diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000000000000000000000000000000000..9088a165761ee325a61054c3d32c17409ddec5ca
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,15 @@
+; http://editorconfig.org/
+
+[*]
+indent_style = space
+indent_size = 4
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[inc/{geshi,phpseclib}/**]
+; Use editor default (possible autodetection).
+indent_style =
+indent_size =
+trim_trailing_whitespace = false
+insert_final_newline = false
diff --git a/.gitattributes b/.gitattributes
index 0fefdf647c38330b535991336ead3ffbd90bac87..1012087d4713eeeed96628ad8638ad419115f81a 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -4,3 +4,11 @@
 *.gif binary
 *.ico binary
 *.xcf binary
+
+.gitattributes export-ignore
+.gitignore export-ignore
+.editorconfig export-ignore
+.travis.yml export-ignore
+_test export-ignore
+_cs export-ignore
+lib/plugins/testing export-ignore
diff --git a/.travis.yml b/.travis.yml
index 93867162cbe8d7db0d9c46c8c2c0a57c0c5fe01d..9c3193d19d149ad11cb108f207fd80ebf676d187 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,13 @@
 language: php
 php:
+  - "5.6"
   - "5.5"
   - "5.4"
   - "5.3"
+# PHP 5.6 is not yet released, allow failures
+matrix:
+  allow_failures:
+    - php: "5.6"
 notifications:
   irc:
     channels:
diff --git a/_test/README b/_test/README
index 5220248b2d5933a5dd7c91818bc87ed6b2a10a72..f0db2a550605910360f7bcf3a7bfb7d7b5e63f2d 100644
--- a/_test/README
+++ b/_test/README
@@ -9,35 +9,28 @@ This is the test suite to automatically test various parts of DokuWiki.
 
 ===== PHPUnit Installation ======
 
-==== via PEAR installer ====
+You can install phpunit through your distribution's package manager or simply
+download the newest phar file into the _test directory:
 
-  pear config-set auto_discover 1
-  pear install pear.phpunit.de/PHPUnit
-
-==== via Composer ====
-
-Include a composer.json file in your project, which can be as minimal as:
-
-<code>
-{
-    "require-dev": {
-        "phpunit/phpunit": "3.7.*"
-    }
-}
-</code>
-
-==== via PHP archive (PHAR) ====
-
-Download http://pear.phpunit.de/get/phpunit.phar and make it executable on your system.
+  cd _test/
+  wget https://phar.phpunit.de/phpunit.phar
 
 
 ===== Running all tests =====
 
-Just change to the ''_test'' directory and run phpunit:
+Just change to the ''_test'' directory and run phpunit (depending on your install
+method):
 
   cd _test/
   phpunit
 
+or
+
+  cd _test/
+  php phpunit.phar
+
+===== Troubleshooting =====
+
 PHPUnit will fail on some systems with a //headers already sent// error.
 This is a known problem with PHPUnit, the error can be avoided by passing the
 '--stderr' flag to phpunit:
@@ -46,8 +39,10 @@ This is a known problem with PHPUnit, the error can be avoided by passing the
 
 On windows you may have to enable OpenSSL support for https tests.
 Some of them point to httpclient_http.tests.php on the failure.
-To enable HTTPS support copy the ''libeay32.dll'' and ''ssleay32.dll'' to your ''windows\system32'' folder
-and add the following line to your php.ini in the extension section:
+To enable HTTPS support copy the ''libeay32.dll'' and ''ssleay32.dll''
+to your ''windows\system32'' folder and add the following line to your php.ini
+in the extension section:
+
 <code ini>
 extension=php_openssl.dll
 </code>
@@ -56,13 +51,13 @@ extension=php_openssl.dll
 
 You can run a single test file by providing it as an argument to phpunit:
 
-  phpunit --stderr tests/inc/common_cleanText.test.php
+  phpunit tests/inc/common_cleanText.test.php
 
 You can also use groups to exclude certain test from running. For example use
 the following command to avoid long running test or tests accessing the
 Internet.
 
-  phpunit --stderr --exclude-group slow,internet
+  phpunit --exclude-group slow,internet
 
 ===== Create new Tests =====
 
@@ -71,23 +66,10 @@ folder. Please respect the folder structure and naming convention. Inside the
 file, implement a class, extending 'DokuWikiTest'. Every method, starting
 with 'test' will be called as a test (e.g. 'testIfThisIsValid');
 
-
 ===== TODO for the test framework =====
 
-  * test cross platform compatibility: especially test windows
-  * update http://www.dokuwiki.org/devel:unittesting
   * optional: add helper methods to TestRequest for easy form submission
     * createForm(), ...
   * check PHP Unit test_helpers https://github.com/sebastianbergmann/php-test-helpers
 
 
-===== Migration Protocol =====
-
-The following tests were not migrated:
-
-  * inc/indexer_idx_indexlengths (fs dependencies)
-  * inc/mail_send (integration test)
-  * inc/parser/parser_formatting
-  * inc/parser/xhtml_htmlphp (runkit)
-  * inc/parser/xhtml_links
-
diff --git a/_test/phpunit.xml b/_test/phpunit.xml
index fc7dd8be04074d31debbb55b6c5d6da9be674dee..25506b1ae3ff9eceffc47a18968dc0935a32dc06 100644
--- a/_test/phpunit.xml
+++ b/_test/phpunit.xml
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <phpunit
     bootstrap="bootstrap.php"
-    convertNoticesToExceptions="false">
+    convertNoticesToExceptions="false"
+    colors="true"
+    stderr="true"
+    >
 
     <testsuites>
         <testsuite name="DokuWiki Tests">
diff --git a/_test/tests/inc/PassHash.test.php b/_test/tests/inc/PassHash.test.php
index b6cb070903861fd7bf0859b24fc939de9c9543ab..1d34aa696804b8100dbdf5e1b38489c993839eb7 100644
--- a/_test/tests/inc/PassHash.test.php
+++ b/_test/tests/inc/PassHash.test.php
@@ -5,7 +5,7 @@
  *
  * most tests are in auth_password.test.php
  */
-class PassHash_test extends PHPUnit_Framework_TestCase {
+class PassHash_test extends DokuWikiTest {
 
     function test_hmac(){
         // known hashes taken from https://code.google.com/p/yii/issues/detail?id=1942
diff --git a/_test/tests/inc/auth_password.test.php b/_test/tests/inc/auth_password.test.php
index 27e03be60a2df0c8a419c82602f022596dc9ca34..07b9f5bb208fe727adaaccd3e8ef4530cb8ec756 100644
--- a/_test/tests/inc/auth_password.test.php
+++ b/_test/tests/inc/auth_password.test.php
@@ -1,6 +1,6 @@
 <?php
 
-class auth_password_test extends PHPUnit_Framework_TestCase {
+class auth_password_test extends DokuWikiTest {
 
     // hashes for the password foo$method, using abcdefgh as salt
     var $passes = array(
diff --git a/_test/tests/inc/cache_use.test.php b/_test/tests/inc/cache_use.test.php
index f5349df1396bbe418065c0babe860901c91902d4..3ea212d50911b0db8a8df4c3f187d88c72e817bf 100644
--- a/_test/tests/inc/cache_use.test.php
+++ b/_test/tests/inc/cache_use.test.php
@@ -10,27 +10,77 @@ class cache_use_test extends DokuWikiTest {
     private $cache;
 
     function setUp() {
-        global $ID;
+        global $ID, $conf;
         parent::setUp();
 
         $ID = 'cached';
         $file = wikiFN($ID);
+        $conf['cachetime'] = 0;  // ensure the value is not -1, which disables caching
 
         saveWikiText($ID, 'Content', 'Created');
-        // set the modification time a second in the past in order to ensure that the cache is newer than the page
-        touch($file, time()-1);
 
-        # Create cache. Note that the metadata cache is used as the xhtml cache triggers metadata rendering
-        $this->cache = new cache_renderer($ID, $file, 'metadata');
+        $this->cache = new cache_renderer($ID, $file, 'xhtml');
         $this->cache->storeCache('Test');
+
+        // set the modification times explicitly (overcome Issue #694)
+        $time = time();
+        touch($file, $time-1);
+        touch($this->cache->cache, $time);
     }
 
     function test_use() {
+        $this->markTestSkipped('Disabled until Ticket #694 has been fixed');
+        return;
+
         $this->assertTrue($this->cache->useCache());
     }
 
-
+    /**
+     * In all the following tests the cache should not be usable
+     * as such, they are meaningless if test_use didn't pass.
+     *
+     * @depends test_use
+     */
     function test_purge() {
-        $this->assertFalse($this->cache->useCache(array('purge' => true)));
+        /* @var Input $INPUT */
+        global $INPUT;
+        $INPUT->set('purge',1);
+
+        $this->assertFalse($this->cache->useCache());
+        $this->assertNotEmpty($this->cache->depends['purge']);
+    }
+
+    /**
+     * @depends test_use
+     */
+    function test_filedependency() {
+        // give the dependent src file the same mtime as the cache
+        touch($this->cache->file, filemtime($this->cache->cache));
+        $this->assertFalse($this->cache->useCache());
+    }
+
+    /**
+     * @depends test_use
+     */
+    function test_age() {
+        // need to age both our source file & the cache
+        $age = 10;
+        $time = time() - $age - 1;  // older than age
+
+        touch($this->cache->file, $time - 1);
+        touch($this->cache->cache, $time);
+
+        $this->assertFalse($this->cache->useCache(array('age' => $age)));
+    }
+
+    /**
+     * @depends test_use
+     */
+    function test_confnocaching() {
+        global $conf;
+        $conf['cachetime'] = -1;   // disables renderer caching
+
+        $this->assertFalse($this->cache->useCache());
+        $this->assertNotEmpty($this->cache->_nocache);
     }
 }
\ No newline at end of file
diff --git a/_test/tests/inc/cli_options.test.php b/_test/tests/inc/cli_options.test.php
new file mode 100644
index 0000000000000000000000000000000000000000..ab03ee29bee2935b40584fb0008a035234f1f64f
--- /dev/null
+++ b/_test/tests/inc/cli_options.test.php
@@ -0,0 +1,56 @@
+<?php
+
+class cli_options extends DokuWikiTest {
+
+    function test_simpleshort() {
+        $options = new DokuCLI_Options();
+        $options->registerOption('exclude', 'exclude files', 'x', 'file');
+
+        $options->args = array('-x', 'foo', 'bang');
+        $options->parseOptions();
+
+        $this->assertEquals('foo', $options->getOpt('exclude'));
+        $this->assertEquals(array('bang'), $options->args);
+        $this->assertFalse($options->getOpt('nothing'));
+    }
+
+    function test_simplelong1() {
+        $options = new DokuCLI_Options();
+        $options->registerOption('exclude', 'exclude files', 'x', 'file');
+
+        $options->args = array('--exclude', 'foo', 'bang');
+        $options->parseOptions();
+
+        $this->assertEquals('foo', $options->getOpt('exclude'));
+        $this->assertEquals(array('bang'), $options->args);
+        $this->assertFalse($options->getOpt('nothing'));
+    }
+
+    function test_simplelong2() {
+        $options = new DokuCLI_Options();
+        $options->registerOption('exclude', 'exclude files', 'x', 'file');
+
+        $options->args = array('--exclude=foo', 'bang');
+        $options->parseOptions();
+
+        $this->assertEquals('foo', $options->getOpt('exclude'));
+        $this->assertEquals(array('bang'), $options->args);
+        $this->assertFalse($options->getOpt('nothing'));
+    }
+
+    function test_complex() {
+        $options = new DokuCLI_Options();
+
+        $options->registerOption('plugins', 'run on plugins only', 'p');
+        $options->registerCommand('status', 'display status info');
+        $options->registerOption('long', 'display long lines', 'l', false, 'status');
+
+        $options->args = array('-p', 'status', '--long', 'foo');
+        $options->parseOptions();
+
+        $this->assertEquals('status', $options->getCmd());
+        $this->assertTrue($options->getOpt('plugins'));
+        $this->assertTrue($options->getOpt('long'));
+        $this->assertEquals(array('foo'), $options->args);
+    }
+}
\ No newline at end of file
diff --git a/_test/tests/inc/init_checkssl.test.php b/_test/tests/inc/init_checkssl.test.php
new file mode 100644
index 0000000000000000000000000000000000000000..c57d3c37e01678b03fdc6eea147fed6aba4dd51f
--- /dev/null
+++ b/_test/tests/inc/init_checkssl.test.php
@@ -0,0 +1,81 @@
+<?php
+
+class init_checkssl_test extends DokuWikiTest {
+
+	/**
+	 * Running behind an SSL proxy, HTTP between server and proxy
+	 * HTTPS not set
+	 * HTTP_X_FORWARDED_PROTO
+	 * set to https
+	 */
+	function test1() {
+		$_SERVER['HTTP_X_FORWARDED_PROTO'] = 'https';
+
+		$this->assertEquals(is_ssl(), true);
+	}
+
+	/**
+	 * Running behind a plain HTTP proxy, HTTP between server and proxy
+	 * HTTPS not set
+	 * HTTP_X_FORWARDED_PROTO set to http
+	 */
+	function test2() {
+		$_SERVER['HTTP_X_FORWARDED_PROTO'] = 'http';
+
+		$this->assertEquals(is_ssl(), false);
+	}
+
+	/**
+	 * Running behind an SSL proxy, HTTP between server and proxy
+	 * HTTPS set to off,
+	 * HTTP_X_FORWARDED_PROTO set to https
+	 */
+	function test3() {
+		$_SERVER['HTTP_X_FORWARDED_PROTO'] = 'https';
+		$_SERVER['HTTPS'] = 'off';
+
+		$this->assertEquals(is_ssl(), true);
+	}
+
+	/**
+	 * Not running behind a proxy, HTTPS server
+	 * HTTPS set to on,
+	 * HTTP_X_FORWARDED_PROTO not set
+	 */
+	function test4() {
+		$_SERVER['HTTPS'] = 'on';
+
+		$this->assertEquals(is_ssl(), true);
+	}
+
+	/**
+	 * Not running behind a proxy, plain HTTP server
+	 * HTTPS not set
+	 * HTTP_X_FORWARDED_PROTO not set
+	 */
+	function test5() {
+		$this->assertEquals(is_ssl(), false);
+	}
+
+	/**
+	 * Not running behind a proxy, plain HTTP server
+	 * HTTPS set to off
+	 * HTTP_X_FORWARDED_PROTO not set
+	 */
+	function test6() {
+		$_SERVER['HTTPS'] = 'off';
+		$this->assertEquals(is_ssl(), false);
+	}
+
+	/**
+	 * Running behind an SSL proxy, SSL between proxy and HTTP server
+	 * HTTPS set to on,
+	 * HTTP_X_FORWARDED_PROTO set to https
+	 */
+	function test7() {
+		$_SERVER['HTTP_X_FORWARDED_PROTO'] = 'https';
+		$_SERVER['HTTPS'] = 'on';
+
+		$this->assertEquals(is_ssl(), true);
+	}
+}
diff --git a/_test/tests/inc/input.test.php b/_test/tests/inc/input.test.php
index 59b5ea4b99df67594ab327d4c4a51db560cb5953..cec0b80f6fa417cbe6e3918479a1d62c0251994a 100644
--- a/_test/tests/inc/input.test.php
+++ b/_test/tests/inc/input.test.php
@@ -214,6 +214,25 @@ class input_test extends DokuWikiTest {
         $this->assertEquals('bla',$test);
     }
 
+    public function test_valid(){
+        $_REQUEST = $this->data;
+        $_POST    = $this->data;
+        $_GET     = $this->data;
+        $INPUT    = new Input();
+
+        $valids = array(17, 'foo');
+        $this->assertSame(null, $INPUT->valid('nope', $valids));
+        $this->assertSame('bang', $INPUT->valid('nope', $valids, 'bang'));
+        $this->assertSame(17, $INPUT->valid('int', $valids));
+        $this->assertSame('foo', $INPUT->valid('string', $valids));
+        $this->assertSame(null, $INPUT->valid('array', $valids));
+
+        $valids = array(true);
+        $this->assertSame(true, $INPUT->valid('string', $valids));
+        $this->assertSame(true, $INPUT->valid('one', $valids));
+        $this->assertSame(null, $INPUT->valid('zero', $valids));
+    }
+
     public function test_extract(){
         $_REQUEST = $this->data;
         $_POST    = $this->data;
diff --git a/_test/tests/inc/io_rmdir.test.php b/_test/tests/inc/io_rmdir.test.php
index 3de57fa8641da7be7acec68531ff5afc82276275..1c0eccb389da5a11e6a3e658704a5302dbef9eb4 100644
--- a/_test/tests/inc/io_rmdir.test.php
+++ b/_test/tests/inc/io_rmdir.test.php
@@ -4,7 +4,7 @@ class io_rmdir_test extends DokuWikiTest {
 
     function test_nopes(){
         // set up test dir
-        $dir = io_mktmpdir();
+        $dir = realpath(io_mktmpdir());
         $top = dirname($dir);
         $this->assertTrue($dir !== false);
         $this->assertTrue(is_dir($dir));
diff --git a/_test/tests/inc/parser/parser.inc.php b/_test/tests/inc/parser/parser.inc.php
index 61f15678bad658fecee6b74b7287335f0056f72f..f1207b11970484a327ec40f10c3517c15bad7c75 100644
--- a/_test/tests/inc/parser/parser.inc.php
+++ b/_test/tests/inc/parser/parser.inc.php
@@ -3,7 +3,7 @@
 require_once DOKU_INC . 'inc/parser/parser.php';
 require_once DOKU_INC . 'inc/parser/handler.php';
 
-abstract class TestOfDoku_Parser extends PHPUnit_Framework_TestCase {
+abstract class TestOfDoku_Parser extends DokuWikiTest {
 
     var $P;
     var $H;
diff --git a/_test/tests/inc/parser/parser_quotes.test.php b/_test/tests/inc/parser/parser_quotes.test.php
index b823282127bffd5c7f342b3b17c3429343c1f76b..6f174ddaeb6653fe605e580334f264218546a137 100644
--- a/_test/tests/inc/parser/parser_quotes.test.php
+++ b/_test/tests/inc/parser/parser_quotes.test.php
@@ -10,8 +10,9 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
     }
 
     function testSingleQuoteOpening() {
+        $raw = "Foo 'hello Bar";
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse("Foo 'hello Bar");
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -23,12 +24,13 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
     function testSingleQuoteOpeningSpecial() {
+        $raw = "Foo said:'hello Bar";
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse("Foo said:'hello Bar");
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -40,12 +42,13 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
     function testSingleQuoteClosing() {
+        $raw = "Foo hello' Bar";
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse("Foo hello' Bar");
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -57,12 +60,13 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
     function testSingleQuoteClosingSpecial() {
+        $raw = "Foo hello') Bar";
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse("Foo hello') Bar");
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -74,12 +78,13 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
     function testSingleQuotes() {
+        $raw = "Foo 'hello' Bar";
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse("Foo 'hello' Bar");
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -93,12 +98,13 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
     function testApostrophe() {
+        $raw = "hey it's fine weather today";
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse("hey it's fine weather today");
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -110,13 +116,14 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
 
     function testSingleQuotesSpecial() {
+        $raw = "Foo ('hello') Bar";
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse("Foo ('hello') Bar");
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -130,12 +137,13 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
     function testDoubleQuoteOpening() {
+        $raw = 'Foo "hello Bar';
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse('Foo "hello Bar');
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -147,12 +155,13 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
     function testDoubleQuoteOpeningSpecial() {
+        $raw = 'Foo said:"hello Bar';
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse('Foo said:"hello Bar');
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -164,12 +173,14 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
     function testDoubleQuoteClosing() {
+        $raw = 'Foo hello" Bar';
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse('Foo hello" Bar');
+        $this->H->status['doublequote'] = 1;
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -181,12 +192,14 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
     function testDoubleQuoteClosingSpecial() {
+        $raw = 'Foo hello") Bar';
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse('Foo hello") Bar');
+        $this->H->status['doublequote'] = 1;
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -198,12 +211,31 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
+    }
+    function testDoubleQuoteClosingSpecial2() {
+        $raw = 'Foo hello") Bar';
+        $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
+        $this->H->status['doublequote'] = 0;
+        $this->P->parse($raw);
+
+        $calls = array (
+            array('document_start',array()),
+            array('p_open',array()),
+            array('cdata',array("\n".'Foo hello')),
+            array('doublequoteopening',array()),
+            array('cdata',array(') Bar')),
+            array('p_close',array()),
+            array('document_end',array()),
+        );
+
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
     function testDoubleQuotes() {
+        $raw = 'Foo "hello" Bar';
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse('Foo "hello" Bar');
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -217,12 +249,13 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
     }
 
     function testDoubleQuotesSpecial() {
+        $raw = 'Foo ("hello") Bar';
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse('Foo ("hello") Bar');
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -236,12 +269,54 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls, 'wikitext => '.$raw);
+    }
+
+    function testDoubleQuotesEnclosingBrackets() {
+        $raw = 'Foo "{hello}" Bar';
+        $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
+        $this->P->parse($raw);
+
+        $calls = array (
+            array('document_start',array()),
+            array('p_open',array()),
+            array('cdata',array("\n".'Foo ')),
+            array('doublequoteopening',array()),
+            array('cdata',array('{hello}')),
+            array('doublequoteclosing',array()),
+            array('cdata',array(' Bar')),
+            array('p_close',array()),
+            array('document_end',array()),
+        );
+
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls,'wikitext - '.$raw);
+    }
+
+    function testDoubleQuotesEnclosingLink() {
+        $raw = 'Foo "[[www.domain.com]]" Bar';
+        $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
+        $this->P->parse($raw);
+
+        $calls = array (
+            array('document_start',array()),
+            array('p_open',array()),
+            array('cdata',array("\n".'Foo ')),
+            array('doublequoteopening',array()),
+            array('cdata',array('[[www.domain.com]]')),
+            array('doublequoteclosing',array()),
+            array('cdata',array(' Bar')),
+            array('p_close',array()),
+            array('document_end',array()),
+        );
+
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls,'wikitext => '.$raw);
     }
 
+
     function testAllQuotes() {
+        $raw = 'There was written "He thought \'It\'s a man\'s world\'".';
         $this->P->addMode('quotes',new Doku_Parser_Mode_Quotes());
-        $this->P->parse('There was written "He thought \'It\'s a man\'s world\'".');
+        $this->P->parse($raw);
 
         $calls = array (
             array('document_start',array()),
@@ -262,7 +337,7 @@ class TestOfDoku_Parser_Quotes extends TestOfDoku_Parser {
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls,'wikitext => '.$raw);
     }
 
 }
diff --git a/_test/tests/inc/parser/parser_table.test.php b/_test/tests/inc/parser/parser_table.test.php
index bc19ebff9ae9ced00576596cb30bea8dee6fa77f..a9b4e284c63f79c314bb5796802873a479334dce 100644
--- a/_test/tests/inc/parser/parser_table.test.php
+++ b/_test/tests/inc/parser/parser_table.test.php
@@ -44,7 +44,7 @@ def');
             array('p_close',array()),
             array('document_end',array()),
         );
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
 
     function testTableWinEOL() {
@@ -84,7 +84,7 @@ def');
             array('p_close',array()),
             array('document_end',array()),
         );
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
 
     function testEmptyTable() {
@@ -109,7 +109,7 @@ def');
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
     
     function testTableHeaders() {
@@ -143,7 +143,152 @@ def');
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
+
+    }
+
+    function testTableHead() {
+        $this->P->addMode('table',new Doku_Parser_Mode_Table());
+        $this->P->parse('
+abc
+^ X ^ Y ^ Z ^
+| x | y | z |
+def');
+
+        $calls = array (
+            array('document_start',array()),
+            array('p_open',array()),
+            array('cdata',array("\n\nabc")),
+            array('p_close',array()),
+            array('table_open',array(3, 2, 6)),
+            array('tablethead_open',array()),
+            array('tablerow_open',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' X ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Y ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Z ')),
+            array('tableheader_close',array()),
+            array('tablerow_close',array()),
+            array('tablethead_close',array()),
+            array('tablerow_open',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' x ')),
+            array('tablecell_close',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' y ')),
+            array('tablecell_close',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' z ')),
+            array('tablecell_close',array()),
+            array('tablerow_close',array()),
+            array('table_close',array(33)),
+            array('p_open',array()),
+            array('cdata',array('def')),
+            array('p_close',array()),
+            array('document_end',array()),
+        );
+
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
+
+    }
+
+    function testTableHeadOneRowTable() {
+        $this->P->addMode('table',new Doku_Parser_Mode_Table());
+        $this->P->parse('
+abc
+^ X ^ Y ^ Z ^
+def');
+
+        $calls = array (
+            array('document_start',array()),
+            array('p_open',array()),
+            array('cdata',array("\n\nabc")),
+            array('p_close',array()),
+            array('table_open',array(3, 1, 6)),
+            array('tablerow_open',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' X ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Y ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Z ')),
+            array('tableheader_close',array()),
+            array('tablerow_close',array()),
+            array('table_close',array(19)),
+            array('p_open',array()),
+            array('cdata',array('def')),
+            array('p_close',array()),
+            array('document_end',array()),
+        );
+
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
+
+    }
+
+    function testTableHeadMultiline() {
+        $this->P->addMode('table',new Doku_Parser_Mode_Table());
+        $this->P->parse('
+abc
+^ X1 ^ Y1 ^ Z1 ^
+^ X2 ^ Y2 ^ Z2 ^
+| A | B | C |
+def');
+
+        $calls = array (
+            array('document_start',array()),
+            array('p_open',array()),
+            array('cdata',array("\n\nabc")),
+            array('p_close',array()),
+            array('table_open',array(3, 3, 6)),
+            array('tablethead_open',array()),
+            array('tablerow_open',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' X1 ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Y1 ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Z1 ')),
+            array('tableheader_close',array()),
+            array('tablerow_close',array()),
+            array('tablerow_open',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' X2 ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Y2 ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Z2 ')),
+            array('tableheader_close',array()),
+            array('tablerow_close',array()),
+            array('tablethead_close',array()),
+            array('tablerow_open',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' A ')),
+            array('tablecell_close',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' B ')),
+            array('tablecell_close',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' C ')),
+            array('tablecell_close',array()),
+            array('tablerow_close',array()),
+            array('table_close',array(53)),
+            array('p_open',array()),
+            array('cdata',array('def')),
+            array('p_close',array()),
+            array('document_end',array()),
+        );
+
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
 
     }
     
@@ -178,7 +323,7 @@ def');
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
     
     function testCellSpan() {
@@ -220,7 +365,7 @@ def');
             array('p_close',array()),
             array('document_end',array()),
         );
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
     
     function testCellRowSpan() {
@@ -268,7 +413,7 @@ def');
             array('p_close',array()),
             array('document_end',array()),
         );
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
 
     function testCellRowSpanFirstRow() {
@@ -326,9 +471,134 @@ def');
             array('p_close',array()),
             array('document_end',array()),
         );
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
     
+    function testRowSpanTableHead() {
+        $this->P->addMode('table',new Doku_Parser_Mode_Table());
+        $this->P->parse('
+abc
+^ X1 ^ Y1 ^ Z1 ^
+^ X2 ^ ::: ^ Z2 ^
+| A3 | B3 | C3 |
+def');
+
+        $calls = array (
+            array('document_start',array()),
+            array('p_open',array()),
+            array('cdata',array("\n\nabc")),
+            array('p_close',array()),
+            array('table_open',array(3, 3, 6)),
+            array('tablethead_open',array()),
+            array('tablerow_open',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' X1 ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,2)),
+            array('cdata',array(' Y1 ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Z1 ')),
+            array('tableheader_close',array()),
+            array('tablerow_close',array()),
+            array('tablerow_open',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' X2 ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Z2 ')),
+            array('tableheader_close',array()),
+            array('tablerow_close',array()),
+            array('tablethead_close',array()),
+            array('tablerow_open',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' A3 ')),
+            array('tablecell_close',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' B3 ')),
+            array('tablecell_close',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' C3 ')),
+            array('tablecell_close',array()),
+            array('tablerow_close',array()),
+            array('table_close',array(57)),
+            array('p_open',array()),
+            array('cdata',array('def')),
+            array('p_close',array()),
+            array('document_end',array()),
+        );
+
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
+
+    }
+
+    function testRowSpanAcrossTableHeadBoundary() {
+        $this->P->addMode('table',new Doku_Parser_Mode_Table());
+        $this->P->parse('
+abc
+^ X1 ^ Y1 ^ Z1 ^
+^ X2 ^ ::: ^ Z2 ^
+| A3 | ::: | C3 |
+| A4 | ::: | C4 |
+def');
+
+        $calls = array (
+            array('document_start',array()),
+            array('p_open',array()),
+            array('cdata',array("\n\nabc")),
+            array('p_close',array()),
+            array('table_open',array(3, 4, 6)),
+            array('tablethead_open',array()),
+            array('tablerow_open',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' X1 ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,2)),
+            array('cdata',array(' Y1 ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Z1 ')),
+            array('tableheader_close',array()),
+            array('tablerow_close',array()),
+            array('tablerow_open',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' X2 ')),
+            array('tableheader_close',array()),
+            array('tableheader_open',array(1,NULL,1)),
+            array('cdata',array(' Z2 ')),
+            array('tableheader_close',array()),
+            array('tablerow_close',array()),
+            array('tablethead_close',array()),
+            array('tablerow_open',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' A3 ')),
+            array('tablecell_close',array()),
+            array('tablecell_open',array(1,NULL,2)),
+            array('cdata',array('')),
+            array('tablecell_close',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' C3 ')),
+            array('tablecell_close',array()),
+            array('tablerow_close',array()),
+            array('tablerow_open',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' A4 ')),
+            array('tablecell_close',array()),
+            array('tablecell_open',array(1,NULL,1)),
+            array('cdata',array(' C4 ')),
+            array('tablecell_close',array()),
+            array('tablerow_close',array()),
+            array('table_close',array(76)),
+            array('p_open',array()),
+            array('cdata',array('def')),
+            array('p_close',array()),
+            array('document_end',array()),
+        );
+
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
+
+    }
+
     function testCellAlignmentFormatting() {
         $this->P->addMode('table',new Doku_Parser_Mode_Table());
         $this->P->addMode('strong',new Doku_Parser_Mode_Formatting('strong'));
@@ -365,7 +635,7 @@ def');
             array('document_end',array()),
         );
  
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
         
     }
     
@@ -411,7 +681,7 @@ def');
             array('p_close',array()),
             array('document_end',array()),
         );
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
     
     // This is really a failing test - formatting able to spread across cols
@@ -466,7 +736,7 @@ def');
             array('p_close',array()),
             array('document_end',array()),
         );
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
     
     // This is really a failing test - unformatted able to spread across cols
@@ -517,7 +787,7 @@ def');
             array('p_close',array()),
             array('document_end',array()),
         );
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
     
     function testTableLinebreak() {
@@ -565,7 +835,7 @@ def');
             array('document_end',array()),
         );
 
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
     
     // This is really a failing test - footnote able to spread across cols
@@ -624,7 +894,7 @@ def');
             array('p_close',array()),
             array('document_end',array()),
         );
-        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+        $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));
     }
 
     function testTable_FS1833() {
@@ -646,4 +916,3 @@ def');
     }
 
 }
-
diff --git a/_test/tests/inc/parser/renderer_resolveinterwiki.test.php b/_test/tests/inc/parser/renderer_resolveinterwiki.test.php
index 7b43b6d627c47f6050eb6da67170d38954e524d9..dd1ed1d3f64f488dbd1913b817d89d1864536940 100644
--- a/_test/tests/inc/parser/renderer_resolveinterwiki.test.php
+++ b/_test/tests/inc/parser/renderer_resolveinterwiki.test.php
@@ -5,7 +5,7 @@ require_once DOKU_INC . 'inc/parser/renderer.php';
 /**
  * Tests for Doku_Renderer::_resolveInterWiki()
  */
-class Test_resolveInterwiki extends PHPUnit_Framework_TestCase {
+class Test_resolveInterwiki extends DokuWikiTest {
 
     function testDefaults() {
         $Renderer = new Doku_Renderer();
diff --git a/_test/tests/inc/parserutils_get_renderer.test.php b/_test/tests/inc/parserutils_get_renderer.test.php
index 69aeb3b194c5f11964d0735a738ebb6725f62b69..0f373227de9934855cba3c78a3de204793fe376c 100644
--- a/_test/tests/inc/parserutils_get_renderer.test.php
+++ b/_test/tests/inc/parserutils_get_renderer.test.php
@@ -45,10 +45,6 @@ class parserutils_get_renderer_test extends DokuWikiTest {
     }
 
     // test fallback fails
-    /**
-     * @expectedException        PHPUnit_Framework_Error
-     * @expectedExceptionCode    E_USER_WARNING
-     */
     function test_p_get_renderer_fallback_fail() {
         global $conf;
 
diff --git a/_test/tests/inc/tar.test.php b/_test/tests/inc/tar.test.php
index 417f1a85384d3b93a745bd49d621c7ff8821a8c3..15453b16db94295bc31b5ff2ba4231b17b478b35 100644
--- a/_test/tests/inc/tar.test.php
+++ b/_test/tests/inc/tar.test.php
@@ -1,6 +1,38 @@
 <?php
 
 class Tar_TestCase extends DokuWikiTest {
+    /**
+     * file extensions that several tests use
+     */
+    protected $extensions = array('tar');
+
+    public function setUp() {
+        parent::setUp();
+        if (extension_loaded('zlib')) {
+            $this->extensions[] = 'tgz';
+        }
+        if (extension_loaded('bz2')) {
+            $this->extensions[] = 'tbz';
+        }
+    }
+
+    /*
+     * dependency for tests needing zlib extension to pass
+     */
+    public function test_ext_zlib() {
+        if (!extension_loaded('zlib')) {
+            $this->markTestSkipped('skipping all zlib tests.  Need zlib extension');
+        }
+    }
+
+    /*
+     * dependency for tests needing zlib extension to pass
+     */
+    public function test_ext_bz2() {
+        if (!extension_loaded('bz2')) {
+            $this->markTestSkipped('skipping all bzip2 tests.  Need bz2 extension');
+        }
+    }
 
     /**
      * simple test that checks that the given filenames and contents can be grepped from
@@ -58,8 +90,6 @@ class Tar_TestCase extends DokuWikiTest {
         $tar->addData('another/testdata3.txt', 'testcontent3');
         $tar->close();
 
-copy ($tmp, '/tmp/test.tar');
-
         $this->assertTrue(filesize($tmp) > 30); //arbitrary non-zero number
         $data = file_get_contents($tmp);
 
@@ -89,7 +119,7 @@ copy ($tmp, '/tmp/test.tar');
     public function test_tarcontent() {
         $dir = dirname(__FILE__).'/tar';
 
-        foreach(array('tar', 'tgz', 'tbz') as $ext) {
+        foreach($this->extensions as $ext) {
             $tar  = new Tar();
             $file = "$dir/test.$ext";
 
@@ -112,7 +142,7 @@ copy ($tmp, '/tmp/test.tar');
         $dir = dirname(__FILE__).'/tar';
         $out = sys_get_temp_dir().'/dwtartest'.md5(time());
 
-        foreach(array('tar', 'tgz', 'tbz') as $ext) {
+        foreach($this->extensions as $ext) {
             $tar  = new Tar();
             $file = "$dir/test.$ext";
 
@@ -138,7 +168,7 @@ copy ($tmp, '/tmp/test.tar');
         $dir = dirname(__FILE__).'/tar';
         $out = sys_get_temp_dir().'/dwtartest'.md5(time());
 
-        foreach(array('tar', 'tgz', 'tbz') as $ext) {
+        foreach($this->extensions as $ext) {
             $tar  = new Tar();
             $file = "$dir/test.$ext";
 
@@ -164,7 +194,7 @@ copy ($tmp, '/tmp/test.tar');
         $dir = dirname(__FILE__).'/tar';
         $out = sys_get_temp_dir().'/dwtartest'.md5(time());
 
-        foreach(array('tar', 'tgz', 'tbz') as $ext) {
+        foreach($this->extensions as $ext) {
             $tar  = new Tar();
             $file = "$dir/test.$ext";
 
@@ -190,7 +220,7 @@ copy ($tmp, '/tmp/test.tar');
         $dir = dirname(__FILE__).'/tar';
         $out = sys_get_temp_dir().'/dwtartest'.md5(time());
 
-        foreach(array('tar', 'tgz', 'tbz') as $ext) {
+        foreach($this->extensions as $ext) {
             $tar  = new Tar();
             $file = "$dir/test.$ext";
 
@@ -215,7 +245,7 @@ copy ($tmp, '/tmp/test.tar');
         $dir = dirname(__FILE__).'/tar';
         $out = sys_get_temp_dir().'/dwtartest'.md5(time());
 
-        foreach(array('tar', 'tgz', 'tbz') as $ext) {
+        foreach($this->extensions as $ext) {
             $tar  = new Tar();
             $file = "$dir/test.$ext";
 
@@ -249,6 +279,9 @@ copy ($tmp, '/tmp/test.tar');
         $this->assertEquals(Tar::COMPRESS_BZIP, $tar->filetype('foo.tar.bz2'));
     }
 
+    /**
+     * @depends test_ext_zlib
+     */
     public function test_longpathextract() {
         $dir = dirname(__FILE__).'/tar';
         $out = sys_get_temp_dir().'/dwtartest'.md5(time());
@@ -338,6 +371,7 @@ copy ($tmp, '/tmp/test.tar');
 
     /**
      * Extract a tarbomomb
+     * @depends test_ext_zlib
      */
     public function test_tarbomb() {
         $dir = dirname(__FILE__).'/tar';
diff --git a/_test/tests/inc/utf8_romanize.test.php b/_test/tests/inc/utf8_romanize.test.php
index d08346faae72e6c15fcbfc3422b112b287830d6c..353d48c00b3d3315498bc1256465c7e8e3ca7011 100644
--- a/_test/tests/inc/utf8_romanize.test.php
+++ b/_test/tests/inc/utf8_romanize.test.php
@@ -5,7 +5,7 @@ if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1);
 /**
  * @group slow
  */
-class utf8_romanize_test extends PHPUnit_Framework_TestCase {
+class utf8_romanize_test extends DokuWikiTest {
 
     /**
      * Check Japanese romanization
diff --git a/_test/tests/lib/exe/css_css_compress.test.php b/_test/tests/lib/exe/css_css_compress.test.php
index f0eb17968be556b12576671af0cfbd6edfd8b0f9..807317ca6c2bb2ca7653d7bca1860cfa74e89f18 100644
--- a/_test/tests/lib/exe/css_css_compress.test.php
+++ b/_test/tests/lib/exe/css_css_compress.test.php
@@ -53,6 +53,21 @@ class css_css_compress_test extends DokuWikiTest {
         $this->assertEquals('#foo{background-image:url(http://foo.bar/baz.jpg);}', css_compress($text));
     }
 
+    function test_slcom6(){
+        $text = '#foo {
+                    background-image: url(//foo.bar/baz.jpg); // background-image: url(http://foo.bar/baz.jpg); this is all commented
+                }';
+        $this->assertEquals('#foo{background-image:url(//foo.bar/baz.jpg);}', css_compress($text));
+    }
+
+    function test_slcom7(){
+        $text = '#foo a[href ^="https://"], #foo a[href ^=\'https://\'] {
+                    background-image: url(//foo.bar/baz.jpg); // background-image: url(http://foo.bar/baz.jpg); this is \'all\' "commented"
+                }';
+        $this->assertEquals('#foo a[href ^="https://"],#foo a[href ^=\'https://\']{background-image:url(//foo.bar/baz.jpg);}', css_compress($text));
+    }
+
+
     function test_hack(){
         $text = '/* Mac IE will not see this and continue with inline-block */
                  /* \\*/
diff --git a/bin/dwpage.php b/bin/dwpage.php
index 96f6d3ef9ecb4102152cce6647dfa32c827ec49b..a777fd3e1798142784c0d9c31c39eb757d804a26 100755
--- a/bin/dwpage.php
+++ b/bin/dwpage.php
@@ -1,378 +1,317 @@
 #!/usr/bin/php
 <?php
-#------------------------------------------------------------------------------
-if ('cli' != php_sapi_name()) die();
-
-ini_set('memory_limit','128M');
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
-require_once DOKU_INC.'inc/init.php';
-require_once DOKU_INC.'inc/common.php';
-require_once DOKU_INC.'inc/cliopts.php';
-
-#------------------------------------------------------------------------------
-function usage($action) {
-    switch ( $action ) {
-        case 'checkout':
-            print "Usage: dwpage.php [opts] checkout <wiki:page> [working_file]
-
-    Checks out a file from the repository, using the wiki id and obtaining
-    a lock for the page.
-    If a working_file is specified, this is where the page is copied to.
-    Otherwise defaults to the same as the wiki page in the current
-    working directory.
-
-    EXAMPLE
-    $ ./dwpage.php checkout wiki:syntax ./new_syntax.txt
-
-    OPTIONS
-        -h, --help=<action>: get help
-        -f: force obtaining a lock for the page (generally bad idea)
-";
-        break;
-        case 'commit':
-            print "Usage: dwpage.php [opts] -m \"Msg\" commit <working_file> <wiki:page>
-
-    Checks in the working_file into the repository using the specified
-    wiki id, archiving the previous version.
-
-    EXAMPLE
-    $ ./dwpage.php -m \"Some message\" commit ./new_syntax.txt wiki:syntax
-
-    OPTIONS
-        -h, --help=<action>: get help
-        -f: force obtaining a lock for the page (generally bad idea)
-        -t, trivial: minor change
-        -m (required): Summary message describing the change
-";
-        break;
-        case 'lock':
-            print "Usage: dwpage.php [opts] lock <wiki:page>
-
-    Obtains or updates a lock for a wiki page
-
-    EXAMPLE
-    $ ./dwpage.php lock wiki:syntax
-
-    OPTIONS
-        -h, --help=<action>: get help
-        -f: force obtaining a lock for the page (generally bad idea)
-";
-        break;
-        case 'unlock':
-            print "Usage: dwpage.php [opts] unlock <wiki:page>
-
-    Removes a lock for a wiki page.
-
-    EXAMPLE
-    $ ./dwpage.php unlock wiki:syntax
-
-    OPTIONS
-        -h, --help=<action>: get help
-        -f: force obtaining a lock for the page (generally bad idea)
-";
-        break;
-        default:
-            print "Usage: dwpage.php [opts] <action>
-
-    Utility to help command line Dokuwiki page editing, allow
-    pages to be checked out for editing then committed after changes
-
-    Normal operation would be;
-
-
-
-    ACTIONS
-        checkout: see $ dwpage.php --help=checkout
-        commit: see $ dwpage.php --help=commit
-        lock: see $ dwpage.php --help=lock
-
-    OPTIONS
-        -h, --help=<action>: get help
-            e.g. $ ./dwpage.php -hcommit
-            e.g. $ ./dwpage.php --help=commit
-";
-        break;
+if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
+define('NOSESSION', 1);
+require_once(DOKU_INC.'inc/init.php');
+
+/**
+ * Checkout and commit pages from the command line while maintaining the history
+ */
+class PageCLI extends DokuCLI {
+
+    protected $force = false;
+    protected $username = '';
+
+    /**
+     * Register options and arguments on the given $options object
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    protected function setup(DokuCLI_Options $options) {
+        /* global */
+        $options->registerOption(
+            'force',
+            'force obtaining a lock for the page (generally bad idea)',
+            'f'
+        );
+        $options->registerOption(
+            'user',
+            'work as this user. defaults to current CLI user',
+            'u'
+        );
+        $options->setHelp(
+            'Utility to help command line Dokuwiki page editing, allow '.
+            'pages to be checked out for editing then committed after changes'
+        );
+
+        /* checkout command */
+        $options->registerCommand(
+            'checkout',
+            'Checks out a file from the repository, using the wiki id and obtaining '.
+            'a lock for the page. '."\n".
+            'If a working_file is specified, this is where the page is copied to. '.
+            'Otherwise defaults to the same as the wiki page in the current '.
+            'working directory.'
+        );
+        $options->registerArgument(
+            'wikipage',
+            'The wiki page to checkout',
+            true,
+            'checkout'
+        );
+        $options->registerArgument(
+            'workingfile',
+            'How to name the local checkout',
+            false,
+            'checkout'
+        );
+
+        /* commit command */
+        $options->registerCommand(
+            'commit',
+            'Checks in the working_file into the repository using the specified '.
+            'wiki id, archiving the previous version.'
+        );
+        $options->registerArgument(
+            'workingfile',
+            'The local file to commit',
+            true,
+            'commit'
+        );
+        $options->registerArgument(
+            'wikipage',
+            'The wiki page to create or update',
+            true,
+            'commit'
+        );
+        $options->registerOption(
+            'message',
+            'Summary describing the change (required)',
+            'm',
+            'summary',
+            'commit'
+        );
+        $options->registerOption(
+            'trivial',
+            'minor change',
+            't',
+            false,
+            'commit'
+        );
+
+        /* lock command */
+        $options->registerCommand(
+            'lock',
+            'Obtains or updates a lock for a wiki page'
+        );
+        $options->registerArgument(
+            'wikipage',
+            'The wiki page to lock',
+            true,
+            'lock'
+        );
+
+        /* unlock command */
+        $options->registerCommand(
+            'unlock',
+            'Removes a lock for a wiki page.'
+        );
+        $options->registerArgument(
+            'wikipage',
+            'The wiki page to unlock',
+            true,
+            'unlock'
+        );
     }
-}
-
-#------------------------------------------------------------------------------
-function getUser() {
-    $user = getenv('USER');
-    if (empty ($user)) {
-        $user = getenv('USERNAME');
-    } else {
-        return $user;
-    }
-    if (empty ($user)) {
-        $user = 'admin';
-    }
-    return $user;
-}
-
-#------------------------------------------------------------------------------
-function getSuppliedArgument($OPTS, $short, $long) {
-    $arg = $OPTS->get($short);
-    if ( is_null($arg) ) {
-        $arg = $OPTS->get($long);
-    }
-    return $arg;
-}
-
-#------------------------------------------------------------------------------
-function obtainLock($WIKI_ID) {
-
-    global $USERNAME;
-
-    if ( !file_exists(wikiFN($WIKI_ID)) ) {
-        fwrite( STDERR, "$WIKI_ID does not yet exist\n");
-    }
-
-    $_SERVER['REMOTE_USER'] = $USERNAME;
-    if ( checklock($WIKI_ID) ) {
-        fwrite( STDERR, "Page $WIKI_ID is already locked by another user\n");
-        exit(1);
-    }
-
-    lock($WIKI_ID);
-
-    $_SERVER['REMOTE_USER'] = '_'.$USERNAME.'_';
-
-    if ( checklock($WIKI_ID) != $USERNAME ) {
-
-        fwrite( STDERR, "Unable to obtain lock for $WIKI_ID\n" );
-        exit(1);
-
-    }
-}
-
-#------------------------------------------------------------------------------
-function clearLock($WIKI_ID) {
-
-    global $USERNAME ;
 
-    if ( !file_exists(wikiFN($WIKI_ID)) ) {
-        fwrite( STDERR, "$WIKI_ID does not yet exist\n");
-    }
-
-    $_SERVER['REMOTE_USER'] = $USERNAME;
-    if ( checklock($WIKI_ID) ) {
-        fwrite( STDERR, "Page $WIKI_ID is locked by another user\n");
-        exit(1);
-    }
-
-    unlock($WIKI_ID);
-
-    if ( file_exists(wikiLockFN($WIKI_ID)) ) {
-        fwrite( STDERR, "Unable to clear lock for $WIKI_ID\n" );
-        exit(1);
-    }
-
-}
-
-#------------------------------------------------------------------------------
-function deleteLock($WIKI_ID) {
-
-    $wikiLockFN = wikiLockFN($WIKI_ID);
-
-    if ( file_exists($wikiLockFN) ) {
-        if ( !unlink($wikiLockFN) ) {
-            fwrite( STDERR, "Unable to delete $wikiLockFN\n" );
-            exit(1);
+    /**
+     * Your main program
+     *
+     * Arguments and options have been parsed when this is run
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    protected function main(DokuCLI_Options $options) {
+        $this->force    = $options->getOpt('force', false);
+        $this->username = $options->getOpt('user', $this->getUser());
+
+        $command = $options->getCmd();
+        switch($command) {
+            case 'checkout':
+                $wiki_id   = array_shift($options->args);
+                $localfile = array_shift($options->args);
+                $this->commandCheckout($wiki_id, $localfile);
+                break;
+            case 'commit':
+                $localfile = array_shift($options->args);
+                $wiki_id   = array_shift($options->args);
+                $this->commandCommit(
+                    $localfile,
+                    $wiki_id,
+                    $options->getOpt('message', ''),
+                    $options->getOpt('trivial', false)
+                );
+                break;
+            case 'lock':
+                $wiki_id = array_shift($options->args);
+                $this->obtainLock($wiki_id);
+                $this->success("$wiki_id locked");
+                break;
+            case 'unlock':
+                $wiki_id = array_shift($options->args);
+                $this->clearLock($wiki_id);
+                $this->success("$wiki_id unlocked");
+                break;
+            default:
+                echo $options->help();
         }
     }
 
-}
-
-#------------------------------------------------------------------------------
-$USERNAME = getUser();
-$CWD = getcwd();
-$SYSTEM_ID = '127.0.0.1';
-
-#------------------------------------------------------------------------------
-$OPTS = Doku_Cli_Opts::getOptions(
-    __FILE__,
-    'h::fm:u:s:t',
-    array(
-        'help==',
-        'user=',
-        'system=',
-        'trivial',
-        )
-);
-
-if ( $OPTS->isError() ) {
-    print $OPTS->getMessage()."\n";
-    exit(1);
-}
-
-if ( $OPTS->has('h') or $OPTS->has('help') or !$OPTS->hasArgs() ) {
-    usage(getSuppliedArgument($OPTS,'h','help'));
-    exit(0);
-}
-
-if ( $OPTS->has('u') or $OPTS->has('user') ) {
-    $USERNAME = getSuppliedArgument($OPTS,'u','user');
-}
-
-if ( $OPTS->has('s') or $OPTS->has('system') ) {
-    $SYSTEM_ID = getSuppliedArgument($OPTS,'s','system');
-}
+    /**
+     * Check out a file
+     *
+     * @param string $wiki_id
+     * @param string $localfile
+     */
+    protected function commandCheckout($wiki_id, $localfile) {
+        global $conf;
 
-#------------------------------------------------------------------------------
-switch ( $OPTS->arg(0) ) {
+        $wiki_id = cleanID($wiki_id);
+        $wiki_fn = wikiFN($wiki_id);
 
-    #----------------------------------------------------------------------
-    case 'checkout':
-
-        $WIKI_ID = $OPTS->arg(1);
-
-        if ( !$WIKI_ID ) {
-            fwrite( STDERR, "Wiki page ID required\n");
-            exit(1);
+        if(!file_exists($wiki_fn)) {
+            $this->fatal("$wiki_id does not yet exist");
         }
 
-        $WIKI_FN = wikiFN($WIKI_ID);
-
-        if ( !file_exists($WIKI_FN) ) {
-            fwrite( STDERR, "$WIKI_ID does not yet exist\n");
-            exit(1);
+        if(empty($localfile)) {
+            $localfile = getcwd().'/'.utf8_basename($wiki_fn);
         }
 
-        $TARGET_FN = $OPTS->arg(2);
-
-        if ( empty($TARGET_FN) ) {
-            $TARGET_FN = getcwd().'/'.utf8_basename($WIKI_FN);
+        if(!file_exists(dirname($localfile))) {
+            $this->fatal("Directory ".dirname($localfile)." does not exist");
         }
 
-        if ( !file_exists(dirname($TARGET_FN)) ) {
-            fwrite( STDERR, "Directory ".dirname($TARGET_FN)." does not exist\n");
-            exit(1);
+        if(stristr(realpath(dirname($localfile)), realpath($conf['datadir'])) !== false) {
+            $this->fatal("Attempt to check out file into data directory - not allowed");
         }
 
-        if ( stristr( realpath(dirname($TARGET_FN)), realpath($conf['datadir']) ) !== false ) {
-            fwrite( STDERR, "Attempt to check out file into data directory - not allowed\n");
-            exit(1);
-        }
+        $this->obtainLock($wiki_id);
 
-        if ( $OPTS->has('f') ) {
-            deleteLock($WIKI_ID);
+        if(!copy($wiki_fn, $localfile)) {
+            $this->clearLock($wiki_id);
+            $this->fatal("Unable to copy $wiki_fn to $localfile");
         }
 
-        obtainLock($WIKI_ID);
+        $this->success("$wiki_id > $localfile");
+    }
 
-        # Need to lock the file first?
-        if ( !copy($WIKI_FN, $TARGET_FN) ) {
-            fwrite( STDERR, "Unable to copy $WIKI_FN to $TARGET_FN\n");
-            clearLock($WIKI_ID);
-            exit(1);
+    /**
+     * Save a file as a new page revision
+     *
+     * @param string $localfile
+     * @param string $wiki_id
+     * @param string $message
+     * @param bool   $minor
+     */
+    protected function commandCommit($localfile, $wiki_id, $message, $minor) {
+        $wiki_id = cleanID($wiki_id);
+        $message = trim($message);
+
+        if(!file_exists($localfile)) {
+            $this->fatal("$localfile does not exist");
         }
 
-        print "$WIKI_ID > $TARGET_FN\n";
-        exit(0);
+        if(!is_readable($localfile)) {
+            $this->fatal("Cannot read from $localfile");
+        }
 
-    break;
+        if(!$message) {
+            $this->fatal("Summary message required");
+        }
 
-    #----------------------------------------------------------------------
-    case 'commit':
+        $this->obtainLock($wiki_id);
 
-        $TARGET_FN = $OPTS->arg(1);
+        saveWikiText($wiki_id, file_get_contents($localfile), $message, $minor);
 
-        if ( !$TARGET_FN ) {
-            fwrite( STDERR, "Target filename required\n");
-            exit(1);
-        }
+        $this->clearLock($wiki_id);
 
-        if ( !file_exists($TARGET_FN) ) {
-            fwrite( STDERR, "$TARGET_FN does not exist\n");
-            exit(1);
-        }
+        $this->success("$localfile > $wiki_id");
+    }
 
-        if ( !is_readable($TARGET_FN) ) {
-            fwrite( STDERR, "Cannot read from $TARGET_FN\n");
+    /**
+     * Lock the given page or exit
+     *
+     * @param string $wiki_id
+     */
+    protected function obtainLock($wiki_id) {
+        if($this->force) $this->deleteLock($wiki_id);
+
+        $_SERVER['REMOTE_USER'] = $this->username;
+        if(checklock($wiki_id)) {
+            $this->error("Page $wiki_id is already locked by another user");
             exit(1);
         }
 
-        $WIKI_ID = $OPTS->arg(2);
+        lock($wiki_id);
 
-        if ( !$WIKI_ID ) {
-            fwrite( STDERR, "Wiki page ID required\n");
+        $_SERVER['REMOTE_USER'] = '_'.$this->username.'_';
+        if(checklock($wiki_id) != $this->username) {
+            $this->error("Unable to obtain lock for $wiki_id ");
+            var_dump(checklock($wiki_id));
             exit(1);
         }
+    }
 
-        if ( !$OPTS->has('m') ) {
-            fwrite( STDERR, "Summary message required\n");
+    /**
+     * Clear the lock on the given page
+     *
+     * @param string $wiki_id
+     */
+    protected function clearLock($wiki_id) {
+        if($this->force) $this->deleteLock($wiki_id);
+
+        $_SERVER['REMOTE_USER'] = $this->username;
+        if(checklock($wiki_id)) {
+            $this->error("Page $wiki_id is locked by another user");
             exit(1);
         }
 
-        if ( $OPTS->has('f') ) {
-            deleteLock($WIKI_ID);
-        }
+        unlock($wiki_id);
 
-        $_SERVER['REMOTE_USER'] = $USERNAME;
-        if ( checklock($WIKI_ID) ) {
-            fwrite( STDERR, "$WIKI_ID is locked by another user\n");
+        if(file_exists(wikiLockFN($wiki_id))) {
+            $this->error("Unable to clear lock for $wiki_id");
             exit(1);
         }
+    }
 
-        obtainLock($WIKI_ID);
-
-        saveWikiText($WIKI_ID, file_get_contents($TARGET_FN), $OPTS->get('m'), $OPTS->has('t'));
-
-        clearLock($WIKI_ID);
-
-        exit(0);
-
-    break;
-
-    #----------------------------------------------------------------------
-    case 'lock':
-
-        $WIKI_ID = $OPTS->arg(1);
-
-        if ( !$WIKI_ID ) {
-            fwrite( STDERR, "Wiki page ID required\n");
-            exit(1);
-        }
-
-        if ( $OPTS->has('f') ) {
-            deleteLock($WIKI_ID);
-        }
-
-        obtainLock($WIKI_ID);
-
-        print "Locked : $WIKI_ID\n";
-        exit(0);
-
-    break;
-
-    #----------------------------------------------------------------------
-    case 'unlock':
-
-        $WIKI_ID = $OPTS->arg(1);
-
-        if ( !$WIKI_ID ) {
-            fwrite( STDERR, "Wiki page ID required\n");
-            exit(1);
+    /**
+     * Forcefully remove a lock on the page given
+     *
+     * @param string $wiki_id
+     */
+    protected function deleteLock($wiki_id) {
+        $wikiLockFN = wikiLockFN($wiki_id);
+
+        if(file_exists($wikiLockFN)) {
+            if(!unlink($wikiLockFN)) {
+                $this->error("Unable to delete $wikiLockFN");
+                exit(1);
+            }
         }
+    }
 
-        if ( $OPTS->has('f') ) {
-            deleteLock($WIKI_ID);
+    /**
+     * Get the current user's username from the environment
+     *
+     * @return string
+     */
+    protected function getUser() {
+        $user = getenv('USER');
+        if(empty ($user)) {
+            $user = getenv('USERNAME');
         } else {
-            clearLock($WIKI_ID);
+            return $user;
         }
-
-        print "Unlocked : $WIKI_ID\n";
-        exit(0);
-
-    break;
-
-    #----------------------------------------------------------------------
-    default:
-
-        fwrite( STDERR, "Invalid action ".$OPTS->arg(0)."\n" );
-        exit(1);
-
-    break;
-
+        if(empty ($user)) {
+            $user = 'admin';
+        }
+        return $user;
+    }
 }
 
+
+// Main
+$cli = new PageCLI();
+$cli->run();
\ No newline at end of file
diff --git a/bin/gittool.php b/bin/gittool.php
index f9f68ac944e4ae33016752f7b2dcd9bbf06a36f0..6944dde57c1ee70aab66762c80621538c41c4698 100755
--- a/bin/gittool.php
+++ b/bin/gittool.php
@@ -1,78 +1,101 @@
 #!/usr/bin/php
 <?php
-
-if('cli' != php_sapi_name()) die();
-ini_set('memory_limit', '128M');
 if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
 define('NOSESSION', 1);
 require_once(DOKU_INC.'inc/init.php');
 
-$GitToolCLI = new GitToolCLI();
-
-array_shift($argv);
-$command = array_shift($argv);
-
-switch($command) {
-    case '':
-    case 'help':
-        $GitToolCLI->cmd_help();
-        break;
-    case 'clone':
-        $GitToolCLI->cmd_clone($argv);
-        break;
-    case 'install':
-        $GitToolCLI->cmd_install($argv);
-        break;
-    case 'repo':
-    case 'repos':
-        $GitToolCLI->cmd_repos();
-        break;
-    default:
-        $GitToolCLI->cmd_git($command, $argv);
-}
-
 /**
  * Easily manage DokuWiki git repositories
  *
  * @author Andreas Gohr <andi@splitbrain.org>
  */
-class GitToolCLI {
-    private $color = true;
-
-    public function cmd_help() {
-        echo <<<EOF
-Usage: gittool.php <command> [parameters]
-
-Manage git repositories for DokuWiki and its plugins and templates.
+class GitToolCLI extends DokuCLI {
 
-EXAMPLE
-
-$> ./bin/gittool.php clone gallery template:ach
-$> ./bin/gittool.php repos
-$> ./bin/gittool.php origin -v
-
-COMMANDS
+    /**
+     * Register options and arguments on the given $options object
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    protected function setup(DokuCLI_Options $options) {
+        $options->setHelp(
+            "Manage git repositories for DokuWiki and its plugins and templates.\n\n".
+            "$> ./bin/gittool.php clone gallery template:ach\n".
+            "$> ./bin/gittool.php repos\n".
+            "$> ./bin/gittool.php origin -v"
+        );
 
-help
-    This help screen
+        $options->registerArgument(
+            'command',
+            'Command to execute. See below',
+            true
+        );
 
-clone <extensions>
-    Tries to install a known plugin or template (prefix with template:) via
-    git. Uses the DokuWiki.org plugin repository to find the proper git
-    repository. Multiple extensions can be given as parameters
+        $options->registerCommand(
+            'clone',
+            'Tries to install a known plugin or template (prefix with template:) via git. Uses the DokuWiki.org '.
+            'plugin repository to find the proper git repository. Multiple extensions can be given as parameters'
+        );
+        $options->registerArgument(
+            'extension',
+            'name of the extension to install, prefix with \'template:\' for templates',
+            true,
+            'clone'
+        );
 
-install <extensions>
-    The same as clone, but when no git source repository can be found, the
-    extension is installed via download
+        $options->registerCommand(
+            'install',
+            'The same as clone, but when no git source repository can be found, the extension is installed via '.
+            'download'
+        );
+        $options->registerArgument(
+            'extension',
+            'name of the extension to install, prefix with \'template:\' for templates',
+            true,
+            'install'
+        );
 
-repos
-    Lists all git repositories found in this DokuWiki installation
+        $options->registerCommand(
+            'repos',
+            'Lists all git repositories found in this DokuWiki installation'
+        );
 
-<any>
-    Any unknown commands are assumed to be arguments to git and will be
-    executed in all repositories found within this DokuWiki installation
+        $options->registerCommand(
+            '*',
+            'Any unknown commands are assumed to be arguments to git and will be executed in all repositories '.
+            'found within this DokuWiki installation'
+        );
+    }
 
-EOF;
+    /**
+     * Your main program
+     *
+     * Arguments and options have been parsed when this is run
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    protected function main(DokuCLI_Options $options) {
+        $command = $options->getCmd();
+        if(!$command) $command = array_shift($options->args);
+
+        switch($command) {
+            case '':
+                echo $options->help();
+                break;
+            case 'clone':
+                $this->cmd_clone($options->args);
+                break;
+            case 'install':
+                $this->cmd_install($options->args);
+                break;
+            case 'repo':
+            case 'repos':
+                $this->cmd_repos();
+                break;
+            default:
+                $this->cmd_git($command, $options->args);
+        }
     }
 
     /**
@@ -88,7 +111,7 @@ EOF;
             $repo = $this->getSourceRepo($ext);
 
             if(!$repo) {
-                $this->msg_error("could not find a repository for $ext");
+                $this->error("could not find a repository for $ext");
                 $errors[] = $ext;
             } else {
                 if($this->cloneExtension($ext, $repo)) {
@@ -100,8 +123,8 @@ EOF;
         }
 
         echo "\n";
-        if($succeeded) $this->msg_success('successfully cloned the following extensions: '.join(', ', $succeeded));
-        if($errors) $this->msg_error('failed to clone the following extensions: '.join(', ', $errors));
+        if($succeeded) $this->success('successfully cloned the following extensions: '.join(', ', $succeeded));
+        if($errors) $this->error('failed to clone the following extensions: '.join(', ', $errors));
     }
 
     /**
@@ -117,7 +140,7 @@ EOF;
             $repo = $this->getSourceRepo($ext);
 
             if(!$repo) {
-                $this->msg_info("could not find a repository for $ext");
+                $this->info("could not find a repository for $ext");
                 if($this->downloadExtension($ext)) {
                     $succeeded[] = $ext;
                 } else {
@@ -133,8 +156,8 @@ EOF;
         }
 
         echo "\n";
-        if($succeeded) $this->msg_success('successfully installed the following extensions: '.join(', ', $succeeded));
-        if($errors) $this->msg_error('failed to install the following extensions: '.join(', ', $errors));
+        if($succeeded) $this->success('successfully installed the following extensions: '.join(', ', $succeeded));
+        if($errors) $this->error('failed to install the following extensions: '.join(', ', $errors));
     }
 
     /**
@@ -152,19 +175,19 @@ EOF;
 
         foreach($repos as $repo) {
             if(!@chdir($repo)) {
-                $this->msg_error("Could not change into $repo");
+                $this->error("Could not change into $repo");
                 continue;
             }
 
             echo "\n";
-            $this->msg_info("executing $shell in $repo");
+            $this->info("executing $shell in $repo");
             $ret = 0;
             system($shell, $ret);
 
             if($ret == 0) {
-                $this->msg_success("git succeeded in $repo");
+                $this->success("git succeeded in $repo");
             } else {
-                $this->msg_error("git failed in $repo");
+                $this->error("git failed in $repo");
             }
         }
     }
@@ -193,23 +216,23 @@ EOF;
 
         $url = $plugin->getDownloadURL();
         if(!$url) {
-            $this->msg_error("no download URL for $ext");
+            $this->error("no download URL for $ext");
             return false;
         }
 
         $ok = false;
         try {
-            $this->msg_info("installing $ext via download from $url");
+            $this->info("installing $ext via download from $url");
             $ok = $plugin->installFromURL($url);
         } catch(Exception $e) {
-            $this->msg_error($e->getMessage());
+            $this->error($e->getMessage());
         }
 
         if($ok) {
-            $this->msg_success("installed $ext via download");
+            $this->success("installed $ext via download");
             return true;
         } else {
-            $this->msg_success("failed to install $ext via download");
+            $this->success("failed to install $ext via download");
             return false;
         }
     }
@@ -228,14 +251,14 @@ EOF;
             $target = DOKU_PLUGIN.$ext;
         }
 
-        $this->msg_info("cloning $ext from $repo to $target");
+        $this->info("cloning $ext from $repo to $target");
         $ret = 0;
         system("git clone $repo $target", $ret);
         if($ret === 0) {
-            $this->msg_success("cloning of $ext succeeded");
+            $this->success("cloning of $ext succeeded");
             return true;
         } else {
-            $this->msg_error("cloning of $ext failed");
+            $this->error("cloning of $ext failed");
             return false;
         }
     }
@@ -248,7 +271,7 @@ EOF;
      * @return array
      */
     private function findRepos() {
-        $this->msg_info('Looking for .git directories');
+        $this->info('Looking for .git directories');
         $data = array_merge(
             glob(DOKU_INC.'.git', GLOB_ONLYDIR),
             glob(DOKU_PLUGIN.'*/.git', GLOB_ONLYDIR),
@@ -256,9 +279,9 @@ EOF;
         );
 
         if(!$data) {
-            $this->msg_error('Found no .git directories');
+            $this->error('Found no .git directories');
         } else {
-            $this->msg_success('Found '.count($data).' .git directories');
+            $this->success('Found '.count($data).' .git directories');
         }
         $data = array_map('fullpath', array_map('dirname', $data));
         return $data;
@@ -304,37 +327,8 @@ EOF;
 
         return false;
     }
+}
 
-    /**
-     * Print an error message
-     *
-     * @param $string
-     */
-    private function msg_error($string) {
-        if($this->color) echo "\033[31m"; // red
-        echo "E: $string\n";
-        if($this->color) echo "\033[37m"; // reset
-    }
-
-    /**
-     * Print a success message
-     *
-     * @param $string
-     */
-    private function msg_success($string) {
-        if($this->color) echo "\033[32m"; // green
-        echo "S: $string\n";
-        if($this->color) echo "\033[37m"; // reset
-    }
-
-    /**
-     * Print an info message
-     *
-     * @param $string
-     */
-    private function msg_info($string) {
-        if($this->color) echo "\033[36m"; // cyan
-        echo "I: $string\n";
-        if($this->color) echo "\033[37m"; // reset
-    }
-}
\ No newline at end of file
+// Main
+$cli = new GitToolCLI();
+$cli->run();
\ No newline at end of file
diff --git a/bin/indexer.php b/bin/indexer.php
index 6f6b5d9fa53997d3d90656bbbc4dc5ef9de9b369..13895c36a507e9b73930f1e2f023b186d3abd668 100755
--- a/bin/indexer.php
+++ b/bin/indexer.php
@@ -1,98 +1,103 @@
 #!/usr/bin/php
 <?php
-if ('cli' != php_sapi_name()) die();
-
-ini_set('memory_limit','128M');
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
+if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
+define('NOSESSION', 1);
 require_once(DOKU_INC.'inc/init.php');
-require_once(DOKU_INC.'inc/cliopts.php');
-session_write_close();
 
-// handle options
-$short_opts = 'hcuq';
-$long_opts  = array('help', 'clear', 'update', 'quiet');
-$OPTS = Doku_Cli_Opts::getOptions(__FILE__,$short_opts,$long_opts);
-if ( $OPTS->isError() ) {
-    fwrite( STDERR, $OPTS->getMessage() . "\n");
-    _usage();
-    exit(1);
-}
-$CLEAR = false;
-$QUIET = false;
-$INDEXER = null;
-foreach ($OPTS->options as $key => $val) {
-    switch ($key) {
-        case 'h':
-        case 'help':
-            _usage();
-            exit;
-        case 'c':
-        case 'clear':
-            $CLEAR = true;
-            break;
-        case 'q':
-        case 'quiet':
-            $QUIET = true;
-            break;
+/**
+ * Update the Search Index from command line
+ */
+class IndexerCLI extends DokuCLI {
+
+    private $quiet = false;
+    private $clear = false;
+
+    /**
+     * Register options and arguments on the given $options object
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    protected function setup(DokuCLI_Options $options) {
+        $options->setHelp(
+            'Updates the searchindex by indexing all new or changed pages. When the -c option is '.
+            'given the index is cleared first.'
+        );
+
+        $options->registerOption(
+            'clear',
+            'clear the index before updating',
+            'c'
+        );
+        $options->registerOption(
+            'quiet',
+            'don\'t produce any output',
+            'q'
+        );
     }
-}
-
-#------------------------------------------------------------------------------
-# Action
-
-if($CLEAR) _clearindex();
-_update();
-
-
-
-#------------------------------------------------------------------------------
-
-function _usage() {
-    print "Usage: indexer.php <options>
-
-    Updates the searchindex by indexing all new or changed pages
-    when the -c option is given the index is cleared first.
 
-    OPTIONS
-        -h, --help     show this help and exit
-        -c, --clear    clear the index before updating
-        -q, --quiet    don't produce any output
-";
-}
-
-function _update(){
-    global $conf;
-    $data = array();
-    _quietecho("Searching pages... ");
-    search($data,$conf['datadir'],'search_allpages',array('skipacl' => true));
-    _quietecho(count($data)." pages found.\n");
-
-    foreach($data as $val){
-        _index($val['id']);
+    /**
+     * Your main program
+     *
+     * Arguments and options have been parsed when this is run
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    protected function main(DokuCLI_Options $options) {
+        $this->clear = $options->getOpt('clear');
+        $this->quiet = $options->getOpt('quiet');
+
+        if($this->clear) $this->clearindex();
+
+        $this->update();
     }
-}
 
-function _index($id){
-    global $CLEAR;
-    global $QUIET;
+    /**
+     * Update the index
+     */
+    function update() {
+        global $conf;
+        $data = array();
+        $this->quietecho("Searching pages... ");
+        search($data, $conf['datadir'], 'search_allpages', array('skipacl' => true));
+        $this->quietecho(count($data)." pages found.\n");
+
+        foreach($data as $val) {
+            $this->index($val['id']);
+        }
+    }
 
-    _quietecho("$id... ");
-    idx_addPage($id, !$QUIET, $CLEAR);
-    _quietecho("done.\n");
-}
+    /**
+     * Index the given page
+     *
+     * @param string $id
+     */
+    function index($id) {
+        $this->quietecho("$id... ");
+        idx_addPage($id, !$this->quiet, $this->clear);
+        $this->quietecho("done.\n");
+    }
 
-/**
- * Clear all index files
- */
-function _clearindex(){
-    _quietecho("Clearing index... ");
-    idx_get_indexer()->clear();
-    _quietecho("done.\n");
-}
+    /**
+     * Clear all index files
+     */
+    function clearindex() {
+        $this->quietecho("Clearing index... ");
+        idx_get_indexer()->clear();
+        $this->quietecho("done.\n");
+    }
 
-function _quietecho($msg) {
-    global $QUIET;
-    if(!$QUIET) echo $msg;
+    /**
+     * Print message if not supressed
+     *
+     * @param string $msg
+     */
+    function quietecho($msg) {
+        if(!$this->quiet) echo $msg;
+    }
 }
 
-//Setup VIM: ex: et ts=2 :
+// Main
+$cli = new IndexerCLI();
+$cli->run();
\ No newline at end of file
diff --git a/bin/render.php b/bin/render.php
index d30ef295874d833d8e3de5124af1b9a58a971614..672993223466ba266dd8965761849b2c9163a21a 100755
--- a/bin/render.php
+++ b/bin/render.php
@@ -1,5 +1,10 @@
 #!/usr/bin/php
 <?php
+if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
+define('NOSESSION', 1);
+require_once(DOKU_INC.'inc/init.php');
+
+
 /**
  * A simple commandline tool to render some DokuWiki syntax with a given
  * renderer.
@@ -9,59 +14,48 @@
  * DokuWiki markup
  *
  * @license GPL2
- * @author Andreas Gohr <andi@splitbrain.org>
+ * @author  Andreas Gohr <andi@splitbrain.org>
  */
-if ('cli' != php_sapi_name()) die();
+class RenderCLI extends DokuCLI {
 
-ini_set('memory_limit','128M');
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
-define('NOSESSION',1);
-require_once(DOKU_INC.'inc/init.php');
-require_once(DOKU_INC.'inc/common.php');
-require_once(DOKU_INC.'inc/parserutils.php');
-require_once(DOKU_INC.'inc/cliopts.php');
-
-// handle options
-$short_opts = 'hr:';
-$long_opts  = array('help','renderer:');
-$OPTS = Doku_Cli_Opts::getOptions(__FILE__,$short_opts,$long_opts);
-if ( $OPTS->isError() ) {
-    fwrite( STDERR, $OPTS->getMessage() . "\n");
-    _usage();
-    exit(1);
-}
-$RENDERER = 'xhtml';
-foreach ($OPTS->options as $key => $val) {
-    switch ($key) {
-        case 'h':
-        case 'help':
-            _usage();
-            exit;
-        case 'r':
-        case 'renderer':
-            $RENDERER = $val;
+    /**
+     * Register options and arguments on the given $options object
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    protected function setup(DokuCLI_Options $options) {
+        $options->setHelp(
+            'A simple commandline tool to render some DokuWiki syntax with a given renderer.'.
+            "\n\n".
+            'This may not work for plugins that expect a certain environment to be '.
+            'set up before rendering, but should work for most or even all standard '.
+            'DokuWiki markup'
+        );
+        $options->registerOption('renderer', 'The renderer mode to use. Defaults to xhtml', 'r', 'mode');
     }
-}
 
+    /**
+     * Your main program
+     *
+     * Arguments and options have been parsed when this is run
+     *
+     * @param DokuCLI_Options $options
+     * @throws DokuCLI_Exception
+     * @return void
+     */
+    protected function main(DokuCLI_Options $options) {
+        $renderer = $options->getOpt('renderer', 'xhtml');
 
-// do the action
-$source = stream_get_contents(STDIN);
-$info = array();
-$result = p_render($RENDERER,p_get_instructions($source),$info);
-if(is_null($result)) die("No such renderer $RENDERER\n");
-echo $result;
-
-/**
- * Print usage info
- */
-function _usage(){
-    print "Usage: render.php <options>
-
-    Reads DokuWiki syntax from STDIN and renders it with the given renderer
-    to STDOUT
-
-    OPTIONS
-        -h, --help                 show this help and exit
-        -r, --renderer <renderer>  the render mode (default: xhtml)
-";
+        // do the action
+        $source = stream_get_contents(STDIN);
+        $info   = array();
+        $result = p_render($renderer, p_get_instructions($source), $info);
+        if(is_null($result)) throw new DokuCLI_Exception("No such renderer $renderer");
+        echo $result;
+    }
 }
+
+// Main
+$cli = new RenderCLI();
+$cli->run();
\ No newline at end of file
diff --git a/bin/striplangs.php b/bin/striplangs.php
index 2bfddcea4250b40be321f904e519b0a3daed30f3..6335bc84c7f1c66b721c1271b8264a0f25de787c 100755
--- a/bin/striplangs.php
+++ b/bin/striplangs.php
@@ -1,148 +1,110 @@
 #!/usr/bin/php
 <?php
-/**
- * Strip unwanted languages from the DokuWiki install
- *
- * @author Martin 'E.T.' Misuth <et.github@ethome.sk>
- */
-if ('cli' != php_sapi_name()) die();
-
-#------------------------------------------------------------------------------
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
-require_once DOKU_INC.'inc/cliopts.php';
-
-#------------------------------------------------------------------------------
-function usage($show_examples = false) {
-    print "Usage: striplangs.php [-h [-x]] [-e] [-k lang1[,lang2]..[,langN]]
-
-    Removes all languages from the installation, besides the ones
-    after the -k option. English language is never removed!
+if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
+define('NOSESSION', 1);
+require_once(DOKU_INC.'inc/init.php');
 
-    OPTIONS
-        -h, --help     get this help
-        -x, --examples get also usage examples
-        -k, --keep     comma separated list of languages, -e is always implied
-        -e, --english  keeps english, dummy to use without -k\n";
-    if ( $show_examples ) {
-        print "\n
-    EXAMPLES
-        Strips all languages, but keeps 'en' and 'de':
-         striplangs -k de
 
-        Strips all but 'en','ca-valencia','cs','de','is','sk':
-         striplangs --keep ca-valencia,cs,de,is,sk
-
-        Strips all but 'en':
-         striplangs -e
-
-        No option specified, prints usage and throws error:
-         striplangs\n";
-    }
-}
-
-function getSuppliedArgument($OPTS, $short, $long) {
-    $arg = $OPTS->get($short);
-    if ( is_null($arg) ) {
-        $arg = $OPTS->get($long);
+/**
+ * Remove unwanted languages from a DokuWiki install
+ */
+class StripLangsCLI extends DokuCLI {
+
+    /**
+     * Register options and arguments on the given $options object
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    protected function setup(DokuCLI_Options $options) {
+
+        $options->setHelp(
+            'Remove all languages from the installation, besides the ones specified. English language '.
+            'is never removed!'
+        );
+
+        $options->registerOption(
+            'keep',
+            'Comma separated list of languages to keep in addition to English.',
+            'k'
+        );
+        $options->registerOption(
+            'english-only',
+            'Remove all languages except English',
+            'e'
+        );
     }
-    return $arg;
-}
 
-function processPlugins($path, $keep_langs) {
-    if (is_dir($path)) {
-        $entries = scandir($path);
-
-        foreach ($entries as $entry) {
-            if ($entry != "." && $entry != "..") {
-                if ( is_dir($path.'/'.$entry) ) {
+    /**
+     * Your main program
+     *
+     * Arguments and options have been parsed when this is run
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    protected function main(DokuCLI_Options $options) {
+        if($options->getOpt('keep')) {
+            $keep = explode(',', $options->getOpt('keep'));
+            if(!in_array('en', $keep)) $keep[] = 'en';
+        } elseif($options->getOpt('english-only')) {
+            $keep = array('en');
+        } else {
+            echo $options->help();
+            exit(0);
+        }
 
-                    $plugin_langs = $path.'/'.$entry.'/lang';
+        // Kill all language directories in /inc/lang and /lib/plugins besides those in $langs array
+        $this->stripDirLangs(realpath(dirname(__FILE__).'/../inc/lang'), $keep);
+        $this->processExtensions(realpath(dirname(__FILE__).'/../lib/plugins'), $keep);
+        $this->processExtensions(realpath(dirname(__FILE__).'/../lib/tpl'), $keep);
+    }
 
-                    if ( is_dir( $plugin_langs ) ) {
-                        stripDirLangs($plugin_langs, $keep_langs);
+    /**
+     * Strip languages from extensions
+     *
+     * @param string $path       path to plugin or template dir
+     * @param array  $keep_langs languages to keep
+     */
+    protected function processExtensions($path, $keep_langs) {
+        if(is_dir($path)) {
+            $entries = scandir($path);
+
+            foreach($entries as $entry) {
+                if($entry != "." && $entry != "..") {
+                    if(is_dir($path.'/'.$entry)) {
+
+                        $plugin_langs = $path.'/'.$entry.'/lang';
+
+                        if(is_dir($plugin_langs)) {
+                            $this->stripDirLangs($plugin_langs, $keep_langs);
+                        }
                     }
                 }
             }
         }
     }
-}
 
-function stripDirLangs($path, $keep_langs) {
-    $dir = dir($path);
+    /**
+     * Strip languages from path
+     *
+     * @param string $path       path to lang dir
+     * @param array  $keep_langs languages to keep
+     */
+    protected function stripDirLangs($path, $keep_langs) {
+        $dir = dir($path);
 
-    while(($cur_dir = $dir->read()) !== false) {
-        if( $cur_dir != '.' and $cur_dir != '..' and is_dir($path.'/'.$cur_dir)) {
+        while(($cur_dir = $dir->read()) !== false) {
+            if($cur_dir != '.' and $cur_dir != '..' and is_dir($path.'/'.$cur_dir)) {
 
-            if ( !in_array($cur_dir, $keep_langs, true ) ) {
-                killDir($path.'/'.$cur_dir);
-            }
-        }
-    }
-    $dir->close();
-}
-
-function killDir($dir) {
-    if (is_dir($dir)) {
-        $entries = scandir($dir);
-
-        foreach ($entries as $entry) {
-            if ($entry != "." && $entry != "..") {
-                if ( is_dir($dir.'/'.$entry) ) {
-                    killDir($dir.'/'.$entry);
-                } else {
-                    unlink($dir.'/'.$entry);
+                if(!in_array($cur_dir, $keep_langs, true)) {
+                    io_rmdir($path.'/'.$cur_dir, true);
                 }
             }
         }
-        reset($entries);
-        rmdir($dir);
-    }
-}
-#------------------------------------------------------------------------------
-
-// handle options
-$short_opts = 'hxk:e';
-$long_opts  = array('help', 'examples', 'keep=','english');
-
-$OPTS = Doku_Cli_Opts::getOptions(__FILE__, $short_opts, $long_opts);
-
-if ( $OPTS->isError() ) {
-    fwrite( STDERR, $OPTS->getMessage() . "\n");
-    exit(1);
-}
-
-// handle '--examples' option
-$show_examples = ( $OPTS->has('x') or $OPTS->has('examples') ) ? true : false;
-
-// handle '--help' option
-if ( $OPTS->has('h') or $OPTS->has('help') ) {
-    usage($show_examples);
-    exit(0);
-}
-
-// handle both '--keep' and '--english' options
-if ( $OPTS->has('k') or $OPTS->has('keep') ) {
-    $preserved_langs = getSuppliedArgument($OPTS,'k','keep');
-    $langs = explode(',', $preserved_langs);
-
-    // ! always enforce 'en' lang when using '--keep' (DW relies on it)
-    if ( !isset($langs['en']) ) {
-        $langs[]='en';
+        $dir->close();
     }
-} elseif ( $OPTS->has('e') or $OPTS->has('english') ) {
-    // '--english' was specified strip everything besides 'en'
-    $langs = array ('en');
-} else {
-    // no option was specified, print usage but don't do anything as
-    // this run might not be intented
-    usage();
-    print "\n
-    ERROR
-        No option specified, use either -h -x to get more info,
-        or -e to strip every language besides english.\n";
-    exit(1);
 }
 
-// Kill all language directories in /inc/lang and /lib/plugins besides those in $langs array
-stripDirLangs(realpath(dirname(__FILE__).'/../inc/lang'), $langs);
-processPlugins(realpath(dirname(__FILE__).'/../lib/plugins'), $langs);
+$cli = new StripLangsCLI();
+$cli->run();
\ No newline at end of file
diff --git a/bin/wantedpages.php b/bin/wantedpages.php
index afcb6b271575cf766c851c964e210b97a9a37622..8fc4ba74ff7d25bdafeced20ccfb69db9ea3e0e4 100755
--- a/bin/wantedpages.php
+++ b/bin/wantedpages.php
@@ -1,134 +1,133 @@
 #!/usr/bin/php
 <?php
-if ('cli' != php_sapi_name()) die();
-
-#------------------------------------------------------------------------------
-ini_set('memory_limit','128M');
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
-require_once DOKU_INC.'inc/init.php';
-require_once DOKU_INC.'inc/common.php';
-require_once DOKU_INC.'inc/search.php';
-require_once DOKU_INC.'inc/cliopts.php';
+if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
+define('NOSESSION', 1);
+require_once(DOKU_INC.'inc/init.php');
+
+/**
+ * Find wanted pages
+ */
+class WantedPagesCLI extends DokuCLI {
+
+    const DIR_CONTINUE = 1;
+    const DIR_NS       = 2;
+    const DIR_PAGE     = 3;
+
+    /**
+     * Register options and arguments on the given $options object
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    protected function setup(DokuCLI_Options $options) {
+        $options->setHelp(
+            'Outputs a list of wanted pages (pages which have internal links but do not yet exist).'
+        );
+        $options->registerArgument(
+            'namespace',
+            'The namespace to lookup. Defaults to root namespace',
+            false
+        );
+    }
 
-#------------------------------------------------------------------------------
-function usage() {
-    print "Usage: wantedpages.php [wiki:namespace]
+    /**
+     * Your main program
+     *
+     * Arguments and options have been parsed when this is run
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    protected function main(DokuCLI_Options $options) {
+
+        if($options->args) {
+            $startdir = dirname(wikiFN($options->args[0].':xxx'));
+        } else {
+            $startdir = dirname(wikiFN('xxx'));
+        }
 
-    Outputs a list of wanted pages (pages which have
-    internal links but do not yet exist).
+        $this->info("searching $startdir");
 
-    If the optional [wiki:namespace] is not provided,
-    defaults to the root wiki namespace
+        $wanted_pages = array();
 
-    OPTIONS
-        -h, --help get help
-";
-}
-
-#------------------------------------------------------------------------------
-define ('DW_DIR_CONTINUE',1);
-define ('DW_DIR_NS',2);
-define ('DW_DIR_PAGE',3);
+        foreach($this->get_pages($startdir) as $page) {
+            $wanted_pages = array_merge($wanted_pages, $this->internal_links($page));
+        }
+        $wanted_pages = array_unique($wanted_pages);
+        sort($wanted_pages);
 
-#------------------------------------------------------------------------------
-function dw_dir_filter($entry, $basepath) {
-    if ($entry == '.' || $entry == '..' ) {
-        return DW_DIR_CONTINUE;
-    }
-    if ( is_dir($basepath . '/' . $entry) ) {
-        if ( strpos($entry, '_') === 0 ) {
-            return DW_DIR_CONTINUE;
+        foreach($wanted_pages as $page) {
+            print $page."\n";
         }
-        return DW_DIR_NS;
-    }
-    if ( preg_match('/\.txt$/',$entry) ) {
-        return DW_DIR_PAGE;
     }
-    return DW_DIR_CONTINUE;
-}
 
-#------------------------------------------------------------------------------
-function dw_get_pages($dir) {
-    static $trunclen = null;
-    if ( !$trunclen ) {
-        global $conf;
-        $trunclen = strlen($conf['datadir'].':');
+    protected function dir_filter($entry, $basepath) {
+        if($entry == '.' || $entry == '..') {
+            return WantedPagesCLI::DIR_CONTINUE;
+        }
+        if(is_dir($basepath.'/'.$entry)) {
+            if(strpos($entry, '_') === 0) {
+                return WantedPagesCLI::DIR_CONTINUE;
+            }
+            return WantedPagesCLI::DIR_NS;
+        }
+        if(preg_match('/\.txt$/', $entry)) {
+            return WantedPagesCLI::DIR_PAGE;
+        }
+        return WantedPagesCLI::DIR_CONTINUE;
     }
 
-    if ( !is_dir($dir) ) {
-        fwrite( STDERR, "Unable to read directory $dir\n");
-        exit(1);
-    }
+    protected function get_pages($dir) {
+        static $trunclen = null;
+        if(!$trunclen) {
+            global $conf;
+            $trunclen = strlen($conf['datadir'].':');
+        }
 
-    $pages = array();
-    $dh = opendir($dir);
-    while ( false !== ( $entry = readdir($dh) ) ) {
-        $status = dw_dir_filter($entry, $dir);
-        if ( $status == DW_DIR_CONTINUE ) {
-            continue;
-        } else if ( $status == DW_DIR_NS ) {
-            $pages = array_merge($pages, dw_get_pages($dir . '/' . $entry));
-        } else {
-            $page = array(
-                'id'  => pathID(substr($dir.'/'.$entry,$trunclen)),
-                'file'=> $dir.'/'.$entry,
+        if(!is_dir($dir)) {
+            throw new DokuCLI_Exception("Unable to read directory $dir");
+        }
+
+        $pages = array();
+        $dh    = opendir($dir);
+        while(false !== ($entry = readdir($dh))) {
+            $status = $this->dir_filter($entry, $dir);
+            if($status == WantedPagesCLI::DIR_CONTINUE) {
+                continue;
+            } else if($status == WantedPagesCLI::DIR_NS) {
+                $pages = array_merge($pages, $this->get_pages($dir.'/'.$entry));
+            } else {
+                $page    = array(
+                    'id'   => pathID(substr($dir.'/'.$entry, $trunclen)),
+                    'file' => $dir.'/'.$entry,
                 );
-            $pages[] = $page;
+                $pages[] = $page;
+            }
         }
+        closedir($dh);
+        return $pages;
     }
-    closedir($dh);
-    return $pages;
-}
 
-#------------------------------------------------------------------------------
-function dw_internal_links($page) {
-    global $conf;
-    $instructions = p_get_instructions(file_get_contents($page['file']));
-    $links = array();
-    $cns = getNS($page['id']);
-    $exists = false;
-    foreach($instructions as $ins){
-        if($ins[0] == 'internallink' || ($conf['camelcase'] && $ins[0] == 'camelcaselink') ){
-            $mid = $ins[1][0];
-            resolve_pageid($cns,$mid,$exists);
-            if ( !$exists ) {
-                list($mid) = explode('#',$mid); //record pages without hashs
-                $links[] = $mid;
+    function internal_links($page) {
+        global $conf;
+        $instructions = p_get_instructions(file_get_contents($page['file']));
+        $links        = array();
+        $cns          = getNS($page['id']);
+        $exists       = false;
+        foreach($instructions as $ins) {
+            if($ins[0] == 'internallink' || ($conf['camelcase'] && $ins[0] == 'camelcaselink')) {
+                $mid = $ins[1][0];
+                resolve_pageid($cns, $mid, $exists);
+                if(!$exists) {
+                    list($mid) = explode('#', $mid); //record pages without hashs
+                    $links[] = $mid;
+                }
             }
         }
+        return $links;
     }
-    return $links;
 }
 
-#------------------------------------------------------------------------------
-$OPTS = Doku_Cli_Opts::getOptions(__FILE__,'h',array('help'));
-
-if ( $OPTS->isError() ) {
-    fwrite( STDERR, $OPTS->getMessage() . "\n");
-    exit(1);
-}
-
-if ( $OPTS->has('h') or $OPTS->has('help') ) {
-    usage();
-    exit(0);
-}
-
-$START_DIR = $conf['datadir'];
-
-if ( $OPTS->numArgs() == 1 ) {
-    $START_DIR .= '/' . $OPTS->arg(0);
-}
-
-#------------------------------------------------------------------------------
-$WANTED_PAGES = array();
-
-foreach ( dw_get_pages($START_DIR) as $WIKI_PAGE ) {
-    $WANTED_PAGES = array_merge($WANTED_PAGES,dw_internal_links($WIKI_PAGE));
-}
-$WANTED_PAGES = array_unique($WANTED_PAGES);
-sort($WANTED_PAGES);
-
-foreach ( $WANTED_PAGES as $WANTED_PAGE ) {
-    print $WANTED_PAGE."\n";
-}
-exit(0);
+// Main
+$cli = new WantedPagesCLI();
+$cli->run();
\ No newline at end of file
diff --git a/data/deleted.files b/data/deleted.files
index 63335d3cc8a8a56e57fa8353d07cd15873244672..cac352c9d0822555957ed5a8f9fbff3b9cc32a2d 100644
--- a/data/deleted.files
+++ b/data/deleted.files
@@ -2,6 +2,164 @@
 # but were removed later. An up to date DokuWiki should not have any of
 # the files installed
 
+# removed in 2014-05-05
+lib/images/fileicons/audio.png
+lib/plugins/acl/lang/hi/lang.php
+lib/plugins/acl/lang/id-ni/lang.php
+lib/plugins/acl/lang/lb/lang.php
+lib/plugins/acl/lang/ms/lang.php
+lib/plugins/authad/lang/lv/settings.php
+lib/plugins/authldap/lang/lv/settings.php
+lib/plugins/authmysql/lang/fi/settings.php
+lib/plugins/authmysql/lang/lv/settings.php
+lib/plugins/authpgsql/lang/fi/settings.php
+lib/plugins/authpgsql/lang/it/settings.php
+lib/plugins/authpgsql/lang/lv/settings.php
+lib/plugins/authpgsql/lang/pl/settings.php
+lib/plugins/config/lang/hr/lang.php
+lib/plugins/config/lang/id/lang.php
+lib/plugins/config/lang/kk/lang.php
+lib/plugins/config/lang/lb/lang.php
+lib/plugins/config/lang/mk/lang.php
+lib/plugins/config/lang/ms/lang.php
+lib/plugins/config/lang/vi/lang.php
+lib/plugins/plugin/admin.php
+lib/plugins/plugin/classes/ap_delete.class.php
+lib/plugins/plugin/classes/ap_download.class.php
+lib/plugins/plugin/classes/ap_enable.class.php
+lib/plugins/plugin/classes/ap_info.class.php
+lib/plugins/plugin/classes/ap_manage.class.php
+lib/plugins/plugin/classes/ap_update.class.php
+lib/plugins/plugin/lang/af/lang.php
+lib/plugins/plugin/lang/ar/admin_plugin.txt
+lib/plugins/plugin/lang/ar/lang.php
+lib/plugins/plugin/lang/bg/admin_plugin.txt
+lib/plugins/plugin/lang/bg/lang.php
+lib/plugins/plugin/lang/ca-valencia/admin_plugin.txt
+lib/plugins/plugin/lang/ca-valencia/lang.php
+lib/plugins/plugin/lang/ca/admin_plugin.txt
+lib/plugins/plugin/lang/ca/lang.php
+lib/plugins/plugin/lang/cs/admin_plugin.txt
+lib/plugins/plugin/lang/cs/lang.php
+lib/plugins/plugin/lang/da/admin_plugin.txt
+lib/plugins/plugin/lang/da/lang.php
+lib/plugins/plugin/lang/de-informal/admin_plugin.txt
+lib/plugins/plugin/lang/de-informal/lang.php
+lib/plugins/plugin/lang/de/admin_plugin.txt
+lib/plugins/plugin/lang/de/lang.php
+lib/plugins/plugin/lang/el/admin_plugin.txt
+lib/plugins/plugin/lang/el/lang.php
+lib/plugins/plugin/lang/en/admin_plugin.txt
+lib/plugins/plugin/lang/en/lang.php
+lib/plugins/plugin/lang/eo/admin_plugin.txt
+lib/plugins/plugin/lang/eo/lang.php
+lib/plugins/plugin/lang/es/admin_plugin.txt
+lib/plugins/plugin/lang/es/lang.php
+lib/plugins/plugin/lang/et/lang.php
+lib/plugins/plugin/lang/eu/admin_plugin.txt
+lib/plugins/plugin/lang/eu/lang.php
+lib/plugins/plugin/lang/fa/admin_plugin.txt
+lib/plugins/plugin/lang/fa/lang.php
+lib/plugins/plugin/lang/fi/admin_plugin.txt
+lib/plugins/plugin/lang/fi/lang.php
+lib/plugins/plugin/lang/fr/admin_plugin.txt
+lib/plugins/plugin/lang/fr/lang.php
+lib/plugins/plugin/lang/gl/admin_plugin.txt
+lib/plugins/plugin/lang/gl/lang.php
+lib/plugins/plugin/lang/he/admin_plugin.txt
+lib/plugins/plugin/lang/he/lang.php
+lib/plugins/plugin/lang/hi/lang.php
+lib/plugins/plugin/lang/hr/lang.php
+lib/plugins/plugin/lang/hu/admin_plugin.txt
+lib/plugins/plugin/lang/hu/lang.php
+lib/plugins/plugin/lang/ia/admin_plugin.txt
+lib/plugins/plugin/lang/ia/lang.php
+lib/plugins/plugin/lang/id-ni/lang.php
+lib/plugins/plugin/lang/id/lang.php
+lib/plugins/plugin/lang/is/lang.php
+lib/plugins/plugin/lang/it/admin_plugin.txt
+lib/plugins/plugin/lang/it/lang.php
+lib/plugins/plugin/lang/ja/admin_plugin.txt
+lib/plugins/plugin/lang/ja/lang.php
+lib/plugins/plugin/lang/kk/lang.php
+lib/plugins/plugin/lang/ko/admin_plugin.txt
+lib/plugins/plugin/lang/ko/lang.php
+lib/plugins/plugin/lang/la/admin_plugin.txt
+lib/plugins/plugin/lang/la/lang.php
+lib/plugins/plugin/lang/lb/admin_plugin.txt
+lib/plugins/plugin/lang/lb/lang.php
+lib/plugins/plugin/lang/lt/admin_plugin.txt
+lib/plugins/plugin/lang/lt/lang.php
+lib/plugins/plugin/lang/lv/admin_plugin.txt
+lib/plugins/plugin/lang/lv/lang.php
+lib/plugins/plugin/lang/mk/lang.php
+lib/plugins/plugin/lang/mr/admin_plugin.txt
+lib/plugins/plugin/lang/mr/lang.php
+lib/plugins/plugin/lang/ms/lang.php
+lib/plugins/plugin/lang/ne/lang.php
+lib/plugins/plugin/lang/nl/admin_plugin.txt
+lib/plugins/plugin/lang/nl/lang.php
+lib/plugins/plugin/lang/no/admin_plugin.txt
+lib/plugins/plugin/lang/no/lang.php
+lib/plugins/plugin/lang/pl/admin_plugin.txt
+lib/plugins/plugin/lang/pl/lang.php
+lib/plugins/plugin/lang/pt-br/admin_plugin.txt
+lib/plugins/plugin/lang/pt-br/lang.php
+lib/plugins/plugin/lang/pt/admin_plugin.txt
+lib/plugins/plugin/lang/pt/lang.php
+lib/plugins/plugin/lang/ro/admin_plugin.txt
+lib/plugins/plugin/lang/ro/lang.php
+lib/plugins/plugin/lang/ru/admin_plugin.txt
+lib/plugins/plugin/lang/ru/lang.php
+lib/plugins/plugin/lang/sk/admin_plugin.txt
+lib/plugins/plugin/lang/sk/lang.php
+lib/plugins/plugin/lang/sl/admin_plugin.txt
+lib/plugins/plugin/lang/sl/lang.php
+lib/plugins/plugin/lang/sq/admin_plugin.txt
+lib/plugins/plugin/lang/sq/lang.php
+lib/plugins/plugin/lang/sr/admin_plugin.txt
+lib/plugins/plugin/lang/sr/lang.php
+lib/plugins/plugin/lang/sv/admin_plugin.txt
+lib/plugins/plugin/lang/sv/lang.php
+lib/plugins/plugin/lang/th/admin_plugin.txt
+lib/plugins/plugin/lang/th/lang.php
+lib/plugins/plugin/lang/tr/admin_plugin.txt
+lib/plugins/plugin/lang/tr/lang.php
+lib/plugins/plugin/lang/uk/admin_plugin.txt
+lib/plugins/plugin/lang/uk/lang.php
+lib/plugins/plugin/lang/vi/lang.php
+lib/plugins/plugin/lang/zh-tw/admin_plugin.txt
+lib/plugins/plugin/lang/zh-tw/lang.php
+lib/plugins/plugin/lang/zh/admin_plugin.txt
+lib/plugins/plugin/lang/zh/lang.php
+lib/plugins/plugin/plugin.info.txt
+lib/plugins/plugin/style.css
+lib/plugins/popularity/lang/et/lang.php
+lib/plugins/popularity/lang/hr/lang.php
+lib/plugins/popularity/lang/id/lang.php
+lib/plugins/popularity/lang/kk/lang.php
+lib/plugins/popularity/lang/lb/lang.php
+lib/plugins/popularity/lang/mk/lang.php
+lib/plugins/popularity/lang/ms/lang.php
+lib/plugins/popularity/lang/vi/lang.php
+lib/plugins/revert/lang/af/lang.php
+lib/plugins/revert/lang/hi/lang.php
+lib/plugins/revert/lang/hr/lang.php
+lib/plugins/revert/lang/id-ni/lang.php
+lib/plugins/revert/lang/id/lang.php
+lib/plugins/revert/lang/kk/lang.php
+lib/plugins/revert/lang/lb/lang.php
+lib/plugins/revert/lang/lt/lang.php
+lib/plugins/revert/lang/mk/lang.php
+lib/plugins/revert/lang/ms/lang.php
+lib/plugins/revert/lang/vi/lang.php
+lib/plugins/usermanager/lang/hi/lang.php
+lib/plugins/usermanager/lang/hr/lang.php
+lib/plugins/usermanager/lang/id-ni/lang.php
+lib/plugins/usermanager/lang/lb/lang.php
+lib/plugins/usermanager/lang/ms/lang.php
+lib/plugins/usermanager/lang/vi/lang.php
+
 # removed in 2013-11-18
 lib/images/arrow_down.gif
 lib/images/arrow_up.gif
diff --git a/doku.php b/doku.php
index 7337309135af20d5331ad39c7187ca4c79f64c86..6673d2d66aa1de5286091f246148ba681c6b39d9 100644
--- a/doku.php
+++ b/doku.php
@@ -9,7 +9,7 @@
  */
 
 // update message version
-$updateVersion = 43;
+$updateVersion = 45;
 
 //  xdebug_start_profiling();
 
diff --git a/feed.php b/feed.php
index 5bf1d2e85d8bfe5d7dda3e2ea88228f48c2f4fe3..a63e22164649d2c84ea6973c7aa671164b818639 100644
--- a/feed.php
+++ b/feed.php
@@ -15,6 +15,13 @@ require_once(DOKU_INC.'inc/init.php');
 //close session
 session_write_close();
 
+//feed disabled?
+if(!actionOK('rss')) {
+    http_status(404);
+    echo '<error>RSS feed is disabled.</error>';
+    exit;
+}
+
 // get params
 $opt = rss_parseOptions();
 
@@ -120,6 +127,8 @@ function rss_parseOptions() {
                 'items'        => array('int', 'num', $conf['recent']),
                 // Boolean, only used in rc mode
                 'show_minor'   => array('bool', 'minor', false),
+                // String, only used in list mode
+                'sort'         => array('str', 'sort', 'natural'),
                 // String, only used in search mode
                 'search_query' => array('str', 'q', null),
                 // One of: pages, media, both
@@ -131,15 +140,14 @@ function rss_parseOptions() {
 
     $opt['items']      = max(0, (int) $opt['items']);
     $opt['show_minor'] = (bool) $opt['show_minor'];
+    $opt['sort'] = valid_input_set('sort', array('default' => 'natural', 'date'), $opt);
 
     $opt['guardmail'] = ($conf['mailguard'] != '' && $conf['mailguard'] != 'none');
 
-    $type = valid_input_set(
-        'type', array(
-                     'rss', 'rss2', 'atom', 'atom1', 'rss1',
-                     'default' => $conf['rss_type']
-                ),
-        $_REQUEST
+    $type = $INPUT->valid(
+        'type',
+        array( 'rss', 'rss2', 'atom', 'atom1', 'rss1'),
+        $conf['rss_type']
     );
     switch($type) {
         case 'rss':
@@ -400,6 +408,7 @@ function rss_buildItems(&$rss, &$data, $opt) {
                 if($userInfo) {
                     switch($conf['showuseras']) {
                         case 'username':
+                        case 'username_link':
                             $item->author = $userInfo['name'];
                             break;
                         default:
@@ -474,7 +483,7 @@ function rssListNamespace($opt) {
     global $conf;
 
     $ns = ':'.cleanID($opt['namespace']);
-    $ns = str_replace(':', '/', $ns);
+    $ns = utf8_encodeFN(str_replace(':', '/', $ns));
 
     $data = array();
     $search_opts = array(
@@ -482,7 +491,7 @@ function rssListNamespace($opt) {
         'pagesonly' => true,
         'listfiles' => true
     );
-    search($data, $conf['datadir'], 'search_universal', $search_opts, $ns);
+    search($data, $conf['datadir'], 'search_universal', $search_opts, $ns, $lvl = 1, $opt['sort']);
 
     return $data;
 }
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php
index 53f3c9a78656806aa39be58da2a0e8f0efa4a9fc..cd4c7c4c55b491677ddadccaa3adc39fa25534ae 100644
--- a/inc/HTTPClient.php
+++ b/inc/HTTPClient.php
@@ -35,6 +35,19 @@ class DokuHTTPClient extends HTTPClient {
         $this->proxy_pass   = conf_decodeString($conf['proxy']['pass']);
         $this->proxy_ssl    = $conf['proxy']['ssl'];
         $this->proxy_except = $conf['proxy']['except'];
+
+        // allow enabling debugging via URL parameter (if debugging allowed)
+        if($conf['allowdebug']) {
+            if(
+                isset($_REQUEST['httpdebug']) ||
+                (
+                    isset($_SERVER['HTTP_REFERER']) &&
+                    strpos($_SERVER['HTTP_REFERER'], 'httpdebug') !== false
+                )
+            ) {
+                $this->debug = true;
+            }
+        }
     }
 
 
@@ -61,6 +74,9 @@ class DokuHTTPClient extends HTTPClient {
 
 }
 
+/**
+ * Class HTTPClientException
+ */
 class HTTPClientException extends Exception { }
 
 /**
@@ -249,7 +265,6 @@ class HTTPClient {
             if (empty($port)) $port = 8080;
         }else{
             $request_url = $path;
-            $server      = $server;
             if (!isset($port)) $port = ($uri['scheme'] == 'https') ? 443 : 80;
         }
 
@@ -280,7 +295,6 @@ class HTTPClient {
                 }
             }
             $headers['Content-Length'] = strlen($data);
-            $rmethod = 'POST';
         }elseif($method == 'GET'){
             $data = ''; //no data allowed on GET requests
         }
@@ -343,7 +357,7 @@ class HTTPClient {
 
         try {
             //set non-blocking
-            stream_set_blocking($socket, false);
+            stream_set_blocking($socket, 0);
 
             // build request
             $request  = "$method $request_url HTTP/".$this->http.HTTP_NL;
@@ -458,7 +472,7 @@ class HTTPClient {
 
                     if ($chunk_size > 0) {
                         $r_body .= $this->_readData($socket, $chunk_size, 'chunk');
-                        $byte = $this->_readData($socket, 2, 'chunk'); // read trailing \r\n
+                        $this->_readData($socket, 2, 'chunk'); // read trailing \r\n
                     }
                 } while ($chunk_size && !$abort);
             }elseif(isset($this->resp_headers['content-length']) && !isset($this->resp_headers['transfer-encoding'])){
@@ -480,7 +494,6 @@ class HTTPClient {
                 $r_body = $this->_readData($socket, $this->max_bodysize, 'response (content-length limited)', true);
             }else{
                 // read entire socket
-                $r_size = 0;
                 while (!feof($socket)) {
                     $r_body .= $this->_readData($socket, 4096, 'response (unlimited)', true);
                 }
@@ -509,7 +522,6 @@ class HTTPClient {
         if (!$this->keep_alive ||
                 (isset($this->resp_headers['connection']) && $this->resp_headers['connection'] == 'Close')) {
             // close socket
-            $status = socket_get_status($socket);
             fclose($socket);
             unset(self::$connections[$connectionId]);
         }
@@ -552,7 +564,7 @@ class HTTPClient {
         $request  = "CONNECT {$requestinfo['host']}:{$requestinfo['port']} HTTP/1.0".HTTP_NL;
         $request .= "Host: {$requestinfo['host']}".HTTP_NL;
         if($this->proxy_user) {
-            $request .= 'Proxy-Authorization Basic '.base64_encode($this->proxy_user.':'.$this->proxy_pass).HTTP_NL;
+            $request .= 'Proxy-Authorization: Basic '.base64_encode($this->proxy_user.':'.$this->proxy_pass).HTTP_NL;
         }
         $request .= HTTP_NL;
 
@@ -796,7 +808,7 @@ class HTTPClient {
     function _buildHeaders($headers){
         $string = '';
         foreach($headers as $key => $value){
-            if(empty($value)) continue;
+            if($value === '') continue;
             $string .= $key.': '.$value.HTTP_NL;
         }
         return $string;
diff --git a/inc/Input.class.php b/inc/Input.class.php
index de8bf5b978ae3d40b1c0ac5c20ff018d778b3d3f..e7eef1c29cc0cae4c8ad540346cc4193678f8060 100644
--- a/inc/Input.class.php
+++ b/inc/Input.class.php
@@ -143,6 +143,26 @@ class Input {
         return (string) $this->access[$name];
     }
 
+    /**
+     * Access a request parameter and make sure it is has a valid value
+     *
+     * Please note that comparisons to the valid values are not done typesafe (request vars
+     * are always strings) however the function will return the correct type from the $valids
+     * array when an match was found.
+     *
+     * @param string $name    Parameter name
+     * @param array  $valids  Array of valid values
+     * @param mixed  $default Default to return if parameter isn't set or not valid
+     * @return null|mixed
+     */
+    public function valid($name, $valids, $default = null) {
+        if(!isset($this->access[$name])) return $default;
+        if(is_array($this->access[$name])) return $default; // we don't allow arrays
+        $found = array_search($this->access[$name], $valids);
+        if($found !== false) return $valids[$found]; // return the valid value for type safety
+        return $default;
+    }
+
     /**
      * Access a request parameter as bool
      *
diff --git a/inc/TarLib.class.php b/inc/TarLib.class.php
index ae08039ecc1611f4c10c636132629309475c94db..dd319a79aedc1097427e3c7fd848574fda1ad44e 100644
--- a/inc/TarLib.class.php
+++ b/inc/TarLib.class.php
@@ -26,6 +26,8 @@ class TarLib {
     public $_result = true;
 
     function __construct($file, $comptype = TarLib::COMPRESS_AUTO, $complevel = 9) {
+        dbg_deprecated('class Tar');
+
         if(!$file) $this->error('__construct', '$file');
 
         $this->file = $file;
diff --git a/inc/auth.php b/inc/auth.php
index 2bdc3eb007be3bac527074c221cbfa248fc3674c..6abaa166fafeab32078b517a9ef7bb1c96723646 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -638,6 +638,7 @@ function auth_isMember($memberlist, $user, array $groups) {
 
     // compare cleaned values
     foreach($members as $member) {
+        if($member == '@ALL' ) return true;
         if(!$auth->isCaseSensitive()) $member = utf8_strtolower($member);
         if($member[0] == '@') {
             $member = $auth->cleanGroup(substr($member, 1));
@@ -922,7 +923,7 @@ function auth_sendPassword($user, $password) {
     if(!$auth) return false;
 
     $user     = $auth->cleanUser($user);
-    $userinfo = $auth->getUserData($user);
+    $userinfo = $auth->getUserData($user, $requireGroups = false);
 
     if(!$userinfo['mail']) return false;
 
@@ -1080,7 +1081,7 @@ function updateprofile() {
         }
     }
 
-    if($result = $auth->triggerUserMod('modify', array($INPUT->server->str('REMOTE_USER'), $changes))) {
+    if($result = $auth->triggerUserMod('modify', array($INPUT->server->str('REMOTE_USER'), &$changes))) {
         // update cookie and session with the changed data
         if($changes['pass']) {
             list( /*user*/, $sticky, /*pass*/) = auth_getCookie();
@@ -1184,7 +1185,7 @@ function act_resendpwd() {
         }
 
         $user     = io_readfile($tfile);
-        $userinfo = $auth->getUserData($user);
+        $userinfo = $auth->getUserData($user, $requireGroups = false);
         if(!$userinfo['mail']) {
             msg($lang['resendpwdnouser'], -1);
             return false;
@@ -1236,7 +1237,7 @@ function act_resendpwd() {
             $user = trim($auth->cleanUser($INPUT->post->str('login')));
         }
 
-        $userinfo = $auth->getUserData($user);
+        $userinfo = $auth->getUserData($user, $requireGroups = false);
         if(!$userinfo['mail']) {
             msg($lang['resendpwdnouser'], -1);
             return false;
diff --git a/inc/cache.php b/inc/cache.php
index 56c5b65f26760b884eb05f4560a0755923f807f3..6817e771ba205b9c2ed63895e7de911842048987 100644
--- a/inc/cache.php
+++ b/inc/cache.php
@@ -16,10 +16,11 @@ class cache {
     public $ext = '';          // file ext for cache data, secondary identifier for this item
     public $cache = '';        // cache file name
     public $depends = array(); // array containing cache dependency information,
-    //   used by _useCache to determine cache validity
+                               //   used by _useCache to determine cache validity
 
     var $_event = '';       // event to be triggered during useCache
     var $_time;
+    var $_nocache = false;  // if set to true, cache will not be used or stored
 
     /**
      * @param string $key primary identifier
@@ -34,7 +35,7 @@ class cache {
     /**
      * public method to determine whether the cache can be used
      *
-     * to assist in cetralisation of event triggering and calculation of cache statistics,
+     * to assist in centralisation of event triggering and calculation of cache statistics,
      * don't override this function override _useCache()
      *
      * @param  array   $depends   array of cache dependencies, support dependecies:
@@ -71,6 +72,7 @@ class cache {
      */
     public function _useCache() {
 
+        if ($this->_nocache) return false;                              // caching turned off
         if (!empty($this->depends['purge'])) return false;              // purge requested?
         if (!($this->_time = @filemtime($this->cache))) return false;   // cache exists?
 
@@ -115,6 +117,8 @@ class cache {
      * @return  bool           true on success, false otherwise
      */
     public function storeCache($data) {
+        if ($this->_nocache) return false;
+
         return io_savefile($this->cache, $data);
     }
 
@@ -174,6 +178,7 @@ class cache_parser extends cache {
 
     public $file = '';       // source file for cache
     public $mode = '';       // input mode (represents the processing the input file will undergo)
+    public $page = '';
 
     var $_event = 'PARSER_CACHE_USE';
 
@@ -203,10 +208,6 @@ class cache_parser extends cache {
     }
 
     protected function _addDependencies() {
-        global $conf;
-
-        $this->depends['age'] = isset($this->depends['age']) ?
-            min($this->depends['age'],$conf['cachetime']) : $conf['cachetime'];
 
         // parser cache file dependencies ...
         $files = array($this->file,                              // ... source
@@ -265,6 +266,18 @@ class cache_renderer extends cache_parser {
     }
 
     protected function _addDependencies() {
+        global $conf;
+
+        // default renderer cache file 'age' is dependent on 'cachetime' setting, two special values:
+        //    -1 : do not cache (should not be overridden)
+        //    0  : cache never expires (can be overridden) - no need to set depends['age']
+        if ($conf['cachetime'] == -1) {
+            $this->_nocache = true;
+            return;
+        } elseif ($conf['cachetime'] > 0) {
+            $this->depends['age'] = isset($this->depends['age']) ?
+                min($this->depends['age'],$conf['cachetime']) : $conf['cachetime'];
+        }
 
         // renderer cache file dependencies ...
         $files = array(
@@ -317,6 +330,8 @@ class cache_instructions extends cache_parser {
      * @return  bool                  true on success, false otherwise
      */
     public function storeCache($instructions) {
+        if ($this->_nocache) return false;
+
         return io_savefile($this->cache,serialize($instructions));
     }
 }
diff --git a/inc/changelog.php b/inc/changelog.php
index 84ee39b9a2d5cf61f361d0cc85a029b0bec3e335..6af336fc23c32b3ff2d8e2be4922abcda3b5a4ac 100644
--- a/inc/changelog.php
+++ b/inc/changelog.php
@@ -18,6 +18,9 @@ define('DOKU_CHANGE_TYPE_REVERT',       'R');
  * parses a changelog line into it's components
  *
  * @author Ben Coburn <btcoburn@silicodon.net>
+ *
+ * @param string $line changelog line
+ * @return array|bool parsed line or false
  */
 function parseChangelogLine($line) {
     $tmp = explode("\t", $line);
@@ -43,7 +46,7 @@ function parseChangelogLine($line) {
  * @param String $summary   Summary of the change
  * @param mixed  $extra     In case of a revert the revision (timestmp) of the reverted page
  * @param array  $flags     Additional flags in a key value array.
- *                             Availible flags:
+ *                             Available flags:
  *                             - ExternalEdit - mark as an external edit.
  *
  * @author Andreas Gohr <andi@splitbrain.org>
@@ -116,6 +119,15 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr
  * @author Andreas Gohr <andi@splitbrain.org>
  * @author Esther Brunner <wikidesign@gmail.com>
  * @author Ben Coburn <btcoburn@silicodon.net>
+ *
+ * @param int    $date      Timestamp of the change
+ * @param String $id        Name of the affected page
+ * @param String $type      Type of the change see DOKU_CHANGE_TYPE_*
+ * @param String $summary   Summary of the change
+ * @param mixed  $extra     In case of a revert the revision (timestmp) of the reverted page
+ * @param array  $flags     Additional flags in a key value array.
+ *                             Available flags:
+ *                             - (none, so far)
  */
 function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extra='', $flags=null){
     global $conf;
@@ -294,6 +306,12 @@ function getRecentsSince($from,$to=null,$ns='',$flags=0){
  * @see getRecents()
  * @author Andreas Gohr <andi@splitbrain.org>
  * @author Ben Coburn <btcoburn@silicodon.net>
+ *
+ * @param string $line   changelog line
+ * @param string $ns     restrict to given namespace
+ * @param int    $flags  flags to control which changes are included
+ * @param array  $seen   listing of seen pages
+ * @return array|bool    false or array with info about a change
  */
 function _handleRecent($line,$ns,$flags,&$seen){
     if(empty($line)) return false;   //skip empty lines
@@ -778,9 +796,9 @@ abstract class ChangeLog {
      * Read chunk and return array with lines of given chunck.
      * Has no check if $head and $tail are really at a new line
      *
-     * @param $fp resource filepointer
-     * @param $head int start point chunck
-     * @param $tail int end point chunck
+     * @param resource $fp    resource filepointer
+     * @param int      $head  start point chunck
+     * @param int      $tail  end point chunck
      * @return array lines read from chunck
      */
     protected function readChunk($fp, $head, $tail) {
@@ -804,8 +822,8 @@ abstract class ChangeLog {
     /**
      * Set pointer to first new line after $finger and return its position
      *
-     * @param resource $fp filepointer
-     * @param $finger int a pointer
+     * @param resource $fp      filepointer
+     * @param int      $finger  a pointer
      * @return int pointer
      */
     protected function getNewlinepointer($fp, $finger) {
@@ -905,7 +923,7 @@ abstract class ChangeLog {
      */
     protected function retrieveRevisionsAround($rev, $max) {
         //get lines from changelog
-        list($fp, $lines, $starthead, $starttail, $eof) = $this->readloglines($rev);
+        list($fp, $lines, $starthead, $starttail, /* $eof */) = $this->readloglines($rev);
         if(empty($lines)) return false;
 
         //parse chunk containing $rev, and read forward more chunks until $max/2 is reached
@@ -1023,12 +1041,13 @@ class MediaChangelog extends ChangeLog {
  * changelog files, only the chunk containing the
  * requested changelog line is read.
  *
- * @deprecated 20-11-2013
+ * @deprecated 2013-11-20
  *
  * @author Ben Coburn <btcoburn@silicodon.net>
  * @author Kate Arzamastseva <pshns@ukr.net>
  */
 function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) {
+    dbg_deprecated('class PageChangeLog or class MediaChangelog');
     if($media) {
         $changelog = new MediaChangeLog($id, $chunk_size);
     } else {
@@ -1043,10 +1062,6 @@ function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) {
  * only that a line with the date exists in the changelog.
  * By default the current revision is skipped.
  *
- * id:    the page of interest
- * first: skip the first n changelog lines
- * num:   number of revisions to return
- *
  * The current revision is automatically skipped when the page exists.
  * See $INFO['meta']['last_change'] for the current revision.
  *
@@ -1055,12 +1070,20 @@ function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) {
  * backwards in chunks until the requested number of changelog
  * lines are recieved.
  *
- * @deprecated 20-11-2013
+ * @deprecated 2013-11-20
  *
  * @author Ben Coburn <btcoburn@silicodon.net>
  * @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param string $id          the page of interest
+ * @param int    $first       skip the first n changelog lines
+ * @param int    $num         number of revisions to return
+ * @param int    $chunk_size
+ * @param bool   $media
+ * @return array
  */
 function getRevisions($id, $first, $num, $chunk_size = 8192, $media = false) {
+    dbg_deprecated('class PageChangeLog or class MediaChangelog');
     if($media) {
         $changelog = new MediaChangeLog($id, $chunk_size);
     } else {
diff --git a/inc/cli.php b/inc/cli.php
new file mode 100644
index 0000000000000000000000000000000000000000..25bfddf7db7f1afbc14454df05d9c17f176bf216
--- /dev/null
+++ b/inc/cli.php
@@ -0,0 +1,647 @@
+<?php
+
+/**
+ * Class DokuCLI
+ *
+ * All DokuWiki commandline scripts should inherit from this class and implement the abstract methods.
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+abstract class DokuCLI {
+    /** @var string the executed script itself */
+    protected $bin;
+    /** @var  DokuCLI_Options the option parser */
+    protected $options;
+    /** @var  DokuCLI_Colors */
+    public $colors;
+
+    /**
+     * constructor
+     *
+     * Initialize the arguments, set up helper classes and set up the CLI environment
+     */
+    public function __construct() {
+        set_exception_handler(array($this, 'fatal'));
+
+        $this->options = new DokuCLI_Options();
+        $this->colors  = new DokuCLI_Colors();
+    }
+
+    /**
+     * Register options and arguments on the given $options object
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    abstract protected function setup(DokuCLI_Options $options);
+
+    /**
+     * Your main program
+     *
+     * Arguments and options have been parsed when this is run
+     *
+     * @param DokuCLI_Options $options
+     * @return void
+     */
+    abstract protected function main(DokuCLI_Options $options);
+
+    /**
+     * Execute the CLI program
+     *
+     * Executes the setup() routine, adds default options, initiate the options parsing and argument checking
+     * and finally executes main()
+     */
+    public function run() {
+        if('cli' != php_sapi_name()) throw new DokuCLI_Exception('This has to be run from the command line');
+
+        // setup
+        $this->setup($this->options);
+        $this->options->registerOption(
+            'no-colors',
+            'Do not use any colors in output. Useful when piping output to other tools or files.'
+        );
+        $this->options->registerOption(
+            'help',
+            'Display this help screen and exit immeadiately.',
+            'h'
+        );
+
+        // parse
+        $this->options->parseOptions();
+
+        // handle defaults
+        if($this->options->getOpt('no-colors')) {
+            $this->colors->disable();
+        }
+        if($this->options->getOpt('help')) {
+            echo $this->options->help();
+            exit(0);
+        }
+
+        // check arguments
+        $this->options->checkArguments();
+
+        // execute
+        $this->main($this->options);
+
+        exit(0);
+    }
+
+    /**
+     * Exits the program on a fatal error
+     *
+     * @param Exception|string $error either an exception or an error message
+     */
+    public function fatal($error) {
+        $code = 0;
+        if(is_object($error) && is_a($error, 'Exception')) {
+            /** @var Exception $error */
+            $code  = $error->getCode();
+            $error = $error->getMessage();
+        }
+        if(!$code) $code = DokuCLI_Exception::E_ANY;
+
+        $this->error($error);
+        exit($code);
+    }
+
+    /**
+     * Print an error message
+     *
+     * @param $string
+     */
+    public function error($string) {
+        $this->colors->ptln("E: $string", 'red', STDERR);
+    }
+
+    /**
+     * Print a success message
+     *
+     * @param $string
+     */
+    public function success($string) {
+        $this->colors->ptln("S: $string", 'green', STDERR);
+    }
+
+    /**
+     * Print an info message
+     *
+     * @param $string
+     */
+    public function info($string) {
+        $this->colors->ptln("I: $string", 'cyan', STDERR);
+    }
+
+}
+
+/**
+ * Class DokuCLI_Colors
+ *
+ * Handles color output on (Linux) terminals
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+class DokuCLI_Colors {
+    /** @var array known color names */
+    protected $colors = array(
+        'reset'       => "\33[0m",
+        'black'       => "\33[0;30m",
+        'darkgray'    => "\33[1;30m",
+        'blue'        => "\33[0;34m",
+        'lightblue'   => "\33[1;34m",
+        'green'       => "\33[0;32m",
+        'lightgreen'  => "\33[1;32m",
+        'cyan'        => "\33[0;36m",
+        'lightcyan'   => "\33[1;36m",
+        'red'         => "\33[0;31m",
+        'lightred'    => "\33[1;31m",
+        'purple'      => "\33[0;35m",
+        'lightpurple' => "\33[1;35m",
+        'brown'       => "\33[0;33m",
+        'yellow'      => "\33[1;33m",
+        'lightgray'   => "\33[0;37m",
+        'white'       => "\33[1;37m",
+    );
+
+    /** @var bool should colors be used? */
+    protected $enabled = true;
+
+    /**
+     * Constructor
+     *
+     * Tries to disable colors for non-terminals
+     */
+    public function __construct() {
+        if(function_exists('posix_isatty') && !posix_isatty(STDOUT)) {
+            $this->enabled = false;
+            return;
+        }
+        if(!getenv('TERM')) {
+            $this->enabled = false;
+            return;
+        }
+    }
+
+    /**
+     * enable color output
+     */
+    public function enable() {
+        $this->enabled = true;
+    }
+
+    /**
+     * disable color output
+     */
+    public function disable() {
+        $this->enabled = false;
+    }
+
+    /**
+     * Convenience function to print a line in a given color
+     *
+     * @param          $line
+     * @param          $color
+     * @param resource $channel
+     */
+    public function ptln($line, $color, $channel = STDOUT) {
+        $this->set($color);
+        fwrite($channel, rtrim($line)."\n");
+        $this->reset();
+    }
+
+    /**
+     * Set the given color for consecutive output
+     *
+     * @param string $color one of the supported color names
+     * @throws DokuCLI_Exception
+     */
+    public function set($color) {
+        if(!$this->enabled) return;
+        if(!isset($this->colors[$color])) throw new DokuCLI_Exception("No such color $color");
+        echo $this->colors[$color];
+    }
+
+    /**
+     * reset the terminal color
+     */
+    public function reset() {
+        $this->set('reset');
+    }
+}
+
+/**
+ * Class DokuCLI_Options
+ *
+ * Parses command line options passed to the CLI script. Allows CLI scripts to easily register all accepted options and
+ * commands and even generates a help text from this setup.
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+class DokuCLI_Options {
+    /** @var  array keeps the list of options to parse */
+    protected $setup;
+
+    /** @var  array store parsed options */
+    protected $options = array();
+
+    /** @var string current parsed command if any */
+    protected $command = '';
+
+    /** @var  array passed non-option arguments */
+    public $args = array();
+
+    /** @var  string the executed script */
+    protected $bin;
+
+    /**
+     * Constructor
+     */
+    public function __construct() {
+        $this->setup = array(
+            '' => array(
+                'opts' => array(),
+                'args' => array(),
+                'help' => ''
+            )
+        ); // default command
+
+        $this->args = $this->readPHPArgv();
+        $this->bin  = basename(array_shift($this->args));
+
+        $this->options = array();
+    }
+
+    /**
+     * Sets the help text for the tool itself
+     *
+     * @param string $help
+     */
+    public function setHelp($help) {
+        $this->setup['']['help'] = $help;
+    }
+
+    /**
+     * Register the names of arguments for help generation and number checking
+     *
+     * This has to be called in the order arguments are expected
+     *
+     * @param string $arg      argument name (just for help)
+     * @param string $help     help text
+     * @param bool   $required is this a required argument
+     * @param string $command  if theses apply to a sub command only
+     * @throws DokuCLI_Exception
+     */
+    public function registerArgument($arg, $help, $required = true, $command = '') {
+        if(!isset($this->setup[$command])) throw new DokuCLI_Exception("Command $command not registered");
+
+        $this->setup[$command]['args'][] = array(
+            'name'     => $arg,
+            'help'     => $help,
+            'required' => $required
+        );
+    }
+
+    /**
+     * This registers a sub command
+     *
+     * Sub commands have their own options and use their own function (not main()).
+     *
+     * @param string $command
+     * @param string $help
+     * @throws DokuCLI_Exception
+     */
+    public function registerCommand($command, $help) {
+        if(isset($this->setup[$command])) throw new DokuCLI_Exception("Command $command already registered");
+
+        $this->setup[$command] = array(
+            'opts' => array(),
+            'args' => array(),
+            'help' => $help
+        );
+
+    }
+
+    /**
+     * Register an option for option parsing and help generation
+     *
+     * @param string      $long     multi character option (specified with --)
+     * @param string      $help     help text for this option
+     * @param string|null $short    one character option (specified with -)
+     * @param bool|string $needsarg does this option require an argument? give it a name here
+     * @param string      $command  what command does this option apply to
+     * @throws DokuCLI_Exception
+     */
+    public function registerOption($long, $help, $short = null, $needsarg = false, $command = '') {
+        if(!isset($this->setup[$command])) throw new DokuCLI_Exception("Command $command not registered");
+
+        $this->setup[$command]['opts'][$long] = array(
+            'needsarg' => $needsarg,
+            'help'     => $help,
+            'short'    => $short
+        );
+
+        if($short) {
+            if(strlen($short) > 1) throw new DokuCLI_Exception("Short options should be exactly one ASCII character");
+
+            $this->setup[$command]['short'][$short] = $long;
+        }
+    }
+
+    /**
+     * Checks the actual number of arguments against the required number
+     *
+     * Throws an exception if arguments are missing. Called from parseOptions()
+     *
+     * @throws DokuCLI_Exception
+     */
+    public function checkArguments() {
+        $argc = count($this->args);
+
+        $req = 0;
+        foreach($this->setup[$this->command]['args'] as $arg) {
+            if(!$arg['required']) break; // last required arguments seen
+            $req++;
+        }
+
+        if($req > $argc) throw new DokuCLI_Exception("Not enough arguments", DokuCLI_Exception::E_OPT_ARG_REQUIRED);
+    }
+
+    /**
+     * Parses the given arguments for known options and command
+     *
+     * The given $args array should NOT contain the executed file as first item anymore! The $args
+     * array is stripped from any options and possible command. All found otions can be accessed via the
+     * getOpt() function
+     *
+     * Note that command options will overwrite any global options with the same name
+     *
+     * @throws DokuCLI_Exception
+     */
+    public function parseOptions() {
+        $non_opts = array();
+
+        $argc = count($this->args);
+        for($i = 0; $i < $argc; $i++) {
+            $arg = $this->args[$i];
+
+            // The special element '--' means explicit end of options. Treat the rest of the arguments as non-options
+            // and end the loop.
+            if($arg == '--') {
+                $non_opts = array_merge($non_opts, array_slice($this->args, $i + 1));
+                break;
+            }
+
+            // '-' is stdin - a normal argument
+            if($arg == '-') {
+                $non_opts = array_merge($non_opts, array_slice($this->args, $i));
+                break;
+            }
+
+            // first non-option
+            if($arg{0} != '-') {
+                $non_opts = array_merge($non_opts, array_slice($this->args, $i));
+                break;
+            }
+
+            // long option
+            if(strlen($arg) > 1 && $arg{1} == '-') {
+                list($opt, $val) = explode('=', substr($arg, 2), 2);
+
+                if(!isset($this->setup[$this->command]['opts'][$opt])) {
+                    throw new DokuCLI_Exception("No such option $arg", DokuCLI_Exception::E_UNKNOWN_OPT);
+                }
+
+                // argument required?
+                if($this->setup[$this->command]['opts'][$opt]['needsarg']) {
+                    if(is_null($val) && $i + 1 < $argc && !preg_match('/^--?[\w]/', $this->args[$i + 1])) {
+                        $val = $this->args[++$i];
+                    }
+                    if(is_null($val)) {
+                        throw new DokuCLI_Exception("Option $arg requires an argument", DokuCLI_Exception::E_OPT_ARG_REQUIRED);
+                    }
+                    $this->options[$opt] = $val;
+                } else {
+                    $this->options[$opt] = true;
+                }
+
+                continue;
+            }
+
+            // short option
+            $opt = substr($arg, 1);
+            if(!isset($this->setup[$this->command]['short'][$opt])) {
+                throw new DokuCLI_Exception("No such option $arg", DokuCLI_Exception::E_UNKNOWN_OPT);
+            } else {
+                $opt = $this->setup[$this->command]['short'][$opt]; // store it under long name
+            }
+
+            // argument required?
+            if($this->setup[$this->command]['opts'][$opt]['needsarg']) {
+                $val = null;
+                if($i + 1 < $argc && !preg_match('/^--?[\w]/', $this->args[$i + 1])) {
+                    $val = $this->args[++$i];
+                }
+                if(is_null($val)) {
+                    throw new DokuCLI_Exception("Option $arg requires an argument", DokuCLI_Exception::E_OPT_ARG_REQUIRED);
+                }
+                $this->options[$opt] = $val;
+            } else {
+                $this->options[$opt] = true;
+            }
+        }
+
+        // parsing is now done, update args array
+        $this->args = $non_opts;
+
+        // if not done yet, check if first argument is a command and reexecute argument parsing if it is
+        if(!$this->command && $this->args && isset($this->setup[$this->args[0]])) {
+            // it is a command!
+            $this->command = array_shift($this->args);
+            $this->parseOptions(); // second pass
+        }
+    }
+
+    /**
+     * Get the value of the given option
+     *
+     * Please note that all options are accessed by their long option names regardless of how they were
+     * specified on commandline.
+     *
+     * Can only be used after parseOptions() has been run
+     *
+     * @param string $option
+     * @param mixed  $default what to return if the option was not set
+     * @return mixed
+     */
+    public function getOpt($option, $default = false) {
+        if(isset($this->options[$option])) return $this->options[$option];
+        return $default;
+    }
+
+    /**
+     * Return the found command if any
+     *
+     * @return string
+     */
+    public function getCmd() {
+        return $this->command;
+    }
+
+    /**
+     * Builds a help screen from the available options. You may want to call it from -h or on error
+     *
+     * @return string
+     */
+    public function help() {
+        $text = '';
+
+        $hascommands = (count($this->setup) > 1);
+        foreach($this->setup as $command => $config) {
+            $hasopts = (bool) $this->setup[$command]['opts'];
+            $hasargs = (bool) $this->setup[$command]['args'];
+
+            if(!$command) {
+                $text .= 'USAGE: '.$this->bin;
+            } else {
+                $text .= "\n$command";
+            }
+
+            if($hasopts) $text .= ' <OPTIONS>';
+
+            foreach($this->setup[$command]['args'] as $arg) {
+                if($arg['required']) {
+                    $text .= ' <'.$arg['name'].'>';
+                } else {
+                    $text .= ' [<'.$arg['name'].'>]';
+                }
+            }
+            $text .= "\n";
+
+            if($this->setup[$command]['help']) {
+                $text .= "\n";
+                $text .= $this->tableFormat(
+                    array(2, 72),
+                    array('', $this->setup[$command]['help']."\n")
+                );
+            }
+
+            if($hasopts) {
+                $text .= "\n  OPTIONS\n\n";
+                foreach($this->setup[$command]['opts'] as $long => $opt) {
+
+                    $name = '';
+                    if($opt['short']) {
+                        $name .= '-'.$opt['short'];
+                        if($opt['needsarg']) $name .= ' <'.$opt['needsarg'].'>';
+                        $name .= ', ';
+                    }
+                    $name .= "--$long";
+                    if($opt['needsarg']) $name .= ' <'.$opt['needsarg'].'>';
+
+                    $text .= $this->tableFormat(
+                        array(2, 20, 52),
+                        array('', $name, $opt['help'])
+                    );
+                    $text .= "\n";
+                }
+            }
+
+            if($hasargs) {
+                $text .= "\n";
+                foreach($this->setup[$command]['args'] as $arg) {
+                    $name = '<'.$arg['name'].'>';
+
+                    $text .= $this->tableFormat(
+                        array(2, 20, 52),
+                        array('', $name, $arg['help'])
+                    );
+                }
+            }
+
+            if($command == '' && $hascommands) {
+                $text .= "\nThis tool accepts a command as first parameter as outlined below:\n";
+            }
+        }
+
+        return $text;
+    }
+
+    /**
+     * Safely read the $argv PHP array across different PHP configurations.
+     * Will take care on register_globals and register_argc_argv ini directives
+     *
+     * @throws DokuCLI_Exception
+     * @return array the $argv PHP array or PEAR error if not registered
+     */
+    private function readPHPArgv() {
+        global $argv;
+        if(!is_array($argv)) {
+            if(!@is_array($_SERVER['argv'])) {
+                if(!@is_array($GLOBALS['HTTP_SERVER_VARS']['argv'])) {
+                    throw new DokuCLI_Exception(
+                        "Could not read cmd args (register_argc_argv=Off?)",
+                        DOKU_CLI_OPTS_ARG_READ
+                    );
+                }
+                return $GLOBALS['HTTP_SERVER_VARS']['argv'];
+            }
+            return $_SERVER['argv'];
+        }
+        return $argv;
+    }
+
+    /**
+     * Displays text in multiple word wrapped columns
+     *
+     * @param array $widths list of column widths (in characters)
+     * @param array $texts  list of texts for each column
+     * @return string
+     */
+    private function tableFormat($widths, $texts) {
+        $wrapped = array();
+        $maxlen  = 0;
+
+        foreach($widths as $col => $width) {
+            $wrapped[$col] = explode("\n", wordwrap($texts[$col], $width - 1, "\n", true)); // -1 char border
+            $len           = count($wrapped[$col]);
+            if($len > $maxlen) $maxlen = $len;
+
+        }
+
+        $out = '';
+        for($i = 0; $i < $maxlen; $i++) {
+            foreach($widths as $col => $width) {
+                if(isset($wrapped[$col][$i])) {
+                    $val = $wrapped[$col][$i];
+                } else {
+                    $val = '';
+                }
+                $out .= sprintf('%-'.$width.'s', $val);
+            }
+            $out .= "\n";
+        }
+        return $out;
+    }
+}
+
+/**
+ * Class DokuCLI_Exception
+ *
+ * The code is used as exit code for the CLI tool. This should probably be extended. Many cases just fall back to the
+ * E_ANY code.
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+class DokuCLI_Exception extends Exception {
+    const E_ANY = -1; // no error code specified
+    const E_UNKNOWN_OPT = 1; //Unrecognized option
+    const E_OPT_ARG_REQUIRED = 2; //Option requires argument
+    const E_OPT_ARG_DENIED = 3; //Option not allowed argument
+    const E_OPT_ABIGUOUS = 4; //Option abiguous
+    const E_ARG_READ = 5; //Could not read argv
+
+    public function __construct($message = "", $code = 0, Exception $previous = null) {
+        if(!$code) $code = DokuCLI_Exception::E_ANY;
+        parent::__construct($message, $code, $previous);
+    }
+}
diff --git a/inc/cliopts.php b/inc/cliopts.php
index 3eac72e5b589f5415237a016e3d41aaaa48a2108..c75a5a93b4ccfb37b29d5659f70f47ed5d788271 100644
--- a/inc/cliopts.php
+++ b/inc/cliopts.php
@@ -68,6 +68,7 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
  *
  * @author Andrei Zmievski <andrei@php.net>
  *
+ * @deprecated 2014-05-16
  */
 class Doku_Cli_Opts {
 
diff --git a/inc/common.php b/inc/common.php
index 44cfe91baf09e659224509822ebae68fcc70a7eb..11b8a7e26244e8d118e73522ec5044d96a44083d 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -22,6 +22,9 @@ define('RECENTS_MEDIA_PAGES_MIXED', 32);
  *
  * @author Andreas Gohr <andi@splitbrain.org>
  * @see    htmlspecialchars()
+ *
+ * @param string $string the string being converted
+ * @return string converted string
  */
 function hsc($string) {
     return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
@@ -33,6 +36,9 @@ function hsc($string) {
  * You can give an indention as optional parameter
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $string  line of text
+ * @param int    $indent  number of spaces indention
  */
 function ptln($string, $indent = 0) {
     echo str_repeat(' ', $indent)."$string\n";
@@ -42,6 +48,9 @@ function ptln($string, $indent = 0) {
  * strips control characters (<32) from the given string
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param $string string being stripped
+ * @return string
  */
 function stripctl($string) {
     return preg_replace('/[\x00-\x1F]+/s', '', $string);
@@ -63,6 +72,9 @@ function getSecurityToken() {
 
 /**
  * Check the secret CSRF token
+ *
+ * @param null|string $token security token or null to read it from request variable
+ * @return bool success if the token matched
  */
 function checkSecurityToken($token = null) {
     /** @var Input $INPUT */
@@ -81,6 +93,9 @@ function checkSecurityToken($token = null) {
  * Print a hidden form field with a secret CSRF token
  *
  * @author  Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param bool $print  if true print the field, otherwise html of the field is returned
+ * @return void|string html of hidden form field
  */
 function formSecurityToken($print = true) {
     $ret = '<div class="no"><input type="hidden" name="sectok" value="'.getSecurityToken().'" /></div>'."\n";
@@ -93,6 +108,11 @@ function formSecurityToken($print = true) {
  *
  * @author Andreas Gohr <andi@splitbrain.org>
  * @author Chris Smith <chris@jalakai.co.uk>
+ *
+ * @param string $id         pageid
+ * @param bool   $htmlClient add info about whether is mobile browser
+ * @return array with info for a request of $id
+ *
  */
 function basicinfo($id, $htmlClient=true){
     global $USERINFO;
@@ -139,6 +159,8 @@ function basicinfo($id, $htmlClient=true){
  * array.
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @return array with info about current document
  */
 function pageinfo() {
     global $ID;
@@ -246,6 +268,8 @@ function pageinfo() {
 
 /**
  * Return information about the current media item as an associative array.
+ *
+ * @return array with info about current media item
  */
 function mediainfo(){
     global $NS;
@@ -261,6 +285,10 @@ function mediainfo(){
  * Build an string of URL parameters
  *
  * @author Andreas Gohr
+ *
+ * @param array  $params    array with key-value pairs
+ * @param string $sep       series of pairs are separated by this character
+ * @return string query string
  */
 function buildURLparams($params, $sep = '&amp;') {
     $url = '';
@@ -281,6 +309,10 @@ function buildURLparams($params, $sep = '&amp;') {
  * Skips keys starting with '_', values get HTML encoded
  *
  * @author Andreas Gohr
+ *
+ * @param array $params    array with (attribute name-attribute value) pairs
+ * @param bool  $skipempty skip empty string values?
+ * @return string
  */
 function buildAttributes($params, $skipempty = false) {
     $url   = '';
@@ -302,6 +334,8 @@ function buildAttributes($params, $skipempty = false) {
  * This builds the breadcrumb trail and returns it as array
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @return array(pageid=>name, ... )
  */
 function breadcrumbs() {
     // we prepare the breadcrumbs early for quick session closing
@@ -361,6 +395,10 @@ function breadcrumbs() {
  * Urlencoding is ommitted when the second parameter is false
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id pageid being filtered
+ * @param bool   $ue apply urlencoding?
+ * @return string
  */
 function idfilter($id, $ue = true) {
     global $conf;
@@ -378,6 +416,7 @@ function idfilter($id, $ue = true) {
     if($ue) {
         $id = rawurlencode($id);
         $id = str_replace('%3A', ':', $id); //keep as colon
+        $id = str_replace('%3B', ';', $id); //keep as semicolon
         $id = str_replace('%2F', '/', $id); //keep as slash
     }
     return $id;
@@ -386,10 +425,15 @@ function idfilter($id, $ue = true) {
 /**
  * This builds a link to a wikipage
  *
- * It handles URL rewriting and adds additional parameter if
- * given in $more
+ * It handles URL rewriting and adds additional parameters
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string       $id             page id, defaults to start page
+ * @param string|array $urlParameters  URL parameters, associative array recommended
+ * @param bool         $absolute       request an absolute URL instead of relative
+ * @param string       $separator      parameter separator
+ * @return string
  */
 function wl($id = '', $urlParameters = '', $absolute = false, $separator = '&amp;') {
     global $conf;
@@ -433,13 +477,19 @@ function wl($id = '', $urlParameters = '', $absolute = false, $separator = '&amp
  * Handles URL rewriting if enabled. Follows the style of wl().
  *
  * @author Ben Coburn <btcoburn@silicodon.net>
+ * @param string       $id             page id, defaults to start page
+ * @param string       $format         the export renderer to use
+ * @param string|array $urlParameters  URL parameters, associative array recommended
+ * @param bool         $abs            request an absolute URL instead of relative
+ * @param string       $sep            parameter separator
+ * @return string
  */
-function exportlink($id = '', $format = 'raw', $more = '', $abs = false, $sep = '&amp;') {
+function exportlink($id = '', $format = 'raw', $urlParameters = '', $abs = false, $sep = '&amp;') {
     global $conf;
-    if(is_array($more)) {
-        $more = buildURLparams($more, $sep);
+    if(is_array($urlParameters)) {
+        $urlParameters = buildURLparams($urlParameters, $sep);
     } else {
-        $more = str_replace(',', $sep, $more);
+        $urlParameters = str_replace(',', $sep, $urlParameters);
     }
 
     $format = rawurlencode($format);
@@ -452,13 +502,13 @@ function exportlink($id = '', $format = 'raw', $more = '', $abs = false, $sep =
 
     if($conf['userewrite'] == 2) {
         $xlink .= DOKU_SCRIPT.'/'.$id.'?do=export_'.$format;
-        if($more) $xlink .= $sep.$more;
+        if($urlParameters) $xlink .= $sep.$urlParameters;
     } elseif($conf['userewrite'] == 1) {
         $xlink .= '_export/'.$format.'/'.$id;
-        if($more) $xlink .= '?'.$more;
+        if($urlParameters) $xlink .= '?'.$urlParameters;
     } else {
         $xlink .= DOKU_SCRIPT.'?do=export_'.$format.$sep.'id='.$id;
-        if($more) $xlink .= $sep.$more;
+        if($urlParameters) $xlink .= $sep.$urlParameters;
     }
 
     return $xlink;
@@ -566,6 +616,8 @@ function ml($id = '', $more = '', $direct = true, $sep = '&amp;', $abs = false)
  * Consider using wl() instead, unless you absoutely need the doku.php endpoint
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @return string
  */
 function script() {
     return DOKU_BASE.DOKU_SCRIPT;
@@ -592,6 +644,7 @@ function script() {
  *
  * @author Andreas Gohr <andi@splitbrain.org>
  * @author Michael Klier <chi@chimeric.de>
+ *
  * @param  string $text - optional text to check, if not given the globals are used
  * @return bool         - true if a spam word was found
  */
@@ -660,6 +713,7 @@ function checkwordblock($text = '') {
  * headers
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
  * @param  boolean $single If set only a single IP is returned
  * @return string
  */
@@ -731,6 +785,8 @@ function clientIP($single = false) {
  * Adapted from the example code at url below
  *
  * @link http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#code
+ *
+ * @return bool if true, client is mobile browser; otherwise false
  */
 function clientismobile() {
     /* @var Input $INPUT */
@@ -755,6 +811,7 @@ function clientismobile() {
  * If $conf['dnslookups'] is disabled it simply returns the input string
  *
  * @author Glen Harris <astfgl@iamnota.org>
+ *
  * @param  string $ips comma separated list of IP addresses
  * @return string a comma separated list of hostnames
  */
@@ -781,6 +838,9 @@ function gethostsbyaddrs($ips) {
  * removes stale lockfiles
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id
+ * @return bool page is locked?
  */
 function checklock($id) {
     global $conf;
@@ -800,7 +860,7 @@ function checklock($id) {
 
     //my own lock
     @list($ip, $session) = explode("\n", io_readFile($lock));
-    if($ip == $INPUT->server->str('REMOTE_USER') || $ip == clientIP() || $session == session_id()) {
+    if($ip == $INPUT->server->str('REMOTE_USER') || $ip == clientIP() || (session_id() && $session == session_id())) {
         return false;
     }
 
@@ -811,6 +871,8 @@ function checklock($id) {
  * Lock a page for editing
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id to lock
  */
 function lock($id) {
     global $conf;
@@ -833,6 +895,7 @@ function lock($id) {
  * Unlock a page if it was locked by the user
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
  * @param string $id page id to unlock
  * @return bool true if a lock was removed
  */
@@ -858,6 +921,9 @@ function unlock($id) {
  *
  * @see    formText() for 2crlf conversion
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $text
+ * @return string
  */
 function cleanText($text) {
     $text = preg_replace("/(\015\012)|(\015)/", "\012", $text);
@@ -877,6 +943,9 @@ function cleanText($text) {
  *
  * @see    cleanText() for 2unix conversion
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $text
+ * @return string
  */
 function formText($text) {
     $text = str_replace("\012", "\015\012", $text);
@@ -887,6 +956,10 @@ function formText($text) {
  * Returns the specified local text in raw format
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id   page id
+ * @param string $ext  extension of file being read, default 'txt'
+ * @return string
  */
 function rawLocale($id, $ext = 'txt') {
     return io_readFile(localeFN($id, $ext));
@@ -896,6 +969,10 @@ function rawLocale($id, $ext = 'txt') {
  * Returns the raw WikiText
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id   page id
+ * @param string $rev  timestamp when a revision of wikitext is desired
+ * @return string
  */
 function rawWiki($id, $rev = '') {
     return io_readWikiPage(wikiFN($id, $rev), $id, $rev);
@@ -906,6 +983,9 @@ function rawWiki($id, $rev = '') {
  *
  * @triggers COMMON_PAGETPL_LOAD
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id the id of the page to be created
+ * @return string parsed pagetemplate content
  */
 function pageTemplate($id) {
     global $conf;
@@ -957,6 +1037,9 @@ function pageTemplate($id) {
  * This works on data from COMMON_PAGETPL_LOAD
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array $data array with event data
+ * @return string
  */
 function parsePageTemplate(&$data) {
     /**
@@ -1024,6 +1107,11 @@ function parsePageTemplate(&$data) {
  * The returned order is prefix, section and suffix.
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $range in form "from-to"
+ * @param string $id    page id
+ * @param string $rev   optional, the revision timestamp
+ * @return array with three slices
  */
 function rawWikiSlices($range, $id, $rev = '') {
     $text = io_readWikiPage(wikiFN($id, $rev), $id, $rev);
@@ -1048,6 +1136,12 @@ function rawWikiSlices($range, $id, $rev = '') {
  * lines between sections if needed (used on saving).
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $pre   prefix
+ * @param string $text  text in the middle
+ * @param string $suf   suffix
+ * @param bool $pretty add additional empty lines between sections
+ * @return string
  */
 function con($pre, $text, $suf, $pretty = false) {
     if($pretty) {
@@ -1072,6 +1166,11 @@ function con($pre, $text, $suf, $pretty = false) {
  *
  * @author Andreas Gohr <andi@splitbrain.org>
  * @author Ben Coburn <btcoburn@silicodon.net>
+ *
+ * @param string $id       page id
+ * @param string $text     wikitext being saved
+ * @param string $summary  summary of text update
+ * @param bool   $minor    mark this saved version as minor update
  */
 function saveWikiText($id, $text, $summary, $minor = false) {
     /* Note to developers:
@@ -1176,6 +1275,9 @@ function saveWikiText($id, $text, $summary, $minor = false) {
  * revision date
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id
+ * @return int|string revision timestamp
  */
 function saveOldRevision($id) {
     $oldf = wikiFN($id);
@@ -1195,8 +1297,8 @@ function saveOldRevision($id) {
  * @param string     $summary  What changed
  * @param boolean    $minor    Is this a minor edit?
  * @param array      $replace  Additional string substitutions, @KEY@ to be replaced by value
- *
  * @return bool
+ *
  * @author Andreas Gohr <andi@splitbrain.org>
  */
 function notify($id, $who, $rev = '', $summary = '', $minor = false, $replace = array()) {
@@ -1212,7 +1314,7 @@ function notify($id, $who, $rev = '', $summary = '', $minor = false, $replace =
     } elseif($who == 'subscribers') {
         if(!actionOK('subscribe')) return false; //subscribers enabled?
         if($conf['useacl'] && $INPUT->server->str('REMOTE_USER') && $minor) return false; //skip minors
-        $data = array('id' => $id, 'addresslist' => '', 'self' => false);
+        $data = array('id' => $id, 'addresslist' => '', 'self' => false, 'replacements' => $replace);
         trigger_event(
             'COMMON_NOTIFY_ADDRESSLIST', $data,
             array(new Subscription(), 'notifyaddresses')
@@ -1234,6 +1336,8 @@ function notify($id, $who, $rev = '', $summary = '', $minor = false, $replace =
  *
  * @author Andreas Gohr <andi@splitbrain.org>
  * @author Todd Augsburger <todd@rollerorgans.com>
+ *
+ * @return array|string
  */
 function getGoogleQuery() {
     /* @var Input $INPUT */
@@ -1275,6 +1379,7 @@ function getGoogleQuery() {
  * @param       int $size A file size
  * @param       int $dec A number of decimal places
  * @return string human readable size
+ *
  * @author      Martin Benjamin <b.martin@cybernet.ch>
  * @author      Aidan Lister <aidan@php.net>
  * @version     1.0.0
@@ -1296,6 +1401,9 @@ function filesize_h($size, $dec = 1) {
  * Return the given timestamp as human readable, fuzzy age
  *
  * @author Andreas Gohr <gohr@cosmocode.de>
+ *
+ * @param int $dt timestamp
+ * @return string
  */
 function datetime_h($dt) {
     global $lang;
@@ -1330,6 +1438,10 @@ function datetime_h($dt) {
  *
  * @see datetime_h
  * @author Andreas Gohr <gohr@cosmocode.de>
+ *
+ * @param int|null $dt      timestamp when given, null will take current timestamp
+ * @param string   $format  empty default to $conf['dformat'], or provide format as recognized by strftime()
+ * @return string
  */
 function dformat($dt = null, $format = '') {
     global $conf;
@@ -1347,6 +1459,7 @@ function dformat($dt = null, $format = '') {
  *
  * @author <ungu at terong dot com>
  * @link http://www.php.net/manual/en/function.date.php#54072
+ *
  * @param int $int_date: current date in UNIX timestamp
  * @return string
  */
@@ -1363,6 +1476,9 @@ function date_iso8601($int_date) {
  *
  * @author Harry Fuecks <hfuecks@gmail.com>
  * @author Christopher Smith <chris@jalakai.co.uk>
+ *
+ * @param string $email email address
+ * @return string
  */
 function obfuscate($email) {
     global $conf;
@@ -1390,6 +1506,10 @@ function obfuscate($email) {
  * Removes quoting backslashes
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $string
+ * @param string $char backslashed character
+ * @return string
  */
 function unslash($string, $char = "'") {
     return str_replace('\\'.$char, $char, $string);
@@ -1400,6 +1520,9 @@ function unslash($string, $char = "'") {
  *
  * @author <gilthans dot NO dot SPAM at gmail dot com>
  * @link   http://de3.php.net/manual/en/ini.core.php#79564
+ *
+ * @param string $v shorthands
+ * @return int|string
  */
 function php_to_byte($v) {
     $l   = substr($v, -1);
@@ -1417,6 +1540,7 @@ function php_to_byte($v) {
         /** @noinspection PhpMissingBreakStatementInspection */
         case 'M':
             $ret *= 1024;
+        /** @noinspection PhpMissingBreakStatementInspection */
         case 'K':
             $ret *= 1024;
             break;
@@ -1429,6 +1553,9 @@ function php_to_byte($v) {
 
 /**
  * Wrapper around preg_quote adding the default delimiter
+ *
+ * @param string $string
+ * @return string
  */
 function preg_quote_cb($string) {
     return preg_quote($string, '/');
@@ -1459,10 +1586,10 @@ function shorten($keep, $short, $max, $min = 9, $char = '…') {
 }
 
 /**
- * Return the users realname or e-mail address for use
+ * Return the users real name or e-mail address for use
  * in page footer and recent changes pages
  *
- * @param string|bool $username or false when currently logged-in user should be used
+ * @param string|null $username or null when currently logged-in user should be used
  * @param bool $textonly true returns only plain text, true allows returning html
  * @return string html or plain text(not escaped) of formatted user name
  *
@@ -1475,7 +1602,7 @@ function editorinfo($username, $textonly = false) {
 /**
  * Returns users realname w/o link
  *
- * @param string|bool $username or false when currently logged-in user should be used
+ * @param string|null $username or null when currently logged-in user should be used
  * @param bool $textonly true returns only plain text, true allows returning html
  * @return string html or plain text(not escaped) of formatted user name
  *
@@ -1517,22 +1644,20 @@ function userlink($username = null, $textonly = false) {
     $evt = new Doku_Event('COMMON_USER_LINK', $data);
     if($evt->advise_before(true)) {
         if(empty($data['name'])) {
-            if($conf['showuseras'] == 'loginname') {
-                $data['name'] = $textonly ? $data['username'] : hsc($data['username']);
-            } else {
-                if($auth) $info = $auth->getUserData($username);
-                if(isset($info) && $info) {
-                    switch($conf['showuseras']) {
-                        case 'username':
-                        case 'username_link':
-                            $data['name'] = $textonly ? $info['name'] : hsc($info['name']);
-                            break;
-                        case 'email':
-                        case 'email_link':
-                            $data['name'] = obfuscate($info['mail']);
-                            break;
-                    }
+            if($auth) $info = $auth->getUserData($username);
+            if($conf['showuseras'] != 'loginname' && isset($info) && $info) {
+                switch($conf['showuseras']) {
+                    case 'username':
+                    case 'username_link':
+                        $data['name'] = $textonly ? $info['name'] : hsc($info['name']);
+                        break;
+                    case 'email':
+                    case 'email_link':
+                        $data['name'] = obfuscate($info['mail']);
+                        break;
                 }
+            } else {
+                $data['name'] = $textonly ? $data['username'] : hsc($data['username']);
             }
         }
 
@@ -1598,6 +1723,7 @@ function userlink($username = null, $textonly = false) {
  * When no image exists, returns an empty string
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
  * @param  string $type - type of image 'badge' or 'button'
  * @return string
  */
@@ -1606,7 +1732,6 @@ function license_img($type) {
     global $conf;
     if(!$conf['license']) return '';
     if(!is_array($license[$conf['license']])) return '';
-    $lic   = $license[$conf['license']];
     $try   = array();
     $try[] = 'lib/images/license/'.$type.'/'.$conf['license'].'.png';
     $try[] = 'lib/images/license/'.$type.'/'.$conf['license'].'.gif';
@@ -1628,9 +1753,8 @@ function license_img($type) {
  * @author Filip Oscadal <webmaster@illusionsoftworks.cz>
  * @author Andreas Gohr <andi@splitbrain.org>
  *
- * @param  int $mem  Size of memory you want to allocate in bytes
- * @param int  $bytes
- * @internal param int $used already allocated memory (see above)
+ * @param int  $mem    Size of memory you want to allocate in bytes
+ * @param int  $bytes  already allocated memory (see above)
  * @return bool
  */
 function is_mem_available($mem, $bytes = 1048576) {
@@ -1661,6 +1785,8 @@ function is_mem_available($mem, $bytes = 1048576) {
  *
  * @link   http://support.microsoft.com/kb/q176113/
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $url url being directed to
  */
 function send_redirect($url) {
     /* @var Input $INPUT */
@@ -1732,6 +1858,10 @@ function valid_input_set($param, $valid_values, $array, $exc = '') {
 /**
  * Read a preference from the DokuWiki cookie
  * (remembering both keys & values are urlencoded)
+ *
+ * @param string $pref     preference key
+ * @param mixed  $default  value returned when preference not found
+ * @return string preference value
  */
 function get_doku_pref($pref, $default) {
     $enc_pref = urlencode($pref);
@@ -1750,6 +1880,9 @@ function get_doku_pref($pref, $default) {
 /**
  * Add a preference to the DokuWiki cookie
  * (remembering $_COOKIE['DOKU_PREFS'] is urlencoded)
+ *
+ * @param string $pref  preference key
+ * @param string $val   preference value
  */
 function set_doku_pref($pref, $val) {
     global $conf;
diff --git a/inc/form.php b/inc/form.php
index 9cd0491e0abfd637c4207573cc2eefb97547d579..fadc71d3e886f95e2f88de8335e03c1bcc322cbb 100644
--- a/inc/form.php
+++ b/inc/form.php
@@ -131,7 +131,7 @@ class Doku_Form {
      * The element can be either a pseudo-tag or string.
      * If string, it is printed without escaping special chars.   *
      *
-     * @param   string  $elem   Pseudo-tag or string to add to the form.
+     * @param   string|array  $elem   Pseudo-tag or string to add to the form.
      * @author  Tom N Harris <tnharris@whoopdedo.org>
      */
     function addElement($elem) {
@@ -143,8 +143,8 @@ class Doku_Form {
      *
      * Inserts a content element at a position.
      *
-     * @param   string  $pos    0-based index where the element will be inserted.
-     * @param   string  $elem   Pseudo-tag or string to add to the form.
+     * @param   string       $pos  0-based index where the element will be inserted.
+     * @param   string|array $elem Pseudo-tag or string to add to the form.
      * @author  Tom N Harris <tnharris@whoopdedo.org>
      */
     function insertElement($pos, $elem) {
@@ -156,8 +156,8 @@ class Doku_Form {
      *
      * Replace with NULL to remove an element.
      *
-     * @param   int     $pos    0-based index the element will be placed at.
-     * @param   string  $elem   Pseudo-tag or string to add to the form.
+     * @param   int          $pos  0-based index the element will be placed at.
+     * @param   string|array $elem Pseudo-tag or string to add to the form.
      * @author  Tom N Harris <tnharris@whoopdedo.org>
      */
     function replaceElement($pos, $elem) {
diff --git a/inc/fulltext.php b/inc/fulltext.php
index dd918f214ffb182755da5680c7f8222a4e921dca..aaef090e1ff6c89d6dfd143ee1a83239590eae31 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -215,7 +215,7 @@ function ft_pageLookup($id, $in_ns=false, $in_title=false){
 function _ft_pageLookup(&$data){
     // split out original parameters
     $id = $data['id'];
-    if (preg_match('/(?:^| )@(\w+)/', $id, $matches)) {
+    if (preg_match('/(?:^| )(?:@|ns:)([\w:]+)/', $id, $matches)) {
         $ns = cleanID($matches[1]) . ':';
         $id = str_replace($matches[0], '', $id);
     }
diff --git a/inc/html.php b/inc/html.php
index 3f6cd640fa1b65f54c6cf062fc8097ee19f664fe..c5cdc7462b442a9c5804cc81d5fb555b190c2272 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -412,8 +412,8 @@ function html_locked(){
 
     print p_locale_xhtml('locked');
     print '<ul>';
-    print '<li><div class="li"><strong>'.$lang['lockedby'].':</strong> '.editorinfo($INFO['locked']).'</div></li>';
-    print '<li><div class="li"><strong>'.$lang['lockexpire'].':</strong> '.$expire.' ('.$min.' min)</div></li>';
+    print '<li><div class="li"><strong>'.$lang['lockedby'].'</strong> '.editorinfo($INFO['locked']).'</div></li>';
+    print '<li><div class="li"><strong>'.$lang['lockexpire'].'</strong> '.$expire.' ('.$min.' min)</div></li>';
     print '</ul>';
 }
 
@@ -923,6 +923,14 @@ function html_li_default($item){
  * a member of an object.
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array    $data  array with item arrays
+ * @param string   $class class of ul wrapper
+ * @param callable $func  callback to print an list item
+ * @param string   $lifunc callback to the opening li tag
+ * @param bool     $forcewrapper Trigger building a wrapper ul if the first level is
+                                 0 (we have a root object) or 1 (just the root content)
+ * @return string html of an unordered list
  */
 function html_buildlist($data,$class,$func,$lifunc='html_li_default',$forcewrapper=false){
     if (count($data) === 0) {
@@ -1336,7 +1344,7 @@ function html_diff_navigation($pagelog, $type, $l_rev, $r_rev) {
         $info = $pagelog->getRevisionInfo($rev);
         $l_revisions[$rev] = array(
             $rev,
-            dformat($info['date']) . ' ' . editorinfo($info['user']) . ' ' . $info['sum'],
+            dformat($info['date']) . ' ' . editorinfo($info['user'], true) . ' ' . $info['sum'],
             $r_rev ? $rev >= $r_rev : false //disable?
         );
     }
@@ -1348,7 +1356,7 @@ function html_diff_navigation($pagelog, $type, $l_rev, $r_rev) {
         $info = $pagelog->getRevisionInfo($rev);
         $r_revisions[$rev] = array(
             $rev,
-            dformat($info['date']) . ' ' . editorinfo($info['user']) . ' ' . $info['sum'],
+            dformat($info['date']) . ' ' . editorinfo($info['user'], true) . ' ' . $info['sum'],
             $rev <= $l_rev //disable?
         );
     }
diff --git a/inc/indexer.php b/inc/indexer.php
index a167db47f72bb34d1b8bee5bf1eab9499eec44cc..5ca2f0bb1ff327351971b2263299f7ec49d3c698 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -1218,19 +1218,18 @@ class Doku_Indexer {
      * @author Tom N Harris <tnharris@whoopdedo.org>
      */
     protected function updateTuple($line, $id, $count) {
-        $newLine = $line;
-        if ($newLine !== ''){
-            $newLine = preg_replace('/(^|:)'.preg_quote($id,'/').'\*\d*/', '', $newLine);
+        if ($line != ''){
+            $line = preg_replace('/(^|:)'.preg_quote($id,'/').'\*\d*/', '', $line);
         }
-        $newLine = trim($newLine, ':');
+        $line = trim($line, ':');
         if ($count) {
-            if (strlen($newLine) > 0) {
-                return "$id*$count:".$newLine;
+            if ($line) {
+                return "$id*$count:".$line;
             } else {
-                return "$id*$count".$newLine;
+                return "$id*$count";
             }
         }
-        return $newLine;
+        return $line;
     }
 
     /**
diff --git a/inc/infoutils.php b/inc/infoutils.php
index 0992040d97f29dd30fc883167ff42f2444b953a3..f9ba115608c4355599efd77d7ac638f5e8599868 100644
--- a/inc/infoutils.php
+++ b/inc/infoutils.php
@@ -30,7 +30,12 @@ function checkUpdateMessages(){
         $http = new DokuHTTPClient();
         $http->timeout = 12;
         $data = $http->get(DOKU_MESSAGEURL.$updateVersion);
-        io_saveFile($cf,$data);
+        if(substr(trim($data), -1) != '%') {
+            // this doesn't look like one of our messages, maybe some WiFi login interferred
+            $data = '';
+        }else {
+            io_saveFile($cf,$data);
+        }
     }else{
         dbglog("checkUpdateMessages(): messages.txt up to date");
         $data = io_readFile($cf);
@@ -280,6 +285,15 @@ define('MSG_USERS_ONLY', 1);
 define('MSG_MANAGERS_ONLY',2);
 define('MSG_ADMINS_ONLY',4);
 
+/**
+ * Display a message to the user
+ *
+ * @param string $message
+ * @param int    $lvl   -1 = error, 0 = info, 1 = success, 2 = notify
+ * @param string $line  line number
+ * @param string $file  file number
+ * @param int    $allow who's allowed to see the message, see MSG_* constants
+ */
 function msg($message,$lvl=0,$line='',$file='',$allow=MSG_PUBLIC){
     global $MSG, $MSG_shown;
     $errors[-1] = 'error';
@@ -309,6 +323,7 @@ function msg($message,$lvl=0,$line='',$file='',$allow=MSG_PUBLIC){
  *                         lvl   => int, level of the message (see msg() function)
  *                         allow => int, flag used to determine who is allowed to see the message
  *                                       see MSG_* constants
+ * @return bool
  */
 function info_msg_allowed($msg){
     global $INFO, $auth;
@@ -383,6 +398,32 @@ function dbglog($msg,$header=''){
     }
 }
 
+/**
+ * Log accesses to deprecated fucntions to the debug log
+ *
+ * @param string $alternative The function or method that should be used instead
+ */
+function dbg_deprecated($alternative = '') {
+    global $conf;
+    if(!$conf['allowdebug']) return;
+
+    $backtrace = debug_backtrace();
+    array_shift($backtrace);
+    $self = array_shift($backtrace);
+    $call = array_shift($backtrace);
+
+    $called = trim($self['class'].'::'.$self['function'].'()', ':');
+    $caller = trim($call['class'].'::'.$call['function'].'()', ':');
+
+    $msg = $called.' is deprecated. It was called from ';
+    $msg .= $caller.' in '.$call['file'].':'.$call['line'];
+    if($alternative) {
+        $msg .= ' '.$alternative.' should be used instead!';
+    }
+
+    dbglog($msg);
+}
+
 /**
  * Print a reversed, prettyprinted backtrace
  *
diff --git a/inc/init.php b/inc/init.php
index 4ff2397876fee985a8b04a0aa3ae331aa8d82c7c..d825b52506bdd21bc09ce21fd432fbb1aa99e21d 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -456,10 +456,6 @@ function getBaseURL($abs=null){
         $port = '';
     }
 
-    if(!$port && isset($_SERVER['SERVER_PORT'])) {
-        $port = $_SERVER['SERVER_PORT'];
-    }
-
     if(is_null($port)){
         $port = '';
     }
@@ -490,6 +486,14 @@ function getBaseURL($abs=null){
  * @returns bool true when SSL is active
  */
 function is_ssl(){
+    // check if we are behind a reverse proxy
+    if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
+        if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
+	    return true;
+	} else {
+	    return false;
+	}
+    }
     if (!isset($_SERVER['HTTPS']) ||
         preg_match('/^(|off|false|disabled)$/i',$_SERVER['HTTPS'])){
         return false;
diff --git a/inc/lang/af/jquery.ui.datepicker.js b/inc/lang/af/jquery.ui.datepicker.js
index 0922ef7a1c020367faf0e8e394850afaddc3f57b..ec86242d6157d83f62576fe34a6d5d5e4377381c 100644
--- a/inc/lang/af/jquery.ui.datepicker.js
+++ b/inc/lang/af/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Afrikaans initialisation for the jQuery UI date picker plugin. */
 /* Written by Renier Pretorius. */
-jQuery(function($){
-	$.datepicker.regional['af'] = {
-		closeText: 'Selekteer',
-		prevText: 'Vorige',
-		nextText: 'Volgende',
-		currentText: 'Vandag',
-		monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie',
-		'Julie','Augustus','September','Oktober','November','Desember'],
-		monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun',
-		'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'],
-		dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'],
-		dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'],
-		dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'],
-		weekHeader: 'Wk',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['af']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['af'] = {
+	closeText: 'Selekteer',
+	prevText: 'Vorige',
+	nextText: 'Volgende',
+	currentText: 'Vandag',
+	monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie',
+	'Julie','Augustus','September','Oktober','November','Desember'],
+	monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun',
+	'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'],
+	dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'],
+	dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'],
+	dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'],
+	weekHeader: 'Wk',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['af']);
+
+return datepicker.regional['af'];
+
+}));
diff --git a/inc/lang/af/lang.php b/inc/lang/af/lang.php
index 00811045031812377c24df4df47d5f054ef5014f..70672fbdd5fa7ec388116805141463351d3e4954 100644
--- a/inc/lang/af/lang.php
+++ b/inc/lang/af/lang.php
@@ -25,7 +25,7 @@ $lang['btn_back']              = 'Terug';
 $lang['btn_backlink']          = 'Wat skakel hierheen';
 $lang['btn_subscribe']         = 'Hou bladsy dop';
 $lang['btn_register']          = 'Skep gerus \'n rekening';
-$lang['loggedinas']            = 'Ingeteken as';
+$lang['loggedinas']            = 'Ingeteken as:';
 $lang['user']                  = 'Gebruikernaam';
 $lang['pass']                  = 'Wagwoord';
 $lang['newpass']               = 'Nuive wagwoord';
@@ -52,7 +52,7 @@ $lang['mediaroot']             = 'root';
 $lang['toc']                   = 'Inhoud';
 $lang['current']               = 'huidige';
 $lang['line']                  = 'Streak';
-$lang['youarehere']            = 'Jy is hier';
+$lang['youarehere']            = 'Jy is hier:';
 $lang['by']                    = 'by';
 $lang['restored']              = 'Het terug gegaan na vroeëre weergawe (%s)';
 $lang['summary']               = 'Voorskou';
@@ -64,7 +64,7 @@ $lang['qb_hr']                 = 'Horisontale streep';
 $lang['qb_sig']                = 'Handtekening met datum';
 $lang['admin_register']        = 'Skep gerus \'n rekening';
 $lang['btn_img_backto']        = 'Terug na %s';
-$lang['img_date']              = 'Datem';
-$lang['img_camera']            = 'Camera';
+$lang['img_date']              = 'Datem:';
+$lang['img_camera']            = 'Camera:';
 $lang['i_wikiname']            = 'Wiki Naam';
 $lang['i_funcna']              = 'PHP funksie <code>%s</code> is nie beskibaar nie. Miskien is dit af gehaal.';
diff --git a/inc/lang/ar/jquery.ui.datepicker.js b/inc/lang/ar/jquery.ui.datepicker.js
index cef0f08fd2d96a403fe8112e5d840f1a83461eb0..c93fed48dc6cd1cba06e243c04afd782562ffaef 100644
--- a/inc/lang/ar/jquery.ui.datepicker.js
+++ b/inc/lang/ar/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Arabic Translation for jQuery UI date picker plugin. */
 /* Khaled Alhourani -- me@khaledalhourani.com */
 /* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */
-jQuery(function($){
-	$.datepicker.regional['ar'] = {
-		closeText: 'إغلاق',
-		prevText: '&#x3C;السابق',
-		nextText: 'التالي&#x3E;',
-		currentText: 'اليوم',
-		monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'مايو', 'حزيران',
-		'تموز', 'آب', 'أيلول',	'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
-		monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
-		dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
-		dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
-		dayNamesMin: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
-		weekHeader: 'أسبوع',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 6,
-  		isRTL: true,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['ar']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['ar'] = {
+	closeText: 'إغلاق',
+	prevText: '&#x3C;السابق',
+	nextText: 'التالي&#x3E;',
+	currentText: 'اليوم',
+	monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'مايو', 'حزيران',
+	'تموز', 'آب', 'أيلول',	'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
+	monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
+	dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+	dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+	dayNamesMin: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
+	weekHeader: 'أسبوع',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 6,
+		isRTL: true,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['ar']);
+
+return datepicker.regional['ar'];
+
+}));
diff --git a/inc/lang/ar/lang.php b/inc/lang/ar/lang.php
index b0a2edc883b68a3903ca9b468000036380d4a92e..9d192639b25da631b5987745797fb974a9369fcb 100644
--- a/inc/lang/ar/lang.php
+++ b/inc/lang/ar/lang.php
@@ -9,6 +9,7 @@
  * @author uahello@gmail.com
  * @author Ahmad Abd-Elghany <tolpa1@gmail.com>
  * @author alhajr <alhajr300@gmail.com>
+ * @author Mohamed Belhsine <b.mohamed897@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'rtl';
@@ -53,7 +54,9 @@ $lang['btn_register']          = 'سجّل';
 $lang['btn_apply']             = 'طبق';
 $lang['btn_media']             = 'مدير الوسائط';
 $lang['btn_deleteuser']        = 'احذف حسابي الخاص';
-$lang['loggedinas']            = 'داخل باسم';
+$lang['btn_img_backto']        = 'عودة إلى %s';
+$lang['btn_mediaManager']      = 'اعرض في مدير الوسائط';
+$lang['loggedinas']            = 'داخل باسم:';
 $lang['user']                  = 'اسم المستخدم';
 $lang['pass']                  = 'كلمة السر';
 $lang['newpass']               = 'كلمة سر جديدة';
@@ -86,6 +89,7 @@ $lang['profdeleteuser']        = 'احذف حساب';
 $lang['profdeleted']           = 'حسابك الخاص تم حذفه من هذه الموسوعة';
 $lang['profconfdelete']        = 'أنا أرغب في حذف حسابي من هذه الموسوعة.<br/> 
 هذا الحدث غير ممكن.';
+$lang['profconfdeletemissing'] = 'لم تقم بوضع علامة في مربع التأكيد';
 $lang['pwdforget']             = 'أنسيت كلمة السر؟ احصل على واحدة جديدة';
 $lang['resendna']              = 'هذه الويكي لا تدعم إعادة إرسال كلمة المرور.';
 $lang['resendpwd']             = 'اضبط كلمة سر جديدة لـ';
@@ -98,12 +102,12 @@ $lang['license']               = 'مالم يشر لخلاف ذلك، فإن ا
 $lang['licenseok']             = 'لاحظ: بتحرير هذه الصفحة أنت توافق على ترخيص محتواها تحت الرخصة التالية:';
 $lang['searchmedia']           = 'ابحث في أسماء الملفات:';
 $lang['searchmedia_in']        = 'ابحث في %s';
-$lang['txt_upload']            = 'اختر ملفاً للرفع';
-$lang['txt_filename']          = 'رفع كـ (اختياري)';
+$lang['txt_upload']            = 'اختر ملفاً للرفع:';
+$lang['txt_filename']          = 'رفع كـ (اختياري):';
 $lang['txt_overwrt']           = 'اكتب على ملف موجود';
 $lang['maxuploadsize']         = 'الحجم الاقصى %s للملف';
-$lang['lockedby']              = 'مقفلة حاليا لـ';
-$lang['lockexpire']            = 'ينتهي القفل في';
+$lang['lockedby']              = 'مقفلة حاليا لـ:';
+$lang['lockexpire']            = 'ينتهي القفل في:';
 $lang['js']['willexpire']      = 'سينتهي قفل تحرير هذه الصفحه خلال دقيقة.\nلتجنب التعارض استخدم زر المعاينة لتصفير مؤقت القفل.';
 $lang['js']['notsavedyet']     = 'التعديلات غير المحفوظة ستفقد.';
 $lang['js']['searchmedia']     = 'ابحث عن ملفات';
@@ -183,10 +187,15 @@ $lang['difflink']              = 'رابط إلى هذه المقارنة';
 $lang['diff_type']             = 'أظهر الفروق:';
 $lang['diff_inline']           = 'ضمنا';
 $lang['diff_side']             = 'جنبا إلى جنب';
+$lang['diffprevrev']           = 'المراجعة السابقة';
+$lang['diffnextrev']           = 'المراجعة التالية';
+$lang['difflastrev']           = 'المراجعة الأخيرة';
+$lang['diffbothprevrev']       = 'جانبي المراجعة السابقة';
+$lang['diffbothnextrev']       = 'جانبي المراجعة التالية';
 $lang['line']                  = 'سطر';
-$lang['breadcrumb']            = 'أثر';
-$lang['youarehere']            = 'أنت هنا';
-$lang['lastmod']               = 'آخر تعديل';
+$lang['breadcrumb']            = 'أثر:';
+$lang['youarehere']            = 'أنت هنا:';
+$lang['lastmod']               = 'آخر تعديل:';
 $lang['by']                    = 'بواسطة';
 $lang['deleted']               = 'حذفت';
 $lang['created']               = 'اُنشئت';
@@ -239,20 +248,18 @@ $lang['admin_register']        = 'أضف مستخدما جديدا';
 $lang['metaedit']              = 'تحرير البيانات الشمولية ';
 $lang['metasaveerr']           = 'فشلت كتابة البيانات الشمولية';
 $lang['metasaveok']            = 'حُفظت البيانات الشمولية';
-$lang['btn_img_backto']        = 'عودة إلى %s';
-$lang['img_title']             = 'العنوان';
-$lang['img_caption']           = 'وصف';
-$lang['img_date']              = 'التاريخ';
-$lang['img_fname']             = 'اسم الملف';
-$lang['img_fsize']             = 'الحجم';
-$lang['img_artist']            = 'المصور';
-$lang['img_copyr']             = 'حقوق النسخ';
-$lang['img_format']            = 'الهيئة';
-$lang['img_camera']            = 'الكمرا';
-$lang['img_keywords']          = 'كلمات مفتاحية';
-$lang['img_width']             = 'العرض';
-$lang['img_height']            = 'الإرتفاع';
-$lang['btn_mediaManager']           = 'اعرض في مدير الوسائط';
+$lang['img_title']             = 'العنوان:';
+$lang['img_caption']           = 'وصف:';
+$lang['img_date']              = 'التاريخ:';
+$lang['img_fname']             = 'اسم الملف:';
+$lang['img_fsize']             = 'الحجم:';
+$lang['img_artist']            = 'المصور:';
+$lang['img_copyr']             = 'حقوق النسخ:';
+$lang['img_format']            = 'الهيئة:';
+$lang['img_camera']            = 'الكمرا:';
+$lang['img_keywords']          = 'كلمات مفتاحية:';
+$lang['img_width']             = 'العرض:';
+$lang['img_height']            = 'الإرتفاع:';
 $lang['subscr_subscribe_success'] = 'اضيف %s لقائمة اشتراك %s';
 $lang['subscr_subscribe_error'] = 'خطأ في إضافة %s لقائمة اشتراك %s';
 $lang['subscr_subscribe_noaddress'] = 'ليس هناك عنوان مرتبط بولوجك، لا يمكن اضافتك لقائمة الاشتراك';
@@ -287,6 +294,7 @@ $lang['i_phpver']              = 'نسخة PHP التي لديك هي
 وهي أقل من النسخة المطلوبة
 <code>%s</code>
 عليك تحديث نسخة PHP';
+$lang['i_mbfuncoverload']      = 'يجب ايقاف تشغيل mbstring.func_overload في ملف php.ini لتشغيل دوكوويكي.';
 $lang['i_permfail']            = 'إن <code>%s</code> غير قابل للكتابة بواسطة دوكو ويكي، عليك تعديل إعدادات الصلاحيات لهذا المجلد!';
 $lang['i_confexists']          = 'إن <code>%s</code> موجود أصلاً';
 $lang['i_writeerr']            = 'لا يمكن إنشاء <code>%s</code>، عليك التأكد من صلاحيات الملف أو المجلد وإنشاء الملف يدوياً.';
@@ -340,4 +348,5 @@ $lang['media_update']          = 'ارفع إصدارا أحدث';
 $lang['media_restore']         = 'استرجع هذه النسخة';
 $lang['currentns']             = 'مساحة الاسم الحالية';
 $lang['searchresult']          = 'نتيجة البحث';
+$lang['plainhtml']             = 'نص HTML غير منسق';
 $lang['wikimarkup']            = 'علامات الوكي';
diff --git a/inc/lang/az/jquery.ui.datepicker.js b/inc/lang/az/jquery.ui.datepicker.js
index a133a9eb234751e46e7e155e6cc4f3147fb867f4..be87ad411519b5cb456c3b7b9290dfc42d8349ee 100644
--- a/inc/lang/az/jquery.ui.datepicker.js
+++ b/inc/lang/az/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */
 /* Written by Jamil Najafov (necefov33@gmail.com). */
-jQuery(function($) {
-	$.datepicker.regional['az'] = {
-		closeText: 'BaÄŸla',
-		prevText: '&#x3C;Geri',
-		nextText: 'İrəli&#x3E;',
-		currentText: 'Bugün',
-		monthNames: ['Yanvar','Fevral','Mart','Aprel','May','Ä°yun',
-		'Ä°yul','Avqust','Sentyabr','Oktyabr','Noyabr','Dekabr'],
-		monthNamesShort: ['Yan','Fev','Mar','Apr','May','Ä°yun',
-		'Ä°yul','Avq','Sen','Okt','Noy','Dek'],
-		dayNames: ['Bazar','Bazar ertəsi','Çərşənbə axşamı','Çərşənbə','Cümə axşamı','Cümə','Şənbə'],
-		dayNamesShort: ['B','Be','Ça','Ç','Ca','C','Ş'],
-		dayNamesMin: ['B','B','Ç','С','Ç','C','Ş'],
-		weekHeader: 'Hf',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['az']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['az'] = {
+	closeText: 'BaÄŸla',
+	prevText: '&#x3C;Geri',
+	nextText: 'İrəli&#x3E;',
+	currentText: 'Bugün',
+	monthNames: ['Yanvar','Fevral','Mart','Aprel','May','Ä°yun',
+	'Ä°yul','Avqust','Sentyabr','Oktyabr','Noyabr','Dekabr'],
+	monthNamesShort: ['Yan','Fev','Mar','Apr','May','Ä°yun',
+	'Ä°yul','Avq','Sen','Okt','Noy','Dek'],
+	dayNames: ['Bazar','Bazar ertəsi','Çərşənbə axşamı','Çərşənbə','Cümə axşamı','Cümə','Şənbə'],
+	dayNamesShort: ['B','Be','Ça','Ç','Ca','C','Ş'],
+	dayNamesMin: ['B','B','Ç','С','Ç','C','Ş'],
+	weekHeader: 'Hf',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['az']);
+
+return datepicker.regional['az'];
+
+}));
diff --git a/inc/lang/az/lang.php b/inc/lang/az/lang.php
index 8d51d2372428baff955ee80a81d706d9950a7dab..5edcfbe58fff4546bb2240d89814ecdef8592c71 100644
--- a/inc/lang/az/lang.php
+++ b/inc/lang/az/lang.php
@@ -44,7 +44,7 @@ $lang['btn_recover']           = 'Qaralamanı qaytar';
 $lang['btn_draftdel']          = 'Qaralamanı sil';
 $lang['btn_revert']            = 'Qaytar';
 $lang['btn_register']          = 'Qeydiyyatdan keç';
-$lang['loggedinas']            = 'İstifadəcinin adı';
+$lang['loggedinas']            = 'İstifadəcinin adı:';
 $lang['user']                  = 'istifadəci adı';
 $lang['pass']                  = 'ÅžifrÉ™';
 $lang['newpass']               = 'Yeni ÅŸifrÉ™';
@@ -82,10 +82,10 @@ $lang['license']               = 'Fərqli şey göstərilmiş hallardan başqa,
 $lang['licenseok']             = 'Qeyd: bu səhifəni düzəliş edərək, Siz elədiyiniz düzəlişi aşağıda göstərilmiş lisenziyanın şərtlərinə uyğun istifadəsinə razılıq verirsiniz:';
 $lang['searchmedia']           = 'Faylın adına görə axtarış:';
 $lang['searchmedia_in']        = '%s-ın içində axtarış';
-$lang['txt_upload']            = 'Serverə yükləmək üçün fayl seçin';
-$lang['txt_filename']          = 'Faylın wiki-də olan adını daxil edin (mütləq deyil)';
+$lang['txt_upload']            = 'Serverə yükləmək üçün fayl seçin:';
+$lang['txt_filename']          = 'Faylın wiki-də olan adını daxil edin (mütləq deyil):';
 $lang['txt_overwrt']           = 'Mövcud olan faylın üstündən yaz';
-$lang['lockedby']              = 'В данный момент заблокирован Bu an blokdadır';
+$lang['lockedby']              = 'В данный момент заблокирован Bu an blokdadır:';
 $lang['lockexpire']            = 'Blok bitir:';
 $lang['js']['willexpire']            = 'Sizin bu səhifədə dəyişik etmək üçün blokunuz bir dəqiqə ərzində bitəcək.\nMünaqişələrdən yayınmaq və blokun taymerini sıfırlamaq üçün, baxış düyməsini sıxın.';
 $lang['rssfailed']             = 'Aşağıda göstərilmiş xəbər lentini əldə edən zaman xəta baş verdi: ';
@@ -128,9 +128,9 @@ $lang['yours']                 = 'Sizin versiyanız';
 $lang['diff']                  = 'hazırki versiyadan fərqləri göstər';
 $lang['diff2']                 = 'Versiyaların arasındaki fərqləri göstər  ';
 $lang['line']                  = 'Sətr';
-$lang['breadcrumb']            = 'Siz ziyarət etdiniz';
-$lang['youarehere']            = 'Siz burdasınız';
-$lang['lastmod']               = 'Son dəyişiklər';
+$lang['breadcrumb']            = 'Siz ziyarət etdiniz:';
+$lang['youarehere']            = 'Siz burdasınız:';
+$lang['lastmod']               = 'Son dəyişiklər:';
 $lang['by']                    = ' Kimdən';
 $lang['deleted']               = 'silinib';
 $lang['created']               = 'yaranıb';
@@ -173,16 +173,16 @@ $lang['metaedit']              = 'Meta-məlumatlarda düzəliş et';
 $lang['metasaveerr']           = 'Meta-məlumatları yazan zamanı xəta';
 $lang['metasaveok']            = 'Meta-məlumatlar yadda saxlandı';
 $lang['btn_img_backto']        = 'Qayıd %s';
-$lang['img_title']             = 'Başlıq';
-$lang['img_caption']           = 'Ä°mza';
-$lang['img_date']              = 'Tarix';
-$lang['img_fname']             = 'Faylın adı';
-$lang['img_fsize']             = 'Boy';
-$lang['img_artist']            = 'Şkilin müəllifi';
-$lang['img_copyr']             = 'Müəllif hüquqları';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Model';
-$lang['img_keywords']          = 'Açar sözlər';
+$lang['img_title']             = 'Başlıq:';
+$lang['img_caption']           = 'Ä°mza:';
+$lang['img_date']              = 'Tarix:';
+$lang['img_fname']             = 'Faylın adı:';
+$lang['img_fsize']             = 'Boy:';
+$lang['img_artist']            = 'Şkilin müəllifi:';
+$lang['img_copyr']             = 'Müəllif hüquqları:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Model:';
+$lang['img_keywords']          = 'Açar sözlər:';
 $lang['authtempfail']          = 'İstifadəçilərin autentifikasiyası müvəqqəti dayandırılıb. Əgər bu problem uzun müddət davam edir sə, administrator ilə əlaqə saxlayın.';
 $lang['i_chooselang']          = 'Dili seçin/Language';
 $lang['i_installer']           = 'DokuWiki quraşdırılır';
diff --git a/inc/lang/bg/jquery.ui.datepicker.js b/inc/lang/bg/jquery.ui.datepicker.js
index 86ab885828b156a5bf2c1398e8d4bf000fa140f3..0ee1b171db9132aaa7f85c5c7256ca12f6ba1dbf 100644
--- a/inc/lang/bg/jquery.ui.datepicker.js
+++ b/inc/lang/bg/jquery.ui.datepicker.js
@@ -1,24 +1,38 @@
 /* Bulgarian initialisation for the jQuery UI date picker plugin. */
 /* Written by Stoyan Kyosev (http://svest.org). */
-jQuery(function($){
-	$.datepicker.regional['bg'] = {
-		closeText: 'затвори',
-		prevText: '&#x3C;назад',
-		nextText: 'напред&#x3E;',
-		nextBigText: '&#x3E;&#x3E;',
-		currentText: 'днес',
-		monthNames: ['Януари','Февруари','Март','Април','Май','Юни',
-		'Юли','Август','Септември','Октомври','Ноември','Декември'],
-		monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни',
-		'Юли','Авг','Сеп','Окт','Нов','Дек'],
-		dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'],
-		dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'],
-		dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'],
-		weekHeader: 'Wk',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['bg']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['bg'] = {
+	closeText: 'затвори',
+	prevText: '&#x3C;назад',
+	nextText: 'напред&#x3E;',
+	nextBigText: '&#x3E;&#x3E;',
+	currentText: 'днес',
+	monthNames: ['Януари','Февруари','Март','Април','Май','Юни',
+	'Юли','Август','Септември','Октомври','Ноември','Декември'],
+	monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни',
+	'Юли','Авг','Сеп','Окт','Нов','Дек'],
+	dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'],
+	dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'],
+	dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'],
+	weekHeader: 'Wk',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['bg']);
+
+return datepicker.regional['bg'];
+
+}));
diff --git a/inc/lang/bg/lang.php b/inc/lang/bg/lang.php
index dcf66955f46914054e2e0e967708a6343e1e31d1..bfa8b2ad78221826b2b427ef0975d5f3b2439d23 100644
--- a/inc/lang/bg/lang.php
+++ b/inc/lang/bg/lang.php
@@ -50,8 +50,8 @@ $lang['btn_revert']            = 'Възстановяване';
 $lang['btn_register']          = 'Регистриране';
 $lang['btn_apply']             = 'Прилагане';
 $lang['btn_media']             = 'Диспечер на файлове';
-$lang['btn_deleteuser']        = 'Изтрий профила ми';
-$lang['loggedinas']            = 'Вписани сте като';
+$lang['btn_deleteuser']        = 'Изтриване на профила';
+$lang['loggedinas']            = 'Вписани сте като:';
 $lang['user']                  = 'Потребител';
 $lang['pass']                  = 'Парола';
 $lang['newpass']               = 'Нова парола';
@@ -62,7 +62,7 @@ $lang['fullname']              = 'Истинско име';
 $lang['email']                 = 'Електронна поща';
 $lang['profile']               = 'Потребителски профил';
 $lang['badlogin']              = 'Грешно потребителско име или парола.';
-$lang['badpassconfirm']        = 'Съжаляваме, паролата е грешна';
+$lang['badpassconfirm']        = 'За съжаление паролата е грешна';
 $lang['minoredit']             = 'Промените са незначителни';
 $lang['draftdate']             = 'Черновата е автоматично записана на';
 $lang['nosecedit']             = 'Страницата бе междувременно променена, презареждане на страницата поради неактуална информация.';
@@ -77,13 +77,13 @@ $lang['regpwmail']             = 'Паролата ви за DokuWiki';
 $lang['reghere']               = 'Все още нямате профил? Направете си';
 $lang['profna']                = 'Wiki-то не поддържа промяна на профила';
 $lang['profnochange']          = 'Няма промени.';
-$lang['profnoempty']           = 'Въвеждането на име и ел. поща е задължително';
+$lang['profnoempty']           = 'Въвеждането на име и имейл е задължително';
 $lang['profchanged']           = 'Потребителският профил е обновен успешно.';
-$lang['profnodelete']          = 'Не е възможно изтриване на потребители в това wiki ';
-$lang['profdeleteuser']        = 'Изтрий профила ми';
+$lang['profnodelete']          = 'Изтриването на потребители в това wiki не е възможно';
+$lang['profdeleteuser']        = 'Изтриване на профила';
 $lang['profdeleted']           = 'Вашият профил е премахнат от това wiki ';
-$lang['profconfdelete']        = 'Искам да изтрия профила си от това wiki. <br/>  Веднъж изтрит, профила не може да бъде възстановен!';
-$lang['profconfdeletemissing'] = 'Не и маркирана опцията за потвърждение';
+$lang['profconfdelete']        = 'Искам да изтрия профила си от това wiki. <br/>  Веднъж изтрит, профилът не може да бъде възстановен!';
+$lang['profconfdeletemissing'] = 'Не сте поставили отметка в кутията потвърждение';
 $lang['pwdforget']             = 'Забравили сте паролата си? Получете нова';
 $lang['resendna']              = 'Wiki-то не поддържа повторно пращане на паролата.';
 $lang['resendpwd']             = 'Задаване на нова парола за';
@@ -96,12 +96,12 @@ $lang['license']               = 'Ако не е посочено друго, с
 $lang['licenseok']             = 'Бележка: Редактирайки страницата, Вие се съгласявате да лицензирате промените (които сте направили) под следния лиценз:';
 $lang['searchmedia']           = 'Търсене на файл: ';
 $lang['searchmedia_in']        = 'Търсене в %s';
-$lang['txt_upload']            = 'Изберете файл за качване';
-$lang['txt_filename']          = 'Качи като (незадължително)';
+$lang['txt_upload']            = 'Изберете файл за качване:';
+$lang['txt_filename']          = 'Качи като (незадължително):';
 $lang['txt_overwrt']           = 'Презапиши съществуващите файлове';
 $lang['maxuploadsize']         = 'Макс. размер за отделните файлове е %s.';
-$lang['lockedby']              = 'В момента е заключена от';
-$lang['lockexpire']            = 'Ще бъде отключена на';
+$lang['lockedby']              = 'В момента е заключена от:';
+$lang['lockexpire']            = 'Ще бъде отключена на:';
 $lang['js']['willexpire']      = 'Страницата ще бъде отключена за редактиране след минута.\nЗа предотвратяване на конфликти, ползвайте бутона "Преглед", за рестартиране на брояча за заключване.';
 $lang['js']['notsavedyet']     = 'Незаписаните промени ще бъдат загубени. Желаете ли да продължите?';
 $lang['js']['searchmedia']     = 'Търсене на файлове';
@@ -140,7 +140,7 @@ $lang['js']['media_diff_portions'] = 'По половинка';
 $lang['js']['media_select']    = 'Изберете файлове...';
 $lang['js']['media_upload_btn'] = 'Качване';
 $lang['js']['media_done_btn']  = 'Готово';
-$lang['js']['media_drop']      = 'Влачете и пуснете файливе тук, за да бъдат качени';
+$lang['js']['media_drop']      = 'Влачете и пуснете файлове тук, за да бъдат качени';
 $lang['js']['media_cancel']    = 'премахване';
 $lang['js']['media_overwrt']   = 'Презапиши съществуващите файлове';
 $lang['rssfailed']             = 'Възникна грешка при получаването на емисията: ';
@@ -164,7 +164,7 @@ $lang['accessdenied']          = 'Нямате необходимите прав
 $lang['mediausage']            = 'Ползвайте следния синтаксис, за да упоменете файла:';
 $lang['mediaview']             = 'Преглед на оригиналния файл';
 $lang['mediaroot']             = 'root';
-$lang['mediaupload']           = 'Качете файл в текущото именно пространство. За създаване на подимено пространство, добавете име преди това на файла като ги разделите с двоеточие в полето "Качи като"';
+$lang['mediaupload']           = 'Качете файл в текущото именно пространство. За създаване на подименно пространство, добавете име преди това на файла като ги разделите с двоеточие в полето "Качи като"';
 $lang['mediaextchange']        = 'Разширението на файла е сменено от .%s на .%s!';
 $lang['reference']             = 'Връзки за';
 $lang['ref_inuse']             = 'Файлът не може да бъде изтрит, защото все още се ползва от следните страници:';
@@ -181,9 +181,9 @@ $lang['diff_type']             = 'Преглед на разликите:';
 $lang['diff_inline']           = 'Вграден';
 $lang['diff_side']             = 'Един до друг';
 $lang['line']                  = 'Ред';
-$lang['breadcrumb']            = 'Следа';
-$lang['youarehere']            = 'Намирате се в';
-$lang['lastmod']               = 'Последна промяна';
+$lang['breadcrumb']            = 'Следа:';
+$lang['youarehere']            = 'Намирате се в:';
+$lang['lastmod']               = 'Последна промяна:';
 $lang['by']                    = 'от';
 $lang['deleted']               = 'изтрита';
 $lang['created']               = 'създадена';
@@ -237,22 +237,22 @@ $lang['metaedit']              = 'Редактиране на метаданни
 $lang['metasaveerr']           = 'Записването на метаданните се провали';
 $lang['metasaveok']            = 'Метаданните са запазени успешно';
 $lang['btn_img_backto']        = 'Назад към %s';
-$lang['img_title']             = 'Заглавие';
-$lang['img_caption']           = 'Надпис';
-$lang['img_date']              = 'Дата';
-$lang['img_fname']             = 'Име на файла';
-$lang['img_fsize']             = 'Размер';
-$lang['img_artist']            = 'Фотограф';
-$lang['img_copyr']             = 'Авторско право';
-$lang['img_format']            = 'Формат';
-$lang['img_camera']            = 'Фотоапарат';
-$lang['img_keywords']          = 'Ключови думи';
-$lang['img_width']             = 'Ширина';
-$lang['img_height']            = 'Височина';
+$lang['img_title']             = 'Заглавие:';
+$lang['img_caption']           = 'Надпис:';
+$lang['img_date']              = 'Дата:';
+$lang['img_fname']             = 'Име на файла:';
+$lang['img_fsize']             = 'Размер:';
+$lang['img_artist']            = 'Фотограф:';
+$lang['img_copyr']             = 'Авторско право:';
+$lang['img_format']            = 'Формат:';
+$lang['img_camera']            = 'Фотоапарат:';
+$lang['img_keywords']          = 'Ключови думи:';
+$lang['img_width']             = 'Ширина:';
+$lang['img_height']            = 'Височина:';
 $lang['btn_mediaManager']      = 'Преглед в диспечера на файлове';
 $lang['subscr_subscribe_success'] = '%s е добавен към списъка с абониралите се за %s';
 $lang['subscr_subscribe_error'] = 'Грешка при добавянето на %s към списъка с абониралите се за %s';
-$lang['subscr_subscribe_noaddress'] = 'Добавянето ви към списъка с абонати не е възможно поради липсата на свързан адрес (на ел. поща) с профила ви.';
+$lang['subscr_subscribe_noaddress'] = 'Добавянето ви към списъка с абонати не е възможно поради липсата на свързан адрес (имейл) с профила ви.';
 $lang['subscr_unsubscribe_success'] = '%s е премахнат от списъка с абониралите се за %s';
 $lang['subscr_unsubscribe_error'] = 'Грешка при премахването на %s от списъка с абониралите се за %s';
 $lang['subscr_already_subscribed'] = '%s е вече абониран за %s';
@@ -263,12 +263,12 @@ $lang['subscr_m_current_header'] = 'Текущи абонаменти';
 $lang['subscr_m_unsubscribe']  = 'Прекратяване на абонамента';
 $lang['subscr_m_subscribe']    = 'Абониране';
 $lang['subscr_m_receive']      = 'Получаване';
-$lang['subscr_style_every']    = 'на ел. писмо при всяка промяна';
-$lang['subscr_style_digest']   = 'на ел. писмо с обобщение на промените във всяка страница (всеки %.2f дни)';
-$lang['subscr_style_list']     = 'на списък с променените страници от последното ел. писмо (всеки %.2f дни)';
+$lang['subscr_style_every']    = 'на имейл при всяка промяна';
+$lang['subscr_style_digest']   = 'на имейл с обобщение на промените във всяка страница (всеки %.2f дни)';
+$lang['subscr_style_list']     = 'на списък с променените страници от последния имейл (всеки %.2f дни)';
 $lang['authtempfail']          = 'Удостоверяването на потребители не е възможно за момента. Ако продължи дълго, моля уведомете администратора на Wiki страницата.';
-$lang['authpwdexpire']         = 'Срока на паролата ви ще изтече след %d дни. Препорачително е да я смените по-скоро.';
-$lang['i_chooselang']          = 'Изберете вашия изик';
+$lang['authpwdexpire']         = 'Срока на паролата ви ще изтече след %d дни. Препоръчително е да я смените по-скоро.';
+$lang['i_chooselang']          = 'Изберете вашия език';
 $lang['i_installer']           = 'Инсталатор на DokuWiki';
 $lang['i_wikiname']            = 'Име на Wiki-то';
 $lang['i_enableacl']           = 'Ползване на списък за достъп (ACL) [препоръчително]';
diff --git a/inc/lang/bg/register.txt b/inc/lang/bg/register.txt
index 51fbb83fe44a42bb2ad0919a821c8ea91b1ebbe5..333428005fb6fc25d13dbe93b822d3612b6849e9 100644
--- a/inc/lang/bg/register.txt
+++ b/inc/lang/bg/register.txt
@@ -1,4 +1,4 @@
 ====== Регистриране като нов потребител ======
 
-Моля, попълнете всичките полета отдолу, за да бъде създаден нов профил. Уверете се, че въведеният **адрес на ел. поща е правилен**. Ако няма поле за парола, ще ви бъде изпратена такава на въведения адрес. Потребителското име трябва да бъде валидно [[doku>pagename|име на страница]].
+Моля, попълнете всичките полета отдолу, за да бъде създаден нов профил. Уверете се, че въведеният **имейл адрес е правилен**. Ако няма поле за парола, ще ви бъде изпратена такава на въведения адрес. Потребителското име трябва да бъде валидно [[doku>pagename|име на страница]].
 
diff --git a/inc/lang/bg/resendpwd.txt b/inc/lang/bg/resendpwd.txt
index 38e2d1fe48928e68a3ca80e90368ced0c01654cc..19dffc0703942607382eed29d7bd45e2964e7d5a 100644
--- a/inc/lang/bg/resendpwd.txt
+++ b/inc/lang/bg/resendpwd.txt
@@ -1,3 +1,3 @@
 ====== Пращане на нова парола ======
 
-Моля, въведете потребителското си име във формата по-долу, ако желаете да получите нова парола. По ел. поща ще получите линк, с който да потвърдите.
+Моля, въведете потребителското си име във формата по-долу, ако желаете да получите нова парола. Чрез имейл ще получите линк, с който да потвърдите.
diff --git a/inc/lang/bn/lang.php b/inc/lang/bn/lang.php
index 230f3ef803ae0c2e709f665e1d7ddc0445d77475..0995bc478656a65372516428b6a26da3aad44174 100644
--- a/inc/lang/bn/lang.php
+++ b/inc/lang/bn/lang.php
@@ -50,7 +50,9 @@ $lang['btn_register']          = 'খাতা';
 $lang['btn_apply']             = 'প্রয়োগ করা';
 $lang['btn_media']             = 'মিডিয়া ম্যানেজার';
 $lang['btn_deleteuser']        = 'আমার অ্যাকাউন্ট অপসারণ করুন';
-$lang['loggedinas']            = 'লগ ইন';
+$lang['btn_img_backto']        = 'ফিরে যান %s';
+$lang['btn_mediaManager']      = 'মিডিয়া ম্যানেজারে দেখুন';
+$lang['loggedinas']            = 'লগ ইন:';
 $lang['user']                  = 'ইউজারনেম';
 $lang['pass']                  = 'পাসওয়ার্ড';
 $lang['newpass']               = 'নতুন পাসওয়ার্ড';
@@ -96,12 +98,12 @@ $lang['license']               = 'অন্যথায় নোট যেখ
 $lang['licenseok']             = 'দ্রষ্টব্য: আপনি নিম্নলিখিত লাইসেন্সের অধীনে আপনার বিষয়বস্তু লাইসেন্স সম্মত হন এই পৃষ্ঠার সম্পাদনার দ্বারা:';
 $lang['searchmedia']           = 'অনুসন্ধান ফাইলের নাম:';
 $lang['searchmedia_in']        = 'অনুসন্ধান %s -এ';
-$lang['txt_upload']            = 'আপলোড করার জন্য নির্বাচন করুন ফাইল';
-$lang['txt_filename']          = 'হিসাবে আপলোড করুন (ঐচ্ছিক)';
+$lang['txt_upload']            = 'আপলোড করার জন্য নির্বাচন করুন ফাইল:';
+$lang['txt_filename']          = 'হিসাবে আপলোড করুন (ঐচ্ছিক):';
 $lang['txt_overwrt']           = 'বিদ্যমান ফাইল মুছে যাবে';
 $lang['maxuploadsize']         = 'সর্বোচ্চ আপলোড করুন. %s-ফাইলের প্রতি.';
-$lang['lockedby']              = 'বর্তমানে দ্বারা লক';
-$lang['lockexpire']            = 'তালা এ মেয়াদ শেষ';
+$lang['lockedby']              = 'বর্তমানে দ্বারা লক:';
+$lang['lockexpire']            = 'তালা এ মেয়াদ শেষ:';
 $lang['js']['willexpire']      = 'এই পৃষ্ঠার সম্পাদনার জন্য আপনার লক এক মিনিটের মধ্যে মেয়াদ শেষ সম্পর্কে. \ দ্বন্দ্ব লক টাইমার রিসেট প্রিভিউ বাটন ব্যবহার এড়াতে.';
 $lang['js']['notsavedyet']     = 'অসংরক্ষিত পরিবর্তন হারিয়ে যাবে.';
 $lang['js']['searchmedia']     = 'ফাইলের জন্য অনুসন্ধান';
@@ -158,3 +160,41 @@ $lang['uploadsize']            = 'আপলোডকৃত ফাইলটি 
 $lang['deletesucc']            = '"%s" ফাইলটি মুছে ফেলা হয়েছে।';
 $lang['deletefail']            = '"%s" ডিলিট করা যায়নি - অনুমতি আছে কি না দেখুন।';
 $lang['mediainuse']            = '"%s" ফাইলটি মোছা হয়নি - এটি এখনো ব্যবহৃত হচ্ছে।';
+$lang['namespaces']            = 'নামস্থান';
+$lang['mediafiles']            = 'ফাইল পাওয়া যাবে ';
+$lang['accessdenied']          = 'আপনি এই পৃষ্ঠাটি দেখতে অনুমতি দেওয়া হয়নি';
+$lang['mediausage']            = 'এই ফাইলের উল্লেখ নিম্নলিখিত সিনট্যাক্স ব্যবহার করুন:';
+$lang['mediaview']             = 'মূল ফাইলটি দেখুন';
+$lang['mediaroot']             = 'মূল';
+$lang['mediaupload']           = 'এখানে বর্তমান নামস্থান একটি ফাইল আপলোড করুন. , Subnamespaces তৈরি আপনি ফাইল নির্বাচন পরে কোলন দ্বারা বিভাজিত আপনার ফাইলের নাম তাদের পূর্বে লিখুন করুন. কোন ফাইল এছাড়াও ড্র্যাগ এবং ড্রপ দ্বারা নির্বাচন করা সম্ভব.';
+$lang['mediaextchange']        = 'ফাইল এক্সটেনশন .%s থেকে .%s\'এ পরিবর্তন হলো !';
+$lang['reference']             = 'তথ্যসূত্রের জন্য ';
+$lang['ref_inuse']             = 'এই ফাইল মুছে ফেলা যাবে না কারণ এটি এখনও ব্যবহৃত হচ্ছে নিম্নলিখিত পাতা দ্বারা:';
+$lang['ref_hidden']            = 'এই পাতায় কিছু রেফারেন্স পড়ার আপনার আনুমতি নেই';
+$lang['hits']                  = 'সফল ';
+$lang['quickhits']             = 'পৃষ্ঠা মেলে';
+$lang['toc']                   = 'সূচীপত্র';
+$lang['current']               = 'বর্তমান';
+$lang['yours']                 = 'আপনার সংস্করণ
+';
+$lang['diff']                  = 'বর্তমান সংস্করণের পার্থক্য দেখান ';
+$lang['diff2']                 = 'নির্বাচিত সংস্করণের মধ্যে পার্থক্য দেখান ';
+$lang['diff_type']             = 'পার্থক্য দেখুন:';
+$lang['diff_inline']           = 'ইনলাইন';
+$lang['diff_side']             = 'পাশাপাশি';
+$lang['diffprevrev']           = 'পূর্ববর্তী সংস্করণ';
+$lang['diffnextrev']           = 'পরবর্তী সংস্করণ';
+$lang['difflastrev']           = 'সর্বশেষ সংস্করণ';
+$lang['diffbothprevrev']       = 'উভয় পক্ষের পূর্ববর্তী সংস্করণ';
+$lang['diffbothnextrev']       = 'উভয় পক্ষের পরবর্তী সংস্করণ';
+$lang['line']                  = 'লাইন';
+$lang['breadcrumb']            = 'ট্রেস:';
+$lang['youarehere']            = 'আপনি এখানে আছেন:';
+$lang['lastmod']               = 'শেষ বার পরিমার্জিত';
+$lang['by']                    = 'দ্বারা';
+$lang['deleted']               = 'মুছে ফেলা';
+$lang['created']               = 'তৈরি করা';
+$lang['restored']              = 'পুরানো সংস্করণের পুনঃস্থাপন (%s)';
+$lang['external_edit']         = 'বাহ্যিক সম্পাদনা';
+$lang['summary']               = 'সম্পাদনা সারাংশ';
+$lang['noflash']               = 'এ href="http://www.adobe.com/products/flashplayer/"> অ্যাডোবি ফ্ল্যাশ প্লাগইন </ a> এই সামগ্রী প্রদর্শন করার জন্য প্রয়োজন হয়.';
diff --git a/inc/lang/ca-valencia/lang.php b/inc/lang/ca-valencia/lang.php
index 6e6f2a6628b13f9f864e0e4a4b0b2d5b3823b219..98607d322e6aff28230a84cce25610e429bf78f7 100644
--- a/inc/lang/ca-valencia/lang.php
+++ b/inc/lang/ca-valencia/lang.php
@@ -45,7 +45,7 @@ $lang['btn_recover']           = 'Recuperar borrador';
 $lang['btn_draftdel']          = 'Borrar borrador';
 $lang['btn_revert']            = 'Recuperar';
 $lang['btn_register']          = 'Registrar-se';
-$lang['loggedinas']            = 'Sessió de';
+$lang['loggedinas']            = 'Sessió de:';
 $lang['user']                  = 'Nom d\'usuari';
 $lang['pass']                  = 'Contrasenya';
 $lang['newpass']               = 'Contrasenya nova';
@@ -83,11 +83,11 @@ $lang['license']               = 'Excepte quan s\'indique una atra cosa, el cont
 $lang['licenseok']             = 'Nota: a l\'editar esta pàgina accepta llicenciar el seu contingut baix la següent llicència:';
 $lang['searchmedia']           = 'Buscar nom d\'archiu:';
 $lang['searchmedia_in']        = 'Buscar en %s';
-$lang['txt_upload']            = 'Seleccione l\'archiu que vol pujar';
-$lang['txt_filename']          = 'Enviar com (opcional)';
+$lang['txt_upload']            = 'Seleccione l\'archiu que vol pujar:';
+$lang['txt_filename']          = 'Enviar com (opcional):';
 $lang['txt_overwrt']           = 'Sobreescriure archius existents';
-$lang['lockedby']              = 'Actualment bloquejat per';
-$lang['lockexpire']            = 'El bloqueig venç a les';
+$lang['lockedby']              = 'Actualment bloquejat per:';
+$lang['lockexpire']            = 'El bloqueig venç a les:';
 $lang['js']['willexpire']            = 'El seu bloqueig per a editar esta pàgina vencerà en un minut.\nPer a evitar conflictes utilise el botó de vista prèvia i reiniciarà el contador.';
 $lang['js']['notsavedyet']     = 'Els canvis no guardats es perdran.\n¿Segur que vol continuar?';
 $lang['rssfailed']             = 'Ha ocorregut un erro al solicitar este canal: ';
@@ -130,9 +130,9 @@ $lang['yours']                 = 'La seua versió';
 $lang['diff']                  = 'Mostrar diferències en la versió actual';
 $lang['diff2']                 = 'Mostrar diferències entre versions';
 $lang['line']                  = 'Llínea';
-$lang['breadcrumb']            = 'Traça';
-$lang['youarehere']            = 'Vosté està ací';
-$lang['lastmod']               = 'Última modificació el';
+$lang['breadcrumb']            = 'Traça:';
+$lang['youarehere']            = 'Vosté està ací:';
+$lang['lastmod']               = 'Última modificació el:';
 $lang['by']                    = 'per';
 $lang['deleted']               = 'borrat';
 $lang['created']               = 'creat';
@@ -175,16 +175,16 @@ $lang['metaedit']              = 'Editar meta-senyes';
 $lang['metasaveerr']           = 'Erro escrivint meta-senyes';
 $lang['metasaveok']            = 'Meta-senyes guardades';
 $lang['btn_img_backto']        = 'Tornar a %s';
-$lang['img_title']             = 'Títul';
-$lang['img_caption']           = 'Subtítul';
-$lang['img_date']              = 'Data';
-$lang['img_fname']             = 'Nom de l\'archiu';
-$lang['img_fsize']             = 'Tamany';
-$lang['img_artist']            = 'Fotógraf';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Càmara';
-$lang['img_keywords']          = 'Paraules clau';
+$lang['img_title']             = 'Títul:';
+$lang['img_caption']           = 'Subtítul:';
+$lang['img_date']              = 'Data:';
+$lang['img_fname']             = 'Nom de l\'archiu:';
+$lang['img_fsize']             = 'Tamany:';
+$lang['img_artist']            = 'Fotógraf:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Càmara:';
+$lang['img_keywords']          = 'Paraules clau:';
 $lang['authtempfail']          = 'L\'autenticació d\'usuaris està desactivada temporalment. Si la situació persistix, per favor, informe a l\'administrador del Wiki.';
 $lang['i_chooselang']          = 'Trie l\'idioma';
 $lang['i_installer']           = 'Instalador de DokuWiki';
diff --git a/inc/lang/ca/jquery.ui.datepicker.js b/inc/lang/ca/jquery.ui.datepicker.js
index a10b549c28c7e0fb9b4360f4338edb66346ed175..ab1dbc34d140e8ab38727df259e7ebfa39303c12 100644
--- a/inc/lang/ca/jquery.ui.datepicker.js
+++ b/inc/lang/ca/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Inicialització en català per a l'extensió 'UI date picker' per jQuery. */
 /* Writers: (joan.leon@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['ca'] = {
-		closeText: 'Tanca',
-		prevText: 'Anterior',
-		nextText: 'Següent',
-		currentText: 'Avui',
-		monthNames: ['gener','febrer','març','abril','maig','juny',
-		'juliol','agost','setembre','octubre','novembre','desembre'],
-		monthNamesShort: ['gen','feb','març','abr','maig','juny',
-		'jul','ag','set','oct','nov','des'],
-		dayNames: ['diumenge','dilluns','dimarts','dimecres','dijous','divendres','dissabte'],
-		dayNamesShort: ['dg','dl','dt','dc','dj','dv','ds'],
-		dayNamesMin: ['dg','dl','dt','dc','dj','dv','ds'],
-		weekHeader: 'Set',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['ca']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['ca'] = {
+	closeText: 'Tanca',
+	prevText: 'Anterior',
+	nextText: 'Següent',
+	currentText: 'Avui',
+	monthNames: ['gener','febrer','març','abril','maig','juny',
+	'juliol','agost','setembre','octubre','novembre','desembre'],
+	monthNamesShort: ['gen','feb','març','abr','maig','juny',
+	'jul','ag','set','oct','nov','des'],
+	dayNames: ['diumenge','dilluns','dimarts','dimecres','dijous','divendres','dissabte'],
+	dayNamesShort: ['dg','dl','dt','dc','dj','dv','ds'],
+	dayNamesMin: ['dg','dl','dt','dc','dj','dv','ds'],
+	weekHeader: 'Set',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['ca']);
+
+return datepicker.regional['ca'];
+
+}));
diff --git a/inc/lang/ca/lang.php b/inc/lang/ca/lang.php
index 1d297a1b17eb716b7727453c9050ada78aacae43..00d28083c9a05e8994fecb56102b8495f23c9076 100644
--- a/inc/lang/ca/lang.php
+++ b/inc/lang/ca/lang.php
@@ -48,7 +48,7 @@ $lang['btn_draftdel']          = 'Suprimeix esborrany';
 $lang['btn_revert']            = 'Restaura';
 $lang['btn_register']          = 'Registra\'m';
 $lang['btn_apply']             = 'Aplica';
-$lang['loggedinas']            = 'Heu entrat com';
+$lang['loggedinas']            = 'Heu entrat com:';
 $lang['user']                  = 'Nom d\'usuari';
 $lang['pass']                  = 'Contrasenya';
 $lang['newpass']               = 'Nova contrasenya';
@@ -87,8 +87,8 @@ $lang['license']               = 'Excepte on es digui una altra cosa, el conting
 $lang['licenseok']             = 'Nota. En editar aquesta pàgina esteu acceptant que el vostre contingut estigui subjecte a la llicència següent:';
 $lang['searchmedia']           = 'Cerca pel nom de fitxer';
 $lang['searchmedia_in']        = 'Cerca en: %s';
-$lang['txt_upload']            = 'Trieu el fitxer que voleu penjar';
-$lang['txt_filename']          = 'Introduïu el nom wiki (opcional)';
+$lang['txt_upload']            = 'Trieu el fitxer que voleu penjar:';
+$lang['txt_filename']          = 'Introduïu el nom wiki (opcional):';
 $lang['txt_overwrt']           = 'Sobreescriu el fitxer actual';
 $lang['maxuploadsize']         = 'Puja com a màxim %s per arxiu.';
 $lang['lockedby']              = 'Actualment blocat per:';
@@ -174,9 +174,9 @@ $lang['diff_type']             = 'Veieu les diferències:';
 $lang['diff_inline']           = 'En línia';
 $lang['diff_side']             = 'Un al costat de l\'altre';
 $lang['line']                  = 'Línia';
-$lang['breadcrumb']            = 'Camí';
-$lang['youarehere']            = 'Sou aquí';
-$lang['lastmod']               = 'Darrera modificació';
+$lang['breadcrumb']            = 'Camí:';
+$lang['youarehere']            = 'Sou aquí:';
+$lang['lastmod']               = 'Darrera modificació:';
 $lang['by']                    = 'per';
 $lang['deleted']               = 'suprimit';
 $lang['created']               = 'creat';
@@ -229,18 +229,18 @@ $lang['metaedit']              = 'Edita metadades';
 $lang['metasaveerr']           = 'No s\'han pogut escriure les metadades';
 $lang['metasaveok']            = 'S\'han desat les metadades';
 $lang['btn_img_backto']        = 'Torna a %s';
-$lang['img_title']             = 'Títol';
-$lang['img_caption']           = 'Peu d\'imatge';
-$lang['img_date']              = 'Data';
-$lang['img_fname']             = 'Nom de fitxer';
-$lang['img_fsize']             = 'Mida';
-$lang['img_artist']            = 'Fotògraf';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Càmera';
-$lang['img_keywords']          = 'Paraules clau';
-$lang['img_width']             = 'Ample';
-$lang['img_height']            = 'Alçada';
+$lang['img_title']             = 'Títol:';
+$lang['img_caption']           = 'Peu d\'imatge:';
+$lang['img_date']              = 'Data:';
+$lang['img_fname']             = 'Nom de fitxer:';
+$lang['img_fsize']             = 'Mida:';
+$lang['img_artist']            = 'Fotògraf:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Càmera:';
+$lang['img_keywords']          = 'Paraules clau:';
+$lang['img_width']             = 'Ample:';
+$lang['img_height']            = 'Alçada:';
 $lang['subscr_subscribe_success'] = 'S\'ha afegit %s a la llista de subscripcions per %s';
 $lang['subscr_subscribe_error'] = 'Hi ha hagut un error a l\'afegir %s a la llista per %s';
 $lang['subscr_subscribe_noaddress'] = 'No hi ha cap adreça associada pel vostre nom d\'usuari, no podeu ser afegit a la llista de subscripcions';
diff --git a/inc/lang/cs/jquery.ui.datepicker.js b/inc/lang/cs/jquery.ui.datepicker.js
index b96b1a51c2db8b118ddae77d20540bad9ed5a670..34dae5ecded623354cc5137c131714069d216e3c 100644
--- a/inc/lang/cs/jquery.ui.datepicker.js
+++ b/inc/lang/cs/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Czech initialisation for the jQuery UI date picker plugin. */
 /* Written by Tomas Muller (tomas@tomas-muller.net). */
-jQuery(function($){
-	$.datepicker.regional['cs'] = {
-		closeText: 'Zavřít',
-		prevText: '&#x3C;Dříve',
-		nextText: 'Později&#x3E;',
-		currentText: 'Nyní',
-		monthNames: ['leden','únor','březen','duben','květen','červen',
-		'červenec','srpen','září','říjen','listopad','prosinec'],
-		monthNamesShort: ['led','úno','bře','dub','kvě','čer',
-		'čvc','srp','zář','říj','lis','pro'],
-		dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
-		dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
-		dayNamesMin: ['ne','po','út','st','čt','pá','so'],
-		weekHeader: 'Týd',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['cs']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['cs'] = {
+	closeText: 'Zavřít',
+	prevText: '&#x3C;Dříve',
+	nextText: 'Později&#x3E;',
+	currentText: 'Nyní',
+	monthNames: ['leden','únor','březen','duben','květen','červen',
+	'červenec','srpen','září','říjen','listopad','prosinec'],
+	monthNamesShort: ['led','úno','bře','dub','kvě','čer',
+	'čvc','srp','zář','říj','lis','pro'],
+	dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
+	dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
+	dayNamesMin: ['ne','po','út','st','čt','pá','so'],
+	weekHeader: 'Týd',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['cs']);
+
+return datepicker.regional['cs'];
+
+}));
diff --git a/inc/lang/cs/lang.php b/inc/lang/cs/lang.php
index a491c15331e0147e544579e773a3da4dab0c1de5..4d084d47952297c31f8f26eecaef0515c1404584 100644
--- a/inc/lang/cs/lang.php
+++ b/inc/lang/cs/lang.php
@@ -15,8 +15,10 @@
  * @author Jakub A. Těšínský (j@kub.cz)
  * @author mkucera66@seznam.cz
  * @author Zbyněk Křivka <krivka@fit.vutbr.cz>
- * @author Gerrit Uitslag <klapinklapin@gmail.com>
  * @author Petr Klíma <qaxi@seznam.cz>
+ * @author Radovan Buroň <radovan@buron.cz>
+ * @author Viktor Zavadil <vzavadil@newps.cz>
+ * @author Jaroslav Lichtblau <jlichtblau@seznam.cz>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -61,7 +63,9 @@ $lang['btn_register']          = 'Registrovat';
 $lang['btn_apply']             = 'Použít';
 $lang['btn_media']             = 'Správa médií';
 $lang['btn_deleteuser']        = 'Odstranit můj účet';
-$lang['loggedinas']            = 'Přihlášen(a) jako';
+$lang['btn_img_backto']        = 'Zpět na %s';
+$lang['btn_mediaManager']      = 'Zobrazit ve správě médií';
+$lang['loggedinas']            = 'Přihlášen(a) jako:';
 $lang['user']                  = 'Uživatelské jméno';
 $lang['pass']                  = 'Heslo';
 $lang['newpass']               = 'Nové heslo';
@@ -106,8 +110,8 @@ $lang['license']               = 'Kromě míst, kde je explicitně uvedeno jinak
 $lang['licenseok']             = 'Poznámka: Tím, že editujete tuto stránku, souhlasíte, aby váš obsah byl licencován pod následující licencí:';
 $lang['searchmedia']           = 'Hledat jméno souboru:';
 $lang['searchmedia_in']        = 'Hledat v %s';
-$lang['txt_upload']            = 'Vyberte soubor jako přílohu';
-$lang['txt_filename']          = 'Wiki jméno (volitelné)';
+$lang['txt_upload']            = 'Vyberte soubor jako přílohu:';
+$lang['txt_filename']          = 'Wiki jméno (volitelné):';
 $lang['txt_overwrt']           = 'Přepsat existující soubor';
 $lang['maxuploadsize']         = 'Max. velikost souboru %s';
 $lang['lockedby']              = 'Právě zamknuto:';
@@ -192,10 +196,13 @@ $lang['difflink']              = 'Odkaz na výstup diff';
 $lang['diff_type']             = 'Zobrazit rozdíly:';
 $lang['diff_inline']           = 'Vložené';
 $lang['diff_side']             = 'Přidané';
+$lang['diffprevrev']           = 'Předchozí verze';
+$lang['diffnextrev']           = 'Následující verze';
+$lang['difflastrev']           = 'Poslední revize';
 $lang['line']                  = 'Řádek';
-$lang['breadcrumb']            = 'Historie';
-$lang['youarehere']            = 'Umístění';
-$lang['lastmod']               = 'Poslední úprava';
+$lang['breadcrumb']            = 'Historie:';
+$lang['youarehere']            = 'Umístění:';
+$lang['lastmod']               = 'Poslední úprava:';
 $lang['by']                    = 'autor:';
 $lang['deleted']               = 'odstraněno';
 $lang['created']               = 'vytvořeno';
@@ -248,20 +255,18 @@ $lang['admin_register']        = 'Přidat nového uživatele';
 $lang['metaedit']              = 'Upravit Metadata';
 $lang['metasaveerr']           = 'Chyba při zápisu metadat';
 $lang['metasaveok']            = 'Metadata uložena';
-$lang['btn_img_backto']        = 'Zpět na %s';
-$lang['img_title']             = 'Titulek';
-$lang['img_caption']           = 'Popis';
-$lang['img_date']              = 'Datum';
-$lang['img_fname']             = 'Jméno souboru';
-$lang['img_fsize']             = 'Velikost';
-$lang['img_artist']            = 'Autor fotografie';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Formát';
-$lang['img_camera']            = 'Typ fotoaparátu';
-$lang['img_keywords']          = 'Klíčová slova';
-$lang['img_width']             = 'Šířka';
-$lang['img_height']            = 'Výška';
-$lang['btn_mediaManager']           = 'Zobrazit ve správě médií';
+$lang['img_title']             = 'Titulek:';
+$lang['img_caption']           = 'Popis:';
+$lang['img_date']              = 'Datum:';
+$lang['img_fname']             = 'Jméno souboru:';
+$lang['img_fsize']             = 'Velikost:';
+$lang['img_artist']            = 'Autor fotografie:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Formát:';
+$lang['img_camera']            = 'Typ fotoaparátu:';
+$lang['img_keywords']          = 'Klíčová slova:';
+$lang['img_width']             = 'Šířka:';
+$lang['img_height']            = 'Výška:';
 $lang['subscr_subscribe_success'] = '%s byl přihlášen do seznamu odběratelů %s';
 $lang['subscr_subscribe_error'] = 'Došlo k chybě při přihlašování %s do seznamu odběratelů %s';
 $lang['subscr_subscribe_noaddress'] = 'K Vašemu loginu neexistuje žádná adresa, nemohl jste být přihlášen do seznamu odběratelů.';
diff --git a/inc/lang/da/jquery.ui.datepicker.js b/inc/lang/da/jquery.ui.datepicker.js
index 7e42948b344aebff41e2822afad951b3ce21b6cc..d8881e1b627868b05da9837f40a44f86fb6c4313 100644
--- a/inc/lang/da/jquery.ui.datepicker.js
+++ b/inc/lang/da/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Danish initialisation for the jQuery UI date picker plugin. */
 /* Written by Jan Christensen ( deletestuff@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['da'] = {
-		closeText: 'Luk',
-		prevText: '&#x3C;Forrige',
-		nextText: 'Næste&#x3E;',
-		currentText: 'Idag',
-		monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
-		'Juli','August','September','Oktober','November','December'],
-		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
-		'Jul','Aug','Sep','Okt','Nov','Dec'],
-		dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
-		dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
-		dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
-		weekHeader: 'Uge',
-		dateFormat: 'dd-mm-yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['da']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['da'] = {
+	closeText: 'Luk',
+	prevText: '&#x3C;Forrige',
+	nextText: 'Næste&#x3E;',
+	currentText: 'Idag',
+	monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
+	'Juli','August','September','Oktober','November','December'],
+	monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+	'Jul','Aug','Sep','Okt','Nov','Dec'],
+	dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
+	dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
+	dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
+	weekHeader: 'Uge',
+	dateFormat: 'dd-mm-yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['da']);
+
+return datepicker.regional['da'];
+
+}));
diff --git a/inc/lang/da/lang.php b/inc/lang/da/lang.php
index bdf882ba7462cae1c0fd31e1274d3ead5427d9db..3f06bf7583ea7926e54c848052e909e132c968b8 100644
--- a/inc/lang/da/lang.php
+++ b/inc/lang/da/lang.php
@@ -61,7 +61,7 @@ $lang['btn_register']          = 'Registrér';
 $lang['btn_apply']             = 'Anvend';
 $lang['btn_media']             = 'Media Manager';
 $lang['btn_deleteuser']        = 'Fjern Min Konto';
-$lang['loggedinas']            = 'Logget ind som';
+$lang['loggedinas']            = 'Logget ind som:';
 $lang['user']                  = 'Brugernavn';
 $lang['pass']                  = 'Adgangskode';
 $lang['newpass']               = 'Ny adgangskode';
@@ -105,12 +105,12 @@ $lang['license']               = 'Med mindre andet angivet, vil indhold på denn
 $lang['licenseok']             = 'Note: ved at ændre denne side, acceptere du at dit indhold bliver frigivet under følgende licens:';
 $lang['searchmedia']           = 'Søg filnavn';
 $lang['searchmedia_in']        = 'Søg i %s';
-$lang['txt_upload']            = 'Vælg den fil der skal overføres';
-$lang['txt_filename']          = 'Indtast wikinavn (valgfrit)';
+$lang['txt_upload']            = 'Vælg den fil der skal overføres:';
+$lang['txt_filename']          = 'Indtast wikinavn (valgfrit):';
 $lang['txt_overwrt']           = 'Overskriv eksisterende fil';
 $lang['maxuploadsize']         = 'Upload max. %s pr. fil.';
-$lang['lockedby']              = 'Midlertidig låst af';
-$lang['lockexpire']            = 'Lås udløber kl.';
+$lang['lockedby']              = 'Midlertidig låst af:';
+$lang['lockexpire']            = 'Lås udløber kl:.';
 $lang['js']['willexpire']      = 'Din lås på dette dokument udløber om et minut.\nTryk på Forhåndsvisning-knappen for at undgå konflikter.';
 $lang['js']['notsavedyet']     = 'Ugemte ændringer vil blive mistet
 Fortsæt alligevel?';
@@ -191,9 +191,9 @@ $lang['diff_type']             = 'Vis forskelle:';
 $lang['diff_inline']           = 'Indeni';
 $lang['diff_side']             = 'Side ved Side';
 $lang['line']                  = 'Linje';
-$lang['breadcrumb']            = 'Sti';
-$lang['youarehere']            = 'Du er her';
-$lang['lastmod']               = 'Sidst ændret';
+$lang['breadcrumb']            = 'Sti:';
+$lang['youarehere']            = 'Du er her:';
+$lang['lastmod']               = 'Sidst ændret:';
 $lang['by']                    = 'af';
 $lang['deleted']               = 'slettet';
 $lang['created']               = 'oprettet';
@@ -247,18 +247,18 @@ $lang['metaedit']              = 'Rediger metadata';
 $lang['metasaveerr']           = 'Skrivning af metadata fejlede';
 $lang['metasaveok']            = 'Metadata gemt';
 $lang['btn_img_backto']            = 'Tilbage til %s';
-$lang['img_title']             = 'Titel';
-$lang['img_caption']           = 'Billedtekst';
-$lang['img_date']              = 'Dato';
-$lang['img_fname']             = 'Filnavn';
-$lang['img_fsize']             = 'Størrelse';
-$lang['img_artist']            = 'Fotograf';
-$lang['img_copyr']             = 'Ophavsret';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Emneord';
-$lang['img_width']             = 'Bredde';
-$lang['img_height']            = 'Højde';
+$lang['img_title']             = 'Titel:';
+$lang['img_caption']           = 'Billedtekst:';
+$lang['img_date']              = 'Dato:';
+$lang['img_fname']             = 'Filnavn:';
+$lang['img_fsize']             = 'Størrelse:';
+$lang['img_artist']            = 'Fotograf:';
+$lang['img_copyr']             = 'Ophavsret:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Emneord:';
+$lang['img_width']             = 'Bredde:';
+$lang['img_height']            = 'Højde:';
 $lang['btn_mediaManager']           = 'Vis i Media Manager';
 $lang['subscr_subscribe_success'] = 'Tilføjede %s til abonnement listen for %s';
 $lang['subscr_subscribe_error'] = 'Fejl ved tilføjelse af %s til abonnement listen for %s';
diff --git a/inc/lang/de-informal/jquery.ui.datepicker.js b/inc/lang/de-informal/jquery.ui.datepicker.js
index abe75c4e429a78d36e0a6a1efc5b557f0068b403..bc92a931b84f95e80745c7c0767d40152181c2f0 100644
--- a/inc/lang/de-informal/jquery.ui.datepicker.js
+++ b/inc/lang/de-informal/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* German initialisation for the jQuery UI date picker plugin. */
 /* Written by Milian Wolff (mail@milianw.de). */
-jQuery(function($){
-	$.datepicker.regional['de'] = {
-		closeText: 'Schließen',
-		prevText: '&#x3C;Zurück',
-		nextText: 'Vor&#x3E;',
-		currentText: 'Heute',
-		monthNames: ['Januar','Februar','März','April','Mai','Juni',
-		'Juli','August','September','Oktober','November','Dezember'],
-		monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
-		'Jul','Aug','Sep','Okt','Nov','Dez'],
-		dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
-		dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
-		dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
-		weekHeader: 'KW',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['de']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['de'] = {
+	closeText: 'Schließen',
+	prevText: '&#x3C;Zurück',
+	nextText: 'Vor&#x3E;',
+	currentText: 'Heute',
+	monthNames: ['Januar','Februar','März','April','Mai','Juni',
+	'Juli','August','September','Oktober','November','Dezember'],
+	monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
+	'Jul','Aug','Sep','Okt','Nov','Dez'],
+	dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
+	dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
+	dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
+	weekHeader: 'KW',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['de']);
+
+return datepicker.regional['de'];
+
+}));
diff --git a/inc/lang/de-informal/lang.php b/inc/lang/de-informal/lang.php
index 2e2e04149b23373c4b6b6a6d1ef177561b209e9a..c81109580b35f9ba8958334d532cb23bd38ae292 100644
--- a/inc/lang/de-informal/lang.php
+++ b/inc/lang/de-informal/lang.php
@@ -66,7 +66,7 @@ $lang['btn_register']          = 'Registrieren';
 $lang['btn_apply']             = 'Ãœbernehmen';
 $lang['btn_media']             = 'Medien-Manager';
 $lang['btn_deleteuser']        = 'Benutzerprofil löschen';
-$lang['loggedinas']            = 'Angemeldet als';
+$lang['loggedinas']            = 'Angemeldet als:';
 $lang['user']                  = 'Benutzername';
 $lang['pass']                  = 'Passwort';
 $lang['newpass']               = 'Neues Passwort';
@@ -111,12 +111,12 @@ $lang['license']               = 'Falls nicht anders bezeichnet, ist der Inhalt
 $lang['licenseok']             = 'Hinweis: Durch das Bearbeiten dieser Seite gibst du dein Einverständnis, dass dein Inhalt unter der folgenden Lizenz veröffentlicht wird:';
 $lang['searchmedia']           = 'Suche nach Datei:';
 $lang['searchmedia_in']        = 'Suche in %s';
-$lang['txt_upload']            = 'Datei zum Hochladen auswählen';
-$lang['txt_filename']          = 'Hochladen als (optional)';
+$lang['txt_upload']            = 'Datei zum Hochladen auswählen:';
+$lang['txt_filename']          = 'Hochladen als (optional):';
 $lang['txt_overwrt']           = 'Bestehende Datei überschreiben';
 $lang['maxuploadsize']         = 'Max. %s pro Datei-Upload.';
-$lang['lockedby']              = 'Momentan gesperrt von';
-$lang['lockexpire']            = 'Sperre läuft ab am';
+$lang['lockedby']              = 'Momentan gesperrt von:';
+$lang['lockexpire']            = 'Sperre läuft ab am:';
 $lang['js']['willexpire']      = 'Die Sperre zur Bearbeitung dieser Seite läuft in einer Minute ab.\nUm Bearbeitungskonflikte zu vermeiden, solltest du sie durch einen Klick auf den Vorschau-Knopf verlängern.';
 $lang['js']['notsavedyet']     = 'Nicht gespeicherte Änderungen gehen verloren!';
 $lang['js']['searchmedia']     = 'Suche nach Dateien';
@@ -196,9 +196,9 @@ $lang['diff_type']             = 'Unterschiede anzeigen:';
 $lang['diff_inline']           = 'Inline';
 $lang['diff_side']             = 'Side by Side';
 $lang['line']                  = 'Zeile';
-$lang['breadcrumb']            = 'Zuletzt angesehen';
-$lang['youarehere']            = 'Du befindest dich hier';
-$lang['lastmod']               = 'Zuletzt geändert';
+$lang['breadcrumb']            = 'Zuletzt angesehen:';
+$lang['youarehere']            = 'Du befindest dich hier:';
+$lang['lastmod']               = 'Zuletzt geändert:';
 $lang['by']                    = 'von';
 $lang['deleted']               = 'gelöscht';
 $lang['created']               = 'angelegt';
@@ -252,18 +252,18 @@ $lang['metaedit']              = 'Metadaten bearbeiten';
 $lang['metasaveerr']           = 'Die Metadaten konnten nicht gesichert werden';
 $lang['metasaveok']            = 'Metadaten gesichert';
 $lang['btn_img_backto']            = 'Zurück zu %s';
-$lang['img_title']             = 'Titel';
-$lang['img_caption']           = 'Bildunterschrift';
-$lang['img_date']              = 'Datum';
-$lang['img_fname']             = 'Dateiname';
-$lang['img_fsize']             = 'Größe';
-$lang['img_artist']            = 'Fotograf';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Schlagwörter';
-$lang['img_width']             = 'Breite';
-$lang['img_height']            = 'Höhe';
+$lang['img_title']             = 'Titel:';
+$lang['img_caption']           = 'Bildunterschrift:';
+$lang['img_date']              = 'Datum:';
+$lang['img_fname']             = 'Dateiname:';
+$lang['img_fsize']             = 'Größe:';
+$lang['img_artist']            = 'Fotograf:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Schlagwörter:';
+$lang['img_width']             = 'Breite:';
+$lang['img_height']            = 'Höhe:';
 $lang['btn_mediaManager']           = 'Im Medien-Manager anzeigen';
 $lang['subscr_subscribe_success'] = 'Die Seite %s wurde zur Abonnementliste von %s hinzugefügt';
 $lang['subscr_subscribe_error'] = 'Fehler beim Hinzufügen von %s zur Abonnementliste von %s';
diff --git a/inc/lang/de/backlinks.txt b/inc/lang/de/backlinks.txt
index 1ffa815c213f4337809eedae3bd5a268dd97626b..25e0ed5f9e50526b34bb593aad0dda694e6142c5 100644
--- a/inc/lang/de/backlinks.txt
+++ b/inc/lang/de/backlinks.txt
@@ -1,5 +1,5 @@
 ====== Links hierher ======
 
-Dies ist eine Liste der Seiten, welche zurück zur momentanen Seite verlinken.
+Dies ist eine Liste der Seiten, welche zurück zur momentanen Seite führen.
 
 
diff --git a/inc/lang/de/jquery.ui.datepicker.js b/inc/lang/de/jquery.ui.datepicker.js
index abe75c4e429a78d36e0a6a1efc5b557f0068b403..bc92a931b84f95e80745c7c0767d40152181c2f0 100644
--- a/inc/lang/de/jquery.ui.datepicker.js
+++ b/inc/lang/de/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* German initialisation for the jQuery UI date picker plugin. */
 /* Written by Milian Wolff (mail@milianw.de). */
-jQuery(function($){
-	$.datepicker.regional['de'] = {
-		closeText: 'Schließen',
-		prevText: '&#x3C;Zurück',
-		nextText: 'Vor&#x3E;',
-		currentText: 'Heute',
-		monthNames: ['Januar','Februar','März','April','Mai','Juni',
-		'Juli','August','September','Oktober','November','Dezember'],
-		monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
-		'Jul','Aug','Sep','Okt','Nov','Dez'],
-		dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
-		dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
-		dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
-		weekHeader: 'KW',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['de']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['de'] = {
+	closeText: 'Schließen',
+	prevText: '&#x3C;Zurück',
+	nextText: 'Vor&#x3E;',
+	currentText: 'Heute',
+	monthNames: ['Januar','Februar','März','April','Mai','Juni',
+	'Juli','August','September','Oktober','November','Dezember'],
+	monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
+	'Jul','Aug','Sep','Okt','Nov','Dez'],
+	dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
+	dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
+	dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
+	weekHeader: 'KW',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['de']);
+
+return datepicker.regional['de'];
+
+}));
diff --git a/inc/lang/de/lang.php b/inc/lang/de/lang.php
index c6f11abc914010c570eff6f3d7d7c79e45f6bde2..18357168179fcceab5ac6f047dbdb717fdbc7053 100644
--- a/inc/lang/de/lang.php
+++ b/inc/lang/de/lang.php
@@ -25,6 +25,8 @@
  * @author Benedikt Fey <spam@lifeisgoooood.de>
  * @author Joerg <scooter22@gmx.de>
  * @author Simon <st103267@stud.uni-stuttgart.de>
+ * @author Hoisl <hoisl@gmx.at>
+ * @author Marcel Eickhoff <eickhoff.marcel@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -71,7 +73,7 @@ $lang['btn_media']             = 'Medien-Manager';
 $lang['btn_deleteuser']        = 'Benutzerprofil löschen';
 $lang['btn_img_backto']        = 'Zurück zu %s';
 $lang['btn_mediaManager']      = 'Im Medien-Manager anzeigen';
-$lang['loggedinas']            = 'Angemeldet als';
+$lang['loggedinas']            = 'Angemeldet als:';
 $lang['user']                  = 'Benutzername';
 $lang['pass']                  = 'Passwort';
 $lang['newpass']               = 'Neues Passwort';
@@ -95,7 +97,6 @@ $lang['regbadmail']            = 'Die angegebene E-Mail-Adresse scheint ungülti
 $lang['regbadpass']            = 'Die beiden eingegeben Passwörter stimmen nicht überein. Bitte versuchen Sie es noch einmal.';
 $lang['regpwmail']             = 'Ihr DokuWiki-Passwort';
 $lang['reghere']               = 'Sie haben noch keinen Zugang? Hier registrieren';
-$lang['notloggedin']           = 'Haben Sie vergessen sich einzuloggen?';
 $lang['profna']                = 'Änderung des Benutzerprofils in diesem Wiki nicht möglich.';
 $lang['profnochange']          = 'Keine Änderungen, nichts zu tun.';
 $lang['profnoempty']           = 'Es muss ein Name und eine E-Mail-Adresse angegeben werden.';
@@ -117,12 +118,12 @@ $lang['license']               = 'Falls nicht anders bezeichnet, ist der Inhalt
 $lang['licenseok']             = 'Hinweis: Durch das Bearbeiten dieser Seite geben Sie Ihr Einverständnis, dass Ihr Inhalt unter der folgenden Lizenz veröffentlicht wird:';
 $lang['searchmedia']           = 'Suche Dateinamen:';
 $lang['searchmedia_in']        = 'Suche in %s';
-$lang['txt_upload']            = 'Datei zum Hochladen auswählen';
-$lang['txt_filename']          = 'Hochladen als (optional)';
+$lang['txt_upload']            = 'Datei zum Hochladen auswählen:';
+$lang['txt_filename']          = 'Hochladen als (optional):';
 $lang['txt_overwrt']           = 'Bestehende Datei überschreiben';
 $lang['maxuploadsize']         = 'Max. %s pro Datei-Upload.';
-$lang['lockedby']              = 'Momentan gesperrt von';
-$lang['lockexpire']            = 'Sperre läuft ab am';
+$lang['lockedby']              = 'Momentan gesperrt von:';
+$lang['lockexpire']            = 'Sperre läuft ab am:';
 $lang['js']['willexpire']      = 'Die Sperre zur Bearbeitung dieser Seite läuft in einer Minute ab.\nUm Bearbeitungskonflikte zu vermeiden, sollten Sie sie durch einen Klick auf den Vorschau-Knopf verlängern.';
 $lang['js']['notsavedyet']     = 'Nicht gespeicherte Änderungen gehen verloren!';
 $lang['js']['searchmedia']     = 'Suche Dateien';
@@ -201,10 +202,13 @@ $lang['difflink']              = 'Link zu dieser Vergleichsansicht';
 $lang['diff_type']             = 'Unterschiede anzeigen:';
 $lang['diff_inline']           = 'Inline';
 $lang['diff_side']             = 'Side by Side';
+$lang['diffprevrev']           = 'Vorhergehende Ãœberarbeitung';
+$lang['diffnextrev']           = 'Nächste  Überarbeitung';
+$lang['difflastrev']           = 'Letzte  Ãœberarbeitung';
 $lang['line']                  = 'Zeile';
-$lang['breadcrumb']            = 'Zuletzt angesehen';
-$lang['youarehere']            = 'Sie befinden sich hier';
-$lang['lastmod']               = 'Zuletzt geändert';
+$lang['breadcrumb']            = 'Zuletzt angesehen:';
+$lang['youarehere']            = 'Sie befinden sich hier:';
+$lang['lastmod']               = 'Zuletzt geändert:';
 $lang['by']                    = 'von';
 $lang['deleted']               = 'gelöscht';
 $lang['created']               = 'angelegt';
@@ -257,18 +261,18 @@ $lang['admin_register']        = 'Neuen Benutzer anmelden';
 $lang['metaedit']              = 'Metadaten bearbeiten';
 $lang['metasaveerr']           = 'Die Metadaten konnten nicht gesichert werden';
 $lang['metasaveok']            = 'Metadaten gesichert';
-$lang['img_title']             = 'Titel';
-$lang['img_caption']           = 'Bildunterschrift';
-$lang['img_date']              = 'Datum';
-$lang['img_fname']             = 'Dateiname';
-$lang['img_fsize']             = 'Größe';
-$lang['img_artist']            = 'FotografIn';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Schlagwörter';
-$lang['img_width']             = 'Breite';
-$lang['img_height']            = 'Höhe';
+$lang['img_title']             = 'Titel:';
+$lang['img_caption']           = 'Bildunterschrift:';
+$lang['img_date']              = 'Datum:';
+$lang['img_fname']             = 'Dateiname:';
+$lang['img_fsize']             = 'Größe:';
+$lang['img_artist']            = 'FotografIn:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Schlagwörter:';
+$lang['img_width']             = 'Breite:';
+$lang['img_height']            = 'Höhe:';
 $lang['subscr_subscribe_success'] = '%s hat nun Änderungen der Seite %s abonniert';
 $lang['subscr_subscribe_error'] = '%s kann die Änderungen der Seite %s nicht abonnieren';
 $lang['subscr_subscribe_noaddress'] = 'Weil Ihre E-Mail-Adresse fehlt, können Sie das Thema nicht abonnieren';
@@ -296,6 +300,7 @@ $lang['i_problems']            = 'Das Installationsprogramm hat unten aufgeführ
 $lang['i_modified']            = 'Aus Sicherheitsgründen arbeitet dieses Skript nur mit einer neuen bzw. nicht modifizierten DokuWiki Installation. Sie sollten entweder alle Dateien noch einmal frisch installieren oder die <a href="http://dokuwiki.org/install">Dokuwiki-Installationsanleitung</a> konsultieren.';
 $lang['i_funcna']              = 'Die PHP-Funktion <code>%s</code> ist nicht verfügbar. Unter Umständen wurde sie von Ihrem Hoster deaktiviert?';
 $lang['i_phpver']              = 'Ihre PHP-Version <code>%s</code> ist niedriger als die benötigte Version <code>%s</code>. Bitte aktualisieren Sie Ihre PHP-Installation.';
+$lang['i_mbfuncoverload']      = 'Um DokuWiki zu starten muss mbstring.func_overload in php.ini ausgeschaltet sein.';
 $lang['i_permfail']            = '<code>%s</code> ist nicht durch DokuWiki beschreibbar. Sie müssen die Berechtigungen dieses Ordners ändern!';
 $lang['i_confexists']          = '<code>%s</code> existiert bereits';
 $lang['i_writeerr']            = '<code>%s</code> konnte nicht erzeugt werden. Sie sollten die Verzeichnis-/Datei-Rechte überprüfen und die Datei manuell anlegen.';
diff --git a/inc/lang/el/jquery.ui.datepicker.js b/inc/lang/el/jquery.ui.datepicker.js
index 1ac47561a41c93d49344e7c1dbb8629c4492065d..a852a77d7388ed7a73e77dd0d46403292fa603c5 100644
--- a/inc/lang/el/jquery.ui.datepicker.js
+++ b/inc/lang/el/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Greek (el) initialisation for the jQuery UI date picker plugin. */
 /* Written by Alex Cicovic (http://www.alexcicovic.com) */
-jQuery(function($){
-	$.datepicker.regional['el'] = {
-		closeText: 'Κλείσιμο',
-		prevText: 'Προηγούμενος',
-		nextText: 'Επόμενος',
-		currentText: 'Τρέχων Μήνας',
-		monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος',
-		'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'],
-		monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν',
-		'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'],
-		dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'],
-		dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'],
-		dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'],
-		weekHeader: 'Εβδ',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['el']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['el'] = {
+	closeText: 'Κλείσιμο',
+	prevText: 'Προηγούμενος',
+	nextText: 'Επόμενος',
+	currentText: 'Τρέχων Μήνας',
+	monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος',
+	'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'],
+	monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν',
+	'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'],
+	dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'],
+	dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'],
+	dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'],
+	weekHeader: 'Εβδ',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['el']);
+
+return datepicker.regional['el'];
+
+}));
diff --git a/inc/lang/el/lang.php b/inc/lang/el/lang.php
index d97721cdb423fe2e8d28ccb9fbcf1b9a0d83b16f..e5371c9f3c7fb93ba45a5e92fb1285f67d8c754a 100644
--- a/inc/lang/el/lang.php
+++ b/inc/lang/el/lang.php
@@ -56,7 +56,7 @@ $lang['btn_register']          = 'Εγγραφή';
 $lang['btn_apply']             = 'Εφαρμογή';
 $lang['btn_media']             = 'Διαχειριστής πολυμέσων';
 $lang['btn_deleteuser']        = 'Αφαίρεσε τον λογαριασμό μου';
-$lang['loggedinas']            = 'Συνδεδεμένος ως';
+$lang['loggedinas']            = 'Συνδεδεμένος ως:';
 $lang['user']                  = 'Όνομα χρήστη';
 $lang['pass']                  = 'Κωδικός';
 $lang['newpass']               = 'Νέος κωδικός';
@@ -100,12 +100,12 @@ $lang['license']               = 'Εκτός εάν αναφέρεται δια
 $lang['licenseok']             = 'Σημείωση: Τροποποιώντας αυτή την σελίδα αποδέχεστε την διάθεση του υλικού σας σύμφωνα με την ακόλουθη άδεια:';
 $lang['searchmedia']           = 'Αναζήτηση αρχείου:';
 $lang['searchmedia_in']        = 'Αναζήτηση σε %s';
-$lang['txt_upload']            = 'Επιλέξτε αρχείο για φόρτωση';
-$lang['txt_filename']          = 'Επιλέξτε νέο όνομα αρχείου (προαιρετικό)';
+$lang['txt_upload']            = 'Επιλέξτε αρχείο για φόρτωση:';
+$lang['txt_filename']          = 'Επιλέξτε νέο όνομα αρχείου (προαιρετικό):';
 $lang['txt_overwrt']           = 'Αντικατάσταση υπάρχοντος αρχείου';
 $lang['maxuploadsize']         = 'Μέγιστο μέγεθος αρχείου: %s.';
-$lang['lockedby']              = 'Προσωρινά κλειδωμένο από';
-$lang['lockexpire']            = 'Το κλείδωμα λήγει στις';
+$lang['lockedby']              = 'Προσωρινά κλειδωμένο από:';
+$lang['lockexpire']            = 'Το κλείδωμα λήγει στις:';
 $lang['js']['willexpire']      = 'Το κλείδωμά σας για την επεξεργασία αυτής της σελίδας θα λήξει σε ένα λεπτό.\n Για να το ανανεώσετε χρησιμοποιήστε την Προεπισκόπηση.';
 $lang['js']['notsavedyet']     = 'Οι μη αποθηκευμένες αλλαγές θα χαθούν.
 Θέλετε να συνεχίσετε;';
@@ -186,9 +186,9 @@ $lang['diff_type']             = 'Προβολή διαφορών:';
 $lang['diff_inline']           = 'Σε σειρά';
 $lang['diff_side']             = 'Δίπλα-δίπλα';
 $lang['line']                  = 'Γραμμή';
-$lang['breadcrumb']            = 'Ιστορικό';
-$lang['youarehere']            = 'Είστε εδώ';
-$lang['lastmod']               = 'Τελευταία τροποποίηση';
+$lang['breadcrumb']            = 'Ιστορικό:';
+$lang['youarehere']            = 'Είστε εδώ:';
+$lang['lastmod']               = 'Τελευταία τροποποίηση:';
 $lang['by']                    = 'από';
 $lang['deleted']               = 'διαγράφηκε';
 $lang['created']               = 'δημιουργήθηκε';
@@ -242,18 +242,18 @@ $lang['metaedit']              = 'Τροποποίηση metadata';
 $lang['metasaveerr']           = 'Η αποθήκευση των metadata απέτυχε';
 $lang['metasaveok']            = 'Επιτυχής αποθήκευση metadata';
 $lang['btn_img_backto']            = 'Επιστροφή σε %s';
-$lang['img_title']             = 'Τίτλος';
-$lang['img_caption']           = 'Λεζάντα';
-$lang['img_date']              = 'Ημερομηνία';
-$lang['img_fname']             = 'Όνομα αρχείου';
-$lang['img_fsize']             = 'Μέγεθος';
-$lang['img_artist']            = 'Καλλιτέχνης';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Camera';
-$lang['img_keywords']          = 'Λέξεις-κλειδιά';
-$lang['img_width']             = 'Πλάτος';
-$lang['img_height']            = 'Ύψος';
+$lang['img_title']             = 'Τίτλος:';
+$lang['img_caption']           = 'Λεζάντα:';
+$lang['img_date']              = 'Ημερομηνία:';
+$lang['img_fname']             = 'Όνομα αρχείου:';
+$lang['img_fsize']             = 'Μέγεθος:';
+$lang['img_artist']            = 'Καλλιτέχνης:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Camera:';
+$lang['img_keywords']          = 'Λέξεις-κλειδιά:';
+$lang['img_width']             = 'Πλάτος:';
+$lang['img_height']            = 'Ύψος:';
 $lang['btn_mediaManager']           = 'Εμφάνιση στον διαχειριστή πολυμέσων';
 $lang['subscr_subscribe_success'] = 'Ο/η %s προστέθηκε στην λίστα ειδοποιήσεων για το %s';
 $lang['subscr_subscribe_error'] = 'Σφάλμα κατά την προσθήκη του/της %s στην λίστα ειδοποιήσεων για το %s';
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index 2fee15853c31c90171fba898785ebc2061b01926..9215a3f1d4f052839df3c91c34585e70e1e9b7ad 100644
--- a/inc/lang/en/lang.php
+++ b/inc/lang/en/lang.php
@@ -55,7 +55,7 @@ $lang['btn_deleteuser']        = 'Remove My Account';
 $lang['btn_img_backto']        = 'Back to %s';
 $lang['btn_mediaManager']      = 'View in media manager';
 
-$lang['loggedinas']            = 'Logged in as';
+$lang['loggedinas']            = 'Logged in as:';
 $lang['user']                  = 'Username';
 $lang['pass']                  = 'Password';
 $lang['newpass']               = 'New password';
@@ -105,12 +105,12 @@ $lang['licenseok']             = 'Note: By editing this page you agree to licens
 
 $lang['searchmedia']           = 'Search file name:';
 $lang['searchmedia_in']        = 'Search in %s';
-$lang['txt_upload']            = 'Select file to upload';
-$lang['txt_filename']          = 'Upload as (optional)';
+$lang['txt_upload']            = 'Select file to upload:';
+$lang['txt_filename']          = 'Upload as (optional):';
 $lang['txt_overwrt']           = 'Overwrite existing file';
 $lang['maxuploadsize']         = 'Upload max. %s per file.';
-$lang['lockedby']              = 'Currently locked by';
-$lang['lockexpire']            = 'Lock expires at';
+$lang['lockedby']              = 'Currently locked by:';
+$lang['lockexpire']            = 'Lock expires at:';
 
 $lang['js']['willexpire']      = 'Your lock for editing this page is about to expire in a minute.\nTo avoid conflicts use the preview button to reset the locktimer.';
 $lang['js']['notsavedyet']     = 'Unsaved changes will be lost.';
@@ -199,9 +199,9 @@ $lang['difflastrev']           = 'Last revision';
 $lang['diffbothprevrev']       = 'Both sides previous revision';
 $lang['diffbothnextrev']       = 'Both sides next revision';
 $lang['line']                  = 'Line';
-$lang['breadcrumb']            = 'Trace';
-$lang['youarehere']            = 'You are here';
-$lang['lastmod']               = 'Last modified';
+$lang['breadcrumb']            = 'Trace:';
+$lang['youarehere']            = 'You are here:';
+$lang['lastmod']               = 'Last modified:';
 $lang['by']                    = 'by';
 $lang['deleted']               = 'removed';
 $lang['created']               = 'created';
@@ -260,18 +260,18 @@ $lang['admin_register']        = 'Add new user';
 $lang['metaedit']              = 'Edit Metadata';
 $lang['metasaveerr']           = 'Writing metadata failed';
 $lang['metasaveok']            = 'Metadata saved';
-$lang['img_title']             = 'Title';
-$lang['img_caption']           = 'Caption';
-$lang['img_date']              = 'Date';
-$lang['img_fname']             = 'Filename';
-$lang['img_fsize']             = 'Size';
-$lang['img_artist']            = 'Photographer';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Camera';
-$lang['img_keywords']          = 'Keywords';
-$lang['img_width']             = 'Width';
-$lang['img_height']            = 'Height';
+$lang['img_title']             = 'Title:';
+$lang['img_caption']           = 'Caption:';
+$lang['img_date']              = 'Date:';
+$lang['img_fname']             = 'Filename:';
+$lang['img_fsize']             = 'Size:';
+$lang['img_artist']            = 'Photographer:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Camera:';
+$lang['img_keywords']          = 'Keywords:';
+$lang['img_width']             = 'Width:';
+$lang['img_height']            = 'Height:';
 
 $lang['subscr_subscribe_success']   = 'Added %s to subscription list for %s';
 $lang['subscr_subscribe_error']     = 'Error adding %s to subscription list for %s';
@@ -307,6 +307,7 @@ $lang['i_modified']            = 'For security reasons this script will only wor
                                   <a href="http://dokuwiki.org/install">Dokuwiki installation instructions</a>';
 $lang['i_funcna']              = 'PHP function <code>%s</code> is not available. Maybe your hosting provider disabled it for some reason?';
 $lang['i_phpver']              = 'Your PHP version <code>%s</code> is lower than the needed <code>%s</code>. You need to upgrade your PHP install.';
+$lang['i_mbfuncoverload']      = 'mbstring.func_overload must be disabled in php.ini to run DokuWiki.';
 $lang['i_permfail']            = '<code>%s</code> is not writable by DokuWiki. You need to fix the permission settings of this directory!';
 $lang['i_confexists']          = '<code>%s</code> already exists';
 $lang['i_writeerr']            = 'Unable to create <code>%s</code>. You will need to check directory/file permissions and create the file manually.';
diff --git a/inc/lang/eo/denied.txt b/inc/lang/eo/denied.txt
index 0be6a2e84acea87bdcd99c23608bebd1b16c25b6..e0abba12ce2d1b11ea607d5a395695fef4f1fd8b 100644
--- a/inc/lang/eo/denied.txt
+++ b/inc/lang/eo/denied.txt
@@ -1,4 +1,4 @@
 ====== Aliro malpermesita ======
 
-Vi ne havas sufiĉajn rajtojn rigardi ĉi tiujn paĝojn.
+Vi ne havas sufiĉajn rajtojn daŭrigi.
 
diff --git a/inc/lang/eo/jquery.ui.datepicker.js b/inc/lang/eo/jquery.ui.datepicker.js
index 39e44fc57c1b9d446c29010ec811c188a009ef05..ebbb7238bc7951791f6246daa8e44e8b94d01121 100644
--- a/inc/lang/eo/jquery.ui.datepicker.js
+++ b/inc/lang/eo/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Esperanto initialisation for the jQuery UI date picker plugin. */
 /* Written by Olivier M. (olivierweb@ifrance.com). */
-jQuery(function($){
-	$.datepicker.regional['eo'] = {
-		closeText: 'Fermi',
-		prevText: '&#x3C;Anta',
-		nextText: 'Sekv&#x3E;',
-		currentText: 'Nuna',
-		monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio',
-		'Julio','AÅ­gusto','Septembro','Oktobro','Novembro','Decembro'],
-		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
-		'Jul','AÅ­g','Sep','Okt','Nov','Dec'],
-		dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'],
-		dayNamesShort: ['Dim','Lun','Mar','Mer','Ä´aÅ­','Ven','Sab'],
-		dayNamesMin: ['Di','Lu','Ma','Me','Ä´a','Ve','Sa'],
-		weekHeader: 'Sb',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 0,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['eo']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['eo'] = {
+	closeText: 'Fermi',
+	prevText: '&#x3C;Anta',
+	nextText: 'Sekv&#x3E;',
+	currentText: 'Nuna',
+	monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio',
+	'Julio','AÅ­gusto','Septembro','Oktobro','Novembro','Decembro'],
+	monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+	'Jul','AÅ­g','Sep','Okt','Nov','Dec'],
+	dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'],
+	dayNamesShort: ['Dim','Lun','Mar','Mer','Ä´aÅ­','Ven','Sab'],
+	dayNamesMin: ['Di','Lu','Ma','Me','Ä´a','Ve','Sa'],
+	weekHeader: 'Sb',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 0,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['eo']);
+
+return datepicker.regional['eo'];
+
+}));
diff --git a/inc/lang/eo/lang.php b/inc/lang/eo/lang.php
index b3c19b601ab0b7f5608db0bca1934c25ae4c1264..f81de7fa1600d479ee041682ab9bae972f5df05b 100644
--- a/inc/lang/eo/lang.php
+++ b/inc/lang/eo/lang.php
@@ -54,7 +54,9 @@ $lang['btn_register']          = 'Registriĝi';
 $lang['btn_apply']             = 'Apliki';
 $lang['btn_media']             = 'Medio-administrilo';
 $lang['btn_deleteuser']        = 'Forigi mian konton';
-$lang['loggedinas']            = 'Ensalutinta kiel';
+$lang['btn_img_backto']        = 'Iri reen al %s';
+$lang['btn_mediaManager']      = 'Rigardi en aŭdvidaĵ-administrilo';
+$lang['loggedinas']            = 'Ensalutinta kiel:';
 $lang['user']                  = 'Uzant-nomo';
 $lang['pass']                  = 'Pasvorto';
 $lang['newpass']               = 'Nova pasvorto';
@@ -99,12 +101,12 @@ $lang['license']               = 'Krom kie rekte indikite, enhavo de tiu ĉi vik
 $lang['licenseok']             = 'Rimarku: redaktante tiun ĉi paĝon vi konsentas publikigi vian enhavon laŭ la jena permesilo:';
 $lang['searchmedia']           = 'Serĉi dosiernomon:';
 $lang['searchmedia_in']        = 'Serĉi en %s';
-$lang['txt_upload']            = 'Elektu dosieron por alŝuti';
-$lang['txt_filename']          = 'Alŝuti kiel (laŭvole)';
+$lang['txt_upload']            = 'Elektu dosieron por alŝuti:';
+$lang['txt_filename']          = 'Alŝuti kiel (laŭvole):';
 $lang['txt_overwrt']           = 'AnstataÅ­igi ekzistantan dosieron';
 $lang['maxuploadsize']         = 'Alŝuto maks. %s po dosiero.';
-$lang['lockedby']              = 'Nune ŝlosita de';
-$lang['lockexpire']            = 'Ŝlosado ĉesos je';
+$lang['lockedby']              = 'Nune ŝlosita de:';
+$lang['lockexpire']            = 'Ŝlosado ĉesos je:';
 $lang['js']['willexpire']      = 'Vi povos redakti ĉi tiun paĝon post unu minuto.\nSe vi volas nuligi tempokontrolon de la ŝlosado, premu la butonon "Antaŭrigardi".';
 $lang['js']['notsavedyet']     = 'Ne konservitaj modifoj perdiĝos.
 Ĉu vi certe volas daŭrigi la procezon?';
@@ -184,10 +186,15 @@ $lang['difflink']              = 'Ligilo al kompara rigardo';
 $lang['diff_type']             = 'Rigardi malsamojn:';
 $lang['diff_inline']           = 'Samlinie';
 $lang['diff_side']             = 'Apude';
+$lang['diffprevrev']           = 'AntaÅ­a revizio';
+$lang['diffnextrev']           = 'Sekva revizio';
+$lang['difflastrev']           = 'Lasta revizio';
+$lang['diffbothprevrev']       = 'Sur ambaÅ­ flankoj antaÅ­a revizio';
+$lang['diffbothnextrev']       = 'Sur ambaÅ­ flankoj sekva revizio';
 $lang['line']                  = 'Linio';
-$lang['breadcrumb']            = 'Paŝoj';
-$lang['youarehere']            = 'Vi estas ĉi tie';
-$lang['lastmod']               = 'Lastaj ŝanĝoj';
+$lang['breadcrumb']            = 'Paŝoj:';
+$lang['youarehere']            = 'Vi estas ĉi tie:';
+$lang['lastmod']               = 'Lastaj ŝanĝoj:';
 $lang['by']                    = 'de';
 $lang['deleted']               = 'forigita';
 $lang['created']               = 'kreita';
@@ -240,20 +247,18 @@ $lang['admin_register']        = 'Aldoni novan uzanton';
 $lang['metaedit']              = 'Redakti metadatumaron';
 $lang['metasaveerr']           = 'La konservo de metadatumaro malsukcesis';
 $lang['metasaveok']            = 'La metadatumaro konserviĝis';
-$lang['btn_img_backto']            = 'Iri reen al %s';
-$lang['img_title']             = 'Titolo';
-$lang['img_caption']           = 'Priskribo';
-$lang['img_date']              = 'Dato';
-$lang['img_fname']             = 'Dosiernomo';
-$lang['img_fsize']             = 'Grandeco';
-$lang['img_artist']            = 'Fotisto';
-$lang['img_copyr']             = 'Kopirajtoj';
-$lang['img_format']            = 'Formato';
-$lang['img_camera']            = 'Kamerao';
-$lang['img_keywords']          = 'Åœlosilvortoj';
-$lang['img_width']             = 'Larĝeco';
-$lang['img_height']            = 'Alteco';
-$lang['btn_mediaManager']           = 'Rigardi en aŭdvidaĵ-administrilo';
+$lang['img_title']             = 'Titolo:';
+$lang['img_caption']           = 'Priskribo:';
+$lang['img_date']              = 'Dato:';
+$lang['img_fname']             = 'Dosiernomo:';
+$lang['img_fsize']             = 'Grandeco:';
+$lang['img_artist']            = 'Fotisto:';
+$lang['img_copyr']             = 'Kopirajtoj:';
+$lang['img_format']            = 'Formato:';
+$lang['img_camera']            = 'Kamerao:';
+$lang['img_keywords']          = 'Åœlosilvortoj:';
+$lang['img_width']             = 'Larĝeco:';
+$lang['img_height']            = 'Alteco:';
 $lang['subscr_subscribe_success'] = 'Aldonis %s al la abonlisto por %s';
 $lang['subscr_subscribe_error'] = 'Eraro dum aldono de %s al la abonlisto por %s';
 $lang['subscr_subscribe_noaddress'] = 'Ne estas adreso ligita al via ensaluto, ne eblas aldoni vin al la abonlisto';
diff --git a/inc/lang/es/edit.txt b/inc/lang/es/edit.txt
index 55c3c1dc5261d23cae923d695e93e35bb70f6057..4ed253bb300492847c5ac1e7c83f73a95dd2d8a4 100644
--- a/inc/lang/es/edit.txt
+++ b/inc/lang/es/edit.txt
@@ -1,2 +1,2 @@
-Edita la página y pulsa ''Guardar''. Mira [[wiki:syntax]] para sintaxis Wiki. Por favor edita la página solo si puedes **mejorarla**. Si quieres testear algunas cosas aprende a dar tus primeros pasos en el [[playground:playground]].
+Edita la página y pulsa ''Guardar''. Vaya a [[wiki:syntax]] para ver la sintaxis del Wiki. Por favor edite la página solo si puedes **mejorarla**. Si quieres probar algo relacionado a la sintaxis, aprende a dar tus primeros pasos en el [[playground:playground]].
 
diff --git a/inc/lang/es/jquery.ui.datepicker.js b/inc/lang/es/jquery.ui.datepicker.js
index 763d4ceddbd26fb9043010337156ec4a732a9f9f..c51475e30f636c75b0a7ca54ceb29115140e7100 100644
--- a/inc/lang/es/jquery.ui.datepicker.js
+++ b/inc/lang/es/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Inicialización en español para la extensión 'UI date picker' para jQuery. */
 /* Traducido por Vester (xvester@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['es'] = {
-		closeText: 'Cerrar',
-		prevText: '&#x3C;Ant',
-		nextText: 'Sig&#x3E;',
-		currentText: 'Hoy',
-		monthNames: ['enero','febrero','marzo','abril','mayo','junio',
-		'julio','agosto','septiembre','octubre','noviembre','diciembre'],
-		monthNamesShort: ['ene','feb','mar','abr','may','jun',
-		'jul','ogo','sep','oct','nov','dic'],
-		dayNames: ['domingo','lunes','martes','miércoles','jueves','viernes','sábado'],
-		dayNamesShort: ['dom','lun','mar','mié','juv','vie','sáb'],
-		dayNamesMin: ['D','L','M','X','J','V','S'],
-		weekHeader: 'Sm',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['es']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['es'] = {
+	closeText: 'Cerrar',
+	prevText: '&#x3C;Ant',
+	nextText: 'Sig&#x3E;',
+	currentText: 'Hoy',
+	monthNames: ['enero','febrero','marzo','abril','mayo','junio',
+	'julio','agosto','septiembre','octubre','noviembre','diciembre'],
+	monthNamesShort: ['ene','feb','mar','abr','may','jun',
+	'jul','ago','sep','oct','nov','dic'],
+	dayNames: ['domingo','lunes','martes','miércoles','jueves','viernes','sábado'],
+	dayNamesShort: ['dom','lun','mar','mié','jue','vie','sáb'],
+	dayNamesMin: ['D','L','M','X','J','V','S'],
+	weekHeader: 'Sm',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['es']);
+
+return datepicker.regional['es'];
+
+}));
diff --git a/inc/lang/es/lang.php b/inc/lang/es/lang.php
index 336e60089c64615b3f21652105617bc677325d0b..47bee3b6f1218394b787124a268ecc4097fe50fd 100644
--- a/inc/lang/es/lang.php
+++ b/inc/lang/es/lang.php
@@ -32,6 +32,11 @@
  * @author monica <may.dorado@gmail.com>
  * @author Antonio Bueno <atnbueno@gmail.com>
  * @author Juan De La Cruz <juann.dlc@gmail.com>
+ * @author Fernando <fdiezala@gmail.com>
+ * @author Eloy <ej.perezgomez@gmail.com>
+ * @author Antonio Castilla <antoniocastilla@trazoide.com>
+ * @author Jonathan Hernández <me@jhalicea.com>
+ * @author pokesakura <pokesakura@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -41,13 +46,13 @@ $lang['singlequoteopening']    = '‘';
 $lang['singlequoteclosing']    = '’';
 $lang['apostrophe']            = '’';
 $lang['btn_edit']              = 'Editar esta página';
-$lang['btn_source']            = 'Ver fuente';
+$lang['btn_source']            = 'Ver la fuente de esta página';
 $lang['btn_show']              = 'Ver página';
 $lang['btn_create']            = 'Crear esta página';
 $lang['btn_search']            = 'Buscar';
 $lang['btn_save']              = 'Guardar';
 $lang['btn_preview']           = 'Previsualización';
-$lang['btn_top']               = 'Ir hasta arriba';
+$lang['btn_top']               = 'Volver arriba';
 $lang['btn_newer']             = '<< más reciente';
 $lang['btn_older']             = 'menos reciente >>';
 $lang['btn_revs']              = 'Revisiones antiguas';
@@ -74,9 +79,11 @@ $lang['btn_draftdel']          = 'Eliminar borrador';
 $lang['btn_revert']            = 'Restaurar';
 $lang['btn_register']          = 'Registrarse';
 $lang['btn_apply']             = 'Aplicar';
-$lang['btn_media']             = 'Gestor de ficheros';
+$lang['btn_media']             = 'Administrador de Ficheros';
 $lang['btn_deleteuser']        = 'Elimina Mi Cuenta';
-$lang['loggedinas']            = 'Conectado como ';
+$lang['btn_img_backto']        = 'Volver a %s';
+$lang['btn_mediaManager']      = 'Ver en el administrador de ficheros';
+$lang['loggedinas']            = 'Conectado como:';
 $lang['user']                  = 'Usuario';
 $lang['pass']                  = 'Contraseña';
 $lang['newpass']               = 'Nueva contraseña';
@@ -117,16 +124,16 @@ $lang['resendpwdnouser']       = 'Lo siento, no se encuentra este usuario en nue
 $lang['resendpwdbadauth']      = 'Lo siento, este código de autenticación no es válido. Asegúrate de haber usado el enlace de confirmación entero.';
 $lang['resendpwdconfirm']      = 'Un enlace para confirmación ha sido enviado por correo electrónico.';
 $lang['resendpwdsuccess']      = 'Tu nueva contraseña ha sido enviada por correo electrónico.';
-$lang['license']               = 'Excepto donde se indique lo contrario, el contenido de esta wiki se autoriza bajo la siguiente licencia:';
+$lang['license']               = 'Excepto donde se indique lo contrario, el contenido de este wiki esta bajo la siguiente licencia:';
 $lang['licenseok']             = 'Nota: Al editar esta página, estás de acuerdo en autorizar su contenido bajo la siguiente licencia:';
 $lang['searchmedia']           = 'Buscar archivo:';
 $lang['searchmedia_in']        = 'Buscar en %s';
-$lang['txt_upload']            = 'Selecciona el archivo a subir';
-$lang['txt_filename']          = 'Subir como (opcional)';
+$lang['txt_upload']            = 'Selecciona el archivo a subir:';
+$lang['txt_filename']          = 'Subir como (opcional):';
 $lang['txt_overwrt']           = 'Sobreescribir archivo existente';
 $lang['maxuploadsize']         = 'Peso máximo de %s por archivo';
-$lang['lockedby']              = 'Actualmente bloqueado por';
-$lang['lockexpire']            = 'El bloqueo expira en';
+$lang['lockedby']              = 'Actualmente bloqueado por:';
+$lang['lockexpire']            = 'El bloqueo expira en:';
 $lang['js']['willexpire']      = 'El bloqueo para la edición de esta página expira en un minuto.\nPAra prevenir conflictos uso el botón Previsualizar para restaurar el contador de bloqueo.';
 $lang['js']['notsavedyet']     = 'Los cambios que no se han guardado se perderán.
 ¿Realmente quieres continuar?';
@@ -207,10 +214,15 @@ $lang['difflink']              = 'Enlace a la vista de comparación';
 $lang['diff_type']             = 'Ver diferencias';
 $lang['diff_inline']           = 'En línea';
 $lang['diff_side']             = 'Lado a lado';
+$lang['diffprevrev']           = 'Revisión previa';
+$lang['diffnextrev']           = 'Próxima revisión';
+$lang['difflastrev']           = 'Última revisión';
+$lang['diffbothprevrev']       = 'Ambos lados, revisión anterior';
+$lang['diffbothnextrev']       = 'Ambos lados, revisión siguiente';
 $lang['line']                  = 'Línea';
-$lang['breadcrumb']            = 'Traza';
-$lang['youarehere']            = 'Estás aquí';
-$lang['lastmod']               = 'Última modificación';
+$lang['breadcrumb']            = 'Traza:';
+$lang['youarehere']            = 'Estás aquí:';
+$lang['lastmod']               = 'Última modificación:';
 $lang['by']                    = 'por';
 $lang['deleted']               = 'borrado';
 $lang['created']               = 'creado';
@@ -263,20 +275,18 @@ $lang['admin_register']        = 'Añadir nuevo usuario';
 $lang['metaedit']              = 'Editar metadatos';
 $lang['metasaveerr']           = 'La escritura de los metadatos ha fallado';
 $lang['metasaveok']            = 'Los metadatos han sido guardados';
-$lang['btn_img_backto']            = 'Volver a %s';
-$lang['img_title']             = 'Título';
-$lang['img_caption']           = 'Epígrafe';
-$lang['img_date']              = 'Fecha';
-$lang['img_fname']             = 'Nombre de fichero';
-$lang['img_fsize']             = 'Tamaño';
-$lang['img_artist']            = 'Fotógrafo';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Formato';
-$lang['img_camera']            = 'Cámara';
-$lang['img_keywords']          = 'Palabras claves';
-$lang['img_width']             = 'Ancho';
-$lang['img_height']            = 'Alto';
-$lang['btn_mediaManager']           = 'Ver en el Administrador de medios';
+$lang['img_title']             = 'Título:';
+$lang['img_caption']           = 'Información: ';
+$lang['img_date']              = 'Fecha:';
+$lang['img_fname']             = 'Nombre del archivo:';
+$lang['img_fsize']             = 'Tamaño:';
+$lang['img_artist']            = 'Fotógrafo:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Formato:';
+$lang['img_camera']            = 'Cámara:';
+$lang['img_keywords']          = 'Palabras claves:';
+$lang['img_width']             = 'Ancho:';
+$lang['img_height']            = 'Alto:';
 $lang['subscr_subscribe_success'] = 'Se agregó %s a las listas de suscripción para %s';
 $lang['subscr_subscribe_error'] = 'Error al agregar %s a las listas de suscripción para %s';
 $lang['subscr_subscribe_noaddress'] = 'No hay dirección asociada con tu registro, no se puede agregarte a la lista de suscripción';
@@ -304,6 +314,7 @@ $lang['i_problems']            = 'El instalador encontró algunos problemas, se
 $lang['i_modified']            = 'Por razones de seguridad este script sólo funcionará con una instalación nueva y no modificada de Dokuwiki. Usted debe extraer nuevamente los ficheros del paquete bajado, o bien consultar las <a href="http://dokuwiki.org/install">instrucciones de instalación de Dokuwiki</a> completas.';
 $lang['i_funcna']              = 'La función de PHP <code>%s</code> no está disponible. ¿Tal vez su proveedor de hosting la ha deshabilitado por alguna razón?';
 $lang['i_phpver']              = 'Su versión de PHP <code>%s</code> es menor que la necesaria <code>%s</code>. Es necesario que actualice su instalación de PHP.';
+$lang['i_mbfuncoverload']      = 'mbstring.func_overload se debe deshabilitar en php.ini para que funcione DokuWiki.';
 $lang['i_permfail']            = 'DokuWili no puede escribir <code>%s</code>. ¡Es necesario establecer  correctamente los permisos de este directorio!';
 $lang['i_confexists']          = '<code>%s</code> ya existe';
 $lang['i_writeerr']            = 'Imposible crear <code>%s</code>. Se necesita que usted controle los permisos del fichero/directorio y que cree el fichero manualmente.';
@@ -322,13 +333,13 @@ $lang['i_license_none']        = 'No mostrar ninguna información sobre licencia
 $lang['i_pop_field']           = 'Por favor, ayúdanos a mejorar la experiencia de DokuWiki:';
 $lang['i_pop_label']           = 'Una vez al mes, enviar información anónima de uso de datos a los desarrolladores de DokuWiki';
 $lang['recent_global']         = 'Actualmente estás viendo los cambios dentro del namespace <b>%s</b>. También puedes <a href="%s">ver los cambios recientes en el wiki completo</a>.';
-$lang['years']                 = '%d años atrás';
-$lang['months']                = '%d meses atrás';
-$lang['weeks']                 = '%d semanas atrás';
-$lang['days']                  = '%d días atrás';
-$lang['hours']                 = '%d horas atrás';
-$lang['minutes']               = '%d minutos atrás';
-$lang['seconds']               = '%d segundos atrás';
+$lang['years']                 = 'hace %d años';
+$lang['months']                = 'hace %d meses';
+$lang['weeks']                 = 'hace %d semanas';
+$lang['days']                  = 'hace %d días';
+$lang['hours']                 = 'hace %d horas';
+$lang['minutes']               = 'hace %d minutos';
+$lang['seconds']               = 'hace %d segundos';
 $lang['wordblock']             = 'Sus cambios no se han guardado porque contienen textos bloqueados (spam).';
 $lang['media_uploadtab']       = 'Cargar';
 $lang['media_searchtab']       = 'Buscar';
diff --git a/inc/lang/es/uploadmail.txt b/inc/lang/es/uploadmail.txt
index 9d2f980d3a55fe77feab24ba0b7bd5af5d872aa8..cf70d00d4b02c9ecea9765421d89fa9f1e039671 100644
--- a/inc/lang/es/uploadmail.txt
+++ b/inc/lang/es/uploadmail.txt
@@ -1,6 +1,7 @@
-Se ha subido un fichero a tu DokuWuki. Estos son los detalles:
+Se ha subido un fichero a tu DokuWiki. Estos son los detalles:
 
 Archivo : @MEDIA@
+Ultima revisión: @OLD@
 Fecha : @DATE@
 Navegador : @BROWSER@
 Dirección IP : @IPADDRESS@
diff --git a/inc/lang/et/jquery.ui.datepicker.js b/inc/lang/et/jquery.ui.datepicker.js
index 62cbea8fa8626c702a1770be60a6804384de2696..2a57212526b641e562ccf395db254d578ac747cd 100644
--- a/inc/lang/et/jquery.ui.datepicker.js
+++ b/inc/lang/et/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Estonian initialisation for the jQuery UI date picker plugin. */
 /* Written by Mart Sõmermaa (mrts.pydev at gmail com). */
-jQuery(function($){
-	$.datepicker.regional['et'] = {
-		closeText: 'Sulge',
-		prevText: 'Eelnev',
-		nextText: 'Järgnev',
-		currentText: 'Täna',
-		monthNames: ['Jaanuar','Veebruar','Märts','Aprill','Mai','Juuni',
-		'Juuli','August','September','Oktoober','November','Detsember'],
-		monthNamesShort: ['Jaan', 'Veebr', 'Märts', 'Apr', 'Mai', 'Juuni',
-		'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'],
-		dayNames: ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'],
-		dayNamesShort: ['Pühap', 'Esmasp', 'Teisip', 'Kolmap', 'Neljap', 'Reede', 'Laup'],
-		dayNamesMin: ['P','E','T','K','N','R','L'],
-		weekHeader: 'näd',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['et']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['et'] = {
+	closeText: 'Sulge',
+	prevText: 'Eelnev',
+	nextText: 'Järgnev',
+	currentText: 'Täna',
+	monthNames: ['Jaanuar','Veebruar','Märts','Aprill','Mai','Juuni',
+	'Juuli','August','September','Oktoober','November','Detsember'],
+	monthNamesShort: ['Jaan', 'Veebr', 'Märts', 'Apr', 'Mai', 'Juuni',
+	'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'],
+	dayNames: ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'],
+	dayNamesShort: ['Pühap', 'Esmasp', 'Teisip', 'Kolmap', 'Neljap', 'Reede', 'Laup'],
+	dayNamesMin: ['P','E','T','K','N','R','L'],
+	weekHeader: 'näd',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['et']);
+
+return datepicker.regional['et'];
+
+}));
diff --git a/inc/lang/et/lang.php b/inc/lang/et/lang.php
index 49fc33e1746197f34da8cc6701f687b7e553b48c..9ae06d7d2a63c105f407731fb9c58bff7fe89c09 100644
--- a/inc/lang/et/lang.php
+++ b/inc/lang/et/lang.php
@@ -54,7 +54,7 @@ $lang['btn_register']          = 'Registreeri uus kasutaja';
 $lang['btn_apply']             = 'Kinnita';
 $lang['btn_media']             = 'Meedia haldur';
 $lang['btn_deleteuser']        = 'Eemalda minu konto';
-$lang['loggedinas']            = 'Logis sisse kui';
+$lang['loggedinas']            = 'Logis sisse kui:';
 $lang['user']                  = 'Kasutaja';
 $lang['pass']                  = 'Parool';
 $lang['newpass']               = 'Uus parool';
@@ -101,12 +101,12 @@ $lang['license']               = 'Kus pole öeldud teisiti, kehtib selle wiki si
 $lang['licenseok']             = 'Teadmiseks: Toimetades seda lehte, nõustud avaldama oma sisu järgmise lepingu alusel:';
 $lang['searchmedia']           = 'Otsi failinime:';
 $lang['searchmedia_in']        = 'Otsi %s';
-$lang['txt_upload']            = 'Vali fail, mida üles laadida';
-$lang['txt_filename']          = 'Siseta oma Wikinimi (soovituslik)';
+$lang['txt_upload']            = 'Vali fail, mida üles laadida:';
+$lang['txt_filename']          = 'Siseta oma Wikinimi (soovituslik):';
 $lang['txt_overwrt']           = 'Kirjutan olemasoleva faili üle';
 $lang['maxuploadsize']         = 'Ãœleslaadimiseks lubatu enim %s faili kohta.';
-$lang['lockedby']              = 'Praegu on selle lukustanud';
-$lang['lockexpire']            = 'Lukustus aegub';
+$lang['lockedby']              = 'Praegu on selle lukustanud:';
+$lang['lockexpire']            = 'Lukustus aegub:';
 $lang['js']['willexpire']      = 'Teie lukustus selle lehe toimetamisele aegub umbes minuti pärast.\nIgasugu  probleemide vältimiseks kasuta eelvaate nuppu, et lukustusarvesti taas tööle panna.';
 $lang['js']['notsavedyet']     = 'Sul on seal salvestamata muudatusi, mis kohe kõige kaduva teed lähevad.
 Kas Sa ikka tahad edasi liikuda?';
@@ -188,9 +188,9 @@ $lang['diff_type']             = 'Vaata erinevusi:';
 $lang['diff_inline']           = 'Jooksvalt';
 $lang['diff_side']             = 'Kõrvuti';
 $lang['line']                  = 'Rida';
-$lang['breadcrumb']            = 'Käidud rada';
-$lang['youarehere']            = 'Sa oled siin';
-$lang['lastmod']               = 'Viimati muutnud';
+$lang['breadcrumb']            = 'Käidud rada:';
+$lang['youarehere']            = 'Sa oled siin:';
+$lang['lastmod']               = 'Viimati muutnud:';
 $lang['by']                    = 'persoon';
 $lang['deleted']               = 'eemaldatud';
 $lang['created']               = 'tekitatud';
@@ -243,19 +243,19 @@ $lang['metaedit']              = 'Muuda lisainfot';
 $lang['metasaveerr']           = 'Lisainfo salvestamine läks untsu.';
 $lang['metasaveok']            = 'Lisainfo salvestatud';
 $lang['btn_img_backto']            = 'Tagasi %s';
-$lang['img_title']             = 'Tiitel';
-$lang['img_caption']           = 'Kirjeldus';
-$lang['img_date']              = 'Kuupäev';
-$lang['img_fname']             = 'Faili nimi';
-$lang['img_fsize']             = 'Suurus';
-$lang['img_artist']            = 'Autor';
-$lang['img_copyr']             = 'Autoriõigused';
-$lang['img_format']            = 'Formaat';
-$lang['img_camera']            = 'Kaamera';
-$lang['img_keywords']          = 'Võtmesõnad';
-$lang['img_width']             = 'Laius';
-$lang['img_height']            = 'Kõrgus';
-$lang['img_manager']           = 'Näita meediahalduris';
+$lang['img_title']             = 'Tiitel:';
+$lang['img_caption']           = 'Kirjeldus:';
+$lang['img_date']              = 'Kuupäev:';
+$lang['img_fname']             = 'Faili nimi:';
+$lang['img_fsize']             = 'Suurus:';
+$lang['img_artist']            = 'Autor:';
+$lang['img_copyr']             = 'Autoriõigused:';
+$lang['img_format']            = 'Formaat:';
+$lang['img_camera']            = 'Kaamera:';
+$lang['img_keywords']          = 'Võtmesõnad:';
+$lang['img_width']             = 'Laius:';
+$lang['img_height']            = 'Kõrgus:';
+$lang['btn_mediaManager']           = 'Näita meediahalduris';
 $lang['subscr_subscribe_success'] = '%s lisati %s tellijaks';
 $lang['subscr_subscribe_error'] = 'Viga %s lisamisel %s tellijaks';
 $lang['subscr_subscribe_noaddress'] = 'Sinu kasutajaga pole seotud ühtegi aadressi, seega ei saa sind tellijaks lisada';
diff --git a/inc/lang/eu/jquery.ui.datepicker.js b/inc/lang/eu/jquery.ui.datepicker.js
index a71db2c721c26d821a5d3372ca85f3d04c5beb3a..25b95981f8eb75151e0c15b31dbcde363e253203 100644
--- a/inc/lang/eu/jquery.ui.datepicker.js
+++ b/inc/lang/eu/jquery.ui.datepicker.js
@@ -1,23 +1,36 @@
-/* Euskarako oinarria 'UI date picker' jquery-ko extentsioarentzat */
 /* Karrikas-ek itzulia (karrikas@karrikas.com) */
-jQuery(function($){
-	$.datepicker.regional['eu'] = {
-		closeText: 'Egina',
-		prevText: '&#x3C;Aur',
-		nextText: 'Hur&#x3E;',
-		currentText: 'Gaur',
-		monthNames: ['urtarrila','otsaila','martxoa','apirila','maiatza','ekaina',
-			'uztaila','abuztua','iraila','urria','azaroa','abendua'],
-		monthNamesShort: ['urt.','ots.','mar.','api.','mai.','eka.',
-			'uzt.','abu.','ira.','urr.','aza.','abe.'],
-		dayNames: ['igandea','astelehena','asteartea','asteazkena','osteguna','ostirala','larunbata'],
-		dayNamesShort: ['ig.','al.','ar.','az.','og.','ol.','lr.'],
-		dayNamesMin: ['ig','al','ar','az','og','ol','lr'],
-		weekHeader: 'As',
-		dateFormat: 'yy-mm-dd',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['eu']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['eu'] = {
+	closeText: 'Egina',
+	prevText: '&#x3C;Aur',
+	nextText: 'Hur&#x3E;',
+	currentText: 'Gaur',
+	monthNames: ['urtarrila','otsaila','martxoa','apirila','maiatza','ekaina',
+		'uztaila','abuztua','iraila','urria','azaroa','abendua'],
+	monthNamesShort: ['urt.','ots.','mar.','api.','mai.','eka.',
+		'uzt.','abu.','ira.','urr.','aza.','abe.'],
+	dayNames: ['igandea','astelehena','asteartea','asteazkena','osteguna','ostirala','larunbata'],
+	dayNamesShort: ['ig.','al.','ar.','az.','og.','ol.','lr.'],
+	dayNamesMin: ['ig','al','ar','az','og','ol','lr'],
+	weekHeader: 'As',
+	dateFormat: 'yy-mm-dd',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['eu']);
+
+return datepicker.regional['eu'];
+
+}));
diff --git a/inc/lang/eu/lang.php b/inc/lang/eu/lang.php
index 9a38099b3019e02ae8d55641d21acb08b05b54ac..0c996feaf8c3542783454aeeff0fda552b9f2e57 100644
--- a/inc/lang/eu/lang.php
+++ b/inc/lang/eu/lang.php
@@ -49,7 +49,7 @@ $lang['btn_revert']            = 'Berrezarri';
 $lang['btn_register']          = 'Erregistratu';
 $lang['btn_apply']             = 'Baieztatu';
 $lang['btn_media']             = 'Media Kudeatzailea';
-$lang['loggedinas']            = 'Erabiltzailea';
+$lang['loggedinas']            = 'Erabiltzailea:';
 $lang['user']                  = 'Erabiltzailea';
 $lang['pass']                  = 'Pasahitza';
 $lang['newpass']               = 'Pasahitz berria';
@@ -88,8 +88,8 @@ $lang['license']               = 'Besterik esan ezean, wiki hontako edukia ondor
 $lang['licenseok']             = 'Oharra: Orri hau editatzean, zure edukia ondorengo lizentziapean argitaratzea onartzen duzu: ';
 $lang['searchmedia']           = 'Bilatu fitxategi izena:';
 $lang['searchmedia_in']        = 'Bilatu %s-n';
-$lang['txt_upload']            = 'Ireki nahi den fitxategia aukeratu';
-$lang['txt_filename']          = 'Idatzi wikiname-a (aukerazkoa)';
+$lang['txt_upload']            = 'Ireki nahi den fitxategia aukeratu:';
+$lang['txt_filename']          = 'Idatzi wikiname-a (aukerazkoa):';
 $lang['txt_overwrt']           = 'Oraingo fitxategiaren gainean idatzi';
 $lang['lockedby']              = 'Momentu honetan blokeatzen:';
 $lang['lockexpire']            = 'Blokeaketa iraungitzen da:';
@@ -172,9 +172,9 @@ $lang['diff_type']             = 'Ikusi diferentziak:';
 $lang['diff_inline']           = 'Lerro tartean';
 $lang['diff_side']             = 'Ondoz ondo';
 $lang['line']                  = 'Marra';
-$lang['breadcrumb']            = 'Traza';
-$lang['youarehere']            = 'Hemen zaude';
-$lang['lastmod']               = 'Azken aldaketa';
+$lang['breadcrumb']            = 'Traza:';
+$lang['youarehere']            = 'Hemen zaude:';
+$lang['lastmod']               = 'Azken aldaketa:';
 $lang['by']                    = 'egilea:';
 $lang['deleted']               = 'ezabatua';
 $lang['created']               = 'sortua';
@@ -228,18 +228,18 @@ $lang['metaedit']              = 'Metadatua Aldatu';
 $lang['metasaveerr']           = 'Metadatuaren idazketak huts egin du';
 $lang['metasaveok']            = 'Metadatua gordea';
 $lang['btn_img_backto']            = 'Atzera hona %s';
-$lang['img_title']             = 'Izenburua';
-$lang['img_caption']           = 'Epigrafea';
-$lang['img_date']              = 'Data';
-$lang['img_fname']             = 'Fitxategi izena';
-$lang['img_fsize']             = 'Tamaina';
-$lang['img_artist']            = 'Artista';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Formatua';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Hitz-gakoak';
-$lang['img_width']             = 'Zabalera';
-$lang['img_height']            = 'Altuera';
+$lang['img_title']             = 'Izenburua:';
+$lang['img_caption']           = 'Epigrafea:';
+$lang['img_date']              = 'Data:';
+$lang['img_fname']             = 'Fitxategi izena:';
+$lang['img_fsize']             = 'Tamaina:';
+$lang['img_artist']            = 'Artista:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Formatua:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Hitz-gakoak:';
+$lang['img_width']             = 'Zabalera:';
+$lang['img_height']            = 'Altuera:';
 $lang['btn_mediaManager']           = 'Media kudeatzailean ikusi';
 $lang['subscr_subscribe_success'] = '%s gehitua %s-ren harpidetza zerrendara';
 $lang['subscr_subscribe_error'] = 'Errorea %s gehitzen %s-ren harpidetza zerrendara';
diff --git a/inc/lang/fa/index.txt b/inc/lang/fa/index.txt
index 89ed74b7d63ac2f1384e62053a2db3d5ef0dcaf5..993c8d164c00db4c41c0c837a56945a3ddf9fe12 100644
--- a/inc/lang/fa/index.txt
+++ b/inc/lang/fa/index.txt
@@ -1,3 +1,3 @@
-====== فهرست ======
+====== نقشه‌ی سایت ======
 
-این صفحه فهرست تمامی صفحات بر اساس [[doku>namespaces|فضای‌نام‌ها]] است.
\ No newline at end of file
+این صفحه حاوی فهرست تمامی صفحات موجود به ترتیب [[doku>namespaces|فضای‌نام‌ها]] است.
\ No newline at end of file
diff --git a/inc/lang/fa/jquery.ui.datepicker.js b/inc/lang/fa/jquery.ui.datepicker.js
index bb957f6d8d00eff536841d12ae2e67574168de25..8ffd664111ece1d11d0db44ea53e16c8a4c10c20 100644
--- a/inc/lang/fa/jquery.ui.datepicker.js
+++ b/inc/lang/fa/jquery.ui.datepicker.js
@@ -1,59 +1,73 @@
 /* Persian (Farsi) Translation for the jQuery UI date picker plugin. */
 /* Javad Mowlanezhad -- jmowla@gmail.com */
 /* Jalali calendar should supported soon! (Its implemented but I have to test it) */
-jQuery(function($) {
-	$.datepicker.regional['fa'] = {
-		closeText: 'بستن',
-		prevText: '&#x3C;قبلی',
-		nextText: 'بعدی&#x3E;',
-		currentText: 'امروز',
-		monthNames: [
-			'فروردين',
-			'ارديبهشت',
-			'خرداد',
-			'تير',
-			'مرداد',
-			'شهريور',
-			'مهر',
-			'آبان',
-			'آذر',
-			'دی',
-			'بهمن',
-			'اسفند'
-		],
-		monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
-		dayNames: [
-			'يکشنبه',
-			'دوشنبه',
-			'سه‌شنبه',
-			'چهارشنبه',
-			'پنجشنبه',
-			'جمعه',
-			'شنبه'
-		],
-		dayNamesShort: [
-			'ی',
-			'د',
-			'س',
-			'Ú†',
-			'Ù¾',
-			'ج',
-			'Ø´'
-		],
-		dayNamesMin: [
-			'ی',
-			'د',
-			'س',
-			'Ú†',
-			'Ù¾',
-			'ج',
-			'Ø´'
-		],
-		weekHeader: 'هف',
-		dateFormat: 'yy/mm/dd',
-		firstDay: 6,
-		isRTL: true,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['fa']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['fa'] = {
+	closeText: 'بستن',
+	prevText: '&#x3C;قبلی',
+	nextText: 'بعدی&#x3E;',
+	currentText: 'امروز',
+	monthNames: [
+		'فروردين',
+		'ارديبهشت',
+		'خرداد',
+		'تير',
+		'مرداد',
+		'شهريور',
+		'مهر',
+		'آبان',
+		'آذر',
+		'دی',
+		'بهمن',
+		'اسفند'
+	],
+	monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
+	dayNames: [
+		'يکشنبه',
+		'دوشنبه',
+		'سه‌شنبه',
+		'چهارشنبه',
+		'پنجشنبه',
+		'جمعه',
+		'شنبه'
+	],
+	dayNamesShort: [
+		'ی',
+		'د',
+		'س',
+		'Ú†',
+		'Ù¾',
+		'ج',
+		'Ø´'
+	],
+	dayNamesMin: [
+		'ی',
+		'د',
+		'س',
+		'Ú†',
+		'Ù¾',
+		'ج',
+		'Ø´'
+	],
+	weekHeader: 'هف',
+	dateFormat: 'yy/mm/dd',
+	firstDay: 6,
+	isRTL: true,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['fa']);
+
+return datepicker.regional['fa'];
+
+}));
diff --git a/inc/lang/fa/lang.php b/inc/lang/fa/lang.php
index 1e819419f43e3c1664c3ab605beba750a0198bfb..96ffcaf90b12fd0c7c0c9e5da92adce1aa5bc610 100644
--- a/inc/lang/fa/lang.php
+++ b/inc/lang/fa/lang.php
@@ -11,6 +11,8 @@
  * @author AmirH Hassaneini <mytechmix@gmail.com>
  * @author mehrdad <mehrdad.jafari.bojd@gmail.com>
  * @author reza_khn <reza_khn@yahoo.com>
+ * @author Hamid <zarrabi@sharif.edu>
+ * @author Mohamad Mehdi Habibi <habibi.esf@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'rtl';
@@ -38,30 +40,32 @@ $lang['btn_secedit']           = 'ویرایش';
 $lang['btn_login']             = 'ورود به سیستم';
 $lang['btn_logout']            = 'خروج از سیستم';
 $lang['btn_admin']             = 'مدیر';
-$lang['btn_update']            = 'به روز رسانی';
+$lang['btn_update']            = 'به‌روزرسانی';
 $lang['btn_delete']            = 'حذف';
 $lang['btn_back']              = 'عقب';
 $lang['btn_backlink']          = 'پیوندهای به این صفحه';
 $lang['btn_backtomedia']       = 'بازگشت به انتخاب فایل';
 $lang['btn_subscribe']         = 'عضویت در تغییرات صفحه';
-$lang['btn_profile']           = 'به روز رسانی پروفایل';
+$lang['btn_profile']           = 'به‌روزرسانی پروفایل';
 $lang['btn_reset']             = 'بازنشاندن';
-$lang['btn_resendpwd']         = 'تعیین کلمه عبور جدید';
+$lang['btn_resendpwd']         = 'تعیین گذرواژه‌ی جدید';
 $lang['btn_draft']             = 'ویرایش پیش‌نویس';
 $lang['btn_recover']           = 'بازیابی پیش‌نویس';
 $lang['btn_draftdel']          = 'حذف پیش‌نویس';
 $lang['btn_revert']            = 'بازیابی';
-$lang['btn_register']          = 'یک حساب جدید بسازید';
-$lang['btn_apply']             = 'اعمال کن';
-$lang['btn_media']             = 'مدیریت محتوای چند رسانه ای';
-$lang['btn_deleteuser']        = 'حذف حساب کاربری خود';
-$lang['loggedinas']            = 'به عنوان کاربر روبرو وارد شده‌اید:';
-$lang['user']                  = 'نام کاربری:';
-$lang['pass']                  = 'گذرواژه‌ی شما';
+$lang['btn_register']          = 'ثبت نام';
+$lang['btn_apply']             = 'اعمال';
+$lang['btn_media']             = 'مدیریت رسانه‌ها';
+$lang['btn_deleteuser']        = 'حساب کاربری مرا حذف کن';
+$lang['btn_img_backto']        = 'بازگشت به %s';
+$lang['btn_mediaManager']      = 'مشاهده در مدیریت رسانه‌ها';
+$lang['loggedinas']            = 'به این عنوان وارد شده‌اید:';
+$lang['user']                  = 'نام کاربری';
+$lang['pass']                  = 'گذرواژه‌';
 $lang['newpass']               = 'گذروازه‌ی جدید';
-$lang['oldpass']               = 'گذرواژه‌ی پیشین';
-$lang['passchk']               = 'گذرواژه را دوباره وارد کنید';
-$lang['remember']              = 'گذرواژه را به یاد بسپار.';
+$lang['oldpass']               = 'گذرواژه‌ی فعلی را تایید کنید';
+$lang['passchk']               = 'یک بار دیگر';
+$lang['remember']              = 'مرا به خاطر بسپار.';
 $lang['fullname']              = '*نام واقعی شما';
 $lang['email']                 = 'ایمیل شما*';
 $lang['profile']               = 'پروفایل کاربر';
@@ -86,6 +90,8 @@ $lang['profchanged']           = 'پروفایل کاربر با موفقیت ب
 $lang['profnodelete']          = 'ویکی توانایی پشتیبانی از حذف کاربران را ندارد';
 $lang['profdeleteuser']        = 'حذف حساب کاربری';
 $lang['profdeleted']           = 'حساب کاربری شما حذف گردیده است.';
+$lang['profconfdelete']        = 'می‌خواهم حساب کاربری من از این ویکی حذف شود. <br/> این عمل قابل برگشت نیست.';
+$lang['profconfdeletemissing'] = 'جعبه‌ی تأیید تیک نخورده است';
 $lang['pwdforget']             = 'گذرواژه‌ی خود را فراموش کرده‌اید؟ جدید دریافت کنید';
 $lang['resendna']              = 'این ویکی ارسال مجدد گذرواژه را پشتیبانی نمی‌کند';
 $lang['resendpwd']             = 'تعیین کلمه عبور جدید برای ';
@@ -98,12 +104,12 @@ $lang['license']               = 'به جز مواردی که ذکر می‌شو
 $lang['licenseok']             = 'توجه: با ویرایش این صفحه، شما مجوز زیر را تایید می‌کنید:';
 $lang['searchmedia']           = 'نام فایل برای جستجو:';
 $lang['searchmedia_in']        = 'جستجو در %s';
-$lang['txt_upload']            = 'فایل را برای ارسال انتخاب کنید';
-$lang['txt_filename']          = 'ارسال به صورت (اختیاری)';
+$lang['txt_upload']            = 'فایل را برای ارسال انتخاب کنید:';
+$lang['txt_filename']          = 'ارسال به صورت (اختیاری):';
 $lang['txt_overwrt']           = 'بر روی فایل موجود بنویس';
 $lang['maxuploadsize']         = 'حداکثر %s برای هر فایل مجاز است.';
-$lang['lockedby']              = 'در حال حاضر قفل شده است';
-$lang['lockexpire']            = 'قفل منقضی شده است';
+$lang['lockedby']              = 'در حال حاضر قفل شده است:';
+$lang['lockexpire']            = 'قفل منقضی شده است:';
 $lang['js']['willexpire']      = 'حالت قفل شما مدتی است منقضی شده است \n برای جلوگیری از تداخل دکمه‌ی پیش‌نمایش را برای صفر شدن ساعت قفل بزنید.';
 $lang['js']['notsavedyet']     = 'تغییرات ذخیره شده از بین خواهد رفت.
  می‌خواهید ادامه دهید؟';
@@ -135,9 +141,9 @@ $lang['js']['nosmblinks']      = 'پیوند به Windows share فقط در ای
 شما می‌توانید پیوند‌ها رو کپی کنید.';
 $lang['js']['linkwiz']         = 'ویزارد پیوند';
 $lang['js']['linkto']          = 'پیوند به:';
-$lang['js']['del_confirm']     = 'واقعن تصمیم به حذف این موارد دارید؟';
-$lang['js']['restore_confirm'] = 'آیا مطمئن هستید که می خواهید این نسخه را بازیابی کنید؟';
-$lang['js']['media_diff']      = 'تفاوت ها را ببینید : ';
+$lang['js']['del_confirm']     = 'واقعا تصمیم به حذف این موارد دارید؟';
+$lang['js']['restore_confirm'] = 'آیا مطمئن هستید که می خواهید این نگارش را بازیابی کنید؟';
+$lang['js']['media_diff']      = 'تفاوت ها را ببینید: ';
 $lang['js']['media_diff_both'] = 'پهلو به پهلو';
 $lang['js']['media_diff_opacity'] = 'درخشش از';
 $lang['js']['media_diff_portions'] = 'کش رفتن';
@@ -184,10 +190,15 @@ $lang['difflink']              = 'پیوند به صفحه‌ی تفاوت‌ه
 $lang['diff_type']             = 'مشاهده تغییرات:';
 $lang['diff_inline']           = 'خطی';
 $lang['diff_side']             = 'کلی';
+$lang['diffprevrev']           = 'نگارش قبل';
+$lang['diffnextrev']           = 'نگارش بعد';
+$lang['difflastrev']           = 'آخرین نگارش';
+$lang['diffbothprevrev']       = 'نگارش قبل در دو طرف';
+$lang['diffbothnextrev']       = 'نگارش بعد در دو طرف';
 $lang['line']                  = 'خط';
-$lang['breadcrumb']            = 'ردپا';
-$lang['youarehere']            = 'محل شما';
-$lang['lastmod']               = 'آخرین ویرایش';
+$lang['breadcrumb']            = 'ردپا:';
+$lang['youarehere']            = 'محل شما:';
+$lang['lastmod']               = 'آخرین ویرایش:';
 $lang['by']                    = 'توسط';
 $lang['deleted']               = 'حذف شد';
 $lang['created']               = 'ایجاد شد';
@@ -240,20 +251,18 @@ $lang['admin_register']        = 'یک حساب جدید بسازید';
 $lang['metaedit']              = 'ویرایش داده‌های متا';
 $lang['metasaveerr']           = 'نوشتن داده‌نما با مشکل مواجه شد';
 $lang['metasaveok']            = 'داده‌نما ذخیره شد';
-$lang['btn_img_backto']            = 'بازگشت به  %s';
-$lang['img_title']             = 'عنوان تصویر';
-$lang['img_caption']           = 'عنوان';
-$lang['img_date']              = 'تاریخ';
-$lang['img_fname']             = 'نام فایل';
-$lang['img_fsize']             = 'اندازه';
-$lang['img_artist']            = 'عکاس/هنرمند';
-$lang['img_copyr']             = 'دارنده‌ی حق تکثیر';
-$lang['img_format']            = 'فرمت';
-$lang['img_camera']            = 'دوربین';
-$lang['img_keywords']          = 'واژه‌های کلیدی';
-$lang['img_width']             = 'عرض';
-$lang['img_height']            = 'ارتفاع';
-$lang['btn_mediaManager']           = 'دیدن در مدیریت محتوای چند رسانه ای';
+$lang['img_title']             = 'عنوان تصویر:';
+$lang['img_caption']           = 'عنوان:';
+$lang['img_date']              = 'تاریخ:';
+$lang['img_fname']             = 'نام فایل:';
+$lang['img_fsize']             = 'اندازه:';
+$lang['img_artist']            = 'عکاس/هنرمند:';
+$lang['img_copyr']             = 'دارنده‌ی حق تکثیر:';
+$lang['img_format']            = 'فرمت:';
+$lang['img_camera']            = 'دوربین:';
+$lang['img_keywords']          = 'واژه‌های کلیدی:';
+$lang['img_width']             = 'عرض:';
+$lang['img_height']            = 'ارتفاع:';
 $lang['subscr_subscribe_success'] = '%s به لیست آبونه %s افزوده شد';
 $lang['subscr_subscribe_error'] = 'اشکال در افزودن %s به لیست آبونه %s';
 $lang['subscr_subscribe_noaddress'] = 'هیچ آدرسی برای این عضویت اضافه نشده است، شما نمی‌توانید به لیست آبونه اضافه شوید';
@@ -268,6 +277,8 @@ $lang['subscr_m_unsubscribe']  = 'لغو آبونه';
 $lang['subscr_m_subscribe']    = 'آبونه شدن';
 $lang['subscr_m_receive']      = 'دریافت کردن';
 $lang['subscr_style_every']    = 'ارسال رای‌نامه در تمامی تغییرات';
+$lang['subscr_style_digest']   = 'ایمیل خلاصه‌ی تغییرات هر روز (هر %.2f روز)';
+$lang['subscr_style_list']     = 'فهرست صفحات تغییریافته از آخرین ایمیل (هر %.2f روز)';
 $lang['authtempfail']          = 'معتبرسازی کابران موقتن مسدود می‌باشد. اگر این حالت پایدار بود، مدیر ویکی را باخبر سازید.';
 $lang['authpwdexpire']         = 'کلمه عبور شما در %d روز منقضی خواهد شد ، شما باید آن را زود تغییر دهید';
 $lang['i_chooselang']          = 'انتخاب زبان';
@@ -279,6 +290,7 @@ $lang['i_problems']            = 'نصب کننده با مشکلات زیر م
 $lang['i_modified']            = 'به دلایل امنیتی، این اسکریپت فقط با نصب تازه و بدون تغییر DokuWiki کار خواهد کرد.شما باید دوباره فایل فشرده را باز کنید <a href="http://dokuwiki.org/install">راهنمای نصب DokuWiki</a> را بررسی کنید.';
 $lang['i_funcna']              = 'تابع <code>%s</code> در PHP موجود نیست. ممکن است شرکت خدمات وب شما آن را مسدود کرده باشد.';
 $lang['i_phpver']              = 'نگارش پی‌اچ‌پی <code>%s</code> پایین‌تر از نگارش مورد نیاز، یعنی <code>%s</code> می‌باشد. خواهشمندیم به روز رسانی کنید.';
+$lang['i_mbfuncoverload']      = 'برای اجرای دوکوویکی باید mbstring.func_overload را در php.ini غیرفعال کنید.';
 $lang['i_permfail']            = 'شاخه‌ی <code>%s</code> قابلیت نوشتن ندارد. شما باید دسترسی‌های این شاخه را تنظیم کنید!';
 $lang['i_confexists']          = '<code>%s</code> پیش‌تر موجود است';
 $lang['i_writeerr']            = 'توانایی ایجاد <code>%s</code> نیست. شما باید دسترسی‌های شاخه یا فایل را بررسی کنید و فایل را به طور دستی ایجاد کنید.';
@@ -290,8 +302,12 @@ $lang['i_policy']              = 'کنترل دسترسی‌های اولیه';
 $lang['i_pol0']                = 'ویکی باز (همه می‌توانند بخوانند، بنویسند و فایل ارسال کنند)';
 $lang['i_pol1']                = 'ویکی عمومی (همه می‌توانند بخوانند، کاربران ثبت شده می‌توانند بنویسند و فایل ارسال کنند)';
 $lang['i_pol2']                = 'ویکی بسته (فقط کاربران ثبت شده می‌توانند بخوانند، بنویسند و فایل ارسال کنند)';
+$lang['i_allowreg']            = 'اجازه دهید که کاربران خود را ثبت نام کنند';
 $lang['i_retry']               = 'تلاش مجدد';
 $lang['i_license']             = 'لطفن مجوز این محتوا را وارد کنید:';
+$lang['i_license_none']        = 'هیچ اطلاعات مجوزی را نشان نده';
+$lang['i_pop_field']           = 'لطفا کمک کنید تا تجربه‌ی دوکوویکی را بهبود دهیم.';
+$lang['i_pop_label']           = 'ماهی یک بار، اطلاعات بدون‌نامی از نحوه‌ی استفاده به توسعه‌دهندگان دوکوویکی ارسال کن';
 $lang['recent_global']         = 'شما هم‌اکنون تغییرات فضای‌نام <b>%s</b> را مشاهده می‌کنید. شما هم‌چنین می‌توانید <a href="%s">تغییرات اخیر در کل ویکی را مشاهده نمایید</a>.';
 $lang['years']                 = '%d سال پیش';
 $lang['months']                = '%d ماه پیش';
@@ -319,8 +335,12 @@ $lang['media_view']            = '%s';
 $lang['media_viewold']         = '%s در %s';
 $lang['media_edit']            = '%s ویرایش';
 $lang['media_history']         = 'تاریخچه %s';
-$lang['media_meta_edited']     = 'فرا داده ها ویرایش شدند.';
-$lang['media_perm_read']       = 'متاسفانه ، شما حق خواندن این فایل ها را ندارید.';
-$lang['media_perm_upload']     = 'متاسفانه ، شما حق آپلود این فایل ها را ندارید.';
-$lang['media_update']          = 'آپلود نسخه جدید';
+$lang['media_meta_edited']     = 'فراداده‌ها ویرایش شدند.';
+$lang['media_perm_read']       = 'متاسفانه شما حق خواندن این فایل‌ها را ندارید.';
+$lang['media_perm_upload']     = 'متاسفانه شما حق آپلود این فایل‌ها را ندارید.';
+$lang['media_update']          = 'آپلود نسخه‌ی جدید';
 $lang['media_restore']         = 'بازیابی این نسخه';
+$lang['currentns']             = 'فضای نام جاری';
+$lang['searchresult']          = 'نتیجه‌ی جستجو';
+$lang['plainhtml']             = 'HTML ساده';
+$lang['wikimarkup']            = 'نشانه‌گذاری ویکی';
diff --git a/inc/lang/fi/jquery.ui.datepicker.js b/inc/lang/fi/jquery.ui.datepicker.js
index e5c554aba426892b0def46140244f4437fc9e548..eac170496f906b409d706f9a6894b7e5a09005c6 100644
--- a/inc/lang/fi/jquery.ui.datepicker.js
+++ b/inc/lang/fi/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Finnish initialisation for the jQuery UI date picker plugin. */
 /* Written by Harri Kilpiö (harrikilpio@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['fi'] = {
-		closeText: 'Sulje',
-		prevText: '&#xAB;Edellinen',
-		nextText: 'Seuraava&#xBB;',
-		currentText: 'Tänään',
-		monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kesäkuu',
-		'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'],
-		monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kesä',
-		'Heinä','Elo','Syys','Loka','Marras','Joulu'],
-		dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','La'],
-		dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'],
-		dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'],
-		weekHeader: 'Vk',
-		dateFormat: 'd.m.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['fi']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['fi'] = {
+	closeText: 'Sulje',
+	prevText: '&#xAB;Edellinen',
+	nextText: 'Seuraava&#xBB;',
+	currentText: 'Tänään',
+	monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kesäkuu',
+	'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'],
+	monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kesä',
+	'Heinä','Elo','Syys','Loka','Marras','Joulu'],
+	dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','La'],
+	dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'],
+	dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'],
+	weekHeader: 'Vk',
+	dateFormat: 'd.m.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['fi']);
+
+return datepicker.regional['fi'];
+
+}));
diff --git a/inc/lang/fi/lang.php b/inc/lang/fi/lang.php
index 9b877013e5d45ac1a69cfbb5ba3ceb5163c0663c..0f82c3b7a9db0bc85481316e75365161404be2b7 100644
--- a/inc/lang/fi/lang.php
+++ b/inc/lang/fi/lang.php
@@ -53,7 +53,7 @@ $lang['btn_register']          = 'Rekisteröidy';
 $lang['btn_apply']             = 'Toteuta';
 $lang['btn_media']             = 'Media manager';
 $lang['btn_deleteuser']        = 'Poista tilini';
-$lang['loggedinas']            = 'Kirjautunut nimellä';
+$lang['loggedinas']            = 'Kirjautunut nimellä:';
 $lang['user']                  = 'Käyttäjänimi';
 $lang['pass']                  = 'Salasana';
 $lang['newpass']               = 'Uusi salasana';
@@ -98,12 +98,12 @@ $lang['license']               = 'Jollei muuta ole mainittu, niin sisältö täs
 $lang['licenseok']             = 'Huom: Muokkaamalla tätä sivua suostut lisensoimaan sisällön seuraavan lisenssin mukaisesti:';
 $lang['searchmedia']           = 'Etsi tiedostoa nimeltä:';
 $lang['searchmedia_in']        = 'Etsi kohteesta %s';
-$lang['txt_upload']            = 'Valitse tiedosto lähetettäväksi';
-$lang['txt_filename']          = 'Lähetä nimellä (valinnainen)';
+$lang['txt_upload']            = 'Valitse tiedosto lähetettäväksi:';
+$lang['txt_filename']          = 'Lähetä nimellä (valinnainen):';
 $lang['txt_overwrt']           = 'Ylikirjoita olemassa oleva';
 $lang['maxuploadsize']         = 'Palvelimelle siirto max. %s / tiedosto.';
-$lang['lockedby']              = 'Tällä hetkellä tiedoston on lukinnut';
-$lang['lockexpire']            = 'Lukitus päättyy';
+$lang['lockedby']              = 'Tällä hetkellä tiedoston on lukinnut:';
+$lang['lockexpire']            = 'Lukitus päättyy:';
 $lang['js']['willexpire']      = 'Lukituksesi tämän sivun muokkaukseen päättyy minuutin kuluttua.\nRistiriitojen välttämiseksi paina esikatselu-nappia nollataksesi lukitusajan.';
 $lang['js']['notsavedyet']     = 'Dokumentissa on tallentamattomia muutoksia, jotka häviävät.
  Haluatko varmasti jatkaa?';
@@ -185,9 +185,9 @@ $lang['diff_type']             = 'Näytä eroavaisuudet:';
 $lang['diff_inline']           = 'Sisäkkäin';
 $lang['diff_side']             = 'Vierekkäin';
 $lang['line']                  = 'Rivi';
-$lang['breadcrumb']            = 'Jäljet';
-$lang['youarehere']            = 'Olet täällä';
-$lang['lastmod']               = 'Viimeksi muutettu';
+$lang['breadcrumb']            = 'Jäljet:';
+$lang['youarehere']            = 'Olet täällä:';
+$lang['lastmod']               = 'Viimeksi muutettu:';
 $lang['by']                    = '/';
 $lang['deleted']               = 'poistettu';
 $lang['created']               = 'luotu';
@@ -241,18 +241,18 @@ $lang['metaedit']              = 'Muokkaa metadataa';
 $lang['metasaveerr']           = 'Metadatan kirjoittaminen epäonnistui';
 $lang['metasaveok']            = 'Metadata tallennettu';
 $lang['btn_img_backto']            = 'Takaisin %s';
-$lang['img_title']             = 'Otsikko';
-$lang['img_caption']           = 'Kuvateksti';
-$lang['img_date']              = 'Päivämäärä';
-$lang['img_fname']             = 'Tiedoston nimi';
-$lang['img_fsize']             = 'Koko';
-$lang['img_artist']            = 'Kuvaaja';
-$lang['img_copyr']             = 'Tekijänoikeus';
-$lang['img_format']            = 'Formaatti';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Avainsanat';
-$lang['img_width']             = 'Leveys';
-$lang['img_height']            = 'Korkeus';
+$lang['img_title']             = 'Otsikko:';
+$lang['img_caption']           = 'Kuvateksti:';
+$lang['img_date']              = 'Päivämäärä:';
+$lang['img_fname']             = 'Tiedoston nimi:';
+$lang['img_fsize']             = 'Koko:';
+$lang['img_artist']            = 'Kuvaaja:';
+$lang['img_copyr']             = 'Tekijänoikeus:';
+$lang['img_format']            = 'Formaatti:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Avainsanat:';
+$lang['img_width']             = 'Leveys:';
+$lang['img_height']            = 'Korkeus:';
 $lang['btn_mediaManager']           = 'Näytä mediamanagerissa';
 $lang['subscr_subscribe_success'] = '%s lisätty %s tilauslistalle';
 $lang['subscr_subscribe_error'] = 'Virhe lisättäessä %s tilauslistalle %s';
diff --git a/inc/lang/fo/jquery.ui.datepicker.js b/inc/lang/fo/jquery.ui.datepicker.js
index cb0e3def70f2fe196612a85d025b423e95523afe..1754f7be790673c5c4eb134730f9f16933e9f539 100644
--- a/inc/lang/fo/jquery.ui.datepicker.js
+++ b/inc/lang/fo/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Faroese initialisation for the jQuery UI date picker plugin */
 /* Written by Sverri Mohr Olsen, sverrimo@gmail.com */
-jQuery(function($){
-	$.datepicker.regional['fo'] = {
-		closeText: 'Lat aftur',
-		prevText: '&#x3C;Fyrra',
-		nextText: 'Næsta&#x3E;',
-		currentText: 'Í dag',
-		monthNames: ['Januar','Februar','Mars','Apríl','Mei','Juni',
-		'Juli','August','September','Oktober','November','Desember'],
-		monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
-		'Jul','Aug','Sep','Okt','Nov','Des'],
-		dayNames: ['Sunnudagur','Mánadagur','Týsdagur','Mikudagur','Hósdagur','Fríggjadagur','Leyardagur'],
-		dayNamesShort: ['Sun','Mán','Týs','Mik','Hós','Frí','Ley'],
-		dayNamesMin: ['Su','Má','Tý','Mi','Hó','Fr','Le'],
-		weekHeader: 'Vk',
-		dateFormat: 'dd-mm-yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['fo']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['fo'] = {
+	closeText: 'Lat aftur',
+	prevText: '&#x3C;Fyrra',
+	nextText: 'Næsta&#x3E;',
+	currentText: 'Í dag',
+	monthNames: ['Januar','Februar','Mars','Apríl','Mei','Juni',
+	'Juli','August','September','Oktober','November','Desember'],
+	monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
+	'Jul','Aug','Sep','Okt','Nov','Des'],
+	dayNames: ['Sunnudagur','Mánadagur','Týsdagur','Mikudagur','Hósdagur','Fríggjadagur','Leyardagur'],
+	dayNamesShort: ['Sun','Mán','Týs','Mik','Hós','Frí','Ley'],
+	dayNamesMin: ['Su','Má','Tý','Mi','Hó','Fr','Le'],
+	weekHeader: 'Vk',
+	dateFormat: 'dd-mm-yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['fo']);
+
+return datepicker.regional['fo'];
+
+}));
diff --git a/inc/lang/fo/lang.php b/inc/lang/fo/lang.php
index 2613186eb88a4bdeaaf782d4cd2289d2b4369ba0..b326d27ac97bef32d9c92334f7f193af3ba8e607 100644
--- a/inc/lang/fo/lang.php
+++ b/inc/lang/fo/lang.php
@@ -45,7 +45,7 @@ $lang['btn_recover']           = 'Endurbygg kladdu';
 $lang['btn_draftdel']          = 'Sletta';
 $lang['btn_revert']            = 'Endurbygg';
 $lang['btn_register']          = 'Melda til';
-$lang['loggedinas']            = 'Ritavur inn sum';
+$lang['loggedinas']            = 'Ritavur inn sum:';
 $lang['user']                  = 'Brúkaranavn';
 $lang['pass']                  = 'Loyniorð';
 $lang['newpass']               = 'Nýtt loyniorð';
@@ -83,11 +83,11 @@ $lang['license']               = 'Um ikki annað er tilskilað, so er tilfar á
 $lang['licenseok']             = 'Legg til merkis: Við at dagføra hesa síðu samtykkir tú at loyva margfalding av tilfarinum undir fylgjandi treytum:';
 $lang['searchmedia']           = 'Leita eftir fíl navn:';
 $lang['searchmedia_in']        = 'Leita í %s';
-$lang['txt_upload']            = 'Vel tí fílu sum skal leggjast upp';
-$lang['txt_filename']          = 'Sláa inn wikinavn (valfrítt)';
+$lang['txt_upload']            = 'Vel tí fílu sum skal leggjast upp:';
+$lang['txt_filename']          = 'Sláa inn wikinavn (valfrítt):';
 $lang['txt_overwrt']           = 'Yvurskriva verandi fílu';
-$lang['lockedby']              = 'Fyribils læst av';
-$lang['lockexpire']            = 'Lásið ferð úr gildi kl.';
+$lang['lockedby']              = 'Fyribils læst av:';
+$lang['lockexpire']            = 'Lásið ferð úr gildi kl.:';
 $lang['js']['willexpire']            = 'Títt lás á hetta skjalið ferð úr gildi um ein minnutt.\nTrýst á Forskoðan-knappin fyri at sleppa undan trupulleikum.';
 $lang['js']['notsavedyet']     = 'Tað eru gjørdar broytingar í skjalinum, um tú haldur fram vilja broytingar fara fyri skeytið.
 Ynskir tú at halda fram?';
@@ -124,9 +124,9 @@ $lang['current']               = 'núverandi';
 $lang['yours']                 = 'Tín útgáva';
 $lang['diff']                  = 'vís broytingar í mun til núverandi útgávu';
 $lang['line']                  = 'Linja';
-$lang['breadcrumb']            = 'Leið';
-$lang['youarehere']            = 'Tú ert her';
-$lang['lastmod']               = 'Seinast broytt';
+$lang['breadcrumb']            = 'Leið:';
+$lang['youarehere']            = 'Tú ert her:';
+$lang['lastmod']               = 'Seinast broytt:';
 $lang['by']                    = 'av';
 $lang['deleted']               = 'strika';
 $lang['created']               = 'stovna';
@@ -158,14 +158,14 @@ $lang['metaedit']              = 'Rætta metadáta';
 $lang['metasaveerr']           = 'Brek við skriving av metadáta';
 $lang['metasaveok']            = 'Metadáta goymt';
 $lang['btn_img_backto']            = 'Aftur til %s';
-$lang['img_title']             = 'Heitið';
-$lang['img_caption']           = 'Myndatekstur';
-$lang['img_date']              = 'Dato';
-$lang['img_fname']             = 'Fílunavn';
-$lang['img_fsize']             = 'Stødd';
-$lang['img_artist']            = 'Myndafólk';
-$lang['img_copyr']             = 'Upphavsrættur';
-$lang['img_format']            = 'Snið';
-$lang['img_camera']            = 'Fototól';
-$lang['img_keywords']          = 'Evnisorð';
+$lang['img_title']             = 'Heitið:';
+$lang['img_caption']           = 'Myndatekstur:';
+$lang['img_date']              = 'Dato:';
+$lang['img_fname']             = 'Fílunavn:';
+$lang['img_fsize']             = 'Stødd:';
+$lang['img_artist']            = 'Myndafólk:';
+$lang['img_copyr']             = 'Upphavsrættur:';
+$lang['img_format']            = 'Snið:';
+$lang['img_camera']            = 'Fototól:';
+$lang['img_keywords']          = 'Evnisorð:';
 $lang['authtempfail']          = 'Validering av brúkara virkar fyribils ikki. Um hetta er varandi, fá so samband við umboðsstjóran á hesi wiki.';
diff --git a/inc/lang/fr/denied.txt b/inc/lang/fr/denied.txt
index da01a40869d58b844337140af23bf1018457f50f..6de1930040197975b21b79762ba656e08a01517a 100644
--- a/inc/lang/fr/denied.txt
+++ b/inc/lang/fr/denied.txt
@@ -1,4 +1,4 @@
 ====== Autorisation refusée ======
 
-Désolé, vous n'avez pas suffisement d'autorisations pour poursuivre votre demande.
+Désolé, vous n'avez pas suffisamment d'autorisations pour poursuivre votre demande.
 
diff --git a/inc/lang/fr/jquery.ui.datepicker.js b/inc/lang/fr/jquery.ui.datepicker.js
index 2d06743a66121bc35ecb665db5d50079bf376db4..2f5ff3cbefabee53fd5e287adc515c7fcdc1e42e 100644
--- a/inc/lang/fr/jquery.ui.datepicker.js
+++ b/inc/lang/fr/jquery.ui.datepicker.js
@@ -2,24 +2,38 @@
 /* Written by Keith Wood (kbwood{at}iinet.com.au),
 			  Stéphane Nahmani (sholby@sholby.net),
 			  Stéphane Raimbault <stephane.raimbault@gmail.com> */
-jQuery(function($){
-	$.datepicker.regional['fr'] = {
-		closeText: 'Fermer',
-		prevText: 'Précédent',
-		nextText: 'Suivant',
-		currentText: 'Aujourd\'hui',
-		monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin',
-			'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
-		monthNamesShort: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin',
-			'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
-		dayNames: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
-		dayNamesShort: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
-		dayNamesMin: ['D','L','M','M','J','V','S'],
-		weekHeader: 'Sem.',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['fr']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['fr'] = {
+	closeText: 'Fermer',
+	prevText: 'Précédent',
+	nextText: 'Suivant',
+	currentText: 'Aujourd\'hui',
+	monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin',
+		'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
+	monthNamesShort: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin',
+		'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
+	dayNames: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
+	dayNamesShort: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
+	dayNamesMin: ['D','L','M','M','J','V','S'],
+	weekHeader: 'Sem.',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['fr']);
+
+return datepicker.regional['fr'];
+
+}));
diff --git a/inc/lang/fr/lang.php b/inc/lang/fr/lang.php
index 40bc25d101fbb082d92e9212661ebeb993e94535..a7651e7309aab107c5488018936d88e1581de228 100644
--- a/inc/lang/fr/lang.php
+++ b/inc/lang/fr/lang.php
@@ -30,6 +30,11 @@
  * @author Emmanuel <seedfloyd@gmail.com>
  * @author Jérôme Brandt <jeromebrandt@gmail.com>
  * @author Wild <wild.dagger@free.fr>
+ * @author ggallon <gwenael.gallon@mac.com>
+ * @author David VANTYGHEM <david.vantyghem@free.fr>
+ * @author Caillot <remicaillot5@gmail.com>
+ * @author Schplurtz le Déboulonné <schplurtz@laposte.net>
+ * @author YoBoY <yoboy@ubuntu-fr.org>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -50,7 +55,7 @@ $lang['btn_newer']             = '<< Plus récent';
 $lang['btn_older']             = 'Moins récent >>';
 $lang['btn_revs']              = 'Anciennes révisions';
 $lang['btn_recent']            = 'Derniers changements';
-$lang['btn_upload']            = 'Envoyer';
+$lang['btn_upload']            = 'Téléverser';
 $lang['btn_cancel']            = 'Annuler';
 $lang['btn_index']             = 'Plan du site';
 $lang['btn_secedit']           = 'Modifier';
@@ -60,9 +65,9 @@ $lang['btn_admin']             = 'Administrer';
 $lang['btn_update']            = 'Mettre à jour';
 $lang['btn_delete']            = 'Effacer';
 $lang['btn_back']              = 'Retour';
-$lang['btn_backlink']          = 'Liens vers cette page';
+$lang['btn_backlink']          = 'Liens de retour';
 $lang['btn_backtomedia']       = 'Retour à la sélection du fichier média';
-$lang['btn_subscribe']         = 'S\'abonner à la page';
+$lang['btn_subscribe']         = 'Gérer souscriptions';
 $lang['btn_profile']           = 'Mettre à jour le profil';
 $lang['btn_reset']             = 'Réinitialiser';
 $lang['btn_resendpwd']         = 'Définir un nouveau mot de passe';
@@ -74,7 +79,9 @@ $lang['btn_register']          = 'Créer un compte';
 $lang['btn_apply']             = 'Appliquer';
 $lang['btn_media']             = 'Gestionnaire de médias';
 $lang['btn_deleteuser']        = 'Supprimer mon compte';
-$lang['loggedinas']            = 'Connecté en tant que ';
+$lang['btn_img_backto']        = 'Retour vers %s';
+$lang['btn_mediaManager']      = 'Voir dans le gestionnaire de médias';
+$lang['loggedinas']            = 'Connecté en tant que :';
 $lang['user']                  = 'Utilisateur';
 $lang['pass']                  = 'Mot de passe';
 $lang['newpass']               = 'Nouveau mot de passe';
@@ -84,20 +91,20 @@ $lang['remember']              = 'Mémoriser';
 $lang['fullname']              = 'Nom';
 $lang['email']                 = 'Adresse de courriel';
 $lang['profile']               = 'Profil utilisateur';
-$lang['badlogin']              = 'L\'utilisateur ou le mot de passe est incorrect.';
+$lang['badlogin']              = 'Le nom d\'utilisateur ou le mot de passe est incorrect.';
 $lang['badpassconfirm']        = 'Désolé, le mot de passe est erroné';
 $lang['minoredit']             = 'Modification mineure';
-$lang['draftdate']             = 'Brouillon enregistré de manière automatique le';
+$lang['draftdate']             = 'Brouillon enregistré automatiquement le';
 $lang['nosecedit']             = 'La page a changé entre temps, les informations de la section sont obsolètes ; la page complète a été chargée à la place.';
 $lang['regmissing']            = 'Désolé, vous devez remplir tous les champs.';
-$lang['reguexists']            = 'Désolé, ce nom d\'utilisateur est déjà utilisé.';
+$lang['reguexists']            = 'Désolé, ce nom d\'utilisateur est déjà pris.';
 $lang['regsuccess']            = 'L\'utilisateur a été créé. Le mot de passe a été expédié par courriel.';
 $lang['regsuccess2']           = 'L\'utilisateur a été créé.';
-$lang['regmailfail']           = 'Il semble y avoir un problème à l\'envoi du courriel. Contactez l\'administrateur.';
+$lang['regmailfail']           = 'On dirait qu\'il y a eu une erreur lors de l\'envoi du mot de passe de messagerie. Veuillez contacter l\'administrateur !';
 $lang['regbadmail']            = 'L\'adresse de courriel semble incorrecte. Si vous pensez que c\'est une erreur, contactez l\'administrateur.';
 $lang['regbadpass']            = 'Les deux mots de passe fournis sont différents, veuillez recommencez.';
 $lang['regpwmail']             = 'Votre mot de passe DokuWiki';
-$lang['reghere']               = 'Vous n\'avez pas encore de compte ? Enregistrez-vous ici ';
+$lang['reghere']               = 'Vous n\'avez pas encore de compte ? Inscrivez-vous';
 $lang['profna']                = 'Ce wiki ne permet pas de modifier les profils';
 $lang['profnochange']          = 'Pas de modification, rien à faire.';
 $lang['profnoempty']           = 'Un nom ou une adresse de courriel vide n\'est pas permis.';
@@ -119,12 +126,12 @@ $lang['license']               = 'Sauf mention contraire, le contenu de ce wiki
 $lang['licenseok']             = 'Note : En modifiant cette page, vous acceptez que le contenu soit placé sous les termes de la licence suivante :';
 $lang['searchmedia']           = 'Chercher le nom de fichier :';
 $lang['searchmedia_in']        = 'Chercher dans %s';
-$lang['txt_upload']            = 'Sélectionnez un fichier à envoyer ';
-$lang['txt_filename']          = 'Envoyer en tant que (optionnel) ';
+$lang['txt_upload']            = 'Sélectionnez un fichier à envoyer:';
+$lang['txt_filename']          = 'Envoyer en tant que (optionnel):';
 $lang['txt_overwrt']           = 'Écraser le fichier cible (s\'il existe)';
 $lang['maxuploadsize']         = 'Taille d\'envoi maximale : %s par fichier';
-$lang['lockedby']              = 'Actuellement bloqué par';
-$lang['lockexpire']            = 'Le blocage expire à';
+$lang['lockedby']              = 'Actuellement bloqué par:';
+$lang['lockexpire']            = 'Le blocage expire à:';
 $lang['js']['willexpire']      = 'Votre blocage pour la modification de cette page expire dans une minute.\nPour éviter les conflits, utilisez le bouton « Aperçu » pour réinitialiser le minuteur.';
 $lang['js']['notsavedyet']     = 'Les modifications non enregistrées seront perdues. Voulez-vous vraiment continuer ?';
 $lang['js']['searchmedia']     = 'Chercher des fichiers';
@@ -203,10 +210,15 @@ $lang['difflink']              = 'Lien vers cette vue comparative';
 $lang['diff_type']             = 'Voir les différences :';
 $lang['diff_inline']           = 'Sur une seule ligne';
 $lang['diff_side']             = 'Côte à côte';
+$lang['diffprevrev']           = 'Révision précédente';
+$lang['diffnextrev']           = 'Prochaine révision';
+$lang['difflastrev']           = 'Dernière révision';
+$lang['diffbothprevrev']       = 'Les deux révisions précédentes';
+$lang['diffbothnextrev']       = 'Les deux révisions suivantes';
 $lang['line']                  = 'Ligne';
-$lang['breadcrumb']            = 'Piste';
-$lang['youarehere']            = 'Vous êtes ici';
-$lang['lastmod']               = 'Dernière modification';
+$lang['breadcrumb']            = 'Piste:';
+$lang['youarehere']            = 'Vous êtes ici:';
+$lang['lastmod']               = 'Dernière modification:';
 $lang['by']                    = 'par';
 $lang['deleted']               = 'supprimée';
 $lang['created']               = 'créée';
@@ -259,20 +271,18 @@ $lang['admin_register']        = 'Ajouter un nouvel utilisateur';
 $lang['metaedit']              = 'Modifier les métadonnées';
 $lang['metasaveerr']           = 'Erreur lors de l\'enregistrement des métadonnées';
 $lang['metasaveok']            = 'Métadonnées enregistrées';
-$lang['btn_img_backto']            = 'Retour à %s';
-$lang['img_title']             = 'Titre';
-$lang['img_caption']           = 'Légende';
-$lang['img_date']              = 'Date';
-$lang['img_fname']             = 'Nom de fichier';
-$lang['img_fsize']             = 'Taille';
-$lang['img_artist']            = 'Photographe';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Appareil photo';
-$lang['img_keywords']          = 'Mots-clés';
-$lang['img_width']             = 'Largeur';
-$lang['img_height']            = 'Hauteur';
-$lang['btn_mediaManager']           = 'Voir dans le gestionnaire de médias';
+$lang['img_title']             = 'Titre:';
+$lang['img_caption']           = 'Légende:';
+$lang['img_date']              = 'Date:';
+$lang['img_fname']             = 'Nom de fichier:';
+$lang['img_fsize']             = 'Taille:';
+$lang['img_artist']            = 'Photographe:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Appareil photo:';
+$lang['img_keywords']          = 'Mots-clés:';
+$lang['img_width']             = 'Largeur:';
+$lang['img_height']            = 'Hauteur:';
 $lang['subscr_subscribe_success'] = '%s a été ajouté à la liste de souscription de %s';
 $lang['subscr_subscribe_error'] = 'Erreur à l\'ajout de %s à la liste de souscription de %s';
 $lang['subscr_subscribe_noaddress'] = 'Il n\'y a pas d\'adresse associée à votre identifiant, vous ne pouvez pas être ajouté à la liste de souscription';
@@ -300,6 +310,7 @@ $lang['i_problems']            = 'L\'installateur a détecté les problèmes ind
 $lang['i_modified']            = 'Pour des raisons de sécurité, ce script ne fonctionne qu\'avec une installation neuve et non modifiée de DokuWiki. Vous devriez ré-extraire les fichiers depuis le paquet téléchargé ou consulter les <a href="http://dokuwiki.org/install">instructions d\'installation de DokuWiki</a>';
 $lang['i_funcna']              = 'La fonction PHP <code>%s</code> n\'est pas disponible. Peut-être que votre hébergeur web l\'a désactivée ?';
 $lang['i_phpver']              = 'Votre version de PHP (%s) est antérieure à la version requise (%s). Vous devez mettre à jour votre installation de PHP.';
+$lang['i_mbfuncoverload']      = 'Il faut désactiver mbstring.func_overload dans php.ini pour DokuWiki';
 $lang['i_permfail']            = '<code>%s</code> n\'est pas accessible en écriture pour DokuWiki. Vous devez corriger les autorisations de ce répertoire !';
 $lang['i_confexists']          = '<code>%s</code> existe déjà';
 $lang['i_writeerr']            = 'Impossible de créer <code>%s</code>. Vous devez vérifier les autorisations des répertoires/fichiers et créer le fichier manuellement.';
@@ -349,7 +360,7 @@ $lang['media_perm_read']       = 'Désolé, vous n\'avez pas l\'autorisation de
 $lang['media_perm_upload']     = 'Désolé, vous n\'avez pas l\'autorisation d\'envoyer des fichiers.';
 $lang['media_update']          = 'Envoyer une nouvelle version';
 $lang['media_restore']         = 'Restaurer cette version';
-$lang['currentns']             = 'Namespace actuel';
+$lang['currentns']             = 'Catégorie courante';
 $lang['searchresult']          = 'Résultat de la recherche';
 $lang['plainhtml']             = 'HTML brut';
 $lang['wikimarkup']            = 'Wiki balise';
diff --git a/inc/lang/fr/newpage.txt b/inc/lang/fr/newpage.txt
index b23bf4fe4d766dbe258ae240396a6e82df2ee045..c649489fae1ed24af2e368be9a4491c96d1f1daf 100644
--- a/inc/lang/fr/newpage.txt
+++ b/inc/lang/fr/newpage.txt
@@ -1,4 +1,4 @@
 ====== Cette page n'existe pas encore ======
 
-Vous avez suivi un lien vers une page qui n'existe pas encore. Si vos autorisations sont suffisants, vous pouvez la créer en cliquant sur « Créer cette page ».
+Vous avez suivi un lien vers une page qui n'existe pas encore. Si vos permissions sont suffisantes, vous pouvez la créer en cliquant sur « Créer cette page ».
 
diff --git a/inc/lang/fr/subscr_form.txt b/inc/lang/fr/subscr_form.txt
index 49c0cf443e85da86c355120ec5bed80956051819..d68c05e6a05185689a15650fbaaa7dee873216a6 100644
--- a/inc/lang/fr/subscr_form.txt
+++ b/inc/lang/fr/subscr_form.txt
@@ -1,3 +1,3 @@
-====== Gestion de l'abonnement ======
+====== Gestion des souscriptions ======
 
-Cette page vous permet de gérer vos abonnements à la page et à la catégorie courantes
\ No newline at end of file
+Cette page vous permet de gérer vos souscriptions pour suivre les modifications sur la page et sur la catégorie courante.
\ No newline at end of file
diff --git a/inc/lang/gl/jquery.ui.datepicker.js b/inc/lang/gl/jquery.ui.datepicker.js
index 59b989a6dd44782da0503367a8fcba8b9ca6c864..ed5b2d2fc2fbafb8625796f173eb1e6a086e935d 100644
--- a/inc/lang/gl/jquery.ui.datepicker.js
+++ b/inc/lang/gl/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Galician localization for 'UI date picker' jQuery extension. */
 /* Translated by Jorge Barreiro <yortx.barry@gmail.com>. */
-jQuery(function($){
-	$.datepicker.regional['gl'] = {
-		closeText: 'Pechar',
-		prevText: '&#x3C;Ant',
-		nextText: 'Seg&#x3E;',
-		currentText: 'Hoxe',
-		monthNames: ['Xaneiro','Febreiro','Marzo','Abril','Maio','Xuño',
-		'Xullo','Agosto','Setembro','Outubro','Novembro','Decembro'],
-		monthNamesShort: ['Xan','Feb','Mar','Abr','Mai','Xuñ',
-		'Xul','Ago','Set','Out','Nov','Dec'],
-		dayNames: ['Domingo','Luns','Martes','Mércores','Xoves','Venres','Sábado'],
-		dayNamesShort: ['Dom','Lun','Mar','Mér','Xov','Ven','Sáb'],
-		dayNamesMin: ['Do','Lu','Ma','Mé','Xo','Ve','Sá'],
-		weekHeader: 'Sm',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['gl']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['gl'] = {
+	closeText: 'Pechar',
+	prevText: '&#x3C;Ant',
+	nextText: 'Seg&#x3E;',
+	currentText: 'Hoxe',
+	monthNames: ['Xaneiro','Febreiro','Marzo','Abril','Maio','Xuño',
+	'Xullo','Agosto','Setembro','Outubro','Novembro','Decembro'],
+	monthNamesShort: ['Xan','Feb','Mar','Abr','Mai','Xuñ',
+	'Xul','Ago','Set','Out','Nov','Dec'],
+	dayNames: ['Domingo','Luns','Martes','Mércores','Xoves','Venres','Sábado'],
+	dayNamesShort: ['Dom','Lun','Mar','Mér','Xov','Ven','Sáb'],
+	dayNamesMin: ['Do','Lu','Ma','Mé','Xo','Ve','Sá'],
+	weekHeader: 'Sm',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['gl']);
+
+return datepicker.regional['gl'];
+
+}));
diff --git a/inc/lang/gl/lang.php b/inc/lang/gl/lang.php
index 0c81f1fb2952ca427a28b6aa28e08085a49a6fd5..aed2253590adacee2d791ba7fbc84417a6ae6c8b 100644
--- a/inc/lang/gl/lang.php
+++ b/inc/lang/gl/lang.php
@@ -49,7 +49,7 @@ $lang['btn_revert']            = 'Restaurar';
 $lang['btn_register']          = 'Rexístrate';
 $lang['btn_apply']             = 'Aplicar';
 $lang['btn_media']             = 'Xestor de Arquivos-Media';
-$lang['loggedinas']            = 'Iniciaches sesión como';
+$lang['loggedinas']            = 'Iniciaches sesión como:';
 $lang['user']                  = 'Nome de Usuario';
 $lang['pass']                  = 'Contrasinal';
 $lang['newpass']               = 'Novo Contrasinal';
@@ -88,12 +88,12 @@ $lang['license']               = 'O contido deste wiki, agás onde se indique o
 $lang['licenseok']             = 'Nota: Ao editares esta páxina estás a aceptar o licenciamento do contido baixo da seguinte licenza:';
 $lang['searchmedia']           = 'Procurar nome de arquivo:';
 $lang['searchmedia_in']        = 'Procurar en %s';
-$lang['txt_upload']            = 'Escolle o arquivo para subir';
-$lang['txt_filename']          = 'Subir como (opcional)';
+$lang['txt_upload']            = 'Escolle o arquivo para subir:';
+$lang['txt_filename']          = 'Subir como (opcional):';
 $lang['txt_overwrt']           = 'Sobrescribir arquivo existente';
 $lang['maxuploadsize']         = 'Subida máxima %s por arquivo.';
-$lang['lockedby']              = 'Bloqueado actualmente por';
-$lang['lockexpire']            = 'O bloqueo remata o';
+$lang['lockedby']              = 'Bloqueado actualmente por:';
+$lang['lockexpire']            = 'O bloqueo remata o:';
 $lang['js']['willexpire']      = 'O teu bloqueo para editares esta páxina vai caducar nun minuto.\nPara de evitar conflitos, emprega o botón de previsualización para reiniciares o contador do tempo de bloqueo.';
 $lang['js']['notsavedyet']     = 'Perderanse os trocos non gardados.
 Está certo de quereres continuar?';
@@ -175,9 +175,9 @@ $lang['diff_type']             = 'Ver diferenzas:';
 $lang['diff_inline']           = 'Por liña';
 $lang['diff_side']             = 'Cara a Cara';
 $lang['line']                  = 'Liña';
-$lang['breadcrumb']            = 'Trazado';
-$lang['youarehere']            = 'Estás aquí';
-$lang['lastmod']               = 'Última modificación';
+$lang['breadcrumb']            = 'Trazado:';
+$lang['youarehere']            = 'Estás aquí:';
+$lang['lastmod']               = 'Última modificación:';
 $lang['by']                    = 'por';
 $lang['deleted']               = 'eliminado';
 $lang['created']               = 'creado';
@@ -231,18 +231,18 @@ $lang['metaedit']              = 'Editar Metadatos';
 $lang['metasaveerr']           = 'Non se puideron escribir os metadatos';
 $lang['metasaveok']            = 'Metadatos gardados';
 $lang['btn_img_backto']            = 'Volver a %s';
-$lang['img_title']             = 'Título';
-$lang['img_caption']           = 'Lenda';
-$lang['img_date']              = 'Data';
-$lang['img_fname']             = 'Nome de arquivo';
-$lang['img_fsize']             = 'Tamaño';
-$lang['img_artist']            = 'Fotógrafo';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Formato';
-$lang['img_camera']            = 'Cámara';
-$lang['img_keywords']          = 'Verbas chave';
-$lang['img_width']             = 'Ancho';
-$lang['img_height']            = 'Alto';
+$lang['img_title']             = 'Título:';
+$lang['img_caption']           = 'Lenda:';
+$lang['img_date']              = 'Data:';
+$lang['img_fname']             = 'Nome de arquivo:';
+$lang['img_fsize']             = 'Tamaño:';
+$lang['img_artist']            = 'Fotógrafo:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Formato:';
+$lang['img_camera']            = 'Cámara:';
+$lang['img_keywords']          = 'Verbas chave:';
+$lang['img_width']             = 'Ancho:';
+$lang['img_height']            = 'Alto:';
 $lang['btn_mediaManager']           = 'Ver no xestor de arquivos-media';
 $lang['subscr_subscribe_success'] = 'Engadido %s á lista de subscrición para %s';
 $lang['subscr_subscribe_error'] = 'Erro ao tentar engadir %s á lista de subscrición para %s';
diff --git a/inc/lang/he/jquery.ui.datepicker.js b/inc/lang/he/jquery.ui.datepicker.js
index b9e8deec5fd7087d3258b0669f487482193e60e4..9b166135298c8044aa6875de20871f4240ae99ad 100644
--- a/inc/lang/he/jquery.ui.datepicker.js
+++ b/inc/lang/he/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Hebrew initialisation for the UI Datepicker extension. */
 /* Written by Amir Hardon (ahardon at gmail dot com). */
-jQuery(function($){
-	$.datepicker.regional['he'] = {
-		closeText: 'סגור',
-		prevText: '&#x3C;הקודם',
-		nextText: 'הבא&#x3E;',
-		currentText: 'היום',
-		monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני',
-		'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'],
-		monthNamesShort: ['ינו','פבר','מרץ','אפר','מאי','יוני',
-		'יולי','אוג','ספט','אוק','נוב','דצמ'],
-		dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'],
-		dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
-		dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
-		weekHeader: 'Wk',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 0,
-		isRTL: true,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['he']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['he'] = {
+	closeText: 'סגור',
+	prevText: '&#x3C;הקודם',
+	nextText: 'הבא&#x3E;',
+	currentText: 'היום',
+	monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני',
+	'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'],
+	monthNamesShort: ['ינו','פבר','מרץ','אפר','מאי','יוני',
+	'יולי','אוג','ספט','אוק','נוב','דצמ'],
+	dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'],
+	dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
+	dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
+	weekHeader: 'Wk',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 0,
+	isRTL: true,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['he']);
+
+return datepicker.regional['he'];
+
+}));
diff --git a/inc/lang/he/lang.php b/inc/lang/he/lang.php
index 5339d18024186df95e2e440f3f4eb1c5dd96afa3..101102b482560a895db79b369105ca56d45234e1 100644
--- a/inc/lang/he/lang.php
+++ b/inc/lang/he/lang.php
@@ -57,7 +57,7 @@ $lang['btn_register']          = 'הרשמה';
 $lang['btn_apply']             = 'ליישם';
 $lang['btn_media']             = 'מנהל המדיה';
 $lang['btn_deleteuser']        = 'להסיר את החשבון שלי';
-$lang['loggedinas']            = 'נכנסת בשם';
+$lang['loggedinas']            = 'נכנסת בשם:';
 $lang['user']                  = 'שם משתמש';
 $lang['pass']                  = 'ססמה';
 $lang['newpass']               = 'ססמה חדשה';
@@ -102,12 +102,12 @@ $lang['license']               = 'למעט מקרים בהם צוין אחרת,
 $lang['licenseok']             = 'נא לשים לב: עריכת דף זה מהווה הסכמה מצדך להצגת התוכן שהוספת בהתאם הרישיון הבא:';
 $lang['searchmedia']           = 'חיפוש שם קובץ:';
 $lang['searchmedia_in']        = 'חיפוש תחת %s';
-$lang['txt_upload']            = 'בחירת קובץ להעלות';
-$lang['txt_filename']          = 'העלאה בשם (נתון לבחירה)';
+$lang['txt_upload']            = 'בחירת קובץ להעלות:';
+$lang['txt_filename']          = 'העלאה בשם (נתון לבחירה):';
 $lang['txt_overwrt']           = 'שכתוב על קובץ קיים';
 $lang['maxuploadsize']         = 'העלה מקסימום. s% לכל קובץ.';
-$lang['lockedby']              = 'נעול על ידי';
-$lang['lockexpire']            = 'הנעילה פגה';
+$lang['lockedby']              = 'נעול על ידי:';
+$lang['lockexpire']            = 'הנעילה פגה:';
 $lang['js']['willexpire']      = 'הנעילה תחלוף עוד זמן קצר. \nלמניעת התנגשויות יש להשתמש בכפתור הרענון מטה כדי לאפס את מד משך הנעילה.';
 $lang['js']['notsavedyet']     = 'שינויים שלא נשמרו ילכו לאיבוד.';
 $lang['js']['searchmedia']     = 'חיפוש אחר קבצים';
@@ -188,9 +188,9 @@ $lang['diff_type']             = 'הצגת הבדלים:';
 $lang['diff_inline']           = 'באותה השורה';
 $lang['diff_side']             = 'זה לצד זה';
 $lang['line']                  = 'שורה';
-$lang['breadcrumb']            = 'ביקורים אחרונים';
-$lang['youarehere']            = 'זהו מיקומך';
-$lang['lastmod']               = 'מועד השינוי האחרון';
+$lang['breadcrumb']            = 'ביקורים אחרונים:';
+$lang['youarehere']            = 'זהו מיקומך:';
+$lang['lastmod']               = 'מועד השינוי האחרון:';
 $lang['by']                    = 'על ידי';
 $lang['deleted']               = 'נמחק';
 $lang['created']               = 'נוצר';
@@ -244,18 +244,18 @@ $lang['metaedit']              = 'עריכת נתוני העל';
 $lang['metasaveerr']           = 'אירע כשל בשמירת נתוני העל';
 $lang['metasaveok']            = 'נתוני העל נשמרו';
 $lang['btn_img_backto']            = 'חזרה אל %s';
-$lang['img_title']             = 'שם';
-$lang['img_caption']           = 'כותרת';
-$lang['img_date']              = 'תאריך';
-$lang['img_fname']             = 'שם הקובץ';
-$lang['img_fsize']             = 'גודל';
-$lang['img_artist']            = 'צלם';
-$lang['img_copyr']             = 'זכויות יוצרים';
-$lang['img_format']            = 'מבנה';
-$lang['img_camera']            = 'מצלמה';
-$lang['img_keywords']          = 'מילות מפתח';
-$lang['img_width']             = 'רוחב';
-$lang['img_height']            = 'גובה';
+$lang['img_title']             = 'שם:';
+$lang['img_caption']           = 'כותרת:';
+$lang['img_date']              = 'תאריך:';
+$lang['img_fname']             = 'שם הקובץ:';
+$lang['img_fsize']             = 'גודל:';
+$lang['img_artist']            = 'צלם:';
+$lang['img_copyr']             = 'זכויות יוצרים:';
+$lang['img_format']            = 'מבנה:';
+$lang['img_camera']            = 'מצלמה:';
+$lang['img_keywords']          = 'מילות מפתח:';
+$lang['img_width']             = 'רוחב:';
+$lang['img_height']            = 'גובה:';
 $lang['btn_mediaManager']           = 'צפה במנהל מדיה';
 $lang['subscr_subscribe_success'] = '%s נוסף לרשימת המינויים לדף %s';
 $lang['subscr_subscribe_error'] = 'אירעה שגיאה בהוספת %s לרשימת המינויים לדף %s';
@@ -285,7 +285,7 @@ $lang['i_modified']            = 'משיקולי אבטחה סקריפט זה י
                          עליך לחלץ שנית את הקבצים מהחבילה שהורדה או להיעזר בדף
                          <a href="http://dokuwiki.org/install">Dokuwiki installation instructions</a>';
 $lang['i_funcna']              = 'פונקציית ה-PHP&rlm; <code>%s</code> אינה זמינה. יתכן כי מארח האתר חסם אותה מסיבה כלשהי?';
-$lang['i_phpver']              = 'גרסת PHP שלך <code>%s</code> נמוכה מ <code>%s</ code> הצורך. אתה צריך לשדרג PHP שלך להתקין.';
+$lang['i_phpver']              = 'גרסת PHP שלך <code>%s</code> נמוכה מ <code>%s</code> הצורך. אתה צריך לשדרג PHP שלך להתקין.';
 $lang['i_permfail']            = '<code>%s</code> אינה ניתנת לכתיבה על ידי DokuWiki. עליך לשנות הרשאות תיקייה זו!';
 $lang['i_confexists']          = '<code>%s</code> כבר קיים';
 $lang['i_writeerr']            = 'אין אפשרות ליצור את <code>%s</code>. נא לבדוק את הרשאות הקובץ/תיקייה וליצור את הקובץ ידנית.';
diff --git a/inc/lang/hi/jquery.ui.datepicker.js b/inc/lang/hi/jquery.ui.datepicker.js
index 6c563b997516908cbd9e700aa7021b3407fc7ced..f20a900cab89344dcc8ebef99bc8be7283874d46 100644
--- a/inc/lang/hi/jquery.ui.datepicker.js
+++ b/inc/lang/hi/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Hindi initialisation for the jQuery UI date picker plugin. */
 /* Written by Michael Dawart. */
-jQuery(function($){
-	$.datepicker.regional['hi'] = {
-		closeText: 'बंद',
-		prevText: 'पिछला',
-		nextText: 'अगला',
-		currentText: 'आज',
-		monthNames: ['जनवरी ','फरवरी','मार्च','अप्रेल','मई','जून',
-		'जूलाई','अगस्त ','सितम्बर','अक्टूबर','नवम्बर','दिसम्बर'],
-		monthNamesShort: ['जन', 'फर', 'मार्च', 'अप्रेल', 'मई', 'जून',
-		'जूलाई', 'अग', 'सित', 'अक्ट', 'नव', 'दि'],
-		dayNames: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'],
-		dayNamesShort: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
-		dayNamesMin: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
-		weekHeader: 'हफ्ता',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['hi']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['hi'] = {
+	closeText: 'बंद',
+	prevText: 'पिछला',
+	nextText: 'अगला',
+	currentText: 'आज',
+	monthNames: ['जनवरी ','फरवरी','मार्च','अप्रेल','मई','जून',
+	'जूलाई','अगस्त ','सितम्बर','अक्टूबर','नवम्बर','दिसम्बर'],
+	monthNamesShort: ['जन', 'फर', 'मार्च', 'अप्रेल', 'मई', 'जून',
+	'जूलाई', 'अग', 'सित', 'अक्ट', 'नव', 'दि'],
+	dayNames: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'],
+	dayNamesShort: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
+	dayNamesMin: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
+	weekHeader: 'हफ्ता',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['hi']);
+
+return datepicker.regional['hi'];
+
+}));
diff --git a/inc/lang/hi/lang.php b/inc/lang/hi/lang.php
index 95c443ae9e302080af54086e704b6abc863bb1ae..71795191c8b28cdc03148fa27e219832c1fc1fa2 100644
--- a/inc/lang/hi/lang.php
+++ b/inc/lang/hi/lang.php
@@ -63,11 +63,11 @@ $lang['profna']                = 'यह विकी प्रोफ़ाइ
 $lang['profnochange']          = 'कोई परिवर्तन नहीं, कुछ नहीं करना |';
 $lang['resendpwdmissing']      = 'छमा करें, आपको सारे रिक्त स्थान भरने पड़ेंगे |';
 $lang['resendpwdsuccess']      = 'आपका नवगुप्तशब्द ईमेल द्वारा सम्प्रेषित कर दिया गया है |';
-$lang['txt_upload']            = 'अपलोड करने के लिए फ़ाइल चुनें';
-$lang['txt_filename']          = 'के रूप में अपलोड करें (वैकल्पिक)';
+$lang['txt_upload']            = 'अपलोड करने के लिए फ़ाइल चुनें:';
+$lang['txt_filename']          = 'के रूप में अपलोड करें (वैकल्पिक):';
 $lang['txt_overwrt']           = 'अधिलेखित उपस्थित फ़ाइल';
-$lang['lockedby']              = 'इस समय तक बंद';
-$lang['lockexpire']            = 'बंद समाप्त होगा';
+$lang['lockedby']              = 'इस समय तक बंद:';
+$lang['lockexpire']            = 'बंद समाप्त होगा:';
 $lang['js']['hidedetails']     = 'विवरण छिपाएँ';
 $lang['nothingfound']          = 'कुच्छ नहीं मिला |';
 $lang['uploadexist']           = 'फ़ाइल पहले से उपस्थित है. कुछ भी नहीं किया |';
@@ -81,8 +81,8 @@ $lang['yours']                 = 'आपका संस्करणः';
 $lang['diff']                  = 'वर्तमान संशोधन में मतभेद दिखाइये |';
 $lang['diff2']                 = 'चयनित संशोधन के बीच में मतभेद दिखाइये |';
 $lang['line']                  = 'रेखा';
-$lang['youarehere']            = 'आप यहाँ हैं |';
-$lang['lastmod']               = 'अंतिम बार संशोधित';
+$lang['youarehere']            = 'आप यहाँ हैं |:';
+$lang['lastmod']               = 'अंतिम बार संशोधित:';
 $lang['by']                    = 'के द्वारा';
 $lang['deleted']               = 'हटाया';
 $lang['created']               = 'निर्मित';
@@ -104,13 +104,13 @@ $lang['qb_hr']                 = 'खड़ी रेखा';
 $lang['qb_sig']                = 'हस्ताक्षर डालें';
 $lang['admin_register']        = 'नया उपयोगकर्ता जोड़ें';
 $lang['btn_img_backto']            = 'वापस जाना %s';
-$lang['img_title']             = 'शीर्षक';
-$lang['img_caption']           = 'सहशीर्षक';
-$lang['img_date']              = 'तिथि';
-$lang['img_fsize']             = 'आकार';
-$lang['img_artist']            = 'फोटोग्राफर';
-$lang['img_format']            = 'प्रारूप';
-$lang['img_camera']            = 'कैमरा';
+$lang['img_title']             = 'शीर्षक:';
+$lang['img_caption']           = 'सहशीर्षक:';
+$lang['img_date']              = 'तिथि:';
+$lang['img_fsize']             = 'आकार:';
+$lang['img_artist']            = 'फोटोग्राफर:';
+$lang['img_format']            = 'प्रारूप:';
+$lang['img_camera']            = 'कैमरा:';
 $lang['i_chooselang']          = 'अपनी भाषा चुनें';
 $lang['i_installer']           = 'डोकुविकी इंस्टॉलर';
 $lang['i_wikiname']            = 'विकी का नाम';
diff --git a/inc/lang/hr/adminplugins.txt b/inc/lang/hr/adminplugins.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5a7656d27594dea359cc87b4bb8b764cf49021b2
--- /dev/null
+++ b/inc/lang/hr/adminplugins.txt
@@ -0,0 +1 @@
+===== Dodatni dodatci =====
\ No newline at end of file
diff --git a/inc/lang/hr/backlinks.txt b/inc/lang/hr/backlinks.txt
index e7115a6b6e48f836d5d5a8ed3d0d841cfc320034..a78b9213ee150ecff80b414e28a69913a56cd989 100644
--- a/inc/lang/hr/backlinks.txt
+++ b/inc/lang/hr/backlinks.txt
@@ -1,3 +1,3 @@
-====== Linkovi na stranicu ======
+====== Veze na stranicu ======
 
-Slijedi spisak svih dokumenata koji imaju link na trenutni.
+Slijedi spisak svih stanica koje imaju vezu na trenutnu stranicu.
diff --git a/inc/lang/hr/draft.txt b/inc/lang/hr/draft.txt
new file mode 100644
index 0000000000000000000000000000000000000000..2e6e084295423f3c12d65d5beac5f9d77be1d912
--- /dev/null
+++ b/inc/lang/hr/draft.txt
@@ -0,0 +1,4 @@
+====== Nađena neuspjelo uređivanje stranice ======
+
+Vaše zadnje uređivanje ove stranice nije završilo uredno. DokuWiki je automatski snimio kopiju tijekom rada koju sada možete iskoristiti da nastavite uređivanje. Niže možete vidjeti sadržaj koji je snimljen pri vašem zadnjem uređivanju.
+Molimo odlučite da li želite //vratiti// ili //obrisati// snimljeni sadržaj pri vašem zadnjem neuspjelom uređivanju, ili pak želite //odustati// od uređivanja.
diff --git a/inc/lang/hr/edit.txt b/inc/lang/hr/edit.txt
index 8cd57d524ace73461eb2309f7cc07a7c990216e1..bce1abeea4d5c6fb6ef8947cd139f4d2f2b31649 100644
--- a/inc/lang/hr/edit.txt
+++ b/inc/lang/hr/edit.txt
@@ -1 +1 @@
-Nakon Å¡to ste napravili sve potrebne promjene - odaberite ''Snimi'' za snimanje dokumenta.
+Uredite stranicu i pritisnite "Snimi". Pogledajte [[wiki:syntax]] za Wiki sintaksu. Molimo izmijenite samo ako možete unaprijediti sadržaj. Ako trebate testirati ili naučiti kako se nešto radi, molimo koristite za to namijenjene stranice kao što je [[playground:playground|igraonica]].
diff --git a/inc/lang/hr/index.txt b/inc/lang/hr/index.txt
index 9c30a805ca0d648707c123b3e762892d508097ba..4395994c40a4cd5e6df1638313353e422675a0ea 100644
--- a/inc/lang/hr/index.txt
+++ b/inc/lang/hr/index.txt
@@ -1 +1,3 @@
-====== Indeks ======
+====== Mapa stranica ======
+
+Ovo je mapa svih dostupnih stranica poredanih po [[doku>namespaces|imenskom prostoru]].
diff --git a/inc/lang/hr/jquery.ui.datepicker.js b/inc/lang/hr/jquery.ui.datepicker.js
index 2fe37b64b7081bfba2c575b3452e29a4b5d92d4e..e8b0414b5619a29514946d293593bf6ae6306ab8 100644
--- a/inc/lang/hr/jquery.ui.datepicker.js
+++ b/inc/lang/hr/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Croatian i18n for the jQuery UI date picker plugin. */
 /* Written by Vjekoslav Nesek. */
-jQuery(function($){
-	$.datepicker.regional['hr'] = {
-		closeText: 'Zatvori',
-		prevText: '&#x3C;',
-		nextText: '&#x3E;',
-		currentText: 'Danas',
-		monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj',
-		'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
-		monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip',
-		'Srp','Kol','Ruj','Lis','Stu','Pro'],
-		dayNames: ['Nedjelja','Ponedjeljak','Utorak','Srijeda','ÄŒetvrtak','Petak','Subota'],
-		dayNamesShort: ['Ned','Pon','Uto','Sri','ÄŒet','Pet','Sub'],
-		dayNamesMin: ['Ne','Po','Ut','Sr','ÄŒe','Pe','Su'],
-		weekHeader: 'Tje',
-		dateFormat: 'dd.mm.yy.',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['hr']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['hr'] = {
+	closeText: 'Zatvori',
+	prevText: '&#x3C;',
+	nextText: '&#x3E;',
+	currentText: 'Danas',
+	monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj',
+	'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
+	monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip',
+	'Srp','Kol','Ruj','Lis','Stu','Pro'],
+	dayNames: ['Nedjelja','Ponedjeljak','Utorak','Srijeda','ÄŒetvrtak','Petak','Subota'],
+	dayNamesShort: ['Ned','Pon','Uto','Sri','ÄŒet','Pet','Sub'],
+	dayNamesMin: ['Ne','Po','Ut','Sr','ÄŒe','Pe','Su'],
+	weekHeader: 'Tje',
+	dateFormat: 'dd.mm.yy.',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['hr']);
+
+return datepicker.regional['hr'];
+
+}));
diff --git a/inc/lang/hr/lang.php b/inc/lang/hr/lang.php
index 544541ab282aacd08b70a0f79657ff717779d8d8..69157015be160dfdf6a85eaab50e3d765736f5f8 100644
--- a/inc/lang/hr/lang.php
+++ b/inc/lang/hr/lang.php
@@ -1,12 +1,13 @@
 <?php
+
 /**
- * croatian language file
- *
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Tomo Krajina <aaa@puzz.info>
  * @author Branko Rihtman <theney@gmail.com>
  * @author Dražen Odobašić <dodobasic@gmail.com>
  * @author Dejan Igrec dejan.igrec@gmail.com
+ * @author Davor Turkalj <turki.bsc@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -15,51 +16,58 @@ $lang['doublequoteclosing']    = '”';
 $lang['singlequoteopening']    = '‘';
 $lang['singlequoteclosing']    = '’';
 $lang['apostrophe']            = '\'';
-$lang['btn_edit']              = 'Izmijeni dokument';
-$lang['btn_source']            = 'Prikaži kod dokumenta';
+$lang['btn_edit']              = 'Izmijeni stranicu';
+$lang['btn_source']            = 'Prikaži kod stranice';
 $lang['btn_show']              = 'Prikaži dokument';
-$lang['btn_create']            = 'Novi dokument';
+$lang['btn_create']            = 'Stvori ovu stranicu';
 $lang['btn_search']            = 'Pretraži';
 $lang['btn_save']              = 'Spremi';
 $lang['btn_preview']           = 'Prikaži';
 $lang['btn_top']               = 'Na vrh';
 $lang['btn_newer']             = '<< noviji';
 $lang['btn_older']             = 'stariji >>';
-$lang['btn_revs']              = 'Stare inačice';
+$lang['btn_revs']              = 'Stare promjene';
 $lang['btn_recent']            = 'Nedavne izmjene';
-$lang['btn_upload']            = 'Postavi';
+$lang['btn_upload']            = 'Učitaj';
 $lang['btn_cancel']            = 'Odustani';
-$lang['btn_index']             = 'Indeks';
-$lang['btn_secedit']           = 'Izmjeni';
+$lang['btn_index']             = 'Mapa lokacije';
+$lang['btn_secedit']           = 'Uredi';
 $lang['btn_login']             = 'Prijavi se';
 $lang['btn_logout']            = 'Odjavi se';
 $lang['btn_admin']             = 'Administriranje';
-$lang['btn_update']            = 'Ažuriraj';
+$lang['btn_update']            = 'Dopuni';
 $lang['btn_delete']            = 'Obriši';
-$lang['btn_back']              = 'Povratak';
+$lang['btn_back']              = 'Nazad';
 $lang['btn_backlink']          = 'Povratni linkovi';
-$lang['btn_backtomedia']       = 'Povratak na Mediafile izbornik';
-$lang['btn_subscribe']         = 'Pretplati se na promjene dokumenta';
-$lang['btn_profile']           = 'Ažuriraj profil';
-$lang['btn_reset']             = 'Poništi promjene';
+$lang['btn_backtomedia']       = 'Natrag na odabir datoteka';
+$lang['btn_subscribe']         = 'Uređivanje pretplata';
+$lang['btn_profile']           = 'Dopuni profil';
+$lang['btn_reset']             = 'Poništi';
+$lang['btn_resendpwd']         = 'Postavi novu lozinku';
 $lang['btn_draft']             = 'Uredi nacrt dokumenta';
-$lang['btn_recover']           = 'Vrati prijašnji nacrt dokumenta';
-$lang['btn_draftdel']          = 'Obriši nacrt dokumenta';
+$lang['btn_recover']           = 'Vrati nacrt stranice';
+$lang['btn_draftdel']          = 'Obriši nacrt stranice';
 $lang['btn_revert']            = 'Vrati';
 $lang['btn_register']          = 'Registracija';
-$lang['loggedinas']            = 'Prijavljen kao';
+$lang['btn_apply']             = 'Primjeni';
+$lang['btn_media']             = 'Upravitelj datoteka';
+$lang['btn_deleteuser']        = 'Ukloni mog korisnika';
+$lang['btn_img_backto']        = 'Povratak na %s';
+$lang['btn_mediaManager']      = 'Pogledaj u upravitelju datoteka';
+$lang['loggedinas']            = 'Prijavljen kao:';
 $lang['user']                  = 'Korisničko ime';
 $lang['pass']                  = 'Lozinka';
 $lang['newpass']               = 'Nova lozinka';
 $lang['oldpass']               = 'Potvrdi trenutnu lozinku';
-$lang['passchk']               = 'Ponoviti';
+$lang['passchk']               = 'još jednom';
 $lang['remember']              = 'Zapamti me';
 $lang['fullname']              = 'Ime i prezime';
 $lang['email']                 = 'Email';
 $lang['profile']               = 'Korisnički profil';
 $lang['badlogin']              = 'Ne ispravno korisničko ime ili lozinka.';
+$lang['badpassconfirm']        = 'Nažalost, lozinka nije ispravna';
 $lang['minoredit']             = 'Manje izmjene';
-$lang['draftdate']             = 'Nacrt dokumenta je automatski spremljen u ';
+$lang['draftdate']             = 'Nacrt promjena automatski spremljen u';
 $lang['nosecedit']             = 'Stranica se u međuvremenu promijenila. Informacija o odjeljku je ostarila pa je učitana kompletna stranica.';
 $lang['regmissing']            = 'Morate popuniti sva polja.';
 $lang['reguexists']            = 'Korisnik s tim korisničkim imenom već postoji.';
@@ -72,25 +80,32 @@ $lang['regpwmail']             = 'Vaša DokuWiki lozinka';
 $lang['reghere']               = 'Još uvijek nemate korisnički račun? Registrirajte se.';
 $lang['profna']                = 'Ovaj wiki ne dopušta izmjene korisničkog profila.';
 $lang['profnochange']          = 'Nema izmjena.';
-$lang['profnoempty']           = 'Prazno korisničko ime ili email nisu dopušteni.';
+$lang['profnoempty']           = 'Prazno korisničko ime ili e-pošta nisu dopušteni.';
 $lang['profchanged']           = 'Korisnički profil je uspješno izmijenjen.';
+$lang['profnodelete']          = 'Ovaj wiki ne podržava brisanje korisnika';
+$lang['profdeleteuser']        = 'Obriši korisnika';
+$lang['profdeleted']           = 'Vaš korisnik je obrisan s ovog wiki-a';
+$lang['profconfdelete']        = 'Želim ukloniti mojeg korisnika s ovog wiki-a. <br/> Ova akcija se ne može poništiti.';
+$lang['profconfdeletemissing'] = 'Kvačica za potvrdu nije označena';
 $lang['pwdforget']             = 'Izgubili ste lozinku? Zatražite novu';
-$lang['resendna']              = 'Ovaj wiki ne podržava ponovno slanje lozinke emailom.';
+$lang['resendna']              = 'Ovaj wiki ne podržava ponovno slanje lozinke e-poštom.';
+$lang['resendpwd']             = 'Postavi novu lozinku za';
 $lang['resendpwdmissing']      = 'Ispunite sva polja.';
 $lang['resendpwdnouser']       = 'Nije moguće pronaći korisnika.';
 $lang['resendpwdbadauth']      = 'Neispravan autorizacijski kod. Provjerite da li ste koristili potpun potvrdni link.';
-$lang['resendpwdconfirm']      = 'Potvrdni link je poslan emailom.';
-$lang['resendpwdsuccess']      = 'Nova lozinka je poslana emailom.';
+$lang['resendpwdconfirm']      = 'Potvrdni link je poslan e-poštom.';
+$lang['resendpwdsuccess']      = 'Nova lozinka je poslana e-poštom.';
 $lang['license']               = 'Osim na mjestima gdje je naznačeno drugačije, sadržaj ovog wikija je licenciran sljedećom licencom:';
 $lang['licenseok']             = 'Pažnja: promjenom ovog dokumenta pristajete licencirati sadržaj sljedećom licencom: ';
 $lang['searchmedia']           = 'Traži naziv datoteke:';
 $lang['searchmedia_in']        = 'Traži u %s';
-$lang['txt_upload']            = 'Odaberite datoteku za postavljanje';
-$lang['txt_filename']          = 'Postaviti kao (nije obavezno)';
+$lang['txt_upload']            = 'Odaberite datoteku za postavljanje:';
+$lang['txt_filename']          = 'Postaviti kao (nije obavezno):';
 $lang['txt_overwrt']           = 'Prepiši postojeću datoteku';
-$lang['lockedby']              = 'Zaključao';
-$lang['lockexpire']            = 'Zaključano do';
-$lang['js']['willexpire']            = 'Dokument kojeg mijenjate će biti zaključan još 1 minutu.\n Ukoliko želite i dalje raditi izmjene na dokumentu - kliknite na "Pregled".';
+$lang['maxuploadsize']         = 'Moguće je učitati maks. %s po datoteci.';
+$lang['lockedby']              = 'Trenutno zaključao:';
+$lang['lockexpire']            = 'Zaključano do:';
+$lang['js']['willexpire']      = 'Dokument kojeg mijenjate će biti zaključan još 1 minutu.\n Ukoliko želite i dalje raditi izmjene na dokumentu - kliknite na "Pregled".';
 $lang['js']['notsavedyet']     = 'Vaše izmjene će se izgubiti.
 Želite li nastaviti?';
 $lang['js']['searchmedia']     = 'Traži datoteke';
@@ -121,18 +136,29 @@ $lang['js']['nosmblinks']      = 'Linkovi na dijeljene Windows mape rade samo s
 $lang['js']['linkwiz']         = 'ÄŒarobnjak za poveznice';
 $lang['js']['linkto']          = 'Poveznica na:';
 $lang['js']['del_confirm']     = 'Zbilja želite obrisati odabrane stavke?';
+$lang['js']['restore_confirm'] = 'Zaista želite vratiti ovu verziju?';
+$lang['js']['media_diff']      = 'Pogledaj razlike:';
+$lang['js']['media_diff_both'] = 'Usporedni prikaz';
+$lang['js']['media_diff_opacity'] = 'Sjaj kroz';
+$lang['js']['media_diff_portions'] = 'Pomakni';
+$lang['js']['media_select']    = 'Odaberi datoteke ...';
+$lang['js']['media_upload_btn'] = 'Učitavanje';
+$lang['js']['media_done_btn']  = 'Gotovo';
+$lang['js']['media_drop']      = 'Ovdje spusti datoteke za učitavanje';
+$lang['js']['media_cancel']    = 'ukloni';
+$lang['js']['media_overwrt']   = 'Prepiši preko postojeće datoteke';
 $lang['rssfailed']             = 'Došlo je do greške prilikom preuzimanja feed-a: ';
 $lang['nothingfound']          = 'Traženi dokumetni nisu pronađeni.';
-$lang['mediaselect']           = 'Mediafile datoteke';
-$lang['fileupload']            = 'Mediafile postavljanje';
-$lang['uploadsucc']            = 'Postavljanje uspješno';
-$lang['uploadfail']            = 'Neuspješno postavljanje. Možda dozvole na poslužitelju nisu ispravne?';
-$lang['uploadwrong']           = 'Postavljanje nije dopušteno. Nastavak datoteke je zabranjen!';
+$lang['mediaselect']           = 'Datoteke';
+$lang['fileupload']            = 'Učitavanje datoteka';
+$lang['uploadsucc']            = 'Učitavanje uspješno';
+$lang['uploadfail']            = 'Neuspješno učitavanje. Možda dozvole na poslužitelju nisu ispravne?';
+$lang['uploadwrong']           = 'Učitavanje nije dopušteno. Nastavak datoteke je zabranjen!';
 $lang['uploadexist']           = 'Datoteka već postoji.';
 $lang['uploadbadcontent']      = 'Postavljeni sadržaj ne odgovara ekstenziji %s datoteke.';
-$lang['uploadspam']            = 'Postavljanje je blokirano spam crnom listom.';
-$lang['uploadxss']             = 'Postavljanje je blokirano zbog mogućeg zlonamjernog sadržaja.';
-$lang['uploadsize']            = 'Postavljena datoteka je prevelika (max. %s)';
+$lang['uploadspam']            = 'Učitavanje je spriječeno od spam crne liste.';
+$lang['uploadxss']             = 'Učitavanje je spriječeno zbog mogućeg zlonamjernog sadržaja.';
+$lang['uploadsize']            = 'Učitana datoteka je prevelika (max. %s)';
 $lang['deletesucc']            = 'Datoteka "%s" je obrisana.';
 $lang['deletefail']            = '"%s" se ne može obrisati - provjerite dozvole na poslužitelju.';
 $lang['mediainuse']            = 'Datoteka "%s" nije obrisana - još uvijek se koristi.';
@@ -140,10 +166,10 @@ $lang['namespaces']            = 'Imenski prostori';
 $lang['mediafiles']            = 'Datoteke u';
 $lang['accessdenied']          = 'Nemate potrebne dozvole za pregled ove stranice.';
 $lang['mediausage']            = 'Koristi sljedeću sintaksu za referenciranje ove datoteke:';
-$lang['mediaview']             = 'Pregledaj originalnu datoteku';
+$lang['mediaview']             = 'Vidi izvornu datoteku';
 $lang['mediaroot']             = 'root';
 $lang['mediaupload']           = 'Postavi datoteku u odabrani imenski prostor. Podimenski prostori se stvaraju dodavanjem istih kao prefiks naziva datoteke u "Postavi kao" polju, tako da se odvoje dvotočkama.';
-$lang['mediaextchange']        = 'Ekstenzija datoteke promijenjena iz .%s u .%s!';
+$lang['mediaextchange']        = 'Nastavak datoteke promijenjen iz .%s u .%s!';
 $lang['reference']             = 'Reference za';
 $lang['ref_inuse']             = 'Datoteka se ne može obrisati jer se još uvijek koristi u sljedećim dokumentima:';
 $lang['ref_hidden']            = 'Neke reference se nalaze na dokumentima koje nemate dozvolu čitati';
@@ -152,51 +178,66 @@ $lang['quickhits']             = 'Pronađeno po nazivima dokumenata';
 $lang['toc']                   = 'Sadržaj';
 $lang['current']               = 'trenutno';
 $lang['yours']                 = 'Vaša inačica';
-$lang['diff']                  = 'Prikaži razlike u odnosu na trenutnu inačicu';
-$lang['diff2']                 = 'Pokaži razlike između odabranih inačica';
-$lang['difflink']              = 'Poveznica na ovaj prikaz usporedbe';
-$lang['diff_type']             = 'Razlike u prikazu:';
+$lang['diff']                  = 'Prikaži razlike u odnosu na zadnje stanje';
+$lang['diff2']                 = 'Pokaži razlike između odabranih izmjena';
+$lang['difflink']              = 'Poveznica na ovu usporedbu';
+$lang['diff_type']             = 'Vidi razlike:';
 $lang['diff_inline']           = 'U istoj razini';
 $lang['diff_side']             = 'Usporedo';
+$lang['diffprevrev']           = 'Starija izmjena';
+$lang['diffnextrev']           = 'Novija izmjena';
+$lang['difflastrev']           = 'Zadnja izmjena';
+$lang['diffbothprevrev']       = 'Starije izmjene na obje strane';
+$lang['diffbothnextrev']       = 'Novije izmjene na obje strane';
 $lang['line']                  = 'Redak';
-$lang['breadcrumb']            = 'Putanja';
-$lang['youarehere']            = 'Vi ste ovdje';
-$lang['lastmod']               = 'Zadnja izmjena';
+$lang['breadcrumb']            = 'Putanja:';
+$lang['youarehere']            = 'Vi ste ovdje:';
+$lang['lastmod']               = 'Zadnja izmjena:';
 $lang['by']                    = 'od';
 $lang['deleted']               = 'obrisano';
 $lang['created']               = 'stvoreno';
-$lang['restored']              = 'vraćena prijašnja inačica (%s)';
+$lang['restored']              = 'vraćeno na prijašnju izmjenu (%s)';
 $lang['external_edit']         = 'vanjsko uređivanje';
 $lang['summary']               = 'Sažetak izmjena';
 $lang['noflash']               = 'Za prikazivanje ovog sadržaja potreban je <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a>';
 $lang['download']              = 'Preuzmi isječak';
+$lang['tools']                 = 'Alati';
+$lang['user_tools']            = 'Korisnički alati';
+$lang['site_tools']            = 'Site alati';
+$lang['page_tools']            = 'Stranični alati';
+$lang['skip_to_content']       = 'preskoči na sadržaj';
+$lang['sidebar']               = 'Bočna traka';
 $lang['mail_newpage']          = 'stranica dodana:';
 $lang['mail_changed']          = 'stranica izmjenjena:';
 $lang['mail_subscribe_list']   = 'stranice promijenjene u imenskom prostoru:';
 $lang['mail_new_user']         = 'novi korisnik:';
 $lang['mail_upload']           = 'datoteka postavljena:';
+$lang['changes_type']          = 'Vidi promjene od';
+$lang['pages_changes']         = 'Stranice';
+$lang['media_changes']         = 'Datoteke';
+$lang['both_changes']          = 'Zajedno stranice i datoteke';
 $lang['qb_bold']               = 'Podebljani tekst';
 $lang['qb_italic']             = 'Ukošeni tekst';
 $lang['qb_underl']             = 'Podcrtani tekst';
 $lang['qb_code']               = 'Kod';
 $lang['qb_strike']             = 'Precrtani tekst';
-$lang['qb_h1']                 = 'Naslov - razina 1';
-$lang['qb_h2']                 = 'Naslov - razina 2';
-$lang['qb_h3']                 = 'Naslov - razina 3';
-$lang['qb_h4']                 = 'Naslov - razina 4';
-$lang['qb_h5']                 = 'Naslov - razina 5';
+$lang['qb_h1']                 = 'Naslov 1. razine';
+$lang['qb_h2']                 = 'Naslov 2. razine';
+$lang['qb_h3']                 = 'Naslov 3. razine';
+$lang['qb_h4']                 = 'Naslov 4. razine';
+$lang['qb_h5']                 = 'Naslov 5. razine';
 $lang['qb_h']                  = 'Naslov';
 $lang['qb_hs']                 = 'Odaberite naslov';
 $lang['qb_hplus']              = 'Naslov više razine';
 $lang['qb_hminus']             = 'Naslov niže razine';
 $lang['qb_hequal']             = 'Naslov iste razine';
-$lang['qb_link']               = 'Interni link';
-$lang['qb_extlink']            = 'Vanjski link';
+$lang['qb_link']               = 'Interna poveznica';
+$lang['qb_extlink']            = 'Vanjska poveznica';
 $lang['qb_hr']                 = 'Vodoravna crta';
-$lang['qb_ol']                 = 'Pobrojana lista';
-$lang['qb_ul']                 = 'Lista';
-$lang['qb_media']              = 'Dodaj slike i ostale datoteke';
-$lang['qb_sig']                = 'Potpis';
+$lang['qb_ol']                 = 'Element brojane liste';
+$lang['qb_ul']                 = 'Element obične liste';
+$lang['qb_media']              = 'Dodaj slike i ostale datoteke (prikaz u novom prozoru)';
+$lang['qb_sig']                = 'Ubaci potpis';
 $lang['qb_smileys']            = 'Smiješkići';
 $lang['qb_chars']              = 'Posebni znakovi';
 $lang['upperns']               = 'Skoči u nadređeni imenski prostor';
@@ -204,17 +245,18 @@ $lang['admin_register']        = 'Dodaj novog korisnika';
 $lang['metaedit']              = 'Uredi metapodatake';
 $lang['metasaveerr']           = 'Neuspješno zapisivanje metapodataka';
 $lang['metasaveok']            = 'Spremljeni metapdaci';
-$lang['btn_img_backto']            = 'Povratak na %s';
-$lang['img_title']             = 'Naziv';
-$lang['img_caption']           = 'Naslov';
-$lang['img_date']              = 'Datum';
-$lang['img_fname']             = 'Ime datoteke';
-$lang['img_fsize']             = 'Veličina';
-$lang['img_artist']            = 'Fotograf';
-$lang['img_copyr']             = 'Autorsko pravo';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Ključne riječi';
+$lang['img_title']             = 'Naziv:';
+$lang['img_caption']           = 'Naslov:';
+$lang['img_date']              = 'Datum:';
+$lang['img_fname']             = 'Ime datoteke:';
+$lang['img_fsize']             = 'Veličina:';
+$lang['img_artist']            = 'Fotograf:';
+$lang['img_copyr']             = 'Autorsko pravo:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Ključne riječi:';
+$lang['img_width']             = 'Å irina:';
+$lang['img_height']            = 'Visina:';
 $lang['subscr_subscribe_success'] = 'Dodan %s u listu pretplatnika za %s';
 $lang['subscr_subscribe_error'] = 'Greška kod dodavanja %s u listu pretplatnika za %s';
 $lang['subscr_subscribe_noaddress'] = 'Ne postoji adresa povezana sa vašim podacima za prijavu, stoga ne možete biti dodani u listu pretplatnika';
@@ -227,20 +269,23 @@ $lang['subscr_m_new_header']   = 'Dodaj pretplatu';
 $lang['subscr_m_current_header'] = 'Trenutne pretplate';
 $lang['subscr_m_unsubscribe']  = 'Odjavi pretplatu';
 $lang['subscr_m_subscribe']    = 'Pretplati se';
-$lang['subscr_m_receive']      = 'Primaj';
-$lang['subscr_style_every']    = 'email za svaku promjenu';
-$lang['subscr_style_digest']   = 'email s kratakim prikazom promjena za svaku stranicu (svaka %.2f dana)';
-$lang['subscr_style_list']     = 'listu promijenjenih stranica od zadnjeg primljenog email-a (svaka %.2f dana)';
+$lang['subscr_m_receive']      = 'Primi';
+$lang['subscr_style_every']    = 'e-pošta za svaku promjenu';
+$lang['subscr_style_digest']   = 'e-pošta s kratakim prikazom promjena za svaku stranicu (svaka %.2f dana)';
+$lang['subscr_style_list']     = 'listu promijenjenih stranica od zadnje primljene e-pošte (svaka %.2f dana)';
 $lang['authtempfail']          = 'Autentifikacija korisnika je privremeno nedostupna. Molimo Vas da kontaktirate administratora.';
+$lang['authpwdexpire']         = 'Vaša lozinka će isteći za %d dana, trebate ju promijeniti.';
 $lang['i_chooselang']          = 'Izaberite vaš jezik';
 $lang['i_installer']           = 'DokuWiki instalacija';
 $lang['i_wikiname']            = 'Naziv Wikija';
 $lang['i_enableacl']           = 'Omogući ACL (preporučeno)';
 $lang['i_superuser']           = 'Superkorisnik';
 $lang['i_problems']            = 'Instalacija je pronašla probleme koji su naznačeni ispod. Nije moguće nastaviti dok se ti problemi ne riješe.';
-$lang['i_modified']            = 'Zbog sigurnosnih razlog, ova skripta ce raditi samo sa novim i nepromijenjenim instalacijama dokuWikija. Preporucujemo da ili re-ekstraktirate fajlove iz downloadovanog paketa ili konsultujete pune a href="http://dokuwiki.org/install">Instrukcije za instalaciju Dokuwikija</a>';
+$lang['i_modified']            = 'Zbog sigurnosnih razlog, ova skripta raditi će samo sa novim i neizmijenjenim DokuWiki instalacijama.
+      Molimo ponovno prekopirajte datoteke iz preuzetoga paketa ili pogledajte detaljno <a href="http://dokuwiki.org/install">Uputstvo za postavljanje DokuWiki-a</a>';
 $lang['i_funcna']              = 'PHP funkcija <code>%s</code> nije dostupna. Možda ju je vaš pružatelj hostinga onemogućio iz nekog razloga?';
 $lang['i_phpver']              = 'Vaša PHP verzija <code>%s</code> je niža od potrebne <code>%s</code>. Trebate nadograditi vašu PHP instalaciju.';
+$lang['i_mbfuncoverload']      = 'mbstring.func_overload mora biti onemogućena u php.ini da bi ste pokrenuli DokuWiki.';
 $lang['i_permfail']            = '<code>%s</code> nema dozvolu pisanja od strane DokuWiki. Trebate podesiti dozvole pristupa tom direktoriju.';
 $lang['i_confexists']          = '<code>%s</code> već postoji';
 $lang['i_writeerr']            = 'Ne može se kreirati <code>%s</code>. Trebate provjeriti dozvole direktorija/datoteke i kreirati dokument ručno.';
@@ -252,8 +297,12 @@ $lang['i_policy']              = 'Inicijalna ACL politika';
 $lang['i_pol0']                = 'Otvoreni Wiki (čitanje, pisanje, učitavanje za sve)';
 $lang['i_pol1']                = 'Javni Wiki (čitanje za sve, pisanje i učitavanje za registrirane korisnike)';
 $lang['i_pol2']                = 'Zatvoreni Wiki (čitanje, pisanje, učitavanje samo za registrirane korisnike)';
+$lang['i_allowreg']            = 'Dopusti da korisnici sami sebe registriraju';
 $lang['i_retry']               = 'Pokušaj ponovo';
 $lang['i_license']             = 'Molim odaberite licencu pod kojom želite postavljati vaš sadržaj:';
+$lang['i_license_none']        = 'Ne prikazuj nikakve licenčne informacije.';
+$lang['i_pop_field']           = 'Molimo, pomozite na da unaprijedimo DokuWiki:';
+$lang['i_pop_label']           = 'Jednom na mjesec, pošalji anonimne podatke o korištenju DokuWiki razvojnom timu';
 $lang['recent_global']         = 'Trenutno gledate promjene unutar <b>%s</b> imenskog prostora. Također možete <a href="%s">vidjeti zadnje promjene cijelog wiki-a</a>';
 $lang['years']                 = '%d godina prije';
 $lang['months']                = '%d mjeseci prije';
@@ -263,3 +312,30 @@ $lang['hours']                 = '%d sati prije';
 $lang['minutes']               = '%d minuta prije';
 $lang['seconds']               = '%d sekundi prije';
 $lang['wordblock']             = 'Vaša promjena nije spremljena jer sadrži blokirani tekst (spam).';
+$lang['media_uploadtab']       = 'Učitavanje';
+$lang['media_searchtab']       = 'Traženje';
+$lang['media_file']            = 'Datoteka';
+$lang['media_viewtab']         = 'Pogled';
+$lang['media_edittab']         = 'Uredi';
+$lang['media_historytab']      = 'Povijest';
+$lang['media_list_thumbs']     = 'Ikone';
+$lang['media_list_rows']       = 'Redovi';
+$lang['media_sort_name']       = 'Naziv';
+$lang['media_sort_date']       = 'Datum';
+$lang['media_namespaces']      = 'Odaberi imenski prostor';
+$lang['media_files']           = 'Datoteke u %s';
+$lang['media_upload']          = 'Učitaj u %s';
+$lang['media_search']          = 'Potraži u %s';
+$lang['media_view']            = '%s';
+$lang['media_viewold']         = '%s na %s';
+$lang['media_edit']            = 'Uredi %s';
+$lang['media_history']         = 'Povijest %s';
+$lang['media_meta_edited']     = 'meta podaci uređeni';
+$lang['media_perm_read']       = 'Nažalost, nemate prava za čitanje datoteka.';
+$lang['media_perm_upload']     = 'Nažalost, nemate prava za učitavanje datoteka.';
+$lang['media_update']          = 'Učitaj novu verziju';
+$lang['media_restore']         = 'Vrati ovu verziju';
+$lang['currentns']             = 'Tekući imenički prostor';
+$lang['searchresult']          = 'Rezultati pretraživanja';
+$lang['plainhtml']             = 'ÄŒisti HTML';
+$lang['wikimarkup']            = 'Wiki kod';
diff --git a/inc/lang/hr/pwconfirm.txt b/inc/lang/hr/pwconfirm.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b2d9fa3ad07c690c90bacba5bb239320d041993e
--- /dev/null
+++ b/inc/lang/hr/pwconfirm.txt
@@ -0,0 +1,13 @@
+Pozdrav @FULLNAME@!
+
+Netko je zatražio novu lozinku za vašu @TITLE@ prijavu na @DOKUWIKIURL@.
+
+Ako to niste bili Vi, molimo da samo ignorirate ovu poruku.
+
+Da bi ste potvrdili da ste to ipak bili Vi, molimo slijedite link u nastavku:
+
+@CONFIRM@
+
+-- 
+Ova poruka je generirana od strane DokuWiki dostupnog na
+@DOKUWIKIURL@
\ No newline at end of file
diff --git a/inc/lang/hr/registermail.txt b/inc/lang/hr/registermail.txt
new file mode 100644
index 0000000000000000000000000000000000000000..ceaf3fb83bfaa0753120e78fd84a4ebbbffa26a4
--- /dev/null
+++ b/inc/lang/hr/registermail.txt
@@ -0,0 +1,14 @@
+Novi korisnik je registriran. Ovdje su detalji:
+
+Korisničko ime : @NEWUSER@
+Puno ime       : @NEWNAME@
+e-pošta        : @NEWEMAIL@ 
+
+Datum      : @DATE@ 
+Preglednik : @BROWSER@
+IP-Adresa  : @IPADDRESS@ 
+Računalo   : @HOSTNAME@
+
+-- 
+Ova poruka je generirana od strane DokuWiki dostupnog na
+@DOKUWIKIURL@
\ No newline at end of file
diff --git a/inc/lang/hr/resetpwd.txt b/inc/lang/hr/resetpwd.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8d92e51d2be78132a2d26d93c468681869e1a8f8
--- /dev/null
+++ b/inc/lang/hr/resetpwd.txt
@@ -0,0 +1,3 @@
+====== Postavi novu lozinku ======
+
+Molimo unesite novu lozinku za Vašu korisničku prijavu na ovom wiki-u. 
\ No newline at end of file
diff --git a/inc/lang/hr/revisions.txt b/inc/lang/hr/revisions.txt
index d224a56f3bade9786e82aa25b7f6745a08a1fcaa..67d4cb89fe2e8ac60a129a87509d56d56db3d881 100644
--- a/inc/lang/hr/revisions.txt
+++ b/inc/lang/hr/revisions.txt
@@ -1,3 +1,3 @@
 ====== Stare verzije ======
 
-Slijedi spisak starih verzija za traženi dokument.
+Slijedi spisak starih verzija za traženi dokument. Da bi ste se vratili na neku od njih, odaberite ju, pritisnite Uređivanje i snimite ju.
diff --git a/inc/lang/hr/searchpage.txt b/inc/lang/hr/searchpage.txt
index 91d9f9c0a4ffd83a85816f9171c74ff1eb8a11af..7a94f32d2a75c1eede578e4be4bdc59e60a3f6ad 100644
--- a/inc/lang/hr/searchpage.txt
+++ b/inc/lang/hr/searchpage.txt
@@ -1 +1,5 @@
-====== Rezultati pretraživanja ======
+====== Pretraživanja ======
+
+Možete naći rezultat vaše pretrage u nastavku. Ako ne možete naći što tražite, možete urediti ili stvoriti novu stranicu s odgovarajućim alatom.
+
+====== Rezultati ======
diff --git a/inc/lang/hr/showrev.txt b/inc/lang/hr/showrev.txt
index aba2c0db0f79dcbeb0c92d813799f149ad67c0c3..86c1a0295ba28dedb433b323fd158dad8c304404 100644
--- a/inc/lang/hr/showrev.txt
+++ b/inc/lang/hr/showrev.txt
@@ -1,2 +1,2 @@
-**Ovo je stara verzija dokumenta!**
+**Ovo je stara izmjena dokumenta!**
 ----
diff --git a/inc/lang/hr/subscr_digest.txt b/inc/lang/hr/subscr_digest.txt
new file mode 100644
index 0000000000000000000000000000000000000000..fad158d7690bf99d7d167af98a5e047e88d0a98a
--- /dev/null
+++ b/inc/lang/hr/subscr_digest.txt
@@ -0,0 +1,19 @@
+Pozdrav !
+
+Stranica @PAGE@ u @TITLE@ wiki-u je promijenjena.
+Ovdje su promjene:
+
+--------------------------------------------------------
+@DIFF@
+--------------------------------------------------------
+
+Stara verzija: @OLDPAGE@
+Nova verzija: @NEWPAGE@
+
+Da poništite obavijesti o izmjenama prijavite se na wiki @DOKUWIKIURL@ i zatim posjetite
+@SUBSCRIBE@
+i odjavite se s promjena na stranici i/ili imeničkom prostoru.
+
+-- 
+Ova poruka je generirana od strane DokuWiki dostupnog na
+@DOKUWIKIURL@
\ No newline at end of file
diff --git a/inc/lang/hr/subscr_form.txt b/inc/lang/hr/subscr_form.txt
new file mode 100644
index 0000000000000000000000000000000000000000..95b2cd03e6518751be989910757a398ea73930bc
--- /dev/null
+++ b/inc/lang/hr/subscr_form.txt
@@ -0,0 +1,3 @@
+====== Uređivanje pretplata ======
+
+Ova stranica omogućuje Vam da uredite svoju pretplatu na promjene za tekuću stranicu ili imenički prostor.
\ No newline at end of file
diff --git a/inc/lang/hr/subscr_list.txt b/inc/lang/hr/subscr_list.txt
new file mode 100644
index 0000000000000000000000000000000000000000..611c769380a16d16748e7d1363f742e70f828dd7
--- /dev/null
+++ b/inc/lang/hr/subscr_list.txt
@@ -0,0 +1,15 @@
+Pozdrav !
+
+Stranice u imeničkom prostoru @PAGE@ na @TITLE@ wiki-u su izmijenjene. Ovo su izmijenjene stranice:
+
+--------------------------------------------------------
+@DIFF@
+--------------------------------------------------------
+
+Da poništite obavijesti o izmjenama prijavite se na wiki @DOKUWIKIURL@ i zatim posjetite
+@SUBSCRIBE@
+i odjavite se s promjena na stranici i/ili imeničkom prostoru.
+
+-- 
+Ova poruka je generirana od strane DokuWiki dostupnog na
+@DOKUWIKIURL@
\ No newline at end of file
diff --git a/inc/lang/hr/subscr_single.txt b/inc/lang/hr/subscr_single.txt
new file mode 100644
index 0000000000000000000000000000000000000000..18f66901c62902466c27dbb3150ce56129e85f90
--- /dev/null
+++ b/inc/lang/hr/subscr_single.txt
@@ -0,0 +1,22 @@
+Pozdrav !
+
+Stranica @PAGE@ na @TITLE@ wiki-u je izmijenjena.
+Ovo su promjene:
+
+--------------------------------------------------------
+@DIFF@
+--------------------------------------------------------
+
+Datum  : @DATE@
+Korisnik: @USER@
+Sažetak izmjena: @SUMMARY@
+Stara verzija: @OLDPAGE@
+Nova verzija : @NEWPAGE@
+
+Da poništite obavijesti o izmjenama prijavite se na wiki @DOKUWIKIURL@ i zatim posjetite
+@SUBSCRIBE@
+i odjavite se s promjena na stranici i/ili imeničkom prostoru.
+
+-- 
+Ova poruka je generirana od strane DokuWiki dostupnog na
+@DOKUWIKIURL@
\ No newline at end of file
diff --git a/inc/lang/hr/uploadmail.txt b/inc/lang/hr/uploadmail.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5b18b2ba38dfdb3aeb4563866872efc3bbb0aaf5
--- /dev/null
+++ b/inc/lang/hr/uploadmail.txt
@@ -0,0 +1,15 @@
+Datoteka je učitana na Vaš DokuWiki. Ovdje su detalji:
+
+Datoteka     : @MEDIA@
+Stara verzija: @OLD@
+Datum        : @DATE@
+Preglednik   : @BROWSER@
+IP-Adresa    : @IPADDRESS@
+Računalo     : @HOSTNAME@
+Veličina     : @SIZE@
+MIME Tip     : @MIME@
+Korisnik     : @USER@
+
+-- 
+Ova poruka je generirana od strane DokuWiki dostupnog na
+@DOKUWIKIURL@
\ No newline at end of file
diff --git a/inc/lang/hu/jquery.ui.datepicker.js b/inc/lang/hu/jquery.ui.datepicker.js
index b28c268c1c445911bd24e6a6497648ded808e059..8ea85506e7965acc833d7811375f0b44ad0fb1cf 100644
--- a/inc/lang/hu/jquery.ui.datepicker.js
+++ b/inc/lang/hu/jquery.ui.datepicker.js
@@ -1,23 +1,36 @@
 /* Hungarian initialisation for the jQuery UI date picker plugin. */
-/* Written by Istvan Karaszi (jquery@spam.raszi.hu). */
-jQuery(function($){
-	$.datepicker.regional['hu'] = {
-		closeText: 'bezár',
-		prevText: 'vissza',
-		nextText: 'előre',
-		currentText: 'ma',
-		monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június',
-		'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
-		monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún',
-		'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'],
-		dayNames: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'],
-		dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'],
-		dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
-		weekHeader: 'Hét',
-		dateFormat: 'yy.mm.dd.',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: true,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['hu']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['hu'] = {
+	closeText: 'bezár',
+	prevText: 'vissza',
+	nextText: 'előre',
+	currentText: 'ma',
+	monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június',
+	'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
+	monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún',
+	'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'],
+	dayNames: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'],
+	dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'],
+	dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
+	weekHeader: 'Hét',
+	dateFormat: 'yy.mm.dd.',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: true,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['hu']);
+
+return datepicker.regional['hu'];
+
+}));
diff --git a/inc/lang/hu/lang.php b/inc/lang/hu/lang.php
index ad70438d93a9c6c4646038e3e575acbee931fe7f..eb4b4601adbf4932ccdd0f1d0370631374b1a6a7 100644
--- a/inc/lang/hu/lang.php
+++ b/inc/lang/hu/lang.php
@@ -13,6 +13,7 @@
  * @author Marton Sebok <sebokmarton@gmail.com>
  * @author Serenity87HUN <anikototh87@gmail.com>
  * @author Marina Vladi <deldadam@gmail.com>
+ * @author Mátyás Jani <jzombi@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -57,7 +58,9 @@ $lang['btn_register']          = 'Regisztráció';
 $lang['btn_apply']             = 'Alkalmaz';
 $lang['btn_media']             = 'Médiakezelő';
 $lang['btn_deleteuser']        = 'Felhasználói fiókom eltávolítása';
-$lang['loggedinas']            = 'Belépett felhasználó: ';
+$lang['btn_img_backto']        = 'Vissza %s';
+$lang['btn_mediaManager']      = 'Megtekintés a médiakezelőben';
+$lang['loggedinas']            = 'Belépett felhasználó';
 $lang['user']                  = 'Azonosító';
 $lang['pass']                  = 'Jelszó';
 $lang['newpass']               = 'Új jelszó';
@@ -102,8 +105,8 @@ $lang['license']               = 'Hacsak máshol nincs egyéb rendelkezés, ezen
 $lang['licenseok']             = 'Megjegyzés: az oldal szerkesztésével elfogadja, hogy a tartalom a következő licenc alatt lesz elérhető:';
 $lang['searchmedia']           = 'Keresett fájl neve:';
 $lang['searchmedia_in']        = 'Keresés a következőben: %s';
-$lang['txt_upload']            = 'Válaszd ki a feltöltendő fájlt';
-$lang['txt_filename']          = 'Feltöltési név (elhagyható)';
+$lang['txt_upload']            = 'Válaszd ki a feltöltendő fájlt:';
+$lang['txt_filename']          = 'Feltöltési név (elhagyható):';
 $lang['txt_overwrt']           = 'Létező fájl felülírása';
 $lang['maxuploadsize']         = 'Maximum %s méretű fájlokat tölthetsz fel.';
 $lang['lockedby']              = 'Jelenleg zárolta:';
@@ -187,10 +190,15 @@ $lang['difflink']              = 'Összehasonlító nézet linkje';
 $lang['diff_type']             = 'Összehasonlítás módja:';
 $lang['diff_inline']           = 'Sorok között';
 $lang['diff_side']             = 'Egymás mellett';
+$lang['diffprevrev']           = 'Előző változat';
+$lang['diffnextrev']           = 'Következő változat';
+$lang['difflastrev']           = 'Utolsó változat';
+$lang['diffbothprevrev']       = 'Előző változat mindkét oldalon';
+$lang['diffbothnextrev']       = 'Következő változat mindkét oldalon';
 $lang['line']                  = 'Sor';
-$lang['breadcrumb']            = 'Nyomvonal';
-$lang['youarehere']            = 'Itt vagy';
-$lang['lastmod']               = 'Utolsó módosítás';
+$lang['breadcrumb']            = 'Nyomvonal:';
+$lang['youarehere']            = 'Itt vagy:';
+$lang['lastmod']               = 'Utolsó módosítás:';
 $lang['by']                    = 'szerkesztette:';
 $lang['deleted']               = 'eltávolítva';
 $lang['created']               = 'létrehozva';
@@ -243,20 +251,18 @@ $lang['admin_register']        = 'Új felhasználó';
 $lang['metaedit']              = 'Metaadatok szerkesztése';
 $lang['metasaveerr']           = 'A metaadatok írása nem sikerült';
 $lang['metasaveok']            = 'Metaadatok elmentve';
-$lang['btn_img_backto']            = 'Vissza %s';
-$lang['img_title']             = 'Cím';
-$lang['img_caption']           = 'Képaláírás';
-$lang['img_date']              = 'Dátum';
-$lang['img_fname']             = 'Fájlnév';
-$lang['img_fsize']             = 'Méret';
-$lang['img_artist']            = 'Készítette';
-$lang['img_copyr']             = 'Szerzői jogok';
-$lang['img_format']            = 'Formátum';
-$lang['img_camera']            = 'Fényképezőgép típusa';
-$lang['img_keywords']          = 'Kulcsszavak';
-$lang['img_width']             = 'Szélesség';
-$lang['img_height']            = 'Magasság';
-$lang['btn_mediaManager']           = 'Megtekintés a médiakezelőben';
+$lang['img_title']             = 'Cím:';
+$lang['img_caption']           = 'Képaláírás:';
+$lang['img_date']              = 'Dátum:';
+$lang['img_fname']             = 'Fájlnév:';
+$lang['img_fsize']             = 'Méret:';
+$lang['img_artist']            = 'Készítette:';
+$lang['img_copyr']             = 'Szerzői jogok:';
+$lang['img_format']            = 'Formátum:';
+$lang['img_camera']            = 'Fényképezőgép típusa:';
+$lang['img_keywords']          = 'Kulcsszavak:';
+$lang['img_width']             = 'Szélesség:';
+$lang['img_height']            = 'Magasság:';
 $lang['subscr_subscribe_success'] = '%s hozzáadva az értesítési listához: %s';
 $lang['subscr_subscribe_error'] = 'Hiba történt %s hozzáadásakor az értesítési listához: %s';
 $lang['subscr_subscribe_noaddress'] = 'Nincs e-mail cím megadva az adataidnál, így a rendszer nem tudott hozzáadni az értesítési listához';
diff --git a/inc/lang/ia/lang.php b/inc/lang/ia/lang.php
index 1cc9bd8b5d19b1b5c281f796e8d9b961ac882ed6..cabbbab93c6cb8eb3c454ef43e757dd774cf6db8 100644
--- a/inc/lang/ia/lang.php
+++ b/inc/lang/ia/lang.php
@@ -50,7 +50,7 @@ $lang['btn_recover']           = 'Recuperar version provisori';
 $lang['btn_draftdel']          = 'Deler version provisori';
 $lang['btn_revert']            = 'Restaurar';
 $lang['btn_register']          = 'Crear conto';
-$lang['loggedinas']            = 'Session aperite como';
+$lang['loggedinas']            = 'Session aperite como:';
 $lang['user']                  = 'Nomine de usator';
 $lang['pass']                  = 'Contrasigno';
 $lang['newpass']               = 'Nove contrasigno';
@@ -88,11 +88,11 @@ $lang['license']               = 'Excepte ubi indicate alteremente, le contento
 $lang['licenseok']             = 'Nota ben! Per modificar iste pagina tu accepta que tu contento essera publicate sub le conditiones del licentia sequente:';
 $lang['searchmedia']           = 'Cercar file con nomine:';
 $lang['searchmedia_in']        = 'Cercar in %s';
-$lang['txt_upload']            = 'Selige le file a incargar';
-$lang['txt_filename']          = 'Incargar como (optional)';
+$lang['txt_upload']            = 'Selige le file a incargar:';
+$lang['txt_filename']          = 'Incargar como (optional):';
 $lang['txt_overwrt']           = 'Reimplaciar le file existente';
-$lang['lockedby']              = 'Actualmente serrate per';
-$lang['lockexpire']            = 'Serratura expira le';
+$lang['lockedby']              = 'Actualmente serrate per:';
+$lang['lockexpire']            = 'Serratura expira le:';
 $lang['js']['willexpire']            = 'Tu serratura super le modification de iste pagina expirara post un minuta.\nPro evitar conflictos, usa le button Previsualisar pro reinitialisar le timer del serratura.';
 $lang['js']['notsavedyet']     = 'Le modificationes non salveguardate essera perdite.\nRealmente continuar?';
 $lang['rssfailed']             = 'Un error occurreva durante le obtention de iste syndication:';
@@ -157,9 +157,9 @@ $lang['yours']                 = 'Tu version';
 $lang['diff']                  = 'Monstrar differentias con versiones actual';
 $lang['diff2']                 = 'Monstrar differentias inter le versiones seligite';
 $lang['line']                  = 'Linea';
-$lang['breadcrumb']            = 'Tracia';
-$lang['youarehere']            = 'Tu es hic';
-$lang['lastmod']               = 'Ultime modification';
+$lang['breadcrumb']            = 'Tracia:';
+$lang['youarehere']            = 'Tu es hic:';
+$lang['lastmod']               = 'Ultime modification:';
 $lang['by']                    = 'per';
 $lang['deleted']               = 'removite';
 $lang['created']               = 'create';
@@ -203,16 +203,16 @@ $lang['metaedit']              = 'Modificar metadatos';
 $lang['metasaveerr']           = 'Scriptura de metadatos fallite';
 $lang['metasaveok']            = 'Metadatos salveguardate';
 $lang['btn_img_backto']            = 'Retornar a %s';
-$lang['img_title']             = 'Titulo';
-$lang['img_caption']           = 'Legenda';
-$lang['img_date']              = 'Data';
-$lang['img_fname']             = 'Nomine de file';
-$lang['img_fsize']             = 'Dimension';
-$lang['img_artist']            = 'Photographo';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Formato';
-$lang['img_camera']            = 'Camera';
-$lang['img_keywords']          = 'Parolas-clave';
+$lang['img_title']             = 'Titulo:';
+$lang['img_caption']           = 'Legenda:';
+$lang['img_date']              = 'Data:';
+$lang['img_fname']             = 'Nomine de file:';
+$lang['img_fsize']             = 'Dimension:';
+$lang['img_artist']            = 'Photographo:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Formato:';
+$lang['img_camera']            = 'Camera:';
+$lang['img_keywords']          = 'Parolas-clave:';
 $lang['subscr_subscribe_success'] = '%s addite al lista de subscription de %s';
 $lang['subscr_subscribe_error'] = 'Error durante le addition de %s al lista de subscription de %s';
 $lang['subscr_subscribe_noaddress'] = 'Il non ha un adresse associate con tu conto. Tu non pote esser addite al lista de subscription.';
diff --git a/inc/lang/id-ni/lang.php b/inc/lang/id-ni/lang.php
index 7a11793266e4977d01a727d4d85243cbc142ea4c..1ff714f3ed97f99a560df65e66e9df1c0af6d55f 100644
--- a/inc/lang/id-ni/lang.php
+++ b/inc/lang/id-ni/lang.php
@@ -41,7 +41,7 @@ $lang['btn_reset']             = 'Fawu\'a';
 $lang['btn_draft']             = 'Fawu\'a wanura';
 $lang['btn_draftdel']          = 'Heta zura';
 $lang['btn_register']          = 'Fasura\'ö';
-$lang['loggedinas']            = 'Möi bakha zotöi';
+$lang['loggedinas']            = 'Möi bakha zotöi:';
 $lang['user']                  = 'Töi';
 $lang['pass']                  = 'Kode';
 $lang['newpass']               = 'Kode sibohou';
@@ -72,6 +72,6 @@ $lang['resendpwdmissing']      = 'Bologö dödöu, si lö tola lö\'ö öfo\'ös
 $lang['resendpwdnouser']       = 'Bologö dödöu, lö masöndra zangoguna da\'a ba database.';
 $lang['resendpwdconfirm']      = 'No tefaohe\'ö link famaduhu\'ö ba imele.';
 $lang['resendpwdsuccess']      = 'No tefa\'ohe\'ö kode sibohou ba imele.';
-$lang['txt_upload']            = 'Fili file ni fa\'ohe\'ö';
+$lang['txt_upload']            = 'Fili file ni fa\'ohe\'ö:';
 $lang['js']['notsavedyet']     = 'Famawu\'a si lö mu\'irö\'ö taya. \nSinduhu ötohugö?';
 $lang['mediaselect']           = 'Media file';
diff --git a/inc/lang/id/jquery.ui.datepicker.js b/inc/lang/id/jquery.ui.datepicker.js
index 6327fa60c78bc97a463c01805fab35e1f9eb6f40..0db693fafc86ad79043f4b114c433d109ba83f03 100644
--- a/inc/lang/id/jquery.ui.datepicker.js
+++ b/inc/lang/id/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Indonesian initialisation for the jQuery UI date picker plugin. */
 /* Written by Deden Fathurahman (dedenf@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['id'] = {
-		closeText: 'Tutup',
-		prevText: '&#x3C;mundur',
-		nextText: 'maju&#x3E;',
-		currentText: 'hari ini',
-		monthNames: ['Januari','Februari','Maret','April','Mei','Juni',
-		'Juli','Agustus','September','Oktober','Nopember','Desember'],
-		monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
-		'Jul','Agus','Sep','Okt','Nop','Des'],
-		dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'],
-		dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'],
-		dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'],
-		weekHeader: 'Mg',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 0,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['id']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['id'] = {
+	closeText: 'Tutup',
+	prevText: '&#x3C;mundur',
+	nextText: 'maju&#x3E;',
+	currentText: 'hari ini',
+	monthNames: ['Januari','Februari','Maret','April','Mei','Juni',
+	'Juli','Agustus','September','Oktober','Nopember','Desember'],
+	monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
+	'Jul','Agus','Sep','Okt','Nop','Des'],
+	dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'],
+	dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'],
+	dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'],
+	weekHeader: 'Mg',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 0,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['id']);
+
+return datepicker.regional['id'];
+
+}));
diff --git a/inc/lang/id/lang.php b/inc/lang/id/lang.php
index 648aad865e932ca670c688575b3f915ef64a127e..ff77cf24da7c008f213901931ba729728fc740ba 100644
--- a/inc/lang/id/lang.php
+++ b/inc/lang/id/lang.php
@@ -8,6 +8,7 @@
  * @author Yustinus Waruwu <juswaruwu@gmail.com>
  * @author zamroni <therons@ymail.com>
  * @author umriya afini <bigdream.power@gmail.com>
+ * @author Arif Budiman <me@kangarif.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -50,8 +51,11 @@ $lang['btn_draftdel']          = 'Hapus draft';
 $lang['btn_revert']            = 'Kembalikan';
 $lang['btn_register']          = 'Daftar';
 $lang['btn_apply']             = 'Terapkan';
+$lang['btn_media']             = 'Pengelola Media';
 $lang['btn_deleteuser']        = 'Hapus Akun Saya';
-$lang['loggedinas']            = 'Login sebagai ';
+$lang['btn_img_backto']        = 'Kembali ke %s';
+$lang['btn_mediaManager']      = 'Tampilkan di pengelola media';
+$lang['loggedinas']            = 'Login sebagai :';
 $lang['user']                  = 'Username';
 $lang['pass']                  = 'Password';
 $lang['newpass']               = 'Password baru';
@@ -78,6 +82,7 @@ $lang['profna']                = 'Wiki ini tidak mengijinkan perubahan profil.';
 $lang['profnochange']          = 'Tidak ada perubahan.';
 $lang['profnoempty']           = 'Mohon mengisikan nama atau alamat email.';
 $lang['profchanged']           = 'Profil User berhasil diubah.';
+$lang['profnodelete']          = 'Wiki ini tidak mendukung penghapusan pengguna';
 $lang['profdeleteuser']        = 'Hapus Akun';
 $lang['profdeleted']           = 'Akun anda telah dihapus dari wiki ini';
 $lang['profconfdelete']        = 'Saya berharap menghapus akun saya dari wiki ini.
@@ -91,30 +96,57 @@ $lang['resendpwdnouser']       = 'Maaf, user ini tidak ditemukan.';
 $lang['resendpwdbadauth']      = 'Maaf, kode autentikasi tidak valid. Pastikan Anda menggunakan keseluruhan link konfirmasi.';
 $lang['resendpwdconfirm']      = 'Link konfirmasi telah dikirim melalui email.';
 $lang['resendpwdsuccess']      = 'Password baru Anda telah dikirim melalui email.';
+$lang['license']               = 'Kecuali jika dinyatakan lain, konten pada wiki ini dilisensikan dibawah lisensi berikut:';
+$lang['licenseok']             = 'Catatan: Dengan menyunting halaman ini, Anda setuju untuk melisensikan konten Anda dibawah lisensi berikut:';
 $lang['searchmedia']           = 'Cari nama file:';
-$lang['txt_upload']            = 'File yang akan diupload';
-$lang['txt_filename']          = 'Masukkan nama wiki (opsional)';
+$lang['searchmedia_in']        = 'Cari di %s';
+$lang['txt_upload']            = 'File yang akan diupload:';
+$lang['txt_filename']          = 'Masukkan nama wiki (opsional):';
 $lang['txt_overwrt']           = 'File yang telah ada akan ditindih';
-$lang['lockedby']              = 'Sedang dikunci oleh';
-$lang['lockexpire']            = 'Penguncian artikel sampai dengan';
+$lang['maxuploadsize']         = 'Unggah maks. %s per berkas';
+$lang['lockedby']              = 'Sedang dikunci oleh:';
+$lang['lockexpire']            = 'Penguncian artikel sampai dengan:';
 $lang['js']['willexpire']      = 'Halaman yang sedang Anda kunci akan berakhir dalam waktu kurang lebih satu menit.\nUntuk menghindari konflik, gunakan tombol Preview untuk me-reset timer pengunci.';
 $lang['js']['notsavedyet']     = 'Perubahan yang belum disimpan akan hilang.\nYakin akan dilanjutkan?';
 $lang['js']['searchmedia']     = 'Cari file';
 $lang['js']['keepopen']        = 'Biarkan window terbuka dalam pemilihan';
 $lang['js']['hidedetails']     = 'Sembunyikan detil';
 $lang['js']['mediatitle']      = 'Pengaturan Link';
+$lang['js']['mediadisplay']    = 'Jenis tautan';
+$lang['js']['mediaalign']      = 'Perataan';
 $lang['js']['mediasize']       = 'Ukuran gambar';
+$lang['js']['mediatarget']     = 'Tautan tujuan';
 $lang['js']['mediaclose']      = 'Tutup';
+$lang['js']['mediainsert']     = 'Sisip';
 $lang['js']['mediadisplayimg'] = 'Lihat gambar';
 $lang['js']['mediadisplaylnk'] = 'Lihat hanya link';
+$lang['js']['mediasmall']      = 'Versi kecil';
+$lang['js']['mediamedium']     = 'Versi sedang';
+$lang['js']['medialarge']      = 'Versi besar';
+$lang['js']['mediaoriginal']   = 'Versi asli';
+$lang['js']['medialnk']        = 'Tautan ke halaman rincian';
+$lang['js']['mediadirect']     = 'Tautan langsung ke aslinya';
+$lang['js']['medianolnk']      = 'Tanpa tautan';
+$lang['js']['medianolink']     = 'Jangan tautkan gambar';
+$lang['js']['medialeft']       = 'Rata gambar sebelah kiri';
+$lang['js']['mediaright']      = 'Rata gambar sebelah kanan';
+$lang['js']['mediacenter']     = 'Rata gambar di tengah';
+$lang['js']['medianoalign']    = 'Jangan gunakan perataan';
 $lang['js']['nosmblinks']      = 'Link ke share Windows hanya bekerja di Microsoft Internet Explorer.
 Anda masih dapat mengcopy and paste linknya.';
+$lang['js']['linkwiz']         = 'Wizard Tautan';
+$lang['js']['linkto']          = 'Tautkan ke:';
 $lang['js']['del_confirm']     = 'Hapus tulisan ini?';
+$lang['js']['restore_confirm'] = 'Benar-benar ingin mengembalikan versi ini?';
+$lang['js']['media_diff']      = 'Lihat perbedaan:';
+$lang['js']['media_diff_both'] = 'Berdampingan';
+$lang['js']['media_diff_opacity'] = 'Mencolok';
 $lang['js']['media_select']    = 'Pilih file...';
 $lang['js']['media_upload_btn'] = 'Unggah';
 $lang['js']['media_done_btn']  = 'Selesai';
 $lang['js']['media_drop']      = 'Tarik file disini untuk mengunggah';
 $lang['js']['media_cancel']    = 'Buang';
+$lang['js']['media_overwrt']   = 'Timpa berkas yang ada';
 $lang['rssfailed']             = 'Error terjadi saat mengambil feed: ';
 $lang['nothingfound']          = 'Tidak menemukan samasekali.';
 $lang['mediaselect']           = 'Pilihan Mediafile';
@@ -148,21 +180,40 @@ $lang['current']               = 'sekarang';
 $lang['yours']                 = 'Versi Anda';
 $lang['diff']                  = 'Tampilkan perbedaan dengan versi sekarang';
 $lang['diff2']                 = 'Tampilkan perbedaan diantara revisi terpilih';
+$lang['difflink']              = 'Tautan ke tampilan pembanding ini';
+$lang['diff_type']             = 'Tampilkan perbedaan:';
+$lang['diff_inline']           = 'Sebaris';
+$lang['diff_side']             = 'Berdampingan';
+$lang['diffprevrev']           = 'Revisi sebelumnya';
+$lang['diffnextrev']           = 'Revisi selanjutnya';
+$lang['difflastrev']           = 'Revisi terakhir';
 $lang['line']                  = 'Baris';
-$lang['breadcrumb']            = 'Jejak';
-$lang['youarehere']            = 'Anda disini';
-$lang['lastmod']               = 'Terakhir diubah';
+$lang['breadcrumb']            = 'Jejak:';
+$lang['youarehere']            = 'Anda disini:';
+$lang['lastmod']               = 'Terakhir diubah:';
 $lang['by']                    = 'oleh';
 $lang['deleted']               = 'terhapus';
 $lang['created']               = 'dibuat';
 $lang['restored']              = 'revisi lama ditampilkan kembali (%s)';
 $lang['external_edit']         = 'Perubahan eksternal';
 $lang['summary']               = 'Edit summary';
+$lang['noflash']               = '<a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> diperlukan untuk menampilkan konten ini.';
+$lang['download']              = 'Unduh Cuplikan';
+$lang['tools']                 = 'Alat';
+$lang['user_tools']            = 'Alat Pengguna';
+$lang['site_tools']            = 'Alat Situs';
+$lang['page_tools']            = 'Alat Halaman';
+$lang['skip_to_content']       = 'lewati ke konten';
+$lang['sidebar']               = 'Bilah Sisi';
 $lang['mail_newpage']          = 'Halaman ditambahkan:';
 $lang['mail_changed']          = 'Halaman diubah:';
+$lang['mail_subscribe_list']   = 'halaman diubah dalam namespace:';
 $lang['mail_new_user']         = 'User baru:';
 $lang['mail_upload']           = 'Berkas di-upload:';
+$lang['changes_type']          = 'Tampilkan perubahan';
 $lang['pages_changes']         = 'Halaman';
+$lang['media_changes']         = 'Berkas media';
+$lang['both_changes']          = 'Baik halaman dan berkas media';
 $lang['qb_bold']               = 'Tebal';
 $lang['qb_italic']             = 'Miring';
 $lang['qb_underl']             = 'Garis Bawah';
@@ -173,6 +224,10 @@ $lang['qb_h2']                 = 'Level 2 Headline';
 $lang['qb_h3']                 = 'Level 3 Headline';
 $lang['qb_h4']                 = 'Level 4 Headline';
 $lang['qb_h5']                 = 'Level 5 Headline';
+$lang['qb_hs']                 = 'Pilih Judul';
+$lang['qb_hplus']              = 'Judul Lebih Atas';
+$lang['qb_hminus']             = 'Judul Lebih Bawah';
+$lang['qb_hequal']             = 'Tingkat Judul yang Sama';
 $lang['qb_link']               = 'Link Internal';
 $lang['qb_extlink']            = 'Link External';
 $lang['qb_hr']                 = 'Garis Horisontal';
@@ -182,21 +237,37 @@ $lang['qb_media']              = 'Tambahkan gambar atau file lain';
 $lang['qb_sig']                = 'Sisipkan tanda tangan';
 $lang['qb_smileys']            = 'Smileys';
 $lang['qb_chars']              = 'Karakter Khusus';
+$lang['upperns']               = 'lompat ke namespace induk';
 $lang['admin_register']        = 'Tambah user baru';
 $lang['metaedit']              = 'Edit Metadata';
 $lang['metasaveerr']           = 'Gagal menulis metadata';
 $lang['metasaveok']            = 'Metadata tersimpan';
-$lang['btn_img_backto']            = 'Kembali ke %s';
-$lang['img_title']             = 'Judul';
-$lang['img_caption']           = 'Label';
-$lang['img_date']              = 'Tanggal';
-$lang['img_fname']             = 'Nama file';
-$lang['img_fsize']             = 'Ukuran';
-$lang['img_artist']            = 'Tukang foto';
-$lang['img_copyr']             = 'Hakcipta';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Katakunci';
+$lang['img_title']             = 'Judul:';
+$lang['img_caption']           = 'Label:';
+$lang['img_date']              = 'Tanggal:';
+$lang['img_fname']             = 'Nama file:';
+$lang['img_fsize']             = 'Ukuran:';
+$lang['img_artist']            = 'Tukang foto:';
+$lang['img_copyr']             = 'Hakcipta:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Katakunci:';
+$lang['img_width']             = 'Lebar:';
+$lang['img_height']            = 'Tinggi:';
+$lang['subscr_subscribe_success'] = 'Menambah %s ke senarai langganan untuk %s';
+$lang['subscr_subscribe_error'] = 'Kesalahan menambahkan %s ke senarai langganan untuk %s';
+$lang['subscr_subscribe_noaddress'] = 'Tidak ada alamat yang terkait dengan login Anda, Anda tidak dapat ditambahkan ke senarai langganan';
+$lang['subscr_unsubscribe_success'] = 'Menghapus %s dari senarai langganan untuk %s';
+$lang['subscr_unsubscribe_error'] = 'Kesalahan menghapus %s dari senarai langganan untuk %s';
+$lang['subscr_already_subscribed'] = '%s sudah dilanggankan ke %s';
+$lang['subscr_not_subscribed'] = '%s tidak dilanggankan ke %s';
+$lang['subscr_m_not_subscribed'] = 'Saat ini Anda tidak berlangganan halaman dan namespace saat ini.';
+$lang['subscr_m_new_header']   = 'Tambahkan langganan';
+$lang['subscr_m_current_header'] = 'Langganan saat ini';
+$lang['subscr_m_unsubscribe']  = 'Berhenti berlangganan';
+$lang['subscr_m_subscribe']    = 'Berlangganan';
+$lang['subscr_m_receive']      = 'Menerima';
+$lang['subscr_style_every']    = 'email setiap diubah';
 $lang['authtempfail']          = 'Autentikasi user saat ini sedang tidak dapat digunakan. Jika kejadian ini berlanjut, Harap informasikan admin Wiki Anda.';
 $lang['i_chooselang']          = 'Pilih bahasa';
 $lang['i_installer']           = 'Instalasi DokuWiki';
@@ -217,4 +288,41 @@ $lang['i_policy']              = 'Policy ACL awal';
 $lang['i_pol0']                = 'Wiki Terbuka (baca, tulis, upload untuk semua orang)';
 $lang['i_pol1']                = 'Wiki Publik (baca untuk semua orang, tulis dan upload untuk pengguna terdaftar)';
 $lang['i_pol2']                = 'Wiki Privat (baca, tulis dan upload hanya untuk pengguna terdaftar)';
+$lang['i_allowreg']            = 'Ijinkan pengguna mendaftar sendiri';
 $lang['i_retry']               = 'Coba Lagi';
+$lang['i_license']             = 'Silakan pilih lisensi untuk konten Anda:';
+$lang['i_license_none']        = 'Jangan tampilkan semua informasi lisensi';
+$lang['i_pop_field']           = 'Tolong, bantu kami meningkatkan pengalaman DokuWiki:';
+$lang['i_pop_label']           = 'Setiap bulan mengirimkan penggunaan data anonim ke pengembang DokuWiki';
+$lang['years']                 = '%d tahun yang lalu';
+$lang['months']                = '%d bulan yang lalu';
+$lang['weeks']                 = '%d minggu yang lalu';
+$lang['days']                  = '%d hari yang lalu';
+$lang['hours']                 = '%d jam yang lalu';
+$lang['minutes']               = '%d menit yang lalu';
+$lang['seconds']               = '%d detik yang lalu';
+$lang['wordblock']             = 'Pengubahan Anda tidak disimpan karena berisi teks yang diblokir (spam).';
+$lang['media_uploadtab']       = 'Unggah';
+$lang['media_searchtab']       = 'Cari';
+$lang['media_file']            = 'Berkas';
+$lang['media_viewtab']         = 'Lihat';
+$lang['media_edittab']         = 'Sunting';
+$lang['media_historytab']      = 'Riwayat';
+$lang['media_list_rows']       = 'Kolom';
+$lang['media_sort_name']       = 'Nama';
+$lang['media_sort_date']       = 'Tanggal';
+$lang['media_namespaces']      = 'Pilih namespace';
+$lang['media_upload']          = 'Unggah ke %s';
+$lang['media_search']          = 'Cari di %s';
+$lang['media_view']            = '%s';
+$lang['media_viewold']         = '%s di %s';
+$lang['media_edit']            = 'Sunting %s';
+$lang['media_history']         = 'Riwayat %s';
+$lang['media_meta_edited']     = 'metadata disunting';
+$lang['media_perm_read']       = 'Maaf, Anda tidak memiliki izin untuk membaca berkas.';
+$lang['media_perm_upload']     = 'Maaf, Anda tidak memiliki izin untuk mengunggah berkas.';
+$lang['media_update']          = 'Unggah versi baru';
+$lang['media_restore']         = 'Kembalikan versi ini';
+$lang['currentns']             = 'Namespace saat ini';
+$lang['searchresult']          = 'Hasil Pencarian';
+$lang['wikimarkup']            = 'Markah Wiki';
diff --git a/inc/lang/id/resetpwd.txt b/inc/lang/id/resetpwd.txt
new file mode 100644
index 0000000000000000000000000000000000000000..6ab26c8664db88b1e886bfa4041ddf6b59b5c36a
--- /dev/null
+++ b/inc/lang/id/resetpwd.txt
@@ -0,0 +1,3 @@
+====== Atur sandi baru ====== 
+
+Silakan masukkan sandi baru untuk akun Anda di wiki ini.
\ No newline at end of file
diff --git a/inc/lang/id/subscr_digest.txt b/inc/lang/id/subscr_digest.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5e1041c041caab15b1df403508f299339ac1255e
--- /dev/null
+++ b/inc/lang/id/subscr_digest.txt
@@ -0,0 +1,17 @@
+Hei! 
+
+Halaman @PAGE@ di wiki @TITLE@ telah disunting. 
+Berikut perubahannya:
+
+-------------------------------------------------------- 
+@DIFF@ 
+-------------------------------------------------------- 
+
+Revisi lama: @OLDPAGE@ 
+
+Revisi baru: @NEWPAGE@ 
+
+Untuk menonaktifkan pemberitahuan ini, masuk ke wiki di @DOKUWIKIURL@ kemudian kunjungi @SUBSCRIBE@ dan halaman batal berlangganan dan/atau namespace yang diubah.
+
+-- 
+Email ini dibuat oleh DokuWiki di @DOKUWIKIURL@
\ No newline at end of file
diff --git a/inc/lang/is/jquery.ui.datepicker.js b/inc/lang/is/jquery.ui.datepicker.js
index 4fc4298881a9412708f593eb6a9eafa6774eaa44..16bc79ad8e5829b1c0f808d90b53282151f7e884 100644
--- a/inc/lang/is/jquery.ui.datepicker.js
+++ b/inc/lang/is/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Icelandic initialisation for the jQuery UI date picker plugin. */
 /* Written by Haukur H. Thorsson (haukur@eskill.is). */
-jQuery(function($){
-	$.datepicker.regional['is'] = {
-		closeText: 'Loka',
-		prevText: '&#x3C; Fyrri',
-		nextText: 'Næsti &#x3E;',
-		currentText: 'Í dag',
-		monthNames: ['Janúar','Febrúar','Mars','Apríl','Maí','Júní',
-		'Júlí','Ágúst','September','Október','Nóvember','Desember'],
-		monthNamesShort: ['Jan','Feb','Mar','Apr','Maí','Jún',
-		'Júl','Ágú','Sep','Okt','Nóv','Des'],
-		dayNames: ['Sunnudagur','Mánudagur','Þriðjudagur','Miðvikudagur','Fimmtudagur','Föstudagur','Laugardagur'],
-		dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'],
-		dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'],
-		weekHeader: 'Vika',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 0,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['is']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['is'] = {
+	closeText: 'Loka',
+	prevText: '&#x3C; Fyrri',
+	nextText: 'Næsti &#x3E;',
+	currentText: 'Í dag',
+	monthNames: ['Janúar','Febrúar','Mars','Apríl','Maí','Júní',
+	'Júlí','Ágúst','September','Október','Nóvember','Desember'],
+	monthNamesShort: ['Jan','Feb','Mar','Apr','Maí','Jún',
+	'Júl','Ágú','Sep','Okt','Nóv','Des'],
+	dayNames: ['Sunnudagur','Mánudagur','Þriðjudagur','Miðvikudagur','Fimmtudagur','Föstudagur','Laugardagur'],
+	dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'],
+	dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'],
+	weekHeader: 'Vika',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 0,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['is']);
+
+return datepicker.regional['is'];
+
+}));
diff --git a/inc/lang/is/lang.php b/inc/lang/is/lang.php
index 219431a424ab7844ea35d4c632eaedfdb8102b38..de1a01ed5b1080c88a233fe9ec78ef9cadfd8c11 100644
--- a/inc/lang/is/lang.php
+++ b/inc/lang/is/lang.php
@@ -51,7 +51,7 @@ $lang['btn_recover']           = 'Endurheimta uppkast';
 $lang['btn_draftdel']          = 'Eyða uppkasti';
 $lang['btn_revert']            = 'Endurheimta';
 $lang['btn_register']          = 'Skráning';
-$lang['loggedinas']            = 'Innskráning sem';
+$lang['loggedinas']            = 'Innskráning sem:';
 $lang['user']                  = 'Notendanafn';
 $lang['pass']                  = 'Aðgangsorð';
 $lang['newpass']               = 'Nýtt aðgangsorð';
@@ -89,11 +89,11 @@ $lang['license']               = 'Nema annað sé tekið fram, efni á þessari
 $lang['licenseok']             = 'Athugið: Með því að breyta þessari síðu samþykkir þú að leyfisveitandi efni undir eftirfarandi leyfi:';
 $lang['searchmedia']           = 'Leit skrárheiti:';
 $lang['searchmedia_in']        = 'Leit í %s';
-$lang['txt_upload']            = 'Veldu skrá til innhleðslu';
-$lang['txt_filename']          = 'Innhlaða sem (valfrjálst)';
+$lang['txt_upload']            = 'Veldu skrá til innhleðslu:';
+$lang['txt_filename']          = 'Innhlaða sem (valfrjálst):';
 $lang['txt_overwrt']           = 'Skrifa yfir skrá sem þegar er til';
-$lang['lockedby']              = 'Læstur af';
-$lang['lockexpire']            = 'Læsing rennur út eftir';
+$lang['lockedby']              = 'Læstur af:';
+$lang['lockexpire']            = 'Læsing rennur út eftir:';
 $lang['nothingfound']          = 'Ekkert fannst';
 $lang['mediaselect']           = 'Miðlaskrá';
 $lang['fileupload']            = 'Hlaða inn miðlaskrá';
@@ -127,9 +127,9 @@ $lang['yours']                 = 'Þín útgáfa';
 $lang['diff']                  = 'Sýna ágreiningur til núverandi endurskoðun';
 $lang['diff2']                 = 'Sýna ágreiningur meðal valið endurskoðun';
 $lang['line']                  = 'Lína';
-$lang['breadcrumb']            = 'Snefill';
-$lang['youarehere']            = 'Þú ert hér';
-$lang['lastmod']               = 'Síðast breytt';
+$lang['breadcrumb']            = 'Snefill:';
+$lang['youarehere']            = 'Þú ert hér:';
+$lang['lastmod']               = 'Síðast breytt:';
 $lang['by']                    = 'af';
 $lang['deleted']               = 'eytt';
 $lang['created']               = 'myndað';
@@ -171,14 +171,14 @@ $lang['metaedit']              = 'Breyta lýsigögnum';
 $lang['metasaveerr']           = 'Vistun lýsigagna mistókst';
 $lang['metasaveok']            = 'Lýsigögn vistuð';
 $lang['btn_img_backto']            = 'Aftur til %s';
-$lang['img_title']             = 'Heiti';
-$lang['img_caption']           = 'Skýringartexti';
-$lang['img_date']              = 'Dagsetning';
-$lang['img_fname']             = 'Skrárheiti';
-$lang['img_fsize']             = 'Stærð';
-$lang['img_artist']            = 'Myndsmiður';
-$lang['img_copyr']             = 'Útgáfuréttur';
-$lang['img_format']            = 'Forsnið';
-$lang['img_camera']            = 'Myndavél';
-$lang['img_keywords']          = 'Lykilorðir';
+$lang['img_title']             = 'Heiti:';
+$lang['img_caption']           = 'Skýringartexti:';
+$lang['img_date']              = 'Dagsetning:';
+$lang['img_fname']             = 'Skrárheiti:';
+$lang['img_fsize']             = 'Stærð:';
+$lang['img_artist']            = 'Myndsmiður:';
+$lang['img_copyr']             = 'Útgáfuréttur:';
+$lang['img_format']            = 'Forsnið:';
+$lang['img_camera']            = 'Myndavél:';
+$lang['img_keywords']          = 'Lykilorðir:';
 $lang['i_retry']               = 'Reyna aftur';
diff --git a/inc/lang/it/jquery.ui.datepicker.js b/inc/lang/it/jquery.ui.datepicker.js
index a01f043f8a78ad84e82b51ded200a4e016375fa4..4d4d62f9b619bc58671b35be7ad291e34b9bbeda 100644
--- a/inc/lang/it/jquery.ui.datepicker.js
+++ b/inc/lang/it/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Italian initialisation for the jQuery UI date picker plugin. */
 /* Written by Antonello Pasella (antonello.pasella@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['it'] = {
-		closeText: 'Chiudi',
-		prevText: '&#x3C;Prec',
-		nextText: 'Succ&#x3E;',
-		currentText: 'Oggi',
-		monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno',
-			'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
-		monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu',
-			'Lug','Ago','Set','Ott','Nov','Dic'],
-		dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'],
-		dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
-		dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'],
-		weekHeader: 'Sm',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['it']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['it'] = {
+	closeText: 'Chiudi',
+	prevText: '&#x3C;Prec',
+	nextText: 'Succ&#x3E;',
+	currentText: 'Oggi',
+	monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno',
+		'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
+	monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu',
+		'Lug','Ago','Set','Ott','Nov','Dic'],
+	dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'],
+	dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
+	dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'],
+	weekHeader: 'Sm',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['it']);
+
+return datepicker.regional['it'];
+
+}));
diff --git a/inc/lang/it/lang.php b/inc/lang/it/lang.php
index eefcec9db340ee976be04817c11a8689505a6f6b..f59a7b9488327edb997b1012f5371f4ca095b53f 100644
--- a/inc/lang/it/lang.php
+++ b/inc/lang/it/lang.php
@@ -17,6 +17,9 @@
  * @author snarchio@gmail.com
  * @author Edmondo Di Tucci <snarchio@gmail.com>
  * @author Claudio Lanconelli <lancos@libero.it>
+ * @author Mirko <malisan.mirko@gmail.com>
+ * @author Francesco <francesco.cavalli@hotmail.com>
+ * @author Fabio <fabioslurp@yahoo.it>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -61,7 +64,9 @@ $lang['btn_register']          = 'Registrazione';
 $lang['btn_apply']             = 'Applica';
 $lang['btn_media']             = 'Gestore Media';
 $lang['btn_deleteuser']        = 'Rimuovi il mio account';
-$lang['loggedinas']            = 'Collegato come';
+$lang['btn_img_backto']        = 'Torna a %s';
+$lang['btn_mediaManager']      = 'Guarda nel gestore media';
+$lang['loggedinas']            = 'Collegato come:';
 $lang['user']                  = 'Nome utente';
 $lang['pass']                  = 'Password';
 $lang['newpass']               = 'Nuova password';
@@ -106,12 +111,12 @@ $lang['license']               = 'Ad eccezione da dove è diversamente indicato,
 $lang['licenseok']             = 'Nota: modificando questa pagina accetti di rilasciare il contenuto sotto la seguente licenza:';
 $lang['searchmedia']           = 'Cerca file di nome:';
 $lang['searchmedia_in']        = 'Cerca in %s';
-$lang['txt_upload']            = 'Seleziona un file da caricare';
-$lang['txt_filename']          = 'Carica come (opzionale)';
+$lang['txt_upload']            = 'Seleziona un file da caricare:';
+$lang['txt_filename']          = 'Carica come (opzionale):';
 $lang['txt_overwrt']           = 'Sovrascrivi file esistente';
 $lang['maxuploadsize']         = 'Upload max. %s per ogni file.';
-$lang['lockedby']              = 'Attualmente bloccato da';
-$lang['lockexpire']            = 'Il blocco scade alle';
+$lang['lockedby']              = 'Attualmente bloccato da:';
+$lang['lockexpire']            = 'Il blocco scade alle:';
 $lang['js']['willexpire']      = 'Il tuo blocco su questa pagina scadrà tra circa un minuto.\nPer evitare incongruenze usa il pulsante di anteprima per prolungare il periodo di blocco.';
 $lang['js']['notsavedyet']     = 'Le modifiche non salvate andranno perse.';
 $lang['js']['searchmedia']     = 'Cerca file';
@@ -146,6 +151,7 @@ $lang['js']['del_confirm']     = 'Eliminare veramente questa voce?';
 $lang['js']['restore_confirm'] = 'Vuoi davvero ripristinare questa versione?';
 $lang['js']['media_diff']      = 'Guarda le differenze:';
 $lang['js']['media_diff_both'] = 'Fianco a Fianco';
+$lang['js']['media_diff_portions'] = 'rubare';
 $lang['js']['media_select']    = 'Seleziona files..';
 $lang['js']['media_upload_btn'] = 'Upload';
 $lang['js']['media_done_btn']  = 'Fatto';
@@ -189,10 +195,13 @@ $lang['difflink']              = 'Link a questa pagina di confronto';
 $lang['diff_type']             = 'Guarda le differenze:';
 $lang['diff_inline']           = 'In linea';
 $lang['diff_side']             = 'Fianco a Fianco';
+$lang['diffprevrev']           = 'Revisione precedente';
+$lang['diffnextrev']           = 'Prossima revisione';
+$lang['difflastrev']           = 'Ultima revisione';
 $lang['line']                  = 'Linea';
-$lang['breadcrumb']            = 'Traccia';
-$lang['youarehere']            = 'Ti trovi qui';
-$lang['lastmod']               = 'Ultima modifica';
+$lang['breadcrumb']            = 'Traccia:';
+$lang['youarehere']            = 'Ti trovi qui:';
+$lang['lastmod']               = 'Ultima modifica:';
 $lang['by']                    = 'da';
 $lang['deleted']               = 'eliminata';
 $lang['created']               = 'creata';
@@ -245,20 +254,18 @@ $lang['admin_register']        = 'Aggiungi un nuovo utente';
 $lang['metaedit']              = 'Modifica metadati';
 $lang['metasaveerr']           = 'Scrittura metadati fallita';
 $lang['metasaveok']            = 'Metadati salvati';
-$lang['btn_img_backto']            = 'Torna a %s';
-$lang['img_title']             = 'Titolo';
-$lang['img_caption']           = 'Descrizione';
-$lang['img_date']              = 'Data';
-$lang['img_fname']             = 'Nome File';
-$lang['img_fsize']             = 'Dimensione';
-$lang['img_artist']            = 'Autore';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Formato';
-$lang['img_camera']            = 'Camera';
-$lang['img_keywords']          = 'Parole chiave';
-$lang['img_width']             = 'Larghezza';
-$lang['img_height']            = 'Altezza';
-$lang['btn_mediaManager']           = 'Guarda nel gestore media';
+$lang['img_title']             = 'Titolo:';
+$lang['img_caption']           = 'Descrizione:';
+$lang['img_date']              = 'Data:';
+$lang['img_fname']             = 'Nome File:';
+$lang['img_fsize']             = 'Dimensione:';
+$lang['img_artist']            = 'Autore:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Formato:';
+$lang['img_camera']            = 'Camera:';
+$lang['img_keywords']          = 'Parole chiave:';
+$lang['img_width']             = 'Larghezza:';
+$lang['img_height']            = 'Altezza:';
 $lang['subscr_subscribe_success'] = 'Aggiunto %s alla lista di sottoscrizioni %s';
 $lang['subscr_subscribe_error'] = 'Impossibile aggiungere %s alla lista di sottoscrizioni %s';
 $lang['subscr_subscribe_noaddress'] = 'Non esiste alcun indirizzo associato al tuo account, non puoi essere aggiunto alla lista di sottoscrizioni';
@@ -337,4 +344,6 @@ $lang['media_perm_read']       = 'Spiacente, non hai abbastanza privilegi per le
 $lang['media_perm_upload']     = 'Spiacente, non hai abbastanza privilegi per caricare files.';
 $lang['media_update']          = 'Carica nuova versione';
 $lang['media_restore']         = 'Ripristina questa versione';
+$lang['currentns']             = 'Namespace corrente';
 $lang['searchresult']          = 'Risultati della ricerca';
+$lang['plainhtml']             = 'HTML';
diff --git a/inc/lang/ja/jquery.ui.datepicker.js b/inc/lang/ja/jquery.ui.datepicker.js
index 4d0b63c77de6a4b1bf20d22b489c001cb1161634..381f41b5d705bce773afd446c7cc22002263c2c1 100644
--- a/inc/lang/ja/jquery.ui.datepicker.js
+++ b/inc/lang/ja/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Japanese initialisation for the jQuery UI date picker plugin. */
 /* Written by Kentaro SATO (kentaro@ranvis.com). */
-jQuery(function($){
-	$.datepicker.regional['ja'] = {
-		closeText: '閉じる',
-		prevText: '&#x3C;前',
-		nextText: '次&#x3E;',
-		currentText: '今日',
-		monthNames: ['1月','2月','3月','4月','5月','6月',
-		'7月','8月','9月','10月','11月','12月'],
-		monthNamesShort: ['1月','2月','3月','4月','5月','6月',
-		'7月','8月','9月','10月','11月','12月'],
-		dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'],
-		dayNamesShort: ['日','月','火','水','木','金','土'],
-		dayNamesMin: ['日','月','火','水','木','金','土'],
-		weekHeader: '週',
-		dateFormat: 'yy/mm/dd',
-		firstDay: 0,
-		isRTL: false,
-		showMonthAfterYear: true,
-		yearSuffix: 'å¹´'};
-	$.datepicker.setDefaults($.datepicker.regional['ja']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['ja'] = {
+	closeText: '閉じる',
+	prevText: '&#x3C;前',
+	nextText: '次&#x3E;',
+	currentText: '今日',
+	monthNames: ['1月','2月','3月','4月','5月','6月',
+	'7月','8月','9月','10月','11月','12月'],
+	monthNamesShort: ['1月','2月','3月','4月','5月','6月',
+	'7月','8月','9月','10月','11月','12月'],
+	dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'],
+	dayNamesShort: ['日','月','火','水','木','金','土'],
+	dayNamesMin: ['日','月','火','水','木','金','土'],
+	weekHeader: '週',
+	dateFormat: 'yy/mm/dd',
+	firstDay: 0,
+	isRTL: false,
+	showMonthAfterYear: true,
+	yearSuffix: 'å¹´'};
+datepicker.setDefaults(datepicker.regional['ja']);
+
+return datepicker.regional['ja'];
+
+}));
diff --git a/inc/lang/ja/lang.php b/inc/lang/ja/lang.php
index 782689fa397872c527a3dbc2aefa0eabf5254d17..381863eb3538ec0980256266d19aa8b3ad3b3a86 100644
--- a/inc/lang/ja/lang.php
+++ b/inc/lang/ja/lang.php
@@ -11,6 +11,7 @@
  * @author Satoshi Sahara <sahara.satoshi@gmail.com>
  * @author Hideaki SAWADA <chuno@live.jp>
  * @author Hideaki SAWADA <sawadakun@live.jp>
+ * @author PzF_X <jp_minecraft@yahoo.co.jp>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -55,7 +56,9 @@ $lang['btn_register']          = 'ユーザー登録';
 $lang['btn_apply']             = '適用';
 $lang['btn_media']             = 'メディアマネージャー';
 $lang['btn_deleteuser']        = '自分のアカウントの抹消';
-$lang['loggedinas']            = 'ようこそ';
+$lang['btn_img_backto']        = '戻る %s';
+$lang['btn_mediaManager']      = 'メディアマネージャーで閲覧';
+$lang['loggedinas']            = 'ようこそ:';
 $lang['user']                  = 'ユーザー名';
 $lang['pass']                  = 'パスワード';
 $lang['newpass']               = '新しいパスワード';
@@ -100,12 +103,12 @@ $lang['license']               = '特に明示されていない限り、本Wiki
 $lang['licenseok']             = '注意: 本ページを編集することは、あなたの編集した内容が次のライセンスに従うことに同意したものとみなします:';
 $lang['searchmedia']           = '検索ファイル名:';
 $lang['searchmedia_in']        = '%s 内を検索';
-$lang['txt_upload']            = 'アップロードするファイルを選んでください。';
-$lang['txt_filename']          = '名前を変更してアップロード(オプション)';
+$lang['txt_upload']            = 'アップロードするファイルを選んでください。:';
+$lang['txt_filename']          = '名前を変更してアップロード(オプション):';
 $lang['txt_overwrt']           = '既存のファイルを上書き';
 $lang['maxuploadsize']         = 'アップロード上限サイズ %s /ファイル';
-$lang['lockedby']              = 'この文書は次のユーザーによってロックされています';
-$lang['lockexpire']            = 'ロック期限:';
+$lang['lockedby']              = 'この文書は次のユーザーによってロックされています:';
+$lang['lockexpire']            = 'ロック期限::';
 $lang['js']['willexpire']      = '編集中の文書はロック期限を過ぎようとしています。このままロックする場合は、一度文書の確認を行って期限をリセットしてください。';
 $lang['js']['notsavedyet']     = '変更は保存されません。このまま処理を続けてよろしいですか?';
 $lang['js']['searchmedia']     = 'ファイル検索';
@@ -184,10 +187,15 @@ $lang['difflink']              = 'この比較画面にリンクする';
 $lang['diff_type']             = '差分の表示方法:';
 $lang['diff_inline']           = 'インライン';
 $lang['diff_side']             = '横に並べる';
+$lang['diffprevrev']           = '前のリビジョン';
+$lang['diffnextrev']           = '次のリビジョン';
+$lang['difflastrev']           = '最新リビジョン';
+$lang['diffbothprevrev']       = '両方とも前のリビジョン';
+$lang['diffbothnextrev']       = '両方とも次のリビジョン';
 $lang['line']                  = 'ライン';
-$lang['breadcrumb']            = 'トレース';
-$lang['youarehere']            = '現在位置';
-$lang['lastmod']               = '最終更新';
+$lang['breadcrumb']            = 'トレース:';
+$lang['youarehere']            = '現在位置:';
+$lang['lastmod']               = '最終更新:';
 $lang['by']                    = 'by';
 $lang['deleted']               = '削除';
 $lang['created']               = '作成';
@@ -240,20 +248,18 @@ $lang['admin_register']        = '新規ユーザー作成';
 $lang['metaedit']              = 'メタデータ編集';
 $lang['metasaveerr']           = 'メタデータの書き込みに失敗しました';
 $lang['metasaveok']            = 'メタデータは保存されました';
-$lang['btn_img_backto']            = '戻る %s';
-$lang['img_title']             = 'タイトル';
-$lang['img_caption']           = '見出し';
-$lang['img_date']              = '日付';
-$lang['img_fname']             = 'ファイル名';
-$lang['img_fsize']             = 'サイズ';
-$lang['img_artist']            = '作成者';
-$lang['img_copyr']             = '著作権';
-$lang['img_format']            = 'フォーマット';
-$lang['img_camera']            = '使用カメラ';
-$lang['img_keywords']          = 'キーワード';
-$lang['img_width']             = 'å¹…';
-$lang['img_height']            = '高さ';
-$lang['btn_mediaManager']           = 'メディアマネージャーで閲覧';
+$lang['img_title']             = 'タイトル:';
+$lang['img_caption']           = '見出し:';
+$lang['img_date']              = '日付:';
+$lang['img_fname']             = 'ファイル名:';
+$lang['img_fsize']             = 'サイズ:';
+$lang['img_artist']            = '作成者:';
+$lang['img_copyr']             = '著作権:';
+$lang['img_format']            = 'フォーマット:';
+$lang['img_camera']            = '使用カメラ:';
+$lang['img_keywords']          = 'キーワード:';
+$lang['img_width']             = 'å¹…:';
+$lang['img_height']            = '高さ:';
 $lang['subscr_subscribe_success'] = '%sが%sの購読リストに登録されました。';
 $lang['subscr_subscribe_error'] = '%sを%sの購読リストへの追加に失敗しました。';
 $lang['subscr_subscribe_noaddress'] = 'あなたのログインに対応するアドレスがないため、購読リストへ追加することができません。';
@@ -283,6 +289,7 @@ $lang['i_modified']            = 'セキュリティの理由から、新規も
                          <a href="http://dokuwiki.org/install">Dokuwiki インストールガイド</a>を参考にしてインストールしてください。';
 $lang['i_funcna']              = 'PHPの関数 <code>%s</code> が使用できません。ホスティング会社が何らかの理由で無効にしている可能性があります。';
 $lang['i_phpver']              = 'PHPのバージョン <code>%s</code> が必要なバージョン <code>%s</code> より以前のものです。PHPのアップグレードが必要です。';
+$lang['i_mbfuncoverload']      = 'DokuWiki を実行する php.ini ファイルの mbstring.func_overload は無効にして下さい。';
 $lang['i_permfail']            = '<code>%s</code> に書き込みできません。このディレクトリの権限を確認して下さい。';
 $lang['i_confexists']          = '<code>%s</code> は既に存在します';
 $lang['i_writeerr']            = '<code>%s</code> を作成できません。ディレクトリとファイルの権限を確認し、それらを手動で作成する必要があります。';
diff --git a/inc/lang/ka/admin.txt b/inc/lang/ka/admin.txt
new file mode 100644
index 0000000000000000000000000000000000000000..97072a449f0ccc493d946c4b0b771196a344d250
--- /dev/null
+++ b/inc/lang/ka/admin.txt
@@ -0,0 +1,4 @@
+====== მართვა ======
+
+ქვემოთ თქვენ ხედავთ ადმინისტრაციული ოპერაციების სიას «დოკუვიკიში».
+
diff --git a/inc/lang/ka/adminplugins.txt b/inc/lang/ka/adminplugins.txt
new file mode 100644
index 0000000000000000000000000000000000000000..011bfeb62d11527ca6327a96105feb1838c75396
--- /dev/null
+++ b/inc/lang/ka/adminplugins.txt
@@ -0,0 +1 @@
+===== დამატებითი პლაგინები =====
\ No newline at end of file
diff --git a/inc/lang/ka/backlinks.txt b/inc/lang/ka/backlinks.txt
new file mode 100644
index 0000000000000000000000000000000000000000..7b54797c79e94289bc41131671ae2817a6cfd30a
--- /dev/null
+++ b/inc/lang/ka/backlinks.txt
@@ -0,0 +1,4 @@
+====== გადმომისამართება ======
+
+გვერდები რომლებიც ანიშნებენ ამ გვერდზე.
+
diff --git a/inc/lang/ka/conflict.txt b/inc/lang/ka/conflict.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1b1eb04828a0ef97366cbc0593cec6c0c7771f25
--- /dev/null
+++ b/inc/lang/ka/conflict.txt
@@ -0,0 +1,5 @@
+====== გამოვიდა უფრო ახალი ვერსია ======
+
+არსებობს დოკუმენტის უფრო ახალი ვერსია, რომელიც თქვენ დაარედაქტირეთ. ეს ხდება მაშინ, როდესაც სხვა მომხმარებელი არედაქტირებს დოკუმენტს, სანამ თქვენ აკეთებდით იგივეს. 
+
+ყურადღებით დააკვირდით ქვემოთ მოყვანილ განსხვავებებს, და გადაწყვიტეთ რომელი ვერსია სჯობს. თუ შენახვას დააჭერთ, თქვენი ვერსია შეინახება.
\ No newline at end of file
diff --git a/inc/lang/ka/denied.txt b/inc/lang/ka/denied.txt
new file mode 100644
index 0000000000000000000000000000000000000000..bb89104729e31229a7a3dde1549483865d2f8e51
--- /dev/null
+++ b/inc/lang/ka/denied.txt
@@ -0,0 +1,3 @@
+====== მიუწვდომელია ======
+
+თქვენ არ გაქვთ საკმარისი უფლებები. იქნებ ავტორიზაცია დაგავიწყდათ?
diff --git a/inc/lang/ka/diff.txt b/inc/lang/ka/diff.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c635e45f41ef4779d39b8c9b79a3737a72e47142
--- /dev/null
+++ b/inc/lang/ka/diff.txt
@@ -0,0 +1,3 @@
+====== განსხვავებები ======
+ქვემოთ მოყვანილაი განსხვავებები მსგავს გვერდებს შორის.
+
diff --git a/inc/lang/ka/draft.txt b/inc/lang/ka/draft.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f3356ddb5387b7c3715d7015ca8a293e1fa19ae3
--- /dev/null
+++ b/inc/lang/ka/draft.txt
@@ -0,0 +1,3 @@
+====== ნაპოვნია ჩანაწერი ======
+
+გვერდის რედაქტირება არ იყო დამთავრებული. 
\ No newline at end of file
diff --git a/inc/lang/ka/edit.txt b/inc/lang/ka/edit.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3fffceb0c13846ed71ec8aa00981fc2a455bd20f
--- /dev/null
+++ b/inc/lang/ka/edit.txt
@@ -0,0 +1,2 @@
+დაარედაქტირეთ გვერდი და დააჭირეთ «შენახვას». წაიკითხეთ [[wiki:syntax|FAQ]] ვიკის სინტაქსისთან გასაცნობად. დაარედაქტირეთ გვერდი მხოლოდ იმ შემთხვევაში თუ აპირებთ გვერდის გაუმჯობესებას. თუ თქვენ რამის დატესტვა გინდათ, გამოიყენეთ სპეციალური გვერდი.
+
diff --git a/inc/lang/ka/editrev.txt b/inc/lang/ka/editrev.txt
new file mode 100644
index 0000000000000000000000000000000000000000..17ccff57f1e7f8ac6de51e1fbac125ae760371c7
--- /dev/null
+++ b/inc/lang/ka/editrev.txt
@@ -0,0 +1,2 @@
+**თქვენ ატვირთეთ დოკუმენტის ძველი ვერსია** მისი შენახვით თქვენ შექმნით ახალ ვერსიას იგივე შიგთავსით.
+----
diff --git a/inc/lang/ka/index.txt b/inc/lang/ka/index.txt
new file mode 100644
index 0000000000000000000000000000000000000000..7daef7fb66617e92d5e4f875d8708901e21af018
--- /dev/null
+++ b/inc/lang/ka/index.txt
@@ -0,0 +1 @@
+====== სტატიები ====== აქ ნაჩვენებია ყველა სტატია
\ No newline at end of file
diff --git a/inc/lang/ka/lang.php b/inc/lang/ka/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..28ca11e454d949ee8a99d0e7107911d65c5ae245
--- /dev/null
+++ b/inc/lang/ka/lang.php
@@ -0,0 +1,326 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Luka Lejava <luka.lejava@gmail.com>
+ */
+$lang['encoding']              = 'utf-8';
+$lang['direction']             = 'ltr';
+$lang['doublequoteopening']    = '“';
+$lang['doublequoteclosing']    = '”';
+$lang['singlequoteopening']    = '‘';
+$lang['singlequoteclosing']    = '’';
+$lang['apostrophe']            = '’';
+$lang['btn_edit']              = 'დაარედაქტირეთ ეს გვერდი';
+$lang['btn_source']            = 'მაჩვენე გვერდის კოდი';
+$lang['btn_show']              = 'გვერდის ჩვენება';
+$lang['btn_create']            = 'გვერდის შექმნა';
+$lang['btn_search']            = 'ძიება';
+$lang['btn_save']              = 'შენახვა';
+$lang['btn_preview']           = 'ჩვენება';
+$lang['btn_top']               = 'მაღლა';
+$lang['btn_newer']             = '<<  მეტი ';
+$lang['btn_older']             = 'ნაკლები  >>';
+$lang['btn_revs']              = 'ძველი ვერსიები';
+$lang['btn_recent']            = 'ბოლო ცვლილებები';
+$lang['btn_upload']            = 'ატვირთვა';
+$lang['btn_cancel']            = 'შეწყვეტა';
+$lang['btn_index']             = 'სტატიები';
+$lang['btn_secedit']           = 'რედაქტირება';
+$lang['btn_login']             = 'შესვლა';
+$lang['btn_logout']            = 'გამოსვლა';
+$lang['btn_admin']             = 'ადმინი';
+$lang['btn_update']            = 'განახლება';
+$lang['btn_delete']            = 'წაშლა';
+$lang['btn_back']              = 'უკან';
+$lang['btn_backlink']          = 'გადმომისამართებული ბმულები';
+$lang['btn_backtomedia']       = 'მედიაფაილების არჩევა';
+$lang['btn_subscribe']         = 'Manage Subscriptions';
+$lang['btn_profile']           = 'პროფილის განახლება';
+$lang['btn_reset']             = 'წაშლა';
+$lang['btn_resendpwd']         = 'ახალი პაროლის დაყენება';
+$lang['btn_draft']             = 'ჩანაწერის წაშლა';
+$lang['btn_recover']           = 'ჩანაწერის აღდგენა';
+$lang['btn_draftdel']          = 'ჩანაწერის წაშლა';
+$lang['btn_revert']            = 'აღდგენა';
+$lang['btn_register']          = 'რეგისტრაცია';
+$lang['btn_apply']             = 'ცადე';
+$lang['btn_media']             = 'მედია ფაილების მართვა';
+$lang['btn_deleteuser']        = 'ჩემი ექაუნთის წაშლა';
+$lang['btn_img_backto']        = 'უკან %';
+$lang['btn_mediaManager']      = 'მედია ფაილების მმართველში გახსნა';
+$lang['loggedinas']            = 'შესული ხართ როგორც:';
+$lang['user']                  = 'ლოგინი';
+$lang['pass']                  = 'პაროლი';
+$lang['newpass']               = 'ახალი პაროლი';
+$lang['oldpass']               = 'დაადასტურეთ პაროლი';
+$lang['passchk']               = 'კიდევ ერთხელ';
+$lang['remember']              = 'დამიმახსოვრე';
+$lang['fullname']              = 'ნამდვილი სახელი';
+$lang['email']                 = 'ფოსტა';
+$lang['profile']               = 'მომხმარებლის პროფილი';
+$lang['badlogin']              = 'ლოგინი ან პაროლი არასწორია';
+$lang['badpassconfirm']        = 'პაროლი არასწორია';
+$lang['minoredit']             = 'ცვლილებები';
+$lang['draftdate']             = 'ჩანაწერების ავტომატური შენახვა ჩართულია';
+$lang['nosecedit']             = 'გვერდს ვადა გაუვიდა';
+$lang['regmissing']            = 'ყველა ველი შეავსეთ';
+$lang['reguexists']            = 'მსგავსი ლოგინი უკვე არსებობს';
+$lang['regsuccess']            = 'მომხმარებელი შექმნილია, პაროლი გამოგზავნილია';
+$lang['regsuccess2']           = 'მომხმარებელი შექმნილია';
+$lang['regmailfail']           = 'დაფიქსირდა შეცდომა';
+$lang['regbadmail']            = 'ფოსტა არასწორია';
+$lang['regbadpass']            = 'პაროლი განსხვავებულია';
+$lang['regpwmail']             = 'თვენი DokuWiki პაროლი';
+$lang['reghere']               = 'დარეგისტრირდი';
+$lang['profna']                = 'არ შეგიძლიათ პროფილის რედაქტირება';
+$lang['profnochange']          = 'ცვლილებები არ არის';
+$lang['profnoempty']           = 'ცარიელი სახელი ან ფოსტა დაუშვებელია';
+$lang['profchanged']           = 'პროფილი განახლდა';
+$lang['profnodelete']          = 'მომხმარებლის წაშლა შეუძლებელია';
+$lang['profdeleteuser']        = 'პროფილის წაშლა';
+$lang['profdeleted']           = 'პროფილი წაიშალა';
+$lang['profconfdelete']        = 'მე მსურს პროფილის წაშლა. <br/> თქვენ აღარ გექნებათ საშუალება აღადგინოთ პროფილი.';
+$lang['profconfdeletemissing'] = 'დადასტურების ველი ცარიელია';
+$lang['pwdforget']             = 'დაგავიწყდა პაროლი? აღადგინე';
+$lang['resendna']              = 'პაროლის აღდგენა შეუძლებელია';
+$lang['resendpwd']             = 'ახალი პაროლი';
+$lang['resendpwdmissing']      = 'უნდა შეავსოთ ყველა ველი';
+$lang['resendpwdnouser']       = 'მსგავსი ლოგინი დარეგისტრირებული არ არის';
+$lang['resendpwdbadauth']      = 'კოდი არასწორია';
+$lang['resendpwdconfirm']      = 'აღსადგენი ბმული გამოგზავნილია';
+$lang['resendpwdsuccess']      = 'ახალი პაროლი გამოგზავნილია';
+$lang['license']               = 'ვიკი ლიცენზირებულია: ';
+$lang['licenseok']             = 'ამ გვერდის რედაქტირებით თვენ ეთანხმებით ლიცენზიას:';
+$lang['searchmedia']           = 'საძებო სახელი:';
+$lang['searchmedia_in']        = 'ძებნა %-ში';
+$lang['txt_upload']            = 'აირჩიეთ ასატვირთი ფაილი:';
+$lang['txt_filename']          = 'ატვირთვა როგორც (არჩევითი):';
+$lang['txt_overwrt']           = 'გადაწერა ზემოდან';
+$lang['maxuploadsize']         = 'მაქსიმალური ზომა %';
+$lang['lockedby']              = 'დაბლოკილია:';
+$lang['lockexpire']            = 'განიბლოკება:';
+$lang['js']['willexpire']      = 'გვერდი განიბლოკება 1 წუთში';
+$lang['js']['notsavedyet']     = 'შეუნახავი მონაცემები წაიშლება';
+$lang['js']['searchmedia']     = 'ძებნა';
+$lang['js']['keepopen']        = 'დატოვეთ ღია';
+$lang['js']['hidedetails']     = 'დეტალების დამალვა';
+$lang['js']['mediatitle']      = 'ინსტრუმენტები';
+$lang['js']['mediadisplay']    = 'ბმულის ტიპი';
+$lang['js']['mediaalign']      = 'Alignment';
+$lang['js']['mediasize']       = 'სურათის ზომა';
+$lang['js']['mediatarget']     = 'მიზნის ბმული';
+$lang['js']['mediaclose']      = 'დახურვა';
+$lang['js']['mediainsert']     = 'ჩასმა';
+$lang['js']['mediadisplayimg'] = 'სურათის ნახვა';
+$lang['js']['mediadisplaylnk'] = 'მაჩვენე მხოლოდ ბმული';
+$lang['js']['mediasmall']      = 'მცირე ვერსია';
+$lang['js']['mediamedium']     = 'საშუალო ვერსია';
+$lang['js']['medialarge']      = 'ვრცელი ვერსია';
+$lang['js']['mediaoriginal']   = 'ორიგინალი ვერსია';
+$lang['js']['medialnk']        = 'დაწვრილებით';
+$lang['js']['mediadirect']     = 'ორიგინალი';
+$lang['js']['medianolnk']      = 'ბმული არ არის';
+$lang['js']['medianolink']     = 'არ დალინკოთ სურათი';
+$lang['js']['medialeft']       = 'მარცხვნივ განათავსეთ სურათი';
+$lang['js']['mediaright']      = 'მარჯვნივ განათავსეთ სურათი';
+$lang['js']['mediacenter']     = 'შუაში განათავსეთ სურათი';
+$lang['js']['medianoalign']    = 'Use no align.';
+$lang['js']['nosmblinks']      = 'ეს ფუქნცია მუშაობს მხოლოდ  Internet Explorer-ზე';
+$lang['js']['linkwiz']         = 'ბმული';
+$lang['js']['linkto']          = 'ბმული';
+$lang['js']['del_confirm']     = 'დარწმუნებული ხართ რომ წაშლა გინდათ?';
+$lang['js']['restore_confirm'] = 'დარწმუნებული ხართ რომ აღდგენა გინდათ?';
+$lang['js']['media_diff']      = 'განსხვავებების ჩვენება';
+$lang['js']['media_diff_both'] = 'გვერდიგვერდ';
+$lang['js']['media_diff_opacity'] = 'Shine-through';
+$lang['js']['media_diff_portions'] = 'Swipe
+';
+$lang['js']['media_select']    = 'არჩეული ფაილები';
+$lang['js']['media_upload_btn'] = 'ატვირთვა';
+$lang['js']['media_done_btn']  = 'მზადაა';
+$lang['js']['media_drop']      = 'ჩაყარეთ ასატვირთი ფაილები';
+$lang['js']['media_cancel']    = 'წაშლა';
+$lang['js']['media_overwrt']   = 'გადაწერა ზემოდან';
+$lang['rssfailed']             = 'დაფიქსირდა შეცდომა:';
+$lang['nothingfound']          = 'ნაპოვნი არ არის';
+$lang['mediaselect']           = 'მედია ფაილები';
+$lang['fileupload']            = 'მედია ფაილების ატვირთვა';
+$lang['uploadsucc']            = 'ატვირთვა დასრულებულია';
+$lang['uploadfail']            = 'შეფერხება ატვირთვისას';
+$lang['uploadwrong']           = 'ატვირთვა შეუძლებელია';
+$lang['uploadexist']           = 'ფაილი უკვე არსებობს';
+$lang['uploadbadcontent']      = 'ატვირთული ფაილები არ ემთხვევა ';
+$lang['uploadspam']            = 'ატვირთვა დაბლოკილია სპამბლოკერის მიერ';
+$lang['uploadxss']             = 'ატვირთვა დაბლოკილია';
+$lang['uploadsize']            = 'ასატვირთი ფაილი ზედმეტად დიდია';
+$lang['deletesucc']            = '% ფაილები წაიშალა';
+$lang['deletefail']            = '% ვერ მოიძებნა';
+$lang['mediainuse']            = 'ფაილის % ვერ წაიშალა, რადგან გამოყენებაშია';
+$lang['namespaces']            = 'Namespaces';
+$lang['mediafiles']            = 'არსებული ფაილები';
+$lang['accessdenied']          = 'თქვენ არ შეგიძლიათ გვერდის ნახვა';
+$lang['mediausage']            = 'Use the following syntax to reference this file:';
+$lang['mediaview']             = 'ორიგინალი ფაილის ჩვენება';
+$lang['mediaroot']             = 'root';
+$lang['mediaupload']           = 'Upload a file to the current namespace here. To create subnamespaces, prepend them to your filename separated by colons after you selected the files. Files can also be selected by drag and drop.';
+$lang['mediaextchange']        = 'Filextension changed from .%s to .%s!';
+$lang['reference']             = 'References for';
+$lang['ref_inuse']             = 'ფაილი წაშლა შეუძლებელია, გამოიყენება აქ:';
+$lang['ref_hidden']            = 'ზოგიერთი ბლოკის წაკითხვის უფლება არ გაქვთ';
+$lang['hits']                  = 'Hits';
+$lang['quickhits']             = 'მსგავსი სახელები';
+$lang['toc']                   = 'Table of Contents';
+$lang['current']               = 'ახლანდელი';
+$lang['yours']                 = 'თვენი ვერსია';
+$lang['diff']                  = 'ვერსიების განსხვავება';
+$lang['diff2']                 = 'განსხვავებები';
+$lang['difflink']              = 'Link to this comparison view';
+$lang['diff_type']             = 'განსხვავებების ჩვენება';
+$lang['diff_inline']           = 'Inline';
+$lang['diff_side']             = 'გვერდიგვერდ';
+$lang['diffprevrev']           = 'წინა ვერსია';
+$lang['diffnextrev']           = 'შემდეგი ვერსია';
+$lang['difflastrev']           = 'ბოლო ვერსია';
+$lang['diffbothprevrev']       = 'Both sides previous revision';
+$lang['diffbothnextrev']       = 'Both sides next revision';
+$lang['line']                  = 'ზოლი';
+$lang['breadcrumb']            = 'Trace:';
+$lang['youarehere']            = 'თვენ ხართ აქ:';
+$lang['lastmod']               = 'ბოლოს მოდიფიცირებული:';
+$lang['deleted']               = 'წაშლილია';
+$lang['created']               = 'შექმნილია';
+$lang['restored']              = 'ძველი ვერსია აღდგენილია %';
+$lang['external_edit']         = 'რედაქტირება';
+$lang['summary']               = 'Edit summary';
+$lang['noflash']               = '<a href="http://www.adobe.com/products/flashplayer/">საჭიროა Adobe Flash Plugin</a>';
+$lang['download']              = 'Snippet-ის გადმოწერა';
+$lang['tools']                 = 'ინსტრუმენტები';
+$lang['user_tools']            = 'მომხმარებლის ინსტრუმენტები';
+$lang['site_tools']            = 'საიტის ინსტრუმენტები';
+$lang['page_tools']            = 'გვერდის ინსტრუმენტები';
+$lang['skip_to_content']       = 'მასალა';
+$lang['sidebar']               = 'გვერდითი პანელი';
+$lang['mail_newpage']          = 'გვერდი დამატებულია:';
+$lang['mail_changed']          = 'გვერდი შეცვლილია:';
+$lang['mail_subscribe_list']   = 'გვერდში შეცვლილია namespace-ები:';
+$lang['mail_new_user']         = 'ახალი მომხმარებელი';
+$lang['mail_upload']           = 'ფაილი ატვირთულია';
+$lang['changes_type']          = 'ცვლილებები';
+$lang['pages_changes']         = 'გვერდები';
+$lang['media_changes']         = 'მედია ფაილები';
+$lang['both_changes']          = 'გვერდები და მედია ფაილები';
+$lang['qb_bold']               = 'Bold Text';
+$lang['qb_italic']             = 'Italic Text';
+$lang['qb_underl']             = 'Underlined Text';
+$lang['qb_code']               = 'Monospaced Text';
+$lang['qb_strike']             = 'Strike-through Text';
+$lang['qb_h1']                 = 'Level 1 სათაური';
+$lang['qb_h2']                 = 'Level 2 სათაური';
+$lang['qb_h3']                 = 'Level 3 სათაური';
+$lang['qb_h4']                 = 'Level 4 სათაური';
+$lang['qb_h5']                 = 'Level 5 სათაური';
+$lang['qb_h']                  = 'სათაური';
+$lang['qb_hs']                 = 'სათაურის არჩევა';
+$lang['qb_hplus']              = 'Higher სათაური';
+$lang['qb_hminus']             = 'Lower სათაური';
+$lang['qb_hequal']             = 'Same Level სათაური';
+$lang['qb_link']               = 'Internal Link';
+$lang['qb_extlink']            = 'External Link';
+$lang['qb_hr']                 = 'Horizontal Rule';
+$lang['qb_ol']                 = 'შეკვეთილი ბოლო მასალა';
+$lang['qb_ul']                 = 'Unordered List Item';
+$lang['qb_media']              = 'ნახატების და სხვა ფაიელბის დამატება';
+$lang['qb_sig']                = 'ხელმოწერა';
+$lang['qb_smileys']            = 'სმაილები';
+$lang['qb_chars']              = 'Special Chars';
+$lang['upperns']               = 'jump to parent namespace';
+$lang['admin_register']        = 'ახალი მომხმარებლის დამატება';
+$lang['metaedit']              = 'Edit Metadata';
+$lang['metasaveerr']           = 'Writing metadata failed';
+$lang['metasaveok']            = 'Metadata saved';
+$lang['img_title']             = 'სათაური:';
+$lang['img_caption']           = 'Caption:';
+$lang['img_date']              = 'თარიღი:';
+$lang['img_fname']             = 'ფაილის სახელი:';
+$lang['img_fsize']             = 'ზომა:';
+$lang['img_artist']            = 'ფოტოგრაფი:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'ფორმატი:';
+$lang['img_camera']            = 'კამერა:';
+$lang['img_keywords']          = 'Keywords:';
+$lang['img_width']             = 'სიგანე:';
+$lang['img_height']            = 'სიმაღლე:';
+$lang['subscr_subscribe_success'] = 'Added %s to subscription list for %s';
+$lang['subscr_subscribe_error'] = 'Error adding %s to subscription list for %s';
+$lang['subscr_subscribe_noaddress'] = 'There is no address associated with your login, you cannot be added to the subscription list';
+$lang['subscr_unsubscribe_success'] = 'Removed %s from subscription list for %s';
+$lang['subscr_unsubscribe_error'] = 'Error removing %s from subscription list for %s';
+$lang['subscr_already_subscribed'] = '%s is already subscribed to %s';
+$lang['subscr_not_subscribed'] = '%s is not subscribed to %s';
+$lang['subscr_m_not_subscribed'] = 'You are currently not subscribed to the current page or namespace.';
+$lang['subscr_m_new_header']   = 'Add subscription';
+$lang['subscr_m_current_header'] = 'Current subscriptions';
+$lang['subscr_m_unsubscribe']  = 'Unsubscribe';
+$lang['subscr_m_subscribe']    = 'Subscribe';
+$lang['subscr_m_receive']      = 'მიღება';
+$lang['subscr_style_every']    = 'ფოსტა ყოველ ცვლილებაზე';
+$lang['subscr_style_digest']   = 'ფოსტა ყოველი გვერდის შეცვლაზე ';
+$lang['subscr_style_list']     = 'ფოსტა ყოველი გვერდის შეცვლაზე ';
+$lang['authtempfail']          = 'User authentication is temporarily unavailable. If this situation persists, please inform your Wiki Admin.';
+$lang['authpwdexpire']         = 'თქვენს პაროლს ვადა გაუვა %d დღეში, მალე შეცვლა მოგიწევთ.';
+$lang['i_chooselang']          = 'ენსი არჩევა';
+$lang['i_installer']           = 'DokuWiki დამყენებელი';
+$lang['i_wikiname']            = 'Wiki სახელი';
+$lang['i_enableacl']           = 'Enable ACL (recommended)';
+$lang['i_superuser']           = 'ადმინი';
+$lang['i_problems']            = 'შეასწორეთ შეცდომები';
+$lang['i_modified']            = 'For security reasons this script will only work with a new and unmodified Dokuwiki installation. You should either re-extract the files from the downloaded package or consult the complete <a href="http://dokuwiki.org/install">Dokuwiki installation instructions</a>';
+$lang['i_funcna']              = 'PHP function <code>%s</code> is not available. Maybe your hosting provider disabled it for some reason?';
+$lang['i_phpver']              = 'Your PHP version <code>%s</code> is lower than the needed <code>%s</code>. You need to upgrade your PHP install.';
+$lang['i_permfail']            = '<code>%s</code> is not writable by DokuWiki. You need to fix the permission settings of this directory!';
+$lang['i_confexists']          = '<code>%s</code> already exists';
+$lang['i_writeerr']            = 'Unable to create <code>%s</code>. You will need to check directory/file permissions and create the file manually.';
+$lang['i_badhash']             = 'unrecognised or modified dokuwiki.php (hash=<code>%s</code>)';
+$lang['i_badval']              = '<code>%s</code> - illegal or empty value';
+$lang['i_failure']             = 'Some errors occurred while writing the configuration files. You may need to fix them manually before you can use <a href="doku.php?id=wiki:welcome">your new DokuWiki</a>.';
+$lang['i_policy']              = 'Initial ACL policy';
+$lang['i_pol0']                = 'ღია ვიკი (წაკითხვა, დაწერა და ატვირთვა შეუძლია ნებისმიერს)';
+$lang['i_pol1']                = 'თავისუფალი ვიკი (წაკითხვა შეუძლია ყველას, დაწერა და ატვირთვა - რეგისტრირებულს)';
+$lang['i_pol2']                = 'დახურული ვიკი (წაკითხვა, დაწერა და ატვირთვა შეუძლიათ მხოლოდ რეგისტრირებულებს)';
+$lang['i_allowreg']            = 'რეგისტრაციის გახსნა';
+$lang['i_retry']               = 'თავიდან ცდა';
+$lang['i_license']             = 'აირჩიეთ ლიცენზია';
+$lang['i_license_none']        = 'არ აჩვენოთ ლიცენზიის ინფორმაცია';
+$lang['i_pop_field']           = 'დაგვეხმარეთ DokuWiki-ს აგუმჯობესებაში';
+$lang['i_pop_label']           = 'თვეში ერთელ ინფორმაციის DokuWiki-ის ადმინისტრაციისთვის გაგზავნა';
+$lang['recent_global']         = 'You\'re currently watching the changes inside the <b>%s</b> namespace. You can also <a href="%s">view the recent changes of the whole wiki</a>.';
+$lang['years']                 = '%d წლის უკან';
+$lang['months']                = '%d თვის უკან';
+$lang['weeks']                 = '%d კვირის უკან';
+$lang['days']                  = '%d დღის წინ';
+$lang['hours']                 = '%d საათის წინ';
+$lang['minutes']               = '%d წუთის წინ';
+$lang['seconds']               = '%d წამის წინ';
+$lang['wordblock']             = 'თქვენი ცვლილებები არ შეინახა, რადგან შეიცავს სპამს';
+$lang['media_uploadtab']       = 'ატვირთვა';
+$lang['media_searchtab']       = 'ძებნა';
+$lang['media_file']            = 'ფაილი';
+$lang['media_viewtab']         = 'ჩვენება';
+$lang['media_edittab']         = 'რედაქტირება';
+$lang['media_historytab']      = 'ისტორია';
+$lang['media_list_thumbs']     = 'Thumbnails';
+$lang['media_list_rows']       = 'Rows';
+$lang['media_sort_name']       = 'სახელი';
+$lang['media_sort_date']       = 'თარიღი';
+$lang['media_namespaces']      = 'Choose namespace';
+$lang['media_files']           = 'ფაილები %s';
+$lang['media_upload']          = 'ატვირთვა %s';
+$lang['media_search']          = 'ძებნა %s';
+$lang['media_view']            = '%s';
+$lang['media_viewold']         = '%s at %s';
+$lang['media_edit']            = 'რედაქტირება %s';
+$lang['media_history']         = 'ისტორია %s';
+$lang['media_meta_edited']     = 'metadata edited';
+$lang['media_perm_read']       = 'თვენ არ გაქვთ უფლება წაიკითხოთ ეს მასალა';
diff --git a/inc/lang/kk/jquery.ui.datepicker.js b/inc/lang/kk/jquery.ui.datepicker.js
index dcd6a65df72e7fac57694f015950e404cc856e2e..e85fd8354a599e2a7dc37108d7730fbec52adbd5 100644
--- a/inc/lang/kk/jquery.ui.datepicker.js
+++ b/inc/lang/kk/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Kazakh (UTF-8) initialisation for the jQuery UI date picker plugin. */
 /* Written by Dmitriy Karasyov (dmitriy.karasyov@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['kk'] = {
-		closeText: 'Жабу',
-		prevText: '&#x3C;Алдыңғы',
-		nextText: 'Келесі&#x3E;',
-		currentText: 'Бүгін',
-		monthNames: ['Қаңтар','Ақпан','Наурыз','Сәуір','Мамыр','Маусым',
-		'Шілде','Тамыз','Қыркүйек','Қазан','Қараша','Желтоқсан'],
-		monthNamesShort: ['Қаң','Ақп','Нау','Сәу','Мам','Мау',
-		'Шіл','Там','Қыр','Қаз','Қар','Жел'],
-		dayNames: ['Жексенбі','Дүйсенбі','Сейсенбі','Сәрсенбі','Бейсенбі','Жұма','Сенбі'],
-		dayNamesShort: ['жкс','дсн','ссн','срс','бсн','жма','снб'],
-		dayNamesMin: ['Жк','Дс','Сс','Ср','Бс','Жм','Сн'],
-		weekHeader: 'Не',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['kk']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['kk'] = {
+	closeText: 'Жабу',
+	prevText: '&#x3C;Алдыңғы',
+	nextText: 'Келесі&#x3E;',
+	currentText: 'Бүгін',
+	monthNames: ['Қаңтар','Ақпан','Наурыз','Сәуір','Мамыр','Маусым',
+	'Шілде','Тамыз','Қыркүйек','Қазан','Қараша','Желтоқсан'],
+	monthNamesShort: ['Қаң','Ақп','Нау','Сәу','Мам','Мау',
+	'Шіл','Там','Қыр','Қаз','Қар','Жел'],
+	dayNames: ['Жексенбі','Дүйсенбі','Сейсенбі','Сәрсенбі','Бейсенбі','Жұма','Сенбі'],
+	dayNamesShort: ['жкс','дсн','ссн','срс','бсн','жма','снб'],
+	dayNamesMin: ['Жк','Дс','Сс','Ср','Бс','Жм','Сн'],
+	weekHeader: 'Не',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['kk']);
+
+return datepicker.regional['kk'];
+
+}));
diff --git a/inc/lang/kk/lang.php b/inc/lang/kk/lang.php
index 4b111b11873e84ad02335fb80a555743cb2985ea..74afa24e5d4611e3a5bd91b0a8bf49a23010fcfc 100644
--- a/inc/lang/kk/lang.php
+++ b/inc/lang/kk/lang.php
@@ -45,7 +45,7 @@ $lang['btn_draftdel']          = 'Шимайды өшіру';
 $lang['btn_revert']            = 'Қалпына келтіру';
 $lang['btn_register']          = 'Тіркеу';
 $lang['btn_apply']             = 'Қолдану/Енгізу';
-$lang['loggedinas']            = 'түпнұсқамен кірген';
+$lang['loggedinas']            = 'түпнұсқамен кірген:';
 $lang['user']                  = 'Түпнұсқа';
 $lang['pass']                  = 'Құпиясөз';
 $lang['newpass']               = 'Жаңа құпиясөз';
@@ -83,11 +83,11 @@ $lang['license']               = 'Басқаша көрсетілген болм
 $lang['licenseok']             = 'Ескерту: бұл бетті өңдеуіңізбен мазмұныңыз келесі лицензия бойынша беруге келесесіз:';
 $lang['searchmedia']           = 'Іздеу файлдың атауы:';
 $lang['searchmedia_in']        = '%s-мен іздеу:';
-$lang['txt_upload']            = 'Еңгізетін файлды таңдау';
-$lang['txt_filename']          = 'Келесідей еңгізу (қалауынша)';
+$lang['txt_upload']            = 'Еңгізетін файлды таңдау:';
+$lang['txt_filename']          = 'Келесідей еңгізу (қалауынша):';
 $lang['txt_overwrt']           = 'Бар файлды қайта жазу';
-$lang['lockedby']              = 'Осы уақытта тойтарылған';
-$lang['lockexpire']            = 'Тойтару келесі уақытта бітеді';
+$lang['lockedby']              = 'Осы уақытта тойтарылған:';
+$lang['lockexpire']            = 'Тойтару келесі уақытта бітеді:';
 $lang['js']['willexpire']      = 'Бұл бетті түзеу тойтаруыңыз бір минутта бітеді. Қақтығыс болмау және тойтару таймерді түсіру үшін қарап шығу пернені басыңыз.';
 $lang['js']['notsavedyet']     = 'Сақталмаған өзгерістер жоғалатын болады.';
 $lang['js']['searchmedia']     = 'Файлдарды іздеу';
@@ -124,7 +124,7 @@ $lang['created']               = 'ЖасалFан';
 $lang['mail_new_user']         = 'Жаңа пайдаланушы';
 $lang['qb_chars']              = 'Арнайы белгiлер';
 $lang['btn_img_backto']            = 'Қайта оралу %s';
-$lang['img_format']            = 'Формат';
-$lang['img_camera']            = 'Камера';
+$lang['img_format']            = 'Формат:';
+$lang['img_camera']            = 'Камера:';
 $lang['i_chooselang']          = 'Тіл таңдау';
 $lang['i_retry']               = 'Қайталау';
diff --git a/inc/lang/km/jquery.ui.datepicker.js b/inc/lang/km/jquery.ui.datepicker.js
index f9c4e3a02d92a330c603f8e1dffe0c965769c5fb..599a4771393ae2f5dd48a380515945da920787da 100644
--- a/inc/lang/km/jquery.ui.datepicker.js
+++ b/inc/lang/km/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Khmer initialisation for the jQuery calendar extension. */
 /* Written by Chandara Om (chandara.teacher@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['km'] = {
-		closeText: 'ធ្វើ​រួច',
-		prevText: 'មុន',
-		nextText: 'បន្ទាប់',
-		currentText: 'ថ្ងៃ​នេះ',
-		monthNames: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
-		'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
-		monthNamesShort: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
-		'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
-		dayNames: ['អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'],
-		dayNamesShort: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
-		dayNamesMin: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
-		weekHeader: 'សប្ដាហ៍',
-		dateFormat: 'dd-mm-yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['km']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['km'] = {
+	closeText: 'ធ្វើ​រួច',
+	prevText: 'មុន',
+	nextText: 'បន្ទាប់',
+	currentText: 'ថ្ងៃ​នេះ',
+	monthNames: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
+	'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
+	monthNamesShort: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
+	'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
+	dayNames: ['អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'],
+	dayNamesShort: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
+	dayNamesMin: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
+	weekHeader: 'សប្ដាហ៍',
+	dateFormat: 'dd-mm-yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['km']);
+
+return datepicker.regional['km'];
+
+}));
diff --git a/inc/lang/km/lang.php b/inc/lang/km/lang.php
index 9f65ccd163b4b8959caecd21acb1ba44eb8be924..749fa419cf18a38ca10829f73d4500eec49d1073 100644
--- a/inc/lang/km/lang.php
+++ b/inc/lang/km/lang.php
@@ -43,7 +43,7 @@ $lang['btn_recover']  = 'ស្រោះគំរោងឡើង';
 $lang['btn_draftdel'] = 'លុបគំរោង';
 $lang['btn_register'] = 'ចុះឈ្មោះ';//'Register';
 
-$lang['loggedinas'] = 'អ្នកប្រើ';
+$lang['loggedinas'] = 'អ្នកប្រើ:';
 $lang['user']       = 'នាមបម្រើ';
 $lang['pass']       = 'ពាក្សសម្ងត់';
 $lang['newpass']    = 'ពាក្សសម្ងាត់ថ្មី';
@@ -80,11 +80,11 @@ $lang['resendpwdbadauth'] = 'សុំអាទោស​ រហស្សលេ
 $lang['resendpwdconfirm'] ='ខ្សែបន្ត';
 $lang['resendpwdsuccess'] = 'ពាក្សសម្ងាតអ្នកបានផ្ញើហើយ។';
 
-$lang['txt_upload']   = 'ជ្រើសឯកសារដែលរុញ​ឡើង';
-$lang['txt_filename'] = 'រុញឡើងជា (ស្រេច​ចិត្ត)';
+$lang['txt_upload']   = 'ជ្រើសឯកសារដែលរុញ​ឡើង:';
+$lang['txt_filename'] = 'រុញឡើងជា (ស្រេច​ចិត្ត):';
 $lang['txt_overwrt']  = 'កត់ពីលើ';//'Overwrite existing file';
-$lang['lockedby']     = 'ឥឡូវនេះចកជាប់​';
-$lang['lockexpire']   = 'សោជាប់ផុត​កំណត់ម៉ោង';
+$lang['lockedby']     = 'ឥឡូវនេះចកជាប់​:';
+$lang['lockexpire']   = 'សោជាប់ផុត​កំណត់ម៉ោង:';
 $lang['js']['willexpire']   = 'សោអ្នកចំពោះកែតម្រូវទំព័រនេះ ហួសពែលក្នុងមួយនាទី។\nកុំឲ្យមានជម្លោះ ប្រើ «បង្ហាញ»​ ទៅកំណត់​ឡើង​វិញ។';
 
 $lang['js']['notsavedyet'] = 'កម្រែមិនទានរុក្សាទកត្រូវបោះបង់។\nបន្តទៅទាឬទេ?';
@@ -125,9 +125,9 @@ $lang['current']    = 'ឥឡៅវ';
 $lang['yours']      = 'តំណែអ្នាក';
 $lang['diff']       = 'បង្ហាងអសទិសភាពជាមួយតំណែឥឡូវ ';
 $lang['line']       = 'ខ្សែ';
-$lang['breadcrumb'] = 'ដាន';
-$lang['youarehere'] = 'ដាន';
-$lang['lastmod']    = 'ពេលកែចុងក្រោយ';
+$lang['breadcrumb'] = 'ដាន:';
+$lang['youarehere'] = 'ដាន:';
+$lang['lastmod']    = 'ពេលកែចុងក្រោយ:';
 $lang['by']         = 'និពន្ឋដោយ';
 $lang['deleted']    = 'យកចេញ';
 $lang['created']    = 'បង្កើត';
@@ -166,16 +166,16 @@ $lang['metaedit']    = 'កែទិន្នន័យអរូប';//'Edit Meta
 $lang['metasaveerr'] = 'ពំអាចកត់រទិន្នន័យអរូប';//'Writing metadata failed';
 $lang['metasaveok']  = 'ទិន្នន័យអរូប';
 $lang['btn_img_backto']  = 'ថយក្រោយ%s';
-$lang['img_title']   = 'អភិធេយ្យ';
-$lang['img_caption'] = 'ចំណងជើង';
-$lang['img_date']    = 'ថ្ងៃខែ';//'Date';
-$lang['img_fname']   = 'ឈ្មោះឯកសារ';
-$lang['img_fsize']   = 'ទំហំ';//'Size';
-$lang['img_artist']  = 'អ្នកថតរូប';
-$lang['img_copyr']   = 'រក្សា​សិទ្ធិ';
-$lang['img_format']  = 'ធុនប្រភេទ';
-$lang['img_camera']  = 'គ្រឿងថត';
-$lang['img_keywords']= 'មេពាក្ស';//'Keywords';
+$lang['img_title']   = 'អភិធេយ្យ:';
+$lang['img_caption'] = 'ចំណងជើង:';
+$lang['img_date']    = 'ថ្ងៃខែ:';//'Date';
+$lang['img_fname']   = 'ឈ្មោះឯកសារ:';
+$lang['img_fsize']   = 'ទំហំ:';//'Size';
+$lang['img_artist']  = 'អ្នកថតរូប:';
+$lang['img_copyr']   = 'រក្សា​សិទ្ធិ:';
+$lang['img_format']  = 'ធុនប្រភេទ:';
+$lang['img_camera']  = 'គ្រឿងថត:';
+$lang['img_keywords']= 'មេពាក្ស:';//'Keywords';
 
 /* auth.class language support */
 $lang['authtempfail']    = 'ការផ្ទៀងផ្ទាត់​ភាព​​ត្រឹមត្រូវឥតដំនេ។ ប្រើ ....';
diff --git a/inc/lang/ko/jquery.ui.datepicker.js b/inc/lang/ko/jquery.ui.datepicker.js
index af36f3d6b94496ee2397742098f7217bb1751694..991b5727e02d8f630c08b23f91e10a9a29ad9287 100644
--- a/inc/lang/ko/jquery.ui.datepicker.js
+++ b/inc/lang/ko/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Korean initialisation for the jQuery calendar extension. */
 /* Written by DaeKwon Kang (ncrash.dk@gmail.com), Edited by Genie. */
-jQuery(function($){
-	$.datepicker.regional['ko'] = {
-		closeText: '닫기',
-		prevText: '이전달',
-		nextText: '다음달',
-		currentText: '오늘',
-		monthNames: ['1ì›”','2ì›”','3ì›”','4ì›”','5ì›”','6ì›”',
-		'7ì›”','8ì›”','9ì›”','10ì›”','11ì›”','12ì›”'],
-		monthNamesShort: ['1ì›”','2ì›”','3ì›”','4ì›”','5ì›”','6ì›”',
-		'7ì›”','8ì›”','9ì›”','10ì›”','11ì›”','12ì›”'],
-		dayNames: ['일요일','월요일','화요일','수요일','목요일','금요일','토요일'],
-		dayNamesShort: ['일','월','화','수','목','금','토'],
-		dayNamesMin: ['일','월','화','수','목','금','토'],
-		weekHeader: 'Wk',
-		dateFormat: 'yy-mm-dd',
-		firstDay: 0,
-		isRTL: false,
-		showMonthAfterYear: true,
-		yearSuffix: 'ë…„'};
-	$.datepicker.setDefaults($.datepicker.regional['ko']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['ko'] = {
+	closeText: '닫기',
+	prevText: '이전달',
+	nextText: '다음달',
+	currentText: '오늘',
+	monthNames: ['1ì›”','2ì›”','3ì›”','4ì›”','5ì›”','6ì›”',
+	'7ì›”','8ì›”','9ì›”','10ì›”','11ì›”','12ì›”'],
+	monthNamesShort: ['1ì›”','2ì›”','3ì›”','4ì›”','5ì›”','6ì›”',
+	'7ì›”','8ì›”','9ì›”','10ì›”','11ì›”','12ì›”'],
+	dayNames: ['일요일','월요일','화요일','수요일','목요일','금요일','토요일'],
+	dayNamesShort: ['일','월','화','수','목','금','토'],
+	dayNamesMin: ['일','월','화','수','목','금','토'],
+	weekHeader: 'Wk',
+	dateFormat: 'yy-mm-dd',
+	firstDay: 0,
+	isRTL: false,
+	showMonthAfterYear: true,
+	yearSuffix: 'ë…„'};
+datepicker.setDefaults(datepicker.regional['ko']);
+
+return datepicker.regional['ko'];
+
+}));
diff --git a/inc/lang/ko/lang.php b/inc/lang/ko/lang.php
index 3a49dda7ad2796f7be860e0faf93a46ff569b3db..ff5e66d9b1b8584d28e899af07cc7913301eeeb9 100644
--- a/inc/lang/ko/lang.php
+++ b/inc/lang/ko/lang.php
@@ -12,6 +12,7 @@
  * @author Myeongjin <aranet100@gmail.com>
  * @author Gerrit Uitslag <klapinklapin@gmail.com>
  * @author Garam <rowain8@gmail.com>
+ * @author Young gon Cha <garmede@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -45,7 +46,7 @@ $lang['btn_back']              = '뒤로';
 $lang['btn_backlink']          = '백링크';
 $lang['btn_backtomedia']       = '미디어 파일 선택으로 돌아가기';
 $lang['btn_subscribe']         = '구독 관리';
-$lang['btn_profile']           = '개인 정보 바꾸기';
+$lang['btn_profile']           = '프로필 바꾸기';
 $lang['btn_reset']             = '재설정';
 $lang['btn_resendpwd']         = '새 비밀번호 설정';
 $lang['btn_draft']             = '초안 편집';
@@ -54,18 +55,20 @@ $lang['btn_draftdel']          = '초안 삭제';
 $lang['btn_revert']            = '되돌리기';
 $lang['btn_register']          = '등록';
 $lang['btn_apply']             = '적용';
-$lang['btn_media']             = '미디어 관리';
+$lang['btn_media']             = '미디어 관리자';
 $lang['btn_deleteuser']        = '내 계정 제거';
-$lang['loggedinas']            = '로그인한 사용자';
+$lang['btn_img_backto']        = '%s(으)로 돌아가기';
+$lang['btn_mediaManager']      = '미디어 관리자에서 보기';
+$lang['loggedinas']            = '로그인한 사용자:';
 $lang['user']                  = '사용자 이름';
 $lang['pass']                  = '비밀번호';
 $lang['newpass']               = '새 비밀번호';
 $lang['oldpass']               = '현재 비밀번호 확인';
-$lang['passchk']               = '비밀번호 다시 확인';
+$lang['passchk']               = '다시 확인';
 $lang['remember']              = '기억하기';
 $lang['fullname']              = '실명';
 $lang['email']                 = '이메일';
-$lang['profile']               = '개인 정보';
+$lang['profile']               = '사용자 프로필';
 $lang['badlogin']              = '죄송하지만 사용자 이름이나 비밀번호가 잘못되었습니다.';
 $lang['badpassconfirm']        = '죄송하지만 비밀번호가 잘못되었습니다';
 $lang['minoredit']             = '사소한 바뀜';
@@ -75,21 +78,21 @@ $lang['regmissing']            = '죄송하지만 모든 필드를 채워야 합
 $lang['reguexists']            = '죄송하지만 같은 이름을 사용하는 사용자가 있습니다.';
 $lang['regsuccess']            = '사용자를 만들었으며 비밀번호는 이메일로 보냈습니다.';
 $lang['regsuccess2']           = '사용자를 만들었습니다.';
-$lang['regmailfail']           = '비밀번호를 이메일로 보내는 동안 오류가 발생했습니다. 관리자에게 문의하세요!';
-$lang['regbadmail']            = '주어진 이메일 주소가 잘못되었습니다 - 오류라고 생각하면 관리자에게 문의하세요';
-$lang['regbadpass']            = '새 비밀번호가 같지 않습니다. 다시 입력하세요.';
+$lang['regmailfail']           = '비밀번호를 이메일로 보내는 동안 오류가 발생했습니다. 관리자에게 문의해주세요!';
+$lang['regbadmail']            = '주어진 이메일 주소가 잘못되었습니다 - 오류라고 생각하면 관리자에게 문의해주세요';
+$lang['regbadpass']            = '두 주어진 비밀번호가 같지 않습니다. 다시 입력하세요.';
 $lang['regpwmail']             = '도쿠위키 비밀번호';
-$lang['reghere']               = '계정이 없나요? 계정을 등록할 수 있습니다';
-$lang['profna']                = '이 위키는 개인 정보 수정을 할 수 없습니다';
+$lang['reghere']               = '계정이 없나요? 계정을 등록하세요';
+$lang['profna']                = '이 위키는 프로필 수정을 할 수 없습니다';
 $lang['profnochange']          = '바뀐 내용이 없습니다.';
-$lang['profnoempty']           = '이름이나 이메일 주소가 비었습니다.';
-$lang['profchanged']           = '개인 정보가 성공적으로 바뀌었습니다.';
+$lang['profnoempty']           = '빈 이름이나 이메일 주소는 허용하지 않습니다.';
+$lang['profchanged']           = '프로필이 성공적으로 바뀌었습니다.';
 $lang['profnodelete']          = '이 위키는 사용자 삭제를 지원하지 않습니다';
 $lang['profdeleteuser']        = '계정 삭제';
 $lang['profdeleted']           = '당신의 사용자 계정이 이 위키에서 삭제되었습니다';
 $lang['profconfdelete']        = '이 위키에서 내 계정을 제거하고 싶습니다. <br/> 이 행동은 되돌릴 수 없습니다.';
 $lang['profconfdeletemissing'] = '선택하지 않은 확인 상자를 확인';
-$lang['pwdforget']             = '비밀번호를 잊으셨나요? 비밀번호를 재설정할 수 있습니다';
+$lang['pwdforget']             = '비밀번호를 잊으셨나요? 비밀번호를 재설정하세요';
 $lang['resendna']              = '이 위키는 비밀번호 재설정을 지원하지 않습니다.';
 $lang['resendpwd']             = '다음으로 새 비밀번호 보내기';
 $lang['resendpwdmissing']      = '죄송하지만 모든 필드를 채워야 합니다.';
@@ -101,19 +104,19 @@ $lang['license']               = '별도로 명시하지 않을 경우, 이 위
 $lang['licenseok']             = '참고: 이 문서를 편집하면 내용은 다음 라이선스에 따라 배포하는 데 동의합니다:';
 $lang['searchmedia']           = '파일 이름 검색:';
 $lang['searchmedia_in']        = '%s에서 검색';
-$lang['txt_upload']            = '올릴 파일 선택';
-$lang['txt_filename']          = '올릴 파일 이름 (선택 사항)';
+$lang['txt_upload']            = '올릴 파일 선택:';
+$lang['txt_filename']          = '올릴 파일 이름 (선택 사항):';
 $lang['txt_overwrt']           = '기존 파일에 덮어쓰기';
 $lang['maxuploadsize']         = '최대 올리기 용량. 파일당 %s입니다.';
-$lang['lockedby']              = '현재 잠겨진 사용자';
-$lang['lockexpire']            = '잠금 해제 시간';
+$lang['lockedby']              = '현재 잠겨진 사용자:';
+$lang['lockexpire']            = '잠금 해제 시간:';
 $lang['js']['willexpire']      = '잠시 후 편집 잠금이 해제됩니다.\n편집 충돌을 피하려면 미리 보기를 눌러 잠금 시간을 다시 설정하세요.';
 $lang['js']['notsavedyet']     = '저장하지 않은 바뀜이 사라집니다.';
 $lang['js']['searchmedia']     = '파일 검색';
-$lang['js']['keepopen']        = '선택할 때 창을 열어 놓기';
+$lang['js']['keepopen']        = '선택할 때 열어 놓은 창을 유지하기';
 $lang['js']['hidedetails']     = '자세한 정보 숨기기';
 $lang['js']['mediatitle']      = '링크 설정';
-$lang['js']['mediadisplay']    = '링크 형태';
+$lang['js']['mediadisplay']    = '링크 유형';
 $lang['js']['mediaalign']      = '배치';
 $lang['js']['mediasize']       = '그림 크기';
 $lang['js']['mediatarget']     = '링크 목표';
@@ -171,7 +174,7 @@ $lang['mediaview']             = '원본 파일 보기';
 $lang['mediaroot']             = '루트';
 $lang['mediaupload']           = '파일을 현재 이름공간으로 올립니다. 하위 이름공간으로 만들려면 선택한 파일 이름 앞에 쌍점(:)으로 구분되는 이름을 붙이면 됩니다. 파일을 드래그 앤 드롭해 선택할 수 있습니다.';
 $lang['mediaextchange']        = '파일 확장자가 .%s에서 .%s(으)로 바뀌었습니다!';
-$lang['reference']             = '참고';
+$lang['reference']             = '다음을 참조';
 $lang['ref_inuse']             = '다음 문서에서 아직 사용 중이므로 파일을 삭제할 수 없습니다:';
 $lang['ref_hidden']            = '문서의 일부 참고는 읽을 수 있는 권한이 없습니다';
 $lang['hits']                  = '조회 수';
@@ -185,13 +188,18 @@ $lang['difflink']              = '차이 보기로 링크';
 $lang['diff_type']             = '차이 보기:';
 $lang['diff_inline']           = '직렬 방식';
 $lang['diff_side']             = '다중 창 방식';
+$lang['diffprevrev']           = '이전 판';
+$lang['diffnextrev']           = '다음 판';
+$lang['difflastrev']           = '마지막 판';
+$lang['diffbothprevrev']       = '양쪽 이전 판';
+$lang['diffbothnextrev']       = '양쪽 다음 판';
 $lang['line']                  = '줄';
-$lang['breadcrumb']            = '추적';
-$lang['youarehere']            = '현재 위치';
-$lang['lastmod']               = '마지막으로 수정됨';
+$lang['breadcrumb']            = '추적:';
+$lang['youarehere']            = '현재 위치:';
+$lang['lastmod']               = '마지막으로 수정됨:';
 $lang['by']                    = '저자';
 $lang['deleted']               = '제거됨';
-$lang['created']               = '새로 만듦';
+$lang['created']               = '만듦';
 $lang['restored']              = '이전 판으로 되돌림 (%s)';
 $lang['external_edit']         = '바깥 편집';
 $lang['summary']               = '편집 요약';
@@ -232,7 +240,7 @@ $lang['qb_extlink']            = '바깥 링크';
 $lang['qb_hr']                 = '가로줄';
 $lang['qb_ol']                 = '순서 있는 목록';
 $lang['qb_ul']                 = '순서 없는 목록';
-$lang['qb_media']              = '그림과 기타 파일 추가 (새 창에서 열림)';
+$lang['qb_media']              = '그림과 다른 파일 추가 (새 창에서 열림)';
 $lang['qb_sig']                = '서명 넣기';
 $lang['qb_smileys']            = '이모티콘';
 $lang['qb_chars']              = '특수 문자';
@@ -241,20 +249,18 @@ $lang['admin_register']        = '새 사용자 추가';
 $lang['metaedit']              = '메타데이터 편집';
 $lang['metasaveerr']           = '메타데이터 쓰기 실패';
 $lang['metasaveok']            = '메타데이터 저장됨';
-$lang['btn_img_backto']            = '뒤로 %s';
-$lang['img_title']             = '제목';
-$lang['img_caption']           = '설명';
-$lang['img_date']              = '날짜';
-$lang['img_fname']             = '파일 이름';
-$lang['img_fsize']             = '크기';
-$lang['img_artist']            = '촬영자';
-$lang['img_copyr']             = '저작권';
-$lang['img_format']            = '포맷';
-$lang['img_camera']            = '카메라';
-$lang['img_keywords']          = '키워드';
-$lang['img_width']             = '너비';
-$lang['img_height']            = '높이';
-$lang['btn_mediaManager']           = '미디어 관리자에서 보기';
+$lang['img_title']             = '제목:';
+$lang['img_caption']           = '설명:';
+$lang['img_date']              = '날짜:';
+$lang['img_fname']             = '파일 이름:';
+$lang['img_fsize']             = '크기:';
+$lang['img_artist']            = '촬영자:';
+$lang['img_copyr']             = '저작권:';
+$lang['img_format']            = '포맷:';
+$lang['img_camera']            = '카메라:';
+$lang['img_keywords']          = '키워드:';
+$lang['img_width']             = '너비:';
+$lang['img_height']            = '높이:';
 $lang['subscr_subscribe_success'] = '%s 사용자가 %s 구독 목록에 추가했습니다';
 $lang['subscr_subscribe_error'] = '%s 사용자가 %s 구독 목록에 추가하는데 실패했습니다';
 $lang['subscr_subscribe_noaddress'] = '로그인으로 연결된 주소가 없기 때문에 구독 목록에 추가할 수 없습니다';
@@ -283,6 +289,7 @@ $lang['i_modified']            = '보안 상의 이유로 이 스크립트는 
 다운로드한 압축 패키지를 다시 설치하거나 <a href="http://dokuwiki.org/ko:install">도쿠위키 설치 과정</a>을 참고해서 설치하세요.';
 $lang['i_funcna']              = '<code>%s</code> PHP 함수를 사용할 수 없습니다. 호스트 제공자가 어떤 이유에서인지 막아 놓았을지 모릅니다.';
 $lang['i_phpver']              = 'PHP <code>%s</code> 버전은 필요한 <code>%s</code> 버전보다 오래되었습니다. PHP를 업그레이드할 필요가 있습니다.';
+$lang['i_mbfuncoverload']      = '도쿠위키를 실행하려면 mbstring.func_overload를 php.ini에서 비활성화해야 합니다.';
 $lang['i_permfail']            = '<code>%s</code>는 도쿠위키가 쓰기 가능 권한이 없습니다. 먼저 이 디렉터리에 쓰기 권한이 설정되어야 합니다!';
 $lang['i_confexists']          = '<code>%s</code>(은)는 이미 존재합니다';
 $lang['i_writeerr']            = '<code>%s</code>(을)를 만들 수 없습니다. 먼저 디렉터리/파일 권한을 확인하고 파일을 수동으로 만드세요.';
@@ -302,7 +309,7 @@ $lang['i_pop_field']           = '도쿠위키 경험을 개선하는 데 도움
 $lang['i_pop_label']           = '한 달에 한 번씩, 도쿠위키 개발자에게 익명의 사용 데이터를 보냅니다';
 $lang['recent_global']         = '현재 <b>%s</b> 이름공간을 구독 중입니다. <a href="%s">전체 위키의 최근 바뀜도 볼 수</a> 있습니다.';
 $lang['years']                 = '%dë…„ ì „';
-$lang['months']                = '%d달 전';
+$lang['months']                = '%d개월 전';
 $lang['weeks']                 = '%d주 전';
 $lang['days']                  = '%d일 전';
 $lang['hours']                 = '%d시간 전';
diff --git a/inc/lang/ko/searchpage.txt b/inc/lang/ko/searchpage.txt
index 2313f0bb09ea10a74dbfaef39094ffbc06107913..53faa04c6feec977c0544bbefe3e87477806738c 100644
--- a/inc/lang/ko/searchpage.txt
+++ b/inc/lang/ko/searchpage.txt
@@ -1,5 +1,5 @@
 ====== 검색 ======
 
-아래에서 검색 결과를 찾을 수 있습니다. 만약 원하는 문서를 찾지 못했다면, "문서 만들기"나 "문서 편집"을 사용해 검색어와 같은 이름의 문서를 만들거나 편집할 수 있습니다.
+아래에서 검색 결과를 찾을 수 있습니다. 만약 원하는 문서를 찾지 못했다면, ''문서 만들기''나 ''문서 편집''을 사용해 검색어와 같은 이름의 문서를 만들거나 편집할 수 있습니다.
 
 ===== ê²°ê³¼ =====
\ No newline at end of file
diff --git a/inc/lang/ko/subscr_digest.txt b/inc/lang/ko/subscr_digest.txt
index 0f03e51a3e1a6b539871c1d129cb0db345391223..d1f2d4b99ff10628be51ab833a44ca3a5948f76b 100644
--- a/inc/lang/ko/subscr_digest.txt
+++ b/inc/lang/ko/subscr_digest.txt
@@ -11,7 +11,7 @@
 새 판: @NEWPAGE@
 
 
-문서의 알림을 취소하려면, @DOKUWIKIURL@에 로그인한 뒤
+문서 알림을 취소하려면, @DOKUWIKIURL@에 로그인한 뒤
 @SUBSCRIBE@ 문서를 방문해 문서나 이름공간의 구독을 취소하세요.
 
 -- 
diff --git a/inc/lang/ko/updateprofile.txt b/inc/lang/ko/updateprofile.txt
index 80545e9bfc454beb311cfc22c96d27fe40705983..055272e9d527dba4f2c9cca042c6c500543cdec1 100644
--- a/inc/lang/ko/updateprofile.txt
+++ b/inc/lang/ko/updateprofile.txt
@@ -1,3 +1,3 @@
-====== 개인 정보 바꾸기 ======
+====== 계정 프로필 바꾸기 ======
 
 바꾸고 싶은 항목을 입력하세요. 사용자 이름은 바꿀 수 없습니다.
\ No newline at end of file
diff --git a/inc/lang/ku/lang.php b/inc/lang/ku/lang.php
index 14f568b8e86d01cea6b11b7ae2d5a07a2d2c5a44..b1b733ec94a8e9bd298de78b97480e22287804dd 100644
--- a/inc/lang/ku/lang.php
+++ b/inc/lang/ku/lang.php
@@ -35,7 +35,7 @@ $lang['btn_backtomedia'] = 'Back to Mediafile Selection';
 $lang['btn_subscribe']   = 'Subscribe Changes';
 $lang['btn_register'] = 'Register';
 
-$lang['loggedinas'] = 'Logged in as';
+$lang['loggedinas'] = 'Logged in as:';
 $lang['user']       = 'Username';
 $lang['pass']       = 'Password';
 $lang['passchk']    = 'once again';
@@ -89,8 +89,8 @@ $lang['current']    = 'current';
 $lang['yours']      = 'Your Version';
 $lang['diff']       = 'show differences to current version';
 $lang['line']       = 'Rêz';
-$lang['breadcrumb'] = 'Åžop';
-$lang['lastmod']    = 'Guherandina dawî';
+$lang['breadcrumb'] = 'Åžop:';
+$lang['lastmod']    = 'Guherandina dawî:';
 $lang['by']         = 'by';
 $lang['deleted']    = 'hat jê birin';
 $lang['created']    = 'hat afirandin';
@@ -128,15 +128,15 @@ $lang['metaedit']    = 'Edit Metadata';
 $lang['metasaveerr'] = 'Writing metadata failed';
 $lang['metasaveok']  = 'Metadata saved';
 $lang['btn_img_backto']  = 'Back to %s';
-$lang['img_title']   = 'Title';
-$lang['img_caption'] = 'Caption';
-$lang['img_date']    = 'Date';
-$lang['img_fname']   = 'Filename';
-$lang['img_fsize']   = 'Size';
-$lang['img_artist']  = 'Photographer';
-$lang['img_copyr']   = 'Copyright';
-$lang['img_format']  = 'Format';
-$lang['img_camera']  = 'Camera';
-$lang['img_keywords']= 'Keywords';
+$lang['img_title']   = 'Title:';
+$lang['img_caption'] = 'Caption:';
+$lang['img_date']    = 'Date:';
+$lang['img_fname']   = 'Filename:';
+$lang['img_fsize']   = 'Size:';
+$lang['img_artist']  = 'Photographer:';
+$lang['img_copyr']   = 'Copyright:';
+$lang['img_format']  = 'Format:';
+$lang['img_camera']  = 'Camera:';
+$lang['img_keywords']= 'Keywords:';
 
 //Setup VIM: ex: et ts=2 :
diff --git a/inc/lang/la/lang.php b/inc/lang/la/lang.php
index 691b303ed0a983ea70d8c4f247963cadf2fcc116..66cd13967cb493409733202599bff227c0ba28d5 100644
--- a/inc/lang/la/lang.php
+++ b/inc/lang/la/lang.php
@@ -90,8 +90,8 @@ $lang['searchmedia_in']        = 'Quaere "%s":';
 $lang['txt_upload']            = 'Eligere documenta oneranda:';
 $lang['txt_filename']          = 'Onerare (optio):';
 $lang['txt_overwrt']           = 'Documento ueteri imponere:';
-$lang['lockedby']              = 'Nunc hoc intercludit';
-$lang['lockexpire']            = 'Hoc apertum';
+$lang['lockedby']              = 'Nunc hoc intercludit:';
+$lang['lockexpire']            = 'Hoc apertum:';
 $lang['js']['willexpire']            = 'Interclusio paginae recensendae uno minuto finita est.\nUt errores uites, \'praeuisio\' preme ut interclusionem ripristines.';
 $lang['js']['notsavedyet']     = 'Res non seruatae amissurae sunt.';
 $lang['js']['searchmedia']     = 'Quaere inter documenta';
@@ -203,16 +203,16 @@ $lang['metaedit']              = 'Res codicis mutare';
 $lang['metasaveerr']           = 'Res codicis non scribitur.';
 $lang['metasaveok']            = 'Res codicis seruatae.';
 $lang['btn_img_backto']            = 'Redere ad %s';
-$lang['img_title']             = 'Titulus';
-$lang['img_caption']           = 'Descriptio';
-$lang['img_date']              = 'Dies';
-$lang['img_fname']             = 'Titulus documenti';
-$lang['img_fsize']             = 'Pondus';
-$lang['img_artist']            = 'Imaginum exprimitor\trix';
-$lang['img_copyr']             = 'Iura exemplarium';
-$lang['img_format']            = 'Forma';
-$lang['img_camera']            = 'Cella';
-$lang['img_keywords']          = 'Verba claues';
+$lang['img_title']             = 'Titulus:';
+$lang['img_caption']           = 'Descriptio:';
+$lang['img_date']              = 'Dies:';
+$lang['img_fname']             = 'Titulus documenti:';
+$lang['img_fsize']             = 'Pondus:';
+$lang['img_artist']            = 'Imaginum exprimitor\trix:';
+$lang['img_copyr']             = 'Iura exemplarium:';
+$lang['img_format']            = 'Forma:';
+$lang['img_camera']            = 'Cella:';
+$lang['img_keywords']          = 'Verba claues:';
 $lang['subscr_subscribe_success'] = '%s additur indici subscriptionis quod %s';
 $lang['subscr_subscribe_error'] = '%s non additur indici subscriptionis quod %s';
 $lang['subscr_subscribe_noaddress'] = 'Cursus interretialis tuus deest, sic in indice subscriptionis non scribi potes';
diff --git a/inc/lang/lb/jquery.ui.datepicker.js b/inc/lang/lb/jquery.ui.datepicker.js
index 87c79d594eb3ffe204615437e8a70086f66f364c..4f2e414be9c818d8412fc9ae6a244533dc19a1b0 100644
--- a/inc/lang/lb/jquery.ui.datepicker.js
+++ b/inc/lang/lb/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Luxembourgish initialisation for the jQuery UI date picker plugin. */
 /* Written by Michel Weimerskirch <michel@weimerskirch.net> */
-jQuery(function($){
-	$.datepicker.regional['lb'] = {
-		closeText: 'Fäerdeg',
-		prevText: 'Zréck',
-		nextText: 'Weider',
-		currentText: 'Haut',
-		monthNames: ['Januar','Februar','Mäerz','Abrëll','Mee','Juni',
-		'Juli','August','September','Oktober','November','Dezember'],
-		monthNamesShort: ['Jan', 'Feb', 'Mäe', 'Abr', 'Mee', 'Jun',
-		'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
-		dayNames: ['Sonndeg', 'Méindeg', 'Dënschdeg', 'Mëttwoch', 'Donneschdeg', 'Freideg', 'Samschdeg'],
-		dayNamesShort: ['Son', 'Méi', 'Dën', 'Mët', 'Don', 'Fre', 'Sam'],
-		dayNamesMin: ['So','Mé','Dë','Më','Do','Fr','Sa'],
-		weekHeader: 'W',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['lb']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['lb'] = {
+	closeText: 'Fäerdeg',
+	prevText: 'Zréck',
+	nextText: 'Weider',
+	currentText: 'Haut',
+	monthNames: ['Januar','Februar','Mäerz','Abrëll','Mee','Juni',
+	'Juli','August','September','Oktober','November','Dezember'],
+	monthNamesShort: ['Jan', 'Feb', 'Mäe', 'Abr', 'Mee', 'Jun',
+	'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
+	dayNames: ['Sonndeg', 'Méindeg', 'Dënschdeg', 'Mëttwoch', 'Donneschdeg', 'Freideg', 'Samschdeg'],
+	dayNamesShort: ['Son', 'Méi', 'Dën', 'Mët', 'Don', 'Fre', 'Sam'],
+	dayNamesMin: ['So','Mé','Dë','Më','Do','Fr','Sa'],
+	weekHeader: 'W',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['lb']);
+
+return datepicker.regional['lb'];
+
+}));
diff --git a/inc/lang/lb/lang.php b/inc/lang/lb/lang.php
index efb98f6790f864eb9da1327a02f3c97681ca4448..a1b6ccf84abb730655d79890930ec71c3638477a 100644
--- a/inc/lang/lb/lang.php
+++ b/inc/lang/lb/lang.php
@@ -41,7 +41,7 @@ $lang['btn_draft']             = 'Entworf änneren';
 $lang['btn_recover']           = 'Entworf zeréckhuelen';
 $lang['btn_draftdel']          = 'Entworf läschen';
 $lang['btn_register']          = 'Registréieren';
-$lang['loggedinas']            = 'Ageloggt als';
+$lang['loggedinas']            = 'Ageloggt als:';
 $lang['user']                  = 'Benotzernumm';
 $lang['pass']                  = 'Passwuert';
 $lang['newpass']               = 'Nei Passwuert';
@@ -77,11 +77,11 @@ $lang['resendpwdconfirm']      = 'De Konfirmatiounslink gouf iwwer Email gesché
 $lang['resendpwdsuccess']      = 'Däi nei Passwuert gouf iwwer Email geschéckt.';
 $lang['license']               = 'Wann näischt anescht do steet, ass den Inhalt vun dësem Wiki ënner folgender Lizenz:';
 $lang['licenseok']             = 'Pass op: Wanns de dës Säit änners, bass de dermat averstan dass den Inhalt ënner folgender Lizenz lizenzéiert gëtt:';
-$lang['txt_upload']            = 'Wiel eng Datei fir eropzelueden';
-$lang['txt_filename']          = 'Eroplueden als (optional)';
+$lang['txt_upload']            = 'Wiel eng Datei fir eropzelueden:';
+$lang['txt_filename']          = 'Eroplueden als (optional):';
 $lang['txt_overwrt']           = 'Bestehend Datei iwwerschreiwen';
-$lang['lockedby']              = 'Am Moment gespaart vun';
-$lang['lockexpire']            = 'D\'Spär leeft of ëm';
+$lang['lockedby']              = 'Am Moment gespaart vun:';
+$lang['lockexpire']            = 'D\'Spär leeft of ëm:';
 $lang['js']['willexpire']            = 'Deng Spär fir d\'Säit ze änneren leeft an enger Minutt of.\nFir Konflikter ze verhënneren, dréck op Kucken ouni ofzespäicheren.';
 $lang['js']['notsavedyet']     = 'Net gespäicher Ännerunge gi verluer.\nWierklech weiderfueren?';
 $lang['rssfailed']             = 'Et ass e Feeler virkomm beim erofluede vun dësem Feed: ';
@@ -118,9 +118,9 @@ $lang['yours']                 = 'Deng Versioun';
 $lang['diff']                  = 'Weis d\'Ënnerscheeder zuer aktueller Versioun';
 $lang['diff2']                 = 'Weis d\'Ënnerscheeder zwescht den ausgewielte Versiounen';
 $lang['line']                  = 'Linn';
-$lang['breadcrumb']            = 'Spuer';
-$lang['youarehere']            = 'Du bass hei';
-$lang['lastmod']               = 'Fir d\'lescht g\'ännert';
+$lang['breadcrumb']            = 'Spuer:';
+$lang['youarehere']            = 'Du bass hei:';
+$lang['lastmod']               = 'Fir d\'lescht g\'ännert:';
 $lang['by']                    = 'vun';
 $lang['deleted']               = 'geläscht';
 $lang['created']               = 'erstallt';
@@ -163,16 +163,16 @@ $lang['metaedit']              = 'Metadaten änneren';
 $lang['metasaveerr']           = 'Feeler beim Schreiwe vun de Metadaten';
 $lang['metasaveok']            = 'Metadate gespäichert';
 $lang['btn_img_backto']            = 'Zeréck op %s';
-$lang['img_title']             = 'Titel';
-$lang['img_caption']           = 'Beschreiwung';
-$lang['img_date']              = 'Datum';
-$lang['img_fname']             = 'Dateinumm';
-$lang['img_fsize']             = 'Gréisst';
-$lang['img_artist']            = 'Fotograf';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Schlësselwieder';
+$lang['img_title']             = 'Titel:';
+$lang['img_caption']           = 'Beschreiwung:';
+$lang['img_date']              = 'Datum:';
+$lang['img_fname']             = 'Dateinumm:';
+$lang['img_fsize']             = 'Gréisst:';
+$lang['img_artist']            = 'Fotograf:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Schlësselwieder:';
 $lang['authtempfail']          = 'D\'Benotzerautentifikatioun ass de Moment net verfügbar. Wann dës Situatioun unhält, dann informéier w.e.g. de Wiki Admin.';
 $lang['i_chooselang']          = 'Wiel deng Sprooch';
 $lang['i_installer']           = 'DokuWiki Installer';
diff --git a/inc/lang/lt/jquery.ui.datepicker.js b/inc/lang/lt/jquery.ui.datepicker.js
index 54eb523b30811ed2a18995b5891c95b8f7a90f84..60ccbefe7a16b403894a38c9d28d8341b059dafe 100644
--- a/inc/lang/lt/jquery.ui.datepicker.js
+++ b/inc/lang/lt/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */
 /* @author Arturas Paleicikas <arturas@avalon.lt> */
-jQuery(function($){
-	$.datepicker.regional['lt'] = {
-		closeText: 'Uždaryti',
-		prevText: '&#x3C;Atgal',
-		nextText: 'Pirmyn&#x3E;',
-		currentText: 'Å iandien',
-		monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis',
-		'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'],
-		monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir',
-		'Lie','Rugp','Rugs','Spa','Lap','Gru'],
-		dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'],
-		dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'],
-		dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Å e'],
-		weekHeader: 'SAV',
-		dateFormat: 'yy-mm-dd',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: true,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['lt']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['lt'] = {
+	closeText: 'Uždaryti',
+	prevText: '&#x3C;Atgal',
+	nextText: 'Pirmyn&#x3E;',
+	currentText: 'Å iandien',
+	monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis',
+	'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'],
+	monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir',
+	'Lie','Rugp','Rugs','Spa','Lap','Gru'],
+	dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'],
+	dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'],
+	dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Å e'],
+	weekHeader: 'SAV',
+	dateFormat: 'yy-mm-dd',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: true,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['lt']);
+
+return datepicker.regional['lt'];
+
+}));
diff --git a/inc/lang/lt/lang.php b/inc/lang/lt/lang.php
index 74c8c88e963670bd595a5299a46c2d26a991c73a..d6552d68c76ac2a76f2462aac5e8eea64badf3f8 100644
--- a/inc/lang/lt/lang.php
+++ b/inc/lang/lt/lang.php
@@ -46,7 +46,7 @@ $lang['btn_draft']             = 'Redaguoti juodraštį';
 $lang['btn_recover']           = 'Atkurti juodraštį';
 $lang['btn_draftdel']          = 'Šalinti juodraštį';
 $lang['btn_register']          = 'Registruotis';
-$lang['loggedinas']            = 'Prisijungęs kaip';
+$lang['loggedinas']            = 'Prisijungęs kaip:';
 $lang['user']                  = 'Vartotojo vardas';
 $lang['pass']                  = 'Slaptažodis';
 $lang['newpass']               = 'Naujas slaptažodis';
@@ -82,11 +82,11 @@ $lang['resendpwdconfirm']      = 'Patvirtinimo nuoroda išsiųsta el. paštu.';
 $lang['resendpwdsuccess']      = 'Jūsų naujas slaptažodis buvo išsiųstas el. paštu.';
 $lang['license']               = 'Jei nenurodyta kitaip, Å¡io wiki turinys ginamas tokia licencija:';
 $lang['licenseok']             = 'Pastaba: Redaguodami šį puslapį jūs sutinkate jog jūsų turinys atitinka licencijavima pagal šią licenciją';
-$lang['txt_upload']            = 'Išsirinkite atsiunčiamą bylą';
-$lang['txt_filename']          = 'Įveskite wikivardą (nebūtina)';
+$lang['txt_upload']            = 'Išsirinkite atsiunčiamą bylą:';
+$lang['txt_filename']          = 'Įveskite wikivardą (nebūtina):';
 $lang['txt_overwrt']           = 'Perrašyti egzistuojančią bylą';
-$lang['lockedby']              = 'Užrakintas vartotojo';
-$lang['lockexpire']            = 'Užraktas bus nuimtas';
+$lang['lockedby']              = 'Užrakintas vartotojo:';
+$lang['lockexpire']            = 'Užraktas bus nuimtas:';
 $lang['js']['willexpire']            = 'Šio puslapio redagavimo užrakto galiojimo laikas baigsis po minutės.\nNorėdami išvengti nesklandumų naudokite peržiūros mygtuką ir užraktas atsinaujins.';
 $lang['js']['notsavedyet']     = 'Pakeitimai nebus išsaugoti.\nTikrai tęsti?';
 $lang['rssfailed']             = 'Siunčiant šį feed\'ą įvyko klaida: ';
@@ -125,9 +125,9 @@ $lang['yours']                 = 'Jūsų versija';
 $lang['diff']                  = 'rodyti skirtumus tarp Å¡ios ir esamos versijos';
 $lang['diff2']                 = 'Parodyti skirtumus tarp pasirinktų versijų';
 $lang['line']                  = 'Linija';
-$lang['breadcrumb']            = 'Kelias';
-$lang['youarehere']            = 'Jūs esate čia';
-$lang['lastmod']               = 'Keista';
+$lang['breadcrumb']            = 'Kelias:';
+$lang['youarehere']            = 'Jūs esate čia:';
+$lang['lastmod']               = 'Keista:';
 $lang['by']                    = 'vartotojo';
 $lang['deleted']               = 'ištrintas';
 $lang['created']               = 'sukurtas';
@@ -164,16 +164,16 @@ $lang['metaedit']              = 'Redaguoti metaduomenis';
 $lang['metasaveerr']           = 'Nepavyko išsaugoti metaduomenų';
 $lang['metasaveok']            = 'Metaduomenys išsaugoti';
 $lang['btn_img_backto']            = 'Atgal į %s';
-$lang['img_title']             = 'Pavadinimas';
-$lang['img_caption']           = 'Antraštė';
-$lang['img_date']              = 'Data';
-$lang['img_fname']             = 'Bylos pavadinimas';
-$lang['img_fsize']             = 'Dydis';
-$lang['img_artist']            = 'Fotografas';
-$lang['img_copyr']             = 'AutorinÄ—s teisÄ—s';
-$lang['img_format']            = 'Formatas';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Raktiniai žodžiai';
+$lang['img_title']             = 'Pavadinimas:';
+$lang['img_caption']           = 'Antraštė:';
+$lang['img_date']              = 'Data:';
+$lang['img_fname']             = 'Bylos pavadinimas:';
+$lang['img_fsize']             = 'Dydis:';
+$lang['img_artist']            = 'Fotografas:';
+$lang['img_copyr']             = 'AutorinÄ—s teisÄ—s:';
+$lang['img_format']            = 'Formatas:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Raktiniai žodžiai:';
 $lang['authtempfail']          = 'Vartotojo tapatumo nustatymas laikinai nepasiekiamas. Jei ši situacija kartojasi, tai praneškite savo administratoriui.';
 $lang['i_chooselang']          = 'Pasirinkite kalbÄ…';
 $lang['i_installer']           = 'DokuWiki Instaliatorius';
diff --git a/inc/lang/lv/jquery.ui.datepicker.js b/inc/lang/lv/jquery.ui.datepicker.js
index 3fdf8565bd82257bf71136369d3441643028e80b..b9e288535353536da6dc829daf6b5bcabc004ba7 100644
--- a/inc/lang/lv/jquery.ui.datepicker.js
+++ b/inc/lang/lv/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */
 /* @author Arturas Paleicikas <arturas.paleicikas@metasite.net> */
-jQuery(function($){
-	$.datepicker.regional['lv'] = {
-		closeText: 'Aizvērt',
-		prevText: 'Iepr.',
-		nextText: 'Nāk.',
-		currentText: 'Å odien',
-		monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs',
-		'JÅ«lijs','Augusts','Septembris','Oktobris','Novembris','Decembris'],
-		monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','JÅ«n',
-		'JÅ«l','Aug','Sep','Okt','Nov','Dec'],
-		dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'],
-		dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'],
-		dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'],
-		weekHeader: 'Ned.',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['lv']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['lv'] = {
+	closeText: 'Aizvērt',
+	prevText: 'Iepr.',
+	nextText: 'Nāk.',
+	currentText: 'Å odien',
+	monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs',
+	'JÅ«lijs','Augusts','Septembris','Oktobris','Novembris','Decembris'],
+	monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','JÅ«n',
+	'JÅ«l','Aug','Sep','Okt','Nov','Dec'],
+	dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'],
+	dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'],
+	dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'],
+	weekHeader: 'Ned.',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['lv']);
+
+return datepicker.regional['lv'];
+
+}));
diff --git a/inc/lang/lv/lang.php b/inc/lang/lv/lang.php
index 91fed262e3b8d08e2cfee644b830583ff9ec5dee..15994afe602f72b7d937303df4034f75db021b04 100644
--- a/inc/lang/lv/lang.php
+++ b/inc/lang/lv/lang.php
@@ -1,8 +1,8 @@
 <?php
+
 /**
- * latvian language file
- *
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Aivars Miška <allefm@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
@@ -47,7 +47,10 @@ $lang['btn_revert']            = 'Atjaunot';
 $lang['btn_register']          = 'Reģistrēties';
 $lang['btn_apply']             = 'Labi';
 $lang['btn_media']             = 'Mēdiju pārvaldnieks';
-$lang['loggedinas']            = 'Pieteicies kā';
+$lang['btn_deleteuser']        = 'Dzēst manu kontu';
+$lang['btn_img_backto']        = 'Atpakaļ uz %s';
+$lang['btn_mediaManager']      = 'Skatīt mēdiju pārvaldniekā';
+$lang['loggedinas']            = 'Pieteicies kā:';
 $lang['user']                  = 'Lietotājvārds';
 $lang['pass']                  = 'Parole';
 $lang['newpass']               = 'Jaunā parole';
@@ -58,6 +61,7 @@ $lang['fullname']              = 'Pilns vārds';
 $lang['email']                 = 'E-pasts';
 $lang['profile']               = 'Lietotāja vārds';
 $lang['badlogin']              = 'Atvaino, lietotājvārds vai parole aplama.';
+$lang['badpassconfirm']        = 'Atvaino, aplama parole';
 $lang['minoredit']             = 'SÄ«ki labojumi';
 $lang['draftdate']             = 'Melnraksts automātiski saglabāts';
 $lang['nosecedit']             = 'Lapa pa šo laiku ir mainījusies, sekcijas informācija novecojusi. Ielādēta lapas  pilnās versija.';
@@ -74,6 +78,11 @@ $lang['profna']                = 'Labot profilu nav iespējams';
 $lang['profnochange']          = 'Izmaiņu nav. Nav, ko darīt.';
 $lang['profnoempty']           = 'Bez vārda vai e-pasta adreses nevar.';
 $lang['profchanged']           = 'Profils veiksmīgi izlabots.';
+$lang['profnodelete']          = 'Šajā viki lietotājus izdzēst nevar';
+$lang['profdeleteuser']        = 'Dzēst kontu';
+$lang['profdeleted']           = 'Jūsu lietotāja konts ir izdzēsts';
+$lang['profconfdelete']        = 'Es vēlos dzēst savu kontu no viki. <br/> Šo darbību vairs nevarēs atsaukt.';
+$lang['profconfdeletemissing'] = 'Nav atzīmēta apstiprinājuma rūtiņa.';
 $lang['pwdforget']             = 'Aizmirsi paroli? Saņem jaunu';
 $lang['resendna']              = 'Paroļu izsūtīšanu nepiedāvāju.';
 $lang['resendpwd']             = 'Uzstādīt jaunu paroli lietotājam';
@@ -86,12 +95,12 @@ $lang['license']               = 'Ja nav norādīts citādi, viki saturs pieejam
 $lang['licenseok']             = 'Ievēro: Labojot lapu, tu piekrīti šādiem licenzes noteikumiem.';
 $lang['searchmedia']           = 'Meklētais faila vārds: ';
 $lang['searchmedia_in']        = 'Meklēt iekš %s';
-$lang['txt_upload']            = 'Norādi augšupielādējamo failu';
-$lang['txt_filename']          = 'Ievadi vikivārdu (nav obligāts)';
+$lang['txt_upload']            = 'Norādi augšupielādējamo failu:';
+$lang['txt_filename']          = 'Ievadi vikivārdu (nav obligāts):';
 $lang['txt_overwrt']           = 'Aizstāt esošo failu';
 $lang['maxuploadsize']         = 'Augšuplādējamā faila ierobežojums: %s.';
-$lang['lockedby']              = 'Patlaban bloÄ·Ä“jis ';
-$lang['lockexpire']            = 'BloÄ·Ä“jums beigsies ';
+$lang['lockedby']              = 'Patlaban bloÄ·Ä“jis :';
+$lang['lockexpire']            = 'BloÄ·Ä“jums beigsies :';
 $lang['js']['willexpire']      = 'Tavs bloķējums uz šo lapu pēc minūtes beigsies.\nLai izvairītos no konflikta, nospied Iepriekšapskata pogu\n un bloķējuma laiku sāks skaitīt no jauna.';
 $lang['js']['notsavedyet']     = 'Veiktas bet nav saglabātas izmaiņas.
 Vai tiešām tās nevajag?';
@@ -172,10 +181,15 @@ $lang['difflink']              = 'Saite uz salīdzināšanas skatu.';
 $lang['diff_type']             = 'Skatīt atšķirības:';
 $lang['diff_inline']           = 'Iekļauti';
 $lang['diff_side']             = 'Blakus';
+$lang['diffprevrev']           = 'Iepriekšējā versija';
+$lang['diffnextrev']           = 'Nākamā versija';
+$lang['difflastrev']           = 'Jaunākā versija';
+$lang['diffbothprevrev']       = 'Abās pusēs iepriekšējo versiju';
+$lang['diffbothnextrev']       = 'Abās pusēs nākamo versiju';
 $lang['line']                  = 'Rinda';
-$lang['breadcrumb']            = 'Apmeklēts';
-$lang['youarehere']            = 'Tu atrodies Å¡eit';
-$lang['lastmod']               = 'Labota';
+$lang['breadcrumb']            = 'Apmeklēts:';
+$lang['youarehere']            = 'Tu atrodies Å¡eit:';
+$lang['lastmod']               = 'Labota:';
 $lang['by']                    = ', labojis';
 $lang['deleted']               = 'dzēsts';
 $lang['created']               = 'izveidots';
@@ -228,20 +242,18 @@ $lang['admin_register']        = 'Pievienot jaunu lietotāju';
 $lang['metaedit']              = 'Labot metadatus';
 $lang['metasaveerr']           = 'Metadati nav saglabāti';
 $lang['metasaveok']            = 'Metadati saglabāti';
-$lang['btn_img_backto']            = 'Atpakaļ uz %s';
-$lang['img_title']             = 'Virsraksts';
-$lang['img_caption']           = 'Apraksts';
-$lang['img_date']              = 'Datums';
-$lang['img_fname']             = 'Faila vārds';
-$lang['img_fsize']             = 'Izmērs';
-$lang['img_artist']            = 'Fotogrāfs';
-$lang['img_copyr']             = 'Autortiesības';
-$lang['img_format']            = 'Formāts';
-$lang['img_camera']            = 'Fotoaparāts';
-$lang['img_keywords']          = 'Atslēgvārdi';
-$lang['img_width']             = 'Platums';
-$lang['img_height']            = 'Augstums';
-$lang['btn_mediaManager']           = 'Skatīt mēdiju pārvaldniekā';
+$lang['img_title']             = 'Virsraksts:';
+$lang['img_caption']           = 'Apraksts:';
+$lang['img_date']              = 'Datums:';
+$lang['img_fname']             = 'Faila vārds:';
+$lang['img_fsize']             = 'Izmērs:';
+$lang['img_artist']            = 'Fotogrāfs:';
+$lang['img_copyr']             = 'Autortiesības:';
+$lang['img_format']            = 'Formāts:';
+$lang['img_camera']            = 'Fotoaparāts:';
+$lang['img_keywords']          = 'Atslēgvārdi:';
+$lang['img_width']             = 'Platums:';
+$lang['img_height']            = 'Augstums:';
 $lang['subscr_subscribe_success'] = '%s pievienots %s abonēšanas sarakstam';
 $lang['subscr_subscribe_error'] = 'Kļūme pievienojot %s %s abonēšanas sarakstam.';
 $lang['subscr_subscribe_noaddress'] = 'Nav zināma jūsu e-pasta adrese, tāpēc nevarat abonēt.';
@@ -270,6 +282,7 @@ $lang['i_modified']            = 'Drošības nolūkos šis skripts darbosies tik
 Vai nu no jauna jāatarhivē faili no lejupielādētās pakas vai jāraugās pēc padoma pilnā Dokuwiki instalācijas instrukcijā <a href="http://dokuwiki.org/install"></a>';
 $lang['i_funcna']              = 'PHP funkcija <code>%s</code> nav pieejama. Varbūt jūsu servera īpašnieks to kāda iemesla dēļ atslēdzis?';
 $lang['i_phpver']              = 'Jūsu PHP versija <code>%s</code> ir par vecu. Vajag versiju <code>%s</code>. Atjaunojiet savu PHP instalāciju.';
+$lang['i_mbfuncoverload']      = 'Lai darbinātu  DokuWiki,  php.ini failā ir jāatspējo mbstring.func_overload.';
 $lang['i_permfail']            = 'Dokuwiki nevar ierakstīt <code>%s</code>. Jālabo direktorijas tiesības!';
 $lang['i_confexists']          = '<code>%s</code> jau ir';
 $lang['i_writeerr']            = 'Nevar izveidot <code>%s</code>. Jāpārbauda direktorijas/faila tiesības un fails jāizveido pašam.';
@@ -281,6 +294,7 @@ $lang['i_policy']              = 'Sākotnējā ACL politika';
 $lang['i_pol0']                = 'Atvērts Wiki (raksta, lasa un augšupielādē ikviens)';
 $lang['i_pol1']                = 'Publisks Wiki (lasa ikviens, raksta un augšupielādē reģistrēti lietotāji)';
 $lang['i_pol2']                = 'Slēgts Wiki (raksta, lasa un augšupielādē tikai reģistrēti lietotāji)';
+$lang['i_allowreg']            = 'Atļaut lietotājiem reģistrēties.';
 $lang['i_retry']               = 'Atkārtot';
 $lang['i_license']             = 'Ar kādu licenci saturs tiks publicēts:';
 $lang['i_license_none']        = 'Nerādīt nekādu licences informāciju';
@@ -318,3 +332,7 @@ $lang['media_perm_read']       = 'Atvainojiet, jums nav tiesību skatīt failus.
 $lang['media_perm_upload']     = 'Atvainojiet, jums nav tiesību augšupielādēt. ';
 $lang['media_update']          = 'Augšupielādēt jaunu versiju';
 $lang['media_restore']         = 'Atjaunot Å¡o versiju';
+$lang['currentns']             = 'Pašreizējā sadaļa';
+$lang['searchresult']          = 'Meklēšanas rezultāti';
+$lang['plainhtml']             = 'TÄ«rs HTML';
+$lang['wikimarkup']            = 'Viki iezīmēšana valoda';
diff --git a/inc/lang/mg/lang.php b/inc/lang/mg/lang.php
index c5ed669a9607894238ab8699704912faaaab8bae..6239c01fe5f96c437a6c022fe9eb204a7aa0c447 100644
--- a/inc/lang/mg/lang.php
+++ b/inc/lang/mg/lang.php
@@ -49,11 +49,11 @@ $lang['regbadpass'] = 'Tsy mitovy ny alahidy roa nomenao, avereno indray.';
 $lang['regpwmail']  = 'Ny alahidy Wiki-nao';
 $lang['reghere']    = 'Mbola tsy manana kaonty ianao? Manaova vaovao';
 
-$lang['txt_upload']   = 'Misafidiana rakitra halefa';
-$lang['txt_filename'] = 'Ampidiro ny anaran\'ny wiki (tsy voatery)';
+$lang['txt_upload']   = 'Misafidiana rakitra halefa:';
+$lang['txt_filename'] = 'Ampidiro ny anaran\'ny wiki (tsy voatery):';
 $lang['txt_overwrt']  = 'Fafana izay rakitra efa misy?';
-$lang['lockedby']     = 'Mbola voahidin\'i';
-$lang['lockexpire']   = 'Afaka ny hidy amin\'ny';
+$lang['lockedby']     = 'Mbola voahidin\'i:';
+$lang['lockexpire']   = 'Afaka ny hidy amin\'ny:';
 $lang['js']['willexpire']   = 'Efa ho lany fotoana afaka iray minitra ny hidy ahafahanao manova ny pejy.\nMba hialana amin\'ny conflit dia ampiasao ny bokotra topi-maso hamerenana ny timer-n\'ny hidy.';
 
 $lang['js']['notsavedyet'] = 'Misy fiovana tsy voarakitra, ho very izany ireo.\nAzo antoka fa hotohizana?';
@@ -83,7 +83,7 @@ $lang['current']    = 'current';
 $lang['yours']      = 'Kinova-nao';
 $lang['diff']       = 'Asehoy ny tsy fitoviana amin\'ny kinova amin\'izao';
 $lang['line']       = 'Andalana';
-$lang['breadcrumb'] = 'Taiza ianao';
+$lang['breadcrumb'] = 'Taiza ianao:';
 $lang['lastmod']    = 'Novaina farany:';
 $lang['by']         = '/';
 $lang['deleted']    = 'voafafa';
diff --git a/inc/lang/mk/jquery.ui.datepicker.js b/inc/lang/mk/jquery.ui.datepicker.js
index 0285325519f82c3657b54897ec50800226c2b38d..15942e2810792eb1b0452d1f9d8148d71b6501ba 100644
--- a/inc/lang/mk/jquery.ui.datepicker.js
+++ b/inc/lang/mk/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Macedonian i18n for the jQuery UI date picker plugin. */
 /* Written by Stojce Slavkovski. */
-jQuery(function($){
-	$.datepicker.regional['mk'] = {
-		closeText: 'Затвори',
-		prevText: '&#x3C;',
-		nextText: '&#x3E;',
-		currentText: 'Денес',
-		monthNames: ['Јануари','Февруари','Март','Април','Мај','Јуни',
-		'Јули','Август','Септември','Октомври','Ноември','Декември'],
-		monthNamesShort: ['Јан','Фев','Мар','Апр','Мај','Јун',
-		'Јул','Авг','Сеп','Окт','Ное','Дек'],
-		dayNames: ['Недела','Понеделник','Вторник','Среда','Четврток','Петок','Сабота'],
-		dayNamesShort: ['Нед','Пон','Вто','Сре','Чет','Пет','Саб'],
-		dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Са'],
-		weekHeader: 'Сед',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['mk']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['mk'] = {
+	closeText: 'Затвори',
+	prevText: '&#x3C;',
+	nextText: '&#x3E;',
+	currentText: 'Денес',
+	monthNames: ['Јануари','Февруари','Март','Април','Мај','Јуни',
+	'Јули','Август','Септември','Октомври','Ноември','Декември'],
+	monthNamesShort: ['Јан','Фев','Мар','Апр','Мај','Јун',
+	'Јул','Авг','Сеп','Окт','Ное','Дек'],
+	dayNames: ['Недела','Понеделник','Вторник','Среда','Четврток','Петок','Сабота'],
+	dayNamesShort: ['Нед','Пон','Вто','Сре','Чет','Пет','Саб'],
+	dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Са'],
+	weekHeader: 'Сед',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['mk']);
+
+return datepicker.regional['mk'];
+
+}));
diff --git a/inc/lang/mk/lang.php b/inc/lang/mk/lang.php
index 6bf5fafc96e79537f2b41765f61dc19b1982ce5e..ddfae15c465c770347b967a06206cab52f267c54 100644
--- a/inc/lang/mk/lang.php
+++ b/inc/lang/mk/lang.php
@@ -47,7 +47,7 @@ $lang['btn_recover']           = 'Поврати скица';
 $lang['btn_draftdel']          = 'Избриши скица';
 $lang['btn_revert']            = 'Обнови';
 $lang['btn_register']          = 'Регистрирај се';
-$lang['loggedinas']            = 'Најавен/а како';
+$lang['loggedinas']            = 'Најавен/а како:';
 $lang['user']                  = 'Корисничко име';
 $lang['pass']                  = 'Лозинка';
 $lang['newpass']               = 'Нова лозинка';
@@ -85,11 +85,11 @@ $lang['license']               = 'Освен каде што е наведено
 $lang['licenseok']             = 'Забелешка: со уредување на оваа страница се согласувате да ја лиценцирате вашата содржина под следнава лиценца:';
 $lang['searchmedia']           = 'Барај име на датотека:';
 $lang['searchmedia_in']        = 'Барај во %s';
-$lang['txt_upload']            = 'Избери датотека за качување';
-$lang['txt_filename']          = 'Качи како (неморално)';
+$lang['txt_upload']            = 'Избери датотека за качување:';
+$lang['txt_filename']          = 'Качи како (неморално):';
 $lang['txt_overwrt']           = 'Пребриши ја веќе постоечката датотека';
-$lang['lockedby']              = 'Моментално заклучена од';
-$lang['lockexpire']            = 'Клучот истекува на';
+$lang['lockedby']              = 'Моментално заклучена од:';
+$lang['lockexpire']            = 'Клучот истекува на:';
 $lang['js']['willexpire']            = 'Вашиот клуч за уредување на оваа страница ќе истече за една минута.\nЗа да избегнете конфликти и да го ресетирате бројачот за време, искористете го копчето за преглед.';
 $lang['js']['notsavedyet']     = 'Незачуваните промени ќе бидат изгубени.\nСакате да продолжите?';
 $lang['rssfailed']             = 'Се појави грешка при повлекувањето на овој канал:';
@@ -130,9 +130,9 @@ $lang['yours']                 = 'Вашата верзија';
 $lang['diff']                  = 'Прикажи разлики со сегашната верзија';
 $lang['diff2']                 = 'Прикажи разлики помеѓу избраните ревизии';
 $lang['line']                  = 'Линија';
-$lang['breadcrumb']            = 'Следи';
-$lang['youarehere']            = 'Вие сте тука';
-$lang['lastmod']               = 'Последно изменета';
+$lang['breadcrumb']            = 'Следи:';
+$lang['youarehere']            = 'Вие сте тука:';
+$lang['lastmod']               = 'Последно изменета:';
 $lang['by']                    = 'од';
 $lang['deleted']               = 'отстранета';
 $lang['created']               = 'креирана';
@@ -172,16 +172,16 @@ $lang['metaedit']              = 'Уреди мета-податоци';
 $lang['metasaveerr']           = 'Запишување на мета-податоците не успеа';
 $lang['metasaveok']            = 'Мета-податоците се зачувани';
 $lang['btn_img_backto']            = 'Назад до %s';
-$lang['img_title']             = 'Насловна линија';
-$lang['img_caption']           = 'Наслов';
-$lang['img_date']              = 'Датум';
-$lang['img_fname']             = 'Име на датотека';
-$lang['img_fsize']             = 'Големина';
-$lang['img_artist']            = 'Фотограф';
-$lang['img_copyr']             = 'Авторско право';
-$lang['img_format']            = 'Формат';
-$lang['img_camera']            = 'Камера';
-$lang['img_keywords']          = 'Клучни зборови';
+$lang['img_title']             = 'Насловна линија:';
+$lang['img_caption']           = 'Наслов:';
+$lang['img_date']              = 'Датум:';
+$lang['img_fname']             = 'Име на датотека:';
+$lang['img_fsize']             = 'Големина:';
+$lang['img_artist']            = 'Фотограф:';
+$lang['img_copyr']             = 'Авторско право:';
+$lang['img_format']            = 'Формат:';
+$lang['img_camera']            = 'Камера:';
+$lang['img_keywords']          = 'Клучни зборови:';
 $lang['subscr_subscribe_success'] = 'Додаден/а е %s во претплатничката листа за %s';
 $lang['subscr_subscribe_error'] = 'Грешка при додавањето на %s во претплатничката листа за %s';
 $lang['subscr_subscribe_noaddress'] = 'Нема адреса за е-пошта поврзана со Вашата најава, не може да бидете додадени на претплатничката листа';
diff --git a/inc/lang/mr/lang.php b/inc/lang/mr/lang.php
index ab84e735384aac31b354774e6d795abc9d21f3b5..72779dd10f84a4710740195c5be0a842f059f262 100644
--- a/inc/lang/mr/lang.php
+++ b/inc/lang/mr/lang.php
@@ -54,7 +54,7 @@ $lang['btn_revert']            = 'पुनर्स्थापन';
 $lang['btn_register']          = 'नोंदणी';
 $lang['btn_apply']             = 'लागू';
 $lang['btn_media']             = 'मिडिया व्यवस्थापक';
-$lang['loggedinas']            = 'लॉगिन नाव';
+$lang['loggedinas']            = 'लॉगिन नाव:';
 $lang['user']                  = 'वापरकर्ता';
 $lang['pass']                  = 'परवलीचा शब्द';
 $lang['newpass']               = 'नवीन परवलीचा शब्द';
@@ -93,8 +93,8 @@ $lang['license']               = 'विशिष्ठ नोंद केल
 $lang['licenseok']             = 'नोंद : हे पृष्ठ संपादित केल्यास तुम्ही तुमचे योगदान खालील लायसन्स अंतर्गत येइल : ';
 $lang['searchmedia']           = 'फाईल शोधा:';
 $lang['searchmedia_in']        = '%s मधे शोधा';
-$lang['txt_upload']            = 'अपलोड करण्याची फाइल निवडा';
-$lang['txt_filename']          = 'अपलोड उर्फ़ ( वैकल्पिक )';
+$lang['txt_upload']            = 'अपलोड करण्याची फाइल निवडा:';
+$lang['txt_filename']          = 'अपलोड उर्फ़ ( वैकल्पिक ):';
 $lang['txt_overwrt']           = 'अस्तित्वात असलेल्या फाइलवरच सुरक्षित करा.';
 $lang['lockedby']              = 'सध्या लॉक करणारा :';
 $lang['lockexpire']            = 'सध्या लॉक करणारा :';
@@ -174,9 +174,9 @@ $lang['diff_type']             = 'फरक बघू:';
 $lang['diff_inline']           = 'एका ओळीत';
 $lang['diff_side']             = 'बाजूबाजूला';
 $lang['line']                  = 'ओळ';
-$lang['breadcrumb']            = 'मागमूस';
-$lang['youarehere']            = 'तुम्ही इथे आहात';
-$lang['lastmod']               = 'सर्वात शेवटचा बदल';
+$lang['breadcrumb']            = 'मागमूस:';
+$lang['youarehere']            = 'तुम्ही इथे आहात:';
+$lang['lastmod']               = 'सर्वात शेवटचा बदल:';
 $lang['by']                    = 'द्वारा';
 $lang['deleted']               = 'काढून टाकले';
 $lang['created']               = 'निर्माण केले';
@@ -228,18 +228,18 @@ $lang['metaedit']              = 'मेटाडेटा बदला';
 $lang['metasaveerr']           = 'मेटाडेटा सुरक्षित झाला नाही';
 $lang['metasaveok']            = 'मेटाडेटा सुरक्षित झाला';
 $lang['btn_img_backto']            = 'परत जा %s';
-$lang['img_title']             = 'नाव';
-$lang['img_caption']           = 'टीप';
-$lang['img_date']              = 'तारीख';
-$lang['img_fname']             = 'फाइल नाव';
-$lang['img_fsize']             = 'साइझ';
-$lang['img_artist']            = 'फोटोग्राफर';
-$lang['img_copyr']             = 'कॉपीराइट';
-$lang['img_format']            = 'प्रकार';
-$lang['img_camera']            = 'कॅमेरा';
-$lang['img_keywords']          = 'मुख्य शब्द';
-$lang['img_width']             = 'रुंदी';
-$lang['img_height']            = 'उंची';
+$lang['img_title']             = 'नाव:';
+$lang['img_caption']           = 'टीप:';
+$lang['img_date']              = 'तारीख:';
+$lang['img_fname']             = 'फाइल नाव:';
+$lang['img_fsize']             = 'साइझ:';
+$lang['img_artist']            = 'फोटोग्राफर:';
+$lang['img_copyr']             = 'कॉपीराइट:';
+$lang['img_format']            = 'प्रकार:';
+$lang['img_camera']            = 'कॅमेरा:';
+$lang['img_keywords']          = 'मुख्य शब्द:';
+$lang['img_width']             = 'रुंदी:';
+$lang['img_height']            = 'उंची:';
 $lang['btn_mediaManager']           = 'मिडिया व्यवस्थापकात बघू';
 $lang['authtempfail']          = 'सदस्य अधिकृत करण्याची सुविधा सध्या चालू नाही. सतत हा मजकूर दिसल्यास कृपया तुमच्या विकीच्या व्यवस्थापकाशी सम्पर्क साधा.';
 $lang['i_chooselang']          = 'तुमची भाषा निवडा';
diff --git a/inc/lang/ms/jquery.ui.datepicker.js b/inc/lang/ms/jquery.ui.datepicker.js
index e70de729959b3461e3711d4a47023599deaa5703..d452df3efbb70daa310361964569f05c7f24c98f 100644
--- a/inc/lang/ms/jquery.ui.datepicker.js
+++ b/inc/lang/ms/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Malaysian initialisation for the jQuery UI date picker plugin. */
 /* Written by Mohd Nawawi Mohamad Jamili (nawawi@ronggeng.net). */
-jQuery(function($){
-	$.datepicker.regional['ms'] = {
-		closeText: 'Tutup',
-		prevText: '&#x3C;Sebelum',
-		nextText: 'Selepas&#x3E;',
-		currentText: 'hari ini',
-		monthNames: ['Januari','Februari','Mac','April','Mei','Jun',
-		'Julai','Ogos','September','Oktober','November','Disember'],
-		monthNamesShort: ['Jan','Feb','Mac','Apr','Mei','Jun',
-		'Jul','Ogo','Sep','Okt','Nov','Dis'],
-		dayNames: ['Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu'],
-		dayNamesShort: ['Aha','Isn','Sel','Rab','kha','Jum','Sab'],
-		dayNamesMin: ['Ah','Is','Se','Ra','Kh','Ju','Sa'],
-		weekHeader: 'Mg',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 0,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['ms']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['ms'] = {
+	closeText: 'Tutup',
+	prevText: '&#x3C;Sebelum',
+	nextText: 'Selepas&#x3E;',
+	currentText: 'hari ini',
+	monthNames: ['Januari','Februari','Mac','April','Mei','Jun',
+	'Julai','Ogos','September','Oktober','November','Disember'],
+	monthNamesShort: ['Jan','Feb','Mac','Apr','Mei','Jun',
+	'Jul','Ogo','Sep','Okt','Nov','Dis'],
+	dayNames: ['Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu'],
+	dayNamesShort: ['Aha','Isn','Sel','Rab','kha','Jum','Sab'],
+	dayNamesMin: ['Ah','Is','Se','Ra','Kh','Ju','Sa'],
+	weekHeader: 'Mg',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 0,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['ms']);
+
+return datepicker.regional['ms'];
+
+}));
diff --git a/inc/lang/ms/lang.php b/inc/lang/ms/lang.php
index 02c0e2c91f6cf5c77dc4440a0921eee29492fb02..303116429a8451e8d109a6ca361dfbc0e7368d99 100644
--- a/inc/lang/ms/lang.php
+++ b/inc/lang/ms/lang.php
@@ -47,7 +47,7 @@ $lang['btn_revert']            = 'Pulihkan';
 $lang['btn_register']          = 'Daftaran';
 $lang['btn_apply']             = 'Simpan';
 $lang['btn_media']             = 'Manager media';
-$lang['loggedinas']            = 'Log masuk sebagai';
+$lang['loggedinas']            = 'Log masuk sebagai:';
 $lang['user']                  = 'Nama pengguna';
 $lang['pass']                  = 'Kata laluan';
 $lang['newpass']               = 'Kata laluan baru';
@@ -83,10 +83,10 @@ $lang['license']               = 'Selain daripada yang dinyata, isi wiki ini dis
 $lang['licenseok']             = 'Perhatian: Dengan menyunting halaman ini, anda setuju untuk isi-isi anda dilesen menggunakan lesen berikut:';
 $lang['searchmedia']           = 'Cari nama fail:';
 $lang['searchmedia_in']        = 'Cari di %s';
-$lang['txt_upload']            = 'Pilih fail untuk diunggah';
-$lang['txt_filename']          = 'Unggah fail dengan nama (tidak wajib)';
+$lang['txt_upload']            = 'Pilih fail untuk diunggah:';
+$lang['txt_filename']          = 'Unggah fail dengan nama (tidak wajib):';
 $lang['txt_overwrt']           = 'Timpa fail sekarang';
-$lang['lockedby']              = 'Halaman ini telah di';
+$lang['lockedby']              = 'Halaman ini telah di:';
 $lang['fileupload']            = 'Muat naik fail';
 $lang['uploadsucc']            = 'Pemuatan naik berjaya';
 $lang['uploadfail']            = 'Ralat muat naik';
diff --git a/inc/lang/ne/lang.php b/inc/lang/ne/lang.php
index a7d694d5bdf21db408489b936af156378b094a7c..ddf0312422d1977ed16b999b8e3c2c766fc95e8a 100644
--- a/inc/lang/ne/lang.php
+++ b/inc/lang/ne/lang.php
@@ -44,7 +44,7 @@ $lang['btn_draft']             = ' ड्राफ्ट सम्पादन 
 $lang['btn_recover']           = 'पहिलेको ड्राफ्ट हासिल गर्नुहोस ';
 $lang['btn_draftdel']          = ' ड्राफ्ट मेटाउनुहोस् ';
 $lang['btn_register']          = 'दर्ता  गर्नुहोस्';
-$lang['loggedinas']            = 'प्रवेश गर्नुहोस् ';
+$lang['loggedinas']            = 'प्रवेश गर्नुहोस् :';
 $lang['user']                  = 'प्रयोगकर्ता ';
 $lang['pass']                  = 'प्रवेशशव्द';
 $lang['newpass']               = 'नयाँ प्रवेशशव्द';
@@ -80,10 +80,10 @@ $lang['resendpwdconfirm']      = 'तपाईको इमेलमा कन
 $lang['resendpwdsuccess']      = 'तपाईको प्रवेशशव्द इमेलबाट पठाइएको छ। ';
 $lang['license']               = 'खुलाइएको बाहेक, यस विकिका विषयवस्तुहरु निम्त प्रमाण द्वारा प्रमाणिक गरिएको छ।';
 $lang['licenseok']             = 'नोट: यस पृष्ठ सम्पादन गरी तपाईले आफ्नो विषयवस्तु तलको प्रमाण पत्र अन्तर्गत प्रमाणिक गर्न राजी हुनु हुनेछ ।';
-$lang['txt_upload']            = 'अपलोड गर्नलाई फाइल छा्न्नुहो्स्';
-$lang['txt_filename']          = 'अर्को रुपमा अपलोड गर्नुहोस् (ऐच्छिक)';
+$lang['txt_upload']            = 'अपलोड गर्नलाई फाइल छा्न्नुहो्स्:';
+$lang['txt_filename']          = 'अर्को रुपमा अपलोड गर्नुहोस् (ऐच्छिक):';
 $lang['txt_overwrt']           = 'रहेको उहि नामको फाइललाई मेटाउने';
-$lang['lockedby']              = 'अहिले ताल्चा लगाइएको';
+$lang['lockedby']              = 'अहिले ताल्चा लगाइएको:';
 $lang['lockexpire']            = 'ताल्चा अवधि सकिने :';
 $lang['js']['willexpire']      = 'तपाईलले यो पृष्ठ सम्पादन गर्न लगाउनु भएको ताल्चाको अवधि एक मिनेट भित्र सकिदै छ। \n द्वन्द हुन नदिन  पूर्वरुप वा ताल्चा समय परिवर्तन गर्नुहोस् ।';
 $lang['js']['notsavedyet']     = 'तपाईले वचन गर्नु नभएको परिवर्रन हराउने छ। \n साच्चै जारी गर्नुहुन्छ ।';
@@ -123,9 +123,9 @@ $lang['yours']                 = 'तपाईको संस्करण';
 $lang['diff']                  = 'हालको संस्करण सँगको भिन्नता';
 $lang['diff2']                 = 'रोजिएका संस्करण वीचका भिन्नताहरु ';
 $lang['line']                  = 'हरफ';
-$lang['breadcrumb']            = 'छुट्ट्याउनुहोस् ';
-$lang['youarehere']            = 'तपाई यहा हुनुहुन्छ';
-$lang['lastmod']               = 'अन्तिम पटक सच्याइएको';
+$lang['breadcrumb']            = 'छुट्ट्याउनुहोस् :';
+$lang['youarehere']            = 'तपाई यहा हुनुहुन्छ:';
+$lang['lastmod']               = 'अन्तिम पटक सच्याइएको:';
 $lang['by']                    = 'द्वारा ';
 $lang['deleted']               = 'हटाइएको';
 $lang['created']               = 'निर्माण गरिएको';
@@ -159,16 +159,16 @@ $lang['metaedit']              = 'मेटाडेटा सम्पादन
 $lang['metasaveerr']           = 'मेटाडाटा लेखन असफल';
 $lang['metasaveok']            = 'मेटाडाटा वचत भयो ';
 $lang['btn_img_backto']            = 'फिर्ता%s';
-$lang['img_title']             = 'शिर्षक';
-$lang['img_caption']           = 'निम्न लेख';
-$lang['img_date']              = 'मिति';
-$lang['img_fname']             = 'फाइलनाम';
-$lang['img_fsize']             = 'आकार';
-$lang['img_artist']            = 'चित्रकार';
-$lang['img_copyr']             = 'सर्वाधिकार';
-$lang['img_format']            = 'ढाचा';
-$lang['img_camera']            = 'क्यामेरा';
-$lang['img_keywords']          = 'खोज शब्द';
+$lang['img_title']             = 'शिर्षक:';
+$lang['img_caption']           = 'निम्न लेख:';
+$lang['img_date']              = 'मिति:';
+$lang['img_fname']             = 'फाइलनाम:';
+$lang['img_fsize']             = 'आकार:';
+$lang['img_artist']            = 'चित्रकार:';
+$lang['img_copyr']             = 'सर्वाधिकार:';
+$lang['img_format']            = 'ढाचा:';
+$lang['img_camera']            = 'क्यामेरा:';
+$lang['img_keywords']          = 'खोज शब्द:';
 $lang['authtempfail']          = 'प्रयोगकर्ता प्रामाणिकरण अस्थाइरुपमा अनुपलब्ध छ। यदि यो समस्या रहि रहेमा तपाईको  विकि एड्मिनलाई खवर गर्नुहोला ।';
 $lang['i_chooselang']          = 'भाषा छान्नुहोस् ';
 $lang['i_installer']           = 'DokuWiki  स्थापक';
diff --git a/inc/lang/nl/jquery.ui.datepicker.js b/inc/lang/nl/jquery.ui.datepicker.js
index 203f16069d6242952f80a9c8eb0173e806cfb1a3..9be14bb2aa68035c65560669f21111d5729dab8f 100644
--- a/inc/lang/nl/jquery.ui.datepicker.js
+++ b/inc/lang/nl/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */
 /* Written by Mathias Bynens <http://mathiasbynens.be/> */
-jQuery(function($){
-	$.datepicker.regional.nl = {
-		closeText: 'Sluiten',
-		prevText: '←',
-		nextText: '→',
-		currentText: 'Vandaag',
-		monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
-		'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
-		monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun',
-		'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
-		dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
-		dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
-		dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
-		weekHeader: 'Wk',
-		dateFormat: 'dd-mm-yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional.nl);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional.nl = {
+	closeText: 'Sluiten',
+	prevText: '←',
+	nextText: '→',
+	currentText: 'Vandaag',
+	monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
+	'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
+	monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun',
+	'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
+	dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
+	dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
+	dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
+	weekHeader: 'Wk',
+	dateFormat: 'dd-mm-yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional.nl);
+
+return datepicker.regional.nl;
+
+}));
diff --git a/inc/lang/nl/lang.php b/inc/lang/nl/lang.php
index b6cf11968494cd3e946a0e80898a8d1a658a692c..a9058720c07eb83258b21961fc09cd6a0020ace9 100644
--- a/inc/lang/nl/lang.php
+++ b/inc/lang/nl/lang.php
@@ -23,14 +23,15 @@
  * @author Remon <no@email.local>
  * @author gicalle <gicalle@hotmail.com>
  * @author Rene <wllywlnt@yahoo.com>
+ * @author Johan Vervloet <johan.vervloet@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
-$lang['doublequoteopening']    = '„';
+$lang['doublequoteopening']    = '“';
 $lang['doublequoteclosing']    = '”';
-$lang['singlequoteopening']    = '‚';
+$lang['singlequoteopening']    = '‘';
 $lang['singlequoteclosing']    = '’';
-$lang['apostrophe']            = '\'';
+$lang['apostrophe']            = '’';
 $lang['btn_edit']              = 'Pagina aanpassen';
 $lang['btn_source']            = 'Toon broncode';
 $lang['btn_show']              = 'Toon pagina';
@@ -69,7 +70,7 @@ $lang['btn_media']             = 'Mediabeheerder';
 $lang['btn_deleteuser']        = 'Verwijder mijn account';
 $lang['btn_img_backto']        = 'Terug naar %s';
 $lang['btn_mediaManager']      = 'In mediabeheerder bekijken';
-$lang['loggedinas']            = 'Ingelogd als';
+$lang['loggedinas']            = 'Ingelogd als:';
 $lang['user']                  = 'Gebruikersnaam';
 $lang['pass']                  = 'Wachtwoord';
 $lang['newpass']               = 'Nieuw wachtwoord';
@@ -114,12 +115,12 @@ $lang['license']               = 'Tenzij anders vermeld valt de inhoud van deze
 $lang['licenseok']             = 'Let op: Door deze pagina aan te passen geef je de inhoud vrij onder de volgende licentie:';
 $lang['searchmedia']           = 'Bestandsnaam zoeken:';
 $lang['searchmedia_in']        = 'Zoek in %s';
-$lang['txt_upload']            = 'Selecteer een bestand om te uploaden';
-$lang['txt_filename']          = 'Vul nieuwe naam in (optioneel)';
+$lang['txt_upload']            = 'Selecteer een bestand om te uploaden:';
+$lang['txt_filename']          = 'Vul nieuwe naam in (optioneel):';
 $lang['txt_overwrt']           = 'Overschrijf bestaand bestand';
 $lang['maxuploadsize']         = 'Max %s per bestand';
-$lang['lockedby']              = 'Momenteel in gebruik door';
-$lang['lockexpire']            = 'Exclusief gebruiksrecht vervalt op';
+$lang['lockedby']              = 'Momenteel in gebruik door:';
+$lang['lockexpire']            = 'Exclusief gebruiksrecht vervalt op:';
 $lang['js']['willexpire']      = 'Je exclusieve gebruiksrecht voor het aanpassen van deze pagina verloopt over een minuut.\nKlik op de Voorbeeld-knop om het exclusieve gebruiksrecht te verlengen.';
 $lang['js']['notsavedyet']     = 'Nog niet bewaarde wijzigingen zullen verloren gaan.
 Weet je zeker dat je wilt doorgaan?';
@@ -206,9 +207,9 @@ $lang['difflastrev']           = 'Laatste revisie';
 $lang['diffbothprevrev']       = 'Beide kanten vorige revisie';
 $lang['diffbothnextrev']       = 'Beide kanten volgende revisie';
 $lang['line']                  = 'Regel';
-$lang['breadcrumb']            = 'Spoor';
-$lang['youarehere']            = 'Je bent hier';
-$lang['lastmod']               = 'Laatst gewijzigd';
+$lang['breadcrumb']            = 'Spoor:';
+$lang['youarehere']            = 'Je bent hier:';
+$lang['lastmod']               = 'Laatst gewijzigd:';
 $lang['by']                    = 'door';
 $lang['deleted']               = 'verwijderd';
 $lang['created']               = 'aangemaakt';
@@ -261,18 +262,18 @@ $lang['admin_register']        = 'Nieuwe gebruiker toevoegen';
 $lang['metaedit']              = 'Metadata wijzigen';
 $lang['metasaveerr']           = 'Schrijven van metadata mislukt';
 $lang['metasaveok']            = 'Metadata bewaard';
-$lang['img_title']             = 'Titel';
-$lang['img_caption']           = 'Bijschrift';
-$lang['img_date']              = 'Datum';
-$lang['img_fname']             = 'Bestandsnaam';
-$lang['img_fsize']             = 'Grootte';
-$lang['img_artist']            = 'Fotograaf';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Formaat';
-$lang['img_camera']            = 'Camera';
-$lang['img_keywords']          = 'Trefwoorden';
-$lang['img_width']             = 'Breedte';
-$lang['img_height']            = 'Hoogte';
+$lang['img_title']             = 'Titel:';
+$lang['img_caption']           = 'Bijschrift:';
+$lang['img_date']              = 'Datum:';
+$lang['img_fname']             = 'Bestandsnaam:';
+$lang['img_fsize']             = 'Grootte:';
+$lang['img_artist']            = 'Fotograaf:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Formaat:';
+$lang['img_camera']            = 'Camera:';
+$lang['img_keywords']          = 'Trefwoorden:';
+$lang['img_width']             = 'Breedte:';
+$lang['img_height']            = 'Hoogte:';
 $lang['subscr_subscribe_success'] = '%s is ingeschreven voor %s';
 $lang['subscr_subscribe_error'] = 'Fout bij inschrijven van %s voor %s';
 $lang['subscr_subscribe_noaddress'] = 'Er is geen e-mailadres gekoppeld aan uw account, u kunt daardoor niet worden ingeschreven.';
diff --git a/inc/lang/no/jquery.ui.datepicker.js b/inc/lang/no/jquery.ui.datepicker.js
index d36e430be6d04de6631cc1f6cb7d928dc1a22de0..8917b6a26c3a6d957f05f534396bef509277891b 100644
--- a/inc/lang/no/jquery.ui.datepicker.js
+++ b/inc/lang/no/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Norwegian initialisation for the jQuery UI date picker plugin. */
 /* Written by Naimdjon Takhirov (naimdjon@gmail.com). */
 
-jQuery(function($){
-	$.datepicker.regional['no'] = {
-		closeText: 'Lukk',
-		prevText: '&#xAB;Forrige',
-		nextText: 'Neste&#xBB;',
-		currentText: 'I dag',
-		monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'],
-		monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'],
-		dayNamesShort: ['søn','man','tir','ons','tor','fre','lør'],
-		dayNames: ['søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag'],
-		dayNamesMin: ['sø','ma','ti','on','to','fr','lø'],
-		weekHeader: 'Uke',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''
-	};
-	$.datepicker.setDefaults($.datepicker.regional['no']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['no'] = {
+	closeText: 'Lukk',
+	prevText: '&#xAB;Forrige',
+	nextText: 'Neste&#xBB;',
+	currentText: 'I dag',
+	monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'],
+	monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'],
+	dayNamesShort: ['søn','man','tir','ons','tor','fre','lør'],
+	dayNames: ['søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag'],
+	dayNamesMin: ['sø','ma','ti','on','to','fr','lø'],
+	weekHeader: 'Uke',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''
+};
+datepicker.setDefaults(datepicker.regional['no']);
+
+return datepicker.regional['no'];
+
+}));
diff --git a/inc/lang/no/lang.php b/inc/lang/no/lang.php
index 8b3c4937f81b1462115b40fcbf088064ae2794b8..6156fa34c91c47a1fd8efdbe04d690202ad8dea9 100644
--- a/inc/lang/no/lang.php
+++ b/inc/lang/no/lang.php
@@ -67,7 +67,7 @@ $lang['btn_media']             = 'Mediefiler';
 $lang['btn_deleteuser']        = 'Fjern min konto';
 $lang['btn_img_backto']        = 'Tilbake til %s';
 $lang['btn_mediaManager']      = 'Vis i mediefilbehandler';
-$lang['loggedinas']            = 'Innlogget som';
+$lang['loggedinas']            = 'Innlogget som:';
 $lang['user']                  = 'Brukernavn';
 $lang['pass']                  = 'Passord';
 $lang['newpass']               = 'Nytt passord';
@@ -112,12 +112,12 @@ $lang['license']               = 'Der annet ikke er angitt, er innholdet på den
 $lang['licenseok']             = 'Merk: Ved å endre på denne siden godtar du at ditt innhold utgis under følgende lisens:';
 $lang['searchmedia']           = 'Søk filnavn';
 $lang['searchmedia_in']        = 'Søk i %s';
-$lang['txt_upload']            = 'Velg fil som skal lastes opp';
-$lang['txt_filename']          = 'Skriv inn wikinavn (alternativt)';
+$lang['txt_upload']            = 'Velg fil som skal lastes opp:';
+$lang['txt_filename']          = 'Skriv inn wikinavn (alternativt):';
 $lang['txt_overwrt']           = 'Overskriv eksisterende fil';
 $lang['maxuploadsize']         = 'Opplast maks % per fil.';
-$lang['lockedby']              = 'LÃ¥st av';
-$lang['lockexpire']            = 'Låsingen utløper';
+$lang['lockedby']              = 'LÃ¥st av:';
+$lang['lockexpire']            = 'Låsingen utløper:';
 $lang['js']['willexpire']      = 'Din redigeringslås for dette dokumentet kommer snart til å utløpe.\nFor å unngå versjonskonflikter bør du forhåndsvise dokumentet ditt for å forlenge redigeringslåsen.';
 $lang['js']['notsavedyet']     = 'Ulagrede endringer vil gå tapt!
 Vil du fortsette?';
@@ -204,9 +204,9 @@ $lang['difflastrev']           = 'Siste revisjon';
 $lang['diffbothprevrev']       = 'Begge sider forrige revisjon';
 $lang['diffbothnextrev']       = 'Begge sider neste revisjon';
 $lang['line']                  = 'Linje';
-$lang['breadcrumb']            = 'Spor';
-$lang['youarehere']            = 'Du er her';
-$lang['lastmod']               = 'Sist endret';
+$lang['breadcrumb']            = 'Spor:';
+$lang['youarehere']            = 'Du er her:';
+$lang['lastmod']               = 'Sist endret:';
 $lang['by']                    = 'av';
 $lang['deleted']               = 'fjernet';
 $lang['created']               = 'opprettet';
@@ -259,18 +259,18 @@ $lang['admin_register']        = 'Legg til ny bruker';
 $lang['metaedit']              = 'Rediger metadata';
 $lang['metasaveerr']           = 'Skriving av metadata feilet';
 $lang['metasaveok']            = 'Metadata lagret';
-$lang['img_title']             = 'Tittel';
-$lang['img_caption']           = 'Bildetekst';
-$lang['img_date']              = 'Dato';
-$lang['img_fname']             = 'Filnavn';
-$lang['img_fsize']             = 'Størrelse';
-$lang['img_artist']            = 'Fotograf';
-$lang['img_copyr']             = 'Opphavsrett';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Nøkkelord';
-$lang['img_width']             = 'Bredde';
-$lang['img_height']            = 'Høyde';
+$lang['img_title']             = 'Tittel:';
+$lang['img_caption']           = 'Bildetekst:';
+$lang['img_date']              = 'Dato:';
+$lang['img_fname']             = 'Filnavn:';
+$lang['img_fsize']             = 'Størrelse:';
+$lang['img_artist']            = 'Fotograf:';
+$lang['img_copyr']             = 'Opphavsrett:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Nøkkelord:';
+$lang['img_width']             = 'Bredde:';
+$lang['img_height']            = 'Høyde:';
 $lang['subscr_subscribe_success'] = 'La til %s som abonnent på %s';
 $lang['subscr_subscribe_error'] = 'Klarte ikke å legge til %s som abonnent på %s';
 $lang['subscr_subscribe_noaddress'] = 'Brukeren din er ikke registrert med noen adresse. Du kan derfor ikke legges til som abonnent.';
diff --git a/inc/lang/pl/jquery.ui.datepicker.js b/inc/lang/pl/jquery.ui.datepicker.js
index 0ffc515b95b31a25ceb657b4d72fe328177d8956..a04de8e8a004ebc658cc1db1767627a1657959bb 100644
--- a/inc/lang/pl/jquery.ui.datepicker.js
+++ b/inc/lang/pl/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Polish initialisation for the jQuery UI date picker plugin. */
 /* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['pl'] = {
-		closeText: 'Zamknij',
-		prevText: '&#x3C;Poprzedni',
-		nextText: 'Następny&#x3E;',
-		currentText: 'DziÅ›',
-		monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
-		'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
-		monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
-		'Lip','Sie','Wrz','Pa','Lis','Gru'],
-		dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
-		dayNamesShort: ['Nie','Pn','Wt','Åšr','Czw','Pt','So'],
-		dayNamesMin: ['N','Pn','Wt','Åšr','Cz','Pt','So'],
-		weekHeader: 'Tydz',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['pl']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['pl'] = {
+	closeText: 'Zamknij',
+	prevText: '&#x3C;Poprzedni',
+	nextText: 'Następny&#x3E;',
+	currentText: 'DziÅ›',
+	monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
+	'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
+	monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
+	'Lip','Sie','Wrz','Pa','Lis','Gru'],
+	dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
+	dayNamesShort: ['Nie','Pn','Wt','Åšr','Czw','Pt','So'],
+	dayNamesMin: ['N','Pn','Wt','Åšr','Cz','Pt','So'],
+	weekHeader: 'Tydz',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['pl']);
+
+return datepicker.regional['pl'];
+
+}));
diff --git a/inc/lang/pl/lang.php b/inc/lang/pl/lang.php
index e65866761d399b560e2ea99fc1f71b7638ce3588..c6ff4983e936382986675d82c88b5d6f9840efae 100644
--- a/inc/lang/pl/lang.php
+++ b/inc/lang/pl/lang.php
@@ -16,6 +16,7 @@
  * @author Aoi Karasu <aoikarasu@gmail.com>
  * @author Tomasz Bosak <bosak.tomasz@gmail.com>
  * @author Paweł Jan Czochański <czochanski@gmail.com>
+ * @author Mati <mackosa@wp.pl>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -60,7 +61,9 @@ $lang['btn_register']          = 'Zarejestruj siÄ™!';
 $lang['btn_apply']             = 'Zastosuj';
 $lang['btn_media']             = 'Menadżer multimediów';
 $lang['btn_deleteuser']        = 'Usuń moje konto';
-$lang['loggedinas']            = 'Zalogowany jako';
+$lang['btn_img_backto']        = 'Wróć do %s';
+$lang['btn_mediaManager']      = 'Zobacz w menadżerze multimediów';
+$lang['loggedinas']            = 'Zalogowany jako:';
 $lang['user']                  = 'Użytkownik';
 $lang['pass']                  = 'Hasło';
 $lang['newpass']               = 'Nowe hasło';
@@ -105,12 +108,12 @@ $lang['license']               = 'Wszystkie treści w tym wiki, którym nie przy
 $lang['licenseok']             = 'Uwaga: edytując tę stronę zgadzasz się na publikowanie jej treści pod licencją:';
 $lang['searchmedia']           = 'Szukaj pliku o nazwie:';
 $lang['searchmedia_in']        = 'Szukaj w  %s';
-$lang['txt_upload']            = 'Wybierz plik do wysłania';
-$lang['txt_filename']          = 'Nazwa pliku (opcjonalnie)';
+$lang['txt_upload']            = 'Wybierz plik do wysłania:';
+$lang['txt_filename']          = 'Nazwa pliku (opcjonalnie):';
 $lang['txt_overwrt']           = 'Nadpisać istniejący plik?';
 $lang['maxuploadsize']         = 'Maksymalny rozmiar wysyłanych danych wynosi %s dla jednego pliku.';
-$lang['lockedby']              = 'Aktualnie zablokowane przez';
-$lang['lockexpire']            = 'Blokada wygasa';
+$lang['lockedby']              = 'Aktualnie zablokowane przez:';
+$lang['lockexpire']            = 'Blokada wygasa:';
 $lang['js']['willexpire']      = 'Twoja blokada edycji tej strony wygaśnie w ciągu minuty. \nW celu uniknięcia konfliktów użyj przycisku podglądu aby odnowić blokadę.';
 $lang['js']['notsavedyet']     = 'Nie zapisane zmiany zostanÄ… utracone.
 Czy na pewno kontynuować?';
@@ -191,10 +194,13 @@ $lang['difflink']              = 'Odnośnik do tego porównania';
 $lang['diff_type']             = 'Zobacz różnice:';
 $lang['diff_inline']           = 'W linii';
 $lang['diff_side']             = 'Jeden obok drugiego';
+$lang['diffprevrev']           = 'Poprzednia wersja';
+$lang['diffnextrev']           = 'Nowa wersja';
+$lang['difflastrev']           = 'Ostatnia wersja';
 $lang['line']                  = 'Linia';
-$lang['breadcrumb']            = 'Åšlad';
-$lang['youarehere']            = 'JesteÅ› tutaj';
-$lang['lastmod']               = 'ostatnio zmienione';
+$lang['breadcrumb']            = 'Åšlad:';
+$lang['youarehere']            = 'JesteÅ› tutaj:';
+$lang['lastmod']               = 'ostatnio zmienione:';
 $lang['by']                    = 'przez';
 $lang['deleted']               = 'usunięto';
 $lang['created']               = 'utworzono';
@@ -247,20 +253,18 @@ $lang['admin_register']        = 'Dodawanie użytkownika';
 $lang['metaedit']              = 'Edytuj metadane';
 $lang['metasaveerr']           = 'Zapis metadanych nie powiódł się';
 $lang['metasaveok']            = 'Metadane zapisano';
-$lang['btn_img_backto']            = 'Wróć do %s';
-$lang['img_title']             = 'Tytuł';
-$lang['img_caption']           = 'Nagłówek';
-$lang['img_date']              = 'Data';
-$lang['img_fname']             = 'Nazwa pliku';
-$lang['img_fsize']             = 'Rozmiar';
-$lang['img_artist']            = 'Fotograf';
-$lang['img_copyr']             = 'Prawa autorskie';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Aparat';
-$lang['img_keywords']          = 'SÅ‚owa kluczowe';
-$lang['img_width']             = 'Szerokość';
-$lang['img_height']            = 'Wysokość';
-$lang['btn_mediaManager']           = 'Zobacz w menadżerze multimediów';
+$lang['img_title']             = 'Tytuł:';
+$lang['img_caption']           = 'Nagłówek:';
+$lang['img_date']              = 'Data:';
+$lang['img_fname']             = 'Nazwa pliku:';
+$lang['img_fsize']             = 'Rozmiar:';
+$lang['img_artist']            = 'Fotograf:';
+$lang['img_copyr']             = 'Prawa autorskie:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Aparat:';
+$lang['img_keywords']          = 'SÅ‚owa kluczowe:';
+$lang['img_width']             = 'Szerokość:';
+$lang['img_height']            = 'Wysokość:';
 $lang['subscr_subscribe_success'] = 'Dodano %s do listy subskrypcji %s';
 $lang['subscr_subscribe_error'] = 'BÅ‚Ä…d podczas dodawania %s do listy subskrypcji %s';
 $lang['subscr_subscribe_noaddress'] = 'Brak adresu skojarzonego z twoim loginem, nie możesz zostać dodany(a) do listy subskrypcji';
diff --git a/inc/lang/pt-br/jquery.ui.datepicker.js b/inc/lang/pt-br/jquery.ui.datepicker.js
index 521967ec39a76ccc79f5aa97dd3f223b954853fc..d6bd899071548930cd80ca791d1b6bb9d72dd2b2 100644
--- a/inc/lang/pt-br/jquery.ui.datepicker.js
+++ b/inc/lang/pt-br/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Brazilian initialisation for the jQuery UI date picker plugin. */
 /* Written by Leonildo Costa Silva (leocsilva@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['pt-BR'] = {
-		closeText: 'Fechar',
-		prevText: '&#x3C;Anterior',
-		nextText: 'Próximo&#x3E;',
-		currentText: 'Hoje',
-		monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho',
-		'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
-		monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
-		'Jul','Ago','Set','Out','Nov','Dez'],
-		dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'],
-		dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
-		dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
-		weekHeader: 'Sm',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 0,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['pt-BR']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['pt-BR'] = {
+	closeText: 'Fechar',
+	prevText: '&#x3C;Anterior',
+	nextText: 'Próximo&#x3E;',
+	currentText: 'Hoje',
+	monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho',
+	'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
+	monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
+	'Jul','Ago','Set','Out','Nov','Dez'],
+	dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'],
+	dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
+	dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
+	weekHeader: 'Sm',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 0,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['pt-BR']);
+
+return datepicker.regional['pt-BR'];
+
+}));
diff --git a/inc/lang/pt-br/lang.php b/inc/lang/pt-br/lang.php
index d5539f9217a098e9870d6e49072305c97ec7c2f4..31940f5be1724bb648ea1b0edf0147874b9f98fe 100644
--- a/inc/lang/pt-br/lang.php
+++ b/inc/lang/pt-br/lang.php
@@ -23,6 +23,7 @@
  * @author Leone Lisboa Magevski <leone1983@gmail.com>
  * @author Dário Estevão <darioems@gmail.com>
  * @author Juliano Marconi Lanigra <juliano.marconi@gmail.com>
+ * @author Ednei <leuloch@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -67,7 +68,9 @@ $lang['btn_register']          = 'Cadastre-se';
 $lang['btn_apply']             = 'Aplicar';
 $lang['btn_media']             = 'Gerenciador de mídias';
 $lang['btn_deleteuser']        = 'Remover minha conta';
-$lang['loggedinas']            = 'Identificado(a) como';
+$lang['btn_img_backto']        = 'Voltar para %s';
+$lang['btn_mediaManager']      = 'Ver no gerenciador de mídias';
+$lang['loggedinas']            = 'Identificado(a) como:';
 $lang['user']                  = 'Nome de usuário';
 $lang['pass']                  = 'Senha';
 $lang['newpass']               = 'Nova senha';
@@ -112,12 +115,12 @@ $lang['license']               = 'Exceto onde for informado ao contrário, o con
 $lang['licenseok']             = 'Observe: editando esta página você aceita disponibilizar o seu conteúdo sob a seguinte licença:';
 $lang['searchmedia']           = 'Buscar arquivo:';
 $lang['searchmedia_in']        = 'Buscar em %s';
-$lang['txt_upload']            = 'Selecione o arquivo a ser enviado';
-$lang['txt_filename']          = 'Enviar como (opcional)';
+$lang['txt_upload']            = 'Selecione o arquivo a ser enviado:';
+$lang['txt_filename']          = 'Enviar como (opcional):';
 $lang['txt_overwrt']           = 'Substituir o arquivo existente';
 $lang['maxuploadsize']         = 'Tamanho máximo de %s por arquivo.';
-$lang['lockedby']              = 'Atualmente bloqueada por';
-$lang['lockexpire']            = 'O bloqueio expira em';
+$lang['lockedby']              = 'Atualmente bloqueada por:';
+$lang['lockexpire']            = 'O bloqueio expira em:';
 $lang['js']['willexpire']      = 'O seu bloqueio de edição deste página irá expirar em um minuto.\nPara evitar conflitos de edição, clique no botão de visualização para reiniciar o temporizador de bloqueio.';
 $lang['js']['notsavedyet']     = 'As alterações não salvas serão perdidas.
 Deseja realmente continuar?';
@@ -198,10 +201,15 @@ $lang['difflink']              = 'Link para esta página de comparações';
 $lang['diff_type']             = 'Ver as diferenças:';
 $lang['diff_inline']           = 'Mescladas';
 $lang['diff_side']             = 'Lado a lado';
+$lang['diffprevrev']           = 'Revisão anterior';
+$lang['diffnextrev']           = 'Próxima revisão';
+$lang['difflastrev']           = 'Última revisão';
+$lang['diffbothprevrev']       = 'Ambos lados da revisão anterior';
+$lang['diffbothnextrev']       = 'Ambos lados da revisão seguinte';
 $lang['line']                  = 'Linha';
-$lang['breadcrumb']            = 'Visitou';
-$lang['youarehere']            = 'Você está aqui';
-$lang['lastmod']               = 'Última modificação';
+$lang['breadcrumb']            = 'Visitou:';
+$lang['youarehere']            = 'Você está aqui:';
+$lang['lastmod']               = 'Última modificação:';
 $lang['by']                    = 'por';
 $lang['deleted']               = 'removida';
 $lang['created']               = 'criada';
@@ -254,20 +262,18 @@ $lang['admin_register']        = 'Adicionar novo usuário';
 $lang['metaedit']              = 'Editar metadados';
 $lang['metasaveerr']           = 'Não foi possível escrever os metadados';
 $lang['metasaveok']            = 'Os metadados foram salvos';
-$lang['btn_img_backto']            = 'Voltar para %s';
-$lang['img_title']             = 'Título';
-$lang['img_caption']           = 'Descrição';
-$lang['img_date']              = 'Data';
-$lang['img_fname']             = 'Nome do arquivo';
-$lang['img_fsize']             = 'Tamanho';
-$lang['img_artist']            = 'Fotógrafo';
-$lang['img_copyr']             = 'Direitos autorais';
-$lang['img_format']            = 'Formato';
-$lang['img_camera']            = 'Câmera';
-$lang['img_keywords']          = 'Palavras-chave';
-$lang['img_width']             = 'Largura';
-$lang['img_height']            = 'Altura';
-$lang['btn_mediaManager']           = 'Ver no gerenciador de mídias';
+$lang['img_title']             = 'Título:';
+$lang['img_caption']           = 'Descrição:';
+$lang['img_date']              = 'Data:';
+$lang['img_fname']             = 'Nome do arquivo:';
+$lang['img_fsize']             = 'Tamanho:';
+$lang['img_artist']            = 'Fotógrafo:';
+$lang['img_copyr']             = 'Direitos autorais:';
+$lang['img_format']            = 'Formato:';
+$lang['img_camera']            = 'Câmera:';
+$lang['img_keywords']          = 'Palavras-chave:';
+$lang['img_width']             = 'Largura:';
+$lang['img_height']            = 'Altura:';
 $lang['subscr_subscribe_success'] = 'Adicionado %s à lista de monitoramentos de %s';
 $lang['subscr_subscribe_error'] = 'Ocorreu um erro na adição de %s à lista de monitoramentos de %s';
 $lang['subscr_subscribe_noaddress'] = 'Como não há nenhum endereço associado ao seu usuário, você não pode ser adicionado à lista de monitoramento';
@@ -296,6 +302,7 @@ $lang['i_modified']            = 'Por questões de segurança, esse script funci
 Você pode extrair novamente os arquivos do pacote original ou consultar as <a href="http://dokuwiki.org/install">instruções de instalação do DokuWiki</a>.';
 $lang['i_funcna']              = 'A função PHP <code>%s</code> não está disponível. O seu host a mantém desabilitada por algum motivo?';
 $lang['i_phpver']              = 'A sua versão do PHP (<code>%s</code>) é inferior à necessária (<code>%s</code>). Você precisa atualizar a sua instalação do PHP.';
+$lang['i_mbfuncoverload']      = 'mbstring.func_overload precisa ser desabilitado no php.ini para executar o DokuWiki';
 $lang['i_permfail']            = 'O DokuWiki não tem permissão de escrita em <code>%s</code>. Você precisa corrigir as configurações de permissão nesse diretório!';
 $lang['i_confexists']          = '<code>%s</code> já existe';
 $lang['i_writeerr']            = 'Não foi possível criar <code>%s</code>. É necessário checar as permissões de arquivos/diretórios e criar o arquivo manualmente.';
diff --git a/inc/lang/pt/jquery.ui.datepicker.js b/inc/lang/pt/jquery.ui.datepicker.js
index 4fb16f0329c958b3b89f437c68866a1403d5d6dd..bb46838e2da39119ca8717caf5b376427ff585cd 100644
--- a/inc/lang/pt/jquery.ui.datepicker.js
+++ b/inc/lang/pt/jquery.ui.datepicker.js
@@ -1,22 +1,36 @@
 /* Portuguese initialisation for the jQuery UI date picker plugin. */
-jQuery(function($){
-	$.datepicker.regional['pt'] = {
-		closeText: 'Fechar',
-		prevText: 'Anterior',
-		nextText: 'Seguinte',
-		currentText: 'Hoje',
-		monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho',
-		'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
-		monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
-		'Jul','Ago','Set','Out','Nov','Dez'],
-		dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'],
-		dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
-		dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
-		weekHeader: 'Sem',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 0,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['pt']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['pt'] = {
+	closeText: 'Fechar',
+	prevText: 'Anterior',
+	nextText: 'Seguinte',
+	currentText: 'Hoje',
+	monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho',
+	'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
+	monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
+	'Jul','Ago','Set','Out','Nov','Dez'],
+	dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'],
+	dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
+	dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
+	weekHeader: 'Sem',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 0,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['pt']);
+
+return datepicker.regional['pt'];
+
+}));
diff --git a/inc/lang/pt/lang.php b/inc/lang/pt/lang.php
index b2bb2dc348f151ba4b3abd7d6b64743e98101320..ddc9b33ab38ca2dcd4f6a66112ac24ae787cdbb8 100644
--- a/inc/lang/pt/lang.php
+++ b/inc/lang/pt/lang.php
@@ -2,13 +2,15 @@
 
 /**
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
- *
+ * 
  * @author José Carlos Monteiro <jose.c.monteiro@netcabo.pt>
  * @author José Monteiro <Jose.Monteiro@DoWeDo-IT.com>
  * @author Enrico Nicoletto <liverig@gmail.com>
  * @author Fil <fil@meteopt.com>
  * @author André Neves <drakferion@gmail.com>
  * @author José Campos zecarlosdecampos@gmail.com
+ * @author Murilo <muriloricci@hotmail.com>
+ * @author Paulo Silva <paulotsilva@yahoo.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -44,6 +46,7 @@ $lang['btn_backtomedia']       = 'Voltar à Selecção de Media';
 $lang['btn_subscribe']         = 'Subscrever Alterações';
 $lang['btn_profile']           = 'Actualizar Perfil';
 $lang['btn_reset']             = 'Limpar';
+$lang['btn_resendpwd']         = 'Definir nova senha';
 $lang['btn_draft']             = 'Editar rascunho';
 $lang['btn_recover']           = 'Recuperar rascunho';
 $lang['btn_draftdel']          = 'Apagar rascunho';
@@ -52,7 +55,9 @@ $lang['btn_register']          = 'Registar';
 $lang['btn_apply']             = 'Aplicar';
 $lang['btn_media']             = 'Gestor de Media';
 $lang['btn_deleteuser']        = 'Remover a Minha Conta';
-$lang['loggedinas']            = 'Está em sessão como';
+$lang['btn_img_backto']        = 'De volta a %s';
+$lang['btn_mediaManager']      = 'Ver em gestor de media';
+$lang['loggedinas']            = 'Está em sessão como:';
 $lang['user']                  = 'Utilizador';
 $lang['pass']                  = 'Senha';
 $lang['newpass']               = 'Nova senha';
@@ -63,6 +68,7 @@ $lang['fullname']              = 'Nome completo';
 $lang['email']                 = 'Email';
 $lang['profile']               = 'Perfil do Utilizador';
 $lang['badlogin']              = 'O utilizador inválido ou senha inválida.';
+$lang['badpassconfirm']        = 'Infelizmente a palavra-passe não é a correcta';
 $lang['minoredit']             = 'Alterações Menores';
 $lang['draftdate']             = 'Rascunho automaticamente gravado em';
 $lang['nosecedit']             = 'A página foi modificada entretanto. Como a informação da secção estava desactualizada, foi carregada a página inteira.';
@@ -82,8 +88,11 @@ $lang['profchanged']           = 'Perfil do utilizador actualizado com sucesso.'
 $lang['profnodelete']          = 'Esta wiki não suporta remoção de utilizadores';
 $lang['profdeleteuser']        = 'Apagar Conta';
 $lang['profdeleted']           = 'A sua conta de utilizador foi removida desta wiki';
+$lang['profconfdelete']        = 'Quero remover a minha conta desta wiki. <br/> Esta acção não pode ser anulada.';
+$lang['profconfdeletemissing'] = 'A caixa de confirmação não foi marcada';
 $lang['pwdforget']             = 'Esqueceu a sua senha? Pedir nova senha';
 $lang['resendna']              = 'Este wiki não suporta reenvio de senhas.';
+$lang['resendpwd']             = 'Definir nova senha para';
 $lang['resendpwdmissing']      = 'É preciso preencher todos os campos.';
 $lang['resendpwdnouser']       = 'Não foi possível encontrar este utilizador.';
 $lang['resendpwdbadauth']      = 'O código de autenticação não é válido. Por favor, assegure-se de que o link de confirmação está completo.';
@@ -93,11 +102,11 @@ $lang['license']               = 'Excepto menção em contrário, o conteúdo ne
 $lang['licenseok']             = 'Nota: Ao editar esta página você aceita disponibilizar o seu conteúdo sob a seguinte licença:';
 $lang['searchmedia']           = 'Procurar nome de ficheiro:';
 $lang['searchmedia_in']        = 'Procurar em %s';
-$lang['txt_upload']            = 'Escolha ficheiro para carregar';
-$lang['txt_filename']          = 'Carregar como (opcional)';
+$lang['txt_upload']            = 'Escolha ficheiro para carregar:';
+$lang['txt_filename']          = 'Carregar como (opcional):';
 $lang['txt_overwrt']           = 'Escrever por cima do ficheiro já existente';
-$lang['lockedby']              = 'Bloqueado por';
-$lang['lockexpire']            = 'Expira em';
+$lang['lockedby']              = 'Bloqueado por:';
+$lang['lockexpire']            = 'Expira em:';
 $lang['js']['willexpire']      = 'O bloqueio de edição para este documento irá expirar num minuto.\nPara evitar conflitos use o botão Prever para re-iniciar o temporizador de bloqueio.';
 $lang['js']['notsavedyet']     = 'Alterações não gravadas serão perdidas.';
 $lang['js']['searchmedia']     = 'Procurar por ficheiros';
@@ -177,10 +186,13 @@ $lang['difflink']              = 'Ligação para esta vista de comparação';
 $lang['diff_type']             = 'Ver diferenças';
 $lang['diff_inline']           = 'Embutido';
 $lang['diff_side']             = 'Lado a lado';
+$lang['diffprevrev']           = 'Revisão anterior';
+$lang['diffnextrev']           = 'Próxima revisão';
+$lang['difflastrev']           = 'Última revisão';
 $lang['line']                  = 'Linha';
-$lang['breadcrumb']            = 'Está em';
-$lang['youarehere']            = 'Está aqui';
-$lang['lastmod']               = 'Esta página foi modificada pela última vez em';
+$lang['breadcrumb']            = 'Está em:';
+$lang['youarehere']            = 'Está aqui:';
+$lang['lastmod']               = 'Esta página foi modificada pela última vez em:';
 $lang['by']                    = 'por';
 $lang['deleted']               = 'Documento automaticamente removido.';
 $lang['created']               = 'Criação deste novo documento.';
@@ -233,20 +245,18 @@ $lang['admin_register']        = 'Registar Novo Utilizador';
 $lang['metaedit']              = 'Editar Metadata';
 $lang['metasaveerr']           = 'Falhou a escrita de Metadata';
 $lang['metasaveok']            = 'Metadata gravada';
-$lang['btn_img_backto']            = 'De volta a %s';
-$lang['img_title']             = 'Título';
-$lang['img_caption']           = 'Legenda';
-$lang['img_date']              = 'Data';
-$lang['img_fname']             = 'Ficheiro';
-$lang['img_fsize']             = 'Tamanho';
-$lang['img_artist']            = 'Fotógrafo';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Formato';
-$lang['img_camera']            = 'Câmara';
-$lang['img_keywords']          = 'Palavras-Chave';
-$lang['img_width']             = 'Largura';
-$lang['img_height']            = 'Altura';
-$lang['btn_mediaManager']           = 'Ver em gestor de media';
+$lang['img_title']             = 'Título:';
+$lang['img_caption']           = 'Legenda:';
+$lang['img_date']              = 'Data:';
+$lang['img_fname']             = 'Ficheiro:';
+$lang['img_fsize']             = 'Tamanho:';
+$lang['img_artist']            = 'Fotógrafo:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Formato:';
+$lang['img_camera']            = 'Câmara:';
+$lang['img_keywords']          = 'Palavras-Chave:';
+$lang['img_width']             = 'Largura:';
+$lang['img_height']            = 'Altura:';
 $lang['subscr_subscribe_success'] = 'Adicionado %s à lista de subscrição para %s';
 $lang['subscr_subscribe_error'] = 'Erro ao adicionar %s à lista de subscrição para %s';
 $lang['subscr_subscribe_noaddress'] = 'Não existe endereço algum associado com o seu nome de utilizador, não pode ser adicionado à lista de subscrição';
@@ -285,6 +295,7 @@ $lang['i_policy']              = 'Politica ACL inicial';
 $lang['i_pol0']                = 'Wiki Aberto (ler, escrever e carregar para todos)';
 $lang['i_pol1']                = 'Wiki Público (ler para todos, escrever e carregar para utilizadores inscritos)';
 $lang['i_pol2']                = 'Wiki Fechado (ler, escrever e carregar somente para utilizadores inscritos)';
+$lang['i_allowreg']            = 'Permitir aos utilizadores registarem-se por si próprios';
 $lang['i_retry']               = 'Repetir';
 $lang['i_license']             = 'Por favor escolha a licença sob a qual quer colocar o seu conteúdo:';
 $lang['i_license_none']        = 'Não mostrar nenhuma informação de licença';
@@ -305,9 +316,11 @@ $lang['media_file']            = 'Ficheiro';
 $lang['media_viewtab']         = 'Ver';
 $lang['media_edittab']         = 'Editar';
 $lang['media_historytab']      = 'Histórico';
+$lang['media_list_thumbs']     = 'Miniaturas';
 $lang['media_list_rows']       = 'Linhas';
 $lang['media_sort_name']       = 'Ordenar por nome';
 $lang['media_sort_date']       = 'Ordenar por data';
+$lang['media_namespaces']      = 'Escolha o namespace';
 $lang['media_files']           = 'Ficheiros em %s';
 $lang['media_upload']          = 'Enviar para o grupo <strong>%s</strong>.';
 $lang['media_search']          = 'Procurar no grupo <strong>%s</strong>.';
@@ -319,3 +332,7 @@ $lang['media_perm_read']       = 'Perdão, não tem permissão para ler ficheiro
 $lang['media_perm_upload']     = 'Perdão, não tem permissão para enviar ficheiros.';
 $lang['media_update']          = 'enviar nova versão';
 $lang['media_restore']         = 'Restaurar esta versão';
+$lang['currentns']             = 'Namespace actual';
+$lang['searchresult']          = 'Resultado da pesquisa';
+$lang['plainhtml']             = 'HTML simples';
+$lang['wikimarkup']            = 'Markup de Wiki';
diff --git a/inc/lang/ro/jquery.ui.datepicker.js b/inc/lang/ro/jquery.ui.datepicker.js
index a988270d75099cad50dff2ee8a17b5ce83f7e0ec..66ee1099f4dfd7827fafde76b6a925af22e1ba29 100644
--- a/inc/lang/ro/jquery.ui.datepicker.js
+++ b/inc/lang/ro/jquery.ui.datepicker.js
@@ -3,24 +3,38 @@
  * Written by Edmond L. (ll_edmond@walla.com)
  * and Ionut G. Stan (ionut.g.stan@gmail.com)
  */
-jQuery(function($){
-	$.datepicker.regional['ro'] = {
-		closeText: 'ÃŽnchide',
-		prevText: '&#xAB; Luna precedentă',
-		nextText: 'Luna următoare &#xBB;',
-		currentText: 'Azi',
-		monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie',
-		'Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'],
-		monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun',
-		'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
-		dayNames: ['Duminică', 'Luni', 'Marţi', 'Miercuri', 'Joi', 'Vineri', 'Sâmbătă'],
-		dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'],
-		dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sâ'],
-		weekHeader: 'Săpt',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['ro']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['ro'] = {
+	closeText: 'ÃŽnchide',
+	prevText: '&#xAB; Luna precedentă',
+	nextText: 'Luna următoare &#xBB;',
+	currentText: 'Azi',
+	monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie',
+	'Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'],
+	monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun',
+	'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+	dayNames: ['Duminică', 'Luni', 'Marţi', 'Miercuri', 'Joi', 'Vineri', 'Sâmbătă'],
+	dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'],
+	dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sâ'],
+	weekHeader: 'Săpt',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['ro']);
+
+return datepicker.regional['ro'];
+
+}));
diff --git a/inc/lang/ro/lang.php b/inc/lang/ro/lang.php
index 31b2d7eba1f937e2212bad98b295917c5aece637..cd7d4fcc3510d9d169f42c3e14c0f7512703aa61 100644
--- a/inc/lang/ro/lang.php
+++ b/inc/lang/ro/lang.php
@@ -53,7 +53,7 @@ $lang['btn_revert']            = 'Revenire';
 $lang['btn_register']          = 'Înregistrează';
 $lang['btn_apply']             = 'Aplică';
 $lang['btn_media']             = 'Administrare media';
-$lang['loggedinas']            = 'Autentificat ca';
+$lang['loggedinas']            = 'Autentificat ca:';
 $lang['user']                  = 'Utilizator';
 $lang['pass']                  = 'Parola';
 $lang['newpass']               = 'Parola nouă';
@@ -92,11 +92,11 @@ $lang['license']               = 'Exceptând locurile unde este altfel specifica
 $lang['licenseok']             = 'Notă: Prin editarea acestei pagini ești de acord să publici conțintul sub următoarea licență:';
 $lang['searchmedia']           = 'Caută numele fișierului:';
 $lang['searchmedia_in']        = 'Caută în %s';
-$lang['txt_upload']            = 'Selectează fișierul de încărcat';
-$lang['txt_filename']          = 'Încarcă fișierul ca (opțional)';
+$lang['txt_upload']            = 'Selectează fișierul de încărcat:';
+$lang['txt_filename']          = 'Încarcă fișierul ca (opțional):';
 $lang['txt_overwrt']           = 'Suprascrie fișierul existent';
-$lang['lockedby']              = 'Momentan blocat de';
-$lang['lockexpire']            = 'Blocarea expiră la';
+$lang['lockedby']              = 'Momentan blocat de:';
+$lang['lockexpire']            = 'Blocarea expiră la:';
 $lang['js']['willexpire']      = 'Blocarea pentru editarea paginii expiră intr-un minut.\nPentru a preveni conflictele folosește butonul de previzualizare pentru resetarea blocării.';
 $lang['js']['notsavedyet']     = 'Există modificări nesalvate care se vor pierde.
 Dorești să continui?';
@@ -178,9 +178,9 @@ $lang['diff_type']             = 'Vezi diferențe:';
 $lang['diff_inline']           = 'Succesiv';
 $lang['diff_side']             = 'Alăturate';
 $lang['line']                  = 'Linia';
-$lang['breadcrumb']            = 'Traseu';
-$lang['youarehere']            = 'Ești aici';
-$lang['lastmod']               = 'Ultima modificare';
+$lang['breadcrumb']            = 'Traseu:';
+$lang['youarehere']            = 'Ești aici:';
+$lang['lastmod']               = 'Ultima modificare:';
 $lang['by']                    = 'de către';
 $lang['deleted']               = 'șters';
 $lang['created']               = 'creat';
@@ -233,18 +233,18 @@ $lang['metaedit']              = 'Editează metadata';
 $lang['metasaveerr']           = 'Scrierea metadatelor a eșuat';
 $lang['metasaveok']            = 'Metadatele au fost salvate';
 $lang['btn_img_backto']            = 'ÃŽnapoi la %s';
-$lang['img_title']             = 'Titlu';
-$lang['img_caption']           = 'Legendă';
-$lang['img_date']              = 'Dată';
-$lang['img_fname']             = 'Nume fișier';
-$lang['img_fsize']             = 'Dimensiune';
-$lang['img_artist']            = 'Fotograf';
-$lang['img_copyr']             = 'Drept de autor';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Camera';
-$lang['img_keywords']          = 'Cuvinte cheie';
-$lang['img_width']             = 'Lățime';
-$lang['img_height']            = 'Înălțime';
+$lang['img_title']             = 'Titlu:';
+$lang['img_caption']           = 'Legendă:';
+$lang['img_date']              = 'Dată:';
+$lang['img_fname']             = 'Nume fișier:';
+$lang['img_fsize']             = 'Dimensiune:';
+$lang['img_artist']            = 'Fotograf:';
+$lang['img_copyr']             = 'Drept de autor:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Camera:';
+$lang['img_keywords']          = 'Cuvinte cheie:';
+$lang['img_width']             = 'Lățime:';
+$lang['img_height']            = 'Înălțime:';
 $lang['btn_mediaManager']           = 'Vizualizează în administratorul media';
 $lang['subscr_subscribe_success'] = 'Adăugat %s la lista de abonare pentru %s';
 $lang['subscr_subscribe_error'] = 'Eroare la adăugarea %s la lista de abonare pentru %s';
diff --git a/inc/lang/ru/jquery.ui.datepicker.js b/inc/lang/ru/jquery.ui.datepicker.js
index a519714055d99f97ec13668ebe27aa23755fbe39..c3fda5d59438eb560a99c51a174677723bd5824a 100644
--- a/inc/lang/ru/jquery.ui.datepicker.js
+++ b/inc/lang/ru/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
 /* Written by Andrew Stromnov (stromnov@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['ru'] = {
-		closeText: 'Закрыть',
-		prevText: '&#x3C;Пред',
-		nextText: 'След&#x3E;',
-		currentText: 'Сегодня',
-		monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
-		'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
-		monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
-		'Июл','Авг','Сен','Окт','Ноя','Дек'],
-		dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
-		dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
-		dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
-		weekHeader: 'Нед',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['ru']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['ru'] = {
+	closeText: 'Закрыть',
+	prevText: '&#x3C;Пред',
+	nextText: 'След&#x3E;',
+	currentText: 'Сегодня',
+	monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
+	'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
+	monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
+	'Июл','Авг','Сен','Окт','Ноя','Дек'],
+	dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
+	dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
+	dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
+	weekHeader: 'Нед',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['ru']);
+
+return datepicker.regional['ru'];
+
+}));
diff --git a/inc/lang/ru/lang.php b/inc/lang/ru/lang.php
index deeb016166584eae776d2609bc5e810462bc4cef..e2f9b3d57f386123bdaf4f86ea10c9925913fdc6 100644
--- a/inc/lang/ru/lang.php
+++ b/inc/lang/ru/lang.php
@@ -25,6 +25,8 @@
  * @author Artur <ncuxxx@gmail.com>
  * @author Erli Moen <evseev.jr@gmail.com>
  * @author Aleksandr Selivanov <alexgearbox@yandex.ru>
+ * @author Владимир <id37736@yandex.ru>
+ * @author Igor Degraf <igordegraf@gmail.com>
  */
 $lang['encoding']              = ' utf-8';
 $lang['direction']             = 'ltr';
@@ -71,7 +73,7 @@ $lang['btn_media']             = 'Управление медиафайлами'
 $lang['btn_deleteuser']        = 'Удалить мой аккаунт';
 $lang['btn_img_backto']        = 'Вернуться к %s';
 $lang['btn_mediaManager']      = 'Просмотр в «управлении медиафайлами»';
-$lang['loggedinas']            = 'Зашли как';
+$lang['loggedinas']            = 'Зашли как:';
 $lang['user']                  = 'Логин';
 $lang['pass']                  = 'Пароль';
 $lang['newpass']               = 'Новый пароль';
@@ -116,12 +118,12 @@ $lang['license']               = 'За исключением случаев, к
 $lang['licenseok']             = 'Примечание: редактируя эту страницу, вы соглашаетесь на использование своего вклада на условиях следующей лицензии:';
 $lang['searchmedia']           = 'Поиск по имени файла:';
 $lang['searchmedia_in']        = 'Поиск в %s';
-$lang['txt_upload']            = 'Выберите файл для загрузки';
-$lang['txt_filename']          = 'Введите имя файла в вики (необязательно)';
+$lang['txt_upload']            = 'Выберите файл для загрузки:';
+$lang['txt_filename']          = 'Введите имя файла в вики (необязательно):';
 $lang['txt_overwrt']           = 'Перезаписать существующий файл';
 $lang['maxuploadsize']         = 'Максимальный размер загружаемого файла %s';
-$lang['lockedby']              = 'В данный момент заблокирован';
-$lang['lockexpire']            = 'Блокировка истекает в';
+$lang['lockedby']              = 'В данный момент заблокирован:';
+$lang['lockexpire']            = 'Блокировка истекает в:';
 $lang['js']['willexpire']      = 'Ваша блокировка этой страницы на редактирование истекает в течение минуты.\nЧтобы предотвратить конфликты используйте кнопку «Просмотр» для сброса таймера блокировки.';
 $lang['js']['notsavedyet']     = 'Несохранённые изменения будут потеряны. Вы действительно хотите продолжить?';
 $lang['js']['searchmedia']     = 'Поиск файлов';
@@ -204,9 +206,9 @@ $lang['diffprevrev']           = 'Предыдущая версия';
 $lang['diffnextrev']           = 'Следущая версия';
 $lang['difflastrev']           = 'Последняя версия';
 $lang['line']                  = 'Строка';
-$lang['breadcrumb']            = 'Вы посетили';
-$lang['youarehere']            = 'Вы находитесь здесь';
-$lang['lastmod']               = 'Последние изменения';
+$lang['breadcrumb']            = 'Вы посетили:';
+$lang['youarehere']            = 'Вы находитесь здесь:';
+$lang['lastmod']               = 'Последние изменения:';
 $lang['by']                    = ' —';
 $lang['deleted']               = 'удалено';
 $lang['created']               = 'создано';
@@ -259,18 +261,18 @@ $lang['admin_register']        = 'Добавить пользователя';
 $lang['metaedit']              = 'Править метаданные';
 $lang['metasaveerr']           = 'Ошибка записи метаданных';
 $lang['metasaveok']            = 'Метаданные сохранены';
-$lang['img_title']             = 'Название';
-$lang['img_caption']           = 'Подпись';
-$lang['img_date']              = 'Дата';
-$lang['img_fname']             = 'Имя файла';
-$lang['img_fsize']             = 'Размер';
-$lang['img_artist']            = 'Фотограф';
-$lang['img_copyr']             = 'Авторские права';
-$lang['img_format']            = 'Формат';
-$lang['img_camera']            = 'Модель';
-$lang['img_keywords']          = 'Ключевые слова';
-$lang['img_width']             = 'Ширина';
-$lang['img_height']            = 'Высота';
+$lang['img_title']             = 'Название:';
+$lang['img_caption']           = 'Подпись:';
+$lang['img_date']              = 'Дата:';
+$lang['img_fname']             = 'Имя файла:';
+$lang['img_fsize']             = 'Размер:';
+$lang['img_artist']            = 'Фотограф:';
+$lang['img_copyr']             = 'Авторские права:';
+$lang['img_format']            = 'Формат:';
+$lang['img_camera']            = 'Модель:';
+$lang['img_keywords']          = 'Ключевые слова:';
+$lang['img_width']             = 'Ширина:';
+$lang['img_height']            = 'Высота:';
 $lang['subscr_subscribe_success'] = 'Добавлен %s в подписку на %s';
 $lang['subscr_subscribe_error'] = 'Невозможно добавить %s в подписку на %s';
 $lang['subscr_subscribe_noaddress'] = 'Нет адреса электронной почты, сопоставленного с вашей учётной записью. Вы не можете подписаться на рассылку';
diff --git a/inc/lang/sk/jquery.ui.datepicker.js b/inc/lang/sk/jquery.ui.datepicker.js
index 0cb76c4e800edba49dbc0c383aba30e3696d93bf..1f924f820a0981c662bc067e8f1fb90b26092c3a 100644
--- a/inc/lang/sk/jquery.ui.datepicker.js
+++ b/inc/lang/sk/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Slovak initialisation for the jQuery UI date picker plugin. */
 /* Written by Vojtech Rinik (vojto@hmm.sk). */
-jQuery(function($){
-	$.datepicker.regional['sk'] = {
-		closeText: 'Zavrieť',
-		prevText: '&#x3C;Predchádzajúci',
-		nextText: 'Nasledujúci&#x3E;',
-		currentText: 'Dnes',
-		monthNames: ['január','február','marec','apríl','máj','jún',
-		'júl','august','september','október','november','december'],
-		monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún',
-		'Júl','Aug','Sep','Okt','Nov','Dec'],
-		dayNames: ['nedeľa','pondelok','utorok','streda','štvrtok','piatok','sobota'],
-		dayNamesShort: ['Ned','Pon','Uto','Str','Å tv','Pia','Sob'],
-		dayNamesMin: ['Ne','Po','Ut','St','Å t','Pia','So'],
-		weekHeader: 'Ty',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['sk']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['sk'] = {
+	closeText: 'Zavrieť',
+	prevText: '&#x3C;Predchádzajúci',
+	nextText: 'Nasledujúci&#x3E;',
+	currentText: 'Dnes',
+	monthNames: ['január','február','marec','apríl','máj','jún',
+	'júl','august','september','október','november','december'],
+	monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún',
+	'Júl','Aug','Sep','Okt','Nov','Dec'],
+	dayNames: ['nedeľa','pondelok','utorok','streda','štvrtok','piatok','sobota'],
+	dayNamesShort: ['Ned','Pon','Uto','Str','Å tv','Pia','Sob'],
+	dayNamesMin: ['Ne','Po','Ut','St','Å t','Pia','So'],
+	weekHeader: 'Ty',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['sk']);
+
+return datepicker.regional['sk'];
+
+}));
diff --git a/inc/lang/sk/lang.php b/inc/lang/sk/lang.php
index 3ba220a2d4b0137274fd3627782c315b11ca2576..e501cb7fcf02da685d02b6389ecef20e8d740501 100644
--- a/inc/lang/sk/lang.php
+++ b/inc/lang/sk/lang.php
@@ -51,7 +51,7 @@ $lang['btn_register']          = 'Registrovať';
 $lang['btn_apply']             = 'Použiť';
 $lang['btn_media']             = 'Správa médií';
 $lang['btn_deleteuser']        = 'Zrušiť môj účet';
-$lang['loggedinas']            = 'Prihlásený(á) ako';
+$lang['loggedinas']            = 'Prihlásený(á) ako:';
 $lang['user']                  = 'Užívateľské meno';
 $lang['pass']                  = 'Heslo';
 $lang['newpass']               = 'Nové heslo';
@@ -96,8 +96,8 @@ $lang['license']               = 'Ak nie je uvedené inak, obsah tejto wiki je u
 $lang['licenseok']             = 'Poznámka: Zmenou tejto stránky súhlasíte s uverejnením obsahu pod nasledujúcou licenciou:';
 $lang['searchmedia']           = 'Hľadať meno súboru:';
 $lang['searchmedia_in']        = 'Hľadať v %s';
-$lang['txt_upload']            = 'Vyberte súbor ako prílohu';
-$lang['txt_filename']          = 'Uložiť ako (voliteľné)';
+$lang['txt_upload']            = 'Vyberte súbor ako prílohu:';
+$lang['txt_filename']          = 'Uložiť ako (voliteľné):';
 $lang['txt_overwrt']           = 'Prepísať existujúci súbor';
 $lang['maxuploadsize']         = 'Obmedzenie max. %s na súbor.';
 $lang['lockedby']              = 'Práve zamknuté:';
@@ -183,9 +183,9 @@ $lang['diff_type']             = 'Prehľad zmien:';
 $lang['diff_inline']           = 'Vnorený';
 $lang['diff_side']             = 'Vedľa seba';
 $lang['line']                  = 'Riadok';
-$lang['breadcrumb']            = 'História';
-$lang['youarehere']            = 'Nachádzate sa';
-$lang['lastmod']               = 'Posledná úprava';
+$lang['breadcrumb']            = 'História:';
+$lang['youarehere']            = 'Nachádzate sa:';
+$lang['lastmod']               = 'Posledná úprava:';
 $lang['by']                    = 'od';
 $lang['deleted']               = 'odstránené';
 $lang['created']               = 'vytvorené';
@@ -239,18 +239,18 @@ $lang['metaedit']              = 'Upraviť metainformácie';
 $lang['metasaveerr']           = 'Zápis metainformácií zlyhal';
 $lang['metasaveok']            = 'Metainformácie uložené';
 $lang['btn_img_backto']            = 'Späť na %s';
-$lang['img_title']             = 'Titul';
-$lang['img_caption']           = 'Popis';
-$lang['img_date']              = 'Dátum';
-$lang['img_fname']             = 'Názov súboru';
-$lang['img_fsize']             = 'Veľkosť';
-$lang['img_artist']            = 'Fotograf';
-$lang['img_copyr']             = 'Kopírovacie práva';
-$lang['img_format']            = 'Formát';
-$lang['img_camera']            = 'Fotoaparát';
-$lang['img_keywords']          = 'Kľúčové slová';
-$lang['img_width']             = 'Šírka';
-$lang['img_height']            = 'Výška';
+$lang['img_title']             = 'Titul:';
+$lang['img_caption']           = 'Popis:';
+$lang['img_date']              = 'Dátum:';
+$lang['img_fname']             = 'Názov súboru:';
+$lang['img_fsize']             = 'Veľkosť:';
+$lang['img_artist']            = 'Fotograf:';
+$lang['img_copyr']             = 'Kopírovacie práva:';
+$lang['img_format']            = 'Formát:';
+$lang['img_camera']            = 'Fotoaparát:';
+$lang['img_keywords']          = 'Kľúčové slová:';
+$lang['img_width']             = 'Šírka:';
+$lang['img_height']            = 'Výška:';
 $lang['btn_mediaManager']           = 'Prezrieť v správcovi médií';
 $lang['subscr_subscribe_success'] = 'Používateľ %s bol pridaný do zoznamu hlásení o zmenách %s';
 $lang['subscr_subscribe_error'] = 'Chyba pri pridaní používateľa %s do zoznamu hlásení o zmenách %s';
diff --git a/inc/lang/sl/jquery.ui.datepicker.js b/inc/lang/sl/jquery.ui.datepicker.js
index 048a47af71fe20de5a88d8e7fd8ebe34fb991633..88d7f2b19532044cc44dd95d3bcbe408b7a934c6 100644
--- a/inc/lang/sl/jquery.ui.datepicker.js
+++ b/inc/lang/sl/jquery.ui.datepicker.js
@@ -1,24 +1,38 @@
 /* Slovenian initialisation for the jQuery UI date picker plugin. */
 /* Written by Jaka Jancar (jaka@kubje.org). */
 /* c = č, s = š z = ž C = Č S = Š Z = Ž */
-jQuery(function($){
-	$.datepicker.regional['sl'] = {
-		closeText: 'Zapri',
-		prevText: '&#x3C;Prejšnji',
-		nextText: 'Naslednji&#x3E;',
-		currentText: 'Trenutni',
-		monthNames: ['Januar','Februar','Marec','April','Maj','Junij',
-		'Julij','Avgust','September','Oktober','November','December'],
-		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
-		'Jul','Avg','Sep','Okt','Nov','Dec'],
-		dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','ÄŒetrtek','Petek','Sobota'],
-		dayNamesShort: ['Ned','Pon','Tor','Sre','ÄŒet','Pet','Sob'],
-		dayNamesMin: ['Ne','Po','To','Sr','ÄŒe','Pe','So'],
-		weekHeader: 'Teden',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['sl']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['sl'] = {
+	closeText: 'Zapri',
+	prevText: '&#x3C;Prejšnji',
+	nextText: 'Naslednji&#x3E;',
+	currentText: 'Trenutni',
+	monthNames: ['Januar','Februar','Marec','April','Maj','Junij',
+	'Julij','Avgust','September','Oktober','November','December'],
+	monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+	'Jul','Avg','Sep','Okt','Nov','Dec'],
+	dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','ÄŒetrtek','Petek','Sobota'],
+	dayNamesShort: ['Ned','Pon','Tor','Sre','ÄŒet','Pet','Sob'],
+	dayNamesMin: ['Ne','Po','To','Sr','ÄŒe','Pe','So'],
+	weekHeader: 'Teden',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['sl']);
+
+return datepicker.regional['sl'];
+
+}));
diff --git a/inc/lang/sl/lang.php b/inc/lang/sl/lang.php
index 6de2600926d5a4468c68030ebb215f4ce46b44d7..f76dbb7d18c86d2912ba6fec69eec210fd2025f6 100644
--- a/inc/lang/sl/lang.php
+++ b/inc/lang/sl/lang.php
@@ -10,6 +10,7 @@
  * @author Matej Urbančič (mateju@svn.gnome.org)
  * @author Matej Urbančič <mateju@svn.gnome.org>
  * @author matej <mateju@svn.gnome.org>
+ * @author Jernej Vidmar <jernej.vidmar@vidmarboehm.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -54,7 +55,9 @@ $lang['btn_register']          = 'Prijava';
 $lang['btn_apply']             = 'Uveljavi';
 $lang['btn_media']             = 'Urejevalnik predstavnih vsebin';
 $lang['btn_deleteuser']        = 'Odstrani račun';
-$lang['loggedinas']            = 'Prijava kot';
+$lang['btn_img_backto']        = 'Nazaj na %s';
+$lang['btn_mediaManager']      = 'Poglej v urejevalniku predstavnih vsebin';
+$lang['loggedinas']            = 'Prijava kot:';
 $lang['user']                  = 'Uporabniško ime';
 $lang['pass']                  = 'Geslo';
 $lang['newpass']               = 'Novo geslo';
@@ -85,6 +88,7 @@ $lang['profchanged']           = 'Uporabniški profil je uspešno posodobljen.';
 $lang['profnodelete']          = 'Ni omogočena podpora za brisanje uporabnikov.';
 $lang['profdeleteuser']        = 'Izbriši račun';
 $lang['profdeleted']           = 'Uporabniški račun je izbrisan.';
+$lang['profconfdeletemissing'] = 'Potrditveno okno ni označeno';
 $lang['pwdforget']             = 'Ali ste pozabili geslo? Pridobite si novo geslo.';
 $lang['resendna']              = 'DokuWiki ne podpira možnosti ponovnega pošiljanja gesel.';
 $lang['resendpwd']             = 'Nastavi novo geslo za';
@@ -97,11 +101,11 @@ $lang['license']               = 'V kolikor ni posebej določeno, je vsebina Wik
 $lang['licenseok']             = 'Opomba: z urejanjem vsebine strani, se strinjate z objavo pod pogoji dovoljenja:';
 $lang['searchmedia']           = 'Poišči ime datoteke:';
 $lang['searchmedia_in']        = 'Poišči v %s';
-$lang['txt_upload']            = 'Izberite datoteko za pošiljanje';
-$lang['txt_filename']          = 'Pošlji z imenom (izborno)';
+$lang['txt_upload']            = 'Izberite datoteko za pošiljanje:';
+$lang['txt_filename']          = 'Pošlji z imenom (izborno):';
 $lang['txt_overwrt']           = 'Prepiši obstoječo datoteko';
-$lang['lockedby']              = 'Trenutno je zaklenjeno s strani';
-$lang['lockexpire']            = 'Zaklep preteče ob';
+$lang['lockedby']              = 'Trenutno je zaklenjeno s strani:';
+$lang['lockexpire']            = 'Zaklep preteče ob:';
 $lang['js']['willexpire']      = 'Zaklep za urejevanje bo pretekel čez eno minuto.\nV izogib sporom, uporabite predogled, da se merilnik časa za zaklep ponastavi.';
 $lang['js']['notsavedyet']     = 'Neshranjene spremembe bodo izgubljene.';
 $lang['js']['searchmedia']     = 'Poišči datoteke';
@@ -179,10 +183,13 @@ $lang['difflink']              = 'Poveži s tem pogledom primerjave.';
 $lang['diff_type']             = 'Razlike:';
 $lang['diff_inline']           = 'V besedilu';
 $lang['diff_side']             = 'Eno ob drugem';
+$lang['diffprevrev']           = 'Prejšnja revizija';
+$lang['diffnextrev']           = 'Naslednja revizija';
+$lang['difflastrev']           = 'Zadnja revizija';
 $lang['line']                  = 'Vrstica';
-$lang['breadcrumb']            = 'Sled';
-$lang['youarehere']            = 'Trenutno dejavna stran';
-$lang['lastmod']               = 'Zadnja sprememba';
+$lang['breadcrumb']            = 'Sled:';
+$lang['youarehere']            = 'Trenutno dejavna stran:';
+$lang['lastmod']               = 'Zadnja sprememba:';
 $lang['by']                    = 'uporabnika';
 $lang['deleted']               = 'odstranjena';
 $lang['created']               = 'ustvarjena';
@@ -235,20 +242,18 @@ $lang['admin_register']        = 'Dodaj novega uporabnika';
 $lang['metaedit']              = 'Uredi metapodatke';
 $lang['metasaveerr']           = 'Zapisovanje metapodatkov je spodletelo';
 $lang['metasaveok']            = 'Metapodatki so shranjeni';
-$lang['btn_img_backto']            = 'Nazaj na %s';
-$lang['img_title']             = 'Naslov';
-$lang['img_caption']           = 'Opis';
-$lang['img_date']              = 'Datum';
-$lang['img_fname']             = 'Ime datoteke';
-$lang['img_fsize']             = 'Velikost';
-$lang['img_artist']            = 'Fotograf';
-$lang['img_copyr']             = 'Avtorska pravica';
-$lang['img_format']            = 'Zapis';
-$lang['img_camera']            = 'Fotoaparat';
-$lang['img_keywords']          = 'Ključne besede';
-$lang['img_width']             = 'Å irina';
-$lang['img_height']            = 'Višina';
-$lang['btn_mediaManager']           = 'Poglej v urejevalniku predstavnih vsebin';
+$lang['img_title']             = 'Naslov:';
+$lang['img_caption']           = 'Opis:';
+$lang['img_date']              = 'Datum:';
+$lang['img_fname']             = 'Ime datoteke:';
+$lang['img_fsize']             = 'Velikost:';
+$lang['img_artist']            = 'Fotograf:';
+$lang['img_copyr']             = 'Avtorska pravica:';
+$lang['img_format']            = 'Zapis:';
+$lang['img_camera']            = 'Fotoaparat:';
+$lang['img_keywords']          = 'Ključne besede:';
+$lang['img_width']             = 'Å irina:';
+$lang['img_height']            = 'Višina:';
 $lang['subscr_subscribe_success'] = 'Uporabniški račun %s je dodan na seznam naročnin na %s';
 $lang['subscr_subscribe_error'] = 'Napaka med dodajanjem %s na seznam naročnin na %s';
 $lang['subscr_subscribe_noaddress'] = 'S trenutnimi prijavnimi podatki ni povezanega elektronskega naslova, zato uporabniškega računa ni mogoče dodati na seznam naročnikov.';
@@ -291,6 +296,8 @@ $lang['i_allowreg']            = 'Dovoli uporabnikom vpis';
 $lang['i_retry']               = 'Ponovni poskus';
 $lang['i_license']             = 'Izbor dovoljenja objave vsebine:';
 $lang['i_license_none']        = 'Ne pokaži podrobnosti dovoljenja.';
+$lang['i_pop_field']           = 'Prosimo pomagajte nam izboljšati DokuWiki izkušnjo:';
+$lang['i_pop_label']           = 'Enkrat na mesec pošlji anonimne uporabniške podatke DokuWiki razvijalcem';
 $lang['recent_global']         = 'Trenutno so prikazane spremembe znotraj imenskega prostora <b>%s</b>. Mogoče si je ogledati tudi spremembe <a href="%s">celotnega sistema Wiki</a>.';
 $lang['years']                 = '%d let nazaj';
 $lang['months']                = '%d mesecev nazaj';
diff --git a/inc/lang/sq/jquery.ui.datepicker.js b/inc/lang/sq/jquery.ui.datepicker.js
index d6086a789603ba06ef74e5c14edadd6ca0d9bb08..f88c22c56c09ba9112b943e24f3981fc96277b7c 100644
--- a/inc/lang/sq/jquery.ui.datepicker.js
+++ b/inc/lang/sq/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Albanian initialisation for the jQuery UI date picker plugin. */
 /* Written by Flakron Bytyqi (flakron@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['sq'] = {
-		closeText: 'mbylle',
-		prevText: '&#x3C;mbrapa',
-		nextText: 'Përpara&#x3E;',
-		currentText: 'sot',
-		monthNames: ['Janar','Shkurt','Mars','Prill','Maj','Qershor',
-		'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'],
-		monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer',
-		'Kor','Gus','Sht','Tet','Nën','Dhj'],
-		dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'],
-		dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'],
-		dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'],
-		weekHeader: 'Ja',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['sq']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['sq'] = {
+	closeText: 'mbylle',
+	prevText: '&#x3C;mbrapa',
+	nextText: 'Përpara&#x3E;',
+	currentText: 'sot',
+	monthNames: ['Janar','Shkurt','Mars','Prill','Maj','Qershor',
+	'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'],
+	monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer',
+	'Kor','Gus','Sht','Tet','Nën','Dhj'],
+	dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'],
+	dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'],
+	dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'],
+	weekHeader: 'Ja',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['sq']);
+
+return datepicker.regional['sq'];
+
+}));
diff --git a/inc/lang/sq/lang.php b/inc/lang/sq/lang.php
index c31cdd36061115ad17e8b7603e489187b43e1bb3..49984097c613f467cc5a169752ac230623ecedd1 100644
--- a/inc/lang/sq/lang.php
+++ b/inc/lang/sq/lang.php
@@ -49,7 +49,7 @@ $lang['btn_recover']           = 'Rekupero skicën';
 $lang['btn_draftdel']          = 'Fshi skicën';
 $lang['btn_revert']            = 'Kthe si më parë';
 $lang['btn_register']          = 'Regjsitrohuni';
-$lang['loggedinas']            = 'Regjistruar si ';
+$lang['loggedinas']            = 'Regjistruar si :';
 $lang['user']                  = 'Nofka e përdoruesit:';
 $lang['pass']                  = 'Fjalëkalimi';
 $lang['newpass']               = 'Fjalëkalim i ri';
@@ -87,11 +87,11 @@ $lang['license']               = 'Përveç rasteve të përcaktuara, përmbajtja
 $lang['licenseok']             = 'Shënim: Duke redaktuar këtë faqe ju bini dakort të liçensoni përmbajtjen tuaj nën liçensën e mëposhtme:';
 $lang['searchmedia']           = 'Kërko emrin e skedarit:';
 $lang['searchmedia_in']        = 'Kërko në %s';
-$lang['txt_upload']            = 'Zgjidh skedarin për ngarkim';
-$lang['txt_filename']          = 'Ngarko si (alternative)';
+$lang['txt_upload']            = 'Zgjidh skedarin për ngarkim:';
+$lang['txt_filename']          = 'Ngarko si (alternative):';
 $lang['txt_overwrt']           = 'Zëvendëso skedarin ekzistues';
-$lang['lockedby']              = 'Kyçur momentalisht nga';
-$lang['lockexpire']            = 'Kyçi skadon në';
+$lang['lockedby']              = 'Kyçur momentalisht nga:';
+$lang['lockexpire']            = 'Kyçi skadon në:';
 $lang['js']['willexpire']            = 'Kyçi juaj për redaktimin e kësaj faqeje është duke skaduar.\nPër të shmangur konflikte përdorni butonin Shiko Paraprakisht për të rivendosur kohën e kyçjes.';
 $lang['js']['notsavedyet']     = 'Ndryshimet e paruajtura do të humbasin.\nVazhdo me të vërtetë?';
 $lang['rssfailed']             = 'Ndoshi një gabim gjatë kapjes së këtij lajmi:';
@@ -134,9 +134,9 @@ $lang['yours']                 = 'Versioni Juaj';
 $lang['diff']                  = 'Trego ndryshimet nga rishikimet aktuale';
 $lang['diff2']                 = 'Trego ndryshimet mes rishikimeve të përzgjedhura';
 $lang['line']                  = 'Vijë';
-$lang['breadcrumb']            = 'Gjurmë';
-$lang['youarehere']            = 'Ju jeni këtu';
-$lang['lastmod']               = 'Redaktuar për herë të fundit';
+$lang['breadcrumb']            = 'Gjurmë:';
+$lang['youarehere']            = 'Ju jeni këtu:';
+$lang['lastmod']               = 'Redaktuar për herë të fundit:';
 $lang['by']                    = 'nga';
 $lang['deleted']               = 'u fshi';
 $lang['created']               = 'u krijua';
@@ -180,16 +180,16 @@ $lang['metaedit']              = 'Redakto Metadata';
 $lang['metasaveerr']           = 'Shkrimi i metadata-ve dështoi';
 $lang['metasaveok']            = 'Metadata u ruajt';
 $lang['btn_img_backto']            = 'Mbrapa te %s';
-$lang['img_title']             = 'Titulli ';
-$lang['img_caption']           = 'Titra';
-$lang['img_date']              = 'Data';
-$lang['img_fname']             = 'Emri Skedarit';
-$lang['img_fsize']             = 'Madhësia';
-$lang['img_artist']            = 'Autor';
-$lang['img_copyr']             = 'Mbajtësi i të drejtave të autorit';
-$lang['img_format']            = 'Formati';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Fjalë Kyçe';
+$lang['img_title']             = 'Titulli :';
+$lang['img_caption']           = 'Titra:';
+$lang['img_date']              = 'Data:';
+$lang['img_fname']             = 'Emri Skedarit:';
+$lang['img_fsize']             = 'Madhësia:';
+$lang['img_artist']            = 'Autor:';
+$lang['img_copyr']             = 'Mbajtësi i të drejtave të autorit:';
+$lang['img_format']            = 'Formati:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Fjalë Kyçe:';
 $lang['subscr_subscribe_success'] = 'Iu shtua %s listës së abonimeve për %s';
 $lang['subscr_subscribe_error'] = 'Gabim gjatë shtimit të %s listës së abonimeve për %s';
 $lang['subscr_subscribe_noaddress'] = 'Nuk ekziston asnjë adresë e lidhur me regjistrimin tuaj, ju nuk mund t\'i shtoheni listës së abonimeve.';
diff --git a/inc/lang/sr/jquery.ui.datepicker.js b/inc/lang/sr/jquery.ui.datepicker.js
index 1349a26cfd7d8c5bc9f7cd3ad650a95019181f31..0f6d9e240dc0622033a602ed12680f3b1e048ad2 100644
--- a/inc/lang/sr/jquery.ui.datepicker.js
+++ b/inc/lang/sr/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Serbian i18n for the jQuery UI date picker plugin. */
 /* Written by Dejan Dimić. */
-jQuery(function($){
-	$.datepicker.regional['sr'] = {
-		closeText: 'Затвори',
-		prevText: '&#x3C;',
-		nextText: '&#x3E;',
-		currentText: 'Данас',
-		monthNames: ['Јануар','Фебруар','Март','Април','Мај','Јун',
-		'Јул','Август','Септембар','Октобар','Новембар','Децембар'],
-		monthNamesShort: ['Јан','Феб','Мар','Апр','Мај','Јун',
-		'Јул','Авг','Сеп','Окт','Нов','Дец'],
-		dayNames: ['Недеља','Понедељак','Уторак','Среда','Четвртак','Петак','Субота'],
-		dayNamesShort: ['Нед','Пон','Уто','Сре','Чет','Пет','Суб'],
-		dayNamesMin: ['Не','По','Ут','Ср','Че','Пе','Су'],
-		weekHeader: 'Сед',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['sr']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['sr'] = {
+	closeText: 'Затвори',
+	prevText: '&#x3C;',
+	nextText: '&#x3E;',
+	currentText: 'Данас',
+	monthNames: ['Јануар','Фебруар','Март','Април','Мај','Јун',
+	'Јул','Август','Септембар','Октобар','Новембар','Децембар'],
+	monthNamesShort: ['Јан','Феб','Мар','Апр','Мај','Јун',
+	'Јул','Авг','Сеп','Окт','Нов','Дец'],
+	dayNames: ['Недеља','Понедељак','Уторак','Среда','Четвртак','Петак','Субота'],
+	dayNamesShort: ['Нед','Пон','Уто','Сре','Чет','Пет','Суб'],
+	dayNamesMin: ['Не','По','Ут','Ср','Че','Пе','Су'],
+	weekHeader: 'Сед',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['sr']);
+
+return datepicker.regional['sr'];
+
+}));
diff --git a/inc/lang/sr/lang.php b/inc/lang/sr/lang.php
index 4b44704ad6b67448f06e5fa602a427bc184304ea..22a500e76db72fa00fc3dbb655e3e83c4af7480a 100644
--- a/inc/lang/sr/lang.php
+++ b/inc/lang/sr/lang.php
@@ -46,7 +46,7 @@ $lang['btn_recover']           = 'Опорави нацрт';
 $lang['btn_draftdel']          = 'Обриши нацрт';
 $lang['btn_revert']            = 'Врати на пређашњу верзију';
 $lang['btn_register']          = 'Региструј се';
-$lang['loggedinas']            = 'Пријављен као';
+$lang['loggedinas']            = 'Пријављен као:';
 $lang['user']                  = 'Корисничко име';
 $lang['pass']                  = 'Лозинка';
 $lang['newpass']               = 'Нова лозинка';
@@ -84,11 +84,11 @@ $lang['license']               = 'Осим где је другачије наз
 $lang['licenseok']             = 'Напомена: Изменом ове стране слажете се да ће ваше измене бити под следећом лиценцом:';
 $lang['searchmedia']           = 'Претражи по имену фајла';
 $lang['searchmedia_in']        = 'Претражи у %s';
-$lang['txt_upload']            = 'Изаберите датотеку за слање';
-$lang['txt_filename']          = 'Унесите вики-име (опционо)';
+$lang['txt_upload']            = 'Изаберите датотеку за слање:';
+$lang['txt_filename']          = 'Унесите вики-име (опционо):';
 $lang['txt_overwrt']           = 'Препишите тренутни фајл';
-$lang['lockedby']              = 'Тренутно закључано од стране';
-$lang['lockexpire']            = 'Закључавање истиче';
+$lang['lockedby']              = 'Тренутно закључано од стране:';
+$lang['lockexpire']            = 'Закључавање истиче:';
 $lang['js']['willexpire']            = 'Ваше закључавање за измену ове странице ће да истекне за један минут.\nДа би сте избегли конфликте, искористите дугме за преглед како би сте ресетовали тајмер закључавања.';
 $lang['js']['notsavedyet']     = 'Несачуване измене ће бити изгубљене.
 Да ли стварно желите да наставите?';
@@ -156,9 +156,9 @@ $lang['diff']                  = 'прикажи разлике до трену
 $lang['diff2']                 = 'Прикажи разлике између одабраних ревизија';
 $lang['difflink']              = 'Постави везу ка овом компаративном приказу';
 $lang['line']                  = 'Линија';
-$lang['breadcrumb']            = 'Траг';
-$lang['youarehere']            = 'Сада сте овде';
-$lang['lastmod']               = 'Последњи пут мењано';
+$lang['breadcrumb']            = 'Траг:';
+$lang['youarehere']            = 'Сада сте овде:';
+$lang['lastmod']               = 'Последњи пут мењано:';
 $lang['by']                    = 'од';
 $lang['deleted']               = 'избрисано';
 $lang['created']               = 'направљено';
@@ -202,16 +202,16 @@ $lang['metaedit']              = 'Измени мета-податке';
 $lang['metasaveerr']           = 'Записивање мета-података није било успешно';
 $lang['metasaveok']            = 'Мета-подаци су сачувани';
 $lang['btn_img_backto']            = 'Натраг на %s';
-$lang['img_title']             = 'Наслов';
-$lang['img_caption']           = 'Назив';
-$lang['img_date']              = 'Датум';
-$lang['img_fname']             = 'Име фајла';
-$lang['img_fsize']             = 'Величина';
-$lang['img_artist']            = 'Фотограф';
-$lang['img_copyr']             = 'Права копирања';
-$lang['img_format']            = 'Формат';
-$lang['img_camera']            = 'Камера';
-$lang['img_keywords']          = 'Кључне речи';
+$lang['img_title']             = 'Наслов:';
+$lang['img_caption']           = 'Назив:';
+$lang['img_date']              = 'Датум:';
+$lang['img_fname']             = 'Име фајла:';
+$lang['img_fsize']             = 'Величина:';
+$lang['img_artist']            = 'Фотограф:';
+$lang['img_copyr']             = 'Права копирања:';
+$lang['img_format']            = 'Формат:';
+$lang['img_camera']            = 'Камера:';
+$lang['img_keywords']          = 'Кључне речи:';
 $lang['subscr_subscribe_success'] = '%s је додат на списак претплатника %s';
 $lang['subscr_subscribe_error'] = 'Грешка приликом додавања %s на списак претплатника %s';
 $lang['subscr_subscribe_noaddress'] = 'Не постоји адреса повезана са вашим подацима, стога вас не можемо додати на списак претплатника.';
diff --git a/inc/lang/sv/jquery.ui.datepicker.js b/inc/lang/sv/jquery.ui.datepicker.js
index cbb5ad135c5b3a121cb6735b62435f425f94fec4..4874738904a73ec8e1b6ea5af4057cac8207503a 100644
--- a/inc/lang/sv/jquery.ui.datepicker.js
+++ b/inc/lang/sv/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Swedish initialisation for the jQuery UI date picker plugin. */
 /* Written by Anders Ekdahl ( anders@nomadiz.se). */
-jQuery(function($){
-	$.datepicker.regional['sv'] = {
-		closeText: 'Stäng',
-		prevText: '&#xAB;Förra',
-		nextText: 'Nästa&#xBB;',
-		currentText: 'Idag',
-		monthNames: ['Januari','Februari','Mars','April','Maj','Juni',
-		'Juli','Augusti','September','Oktober','November','December'],
-		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
-		'Jul','Aug','Sep','Okt','Nov','Dec'],
-		dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'],
-		dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'],
-		dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'],
-		weekHeader: 'Ve',
-		dateFormat: 'yy-mm-dd',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['sv']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['sv'] = {
+	closeText: 'Stäng',
+	prevText: '&#xAB;Förra',
+	nextText: 'Nästa&#xBB;',
+	currentText: 'Idag',
+	monthNames: ['Januari','Februari','Mars','April','Maj','Juni',
+	'Juli','Augusti','September','Oktober','November','December'],
+	monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+	'Jul','Aug','Sep','Okt','Nov','Dec'],
+	dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'],
+	dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'],
+	dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'],
+	weekHeader: 'Ve',
+	dateFormat: 'yy-mm-dd',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['sv']);
+
+return datepicker.regional['sv'];
+
+}));
diff --git a/inc/lang/sv/lang.php b/inc/lang/sv/lang.php
index c057d87051c5dac166da4024eb97bffdb515e97b..1f129c62130be96a61a8d5acc374bd2e04de6dc2 100644
--- a/inc/lang/sv/lang.php
+++ b/inc/lang/sv/lang.php
@@ -20,6 +20,7 @@
  * @author Henrik <henrik@idealis.se>
  * @author Tor Härnqvist <tor.harnqvist@gmail.com>
  * @author Hans Iwan Bratt <hibratt@gmail.com>
+ * @author Mikael Bergström <krank23@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -62,9 +63,11 @@ $lang['btn_draftdel']          = 'Radera utkast';
 $lang['btn_revert']            = 'Återställ';
 $lang['btn_register']          = 'Registrera';
 $lang['btn_apply']             = 'Verkställ';
-$lang['btn_media']             = 'Media Hanteraren';
+$lang['btn_media']             = 'Mediahanteraren';
 $lang['btn_deleteuser']        = 'Ta bort Mitt Konto';
-$lang['loggedinas']            = 'Inloggad som';
+$lang['btn_img_backto']        = 'Tillbaka till %s';
+$lang['btn_mediaManager']      = 'Se mediahanteraren';
+$lang['loggedinas']            = 'Inloggad som:';
 $lang['user']                  = 'Användarnamn';
 $lang['pass']                  = 'Lösenord';
 $lang['newpass']               = 'Nytt lösenord';
@@ -109,12 +112,12 @@ $lang['license']               = 'Om inte annat angivet, innehållet i denna wik
 $lang['licenseok']             = 'Notera: Genom att ändra i denna sidan så accepterar du att licensiera ditt bidrag under följande licenser:';
 $lang['searchmedia']           = 'Sök efter filnamn:';
 $lang['searchmedia_in']        = 'Sök i %s';
-$lang['txt_upload']            = 'Välj fil att ladda upp';
-$lang['txt_filename']          = 'Ladda upp som (ej obligatoriskt)';
+$lang['txt_upload']            = 'Välj fil att ladda upp:';
+$lang['txt_filename']          = 'Ladda upp som (ej obligatoriskt):';
 $lang['txt_overwrt']           = 'Skriv över befintlig fil';
 $lang['maxuploadsize']         = 'Max %s per uppladdad fil.';
-$lang['lockedby']              = 'LÃ¥st av';
-$lang['lockexpire']            = 'Lås upphör att gälla';
+$lang['lockedby']              = 'LÃ¥st av:';
+$lang['lockexpire']            = 'Lås upphör att gälla:';
 $lang['js']['willexpire']      = 'Ditt redigeringslås för detta dokument kommer snart att upphöra.\nFör att undvika versionskonflikter bör du förhandsgranska ditt dokument för att förlänga redigeringslåset.';
 $lang['js']['notsavedyet']     = 'Det finns ändringar som inte är sparade.
 Är du säker på att du vill fortsätta?';
@@ -194,9 +197,9 @@ $lang['difflink']              = 'Länk till den här jämförelsesidan';
 $lang['diff_type']             = 'Visa skillnader:';
 $lang['diff_side']             = 'Sida vid sida';
 $lang['line']                  = 'Rad';
-$lang['breadcrumb']            = 'Spår';
-$lang['youarehere']            = 'Här är du';
-$lang['lastmod']               = 'Senast uppdaterad';
+$lang['breadcrumb']            = 'Spår:';
+$lang['youarehere']            = 'Här är du:';
+$lang['lastmod']               = 'Senast uppdaterad:';
 $lang['by']                    = 'av';
 $lang['deleted']               = 'raderad';
 $lang['created']               = 'skapad';
@@ -249,20 +252,18 @@ $lang['admin_register']        = 'Lägg till ny användare';
 $lang['metaedit']              = 'Redigera metadata';
 $lang['metasaveerr']           = 'Skrivning av metadata misslyckades';
 $lang['metasaveok']            = 'Metadata sparad';
-$lang['btn_img_backto']            = 'Tillbaka till %s';
-$lang['img_title']             = 'Rubrik';
-$lang['img_caption']           = 'Bildtext';
-$lang['img_date']              = 'Datum';
-$lang['img_fname']             = 'Filnamn';
-$lang['img_fsize']             = 'Storlek';
-$lang['img_artist']            = 'Fotograf';
-$lang['img_copyr']             = 'Copyright';
-$lang['img_format']            = 'Format';
-$lang['img_camera']            = 'Kamera';
-$lang['img_keywords']          = 'Nyckelord';
-$lang['img_width']             = 'Bredd';
-$lang['img_height']            = 'Höjd';
-$lang['btn_mediaManager']           = 'Se mediahanteraren';
+$lang['img_title']             = 'Rubrik:';
+$lang['img_caption']           = 'Bildtext:';
+$lang['img_date']              = 'Datum:';
+$lang['img_fname']             = 'Filnamn:';
+$lang['img_fsize']             = 'Storlek:';
+$lang['img_artist']            = 'Fotograf:';
+$lang['img_copyr']             = 'Copyright:';
+$lang['img_format']            = 'Format:';
+$lang['img_camera']            = 'Kamera:';
+$lang['img_keywords']          = 'Nyckelord:';
+$lang['img_width']             = 'Bredd:';
+$lang['img_height']            = 'Höjd:';
 $lang['subscr_subscribe_success'] = 'La till %s till prenumerationslista %s';
 $lang['subscr_subscribe_noaddress'] = 'Det finns ingen adress associerad med din inloggning, du kan inte bli tillagd i prenumerationslistan';
 $lang['subscr_unsubscribe_success'] = '%s borttagen från prenumerationslistan för %s';
diff --git a/inc/lang/ta/denied.txt b/inc/lang/ta/denied.txt
new file mode 100644
index 0000000000000000000000000000000000000000..9dcf1c9ed089451f3dbeff0795e4a164035f8902
--- /dev/null
+++ b/inc/lang/ta/denied.txt
@@ -0,0 +1 @@
+மன்னிக்கவும் ! உங்களுக்கு தொடர அனுமதி இல்லை
\ No newline at end of file
diff --git a/inc/lang/ta/lang.php b/inc/lang/ta/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..a5b89527a05c468130d5b084934d99fef1743caf
--- /dev/null
+++ b/inc/lang/ta/lang.php
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Naveen Venugopal <naveen.venugopal.anu@gmail.com>
+ */
+$lang['btn_edit']              = 'இந்த பக்கத்தை திருத்து ';
+$lang['btn_show']              = 'பக்கத்தை காண்பி ';
+$lang['btn_create']            = 'இந்த பக்கத்தை உருவாக்கு ';
+$lang['btn_search']            = 'தேடு';
+$lang['btn_save']              = 'சேமி ';
+$lang['btn_revs']              = 'பழைய  திருத்தங்கள்';
+$lang['btn_recent']            = 'சமீபத்திய மாற்றங்கள்';
+$lang['btn_upload']            = 'பதிவேற்று';
+$lang['btn_cancel']            = 'ரத்து';
+$lang['btn_index']             = 'தள வரைபடம்';
+$lang['btn_admin']             = 'நிர்வாகம்';
+$lang['btn_update']            = 'மேம்படுத்து ';
+$lang['btn_delete']            = 'நீக்கு';
+$lang['btn_resendpwd']         = 'புதிய அடையாளச்சொல்லை நியமி';
+$lang['btn_apply']             = 'உபயோகி';
+$lang['user']                  = 'பயனர்பெயர்';
+$lang['pass']                  = 'அடையாளச்சொல்';
+$lang['newpass']               = 'புதிய அடையாளச்சொல்';
+$lang['oldpass']               = 'தற்போதைய  அடையாளச்சொல்லை உறுதிப்படுத்து';
+$lang['passchk']               = 'மேலும் ஒரு முறை ';
+$lang['remember']              = 'என்னை ஞாபகம் வைத்து கொள்';
+$lang['fullname']              = 'உண்மையான பெயர்';
+$lang['email']                 = 'மின்னஞ்சல்';
+$lang['profile']               = 'பயன்படுத்துபவர் விவரம்';
+$lang['minoredit']             = 'சிறிய மாற்றங்கள்';
+$lang['media_historytab']      = 'வரலாறு';
+$lang['media_list_rows']       = 'வரிசைகள் ';
+$lang['media_sort_name']       = 'பெயர் ';
+$lang['media_sort_date']       = 'தேதி ';
+$lang['media_namespaces']      = 'பெயர்வெளியை தேர்வுசெய் ';
diff --git a/inc/lang/th/jquery.ui.datepicker.js b/inc/lang/th/jquery.ui.datepicker.js
index aecfd27cc066b37fe4de6cdcfb2097cd3965f579..9314268c2f4a4adeb147a44e0a8873f3545927e5 100644
--- a/inc/lang/th/jquery.ui.datepicker.js
+++ b/inc/lang/th/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Thai initialisation for the jQuery UI date picker plugin. */
 /* Written by pipo (pipo@sixhead.com). */
-jQuery(function($){
-	$.datepicker.regional['th'] = {
-		closeText: 'ปิด',
-		prevText: '&#xAB;&#xA0;ย้อน',
-		nextText: 'ถัดไป&#xA0;&#xBB;',
-		currentText: 'วันนี้',
-		monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน',
-		'กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],
-		monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.',
-		'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'],
-		dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'],
-		dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
-		dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
-		weekHeader: 'Wk',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 0,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['th']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['th'] = {
+	closeText: 'ปิด',
+	prevText: '&#xAB;&#xA0;ย้อน',
+	nextText: 'ถัดไป&#xA0;&#xBB;',
+	currentText: 'วันนี้',
+	monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน',
+	'กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],
+	monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.',
+	'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'],
+	dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'],
+	dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
+	dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
+	weekHeader: 'Wk',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 0,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['th']);
+
+return datepicker.regional['th'];
+
+}));
diff --git a/inc/lang/th/lang.php b/inc/lang/th/lang.php
index 8aebfe1a5f08a68a038986a8fa058134efc750c5..0e9f1d3bb5c45eacb9861fb3106d379e835d33a0 100644
--- a/inc/lang/th/lang.php
+++ b/inc/lang/th/lang.php
@@ -1,17 +1,13 @@
 <?php
+
 /**
- * th language file
- *
- * This file was initially built by fetching translations from other
- * Wiki projects. See the @url lines below. Additional translations
- * and fixes where done for DokuWiki by the people mentioned in the
- * lines starting with @author
- *
- * @url http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/languages/messages/MessagesTh.php?view=co
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Komgrit Niyomrath <n.komgrit@gmail.com>
  * @author Arthit Suriyawongkul <arthit@gmail.com>
  * @author Kittithat Arnontavilas <mrtomyum@gmail.com>
  * @author Thanasak Sompaisansin <jombthep@gmail.com>
+ * @author Yuthana Tantirungrotechai <yt203y@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -47,12 +43,17 @@ $lang['btn_backtomedia']       = 'กลับไปยังหน้าเล
 $lang['btn_subscribe']         = 'เฝ้าดู';
 $lang['btn_profile']           = 'แก้ข้อมูลผู้ใช้';
 $lang['btn_reset']             = 'เริ่มใหม่';
+$lang['btn_resendpwd']         = 'ตั้งพาสเวิร์ดใหม่';
 $lang['btn_draft']             = 'แก้ไขเอกสารฉบับร่าง';
 $lang['btn_recover']           = 'กู้คืนเอกสารฉบับร่าง';
 $lang['btn_draftdel']          = 'ลบเอกสารฉบับร่าง';
 $lang['btn_revert']            = 'กู้คืน';
 $lang['btn_register']          = 'สร้างบัญชีผู้ใช้';
-$lang['loggedinas']            = 'ลงชื่อเข้าใช้เป็น';
+$lang['btn_media']             = 'ส่วนจัดการสื่อและไฟล์';
+$lang['btn_deleteuser']        = 'ลบบัญชีผู้ใช้งานของฉัน';
+$lang['btn_img_backto']        = 'กลับไปยัง %s';
+$lang['btn_mediaManager']      = 'ดูในส่วนจัดการสื่อและไฟล์';
+$lang['loggedinas']            = 'ลงชื่อเข้าใช้เป็น:';
 $lang['user']                  = 'ชื่อผู้ใช้:';
 $lang['pass']                  = 'รหัสผ่าน';
 $lang['newpass']               = 'รหัสผ่านใหม่';
@@ -63,6 +64,7 @@ $lang['fullname']              = 'ชื่อจริง:';
 $lang['email']                 = 'อีเมล:';
 $lang['profile']               = 'ข้อมูลส่วนตัวผู้ใช้';
 $lang['badlogin']              = 'ขัดข้อง:';
+$lang['badpassconfirm']        = 'พาสเวิร์ดไม่ถูกต้อง';
 $lang['minoredit']             = 'เป็นการแก้ไขเล็กน้อย';
 $lang['draftdate']             = 'บันทึกฉบับร่างเมื่อ';
 $lang['nosecedit']             = 'ในช่วงเวลาที่ผ่านมานี้เพจถูกแก้ไขไปแล้ว, เนื้อหาในเซคชั่นนี้ไม่ทันสมัย กรุณาโหลดเพจใหม่ทั้งหน้าแทน';
@@ -79,6 +81,10 @@ $lang['profna']                = 'วิกินี้ไม่รองรั
 $lang['profnochange']          = 'ไม่มีการเปลี่ยนแปลงข้อมูลส่วนตัว';
 $lang['profnoempty']           = 'ไม่อนุญาติให้เว้นว่างชื่อ หรืออีเมล';
 $lang['profchanged']           = 'ปรับปรุงข้อมูลส่วนตัวผู้ใช้สำเร็จ';
+$lang['profnodelete']          = 'วิกินี้ไม่รองรับการลบบัญชีผู้ใช้งาน';
+$lang['profdeleteuser']        = 'ลบบัญชีผู้ใช้งาน';
+$lang['profdeleted']           = 'บัญชีผู้ใช้งานของคุณได้ถูกลบออกจากวิกิแล้ว';
+$lang['profconfdelete']        = 'ฉันอยากลบบัญชีผู้ใช้งานของฉันจากวิกินี้ <br/> การดำเนินการนี้ไม่สามารถแก้ไขคืนได้ ';
 $lang['pwdforget']             = 'ลืมรหัสผ่านหรือ? เอาอันใหม่สิ';
 $lang['resendna']              = 'วิกินี้ไม่รองรับการส่งรหัสผ่านซ้ำ';
 $lang['resendpwdmissing']      = 'ขออภัย, คุณต้องกรอกทุกช่อง';
@@ -90,13 +96,20 @@ $lang['license']               = 'เว้นแต่จะได้แจ้
 $lang['licenseok']             = 'โปรดทราบ: เมื่อเริ่มแก้ไขหน้านี้ ถือว่าคุณตกลงให้สิทธิ์กับเนื้อหาของคุณอยู่ภายใต้สัญญาอนุญาตินี้';
 $lang['searchmedia']           = 'สืบค้นไฟล์ชื่อ:';
 $lang['searchmedia_in']        = 'สืบค้นใน %s';
-$lang['txt_upload']            = 'เลือกไฟล์ที่จะอัพโหลด';
-$lang['txt_filename']          = 'อัพโหลดเป็น(ตัวเลือก)';
+$lang['txt_upload']            = 'เลือกไฟล์ที่จะอัพโหลด:';
+$lang['txt_filename']          = 'อัพโหลดเป็น(ตัวเลือก):';
 $lang['txt_overwrt']           = 'เขียนทับไฟล์ที่มีอยู่แล้ว';
-$lang['lockedby']              = 'ตอนนี้ถูกล๊อคโดย';
-$lang['lockexpire']            = 'การล๊อคจะหมดอายุเมื่อ';
-$lang['js']['willexpire']            = 'การล๊อคเพื่อแก้ไขหน้านี้กำลังจะหมดเวลาในอีก \n นาที เพื่อที่จะหลีกเลี่ยงข้อขัดแย้งให้ใช้ปุ่ม "Preview" เพื่อรีเซ็ทเวลาใหม่';
+$lang['lockedby']              = 'ตอนนี้ถูกล๊อคโดย:';
+$lang['lockexpire']            = 'การล๊อคจะหมดอายุเมื่อ:';
+$lang['js']['willexpire']      = 'การล๊อคเพื่อแก้ไขหน้านี้กำลังจะหมดเวลาในอีก \n นาที เพื่อที่จะหลีกเลี่ยงข้อขัดแย้งให้ใช้ปุ่ม "Preview" เพื่อรีเซ็ทเวลาใหม่';
 $lang['js']['notsavedyet']     = 'การแก้ไขที่ไม่ได้บันทึกจะสูญหาย \n ต้องการทำต่อจริงๆหรือ?';
+$lang['js']['searchmedia']     = 'ค้นหาไฟล์';
+$lang['js']['keepopen']        = 'เปิดหน้าต่างไว้ระหว่างที่เลือก';
+$lang['js']['hidedetails']     = 'ซ่อนรายละเอียด';
+$lang['js']['nosmblinks']      = 'เชื่อมไปยังหน้าต่างแบ่งปัน ทำงานได้กับเฉพาะไมโครซอฟท์อินเตอร์เน็ตเอ็กซโปรเรอร์(IE) คุณยังคงสามารถคัดลอกและแปะลิ้งค์ได้';
+$lang['js']['linkwiz']         = 'ลิงค์วิเศษ';
+$lang['js']['linkto']          = 'ลิงค์ไป:';
+$lang['js']['del_confirm']     = 'ต้องการลบรายการที่เลือกจริงๆหรือ?';
 $lang['rssfailed']             = 'มีข้อผิดพลาดขณะดูดฟีดนี้';
 $lang['nothingfound']          = 'ไม่พบสิ่งใด';
 $lang['mediaselect']           = 'ไฟล์สื่อ';
@@ -114,13 +127,6 @@ $lang['deletefail']            = '"%s" ไม่สามารถลบได
 $lang['mediainuse']            = 'ไฟล์ "%s" ไม่ได้ถูกลบ - มันถูกใช้อยู่';
 $lang['namespaces']            = 'เนมสเปซ';
 $lang['mediafiles']            = 'มีไฟล์พร้อมใช้อยู่ใน';
-$lang['js']['searchmedia']     = 'ค้นหาไฟล์';
-$lang['js']['keepopen']        = 'เปิดหน้าต่างไว้ระหว่างที่เลือก';
-$lang['js']['hidedetails']     = 'ซ่อนรายละเอียด';
-$lang['js']['nosmblinks']      = 'เชื่อมไปยังหน้าต่างแบ่งปัน ทำงานได้กับเฉพาะไมโครซอฟท์อินเตอร์เน็ตเอ็กซโปรเรอร์(IE) คุณยังคงสามารถคัดลอกและแปะลิ้งค์ได้';
-$lang['js']['linkwiz']         = 'ลิงค์วิเศษ';
-$lang['js']['linkto']          = 'ลิงค์ไป:';
-$lang['js']['del_confirm']     = 'ต้องการลบรายการที่เลือกจริงๆหรือ?';
 $lang['mediausage']            = 'ให้ใช้ไวยกรณ์ต่อไปนี้เพื่ออ้างอิงไฟล์นี้';
 $lang['mediaview']             = 'ดูไฟล์ต้นฉบับ';
 $lang['mediaroot']             = 'ราก(รูท)';
@@ -137,9 +143,9 @@ $lang['yours']                 = 'ฉบับของคุณ';
 $lang['diff']                  = 'แสดงจุดแตกต่างกับฉบับปัจจุบัน';
 $lang['diff2']                 = 'แสดงจุดแตกต่างระหว่างฉบับที่เลือกไว้';
 $lang['line']                  = 'บรรทัด';
-$lang['breadcrumb']            = 'ตามรอย';
-$lang['youarehere']            = 'คุณอยู่ที่นี่';
-$lang['lastmod']               = 'แก้ไขครั้งล่าสุด';
+$lang['breadcrumb']            = 'ตามรอย:';
+$lang['youarehere']            = 'คุณอยู่ที่นี่:';
+$lang['lastmod']               = 'แก้ไขครั้งล่าสุด:';
 $lang['by']                    = 'โดย';
 $lang['deleted']               = 'ถูกถอดออก';
 $lang['created']               = 'ถูกสร้าง';
@@ -181,17 +187,16 @@ $lang['admin_register']        = 'สร้างบัญชีผู้ใช
 $lang['metaedit']              = 'แก้ไขข้อมูลเมต้า';
 $lang['metasaveerr']           = 'มีข้อผิดพลาดในการเขียนข้อมูลเมต้า';
 $lang['metasaveok']            = 'บันทึกเมต้าดาต้าแล้ว';
-$lang['btn_img_backto']            = 'กลับไปยัง %s';
-$lang['img_title']             = 'ชื่อภาพ';
-$lang['img_caption']           = 'คำบรรยายภาพ';
-$lang['img_date']              = 'วันที่';
-$lang['img_fname']             = 'ชื่อไฟล์';
-$lang['img_fsize']             = 'ขนาดภาพ';
-$lang['img_artist']            = 'ผู้สร้างสรรค์';
-$lang['img_copyr']             = 'ผู้ถือลิขสิทธิ์';
-$lang['img_format']            = 'รูปแบบ';
-$lang['img_camera']            = 'กล้อง';
-$lang['img_keywords']          = 'คำหลัก';
+$lang['img_title']             = 'ชื่อภาพ:';
+$lang['img_caption']           = 'คำบรรยายภาพ:';
+$lang['img_date']              = 'วันที่:';
+$lang['img_fname']             = 'ชื่อไฟล์:';
+$lang['img_fsize']             = 'ขนาดภาพ:';
+$lang['img_artist']            = 'ผู้สร้างสรรค์:';
+$lang['img_copyr']             = 'ผู้ถือลิขสิทธิ์:';
+$lang['img_format']            = 'รูปแบบ:';
+$lang['img_camera']            = 'กล้อง:';
+$lang['img_keywords']          = 'คำหลัก:';
 $lang['authtempfail']          = 'ระบบตรวจสอบสิทธิ์ผู้ใช้ไม่พร้อมใช้งานชั่วคราว หากสถานการณ์ยังไม่เปลี่ยนแปลง กรุณาแจ้งผู้ดูแลระบวิกิของคุณ';
 $lang['i_chooselang']          = 'เลือกภาษาของคุณ';
 $lang['i_installer']           = 'ตัวติดตั้งโดกุวิกิ';
diff --git a/inc/lang/tr/jquery.ui.datepicker.js b/inc/lang/tr/jquery.ui.datepicker.js
index 75b583a778d18b095311de4a25da882d2bfc729c..c366eb16a7592251721b21470abf0a6d71e6ad08 100644
--- a/inc/lang/tr/jquery.ui.datepicker.js
+++ b/inc/lang/tr/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Turkish initialisation for the jQuery UI date picker plugin. */
 /* Written by Izzet Emre Erkan (kara@karalamalar.net). */
-jQuery(function($){
-	$.datepicker.regional['tr'] = {
-		closeText: 'kapat',
-		prevText: '&#x3C;geri',
-		nextText: 'ileri&#x3e',
-		currentText: 'bugün',
-		monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran',
-		'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'],
-		monthNamesShort: ['Oca','Åžub','Mar','Nis','May','Haz',
-		'Tem','AÄŸu','Eyl','Eki','Kas','Ara'],
-		dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'],
-		dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
-		dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
-		weekHeader: 'Hf',
-		dateFormat: 'dd.mm.yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['tr']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['tr'] = {
+	closeText: 'kapat',
+	prevText: '&#x3C;geri',
+	nextText: 'ileri&#x3e',
+	currentText: 'bugün',
+	monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran',
+	'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'],
+	monthNamesShort: ['Oca','Åžub','Mar','Nis','May','Haz',
+	'Tem','AÄŸu','Eyl','Eki','Kas','Ara'],
+	dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'],
+	dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
+	dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
+	weekHeader: 'Hf',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['tr']);
+
+return datepicker.regional['tr'];
+
+}));
diff --git a/inc/lang/tr/lang.php b/inc/lang/tr/lang.php
index 2af17fe27aa0296eb3611b5d0a04ea1a50b48e9d..90a7ea7ba383993f51a1fe58464162fb74802295 100644
--- a/inc/lang/tr/lang.php
+++ b/inc/lang/tr/lang.php
@@ -11,6 +11,8 @@
  * @author farukerdemoncel@gmail.com
  * @author Mustafa Aslan <maslan@hotmail.com>
  * @author huseyin can <huseyincan73@gmail.com>
+ * @author ilker rifat kapaç <irifat@gmail.com>
+ * @author İlker R. Kapaç <irifat@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -55,7 +57,9 @@ $lang['btn_register']          = 'Kayıt ol';
 $lang['btn_apply']             = 'Uygula';
 $lang['btn_media']             = 'Çokluortam Yöneticisi';
 $lang['btn_deleteuser']        = 'Hesabımı Sil';
-$lang['loggedinas']            = 'GiriÅŸ ismi';
+$lang['btn_img_backto']        = 'Şuna dön: %s';
+$lang['btn_mediaManager']      = 'Ortam oynatıcısında göster';
+$lang['loggedinas']            = 'GiriÅŸ ismi:';
 $lang['user']                  = 'Kullanıcı ismi';
 $lang['pass']                  = 'Parola';
 $lang['newpass']               = 'Yeni Parola';
@@ -100,8 +104,8 @@ $lang['license']               = 'Aksi belirtilmediği halde, bu wikinin içeri
 $lang['licenseok']             = 'Not: Bu sayfayı değiştirerek yazınızın şu lisans ile yayınlanmasını kabul etmiş olacaksınız:';
 $lang['searchmedia']           = 'Dosya Adı Ara:';
 $lang['searchmedia_in']        = '%s içinde ara';
-$lang['txt_upload']            = 'Yüklenecek dosyayı seç';
-$lang['txt_filename']          = 'Dosya adı (zorunlu değil)';
+$lang['txt_upload']            = 'Yüklenecek dosyayı seç:';
+$lang['txt_filename']          = 'Dosya adı (zorunlu değil):';
 $lang['txt_overwrt']           = 'Mevcut dosyanın üstüne yaz';
 $lang['maxuploadsize']         = 'Yükleme dosya başına en fazla %s';
 $lang['lockedby']              = 'Şu an şunun tarafından kilitli:';
@@ -181,10 +185,16 @@ $lang['diff']                  = 'Kullanılan sürüm ile farkları göster';
 $lang['diff2']                 = 'Seçili sürümler arasındaki farkı göster';
 $lang['difflink']              = 'Karşılaştırma görünümüne bağlantı';
 $lang['diff_type']             = 'farklı görünüş';
+$lang['diff_side']             = 'Yan yana';
+$lang['diffprevrev']           = 'Önceki sürüm';
+$lang['diffnextrev']           = 'Sonraki sürüm';
+$lang['difflastrev']           = 'Son sürüm';
+$lang['diffbothprevrev']       = 'İki taraf da önceki sürüm';
+$lang['diffbothnextrev']       = 'İki taraf da sonraki sürüm';
 $lang['line']                  = 'Satır';
-$lang['breadcrumb']            = 'Ä°z';
-$lang['youarehere']            = 'Buradasınız';
-$lang['lastmod']               = 'Son deÄŸiÅŸtirilme';
+$lang['breadcrumb']            = 'Ä°z:';
+$lang['youarehere']            = 'Buradasınız:';
+$lang['lastmod']               = 'Son deÄŸiÅŸtirilme:';
 $lang['by']                    = 'DeÄŸiÅŸtiren:';
 $lang['deleted']               = 'silindi';
 $lang['created']               = 'oluÅŸturuldu';
@@ -201,6 +211,7 @@ $lang['skip_to_content']       = 'Bağlanmak için kaydır';
 $lang['sidebar']               = 'kaydırma çubuğu';
 $lang['mail_newpage']          = 'sayfa eklenme:';
 $lang['mail_changed']          = 'sayfa deÄŸiÅŸtirilme:';
+$lang['mail_subscribe_list']   = 'isimalanındaki değişmiş sayfalar: ';
 $lang['mail_new_user']         = 'yeni kullanıcı';
 $lang['mail_upload']           = 'dosya yüklendi:';
 $lang['changes_type']          = 'görünüşü değiştir';
@@ -220,6 +231,8 @@ $lang['qb_h5']                 = '5. Seviye Başlık';
 $lang['qb_h']                  = 'Başlık';
 $lang['qb_hs']                 = 'Başlığı seç';
 $lang['qb_hplus']              = 'Daha yüksek başlık';
+$lang['qb_hminus']             = 'Daha Düşük Başlık';
+$lang['qb_hequal']             = 'Aynı Seviye Başlık';
 $lang['qb_link']               = 'İç Bağlantı';
 $lang['qb_extlink']            = 'Dış Bağlantı';
 $lang['qb_hr']                 = 'Yatay Çizgi';
@@ -229,29 +242,29 @@ $lang['qb_media']              = 'Resim ve baÅŸka dosyalar ekle';
 $lang['qb_sig']                = 'Ä°mza Ekle';
 $lang['qb_smileys']            = 'Gülen Yüzler';
 $lang['qb_chars']              = 'Özel Karakterler';
+$lang['upperns']               = 'ebeveyn isimalanına atla';
 $lang['admin_register']        = 'Yeni kullanıcı ekle...';
 $lang['metaedit']              = 'Metaverileri DeÄŸiÅŸtir';
 $lang['metasaveerr']           = 'Metaveri yazma başarısız ';
 $lang['metasaveok']            = 'Metaveri kaydedildi';
-$lang['btn_img_backto']            = 'Şuna dön: %s';
-$lang['img_title']             = 'Başlık';
-$lang['img_caption']           = 'Serlevha';
-$lang['img_date']              = 'Tarih';
-$lang['img_fname']             = 'Dosya Adı';
-$lang['img_fsize']             = 'Boyut';
-$lang['img_artist']            = 'Fotoğrafçı';
-$lang['img_copyr']             = 'Telif Hakkı';
-$lang['img_format']            = 'Biçim';
-$lang['img_camera']            = 'Fotoğraf Makinası';
-$lang['img_keywords']          = 'Anahtar Sözcükler';
-$lang['img_width']             = 'GeniÅŸlik';
-$lang['img_height']            = 'Yükseklik';
-$lang['btn_mediaManager']           = 'Ortam oynatıcısında göster';
+$lang['img_title']             = 'Başlık:';
+$lang['img_caption']           = 'Serlevha:';
+$lang['img_date']              = 'Tarih:';
+$lang['img_fname']             = 'Dosya Adı:';
+$lang['img_fsize']             = 'Boyut:';
+$lang['img_artist']            = 'Fotoğrafçı:';
+$lang['img_copyr']             = 'Telif Hakkı:';
+$lang['img_format']            = 'Biçim:';
+$lang['img_camera']            = 'Fotoğraf Makinası:';
+$lang['img_keywords']          = 'Anahtar Sözcükler:';
+$lang['img_width']             = 'GeniÅŸlik:';
+$lang['img_height']            = 'Yükseklik:';
 $lang['subscr_m_new_header']   = 'Ãœyelik ekle';
 $lang['subscr_m_current_header'] = 'ÃœyeliÄŸini onayla';
 $lang['subscr_m_unsubscribe']  = 'Ãœyelik iptali';
 $lang['subscr_m_subscribe']    = 'Kayıt ol';
 $lang['subscr_m_receive']      = 'Al';
+$lang['subscr_style_every']    = 'her değişiklikte e-posta gönder';
 $lang['authtempfail']          = 'Kullanıcı doğrulama geçici olarak yapılamıyor. Eğer bu durum devam ederse lütfen Wiki yöneticine haber veriniz.';
 $lang['authpwdexpire']         = 'Şifreniz %d gün sonra geçersiz hale gelecek, yakın bir zamanda değiştirmelisiniz.';
 $lang['i_chooselang']          = 'Dili seçiniz';
@@ -274,8 +287,12 @@ $lang['i_policy']              = 'İlk ACL ayarı';
 $lang['i_pol0']                = 'Tamamen Açık Wiki (herkes okuyabilir, yazabilir ve dosya yükleyebilir)';
 $lang['i_pol1']                = 'Açık Wiki (herkes okuyabilir, ancak  sadece üye olanlar yazabilir ve dosya yükleyebilir)';
 $lang['i_pol2']                = 'Kapalı Wiki (sadece üye olanlar okuyabilir, yazabilir ve dosya yükleyebilir)';
+$lang['i_allowreg']            = 'Kullanıcıların kendi kendilerine üye olmalarına için ver';
 $lang['i_retry']               = 'Tekrar Dene';
 $lang['i_license']             = 'Lütfen içeriği hangi lisans altında yayınlamak istediğniizi belirtin:';
+$lang['i_license_none']        = 'Hiç bir lisans bilgisi gösterme';
+$lang['i_pop_field']           = 'Lütfen DokuWiki deneyimini geliştirmemizde, bize yardım edin:';
+$lang['i_pop_label']           = 'DokuWiki geliştiricilerine ayda bir, anonim kullanım bilgisini gönder';
 $lang['recent_global']         = '<b>%s</b> namespace\'i içerisinde yapılan değişiklikleri görüntülemektesiniz. Wiki\'deki tüm değişiklikleri de <a href="%s">bu adresten</a> görebilirsiniz. ';
 $lang['years']                 = '%d yıl önce';
 $lang['months']                = '%d ay önce';
@@ -295,12 +312,19 @@ $lang['media_list_thumbs']     = 'Küçük resimler';
 $lang['media_list_rows']       = 'Satırlar';
 $lang['media_sort_name']       = 'Ä°sim';
 $lang['media_sort_date']       = 'Tarih';
+$lang['media_namespaces']      = 'İsimalanı seçin';
 $lang['media_files']           = '%s deki dosyalar';
 $lang['media_upload']          = '%s dizinine yükle';
 $lang['media_search']          = '%s dizininde ara';
 $lang['media_view']            = '%s';
 $lang['media_edit']            = 'Düzenle %s';
 $lang['media_history']         = 'Geçmiş %s';
+$lang['media_meta_edited']     = 'üstveri düzenlendi';
+$lang['media_perm_read']       = 'Özür dileriz, dosyaları okumak için yeterli haklara sahip değilsiniz.';
 $lang['media_perm_upload']     = 'Üzgünüm, karşıya dosya yükleme yetkiniz yok.';
 $lang['media_update']          = 'Yeni versiyonu yükleyin';
 $lang['media_restore']         = 'Bu sürümü eski haline getir';
+$lang['currentns']             = 'Geçerli isimalanı';
+$lang['searchresult']          = 'Arama Sonucu';
+$lang['plainhtml']             = 'Yalın HTML';
+$lang['wikimarkup']            = 'Wiki Biçimlendirmesi';
diff --git a/inc/lang/tr/subscr_form.txt b/inc/lang/tr/subscr_form.txt
new file mode 100644
index 0000000000000000000000000000000000000000..21a8fbaebcefebc6aa1776f3edbb6ab155fd523b
--- /dev/null
+++ b/inc/lang/tr/subscr_form.txt
@@ -0,0 +1,3 @@
+====== Abonelik Yönetimi ======
+
+Bu sayfa, geçerli isimalanı ve sayfa için aboneliklerinizi düzenlemenize olanak sağlar.
\ No newline at end of file
diff --git a/inc/lang/uk/jquery.ui.datepicker.js b/inc/lang/uk/jquery.ui.datepicker.js
index 2bdc82ff70104232d867a1c89e9d0170ed9a6b8d..ab4adb9ddb94407e5e3bbf0242ed64b5e64c3749 100644
--- a/inc/lang/uk/jquery.ui.datepicker.js
+++ b/inc/lang/uk/jquery.ui.datepicker.js
@@ -1,24 +1,38 @@
 /* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */
 /* Written by Maxim Drogobitskiy (maxdao@gmail.com). */
 /* Corrected by Igor Milla (igor.fsp.milla@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['uk'] = {
-		closeText: 'Закрити',
-		prevText: '&#x3C;',
-		nextText: '&#x3E;',
-		currentText: 'Сьогодні',
-		monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень',
-		'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'],
-		monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер',
-		'Лип','Сер','Вер','Жов','Лис','Гру'],
-		dayNames: ['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'],
-		dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'],
-		dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'],
-		weekHeader: 'Тиж',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['uk']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['uk'] = {
+	closeText: 'Закрити',
+	prevText: '&#x3C;',
+	nextText: '&#x3E;',
+	currentText: 'Сьогодні',
+	monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень',
+	'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'],
+	monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер',
+	'Лип','Сер','Вер','Жов','Лис','Гру'],
+	dayNames: ['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'],
+	dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'],
+	dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'],
+	weekHeader: 'Тиж',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['uk']);
+
+return datepicker.regional['uk'];
+
+}));
diff --git a/inc/lang/uk/lang.php b/inc/lang/uk/lang.php
index 09b2b6d1d87e8179bf4f73e0372163e963c40431..56f064c9fddf0ef9b1c0f75ebfb650fdbe0ec925 100644
--- a/inc/lang/uk/lang.php
+++ b/inc/lang/uk/lang.php
@@ -53,7 +53,7 @@ $lang['btn_revert']            = 'Відновити';
 $lang['btn_register']          = 'Реєстрація';
 $lang['btn_apply']             = 'Застосувати';
 $lang['btn_deleteuser']        = 'Видалити мій аккаунт';
-$lang['loggedinas']            = 'Ви';
+$lang['loggedinas']            = 'Ви:';
 $lang['user']                  = 'Користувач';
 $lang['pass']                  = 'Пароль';
 $lang['newpass']               = 'Новий пароль';
@@ -94,11 +94,11 @@ $lang['license']               = 'Якщо не вказано інше, вмі
 $lang['licenseok']             = 'Примітка. Редагуючи ці сторінку, ви погоджуєтесь на розповсюдження інформації за такою ліцензією:';
 $lang['searchmedia']           = 'Пошук файлу:';
 $lang['searchmedia_in']        = 'Шукати у %s';
-$lang['txt_upload']            = 'Виберіть файл для завантаження';
-$lang['txt_filename']          = 'Завантажити як (не обов\'язкове)';
+$lang['txt_upload']            = 'Виберіть файл для завантаження:';
+$lang['txt_filename']          = 'Завантажити як (не обов\'язкове):';
 $lang['txt_overwrt']           = 'Перезаписати існуючий файл';
-$lang['lockedby']              = 'Заблоковано';
-$lang['lockexpire']            = 'Блокування завершується в';
+$lang['lockedby']              = 'Заблоковано:';
+$lang['lockexpire']            = 'Блокування завершується в:';
 $lang['js']['willexpire']      = 'Блокування редагування цієї сторінки закінчується через хвилину.\n Щоб уникнути конфліктів використовуйте кнопку перегляду для продовження блокування.';
 $lang['js']['notsavedyet']     = 'Незбережені зміни будуть втрачені.
  Дійсно продовжити?';
@@ -172,9 +172,9 @@ $lang['diff_type']             = 'Переглянути відмінності:
 $lang['diff_inline']           = 'Вбудувати';
 $lang['diff_side']             = 'Поряд';
 $lang['line']                  = 'Рядок';
-$lang['breadcrumb']            = 'Відвідано';
-$lang['youarehere']            = 'Ви тут';
-$lang['lastmod']               = 'В останнє змінено';
+$lang['breadcrumb']            = 'Відвідано:';
+$lang['youarehere']            = 'Ви тут:';
+$lang['lastmod']               = 'В останнє змінено:';
 $lang['by']                    = ' ';
 $lang['deleted']               = 'знищено';
 $lang['created']               = 'створено';
@@ -224,16 +224,16 @@ $lang['metaedit']              = 'Редагувати метадані';
 $lang['metasaveerr']           = 'Помилка запису метаданих';
 $lang['metasaveok']            = 'Метадані збережено';
 $lang['btn_img_backto']            = 'Повернутися до %s';
-$lang['img_title']             = 'Назва';
-$lang['img_caption']           = 'Підпис';
-$lang['img_date']              = 'Дата';
-$lang['img_fname']             = 'Ім’я файлу';
-$lang['img_fsize']             = 'Розмір';
-$lang['img_artist']            = 'Фотограф';
-$lang['img_copyr']             = 'Авторські права';
-$lang['img_format']            = 'Формат';
-$lang['img_camera']            = 'Камера';
-$lang['img_keywords']          = 'Ключові слова';
+$lang['img_title']             = 'Назва:';
+$lang['img_caption']           = 'Підпис:';
+$lang['img_date']              = 'Дата:';
+$lang['img_fname']             = 'Ім’я файлу:';
+$lang['img_fsize']             = 'Розмір:';
+$lang['img_artist']            = 'Фотограф:';
+$lang['img_copyr']             = 'Авторські права:';
+$lang['img_format']            = 'Формат:';
+$lang['img_camera']            = 'Камера:';
+$lang['img_keywords']          = 'Ключові слова:';
 $lang['subscr_subscribe_success'] = 'Додано %s до списку підписки для %s';
 $lang['subscr_subscribe_error'] = 'Помилка при додавані %s до списку підписки для %s';
 $lang['subscr_subscribe_noaddress'] = 'Немає адреси, асоційованої з Вашим логіном, тому Ви не можете бути додані до списку підписки.';
diff --git a/inc/lang/vi/jquery.ui.datepicker.js b/inc/lang/vi/jquery.ui.datepicker.js
index b49e7eb130ea69093aeb87614b7fb3749058ce47..187ec15e4abc4c836ee81f4179b067004dd47416 100644
--- a/inc/lang/vi/jquery.ui.datepicker.js
+++ b/inc/lang/vi/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Vietnamese initialisation for the jQuery UI date picker plugin. */
 /* Translated by Le Thanh Huy (lthanhhuy@cit.ctu.edu.vn). */
-jQuery(function($){
-	$.datepicker.regional['vi'] = {
-		closeText: 'Đóng',
-		prevText: '&#x3C;TrÆ°á»›c',
-		nextText: 'Tiếp&#x3E;',
-		currentText: 'Hôm nay',
-		monthNames: ['Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu',
-		'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai'],
-		monthNamesShort: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6',
-		'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'],
-		dayNames: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],
-		dayNamesShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
-		dayNamesMin: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
-		weekHeader: 'Tu',
-		dateFormat: 'dd/mm/yy',
-		firstDay: 0,
-		isRTL: false,
-		showMonthAfterYear: false,
-		yearSuffix: ''};
-	$.datepicker.setDefaults($.datepicker.regional['vi']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['vi'] = {
+	closeText: 'Đóng',
+	prevText: '&#x3C;TrÆ°á»›c',
+	nextText: 'Tiếp&#x3E;',
+	currentText: 'Hôm nay',
+	monthNames: ['Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu',
+	'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai'],
+	monthNamesShort: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6',
+	'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'],
+	dayNames: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],
+	dayNamesShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
+	dayNamesMin: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
+	weekHeader: 'Tu',
+	dateFormat: 'dd/mm/yy',
+	firstDay: 0,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''};
+datepicker.setDefaults(datepicker.regional['vi']);
+
+return datepicker.regional['vi'];
+
+}));
diff --git a/inc/lang/vi/lang.php b/inc/lang/vi/lang.php
index ccc179eec5738465ef995c91a3245b41a8b87b1b..b2349d0b0bd82b8c7bb2e6819ce35b41cfb29bfa 100644
--- a/inc/lang/vi/lang.php
+++ b/inc/lang/vi/lang.php
@@ -45,7 +45,7 @@ $lang['btn_revert']            = 'Phục hồi';
 $lang['btn_register']          = 'Đăng ký';
 $lang['btn_apply']             = 'Chấp nhận';
 $lang['btn_media']             = 'Quản lý tệp tin';
-$lang['loggedinas']            = 'Username đang dùng';
+$lang['loggedinas']            = 'Username đang dùng:';
 $lang['user']                  = 'Username';
 $lang['pass']                  = 'Mật khẩu';
 $lang['newpass']               = 'Mật khẩu mới';
@@ -84,11 +84,11 @@ $lang['license']               = 'Trừ khi có ghi chú khác, nội dung trên
 $lang['licenseok']             = 'Lưu ý: Bằng cách chỉnh sửa trang này, bạn đồng ý cấp giấy phép nội dung của bạn theo giấy phép sau:';
 $lang['searchmedia']           = 'Tìm tên file:';
 $lang['searchmedia_in']        = 'Tìm ở %s';
-$lang['txt_upload']            = 'Chọn tệp để tải lên';
-$lang['txt_filename']          = 'Điền wikiname (tuỳ ý)';
+$lang['txt_upload']            = 'Chọn tệp để tải lên:';
+$lang['txt_filename']          = 'Điền wikiname (tuỳ ý):';
 $lang['txt_overwrt']           = 'Ghi đè file trùng';
-$lang['lockedby']              = 'Đang khoá bởi';
-$lang['lockexpire']            = 'Sẽ được mở khóa vào lúc';
+$lang['lockedby']              = 'Đang khoá bởi:';
+$lang['lockexpire']            = 'Sẽ được mở khóa vào lúc:';
 $lang['js']['willexpire']      = 'Trong một phút nữa bài viết sẽ được mở khóa để cho phép người khác chỉnh sửa.\nĐể tránh xung đột, bạn nên bấm nút Duyệt trước để lập lại thời gian khoá bài';
 $lang['js']['notsavedyet']     = 'Hiện có những thay đổi chưa được bảo lưu, và sẽ mất.\nBạn thật sự muốn tiếp tục?';
 $lang['js']['searchmedia']     = 'Tìm kiếm tập tin';
@@ -156,9 +156,9 @@ $lang['diff_type']             = 'Xem sự khác biệt:';
 $lang['diff_inline']           = 'Nội tuyến';
 $lang['diff_side']             = 'Xếp cạnh nhau';
 $lang['line']                  = 'Dòng';
-$lang['breadcrumb']            = 'Trang đã xem';
-$lang['youarehere']            = 'Bạn đang ở đây';
-$lang['lastmod']               = 'Thời điểm thay đổi';
+$lang['breadcrumb']            = 'Trang đã xem:';
+$lang['youarehere']            = 'Bạn đang ở đây:';
+$lang['lastmod']               = 'Thời điểm thay đổi:';
 $lang['by']                    = 'do';
 $lang['deleted']               = 'bị xoá';
 $lang['created']               = 'được tạo ra';
@@ -193,18 +193,18 @@ $lang['metaedit']              = 'Sá»­a Metadata';
 $lang['metasaveerr']           = 'Thất bại khi viết metadata';
 $lang['metasaveok']            = 'Metadata đã được lưu';
 $lang['btn_img_backto']            = 'Quay lại %s';
-$lang['img_title']             = 'Tiêu đề';
-$lang['img_caption']           = 'Ghi chú';
-$lang['img_date']              = 'Ngày';
-$lang['img_fname']             = 'Tên file';
-$lang['img_fsize']             = 'Kích cỡ';
-$lang['img_artist']            = 'Người chụp';
-$lang['img_copyr']             = 'Bản quyền';
-$lang['img_format']            = 'Định dạng';
-$lang['img_camera']            = 'Camera';
-$lang['img_keywords']          = 'Từ khóa';
-$lang['img_width']             = 'Rá»™ng';
-$lang['img_height']            = 'Cao';
+$lang['img_title']             = 'Tiêu đề:';
+$lang['img_caption']           = 'Ghi chú:';
+$lang['img_date']              = 'Ngày:';
+$lang['img_fname']             = 'Tên file:';
+$lang['img_fsize']             = 'Kích cỡ:';
+$lang['img_artist']            = 'Người chụp:';
+$lang['img_copyr']             = 'Bản quyền:';
+$lang['img_format']            = 'Định dạng:';
+$lang['img_camera']            = 'Camera:';
+$lang['img_keywords']          = 'Từ khóa:';
+$lang['img_width']             = 'Rá»™ng:';
+$lang['img_height']            = 'Cao:';
 $lang['btn_mediaManager']           = 'Xem trong trình quản lý tệp media';
 $lang['i_chooselang']          = 'Chọn ngôn ngữ';
 $lang['i_retry']               = 'Thử lại';
diff --git a/inc/lang/zh-tw/jquery.ui.datepicker.js b/inc/lang/zh-tw/jquery.ui.datepicker.js
index b9105ea507b1f27b36b7adac98ef33d86d244469..c9e6dfcb6b0f285f264b18eaf0f12c59b2354494 100644
--- a/inc/lang/zh-tw/jquery.ui.datepicker.js
+++ b/inc/lang/zh-tw/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Chinese initialisation for the jQuery UI date picker plugin. */
 /* Written by Ressol (ressol@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['zh-TW'] = {
-		closeText: '關閉',
-		prevText: '&#x3C;上月',
-		nextText: '下月&#x3E;',
-		currentText: '今天',
-		monthNames: ['一月','二月','三月','四月','五月','六月',
-		'七月','八月','九月','十月','十一月','十二月'],
-		monthNamesShort: ['一月','二月','三月','四月','五月','六月',
-		'七月','八月','九月','十月','十一月','十二月'],
-		dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
-		dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
-		dayNamesMin: ['日','一','二','三','四','五','六'],
-		weekHeader: '周',
-		dateFormat: 'yy/mm/dd',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: true,
-		yearSuffix: 'å¹´'};
-	$.datepicker.setDefaults($.datepicker.regional['zh-TW']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['zh-TW'] = {
+	closeText: '關閉',
+	prevText: '&#x3C;上月',
+	nextText: '下月&#x3E;',
+	currentText: '今天',
+	monthNames: ['一月','二月','三月','四月','五月','六月',
+	'七月','八月','九月','十月','十一月','十二月'],
+	monthNamesShort: ['一月','二月','三月','四月','五月','六月',
+	'七月','八月','九月','十月','十一月','十二月'],
+	dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
+	dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
+	dayNamesMin: ['日','一','二','三','四','五','六'],
+	weekHeader: '周',
+	dateFormat: 'yy/mm/dd',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: true,
+	yearSuffix: 'å¹´'};
+datepicker.setDefaults(datepicker.regional['zh-TW']);
+
+return datepicker.regional['zh-TW'];
+
+}));
diff --git a/inc/lang/zh-tw/lang.php b/inc/lang/zh-tw/lang.php
index 84afec97ad14be63a5a20563ed296f3c02158c18..bf7f89130d9ca8638b4b68c010d8dee9df42ab9b 100644
--- a/inc/lang/zh-tw/lang.php
+++ b/inc/lang/zh-tw/lang.php
@@ -2,7 +2,7 @@
 
 /**
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
- *
+ * 
  * @author chinsan <chinsan@mail2000.com.tw>
  * @author Li-Jiun Huang <ljhuang.tw@gmail.com>
  * @author http://www.chinese-tools.com/tools/converter-simptrad.html
@@ -13,6 +13,8 @@
  * @author Ichirou Uchiki <syaoranhinata@gmail.com>
  * @author tsangho <ou4222@gmail.com>
  * @author Danny Lin <danny0838@gmail.com>
+ * @author Stan <talktostan@gmail.com>
+ * @author June-Hao Hou <junehao@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -57,7 +59,9 @@ $lang['btn_register']          = '註冊';
 $lang['btn_apply']             = '套用';
 $lang['btn_media']             = '多媒體管理器';
 $lang['btn_deleteuser']        = '移除我的帳號';
-$lang['loggedinas']            = '登入成';
+$lang['btn_img_backto']        = '回上一頁 %s';
+$lang['btn_mediaManager']      = '在多媒體管理器中檢視';
+$lang['loggedinas']            = '登入成:';
 $lang['user']                  = '帳號';
 $lang['pass']                  = '密碼';
 $lang['newpass']               = '新密碼';
@@ -102,12 +106,12 @@ $lang['license']               = '若無特別註明,本 wiki 上的內容都
 $lang['licenseok']             = '注意:編輯此頁面表示您同意用以下授權方式發布您撰寫的內容:';
 $lang['searchmedia']           = '搜尋檔名:';
 $lang['searchmedia_in']        = '在 %s 裏搜尋';
-$lang['txt_upload']            = '請選擇要上傳的檔案';
-$lang['txt_filename']          = '請輸入要上傳至本 wiki 的檔案名稱 (非必要)';
+$lang['txt_upload']            = '請選擇要上傳的檔案:';
+$lang['txt_filename']          = '請輸入要上傳至本 wiki 的檔案名稱 (非必要):';
 $lang['txt_overwrt']           = '是否要覆蓋原有檔案';
 $lang['maxuploadsize']         = '每個上傳檔案不可大於 %s 。';
-$lang['lockedby']              = '目前已被下列人員鎖定';
-$lang['lockexpire']            = '預計解除鎖定於';
+$lang['lockedby']              = '目前已被下列人員鎖定:';
+$lang['lockexpire']            = '預計解除鎖定於:';
 $lang['js']['willexpire']      = '本頁的編輯鎖定將在一分鐘內到期。要避免發生衝突,請按「預覽」鍵重設鎖定計時。';
 $lang['js']['notsavedyet']     = '未儲存的變更將會遺失,繼續嗎?';
 $lang['js']['searchmedia']     = '搜尋檔案';
@@ -187,10 +191,15 @@ $lang['difflink']              = '連向這個比對檢視';
 $lang['diff_type']             = '檢視差異:';
 $lang['diff_inline']           = '行內';
 $lang['diff_side']             = '並排';
+$lang['diffprevrev']           = '前次修改
+';
+$lang['diffnextrev']           = '下次修改';
+$lang['difflastrev']           = '最後一次修改
+';
 $lang['line']                  = '行';
-$lang['breadcrumb']            = '足跡';
-$lang['youarehere']            = '您在這裏';
-$lang['lastmod']               = '上一次變更';
+$lang['breadcrumb']            = '足跡:';
+$lang['youarehere']            = '您在這裏:';
+$lang['lastmod']               = '上一次變更:';
 $lang['by']                    = 'ç”±';
 $lang['deleted']               = '移除';
 $lang['created']               = '建立';
@@ -243,20 +252,18 @@ $lang['admin_register']        = '新增使用者';
 $lang['metaedit']              = '編輯後設資料';
 $lang['metasaveerr']           = '後設資料無法寫入';
 $lang['metasaveok']            = '後設資料已儲存';
-$lang['btn_img_backto']            = '回上一頁 %s';
-$lang['img_title']             = '標題';
-$lang['img_caption']           = '照片說明';
-$lang['img_date']              = '日期';
-$lang['img_fname']             = '檔名';
-$lang['img_fsize']             = '大小';
-$lang['img_artist']            = '攝影者';
-$lang['img_copyr']             = '版權';
-$lang['img_format']            = '格式';
-$lang['img_camera']            = '相機';
-$lang['img_keywords']          = '關鍵字';
-$lang['img_width']             = '寬度';
-$lang['img_height']            = '高度';
-$lang['btn_mediaManager']           = '在多媒體管理器中檢視';
+$lang['img_title']             = '標題:';
+$lang['img_caption']           = '照片說明:';
+$lang['img_date']              = '日期:';
+$lang['img_fname']             = '檔名:';
+$lang['img_fsize']             = '大小:';
+$lang['img_artist']            = '攝影者:';
+$lang['img_copyr']             = '版權:';
+$lang['img_format']            = '格式:';
+$lang['img_camera']            = '相機:';
+$lang['img_keywords']          = '關鍵字:';
+$lang['img_width']             = '寬度:';
+$lang['img_height']            = '高度:';
 $lang['subscr_subscribe_success'] = '已將 %s 加入至 %s 的訂閱列表';
 $lang['subscr_subscribe_error'] = '將 %s 加入至 %s 的訂閱列表時發生錯誤';
 $lang['subscr_subscribe_noaddress'] = '沒有與您登入相關的地址,無法將您加入訂閱列表';
@@ -273,8 +280,6 @@ $lang['subscr_m_receive']      = '接收';
 $lang['subscr_style_every']    = '每次更改都發送信件';
 $lang['subscr_style_digest']   = '對每個頁面發送更改的摘要信件 (每 %.2f 天)';
 $lang['subscr_style_list']     = '自上次發信以來更改的頁面的列表 (每 %.2f 天)';
-
-/* auth.class language support */
 $lang['authtempfail']          = '暫不提供帳號認證。若本狀況持續,請通知本 wiki 管理員。';
 $lang['authpwdexpire']         = '您的密碼將在 %d 天內到期,請馬上更換新密碼。';
 $lang['i_chooselang']          = '選擇您的語系';
@@ -299,6 +304,7 @@ $lang['i_policy']              = '初步的 ACL 政策';
 $lang['i_pol0']                = '開放的 wiki (任何人可讀取、寫入、上傳)';
 $lang['i_pol1']                = '公開的 wiki (任何人可讀取,註冊使用者可寫入與上傳)';
 $lang['i_pol2']                = '封閉的 wiki (只有註冊使用者可讀取、寫入、上傳)';
+$lang['i_allowreg']            = '允許使用者自行註冊';
 $lang['i_retry']               = '重試';
 $lang['i_license']             = '請選擇您想要的內容發佈授權方式:';
 $lang['i_license_none']        = '不要顯示任何關於授權方式的訊息';
@@ -336,7 +342,6 @@ $lang['media_perm_read']       = '抱歉,您沒有足夠權限讀取檔案。'
 $lang['media_perm_upload']     = '抱歉,您沒有足夠權限上傳檔案。';
 $lang['media_update']          = '上傳新的版本';
 $lang['media_restore']         = '還原這個版本';
-
 $lang['currentns']             = '目前的命名空間';
 $lang['searchresult']          = '搜尋結果';
 $lang['plainhtml']             = 'ç´” HTML';
diff --git a/inc/lang/zh/jquery.ui.datepicker.js b/inc/lang/zh/jquery.ui.datepicker.js
index d337e4a99ef0f69a8085745640c81582c6969599..b62090a6309dd94198ddbd279178999f36d068ba 100644
--- a/inc/lang/zh/jquery.ui.datepicker.js
+++ b/inc/lang/zh/jquery.ui.datepicker.js
@@ -1,23 +1,37 @@
 /* Chinese initialisation for the jQuery UI date picker plugin. */
 /* Written by Cloudream (cloudream@gmail.com). */
-jQuery(function($){
-	$.datepicker.regional['zh-CN'] = {
-		closeText: '关闭',
-		prevText: '&#x3C;上月',
-		nextText: '下月&#x3E;',
-		currentText: '今天',
-		monthNames: ['一月','二月','三月','四月','五月','六月',
-		'七月','八月','九月','十月','十一月','十二月'],
-		monthNamesShort: ['一月','二月','三月','四月','五月','六月',
-		'七月','八月','九月','十月','十一月','十二月'],
-		dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
-		dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
-		dayNamesMin: ['日','一','二','三','四','五','六'],
-		weekHeader: '周',
-		dateFormat: 'yy-mm-dd',
-		firstDay: 1,
-		isRTL: false,
-		showMonthAfterYear: true,
-		yearSuffix: 'å¹´'};
-	$.datepicker.setDefaults($.datepicker.regional['zh-CN']);
-});
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "../datepicker" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery.datepicker );
+	}
+}(function( datepicker ) {
+
+datepicker.regional['zh-CN'] = {
+	closeText: '关闭',
+	prevText: '&#x3C;上月',
+	nextText: '下月&#x3E;',
+	currentText: '今天',
+	monthNames: ['一月','二月','三月','四月','五月','六月',
+	'七月','八月','九月','十月','十一月','十二月'],
+	monthNamesShort: ['一月','二月','三月','四月','五月','六月',
+	'七月','八月','九月','十月','十一月','十二月'],
+	dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
+	dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
+	dayNamesMin: ['日','一','二','三','四','五','六'],
+	weekHeader: '周',
+	dateFormat: 'yy-mm-dd',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: true,
+	yearSuffix: 'å¹´'};
+datepicker.setDefaults(datepicker.regional['zh-CN']);
+
+return datepicker.regional['zh-CN'];
+
+}));
diff --git a/inc/lang/zh/lang.php b/inc/lang/zh/lang.php
index 86c2ac20cbe0238bdc859543b3da2179ffcc5dad..c8a76b66b627679c65350a9916ea50a9d6f8eda4 100644
--- a/inc/lang/zh/lang.php
+++ b/inc/lang/zh/lang.php
@@ -22,6 +22,7 @@
  * @author oott123 <ip.192.168.1.1@qq.com>
  * @author Cupen <Cupenoruler@foxmail.com>
  * @author xiqingongzi <Xiqingongzi@Gmail.com>
+ * @author qinghao <qingxianhao@gmail.com>
  */
 $lang['encoding']              = 'utf-8';
 $lang['direction']             = 'ltr';
@@ -66,7 +67,9 @@ $lang['btn_register']          = '注册';
 $lang['btn_apply']             = '应用';
 $lang['btn_media']             = '媒体管理器';
 $lang['btn_deleteuser']        = '移除我的账户';
-$lang['loggedinas']            = '登录为';
+$lang['btn_img_backto']        = '返回到 %s';
+$lang['btn_mediaManager']      = '在媒体管理器中查看';
+$lang['loggedinas']            = '登录为:';
 $lang['user']                  = '用户名';
 $lang['pass']                  = '密码';
 $lang['newpass']               = '请输入新密码';
@@ -111,12 +114,12 @@ $lang['license']               = '除额外注明的地方外,本维基上的
 $lang['licenseok']             = '当您选择开始编辑本页,即寓示你同意将你贡献的内容按下列许可协议发布:';
 $lang['searchmedia']           = '查找文件名:';
 $lang['searchmedia_in']        = '在%s中查找';
-$lang['txt_upload']            = '选择要上传的文件';
-$lang['txt_filename']          = '上传并重命名为(可选)';
+$lang['txt_upload']            = '选择要上传的文件:';
+$lang['txt_filename']          = '上传并重命名为(可选):';
 $lang['txt_overwrt']           = '覆盖已存在的同名文件';
 $lang['maxuploadsize']         = '上传限制。每个文件 %s';
-$lang['lockedby']              = '目前已被下列人员锁定';
-$lang['lockexpire']            = '预计锁定解除于';
+$lang['lockedby']              = '目前已被下列人员锁定:';
+$lang['lockexpire']            = '预计锁定解除于:';
 $lang['js']['willexpire']      = '您对本页的独有编辑权将于一分钟之后解除。\n为了防止与其他人的编辑冲突,请使用预览按钮重设计时器。';
 $lang['js']['notsavedyet']     = '未保存的更改将丢失。
 真的要继续?';
@@ -197,10 +200,15 @@ $lang['difflink']              = '到此差别页面的链接';
 $lang['diff_type']             = '查看差异:';
 $lang['diff_inline']           = '行内显示';
 $lang['diff_side']             = '并排显示';
+$lang['diffprevrev']           = '前一修订版';
+$lang['diffnextrev']           = '后一修订版';
+$lang['difflastrev']           = '上一修订版';
+$lang['diffbothprevrev']       = '两侧同时换到之前的修订记录';
+$lang['diffbothnextrev']       = '两侧同时换到之后的修订记录';
 $lang['line']                  = '行';
-$lang['breadcrumb']            = '您的足迹';
-$lang['youarehere']            = '您在这里';
-$lang['lastmod']               = '最后更改';
+$lang['breadcrumb']            = '您的足迹:';
+$lang['youarehere']            = '您在这里:';
+$lang['lastmod']               = '最后更改:';
 $lang['by']                    = 'ç”±';
 $lang['deleted']               = '移除';
 $lang['created']               = '创建';
@@ -253,20 +261,18 @@ $lang['admin_register']        = '添加新用户';
 $lang['metaedit']              = '编辑元数据';
 $lang['metasaveerr']           = '写入元数据失败';
 $lang['metasaveok']            = '元数据已保存';
-$lang['btn_img_backto']            = '返回到 %s';
-$lang['img_title']             = '标题';
-$lang['img_caption']           = '说明';
-$lang['img_date']              = '日期';
-$lang['img_fname']             = '名称';
-$lang['img_fsize']             = '大小';
-$lang['img_artist']            = '摄影师';
-$lang['img_copyr']             = '版权';
-$lang['img_format']            = '格式';
-$lang['img_camera']            = '相机';
-$lang['img_keywords']          = '关键字';
-$lang['img_width']             = '宽度';
-$lang['img_height']            = '高度';
-$lang['btn_mediaManager']           = '在媒体管理器中查看';
+$lang['img_title']             = '标题:';
+$lang['img_caption']           = '说明:';
+$lang['img_date']              = '日期:';
+$lang['img_fname']             = '名称:';
+$lang['img_fsize']             = '大小:';
+$lang['img_artist']            = '摄影师:';
+$lang['img_copyr']             = '版权:';
+$lang['img_format']            = '格式:';
+$lang['img_camera']            = '相机:';
+$lang['img_keywords']          = '关键字:';
+$lang['img_width']             = '宽度:';
+$lang['img_height']            = '高度:';
 $lang['subscr_subscribe_success'] = '添加 %s 到 %s 的订阅列表';
 $lang['subscr_subscribe_error'] = '添加 %s 到 %s 的订阅列表中出现错误';
 $lang['subscr_subscribe_noaddress'] = '没有与您登录信息相关联的地址,您无法被添加到订阅列表';
diff --git a/inc/load.php b/inc/load.php
index f1deffe19a56cf867f8fa39de04101d533a87fc3..ac2812a0bbe3bf28e96b1794577a3f60592adb09 100644
--- a/inc/load.php
+++ b/inc/load.php
@@ -102,6 +102,10 @@ function load_autoload($name){
         'Doku_Renderer_xhtmlsummary' => DOKU_INC.'inc/parser/xhtmlsummary.php',
         'Doku_Renderer_metadata' => DOKU_INC.'inc/parser/metadata.php',
 
+        'DokuCLI'                => DOKU_INC.'inc/cli.php',
+        'DokuCLI_Options'        => DOKU_INC.'inc/cli.php',
+        'DokuCLI_Colors'         => DOKU_INC.'inc/cli.php',
+
     );
 
     if(isset($classes[$name])){
diff --git a/inc/media.php b/inc/media.php
index 2c1a3e8eba8b63637dcd6e2b1323ce3478312f6c..9022858e1599095d49f17c4f35b9a2b0eafae3fc 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -203,7 +203,7 @@ define('DOKU_MEDIA_EMPTY_NS', 8);
  *
  * @author             Andreas Gohr <andi@splitbrain.org>
  * @param string $id media id
- * @param int $auth current auth check result
+ * @param int $auth no longer used
  * @return int One of: 0,
  *                     DOKU_MEDIA_DELETED,
  *                     DOKU_MEDIA_DELETED | DOKU_MEDIA_EMPTY_NS,
@@ -212,6 +212,7 @@ define('DOKU_MEDIA_EMPTY_NS', 8);
  */
 function media_delete($id,$auth){
     global $lang;
+    $auth = auth_quickaclcheck(ltrim(getNS($id).':*', ':'));
     if($auth < AUTH_DELETE) return DOKU_MEDIA_NOT_AUTH;
     if(media_inuse($id)) return DOKU_MEDIA_INUSE;
 
@@ -1042,7 +1043,7 @@ function media_details($image, $auth, $rev=false, $meta=false) {
     foreach($tags as $tag){
         if ($tag['value']) {
             $value = cleanText($tag['value']);
-            echo '<dt>'.$lang[$tag['tag'][1]].':</dt><dd>';
+            echo '<dt>'.$lang[$tag['tag'][1]].'</dt><dd>';
             if ($tag['tag'][2] == 'date') echo dformat($value);
             else echo hsc($value);
             echo '</dd>'.NL;
@@ -1225,7 +1226,7 @@ function media_file_diff($image, $l_rev, $r_rev, $ns, $auth, $fromajax){
         foreach($tags as $tag){
             $value = cleanText($tag['value']);
             if (!$value) $value = '-';
-            echo '<dt>'.$lang[$tag['tag'][1]].':</dt>';
+            echo '<dt>'.$lang[$tag['tag'][1]].'</dt>';
             echo '<dd>';
             if ($tag['highlighted']) {
                 echo '<strong>';
@@ -1448,17 +1449,23 @@ function media_printfile($item,$auth,$jump,$display_namespace=false){
     echo '</div>'.NL;
 }
 
-function media_printicon($filename){
+/**
+ * Display a media icon
+ *
+ * @param $filename
+ * @param string $size the size subfolder, if not specified 16x16 is used
+ * @return string
+ */
+function media_printicon($filename, $size=''){
     list($ext) = mimetype(mediaFN($filename),false);
 
-    if (@file_exists(DOKU_INC.'lib/images/fileicons/32x32/'.$ext.'.png')) {
-        $icon = DOKU_BASE.'lib/images/fileicons/32x32/'.$ext.'.png';
+    if (@file_exists(DOKU_INC.'lib/images/fileicons/'.$size.'/'.$ext.'.png')) {
+        $icon = DOKU_BASE.'lib/images/fileicons/'.$size.'/'.$ext.'.png';
     } else {
-        $icon = DOKU_BASE.'lib/images/fileicons/32x32/file.png';
+        $icon = DOKU_BASE.'lib/images/fileicons/'.$size.'/file.png';
     }
 
     return '<img src="'.$icon.'" alt="'.$filename.'" class="icon" />';
-
 }
 
 /**
@@ -1482,7 +1489,7 @@ function media_printfile_thumbs($item,$auth,$jump=false,$display_namespace=false
         echo '<a id="d_:'.$item['id'].'" class="image" title="'.$item['id'].'" href="'.
             media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']),
             'tab_details' => 'view')).'">';
-        echo media_printicon($item['id']);
+        echo media_printicon($item['id'], '32x32');
         echo '</a>';
     }
     echo '</dt>'.NL;
@@ -1648,10 +1655,10 @@ function media_uploadform($ns, $auth, $fullscreen = false){
     $form->addElement(formSecurityToken());
     $form->addHidden('ns', hsc($ns));
     $form->addElement(form_makeOpenTag('p'));
-    $form->addElement(form_makeFileField('upload', $lang['txt_upload'].':', 'upload__file'));
+    $form->addElement(form_makeFileField('upload', $lang['txt_upload'], 'upload__file'));
     $form->addElement(form_makeCloseTag('p'));
     $form->addElement(form_makeOpenTag('p'));
-    $form->addElement(form_makeTextField('mediaid', noNS($id), $lang['txt_filename'].':', 'upload__name'));
+    $form->addElement(form_makeTextField('mediaid', noNS($id), $lang['txt_filename'], 'upload__name'));
     $form->addElement(form_makeButton('submit', '', $lang['btn_upload']));
     $form->addElement(form_makeCloseTag('p'));
 
diff --git a/inc/pageutils.php b/inc/pageutils.php
index d5d33e76f40e7407c1a211be4358fb63477dcbb0..9ea75c8aa9ec5792b27a88b9b6d42818dc93e8d8 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -17,6 +17,10 @@
  * If the second parameter is true (default) the ID is cleaned.
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $param  the $_REQUEST variable name, default 'id'
+ * @param bool   $clean  if true, ID is cleaned
+ * @return mixed|string
  */
 function getID($param='id',$clean=true){
     /** @var Input $INPUT */
@@ -146,6 +150,9 @@ function cleanID($raw_id,$ascii=false){
  * Return namespacepart of a wiki ID
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id
+ * @return string|bool the namespace part or false if the given ID has no namespace (root)
  */
 function getNS($id){
     $pos = strrpos((string)$id,':');
@@ -159,6 +166,9 @@ function getNS($id){
  * Returns the ID without the namespace
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id
+ * @return string
  */
 function noNS($id) {
     $pos = strrpos($id, ':');
@@ -173,6 +183,9 @@ function noNS($id) {
  * Returns the current namespace
  *
  * @author Nathan Fritz <fritzn@crown.edu>
+ *
+ * @param string $id
+ * @return string
  */
 function curNS($id) {
     return noNS(getNS($id));
@@ -182,6 +195,9 @@ function curNS($id) {
  * Returns the ID without the namespace or current namespace for 'start' pages
  *
  * @author Nathan Fritz <fritzn@crown.edu>
+ *
+ * @param string $id
+ * @return string
  */
 function noNSorNS($id) {
     global $conf;
@@ -202,6 +218,7 @@ function noNSorNS($id) {
  * @param string  $title   The headline title
  * @param array|bool   $check   Existing IDs (title => number)
  * @return string the title
+ *
  * @author Andreas Gohr <andi@splitbrain.org>
  */
 function sectionID($title,&$check) {
@@ -232,6 +249,11 @@ function sectionID($title,&$check) {
  * parameters as for wikiFN
  *
  * @author Chris Smith <chris@jalakai.co.uk>
+ *
+ * @param string     $id     page id
+ * @param string|int $rev    empty or revision timestamp
+ * @param bool       $clean  flag indicating that $id should be cleaned (see wikiFN as well)
+ * @return bool exists?
  */
 function page_exists($id,$rev='',$clean=true, $data_at=false) {
     if($rev !== '' && $date_at) {
@@ -296,6 +318,9 @@ function wikiFN($raw_id,$rev='',$clean=true){
  * Returns the full path to the file for locking the page while editing.
  *
  * @author Ben Coburn <btcoburn@silicodon.net>
+ *
+ * @param string $id page id
+ * @return string full path
  */
 function wikiLockFN($id) {
     global $conf;
@@ -307,6 +332,10 @@ function wikiLockFN($id) {
  * returns the full path to the meta file specified by ID and extension
  *
  * @author Steven Danz <steven-danz@kc.rr.com>
+ *
+ * @param string $id   page id
+ * @param string $ext  file extension
+ * @return string full path
  */
 function metaFN($id,$ext){
     global $conf;
@@ -320,6 +349,10 @@ function metaFN($id,$ext){
  * returns the full path to the media's meta file specified by ID and extension
  *
  * @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param string $id   media id
+ * @param string $ext  extension of media
+ * @return string
  */
 function mediaMetaFN($id,$ext){
     global $conf;
@@ -334,6 +367,9 @@ function mediaMetaFN($id,$ext){
  *
  * @author Esther Brunner <esther@kaffeehaus.ch>
  * @author Michael Hamann <michael@content-space.de>
+ *
+ * @param string $id page id
+ * @return array
  */
 function metaFiles($id){
     $basename = metaFN($id, '');
@@ -349,6 +385,10 @@ function metaFiles($id){
  *
  * @author Andreas Gohr <andi@splitbrain.org>
  * @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param string     $id  media id
+ * @param string|int $rev empty string or revision timestamp
+ * @return string full path
  */
 function mediaFN($id, $rev=''){
     global $conf;
@@ -371,6 +411,7 @@ function mediaFN($id, $rev=''){
  * @param  string $id  The id of the local file
  * @param  string $ext The file extension (usually txt)
  * @return string full filepath to localized file
+ *
  * @author Andreas Gohr <andi@splitbrain.org>
  */
 function localeFN($id,$ext='txt'){
@@ -396,6 +437,11 @@ function localeFN($id,$ext='txt'){
  * http://www.php.net/manual/en/function.realpath.php#57016
  *
  * @author <bart at mediawave dot nl>
+ *
+ * @param string $ns     namespace which is context of id
+ * @param string $id     relative id
+ * @param bool   $clean  flag indicating that id should be cleaned
+ * @return mixed|string
  */
 function resolve_id($ns,$id,$clean=true){
     global $conf;
@@ -441,6 +487,10 @@ function resolve_id($ns,$id,$clean=true){
  * Returns a full media id
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string  $ns     namespace which is context of id
+ * @param string &$page   (reference) relative media id, updated to resolved id
+ * @param bool   &$exists (reference) updated with existance of media
  */
 function resolve_mediaid($ns,&$page,&$exists,$rev='',$date_at=false){
     if($rev !== '' &&  $date_at){
@@ -459,6 +509,10 @@ function resolve_mediaid($ns,&$page,&$exists,$rev='',$date_at=false){
  * Returns a full page id
  *
  * @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string  $ns     namespace which is context of id
+ * @param string &$page   (reference) relative page id, updated to resolved id
+ * @param bool   &$exists (reference) updated with existance of media
  */
 function resolve_pageid($ns,&$page,&$exists,$rev='',$date_at=false ){
     global $conf;
@@ -556,6 +610,9 @@ function getCacheName($data,$ext=''){
  * Checks a pageid against $conf['hidepages']
  *
  * @author Andreas Gohr <gohr@cosmocode.de>
+ *
+ * @param string $id page id
+ * @return bool
  */
 function isHiddenPage($id){
     $data = array(
@@ -569,7 +626,7 @@ function isHiddenPage($id){
 /**
  * callback checks if page is hidden
  *
- * @param array $data event data    see isHiddenPage()
+ * @param array $data event data    - see isHiddenPage()
  */
 function _isHiddenPage(&$data) {
     global $conf;
@@ -588,6 +645,9 @@ function _isHiddenPage(&$data) {
  * Reverse of isHiddenPage
  *
  * @author Andreas Gohr <gohr@cosmocode.de>
+ *
+ * @param string $id page id
+ * @return bool
  */
 function isVisiblePage($id){
     return !isHiddenPage($id);
@@ -600,8 +660,10 @@ function isVisiblePage($id){
  * “*”. Output is escaped.
  *
  * @author Adrian Lang <lang@cosmocode.de>
+ *
+ * @param string $id page id
+ * @return string
  */
-
 function prettyprint_id($id) {
     if (!$id || $id === ':') {
         return '*';
@@ -624,6 +686,10 @@ function prettyprint_id($id) {
  *
  * @author Andreas Gohr <andi@splitbrain.org>
  * @see    urlencode
+ *
+ * @param string $file file name
+ * @param bool   $safe if true, only encoded when non ASCII characters detected
+ * @return string
  */
 function utf8_encodeFN($file,$safe=true){
     global $conf;
@@ -649,6 +715,9 @@ function utf8_encodeFN($file,$safe=true){
  *
  * @author Andreas Gohr <andi@splitbrain.org>
  * @see    urldecode
+ *
+ * @param string $file file name
+ * @return string
  */
 function utf8_decodeFN($file){
     global $conf;
diff --git a/inc/parser/code.php b/inc/parser/code.php
index d77ffd1aa8ec5c7b9543df11e19d99bd6e3b6b88..00b956c277df503efa584535c8c59722aa30a2ab 100644
--- a/inc/parser/code.php
+++ b/inc/parser/code.php
@@ -7,25 +7,25 @@
 if(!defined('DOKU_INC')) die('meh.');
 
 class Doku_Renderer_code extends Doku_Renderer {
-    var $_codeblock=0;
+    var $_codeblock = 0;
 
     /**
      * Send the wanted code block to the browser
      *
      * When the correct block was found it exits the script.
      */
-    function code($text, $language = null, $filename='' ) {
+    function code($text, $language = null, $filename = '') {
         global $INPUT;
         if(!$language) $language = 'txt';
         if(!$filename) $filename = 'snippet.'.$language;
         $filename = utf8_basename($filename);
         $filename = utf8_stripspecials($filename, '_');
 
-        if($this->_codeblock == $INPUT->str('codeblock')){
+        if($this->_codeblock == $INPUT->str('codeblock')) {
             header("Content-Type: text/plain; charset=utf-8");
             header("Content-Disposition: attachment; filename=$filename");
             header("X-Robots-Tag: noindex");
-            echo trim($text,"\r\n");
+            echo trim($text, "\r\n");
             exit;
         }
 
@@ -35,7 +35,7 @@ class Doku_Renderer_code extends Doku_Renderer {
     /**
      * Wraps around code()
      */
-    function file($text, $language = null, $filename='') {
+    function file($text, $language = null, $filename = '') {
         $this->code($text, $language, $filename);
     }
 
@@ -53,7 +53,7 @@ class Doku_Renderer_code extends Doku_Renderer {
      *
      * @returns string 'code'
      */
-    function getFormat(){
+    function getFormat() {
         return 'code';
     }
 }
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index 8ae9912096ff82052a3a8c9a2595118e72a306dd..a1040d12e78e21bb77c6c9af3faae21f84d5333e 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -12,6 +12,7 @@ class Doku_Handler {
 
     var $status = array(
         'section' => false,
+        'doublequote' => 0,
     );
 
     var $rewriteBlocks = true;
@@ -401,11 +402,17 @@ class Doku_Handler {
 
     function doublequoteopening($match, $state, $pos) {
         $this->_addCall('doublequoteopening',array(), $pos);
+        $this->status['doublequote']++;
         return true;
     }
 
     function doublequoteclosing($match, $state, $pos) {
-        $this->_addCall('doublequoteclosing',array(), $pos);
+        if ($this->status['doublequote'] <= 0) {
+            $this->doublequoteopening($match, $state, $pos);
+        } else {
+            $this->_addCall('doublequoteclosing',array(), $pos);
+            $this->status['doublequote'] = max(0, --$this->status['doublequote']);
+        }
         return true;
     }
 
@@ -1149,6 +1156,9 @@ class Doku_Handler_Table {
     var $currentCols = 0;
     var $firstCell = false;
     var $lastCellType = 'tablecell';
+    var $inTableHead = true;
+    var $currentRow = array('tableheader' => 0, 'tablecell' => 0);
+    var $countTableHeadRows = 0;
 
     function Doku_Handler_Table(& $CallWriter) {
         $this->CallWriter = & $CallWriter;
@@ -1216,15 +1226,24 @@ class Doku_Handler_Table {
         $this->firstCell = true;
         $this->lastCellType = 'tablecell';
         $this->maxRows++;
+        if ($this->inTableHead) {
+            $this->currentRow = array('tablecell' => 0, 'tableheader' => 0);
+        }
     }
 
     function tableRowClose($call) {
+        if ($this->inTableHead && ($this->inTableHead = $this->isTableHeadRow())) {
+            $this->countTableHeadRows++;
+        }
         // Strip off final cell opening and anything after it
         while ( $discard = array_pop($this->tableCalls ) ) {
 
             if ( $discard[0] == 'tablecell_open' || $discard[0] == 'tableheader_open') {
                 break;
             }
+            if (!empty($this->currentRow[$discard[0]])) {
+                $this->currentRow[$discard[0]]--;
+            }
         }
         $this->tableCalls[] = array('tablerow_close', array(), $call[2]);
 
@@ -1233,7 +1252,20 @@ class Doku_Handler_Table {
         }
     }
 
+    function isTableHeadRow() {
+        $td = $this->currentRow['tablecell'];
+        $th = $this->currentRow['tableheader'];
+
+        if (!$th || $td > 2) return false;
+        if (2*$td > $th) return false;
+
+        return true;
+    }
+
     function tableCell($call) {
+        if ($this->inTableHead) {
+            $this->currentRow[$call[0]]++;
+        }
         if ( !$this->firstCell ) {
 
             // Increase the span
@@ -1281,6 +1313,13 @@ class Doku_Handler_Table {
         $cellKey = array();
         $toDelete = array();
 
+        // if still in tableheader, then there can be no table header
+        // as all rows can't be within <THEAD>
+        if ($this->inTableHead) {
+            $this->inTableHead = false;
+            $this->countTableHeadRows = 0;
+        }
+
         // Look for the colspan elements and increment the colspan on the
         // previous non-empty opening cell. Once done, delete all the cells
         // that contain colspans
@@ -1288,6 +1327,14 @@ class Doku_Handler_Table {
             $call = $this->tableCalls[$key];
 
             switch ($call[0]) {
+                case 'table_open' :
+                    if($this->countTableHeadRows) {
+                        array_splice($this->tableCalls, $key+1, 0, array(
+                              array('tablethead_open', array(), $call[2]))
+                        );
+                    }
+                    break;
+
                 case 'tablerow_open':
 
                     $lastRow++;
@@ -1357,15 +1404,19 @@ class Doku_Handler_Table {
                     } else {
 
                         $spanning_cell = null;
-                        for($i = $lastRow-1; $i > 0; $i--) {
 
-                            if ( $this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tablecell_open' || $this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tableheader_open' ) {
+                        // can't cross thead/tbody boundary
+                        if (!$this->countTableHeadRows || ($lastRow-1 != $this->countTableHeadRows)) {
+                            for($i = $lastRow-1; $i > 0; $i--) {
 
-                                if ($this->tableCalls[$cellKey[$i][$lastCell]][1][2] >= $lastRow - $i) {
-                                    $spanning_cell = $i;
-                                    break;
-                                }
+                                if ( $this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tablecell_open' || $this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tableheader_open' ) {
+
+                                    if ($this->tableCalls[$cellKey[$i][$lastCell]][1][2] >= $lastRow - $i) {
+                                        $spanning_cell = $i;
+                                        break;
+                                    }
 
+                                }
                             }
                         }
                         if (is_null($spanning_cell)) {
@@ -1396,6 +1447,10 @@ class Doku_Handler_Table {
                         $key += 3;
                     }
 
+                    if($this->countTableHeadRows == $lastRow) {
+                        array_splice($this->tableCalls, $key+1, 0, array(
+                              array('tablethead_close', array(), $call[2])));
+                    }
                     break;
 
             }
@@ -1438,7 +1493,7 @@ class Doku_Handler_Block {
     var $blockOpen = array(
             'header',
             'listu_open','listo_open','listitem_open','listcontent_open',
-            'table_open','tablerow_open','tablecell_open','tableheader_open',
+            'table_open','tablerow_open','tablecell_open','tableheader_open','tablethead_open',
             'quote_open',
             'code','file','hr','preformatted','rss',
             'htmlblock','phpblock',
@@ -1448,7 +1503,7 @@ class Doku_Handler_Block {
     var $blockClose = array(
             'header',
             'listu_close','listo_close','listitem_close','listcontent_close',
-            'table_close','tablerow_close','tablecell_close','tableheader_close',
+            'table_close','tablerow_close','tablecell_close','tableheader_close','tablethead_close',
             'quote_close',
             'code','file','hr','preformatted','rss',
             'htmlblock','phpblock',
diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php
index 82a268fd6b01e10dd8f291d10c4865e7dc23a4d1..25bf3fe3df1a5f4efbaf2135a68e7935bae643c6 100644
--- a/inc/parser/metadata.php
+++ b/inc/parser/metadata.php
@@ -6,129 +6,198 @@
  */
 if(!defined('DOKU_INC')) die('meh.');
 
-if ( !defined('DOKU_LF') ) {
+if(!defined('DOKU_LF')) {
     // Some whitespace to help View > Source
-    define ('DOKU_LF',"\n");
+    define ('DOKU_LF', "\n");
 }
 
-if ( !defined('DOKU_TAB') ) {
+if(!defined('DOKU_TAB')) {
     // Some whitespace to help View > Source
-    define ('DOKU_TAB',"\t");
+    define ('DOKU_TAB', "\t");
 }
 
 /**
- * The Renderer
+ * The MetaData Renderer
+ *
+ * Metadata is additional information about a DokuWiki page that gets extracted mainly from the page's content
+ * but also it's own filesystem data (like the creation time). All metadata is stored in the fields $meta and
+ * $persistent.
+ *
+ * Some simplified rendering to $doc is done to gather the page's (text-only) abstract.
  */
 class Doku_Renderer_metadata extends Doku_Renderer {
+    /** the approximate byte lenght to capture for the abstract */
+    const ABSTRACT_LEN = 250;
+
+    /** the maximum UTF8 character length for the abstract */
+    const ABSTRACT_MAX = 500;
+
+    /** @var array transient meta data, will be reset on each rendering */
+    public $meta = array();
+
+    /** @var array persistent meta data, will be kept until explicitly deleted */
+    public $persistent = array();
 
-    var $doc  = '';
-    var $meta = array();
-    var $persistent = array();
+    /** @var array the list of headers used to create unique link ids */
+    protected $headers = array();
 
-    var $headers = array();
-    var $capture = true;
-    var $store   = '';
-    var $firstimage = '';
+    /** @var string temporary $doc store */
+    protected $store = '';
 
-    function getFormat(){
+    /** @var string keeps the first image reference */
+    protected $firstimage = '';
+
+    /** @var bool determines if enough data for the abstract was collected, yet */
+    public $capture = true;
+
+    /** @var int number of bytes captured for abstract */
+    protected $captured = 0;
+
+    /**
+     * Returns the format produced by this renderer.
+     *
+     * @return string always 'metadata'
+     */
+    function getFormat() {
         return 'metadata';
     }
 
-    function document_start(){
+    /**
+     * Initialize the document
+     *
+     * Sets up some of the persistent info about the page if it doesn't exist, yet.
+     */
+    function document_start() {
         global $ID;
 
         $this->headers = array();
 
         // external pages are missing create date
-        if(!$this->persistent['date']['created']){
+        if(!$this->persistent['date']['created']) {
             $this->persistent['date']['created'] = filectime(wikiFN($ID));
         }
-        if(!isset($this->persistent['user'])){
+        if(!isset($this->persistent['user'])) {
             $this->persistent['user'] = '';
         }
-        if(!isset($this->persistent['creator'])){
+        if(!isset($this->persistent['creator'])) {
             $this->persistent['creator'] = '';
         }
         // reset metadata to persistent values
         $this->meta = $this->persistent;
     }
 
-    function document_end(){
+    /**
+     * Finalize the document
+     *
+     * Stores collected data in the metadata
+     */
+    function document_end() {
         global $ID;
 
         // store internal info in metadata (notoc,nocache)
         $this->meta['internal'] = $this->info;
 
-        if (!isset($this->meta['description']['abstract'])){
+        if(!isset($this->meta['description']['abstract'])) {
             // cut off too long abstracts
             $this->doc = trim($this->doc);
-            if (strlen($this->doc) > 500)
-                $this->doc = utf8_substr($this->doc, 0, 500).'…';
+            if(strlen($this->doc) > self::ABSTRACT_MAX) {
+                $this->doc = utf8_substr($this->doc, 0, self::ABSTRACT_MAX).'…';
+            }
             $this->meta['description']['abstract'] = $this->doc;
         }
 
         $this->meta['relation']['firstimage'] = $this->firstimage;
 
-        if(!isset($this->meta['date']['modified'])){
+        if(!isset($this->meta['date']['modified'])) {
             $this->meta['date']['modified'] = filemtime(wikiFN($ID));
         }
 
     }
 
+    /**
+     * Render plain text data
+     *
+     * This function takes care of the amount captured data and will stop capturing when
+     * enough abstract data is available
+     *
+     * @param $text
+     */
+    function cdata($text) {
+        if(!$this->capture) return;
+
+        $this->doc .= $text;
+
+        $this->captured += strlen($text);
+        if($this->captured > self::ABSTRACT_LEN) $this->capture = false;
+    }
+
+    /**
+     * Add an item to the TOC
+     *
+     * @param string $id       the hash link
+     * @param string $text     the text to display
+     * @param int    $level    the nesting level
+     */
     function toc_additem($id, $text, $level) {
         global $conf;
 
         //only add items within configured levels
-        if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']){
+        if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']) {
             // the TOC is one of our standard ul list arrays ;-)
             $this->meta['description']['tableofcontents'][] = array(
-              'hid'   => $id,
-              'title' => $text,
-              'type'  => 'ul',
-              'level' => $level-$conf['toptoclevel']+1
+                'hid'   => $id,
+                'title' => $text,
+                'type'  => 'ul',
+                'level' => $level - $conf['toptoclevel'] + 1
             );
         }
 
     }
 
+    /**
+     * Render a heading
+     *
+     * @param string $text  the text to display
+     * @param int    $level header level
+     * @param int    $pos   byte position in the original source
+     */
     function header($text, $level, $pos) {
-        if (!isset($this->meta['title'])) $this->meta['title'] = $text;
+        if(!isset($this->meta['title'])) $this->meta['title'] = $text;
 
         // add the header to the TOC
-        $hid = $this->_headerToLink($text,'true');
+        $hid = $this->_headerToLink($text, 'true');
         $this->toc_additem($hid, $text, $level);
 
         // add to summary
-        if ($this->capture && ($level > 1)) $this->doc .= DOKU_LF.$text.DOKU_LF;
+        $this->cdata(DOKU_LF.$text.DOKU_LF);
     }
 
-    function section_open($level){}
-    function section_close(){}
-
-    function cdata($text){
-      if ($this->capture) $this->doc .= $text;
-    }
-
-    function p_open(){
-      if ($this->capture) $this->doc .= DOKU_LF;
+    /**
+     * Open a paragraph
+     */
+    function p_open() {
+        $this->cdata(DOKU_LF);
     }
 
-    function p_close(){
-        if ($this->capture){
-            if (strlen($this->doc) > 250) $this->capture = false;
-            else $this->doc .= DOKU_LF;
-        }
+    /**
+     * Close a paragraph
+     */
+    function p_close() {
+        $this->cdata(DOKU_LF);
     }
 
-    function linebreak(){
-        if ($this->capture) $this->doc .= DOKU_LF;
+    /**
+     * Create a line break
+     */
+    function linebreak() {
+        $this->cdata(DOKU_LF);
     }
 
-    function hr(){
-        if ($this->capture){
-            if (strlen($this->doc) > 250) $this->capture = false;
-            else $this->doc .= DOKU_LF.'----------'.DOKU_LF;
-        }
+    /**
+     * Create a horizontal line
+     */
+    function hr() {
+        $this->cdata(DOKU_LF.'----------'.DOKU_LF);
     }
 
     /**
@@ -141,7 +210,7 @@ class Doku_Renderer_metadata extends Doku_Renderer {
      * @author Andreas Gohr <andi@splitbrain.org>
      */
     function footnote_open() {
-        if ($this->capture){
+        if($this->capture) {
             // move current content to store and record footnote
             $this->store = $this->doc;
             $this->doc   = '';
@@ -157,141 +226,214 @@ class Doku_Renderer_metadata extends Doku_Renderer {
      * @author Andreas Gohr
      */
     function footnote_close() {
-        if ($this->capture){
+        if($this->capture) {
             // restore old content
-            $this->doc = $this->store;
+            $this->doc   = $this->store;
             $this->store = '';
         }
     }
 
-    function listu_open(){
-        if ($this->capture) $this->doc .= DOKU_LF;
-    }
-
-    function listu_close(){
-        if ($this->capture && (strlen($this->doc) > 250)) $this->capture = false;
-    }
-
-    function listo_open(){
-        if ($this->capture) $this->doc .= DOKU_LF;
-    }
-
-    function listo_close(){
-        if ($this->capture && (strlen($this->doc) > 250)) $this->capture = false;
+    /**
+     * Open an unordered list
+     */
+    function listu_open() {
+        $this->cdata(DOKU_LF);
     }
 
-    function listitem_open($level){
-        if ($this->capture) $this->doc .= str_repeat(DOKU_TAB, $level).'* ';
+    /**
+     * Open an ordered list
+     */
+    function listo_open() {
+        $this->cdata(DOKU_LF);
     }
 
-    function listitem_close(){
-        if ($this->capture) $this->doc .= DOKU_LF;
+    /**
+     * Open a list item
+     *
+     * @param int $level the nesting level
+     */
+    function listitem_open($level) {
+        $this->cdata(str_repeat(DOKU_TAB, $level).'* ');
     }
 
-    function listcontent_open(){}
-    function listcontent_close(){}
-
-    function unformatted($text){
-        if ($this->capture) $this->doc .= $text;
+    /**
+     * Close a list item
+     */
+    function listitem_close() {
+        $this->cdata(DOKU_LF);
     }
 
-    function preformatted($text){
-        if ($this->capture) $this->doc .= $text;
+    /**
+     * Output preformatted text
+     *
+     * @param string $text
+     */
+    function preformatted($text) {
+        $this->cdata($text);
     }
 
-    function file($text, $lang = null, $file = null){
-        if ($this->capture){
-            $this->doc .= DOKU_LF.$text;
-            if (strlen($this->doc) > 250) $this->capture = false;
-            else $this->doc .= DOKU_LF;
-        }
+    /**
+     * Start a block quote
+     */
+    function quote_open() {
+        $this->cdata(DOKU_LF.DOKU_TAB.'"');
     }
 
-    function quote_open(){
-        if ($this->capture) $this->doc .= DOKU_LF.DOKU_TAB.'"';
+    /**
+     * Stop a block quote
+     */
+    function quote_close() {
+        $this->cdata('"'.DOKU_LF);
     }
 
-    function quote_close(){
-        if ($this->capture){
-            $this->doc .= '"';
-            if (strlen($this->doc) > 250) $this->capture = false;
-            else $this->doc .= DOKU_LF;
-        }
+    /**
+     * Display text as file content, optionally syntax highlighted
+     *
+     * @param string $text text to show
+     * @param string $lang programming language to use for syntax highlighting
+     * @param string $file file path label
+     */
+    function file($text, $lang = null, $file = null) {
+        $this->cdata(DOKU_LF.$text.DOKU_LF);
     }
 
-    function code($text, $language = null, $file = null){
-        if ($this->capture){
-            $this->doc .= DOKU_LF.$text;
-            if (strlen($this->doc) > 250) $this->capture = false;
-            else $this->doc .= DOKU_LF;
-      }
+    /**
+     * Display text as code content, optionally syntax highlighted
+     *
+     * @param string $text     text to show
+     * @param string $language programming language to use for syntax highlighting
+     * @param string $file     file path label
+     */
+    function code($text, $language = null, $file = null) {
+        $this->cdata(DOKU_LF.$text.DOKU_LF);
     }
 
-    function acronym($acronym){
-        if ($this->capture) $this->doc .= $acronym;
+    /**
+     * Format an acronym
+     *
+     * Uses $this->acronyms
+     *
+     * @param string $acronym
+     */
+    function acronym($acronym) {
+        $this->cdata($acronym);
     }
 
-    function smiley($smiley){
-        if ($this->capture) $this->doc .= $smiley;
+    /**
+     * Format a smiley
+     *
+     * Uses $this->smiley
+     *
+     * @param string $smiley
+     */
+    function smiley($smiley) {
+        $this->cdata($smiley);
     }
 
-    function entity($entity){
-        if ($this->capture) $this->doc .= $entity;
+    /**
+     * Format an entity
+     *
+     * Entities are basically small text replacements
+     *
+     * Uses $this->entities
+     *
+     * @param string $entity
+     */
+    function entity($entity) {
+        $this->cdata($entity);
     }
 
-    function multiplyentity($x, $y){
-        if ($this->capture) $this->doc .= $x.'×'.$y;
+    /**
+     * Typographically format a multiply sign
+     *
+     * Example: ($x=640, $y=480) should result in "640×480"
+     *
+     * @param string|int $x first value
+     * @param string|int $y second value
+     */
+    function multiplyentity($x, $y) {
+        $this->cdata($x.'×'.$y);
     }
 
-    function singlequoteopening(){
+    /**
+     * Render an opening single quote char (language specific)
+     */
+    function singlequoteopening() {
         global $lang;
-        if ($this->capture) $this->doc .= $lang['singlequoteopening'];
+        $this->cdata($lang['singlequoteopening']);
     }
 
-    function singlequoteclosing(){
+    /**
+     * Render a closing single quote char (language specific)
+     */
+    function singlequoteclosing() {
         global $lang;
-        if ($this->capture) $this->doc .= $lang['singlequoteclosing'];
+        $this->cdata($lang['singlequoteclosing']);
     }
 
+    /**
+     * Render an apostrophe char (language specific)
+     */
     function apostrophe() {
         global $lang;
-        if ($this->capture) $this->doc .= $lang['apostrophe'];
+        $this->cdata($lang['apostrophe']);
     }
 
-    function doublequoteopening(){
+    /**
+     * Render an opening double quote char (language specific)
+     */
+    function doublequoteopening() {
         global $lang;
-        if ($this->capture) $this->doc .= $lang['doublequoteopening'];
+        $this->cdata($lang['doublequoteopening']);
     }
 
-    function doublequoteclosing(){
+    /**
+     * Render an closinging double quote char (language specific)
+     */
+    function doublequoteclosing() {
         global $lang;
-        if ($this->capture) $this->doc .= $lang['doublequoteclosing'];
+        $this->cdata($lang['doublequoteclosing']);
     }
 
+    /**
+     * Render a CamelCase link
+     *
+     * @param string $link The link name
+     * @see http://en.wikipedia.org/wiki/CamelCase
+     */
     function camelcaselink($link) {
         $this->internallink($link, $link);
     }
 
-    function locallink($hash, $name = null){
+    /**
+     * Render a page local link
+     *
+     * @param string $hash hash link identifier
+     * @param string $name name for the link
+     */
+    function locallink($hash, $name = null) {
         if(is_array($name)) {
             $this->_firstimage($name['src']);
-            if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+            if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
         }
     }
 
     /**
      * keep track of internal links in $this->meta['relation']['references']
+     *
+     * @param string       $id   page ID to link to. eg. 'wiki:syntax'
+     * @param string|array $name name for the link, array for media file
      */
-    function internallink($id, $name = null){
+    function internallink($id, $name = null) {
         global $ID;
 
         if(is_array($name)) {
             $this->_firstimage($name['src']);
-            if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+            if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
         }
 
         $parts = explode('?', $id, 2);
-        if (count($parts) === 2) {
+        if(count($parts) === 2) {
             $id = $parts[0];
         }
 
@@ -299,7 +441,7 @@ class Doku_Renderer_metadata extends Doku_Renderer {
 
         // first resolve and clean up the $id
         resolve_pageid(getNS($ID), $id, $exists);
-        @list($page, $hash) = explode('#', $id, 2);
+        @list($page) = explode('#', $id, 2);
 
         // set metadata
         $this->meta['relation']['references'][$page] = $exists;
@@ -307,84 +449,141 @@ class Doku_Renderer_metadata extends Doku_Renderer {
         // p_set_metadata($id, $data);
 
         // add link title to summary
-        if ($this->capture){
+        if($this->capture) {
             $name = $this->_getLinkTitle($name, $default, $id);
             $this->doc .= $name;
         }
     }
 
-    function externallink($url, $name = null){
+    /**
+     * Render an external link
+     *
+     * @param string       $url  full URL with scheme
+     * @param string|array $name name for the link, array for media file
+     */
+    function externallink($url, $name = null) {
         if(is_array($name)) {
             $this->_firstimage($name['src']);
-            if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+            if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
         }
 
-        if ($this->capture){
-            $this->doc .= $this->_getLinkTitle($name, '<' . $url . '>');
+        if($this->capture) {
+            $this->doc .= $this->_getLinkTitle($name, '<'.$url.'>');
         }
     }
 
-    function interwikilink($match, $name = null, $wikiName, $wikiUri){
+    /**
+     * Render an interwiki link
+     *
+     * You may want to use $this->_resolveInterWiki() here
+     *
+     * @param string       $match     original link - probably not much use
+     * @param string|array $name      name for the link, array for media file
+     * @param string       $wikiName  indentifier (shortcut) for the remote wiki
+     * @param string       $wikiUri   the fragment parsed from the original link
+     */
+    function interwikilink($match, $name = null, $wikiName, $wikiUri) {
         if(is_array($name)) {
             $this->_firstimage($name['src']);
-            if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+            if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
         }
 
-        if ($this->capture){
-            list($wikiUri, $hash) = explode('#', $wikiUri, 2);
+        if($this->capture) {
+            list($wikiUri) = explode('#', $wikiUri, 2);
             $name = $this->_getLinkTitle($name, $wikiUri);
             $this->doc .= $name;
         }
     }
 
-    function windowssharelink($url, $name = null){
+    /**
+     * Link to windows share
+     *
+     * @param string       $url  the link
+     * @param string|array $name name for the link, array for media file
+     */
+    function windowssharelink($url, $name = null) {
         if(is_array($name)) {
             $this->_firstimage($name['src']);
-            if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+            if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
         }
 
-        if ($this->capture){
-            if ($name) $this->doc .= $name;
+        if($this->capture) {
+            if($name) $this->doc .= $name;
             else $this->doc .= '<'.$url.'>';
         }
     }
 
-    function emaillink($address, $name = null){
+    /**
+     * Render a linked E-Mail Address
+     *
+     * Should honor $conf['mailguard'] setting
+     *
+     * @param string       $address Email-Address
+     * @param string|array $name    name for the link, array for media file
+     */
+    function emaillink($address, $name = null) {
         if(is_array($name)) {
             $this->_firstimage($name['src']);
-            if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+            if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
         }
 
-        if ($this->capture){
-            if ($name) $this->doc .= $name;
+        if($this->capture) {
+            if($name) $this->doc .= $name;
             else $this->doc .= '<'.$address.'>';
         }
     }
 
-    function internalmedia($src, $title=null, $align=null, $width=null,
-                           $height=null, $cache=null, $linking=null){
-        if ($this->capture && $title) $this->doc .= '['.$title.']';
+    /**
+     * Render an internal media file
+     *
+     * @param string $src     media ID
+     * @param string $title   descriptive text
+     * @param string $align   left|center|right
+     * @param int    $width   width of media in pixel
+     * @param int    $height  height of media in pixel
+     * @param string $cache   cache|recache|nocache
+     * @param string $linking linkonly|detail|nolink
+     */
+    function internalmedia($src, $title = null, $align = null, $width = null,
+                           $height = null, $cache = null, $linking = null) {
+        if($this->capture && $title) $this->doc .= '['.$title.']';
         $this->_firstimage($src);
         $this->_recordMediaUsage($src);
     }
 
-    function externalmedia($src, $title=null, $align=null, $width=null,
-                           $height=null, $cache=null, $linking=null){
-        if ($this->capture && $title) $this->doc .= '['.$title.']';
+    /**
+     * Render an external media file
+     *
+     * @param string $src     full media URL
+     * @param string $title   descriptive text
+     * @param string $align   left|center|right
+     * @param int    $width   width of media in pixel
+     * @param int    $height  height of media in pixel
+     * @param string $cache   cache|recache|nocache
+     * @param string $linking linkonly|detail|nolink
+     */
+    function externalmedia($src, $title = null, $align = null, $width = null,
+                           $height = null, $cache = null, $linking = null) {
+        if($this->capture && $title) $this->doc .= '['.$title.']';
         $this->_firstimage($src);
     }
 
-    function rss($url,$params) {
+    /**
+     * Render the output of an RSS feed
+     *
+     * @param string $url    URL of the feed
+     * @param array  $params Finetuning of the output
+     */
+    function rss($url, $params) {
         $this->meta['relation']['haspart'][$url] = true;
 
         $this->meta['date']['valid']['age'] =
-              isset($this->meta['date']['valid']['age']) ?
-                  min($this->meta['date']['valid']['age'],$params['refresh']) :
-                  $params['refresh'];
+            isset($this->meta['date']['valid']['age']) ?
+                min($this->meta['date']['valid']['age'], $params['refresh']) :
+                $params['refresh'];
     }
 
-    //----------------------------------------------------------
-    // Utils
+    #region Utils
 
     /**
      * Removes any Namespace from the given name but keeps
@@ -392,35 +591,36 @@ class Doku_Renderer_metadata extends Doku_Renderer {
      *
      * @author Andreas Gohr <andi@splitbrain.org>
      */
-    function _simpleTitle($name){
+    function _simpleTitle($name) {
         global $conf;
 
         if(is_array($name)) return '';
 
-        if($conf['useslash']){
+        if($conf['useslash']) {
             $nssep = '[:;/]';
-        }else{
+        } else {
             $nssep = '[:;]';
         }
-        $name = preg_replace('!.*'.$nssep.'!','',$name);
+        $name = preg_replace('!.*'.$nssep.'!', '', $name);
         //if there is a hash we use the anchor name only
-        $name = preg_replace('!.*#!','',$name);
+        $name = preg_replace('!.*#!', '', $name);
         return $name;
     }
 
     /**
      * Creates a linkid from a headline
      *
+     * @author Andreas Gohr <andi@splitbrain.org>
      * @param string  $title   The headline title
      * @param boolean $create  Create a new unique ID?
-     * @author Andreas Gohr <andi@splitbrain.org>
+     * @return string
      */
-    function _headerToLink($title, $create=false) {
-        if($create){
-            return sectionID($title,$this->headers);
-        }else{
+    function _headerToLink($title, $create = false) {
+        if($create) {
+            return sectionID($title, $this->headers);
+        } else {
             $check = false;
-            return sectionID($title,$check);
+            return sectionID($title, $check);
         }
     }
 
@@ -428,17 +628,22 @@ class Doku_Renderer_metadata extends Doku_Renderer {
      * Construct a title and handle images in titles
      *
      * @author Harry Fuecks <hfuecks@gmail.com>
+     * @param string|array $title    either string title or media array
+     * @param string       $default  default title if nothing else is found
+     * @param null|string  $id       linked page id (used to extract title from first heading)
+     * @return string title text
      */
-    function _getLinkTitle($title, $default, $id=null) {
-        global $conf;
-
-        $isImage = false;
-        if (is_array($title)){
-            if($title['title']) return '['.$title['title'].']';
-        } else if (is_null($title) || trim($title)==''){
-            if (useHeading('content') && $id){
-                $heading = p_get_first_heading($id,METADATA_DONT_RENDER);
-                if ($heading) return $heading;
+    function _getLinkTitle($title, $default, $id = null) {
+        if(is_array($title)) {
+            if($title['title']) {
+                return '['.$title['title'].']';
+            } else {
+                return $default;
+            }
+        } else if(is_null($title) || trim($title) == '') {
+            if(useHeading('content') && $id) {
+                $heading = p_get_first_heading($id, METADATA_DONT_RENDER);
+                if($heading) return $heading;
             }
             return $default;
         } else {
@@ -446,27 +651,39 @@ class Doku_Renderer_metadata extends Doku_Renderer {
         }
     }
 
-    function _firstimage($src){
+    /**
+     * Remember first image
+     *
+     * @param string $src image URL or ID
+     */
+    function _firstimage($src) {
         if($this->firstimage) return;
         global $ID;
 
-        list($src,$hash) = explode('#',$src,2);
-        if(!media_isexternal($src)){
-            resolve_mediaid(getNS($ID),$src, $exists);
+        list($src) = explode('#', $src, 2);
+        if(!media_isexternal($src)) {
+            resolve_mediaid(getNS($ID), $src, $exists);
         }
-        if(preg_match('/.(jpe?g|gif|png)$/i',$src)){
+        if(preg_match('/.(jpe?g|gif|png)$/i', $src)) {
             $this->firstimage = $src;
         }
     }
 
+    /**
+     * Store list of used media files in metadata
+     *
+     * @param string $src media ID
+     */
     function _recordMediaUsage($src) {
         global $ID;
 
-        list ($src, $hash) = explode('#', $src, 2);
-        if (media_isexternal($src)) return;
+        list ($src) = explode('#', $src, 2);
+        if(media_isexternal($src)) return;
         resolve_mediaid(getNS($ID), $src, $exists);
         $this->meta['relation']['media'][$src] = $exists;
     }
+
+    #endregion
 }
 
 //Setup VIM: ex: et ts=4 :
diff --git a/inc/parser/parser.php b/inc/parser/parser.php
index 252bd9170523669173923784e99b76770713cdaa..df01f3302fff02a3682ab7e37a2fc0c48c89917e 100644
--- a/inc/parser/parser.php
+++ b/inc/parser/parser.php
@@ -200,6 +200,11 @@ class Doku_Parser_Mode_Plugin extends DokuWiki_Plugin implements Doku_Parser_Mod
     var $Lexer;
     var $allowedModes = array();
 
+    /**
+     * Sort for applying this mode
+     *
+     * @return int
+     */
     function getSort() {
         trigger_error('getSort() not implemented in '.get_class($this), E_USER_WARNING);
     }
diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php
index 0c3c56c568bf0cdf73f723e1a2c9bc0491b1045a..09294539e4538d5c06fbef02cb5cca0a604e33ae 100644
--- a/inc/parser/renderer.php
+++ b/inc/parser/renderer.php
@@ -11,259 +11,748 @@ if(!defined('DOKU_INC')) die('meh.');
  * An empty renderer, produces no output
  *
  * Inherits from DokuWiki_Plugin for giving additional functions to render plugins
+ *
+ * The renderer transforms the syntax instructions created by the parser and handler into the
+ * desired output format. For each instruction a corresponding method defined in this class will
+ * be called. That method needs to produce the desired output for the instruction and add it to the
+ * $doc field. When all instructions are processed, the $doc field contents will be cached by
+ * DokuWiki and sent to the user.
  */
 class Doku_Renderer extends DokuWiki_Plugin {
-    var $info = array(
+    /** @var array Settings, control the behavior of the renderer */
+    public $info = array(
         'cache' => true, // may the rendered result cached?
         'toc'   => true, // render the TOC?
     );
 
-    var $doc = '';
+    /** @var array contains the smiley configuration, set in p_render() */
+    public $smileys = array();
+    /** @var array contains the entity configuration, set in p_render() */
+    public $entities = array();
+    /** @var array contains the acronym configuration, set in p_render() */
+    public $acronyms = array();
+    /** @var array contains the interwiki configuration, set in p_render() */
+    public $interwiki = array();
 
-    // keep some config options
-    var $acronyms = array();
-    var $smileys = array();
-    var $badwords = array();
-    var $entities = array();
-    var $interwiki = array();
+    /**
+     * @var string the rendered document, this will be cached after the renderer ran through
+     */
+    public $doc = '';
 
-    // allows renderer to be used again, clean out any per-use values
+    /**
+     * clean out any per-use values
+     *
+     * This is called before each use of the renderer object and should be used to
+     * completely reset the state of the renderer to be reused for a new document
+     */
     function reset() {
     }
 
-    function nocache() {
-        $this->info['cache'] = false;
-    }
-
-    function notoc() {
-        $this->info['toc'] = false;
+    /**
+     * Allow the plugin to prevent DokuWiki from reusing an instance
+     *
+     * Since most renderer plugins fail to implement Doku_Renderer::reset() we default
+     * to reinstantiating the renderer here
+     *
+     * @return bool   false if the plugin has to be instantiated
+     */
+    function isSingleton() {
+        return false;
     }
 
     /**
      * Returns the format produced by this renderer.
      *
-     * Has to be overidden by decendend classes
+     * Has to be overidden by sub classes
+     *
+     * @return string
      */
-    function getFormat(){
+    function getFormat() {
         trigger_error('getFormat() not implemented in '.get_class($this), E_USER_WARNING);
+        return '';
     }
 
     /**
-     * Allow the plugin to prevent DokuWiki from reusing an instance
+     * Disable caching of this renderer's output
+     */
+    function nocache() {
+        $this->info['cache'] = false;
+    }
+
+    /**
+     * Disable TOC generation for this renderer's output
      *
-     * @return bool   false if the plugin has to be instantiated
+     * This might not be used for certain sub renderer
      */
-    function isSingleton() {
-        return false;
+    function notoc() {
+        $this->info['toc'] = false;
     }
 
     /**
-     * handle plugin rendering
+     * Handle plugin rendering
+     *
+     * Most likely this needs NOT to be overwritten by sub classes
      *
-     * @param string $name Plugin name
-     * @param mixed  $data custom data set by handler
+     * @param string $name  Plugin name
+     * @param mixed  $data  custom data set by handler
      * @param string $state matched state if any
      * @param string $match raw matched syntax
      */
-    function plugin($name,$data,$state='',$match=''){
-        $plugin = plugin_load('syntax',$name);
-        if($plugin != null){
-            $plugin->render($this->getFormat(),$this,$data);
+    function plugin($name, $data, $state = '', $match = '') {
+        /** @var DokuWiki_Syntax_Plugin $plugin */
+        $plugin = plugin_load('syntax', $name);
+        if($plugin != null) {
+            $plugin->render($this->getFormat(), $this, $data);
         }
     }
 
     /**
      * handle nested render instructions
      * this method (and nest_close method) should not be overloaded in actual renderer output classes
+     *
+     * @param array $instructions
      */
     function nest($instructions) {
-
-        foreach ( $instructions as $instruction ) {
+        foreach($instructions as $instruction) {
             // execute the callback against ourself
-            if (method_exists($this,$instruction[0])) {
+            if(method_exists($this, $instruction[0])) {
                 call_user_func_array(array($this, $instruction[0]), $instruction[1] ? $instruction[1] : array());
             }
         }
     }
 
-    // dummy closing instruction issued by Doku_Handler_Nest, normally the syntax mode should
-    // override this instruction when instantiating Doku_Handler_Nest - however plugins will not
-    // be able to - as their instructions require data.
-    function nest_close() {}
+    /**
+     * dummy closing instruction issued by Doku_Handler_Nest
+     *
+     * normally the syntax mode should override this instruction when instantiating Doku_Handler_Nest -
+     * however plugins will not be able to - as their instructions require data.
+     */
+    function nest_close() {
+    }
 
-    function document_start() {}
+    #region Syntax modes - sub classes will need to implement them to fill $doc
 
-    function document_end() {}
+    /**
+     * Initialize the document
+     */
+    function document_start() {
+    }
 
-    function render_TOC() { return ''; }
+    /**
+     * Finalize the document
+     */
+    function document_end() {
+    }
 
-    function toc_additem($id, $text, $level) {}
+    /**
+     * Render the Table of Contents
+     *
+     * @return string
+     */
+    function render_TOC() {
+        return '';
+    }
 
-    function header($text, $level, $pos) {}
+    /**
+     * Add an item to the TOC
+     *
+     * @param string $id       the hash link
+     * @param string $text     the text to display
+     * @param int    $level    the nesting level
+     */
+    function toc_additem($id, $text, $level) {
+    }
 
-    function section_open($level) {}
+    /**
+     * Render a heading
+     *
+     * @param string $text  the text to display
+     * @param int    $level header level
+     * @param int    $pos   byte position in the original source
+     */
+    function header($text, $level, $pos) {
+    }
 
-    function section_close() {}
+    /**
+     * Open a new section
+     *
+     * @param int $level section level (as determined by the previous header)
+     */
+    function section_open($level) {
+    }
 
-    function cdata($text) {}
+    /**
+     * Close the current section
+     */
+    function section_close() {
+    }
 
-    function p_open() {}
+    /**
+     * Render plain text data
+     *
+     * @param $text
+     */
+    function cdata($text) {
+    }
 
-    function p_close() {}
+    /**
+     * Open a paragraph
+     */
+    function p_open() {
+    }
 
-    function linebreak() {}
+    /**
+     * Close a paragraph
+     */
+    function p_close() {
+    }
 
-    function hr() {}
+    /**
+     * Create a line break
+     */
+    function linebreak() {
+    }
 
-    function strong_open() {}
+    /**
+     * Create a horizontal line
+     */
+    function hr() {
+    }
 
-    function strong_close() {}
+    /**
+     * Start strong (bold) formatting
+     */
+    function strong_open() {
+    }
 
-    function emphasis_open() {}
+    /**
+     * Stop strong (bold) formatting
+     */
+    function strong_close() {
+    }
 
-    function emphasis_close() {}
+    /**
+     * Start emphasis (italics) formatting
+     */
+    function emphasis_open() {
+    }
 
-    function underline_open() {}
+    /**
+     * Stop emphasis (italics) formatting
+     */
+    function emphasis_close() {
+    }
 
-    function underline_close() {}
+    /**
+     * Start underline formatting
+     */
+    function underline_open() {
+    }
 
-    function monospace_open() {}
+    /**
+     * Stop underline formatting
+     */
+    function underline_close() {
+    }
 
-    function monospace_close() {}
+    /**
+     * Start monospace formatting
+     */
+    function monospace_open() {
+    }
 
-    function subscript_open() {}
+    /**
+     * Stop monospace formatting
+     */
+    function monospace_close() {
+    }
 
-    function subscript_close() {}
+    /**
+     * Start a subscript
+     */
+    function subscript_open() {
+    }
 
-    function superscript_open() {}
+    /**
+     * Stop a subscript
+     */
+    function subscript_close() {
+    }
 
-    function superscript_close() {}
+    /**
+     * Start a superscript
+     */
+    function superscript_open() {
+    }
 
-    function deleted_open() {}
+    /**
+     * Stop a superscript
+     */
+    function superscript_close() {
+    }
 
-    function deleted_close() {}
+    /**
+     * Start deleted (strike-through) formatting
+     */
+    function deleted_open() {
+    }
 
-    function footnote_open() {}
+    /**
+     * Stop deleted (strike-through) formatting
+     */
+    function deleted_close() {
+    }
 
-    function footnote_close() {}
+    /**
+     * Start a footnote
+     */
+    function footnote_open() {
+    }
 
-    function listu_open() {}
+    /**
+     * Stop a footnote
+     */
+    function footnote_close() {
+    }
 
-    function listu_close() {}
+    /**
+     * Open an unordered list
+     */
+    function listu_open() {
+    }
 
-    function listo_open() {}
+    /**
+     * Close an unordered list
+     */
+    function listu_close() {
+    }
 
-    function listo_close() {}
+    /**
+     * Open an ordered list
+     */
+    function listo_open() {
+    }
 
-    function listitem_open($level) {}
+    /**
+     * Close an ordered list
+     */
+    function listo_close() {
+    }
 
-    function listitem_close() {}
+    /**
+     * Open a list item
+     *
+     * @param int $level the nesting level
+     */
+    function listitem_open($level) {
+    }
 
-    function listcontent_open() {}
+    /**
+     * Close a list item
+     */
+    function listitem_close() {
+    }
 
-    function listcontent_close() {}
+    /**
+     * Start the content of a list item
+     */
+    function listcontent_open() {
+    }
 
-    function unformatted($text) {}
+    /**
+     * Stop the content of a list item
+     */
+    function listcontent_close() {
+    }
 
-    function php($text) {}
+    /**
+     * Output unformatted $text
+     *
+     * Defaults to $this->cdata()
+     *
+     * @param string $text
+     */
+    function unformatted($text) {
+        $this->cdata($text);
+    }
 
-    function phpblock($text) {}
+    /**
+     * Output inline PHP code
+     *
+     * If $conf['phpok'] is true this should evaluate the given code and append the result
+     * to $doc
+     *
+     * @param string $text The PHP code
+     */
+    function php($text) {
+    }
 
-    function html($text) {}
+    /**
+     * Output block level PHP code
+     *
+     * If $conf['phpok'] is true this should evaluate the given code and append the result
+     * to $doc
+     *
+     * @param string $text The PHP code
+     */
+    function phpblock($text) {
+    }
 
-    function htmlblock($text) {}
+    /**
+     * Output raw inline HTML
+     *
+     * If $conf['htmlok'] is true this should add the code as is to $doc
+     *
+     * @param string $text The HTML
+     */
+    function html($text) {
+    }
 
-    function preformatted($text) {}
+    /**
+     * Output raw block-level HTML
+     *
+     * If $conf['htmlok'] is true this should add the code as is to $doc
+     *
+     * @param string $text The HTML
+     */
+    function htmlblock($text) {
+    }
 
-    function quote_open() {}
+    /**
+     * Output preformatted text
+     *
+     * @param string $text
+     */
+    function preformatted($text) {
+    }
 
-    function quote_close() {}
+    /**
+     * Start a block quote
+     */
+    function quote_open() {
+    }
 
-    function file($text, $lang = null, $file = null ) {}
+    /**
+     * Stop a block quote
+     */
+    function quote_close() {
+    }
 
-    function code($text, $lang = null, $file = null ) {}
+    /**
+     * Display text as file content, optionally syntax highlighted
+     *
+     * @param string $text text to show
+     * @param string $lang programming language to use for syntax highlighting
+     * @param string $file file path label
+     */
+    function file($text, $lang = null, $file = null) {
+    }
 
-    function acronym($acronym) {}
+    /**
+     * Display text as code content, optionally syntax highlighted
+     *
+     * @param string $text text to show
+     * @param string $lang programming language to use for syntax highlighting
+     * @param string $file file path label
+     */
+    function code($text, $lang = null, $file = null) {
+    }
 
-    function smiley($smiley) {}
+    /**
+     * Format an acronym
+     *
+     * Uses $this->acronyms
+     *
+     * @param string $acronym
+     */
+    function acronym($acronym) {
+    }
 
-    function wordblock($word) {}
+    /**
+     * Format a smiley
+     *
+     * Uses $this->smiley
+     *
+     * @param string $smiley
+     */
+    function smiley($smiley) {
+    }
 
-    function entity($entity) {}
+    /**
+     * Format an entity
+     *
+     * Entities are basically small text replacements
+     *
+     * Uses $this->entities
+     *
+     * @param string $entity
+     */
+    function entity($entity) {
+    }
 
-    // 640x480 ($x=640, $y=480)
-    function multiplyentity($x, $y) {}
+    /**
+     * Typographically format a multiply sign
+     *
+     * Example: ($x=640, $y=480) should result in "640×480"
+     *
+     * @param string|int $x first value
+     * @param string|int $y second value
+     */
+    function multiplyentity($x, $y) {
+    }
 
-    function singlequoteopening() {}
+    /**
+     * Render an opening single quote char (language specific)
+     */
+    function singlequoteopening() {
+    }
 
-    function singlequoteclosing() {}
+    /**
+     * Render a closing single quote char (language specific)
+     */
+    function singlequoteclosing() {
+    }
 
-    function apostrophe() {}
+    /**
+     * Render an apostrophe char (language specific)
+     */
+    function apostrophe() {
+    }
 
-    function doublequoteopening() {}
+    /**
+     * Render an opening double quote char (language specific)
+     */
+    function doublequoteopening() {
+    }
 
-    function doublequoteclosing() {}
+    /**
+     * Render an closinging double quote char (language specific)
+     */
+    function doublequoteclosing() {
+    }
 
-    // $link like 'SomePage'
-    function camelcaselink($link) {}
+    /**
+     * Render a CamelCase link
+     *
+     * @param string $link The link name
+     * @see http://en.wikipedia.org/wiki/CamelCase
+     */
+    function camelcaselink($link) {
+    }
 
-    function locallink($hash, $name = null) {}
+    /**
+     * Render a page local link
+     *
+     * @param string $hash hash link identifier
+     * @param string $name name for the link
+     */
+    function locallink($hash, $name = null) {
+    }
 
-    // $link like 'wiki:syntax', $title could be an array (media)
-    function internallink($link, $title = null) {}
+    /**
+     * Render a wiki internal link
+     *
+     * @param string       $link  page ID to link to. eg. 'wiki:syntax'
+     * @param string|array $title name for the link, array for media file
+     */
+    function internallink($link, $title = null) {
+    }
+
+    /**
+     * Render an external link
+     *
+     * @param string       $link  full URL with scheme
+     * @param string|array $title name for the link, array for media file
+     */
+    function externallink($link, $title = null) {
+    }
 
-    // $link is full URL with scheme, $title could be an array (media)
-    function externallink($link, $title = null) {}
+    /**
+     * Render the output of an RSS feed
+     *
+     * @param string $url    URL of the feed
+     * @param array  $params Finetuning of the output
+     */
+    function rss($url, $params) {
+    }
 
-    function rss ($url,$params) {}
+    /**
+     * Render an interwiki link
+     *
+     * You may want to use $this->_resolveInterWiki() here
+     *
+     * @param string       $link     original link - probably not much use
+     * @param string|array $title    name for the link, array for media file
+     * @param string       $wikiName indentifier (shortcut) for the remote wiki
+     * @param string       $wikiUri  the fragment parsed from the original link
+     */
+    function interwikilink($link, $title = null, $wikiName, $wikiUri) {
+    }
 
-    // $link is the original link - probably not much use
-    // $wikiName is an indentifier for the wiki
-    // $wikiUri is the URL fragment to append to some known URL
-    function interwikilink($link, $title = null, $wikiName, $wikiUri) {}
+    /**
+     * Link to file on users OS
+     *
+     * @param string       $link  the link
+     * @param string|array $title name for the link, array for media file
+     */
+    function filelink($link, $title = null) {
+    }
 
-    // Link to file on users OS, $title could be an array (media)
-    function filelink($link, $title = null) {}
+    /**
+     * Link to windows share
+     *
+     * @param string       $link  the link
+     * @param string|array $title name for the link, array for media file
+     */
+    function windowssharelink($link, $title = null) {
+    }
 
-    // Link to a Windows share, , $title could be an array (media)
-    function windowssharelink($link, $title = null) {}
+    /**
+     * Render a linked E-Mail Address
+     *
+     * Should honor $conf['mailguard'] setting
+     *
+     * @param string $address Email-Address
+     * @param string|array $name name for the link, array for media file
+     */
+    function emaillink($address, $name = null) {
+    }
 
-//  function email($address, $title = null) {}
-    function emaillink($address, $name = null) {}
+    /**
+     * Render an internal media file
+     *
+     * @param string $src     media ID
+     * @param string $title   descriptive text
+     * @param string $align   left|center|right
+     * @param int    $width   width of media in pixel
+     * @param int    $height  height of media in pixel
+     * @param string $cache   cache|recache|nocache
+     * @param string $linking linkonly|detail|nolink
+     */
+    function internalmedia($src, $title = null, $align = null, $width = null,
+                           $height = null, $cache = null, $linking = null) {
+    }
 
-    function internalmedia ($src, $title=null, $align=null, $width=null,
-                            $height=null, $cache=null, $linking=null) {}
+    /**
+     * Render an external media file
+     *
+     * @param string $src     full media URL
+     * @param string $title   descriptive text
+     * @param string $align   left|center|right
+     * @param int    $width   width of media in pixel
+     * @param int    $height  height of media in pixel
+     * @param string $cache   cache|recache|nocache
+     * @param string $linking linkonly|detail|nolink
+     */
+    function externalmedia($src, $title = null, $align = null, $width = null,
+                           $height = null, $cache = null, $linking = null) {
+    }
 
-    function externalmedia ($src, $title=null, $align=null, $width=null,
-                            $height=null, $cache=null, $linking=null) {}
+    /**
+     * Render a link to an internal media file
+     *
+     * @param string $src     media ID
+     * @param string $title   descriptive text
+     * @param string $align   left|center|right
+     * @param int    $width   width of media in pixel
+     * @param int    $height  height of media in pixel
+     * @param string $cache   cache|recache|nocache
+     */
+    function internalmedialink($src, $title = null, $align = null,
+                               $width = null, $height = null, $cache = null) {
+    }
 
-    function internalmedialink (
-        $src,$title=null,$align=null,$width=null,$height=null,$cache=null
-        ) {}
+    /**
+     * Render a link to an external media file
+     *
+     * @param string $src     media ID
+     * @param string $title   descriptive text
+     * @param string $align   left|center|right
+     * @param int    $width   width of media in pixel
+     * @param int    $height  height of media in pixel
+     * @param string $cache   cache|recache|nocache
+     */
+    function externalmedialink($src, $title = null, $align = null,
+                               $width = null, $height = null, $cache = null) {
+    }
 
-    function externalmedialink(
-        $src,$title=null,$align=null,$width=null,$height=null,$cache=null
-        ) {}
+    /**
+     * Start a table
+     *
+     * @param int $maxcols maximum number of columns
+     * @param int $numrows NOT IMPLEMENTED
+     * @param int $pos     byte position in the original source
+     */
+    function table_open($maxcols = null, $numrows = null, $pos = null) {
+    }
 
-    function table_open($maxcols = null, $numrows = null, $pos = null){}
+    /**
+     * Close a table
+     *
+     * @param int $pos byte position in the original source
+     */
+    function table_close($pos = null) {
+    }
 
-    function table_close($pos = null){}
+    /**
+     * Open a table header
+     */
+    function tablethead_open() {
+    }
 
-    function tablerow_open(){}
+    /**
+     * Close a table header
+     */
+    function tablethead_close() {
+    }
 
-    function tablerow_close(){}
+    /**
+     * Open a table row
+     */
+    function tablerow_open() {
+    }
 
-    function tableheader_open($colspan = 1, $align = null, $rowspan = 1){}
+    /**
+     * Close a table row
+     */
+    function tablerow_close() {
+    }
 
-    function tableheader_close(){}
+    /**
+     * Open a table header cell
+     *
+     * @param int    $colspan
+     * @param string $align left|center|right
+     * @param int    $rowspan
+     */
+    function tableheader_open($colspan = 1, $align = null, $rowspan = 1) {
+    }
 
-    function tablecell_open($colspan = 1, $align = null, $rowspan = 1){}
+    /**
+     * Close a table header cell
+     */
+    function tableheader_close() {
+    }
 
-    function tablecell_close(){}
+    /**
+     * Open a table cell
+     *
+     * @param int    $colspan
+     * @param string $align left|center|right
+     * @param int    $rowspan
+     */
+    function tablecell_open($colspan = 1, $align = null, $rowspan = 1) {
+    }
 
+    /**
+     * Close a table cell
+     */
+    function tablecell_close() {
+    }
 
-    // util functions follow, you probably won't need to reimplement them
+    #endregion
 
+    #region util functions, you probably won't need to reimplement them
 
     /**
      * Removes any Namespace from the given name but keeps
@@ -290,13 +779,13 @@ class Doku_Renderer extends DokuWiki_Plugin {
     /**
      * Resolve an interwikilink
      */
-    function _resolveInterWiki(&$shortcut, $reference, &$exists=null) {
+    function _resolveInterWiki(&$shortcut, $reference, &$exists = null) {
         //get interwiki URL
         if(isset($this->interwiki[$shortcut])) {
             $url = $this->interwiki[$shortcut];
         } else {
             // Default to Google I'm feeling lucky
-            $url = 'http://www.google.com/search?q={URL}&amp;btnI=lucky';
+            $url      = 'http://www.google.com/search?q={URL}&amp;btnI=lucky';
             $shortcut = 'go';
         }
 
@@ -306,8 +795,8 @@ class Doku_Renderer extends DokuWiki_Plugin {
         //replace placeholder
         if(preg_match('#\{(URL|NAME|SCHEME|HOST|PORT|PATH|QUERY)\}#', $url)) {
             //use placeholders
-            $url = str_replace('{URL}', rawurlencode($reference), $url);
-            $url = str_replace('{NAME}', $reference, $url);
+            $url    = str_replace('{URL}', rawurlencode($reference), $url);
+            $url    = str_replace('{NAME}', $reference, $url);
             $parsed = parse_url($reference);
             if(!$parsed['port']) $parsed['port'] = 80;
             $url = str_replace('{SCHEME}', $parsed['scheme'], $url);
@@ -317,18 +806,20 @@ class Doku_Renderer extends DokuWiki_Plugin {
             $url = str_replace('{QUERY}', $parsed['query'], $url);
         } else {
             //default
-            $url = $url . rawurlencode($reference);
+            $url = $url.rawurlencode($reference);
         }
         //handle as wiki links
         if($url{0} === ':') {
             list($id, $urlparam) = explode('?', $url, 2);
-            $url = wl(cleanID($id), $urlparam);
+            $url    = wl(cleanID($id), $urlparam);
             $exists = page_exists($id);
         }
-        if($hash) $url .= '#' . rawurlencode($hash);
+        if($hash) $url .= '#'.rawurlencode($hash);
 
         return $url;
     }
+
+    #endregion
 }
 
 
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index dee3c922df8b52d01e9d07b84e33fb153b1ad378..078bb5639e4ae27bb9a6de4349ab965d3c63e77f 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -7,38 +7,54 @@
  */
 if(!defined('DOKU_INC')) die('meh.');
 
-if ( !defined('DOKU_LF') ) {
+if(!defined('DOKU_LF')) {
     // Some whitespace to help View > Source
-    define ('DOKU_LF',"\n");
+    define ('DOKU_LF', "\n");
 }
 
-if ( !defined('DOKU_TAB') ) {
+if(!defined('DOKU_TAB')) {
     // Some whitespace to help View > Source
-    define ('DOKU_TAB',"\t");
+    define ('DOKU_TAB', "\t");
 }
 
 /**
- * The Renderer
+ * The XHTML Renderer
+ *
+ * This is DokuWiki's main renderer used to display page content in the wiki
  */
 class Doku_Renderer_xhtml extends Doku_Renderer {
+    /** @var array store the table of contents */
+    public $toc = array();
 
-    // @access public
-    var $doc = '';        // will contain the whole document
-    var $toc = array();   // will contain the Table of Contents
+    /** @var array A stack of section edit data */
+    protected $sectionedits = array();
     var $date_at = '';    // link pages and media against this revision
 
-    var $sectionedits = array(); // A stack of section edit data
-    private $lastsecid = 0; // last section edit id, used by startSectionEdit
+    /** @var int last section edit id, used by startSectionEdit */
+    protected $lastsecid = 0;
+
+    /** @var array the list of headers used to create unique link ids */
+    protected $headers = array();
 
-    var $headers = array();
     /** @var array a list of footnotes, list starts at 1! */
-    var $footnotes = array();
-    var $lastlevel = 0;
-    var $node = array(0,0,0,0,0);
-    var $store = '';
+    protected $footnotes = array();
+
+    /** @var int current section level */
+    protected $lastlevel = 0;
+    /** @var array section node tracker */
+    protected $node = array(0, 0, 0, 0, 0);
+
+    /** @var string temporary $doc store */
+    protected $store = '';
 
-    var $_counter   = array(); // used as global counter, introduced for table classes
-    var $_codeblock = 0; // counts the code and file blocks, used to provide download links
+    /** @var array global counter, for table classes etc. */
+    protected $_counter = array(); //
+
+    /** @var int counts the code and file blocks, used to provide download links */
+    protected $_codeblock = 0;
+
+    /** @var array list of allowed URL schemes */
+    protected $schemes = null;
 
     /**
      * Register a new edit section range
@@ -51,43 +67,53 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
      */
     public function startSectionEdit($start, $type, $title = null) {
         $this->sectionedits[] = array(++$this->lastsecid, $start, $type, $title);
-        return 'sectionedit' . $this->lastsecid;
+        return 'sectionedit'.$this->lastsecid;
     }
 
     /**
      * Finish an edit section range
      *
-     * @param $end int The byte position for the edit end; null for the rest of
+     * @param $end     int The byte position for the edit end; null for the rest of
      *                 the page
      * @author Adrian Lang <lang@cosmocode.de>
      */
     public function finishSectionEdit($end = null) {
         list($id, $start, $type, $title) = array_pop($this->sectionedits);
-        if (!is_null($end) && $end <= $start) {
+        if(!is_null($end) && $end <= $start) {
             return;
         }
-        $this->doc .= "<!-- EDIT$id " . strtoupper($type) . ' ';
-        if (!is_null($title)) {
-            $this->doc .= '"' . str_replace('"', '', $title) . '" ';
+        $this->doc .= "<!-- EDIT$id ".strtoupper($type).' ';
+        if(!is_null($title)) {
+            $this->doc .= '"'.str_replace('"', '', $title).'" ';
         }
-        $this->doc .= "[$start-" . (is_null($end) ? '' : $end) . '] -->';
+        $this->doc .= "[$start-".(is_null($end) ? '' : $end).'] -->';
     }
 
-    function getFormat(){
+    /**
+     * Returns the format produced by this renderer.
+     *
+     * @return string always 'xhtml'
+     */
+    function getFormat() {
         return 'xhtml';
     }
 
-
+    /**
+     * Initialize the document
+     */
     function document_start() {
         //reset some internals
         $this->toc     = array();
         $this->headers = array();
     }
 
+    /**
+     * Finalize the document
+     */
     function document_end() {
         // Finish open section edits.
-        while (count($this->sectionedits) > 0) {
-            if ($this->sectionedits[count($this->sectionedits) - 1][1] <= 1) {
+        while(count($this->sectionedits) > 0) {
+            if($this->sectionedits[count($this->sectionedits) - 1][1] <= 1) {
                 // If there is only one section, do not write a section edit
                 // marker.
                 array_pop($this->sectionedits);
@@ -96,12 +122,12 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
             }
         }
 
-        if ( count ($this->footnotes) > 0 ) {
+        if(count($this->footnotes) > 0) {
             $this->doc .= '<div class="footnotes">'.DOKU_LF;
 
-            foreach ( $this->footnotes as $id => $footnote ) {
+            foreach($this->footnotes as $id => $footnote) {
                 // check its not a placeholder that indicates actual footnote text is elsewhere
-                if (substr($footnote, 0, 5) != "@@FNT") {
+                if(substr($footnote, 0, 5) != "@@FNT") {
 
                     // open the footnote and set the anchor and backlink
                     $this->doc .= '<div class="fn">';
@@ -111,8 +137,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
                     // get any other footnotes that use the same markup
                     $alt = array_keys($this->footnotes, "@@FNT$id");
 
-                    if (count($alt)) {
-                        foreach ($alt as $ref) {
+                    if(count($alt)) {
+                        foreach($alt as $ref) {
                             // set anchor and backlink for the other footnotes
                             $this->doc .= ', <sup><a href="#fnt__'.($ref).'" id="fn__'.($ref).'" class="fn_bot">';
                             $this->doc .= ($ref).')</a></sup> '.DOKU_LF;
@@ -121,7 +147,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
 
                     // add footnote markup and close this footnote
                     $this->doc .= $footnote;
-                    $this->doc .= '</div>' . DOKU_LF;
+                    $this->doc .= '</div>'.DOKU_LF;
                 }
             }
             $this->doc .= '</div>'.DOKU_LF;
@@ -129,139 +155,221 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
 
         // Prepare the TOC
         global $conf;
-        if($this->info['toc'] && is_array($this->toc) && $conf['tocminheads'] && count($this->toc) >= $conf['tocminheads']){
+        if($this->info['toc'] && is_array($this->toc) && $conf['tocminheads'] && count($this->toc) >= $conf['tocminheads']) {
             global $TOC;
             $TOC = $this->toc;
         }
 
         // make sure there are no empty paragraphs
-        $this->doc = preg_replace('#<p>\s*</p>#','',$this->doc);
+        $this->doc = preg_replace('#<p>\s*</p>#', '', $this->doc);
     }
 
+    /**
+     * Add an item to the TOC
+     *
+     * @param string $id       the hash link
+     * @param string $text     the text to display
+     * @param int    $level    the nesting level
+     */
     function toc_additem($id, $text, $level) {
         global $conf;
 
         //handle TOC
-        if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']){
-            $this->toc[] = html_mktocitem($id, $text, $level-$conf['toptoclevel']+1);
+        if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']) {
+            $this->toc[] = html_mktocitem($id, $text, $level - $conf['toptoclevel'] + 1);
         }
     }
 
+    /**
+     * Render a heading
+     *
+     * @param string $text  the text to display
+     * @param int    $level header level
+     * @param int    $pos   byte position in the original source
+     */
     function header($text, $level, $pos) {
         global $conf;
 
         if(!$text) return; //skip empty headlines
 
-        $hid = $this->_headerToLink($text,true);
+        $hid = $this->_headerToLink($text, true);
 
         //only add items within configured levels
         $this->toc_additem($hid, $text, $level);
 
         // adjust $node to reflect hierarchy of levels
-        $this->node[$level-1]++;
-        if ($level < $this->lastlevel) {
-            for ($i = 0; $i < $this->lastlevel-$level; $i++) {
-                $this->node[$this->lastlevel-$i-1] = 0;
+        $this->node[$level - 1]++;
+        if($level < $this->lastlevel) {
+            for($i = 0; $i < $this->lastlevel - $level; $i++) {
+                $this->node[$this->lastlevel - $i - 1] = 0;
             }
         }
         $this->lastlevel = $level;
 
-        if ($level <= $conf['maxseclevel'] &&
+        if($level <= $conf['maxseclevel'] &&
             count($this->sectionedits) > 0 &&
-            $this->sectionedits[count($this->sectionedits) - 1][2] === 'section') {
+            $this->sectionedits[count($this->sectionedits) - 1][2] === 'section'
+        ) {
             $this->finishSectionEdit($pos - 1);
         }
 
         // write the header
         $this->doc .= DOKU_LF.'<h'.$level;
-        if ($level <= $conf['maxseclevel']) {
-            $this->doc .= ' class="' . $this->startSectionEdit($pos, 'section', $text) . '"';
+        if($level <= $conf['maxseclevel']) {
+            $this->doc .= ' class="'.$this->startSectionEdit($pos, 'section', $text).'"';
         }
         $this->doc .= ' id="'.$hid.'">';
         $this->doc .= $this->_xmlEntities($text);
         $this->doc .= "</h$level>".DOKU_LF;
     }
 
+    /**
+     * Open a new section
+     *
+     * @param int $level section level (as determined by the previous header)
+     */
     function section_open($level) {
-        $this->doc .= '<div class="level' . $level . '">' . DOKU_LF;
+        $this->doc .= '<div class="level'.$level.'">'.DOKU_LF;
     }
 
+    /**
+     * Close the current section
+     */
     function section_close() {
         $this->doc .= DOKU_LF.'</div>'.DOKU_LF;
     }
 
+    /**
+     * Render plain text data
+     *
+     * @param $text
+     */
     function cdata($text) {
         $this->doc .= $this->_xmlEntities($text);
     }
 
+    /**
+     * Open a paragraph
+     */
     function p_open() {
         $this->doc .= DOKU_LF.'<p>'.DOKU_LF;
     }
 
+    /**
+     * Close a paragraph
+     */
     function p_close() {
         $this->doc .= DOKU_LF.'</p>'.DOKU_LF;
     }
 
+    /**
+     * Create a line break
+     */
     function linebreak() {
         $this->doc .= '<br/>'.DOKU_LF;
     }
 
+    /**
+     * Create a horizontal line
+     */
     function hr() {
         $this->doc .= '<hr />'.DOKU_LF;
     }
 
+    /**
+     * Start strong (bold) formatting
+     */
     function strong_open() {
         $this->doc .= '<strong>';
     }
 
+    /**
+     * Stop strong (bold) formatting
+     */
     function strong_close() {
         $this->doc .= '</strong>';
     }
 
+    /**
+     * Start emphasis (italics) formatting
+     */
     function emphasis_open() {
         $this->doc .= '<em>';
     }
 
+    /**
+     * Stop emphasis (italics) formatting
+     */
     function emphasis_close() {
         $this->doc .= '</em>';
     }
 
+    /**
+     * Start underline formatting
+     */
     function underline_open() {
         $this->doc .= '<em class="u">';
     }
 
+    /**
+     * Stop underline formatting
+     */
     function underline_close() {
         $this->doc .= '</em>';
     }
 
+    /**
+     * Start monospace formatting
+     */
     function monospace_open() {
         $this->doc .= '<code>';
     }
 
+    /**
+     * Stop monospace formatting
+     */
     function monospace_close() {
         $this->doc .= '</code>';
     }
 
+    /**
+     * Start a subscript
+     */
     function subscript_open() {
         $this->doc .= '<sub>';
     }
 
+    /**
+     * Stop a subscript
+     */
     function subscript_close() {
         $this->doc .= '</sub>';
     }
 
+    /**
+     * Start a superscript
+     */
     function superscript_open() {
         $this->doc .= '<sup>';
     }
 
+    /**
+     * Stop a superscript
+     */
     function superscript_close() {
         $this->doc .= '</sup>';
     }
 
+    /**
+     * Start deleted (strike-through) formatting
+     */
     function deleted_open() {
         $this->doc .= '<del>';
     }
 
+    /**
+     * Stop deleted (strike-through) formatting
+     */
     function deleted_close() {
         $this->doc .= '</del>';
     }
@@ -297,14 +405,14 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $fnid++;
 
         // recover footnote into the stack and restore old content
-        $footnote = $this->doc;
-        $this->doc = $this->store;
+        $footnote    = $this->doc;
+        $this->doc   = $this->store;
         $this->store = '';
 
         // check to see if this footnote has been seen before
         $i = array_search($footnote, $this->footnotes);
 
-        if ($i === false) {
+        if($i === false) {
             // its a new footnote, add it to the $footnotes array
             $this->footnotes[$fnid] = $footnote;
         } else {
@@ -316,38 +424,71 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $this->doc .= '<sup><a href="#fn__'.$fnid.'" id="fnt__'.$fnid.'" class="fn_top">'.$fnid.')</a></sup>';
     }
 
+    /**
+     * Open an unordered list
+     */
     function listu_open() {
         $this->doc .= '<ul>'.DOKU_LF;
     }
 
+    /**
+     * Close an unordered list
+     */
     function listu_close() {
         $this->doc .= '</ul>'.DOKU_LF;
     }
 
+    /**
+     * Open an ordered list
+     */
     function listo_open() {
         $this->doc .= '<ol>'.DOKU_LF;
     }
 
+    /**
+     * Close an ordered list
+     */
     function listo_close() {
         $this->doc .= '</ol>'.DOKU_LF;
     }
 
+    /**
+     * Open a list item
+     *
+     * @param int $level the nesting level
+     */
     function listitem_open($level) {
         $this->doc .= '<li class="level'.$level.'">';
     }
 
+    /**
+     * Close a list item
+     */
     function listitem_close() {
         $this->doc .= '</li>'.DOKU_LF;
     }
 
+    /**
+     * Start the content of a list item
+     */
     function listcontent_open() {
         $this->doc .= '<div class="li">';
     }
 
+    /**
+     * Stop the content of a list item
+     */
     function listcontent_close() {
         $this->doc .= '</div>'.DOKU_LF;
     }
 
+    /**
+     * Output unformatted $text
+     *
+     * Defaults to $this->cdata()
+     *
+     * @param string $text
+     */
     function unformatted($text) {
         $this->doc .= $this->_xmlEntities($text);
     }
@@ -355,15 +496,15 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
     /**
      * Execute PHP code if allowed
      *
-     * @param  string   $text      PHP code that is either executed or printed
-     * @param  string   $wrapper   html element to wrap result if $conf['phpok'] is okff
+     * @param  string $text      PHP code that is either executed or printed
+     * @param  string $wrapper   html element to wrap result if $conf['phpok'] is okff
      *
      * @author Andreas Gohr <andi@splitbrain.org>
      */
-    function php($text, $wrapper='code') {
+    function php($text, $wrapper = 'code') {
         global $conf;
 
-        if($conf['phpok']){
+        if($conf['phpok']) {
             ob_start();
             eval($text);
             $this->doc .= ob_get_contents();
@@ -373,6 +514,14 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         }
     }
 
+    /**
+     * Output block level PHP code
+     *
+     * If $conf['phpok'] is true this should evaluate the given code and append the result
+     * to $doc
+     *
+     * @param string $text The PHP code
+     */
     function phpblock($text) {
         $this->php($text, 'pre');
     }
@@ -380,75 +529,110 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
     /**
      * Insert HTML if allowed
      *
-     * @param  string   $text      html text
-     * @param  string   $wrapper   html element to wrap result if $conf['htmlok'] is okff
+     * @param  string $text      html text
+     * @param  string $wrapper   html element to wrap result if $conf['htmlok'] is okff
      *
      * @author Andreas Gohr <andi@splitbrain.org>
      */
-    function html($text, $wrapper='code') {
+    function html($text, $wrapper = 'code') {
         global $conf;
 
-        if($conf['htmlok']){
+        if($conf['htmlok']) {
             $this->doc .= $text;
         } else {
             $this->doc .= p_xhtml_cached_geshi($text, 'html4strict', $wrapper);
         }
     }
 
+    /**
+     * Output raw block-level HTML
+     *
+     * If $conf['htmlok'] is true this should add the code as is to $doc
+     *
+     * @param string $text The HTML
+     */
     function htmlblock($text) {
         $this->html($text, 'pre');
     }
 
+    /**
+     * Start a block quote
+     */
     function quote_open() {
         $this->doc .= '<blockquote><div class="no">'.DOKU_LF;
     }
 
+    /**
+     * Stop a block quote
+     */
     function quote_close() {
         $this->doc .= '</div></blockquote>'.DOKU_LF;
     }
 
+    /**
+     * Output preformatted text
+     *
+     * @param string $text
+     */
     function preformatted($text) {
-        $this->doc .= '<pre class="code">' . trim($this->_xmlEntities($text),"\n\r") . '</pre>'. DOKU_LF;
+        $this->doc .= '<pre class="code">'.trim($this->_xmlEntities($text), "\n\r").'</pre>'.DOKU_LF;
     }
 
-    function file($text, $language=null, $filename=null) {
-        $this->_highlight('file',$text,$language,$filename);
+    /**
+     * Display text as file content, optionally syntax highlighted
+     *
+     * @param string $text     text to show
+     * @param string $language programming language to use for syntax highlighting
+     * @param string $filename file path label
+     */
+    function file($text, $language = null, $filename = null) {
+        $this->_highlight('file', $text, $language, $filename);
     }
 
-    function code($text, $language=null, $filename=null) {
-        $this->_highlight('code',$text,$language,$filename);
+    /**
+     * Display text as code content, optionally syntax highlighted
+     *
+     * @param string $text     text to show
+     * @param string $language programming language to use for syntax highlighting
+     * @param string $filename file path label
+     */
+    function code($text, $language = null, $filename = null) {
+        $this->_highlight('code', $text, $language, $filename);
     }
 
     /**
      * Use GeSHi to highlight language syntax in code and file blocks
      *
      * @author Andreas Gohr <andi@splitbrain.org>
+     * @param string $type     code|file
+     * @param string $text     text to show
+     * @param string $language programming language to use for syntax highlighting
+     * @param string $filename file path label
      */
-    function _highlight($type, $text, $language=null, $filename=null) {
-        global $conf;
+    function _highlight($type, $text, $language = null, $filename = null) {
         global $ID;
         global $lang;
 
-        if($filename){
+        if($filename) {
             // add icon
-            list($ext) = mimetype($filename,false);
-            $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext);
+            list($ext) = mimetype($filename, false);
+            $class = preg_replace('/[^_\-a-z0-9]+/i', '_', $ext);
             $class = 'mediafile mf_'.$class;
 
             $this->doc .= '<dl class="'.$type.'">'.DOKU_LF;
-            $this->doc .= '<dt><a href="'.exportlink($ID,'code',array('codeblock'=>$this->_codeblock)).'" title="'.$lang['download'].'" class="'.$class.'">';
+            $this->doc .= '<dt><a href="'.exportlink($ID, 'code', array('codeblock' => $this->_codeblock)).'" title="'.$lang['download'].'" class="'.$class.'">';
             $this->doc .= hsc($filename);
             $this->doc .= '</a></dt>'.DOKU_LF.'<dd>';
         }
 
-        if ($text{0} == "\n") {
+        if($text{0} == "\n") {
             $text = substr($text, 1);
         }
-        if (substr($text, -1) == "\n") {
+        if(substr($text, -1) == "\n") {
             $text = substr($text, 0, -1);
         }
 
-        if ( is_null($language) ) {
+        if(is_null($language)) {
             $this->doc .= '<pre class="'.$type.'">'.$this->_xmlEntities($text).'</pre>'.DOKU_LF;
         } else {
             $class = 'code'; //we always need the code class to make the syntax highlighting apply
@@ -457,16 +641,23 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
             $this->doc .= "<pre class=\"$class $language\">".p_xhtml_cached_geshi($text, $language, '').'</pre>'.DOKU_LF;
         }
 
-        if($filename){
+        if($filename) {
             $this->doc .= '</dd></dl>'.DOKU_LF;
         }
 
         $this->_codeblock++;
     }
 
+    /**
+     * Format an acronym
+     *
+     * Uses $this->acronyms
+     *
+     * @param string $acronym
+     */
     function acronym($acronym) {
 
-        if ( array_key_exists($acronym, $this->acronyms) ) {
+        if(array_key_exists($acronym, $this->acronyms)) {
 
             $title = $this->_xmlEntities($this->acronyms[$acronym]);
 
@@ -478,73 +669,109 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         }
     }
 
+    /**
+     * Format a smiley
+     *
+     * Uses $this->smiley
+     *
+     * @param string $smiley
+     */
     function smiley($smiley) {
-        if ( array_key_exists($smiley, $this->smileys) ) {
-            $title = $this->_xmlEntities($this->smileys[$smiley]);
+        if(array_key_exists($smiley, $this->smileys)) {
             $this->doc .= '<img src="'.DOKU_BASE.'lib/images/smileys/'.$this->smileys[$smiley].
                 '" class="icon" alt="'.
-                    $this->_xmlEntities($smiley).'" />';
+                $this->_xmlEntities($smiley).'" />';
         } else {
             $this->doc .= $this->_xmlEntities($smiley);
         }
     }
 
-    /*
-    * not used
-    function wordblock($word) {
-        if ( array_key_exists($word, $this->badwords) ) {
-            $this->doc .= '** BLEEP **';
-        } else {
-            $this->doc .= $this->_xmlEntities($word);
-        }
-    }
-    */
-
+    /**
+     * Format an entity
+     *
+     * Entities are basically small text replacements
+     *
+     * Uses $this->entities
+     *
+     * @param string $entity
+     */
     function entity($entity) {
-        if ( array_key_exists($entity, $this->entities) ) {
+        if(array_key_exists($entity, $this->entities)) {
             $this->doc .= $this->entities[$entity];
         } else {
             $this->doc .= $this->_xmlEntities($entity);
         }
     }
 
+    /**
+     * Typographically format a multiply sign
+     *
+     * Example: ($x=640, $y=480) should result in "640×480"
+     *
+     * @param string|int $x first value
+     * @param string|int $y second value
+     */
     function multiplyentity($x, $y) {
         $this->doc .= "$x&times;$y";
     }
 
+    /**
+     * Render an opening single quote char (language specific)
+     */
     function singlequoteopening() {
         global $lang;
         $this->doc .= $lang['singlequoteopening'];
     }
 
+    /**
+     * Render a closing single quote char (language specific)
+     */
     function singlequoteclosing() {
         global $lang;
         $this->doc .= $lang['singlequoteclosing'];
     }
 
+    /**
+     * Render an apostrophe char (language specific)
+     */
     function apostrophe() {
         global $lang;
         $this->doc .= $lang['apostrophe'];
     }
 
+    /**
+     * Render an opening double quote char (language specific)
+     */
     function doublequoteopening() {
         global $lang;
         $this->doc .= $lang['doublequoteopening'];
     }
 
+    /**
+     * Render an closinging double quote char (language specific)
+     */
     function doublequoteclosing() {
         global $lang;
         $this->doc .= $lang['doublequoteclosing'];
     }
 
     /**
+     * Render a CamelCase link
+     *
+     * @param string $link The link name
+     * @see http://en.wikipedia.org/wiki/CamelCase
      */
     function camelcaselink($link) {
-        $this->internallink($link,$link);
+        $this->internallink($link, $link);
     }
 
-
-    function locallink($hash, $name = null){
+    /**
+     * Render a page local link
+     *
+     * @param string $hash hash link identifier
+     * @param string $name name for the link
+     */
+    function locallink($hash, $name = null) {
         global $ID;
         $name  = $this->_getLinkTitle($name, $hash, $isImage);
         $hash  = $this->_headerToLink($hash);
@@ -560,23 +787,23 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
      * $search,$returnonly & $linktype are not for the renderer but are used
      * elsewhere - no need to implement them in other renderers
      *
-     * @param string $id pageid
-     * @param string|null $name link name
-     * @param string|null $search adds search url param
-     * @param bool $returnonly whether to return html or write to doc attribute
-     * @param string $linktype type to set use of headings
-     * @return void|string writes to doc attribute or returns html depends on $returnonly
      * @author Andreas Gohr <andi@splitbrain.org>
+     * @param string      $id         pageid
+     * @param string|null $name       link name
+     * @param string|null $search     adds search url param
+     * @param bool        $returnonly whether to return html or write to doc attribute
+     * @param string      $linktype   type to set use of headings
+     * @return void|string writes to doc attribute or returns html depends on $returnonly
      */
-    function internallink($id, $name = null, $search=null,$returnonly=false,$linktype='content') {
+    function internallink($id, $name = null, $search = null, $returnonly = false, $linktype = 'content') {
         global $conf;
         global $ID;
         global $INFO;
 
         $params = '';
-        $parts = explode('?', $id, 2);
-        if (count($parts) === 2) {
-            $id = $parts[0];
+        $parts  = explode('?', $id, 2);
+        if(count($parts) === 2) {
+            $id     = $parts[0];
             $params = $parts[1];
         }
 
@@ -584,7 +811,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         // We need this check because _simpleTitle needs
         // correct $id and resolve_pageid() use cleanID($id)
         // (some things could be lost)
-        if ($id === '') {
+        if($id === '') {
             $id = $ID;
         }
 
@@ -592,22 +819,22 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $default = $this->_simpleTitle($id);
 
         // now first resolve and clean up the $id
-        resolve_pageid(getNS($ID),$id,$exists,$this->date_at,true);
+        resolve_pageid(getNS($ID), $id, $exists, $this->date_at, true);
 
         $name = $this->_getLinkTitle($name, $default, $isImage, $id, $linktype);
-        if ( !$isImage ) {
-            if ( $exists ) {
-                $class='wikilink1';
+        if(!$isImage) {
+            if($exists) {
+                $class = 'wikilink1';
             } else {
-                $class='wikilink2';
-                $link['rel']='nofollow';
+                $class       = 'wikilink2';
+                $link['rel'] = 'nofollow';
             }
         } else {
-            $class='media';
+            $class = 'media';
         }
 
         //keep hash anchor
-        @list($id,$hash) = explode('#',$id,2);
+        @list($id, $hash) = explode('#', $id, 2);
         if(!empty($hash)) $hash = $this->_headerToLink($hash);
 
         //prepare for formating
@@ -616,9 +843,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $link['pre']    = '';
         $link['suf']    = '';
         // highlight link to current page
-        if ($id == $INFO['id']) {
-            $link['pre']    = '<span class="curid">';
-            $link['suf']    = '</span>';
+        if($id == $INFO['id']) {
+            $link['pre'] = '<span class="curid">';
+            $link['suf'] = '</span>';
         }
         $link['more']   = '';
         $link['class']  = $class;
@@ -629,27 +856,33 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $link['name']   = $name;
         $link['title']  = $id;
         //add search string
-        if($search){
-            ($conf['userewrite']) ? $link['url'].='?' : $link['url'].='&amp;';
-            if(is_array($search)){
-                $search = array_map('rawurlencode',$search);
-                $link['url'] .= 's[]='.join('&amp;s[]=',$search);
-            }else{
+        if($search) {
+            ($conf['userewrite']) ? $link['url'] .= '?' : $link['url'] .= '&amp;';
+            if(is_array($search)) {
+                $search = array_map('rawurlencode', $search);
+                $link['url'] .= 's[]='.join('&amp;s[]=', $search);
+            } else {
                 $link['url'] .= 's='.rawurlencode($search);
             }
         }
 
         //keep hash
-        if($hash) $link['url'].='#'.$hash;
+        if($hash) $link['url'] .= '#'.$hash;
 
         //output formatted
-        if($returnonly){
+        if($returnonly) {
             return $this->_formatLink($link);
-        }else{
+        } else {
             $this->doc .= $this->_formatLink($link);
         }
     }
 
+    /**
+     * Render an external link
+     *
+     * @param string       $url  full URL with scheme
+     * @param string|array $name name for the link, array for media file
+     */
     function externallink($url, $name = null) {
         global $conf;
 
@@ -657,21 +890,21 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
 
         // url might be an attack vector, only allow registered protocols
         if(is_null($this->schemes)) $this->schemes = getSchemes();
-        list($scheme) = explode('://',$url);
+        list($scheme) = explode('://', $url);
         $scheme = strtolower($scheme);
-        if(!in_array($scheme,$this->schemes)) $url = '';
+        if(!in_array($scheme, $this->schemes)) $url = '';
 
         // is there still an URL?
-        if(!$url){
+        if(!$url) {
             $this->doc .= $name;
             return;
         }
 
         // set class
-        if ( !$isImage ) {
-            $class='urlextern';
+        if(!$isImage) {
+            $class = 'urlextern';
         } else {
-            $class='media';
+            $class = 'media';
         }
 
         //prepare for formating
@@ -683,8 +916,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $link['class']  = $class;
         $link['url']    = $url;
 
-        $link['name']   = $name;
-        $link['title']  = $this->_xmlEntities($url);
+        $link['name']  = $name;
+        $link['title'] = $this->_xmlEntities($url);
         if($conf['relnofollow']) $link['more'] .= ' rel="nofollow"';
 
         //output formatted
@@ -692,11 +925,19 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
     }
 
     /**
+     * Render an interwiki link
+     *
+     * You may want to use $this->_resolveInterWiki() here
+     *
+     * @param string       $match     original link - probably not much use
+     * @param string|array $name      name for the link, array for media file
+     * @param string       $wikiName  indentifier (shortcut) for the remote wiki
+     * @param string       $wikiUri   the fragment parsed from the original link
      */
     function interwikilink($match, $name = null, $wikiName, $wikiUri) {
         global $conf;
 
-        $link = array();
+        $link           = array();
         $link['target'] = $conf['target']['interwiki'];
         $link['pre']    = '';
         $link['suf']    = '';
@@ -705,10 +946,10 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
 
         //get interwiki URL
         $exists = null;
-        $url = $this->_resolveInterWiki($wikiName, $wikiUri, $exists);
+        $url    = $this->_resolveInterWiki($wikiName, $wikiUri, $exists);
 
         if(!$isImage) {
-            $class = preg_replace('/[^_\-a-z0-9]+/i', '_', $wikiName);
+            $class         = preg_replace('/[^_\-a-z0-9]+/i', '_', $wikiName);
             $link['class'] = "interwiki iw_$class";
         } else {
             $link['class'] = 'media';
@@ -727,7 +968,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
             }
         }
 
-        $link['url'] = $url;
+        $link['url']   = $url;
         $link['title'] = htmlspecialchars($link['url']);
 
         //output formatted
@@ -735,54 +976,66 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
     }
 
     /**
+     * Link to windows share
+     *
+     * @param string       $url  the link
+     * @param string|array $name name for the link, array for media file
      */
     function windowssharelink($url, $name = null) {
         global $conf;
-        global $lang;
+
         //simple setup
         $link['target'] = $conf['target']['windows'];
         $link['pre']    = '';
-        $link['suf']   = '';
+        $link['suf']    = '';
         $link['style']  = '';
 
         $link['name'] = $this->_getLinkTitle($name, $url, $isImage);
-        if ( !$isImage ) {
+        if(!$isImage) {
             $link['class'] = 'windows';
         } else {
             $link['class'] = 'media';
         }
 
         $link['title'] = $this->_xmlEntities($url);
-        $url = str_replace('\\','/',$url);
-        $url = 'file:///'.$url;
-        $link['url'] = $url;
+        $url           = str_replace('\\', '/', $url);
+        $url           = 'file:///'.$url;
+        $link['url']   = $url;
 
         //output formatted
         $this->doc .= $this->_formatLink($link);
     }
 
+    /**
+     * Render a linked E-Mail Address
+     *
+     * Honors $conf['mailguard'] setting
+     *
+     * @param string       $address Email-Address
+     * @param string|array $name    name for the link, array for media file
+     */
     function emaillink($address, $name = null) {
         global $conf;
         //simple setup
-        $link = array();
+        $link           = array();
         $link['target'] = '';
         $link['pre']    = '';
-        $link['suf']   = '';
+        $link['suf']    = '';
         $link['style']  = '';
         $link['more']   = '';
 
         $name = $this->_getLinkTitle($name, '', $isImage);
-        if ( !$isImage ) {
-            $link['class']='mail';
+        if(!$isImage) {
+            $link['class'] = 'mail';
         } else {
-            $link['class']='media';
+            $link['class'] = 'media';
         }
 
         $address = $this->_xmlEntities($address);
         $address = obfuscate($address);
         $title   = $address;
 
-        if(empty($name)){
+        if(empty($name)) {
             $name = $address;
         }
 
@@ -796,73 +1049,97 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $this->doc .= $this->_formatLink($link);
     }
 
-    function internalmedia ($src, $title=null, $align=null, $width=null,
-                            $height=null, $cache=null, $linking=null, $return=NULL) {
+    /**
+     * Render an internal media file
+     *
+     * @param string $src       media ID
+     * @param string $title     descriptive text
+     * @param string $align     left|center|right
+     * @param int    $width     width of media in pixel
+     * @param int    $height    height of media in pixel
+     * @param string $cache     cache|recache|nocache
+     * @param string $linking   linkonly|detail|nolink
+     * @param bool   $return    return HTML instead of adding to $doc
+     * @return void|string
+     */
+    function internalmedia($src, $title = null, $align = null, $width = null,
+                           $height = null, $cache = null, $linking = null, $return = false) {
         global $ID;
-        list($src,$hash) = explode('#',$src,2);
-        resolve_mediaid(getNS($ID),$src, $exists,$this->date_at,true);
+        list($src, $hash) = explode('#', $src, 2);
+        resolve_mediaid(getNS($ID), $src, $exists, $this->date_at, true);
 
         $noLink = false;
         $render = ($linking == 'linkonly') ? false : true;
-        $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
+        $link   = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
 
-        list($ext,$mime,$dl) = mimetype($src,false);
-        if(substr($mime,0,5) == 'image' && $render){
-            $link['url'] = ml($src,array('id'=>$ID,'cache'=>$cache,'rev'=>$this->_getLastMediaRevisionAt($src)),($linking=='direct'));
-        }elseif(($mime == 'application/x-shockwave-flash' || media_supportedav($mime)) && $render){
+        list($ext, $mime) = mimetype($src, false);
+        if(substr($mime, 0, 5) == 'image' && $render) {
+            $link['url'] = ml($src, array('id' => $ID, 'cache' => $cache, 'rev'=>$this->_getLastMediaRevisionAt($src)), ($linking == 'direct'));
+        } elseif(($mime == 'application/x-shockwave-flash' || media_supportedav($mime)) && $render) {
             // don't link movies
             $noLink = true;
-        }else{
+        } else {
             // add file icons
-            $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext);
+            $class = preg_replace('/[^_\-a-z0-9]+/i', '_', $ext);
             $link['class'] .= ' mediafile mf_'.$class;
-            $link['url'] = ml($src,array('id'=>$ID,'cache'=>$cache,'rev'=>$this->_getLastMediaRevisionAt($src)),true);
-            if ($exists) $link['title'] .= ' (' . filesize_h(filesize(mediaFN($src))).')';
+            $link['url'] = ml($src, array('id' => $ID, 'cache' => $cache , 'rev'=>$this->_getLastMediaRevisionAt($src)), true);
+            if($exists) $link['title'] .= ' ('.filesize_h(filesize(mediaFN($src))).')';
         }
 
         if($hash) $link['url'] .= '#'.$hash;
 
         //markup non existing files
-        if (!$exists) {
+        if(!$exists) {
             $link['class'] .= ' wikilink2';
         }
 
         //output formatted
-        if ($return) {
-            if ($linking == 'nolink' || $noLink) return $link['name'];
+        if($return) {
+            if($linking == 'nolink' || $noLink) return $link['name'];
             else return $this->_formatLink($link);
         } else {
-            if ($linking == 'nolink' || $noLink) $this->doc .= $link['name'];
+            if($linking == 'nolink' || $noLink) $this->doc .= $link['name'];
             else $this->doc .= $this->_formatLink($link);
         }
     }
 
-    function externalmedia ($src, $title=null, $align=null, $width=null,
-                            $height=null, $cache=null, $linking=null) {
-        list($src,$hash) = explode('#',$src,2);
+    /**
+     * Render an external media file
+     *
+     * @param string $src     full media URL
+     * @param string $title   descriptive text
+     * @param string $align   left|center|right
+     * @param int    $width   width of media in pixel
+     * @param int    $height  height of media in pixel
+     * @param string $cache   cache|recache|nocache
+     * @param string $linking linkonly|detail|nolink
+     */
+    function externalmedia($src, $title = null, $align = null, $width = null,
+                           $height = null, $cache = null, $linking = null) {
+        list($src, $hash) = explode('#', $src, 2);
         $noLink = false;
         $render = ($linking == 'linkonly') ? false : true;
-        $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
+        $link   = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
 
-        $link['url']    = ml($src,array('cache'=>$cache));
+        $link['url'] = ml($src, array('cache' => $cache));
 
-        list($ext,$mime,$dl) = mimetype($src,false);
-        if(substr($mime,0,5) == 'image' && $render){
+        list($ext, $mime) = mimetype($src, false);
+        if(substr($mime, 0, 5) == 'image' && $render) {
             // link only jpeg images
             // if ($ext != 'jpg' && $ext != 'jpeg') $noLink = true;
-        }elseif(($mime == 'application/x-shockwave-flash' || media_supportedav($mime)) && $render){
+        } elseif(($mime == 'application/x-shockwave-flash' || media_supportedav($mime)) && $render) {
             // don't link movies
             $noLink = true;
-        }else{
+        } else {
             // add file icons
-            $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext);
+            $class = preg_replace('/[^_\-a-z0-9]+/i', '_', $ext);
             $link['class'] .= ' mediafile mf_'.$class;
         }
 
         if($hash) $link['url'] .= '#'.$hash;
 
         //output formatted
-        if ($linking == 'nolink' || $noLink) $this->doc .= $link['name'];
+        if($linking == 'nolink' || $noLink) $this->doc .= $link['name'];
         else $this->doc .= $this->_formatLink($link);
     }
 
@@ -871,7 +1148,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
      *
      * @author Andreas Gohr <andi@splitbrain.org>
      */
-    function rss ($url,$params){
+    function rss($url, $params) {
         global $lang;
         global $conf;
 
@@ -880,17 +1157,21 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $feed->set_feed_url($url);
 
         //disable warning while fetching
-        if (!defined('DOKU_E_LEVEL')) { $elvl = error_reporting(E_ERROR); }
+        if(!defined('DOKU_E_LEVEL')) {
+            $elvl = error_reporting(E_ERROR);
+        }
         $rc = $feed->init();
-        if (!defined('DOKU_E_LEVEL')) { error_reporting($elvl); }
+        if(isset($elvl)) {
+            error_reporting($elvl);
+        }
 
         //decide on start and end
-        if($params['reverse']){
-            $mod = -1;
-            $start = $feed->get_item_quantity()-1;
+        if($params['reverse']) {
+            $mod   = -1;
+            $start = $feed->get_item_quantity() - 1;
             $end   = $start - ($params['max']);
             $end   = ($end < -1) ? -1 : $end;
-        }else{
+        } else {
             $mod   = 1;
             $start = 0;
             $end   = $feed->get_item_quantity();
@@ -898,36 +1179,38 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         }
 
         $this->doc .= '<ul class="rss">';
-        if($rc){
-            for ($x = $start; $x != $end; $x += $mod) {
+        if($rc) {
+            for($x = $start; $x != $end; $x += $mod) {
                 $item = $feed->get_item($x);
                 $this->doc .= '<li><div class="li">';
                 // support feeds without links
                 $lnkurl = $item->get_permalink();
-                if($lnkurl){
+                if($lnkurl) {
                     // title is escaped by SimplePie, we unescape here because it
                     // is escaped again in externallink() FS#1705
-                    $this->externallink($item->get_permalink(),
-                                        html_entity_decode($item->get_title(), ENT_QUOTES, 'UTF-8'));
-                }else{
+                    $this->externallink(
+                        $item->get_permalink(),
+                        html_entity_decode($item->get_title(), ENT_QUOTES, 'UTF-8')
+                    );
+                } else {
                     $this->doc .= ' '.$item->get_title();
                 }
-                if($params['author']){
+                if($params['author']) {
                     $author = $item->get_author(0);
-                    if($author){
+                    if($author) {
                         $name = $author->get_name();
                         if(!$name) $name = $author->get_email();
                         if($name) $this->doc .= ' '.$lang['by'].' '.$name;
                     }
                 }
-                if($params['date']){
+                if($params['date']) {
                     $this->doc .= ' ('.$item->get_local_date($conf['dformat']).')';
                 }
-                if($params['details']){
+                if($params['details']) {
                     $this->doc .= '<div class="detail">';
-                    if($conf['htmlok']){
+                    if($conf['htmlok']) {
                         $this->doc .= $item->get_description();
-                    }else{
+                    } else {
                         $this->doc .= strip_tags($item->get_description());
                     }
                     $this->doc .= '</div>';
@@ -935,11 +1218,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
 
                 $this->doc .= '</div></li>';
             }
-        }else{
+        } else {
             $this->doc .= '<li><div class="li">';
             $this->doc .= '<em>'.$lang['rssfailed'].'</em>';
             $this->externallink($url);
-            if($conf['allowdebug']){
+            if($conf['allowdebug']) {
                 $this->doc .= '<!--'.hsc($feed->error).'-->';
             }
             $this->doc .= '</div></li>';
@@ -947,81 +1230,130 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $this->doc .= '</ul>';
     }
 
-    // $numrows not yet implemented
-    function table_open($maxcols = null, $numrows = null, $pos = null){
-        global $lang;
+    /**
+     * Start a table
+     *
+     * @param int $maxcols maximum number of columns
+     * @param int $numrows NOT IMPLEMENTED
+     * @param int $pos     byte position in the original source
+     */
+    function table_open($maxcols = null, $numrows = null, $pos = null) {
         // initialize the row counter used for classes
         $this->_counter['row_counter'] = 0;
-        $class = 'table';
-        if ($pos !== null) {
-            $class .= ' ' . $this->startSectionEdit($pos, 'table');
+        $class                         = 'table';
+        if($pos !== null) {
+            $class .= ' '.$this->startSectionEdit($pos, 'table');
         }
-        $this->doc .= '<div class="' . $class . '"><table class="inline">' .
-                      DOKU_LF;
+        $this->doc .= '<div class="'.$class.'"><table class="inline">'.
+            DOKU_LF;
     }
 
-    function table_close($pos = null){
+    /**
+     * Close a table
+     *
+     * @param int $pos byte position in the original source
+     */
+    function table_close($pos = null) {
         $this->doc .= '</table></div>'.DOKU_LF;
-        if ($pos !== null) {
+        if($pos !== null) {
             $this->finishSectionEdit($pos);
         }
     }
 
-    function tablerow_open(){
+    /**
+     * Open a table header
+     */
+    function tablethead_open() {
+        $this->doc .= DOKU_TAB.'<thead>'.DOKU_LF;
+    }
+
+    /**
+     * Close a table header
+     */
+    function tablethead_close() {
+        $this->doc .= DOKU_TAB.'</thead>'.DOKU_LF;
+    }
+
+    /**
+     * Open a table row
+     */
+    function tablerow_open() {
         // initialize the cell counter used for classes
         $this->_counter['cell_counter'] = 0;
-        $class = 'row' . $this->_counter['row_counter']++;
-        $this->doc .= DOKU_TAB . '<tr class="'.$class.'">' . DOKU_LF . DOKU_TAB . DOKU_TAB;
+        $class                          = 'row'.$this->_counter['row_counter']++;
+        $this->doc .= DOKU_TAB.'<tr class="'.$class.'">'.DOKU_LF.DOKU_TAB.DOKU_TAB;
     }
 
-    function tablerow_close(){
-        $this->doc .= DOKU_LF . DOKU_TAB . '</tr>' . DOKU_LF;
+    /**
+     * Close a table row
+     */
+    function tablerow_close() {
+        $this->doc .= DOKU_LF.DOKU_TAB.'</tr>'.DOKU_LF;
     }
 
-    function tableheader_open($colspan = 1, $align = null, $rowspan = 1){
-        $class = 'class="col' . $this->_counter['cell_counter']++;
-        if ( !is_null($align) ) {
+    /**
+     * Open a table header cell
+     *
+     * @param int    $colspan
+     * @param string $align left|center|right
+     * @param int    $rowspan
+     */
+    function tableheader_open($colspan = 1, $align = null, $rowspan = 1) {
+        $class = 'class="col'.$this->_counter['cell_counter']++;
+        if(!is_null($align)) {
             $class .= ' '.$align.'align';
         }
         $class .= '"';
-        $this->doc .= '<th ' . $class;
-        if ( $colspan > 1 ) {
-            $this->_counter['cell_counter'] += $colspan-1;
+        $this->doc .= '<th '.$class;
+        if($colspan > 1) {
+            $this->_counter['cell_counter'] += $colspan - 1;
             $this->doc .= ' colspan="'.$colspan.'"';
         }
-        if ( $rowspan > 1 ) {
+        if($rowspan > 1) {
             $this->doc .= ' rowspan="'.$rowspan.'"';
         }
         $this->doc .= '>';
     }
 
-    function tableheader_close(){
+    /**
+     * Close a table header cell
+     */
+    function tableheader_close() {
         $this->doc .= '</th>';
     }
 
-    function tablecell_open($colspan = 1, $align = null, $rowspan = 1){
-        $class = 'class="col' . $this->_counter['cell_counter']++;
-        if ( !is_null($align) ) {
+    /**
+     * Open a table cell
+     *
+     * @param int    $colspan
+     * @param string $align left|center|right
+     * @param int    $rowspan
+     */
+    function tablecell_open($colspan = 1, $align = null, $rowspan = 1) {
+        $class = 'class="col'.$this->_counter['cell_counter']++;
+        if(!is_null($align)) {
             $class .= ' '.$align.'align';
         }
         $class .= '"';
         $this->doc .= '<td '.$class;
-        if ( $colspan > 1 ) {
-            $this->_counter['cell_counter'] += $colspan-1;
+        if($colspan > 1) {
+            $this->_counter['cell_counter'] += $colspan - 1;
             $this->doc .= ' colspan="'.$colspan.'"';
         }
-        if ( $rowspan > 1 ) {
+        if($rowspan > 1) {
             $this->doc .= ' rowspan="'.$rowspan.'"';
         }
         $this->doc .= '>';
     }
 
-    function tablecell_close(){
+    /**
+     * Close a table cell
+     */
+    function tablecell_close() {
         $this->doc .= '</td>';
     }
 
-    //----------------------------------------------------------
-    // Utils
+    #region Utility functions
 
     /**
      * Build a link
@@ -1030,29 +1362,29 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
      *
      * @author Andreas Gohr <andi@splitbrain.org>
      */
-    function _formatLink($link){
+    function _formatLink($link) {
         //make sure the url is XHTML compliant (skip mailto)
-        if(substr($link['url'],0,7) != 'mailto:'){
-            $link['url'] = str_replace('&','&amp;',$link['url']);
-            $link['url'] = str_replace('&amp;amp;','&amp;',$link['url']);
+        if(substr($link['url'], 0, 7) != 'mailto:') {
+            $link['url'] = str_replace('&', '&amp;', $link['url']);
+            $link['url'] = str_replace('&amp;amp;', '&amp;', $link['url']);
         }
         //remove double encodings in titles
-        $link['title'] = str_replace('&amp;amp;','&amp;',$link['title']);
+        $link['title'] = str_replace('&amp;amp;', '&amp;', $link['title']);
 
         // be sure there are no bad chars in url or title
         // (we can't do this for name because it can contain an img tag)
-        $link['url']   = strtr($link['url'],array('>'=>'%3E','<'=>'%3C','"'=>'%22'));
-        $link['title'] = strtr($link['title'],array('>'=>'&gt;','<'=>'&lt;','"'=>'&quot;'));
+        $link['url']   = strtr($link['url'], array('>' => '%3E', '<' => '%3C', '"' => '%22'));
+        $link['title'] = strtr($link['title'], array('>' => '&gt;', '<' => '&lt;', '"' => '&quot;'));
 
-        $ret  = '';
+        $ret = '';
         $ret .= $link['pre'];
         $ret .= '<a href="'.$link['url'].'"';
-        if(!empty($link['class']))  $ret .= ' class="'.$link['class'].'"';
+        if(!empty($link['class'])) $ret .= ' class="'.$link['class'].'"';
         if(!empty($link['target'])) $ret .= ' target="'.$link['target'].'"';
-        if(!empty($link['title']))  $ret .= ' title="'.$link['title'].'"';
-        if(!empty($link['style']))  $ret .= ' style="'.$link['style'].'"';
-        if(!empty($link['rel']))    $ret .= ' rel="'.$link['rel'].'"';
-        if(!empty($link['more']))   $ret .= ' '.$link['more'];
+        if(!empty($link['title'])) $ret .= ' title="'.$link['title'].'"';
+        if(!empty($link['style'])) $ret .= ' style="'.$link['style'].'"';
+        if(!empty($link['rel'])) $ret .= ' rel="'.$link['rel'].'"';
+        if(!empty($link['more'])) $ret .= ' '.$link['more'];
         $ret .= '>';
         $ret .= $link['name'];
         $ret .= '</a>';
@@ -1064,102 +1396,112 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
      * Renders internal and external media
      *
      * @author Andreas Gohr <andi@splitbrain.org>
+     * @param string $src       media ID
+     * @param string $title     descriptive text
+     * @param string $align     left|center|right
+     * @param int    $width     width of media in pixel
+     * @param int    $height    height of media in pixel
+     * @param string $cache     cache|recache|nocache
+     * @param bool   $render    should the media be embedded inline or just linked
+     * @return string
      */
-    function _media ($src, $title=null, $align=null, $width=null,
-                      $height=null, $cache=null, $render = true) {
+    function _media($src, $title = null, $align = null, $width = null,
+                    $height = null, $cache = null, $render = true) {
 
         $ret = '';
 
-        list($ext,$mime,$dl) = mimetype($src);
-        if(substr($mime,0,5) == 'image'){
+        list($ext, $mime) = mimetype($src);
+        if(substr($mime, 0, 5) == 'image') {
             // first get the $title
-            if (!is_null($title)) {
-                $title  = $this->_xmlEntities($title);
-            }elseif($ext == 'jpg' || $ext == 'jpeg'){
+            if(!is_null($title)) {
+                $title = $this->_xmlEntities($title);
+            } elseif($ext == 'jpg' || $ext == 'jpeg') {
                 //try to use the caption from IPTC/EXIF
                 require_once(DOKU_INC.'inc/JpegMeta.php');
-                $jpeg =new JpegMeta(mediaFN($src));
+                $jpeg = new JpegMeta(mediaFN($src));
                 if($jpeg !== false) $cap = $jpeg->getTitle();
-                if($cap){
+                if(!empty($cap)) {
                     $title = $this->_xmlEntities($cap);
                 }
             }
-            if (!$render) {
+            if(!$render) {
                 // if the picture is not supposed to be rendered
                 // return the title of the picture
-                if (!$title) {
+                if(!$title) {
                     // just show the sourcename
                     $title = $this->_xmlEntities(utf8_basename(noNS($src)));
                 }
                 return $title;
             }
             //add image tag
-            $ret .= '<img src="'.ml($src,array('w'=>$width,'h'=>$height,'cache'=>$cache,'rev'=>$this->_getLastMediaRevisionAt($src))).'"';
+            $ret .= '<img src="'.ml($src, array('w' => $width, 'h' => $height, 'cache' => $cache, 'rev'=>$this->_getLastMediaRevisionAt($src))).'"';
             $ret .= ' class="media'.$align.'"';
 
-            if ($title) {
-                $ret .= ' title="' . $title . '"';
-                $ret .= ' alt="'   . $title .'"';
-            }else{
+            if($title) {
+                $ret .= ' title="'.$title.'"';
+                $ret .= ' alt="'.$title.'"';
+            } else {
                 $ret .= ' alt=""';
             }
 
-            if ( !is_null($width) )
+            if(!is_null($width))
                 $ret .= ' width="'.$this->_xmlEntities($width).'"';
 
-            if ( !is_null($height) )
+            if(!is_null($height))
                 $ret .= ' height="'.$this->_xmlEntities($height).'"';
 
             $ret .= ' />';
 
-        }elseif(media_supportedav($mime, 'video') || media_supportedav($mime, 'audio')){
+        } elseif(media_supportedav($mime, 'video') || media_supportedav($mime, 'audio')) {
             // first get the $title
             $title = !is_null($title) ? $this->_xmlEntities($title) : false;
-            if (!$render) {
+            if(!$render) {
                 // if the file is not supposed to be rendered
                 // return the title of the file (just the sourcename if there is no title)
                 return $title ? $title : $this->_xmlEntities(utf8_basename(noNS($src)));
             }
 
-            $att = array();
+            $att          = array();
             $att['class'] = "media$align";
-            if ($title) {
+            if($title) {
                 $att['title'] = $title;
             }
 
-            if (media_supportedav($mime, 'video')) {
+            if(media_supportedav($mime, 'video')) {
                 //add video
                 $ret .= $this->_video($src, $width, $height, $att);
             }
-            if (media_supportedav($mime, 'audio')) {
+            if(media_supportedav($mime, 'audio')) {
                 //add audio
                 $ret .= $this->_audio($src, $att);
             }
 
-        }elseif($mime == 'application/x-shockwave-flash'){
-            if (!$render) {
+        } elseif($mime == 'application/x-shockwave-flash') {
+            if(!$render) {
                 // if the flash is not supposed to be rendered
                 // return the title of the flash
-                if (!$title) {
+                if(!$title) {
                     // just show the sourcename
                     $title = utf8_basename(noNS($src));
                 }
                 return $this->_xmlEntities($title);
             }
 
-            $att = array();
+            $att          = array();
             $att['class'] = "media$align";
             if($align == 'right') $att['align'] = 'right';
-            if($align == 'left')  $att['align'] = 'left';
-            $ret .= html_flashobject(ml($src,array('cache'=>$cache),true,'&'),$width,$height,
-                                     array('quality' => 'high'),
-                                     null,
-                                     $att,
-                                     $this->_xmlEntities($title));
-        }elseif($title){
+            if($align == 'left') $att['align'] = 'left';
+            $ret .= html_flashobject(
+                ml($src, array('cache' => $cache), true, '&'), $width, $height,
+                array('quality' => 'high'),
+                null,
+                $att,
+                $this->_xmlEntities($title)
+            );
+        } elseif($title) {
             // well at least we have a title to display
             $ret .= $this->_xmlEntities($title);
-        }else{
+        } else {
             // just show the sourcename
             $ret .= $this->_xmlEntities(utf8_basename(noNS($src)));
         }
@@ -1167,23 +1509,30 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         return $ret;
     }
 
+    /**
+     * Escape string for output
+     *
+     * @param $string
+     * @return string
+     */
     function _xmlEntities($string) {
-        return htmlspecialchars($string,ENT_QUOTES,'UTF-8');
+        return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
     }
 
     /**
      * Creates a linkid from a headline
      *
+     * @author Andreas Gohr <andi@splitbrain.org>
      * @param string  $title   The headline title
      * @param boolean $create  Create a new unique ID?
-     * @author Andreas Gohr <andi@splitbrain.org>
+     * @return string
      */
-    function _headerToLink($title,$create=false) {
-        if($create){
-            return sectionID($title,$this->headers);
-        }else{
+    function _headerToLink($title, $create = false) {
+        if($create) {
+            return sectionID($title, $this->headers);
+        } else {
             $check = false;
-            return sectionID($title,$check);
+            return sectionID($title, $check);
         }
     }
 
@@ -1191,18 +1540,22 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
      * Construct a title and handle images in titles
      *
      * @author Harry Fuecks <hfuecks@gmail.com>
+     * @param string|array $title    either string title or media array
+     * @param string       $default  default title if nothing else is found
+     * @param bool         $isImage  will be set to true if it's a media file
+     * @param null|string  $id       linked page id (used to extract title from first heading)
+     * @param string       $linktype content|navigation
+     * @return string      HTML of the title, might be full image tag or just escaped text
      */
-    function _getLinkTitle($title, $default, & $isImage, $id=null, $linktype='content') {
-        global $conf;
-
+    function _getLinkTitle($title, $default, &$isImage, $id = null, $linktype = 'content') {
         $isImage = false;
-        if ( is_array($title) ) {
+        if(is_array($title)) {
             $isImage = true;
             return $this->_imageTitle($title);
-        } elseif ( is_null($title) || trim($title)=='') {
-            if (useHeading($linktype) && $id) {
+        } elseif(is_null($title) || trim($title) == '') {
+            if(useHeading($linktype) && $id) {
                 $heading = p_get_first_heading($id);
-                if ($heading) {
+                if($heading) {
                     return $this->_xmlEntities($heading);
                 }
             }
@@ -1213,48 +1566,51 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
     }
 
     /**
-     * Returns an HTML code for images used in link titles
+     * Returns HTML code for images used in link titles
      *
-     * @todo Resolve namespace on internal images
      * @author Andreas Gohr <andi@splitbrain.org>
+     * @param string $img
+     * @return string HTML img tag or similar
      */
     function _imageTitle($img) {
         global $ID;
 
         // some fixes on $img['src']
         // see internalmedia() and externalmedia()
-        list($img['src'],$hash) = explode('#',$img['src'],2);
-        if ($img['type'] == 'internalmedia') {
-            resolve_mediaid(getNS($ID),$img['src'],$exists,$this->date_at,true);
+        list($img['src']) = explode('#', $img['src'], 2);
+        if($img['type'] == 'internalmedia') {
+            resolve_mediaid(getNS($ID), $img['src'], $exists ,$this->date_at, true);
         }
 
-        return $this->_media($img['src'],
-                              $img['title'],
-                              $img['align'],
-                              $img['width'],
-                              $img['height'],
-                              $img['cache']);
+        return $this->_media(
+            $img['src'],
+            $img['title'],
+            $img['align'],
+            $img['width'],
+            $img['height'],
+            $img['cache']
+        );
     }
 
     /**
-     * _getMediaLinkConf is a helperfunction to internalmedia() and externalmedia()
-     * which returns a basic link to a media.
+     * helperfunction to return a basic link to a media
      *
-     * @author Pierre Spring <pierre.spring@liip.ch>
-     * @param string $src
-     * @param string $title
-     * @param string $align
-     * @param string $width
-     * @param string $height
-     * @param string $cache
-     * @param string $render
-     * @access protected
-     * @return array
+     * used in internalmedia() and externalmedia()
+     *
+     * @author   Pierre Spring <pierre.spring@liip.ch>
+     * @param string $src       media ID
+     * @param string $title     descriptive text
+     * @param string $align     left|center|right
+     * @param int    $width     width of media in pixel
+     * @param int    $height    height of media in pixel
+     * @param string $cache     cache|recache|nocache
+     * @param bool   $render    should the media be embedded inline or just linked
+     * @return array associative array with link config
      */
     function _getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render) {
         global $conf;
 
-        $link = array();
+        $link           = array();
         $link['class']  = 'media';
         $link['style']  = '';
         $link['pre']    = '';
@@ -1267,50 +1623,49 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         return $link;
     }
 
-
     /**
      * Embed video(s) in HTML
      *
      * @author Anika Henke <anika@selfthinker.org>
      *
-     * @param string $src      - ID of video to embed
-     * @param int $width       - width of the video in pixels
-     * @param int $height      - height of the video in pixels
-     * @param array $atts      - additional attributes for the <video> tag
+     * @param string $src         - ID of video to embed
+     * @param int    $width       - width of the video in pixels
+     * @param int    $height      - height of the video in pixels
+     * @param array  $atts        - additional attributes for the <video> tag
      * @return string
      */
-    function _video($src,$width,$height,$atts=null){
+    function _video($src, $width, $height, $atts = null) {
         // prepare width and height
         if(is_null($atts)) $atts = array();
         $atts['width']  = (int) $width;
         $atts['height'] = (int) $height;
-        if(!$atts['width'])  $atts['width']  = 320;
+        if(!$atts['width']) $atts['width'] = 320;
         if(!$atts['height']) $atts['height'] = 240;
 
         // prepare alternative formats
-        $extensions = array('webm', 'ogv', 'mp4');
+        $extensions   = array('webm', 'ogv', 'mp4');
         $alternatives = media_alternativefiles($src, $extensions);
-        $poster = media_alternativefiles($src, array('jpg', 'png'), true);
-        $posterUrl = '';
-        if (!empty($poster)) {
-            $posterUrl = ml(reset($poster),array('cache'=>$cache),true,'&');
+        $poster       = media_alternativefiles($src, array('jpg', 'png'), true);
+        $posterUrl    = '';
+        if(!empty($poster)) {
+            $posterUrl = ml(reset($poster), '', true, '&');
         }
 
         $out = '';
         // open video tag
         $out .= '<video '.buildAttributes($atts).' controls="controls"';
-        if ($posterUrl) $out .= ' poster="'.hsc($posterUrl).'"';
+        if($posterUrl) $out .= ' poster="'.hsc($posterUrl).'"';
         $out .= '>'.NL;
         $fallback = '';
 
         // output source for each alternative video format
         foreach($alternatives as $mime => $file) {
-            $url = ml($file,array('cache'=>$cache),true,'&');
+            $url   = ml($file, '', true, '&');
             $title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(utf8_basename(noNS($file)));
 
             $out .= '<source src="'.hsc($url).'" type="'.$mime.'" />'.NL;
             // alternative content (just a link to the file)
-            $fallback .= $this->internalmedia($file, $title, NULL, NULL, NULL, $cache=NULL, $linking='linkonly', $return=true);
+            $fallback .= $this->internalmedia($file, $title, null, null, null, $cache = null, $linking = 'linkonly', $return = true);
         }
 
         // finish
@@ -1324,14 +1679,14 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
      *
      * @author Anika Henke <anika@selfthinker.org>
      *
-     * @param string $src      - ID of audio to embed
-     * @param array $atts      - additional attributes for the <audio> tag
+     * @param string $src       - ID of audio to embed
+     * @param array  $atts      - additional attributes for the <audio> tag
      * @return string
      */
-    function _audio($src,$atts=null){
+    function _audio($src, $atts = null) {
 
         // prepare alternative formats
-        $extensions = array('ogg', 'mp3', 'wav');
+        $extensions   = array('ogg', 'mp3', 'wav');
         $alternatives = media_alternativefiles($src, $extensions);
 
         $out = '';
@@ -1341,12 +1696,12 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
 
         // output source for each alternative audio format
         foreach($alternatives as $mime => $file) {
-            $url = ml($file,array('cache'=>$cache),true,'&');
+            $url   = ml($file, '', true, '&');
             $title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(utf8_basename(noNS($file)));
 
             $out .= '<source src="'.hsc($url).'" type="'.$mime.'" />'.NL;
             // alternative content (just a link to the file)
-            $fallback .= $this->internalmedia($file, $title, NULL, NULL, NULL, $cache=NULL, $linking='linkonly', $return=true);
+            $fallback .= $this->internalmedia($file, $title, null, null, null, $cache = null, $linking = 'linkonly', $return = true);
         }
 
         // finish
@@ -1370,6 +1725,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         return $pagelog->getLastRevisionAt($this->date_at);
     }
 
+    #endregion
 }
 
 //Setup VIM: ex: et ts=4 :
diff --git a/inc/parserutils.php b/inc/parserutils.php
index e2811b0818f1914bd5db6f30ffa73a9a63d8d675..4aebec2c8e86e4906b52fd7b947b82d149b5424c 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -112,8 +112,7 @@ function p_cached_output($file, $format='xhtml', $id='') {
     } else {
         $parsed = p_render($format, p_cached_instructions($file,false,$id), $info);
 
-        if ($info['cache']) {
-            $cache->storeCache($parsed);               //save cachefile
+        if ($info['cache'] && $cache->storeCache($parsed)) {              // storeCache() attempts to save cachefile
             if($conf['allowdebug'] && $format=='xhtml') $parsed .= "\n<!-- no cachefile used, but created {$cache->cache} -->\n";
         }else{
             $cache->removeCache();                     //try to delete cachefile
@@ -640,9 +639,9 @@ function p_get_renderer($mode) {
         return $Renderer;
     }
 
-    // not bundled, see if its an enabled plugin for rendering $mode
+    // not bundled, see if its an enabled renderer plugin & when $mode is 'xhtml', the renderer can supply that format.
     $Renderer = $plugin_controller->load('renderer',$rname);
-    if ($Renderer && is_a($Renderer, 'Doku_Renderer')  && ($mode == $Renderer->getFormat())) {
+    if ($Renderer && is_a($Renderer, 'Doku_Renderer')  && ($mode != 'xhtml' || $mode == $Renderer->getFormat())) {
         return $Renderer;
     }
 
@@ -664,7 +663,6 @@ function p_get_renderer($mode) {
     }
 
     // fallback failed, alert the world
-    trigger_error("Unable to resolve render class $rclass",E_USER_WARNING);
     msg("No renderer '$rname' found for mode '$mode'",-1);
     return null;
 }
diff --git a/inc/plugin.php b/inc/plugin.php
index 95bdaee2bd440a17284cdf760b5b28fc73c4332e..fbfc0325f74ed03dbb8f714e35ae34de93af378c 100644
--- a/inc/plugin.php
+++ b/inc/plugin.php
@@ -30,18 +30,19 @@ class DokuWiki_Plugin {
      * desc   - Short description of the plugin (Text only)
      * url    - Website with more information on the plugin (eg. syntax description)
      */
-    function getInfo(){
-        $parts = explode('_',get_class($this));
-        $info  = DOKU_PLUGIN.'/'.$parts[2].'/plugin.info.txt';
+    function getInfo() {
+        $parts = explode('_', get_class($this));
+        $info = DOKU_PLUGIN . '/' . $parts[2] . '/plugin.info.txt';
         if(@file_exists($info)) return confToHash($info);
 
-        msg('getInfo() not implemented in '.get_class($this).
-               ' and '.$info.' not found.<br />This is a bug in the '.
-               $parts[2].' plugin and should be reported to the '.
-               'plugin author.',-1);
+        msg(
+            'getInfo() not implemented in ' . get_class($this) . ' and ' . $info . ' not found.<br />' .
+            'Verify you\'re running the latest version of the plugin. If the problem persists, send a ' .
+            'bug report to the author of the ' . $parts[2] . ' plugin.', -1
+        );
         return array(
-            'date'   => '0000-00-00',
-            'name'   => $parts[2].' plugin',
+            'date' => '0000-00-00',
+            'name' => $parts[2] . ' plugin',
         );
     }
 
@@ -252,10 +253,11 @@ class DokuWiki_Plugin {
      */
     function __call($name, $arguments) {
         if($name == 'render'){
+            dbg_deprecated('render_text()');
             if(!isset($arguments[1])) $arguments[1] = 'xhtml';
             return $this->render_text($arguments[0], $arguments[1]);
         }
-        trigger_error("no such method $name", E_ERROR);
+        trigger_error("no such method $name", E_USER_ERROR);
         return null;
     }
 
diff --git a/inc/search.php b/inc/search.php
index be47102371b3cc346100e9cc297aa0494739eb0b..5489dc2c0fad3e3af397fb28102441245eb73521 100644
--- a/inc/search.php
+++ b/inc/search.php
@@ -317,25 +317,25 @@ function pathID($path,$keeptxt=false){
  * How the function behaves, depends on the options passed in the $opts
  * array, where the following settings can be used.
  *
- * depth      int     recursion depth. 0 for unlimited
- * keeptxt    bool    keep .txt extension for IDs
- * listfiles  bool    include files in listing
- * listdirs   bool    include namespaces in listing
- * pagesonly  bool    restrict files to pages
- * skipacl    bool    do not check for READ permission
- * sneakyacl  bool    don't recurse into nonreadable dirs
- * hash       bool    create MD5 hash for files
- * meta       bool    return file metadata
- * filematch  string  match files against this regexp
- * idmatch    string  match full ID against this regexp
- * dirmatch   string  match directory against this regexp when adding
- * nsmatch    string  match namespace against this regexp when adding
- * recmatch   string  match directory against this regexp when recursing
- * showmsg    bool    warn about non-ID files
- * showhidden bool    show hidden files too
- * firsthead  bool    return first heading for pages
+ * depth      int     recursion depth. 0 for unlimited                       (default: 0)
+ * keeptxt    bool    keep .txt extension for IDs                            (default: false)
+ * listfiles  bool    include files in listing                               (default: false)
+ * listdirs   bool    include namespaces in listing                          (default: false)
+ * pagesonly  bool    restrict files to pages                                (default: false)
+ * skipacl    bool    do not check for READ permission                       (default: false)
+ * sneakyacl  bool    don't recurse into nonreadable dirs                    (default: false)
+ * hash       bool    create MD5 hash for files                              (default: false)
+ * meta       bool    return file metadata                                   (default: false)
+ * filematch  string  match files against this regexp                        (default: '', so accept everything)
+ * idmatch    string  match full ID against this regexp                      (default: '', so accept everything)
+ * dirmatch   string  match directory against this regexp when adding        (default: '', so accept everything)
+ * nsmatch    string  match namespace against this regexp when adding        (default: '', so accept everything)
+ * recmatch   string  match directory against this regexp when recursing     (default: '', so accept everything)
+ * showmsg    bool    warn about non-ID files                                (default: false)
+ * showhidden bool    show hidden files(e.g. by hidepages config) too        (default: false)
+ * firsthead  bool    return first heading for pages                         (default: false)
  *
- * @param array &$data - Reference to the result data structure
+ * @param array &$data  - Reference to the result data structure
  * @param string $base  - Base usually $conf['datadir']
  * @param string $file  - current file or directory relative to $base
  * @param string $type  - Type either 'd' for directory or 'f' for file
diff --git a/inc/subscription.php b/inc/subscription.php
index 298e7c12bb29c6f405f5174c05c604260623b319..aab6de926464448cfc687927646815cc09fd9764 100644
--- a/inc/subscription.php
+++ b/inc/subscription.php
@@ -650,9 +650,11 @@ class Subscription {
      * @todo move the whole functionality into this class, trigger SUBSCRIPTION_NOTIFY_ADDRESSLIST instead,
      *       use an array for the addresses within it
      *
-     * @param array &$data Containing $id (the page id), $self (whether the author
-     *                     should be notified, $addresslist (current email address
-     *                     list)
+     * @param array &$data Containing the entries:
+     *    - $id (the page id),
+     *    - $self (whether the author should be notified,
+     *    - $addresslist (current email address list)
+     *    - $replacements (array of additional string substitutions, @KEY@ to be replaced by value)
      */
     public function notifyaddresses(&$data) {
         if(!$this->isenabled()) return;
@@ -700,6 +702,7 @@ class Subscription {
  * @deprecated 2012-12-07
  */
 function subscription_addresslist(&$data) {
+    dbg_deprecated('class Subscription');
     $sub = new Subscription();
     $sub->notifyaddresses($data);
 }
diff --git a/inc/template.php b/inc/template.php
index 2cb6d3da8bf9c0ba149cace7e246f0ed9073e36a..2dd77502f2f1dd06bd6aeb0918b139671fdbbf59 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -318,15 +318,17 @@ function tpl_metaheaders($alt = true) {
     }
 
     if($alt) {
-        $head['link'][] = array(
-            'rel'  => 'alternate', 'type'=> 'application/rss+xml',
-            'title'=> $lang['btn_recent'], 'href'=> DOKU_BASE.'feed.php'
-        );
-        $head['link'][] = array(
-            'rel'  => 'alternate', 'type'=> 'application/rss+xml',
-            'title'=> $lang['currentns'],
-            'href' => DOKU_BASE.'feed.php?mode=list&ns='.$INFO['namespace']
-        );
+        if(actionOK('rss')) {
+            $head['link'][] = array(
+                'rel'  => 'alternate', 'type'=> 'application/rss+xml',
+                'title'=> $lang['btn_recent'], 'href'=> DOKU_BASE.'feed.php'
+            );
+            $head['link'][] = array(
+                'rel'  => 'alternate', 'type'=> 'application/rss+xml',
+                'title'=> $lang['currentns'],
+                'href' => DOKU_BASE.'feed.php?mode=list&ns='.$INFO['namespace']
+            );
+        }
         if(($ACT == 'show' || $ACT == 'search') && $INFO['writable']) {
             $head['link'][] = array(
                 'rel'  => 'edit',
@@ -335,7 +337,7 @@ function tpl_metaheaders($alt = true) {
             );
         }
 
-        if($ACT == 'search') {
+        if(actionOK('rss') && $ACT == 'search') {
             $head['link'][] = array(
                 'rel'  => 'alternate', 'type'=> 'application/rss+xml',
                 'title'=> $lang['searchresult'],
@@ -367,7 +369,11 @@ function tpl_metaheaders($alt = true) {
             } else {
                 $head['meta'][] = array('name'=> 'robots', 'content'=> 'noindex,nofollow');
             }
-            $head['link'][] = array('rel'=> 'canonical', 'href'=> wl($ID, '', true, '&'));
+            $canonicalUrl = wl($ID, '', true, '&');
+            if ($ID == $conf['start']) {
+                $canonicalUrl = DOKU_URL;
+            }
+            $head['link'][] = array('rel'=> 'canonical', 'href'=> $canonicalUrl);
         } else {
             $head['meta'][] = array('name'=> 'robots', 'content'=> 'noindex,follow');
         }
@@ -379,13 +385,6 @@ function tpl_metaheaders($alt = true) {
 
     // set metadata
     if($ACT == 'show' || $ACT == 'export_xhtml') {
-        // date of modification
-        if($REV) {
-            $head['meta'][] = array('name'=> 'date', 'content'=> date('Y-m-d\TH:i:sO', $REV));
-        } else {
-            $head['meta'][] = array('name'=> 'date', 'content'=> date('Y-m-d\TH:i:sO', $INFO['lastmod']));
-        }
-
         // keywords (explicit or implicit)
         if(!empty($INFO['meta']['subject'])) {
             $head['meta'][] = array('name'=> 'keywords', 'content'=> join(',', $INFO['meta']['subject']));
@@ -834,7 +833,7 @@ function tpl_breadcrumbs($sep = '•') {
     $crumbs_sep = ' <span class="bcsep">'.$sep.'</span> ';
 
     //render crumbs, highlight the last one
-    print '<span class="bchead">'.$lang['breadcrumb'].':</span>';
+    print '<span class="bchead">'.$lang['breadcrumb'].'</span>';
     $last = count($crumbs);
     $i    = 0;
     foreach($crumbs as $id => $name) {
@@ -874,7 +873,7 @@ function tpl_youarehere($sep = ' » ') {
     $parts = explode(':', $ID);
     $count = count($parts);
 
-    echo '<span class="bchead">'.$lang['youarehere'].': </span>';
+    echo '<span class="bchead">'.$lang['youarehere'].' </span>';
 
     // always print the startpage
     echo '<span class="home">';
@@ -918,7 +917,7 @@ function tpl_userinfo() {
     global $INPUT;
 
     if($INPUT->server->str('REMOTE_USER')) {
-        print $lang['loggedinas'].': '.userlink();
+        print $lang['loggedinas'].' '.userlink();
         return true;
     }
     return false;
@@ -960,7 +959,7 @@ function tpl_pageinfo($ret = false) {
         $out .= '<bdi>'.$fn.'</bdi>';
         $out .= ' · ';
         $out .= $lang['lastmod'];
-        $out .= ': ';
+        $out .= ' ';
         $out .= $date;
         if($INFO['editor']) {
             $out .= ' '.$lang['by'].' ';
@@ -971,7 +970,7 @@ function tpl_pageinfo($ret = false) {
         if($INFO['locked']) {
             $out .= ' · ';
             $out .= $lang['lockedby'];
-            $out .= ': ';
+            $out .= ' ';
             $out .= '<bdi>'.editorinfo($INFO['locked']).'</bdi>';
         }
         if($ret) {
@@ -1042,7 +1041,7 @@ function tpl_img_getTag($tags, $alt = '', $src = null) {
     static $meta = null;
     if(is_null($meta)) $meta = new JpegMeta($src);
     if($meta === false) return $alt;
-    $info = $meta->getField($tags);
+    $info = cleanText($meta->getField($tags));
     if($info == false) return $alt;
     return $info;
 }
@@ -1060,9 +1059,9 @@ function tpl_img_meta() {
     echo '<dl>';
     foreach($tags as $tag) {
         $label = $lang[$tag['langkey']];
-        if(!$label) $label = $tag['langkey'];
+        if(!$label) $label = $tag['langkey'] . ':';
 
-        echo '<dt>'.$label.':</dt><dd>';
+        echo '<dt>'.$label.'</dt><dd>';
         if ($tag['type'] == 'date') {
             echo dformat($tag['value']);
         } else {
@@ -1427,14 +1426,14 @@ function tpl_mediaFileList() {
  * @author Kate Arzamastseva <pshns@ukr.net>
  */
 function tpl_mediaFileDetails($image, $rev) {
-    global $AUTH, $NS, $conf, $DEL, $lang;
+    global $conf, $DEL, $lang;
     /** @var Input $INPUT */
     global $INPUT;
 
     $removed = (!file_exists(mediaFN($image)) && file_exists(mediaMetaFN($image, '.changes')) && $conf['mediarevisions']);
     if(!$image || (!file_exists(mediaFN($image)) && !$removed) || $DEL) return;
     if($rev && !file_exists(mediaFN($image, $rev))) $rev = false;
-    if(isset($NS) && getNS($image) != $NS) return;
+    $ns = getNS($image);
     $do = $INPUT->str('mediado');
 
     $opened_tab = $INPUT->str('tab_details');
@@ -1470,13 +1469,13 @@ function tpl_mediaFileDetails($image, $rev) {
     echo '<div class="panelContent">'.NL;
 
     if($opened_tab == 'view') {
-        media_tab_view($image, $NS, $AUTH, $rev);
+        media_tab_view($image, $ns, null, $rev);
 
     } elseif($opened_tab == 'edit' && !$removed) {
-        media_tab_edit($image, $NS, $AUTH);
+        media_tab_edit($image, $ns);
 
     } elseif($opened_tab == 'history' && $conf['mediarevisions']) {
-        media_tab_history($image, $NS, $AUTH);
+        media_tab_history($image, $ns);
     }
 
     echo '</div>'.NL;
diff --git a/install.php b/install.php
index 779084cfa2bf6b4c15e9832b69e9d00ec6b1ca67..767dd332f1f770de17840a889ad72fa935541dbc 100644
--- a/install.php
+++ b/install.php
@@ -57,6 +57,8 @@ $dokuwiki_hash = array(
     '2012-09-10'   => 'eb0b3fc90056fbc12bac6f49f7764df3',
     '2013-05-10'   => '7b62b75245f57f122d3e0f8ed7989623',
     '2013-12-08'   => '263c76af309fbf083867c18a34ff5214',
+    '2014-05-05'   => '263c76af309fbf083867c18a34ff5214',
+    'devel'        => 'b3ddc3f793eac8c135176e535054c00a',
 );
 
 
@@ -349,6 +351,16 @@ function store_data($d){
  */
 
 EOT;
+    // add any config options set by a previous installer
+    $preset = __DIR__.'/install.conf';
+    if(file_exists($preset)){
+        $output .= "# preset config options\n";
+        $output .= file_get_contents($preset);
+        $output .= "\n\n";
+        $output .= "# options selected in installer\n";
+        @unlink($preset);
+    }
+
     $output .= '$conf[\'title\'] = \''.addslashes($d['title'])."';\n";
     $output .= '$conf[\'lang\'] = \''.addslashes($LC)."';\n";
     $output .= '$conf[\'license\'] = \''.addslashes($d['license'])."';\n";
@@ -532,6 +544,11 @@ function check_functions(){
         $ok = false;
     }
 
+    if(ini_get('mbstring.func_overload') != 0){
+        $error[] = $lang['i_mbfuncoverload'];
+        $ok = false;
+    }
+
     $funcs = explode(' ','addslashes call_user_func chmod copy fgets '.
                          'file file_exists fseek flush filesize ftell fopen '.
                          'glob header ignore_user_abort ini_get mail mkdir '.
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php
index 1000094bcb08543161341f909d374be01d58bb11..a200a3dedd2fde7302dfa1d17114ca5e2954cc1f 100644
--- a/lib/exe/ajax.php
+++ b/lib/exe/ajax.php
@@ -254,7 +254,7 @@ function ajax_mediadiff(){
 
     $image = '';
     if ($INPUT->has('image')) $image = cleanID($INPUT->str('image'));
-    $NS = $INPUT->post->str('ns');
+    $NS = getNS($image);
     $auth = auth_quickaclcheck("$NS:*");
     media_diff($image, $NS, $auth, true);
 }
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 30d0d18c56d2cb8ffa71f71bc87a24d07890a868..6c1d607514d3a2c0da391df74e7f704c710fdb93 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -602,30 +602,47 @@ function css_comment_cb($matches){
 function css_onelinecomment_cb($matches) {
     $line = $matches[0];
 
-    $out = '';
     $i = 0;
     $len = strlen($line);
+
     while ($i< $len){
         $nextcom = strpos($line, '//', $i);
         $nexturl = stripos($line, 'url(', $i);
 
         if($nextcom === false) {
             // no more comments, we're done
-            $out .= substr($line, $i, $len-$i);
+            $i = $len;
             break;
         }
+
+        // keep any quoted string that starts before a comment
+        $nextsqt = strpos($line, "'", $i);
+        $nextdqt = strpos($line, '"', $i);
+        if(min($nextsqt, $nextdqt) < $nextcom) {
+            $skipto = false;
+            if($nextsqt !== false && ($nextdqt === false || $nextsqt < $nextdqt)) {
+                $skipto = strpos($line, "'", $nextsqt+1) +1;
+            } else if ($nextdqt !== false) {
+                $skipto = strpos($line, '"', $nextdqt+1) +1;
+            }
+
+            if($skipto !== false) {
+                $i = $skipto;
+                continue;
+            }
+        }
+
         if($nexturl === false || $nextcom < $nexturl) {
             // no url anymore, strip comment and be done
-            $out .= substr($line, $i, $nextcom-$i);
+            $i = $nextcom;
             break;
         }
+
         // we have an upcoming url
-        $urlclose = strpos($line, ')', $nexturl);
-        $out .= substr($line, $i, $urlclose-$i);
-        $i = $urlclose;
+        $i = strpos($line, ')', $nexturl);
     }
 
-    return $out;
+    return substr($line, 0, $i);
 }
 
 //Setup VIM: ex: et ts=4 :
diff --git a/lib/exe/js.php b/lib/exe/js.php
index 4d46601974355a025d3f71f1fbf6cae3ecf930d8..bec12ef7a4244d91200f708569c5c2b3ad125aba 100644
--- a/lib/exe/js.php
+++ b/lib/exe/js.php
@@ -166,7 +166,10 @@ function js_load($file){
         // is it a include_once?
         if($match[1]){
             $base = utf8_basename($ifile);
-            if($loaded[$base]) continue;
+            if($loaded[$base]){
+                $data  = str_replace($match[0], '' ,$data);
+                continue;
+            }
             $loaded[$base] = true;
         }
 
diff --git a/lib/exe/mediamanager.php b/lib/exe/mediamanager.php
index 7044232ceedd8a65365f5e299e6a9e3bccf4ace2..c90b6db35441ad4ad7ad12c2076b22113662b70a 100644
--- a/lib/exe/mediamanager.php
+++ b/lib/exe/mediamanager.php
@@ -8,6 +8,7 @@
     require_once(DOKU_INC.'inc/init.php');
 
     global $INPUT;
+    global $lang;
     // handle passed message
     if($INPUT->str('msg1')) msg(hsc($INPUT->str('msg1')),1);
     if($INPUT->str('err')) msg(hsc($INPUT->str('err')),-1);
diff --git a/lib/plugins/acl/admin.php b/lib/plugins/acl/admin.php
index de38aedd5fe802b634312930ef502ed8d573ef54..ebb097a04bfab717f20dabc396dada1b2ea6f438 100644
--- a/lib/plugins/acl/admin.php
+++ b/lib/plugins/acl/admin.php
@@ -779,8 +779,8 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
         }
 
         echo '<select name="acl_t" class="edit">'.NL;
-        echo '  <option value="__g__" class="aclgroup"'.$gsel.'>'.$this->getLang('acl_group').':</option>'.NL;
-        echo '  <option value="__u__"  class="acluser"'.$usel.'>'.$this->getLang('acl_user').':</option>'.NL;
+        echo '  <option value="__g__" class="aclgroup"'.$gsel.'>'.$this->getLang('acl_group').'</option>'.NL;
+        echo '  <option value="__u__"  class="acluser"'.$usel.'>'.$this->getLang('acl_user').'</option>'.NL;
         if (!empty($this->specials)) {
             echo '  <optgroup label="&#160;">'.NL;
             foreach($this->specials as $ug){
diff --git a/lib/plugins/acl/lang/ar/lang.php b/lib/plugins/acl/lang/ar/lang.php
index 4e44dab5fc43d38790931427c866f2194fd9b162..89fe27a767b3a41eebfcd22d8ab23c88161ad2cb 100644
--- a/lib/plugins/acl/lang/ar/lang.php
+++ b/lib/plugins/acl/lang/ar/lang.php
@@ -9,8 +9,8 @@
  * @author uahello@gmail.com
  */
 $lang['admin_acl']             = 'إدارة قوائم التحكم بالدخول';
-$lang['acl_group']             = 'مجموعة';
-$lang['acl_user']              = 'مستخدم';
+$lang['acl_group']             = 'مجموعة:';
+$lang['acl_user']              = 'مستخدم:';
 $lang['acl_perms']             = 'ترخيص لـ';
 $lang['page']                  = 'صفحة';
 $lang['namespace']             = 'فضاء التسمية';
diff --git a/lib/plugins/acl/lang/bg/lang.php b/lib/plugins/acl/lang/bg/lang.php
index 14e7d311cf7bedb18f6adc69fd0f105145e0e84e..648b91ef474d957b2ba53716647b9a1e93927e17 100644
--- a/lib/plugins/acl/lang/bg/lang.php
+++ b/lib/plugins/acl/lang/bg/lang.php
@@ -8,8 +8,8 @@
  * @author Kiril <neohidra@gmail.com>
  */
 $lang['admin_acl']             = 'Управление на списъците за достъп';
-$lang['acl_group']             = 'Група';
-$lang['acl_user']              = 'Потребител';
+$lang['acl_group']             = 'Група:';
+$lang['acl_user']              = 'Потребител:';
 $lang['acl_perms']             = 'Права за';
 $lang['page']                  = 'Страница';
 $lang['namespace']             = 'Именно пространство';
diff --git a/lib/plugins/acl/lang/ca-valencia/lang.php b/lib/plugins/acl/lang/ca-valencia/lang.php
index ef0ae92ebdb52d4b48f5aa5e1bba1c6ace675fbb..bdfa7da22dd2225c84c4b2685ae9252c1218a823 100644
--- a/lib/plugins/acl/lang/ca-valencia/lang.php
+++ b/lib/plugins/acl/lang/ca-valencia/lang.php
@@ -8,8 +8,8 @@
  * @author Bernat Arlandis <berarma@llenguaitecnologia.com>
  */
 $lang['admin_acl']             = 'Gestor de les llistes de control d\'accés';
-$lang['acl_group']             = 'Grup';
-$lang['acl_user']              = 'Usuari';
+$lang['acl_group']             = 'Grup:';
+$lang['acl_user']              = 'Usuari:';
 $lang['acl_perms']             = 'Permissos per a';
 $lang['page']                  = 'Pàgina';
 $lang['namespace']             = 'Espai de noms';
diff --git a/lib/plugins/acl/lang/ca/lang.php b/lib/plugins/acl/lang/ca/lang.php
index 183db711bf5d7bc3a14995d9779297f9f9d28e5f..bead981f00765a74832a316a9bd0cdce7e2b1f01 100644
--- a/lib/plugins/acl/lang/ca/lang.php
+++ b/lib/plugins/acl/lang/ca/lang.php
@@ -10,8 +10,8 @@
  * @author daniel@6temes.cat
  */
 $lang['admin_acl']             = 'Gestió de la Llista de Control d\'Accés';
-$lang['acl_group']             = 'Grup';
-$lang['acl_user']              = 'Usuari';
+$lang['acl_group']             = 'Grup:';
+$lang['acl_user']              = 'Usuari:';
 $lang['acl_perms']             = 'Permisos per a';
 $lang['page']                  = 'Pàgina';
 $lang['namespace']             = 'Espai';
diff --git a/lib/plugins/acl/lang/cs/lang.php b/lib/plugins/acl/lang/cs/lang.php
index 8031612f7d13e7388bf7909661fcb33191e01689..497d53a4afbe0f70dca60a7a905ae8c4e0259ae7 100644
--- a/lib/plugins/acl/lang/cs/lang.php
+++ b/lib/plugins/acl/lang/cs/lang.php
@@ -15,8 +15,8 @@
  * @author mkucera66@seznam.cz
  */
 $lang['admin_acl']             = 'Správa přístupových práv';
-$lang['acl_group']             = 'Skupina';
-$lang['acl_user']              = 'Uživatel';
+$lang['acl_group']             = 'Skupina:';
+$lang['acl_user']              = 'Uživatel:';
 $lang['acl_perms']             = 'Práva pro';
 $lang['page']                  = 'Stránka';
 $lang['namespace']             = 'Jmenný prostor';
diff --git a/lib/plugins/acl/lang/da/lang.php b/lib/plugins/acl/lang/da/lang.php
index 2558795fd05f3b4e81858ba846daf50c5ee53a62..2f8086ac1f0589c597671cb5845d825bdc1da037 100644
--- a/lib/plugins/acl/lang/da/lang.php
+++ b/lib/plugins/acl/lang/da/lang.php
@@ -16,8 +16,8 @@
  * @author Mikael Lyngvig <mikael@lyngvig.org>
  */
 $lang['admin_acl']             = 'Rettighedsadministration';
-$lang['acl_group']             = 'Gruppe';
-$lang['acl_user']              = 'Bruger';
+$lang['acl_group']             = 'Gruppe:';
+$lang['acl_user']              = 'Bruger:';
 $lang['acl_perms']             = 'Rettigheder for';
 $lang['page']                  = 'Dokument';
 $lang['namespace']             = 'Navnerum';
diff --git a/lib/plugins/acl/lang/de-informal/lang.php b/lib/plugins/acl/lang/de-informal/lang.php
index 35df13dc02fdfb80039035033ace9f327c30d775..6a04cc520fe27bd04cbf346ca35c944a8ad5b474 100644
--- a/lib/plugins/acl/lang/de-informal/lang.php
+++ b/lib/plugins/acl/lang/de-informal/lang.php
@@ -13,8 +13,8 @@
  * @author Volker Bödker <volker@boedker.de>
  */
 $lang['admin_acl']             = 'Zugangsverwaltung';
-$lang['acl_group']             = 'Gruppe';
-$lang['acl_user']              = 'Benutzer';
+$lang['acl_group']             = 'Gruppe:';
+$lang['acl_user']              = 'Benutzer:';
 $lang['acl_perms']             = 'Rechte für';
 $lang['page']                  = 'Seite';
 $lang['namespace']             = 'Namensraum';
diff --git a/lib/plugins/acl/lang/de/lang.php b/lib/plugins/acl/lang/de/lang.php
index 77de4b097813c8d209e32e39f7f8236268750c4a..f25a2ea7159ad72829575f4c0f6eb98b99af4b78 100644
--- a/lib/plugins/acl/lang/de/lang.php
+++ b/lib/plugins/acl/lang/de/lang.php
@@ -23,8 +23,8 @@
  * @author Pierre Corell <info@joomla-praxis.de>
  */
 $lang['admin_acl']             = 'Zugangsverwaltung';
-$lang['acl_group']             = 'Gruppe';
-$lang['acl_user']              = 'Benutzer';
+$lang['acl_group']             = 'Gruppe:';
+$lang['acl_user']              = 'Benutzer:';
 $lang['acl_perms']             = 'Berechtigungen für';
 $lang['page']                  = 'Seite';
 $lang['namespace']             = 'Namensraum';
diff --git a/lib/plugins/acl/lang/el/lang.php b/lib/plugins/acl/lang/el/lang.php
index dc4a9f03453cf8bc4e42ad4b6f41ba636ff50ae3..09c8691e76fc5b68480b6fc4587f8188534d5c95 100644
--- a/lib/plugins/acl/lang/el/lang.php
+++ b/lib/plugins/acl/lang/el/lang.php
@@ -14,8 +14,8 @@
  * @author Vasileios Karavasilis vasileioskaravasilis@gmail.com
  */
 $lang['admin_acl']             = 'Διαχείριση Δικαιωμάτων Πρόσβασης';
-$lang['acl_group']             = 'Ομάδα';
-$lang['acl_user']              = 'Χρήστης';
+$lang['acl_group']             = 'Ομάδα:';
+$lang['acl_user']              = 'Χρήστης:';
 $lang['acl_perms']             = 'Δικαιώματα για';
 $lang['page']                  = 'Σελίδα';
 $lang['namespace']             = 'Φάκελος';
diff --git a/lib/plugins/acl/lang/en/lang.php b/lib/plugins/acl/lang/en/lang.php
index 779614d3289819158d2b916f4058a5b20dd764c0..0c8648974ba300971be47faad5011413d08ecbb6 100644
--- a/lib/plugins/acl/lang/en/lang.php
+++ b/lib/plugins/acl/lang/en/lang.php
@@ -9,8 +9,8 @@
  */
 
 $lang['admin_acl']  = 'Access Control List Management';
-$lang['acl_group']  = 'Group';
-$lang['acl_user']   = 'User';
+$lang['acl_group']  = 'Group:';
+$lang['acl_user']   = 'User:';
 $lang['acl_perms']  = 'Permissions for';
 $lang['page']       = 'Page';
 $lang['namespace']  = 'Namespace';
diff --git a/lib/plugins/acl/lang/eo/lang.php b/lib/plugins/acl/lang/eo/lang.php
index a5f607341dd0e96ed208cebad817f3bd2d6f06fc..f65995408e5eca94d5d3258b45dd0145bbef04a4 100644
--- a/lib/plugins/acl/lang/eo/lang.php
+++ b/lib/plugins/acl/lang/eo/lang.php
@@ -12,8 +12,8 @@
  * @author Robert Bogenschneider <bogi@uea.org>
  */
 $lang['admin_acl']             = 'Administrado de Alirkontrola Listo (ACL)';
-$lang['acl_group']             = 'Grupo';
-$lang['acl_user']              = 'Uzanto';
+$lang['acl_group']             = 'Grupo:';
+$lang['acl_user']              = 'Uzanto:';
 $lang['acl_perms']             = 'Rajtoj por';
 $lang['page']                  = 'Paĝo';
 $lang['namespace']             = 'Nomspaco';
diff --git a/lib/plugins/acl/lang/es/lang.php b/lib/plugins/acl/lang/es/lang.php
index cf503d4d1965bf4a1c4f2a98ad3fe35f44803dd1..da0dc8e38c1a7257460cc11cbdd35251e2899316 100644
--- a/lib/plugins/acl/lang/es/lang.php
+++ b/lib/plugins/acl/lang/es/lang.php
@@ -26,8 +26,8 @@
  * @author Mercè López mercelz@gmail.com
  */
 $lang['admin_acl']             = 'Administración de lista de control de acceso';
-$lang['acl_group']             = 'Grupo';
-$lang['acl_user']              = 'Usuario';
+$lang['acl_group']             = 'Grupo:';
+$lang['acl_user']              = 'Usuario:';
 $lang['acl_perms']             = 'Permiso para';
 $lang['page']                  = 'Página';
 $lang['namespace']             = 'Espacio de nombres';
diff --git a/lib/plugins/acl/lang/et/lang.php b/lib/plugins/acl/lang/et/lang.php
index b591456e823a002ed3bb73ab6189a1bbe44c93a4..d1a047affd1682a2cfa9db5ae8561f00389b951f 100644
--- a/lib/plugins/acl/lang/et/lang.php
+++ b/lib/plugins/acl/lang/et/lang.php
@@ -11,8 +11,8 @@
  * @author Janar Leas <janar.leas@eesti.ee>
  */
 $lang['admin_acl']             = 'Ligipääsukontrolli nimekirja haldamine';
-$lang['acl_group']             = 'Rühm';
-$lang['acl_user']              = 'Kasutaja';
+$lang['acl_group']             = 'Rühm:';
+$lang['acl_user']              = 'Kasutaja:';
 $lang['acl_perms']             = 'Lubatud';
 $lang['page']                  = 'leht';
 $lang['namespace']             = 'Nimeruum';
diff --git a/lib/plugins/acl/lang/eu/lang.php b/lib/plugins/acl/lang/eu/lang.php
index b9285ff36e2ace730c2b7046ecc1eedbafb0044d..f051523d956b5048d45cbfd10836bac54b2e2e2a 100644
--- a/lib/plugins/acl/lang/eu/lang.php
+++ b/lib/plugins/acl/lang/eu/lang.php
@@ -6,8 +6,8 @@
  * @author Zigor Astarbe <astarbe@gmail.com>
  */
 $lang['admin_acl']             = 'Atzipen Kontrol Listaren Kudeaketa';
-$lang['acl_group']             = 'Taldea';
-$lang['acl_user']              = 'Erabiltzailea';
+$lang['acl_group']             = 'Taldea:';
+$lang['acl_user']              = 'Erabiltzailea:';
 $lang['acl_perms']             = 'Baimenak honetarako:';
 $lang['page']                  = 'Orria';
 $lang['namespace']             = 'Izen-espazioa';
diff --git a/lib/plugins/acl/lang/fa/lang.php b/lib/plugins/acl/lang/fa/lang.php
index 24bebaeaf5603e728fd0f5e588e0cc4ddeace3f8..3564f6a3980db0c27e2206b009ba23c1388c8b41 100644
--- a/lib/plugins/acl/lang/fa/lang.php
+++ b/lib/plugins/acl/lang/fa/lang.php
@@ -12,8 +12,8 @@
  * @author AmirH Hassaneini <mytechmix@gmail.com>
  */
 $lang['admin_acl']             = 'مدیریت کنترل دسترسی‌ها';
-$lang['acl_group']             = 'گروه';
-$lang['acl_user']              = 'کاربر';
+$lang['acl_group']             = 'گروه:';
+$lang['acl_user']              = 'کاربر:';
 $lang['acl_perms']             = 'مجوز برای';
 $lang['page']                  = 'صفحه';
 $lang['namespace']             = 'فضای‌نام';
diff --git a/lib/plugins/acl/lang/fi/lang.php b/lib/plugins/acl/lang/fi/lang.php
index 50224dfb48f15172a81a26b635429fd748d95a41..2dfc35801ef04efa90c8cdcd2877dccb35a67e94 100644
--- a/lib/plugins/acl/lang/fi/lang.php
+++ b/lib/plugins/acl/lang/fi/lang.php
@@ -9,8 +9,8 @@
  * @author Sami Olmari <sami@olmari.fi>
  */
 $lang['admin_acl']             = 'Käyttöoikeudet (ACL)';
-$lang['acl_group']             = 'Ryhmä';
-$lang['acl_user']              = 'Käyttäjä';
+$lang['acl_group']             = 'Ryhmä:';
+$lang['acl_user']              = 'Käyttäjä:';
 $lang['acl_perms']             = 'Oikeudet';
 $lang['page']                  = 'Sivu';
 $lang['namespace']             = 'Nimiavaruus';
diff --git a/lib/plugins/acl/lang/fr/help.txt b/lib/plugins/acl/lang/fr/help.txt
index 0819784881707909d4bc375fee8127f4eccea4c0..9fc2af66541c56e7b07c30bf786463dd1815e1e8 100644
--- a/lib/plugins/acl/lang/fr/help.txt
+++ b/lib/plugins/acl/lang/fr/help.txt
@@ -6,6 +6,6 @@ Le panneau de gauche liste toutes les catégories et les pages disponibles.
 
 Le formulaire ci-dessus permet d'afficher et de modifier les autorisations d'un utilisateur ou d'un groupe sélectionné.
 
-Dans le tableau ci-dessous, toutes les listes de contrôle d'accès (ACL) actuelles sont affichées. Vous pouvez l'utiliser pour supprimer ou modifier rapidement plusieurs contrôles d'accès.
+Le tableau ci-dessous présente toutes les listes de contrôle d'accès (ACL) actuelles. Vous pouvez l'utiliser pour supprimer ou modifier rapidement plusieurs contrôles d'accès.
 
 La lecture de [[doku>fr:acl|la documentation officielle des contrôles d'accès]] pourra vous permettre de mieux comprendre le fonctionnement du contrôle d'accès dans DokuWiki.
diff --git a/lib/plugins/acl/lang/fr/lang.php b/lib/plugins/acl/lang/fr/lang.php
index dc17cf79ec6eeff1f9210336f069778e58c364e4..9539c5be52fc4bf224bfbfd7d6d24ace67ceb837 100644
--- a/lib/plugins/acl/lang/fr/lang.php
+++ b/lib/plugins/acl/lang/fr/lang.php
@@ -28,8 +28,8 @@
  * @author Bruno Veilleux <bruno.vey@gmail.com>
  */
 $lang['admin_acl']             = 'Gestion de la liste des contrôles d\'accès (ACL)';
-$lang['acl_group']             = 'Groupe';
-$lang['acl_user']              = 'Utilisateur';
+$lang['acl_group']             = 'Groupe:';
+$lang['acl_user']              = 'Utilisateur:';
 $lang['acl_perms']             = 'Autorisations pour';
 $lang['page']                  = 'Page';
 $lang['namespace']             = 'Catégorie';
diff --git a/lib/plugins/acl/lang/gl/lang.php b/lib/plugins/acl/lang/gl/lang.php
index 3325bfd07913533f30680cafaad7ae382ff36fd0..74d2a79437840b5eb58e8ad14eda1a91ed758442 100644
--- a/lib/plugins/acl/lang/gl/lang.php
+++ b/lib/plugins/acl/lang/gl/lang.php
@@ -7,8 +7,8 @@
  * @author Rodrigo Rega <rodrigorega@gmail.com>
  */
 $lang['admin_acl']             = 'Xestión da Lista de Control de Acceso (ACL)';
-$lang['acl_group']             = 'Grupo';
-$lang['acl_user']              = 'Usuario';
+$lang['acl_group']             = 'Grupo:';
+$lang['acl_user']              = 'Usuario:';
 $lang['acl_perms']             = 'Permisos para';
 $lang['page']                  = 'Páxina';
 $lang['namespace']             = 'Nome de espazo';
diff --git a/lib/plugins/acl/lang/he/lang.php b/lib/plugins/acl/lang/he/lang.php
index 6716081ebff041aca66cb35e812954058101c161..2369b80101b75a1674f2379eb2efa8c4b8700081 100644
--- a/lib/plugins/acl/lang/he/lang.php
+++ b/lib/plugins/acl/lang/he/lang.php
@@ -10,8 +10,8 @@
  * @author Yaron Shahrabani <sh.yaron@gmail.com>
  */
 $lang['admin_acl']             = 'ניהול רשימת בקרת גישות';
-$lang['acl_group']             = 'קבוצה';
-$lang['acl_user']              = 'משתמש';
+$lang['acl_group']             = 'קבוצה:';
+$lang['acl_user']              = 'משתמש:';
 $lang['acl_perms']             = 'הרשאות עבור';
 $lang['page']                  = 'דף';
 $lang['namespace']             = 'מרחב שמות';
diff --git a/lib/plugins/acl/lang/hr/lang.php b/lib/plugins/acl/lang/hr/lang.php
index 8c21f1b0b469fc813f9531e09169935cfd59ce7e..b12966c8446fbae349a0b46cb4f869fb65caca4f 100644
--- a/lib/plugins/acl/lang/hr/lang.php
+++ b/lib/plugins/acl/lang/hr/lang.php
@@ -1,14 +1,15 @@
 <?php
+
 /**
- * Croatian language file
- *
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Branko Rihtman <theney@gmail.com>
  * @author Dražen Odobašić <dodobasic@gmail.com>
  * @author Dejan Igrec dejan.igrec@gmail.com
  */
 $lang['admin_acl']             = 'Upravljanje listom kontrole pristupa';
-$lang['acl_group']             = 'Grupa';
-$lang['acl_user']              = 'Korisnik';
+$lang['acl_group']             = 'Grupa:';
+$lang['acl_user']              = 'Korisnik:';
 $lang['acl_perms']             = 'Dozvole za';
 $lang['page']                  = 'Stranica';
 $lang['namespace']             = 'Imenski prostor';
diff --git a/lib/plugins/acl/lang/ia/lang.php b/lib/plugins/acl/lang/ia/lang.php
index f7d076539b87487be0ec6650b32f35786623a6bd..121424c477286af5cbdd600e44732499e1e8bb05 100644
--- a/lib/plugins/acl/lang/ia/lang.php
+++ b/lib/plugins/acl/lang/ia/lang.php
@@ -6,8 +6,8 @@
  * @author Martijn Dekker <martijn@inlv.org>
  */
 $lang['admin_acl']             = 'Gestion de listas de controlo de accesso';
-$lang['acl_group']             = 'Gruppo';
-$lang['acl_user']              = 'Usator';
+$lang['acl_group']             = 'Gruppo:';
+$lang['acl_user']              = 'Usator:';
 $lang['acl_perms']             = 'Permissiones pro';
 $lang['page']                  = 'Pagina';
 $lang['namespace']             = 'Spatio de nomines';
diff --git a/lib/plugins/acl/lang/id/lang.php b/lib/plugins/acl/lang/id/lang.php
index 6f619c5ec27579326474adaa6df52dc311940c64..3b0ecf44620d4d0fd9960bff79a5b97c1caab2da 100644
--- a/lib/plugins/acl/lang/id/lang.php
+++ b/lib/plugins/acl/lang/id/lang.php
@@ -7,8 +7,8 @@
  * @author Yustinus Waruwu <juswaruwu@gmail.com>
  */
 $lang['admin_acl']             = 'Manajemen Daftar Pengendali Akses';
-$lang['acl_group']             = 'Grup';
-$lang['acl_user']              = 'User';
+$lang['acl_group']             = 'Grup:';
+$lang['acl_user']              = 'User:';
 $lang['acl_perms']             = 'Ijin untuk';
 $lang['page']                  = 'Halaman';
 $lang['namespace']             = 'Namespace';
diff --git a/lib/plugins/acl/lang/is/lang.php b/lib/plugins/acl/lang/is/lang.php
index b45faa80a2edb452bb20638968b1b7522ac8a3bf..13ed7bfd79dde77615d454b3b9e72a30a7892501 100644
--- a/lib/plugins/acl/lang/is/lang.php
+++ b/lib/plugins/acl/lang/is/lang.php
@@ -6,8 +6,8 @@
  * @author Ólafur Gunnlaugsson <oli@audiotools.com>
  * @author Erik Bjørn Pedersen <erik.pedersen@shaw.ca>
  */
-$lang['acl_group']             = 'Hópur';
-$lang['acl_user']              = 'Notandi';
+$lang['acl_group']             = 'Hópur:';
+$lang['acl_user']              = 'Notandi:';
 $lang['page']                  = 'Síða';
 $lang['namespace']             = 'Nafnrými';
 $lang['btn_select']            = 'Veldu';
diff --git a/lib/plugins/acl/lang/it/lang.php b/lib/plugins/acl/lang/it/lang.php
index ba2d0fd3264c1ff221f92aeebf0ee435e9d5f126..82827510fc010fa4b79e451fef8e5a0c734b2091 100644
--- a/lib/plugins/acl/lang/it/lang.php
+++ b/lib/plugins/acl/lang/it/lang.php
@@ -17,8 +17,8 @@
  * @author snarchio@gmail.com
  */
 $lang['admin_acl']             = 'Gestione Lista Controllo Accessi (ACL)';
-$lang['acl_group']             = 'Gruppo';
-$lang['acl_user']              = 'Utente';
+$lang['acl_group']             = 'Gruppo:';
+$lang['acl_user']              = 'Utente:';
 $lang['acl_perms']             = 'Permessi per';
 $lang['page']                  = 'Pagina';
 $lang['namespace']             = 'Categoria';
diff --git a/lib/plugins/acl/lang/ja/lang.php b/lib/plugins/acl/lang/ja/lang.php
index 61fc1ea86ba9dee460124279580eb4e8f8038b60..203ab96d2cb9632dfd4b0dafbaee3319881d44b2 100644
--- a/lib/plugins/acl/lang/ja/lang.php
+++ b/lib/plugins/acl/lang/ja/lang.php
@@ -12,8 +12,8 @@
  * @author Satoshi Sahara <sahara.satoshi@gmail.com>
  */
 $lang['admin_acl']             = 'アクセスコントロール管理';
-$lang['acl_group']             = 'グループ';
-$lang['acl_user']              = 'ユーザー';
+$lang['acl_group']             = 'グループ:';
+$lang['acl_user']              = 'ユーザー:';
 $lang['acl_perms']             = '権限を追加';
 $lang['page']                  = '文書';
 $lang['namespace']             = '名前空間';
diff --git a/lib/plugins/acl/lang/kk/lang.php b/lib/plugins/acl/lang/kk/lang.php
index f21b93132deccd8b2f5a5c0c12576a626241f059..28984fd6dab5af1411d4e1f1b93eabd6cffc17d7 100644
--- a/lib/plugins/acl/lang/kk/lang.php
+++ b/lib/plugins/acl/lang/kk/lang.php
@@ -4,7 +4,7 @@
  *
  * @author Nurgozha Kaliaskarov astana08@gmail.com
  */
-$lang['acl_group']             = 'Группа';
-$lang['acl_user']              = 'Пайдаланушы';
+$lang['acl_group']             = 'Группа:';
+$lang['acl_user']              = 'Пайдаланушы:';
 $lang['page']                  = 'Бет';
 $lang['acl_perm1']             = 'Оқу';
diff --git a/lib/plugins/acl/lang/ko/help.txt b/lib/plugins/acl/lang/ko/help.txt
index 9baeedbb9d4371f5e94af4af439442569f7822d8..80069b322d7255e9ce50e78af5e146546493de91 100644
--- a/lib/plugins/acl/lang/ko/help.txt
+++ b/lib/plugins/acl/lang/ko/help.txt
@@ -1,8 +1,8 @@
 === 빠른 도움말: ===
 
 현재 문서에서 위키 이름공간과 문서에 대한 접근 권한을 추가하거나 삭제할 수 있습니다.
-* 왼쪽 영역에는 선택 가능한 이름공간과 문서 목록을 보여줍니다.
-* 위쪽 입력 양식에서 선택된 사용자와 그룹의 접근 권한을 보거나 바꿀 수 있습니다.
-* 아래 테이블에서 현재 설정된 모든 접근 제어 규칙을 볼 수 있으며, 즉시 여러 규칙을 삭제하거나 바꿀 수 있습니다.
+  * 왼쪽 영역에는 선택 가능한 이름공간과 문서 목록을 보여줍니다.
+  * 위쪽 입력 양식에서 선택된 사용자와 그룹의 접근 권한을 보거나 바꿀 수 있습니다.
+  * 아래 테이블에서 현재 설정된 모든 접근 제어 규칙을 볼 수 있으며, 즉시 여러 규칙을 삭제하거나 바꿀 수 있습니다.
 
 도쿠위키에서 접근 제어가 어떻게 동작되는지 알아보려면 [[doku>ko:acl|ACL 공식 문서]]를 읽어보시기 바랍니다.
\ No newline at end of file
diff --git a/lib/plugins/acl/lang/ko/lang.php b/lib/plugins/acl/lang/ko/lang.php
index 34b93a9f4d2d1a3e8da90a0fd9c7a97363d5f28c..35563ff6c75fc1fb951fb5333959c997e65a20bf 100644
--- a/lib/plugins/acl/lang/ko/lang.php
+++ b/lib/plugins/acl/lang/ko/lang.php
@@ -15,8 +15,8 @@
  * @author Garam <rowain8@gmail.com>
  */
 $lang['admin_acl']             = '접근 제어 목록 관리';
-$lang['acl_group']             = '그룹';
-$lang['acl_user']              = '사용자';
+$lang['acl_group']             = '그룹:';
+$lang['acl_user']              = '사용자:';
 $lang['acl_perms']             = '권한';
 $lang['page']                  = '문서';
 $lang['namespace']             = '이름공간';
@@ -33,7 +33,7 @@ $lang['p_include']             = '더 높은 접근 권한은 하위를 포함
 $lang['current']               = '현재 ACL 규칙';
 $lang['where']                 = '문서/이름공간';
 $lang['who']                   = '사용자/그룹';
-$lang['perm']                  = '접근 권한';
+$lang['perm']                  = '권한';
 $lang['acl_perm0']             = '없음';
 $lang['acl_perm1']             = '읽기';
 $lang['acl_perm2']             = '편집';
diff --git a/lib/plugins/acl/lang/la/lang.php b/lib/plugins/acl/lang/la/lang.php
index 941de1f796e9f7f224bb747761f01a3a8d1b0e00..3779ba7456ed99aa99ce84d079115e9cb08ffc0c 100644
--- a/lib/plugins/acl/lang/la/lang.php
+++ b/lib/plugins/acl/lang/la/lang.php
@@ -5,8 +5,8 @@
  * @author Massimiliano Vassalli <vassalli.max@gmail.com>
  */
 $lang['admin_acl']             = 'Administratio Indicis Custodiae Aditus';
-$lang['acl_group']             = 'Grex';
-$lang['acl_user']              = 'Sodalis';
+$lang['acl_group']             = 'Grex:';
+$lang['acl_user']              = 'Sodalis:';
 $lang['acl_perms']             = 'Facultas:';
 $lang['page']                  = 'Pagina';
 $lang['namespace']             = 'Genus';
diff --git a/lib/plugins/acl/lang/lt/lang.php b/lib/plugins/acl/lang/lt/lang.php
index f1194474686efc28f08da98534e481b8f11eec72..ef339177b772745a629f69cdf5d2d2ede3c49121 100644
--- a/lib/plugins/acl/lang/lt/lang.php
+++ b/lib/plugins/acl/lang/lt/lang.php
@@ -8,8 +8,8 @@
  * @author Arunas Vaitekunas <aras@fan.lt>
  */
 $lang['admin_acl']             = 'Priėjimo Kontrolės Sąrašų valdymas';
-$lang['acl_group']             = 'GrupÄ—';
-$lang['acl_user']              = 'Vartotojas';
+$lang['acl_group']             = 'GrupÄ—:';
+$lang['acl_user']              = 'Vartotojas:';
 $lang['acl_perms']             = 'Leidimai';
 $lang['page']                  = 'Puslapis';
 $lang['namespace']             = 'Pavadinimas';
diff --git a/lib/plugins/acl/lang/lv/lang.php b/lib/plugins/acl/lang/lv/lang.php
index f478b32c6120f3ff632e3cd36dc296ad7e078695..c0acdd7331c8d8299e5d1a25814e1e9fc45690f9 100644
--- a/lib/plugins/acl/lang/lv/lang.php
+++ b/lib/plugins/acl/lang/lv/lang.php
@@ -1,13 +1,13 @@
 <?php
+
 /**
- * latvian language file
- *
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Aivars Miška <allefm@gmail.com>
  */
 $lang['admin_acl']             = 'Piekļuves tiesību vadība';
-$lang['acl_group']             = 'Grupa';
-$lang['acl_user']              = 'Lietotājs';
+$lang['acl_group']             = 'Grupa:';
+$lang['acl_user']              = 'Lietotājs:';
 $lang['acl_perms']             = 'Tiesības';
 $lang['page']                  = 'Lapa';
 $lang['namespace']             = 'Nodaļa';
diff --git a/lib/plugins/acl/lang/mk/lang.php b/lib/plugins/acl/lang/mk/lang.php
index d576c3d1d4a4c8e14b03cff87dc7cd50b5d6b8b4..27f41e77659e469e70e1c75a46c47113785ea9c6 100644
--- a/lib/plugins/acl/lang/mk/lang.php
+++ b/lib/plugins/acl/lang/mk/lang.php
@@ -4,8 +4,8 @@
  *
  * @author Dimitar Talevski <dimi3.14@gmail.com>
  */
-$lang['acl_group']             = 'Група';
-$lang['acl_user']              = 'Корисник';
+$lang['acl_group']             = 'Група:';
+$lang['acl_user']              = 'Корисник:';
 $lang['acl_perms']             = 'Пермисии за';
 $lang['page']                  = 'Страница';
 $lang['btn_select']            = 'Избери';
diff --git a/lib/plugins/acl/lang/mr/lang.php b/lib/plugins/acl/lang/mr/lang.php
index 978df758a8ff56f320a157cd0f062af343a0bd7d..1094ed768530fe2c2908c0e5508e3dfc245945da 100644
--- a/lib/plugins/acl/lang/mr/lang.php
+++ b/lib/plugins/acl/lang/mr/lang.php
@@ -8,8 +8,8 @@
  * @author shantanoo@gmail.com
  */
 $lang['admin_acl']             = 'Access Control List  व्यवस्थापन';
-$lang['acl_group']             = 'गट';
-$lang['acl_user']              = 'सदस्य';
+$lang['acl_group']             = 'गट:';
+$lang['acl_user']              = 'सदस्य:';
 $lang['acl_perms']             = 'परवानगी \'च्या साठी';
 $lang['page']                  = 'पान';
 $lang['namespace']             = 'नेमस्पेस';
diff --git a/lib/plugins/acl/lang/ne/lang.php b/lib/plugins/acl/lang/ne/lang.php
index 5e6196a306afd10bef994c9a0486e26b6d1348ff..481b39ad253d65aa57938bc0f0cda48dbf89c999 100644
--- a/lib/plugins/acl/lang/ne/lang.php
+++ b/lib/plugins/acl/lang/ne/lang.php
@@ -8,8 +8,8 @@
  * @author Saroj Dhakal<lotusnagarkot@yahoo.com>
  */
 $lang['admin_acl']             = 'एक्सेस कन्ट्रोल लिस्ट व्यवस्थापन';
-$lang['acl_group']             = 'समूह';
-$lang['acl_user']              = 'प्रोगकर्ता';
+$lang['acl_group']             = 'समूह:';
+$lang['acl_user']              = 'प्रोगकर्ता:';
 $lang['acl_perms']             = 'को लागि अनुमति';
 $lang['page']                  = 'पृष्ठ';
 $lang['namespace']             = 'नेमस्पेस';
diff --git a/lib/plugins/acl/lang/nl/lang.php b/lib/plugins/acl/lang/nl/lang.php
index abb81ae06364b2138421d7f6aafe342fe96d5459..a73d133444817b438157bb5a549121d1dbed37a8 100644
--- a/lib/plugins/acl/lang/nl/lang.php
+++ b/lib/plugins/acl/lang/nl/lang.php
@@ -23,8 +23,8 @@
  * @author Remon <no@email.local>
  */
 $lang['admin_acl']             = 'Toegangsrechten';
-$lang['acl_group']             = 'Groep';
-$lang['acl_user']              = 'Gebruiker';
+$lang['acl_group']             = 'Groep:';
+$lang['acl_user']              = 'Gebruiker:';
 $lang['acl_perms']             = 'Permissies voor';
 $lang['page']                  = 'Pagina';
 $lang['namespace']             = 'Namespace';
diff --git a/lib/plugins/acl/lang/no/lang.php b/lib/plugins/acl/lang/no/lang.php
index 82cdd5eeff205c56e38aec6fda24df5cb910c291..b9664794d0f9ffef35b338050ef768035ec027e8 100644
--- a/lib/plugins/acl/lang/no/lang.php
+++ b/lib/plugins/acl/lang/no/lang.php
@@ -20,8 +20,8 @@
  * @author Egil Hansen <egil@rosetta.no>
  */
 $lang['admin_acl']             = 'Administrasjon av lister for adgangskontroll (ACL)';
-$lang['acl_group']             = 'Gruppe';
-$lang['acl_user']              = 'Bruker';
+$lang['acl_group']             = 'Gruppe:';
+$lang['acl_user']              = 'Bruker:';
 $lang['acl_perms']             = 'Rettigheter for';
 $lang['page']                  = 'Side';
 $lang['namespace']             = 'Navnerom';
diff --git a/lib/plugins/acl/lang/pl/lang.php b/lib/plugins/acl/lang/pl/lang.php
index 42ce7fdaf7a22ec21830d6ee82c9c05b51219be9..4fa4e8b9d83edc42d9ddbc5b4389803e2b17901d 100644
--- a/lib/plugins/acl/lang/pl/lang.php
+++ b/lib/plugins/acl/lang/pl/lang.php
@@ -16,8 +16,8 @@
  * @author Aoi Karasu <aoikarasu@gmail.com>
  */
 $lang['admin_acl']             = 'ZarzÄ…dzanie uprawnieniami';
-$lang['acl_group']             = 'Grupa';
-$lang['acl_user']              = 'Użytkownik';
+$lang['acl_group']             = 'Grupa:';
+$lang['acl_user']              = 'Użytkownik:';
 $lang['acl_perms']             = 'Uprawnienia użytkownika';
 $lang['page']                  = 'Strona';
 $lang['namespace']             = 'Katalog';
diff --git a/lib/plugins/acl/lang/pt-br/lang.php b/lib/plugins/acl/lang/pt-br/lang.php
index ef0ae6c8b44a376bd01c64ede0bb838f024b9b88..22792752459f3c63ff29afc4c575ab97d5e9223e 100644
--- a/lib/plugins/acl/lang/pt-br/lang.php
+++ b/lib/plugins/acl/lang/pt-br/lang.php
@@ -22,8 +22,8 @@
  * @author Victor Westmann <victor.westmann@gmail.com>
  */
 $lang['admin_acl']             = 'Administração da Lista de Controles de Acesso';
-$lang['acl_group']             = 'Grupo';
-$lang['acl_user']              = 'Usuário';
+$lang['acl_group']             = 'Grupo:';
+$lang['acl_user']              = 'Usuário:';
 $lang['acl_perms']             = 'Permissões para';
 $lang['page']                  = 'Página';
 $lang['namespace']             = 'Espaço de nomes';
diff --git a/lib/plugins/acl/lang/pt/lang.php b/lib/plugins/acl/lang/pt/lang.php
index 4c2114d678c06c13e3c8c25d23869191d043b345..aef1746125dd522e351bba38d86bc9881a2272d4 100644
--- a/lib/plugins/acl/lang/pt/lang.php
+++ b/lib/plugins/acl/lang/pt/lang.php
@@ -11,8 +11,8 @@
  * @author José Campos zecarlosdecampos@gmail.com
  */
 $lang['admin_acl']             = 'Gestão de ACLs';
-$lang['acl_group']             = 'Grupo';
-$lang['acl_user']              = 'Utilizador';
+$lang['acl_group']             = 'Grupo:';
+$lang['acl_user']              = 'Utilizador:';
 $lang['acl_perms']             = 'Permissão para';
 $lang['page']                  = 'Documento';
 $lang['namespace']             = 'Namespace';
diff --git a/lib/plugins/acl/lang/ro/lang.php b/lib/plugins/acl/lang/ro/lang.php
index 4d093216bc5ddfde6b3334e98cbc87dd3d67b4d2..0d281f04958a7099dd1312951e0499db1ba4e341 100644
--- a/lib/plugins/acl/lang/ro/lang.php
+++ b/lib/plugins/acl/lang/ro/lang.php
@@ -13,8 +13,8 @@
  * @author Emanuel-Emeric Andrași <em.andrasi@mandrivausers.ro>
  */
 $lang['admin_acl']             = 'Managementul Listei de Control a Accesului';
-$lang['acl_group']             = 'Grup';
-$lang['acl_user']              = 'Utilizator';
+$lang['acl_group']             = 'Grup:';
+$lang['acl_user']              = 'Utilizator:';
 $lang['acl_perms']             = 'Autorizare pentru';
 $lang['page']                  = 'Pagina';
 $lang['namespace']             = 'Spaţiu de nume';
diff --git a/lib/plugins/acl/lang/ru/lang.php b/lib/plugins/acl/lang/ru/lang.php
index ff4740676b7dd3fe4d7dde10de1ccf693a7c7b75..b49d216f9ea8dab68fae085e04745a2325872513 100644
--- a/lib/plugins/acl/lang/ru/lang.php
+++ b/lib/plugins/acl/lang/ru/lang.php
@@ -19,8 +19,8 @@
  * @author Ivan I. Udovichenko (sendtome@mymailbox.pp.ua)
  */
 $lang['admin_acl']             = 'Управление списками контроля доступа';
-$lang['acl_group']             = 'Группа';
-$lang['acl_user']              = 'Пользователь';
+$lang['acl_group']             = 'Группа:';
+$lang['acl_user']              = 'Пользователь:';
 $lang['acl_perms']             = 'Права доступа для';
 $lang['page']                  = 'Страница';
 $lang['namespace']             = 'Пространство имён';
diff --git a/lib/plugins/acl/lang/sk/lang.php b/lib/plugins/acl/lang/sk/lang.php
index 51837d4b4a71e0280a6598ac59a6bd55824c4508..001218304f4bd6ff9b56f20297a9fc2e2e59f419 100644
--- a/lib/plugins/acl/lang/sk/lang.php
+++ b/lib/plugins/acl/lang/sk/lang.php
@@ -9,8 +9,8 @@
  * @author Martin Michalek <michalek.dev@gmail.com>
  */
 $lang['admin_acl']             = 'Správa zoznamu prístupových práv';
-$lang['acl_group']             = 'Skupina';
-$lang['acl_user']              = 'Užívateľ';
+$lang['acl_group']             = 'Skupina:';
+$lang['acl_user']              = 'Užívateľ:';
 $lang['acl_perms']             = 'Práva pre';
 $lang['page']                  = 'Stránka';
 $lang['namespace']             = 'Menný priestor';
diff --git a/lib/plugins/acl/lang/sl/lang.php b/lib/plugins/acl/lang/sl/lang.php
index 303b18cff5eae0222dfd2c0de99b6ca1a93278cf..84c2088e88287eaa6a8d3d62278ffb2b2d57db44 100644
--- a/lib/plugins/acl/lang/sl/lang.php
+++ b/lib/plugins/acl/lang/sl/lang.php
@@ -9,8 +9,8 @@
  * @author Matej Urbančič (mateju@svn.gnome.org)
  */
 $lang['admin_acl']             = 'Upravljanje dostopa';
-$lang['acl_group']             = 'Skupina';
-$lang['acl_user']              = 'Uporabnik';
+$lang['acl_group']             = 'Skupina:';
+$lang['acl_user']              = 'Uporabnik:';
 $lang['acl_perms']             = 'Dovoljenja za';
 $lang['page']                  = 'Stran';
 $lang['namespace']             = 'Imenski prostor';
diff --git a/lib/plugins/acl/lang/sq/lang.php b/lib/plugins/acl/lang/sq/lang.php
index 30fc99bb0d593b7767f6c9019ce98340c4309f1c..3edd709473b2b144372beae596ba8cc4544d4b45 100644
--- a/lib/plugins/acl/lang/sq/lang.php
+++ b/lib/plugins/acl/lang/sq/lang.php
@@ -5,8 +5,8 @@
  * @author Leonard Elezi leonard.elezi@depinfo.info
  */
 $lang['admin_acl']             = 'Menaxhimi i Listës së Kontrollit të Aksesit';
-$lang['acl_group']             = 'Grup';
-$lang['acl_user']              = 'Përdorues';
+$lang['acl_group']             = 'Grup:';
+$lang['acl_user']              = 'Përdorues:';
 $lang['acl_perms']             = 'Të drejta për';
 $lang['page']                  = 'Faqe';
 $lang['namespace']             = 'Hapësira e Emrit';
diff --git a/lib/plugins/acl/lang/sr/lang.php b/lib/plugins/acl/lang/sr/lang.php
index 20fbb0382b9e7fa358181afccb0c37254de7a28e..0a94418c7701bab7a06c777402529d3807f50d30 100644
--- a/lib/plugins/acl/lang/sr/lang.php
+++ b/lib/plugins/acl/lang/sr/lang.php
@@ -9,8 +9,8 @@
  * @author Miroslav Å olti <solti.miroslav@gmail.com>
  */
 $lang['admin_acl']             = 'Управљање листом контроле приступа';
-$lang['acl_group']             = 'Група';
-$lang['acl_user']              = 'Корисник';
+$lang['acl_group']             = 'Група:';
+$lang['acl_user']              = 'Корисник:';
 $lang['acl_perms']             = 'Дозволе за';
 $lang['page']                  = 'Страница';
 $lang['namespace']             = 'Именски простор';
diff --git a/lib/plugins/acl/lang/sv/lang.php b/lib/plugins/acl/lang/sv/lang.php
index f226542e6e918a78905c1be16516882753f46d45..34c1c6624406bc9d72383151eee4512693b1a98d 100644
--- a/lib/plugins/acl/lang/sv/lang.php
+++ b/lib/plugins/acl/lang/sv/lang.php
@@ -18,8 +18,8 @@
  * @author Smorkster Andersson smorkster@gmail.com
  */
 $lang['admin_acl']             = 'Hantera behörighetslistan (ACL)';
-$lang['acl_group']             = 'Grupp';
-$lang['acl_user']              = 'Användare';
+$lang['acl_group']             = 'Grupp:';
+$lang['acl_user']              = 'Användare:';
 $lang['acl_perms']             = 'Behörighet för';
 $lang['page']                  = 'Sida';
 $lang['namespace']             = 'Namnrymd';
diff --git a/lib/plugins/acl/lang/th/lang.php b/lib/plugins/acl/lang/th/lang.php
index 472c33cdc3a844876b14a418a090fa63f84e65f6..55b707b5c87fbb0a254b451b49ba2da5d500f881 100644
--- a/lib/plugins/acl/lang/th/lang.php
+++ b/lib/plugins/acl/lang/th/lang.php
@@ -1,15 +1,16 @@
 <?php
+
 /**
- * Thai language file
- *
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Komgrit Niyomrath <n.komgrit@gmail.com>
  * @author Kittithat Arnontavilas mrtomyum@gmail.com
  * @author Kittithat Arnontavilas <mrtomyum@gmail.com>
  * @author Thanasak Sompaisansin <jombthep@gmail.com>
  */
 $lang['admin_acl']             = 'จัดการรายชื่อเพื่อควบคุมการเข้าถึง (Access Control List:ACL)';
-$lang['acl_group']             = 'กลุ่ม';
-$lang['acl_user']              = 'ผู้ใช้';
+$lang['acl_group']             = 'กลุ่ม:';
+$lang['acl_user']              = 'ผู้ใช้:';
 $lang['acl_perms']             = 'สิทธิสำหรับ';
 $lang['page']                  = 'เพจ';
 $lang['namespace']             = 'เนมสเปซ';
diff --git a/lib/plugins/acl/lang/tr/lang.php b/lib/plugins/acl/lang/tr/lang.php
index a9699a5f9315916b048118ca36d3cc21ac3b4552..3c3e3dbc13117c024119a29756c17f417128d680 100644
--- a/lib/plugins/acl/lang/tr/lang.php
+++ b/lib/plugins/acl/lang/tr/lang.php
@@ -11,8 +11,8 @@
  * @author farukerdemoncel@gmail.com
  */
 $lang['admin_acl']             = 'Erişim Kontrol Listesi (ACL) Yönetimi';
-$lang['acl_group']             = 'Grup';
-$lang['acl_user']              = 'Kullanıcı';
+$lang['acl_group']             = 'Grup:';
+$lang['acl_user']              = 'Kullanıcı:';
 $lang['acl_perms']             = 'Şunun için yetkiler:';
 $lang['page']                  = 'Sayfa';
 $lang['namespace']             = 'Namespace';
diff --git a/lib/plugins/acl/lang/uk/lang.php b/lib/plugins/acl/lang/uk/lang.php
index 97c66d8a2d3e3a0c0f50ca3f6f17a43cf34c7509..4d8b52e1b0f77c8eb7e0e390b44a65f6e9a0d6ea 100644
--- a/lib/plugins/acl/lang/uk/lang.php
+++ b/lib/plugins/acl/lang/uk/lang.php
@@ -11,8 +11,8 @@
  * @author Ulrikhe Lukoie  <lukoie@gmail>.com
  */
 $lang['admin_acl']             = 'Керування списками контролю доступу';
-$lang['acl_group']             = 'Група';
-$lang['acl_user']              = 'Користувач';
+$lang['acl_group']             = 'Група:';
+$lang['acl_user']              = 'Користувач:';
 $lang['acl_perms']             = 'Права доступу для';
 $lang['page']                  = 'Сторінка';
 $lang['namespace']             = 'Простір імен';
diff --git a/lib/plugins/acl/lang/vi/lang.php b/lib/plugins/acl/lang/vi/lang.php
index 4fc3388ff57e56d722a33caf5f4c416030f0c312..8ca888cae05c0a9ed0446afdac18654b9418edae 100644
--- a/lib/plugins/acl/lang/vi/lang.php
+++ b/lib/plugins/acl/lang/vi/lang.php
@@ -6,8 +6,8 @@
  * @author NukeViet <admin@nukeviet.vn>
  */
 $lang['admin_acl']             = 'Quản lý danh sách quyền truy cập';
-$lang['acl_group']             = 'Nhóm';
-$lang['acl_user']              = 'Thành viên';
+$lang['acl_group']             = 'Nhóm:';
+$lang['acl_user']              = 'Thành viên:';
 $lang['acl_perms']             = 'Cấp phép cho';
 $lang['page']                  = 'Trang';
 $lang['namespace']             = 'Thư mục';
diff --git a/lib/plugins/acl/lang/zh-tw/lang.php b/lib/plugins/acl/lang/zh-tw/lang.php
index a56435318ce1e54eb31254e8dbae9b1fab2e411b..c37727212ccfb092da04093d69c5eb28138b7f1f 100644
--- a/lib/plugins/acl/lang/zh-tw/lang.php
+++ b/lib/plugins/acl/lang/zh-tw/lang.php
@@ -15,8 +15,8 @@
  * @author Ichirou Uchiki <syaoranhinata@gmail.com>
  */
 $lang['admin_acl']             = '管理存取控制表 (ACL)';
-$lang['acl_group']             = '群組';
-$lang['acl_user']              = '使用者';
+$lang['acl_group']             = '群組:';
+$lang['acl_user']              = '使用者:';
 $lang['acl_perms']             = '設定權限於';
 $lang['page']                  = '頁面';
 $lang['namespace']             = '分類名稱';
diff --git a/lib/plugins/acl/lang/zh/lang.php b/lib/plugins/acl/lang/zh/lang.php
index 029446cca4c40215ce2e0adca90bc9e6ada6b2da..4294e6034be50c5498e45678f38679c08bf92e0a 100644
--- a/lib/plugins/acl/lang/zh/lang.php
+++ b/lib/plugins/acl/lang/zh/lang.php
@@ -17,8 +17,8 @@
  * @author Shuo-Ting Jian <shoting@gmail.com>
  */
 $lang['admin_acl']             = '访问控制列表(ACL)管理器';
-$lang['acl_group']             = '组';
-$lang['acl_user']              = '用户';
+$lang['acl_group']             = '组:';
+$lang['acl_user']              = '用户:';
 $lang['acl_perms']             = '许可给';
 $lang['page']                  = '页面';
 $lang['namespace']             = '命名空间';
diff --git a/lib/plugins/acl/plugin.info.txt b/lib/plugins/acl/plugin.info.txt
index 029dc82e72ca50c19ed62edf46b5112576b04839..cb8fe7e8e9be26e96c36ddb204e3c4270e858a8d 100644
--- a/lib/plugins/acl/plugin.info.txt
+++ b/lib/plugins/acl/plugin.info.txt
@@ -1,7 +1,7 @@
 base   acl
 author Andreas Gohr
 email  andi@splitbrain.org
-date   2013-02-17
+date   2014-06-04
 name   ACL Manager
 desc   Manage Page Access Control Lists
 url    http://dokuwiki.org/plugin:acl
diff --git a/lib/plugins/auth.php b/lib/plugins/auth.php
index b0473563914601a864251414f0de2a7ef90f2ceb..b38b591a356b74c9e77847547752a89fc8c55f02 100644
--- a/lib/plugins/auth.php
+++ b/lib/plugins/auth.php
@@ -229,14 +229,15 @@ class DokuWiki_Auth_Plugin extends DokuWiki_Plugin {
      * at least these fields:
      *
      * name string  full name of the user
-     * mail string  email addres of the user
+     * mail string  email address of the user
      * grps array   list of groups the user is in
      *
      * @author  Andreas Gohr <andi@splitbrain.org>
      * @param   string $user the user name
+     * @param   bool $requireGroups whether or not the returned data must include groups
      * @return  array containing user data or false
      */
-    public function getUserData($user) {
+    public function getUserData($user, $requireGroups=true) {
         if(!$this->cando['external']) msg("no valid authorisation system in use", -1);
         return false;
     }
diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php
index 0860e5756af7a39a588027e79979afa3dcbb63ff..a3119dda62d73e08dbaff5fb0038b202a047e5c8 100644
--- a/lib/plugins/authad/auth.php
+++ b/lib/plugins/authad/auth.php
@@ -177,9 +177,10 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin {
      *
      * @author  James Van Lommel <james@nosq.com>
      * @param string $user
+     * @param bool $requireGroups (optional) - ignored, groups are always supplied by this plugin
      * @return array
      */
-    public function getUserData($user) {
+    public function getUserData($user, $requireGroups=true) {
         global $conf;
         global $lang;
         global $ID;
diff --git a/lib/plugins/authad/lang/ar/lang.php b/lib/plugins/authad/lang/ar/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..e0ba7681ac80a98dfdf09873f86e3821a9d28ac8
--- /dev/null
+++ b/lib/plugins/authad/lang/ar/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Mohamed Belhsine <b.mohamed897@gmail.com>
+ */
+$lang['domain']                = 'مجال تسجيل الدخول';
diff --git a/lib/plugins/authad/lang/cs/lang.php b/lib/plugins/authad/lang/cs/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..8119d208aeabb31bde53e05208449ff741ed5376
--- /dev/null
+++ b/lib/plugins/authad/lang/cs/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Jaroslav Lichtblau <jlichtblau@seznam.cz>
+ */
+$lang['domain']                = 'Přihlašovací doména';
diff --git a/lib/plugins/authad/lang/eo/lang.php b/lib/plugins/authad/lang/eo/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..be4abc123b4335096225f63e2836eeed8e967943
--- /dev/null
+++ b/lib/plugins/authad/lang/eo/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Robert Bogenschneider <bogi@uea.org>
+ */
+$lang['domain']                = 'Ensaluta domajno';
diff --git a/lib/plugins/authad/lang/es/settings.php b/lib/plugins/authad/lang/es/settings.php
index 9dbd44be8f4343cd2c52dcd141836ff91a7bfc3f..970259c9ccf1dc4cbe7bc2f9cb4f73777b7db8d0 100644
--- a/lib/plugins/authad/lang/es/settings.php
+++ b/lib/plugins/authad/lang/es/settings.php
@@ -6,12 +6,18 @@
  * @author monica <may.dorado@gmail.com>
  * @author Antonio Bueno <atnbueno@gmail.com>
  * @author Juan De La Cruz <juann.dlc@gmail.com>
+ * @author Eloy <ej.perezgomez@gmail.com>
  */
-$lang['account_suffix']        = 'Su cuenta, sufijo. Ejem. <code> @ my.domain.org </ code>';
+$lang['account_suffix']        = 'Su cuenta, sufijo. Ejem. <code> @ my.domain.org </code>';
 $lang['base_dn']               = 'Su base DN. Ejem. <code>DC=my,DC=dominio,DC=org</code>';
 $lang['domain_controllers']    = 'Una lista separada por coma de los controladores de dominios. Ejem. <code>srv1.dominio.org,srv2.dominio.org</code>';
 $lang['admin_username']        = 'Un usuario con privilegios de Active Directory con acceso a los datos de cualquier otro usuario. Opcional, pero es necesario para determinadas acciones como el envío de suscripciones de correos electrónicos.';
 $lang['admin_password']        = 'La contraseña del usuario anterior.';
 $lang['sso']                   = 'En caso de inicio de sesión usará ¿Kerberos o NTLM?';
 $lang['sso_charset']           = 'La codificación con que tu servidor web pasará el nombre de usuario Kerberos o NTLM. Si es UTF-8 o latin-1 dejar en blanco. Requiere la extensión iconv.';
+$lang['real_primarygroup']     = 'Resolver el grupo primario real en vez de asumir "Domain Users" (más lento)';
+$lang['use_ssl']               = '¿Usar conexión SSL? Si se usa, no habilitar TLS abajo.';
+$lang['use_tls']               = '¿Usar conexión TLS? Si se usa, no habilitar SSL arriba.';
 $lang['debug']                 = 'Mostrar información adicional de depuración sobre los errores?';
+$lang['expirywarn']            = 'Días por adelantado para avisar al usuario de que contraseña expirará. 0 para deshabilitar.';
+$lang['additional']            = 'Una lista separada por comas de atributos AD adicionales a obtener de los datos de usuario. Usado por algunos plugins.';
diff --git a/lib/plugins/authad/lang/fa/lang.php b/lib/plugins/authad/lang/fa/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..1ea73cfdb451e7556892a1a4cd927dd33b0b841d
--- /dev/null
+++ b/lib/plugins/authad/lang/fa/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Hamid <zarrabi@sharif.edu>
+ */
+$lang['domain']                = 'دامنه‌ی ورود';
diff --git a/lib/plugins/authad/lang/fr/lang.php b/lib/plugins/authad/lang/fr/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..2de362e41dd4b60f3d40124e6a572df301a24821
--- /dev/null
+++ b/lib/plugins/authad/lang/fr/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author ggallon <gwenael.gallon@mac.com>
+ */
+$lang['domain']                = 'Domaine de connexion';
diff --git a/lib/plugins/authad/lang/hr/lang.php b/lib/plugins/authad/lang/hr/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..f750c91b5379545d53d703dbcbcd5c3e9df623c4
--- /dev/null
+++ b/lib/plugins/authad/lang/hr/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Davor Turkalj <turki.bsc@gmail.com>
+ */
+$lang['domain']                = 'Domena za prijavu';
diff --git a/lib/plugins/authad/lang/hr/settings.php b/lib/plugins/authad/lang/hr/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..a024b10b7e9b06d9a4224ee8a8c369f882425134
--- /dev/null
+++ b/lib/plugins/authad/lang/hr/settings.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Davor Turkalj <turki.bsc@gmail.com>
+ */
+$lang['account_suffix']        = 'Vaš sufiks korisničkog imena. Npr. <code>@my.domain.org</code>';
+$lang['base_dn']               = 'Vaš bazni DN. Npr. <code>DC=my,DC=domain,DC=org</code>';
+$lang['domain_controllers']    = 'Zarezom odvojena lista domenskih kontrolera. Npr. <code>srv1.domain.org,srv2.domain.org</code>';
+$lang['admin_username']        = 'Privilegirani korisnik Active Directory-a s pristupom svim korisničkim podacima. Opcionalno, ali potrebno za određene akcije kao što je slanje pretplatničkih poruka.';
+$lang['admin_password']        = 'Lozinka gore navedenoga korisnika.';
+$lang['sso']                   = 'Da li će Single-Sign-On prijava biti korištena preko Kerberosa ili NTLM-a?';
+$lang['sso_charset']           = 'Znakovni set koji će se koristiti Kerberos ili NTLM pri slanju imena korisnika. Prazno za UTF-8 ili latin-1. Zahtjeva iconv ekstenziju.';
+$lang['real_primarygroup']     = 'Da li da se razluči stvarna primarna grupa umjesto pretpostavke da je to "Domain Users" (sporije !).';
+$lang['use_ssl']               = 'Koristi SSL vezu? Ako da, dolje ne koristi TLS!';
+$lang['use_tls']               = 'Koristi TLS vezu? Ako da, gore ne koristi SSL!';
+$lang['debug']                 = 'Prikaži dodatni debug ispis u slučaju greške? ';
+$lang['expirywarn']            = 'Upozori korisnike o isteku lozinke ovoliko dana. 0 za onemogućavanje. ';
+$lang['additional']            = 'Zarezom odvojena lista dodatnih AD atributa koji se dohvaćaju iz korisničkih podataka. Koristi se u nekim dodatcima (plugin).';
diff --git a/lib/plugins/authad/lang/hu/lang.php b/lib/plugins/authad/lang/hu/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..7bb6084b0e2d0c270bb08560ec6b40e1c9996737
--- /dev/null
+++ b/lib/plugins/authad/lang/hu/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Marton Sebok <sebokmarton@gmail.com>
+ */
+$lang['domain']                = 'Bejelentkezési tartomány';
diff --git a/lib/plugins/authad/lang/ja/lang.php b/lib/plugins/authad/lang/ja/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..b40aa5da39437c18ead598bb5d306f0df038f4ed
--- /dev/null
+++ b/lib/plugins/authad/lang/ja/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author PzF_X <jp_minecraft@yahoo.co.jp>
+ */
+$lang['domain']                = 'ログオン時のドメイン';
diff --git a/lib/plugins/authad/lang/ja/settings.php b/lib/plugins/authad/lang/ja/settings.php
index f308249ef4d0701080f18b5df9a518b712070989..118e8348cda5d8306be6674ed499fbd6fcc27c83 100644
--- a/lib/plugins/authad/lang/ja/settings.php
+++ b/lib/plugins/authad/lang/ja/settings.php
@@ -5,6 +5,7 @@
  * 
  * @author Satoshi Sahara <sahara.satoshi@gmail.com>
  * @author Hideaki SAWADA <chuno@live.jp>
+ * @author PzF_X <jp_minecraft@yahoo.co.jp>
  */
 $lang['account_suffix']        = 'アカウントの接尾語。例:<code>@my.domain.org</code>';
 $lang['base_dn']               = 'ベースDN。例:<code>DC=my,DC=domain,DC=org</code>';
@@ -12,6 +13,7 @@ $lang['domain_controllers']    = 'ドメインコントローラのカンマ区
 $lang['admin_username']        = '全ユーザーデータへのアクセス権のある特権Active Directoryユーザー。任意ですが、メール通知の登録等の特定の動作に必要。';
 $lang['admin_password']        = '上記ユーザーのパスワード';
 $lang['sso']                   = 'Kerberos か NTLM を使ったシングルサインオン(SSO)をしますか?';
+$lang['sso_charset']           = 'サーバーは空のUTF-8かLatin-1でKerberosかNTLMユーザネームを送信します。iconv拡張モジュールが必要です。';
 $lang['real_primarygroup']     = '"Domain Users" を仮定する代わりに本当のプライマリグループを解決する(低速)';
 $lang['use_ssl']               = 'SSL接続を使用しますか?使用した場合、下のSSLを有効にしないでください。';
 $lang['use_tls']               = 'TLS接続を使用しますか?使用した場合、上のSSLを有効にしないでください。';
diff --git a/lib/plugins/authad/lang/ko/lang.php b/lib/plugins/authad/lang/ko/lang.php
index 1aa436708df72cdd246bd195ebde60edf02d0946..5a2416b2c9028314b7b2923d9335c24ee3b82dbb 100644
--- a/lib/plugins/authad/lang/ko/lang.php
+++ b/lib/plugins/authad/lang/ko/lang.php
@@ -1,10 +1,8 @@
 <?php
+
 /**
- * Korean language file for addomain plugin
- *
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Myeongjin <aranet100@gmail.com>
  */
-
-$lang['domain'] = '로그온 도메인';
-
-//Setup VIM: ex: et ts=4 :
+$lang['domain']                = '로그온 도메인';
diff --git a/lib/plugins/authad/lang/lv/lang.php b/lib/plugins/authad/lang/lv/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..74becf756b55190068fe3859c1a59b9542d6049b
--- /dev/null
+++ b/lib/plugins/authad/lang/lv/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Aivars Miška <allefm@gmail.com>
+ */
+$lang['domain']                = 'Iežurnālēšanās domēns';
diff --git a/lib/plugins/authad/lang/lv/settings.php b/lib/plugins/authad/lang/lv/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..5272d27d0521fc62e1a8fc9bc52b52d197c16217
--- /dev/null
+++ b/lib/plugins/authad/lang/lv/settings.php
@@ -0,0 +1,11 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Aivars Miška <allefm@gmail.com>
+ */
+$lang['account_suffix']        = 'Jūsu konta sufikss. Piemēram, <code>@my.domain.org</code>';
+$lang['domain_controllers']    = 'Ar komatiem atdalīts domēna kontroleru saraksts. Piemēram, <code>srv1.domain.org,srv2.domain.org</code>';
+$lang['admin_password']        = 'Minētā lietotāja parole.';
+$lang['expirywarn']            = 'Cik dienas iepriekš brīdināt lietotāju par paroles termiņa beigām. Ierakstīt 0, lai atspējotu.';
diff --git a/lib/plugins/authad/lang/pl/settings.php b/lib/plugins/authad/lang/pl/settings.php
index 4e397fc980a8b872bc9ec71e6131f2a320ddc19a..91cadca6fa7b3d51cb8f7410b121fe7b4303763f 100644
--- a/lib/plugins/authad/lang/pl/settings.php
+++ b/lib/plugins/authad/lang/pl/settings.php
@@ -5,6 +5,7 @@
  * 
  * @author Tomasz Bosak <bosak.tomasz@gmail.com>
  * @author Paweł Jan Czochański <czochanski@gmail.com>
+ * @author Mati <mackosa@wp.pl>
  */
 $lang['account_suffix']        = 'Przyrostek twojej nazwy konta np. <code>@my.domain.org</code>';
 $lang['base_dn']               = 'Twoje bazowe DN. Na przykład: <code>DC=my,DC=domain,DC=org</code>';
diff --git a/lib/plugins/authad/lang/pt-br/lang.php b/lib/plugins/authad/lang/pt-br/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..5fa963d4e2a2e8ea8e7be760f35c82f5b030f6c1
--- /dev/null
+++ b/lib/plugins/authad/lang/pt-br/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Felipe Castro <fefcas@gmail.com>
+ */
+$lang['domain']                = 'Domínio de "Logon"';
diff --git a/lib/plugins/authad/lang/pt/lang.php b/lib/plugins/authad/lang/pt/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..f307bc901182de18b61b8841257886494b6c96e4
--- /dev/null
+++ b/lib/plugins/authad/lang/pt/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Paulo Silva <paulotsilva@yahoo.com>
+ */
+$lang['domain']                = 'Domínio de Início de Sessão';
diff --git a/lib/plugins/authad/lang/pt/settings.php b/lib/plugins/authad/lang/pt/settings.php
index 45eff5e96c35e31f3e0ffe395b63e1e7d1080bea..dc60d7259eb733398ea96190a4afb7a5305bade7 100644
--- a/lib/plugins/authad/lang/pt/settings.php
+++ b/lib/plugins/authad/lang/pt/settings.php
@@ -4,7 +4,12 @@
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
  * @author André Neves <drakferion@gmail.com>
+ * @author Murilo <muriloricci@hotmail.com>
+ * @author Paulo Silva <paulotsilva@yahoo.com>
  */
+$lang['account_suffix']        = 'O sufixo da sua conta. Por exemplo, <code>@my.domain.org</code>';
+$lang['domain_controllers']    = 'Uma lista separada por vírgulas de Controladores de Domínio (AD DC). Ex.: <code>srv1.domain.org,srv2.domain.org</code>';
+$lang['admin_username']        = 'Um utilizador com privilégios na Active Directory que tenha acesso aos dados de todos os outros utilizadores. Opcional, mas necessário para certas ações como enviar emails de subscrição.';
 $lang['admin_password']        = 'A senha para o utilizador acima.';
 $lang['sso']                   = 'Deve ser usado o Single-Sign-On via Kerberos ou NTLM?';
 $lang['use_ssl']               = 'Usar ligação SSL? Se usada, não ative TLS abaixo.';
diff --git a/lib/plugins/authad/lang/ru/settings.php b/lib/plugins/authad/lang/ru/settings.php
index e662300d7f8b0795c12149e9f7feed5c14253426..c9c6d9f886a556b77d44b6275c403abc66fd047e 100644
--- a/lib/plugins/authad/lang/ru/settings.php
+++ b/lib/plugins/authad/lang/ru/settings.php
@@ -7,7 +7,9 @@
  * @author Aleksandr Selivanov <alexgearbox@gmail.com>
  * @author Artur <ncuxxx@gmail.com>
  * @author Erli Moen <evseev.jr@gmail.com>
+ * @author Владимир <id37736@yandex.ru>
  */
+$lang['account_suffix']        = 'Суффикс вашего аккаунта типа  <code>@my.domain.org</code>';
 $lang['domain_controllers']    = 'Список DNS-серверов, разделенных запятой. Например:<code>srv1.domain.org,srv2.domain.org</code>';
 $lang['admin_password']        = 'Пароль для указанного пользователя.';
 $lang['sso']                   = 'Использовать SSO (Single-Sign-On) через Kerberos или NTLM?';
diff --git a/lib/plugins/authad/lang/sl/settings.php b/lib/plugins/authad/lang/sl/settings.php
index bae467d6da61d0c65e0548bde5b4bf8e57c78b18..5849ea43136770cb353a045157fe3dbff52b84e3 100644
--- a/lib/plugins/authad/lang/sl/settings.php
+++ b/lib/plugins/authad/lang/sl/settings.php
@@ -4,5 +4,8 @@
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
  * @author matej <mateju@svn.gnome.org>
+ * @author Jernej Vidmar <jernej.vidmar@vidmarboehm.com>
  */
+$lang['admin_password']        = 'Geslo zgoraj omenjenega uporabnika';
+$lang['use_tls']               = 'Uporabi TLS povezavo? Če da, ne vključi SSL povezave zgoraj.';
 $lang['debug']                 = 'Ali naj bodo prikazane dodatne podrobnosti napak?';
diff --git a/lib/plugins/authad/lang/zh-tw/lang.php b/lib/plugins/authad/lang/zh-tw/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..6ad0947a233e80db7e07e86c1e0eeb0380ca8747
--- /dev/null
+++ b/lib/plugins/authad/lang/zh-tw/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author June-Hao Hou <junehao@gmail.com>
+ */
+$lang['domain']                = '登入網域';
diff --git a/lib/plugins/authad/lang/zh-tw/settings.php b/lib/plugins/authad/lang/zh-tw/settings.php
index bd5d9413a834b4e1d30b5df04119fc3d3d47dd9e..42cd8c96b6a1dfa1d8deb547d1b33a6605f05f8a 100644
--- a/lib/plugins/authad/lang/zh-tw/settings.php
+++ b/lib/plugins/authad/lang/zh-tw/settings.php
@@ -4,6 +4,7 @@
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
  * @author syaoranhinata@gmail.com
+ * @author June-Hao Hou <junehao@gmail.com>
  */
 $lang['account_suffix']        = '您的帳號後綴。如: <code>@my.domain.org</code>';
 $lang['base_dn']               = '您的基本識別名。如: <code>DC=my,DC=domain,DC=org</code>';
@@ -11,6 +12,7 @@ $lang['domain_controllers']    = '以逗號分隔的域名控制器列表。如
 $lang['admin_username']        = 'Active Directory 的特權使用者,可以查看所有使用者的數據。(非必要,但對發送訂閱郵件等活動來說,這是必須的。)';
 $lang['admin_password']        = '上述使用者的密碼。';
 $lang['sso']                   = '是否使用 Kerberos 或 NTLM 的單一登入系統 (Single-Sign-On)?';
+$lang['sso_charset']           = '你的網站伺服器傳遞 Kerberos 或 NTML 帳號名稱所用的語系編碼。空白表示 UTF-8 或 latin-1。此設定需要用到 iconv 套件。';
 $lang['real_primarygroup']     = '是否視作真正的主要群組,而不是假設為網域使用者 (比較慢)';
 $lang['use_ssl']               = '使用 SSL 連接嗎?如果要使用,請不要啟用下方的 TLS。';
 $lang['use_tls']               = '使用 TLS 連接嗎?如果要使用,請不要啟用上方的 SSL。';
diff --git a/lib/plugins/authad/lang/zh/lang.php b/lib/plugins/authad/lang/zh/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..2a05aa1682e467f181bb7b7a3ca428f3d63dc6b2
--- /dev/null
+++ b/lib/plugins/authad/lang/zh/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author lainme <lainme993@gmail.com>
+ */
+$lang['domain']                = '登录域';
diff --git a/lib/plugins/authad/plugin.info.txt b/lib/plugins/authad/plugin.info.txt
index 8774fcf3cd8f57a6168ba356dc52abbb0c2dd78a..dc06291896e66d3a3fdc13187cc7556caabd6135 100644
--- a/lib/plugins/authad/plugin.info.txt
+++ b/lib/plugins/authad/plugin.info.txt
@@ -1,7 +1,7 @@
 base   authad
 author Andreas Gohr
 email  andi@splitbrain.org
-date   2014-02-14
+date   2014-04-03
 name   Active Directory Auth Plugin
 desc   Provides user authentication against a Microsoft Active Directory
 url    http://www.dokuwiki.org/plugin:authad
diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php
index 6c3637e157049faebbaf8a8b407630f6a8a57262..b22b82ecc6fd2ba0b736dd0fbb33f1b46aa16bed 100644
--- a/lib/plugins/authldap/auth.php
+++ b/lib/plugins/authldap/auth.php
@@ -36,8 +36,8 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
             return;
         }
 
-        // auth_ldap currently just handles authentication, so no
-        // capabilities are set
+        // Add the capabilities to change the password
+        $this->cando['modPass'] = true;
     }
 
     /**
@@ -103,7 +103,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
             return true;
         } else {
             // See if we can find the user
-            $info = $this->getUserData($user, true);
+            $info = $this->_getUserData($user, true);
             if(empty($info['dn'])) {
                 return false;
             } else {
@@ -145,11 +145,20 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
      * @author  Stephane Chazelas <stephane.chazelas@emerson.com>
      * @author  Steffen Schoch <schoch@dsb.net>
      *
+     * @param   string $user
+     * @param   bool   $requireGroups (optional) - ignored, groups are always supplied by this plugin
+     * @return  array containing user data or false
+     */
+    public function getUserData($user, $requireGroups=true) {
+        return $this->_getUserData($user);
+    }
+
+    /**
      * @param   string $user
      * @param   bool   $inbind authldap specific, true if in bind phase
      * @return  array containing user data or false
      */
-    public function getUserData($user, $inbind = false) {
+    protected function _getUserData($user, $inbind = false) {
         global $conf;
         if(!$this->_openLDAP()) return false;
 
@@ -263,6 +272,62 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
         return $info;
     }
 
+    /**
+     * Definition of the function modifyUser in order to modify the password
+     */
+
+    function modifyUser($user,$changes){
+
+        // open the connection to the ldap
+        if(!$this->_openLDAP()){
+            msg('LDAP cannot connect: '. htmlspecialchars(ldap_error($this->con)));
+            return false;
+        }
+
+        // find the information about the user, in particular the "dn"
+        $info = $this->getUserData($user,true);
+        if(empty($info['dn'])) {
+            msg('LDAP cannot find your user dn');
+            return false;
+        }
+        $dn = $info['dn'];
+
+        // find the old password of the user
+        list($loginuser,$loginsticky,$loginpass) = auth_getCookie();
+        if ($loginuser !== null) { // the user is currently logged in
+            $secret = auth_cookiesalt(!$loginsticky, true);
+            $pass   = auth_decrypt($loginpass, $secret);
+
+            // bind with the ldap
+            if(!@ldap_bind($this->con, $dn, $pass)){
+                msg('LDAP user bind failed: '. htmlspecialchars($dn) .': '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
+                return false;
+            }
+        } elseif ($this->getConf('binddn') && $this->getConf('bindpw')) {
+            // we are changing the password on behalf of the user (eg: forgotten password)
+            // bind with the superuser ldap
+            if (!@ldap_bind($this->con, $this->getConf('binddn'), $this->getConf('bindpw'))){
+                $this->_debug('LDAP bind as superuser: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
+                return false;
+            }
+        }
+        else {
+            return false; // no otherway
+        }
+
+        // Generate the salted hashed password for LDAP
+        $phash = new PassHash();
+        $hash = $phash->hash_ssha($changes['pass']);
+
+        // change the password
+        if(!@ldap_mod_replace($this->con, $dn,array('userpassword' => $hash))){
+            msg('LDAP mod replace failed: '. htmlspecialchars($dn) .': '.htmlspecialchars(ldap_error($this->con)));
+            return false;
+        }
+
+        return true;
+    }
+
     /**
      * Most values in LDAP are case-insensitive
      *
diff --git a/lib/plugins/authldap/lang/es/settings.php b/lib/plugins/authldap/lang/es/settings.php
index f8c3ad01408938882dcfb3f36004f26195a0435f..6991546d3227bf7b3cb679cde7d31251ede21088 100644
--- a/lib/plugins/authldap/lang/es/settings.php
+++ b/lib/plugins/authldap/lang/es/settings.php
@@ -4,8 +4,22 @@
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
  * @author Antonio Bueno <atnbueno@gmail.com>
+ * @author Eloy <ej.perezgomez@gmail.com>
  */
+$lang['server']                = 'Tu servidor LDAP. Puede ser el nombre del host  (<code>localhost</code>) o una URL completa (<code>ldap://server.tld:389</code>)';
+$lang['port']                  = 'Servidor LDAP en caso de que no se diera la URL completa anteriormente.';
+$lang['usertree']              = 'Donde encontrar cuentas de usuario. Ej. <code>ou=People, dc=server, dc=tld</code>';
+$lang['grouptree']             = 'Donde encontrar grupos de usuarios. Ej. <code>ou=Group, dc=server, dc=tld</code>';
+$lang['userfilter']            = 'Filtro LDAP para la busqueda de cuentas de usuario. P. E. <code>(&amp;(uid=%{user})(objectClass=posixAccount))</code>';
+$lang['groupfilter']           = 'Filtro LDAP para la busqueda de grupos. P. E. <code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
+$lang['version']               = 'La versión del protocolo a usar. Puede que necesites poner esto a <code>3</code>';
 $lang['starttls']              = 'Usar conexiones TLS?';
+$lang['referrals']             = '¿Deben ser seguidas las referencias?';
+$lang['deref']                 = '¿Cómo desreferenciar los alias?';
+$lang['bindpw']                = 'Contraseña del usuario de arriba.';
+$lang['userscope']             = 'Limitar ámbito de búsqueda para búsqueda de usuarios';
+$lang['groupscope']            = 'Limitar ámbito de búsqueda para búsqueda de grupos';
+$lang['groupkey']              = 'Pertenencia al grupo desde cualquier atributo de usuario (en lugar de grupos AD estándar) p.e., grupo a partir departamento o número de teléfono';
 $lang['debug']                 = 'Mostrar información adicional para depuración de errores';
 $lang['deref_o_0']             = 'LDAP_DEREF_NEVER';
 $lang['deref_o_1']             = 'LDAP_DEREF_SEARCHING';
diff --git a/lib/plugins/authldap/lang/et/settings.php b/lib/plugins/authldap/lang/et/settings.php
index 9bba85dda523ea9907037f38c20dfee93c3a040b..f4933b6bf6b15d0c1be608d927b0885a8b03edd7 100644
--- a/lib/plugins/authldap/lang/et/settings.php
+++ b/lib/plugins/authldap/lang/et/settings.php
@@ -5,5 +5,5 @@
  * 
  * @author Janar Leas <janar.leas@eesti.ee>
  */
-$lang['grouptree']             = 'Kus kohast kasutaja rühmi otsida. Nt. <code>ou=Rühm, dc=server, dc=tld</code';
+$lang['grouptree']             = 'Kus kohast kasutaja rühmi otsida. Nt. <code>ou=Rühm, dc=server, dc=tld</code>';
 $lang['groupscope']            = 'Piiritle otsingu ulatus rühma otsinguga';
diff --git a/lib/plugins/authldap/lang/hr/settings.php b/lib/plugins/authldap/lang/hr/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..cb8df7218cc9bf64ccf4019d6c157eaac88a508c
--- /dev/null
+++ b/lib/plugins/authldap/lang/hr/settings.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Davor Turkalj <turki.bsc@gmail.com>
+ */
+$lang['server']                = 'Vaš LDAP server. Upišite ili naziv računala (<code>localhost</code>) ili puni URL (<code>ldap://server.tld:389</code>)';
+$lang['port']                  = 'LDAP server port, ako gore nije specificiran puni URL.';
+$lang['usertree']              = 'Gdje da nađem korisničke prijave. Npr. <code>ou=People, dc=server, dc=tld</code>';
+$lang['grouptree']             = 'Gdje da nađem korisničke grupe. Npr. <code>ou=Group, dc=server, dc=tld</code>';
+$lang['userfilter']            = 'LDAP filter za pretragu korisničkih prijava. Npr. <code>(&amp;(uid=%{user})(objectClass=posixAccount))</code>';
+$lang['groupfilter']           = 'LDAP filter za pretragu grupa. Npr. <code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
+$lang['version']               = 'Protokol koji se koristi. Možda će te trebati postaviti na <code>3</code>';
+$lang['starttls']              = 'Korisni TLS vezu?';
+$lang['referrals']             = 'Da li da slijedim uputnice?';
+$lang['deref']                 = 'Kako da razlikujem aliase?';
+$lang['binddn']                = 'DN opcionalnog korisnika ako anonimni korisnik nije dovoljan. Npr. <code>cn=admin, dc=my, dc=home</code>';
+$lang['bindpw']                = 'Lozinka gore navedenog korisnika';
+$lang['userscope']             = 'Ograniči područje za pretragu korisnika';
+$lang['groupscope']            = 'Ograniči područje za pretragu grupa';
+$lang['groupkey']              = 'ÄŒlanstvo grupa iz svih atributa korisnika (umjesto standardnih AD grupa) npr. grupa iz odjela ili telefonskog broja';
+$lang['debug']                 = 'Prikaži dodatne informacije u slučaju greške';
+$lang['deref_o_0']             = 'LDAP_DEREF_NEVER';
+$lang['deref_o_1']             = 'LDAP_DEREF_SEARCHING';
+$lang['deref_o_2']             = 'LDAP_DEREF_FINDING';
+$lang['deref_o_3']             = 'LDAP_DEREF_ALWAYS';
diff --git a/lib/plugins/authldap/lang/it/settings.php b/lib/plugins/authldap/lang/it/settings.php
index eba7cde6effed460f7487655928032e77a4c95f2..858c694b824373b8b30bd27af52048cbe405081b 100644
--- a/lib/plugins/authldap/lang/it/settings.php
+++ b/lib/plugins/authldap/lang/it/settings.php
@@ -5,6 +5,7 @@
  * 
  * @author Edmondo Di Tucci <snarchio@gmail.com>
  * @author Claudio Lanconelli <lancos@libero.it>
+ * @author Francesco <francesco.cavalli@hotmail.com>
  */
 $lang['server']                = 'Il tuo server LDAP. Inserire o l\'hostname (<code>localhost</code>) oppure un URL completo (<code>ldap://server.tld:389</code>)';
 $lang['port']                  = 'Porta del server LDAP se non è stato fornito un URL completo più sopra.';
@@ -14,6 +15,11 @@ $lang['userfilter']            = 'Filtro per cercare l\'account utente LDAP. Eg.
 $lang['groupfilter']           = 'Filtro per cercare i gruppi LDAP. Eg. <code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
 $lang['version']               = 'Versione protocollo da usare. Pu<code>3</code>';
 $lang['starttls']              = 'Usare la connessione TSL?';
+$lang['deref']                 = 'Come differenziare un alias?';
 $lang['userscope']             = 'Limita il contesto di ricerca per la ricerca degli utenti';
 $lang['groupscope']            = 'Limita il contesto di ricerca per la ricerca dei gruppi';
 $lang['debug']                 = 'In caso di errori mostra ulteriori informazioni di debug';
+$lang['deref_o_0']             = 'LDAP_DEREF_NEVER';
+$lang['deref_o_1']             = 'LDAP_DEREF_SEARCHING';
+$lang['deref_o_2']             = 'LDAP_DEREF_FINDING';
+$lang['deref_o_3']             = 'LDAP_DEREF_ALWAYS';
diff --git a/lib/plugins/authldap/lang/ja/settings.php b/lib/plugins/authldap/lang/ja/settings.php
index 6dec9a5768b0f3705e1dd9201cee9ba78a346798..6cff0ea67a1a25a1f3e89339057ea7e56e7ad79e 100644
--- a/lib/plugins/authldap/lang/ja/settings.php
+++ b/lib/plugins/authldap/lang/ja/settings.php
@@ -6,8 +6,9 @@
  * @author Satoshi Sahara <sahara.satoshi@gmail.com>
  * @author Hideaki SAWADA <sawadakun@live.jp>
  * @author Hideaki SAWADA <chuno@live.jp>
+ * @author PzF_X <jp_minecraft@yahoo.co.jp>
  */
-$lang['server']                = 'LDAPサーバー。ホスト名(<code>localhost</code)又は完全修飾URL(<code>ldap://server.tld:389</code>)';
+$lang['server']                = 'LDAPサーバー。ホスト名(<code>localhost</code>)又は完全修飾URL(<code>ldap://server.tld:389</code>)';
 $lang['port']                  = '上記が完全修飾URLでない場合、LDAPサーバーポート';
 $lang['usertree']              = 'ユーザーアカウントを探す場所。例:<code>ou=People, dc=server, dc=tld</code>';
 $lang['grouptree']             = 'ユーザーグループを探す場所。例:<code>ou=Group, dc=server, dc=tld</code>';
@@ -15,8 +16,14 @@ $lang['userfilter']            = 'ユーザーアカウントを探すためのL
 $lang['groupfilter']           = 'グループを探すLDAP抽出条件。例:<code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
 $lang['version']               = '使用するプロトコルのバージョン。<code>3</code>を設定する必要がある場合があります。';
 $lang['starttls']              = 'TLS接続を使用しますか?';
+$lang['referrals']             = '紹介に従いますか?';
+$lang['deref']                 = 'どのように間接参照のエイリアスにしますか?';
 $lang['binddn']                = '匿名バインドでは不十分な場合、オプションバインドユーザーのDN。例:<code>cn=admin, dc=my, dc=home</code>';
 $lang['bindpw']                = '上記ユーザーのパスワード';
+$lang['userscope']             = 'ユーザー検索の範囲を限定させる';
+$lang['groupscope']            = 'グループ検索の範囲を限定させる';
+$lang['groupkey']              = 'ユーザー属性をグループのメンバーシップから設定します(代わりに標準のADグループ)。
+例えば、部署や電話番号などです。';
 $lang['debug']                 = 'エラーに関して追加のデバッグ情報を表示する。';
 $lang['deref_o_0']             = 'LDAP_DEREF_NEVER';
 $lang['deref_o_1']             = 'LDAP_DEREF_SEARCHING';
diff --git a/lib/plugins/authldap/lang/ko/settings.php b/lib/plugins/authldap/lang/ko/settings.php
index ae8dc7ab6b860007c028e34f6ede1b3fe7f774c2..e663ba0633fbec77721a6910565c3449c5be9f76 100644
--- a/lib/plugins/authldap/lang/ko/settings.php
+++ b/lib/plugins/authldap/lang/ko/settings.php
@@ -13,8 +13,8 @@ $lang['userfilter']            = '사용자 계정을 찾을 LDAP 필터. 예를
 $lang['groupfilter']           = '그룹을 찾을 LDAP 필터. 예를 들어 <code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
 $lang['version']               = '사용할 프로토콜 버전. <code>3</code>으로 설정해야 할 수도 있습니다';
 $lang['starttls']              = 'TLS 연결을 사용하겠습니까?';
-$lang['referrals']             = '참고(referrals)를 허용하겠습니까? ';
-$lang['deref']                 = '어떻게 별명을 간접 참고하겠습니까?';
+$lang['referrals']             = '참조(referrals)를 허용하겠습니까? ';
+$lang['deref']                 = '어떻게 별명을 간접 참조하겠습니까?';
 $lang['binddn']                = '익명 바인드가 충분하지 않으면 선택적인 바인드 사용자의 DN. 예를 들어 <code>cn=admin, dc=my, dc=home</code>';
 $lang['bindpw']                = '위 사용자의 비밀번호';
 $lang['userscope']             = '사용자 검색에 대한 검색 범위 제한';
diff --git a/lib/plugins/authldap/lang/lv/settings.php b/lib/plugins/authldap/lang/lv/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..90986e4f130b6531a42e6f23b5b6ff9c4571defc
--- /dev/null
+++ b/lib/plugins/authldap/lang/lv/settings.php
@@ -0,0 +1,9 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Aivars Miška <allefm@gmail.com>
+ */
+$lang['starttls']              = 'Lietot TLS  savienojumus?';
+$lang['bindpw']                = 'Lietotāja parole';
diff --git a/lib/plugins/authldap/lang/ru/settings.php b/lib/plugins/authldap/lang/ru/settings.php
index 04a3ee7840eba5be6902cc47a1f5c8c9eae42ba8..5677e06a31c0b5cfdf795f34c4245ab6204be296 100644
--- a/lib/plugins/authldap/lang/ru/settings.php
+++ b/lib/plugins/authldap/lang/ru/settings.php
@@ -7,9 +7,12 @@
  * @author Aleksandr Selivanov <alexgearbox@gmail.com>
  * @author Erli Moen <evseev.jr@gmail.com>
  * @author Aleksandr Selivanov <alexgearbox@yandex.ru>
+ * @author Владимир <id37736@yandex.ru>
  */
+$lang['starttls']              = 'Использовать TLS подключения?';
 $lang['deref']                 = 'Как расшифровывать псевдонимы?';
 $lang['bindpw']                = 'Пароль для указанного пользователя.';
+$lang['debug']                 = 'Показывать дополнительную отладочную информацию при ошибках';
 $lang['deref_o_0']             = 'LDAP_DEREF_NEVER';
 $lang['deref_o_1']             = 'LDAP_DEREF_SEARCHING';
 $lang['deref_o_2']             = 'LDAP_DEREF_FINDING';
diff --git a/lib/plugins/authldap/lang/sl/settings.php b/lib/plugins/authldap/lang/sl/settings.php
index f180226fc1f5f790839c86aded479ca8bddd0d24..f630703904e0a3dd28db3ed2d6efbcde04859cb6 100644
--- a/lib/plugins/authldap/lang/sl/settings.php
+++ b/lib/plugins/authldap/lang/sl/settings.php
@@ -4,5 +4,7 @@
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
  * @author matej <mateju@svn.gnome.org>
+ * @author Jernej Vidmar <jernej.vidmar@vidmarboehm.com>
  */
 $lang['starttls']              = 'Ali naj se uporabijo povezave TLS?';
+$lang['bindpw']                = 'Geslo uporabnika zgoraj';
diff --git a/lib/plugins/authldap/lang/tr/settings.php b/lib/plugins/authldap/lang/tr/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..843b7ef9c1e3e04d594219a0f2edaa389bb99da0
--- /dev/null
+++ b/lib/plugins/authldap/lang/tr/settings.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author ilker rifat kapaç <irifat@gmail.com>
+ */
+$lang['bindpw']                = 'Üstteki kullanıcının şifresi';
diff --git a/lib/plugins/authldap/lang/zh-tw/settings.php b/lib/plugins/authldap/lang/zh-tw/settings.php
index 7e35ef63216dfcf81322924251d2fafda6f77152..e3d85cb873e532e2f6be164763620fc73433170a 100644
--- a/lib/plugins/authldap/lang/zh-tw/settings.php
+++ b/lib/plugins/authldap/lang/zh-tw/settings.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
@@ -19,7 +20,6 @@ $lang['userscope']             = '限制使用者搜索的範圍';
 $lang['groupscope']            = '限制群組搜索的範圍';
 $lang['groupkey']              = '以其他使用者屬性 (而非標準 AD 群組) 來把使用者分組,例如以部門或電話號碼分類';
 $lang['debug']                 = '有錯誤時,顯示額外除錯資訊';
-
 $lang['deref_o_0']             = 'LDAP_DEREF_NEVER';
 $lang['deref_o_1']             = 'LDAP_DEREF_SEARCHING';
 $lang['deref_o_2']             = 'LDAP_DEREF_FINDING';
diff --git a/lib/plugins/authldap/plugin.info.txt b/lib/plugins/authldap/plugin.info.txt
index 0d0b13f6553041cb651fb3b1cd9822db675cabaf..964fbb99453718d2e1a5702cbd61464543a32084 100644
--- a/lib/plugins/authldap/plugin.info.txt
+++ b/lib/plugins/authldap/plugin.info.txt
@@ -1,7 +1,7 @@
 base   authldap
 author Andreas Gohr
 email  andi@splitbrain.org
-date   2013-04-19
+date   2014-05-18
 name   LDAP Auth Plugin
 desc   Provides user authentication against an LDAP server
 url    http://www.dokuwiki.org/plugin:authldap
diff --git a/lib/plugins/authmysql/auth.php b/lib/plugins/authmysql/auth.php
index 1e6e6a4a97eb49ee1451627d6f8d0345e700ef39..95c62f6369ef2be429fda29acff63060ae3a6a40 100644
--- a/lib/plugins/authmysql/auth.php
+++ b/lib/plugins/authmysql/auth.php
@@ -21,6 +21,9 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
     /** @var int database subrevision */
     protected $dbsub = 0;
 
+    /** @var array cache to avoid re-reading user info data */
+    protected $cacheUserInfo = array();
+
     /**
      * Constructor
      *
@@ -157,10 +160,11 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
             $result = $this->_queryDB($sql);
 
             if($result !== false && count($result) == 1) {
-                if($this->getConf('forwardClearPass') == 1)
+                if($this->getConf('forwardClearPass') == 1) {
                     $rc = true;
-                else
+                } else {
                     $rc = auth_verifyPassword($pass, $result[0]['pass']);
+                }
             }
             $this->_closeDB();
         }
@@ -174,16 +178,23 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
      * @author  Matthias Grimm <matthiasgrimm@users.sourceforge.net>
      *
      * @param string $user user login to get data for
+     * @param bool $requireGroups  when true, group membership information should be included in the returned array;
+     *                             when false, it maybe included, but is not required by the caller
      * @return array|bool
      */
-    public function getUserData($user) {
+    public function getUserData($user, $requireGroups=true) {
+        if($this->_cacheExists($user, $requireGroups)) {
+            return $this->cacheUserInfo[$user];
+        }
+
         if($this->_openDB()) {
             $this->_lockTables("READ");
-            $info = $this->_getUserInfo($user);
+            $info = $this->_getUserInfo($user, $requireGroups);
             $this->_unlockTables();
             $this->_closeDB();
-        } else
+        } else {
             $info = false;
+        }
         return $info;
     }
 
@@ -209,12 +220,14 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
         global $conf;
 
         if($this->_openDB()) {
-            if(($info = $this->_getUserInfo($user)) !== false)
+            if(($info = $this->_getUserInfo($user)) !== false) {
                 return false; // user already exists
+            }
 
             // set defaultgroup if no groups were given
-            if($grps == null)
+            if($grps == null) {
                 $grps = array($conf['defaultgroup']);
+            }
 
             $this->_lockTables("WRITE");
             $pwd = $this->getConf('forwardClearPass') ? $pwd : auth_cryptPassword($pwd);
@@ -234,17 +247,17 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
      * The dataset update will be rejected if the user name should be changed
      * to an already existing one.
      *
-     * The password must be provides unencrypted. Pasword cryption is done
+     * The password must be provided unencrypted. Pasword encryption is done
      * automatically if configured.
      *
-     * If one or more groups could't be updated, an error would be set. In
+     * If one or more groups can't be updated, an error will be set. In
      * this case the dataset might already be changed and we can't rollback
-     * the changes. Transactions would be really usefull here.
+     * the changes. Transactions would be really useful here.
      *
      * modifyUser() may be called without SQL statements defined that are
      * needed to change group membership (for example if only the user profile
-     * should be modified). In this case we asure that we don't touch groups
-     * even $changes['grps'] is set by mistake.
+     * should be modified). In this case we assure that we don't touch groups
+     * even when $changes['grps'] is set by mistake.
      *
      * @author  Chris Smith <chris@jalakai.co.uk>
      * @author  Matthias Grimm <matthiasgrimm@users.sourceforge.net>
@@ -256,27 +269,30 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
     public function modifyUser($user, $changes) {
         $rc = false;
 
-        if(!is_array($changes) || !count($changes))
+        if(!is_array($changes) || !count($changes)) {
             return true; // nothing to change
+        }
 
         if($this->_openDB()) {
             $this->_lockTables("WRITE");
 
-            if(($uid = $this->_getUserID($user))) {
-                $rc = $this->_updateUserInfo($changes, $uid);
+            $rc = $this->_updateUserInfo($user, $changes);
 
-                if($rc && isset($changes['grps']) && $this->cando['modGroups']) {
-                    $groups = $this->_getGroups($user);
-                    $grpadd = array_diff($changes['grps'], $groups);
-                    $grpdel = array_diff($groups, $changes['grps']);
+            if($rc && isset($changes['grps']) && $this->cando['modGroups']) {
+                $groups = $this->_getGroups($user);
+                $grpadd = array_diff($changes['grps'], $groups);
+                $grpdel = array_diff($groups, $changes['grps']);
 
-                    foreach($grpadd as $group)
-                        if(($this->_addUserToGroup($user, $group, 1)) == false)
-                            $rc = false;
+                foreach($grpadd as $group) {
+                    if(($this->_addUserToGroup($user, $group, 1)) == false) {
+                        $rc = false;
+                    }
+                }
 
-                    foreach($grpdel as $group)
-                        if(($this->_delUserFromGroup($user, $group)) == false)
-                            $rc = false;
+                foreach($grpdel as $group) {
+                    if(($this->_delUserFromGroup($user, $group)) == false) {
+                        $rc = false;
+                    }
                 }
             }
 
@@ -304,8 +320,9 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
             if(is_array($users) && count($users)) {
                 $this->_lockTables("WRITE");
                 foreach($users as $user) {
-                    if($this->_delUser($user))
+                    if($this->_delUser($user)) {
                         $count++;
+                    }
                 }
                 $this->_unlockTables();
             }
@@ -367,9 +384,11 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
             $result = $this->_queryDB($sql);
 
             if(!empty($result)) {
-                foreach($result as $user)
-                    if(($info = $this->_getUserInfo($user['user'])))
+                foreach($result as $user) {
+                    if(($info = $this->_getUserInfo($user['user']))) {
                         $out[$user['user']] = $info;
+                    }
+                }
             }
 
             $this->_unlockTables();
@@ -466,7 +485,10 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
             $sql = str_replace('%{user}', $this->_escape($user), $sql);
             $sql = str_replace('%{gid}', $this->_escape($gid), $sql);
             $sql = str_replace('%{group}', $this->_escape($group), $sql);
-            if($this->_modifyDB($sql) !== false) return true;
+            if($this->_modifyDB($sql) !== false) {
+                $this->_flushUserInfoCache($user);
+                return true;
+            }
 
             if($newgroup) { // remove previously created group on error
                 $sql = str_replace('%{gid}', $this->_escape($gid), $this->getConf('delGroup'));
@@ -501,6 +523,10 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
                 $sql = str_replace('%{gid}', $this->_escape($gid), $sql);
                 $sql = str_replace('%{group}', $this->_escape($group), $sql);
                 $rc  = $this->_modifyDB($sql) == 0 ? true : false;
+
+                if ($rc) {
+                    $this->_flushUserInfoCache($user);
+                }
             }
         }
         return $rc;
@@ -526,8 +552,9 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
             $result = $this->_queryDB($sql);
 
             if($result !== false && count($result)) {
-                foreach($result as $row)
+                foreach($result as $row) {
                     $groups[] = $row['group'];
+                }
             }
             return $groups;
         }
@@ -590,6 +617,7 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
                 }
 
                 if($gid !== false){
+                    $this->_flushUserInfoCache($user);
                     return true;
                 } else {
                     /* remove the new user and all group relations if a group can't
@@ -614,7 +642,7 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
      *
      * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
      *
-     * @param  string $user user whose id is desired
+     * @param  string $user username of the user to be deleted
      * @return bool
      */
     protected function _delUser($user) {
@@ -626,16 +654,96 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
                 $sql = str_replace('%{uid}', $this->_escape($uid), $this->getConf('delUser'));
                 $sql = str_replace('%{user}', $this->_escape($user), $sql);
                 $this->_modifyDB($sql);
+                $this->_flushUserInfoCache($user);
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Flush cached user information
+     *
+     * @author Christopher Smith <chris@jalakai.co.uk>
+     *
+     * @param  string  $user username of the user whose data is to be removed from the cache
+     *                       if null, empty the whole cache
+     * @return none
+     */
+    protected function _flushUserInfoCache($user=null) {
+        if (is_null($user)) {
+            $this->cacheUserInfo = array();
+        } else {
+            unset($this->cacheUserInfo[$user]);
+        }
+    }
+
+    /**
+     * Quick lookup to see if a user's information has been cached
+     *
+     * This test does not need a database connection or read lock
+     *
+     * @author Christopher Smith <chris@jalakai.co.uk>
+     *
+     * @param  string  $user  username to be looked up in the cache
+     * @param  bool    $requireGroups  true, if cached info should include group memberships
+     *
+     * @return bool    existence of required user information in the cache
+     */
+    protected function _cacheExists($user, $requireGroups=true) {
+        if (isset($this->cacheUserInfo[$user])) {
+            if (!is_array($this->cacheUserInfo[$user])) {
+                return true;          // user doesn't exist
+            }
+
+            if (!$requireGroups || isset($this->cacheUserInfo[$user]['grps'])) {
                 return true;
             }
         }
+
         return false;
     }
 
     /**
-     * getUserInfo
+     * Get a user's information
+     *
+     * The database connection must already be established for this function to work.
+     *
+     * @author Christopher Smith <chris@jalakai.co.uk>
+     *
+     * @param  string  $user  username of the user whose information is being reterieved
+     * @param  bool    $requireGroups  true if group memberships should be included
+     * @param  bool    $useCache       true if ok to return cached data & to cache returned data
+     *
+     * @return mixed   false|array     false if the user doesn't exist
+     *                                 array containing user information if user does exist
+     */
+    protected function _getUserInfo($user, $requireGroups=true, $useCache=true) {
+        $info = null;
+
+        if ($useCache && isset($this->cacheUserInfo[$user])) {
+            $info = $this->cacheUserInfo[$user];
+        }
+
+        if (is_null($info)) {
+            $info = $this->_retrieveUserInfo($user);
+        }
+
+        if (($requireGroups == true) && $info && !isset($info['grps'])) {
+            $info['grps'] = $this->_getGroups($user);
+        }
+
+        if ($useCache) {
+            $this->cacheUserInfo[$user] = $info;
+        }
+
+        return $info;
+    }
+
+    /**
+     * retrieveUserInfo
      *
-     * Gets the data for a specific user The database connection
+     * Gets the data for a specific user. The database connection
      * must already be established for this function to work.
      * Otherwise it will return 'false'.
      *
@@ -644,12 +752,11 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
      * @param  string $user  user's nick to get data for
      * @return bool|array false on error, user info on success
      */
-    protected function _getUserInfo($user) {
+    protected function _retrieveUserInfo($user) {
         $sql    = str_replace('%{user}', $this->_escape($user), $this->getConf('getUserInfo'));
         $result = $this->_queryDB($sql);
         if($result !== false && count($result)) {
             $info         = $result[0];
-            $info['grps'] = $this->_getGroups($user);
             return $info;
         }
         return false;
@@ -666,20 +773,26 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
      * The database connection has already to be established for this
      * function to work. Otherwise it will return 'false'.
      *
-     * The password will be crypted if necessary.
+     * The password will be encrypted if necessary.
      *
+     * @param  string $user    user's nick being updated
      * @param  array $changes  array of items to change as pairs of item and value
      * @param  mixed $uid      user id of dataset to change, must be unique in DB
      * @return bool true on success or false on error
      *
      * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
      */
-    protected function _updateUserInfo($changes, $uid) {
+    protected function _updateUserInfo($user, $changes) {
         $sql = $this->getConf('updateUser')." ";
         $cnt = 0;
         $err = 0;
 
         if($this->dbcon) {
+            $uid = $this->_getUserID($user);
+            if ($uid === false) {
+                return false;
+            }
+
             foreach($changes as $item => $value) {
                 if($item == 'user') {
                     if(($this->_getUserID($changes['user']))) {
@@ -707,6 +820,7 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
                     $sql .= " ".str_replace('%{uid}', $uid, $this->getConf('UpdateTarget'));
                     if(get_class($this) == 'auth_mysql') $sql .= " LIMIT 1"; //some PgSQL inheritance comp.
                     $this->_modifyDB($sql);
+                    $this->_flushUserInfoCache($user);
                 }
                 return true;
             }
diff --git a/lib/plugins/authmysql/lang/es/settings.php b/lib/plugins/authmysql/lang/es/settings.php
index 64d422102497f2976472860a03784269e28a4b19..b82620fc60230ab4176f3b1c8229700dbdbe278d 100644
--- a/lib/plugins/authmysql/lang/es/settings.php
+++ b/lib/plugins/authmysql/lang/es/settings.php
@@ -4,9 +4,36 @@
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
  * @author Antonio Bueno <atnbueno@gmail.com>
+ * @author Eloy <ej.perezgomez@gmail.com>
+ * @author Antonio Castilla <antoniocastilla@trazoide.com>
  */
 $lang['server']                = 'Tu servidor MySQL';
 $lang['user']                  = 'Nombre de usuario MySQL';
+$lang['password']              = 'Contraseña para el usuario de arriba.';
 $lang['database']              = 'Base de datos a usar';
 $lang['charset']               = 'Codificación usada en la base de datos';
 $lang['debug']                 = 'Mostrar información adicional para depuración de errores';
+$lang['forwardClearPass']      = 'Enviar las contraseñas de usuario comotexto plano a las siguientes sentencias de SQL, en lugar de utilizar la opción passcrypt';
+$lang['TablesToLock']          = 'Lista separada por comasde las tablas a bloquear durante operaciones de escritura';
+$lang['checkPass']             = 'Sentencia SQL para verificar las contraseñas';
+$lang['getUserInfo']           = 'Sentencia SQL para obtener información del usuario';
+$lang['getGroups']             = 'Sentencia SQL para obtener la pertenencia a grupos de un usuario';
+$lang['getUsers']              = 'Sentencia SQL para listar todos los usuarios';
+$lang['FilterLogin']           = 'Cláusula SQL para filtrar usuarios por su nombre de usuario';
+$lang['FilterName']            = 'Cláusula SQL para filtrar usuarios por su nombre completo';
+$lang['FilterEmail']           = 'Cláusula SQL para filtrar usuarios por su dirección de correo electrónico';
+$lang['FilterGroup']           = 'Cláusula SQL para filtrar usuarios por su pertenencia a grupos';
+$lang['SortOrder']             = 'Cláusula SQL para ordenar usuarios';
+$lang['addUser']               = 'Sentencia SQL para agregar un nuevo usuario';
+$lang['addGroup']              = 'Sentencia SQL para agregar un nuevo grupo';
+$lang['addUserGroup']          = 'Sentencia SQL para agregar un usuario a un grupo existente';
+$lang['delGroup']              = 'Sentencia SQL para eliminar un grupo';
+$lang['getUserID']             = 'Sentencia SQL para obtener la clave primaria de un usuario';
+$lang['delUser']               = 'Sentencia SQL para eliminar un usuario';
+$lang['delUserRefs']           = 'Sentencia SQL para eliminar un usuario de todos los grupos';
+$lang['updateUser']            = 'Sentencia SQL para actualizar un perfil de usuario';
+$lang['delUserGroup']          = 'Sentencia SQL para eliminar un usuario de un grupo dado';
+$lang['getGroupID']            = 'Sentencia SQL para obtener la clave principal de un grupo dado';
+$lang['debug_o_0']             = 'ninguno';
+$lang['debug_o_1']             = 'sólo errores';
+$lang['debug_o_2']             = 'todas las consultas SQL';
diff --git a/lib/plugins/authmysql/lang/fa/settings.php b/lib/plugins/authmysql/lang/fa/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..68ad5ce8374104adaf90a3a769fc92d545f686f3
--- /dev/null
+++ b/lib/plugins/authmysql/lang/fa/settings.php
@@ -0,0 +1,10 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Mohamad Mehdi Habibi <habibi.esf@gmail.com>
+ */
+$lang['server']                = 'سرور MySQL';
+$lang['user']                  = 'نام کاربری MySQL';
+$lang['database']              = 'پایگاه داده مورد استفاده';
diff --git a/lib/plugins/authmysql/lang/hr/settings.php b/lib/plugins/authmysql/lang/hr/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..af99669999e70b86b312caf92167b0a64385ca2c
--- /dev/null
+++ b/lib/plugins/authmysql/lang/hr/settings.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Davor Turkalj <turki.bsc@gmail.com>
+ */
+$lang['server']                = 'Vaš MySQL server';
+$lang['user']                  = 'MySQL korisničko ime';
+$lang['password']              = 'Lozinka gore navedenog korisnika';
+$lang['database']              = 'Baza koja se koristi';
+$lang['charset']               = 'Znakovni set koji se koristi u bazi';
+$lang['debug']                 = 'Prikaz dodatnih debug informacija';
+$lang['forwardClearPass']      = 'Proslijedi korisničku lozinku kao čisti tekst u SQL upitu niže, umjesto korištenja passcrypt opcije';
+$lang['TablesToLock']          = 'Zarezom odvojena lista tabela koje trebaju biti zaključane pri operacijama pisanja';
+$lang['checkPass']             = 'SQL izraz za provjeru lozinki';
+$lang['getUserInfo']           = 'SQL izraz za dohvaćanje informacija o korisniku';
+$lang['getGroups']             = 'SQL izraz za dohvaćanje članstva u grupama';
+$lang['getUsers']              = 'SQL izraz za ispis svih korisnika';
+$lang['FilterLogin']           = 'SQL izraz za izdvajanje korisnika po korisničkom imenu';
+$lang['FilterName']            = 'SQL izraz za izdvajanje korisnika po punom imenu';
+$lang['FilterEmail']           = 'SQL izraz za izdvajanje korisnika po adresi e-pošte';
+$lang['FilterGroup']           = 'SQL izraz za izdvajanje korisnika po članstvu u grupama';
+$lang['SortOrder']             = 'SQL izraz za sortiranje korisnika';
+$lang['addUser']               = 'SQL izraz za dodavanje novih korisnika';
+$lang['addGroup']              = 'SQL izraz za dodavanje novih grupa';
+$lang['addUserGroup']          = 'SQL izraz za dodavanje korisnika u postojeću grupu';
+$lang['delGroup']              = 'SQL izraz za uklanjanje grupe';
+$lang['getUserID']             = 'SQL izraz za dobivanje primarnog ključa korisnika';
+$lang['delUser']               = 'SQL izraz za brisanje korisnika';
+$lang['delUserRefs']           = 'SQL izraz za uklanjanje korisnika iz grupe';
+$lang['updateUser']            = 'SQL izraz za ažuriranje korisničkog profila';
+$lang['UpdateLogin']           = 'UPDATE izraz za ažuriranje korisničkog imena';
+$lang['UpdatePass']            = 'UPDATE izraz za ažuriranje korisničke lozinke';
+$lang['UpdateEmail']           = 'UPDATE izraz za ažuriranje korisničke email adrese';
+$lang['UpdateName']            = 'UPDATE izraz za ažuriranje punog imena korisnika';
+$lang['UpdateTarget']          = 'Limit izraz za identificiranje korisnika pri ažuriranju';
+$lang['delUserGroup']          = 'SQL izraz za uklanjanje korisnika iz zadane grupe';
+$lang['getGroupID']            = 'SQL izraz za dobivanje primarnoga ključa zadane grupe';
+$lang['debug_o_0']             = 'ništa';
+$lang['debug_o_1']             = 'u slučaju greške';
+$lang['debug_o_2']             = 'svi SQL upiti';
diff --git a/lib/plugins/authmysql/lang/it/settings.php b/lib/plugins/authmysql/lang/it/settings.php
index e493ec7e92aacc6dc23a4fe37d15b2c4995acdc3..10c0de96fb49ae7c969de59f790ed8a01c694a30 100644
--- a/lib/plugins/authmysql/lang/it/settings.php
+++ b/lib/plugins/authmysql/lang/it/settings.php
@@ -4,5 +4,34 @@
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
  * @author Claudio Lanconelli <lancos@libero.it>
+ * @author Mirko <malisan.mirko@gmail.com>
+ * @author Francesco <francesco.cavalli@hotmail.com>
  */
+$lang['server']                = 'Il tuo server MySQL';
+$lang['user']                  = 'User name di MySQL';
+$lang['database']              = 'Database da usare';
+$lang['charset']               = 'Set di caratteri usato nel database';
 $lang['debug']                 = 'Mostra ulteriori informazioni di debug';
+$lang['TablesToLock']          = 'Lista, separata da virgola, delle tabelle che devono essere bloccate in scrittura';
+$lang['checkPass']             = 'Istruzione SQL per il controllo password';
+$lang['getUserInfo']           = 'Istruzione SQL per recuperare le informazioni utente';
+$lang['getUsers']              = 'Istruzione SQL per listare tutti gli utenti';
+$lang['FilterLogin']           = 'Istruzione SQL per per filtrare gli utenti in funzione del "login name"';
+$lang['SortOrder']             = 'Istruzione SQL per ordinare gli utenti';
+$lang['addUser']               = 'Istruzione SQL per aggiungere un nuovo utente';
+$lang['addGroup']              = 'Istruzione SQL per aggiungere un nuovo gruppo';
+$lang['addUserGroup']          = 'Istruzione SQL per aggiungere un utente ad un gruppo esistente';
+$lang['delGroup']              = 'Istruzione SQL per imuovere un gruppo';
+$lang['getUserID']             = 'Istruzione SQL per recuperare la primary key di un utente';
+$lang['delUser']               = 'Istruzione SQL per cancellare un utente';
+$lang['delUserRefs']           = 'Istruzione SQL per rimuovere un utente da tutti i gruppi';
+$lang['updateUser']            = 'Istruzione SQL per aggiornare il profilo utente';
+$lang['UpdateLogin']           = 'Clausola per aggiornare il "login name" dell\'utente';
+$lang['UpdatePass']            = 'Clausola per aggiornare la password utente';
+$lang['UpdateEmail']           = 'Clausola per aggiornare l\'email utente';
+$lang['UpdateName']            = 'Clausola per aggiornare il nome completo';
+$lang['delUserGroup']          = 'Istruzione SQL per rimuovere un utente da un dato gruppo';
+$lang['getGroupID']            = 'Istruzione SQL per avere la primary key di un dato gruppo';
+$lang['debug_o_0']             = 'Nulla';
+$lang['debug_o_1']             = 'Solo in errore';
+$lang['debug_o_2']             = 'Tutte le query SQL';
diff --git a/lib/plugins/authmysql/lang/lv/settings.php b/lib/plugins/authmysql/lang/lv/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..8550363c9a15fc78afed6ecee125ce77daba1062
--- /dev/null
+++ b/lib/plugins/authmysql/lang/lv/settings.php
@@ -0,0 +1,10 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Aivars Miška <allefm@gmail.com>
+ */
+$lang['user']                  = 'MySQL lietotāja vārds';
+$lang['password']              = 'Lietotāja parole';
+$lang['delUser']               = 'SQL pieprasījums lietotāja dzēšanai';
diff --git a/lib/plugins/authmysql/lang/pl/settings.php b/lib/plugins/authmysql/lang/pl/settings.php
index 88cbd5d6f2bdb7dc3c9922b647885162173ed597..9dc798ee088ea6868c7f1b59472e590b38c66993 100644
--- a/lib/plugins/authmysql/lang/pl/settings.php
+++ b/lib/plugins/authmysql/lang/pl/settings.php
@@ -4,6 +4,7 @@
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
  * @author Paweł Jan Czochański <czochanski@gmail.com>
+ * @author Mati <mackosa@wp.pl>
  */
 $lang['server']                = 'Twój server MySQL';
 $lang['user']                  = 'Nazwa użytkownika MySQL';
@@ -12,3 +13,4 @@ $lang['database']              = 'Używana baza danych';
 $lang['charset']               = 'Zestaw znaków uzyty w bazie danych';
 $lang['debug']                 = 'Wyświetlaj dodatkowe informacje do debugowania.';
 $lang['checkPass']             = 'Zapytanie SQL wykorzystywane do sprawdzania haseł.';
+$lang['debug_o_2']             = 'wszystkie zapytania SQL';
diff --git a/lib/plugins/authmysql/lang/tr/settings.php b/lib/plugins/authmysql/lang/tr/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..ca6a7c6ad97a29d9821fde26759d629aa9d80698
--- /dev/null
+++ b/lib/plugins/authmysql/lang/tr/settings.php
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author ilker rifat kapaç <irifat@gmail.com>
+ * @author İlker R. Kapaç <irifat@gmail.com>
+ */
+$lang['server']                = 'Sizin MySQL sunucunuz';
+$lang['user']                  = 'MySQL kullanıcısının adı';
+$lang['password']              = 'Üstteki kullanıcı için şifre';
+$lang['database']              = 'Kullanılacak veritabanı';
+$lang['charset']               = 'Veritabanında kullanılacak karakter seti';
+$lang['debug']                 = 'İlave hata ayıklama bilgisini görüntüle';
+$lang['checkPass']             = 'Åžifreleri kontrol eden SQL ifadesi';
+$lang['getUserInfo']           = 'Kullanıcı bilgilerini getiren SQL ifadesi';
+$lang['getGroups']             = 'Kullanıcının grup üyeliklerini getiren SQL ifadesi';
+$lang['getUsers']              = 'Tüm kullanıcıları listeleyen SQL ifadesi';
+$lang['FilterLogin']           = 'Kullanıcıları giriş yaptıkları isimlere göre süzmek için SQL şartı';
+$lang['FilterName']            = 'Kullanıcıları tam isimlerine göre süzmek için SQL şartı';
+$lang['FilterEmail']           = 'Kullanıcıları e-posta adreslerine göre süzmek için SQL şartı';
+$lang['FilterGroup']           = 'Kullanıcıları üye oldukları grup isimlerine göre süzmek için SQL şartı';
+$lang['SortOrder']             = 'Kullanıcıları sıralamak için SQL şartı';
+$lang['addUser']               = 'Yeni bir kullanıcı ekleyen SQL ifadesi';
+$lang['addGroup']              = 'Yeni bir grup ekleyen SQL ifadesi';
+$lang['addUserGroup']          = 'Varolan gruba yeni bir kullanıcı ekleyen SQL ifadesi';
+$lang['delGroup']              = 'Grup silen SQL ifadesi';
+$lang['getUserID']             = 'Kullanıcının birincil anahtarını getiren SQL ifadesi';
+$lang['delUser']               = 'Kullanıcı silen SQL ifadesi';
+$lang['delUserRefs']           = 'Kullanıcıyı tüm gruplardan çıkartan SQL ifadesi';
+$lang['updateUser']            = 'Kullanıcı profilini güncelleyen SQL ifadesi';
+$lang['UpdateLogin']           = 'Kullanıcının giriş yaptığı ismi güncelleyen, güncelleme şartı';
+$lang['UpdatePass']            = 'Kullanıcının  şifresini güncelleyen, güncelleme şartı';
+$lang['UpdateEmail']           = 'Kullanıcının e-posta adresini güncelleyen, güncelleme şartı';
+$lang['UpdateName']            = 'Kullanıcının tam adını güncelleyen, güncelleme şartı';
+$lang['UpdateTarget']          = 'Güncelleme esnasında kullanıcıyı belirleyen, sınır şartı';
+$lang['delUserGroup']          = 'Kullanıcıyı verilen gruptan silen SQL ifadesi';
+$lang['getGroupID']            = 'Verilen grubun birincil anahtarını getiren SQL ifadesi';
+$lang['debug_o_0']             = 'hiçbiri';
+$lang['debug_o_1']             = 'sadece hata olduÄŸunda';
+$lang['debug_o_2']             = 'tüm SQL sorguları';
diff --git a/lib/plugins/authmysql/plugin.info.txt b/lib/plugins/authmysql/plugin.info.txt
index 3e889d11e4e2c32c48df7e962943ea564ffe8a53..fa00fccf4ba75fba6ff14013a3121550abeac88e 100644
--- a/lib/plugins/authmysql/plugin.info.txt
+++ b/lib/plugins/authmysql/plugin.info.txt
@@ -1,7 +1,7 @@
 base   authmysql
 author Andreas Gohr
 email  andi@splitbrain.org
-date   2013-02-16
+date   2014-02-15
 name   MYSQL Auth Plugin
 desc   Provides user authentication against a MySQL database
 url    http://www.dokuwiki.org/plugin:authmysql
diff --git a/lib/plugins/authpgsql/auth.php b/lib/plugins/authpgsql/auth.php
index e51b39858148a782e0dddc5c5f990442483b11c1..99f3ed4436637fe215146271898674fc0c07bdcc 100644
--- a/lib/plugins/authpgsql/auth.php
+++ b/lib/plugins/authpgsql/auth.php
@@ -160,7 +160,7 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql {
             $result = $this->_queryDB($sql);
 
             foreach($result as $user)
-                if(($info = $this->_getUserInfo($user['user'])))
+                if(($info = $this->_getCachedUserInfo($user['user'])))
                     $out[$user['user']] = $info;
 
             $this->_unlockTables();
@@ -212,7 +212,10 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql {
             $sql = str_replace('%{user}', addslashes($user), $sql);
             $sql = str_replace('%{gid}', addslashes($gid), $sql);
             $sql = str_replace('%{group}', addslashes($group), $sql);
-            if($this->_modifyDB($sql) !== false) return true;
+            if($this->_modifyDB($sql) !== false) {
+                $this->_flushUserInfoCache($user);
+                return true;
+            }
 
             if($newgroup) { // remove previously created group on error
                 $sql = str_replace('%{gid}', addslashes($gid), $this->conf['delGroup']);
@@ -267,6 +270,7 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql {
                 }
 
                 if($gid !== false){
+                    $this->_flushUserInfoCache($user);
                     return true;
                 } else {
                     /* remove the new user and all group relations if a group can't
diff --git a/lib/plugins/authpgsql/lang/es/settings.php b/lib/plugins/authpgsql/lang/es/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..abfb00d387bd8e8e5bc1d9bf1fe0d59b4d91190e
--- /dev/null
+++ b/lib/plugins/authpgsql/lang/es/settings.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Antonio Bueno <atnbueno@gmail.com>
+ * @author Antonio Castilla <antoniocastilla@trazoide.com>
+ * @author pokesakura <pokesakura@gmail.com>
+ */
+$lang['server']                = 'Su servidor PostgreSQL';
+$lang['port']                  = 'Puerto de su servidor PostgreSQL';
+$lang['user']                  = 'Nombre de usuario PostgreSQL';
+$lang['password']              = 'Contraseña del usuario indicado';
+$lang['database']              = 'Base de datos a usar';
+$lang['debug']                 = 'Muestra la información de depuración adicional';
+$lang['forwardClearPass']      = 'Pasar las contraseñas de usuario en texto plano a las siguientes sentencias de SQL, en lugar de utilizar la opción passcrypt';
+$lang['checkPass']             = 'Sentencia SQL para el control de las contraseñas';
+$lang['getUserInfo']           = 'Sentencia SQL para recuperar información del usuario';
+$lang['getGroups']             = 'Sentencia SQL para recuperar la pertenencia a grupos de un usuario';
+$lang['getUsers']              = 'Sentencia SQL para enumerar todos los usuarios';
+$lang['FilterLogin']           = 'Sentencia SQL para filtrar a los usuarios por su login';
+$lang['FilterName']            = 'Sentencia SQL para filtrar a los usuarios por su nombre completo';
+$lang['FilterEmail']           = 'Sentencia SQL para filtrar a los usuarios por su correo electrónico';
+$lang['FilterGroup']           = 'Sentencia SQL para filtrar a los usuarios por su membresía en un grupo';
+$lang['SortOrder']             = 'Sentencia SQL para ordenar a los usuarios';
+$lang['addUser']               = 'Sentencia de SQL para agregar un nuevo usuario';
+$lang['addGroup']              = 'Sentencia de SQL para agregar un nuevo grupo';
+$lang['addUserGroup']          = 'Sentencia SQL para agregar un usuario a un grupo existente';
+$lang['delGroup']              = 'Instrucción SQL para eliminar un grupo';
+$lang['getUserID']             = 'Sentencia SQL para obtener la clave principal de un usuario';
+$lang['delUser']               = 'Sentencia SQL para eliminar un usuario';
+$lang['delUserRefs']           = 'Sentencia SQL para remover a un usuario de su memebresia en todos los grupos';
+$lang['updateUser']            = 'Sentencia SQL para actualizar los datos del usuario';
+$lang['UpdateLogin']           = 'Sentencia de actualizacion para el login del usuario';
+$lang['UpdatePass']            = 'Sentencia de actualizacion para el password del usuario';
+$lang['UpdateEmail']           = 'Sentencia de actualizacion del correo electrónico del usuario';
+$lang['UpdateName']            = 'Sentencia de actualizacion del nombre completo del usuario';
+$lang['getGroupID']            = 'Sentencia SQL para obtener la clave principal de un grupo dado';
diff --git a/lib/plugins/authpgsql/lang/fa/settings.php b/lib/plugins/authpgsql/lang/fa/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..8134939674937ca62b6b6f4ae199add8dbc76b19
--- /dev/null
+++ b/lib/plugins/authpgsql/lang/fa/settings.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Mohamad Mehdi Habibi <habibi.esf@gmail.com>
+ */
+$lang['database']              = 'پایگاه داده مورد استفاده';
diff --git a/lib/plugins/authpgsql/lang/hr/settings.php b/lib/plugins/authpgsql/lang/hr/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..7ae4cec77b6fc9c55db52323dd2642c6c727446d
--- /dev/null
+++ b/lib/plugins/authpgsql/lang/hr/settings.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Davor Turkalj <turki.bsc@gmail.com>
+ */
+$lang['server']                = 'Vaš PostgreSQL server';
+$lang['port']                  = 'Port vašeg PostgreSQL servera';
+$lang['user']                  = 'PostgreSQL korisničko ime';
+$lang['password']              = 'Lozinka gore navedenoga korisnika';
+$lang['database']              = 'Baza koja se koristi';
+$lang['debug']                 = 'Prikaz dodatnih dijagnostičkih informacija';
+$lang['forwardClearPass']      = 'Proslijed lozinku kao običan tekst u SQL izrazima koji slijede, umjesto korištenja passcrypt opcije';
+$lang['checkPass']             = 'SQL izraz za provjeru lozinke';
+$lang['getUserInfo']           = 'SQL izraz za dohvat korisničkih informacija';
+$lang['getGroups']             = 'SQL izraz za dohvat korisničkog članstva u grupama';
+$lang['getUsers']              = 'SQL izraz za ispis svih korisnika';
+$lang['FilterLogin']           = 'SQL izraz za filtriranje korisnika po korisničkom imenu';
+$lang['FilterName']            = 'SQL izraz za filtriranje korisnika po punom imenu';
+$lang['FilterEmail']           = 'SQL izraz za filtriranje korisnika po email adresi';
+$lang['FilterGroup']           = 'SQL izraz za filtriranje korisnika po članstvu u grupama';
+$lang['SortOrder']             = 'SQL izraz za sortiranje korisnika';
+$lang['addUser']               = 'SQL izraz za dodavanje novog korisnika';
+$lang['addGroup']              = 'SQL izraz za dodavanje nove grupe';
+$lang['addUserGroup']          = 'SQL izraz za dodavanje korisnika u postojeću grupu';
+$lang['delGroup']              = 'SQL izraz za brisanje grupe';
+$lang['getUserID']             = 'SQL izraz za dohvaćanje primarnog ključa korisnika';
+$lang['delUser']               = 'SQL izraz za brisanje korisnika';
+$lang['delUserRefs']           = 'SQL izraz za uklanjanje korisnika iz svih grupa';
+$lang['updateUser']            = 'SQL izraz za ažuriranje korisničkog profila';
+$lang['UpdateLogin']           = 'UPDATE izraz za ažuriranje korisničkog imena';
+$lang['UpdatePass']            = 'UPDATE izraz za ažuriranje korisničke lozinke';
+$lang['UpdateEmail']           = 'UPDATE izraz za ažuriranje korisničke email adrese';
+$lang['UpdateName']            = 'UPDATE izraz za ažuriranje korisničkog punog imena';
+$lang['UpdateTarget']          = 'Limitirajući izraz za identificiranje korisnika pri ažuriranju';
+$lang['delUserGroup']          = 'SQL izraz za uklanjanje korisnika iz navedenih grupa';
+$lang['getGroupID']            = 'SQL izraz za dobivanje primarnog ključa navedene grupe';
diff --git a/lib/plugins/authpgsql/lang/it/settings.php b/lib/plugins/authpgsql/lang/it/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..baf40a468a6c3030e3a88f2ccb78a5f6894dc72a
--- /dev/null
+++ b/lib/plugins/authpgsql/lang/it/settings.php
@@ -0,0 +1,11 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Francesco <francesco.cavalli@hotmail.com>
+ */
+$lang['server']                = 'Il tuo server PostgreSQL ';
+$lang['port']                  = 'La porta del tuo server PostgreSQL ';
+$lang['user']                  = 'Lo username PostgreSQL';
+$lang['database']              = 'Database da usare';
diff --git a/lib/plugins/authpgsql/lang/lv/settings.php b/lib/plugins/authpgsql/lang/lv/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..889b9566c20bc5ac4649263c84ea5588bbfaaf60
--- /dev/null
+++ b/lib/plugins/authpgsql/lang/lv/settings.php
@@ -0,0 +1,9 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Aivars Miška <allefm@gmail.com>
+ */
+$lang['password']              = 'Lietotāja parole';
+$lang['delUser']               = 'SQL pieprasījums lietotāja dzēšanai';
diff --git a/lib/plugins/authpgsql/lang/pl/settings.php b/lib/plugins/authpgsql/lang/pl/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..25a2afd4f199635a5140f6d3282ed6acd55d3a76
--- /dev/null
+++ b/lib/plugins/authpgsql/lang/pl/settings.php
@@ -0,0 +1,9 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Mati <mackosa@wp.pl>
+ */
+$lang['server']                = 'Twój serwer PostgreSQL';
+$lang['database']              = 'Baza danych do użycia';
diff --git a/lib/plugins/authpgsql/lang/tr/settings.php b/lib/plugins/authpgsql/lang/tr/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..f6fef9cdeaec92eaff62cf124a6ec55a44050314
--- /dev/null
+++ b/lib/plugins/authpgsql/lang/tr/settings.php
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author İlker R. Kapaç <irifat@gmail.com>
+ */
+$lang['server']                = 'PostgreSQL sunucunuz';
+$lang['port']                  = 'PostgreSQL sunucunuzun kapısı (port)';
+$lang['user']                  = 'PostgreSQL kullanıcısının adı';
+$lang['password']              = 'Yukarıdaki kullanıcı için şifre';
+$lang['database']              = 'Kullanılacak veritabanı';
+$lang['debug']                 = 'İlave hata ayıklama bilgisini görüntüle';
diff --git a/lib/plugins/authpgsql/plugin.info.txt b/lib/plugins/authpgsql/plugin.info.txt
index aecab914e685a17a4014f09a6648327d8920d8a9..59b7d89a9839533607216fcb52ae9ccaa9435141 100644
--- a/lib/plugins/authpgsql/plugin.info.txt
+++ b/lib/plugins/authpgsql/plugin.info.txt
@@ -1,7 +1,7 @@
 base   authpgsql
 author Andreas Gohr
 email  andi@splitbrain.org
-date   2013-02-16
+date   2014-02-15
 name   PostgreSQL Auth Plugin
 desc   Provides user authentication against a PostgreSQL database
 url    http://www.dokuwiki.org/plugin:authpgsql
diff --git a/lib/plugins/authplain/_test/escaping.test.php b/lib/plugins/authplain/_test/escaping.test.php
new file mode 100644
index 0000000000000000000000000000000000000000..cd5294157502b497220f6f1b20848587a0dfbbfc
--- /dev/null
+++ b/lib/plugins/authplain/_test/escaping.test.php
@@ -0,0 +1,82 @@
+<?php
+
+/**
+ * These tests are designed to test the capacity of pluginauth to handle
+ * correct escaping of colon field delimiters and backslashes in user content.
+ *
+ * (Note that these tests set some Real Names, etc. that are may not be
+ * valid in the broader dokuwiki context, but the tests ensure that
+ * authplain won't get unexpectedly surprised.)
+ *
+ * @group plugin_authplain
+ * @group plugins
+ */
+class helper_plugin_authplain_escaping_test extends DokuWikiTest {
+ 
+    protected $pluginsEnabled = array('authplain');
+    protected $auth;
+ 
+    protected function reloadUsers() {
+        /* auth caches data loaded from file, but recreated object forces reload */
+        $this->auth = new auth_plugin_authplain();
+    }
+
+    function setUp() {
+        global $config_cascade;
+        parent::setUp();
+        $name = $config_cascade['plainauth.users']['default'];
+        copy($name, $name.".orig");
+        $this->reloadUsers();
+    }
+
+    function tearDown() {
+        global $config_cascade;
+        parent::tearDown();
+        $name = $config_cascade['plainauth.users']['default'];
+        copy($name.".orig", $name);
+    }
+
+    public function testMediawikiPasswordHash() {
+        global $conf;
+        $conf['passcrypt'] = 'mediawiki';
+        $this->auth->createUser("mwuser", "12345", "Mediawiki User", "me@example.com");
+        $this->reloadUsers();
+        $this->assertTrue($this->auth->checkPass("mwuser", "12345"));
+        $mwuser = $this->auth->getUserData("mwuser");
+        $this->assertStringStartsWith(":B:",$mwuser['pass']);
+        $this->assertEquals("Mediawiki User",$mwuser['name']);
+    }
+
+    public function testNameWithColons() {
+        $name = ":Colon: User:";
+        $this->auth->createUser("colonuser", "password", $name, "me@example.com");
+        $this->reloadUsers();
+        $user = $this->auth->getUserData("colonuser");
+        $this->assertEquals($name,$user['name']);
+    }
+
+    public function testNameWithBackslashes() {
+        $name = "\\Slash\\ User\\";
+        $this->auth->createUser("slashuser", "password", $name, "me@example.com");
+        $this->reloadUsers();
+        $user = $this->auth->getUserData("slashuser");
+        $this->assertEquals($name,$user['name']);
+    }
+
+    public function testModifyUser() {
+        global $conf;
+        $conf['passcrypt'] = 'mediawiki';
+        $user = $this->auth->getUserData("testuser");
+        $user['name'] = "\\New:Crazy:Name\\";
+        $user['pass'] = "awesome new password";
+        $this->auth->modifyUser("testuser", $user);
+        $this->reloadUsers();
+
+        $saved = $this->auth->getUserData("testuser");
+        $this->assertEquals($saved['name'], $user['name']);
+        $this->assertTrue($this->auth->checkPass("testuser", $user['pass']));
+    }
+    
+}
+
+?>
\ No newline at end of file
diff --git a/lib/plugins/authplain/auth.php b/lib/plugins/authplain/auth.php
index 8c4ce0dd908e95a6fa21eca2e602d6ab73ecdc5b..b3ca988b9c4a1bde00eba82e02208ec1f168216c 100644
--- a/lib/plugins/authplain/auth.php
+++ b/lib/plugins/authplain/auth.php
@@ -76,13 +76,35 @@ class auth_plugin_authplain extends DokuWiki_Auth_Plugin {
      *
      * @author  Andreas Gohr <andi@splitbrain.org>
      * @param string $user
+     * @param bool $requireGroups  (optional) ignored by this plugin, grps info always supplied
      * @return array|bool
      */
-    public function getUserData($user) {
+    public function getUserData($user, $requireGroups=true) {
         if($this->users === null) $this->_loadUserData();
         return isset($this->users[$user]) ? $this->users[$user] : false;
     }
 
+    /**
+     * Creates a string suitable for saving as a line
+     * in the file database
+     * (delimiters escaped, etc.)
+     *
+     * @param string $user
+     * @param string $pass
+     * @param string $name
+     * @param string $mail
+     * @param array  $grps list of groups the user is in
+     * @return string
+     */
+    protected function _createUserLine($user, $pass, $name, $mail, $grps) {
+        $groups   = join(',', $grps);
+        $userline = array($user, $pass, $name, $mail, $groups);
+        $userline = str_replace('\\', '\\\\', $userline); // escape \ as \\
+        $userline = str_replace(':', '\\:', $userline); // escape : as \:
+        $userline = join(':', $userline)."\n";
+        return $userline;
+    }
+
     /**
      * Create a new User
      *
@@ -115,8 +137,7 @@ class auth_plugin_authplain extends DokuWiki_Auth_Plugin {
         if(!is_array($grps)) $grps = array($conf['defaultgroup']);
 
         // prepare user line
-        $groups   = join(',', $grps);
-        $userline = join(':', array($user, $pass, $name, $mail, $groups))."\n";
+        $userline = $this->_createUserLine($user, $pass, $name, $mail, $grps);
 
         if(io_saveFile($config_cascade['plainauth.users']['default'], $userline, true)) {
             $this->users[$user] = compact('pass', 'name', 'mail', 'grps');
@@ -157,8 +178,7 @@ class auth_plugin_authplain extends DokuWiki_Auth_Plugin {
             $userinfo[$field] = $value;
         }
 
-        $groups   = join(',', $userinfo['grps']);
-        $userline = join(':', array($newuser, $userinfo['pass'], $userinfo['name'], $userinfo['mail'], $groups))."\n";
+        $userline = $this->_createUserLine($newuser, $userinfo['pass'], $userinfo['name'], $userinfo['mail'], $userinfo['grps']);
 
         if(!$this->deleteUsers(array($user))) {
             msg('Unable to modify user data. Please inform the Wiki-Admin', -1);
@@ -308,7 +328,11 @@ class auth_plugin_authplain extends DokuWiki_Auth_Plugin {
             $line = trim($line);
             if(empty($line)) continue;
 
-            $row    = explode(":", $line, 5);
+            /* NB: preg_split can be deprecated/replaced with str_getcsv once dokuwiki is min php 5.3 */
+            $row = preg_split('/(?<![^\\\\]\\\\)\:/', $line, 5); // allow for : escaped as \:
+            $row = str_replace('\\:', ':', $row);
+            $row = str_replace('\\\\', '\\', $row);
+
             $groups = array_values(array_filter(explode(",", $row[4])));
 
             $this->users[$row[0]]['pass'] = $row[1];
diff --git a/lib/plugins/authplain/plugin.info.txt b/lib/plugins/authplain/plugin.info.txt
index b63ee53e49f0163e669155f5c7335a0bb796463b..2659ac7ad5c38cb121caede91f3a1a6a9c7381cd 100644
--- a/lib/plugins/authplain/plugin.info.txt
+++ b/lib/plugins/authplain/plugin.info.txt
@@ -1,7 +1,7 @@
 base   authplain
 author Andreas Gohr
 email  andi@splitbrain.org
-date   2012-11-09
+date   2014-07-01
 name   Plain Auth Plugin
 desc   Provides user authentication against DokuWiki's local password storage
 url    http://www.dokuwiki.org/plugin:authplain
diff --git a/lib/plugins/config/lang/bg/lang.php b/lib/plugins/config/lang/bg/lang.php
index d0df38cae2a0cdbcb1bc3a626a34d63aa6ac22a5..64ddb1eae873a749a4f1d33c82b5123809b6531c 100644
--- a/lib/plugins/config/lang/bg/lang.php
+++ b/lib/plugins/config/lang/bg/lang.php
@@ -67,7 +67,7 @@ $lang['fmode']      = 'Режим (права) за създаване на фа
 $lang['allowdebug'] = 'Включване на режи debug - <b>изключете, ако не е нужен!</b>';
 
 /* Display Settings */
-$lang['recent']      = 'Скорошни промени - брой еленти на страница';
+$lang['recent']      = 'Скорошни промени - брой елементи на страница';
 $lang['recent_days'] = 'Колко от скорошните промени да се пазят (дни)';
 $lang['breadcrumbs'] = 'Брой на следите. За изключване на функцията задайте 0.';
 $lang['youarehere']  = 'Йерархични следи (в този случай можете да изключите горната опция)';
@@ -167,7 +167,7 @@ $lang['compress']    = 'Компактен CSS и javascript изглед';
 $lang['cssdatauri']  = 'Максимален размер, в байтове, до който изображенията посочени в .CSS файл ще бъдат вграждани в стила (stylesheet), за да се намали броя на HTTP заявките. Техниката не работи за версиите на IE преди 8! Препоръчителни стойности: <code>400</code> до <code>600</code> байта. Въведете <code>0</code> за изключване.';
 $lang['send404']     = 'Пращане на "HTTP 404/Page Not Found" за несъществуващи страници';
 $lang['broken_iua']  = 'Отметнете, ако ignore_user_abort функцията не работи. Може да попречи на търсенето в страниците. Знае се, че комбинацията IIS+PHP/CGI е лоша. Вижте  <a href="http://bugs.splitbrain.org/?do=details&amp;task_id=852">Грешка 852</a> за повече информация.';
-$lang['xsendfile']   = 'Ползване на Х-Sendfile header, за да може уебсървъра да дава статични файлове? Вашият уебсървър трябва да го поддържа.';
+$lang['xsendfile']   = 'Ползване на Х-Sendfile header, за да може уебсървъра да дава статични файлове? Вашият уеб сървър трябва да го поддържа.';
 $lang['renderer_xhtml']   = 'Представяне на основните изходни данни (xhtml) от Wiki-то с';
 $lang['renderer__core']   = '%s (ядрото на DokuWiki)';
 $lang['renderer__plugin'] = '%s (приставка)';
diff --git a/lib/plugins/config/lang/de/lang.php b/lib/plugins/config/lang/de/lang.php
index e55081a915fde03f06addd1f4f5c9ed30daa33b0..d398ebf843872a31f6c25d7511b6fd7a32eba662 100644
--- a/lib/plugins/config/lang/de/lang.php
+++ b/lib/plugins/config/lang/de/lang.php
@@ -41,7 +41,7 @@ $lang['_links']                = 'Links';
 $lang['_media']                = 'Medien';
 $lang['_notifications']        = 'Benachrichtigung';
 $lang['_syndication']          = 'Syndication (RSS)';
-$lang['_advanced']             = 'Erweitertet';
+$lang['_advanced']             = 'Erweitert';
 $lang['_network']              = 'Netzwerk';
 $lang['_msg_setting_undefined'] = 'Keine Konfigurationsmetadaten.';
 $lang['_msg_setting_no_class'] = 'Keine Konfigurationsklasse.';
diff --git a/lib/plugins/config/lang/en/lang.php b/lib/plugins/config/lang/en/lang.php
index 92e500ab472574db9c46688a07d010b488be93f4..3fc9c292024afc7612116100625918c3dff6b033 100644
--- a/lib/plugins/config/lang/en/lang.php
+++ b/lib/plugins/config/lang/en/lang.php
@@ -101,6 +101,7 @@ $lang['disableactions_subscription'] = 'Subscribe/Unsubscribe';
 $lang['disableactions_wikicode'] = 'View source/Export Raw';
 $lang['disableactions_profile_delete'] = 'Delete Own Account';
 $lang['disableactions_other'] = 'Other actions (comma separated)';
+$lang['disableactions_rss'] = 'XML Syndication (RSS)';
 $lang['auth_security_timeout'] = 'Authentication Security Timeout (seconds)';
 $lang['securecookie'] = 'Should cookies set via HTTPS only be sent via HTTPS by the browser? Disable this option when only the login of your wiki is secured with SSL but browsing the wiki is done unsecured.';
 $lang['remote']      = 'Enable the remote API system. This allows other applications to access the wiki via XML-RPC or other mechanisms.';
diff --git a/lib/plugins/config/plugin.info.txt b/lib/plugins/config/plugin.info.txt
index 510be3be4c7544f5dddccdbc951c7adf87f0492b..9472346b9384b3d8344afe2e975507a870c98440 100644
--- a/lib/plugins/config/plugin.info.txt
+++ b/lib/plugins/config/plugin.info.txt
@@ -1,7 +1,7 @@
 base   config
 author Christopher Smith
 email  chris@jalakai.co.uk
-date   2013-02-24
+date   2014-03-18
 name   Configuration Manager
 desc   Manage Dokuwiki's Configuration Settings
 url    http://dokuwiki.org/plugin:config
diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php
index 05f8470f72e450c7be881bd996ebb270c359b1ae..8dae2311027e22f524ccc67ac739a1adfba052ff 100644
--- a/lib/plugins/config/settings/config.class.php
+++ b/lib/plugins/config/settings/config.class.php
@@ -18,6 +18,7 @@ if (!class_exists('configuration')) {
         var $_heading = '';            // heading string written at top of config file - don't include comment indicators
         var $_loaded = false;          // set to true after configuration files are loaded
         var $_metadata = array();      // holds metadata describing the settings
+        /** @var setting[]  */
         var $setting = array();        // array of setting objects
         var $locked = false;           // configuration is considered locked if it can't be updated
         var $show_disabled_plugins = false;
@@ -31,8 +32,10 @@ if (!class_exists('configuration')) {
 
         /**
          * constructor
+         *
+         * @param string $datafile path to config metadata file
          */
-        function configuration($datafile) {
+        public function configuration($datafile) {
             global $conf, $config_cascade;
 
             if (!@file_exists($datafile)) {
@@ -55,7 +58,10 @@ if (!class_exists('configuration')) {
             $this->retrieve_settings();
         }
 
-        function retrieve_settings() {
+        /**
+         * Retrieve and stores settings in setting[] attribute
+         */
+        public function retrieve_settings() {
             global $conf;
             $no_default_check = array('setting_fieldset', 'setting_undefined', 'setting_no_class');
 
@@ -100,7 +106,15 @@ if (!class_exists('configuration')) {
             }
         }
 
-        function save_settings($id, $header='', $backup=true) {
+        /**
+         * Stores setting[] array to file
+         *
+         * @param string $id     Name of plugin, which saves the settings
+         * @param string $header Text at the top of the rewritten settings file
+         * @param bool $backup   backup current file? (remove any existing backup)
+         * @return bool succesful?
+         */
+        public function save_settings($id, $header='', $backup=true) {
             global $conf;
 
             if ($this->locked) return false;
@@ -138,13 +152,19 @@ if (!class_exists('configuration')) {
         /**
          * Update last modified time stamp of the config file
          */
-        function touch_settings(){
+        public function touch_settings(){
             if ($this->locked) return false;
             $file = end($this->_local_files);
             return @touch($file);
         }
 
-        function _read_config_group($files) {
+        /**
+         * Read and merge given config files
+         *
+         * @param array $files file paths
+         * @return array config settings
+         */
+        protected function _read_config_group($files) {
             $config = array();
             foreach ($files as $file) {
                 $config = array_merge($config, $this->_read_config($file));
@@ -154,7 +174,10 @@ if (!class_exists('configuration')) {
         }
 
         /**
-         * return an array of config settings
+         * Return an array of config settings
+         *
+         * @param string $file file path
+         * @return array config settings
          */
         function _read_config($file) {
 
@@ -206,7 +229,14 @@ if (!class_exists('configuration')) {
             return $config;
         }
 
-        function _out_header($id, $header) {
+        /**
+         * Returns header of rewritten settings file
+         *
+         * @param string $id plugin name of which generated this output
+         * @param string $header additional text for at top of the file
+         * @return string text of header
+         */
+        protected function _out_header($id, $header) {
             $out = '';
             if ($this->_format == 'php') {
                 $out .= '<'.'?php'."\n".
@@ -221,7 +251,12 @@ if (!class_exists('configuration')) {
             return $out;
         }
 
-        function _out_footer() {
+        /**
+         * Returns footer of rewritten settings file
+         *
+         * @return string text of footer
+         */
+        protected function _out_footer() {
             $out = '';
             if ($this->_format == 'php') {
                 $out .= "\n// end auto-generated content\n";
@@ -230,9 +265,13 @@ if (!class_exists('configuration')) {
             return $out;
         }
 
-        // configuration is considered locked if there is no local settings filename
-        // or the directory its in is not writable or the file exists and is not writable
-        function _is_locked() {
+        /**
+         * Configuration is considered locked if there is no local settings filename
+         * or the directory its in is not writable or the file exists and is not writable
+         *
+         * @return bool true: locked, false: writable
+         */
+        protected function _is_locked() {
             if (!$this->_local_files) return true;
 
             $local = $this->_local_files[0];
@@ -247,7 +286,7 @@ if (!class_exists('configuration')) {
          * not used ... conf's contents are an array!
          * reduce any multidimensional settings to one dimension using CM_KEYMARKER
          */
-        function _flatten($conf,$prefix='') {
+        protected function _flatten($conf,$prefix='') {
 
             $out = array();
 
@@ -264,6 +303,12 @@ if (!class_exists('configuration')) {
             return $out;
         }
 
+        /**
+         * Returns array of plugin names
+         *
+         * @return array plugin names
+         * @triggers PLUGIN_CONFIG_PLUGINLIST event
+         */
         function get_plugin_list() {
             if (is_null($this->_plugin_list)) {
                 $list = plugin_list('',$this->show_disabled_plugins);
@@ -281,6 +326,9 @@ if (!class_exists('configuration')) {
 
         /**
          * load metadata for plugin and template settings
+         *
+         * @param string $tpl name of active template
+         * @return array metadata of settings
          */
         function get_plugintpl_metadata($tpl){
             $file     = '/conf/metadata.php';
@@ -321,7 +369,10 @@ if (!class_exists('configuration')) {
         }
 
         /**
-         * load default settings for plugins and templates
+         * Load default settings for plugins and templates
+         *
+         * @param string $tpl name of active template
+         * @return array default settings
          */
         function get_plugintpl_default($tpl){
             $file    = '/conf/default.php';
@@ -368,7 +419,11 @@ if (!class_exists('setting')) {
 
         static protected $_validCautions = array('warning','danger','security');
 
-        function setting($key, $params=null) {
+        /**
+         * @param string $key
+         * @param array|null $params array with metadata of setting
+         */
+        public function setting($key, $params=null) {
             $this->_key = $key;
 
             if (is_array($params)) {
@@ -379,9 +434,13 @@ if (!class_exists('setting')) {
         }
 
         /**
-         * receives current values for the setting $key
+         * Receives current values for the setting $key
+         *
+         * @param mixed $default   default setting value
+         * @param mixed $local     local setting value
+         * @param mixed $protected protected setting value
          */
-        function initialize($default, $local, $protected) {
+        public function initialize($default, $local, $protected) {
             if (isset($default)) $this->_default = $default;
             if (isset($local)) $this->_local = $local;
             if (isset($protected)) $this->_protected = $protected;
@@ -395,7 +454,7 @@ if (!class_exists('setting')) {
          * @param  mixed   $input   the new value
          * @return boolean          true if changed, false otherwise (incl. on error)
          */
-        function update($input) {
+        public function update($input) {
             if (is_null($input)) return false;
             if ($this->is_protected()) return false;
 
@@ -413,9 +472,13 @@ if (!class_exists('setting')) {
         }
 
         /**
-         * @return   array(string $label_html, string $input_html)
+         * Build html for label and input of setting
+         *
+         * @param DokuWiki_Plugin $plugin object of config plugin
+         * @param bool            $echo   true: show inputted value, when error occurred, otherwise the stored setting
+         * @return array(string $label_html, string $input_html)
          */
-        function html(&$plugin, $echo=false) {
+        public function html(&$plugin, $echo=false) {
             $value = '';
             $disable = '';
 
@@ -439,9 +502,9 @@ if (!class_exists('setting')) {
         }
 
         /**
-         * generate string to save setting value to file according to $fmt
+         * Generate string to save setting value to file according to $fmt
          */
-        function out($var, $fmt='php') {
+        public function out($var, $fmt='php') {
 
             if ($this->is_protected()) return '';
             if (is_null($this->_local) || ($this->_default == $this->_local)) return '';
@@ -457,17 +520,45 @@ if (!class_exists('setting')) {
             return $out;
         }
 
-        function prompt(&$plugin) {
+        /**
+         * Returns the localized prompt
+         *
+         * @param DokuWiki_Plugin $plugin object of config plugin
+         * @return string text
+         */
+        public function prompt(&$plugin) {
             $prompt = $plugin->getLang($this->_key);
             if (!$prompt) $prompt = htmlspecialchars(str_replace(array('____','_'),' ',$this->_key));
             return $prompt;
         }
 
-        function is_protected() { return !is_null($this->_protected); }
-        function is_default() { return !$this->is_protected() && is_null($this->_local); }
-        function error() { return $this->_error; }
+        /**
+         * Is setting protected
+         *
+         * @return bool
+         */
+        public function is_protected() { return !is_null($this->_protected); }
+
+        /**
+         * Is setting the default?
+         *
+         * @return bool
+         */
+        public function is_default() { return !$this->is_protected() && is_null($this->_local); }
+
+        /**
+         * Has an error?
+         *
+         * @return bool
+         */
+        public function error() { return $this->_error; }
 
-        function caution() {
+        /**
+         * Returns caution
+         *
+         * @return bool|string caution string, otherwise false for invalid caution
+         */
+        public function caution() {
             if (!empty($this->_caution)) {
                 if (!in_array($this->_caution, setting::$_validCautions)) {
                     trigger_error('Invalid caution string ('.$this->_caution.') in metadata for setting "'.$this->_key.'"', E_USER_WARNING);
@@ -486,7 +577,14 @@ if (!class_exists('setting')) {
             return false;
         }
 
-        function _out_key($pretty=false,$url=false) {
+        /**
+         * Returns setting key, eventually with referer to config: namespace at dokuwiki.org
+         *
+         * @param bool $pretty create nice key
+         * @param bool $url    provide url to config: namespace
+         * @return string key
+         */
+        public function _out_key($pretty=false,$url=false) {
             if($pretty){
                 $out = str_replace(CM_KEYMARKER,"»",$this->_key);
                 if ($url && !strstr($out,'»')) {//provide no urls for plugins, etc.
diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php
index 1d72f7962dd05354871e7990d3ff20ae930dfc1a..5cd09a8cbc58ac0262b11407b7e089bcdcb3910a 100644
--- a/lib/plugins/config/settings/config.metadata.php
+++ b/lib/plugins/config/settings/config.metadata.php
@@ -138,7 +138,7 @@ $meta['manager']     = array('string');
 $meta['profileconfirm'] = array('onoff');
 $meta['rememberme'] = array('onoff');
 $meta['disableactions'] = array('disableactions',
-                                '_choices' => array('backlink','index','recent','revisions','search','subscription','register','resendpwd','profile','profile_delete','edit','wikicode','check'),
+                                '_choices' => array('backlink','index','recent','revisions','search','subscription','register','resendpwd','profile','profile_delete','edit','wikicode','check', 'rss'),
                                 '_combine' => array('subscription' => array('subscribe','unsubscribe'), 'wikicode' => array('source','export_raw')));
 $meta['auth_security_timeout'] = array('numeric');
 $meta['securecookie'] = array('onoff');
diff --git a/lib/plugins/extension/helper/extension.php b/lib/plugins/extension/helper/extension.php
index 7958cd2dabcbc3a42923c624b9906f907f225edb..2aca0e21877dadac41c38619f580eec1045bdc62 100644
--- a/lib/plugins/extension/helper/extension.php
+++ b/lib/plugins/extension/helper/extension.php
@@ -57,6 +57,8 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
         if(substr($id, 0 , 9) == 'template:'){
             $this->base = substr($id, 9);
             $this->is_template = true;
+        } else {
+            $this->is_template = false;
         }
 
         $this->localInfo = array();
@@ -290,7 +292,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
      */
     public function getUpdateDate() {
         if (!empty($this->managerData['updated'])) return $this->managerData['updated'];
-        return false;
+        return $this->getInstallDate();
     }
 
     /**
@@ -575,6 +577,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
 
         try {
             $installed = $this->installArchive("$tmp/upload.archive", true, $basename);
+            $this->updateManagerData('', $installed);
             // purge cache
             $this->purgeCache();
         }catch (Exception $e){
@@ -594,12 +597,10 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
         try {
             $path      = $this->download($url);
             $installed = $this->installArchive($path, true);
+            $this->updateManagerData($url, $installed);
 
-            // purge caches
-            foreach($installed as $ext => $info){
-                $this->setExtension($ext);
-                $this->purgeCache();
-            }
+            // purge cache
+            $this->purgeCache();
         }catch (Exception $e){
             throw $e;
         }
@@ -613,8 +614,10 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
      * @return array The list of installed extensions
      */
     public function installOrUpdate() {
-        $path      = $this->download($this->getDownloadURL());
+        $url       = $this->getDownloadURL();
+        $path      = $this->download($url);
         $installed = $this->installArchive($path, $this->isInstalled(), $this->getBase());
+        $this->updateManagerData($url, $installed);
 
         // refresh extension information
         if (!isset($installed[$this->getID()])) {
@@ -728,6 +731,37 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
         }
     }
 
+    /**
+     * Save the given URL and current datetime in the manager.dat file of all installed extensions
+     *
+     * @param string $url       Where the extension was downloaded from. (empty for manual installs via upload)
+     * @param array  $installed Optional list of installed plugins
+     */
+    protected function updateManagerData($url = '', $installed = null) {
+        $origID = $this->getID();
+
+        if(is_null($installed)) {
+            $installed = array($origID);
+        }
+
+        foreach($installed as $ext => $info) {
+            if($this->getID() != $ext) $this->setExtension($ext);
+            if($url) {
+                $this->managerData['downloadurl'] = $url;
+            } elseif(isset($this->managerData['downloadurl'])) {
+                unset($this->managerData['downloadurl']);
+            }
+            if(isset($this->managerData['installed'])) {
+                $this->managerData['updated'] = date('r');
+            } else {
+                $this->managerData['installed'] = date('r');
+            }
+            $this->writeManagerData();
+        }
+
+        if($this->getID() != $origID) $this->setExtension($origID);
+    }
+
     /**
      * Read the manager.dat file
      */
diff --git a/lib/plugins/extension/images/disabled.png b/lib/plugins/extension/images/disabled.png
index 7a0dbb3b52cde9602ab7f3e51fa5aabe6dadade3..93a813642a955210f14433ed542f4711190ce482 100644
Binary files a/lib/plugins/extension/images/disabled.png and b/lib/plugins/extension/images/disabled.png differ
diff --git a/lib/plugins/extension/images/enabled.png b/lib/plugins/extension/images/enabled.png
index 7c051cda19a13e28f5eb970656e44344c8412030..92d958802c8e19e0b25a940bbfe0176d33862307 100644
Binary files a/lib/plugins/extension/images/enabled.png and b/lib/plugins/extension/images/enabled.png differ
diff --git a/lib/plugins/extension/images/license.txt b/lib/plugins/extension/images/license.txt
index 254b9cdf6d04debca486a5c0653b713e663de1a7..44e176ac91c45acf5aad5a8248026935455845a6 100644
--- a/lib/plugins/extension/images/license.txt
+++ b/lib/plugins/extension/images/license.txt
@@ -1,4 +1,4 @@
-enabled.png - CC-BY-ND, (c) Emey87 http://www.iconfinder.com/icondetails/65590/48/lightbulb_icon
-disabled.png - CC-BY-ND, (c) Emey87 http://www.iconfinder.com/icondetails/65589/48/idea_lightbulb_off_icon
+enabled.png - CC0, (c) Tanguy Ortolo
+disabled.png - public domain, (c) Tango Desktop Project http://commons.wikimedia.org/wiki/File:Dialog-information.svg
 plugin.png - public domain, (c) nicubunu, http://openclipart.org/detail/15093/blue-jigsaw-piece-07-by-nicubunu
 template.png - public domain, (c) mathec, http://openclipart.org/detail/166596/palette-by-mathec
diff --git a/lib/plugins/extension/lang/cs/intro_install.txt b/lib/plugins/extension/lang/cs/intro_install.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b274959b9355197b17f7a8a3576c1795222c1332
--- /dev/null
+++ b/lib/plugins/extension/lang/cs/intro_install.txt
@@ -0,0 +1 @@
+Zde můžete ručně instalovat zásuvné moduly a šablony vzhledu, buď nahráním, nebo zadáním přímé URL pro stažení.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/cs/lang.php b/lib/plugins/extension/lang/cs/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..27b3a94a3320ea12c2f7ca4d7204b66ce3e71dbc
--- /dev/null
+++ b/lib/plugins/extension/lang/cs/lang.php
@@ -0,0 +1,57 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Viktor Zavadil <vzavadil@newps.cz>
+ * @author Jaroslav Lichtblau <jlichtblau@seznam.cz>
+ */
+$lang['menu']                  = 'Manager rozšíření';
+$lang['tab_plugins']           = 'Instalované moduly';
+$lang['tab_templates']         = 'Instalované šablony';
+$lang['tab_search']            = 'Vyhledej a instaluj';
+$lang['tab_install']           = 'Ruční instalování';
+$lang['notimplemented']        = 'Tato vychytávka není dosud implementována';
+$lang['notinstalled']          = 'Toto rozšíření není instalováno';
+$lang['alreadyenabled']        = 'Toto rozšíření je již povoleno';
+$lang['alreadydisabled']       = 'Toto rozšíření je již vypnuto';
+$lang['unknownauthor']         = 'Neznámý autor';
+$lang['unknownversion']        = 'Neznámá verze';
+$lang['btn_info']              = 'Zobrazit více informací';
+$lang['btn_update']            = 'Aktualizovat';
+$lang['btn_uninstall']         = 'Odinstalovat';
+$lang['btn_enable']            = 'Povolit';
+$lang['btn_disable']           = 'Zakázat';
+$lang['btn_install']           = 'Instalovat';
+$lang['btn_reinstall']         = 'Přeinstalovat';
+$lang['js']['reallydel']       = 'Opravdu odinstalovat toto rozšíření?';
+$lang['search_for']            = 'Hledat rozšíření:';
+$lang['search']                = 'Hledat';
+$lang['popularity']            = 'Popularita: %s%%';
+$lang['homepage_link']         = 'Dokumenty';
+$lang['bugs_features']         = 'Chyby';
+$lang['tags']                  = 'Štítky:';
+$lang['author_hint']           = 'Vyhledat rozšíření podle tohoto autora';
+$lang['installed']             = 'Nainstalováno:';
+$lang['repository']            = 'Repozitář:';
+$lang['unknown']               = '<em>neznámý</em>';
+$lang['installed_version']     = 'Nainstalovaná verze:';
+$lang['install_date']          = 'Poslední aktualizace';
+$lang['available_version']     = 'Dostupná verze:';
+$lang['compatible']            = 'Kompatibilní s:';
+$lang['depends']               = 'Závisí na:';
+$lang['similar']               = 'Podobný jako:';
+$lang['donate']                = 'Líbí se ti to?';
+$lang['donate_action']         = 'Kup autorovi kávu!';
+$lang['repo_retry']            = 'Opakovat';
+$lang['provides']              = 'Poskytuje:';
+$lang['status']                = 'Stav:';
+$lang['status_installed']      = 'instalovaný';
+$lang['status_not_installed']  = 'nenainstalovaný';
+$lang['status_protected']      = 'chráněný';
+$lang['status_enabled']        = 'povolený';
+$lang['status_disabled']       = 'zakázaný';
+$lang['status_unmodifiable']   = 'neměnný';
+$lang['status_plugin']         = 'zásuvný modul';
+$lang['status_template']       = 'Å¡ablona';
+$lang['msg_delete_success']    = 'Rozšíření odinstalováno';
diff --git a/lib/plugins/extension/lang/de/lang.php b/lib/plugins/extension/lang/de/lang.php
index 8068ce8309f1664ac61442505e9ed074133439b9..ce5495e243efb2efbb84bd4517497026225aaf44 100644
--- a/lib/plugins/extension/lang/de/lang.php
+++ b/lib/plugins/extension/lang/de/lang.php
@@ -6,6 +6,8 @@
  * @author H. Richard <wanderer379@t-online.de>
  * @author Joerg <scooter22@gmx.de>
  * @author Simon <st103267@stud.uni-stuttgart.de>
+ * @author Hoisl <hoisl@gmx.at>
+ * @author Dominik Mahr <drache.mahr@gmx.de>
  */
 $lang['menu']                  = 'Erweiterungen verwalten';
 $lang['tab_plugins']           = 'Installierte Plugins';
@@ -74,6 +76,7 @@ $lang['security_issue']        = '<strong>Sicherheitsproblem:</strong> %s';
 $lang['security_warning']      = '<strong>Sicherheitswarnung:</strong> %s';
 $lang['update_available']      = '<strong>Update:</strong> Version %s steht zum Download bereit.';
 $lang['wrong_folder']          = '<strong>Plugin wurde nicht korrekt installiert:</strong> Benennen Sie das Plugin-Verzeichnis "%s" in "%s" um.';
+$lang['url_change']            = '<strong>URL geändert:</strong> Die Download URL wurde seit dem letzten Download geändert. Internetadresse vor Aktualisierung der Erweiterung auf Gültigkeit prüfen.<br />Neu: %s<br />Alt: %s';
 $lang['error_badurl']          = 'URLs sollten mit http oder https beginnen';
 $lang['error_dircreate']       = 'Temporären Ordner konnte nicht erstellt werden, um Download zu empfangen';
 $lang['error_download']        = 'Download der Datei: %s nicht möglich.';
@@ -83,6 +86,7 @@ $lang['error_copy']            = 'Beim Versuch Dateien in den Ordner <em>%s</em>
 $lang['noperms']               = 'Das Erweiterungs-Verzeichnis ist schreibgeschützt';
 $lang['notplperms']            = 'Das Template-Verzeichnis ist schreibgeschützt';
 $lang['nopluginperms']         = 'Das Plugin-Verzeichnis ist schreibgeschützt';
-$lang['git']                   = 'Diese Erweiterung wurde über git installiert, daher kann diese nicht hier aktualisiert werden.';
+$lang['git']                   = 'Diese Erweiterung wurde über git installiert und sollte daher nicht hier aktualisiert werden.';
 $lang['install_url']           = 'Von Webadresse (URL) installieren';
 $lang['install_upload']        = 'Erweiterung hochladen:';
+$lang['repo_error']            = 'Es konnte keine Verbindung zum Plugin-Verzeichnis hergestellt werden. Stellen sie sicher das der Server Verbindung mit www.dokuwiki.org aufnehmen darf und überprüfen sie ihre Proxy Einstellungen.';
diff --git a/lib/plugins/extension/lang/en/lang.php b/lib/plugins/extension/lang/en/lang.php
index 5224f694af43ce6908bfb1cff831fe4ece70e07f..72c9b9e2da880ba42a88247d9cc7054f3c738a95 100644
--- a/lib/plugins/extension/lang/en/lang.php
+++ b/lib/plugins/extension/lang/en/lang.php
@@ -96,4 +96,6 @@ $lang['nopluginperms']                = 'Plugin directory is not writable';
 $lang['git']                          = 'This extension was installed via git, you may not want to update it here.';
 
 $lang['install_url']                  = 'Install from URL:';
-$lang['install_upload']               = 'Upload Extension:';
\ No newline at end of file
+$lang['install_upload']               = 'Upload Extension:';
+
+$lang['repo_error']                   = 'The plugin repository could not be contacted. Make sure your server is allowed to contact www.dokuwiki.org and check your proxy settings.';
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/es/intro_install.txt b/lib/plugins/extension/lang/es/intro_install.txt
new file mode 100644
index 0000000000000000000000000000000000000000..533396b27d174042fd32fa242030292e32faf744
--- /dev/null
+++ b/lib/plugins/extension/lang/es/intro_install.txt
@@ -0,0 +1 @@
+Aquí se puede instalar manualmente los plugins y las plantillas, ya sea cargándolos o dando una URL de descarga directa.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/es/intro_templates.txt b/lib/plugins/extension/lang/es/intro_templates.txt
new file mode 100644
index 0000000000000000000000000000000000000000..4ede9a1a90cd402189793f00efa75dc93816fa48
--- /dev/null
+++ b/lib/plugins/extension/lang/es/intro_templates.txt
@@ -0,0 +1 @@
+Estas son las plantillas actualmente instalados en su DokuWiki. Puede seleccionar la plantilla que se utilizará en [[?do=admin&page=config|Configuration Manager]]
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/es/lang.php b/lib/plugins/extension/lang/es/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..63742c3b39ccf31ee39dab356bcf384534e7ba65
--- /dev/null
+++ b/lib/plugins/extension/lang/es/lang.php
@@ -0,0 +1,84 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Antonio Bueno <atnbueno@gmail.com>
+ * @author Antonio Castilla <antoniocastilla@trazoide.com>
+ * @author Jonathan Hernández <me@jhalicea.com>
+ */
+$lang['menu']                  = 'Administrador de Extensiones ';
+$lang['tab_plugins']           = 'Plugins instalados';
+$lang['tab_templates']         = 'Plantillas instaladas';
+$lang['tab_search']            = 'Buscar e instalar';
+$lang['tab_install']           = 'Instalación manual';
+$lang['notimplemented']        = 'Esta característica no se ha implementado aún';
+$lang['notinstalled']          = 'Esta expensión no está instalada';
+$lang['alreadyenabled']        = 'Esta extensión ya había sido activada';
+$lang['alreadydisabled']       = 'Esta extensión ya había sido desactivada';
+$lang['pluginlistsaveerror']   = 'Se ha producido un error al guardar la lista de plugins';
+$lang['unknownauthor']         = 'autor desconocido';
+$lang['unknownversion']        = 'versión desconocida';
+$lang['btn_info']              = 'Mostrar más información';
+$lang['btn_update']            = 'Actualizar';
+$lang['btn_uninstall']         = 'Desinstalar';
+$lang['btn_enable']            = 'Activar';
+$lang['btn_disable']           = 'Desactivar';
+$lang['btn_install']           = 'Instalar';
+$lang['btn_reinstall']         = 'Reinstalar';
+$lang['js']['reallydel']       = '¿Realmente quiere desinstalar esta extensión?';
+$lang['search_for']            = 'Extensión de búsqueda :';
+$lang['search']                = 'Buscar';
+$lang['extensionby']           = '<strong>%s</strong> por %s';
+$lang['screenshot']            = 'Captura de %s';
+$lang['popularity']            = 'Popularidad:%s%%';
+$lang['homepage_link']         = 'Documentos';
+$lang['bugs_features']         = 'Bugs';
+$lang['tags']                  = 'Etiquetas:';
+$lang['author_hint']           = 'Buscar extensiones de este autor';
+$lang['installed']             = 'Instalado:';
+$lang['downloadurl']           = 'URL de descarga:';
+$lang['repository']            = 'Repositorio:';
+$lang['unknown']               = '<em>desconocido</em>';
+$lang['installed_version']     = 'Versión instalada:';
+$lang['install_date']          = 'Tú última actualización:';
+$lang['available_version']     = 'Versión disponible:';
+$lang['compatible']            = 'Compatible con:';
+$lang['depends']               = 'Dependencias:';
+$lang['similar']               = 'Similar a:';
+$lang['conflicts']             = 'Conflictos con:';
+$lang['donate']                = '¿Cómo está?';
+$lang['donate_action']         = '¡Págale un café al autor!';
+$lang['repo_retry']            = 'Trate otra vez';
+$lang['provides']              = 'Provee: ';
+$lang['status']                = 'Estado:';
+$lang['status_installed']      = 'instalado';
+$lang['status_not_installed']  = 'no instalado';
+$lang['status_protected']      = 'protegido';
+$lang['status_enabled']        = 'activado';
+$lang['status_disabled']       = 'desactivado';
+$lang['status_unmodifiable']   = 'no modificable';
+$lang['status_plugin']         = 'plugin';
+$lang['status_template']       = 'plantilla';
+$lang['status_bundled']        = 'agrupado';
+$lang['msg_enabled']           = 'Plugin %s activado';
+$lang['msg_disabled']          = 'Plugin %s desactivado';
+$lang['msg_delete_success']    = 'Extensión desinstalada';
+$lang['msg_template_install_success'] = 'Plantilla %s instalada con éxito';
+$lang['msg_template_update_success'] = 'Plantilla %s actualizada con éxito';
+$lang['msg_plugin_install_success'] = 'Plugin %s instalado con éxito';
+$lang['msg_plugin_update_success'] = 'Plugin %s actualizado con éxito';
+$lang['msg_upload_failed']     = 'Falló la carga del archivo';
+$lang['missing_dependency']    = '<strong>Dependencia deshabilitada o perdida:</strong> %s';
+$lang['security_issue']        = '<strong>Problema de seguridad:</strong> %s';
+$lang['security_warning']      = '<strong>Aviso de seguridad:</strong> %s';
+$lang['update_available']      = '<strong>Actualizar:</strong> Nueva versión %s disponible.';
+$lang['wrong_folder']          = '<strong>"Plugin" instalado incorrectamente:</strong> Cambie el nombre del directorio del plugin "%s" a "%s".';
+$lang['url_change']            = '<strong>URL actualizada:</strong> El Download URL ha cambiado desde el último download. Verifica si el nuevo URL es valido antes de actualizar la extensión .<br />Nuevo: %s<br />Viejo: %s';
+$lang['error_badurl']          = 'URLs deberían empezar con http o https';
+$lang['error_dircreate']       = 'No es posible de crear un directorio temporero para poder recibir el download';
+$lang['error_download']        = 'No es posible descargar el documento: %s';
+$lang['git']                   = 'Esta extensión fue instalada a través de git, quizás usted no quiera actualizarla aquí mismo.';
+$lang['install_url']           = 'Instalar desde URL:';
+$lang['install_upload']        = 'Subir Extensión:';
+$lang['repo_error']            = 'El repositorio de plugins no puede ser contactado. Asegúrese que su servidor pueda contactar www.dokuwiki.org y verificar la configuración de su proxy.';
diff --git a/lib/plugins/extension/lang/fa/lang.php b/lib/plugins/extension/lang/fa/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..95c3e9652cf199ca2a5022f1e570dab83e930bbe
--- /dev/null
+++ b/lib/plugins/extension/lang/fa/lang.php
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Mohamad Mehdi Habibi <habibi.esf@gmail.com>
+ */
+$lang['menu']                  = 'مدیریت افزونه ها';
+$lang['tab_plugins']           = 'پلاگین های نصب شده';
+$lang['tab_templates']         = 'قالب های نصب شده';
+$lang['tab_search']            = 'جستجو و نصب';
+$lang['tab_install']           = 'نصب دستی';
+$lang['notinstalled']          = 'این افزونه نصب نشده است';
+$lang['alreadyenabled']        = 'این افزونه فعال شده است';
+$lang['alreadydisabled']       = 'این افزونه غیرفعال شده است';
+$lang['unknownversion']        = 'نسخه ناشناخته';
+$lang['btn_info']              = 'نمایش اطلاعات بیشتر';
+$lang['btn_update']            = 'به روز رسانی';
+$lang['btn_enable']            = 'فعال';
+$lang['btn_disable']           = 'غیرفعال';
+$lang['btn_install']           = 'نصب';
+$lang['btn_reinstall']         = 'نصب مجدد';
+$lang['search_for']            = 'جستجوی افزونه:';
+$lang['search']                = 'جستجو';
+$lang['tags']                  = 'برچسب ها:';
+$lang['installed_version']     = 'نسخه نصب شده:';
+$lang['available_version']     = 'نسخه در دسترس:';
+$lang['repo_retry']            = 'دوباره';
+$lang['status']                = 'وضعیت';
+$lang['status_installed']      = 'نصب شده';
+$lang['status_not_installed']  = 'نصب نشده';
+$lang['status_enabled']        = 'فعال';
+$lang['status_disabled']       = 'غیرفعال';
+$lang['status_plugin']         = 'پلاگین';
+$lang['status_template']       = 'قالب';
+$lang['noperms']               = 'پوشه افزونه ها قابل نوشتن نیست';
+$lang['notplperms']            = 'پوشه قالب ها قابل نوشتن نیست';
+$lang['nopluginperms']         = 'پوشه پلاگین ها قابل نوشتن نیست';
+$lang['install_url']           = 'نصب از آدرس:';
+$lang['install_upload']        = 'بارگذاری افزونه:';
diff --git a/lib/plugins/extension/lang/fr/intro_install.txt b/lib/plugins/extension/lang/fr/intro_install.txt
index 6f68a260628622a0c28c2b8c87eaefd578b71ac7..5d287b818b333c750299246f96084d1da739fbf1 100644
--- a/lib/plugins/extension/lang/fr/intro_install.txt
+++ b/lib/plugins/extension/lang/fr/intro_install.txt
@@ -1 +1 @@
-Ici, vous pouvez installer des extensions, greffons et modèles. Soit en les téléversant, soit en indiquant un URL de téléchargement.
\ No newline at end of file
+Ici, vous pouvez installer des extensions, greffons et thèmes. Soit en les téléversant, soit en indiquant un URL de téléchargement.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/fr/intro_templates.txt b/lib/plugins/extension/lang/fr/intro_templates.txt
index fefdb5538ea03be115abbcfee9b673ebd7392af3..a0a1336ea4ef54e1db960648491942500e4eda74 100644
--- a/lib/plugins/extension/lang/fr/intro_templates.txt
+++ b/lib/plugins/extension/lang/fr/intro_templates.txt
@@ -1 +1 @@
-Voici la liste des modèles actuellement installés. Le [[?do=admin&page=config|gestionnaire de configuration]] vous permet de choisir le modèle à utiliser.
\ No newline at end of file
+Voici la liste des thèmes actuellement installés. Le [[?do=admin&page=config|gestionnaire de configuration]] vous permet de choisir le thème à utiliser.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/fr/lang.php b/lib/plugins/extension/lang/fr/lang.php
index c2dae0fc9f2e2082cfd6ac35af36ad16a6418d07..88234efd01e9db488a570f98f320bcd108279a70 100644
--- a/lib/plugins/extension/lang/fr/lang.php
+++ b/lib/plugins/extension/lang/fr/lang.php
@@ -7,7 +7,7 @@
  */
 $lang['menu']                  = 'Gestionnaire d\'extension';
 $lang['tab_plugins']           = 'Greffons installés';
-$lang['tab_templates']         = 'Modèles installés';
+$lang['tab_templates']         = 'Thèmes installés';
 $lang['tab_search']            = 'Rechercher et installer';
 $lang['tab_install']           = 'Installation manuelle';
 $lang['notimplemented']        = 'Cette fonctionnalité n\'est pas encore installée';
@@ -57,13 +57,13 @@ $lang['status_enabled']        = 'activé';
 $lang['status_disabled']       = 'désactivé';
 $lang['status_unmodifiable']   = 'non modifiable';
 $lang['status_plugin']         = 'greffon';
-$lang['status_template']       = 'modèle';
+$lang['status_template']       = 'thème';
 $lang['status_bundled']        = 'fourni';
 $lang['msg_enabled']           = 'Greffon %s activé';
 $lang['msg_disabled']          = 'Greffon %s désactivé';
 $lang['msg_delete_success']    = 'Extension désinstallée';
-$lang['msg_template_install_success'] = 'Modèle %s installée avec succès';
-$lang['msg_template_update_success'] = 'Modèle %s mis à jour avec succès';
+$lang['msg_template_install_success'] = 'Thème %s installée avec succès';
+$lang['msg_template_update_success'] = 'Thème %s mis à jour avec succès';
 $lang['msg_plugin_install_success'] = 'Greffon %s installé avec succès';
 $lang['msg_plugin_update_success'] = 'Greffon %s mis à jour avec succès';
 $lang['msg_upload_failed']     = 'Téléversement échoué';
@@ -80,8 +80,9 @@ $lang['error_decompress']      = 'Impossible de décompresser le fichier téléc
 $lang['error_findfolder']      = 'Impossible d\'idnetifier le dossier de l\'extension. vous devez procéder à une installation manuelle.';
 $lang['error_copy']            = 'Une erreur de copie de fichier s\'est produite lors de l\'installation des fichiers dans le dossier <em>%s</em>. Il se peut que le disque soit plein, ou que les permissions d\'accès aux fichiers soient incorrectes. Il est possible que le greffon soit partiellement installé et que cela laisse votre installation de DoluWiki instable.';
 $lang['noperms']               = 'Impossible d\'écrire dans le dossier des extensions.';
-$lang['notplperms']            = 'Impossible d\'écrire dans le dossier des modèles.';
+$lang['notplperms']            = 'Impossible d\'écrire dans le dossier des thèmes.';
 $lang['nopluginperms']         = 'Impossible d\'écrire dans le dossier des greffons.';
 $lang['git']                   = 'Cette extension a été installé via git, vous voudrez peut-être ne pas la mettre à jour ici.';
 $lang['install_url']           = 'Installez depuis l\'URL :';
 $lang['install_upload']        = 'Téléversez l\'extension :';
+$lang['repo_error']            = 'L\'entrepôt d\'extensions est injoignable. Veuillez vous assurer que le server web est autorisé à contacter www.dokuwiki.org et vérifier les réglages de proxy.';
diff --git a/lib/plugins/extension/lang/hr/intro_install.txt b/lib/plugins/extension/lang/hr/intro_install.txt
new file mode 100644
index 0000000000000000000000000000000000000000..fc2d22f52f8ddefd5c09669cc1270c0701c1b6f1
--- /dev/null
+++ b/lib/plugins/extension/lang/hr/intro_install.txt
@@ -0,0 +1 @@
+Ovdje možete ručno instalirati dodatak (plugin) i predložak (template) bilo učitavanjem ili specificiranjem URL-a za direktno učitavanje.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/hr/intro_plugins.txt b/lib/plugins/extension/lang/hr/intro_plugins.txt
new file mode 100644
index 0000000000000000000000000000000000000000..fdc629d62f6518171087aca2d628dafb29301db2
--- /dev/null
+++ b/lib/plugins/extension/lang/hr/intro_plugins.txt
@@ -0,0 +1 @@
+Ovo su dodaci (plugin) trenutno instalirani na Vašem DokuWiku-u. Možete ih omogućiti, onemogućiti ili u potpunosti deinstalirati. Nadogradnje dodataka su također prikazane, obavezno pročitajte dokumentaciju  dodatka prije nadogradnje.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/hr/intro_search.txt b/lib/plugins/extension/lang/hr/intro_search.txt
new file mode 100644
index 0000000000000000000000000000000000000000..93bf4b000365f1b8cdd7f3b8eebf9bce4008d4b4
--- /dev/null
+++ b/lib/plugins/extension/lang/hr/intro_search.txt
@@ -0,0 +1 @@
+Ovaj tab vam pruža pristup dostupnim dodatcima i predlošcima za DokuWiki od treće strane. Molimo budite svjesni da instaliranje koda od treće strane može biti **sigurnosni rizik**, možda želite prvo pročitati o [[doku>security#plugin_security|sigurnosti dodataka]].
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/hr/intro_templates.txt b/lib/plugins/extension/lang/hr/intro_templates.txt
new file mode 100644
index 0000000000000000000000000000000000000000..968906cf971c72a814ee1822524c0d09ee637d95
--- /dev/null
+++ b/lib/plugins/extension/lang/hr/intro_templates.txt
@@ -0,0 +1 @@
+Ovo su predlošci trenutno instalirani na Vašem DokuWiki-u. Možete odabrati koji se predložak koristi na [[?do=admin&page=config|Upravitelju postavki]].
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/hr/lang.php b/lib/plugins/extension/lang/hr/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..4905fe86486ec240adca6f685e03ad7a3cfd7a4d
--- /dev/null
+++ b/lib/plugins/extension/lang/hr/lang.php
@@ -0,0 +1,88 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Davor Turkalj <turki.bsc@gmail.com>
+ */
+$lang['menu']                  = 'Upravitelj dodataka';
+$lang['tab_plugins']           = 'Instalirani dodatci';
+$lang['tab_templates']         = 'Instalirani predlošci';
+$lang['tab_search']            = 'Potraži i instaliraj';
+$lang['tab_install']           = 'Ručno instaliranje';
+$lang['notimplemented']        = 'Ova mogućnost još nije napravljena';
+$lang['notinstalled']          = 'Dodatak nije instaliran';
+$lang['alreadyenabled']        = 'Ovaj dodatak je već omogućen';
+$lang['alreadydisabled']       = 'Ovaj dodatak je već onemogućen';
+$lang['pluginlistsaveerror']   = 'Dogodila se greška pri snimanju liste dodataka';
+$lang['unknownauthor']         = 'Nepoznat autor';
+$lang['unknownversion']        = 'Nepoznata inačica';
+$lang['btn_info']              = 'Prikaži više informacija';
+$lang['btn_update']            = 'Dopuni';
+$lang['btn_uninstall']         = 'Ukloni';
+$lang['btn_enable']            = 'Omogući';
+$lang['btn_disable']           = 'Onemogući';
+$lang['btn_install']           = 'Postavi';
+$lang['btn_reinstall']         = 'Ponovno postavi';
+$lang['js']['reallydel']       = 'Zaista ukloniti ovo proširenje?';
+$lang['search_for']            = 'Pretraži proširenja';
+$lang['search']                = 'Pretraži';
+$lang['extensionby']           = '<strong>%s</strong> po %s';
+$lang['screenshot']            = 'Slika zaslona od %s';
+$lang['popularity']            = 'Popularnost: %s%%';
+$lang['homepage_link']         = 'Upute';
+$lang['bugs_features']         = 'Greške';
+$lang['tags']                  = 'Oznake:';
+$lang['author_hint']           = 'Potraži dodatke od ovog autora';
+$lang['installed']             = 'Postavljeno:';
+$lang['downloadurl']           = 'URL adresa preuzimanja:';
+$lang['repository']            = 'Repozitorij:';
+$lang['unknown']               = '<em>nepoznat</em>';
+$lang['installed_version']     = 'Postavljena inačica:';
+$lang['install_date']          = 'Vaše zadnje osvježavanje:';
+$lang['available_version']     = 'Dostupna inačica';
+$lang['compatible']            = 'Kompatibilan s:';
+$lang['depends']               = 'Zavisi o:';
+$lang['similar']               = 'Sličan s:';
+$lang['conflicts']             = 'U sukobu s:';
+$lang['donate']                = 'Poput ovog?';
+$lang['donate_action']         = 'Kupite autoru kavu!';
+$lang['repo_retry']            = 'Ponovi';
+$lang['provides']              = 'Osigurava:';
+$lang['status']                = 'Status:';
+$lang['status_installed']      = 'ugrađen';
+$lang['status_not_installed']  = 'nije ugrađen';
+$lang['status_protected']      = 'zaštićen';
+$lang['status_enabled']        = 'omogućen';
+$lang['status_disabled']       = 'onemogućen';
+$lang['status_unmodifiable']   = 'neizmjenjiv';
+$lang['status_plugin']         = 'dodatak';
+$lang['status_template']       = 'predložak';
+$lang['status_bundled']        = 'ugrađen';
+$lang['msg_enabled']           = 'Dodatak %s omogućen';
+$lang['msg_disabled']          = 'Dodatak %s onemogućen';
+$lang['msg_delete_success']    = 'Proširenje uklonjeno';
+$lang['msg_template_install_success'] = 'Predložak %s uspješno ugrađen';
+$lang['msg_template_update_success'] = 'Predložak %s uspješno nadograđen';
+$lang['msg_plugin_install_success'] = 'Dodatak %s uspješno ugrađen';
+$lang['msg_plugin_update_success'] = 'Dodatak %s uspješno nadograđen';
+$lang['msg_upload_failed']     = 'Učitavanje datoteke nije uspjelo';
+$lang['missing_dependency']    = '<strong>Nedostaje ili onemogućena zavisnost:</strong> %s';
+$lang['security_issue']        = '<strong>Sigurnosno pitanje:</strong> %s';
+$lang['security_warning']      = '<strong>Sigurnosno upozorenje:</strong> %s';
+$lang['update_available']      = '<strong>Nadogranja:</strong> Nova inačica %s je dostupna.';
+$lang['wrong_folder']          = '<strong>Dodatak neispravno ugrađen:</strong> Preimenujte mapu dodatka iz "%s" u "%s".';
+$lang['url_change']            = '<strong>URL izmijenjen:</strong> Adresa za preuzimanje je promijenjena od zadnjeg preuzimanja. Provjerite da li je novu URL valjan prije nadogradnje proširenja.<br />Novi: %s<br />Stari: %s';
+$lang['error_badurl']          = 'URL adrese trebaju započinjati sa http ili https';
+$lang['error_dircreate']       = 'Ne mogu napraviti privremenu mapu za prihvat preuzimanja';
+$lang['error_download']        = 'Ne mogu preuzeti datoteku: %s';
+$lang['error_decompress']      = 'Ne mogu raspakirati preuzetu datoteku. To može biti rezultati lošeg preuzimanja i tada treba pokušati ponovo; ili format sažimanja je nepoznat i u tom slučaju treba datoteku ručno preuzeti i ugraditi.';
+$lang['error_findfolder']      = 'Ne mogu odrediti mapu proširenja, trebate ga ručno preuzeti i ugraditi';
+$lang['error_copy']            = 'Dogodila se greška pri kopiranju dok je pokušavanja ugradnja datoteka u mapu <em>%s</em>: disk može biti pun ili dozvole pristupa nisu dobre. Ovo može rezultirati djelomično ugrađenim dodatkom i može učiniti Vaš wiki nestabilnim';
+$lang['noperms']               = 'Nije moguće pisati u mapu proširanja';
+$lang['notplperms']            = 'Nije moguće pisati u mapu predloška';
+$lang['nopluginperms']         = 'Nije moguće pisati u mapu dodatka';
+$lang['git']                   = 'Proširenje je ugrađeno preko Git-a, možda ga ne želite nadograđivati ovdje.';
+$lang['install_url']           = 'Ugradi s URL-a:';
+$lang['install_upload']        = 'Učitaj proširenje:';
+$lang['repo_error']            = 'Repozitorij dodataka nije dostupan. Budite sigurni da server može pristupiti www.dokuwiki.org i provjerite proxy postavke.';
diff --git a/lib/plugins/extension/lang/hu/intro_install.txt b/lib/plugins/extension/lang/hu/intro_install.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8427e7dc6b47c784febe2e0dc87c5dcdf19114a6
--- /dev/null
+++ b/lib/plugins/extension/lang/hu/intro_install.txt
@@ -0,0 +1 @@
+Itt új modulokat és sablonokat telepíthetsz feltöltéssel vagy a csomagra hivatkozó URL megadásával.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/hu/intro_plugins.txt b/lib/plugins/extension/lang/hu/intro_plugins.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8a3e92ddbd8ae032cb3f31f0ba7318332bb4609e
--- /dev/null
+++ b/lib/plugins/extension/lang/hu/intro_plugins.txt
@@ -0,0 +1 @@
+A DokuWiki rendszerben telepített modulok az alábbiak. Engedélyezheted, letilthatod vagy teljesen le is törölheted ezeket. A modulokhoz tartozó frissítések is itt láthatók, viszont frissítés előtt mindenképp olvasd el az utasításokat a modul dokumentációjában is!
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/hu/intro_search.txt b/lib/plugins/extension/lang/hu/intro_search.txt
new file mode 100644
index 0000000000000000000000000000000000000000..87a2a5d642304242d3923448f2575e7b2d9000e2
--- /dev/null
+++ b/lib/plugins/extension/lang/hu/intro_search.txt
@@ -0,0 +1 @@
+Ezen a fülön harmadik fél által készített modulokat és sablonokat találsz a DokuWiki-hez. Ne feledd, hogy a harmadik féltől származó kódok **biztonsági kockázatot** jelenthetnek, ennek a [[doku>security#plugin_security|modulok biztonsága]] oldalon olvashatsz utána a telepítés előtt.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/hu/intro_templates.txt b/lib/plugins/extension/lang/hu/intro_templates.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c0ad92b35d4fdf6876b71a339bd4065129986e9e
--- /dev/null
+++ b/lib/plugins/extension/lang/hu/intro_templates.txt
@@ -0,0 +1 @@
+A DokuWiki rendszerben telepített sablonok az alábbiak. A használt sablont a [[?do=admin&page=config|Beállítóközpontban]] választhatod ki.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/hu/lang.php b/lib/plugins/extension/lang/hu/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..a27b5a3079f12279ece6fc9e3711e362afc867ef
--- /dev/null
+++ b/lib/plugins/extension/lang/hu/lang.php
@@ -0,0 +1,88 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Marton Sebok <sebokmarton@gmail.com>
+ */
+$lang['menu']                  = 'Bővítménykezelő';
+$lang['tab_plugins']           = 'Telepített modulok';
+$lang['tab_templates']         = 'Telepített sablonok';
+$lang['tab_search']            = 'Keresés és telepítés';
+$lang['tab_install']           = 'Kézi telepítés';
+$lang['notimplemented']        = 'Ez a funkció még nincs implementálva';
+$lang['notinstalled']          = 'Ez a bővítmény nincs telepítve';
+$lang['alreadyenabled']        = 'Ez a bővítmény már engedélyezve van';
+$lang['alreadydisabled']       = 'Ez a bővítmény már le van tiltva';
+$lang['pluginlistsaveerror']   = 'Hiba történt a modulok listájának mentésekor';
+$lang['unknownauthor']         = 'Ismeretlen szerző';
+$lang['unknownversion']        = 'Ismeretlen verzió';
+$lang['btn_info']              = 'További információk megjelenítése';
+$lang['btn_update']            = 'Frissítés';
+$lang['btn_uninstall']         = 'Törlés';
+$lang['btn_enable']            = 'Engedélyezés';
+$lang['btn_disable']           = 'Letiltás';
+$lang['btn_install']           = 'Telepítés';
+$lang['btn_reinstall']         = 'Újratelepítés';
+$lang['js']['reallydel']       = 'Biztosan törlöd ezt a bővítményt?';
+$lang['search_for']            = 'Bővítmények keresése:';
+$lang['search']                = 'Keresés';
+$lang['extensionby']           = '<strong>%s</strong>, %s szerzőtől';
+$lang['screenshot']            = '%s képernyőképe';
+$lang['popularity']            = 'Népszerűség: %s%%';
+$lang['homepage_link']         = 'Dokumentáció';
+$lang['bugs_features']         = 'Hibák';
+$lang['tags']                  = 'Címkék:';
+$lang['author_hint']           = 'Bővítmények keresése ettől a szerzőtől';
+$lang['installed']             = 'Telepítve:';
+$lang['downloadurl']           = 'Csomag URL:';
+$lang['repository']            = 'Repository:';
+$lang['unknown']               = '<em>ismeretlen</em>';
+$lang['installed_version']     = 'Telepített verzió:';
+$lang['install_date']          = 'Utoljára frissítve:';
+$lang['available_version']     = 'Elérhető verzió:';
+$lang['compatible']            = 'Kompatibilis rendszerek:';
+$lang['depends']               = 'Függőségek:';
+$lang['similar']               = 'Hasonló bővítmények:';
+$lang['conflicts']             = 'Ütközést okozó bővítmények:';
+$lang['donate']                = 'Tetszik?';
+$lang['donate_action']         = 'Hívd meg a szerzőjét egy kávéra!';
+$lang['repo_retry']            = 'Újra';
+$lang['provides']              = 'Szolgáltatások:';
+$lang['status']                = 'Állapot:';
+$lang['status_installed']      = 'telepítve';
+$lang['status_not_installed']  = 'nincs telepítve';
+$lang['status_protected']      = 'védett';
+$lang['status_enabled']        = 'engedélyezve';
+$lang['status_disabled']       = 'letiltva';
+$lang['status_unmodifiable']   = 'nem lehet módosítani';
+$lang['status_plugin']         = 'modul';
+$lang['status_template']       = 'sablon';
+$lang['status_bundled']        = 'beépített';
+$lang['msg_enabled']           = 'A(z) %s modul engedélyezve';
+$lang['msg_disabled']          = 'A(z) %s modul letiltva';
+$lang['msg_delete_success']    = 'A bővítmény törölve';
+$lang['msg_template_install_success'] = 'A(z) %s sablon sikeresen telepítve';
+$lang['msg_template_update_success'] = 'A(z) %s sablon sikeresen frissítve';
+$lang['msg_plugin_install_success'] = 'A(z) %s modul sikeresen telepítve';
+$lang['msg_plugin_update_success'] = 'A(z) %s modul sikeresen frissítve';
+$lang['msg_upload_failed']     = 'A fájl feltöltése sikertelen';
+$lang['missing_dependency']    = '<strong>Hiányzó vagy letiltott függőség:</strong> %s';
+$lang['security_issue']        = '<strong>Biztonsági probléma:</strong> %s';
+$lang['security_warning']      = '<strong>Biztonsági figyelmeztetés:</strong> %s';
+$lang['update_available']      = '<strong>Frissítés:</strong> Elérhető %s új verziója.';
+$lang['wrong_folder']          = '<strong>A modul telepítése sikertelen:</strong> Nevezd át a modul könyvtárát "%s" névről "%s" névre!';
+$lang['url_change']            = '<strong>Az URL megváltozott:</strong> A csomag URL-je megváltozott az utolsó letöltés óta. A bővítmény frissítése előtt ellenőrizd az új URL helyességét!<br />Új: %s<br />Régi: %s';
+$lang['error_badurl']          = 'Az URL-nek "http"-vel vagy "https"-sel kell kezdődnie';
+$lang['error_dircreate']       = 'A letöltéshez az ideiglenes könyvtár létrehozása sikertelen';
+$lang['error_download']        = 'A(z) %s fájl letöltése sikertelen';
+$lang['error_decompress']      = 'A letöltött fájlt nem lehet kicsomagolni. Ezt okozhatja a fájl sérülése (ebben az esetben próbáld újra letölteni) vagy egy ismeretlen tömörítési formátum használata (ilyenkor kézzel kell telepítened).';
+$lang['error_findfolder']      = 'A bővítményhez tartozó könyvtárat nem sikerült megállapítani, kézzel kell letöltened és telepítened';
+$lang['error_copy']            = 'Egy fájl másolása közben hiba történt a <em>%s</em> könyvtárban: lehet, hogy a lemez megtelt vagy nincsenek megfelelő írási jogaid. A telepítés megszakadása a modul hibás működését eredményezheti és instabil állapotba hozhatja a wikit';
+$lang['noperms']               = 'A bővítmény könyvtára nem írható';
+$lang['notplperms']            = 'A sablon könyvtára nem írható';
+$lang['nopluginperms']         = 'A modul könyvtára nem írható';
+$lang['git']                   = 'Ezt a bővítményt git-tel telepítették, lehet, hogy nem itt célszerű frissíteni';
+$lang['install_url']           = 'Telepítés erről az URL-ről:';
+$lang['install_upload']        = 'Bővítmény feltöltése:';
+$lang['repo_error']            = 'A modul repository-ja nem érhető el. Bizonyosodj meg róla, hogy a szervereden engedélyezett a www.dokuwiki.org cím elérése és ellenőrizd a proxy beállításaidat!';
diff --git a/lib/plugins/extension/lang/it/lang.php b/lib/plugins/extension/lang/it/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..7dff6c5b29753e954ee27d73b2ba3d9b04fdc03e
--- /dev/null
+++ b/lib/plugins/extension/lang/it/lang.php
@@ -0,0 +1,43 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Francesco <francesco.cavalli@hotmail.com>
+ * @author Fabio <fabioslurp@yahoo.it>
+ */
+$lang['btn_enable']            = 'Abilita';
+$lang['btn_disable']           = 'Disabilita';
+$lang['btn_install']           = 'Installa';
+$lang['btn_reinstall']         = 'Reinstalla';
+$lang['search']                = 'Cerca';
+$lang['homepage_link']         = 'Documenti';
+$lang['bugs_features']         = 'Bug';
+$lang['tags']                  = 'Tag:';
+$lang['author_hint']           = 'Cerca estensioni per questo autore';
+$lang['installed']             = 'Installato:';
+$lang['downloadurl']           = 'URL download:';
+$lang['repository']            = 'Repository';
+$lang['installed_version']     = 'Versione installata';
+$lang['install_date']          = 'Il tuo ultimo aggiornamento:';
+$lang['available_version']     = 'Versione disponibile:';
+$lang['compatible']            = 'Compatibile con:';
+$lang['similar']               = 'Simile a:';
+$lang['donate']                = 'Simile a questo?';
+$lang['repo_retry']            = 'Riprova';
+$lang['status']                = 'Status:';
+$lang['status_installed']      = 'installato';
+$lang['status_not_installed']  = 'non installato';
+$lang['status_protected']      = 'protetto';
+$lang['status_enabled']        = 'abilitato';
+$lang['status_disabled']       = 'disabilitato';
+$lang['status_unmodifiable']   = 'inmodificabile';
+$lang['status_plugin']         = 'plugin';
+$lang['status_template']       = 'modello';
+$lang['error_badurl']          = 'URLs deve iniziare con http o https';
+$lang['error_dircreate']       = 'Impossibile creare una cartella temporanea per ricevere il download';
+$lang['error_download']        = 'Impossibile scaricare il file: %s';
+$lang['noperms']               = 'La directory Extension non è scrivibile';
+$lang['notplperms']            = 'Il modello di cartella non è scrivibile';
+$lang['nopluginperms']         = 'La cartella plugin non è scrivibile';
+$lang['install_url']           = 'Installa da URL:';
diff --git a/lib/plugins/extension/lang/ja/intro_install.txt b/lib/plugins/extension/lang/ja/intro_install.txt
index 889ed68799cf34679702306e34ad8cdaa61690ec..9f99b820256e9f195de2eee734b4194fd1e7e400 100644
--- a/lib/plugins/extension/lang/ja/intro_install.txt
+++ b/lib/plugins/extension/lang/ja/intro_install.txt
@@ -1 +1 @@
-ここでは、アップロードするかダウンロードURLを指定して、手動でプラグインやテンプレートをインストールできます。
+アップロードするかダウンロードURLを指定して、手動でプラグインやテンプレートをインストールできます。
diff --git a/lib/plugins/extension/lang/ja/intro_plugins.txt b/lib/plugins/extension/lang/ja/intro_plugins.txt
index 9bfc684319a4739092bc0c4ea7f674b3ca159ad7..b8251c7e896f70f3d27d00b5837946c8d4cfdce4 100644
--- a/lib/plugins/extension/lang/ja/intro_plugins.txt
+++ b/lib/plugins/extension/lang/ja/intro_plugins.txt
@@ -1 +1 @@
-このDokuWikiに現在インストールされているプラグインです。ここでは、これらプラグインを有効化、無効化、アンインストールすることができます。同様にプラグインのアップデートも表示されます。アップデート前に、プラグインのマニュアルをお読みください。
\ No newline at end of file
+このDokuWikiに現在インストールされているプラグインです。これらプラグインを有効化、無効化、アンインストールできます。更新はできる場合のみ表示されます。更新前に、プラグインの解説をお読みください。
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/ja/intro_templates.txt b/lib/plugins/extension/lang/ja/intro_templates.txt
index f97694aaaa04cbba96613d42e7f2f1da5c9981e3..5de6d2f0da6f1dfd78912b8970e78eb0957e402f 100644
--- a/lib/plugins/extension/lang/ja/intro_templates.txt
+++ b/lib/plugins/extension/lang/ja/intro_templates.txt
@@ -1 +1 @@
-このDokuWikiに現在インストールされているテンプレートです。[[?do=admin&page=config|設定管理]]で使用するテンプレートを選択できます。
\ No newline at end of file
+このDokuWikiに現在インストールされているテンプレートです。使用するテンプレートは[[?do=admin&page=config|設定管理]]で選択できます。
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/ja/lang.php b/lib/plugins/extension/lang/ja/lang.php
index 0401d7630a80dc1af254aacef989cc703cc46752..dec46d629f7e4cccc5b2d94501ddc44a0e1888f1 100644
--- a/lib/plugins/extension/lang/ja/lang.php
+++ b/lib/plugins/extension/lang/ja/lang.php
@@ -4,10 +4,12 @@
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
  * @author Hideaki SAWADA <chuno@live.jp>
+ * @author PzF_X <jp_minecraft@yahoo.co.jp>
  */
 $lang['menu']                  = '拡張機能管理';
 $lang['tab_plugins']           = 'インストール済プラグイン';
 $lang['tab_templates']         = 'インストール済テンプレート';
+$lang['tab_search']            = '検索とインストール';
 $lang['tab_install']           = '手動インストール';
 $lang['notimplemented']        = 'この機能は未実装です。';
 $lang['notinstalled']          = 'この拡張機能はインストールされていません。';
@@ -17,21 +19,44 @@ $lang['pluginlistsaveerror']   = 'プラグイン一覧の保存中にエラー
 $lang['unknownauthor']         = '作者不明';
 $lang['unknownversion']        = 'バージョン不明';
 $lang['btn_info']              = '詳細情報を表示する。';
-$lang['btn_update']            = 'アップデート';
+$lang['btn_update']            = 'æ›´æ–°';
 $lang['btn_uninstall']         = 'アンインストール';
 $lang['btn_enable']            = '有効化';
 $lang['btn_disable']           = '無効化';
 $lang['btn_install']           = 'インストール';
 $lang['btn_reinstall']         = '再インストール';
 $lang['js']['reallydel']       = 'この拡張機能を本当にアンインストールしますか?';
+$lang['search_for']            = '拡張機能の検索:';
+$lang['search']                = '検索';
+$lang['extensionby']           = '<strong>%s</strong> 作者: %s';
+$lang['screenshot']            = '%s のスクリーンショット';
+$lang['popularity']            = '利用状況:%s%%';
+$lang['homepage_link']         = '解説';
+$lang['bugs_features']         = 'バグ';
+$lang['tags']                  = 'タグ:';
+$lang['author_hint']           = 'この作者で拡張機能を検索';
+$lang['installed']             = 'インストール済:';
 $lang['downloadurl']           = 'ダウンロード URL:';
 $lang['repository']            = 'リポジトリ:';
+$lang['unknown']               = '<em>不明</em>';
+$lang['installed_version']     = 'インストール済バージョン:';
+$lang['install_date']          = '最終更新日:';
+$lang['available_version']     = '利用可能バージョン:';
+$lang['compatible']            = '互換:';
 $lang['depends']               = '依存:';
 $lang['similar']               = '類似:';
+$lang['conflicts']             = '競合:';
+$lang['donate']                = 'お気に入り?';
+$lang['donate_action']         = '寄付先';
+$lang['repo_retry']            = '再実行';
+$lang['provides']              = '提供:';
+$lang['status']                = '状態:';
 $lang['status_installed']      = 'インストール済';
 $lang['status_not_installed']  = '未インストール';
+$lang['status_protected']      = '保護されています';
 $lang['status_enabled']        = '有効';
 $lang['status_disabled']       = '無効';
+$lang['status_unmodifiable']   = '編集不可';
 $lang['status_plugin']         = 'プラグイン';
 $lang['status_template']       = 'テンプレート';
 $lang['status_bundled']        = '同梱';
@@ -39,16 +64,26 @@ $lang['msg_enabled']           = '%s プラグインを有効化しました。'
 $lang['msg_disabled']          = '%s プラグインを無効化しました。';
 $lang['msg_delete_success']    = '拡張機能をアンインストールしました。';
 $lang['msg_template_install_success'] = '%s テンプレートをインストールできました。';
-$lang['msg_template_update_success'] = '%s テンプレートをアップデートできました。';
+$lang['msg_template_update_success'] = '%s テンプレートを更新できました。';
 $lang['msg_plugin_install_success'] = '%s プラグインをインストールできました。';
-$lang['msg_plugin_update_success'] = '%s プラグインをアップデートできました。';
+$lang['msg_plugin_update_success'] = '%s プラグインを更新できました。';
 $lang['msg_upload_failed']     = 'ファイルのアップロードに失敗しました。';
+$lang['missing_dependency']    = '<strong>依存関係が欠落または無効:</strong> %s';
 $lang['security_issue']        = '<strong>セキュリティ問題:</strong> %s';
 $lang['security_warning']      = '<strong>セキュリティ警告:</strong> %s';
-$lang['update_available']      = '<strong>アップデート:</strong>%sの新バージョンが利用可能です。 ';
+$lang['update_available']      = '<strong>更新:</strong> %sの新バージョンが利用可能です。';
+$lang['wrong_folder']          = '<strong>プラグインは正しくインストールされませんでした:</strong> プラグインのディレクトリを "%s" から "%s" へ変更して下さい。';
+$lang['url_change']            = '<strong>URL が変更されました:</strong> 最後にダウンロードした後、ダウンロード URL が変更されました。拡張機能のアップデート前に新 URL が正しいかを確認して下さい。<br />新:%s<br />旧:%s';
 $lang['error_badurl']          = 'URLはhttpかhttpsで始まる必要があります。';
 $lang['error_dircreate']       = 'ダウンロード用の一時フォルダが作成できません。';
 $lang['error_download']        = 'ファイルをダウンロードできません:%s';
+$lang['error_decompress']      = 'ダウンロードしたファイルを解凍できません。ダウンロードの失敗の結果であれば、再度試して下さい。圧縮形式が不明の場合は、手動でダウンロード・インストールしてください。';
+$lang['error_findfolder']      = '拡張機能ディレクトリを認識できません。手動でダウンロード・インストールしてください。';
+$lang['error_copy']            = '<em>%s</em> ディレクトリのファイルをインストールしようとした時、ファイルコピーエラーが発生しました:ディスクがいっぱいかもしれませんし、ファイルのアクセス権が正しくないかもしれません。プラグインが一部分インストールされ、wiki が不安定になるかもしれません。';
 $lang['noperms']               = '拡張機能ディレクトリが書き込み不可です。';
 $lang['notplperms']            = 'テンプレートディレクトリが書き込み不可です。';
 $lang['nopluginperms']         = 'プラグインディレクトリが書き込み不可です。';
+$lang['git']                   = 'この拡張機能は Git 経由でインストールされており、ここで更新すべきでないかもしれません。';
+$lang['install_url']           = 'URL からインストール:';
+$lang['install_upload']        = '拡張機能をアップロード:';
+$lang['repo_error']            = 'プラグインのリポジトリに接続できません。サーバーが www.dokuwiki.org に接続できることやプロキシの設定を確認して下さい。';
diff --git a/lib/plugins/extension/lang/ko/intro_install.txt b/lib/plugins/extension/lang/ko/intro_install.txt
new file mode 100644
index 0000000000000000000000000000000000000000..269df29ccae7e8aa3ed2566ff666034aa528d24c
--- /dev/null
+++ b/lib/plugins/extension/lang/ko/intro_install.txt
@@ -0,0 +1 @@
+여기에 플러그인과 템플릿을 수동으로 올리거나 직접 다운로드 URL을 제공하여 수동으로 설치할 수 있습니다.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/ko/intro_plugins.txt b/lib/plugins/extension/lang/ko/intro_plugins.txt
new file mode 100644
index 0000000000000000000000000000000000000000..9ac7a3d8983e9d6443630b7e105d204d6a1ace7f
--- /dev/null
+++ b/lib/plugins/extension/lang/ko/intro_plugins.txt
@@ -0,0 +1 @@
+도쿠위키에 현재 설치된 플러그인입니다. 여기에서 플러그인을 활성화 또는 비활성화하거나 심지어 완전히 제거할 수 있습니다. 또한 플러그인 업데이트는 여기에 보여집니다. 업데이트하기 전에 플러그인의 설명문서를 읽으십시오.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/ko/intro_search.txt b/lib/plugins/extension/lang/ko/intro_search.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b6760264ec4a3bbfead60d875ff944753373b76b
--- /dev/null
+++ b/lib/plugins/extension/lang/ko/intro_search.txt
@@ -0,0 +1 @@
+이 탭은 도쿠위키를 위한 사용할 수 있는 모든 타사 플러그인과 템플릿에 접근하도록 제공합니다. 타사 코드를 설치하면 **보안 위험에 노출**될 수 있음을 유의하십시오, 먼저 [[doku>security#plugin_security|플러그인 보안]]에 대해 읽을 수 있습니다.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/ko/intro_templates.txt b/lib/plugins/extension/lang/ko/intro_templates.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d4320b8802f1272c07ee3f149613951b76bbec61
--- /dev/null
+++ b/lib/plugins/extension/lang/ko/intro_templates.txt
@@ -0,0 +1 @@
+도쿠위키에 현재 설치된 템플릿입니다. [[?do=admin&page=config|환경 설정 관리자]]에서 사용하는 템플릿을 선택할 수 있습니다.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/ko/lang.php b/lib/plugins/extension/lang/ko/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..53c9b4481b0aea19eab9179a08f79027e5495725
--- /dev/null
+++ b/lib/plugins/extension/lang/ko/lang.php
@@ -0,0 +1,89 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Young gon Cha <garmede@gmail.com>
+ * @author Myeongjin <aranet100@gmail.com>
+ */
+$lang['menu']                  = '확장 기능 관리자';
+$lang['tab_plugins']           = '설치된 플러그인';
+$lang['tab_templates']         = '설치된 템플릿';
+$lang['tab_search']            = '검색하고 설치';
+$lang['tab_install']           = '수동 설치';
+$lang['notimplemented']        = '이 기능은 아직 구현되지 않았습니다';
+$lang['notinstalled']          = '이 확장 기능은 설치되어 있지 않습니다';
+$lang['alreadyenabled']        = '이 확장 기능이 이미 활성화되어 있습니다';
+$lang['alreadydisabled']       = '이 확장 기능이 이미 비활성화되어 있습니다';
+$lang['pluginlistsaveerror']   = '플러그인 목록을 저장하는 중 오류가 있었습니다';
+$lang['unknownauthor']         = '알 수 없는 저자';
+$lang['unknownversion']        = '알 수 없는 버전';
+$lang['btn_info']              = '정보 더 보기';
+$lang['btn_update']            = '업데이트';
+$lang['btn_uninstall']         = '제거';
+$lang['btn_enable']            = '활성화';
+$lang['btn_disable']           = '비활성화';
+$lang['btn_install']           = '설치';
+$lang['btn_reinstall']         = '다시 설치';
+$lang['js']['reallydel']       = '정말 이 확장 기능을 제거하겠습니까?';
+$lang['search_for']            = '확장 기능 검색:';
+$lang['search']                = '검색';
+$lang['extensionby']           = '<strong>%s</strong> (저자 %s)';
+$lang['screenshot']            = '%s의 스크린샷';
+$lang['popularity']            = '인기: %s%%';
+$lang['homepage_link']         = '문서';
+$lang['bugs_features']         = '버그';
+$lang['tags']                  = '태그:';
+$lang['author_hint']           = '이 저자로 확장 기능 검색';
+$lang['installed']             = '설치됨:';
+$lang['downloadurl']           = '다운로드 URL:';
+$lang['repository']            = '저장소:';
+$lang['unknown']               = '<em>알 수 없음</em>';
+$lang['installed_version']     = '설치된 버전:';
+$lang['install_date']          = '마지막 업데이트:';
+$lang['available_version']     = '가능한 버전:';
+$lang['compatible']            = '다음과의 호환성:';
+$lang['depends']               = '다음에 의존:';
+$lang['similar']               = '다음과 비슷:';
+$lang['conflicts']             = '다음과 충돌:';
+$lang['donate']                = '이것이 좋나요?';
+$lang['donate_action']         = '저자에게 커피를 사주세요!';
+$lang['repo_retry']            = '다시 시도';
+$lang['provides']              = '제공:';
+$lang['status']                = '상태:';
+$lang['status_installed']      = '설치됨';
+$lang['status_not_installed']  = '설치되지 않음';
+$lang['status_protected']      = '보호됨';
+$lang['status_enabled']        = '활성화됨';
+$lang['status_disabled']       = '비활성화됨';
+$lang['status_unmodifiable']   = '수정할 수 없음';
+$lang['status_plugin']         = '플러그인';
+$lang['status_template']       = '템플릿';
+$lang['status_bundled']        = '포함';
+$lang['msg_enabled']           = '%s 플러그인이 활성화되었습니다';
+$lang['msg_disabled']          = '%s 플러그인이 비활성화되었습니다';
+$lang['msg_delete_success']    = '확장 기능이 제거되었습니다';
+$lang['msg_template_install_success'] = '%s 템플릿을 성공적으로 설치했습니다';
+$lang['msg_template_update_success'] = '%s 템플릿을 성공적으로 업데이트했습니다';
+$lang['msg_plugin_install_success'] = '%s 플러그인을 성공적으로 설치했습니다';
+$lang['msg_plugin_update_success'] = '%s 플러그인을 성공적으로 업데이트했습니다';
+$lang['msg_upload_failed']     = '파일 올리기에 실패했습니다';
+$lang['missing_dependency']    = '<strong>의존성을 잃었거나 비활성화되어 있습니다:</strong> %s';
+$lang['security_issue']        = '<strong>보안 문제:</strong> %s';
+$lang['security_warning']      = '<strong>보안 경고:</strong> %s';
+$lang['update_available']      = '<strong>업데이트:</strong> 새 버전 %s(을)를 사용할 수 있습니다.';
+$lang['wrong_folder']          = '<strong>플러그인이 올바르지 않게 설치됨:</strong> 플러그인 디렉터리를 "%s"에서 "%s"로 이름을 바꾸세요.';
+$lang['url_change']            = '<strong>URL이 바뀜:</strong> 다운로드 URL이 최신 다운로드 이래로 바뀌었습니다. 확장 기능을 업데이트하기 전에 새 URL이 올바른지 확인하세요.<br />새 URL: %s<br />오래된 URL: %s';
+$lang['error_badurl']          = 'URL은 http나 https로 시작해야 합니다';
+$lang['error_dircreate']       = '다운로드를 받을 임시 폴더를 만들 수 없습니다';
+$lang['error_download']        = '파일을 다운로드할 수 없습니다: %s';
+$lang['error_decompress']      = '다운로드한 파일의 압축을 풀 수 없습니다. 이는 아마도 잘못된 다운로드의 결과로, 이럴 경우 다시 시도해야 합니다; 또는 압축 형식을 알 수 없으며, 이럴 경우 수동으로 다운로드하고 설치해야 합니다.';
+$lang['error_findfolder']      = '확장 기능 디렉터리를 식별할 수 없습니다, 수동으로 다운로드하고 설치해야 합니다';
+$lang['error_copy']            = '<em>%s</em> 디렉터리에 파일을 설치하는 동안 파일 복사 오류가 발생했습니다: 디스크가 꽉 찼거나 파일 접근 권한이 잘못되었을 수도 있습니다. 플러그인 설치가 부분적으로 되었거나 불안정하게 위키 설치가 되었을 수 있습니다.';
+$lang['noperms']               = '확장 기능 디렉터리에 쓸 수 없습니다';
+$lang['notplperms']            = '임시 디렉터리에 쓸 수 없습니다';
+$lang['nopluginperms']         = '플러그인 디렉터리에 쓸 수 없습니다';
+$lang['git']                   = '이 확장 기능은 git을 통해 설치되었으며, 여기에서 업데이트할 수 없을 수 있습니다.';
+$lang['install_url']           = 'URL에서 설치:';
+$lang['install_upload']        = '확장 기능 올리기:';
+$lang['repo_error']            = '플러그인 저장소에 연결할 수 없습니다. 서버가 www.dokuwiki.org에 연결할 수 있는지 확인하고 프록시 설정을 확인하세요.';
diff --git a/lib/plugins/extension/lang/lv/intro_templates.txt b/lib/plugins/extension/lang/lv/intro_templates.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1014c7c1e06fe82aa29392a4336961854234d590
--- /dev/null
+++ b/lib/plugins/extension/lang/lv/intro_templates.txt
@@ -0,0 +1 @@
+DokuWiki ir instalēti šādi šabloni. Lietojamo šablonu var norādīt  [[?do=admin&page=config|Konfigurācijas lapā]].
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/lv/lang.php b/lib/plugins/extension/lang/lv/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..e7e9bdfd9a1206a86a72129c74748f2d2fbe946a
--- /dev/null
+++ b/lib/plugins/extension/lang/lv/lang.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Aivars Miška <allefm@gmail.com>
+ */
+$lang['msg_delete_success']    = 'Papildinājums atinstalēts';
diff --git a/lib/plugins/extension/lang/nl/intro_plugins.txt b/lib/plugins/extension/lang/nl/intro_plugins.txt
index 0077aca30be1c895ca0b9f520bd38984a927a3c6..e12bdf0f8c85705fc11de7cb265a9e66e5737c76 100644
--- a/lib/plugins/extension/lang/nl/intro_plugins.txt
+++ b/lib/plugins/extension/lang/nl/intro_plugins.txt
@@ -1 +1 @@
-Dit zijn de momenteel in uw Dokuwiki geïnstalleerde plugins. U kunt deze hier aan of uitschakelen danwel geheel deïnstalleren. Plugin updates zijn hier ook opgenomen, lees de pluin documentatie voordat u update.
\ No newline at end of file
+Dit zijn de momenteel in uw Dokuwiki geïnstalleerde plugins. U kunt deze hier aan of uitschakelen danwel geheel deïnstalleren. Plugin updates zijn hier ook opgenomen, lees de plugin documentatie voordat u update.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/nl/intro_search.txt b/lib/plugins/extension/lang/nl/intro_search.txt
index 8fc3900adefae817201993568db03627e722baed..f0c8d7435069c2f2b1cd34b0d310120363495d83 100644
--- a/lib/plugins/extension/lang/nl/intro_search.txt
+++ b/lib/plugins/extension/lang/nl/intro_search.txt
@@ -1 +1 @@
-Deze tab verschaft u toegang tot alle plugins en templates vervaardigd door derden en bestemd voor Dokuwiki. Houdt er rekening meel dat indien u Plugins van derden installeerd deze een **veiligheids risico ** kunnen bevatten, geadviseerd wordt om eerst te lezen [[doku>security#plugin_security|plugin security]].
\ No newline at end of file
+Deze tab verschaft u toegang tot alle plugins en templates vervaardigd door derden en bestemd voor Dokuwiki. Houdt er rekening mee dat indien u Plugins van derden installeert deze een **veiligheids risico ** kunnen bevatten, geadviseerd wordt om eerst te lezen [[doku>security#plugin_security|plugin security]].
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/nl/intro_templates.txt b/lib/plugins/extension/lang/nl/intro_templates.txt
index 5ef23dadf1dc43dfcfaa4fa84790dc5ae1b2175c..52c96cef73d7e149e6834f207379af61efd2393b 100644
--- a/lib/plugins/extension/lang/nl/intro_templates.txt
+++ b/lib/plugins/extension/lang/nl/intro_templates.txt
@@ -1 +1 @@
-Deze templates zijn thans in DokuWiki geïnstalleerd. U kent een template selecteren middels [[?do=admin&page=config|Configuration Manager]] .
\ No newline at end of file
+Deze templates zijn thans in DokuWiki geïnstalleerd. U kunt een template selecteren middels [[?do=admin&page=config|Configuration Manager]] .
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/nl/lang.php b/lib/plugins/extension/lang/nl/lang.php
index 2983f9fee215c6d93c31078969082e040fdc5dc2..a54924e937bcba8aa73130ac752d888d7acd5799 100644
--- a/lib/plugins/extension/lang/nl/lang.php
+++ b/lib/plugins/extension/lang/nl/lang.php
@@ -4,8 +4,10 @@
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
  * @author Rene <wllywlnt@yahoo.com>
+ * @author Gerrit Uitslag <klapinklapin@gmail.com>
+ * @author Johan Vervloet <johan.vervloet@gmail.com>
  */
-$lang['menu']                  = 'Extension Manager (Uitbreidings Beheerder)';
+$lang['menu']                  = 'Uitbreidingen';
 $lang['tab_plugins']           = 'Geïnstalleerde Plugins';
 $lang['tab_templates']         = 'Geïnstalleerde Templates';
 $lang['tab_search']            = 'Zoek en installeer';
@@ -24,28 +26,28 @@ $lang['btn_enable']            = 'Schakel aan';
 $lang['btn_disable']           = 'Schakel uit';
 $lang['btn_install']           = 'Installeer';
 $lang['btn_reinstall']         = 'Her-installeer';
-$lang['js']['reallydel']       = 'Wilt u deze uitbreiding deinstalleren ?';
+$lang['js']['reallydel']       = 'Wilt u deze uitbreiding deinstalleren?';
 $lang['search_for']            = 'Zoek Uitbreiding:';
 $lang['search']                = 'Zoek';
 $lang['extensionby']           = '<strong>%s</strong> by %s';
 $lang['screenshot']            = 'Schermafdruk bij %s';
 $lang['popularity']            = 'Populariteit:%s%%';
-$lang['homepage_link']         = 'Dokumenten';
+$lang['homepage_link']         = 'Documentatie';
 $lang['bugs_features']         = 'Bugs';
 $lang['tags']                  = 'Tags:';
 $lang['author_hint']           = 'Zoek uitbreidingen van deze auteur:';
 $lang['installed']             = 'Geinstalleerd:';
 $lang['downloadurl']           = 'Download URL:';
-$lang['repository']            = 'Repository ( centrale opslag)';
+$lang['repository']            = 'Centrale opslag:';
 $lang['unknown']               = '<em>onbekend</em>';
-$lang['installed_version']     = 'Geïnstalleerde versie';
-$lang['install_date']          = 'Uw laatste update :';
+$lang['installed_version']     = 'Geïnstalleerde versie:';
+$lang['install_date']          = 'Uw laatste update:';
 $lang['available_version']     = 'Beschikbare versie:';
-$lang['compatible']            = 'Compatible met :';
-$lang['depends']               = 'Afhankelijk van :';
-$lang['similar']               = 'Soortgelijk :';
-$lang['conflicts']             = 'Conflicteerd met :';
-$lang['donate']                = 'Vindt u dit leuk ?';
+$lang['compatible']            = 'Compatible met:';
+$lang['depends']               = 'Afhankelijk van:';
+$lang['similar']               = 'Soortgelijk:';
+$lang['conflicts']             = 'Conflicteerd met:';
+$lang['donate']                = 'Vindt u dit leuk?';
 $lang['donate_action']         = 'Koop een kop koffie voor de auteur!';
 $lang['repo_retry']            = 'Herhaal';
 $lang['provides']              = 'Zorgt voor:';
@@ -63,16 +65,16 @@ $lang['msg_enabled']           = 'Plugin %s ingeschakeld';
 $lang['msg_disabled']          = 'Plugin %s uitgeschakeld';
 $lang['msg_delete_success']    = 'Uitbreiding gedeinstalleerd';
 $lang['msg_template_install_success'] = 'Template %s werd succesvol geïnstalleerd';
-$lang['msg_template_update_success'] = 'Template %s werd succesvol ge-update';
+$lang['msg_template_update_success'] = 'Template %s werd succesvol geüpdatet';
 $lang['msg_plugin_install_success'] = 'Plugin %s werd succesvol geïnstalleerd';
-$lang['msg_plugin_update_success'] = 'Plugin %s werd succesvol ge-update';
+$lang['msg_plugin_update_success'] = 'Plugin %s werd succesvol geüpdatet';
 $lang['msg_upload_failed']     = 'Uploaden van het bestand is mislukt';
 $lang['missing_dependency']    = '<strong>niet aanwezige of uitgeschakelde afhankelijkheid</strong> %s';
 $lang['security_issue']        = '<strong>Veiligheids kwestie:</strong> %s';
 $lang['security_warning']      = '<strong>Veiligheids Waarschuwing</strong> %s';
 $lang['update_available']      = '<strong>Update:</strong> Nieuwe versie %s is beschikbaar.';
 $lang['wrong_folder']          = '<strong>Plugin onjuist geïnstalleerd:</strong> Hernoem de plugin directory van "%s" naar"%s"';
-$lang['url_change']            = '<strong>URL gewijzigd:</strong> Download URL is gewijzigd sinds de laatste download. Controleer of de nieuwe URL juist is voordat u de uitbreiding update. <br />Nieuw:%s<Br /> Vorig: %s';
+$lang['url_change']            = '<strong>URL gewijzigd:</strong> Download URL is gewijzigd sinds de laatste download. Controleer of de nieuwe URL juist is voordat u de uitbreiding updatet. <br />Nieuw:%s<Br /> Vorig: %s';
 $lang['error_badurl']          = 'URLs moeten beginnen met http of https';
 $lang['error_dircreate']       = 'De tijdelijke map kon niet worden gemaakt om de download te ontvangen';
 $lang['error_download']        = 'Het is niet mogelijk het bestand te downloaden: %s';
@@ -85,3 +87,4 @@ $lang['nopluginperms']         = 'Plugin directory is niet schrijfbaar';
 $lang['git']                   = 'De uitbreiding werd geïnstalleerd via git, u wilt deze hier wellicht niet aanpassen.';
 $lang['install_url']           = 'Installeer vanaf URL:';
 $lang['install_upload']        = 'Upload Uitbreiding:';
+$lang['repo_error']            = 'Er kon geen verbinding worden gemaakt met de centrale plugin opslag. Controleer of de server verbinding mag maken met www.dokuwiki.org en controleer de proxy instellingen.';
diff --git a/lib/plugins/extension/lang/pl/lang.php b/lib/plugins/extension/lang/pl/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..4fdca79c9caca2c538744cc84e7cce18b1266250
--- /dev/null
+++ b/lib/plugins/extension/lang/pl/lang.php
@@ -0,0 +1,39 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Mati <mackosa@wp.pl>
+ */
+$lang['menu']                  = 'Menedżer rozszerzeń';
+$lang['tab_plugins']           = 'Zainstalowane dodatki';
+$lang['tab_search']            = 'Znajdź i zainstaluj';
+$lang['notinstalled']          = 'Te rozszerzenie nie zostało zainstalowane';
+$lang['alreadyenabled']        = 'Te rozszerzenie jest już uruchomione';
+$lang['unknownauthor']         = 'Nieznany autor';
+$lang['unknownversion']        = 'Nieznana wersja';
+$lang['btn_info']              = 'Pokaż więcej informacji';
+$lang['btn_enable']            = 'Uruchom';
+$lang['btn_disable']           = 'Wyłącz';
+$lang['btn_reinstall']         = 'Ponowna instalacja';
+$lang['js']['reallydel']       = 'Naprawdę odinstalować te rozszerzenie?';
+$lang['search']                = 'Szukaj';
+$lang['bugs_features']         = 'Błędy';
+$lang['tags']                  = 'Tagi:';
+$lang['installed']             = 'Zainstalowano:';
+$lang['repository']            = 'Repozytorium';
+$lang['installed_version']     = 'Zainstalowana wersja:';
+$lang['install_date']          = 'Twoja ostatnia aktualizacja:';
+$lang['available_version']     = 'Dostępna wersja:';
+$lang['depends']               = 'Zależy od:';
+$lang['conflicts']             = 'Konflikt z:';
+$lang['donate']                = 'Lubisz to?';
+$lang['donate_action']         = 'Kup autorowi kawÄ™!';
+$lang['repo_retry']            = 'Ponów';
+$lang['status']                = 'Status:';
+$lang['status_installed']      = 'zainstalowano';
+$lang['status_not_installed']  = 'nie zainstalowano';
+$lang['status_enabled']        = 'uruchomione';
+$lang['status_disabled']       = 'wyłączone';
+$lang['status_plugin']         = 'dodatek';
+$lang['msg_delete_success']    = 'Rozszerzenie odinstalowane';
diff --git a/lib/plugins/extension/lang/pt-br/intro_install.txt b/lib/plugins/extension/lang/pt-br/intro_install.txt
new file mode 100644
index 0000000000000000000000000000000000000000..08527b0f69bbb6fb87be60f8c0272d10ad2d2f53
--- /dev/null
+++ b/lib/plugins/extension/lang/pt-br/intro_install.txt
@@ -0,0 +1 @@
+Aqui você pode instalar extensões e modelos manualmente, ou subindo eles ou submetendo uma URL de baixar diretamente.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/pt-br/intro_plugins.txt b/lib/plugins/extension/lang/pt-br/intro_plugins.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e0a8c7f3f639dcab3e58679a3e20b2d645c0aa8f
--- /dev/null
+++ b/lib/plugins/extension/lang/pt-br/intro_plugins.txt
@@ -0,0 +1 @@
+Estas são as extensões instaladas atualmente no seu DokuWiki. Você pode habilitar ou desabilitar ou desinstalar completamente elas aqui. Atualizações das extensões também são mostradas, certifique-se de ler a documentação da extensão antes de atualizá-la.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/pt-br/intro_search.txt b/lib/plugins/extension/lang/pt-br/intro_search.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f2101d73b109c1699dae4c8eeb1471308fe5dd0f
--- /dev/null
+++ b/lib/plugins/extension/lang/pt-br/intro_search.txt
@@ -0,0 +1 @@
+Esta aba lhe dá acesso a extensões e modelos disponibilizados por terceiros para o DokuWiki. Favor ter cuidado pois instalar código de terceiros pode acarretar um **risco de segurança**, você poderia ler sobre [[doku>security#plugin_security|segurança de extensões]] primeiramente.
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/pt-br/intro_templates.txt b/lib/plugins/extension/lang/pt-br/intro_templates.txt
new file mode 100644
index 0000000000000000000000000000000000000000..aa3e07f0c5b54d17e613760bc67ae3980327d9df
--- /dev/null
+++ b/lib/plugins/extension/lang/pt-br/intro_templates.txt
@@ -0,0 +1 @@
+Estes são os modelos instalados atualmente no seu DokuWiki. Você pode selecionar o modelo a ser usado no [[?do=admin&page=config|Configuration Manager]].
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/pt-br/lang.php b/lib/plugins/extension/lang/pt-br/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..0d897616abd4425aaa742da2b25214133519a9ac
--- /dev/null
+++ b/lib/plugins/extension/lang/pt-br/lang.php
@@ -0,0 +1,75 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Felipe Castro <fefcas@gmail.com>
+ */
+$lang['menu']                  = 'Gerenciador de extensões';
+$lang['tab_plugins']           = 'Extensões instaladas';
+$lang['tab_templates']         = 'Modelos instalados';
+$lang['tab_search']            = 'Procurar e instalar';
+$lang['tab_install']           = 'Instalar manualmente';
+$lang['notimplemented']        = 'Esta função ainda não foi implementada';
+$lang['notinstalled']          = 'Esta extensão não está instalada';
+$lang['alreadyenabled']        = 'Esta extensão já foi habilitada';
+$lang['alreadydisabled']       = 'Esta extensão já foi desabilitada';
+$lang['pluginlistsaveerror']   = 'Houve um erro ao salvar a lista de extensões';
+$lang['unknownauthor']         = 'Autor desconhecido';
+$lang['unknownversion']        = 'Versão desconhecida';
+$lang['btn_info']              = 'Mostrar mais informações';
+$lang['btn_update']            = 'Atualizar';
+$lang['btn_uninstall']         = 'Desinstalar';
+$lang['btn_enable']            = 'Habilitar';
+$lang['btn_disable']           = 'Desabilitar';
+$lang['btn_install']           = 'Instalar';
+$lang['btn_reinstall']         = 'Re-instalar';
+$lang['js']['reallydel']       = 'Quer mesmo desinstalar esta extensão?';
+$lang['search_for']            = 'Procurar extensão:';
+$lang['search']                = 'Procurar';
+$lang['extensionby']           = '<strong>%s</strong> de %s';
+$lang['screenshot']            = 'Tela congelada de %s';
+$lang['popularity']            = 'Popularidade: %s%%';
+$lang['homepage_link']         = 'Docs';
+$lang['bugs_features']         = 'Erros';
+$lang['tags']                  = 'Etiquetas:';
+$lang['author_hint']           = 'Procurar extensões deste autor';
+$lang['installed']             = 'Instalado:';
+$lang['downloadurl']           = 'URL para baixar:';
+$lang['repository']            = 'Repositório:';
+$lang['unknown']               = '<em>desconhecido</em>';
+$lang['installed_version']     = 'Versão instalada:';
+$lang['install_date']          = 'Sua última atualização:';
+$lang['available_version']     = 'Versão disponível:';
+$lang['compatible']            = 'Compatível com:';
+$lang['depends']               = 'Depende de:';
+$lang['similar']               = 'Similar a:';
+$lang['conflicts']             = 'Colide com:';
+$lang['donate']                = 'Gostou deste?';
+$lang['donate_action']         = 'Pague um café ao autor!';
+$lang['repo_retry']            = 'Tentar de novo';
+$lang['provides']              = 'Disponibiliza:';
+$lang['status']                = 'Estado:';
+$lang['status_installed']      = 'instalado';
+$lang['status_not_installed']  = 'não instalado';
+$lang['status_protected']      = 'protegido';
+$lang['status_enabled']        = 'habilitado';
+$lang['status_disabled']       = 'desabilitado';
+$lang['status_unmodifiable']   = 'não modificável';
+$lang['status_plugin']         = 'extensão';
+$lang['status_template']       = 'modelo';
+$lang['status_bundled']        = 'agrupado';
+$lang['msg_enabled']           = 'Extensão %s habilitada';
+$lang['msg_disabled']          = 'Extensão %s desabilitada';
+$lang['msg_delete_success']    = 'Extensão desinstalada';
+$lang['msg_template_install_success'] = 'Modelo %s instalado com sucesso';
+$lang['msg_template_update_success'] = 'Modelo %s atualizado com sucesso';
+$lang['msg_plugin_install_success'] = 'Extensão %s instalada com sucesso';
+$lang['msg_plugin_update_success'] = 'Extensão %s atualizada com sucesso';
+$lang['msg_upload_failed']     = 'Subida do arquivo falhou';
+$lang['missing_dependency']    = '<strong>Dependência faltante ou desabilitada:</strong> %s';
+$lang['security_issue']        = '<strong>Problema com segurança:</strong> %s';
+$lang['security_warning']      = '<strong>Aviso sobre segurança:</strong> %s';
+$lang['update_available']      = '<strong>Atualização:</strong> Nova versão %s está disponível.';
+$lang['wrong_folder']          = '<strong>Extensão instalada incorretamente:</strong> Renomeie o diretório de extensões "%s" para "%s".';
+$lang['url_change']            = '<strong>URL mudou:</strong> A URL para baixar mudou desde a última baixada. Verifique se a nova URL é válida antes de atualizar a extensão.<br />Novo: %s<br />Velho: %s';
diff --git a/lib/plugins/extension/lang/ru/lang.php b/lib/plugins/extension/lang/ru/lang.php
index d524f072b17979774bd09eb0164cb4591bbe9fb1..fa1625f280c1dfcb4fdb1df5f289eb8fe0421c55 100644
--- a/lib/plugins/extension/lang/ru/lang.php
+++ b/lib/plugins/extension/lang/ru/lang.php
@@ -4,6 +4,7 @@
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  * 
  * @author Aleksandr Selivanov <alexgearbox@yandex.ru>
+ * @author Igor Degraf <igordegraf@gmail.com>
  */
 $lang['menu']                  = 'Управление дополнениями';
 $lang['tab_plugins']           = 'Установленные плагины';
@@ -58,3 +59,10 @@ $lang['msg_template_install_success'] = 'Шаблон %s успешно уста
 $lang['msg_template_update_success'] = 'Шаблон %s успешно обновлён';
 $lang['msg_plugin_install_success'] = 'Плагин %s успешно установлен';
 $lang['msg_plugin_update_success'] = 'Плагин %s успешно обновлён';
+$lang['noperms']               = 'Папка для расширений не доступна на запись';
+$lang['notplperms']            = 'Папка для шаблонов не доступна на запись';
+$lang['nopluginperms']         = 'Папка плагинов не доступна на запись';
+$lang['git']                   = 'Это расширение было установлено через git, Вы не можете обновить его тут.';
+$lang['install_url']           = 'Установить с адреса URL:';
+$lang['install_upload']        = 'Скачать расширение:';
+$lang['repo_error']            = 'Сайт с плагинами недоступен. Убедитесь, что у сайта есть доступ на www.dokuwiki.org и также проверьте настройки соединения прокси.';
diff --git a/lib/plugins/extension/lang/tr/lang.php b/lib/plugins/extension/lang/tr/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..dfabfa715a63ee1b260a3f658bfb4a285ecf30e1
--- /dev/null
+++ b/lib/plugins/extension/lang/tr/lang.php
@@ -0,0 +1,60 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author İlker R. Kapaç <irifat@gmail.com>
+ */
+$lang['menu']                  = 'Genişletme Yöneticisi';
+$lang['tab_plugins']           = 'KurulmuÅŸ Eklentiler';
+$lang['tab_templates']         = 'KurulmuÅŸ Åžablonlar';
+$lang['tab_search']            = 'Ara ve Kur';
+$lang['tab_install']           = 'Elle Kurulum';
+$lang['notimplemented']        = 'Bu özellik henüz uygulamaya geçmemiştir';
+$lang['notinstalled']          = 'Bu genişletme yüklü değildir';
+$lang['alreadyenabled']        = 'Bu geniÅŸletme zaten etkinleÅŸtirilmiÅŸtir.';
+$lang['alreadydisabled']       = 'Bu geniÅŸletme zaten pasifleÅŸtirilmiÅŸtir';
+$lang['pluginlistsaveerror']   = 'Eklenti listesini kaydederken bir hata oluÅŸtu.';
+$lang['unknownauthor']         = 'Bilinmeyen yazar';
+$lang['unknownversion']        = 'Bilinmeyen sürüm';
+$lang['btn_info']              = 'Daha fazla bilgi göster';
+$lang['btn_update']            = 'Güncelle';
+$lang['btn_uninstall']         = 'Kaldır';
+$lang['btn_enable']            = 'EtkinleÅŸtir';
+$lang['btn_disable']           = 'PasifleÅŸtir';
+$lang['btn_install']           = 'Kur';
+$lang['btn_reinstall']         = 'Yeniden kur';
+$lang['js']['reallydel']       = 'Genişletme gerçekten kaldırılsın mı?';
+$lang['search_for']            = 'GeniÅŸletme Ara:';
+$lang['search']                = 'Ara';
+$lang['extensionby']           = '<strong>%s</strong> tarafından %s';
+$lang['screenshot']            = '%s ekran görüntüsü';
+$lang['popularity']            = 'RaÄŸbet: %s%%';
+$lang['homepage_link']         = 'Belgeler';
+$lang['bugs_features']         = 'Hatalar';
+$lang['tags']                  = 'Etiketler:';
+$lang['author_hint']           = 'Bu yazarın genişletmelerini ara.';
+$lang['installed']             = 'Kurulu:';
+$lang['downloadurl']           = 'İndirme bağlantısı:';
+$lang['repository']            = 'Veri havuzu:';
+$lang['unknown']               = '<em>bilinmeyen</em>';
+$lang['installed_version']     = 'Kurulu sürüm:';
+$lang['install_date']          = 'Son güncellemeniz:';
+$lang['available_version']     = 'Müsait sürüm:';
+$lang['compatible']            = 'Åžununla uyumlu:';
+$lang['depends']               = 'Şuna bağımlı';
+$lang['similar']               = 'Åžununla benzer';
+$lang['conflicts']             = 'Şununla çelişir';
+$lang['donate']                = 'BeÄŸendiniz mi?';
+$lang['donate_action']         = 'Yazara bir kahve ısmarlayın!';
+$lang['repo_retry']            = 'Yeniden dene';
+$lang['provides']              = 'SaÄŸlar:';
+$lang['status']                = 'Durum:';
+$lang['status_installed']      = 'kurulu';
+$lang['status_not_installed']  = 'kurulu deÄŸil';
+$lang['status_protected']      = 'korunmuÅŸ';
+$lang['status_enabled']        = 'etkin';
+$lang['status_disabled']       = 'hizmet dışı';
+$lang['status_unmodifiable']   = 'deÄŸiÅŸtirilemez';
+$lang['status_plugin']         = 'eklenti';
+$lang['status_template']       = 'ÅŸablon';
diff --git a/lib/plugins/extension/lang/zh-tw/intro_install.txt b/lib/plugins/extension/lang/zh-tw/intro_install.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3ba93f5f8d17fa55254176e23726ba637aed4ff2
--- /dev/null
+++ b/lib/plugins/extension/lang/zh-tw/intro_install.txt
@@ -0,0 +1 @@
+在此你可以透過檔案上傳或提供下載網址的方式,進行手動安裝外掛與版型風格。
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/zh-tw/lang.php b/lib/plugins/extension/lang/zh-tw/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..a86364d7ab6dcf5c5b414587644f38e236342536
--- /dev/null
+++ b/lib/plugins/extension/lang/zh-tw/lang.php
@@ -0,0 +1,50 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Stan <talktostan@gmail.com>
+ * @author June-Hao Hou <junehao@gmail.com>
+ */
+$lang['menu']                  = '延伸功能管理';
+$lang['tab_plugins']           = '已安裝外掛';
+$lang['tab_templates']         = '已安裝裝模版
+';
+$lang['tab_search']            = '搜尋與安裝';
+$lang['tab_install']           = '手動安裝';
+$lang['notimplemented']        = '此功能尚未完成';
+$lang['notinstalled']          = '此延伸功能尚未安裝';
+$lang['alreadyenabled']        = '此延伸功能已經安裝';
+$lang['alreadydisabled']       = '此延伸功能停用';
+$lang['unknownauthor']         = '作者未知';
+$lang['unknownversion']        = '版本未知';
+$lang['btn_info']              = '顯示更多訊息';
+$lang['btn_update']            = 'æ›´æ–°';
+$lang['btn_uninstall']         = '移除安裝';
+$lang['btn_enable']            = '啟用';
+$lang['btn_disable']           = '停用';
+$lang['btn_install']           = '安裝';
+$lang['btn_reinstall']         = '重新安裝';
+$lang['js']['reallydel']       = '確定要移除此延伸功能?';
+$lang['search_for']            = '搜尋延伸功能:';
+$lang['search']                = '搜尋';
+$lang['tags']                  = '標籤:';
+$lang['author_hint']           = '搜尋相同作者的延伸功能';
+$lang['installed']             = '已安裝:';
+$lang['downloadurl']           = '下載網址:';
+$lang['installed_version']     = '已安裝版本:';
+$lang['available_version']     = '可用版本:';
+$lang['compatible']            = '相容於:';
+$lang['repo_retry']            = '再試一次';
+$lang['status']                = '狀態:';
+$lang['status_installed']      = '已安裝';
+$lang['status_not_installed']  = '未安裝';
+$lang['status_enabled']        = '作用中';
+$lang['status_disabled']       = '停用中';
+$lang['status_plugin']         = '外掛';
+$lang['noperms']               = '延伸功能資料夾無法寫入';
+$lang['notplperms']            = '版型資料夾無法寫入';
+$lang['nopluginperms']         = '外掛資料夾無法寫入';
+$lang['git']                   = '此延伸功能是透過git安裝的,最好不要用上傳方式。';
+$lang['install_url']           = '透過網址安裝:';
+$lang['install_upload']        = '上傳延伸功能:';
diff --git a/lib/plugins/extension/lang/zh/intro_plugins.txt b/lib/plugins/extension/lang/zh/intro_plugins.txt
new file mode 100644
index 0000000000000000000000000000000000000000..69cb343b3d2a4326381a076320da5d8ec3e69ca2
--- /dev/null
+++ b/lib/plugins/extension/lang/zh/intro_plugins.txt
@@ -0,0 +1 @@
+这些是你当前已经安装的插件。你可以在这里启用和禁用甚至卸载它们。插件的更新信息也显示在这,请一定在更新之前阅读插件的文档。
\ No newline at end of file
diff --git a/lib/plugins/extension/lang/zh/lang.php b/lib/plugins/extension/lang/zh/lang.php
index b9db01540575390141c878675159cacfad1c4ae3..0264f3e9cf5a16baa1f89231a031bc300552cb0f 100644
--- a/lib/plugins/extension/lang/zh/lang.php
+++ b/lib/plugins/extension/lang/zh/lang.php
@@ -5,6 +5,8 @@
  * 
  * @author Cupen <Cupenoruler@foxmail.com>
  * @author xiqingongzi <Xiqingongzi@Gmail.com>
+ * @author qinghao <qingxianhao@gmail.com>
+ * @author lainme <lainme993@gmail.com>
  */
 $lang['menu']                  = '扩展管理器';
 $lang['tab_plugins']           = '安装插件';
@@ -41,10 +43,49 @@ $lang['repository']            = '版本库:';
 $lang['unknown']               = '<em>未知的</em>';
 $lang['installed_version']     = '已安装版本:';
 $lang['install_date']          = '您的最后一次升级:';
+$lang['available_version']     = '可用版本:';
+$lang['compatible']            = '兼容于:';
+$lang['depends']               = '依赖于:';
+$lang['similar']               = '相似于:';
+$lang['conflicts']             = '冲突于:';
 $lang['donate']                = '喜欢?';
 $lang['donate_action']         = '捐给作者一杯咖啡钱!';
 $lang['repo_retry']            = '重试';
+$lang['provides']              = '提供:';
 $lang['status']                = '现状:';
 $lang['status_installed']      = '已安装的';
+$lang['status_not_installed']  = '未安装';
+$lang['status_protected']      = '受保护';
+$lang['status_enabled']        = '启用';
+$lang['status_disabled']       = '禁用';
+$lang['status_unmodifiable']   = '不可修改';
 $lang['status_plugin']         = '插件';
 $lang['status_template']       = '模板';
+$lang['status_bundled']        = '内建';
+$lang['msg_enabled']           = '插件 %s 已启用';
+$lang['msg_disabled']          = '插件 %s 已禁用';
+$lang['msg_delete_success']    = '插件已经卸载';
+$lang['msg_template_install_success'] = '模板 %s 安装成功';
+$lang['msg_template_update_success'] = '模板 %s 更新成功';
+$lang['msg_plugin_install_success'] = '插件 %s 安装成功';
+$lang['msg_plugin_update_success'] = '插件 %s 更新成功';
+$lang['msg_upload_failed']     = '上传文件失败';
+$lang['missing_dependency']    = '<strong>缺少或者被禁用依赖:</strong> %s';
+$lang['security_issue']        = '<strong>安全问题:</strong> %s';
+$lang['security_warning']      = '<strong>安全警告:</strong> %s';
+$lang['update_available']      = '<strong>更新:</strong>新版本 %s 已经可用。';
+$lang['wrong_folder']          = '<strong>插件安装不正确:</strong>重命名插件目录 "%s" 为 "%s"。';
+$lang['url_change']            = '<strong>URL已改变:</strong>自上次下载以来的下载 URL 已经改变。请在更新扩展前检查新 URL 是否有效。<br />新的:%s<br />旧的:%s';
+$lang['error_badurl']          = 'URL 应当以 http 或者 https 作为开头';
+$lang['error_dircreate']       = '无法创建用于保存下载的临时文件夹';
+$lang['error_download']        = '无法下载文件:%s';
+$lang['error_decompress']      = '无法解压下载的文件。这可能是由于文件损坏,在这种情况下您可以重试。这也可能是由于压缩格式是未知的,在这种情况下您需要手动下载并且安装。';
+$lang['error_findfolder']      = '无法识别扩展目录,您需要手动下载和安装';
+$lang['error_copy']            = '在尝试安装文件到目录 <em>%s</em> 时出现文件复制错误:磁盘可能已满或者文件访问权限不正确。这可能导致插件被部分安装并使您的维基处在不稳定状态';
+$lang['noperms']               = '扩展目录不可写';
+$lang['notplperms']            = '模板目录不可写';
+$lang['nopluginperms']         = '插件目录不可写';
+$lang['git']                   = '这个扩展是通过 git 安装的,您可能不想在这里升级它';
+$lang['install_url']           = '从 URL 安装:';
+$lang['install_upload']        = '上传扩展:';
+$lang['repo_error']            = '无法连接到插件仓库。请确定您的服务器可以连接 www.dokuwiki.org 并检查您的代理设置。';
diff --git a/lib/plugins/extension/plugin.info.txt b/lib/plugins/extension/plugin.info.txt
index ef16d78a1f30983712ef2b0476ac5af1422b32db..ee983062838443c151d08e76340cd2d530e2b7a3 100644
--- a/lib/plugins/extension/plugin.info.txt
+++ b/lib/plugins/extension/plugin.info.txt
@@ -1,7 +1,7 @@
 base   extension
 author Michael Hamann
 email  michael@content-space.de
-date   2013-08-01
+date   2014-06-15
 name   Extension Manager
 desc   Allows managing and installing plugins and templates
 url    https://www.dokuwiki.org/plugin:extension
diff --git a/lib/plugins/info/plugin.info.txt b/lib/plugins/info/plugin.info.txt
index 0537436395c7137638391967246b58fb27cdc7e0..7773a419de5dd3aa4d23471e015250f1a0726b5b 100644
--- a/lib/plugins/info/plugin.info.txt
+++ b/lib/plugins/info/plugin.info.txt
@@ -1,7 +1,7 @@
 base info
 author Andreas Gohr
 email andi@splitbrain.org
-date 2013-02-16
+date 2014-03-05
 name Info Plugin
 desc Displays information about various DokuWiki internals
 url http://dokuwiki.org/plugin:info
diff --git a/lib/plugins/popularity/lang/hr/intro.txt b/lib/plugins/popularity/lang/hr/intro.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c7c3eba61e4dc1551c889cb4060abdc73681885a
--- /dev/null
+++ b/lib/plugins/popularity/lang/hr/intro.txt
@@ -0,0 +1,7 @@
+====== Povratna informacija o popularnosti ======
+
+Ovaj [[doku>popularity|alat]] prikupla anonimne podatke o Vašem wiki i omogućava Vam da ih pošaljete DokuWiki razvojnom timu. To im pomaže da bolje razumiju kako korisnici koriste DokuWiki i osigurava kvalitetnije odluke o budućem razvoju u skladu s stvarnim korištenjem.
+
+Pozivamo Vas da ponavljate ovaj korak s vremena na vrijeme kako bi razvojni tim bio obaviješten o razvoju Vašeg wiki-a. Vaši novi podaci biti će identificirani putem anonimne oznake.
+
+Prikupljeni podatci sadrže informacije kako što je DokuWiki inačica, broj i veličina vaših stranica i datoteka, ugrađeni dodatci i PHP-u koji se koristi. Sirovi podatci koji će biti poslani su prikazani niže. Molim koristite gumb "Pošalji podatke" da bi ste poslali ove informacije.
diff --git a/lib/plugins/popularity/lang/hr/lang.php b/lib/plugins/popularity/lang/hr/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..a8ea707281ff9ba8c2492c2b771a09686591a7d7
--- /dev/null
+++ b/lib/plugins/popularity/lang/hr/lang.php
@@ -0,0 +1,14 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Davor Turkalj <turki.bsc@gmail.com>
+ */
+$lang['name']                  = 'Povratna informacija o popularnosti (može proteći neko vrijeme dok se učita)';
+$lang['submit']                = 'Pošalji podatke';
+$lang['autosubmit']            = 'Šalji podatke automatski jednom mjesečno';
+$lang['submissionFailed']      = 'Podatci ne mogu biti poslani zbog slijedeće greške:';
+$lang['submitDirectly']        = 'Podatke možete poslati ručno potvrđivanjem forme u nastavku.';
+$lang['autosubmitError']       = 'Zadnje automatsko slanje nije uspješno zbog slijedeće greške:';
+$lang['lastSent']              = 'Podatci su poslani';
diff --git a/lib/plugins/popularity/lang/hr/submitted.txt b/lib/plugins/popularity/lang/hr/submitted.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8c841b3df2cf5b2378bc49a0458e22769e34ae1d
--- /dev/null
+++ b/lib/plugins/popularity/lang/hr/submitted.txt
@@ -0,0 +1,3 @@
+====== Povratna informacija o popularnosti ======
+
+Podatci su uspješno poslani.
\ No newline at end of file
diff --git a/lib/plugins/popularity/lang/lv/lang.php b/lib/plugins/popularity/lang/lv/lang.php
index f0c940b6f57f68534e1e57428ba48b5e3c633906..a8ef37f7a91c3bbb1860c404a429e1113eef2f75 100644
--- a/lib/plugins/popularity/lang/lv/lang.php
+++ b/lib/plugins/popularity/lang/lv/lang.php
@@ -1,7 +1,8 @@
 <?php
+
 /**
- * Latvian, Lettish language file
- *
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Aivars Miška <allefm@gmail.com>
  */
 $lang['name']                  = 'Popularitātes atsauksmes (ielāde var aizņemt kādu laiku)';
diff --git a/lib/plugins/popularity/lang/th/lang.php b/lib/plugins/popularity/lang/th/lang.php
index 3ae8a7890221410b31a548ec9712430629e39e34..f6a736a06e897643b168696af78472184ccea0c6 100644
--- a/lib/plugins/popularity/lang/th/lang.php
+++ b/lib/plugins/popularity/lang/th/lang.php
@@ -1,7 +1,8 @@
 <?php
+
 /**
- * Thai language file
- *
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Komgrit Niyomrath <n.komgrit@gmail.com>
  * @author Kittithat Arnontavilas mrtomyum@gmail.com
  * @author Kittithat Arnontavilas <mrtomyum@gmail.com>
diff --git a/lib/plugins/popularity/plugin.info.txt b/lib/plugins/popularity/plugin.info.txt
index 4dc971d3ae330ea618a678994792c3ce7bbdd399..eadfffaa09d5f04e82c73ec7841c31c901abe87c 100644
--- a/lib/plugins/popularity/plugin.info.txt
+++ b/lib/plugins/popularity/plugin.info.txt
@@ -1,7 +1,7 @@
 base    popularity
 author  Andreas Gohr
 email   andi@splitbrain.org
-date    2012-11-29
+date    2013-10-14
 name    Popularity Feedback Plugin
 desc    Send anonymous data about your wiki to the DokuWiki developers
 url     http://www.dokuwiki.org/plugin:popularity
diff --git a/lib/plugins/revert/lang/ar/lang.php b/lib/plugins/revert/lang/ar/lang.php
index 71f411c52054af4cba3f218633b0e1eb8536cf92..6262cc6741a995635a1c859bcf7e64a351f09e08 100644
--- a/lib/plugins/revert/lang/ar/lang.php
+++ b/lib/plugins/revert/lang/ar/lang.php
@@ -8,6 +8,7 @@
  * @author uahello@gmail.com
  * @author Ahmad Abd-Elghany <tolpa1@gmail.com>
  * @author alhajr <alhajr300@gmail.com>
+ * @author Mohamed Belhsine <b.mohamed897@gmail.com>
  */
 $lang['menu']                  = 'مدير الاسترجاع';
 $lang['filter']                = 'ابحث في الصفحات المتأذاة';
diff --git a/lib/plugins/revert/lang/cs/lang.php b/lib/plugins/revert/lang/cs/lang.php
index 69abaaadee5cbf273c9415750db0db7adde0364d..619a9d929af2a2f6ce057af30baefe9a25649ef1 100644
--- a/lib/plugins/revert/lang/cs/lang.php
+++ b/lib/plugins/revert/lang/cs/lang.php
@@ -16,6 +16,9 @@
  * @author Zbyněk Křivka <krivka@fit.vutbr.cz>
  * @author Gerrit Uitslag <klapinklapin@gmail.com>
  * @author Petr Klíma <qaxi@seznam.cz>
+ * @author Radovan Buroň <radovan@buron.cz>
+ * @author Viktor Zavadil <vzavadil@newps.cz>
+ * @author Jaroslav Lichtblau <jlichtblau@seznam.cz>
  */
 $lang['menu']                  = 'Obnova zaspamovaných stránek';
 $lang['filter']                = 'Hledat zaspamované stránky';
diff --git a/lib/plugins/revert/lang/hr/intro.txt b/lib/plugins/revert/lang/hr/intro.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5d7a52dfbc2ffcbfc2be5efcbc7e212d06068e0e
--- /dev/null
+++ b/lib/plugins/revert/lang/hr/intro.txt
@@ -0,0 +1,3 @@
+====== Pomoćnik za povrat ======
+
+Pomaže vam pri povratku u slučaju spam napada. Da bi ste našli listu stranica koje su onečišćene spam-om unesite tekst za potragu (npr. spam URL), te potvrdite da su nađene stranice zaista spam i vratite na prethodno stanje.
\ No newline at end of file
diff --git a/lib/plugins/revert/lang/hr/lang.php b/lib/plugins/revert/lang/hr/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..59413690224c696086b57bc3a8466a69adf2176c
--- /dev/null
+++ b/lib/plugins/revert/lang/hr/lang.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Davor Turkalj <turki.bsc@gmail.com>
+ */
+$lang['menu']                  = 'Pomoćnik za povrat stanja';
+$lang['filter']                = 'Potraži spam stranice';
+$lang['revert']                = 'Povrati odabrane stranice';
+$lang['reverted']              = '%s vraćena na izdanje %s';
+$lang['removed']               = '%s uklonjen';
+$lang['revstart']              = 'Proces povratka započeo. To može potrajati. Ako se dogodi istek vremena prije završetka, trebate povrat stranica vršiti u manjim grupama.';
+$lang['revstop']               = 'Proces povratka uspješno završio.';
+$lang['note1']                 = 'Obavijest: ova pretraga razlikuje velika/mala slova';
+$lang['note2']                 = 'Obavijest: stranica će biti vraćena na zadnje stanje koje ne sadrži traženi spam termin <i>%s</i>.';
diff --git a/lib/plugins/revert/lang/lv/lang.php b/lib/plugins/revert/lang/lv/lang.php
index 012d6cc4c262d7250697448c8dcf50184d464cb0..b873692336bfc3ad4ee0b5b992f64e127c325fa6 100644
--- a/lib/plugins/revert/lang/lv/lang.php
+++ b/lib/plugins/revert/lang/lv/lang.php
@@ -1,7 +1,8 @@
 <?php
+
 /**
- * Latvian, Lettish language file
- *
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Aivars Miška <allefm@gmail.com>
  */
 $lang['menu']                  = 'Piemēsloto lapu atjaunotājs';
diff --git a/lib/plugins/revert/lang/nl/intro.txt b/lib/plugins/revert/lang/nl/intro.txt
index db8f5a06cd59ef106044ea94dbf1636b44b10ad0..efa325839e52c2fa586961a3e346e1b98a34997f 100644
--- a/lib/plugins/revert/lang/nl/intro.txt
+++ b/lib/plugins/revert/lang/nl/intro.txt
@@ -1,3 +1,3 @@
-===== Herstelmanager =====
+===== Herstel =====
 
 Deze pagina helpt u bij het herstellen van pagina's na een spam-aanval. Vul een zoekterm in (bijvoorbeeld een spam url) om een lijst te krijgen van bekladde pagina's, bevestig dat de pagina's inderdaad spam bevatten en herstel de wijzigingen.
diff --git a/lib/plugins/revert/lang/nl/lang.php b/lib/plugins/revert/lang/nl/lang.php
index ee8678e638db54667acede6732c22251afb06e75..d04b968694ce22127e5a0033bdb326f7ce4d053c 100644
--- a/lib/plugins/revert/lang/nl/lang.php
+++ b/lib/plugins/revert/lang/nl/lang.php
@@ -16,8 +16,9 @@
  * @author Ricardo Guijt <ricardoguijt@gmail.com>
  * @author Gerrit <klapinklapin@gmail.com>
  * @author Remon <no@email.local>
+ * @author Rene <wllywlnt@yahoo.com>
  */
-$lang['menu']                  = 'Herstelmanager';
+$lang['menu']                  = 'Herstel';
 $lang['filter']                = 'Zoek naar bekladde pagina\'s';
 $lang['revert']                = 'Herstel geselecteerde pagina\'s';
 $lang['reverted']              = '%s hersteld naar revisie %s';
diff --git a/lib/plugins/revert/lang/sv/lang.php b/lib/plugins/revert/lang/sv/lang.php
index e605a17d4e4a87a6be9274eddff0d906c7e04a96..504332bae28ccc8ad9324c1507ce9a208b15399a 100644
--- a/lib/plugins/revert/lang/sv/lang.php
+++ b/lib/plugins/revert/lang/sv/lang.php
@@ -19,6 +19,7 @@
  * @author Henrik <henrik@idealis.se>
  * @author Tor Härnqvist <tor.harnqvist@gmail.com>
  * @author Hans Iwan Bratt <hibratt@gmail.com>
+ * @author Mikael Bergström <krank23@gmail.com>
  */
 $lang['menu']                  = 'Hantera återställningar';
 $lang['filter']                = 'Sök efter spamsidor';
diff --git a/lib/plugins/revert/lang/th/lang.php b/lib/plugins/revert/lang/th/lang.php
index 86e4f9ca41bbef3092a2589fdf6fca1ecb693de0..7b6217b7c4a5cec89c906ffe46667a4f2c7f1034 100644
--- a/lib/plugins/revert/lang/th/lang.php
+++ b/lib/plugins/revert/lang/th/lang.php
@@ -1,7 +1,8 @@
 <?php
+
 /**
- * Thai language file
- *
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Komgrit Niyomrath <n.komgrit@gmail.com>
  * @author Kittithat Arnontavilas mrtomyum@gmail.com
  * @author Arthit Suriyawongkul <arthit@gmail.com>
diff --git a/lib/plugins/revert/plugin.info.txt b/lib/plugins/revert/plugin.info.txt
index 482b68dc4aa849950a7212344fd18ece24122e9e..8d107dc3224f0c42be7288b01fcd6e1edb920812 100644
--- a/lib/plugins/revert/plugin.info.txt
+++ b/lib/plugins/revert/plugin.info.txt
@@ -1,7 +1,7 @@
 base   revert
 author Andreas Gohr
 email  andi@splitbrain.org
-date   2013-03-09
+date   2013-11-21
 name   Revert Manager
 desc   Allows you to mass revert recent edits to remove Spam or vandalism
 url    http://dokuwiki.org/plugin:revert
diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php
index 42a4903ec1e2b99fec69f7aed5f440b729031ae1..4a301f927fa4f4ddb988fc6e10f87d8f84674215 100644
--- a/lib/plugins/syntax.php
+++ b/lib/plugins/syntax.php
@@ -20,9 +20,12 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode_Plugin {
      * Syntax Type
      *
      * Needs to return one of the mode types defined in $PARSER_MODES in parser.php
+     *
+     * @return string
      */
     function getType(){
         trigger_error('getType() not implemented in '.get_class($this), E_USER_WARNING);
+        return '';
     }
 
     /**
@@ -31,6 +34,8 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode_Plugin {
      * Defines the mode types for other dokuwiki markup that maybe nested within the
      * plugin's own markup. Needs to return an array of one or more of the mode types
      * defined in $PARSER_MODES in parser.php
+     *
+     * @return array
      */
     function getAllowedTypes() {
         return array();
@@ -47,6 +52,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode_Plugin {
      * 'stack'  - Special case. Plugin wraps other paragraphs.
      *
      * @see Doku_Handler_Block
+     * @return string
      */
     function getPType(){
         return 'normal';
@@ -99,7 +105,10 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode_Plugin {
     }
 
     /**
-     *  There should be no need to override these functions
+     *  There should be no need to override this function
+     *
+     * @param string $mode
+     * @return bool
      */
     function accepts($mode) {
 
diff --git a/lib/plugins/usermanager/lang/bg/lang.php b/lib/plugins/usermanager/lang/bg/lang.php
index 9700385f8fb4565e2eb35bb28800215ab2aa6790..aadf7651284797489889ab3ebdfa64f0753fd697 100644
--- a/lib/plugins/usermanager/lang/bg/lang.php
+++ b/lib/plugins/usermanager/lang/bg/lang.php
@@ -41,10 +41,10 @@ $lang['next']                  = 'напред';
 $lang['last']                  = 'край';
 $lang['edit_usermissing']      = 'Избраният потребител не е намерен, въведеното потребителско име може да е изтрито или променено другаде.';
 $lang['user_notify']           = 'Уведомяване на потребителя';
-$lang['note_notify']           = 'Ел. писмо се изпраща само ако бъде променена паролата на потребителя.';
+$lang['note_notify']           = 'Имейл се изпраща само ако бъде променена паролата на потребителя.';
 $lang['note_group']            = 'Новите потребители биват добавяни към стандартната групата (%s) ако не е посочена друга.';
 $lang['note_pass']             = 'Паролата ще бъде генерирана автоматично, ако оставите полето празно и функцията за уведомяване на потребителя е включена.';
 $lang['add_ok']                = 'Добавянето на потребителя е успешно';
 $lang['add_fail']              = 'Добавянето на потребителя се провали';
-$lang['notify_ok']             = 'Изпратено е осведомително ел. писмо';
-$lang['notify_fail']           = 'Изпращането на осведомително ел. писмо не е възможно';
+$lang['notify_ok']             = 'Изпратено е осведомителен имейл';
+$lang['notify_fail']           = 'Изпращането на осведомителен имейл не е възможно';
diff --git a/lib/plugins/usermanager/lang/cs/import.txt b/lib/plugins/usermanager/lang/cs/import.txt
index c264ae18591866488fd49b172fa14ccbc03d7501..d665838f4fc5f1d47880cd7a1cdc25054f19762d 100644
--- a/lib/plugins/usermanager/lang/cs/import.txt
+++ b/lib/plugins/usermanager/lang/cs/import.txt
@@ -2,7 +2,7 @@
 
 Vyžaduje CSV soubor s uživateli obsahující alespoň 4 sloupce.
 Sloupce obsahují (v daném pořadí): user-id, celé jméno, emailovou adresu, seznam skupin.
-Položky CSV musí být odděleny čárkou (,) a řetězce umístěny v uvozovkách (""). Zpětné lomítko (\) lze použít pro escapování.
+Položky CSV musí být odděleny čárkou (,) a řetězce umístěny v uvozovkách (%%""%%). Zpětné lomítko (\) lze použít pro escapování.
 Pro získání příkladu takového souboru využijte funkci "Exportovat uživatele" výše.
 Záznamy s duplicitním user-id budou ignorovány.
 
diff --git a/lib/plugins/usermanager/lang/de-informal/import.txt b/lib/plugins/usermanager/lang/de-informal/import.txt
index 6fd6b8d8c998a01b34c16e9758832e46642f391d..bc888719377fb025944b21f1689aa7bafe6396b7 100644
--- a/lib/plugins/usermanager/lang/de-informal/import.txt
+++ b/lib/plugins/usermanager/lang/de-informal/import.txt
@@ -1,7 +1,7 @@
 ===== Massenimport von Benutzern =====
 
 Dieser Import benötigt eine CSV-Datei mit mindestens vier Spalten. Diese Spalten müssen die folgenden Daten (in dieser Reihenfolge) enthalten: Benutzername, Name, E-Mailadresse und Gruppenzugehörigkeit.
-Die CSV-Felder müssen durch ein Komma (,) getrennt sein. Die Zeichenfolgen müssen von Anführungszeichen ("") umgeben sein. Ein Backslash (\) kann zum Maskieren benutzt werden.
+Die CSV-Felder müssen durch ein Komma (,) getrennt sein. Die Zeichenfolgen müssen von Anführungszeichen (%%""%%) umgeben sein. Ein Backslash (\) kann zum Maskieren benutzt werden.
 Für eine Beispieldatei kannst Du die "Benutzer exportieren"-Funktion oben benutzen. Doppelte Benutzername werden ignoriert.
 
 Ein Passwort wird generiert und den einzelnen, erfolgreich importierten Benutzern zugemailt.
\ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/de/import.txt b/lib/plugins/usermanager/lang/de/import.txt
index bf0d2922e87fc4c06a36cf192d743783dcca75df..7faca3b9a2ba3e800b205eb81721d55d0ae97db8 100644
--- a/lib/plugins/usermanager/lang/de/import.txt
+++ b/lib/plugins/usermanager/lang/de/import.txt
@@ -1,7 +1,7 @@
 ===== Benutzer-Massenimport =====
 
 Um mehrere Benutzer gleichzeitig zu importieren, wird eine CSV-Datei mit den folgenden vier Spalten benötigt (In dieser Reihenfolge): Benutzer-ID, Voller Name, E-Mail-Adresse und Gruppen.
-Die CSV-Felder sind Kommata-separiert (,) und mit Anführungszeichen eingefasst ("). Mit Backslashes (\) können Sonderzeichen maskiert werden.
+Die CSV-Felder sind Kommata-separiert (,) und mit Anführungszeichen eingefasst (%%"%%). Mit Backslashes (\) können Sonderzeichen maskiert werden.
 Ein Beispiel für eine gültige Datei kann mit der Benutzer-Export-Funktion oben generiert werden.
 Doppelte Benutzer-IDs werden ignoriert.
 
diff --git a/lib/plugins/usermanager/lang/en/import.txt b/lib/plugins/usermanager/lang/en/import.txt
index 2087083e05577be7cbfe3cbd6d64c641859cf7a1..360a0689b6748db5251a69a026966e72f7bddd14 100644
--- a/lib/plugins/usermanager/lang/en/import.txt
+++ b/lib/plugins/usermanager/lang/en/import.txt
@@ -2,7 +2,7 @@
 
 Requires a CSV file of users with at least four columns.
 The columns must contain, in order: user-id, full name, email address and groups.
-The CSV fields should be separated by commas (,) and strings delimited by quotation marks ("").  Backslash (\) can be used for escaping.
+The CSV fields should be separated by commas (,) and strings delimited by quotation marks (%%""%%).  Backslash (\) can be used for escaping.
 For an example of a suitable file, try the "Export Users" function above.  
 Duplicate user-ids will be ignored.
 
diff --git a/lib/plugins/usermanager/lang/eo/import.txt b/lib/plugins/usermanager/lang/eo/import.txt
index 61c2c74de32e14344137e819714f65056bd5674e..09fbe6911b4ff582a879bdff3b5dcdbd07f4ec72 100644
--- a/lib/plugins/usermanager/lang/eo/import.txt
+++ b/lib/plugins/usermanager/lang/eo/import.txt
@@ -2,7 +2,7 @@
 
 Tio ĉi postulas CSV-dosiero de uzantoj kun minimume kvar kolumnoj.
 La kolumnoj devas enhavi, laÅ­orde: uzant-id, kompleta nomo, retadreso kaj grupoj.
-La CSV-kampoj devos esti apartitaj per komoj (,) kaj ĉenoj devas esti limigitaj per citiloj (""). Retroklino (\) povas esti uzata por eskapo.
+La CSV-kampoj devos esti apartitaj per komoj (,) kaj ĉenoj devas esti limigitaj per citiloj (%%""%%). Retroklino (\) povas esti uzata por eskapo.
 Por ekzemplo de taÅ­ga dosiero, provu la funkcion "Eksporti uzantojn" supre.
 Duobligitaj uzant-id estos preteratentataj.
 
diff --git a/lib/plugins/usermanager/lang/es/lang.php b/lib/plugins/usermanager/lang/es/lang.php
index 26e4200e4514578b7cf615d7347d91cdb4001fd0..a557eacdd0ad8d2ff610058e1879185c8ab0c08c 100644
--- a/lib/plugins/usermanager/lang/es/lang.php
+++ b/lib/plugins/usermanager/lang/es/lang.php
@@ -24,6 +24,9 @@
  * @author Ruben Figols <ruben.figols@gmail.com>
  * @author Gerardo Zamudio <gerardo@gerardozamudio.net>
  * @author Mercè López mercelz@gmail.com
+ * @author Antonio Bueno <atnbueno@gmail.com>
+ * @author Antonio Castilla <antoniocastilla@trazoide.com>
+ * @author Jonathan Hernández <me@jhalicea.com>
  */
 $lang['menu']                  = 'Administración de usuarios';
 $lang['noauth']                = '(la autenticación de usuarios no está disponible)';
@@ -46,6 +49,11 @@ $lang['search']                = 'Buscar';
 $lang['search_prompt']         = 'Realizar la búsqueda';
 $lang['clear']                 = 'Limpiar los filtros de la búsqueda';
 $lang['filter']                = 'Filtrar';
+$lang['export_all']            = 'Exportar Todos los Usuarios (CSV)';
+$lang['export_filtered']       = 'Exportar Lista de Usuarios Filtrada (CSV)';
+$lang['import']                = 'Importar Nuevos Usuarios';
+$lang['line']                  = 'Línea nº';
+$lang['error']                 = 'Mensaje de error';
 $lang['summary']               = 'Mostrando los usuarios %1$d-%2$d de %3$d encontrados. Cantidad total de usuarios %4$d.';
 $lang['nonefound']             = 'No se encontraron usuarios que coincidan con los párametros de la búsqueda. Cantidad total de usuarios %d.';
 $lang['delete_ok']             = '%d usuarios eliminados';
@@ -66,3 +74,10 @@ $lang['add_ok']                = 'El usuario fue creado exitosamente';
 $lang['add_fail']              = 'Falló la creación del usuario';
 $lang['notify_ok']             = 'Se envió la notificación por correo electrónico';
 $lang['notify_fail']           = 'No se pudo enviar la notificación por correo electrónico';
+$lang['import_userlistcsv']    = 'Lista de usuarios (CSV): ';
+$lang['import_error_badmail']  = 'Dirección de correo electrónico incorrecta';
+$lang['import_error_upload']   = 'Error al importar. El archivo csv no se pudo cargar o está vacío.';
+$lang['import_error_readfail'] = 'Error al importar. No se puede leer el archivo subido.';
+$lang['import_error_create']   = 'No se puede crear el usuario';
+$lang['import_notify_fail']    = 'Mensaje de notificación no se ha podido enviar por el usuario importado,%s con el email %s.';
+$lang['import_downloadfailures'] = 'Descarga errores en archivo CSV para la corrección';
diff --git a/lib/plugins/usermanager/lang/fa/lang.php b/lib/plugins/usermanager/lang/fa/lang.php
index a6a484411ac0583084197939147613301aa7ddd6..bb2505a2774e949afb7fe3f13e9521adce285e9e 100644
--- a/lib/plugins/usermanager/lang/fa/lang.php
+++ b/lib/plugins/usermanager/lang/fa/lang.php
@@ -10,6 +10,8 @@
  * @author Mohammad Reza Shoaei <shoaei@gmail.com>
  * @author Milad DZand <M.DastanZand@gmail.com>
  * @author AmirH Hassaneini <mytechmix@gmail.com>
+ * @author Hamid <zarrabi@sharif.edu>
+ * @author Mohamad Mehdi Habibi <habibi.esf@gmail.com>
  */
 $lang['menu']                  = 'مدیریت کاربر';
 $lang['noauth']                = '(معتبرسازی کاربر ممکن نیست)';
@@ -32,23 +34,25 @@ $lang['search']                = 'جستجو';
 $lang['search_prompt']         = 'انجام جستجو';
 $lang['clear']                 = 'بازنویسی فیلترهای جستجو';
 $lang['filter']                = 'فیلتر';
+$lang['import']                = 'ورود کاربران جدید';
+$lang['error']                 = 'متن خطا';
 $lang['summary']               = 'نمایش کاربر %1$d-%2$d از %3$d. در کل %4$d کاربر.';
 $lang['nonefound']             = 'هیچ کاربری یافت نشد. در کل %d کاربر.';
 $lang['delete_ok']             = '%d کاربر حذف شد';
 $lang['delete_fail']           = 'حذف %d کاربر با مشکل مواجه شد.';
-$lang['update_ok']             = 'کاربر با موفقیت به روز رسانی شد.';
-$lang['update_fail']           = 'به روز رسانی کاربر با مشکل مواجه شد';
-$lang['update_exists']         = 'تغییر نام کاربری ممکن نیست، نام کاربری مورد نظر (%s) قبلن وجود داشته (مابقی تغییرات اعمال شده است)';
+$lang['update_ok']             = 'کاربر با موفقیت به‌روز شد.';
+$lang['update_fail']           = 'به‌روزرسانی کاربر با مشکل مواجه شد';
+$lang['update_exists']         = 'تغییر نام کاربری ممکن نیست، نام کاربری مورد نظر (%s) از قبل وجود داشته است (مابقی تغییرات اعمال خواهد شد).';
 $lang['start']                 = 'شروع';
 $lang['prev']                  = 'قبلی';
 $lang['next']                  = 'بعدی';
 $lang['last']                  = 'آخرین';
-$lang['edit_usermissing']      = 'کاربر انتخاب شده یافت نشد، نام کاربری مورد نظر در جایی دیگر حذف شده یا تغییر کرده.';
+$lang['edit_usermissing']      = 'کاربر انتخاب شده یافت نشد، نام کاربری موردنظر در جایی دیگر حذف شده یا تغییر کرده است.';
 $lang['user_notify']           = 'آگاه کردن کاربر';
 $lang['note_notify']           = 'ایمیلی برای آگاهی، فقط در زمان تغییر گذرواژه‌ ارسال می‌شود.';
 $lang['note_group']            = 'اگر گروهی انتخاب نشود، کاربران جدید به گروه پیش‌فرض (%s) افزوده خواهند شد.';
 $lang['note_pass']             = 'اگر فیلد گذرواژه خالی گذاشته شود، گذرواژه به طور خودکار تولید و ایمیلی برای کاربر ارسال خواهد شد.';
 $lang['add_ok']                = 'کاربر با موفقیت افزوده شد';
 $lang['add_fail']              = 'افزودن کاربر با مشکل مواجه شد';
-$lang['notify_ok']             = 'ایمیل آگاهی دهنده ارسال شد';
-$lang['notify_fail']           = 'ارسال ایمیل آگاهی دهنده با مشکل مواجه شد';
+$lang['notify_ok']             = 'ایمیل آگاهی‌دهنده ارسال شد';
+$lang['notify_fail']           = 'ارسال ایمیل آگاهی‌دهنده با مشکل مواجه شد';
diff --git a/lib/plugins/usermanager/lang/fr/import.txt b/lib/plugins/usermanager/lang/fr/import.txt
index 191bb83700d3a94ec3bc6fb3ae94e7686cd801bc..a1eb8f85895d279d5b2c75b41ef6c784dbb2018a 100644
--- a/lib/plugins/usermanager/lang/fr/import.txt
+++ b/lib/plugins/usermanager/lang/fr/import.txt
@@ -3,7 +3,7 @@
 Requière un fichier [[wpfr>CSV]] d'utilisateurs avec un minimum de quatre colonnes.
 Les colonnes doivent comporter, dans l'ordre : identifiant, nom complet, adresse de courriel et groupes.
 
-Les champs doivent être séparés par une virgule (,), les chaînes sont délimitées par des guillemets (""). On peut utiliser la balance inverse (\) comme caractère d'échappement.
+Les champs doivent être séparés par une virgule (,), les chaînes sont délimitées par des guillemets (%%""%%). On peut utiliser la balance inverse (\) comme caractère d'échappement.
 Pour obtenir un exemple de fichier acceptable, essayer la fonction "Exporter les utilisateurs" ci dessus.
 
 Les identifiants dupliqués seront ignorés.
diff --git a/lib/plugins/usermanager/lang/hr/add.txt b/lib/plugins/usermanager/lang/hr/add.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f7c866495f6fb7f97a699354ff1ffb722cceb815
--- /dev/null
+++ b/lib/plugins/usermanager/lang/hr/add.txt
@@ -0,0 +1 @@
+===== Dodaj korisnika =====
diff --git a/lib/plugins/usermanager/lang/hr/delete.txt b/lib/plugins/usermanager/lang/hr/delete.txt
new file mode 100644
index 0000000000000000000000000000000000000000..072185fc1008e12d79a76d5a56e6c9def53e1991
--- /dev/null
+++ b/lib/plugins/usermanager/lang/hr/delete.txt
@@ -0,0 +1 @@
+===== Ukloni korisnika =====
diff --git a/lib/plugins/usermanager/lang/hr/edit.txt b/lib/plugins/usermanager/lang/hr/edit.txt
new file mode 100644
index 0000000000000000000000000000000000000000..752fd81f36f192ecda310d886ffe99f807a10354
--- /dev/null
+++ b/lib/plugins/usermanager/lang/hr/edit.txt
@@ -0,0 +1 @@
+===== Uredi korisnika =====
diff --git a/lib/plugins/usermanager/lang/hr/import.txt b/lib/plugins/usermanager/lang/hr/import.txt
new file mode 100644
index 0000000000000000000000000000000000000000..85ea92723fae252ee5087a13edd61b6ce46f6921
--- /dev/null
+++ b/lib/plugins/usermanager/lang/hr/import.txt
@@ -0,0 +1,9 @@
+===== Masovni unos korisnika =====
+
+Zahtjeva CSV datoteku popisa korisnika s minimalno četiri kolone.
+Kolone moraju sadržavati redom: korisničko ime, puno ime, adresu e-pošte i grupe.
+Polja trebaju biti odvojena zarezom (,) a znakovni nizovi s dvostrukim navodnicima (%%""%%). Obrnuta kosa crta (\) koristi se za specijalne kodove (escaping).
+Koristite "Izvoz korisnika" funkciju da bi ste dobili primjer odgovarajuće datoteke. 
+Duplikati korisničkih imena biti će ignorirani.
+
+Uspješno kreiranim korisnicima lozinka će biti generirana i poslana e-poštom.
\ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/hr/intro.txt b/lib/plugins/usermanager/lang/hr/intro.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0f156579bdb033b9a30785722e3884c0cad1e2ef
--- /dev/null
+++ b/lib/plugins/usermanager/lang/hr/intro.txt
@@ -0,0 +1 @@
+====== Upravitelj korisnicima ======
\ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/hr/lang.php b/lib/plugins/usermanager/lang/hr/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..80613ed6fc962683c4525afb6760a7fd6f434cb2
--- /dev/null
+++ b/lib/plugins/usermanager/lang/hr/lang.php
@@ -0,0 +1,66 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
+ * @author Davor Turkalj <turki.bsc@gmail.com>
+ */
+$lang['menu']                  = 'Upravitelj korisnicima';
+$lang['noauth']                = '(korisnička prijava nije dostupna)';
+$lang['nosupport']             = '(upravljanje korisnikom nije podržano)';
+$lang['badauth']               = 'pogrešan mehanizam prijave';
+$lang['user_id']               = 'Korisnik';
+$lang['user_pass']             = 'Lozinka';
+$lang['user_name']             = 'Stvarno ime';
+$lang['user_mail']             = 'E-pošta';
+$lang['user_groups']           = 'Grupe';
+$lang['field']                 = 'Polje';
+$lang['value']                 = 'Vrijednost';
+$lang['add']                   = 'Dodaj';
+$lang['delete']                = 'Obriši';
+$lang['delete_selected']       = 'Obriši odabrano';
+$lang['edit']                  = 'Uredi';
+$lang['edit_prompt']           = 'Uredi ovog korisnika';
+$lang['modify']                = 'Snimi promjene';
+$lang['search']                = 'Potraži';
+$lang['search_prompt']         = 'Izvedi potragu';
+$lang['clear']                 = 'Obriši filtar potrage';
+$lang['filter']                = 'Filtar';
+$lang['export_all']            = 'Izvezi sve korisnike (CSV)';
+$lang['export_filtered']       = 'Izvezi filtriranu listu korisnika (CSV)';
+$lang['import']                = 'Unos novih korisnika';
+$lang['line']                  = 'Linija br.';
+$lang['error']                 = 'Poruka o grešci';
+$lang['summary']               = 'Prikaz korisnika %1$d-%2$d od %3$d nađenih. Ukupno %4$d korisnika.';
+$lang['nonefound']             = 'Nema korisnika koji odgovaraju filtru.Ukupno %d korisnika.';
+$lang['delete_ok']             = '%d korisnik obrisano';
+$lang['delete_fail']           = '%d neuspjelih brisanja.';
+$lang['update_ok']             = 'Korisnik uspješno izmijenjen';
+$lang['update_fail']           = 'Neuspjela izmjena korisnika';
+$lang['update_exists']         = 'Promjena korisničkog imena neuspješna, traženo ime (%s) već postoji (ostale izmjene biti će primijenjene).';
+$lang['start']                 = 'početni';
+$lang['prev']                  = 'prethodni';
+$lang['next']                  = 'slijedeći';
+$lang['last']                  = 'zadnji';
+$lang['edit_usermissing']      = 'Odabrani korisnik nije nađen, traženo korisničko ime vjerojatno je obrisano i promijenjeno negdje drugdje.';
+$lang['user_notify']           = 'Obavijesti korisnika';
+$lang['note_notify']           = 'Obavijest korisniku biti će poslana samo ako je upisana nova lozinka.';
+$lang['note_group']            = 'Novi korisnik biti će dodijeljen u podrazumijevanu grupu (%s) ako grupa nije specificirana.';
+$lang['note_pass']             = 'Lozinka će biti generirana ako se polje ostavi prazno i obavješćivanje korisnika je omogućeno.';
+$lang['add_ok']                = 'Korisnik uspješno dodan';
+$lang['add_fail']              = 'Neuspješno dodavanje korisnika';
+$lang['notify_ok']             = 'Obavijest korisniku poslana';
+$lang['notify_fail']           = 'Obavijest korisniku ne može biti poslana';
+$lang['import_userlistcsv']    = 'Datoteka s popisom korisnika (CSV):';
+$lang['import_header']         = 'Zadnje greške pri uvozu';
+$lang['import_success_count']  = 'Uvoz korisnika: %d korisnika nađeno, %d uspješno uvezeno';
+$lang['import_failure_count']  = 'Uvoz korisnika: %d neuspješno. Greške su navedene niže.';
+$lang['import_error_fields']   = 'Nedovoljan broj polja, nađeno %d, potrebno 4.';
+$lang['import_error_baduserid'] = 'Nedostaje korisničko ime';
+$lang['import_error_badname']  = 'Krivo ime';
+$lang['import_error_badmail']  = 'Kriva adresa e-pošte';
+$lang['import_error_upload']   = 'Uvoz neuspješan. CSV datoteka ne može biti učitana ili je prazna.';
+$lang['import_error_readfail'] = 'Uvoz neuspješan. Ne mogu pročitati učitanu datoteku.';
+$lang['import_error_create']   = 'Ne mogu kreirati korisnika';
+$lang['import_notify_fail']    = 'Obavijest uvezenom korisniku %s nije moguće poslati na adresu e-pošte %s.';
+$lang['import_downloadfailures'] = 'Preuzmi  greške kao CSV za ispravak';
diff --git a/lib/plugins/usermanager/lang/hr/list.txt b/lib/plugins/usermanager/lang/hr/list.txt
new file mode 100644
index 0000000000000000000000000000000000000000..50b1d2513743d8154b024da0d0641da35c910425
--- /dev/null
+++ b/lib/plugins/usermanager/lang/hr/list.txt
@@ -0,0 +1 @@
+===== Lista korisnika =====
\ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/hu/import.txt b/lib/plugins/usermanager/lang/hu/import.txt
index f204f6a1ef58c2e7c1bdf1e1d3ebc8804349db41..a2db033000eeda42ca61cec50e9d7e0a4081b60b 100644
--- a/lib/plugins/usermanager/lang/hu/import.txt
+++ b/lib/plugins/usermanager/lang/hu/import.txt
@@ -2,8 +2,8 @@
 
 Szükséges egy legalább 4 oszlopot tartalmazó, felhasználókat tartalmazó fájl.
 Az oszlopok kötelező tartalma, sorrendben: felhasználói azonosító, teljes név, e-mailcím és csoport.
-A CSV-mezőket vesszővel (,) kell elválasztani, a szövegeket idézőjelek ("") közé kell tenni. A fordított törtvonal (\) használható feloldójelnek. 
-Megfelelő mintafájl megtekintéséhez próbáld ki a "Felhasználók exportálása" funkciót fentebb.
+A CSV-mezőket vesszővel (,) kell elválasztani, a szövegeket idézőjelek (%%""%%) közé kell tenni. A fordított törtvonal (\) használható feloldójelnek.
+Megfelelő mintafájl megtekintéséhez próbáld ki a "Felhasználók exportálása" funkciót fentebb. 
 A duplán szereplő felhasználói azonosítók kihagyásra kerülnek.
 
 Minden sikeresen importált felhasználó számára jelszó készül, amelyet e-mailben kézhez kap.
\ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/it/lang.php b/lib/plugins/usermanager/lang/it/lang.php
index 6c67894424ebccb8014a88d299f2197c1b6ec2ff..ffded3481af1d33a162dad226b60d63bc32e7ec4 100644
--- a/lib/plugins/usermanager/lang/it/lang.php
+++ b/lib/plugins/usermanager/lang/it/lang.php
@@ -16,6 +16,8 @@
  * @author Matteo Pasotti <matteo@xquiet.eu>
  * @author snarchio@gmail.com
  * @author Claudio Lanconelli <lancos@libero.it>
+ * @author Francesco <francesco.cavalli@hotmail.com>
+ * @author Fabio <fabioslurp@yahoo.it>
  */
 $lang['menu']                  = 'Gestione Utenti';
 $lang['noauth']                = '(autenticazione non disponibile)';
@@ -40,6 +42,9 @@ $lang['clear']                 = 'Azzera filtro di ricerca';
 $lang['filter']                = 'Filtro';
 $lang['export_all']            = 'Esporta tutti gli utenti (CSV)';
 $lang['export_filtered']       = 'Esporta elenco utenti filtrati (CSV)';
+$lang['import']                = 'Importa nuovi utenti';
+$lang['line']                  = 'Linea numero';
+$lang['error']                 = 'Messaggio di errore';
 $lang['summary']               = 'Visualizzazione utenti %1$d-%2$d di %3$d trovati. %4$d utenti totali.';
 $lang['nonefound']             = 'Nessun utente trovato. %d utenti totali.';
 $lang['delete_ok']             = '%d utenti eliminati';
@@ -60,3 +65,12 @@ $lang['add_ok']                = 'Utente aggiunto correttamente';
 $lang['add_fail']              = 'Aggiunta utente fallita';
 $lang['notify_ok']             = 'Email di notifica inviata';
 $lang['notify_fail']           = 'L\'email di notifica non può essere inviata';
+$lang['import_success_count']  = 'Importazione utenti: %d utenti trovati, %d utenti importati con successo.';
+$lang['import_failure_count']  = 'Importazione utenti: %d falliti. Errori riportati qui sotto.';
+$lang['import_error_fields']   = 'Campi insufficienti, trovati %d, richiesti 4.';
+$lang['import_error_baduserid'] = 'User-id non trovato';
+$lang['import_error_badname']  = 'Nome errato';
+$lang['import_error_badmail']  = 'Indirizzo email errato';
+$lang['import_error_upload']   = 'Importazione fallita. Il file CSV non può essere caricato, o è vuoto.';
+$lang['import_error_readfail'] = 'Importazione in errore. Impossibile leggere i file caricati.';
+$lang['import_error_create']   = 'Impossibile creare l\'utente';
diff --git a/lib/plugins/usermanager/lang/ja/import.txt b/lib/plugins/usermanager/lang/ja/import.txt
index 751e515acaec6e41d7298c155d65e723ff64dc4b..6af87c263e750dd28e0636b92b714d44a295407d 100644
--- a/lib/plugins/usermanager/lang/ja/import.txt
+++ b/lib/plugins/usermanager/lang/ja/import.txt
@@ -2,7 +2,7 @@
 
 少なくとも4列のユーザーCSVファイルが必要です。
 列の順序:ユーザーID、氏名、電子メールアドレス、グループ。
-CSVフィールドはカンマ(,)区切り、文字列は引用符("")区切りです。
+CSVフィールドはカンマ(,)区切り、文字列は引用符(%%""%%)区切りです。
 エスケープにバックスラッシュ(\)を使用できます。
 適切なファイル例は、上記の"エクスポートユーザー"機能で試して下さい。 
 重複するユーザーIDは無視されます。
diff --git a/lib/plugins/usermanager/lang/ko/edit.txt b/lib/plugins/usermanager/lang/ko/edit.txt
index a938c5b2e20ae5631e5cdf850cb63b52f5a74d4d..0b35cd7d5548ced1d8af030f6f8654edb6d5ac94 100644
--- a/lib/plugins/usermanager/lang/ko/edit.txt
+++ b/lib/plugins/usermanager/lang/ko/edit.txt
@@ -1 +1 @@
-===== 사용자 정보 편집 =====
\ No newline at end of file
+===== 사용자 편집 =====
\ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/ko/import.txt b/lib/plugins/usermanager/lang/ko/import.txt
index 44fe392d00d6162f16682ad268483099d74974c4..6d077dfb841b1c8006341a0b60d673115f038cd8 100644
--- a/lib/plugins/usermanager/lang/ko/import.txt
+++ b/lib/plugins/usermanager/lang/ko/import.txt
@@ -2,7 +2,7 @@
 
 적어도 열 네 개가 있는 사용자의 CSV 파일이 필요합니다.
 열은 다음과 같이 포함해야 합니다: 사용자 id, 실명, 이메일 주소와 그룹.
-CSV 필드는 인용 부호("")로 쉼표(,)와 구분된 문자열로 구분해야 합니다. 백슬래시(\)는 탈출에 사용할 수 있습니다.
+CSV 필드는 인용 부호(%%""%%)로 쉼표(,)와 구분된 문자열로 구분해야 합니다. 백슬래시(\)는 탈출에 사용할 수 있습니다.
 적절한 파일의 예를 들어, 위의 "사용자 목록 내보내기"를 시도하세요.
 중복된 사용자 id는 무시됩니다.
 
diff --git a/lib/plugins/usermanager/lang/ko/intro.txt b/lib/plugins/usermanager/lang/ko/intro.txt
index d75680c71d7b7883fa70ff8fc655f7b93b41d0fd..2ce85f1a293b73fb53c645d56bce5db828d91306 100644
--- a/lib/plugins/usermanager/lang/ko/intro.txt
+++ b/lib/plugins/usermanager/lang/ko/intro.txt
@@ -1 +1 @@
-====== 사용자 관리 ======
\ No newline at end of file
+====== 사용자 관리자 ======
\ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/ko/lang.php b/lib/plugins/usermanager/lang/ko/lang.php
index ac129c95e6d11517cca998189af6785ac9b34fea..70e3d94f0894e205e74ed687906dbf9465bd0687 100644
--- a/lib/plugins/usermanager/lang/ko/lang.php
+++ b/lib/plugins/usermanager/lang/ko/lang.php
@@ -44,7 +44,7 @@ $lang['delete_ok']             = '사용자 %d명이 삭제되었습니다';
 $lang['delete_fail']           = '사용자 %d명을 삭제하는 데 실패했습니다.';
 $lang['update_ok']             = '사용자 정보를 성공적으로 바꾸었습니다';
 $lang['update_fail']           = '사용자 정보를 바꾸는 데 실패했습니다';
-$lang['update_exists']         = '사용자 이름을 바꾸는 데 실패했습니다. 사용자 이름(%s)이 이미 존재합니다. (다른 항목의 바뀜은 적용됩니다.)';
+$lang['update_exists']         = '사용자 이름을 바꾸는 데 실패했습니다. 사용자 이름(%s)이 이미 존재합니다. (다른 항목의 바뀜은 적용됩니다)';
 $lang['start']                 = '시작';
 $lang['prev']                  = '이전';
 $lang['next']                  = '다음';
diff --git a/lib/plugins/usermanager/lang/lv/import.txt b/lib/plugins/usermanager/lang/lv/import.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0006ae8500be366e20a3752954cabae43718a7b3
--- /dev/null
+++ b/lib/plugins/usermanager/lang/lv/import.txt
@@ -0,0 +1,9 @@
+===== Masveida lietotāju imports =====
+
+Vajag CSV failu ar vismaz četrām lietotāju datu kolonām šādā secībā: identifikators, pilns vārds, e-pasta adrese un grupas. 
+
+CSV lauki jāatdala ar komatiem (,) un virknes — ar pēdiņām (%%""%%). Backslash (\) can be used for escaping. 
+Derīga faila paraugam izmantojiem augtāk redzamo "Lietotāju eksportu".  
+Dublētus identifikatorus ignorēs. 
+
+Paroli katram veiksmīgi importētajam lietotājam izveidos un nosūtīs pa e-pastu.
\ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/lv/lang.php b/lib/plugins/usermanager/lang/lv/lang.php
index 620678ff558436803e66370a39324cc3e16a67a3..4944da31ec97757039a9d5d7d8752942888f6f0b 100644
--- a/lib/plugins/usermanager/lang/lv/lang.php
+++ b/lib/plugins/usermanager/lang/lv/lang.php
@@ -1,7 +1,8 @@
 <?php
+
 /**
- * Latvian language file
- *
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Aivars Miška <allefm@gmail.lv>
  * @author Aivars Miška <allefm@gmail.com>
  */
diff --git a/lib/plugins/usermanager/lang/nl/import.txt b/lib/plugins/usermanager/lang/nl/import.txt
index 2678910984190bf7be2dc38cdf3b39122f434ac3..3a9320ecf87a40d1268dadd72a4c9966dc182032 100644
--- a/lib/plugins/usermanager/lang/nl/import.txt
+++ b/lib/plugins/usermanager/lang/nl/import.txt
@@ -1,7 +1,7 @@
 ===== Massa-import van gebruikers =====
 
 Hiervoor is een CSV-bestand nodig van de gebruikers met minstens vier kolommen. De kolommen moeten bevatten, in deze volgorde: gebruikers-id, complete naam, e-mailadres en groepen.
-Het CSV-velden moeten worden gescheiden met komma's (,) en de teksten moeten worden omringd met dubbele aanhalingstekens (""). Backslash (\) kan worden gebruikt om te escapen.
+Het CSV-velden moeten worden gescheiden met komma's (,) en de teksten moeten worden omringd met dubbele aanhalingstekens (%%""%%). Backslash (\) kan worden gebruikt om te escapen.
 Voor een voorbeeld van een werkend bestand, probeer de "Exporteer Gebruikers" functie hierboven.
 Dubbele gebruikers-id's zullen worden genegeerd.
 
diff --git a/lib/plugins/usermanager/lang/nl/intro.txt b/lib/plugins/usermanager/lang/nl/intro.txt
index 7df09dbab79853a1d5765019063ccefccba35ce4..819e64d7d739f51c4b03d6b4ff3d88e7ef3459db 100644
--- a/lib/plugins/usermanager/lang/nl/intro.txt
+++ b/lib/plugins/usermanager/lang/nl/intro.txt
@@ -1 +1 @@
-==== Gebruikersmanager =====
\ No newline at end of file
+====== Gebruikersbeheer ======
diff --git a/lib/plugins/usermanager/lang/nl/lang.php b/lib/plugins/usermanager/lang/nl/lang.php
index 5cebede89a7a07bdd3c20493032c1c509d43158c..3f9902e141e6478ae4b1740db5fc18b3699e08d3 100644
--- a/lib/plugins/usermanager/lang/nl/lang.php
+++ b/lib/plugins/usermanager/lang/nl/lang.php
@@ -15,8 +15,9 @@
  * @author Jeroen
  * @author Ricardo Guijt <ricardoguijt@gmail.com>
  * @author Gerrit Uitslag <klapinklapin@gmail.com>
+ * @author Rene <wllywlnt@yahoo.com>
  */
-$lang['menu']                  = 'Gebruikersmanager';
+$lang['menu']                  = 'Gebruikersbeheer';
 $lang['noauth']                = '(gebruikersauthenticatie niet beschikbaar)';
 $lang['nosupport']             = '(gebruikersbeheer niet ondersteund)';
 $lang['badauth']               = 'ongeldige authenticatiemethode';
diff --git a/lib/plugins/usermanager/lang/ru/import.txt b/lib/plugins/usermanager/lang/ru/import.txt
index dd2b797bc0eaf5e41d970f3d4f88c074e55e30ab..f2049dd0c1f0f40141ec681d8b652b587802e135 100644
--- a/lib/plugins/usermanager/lang/ru/import.txt
+++ b/lib/plugins/usermanager/lang/ru/import.txt
@@ -2,7 +2,7 @@
 
 Потребуется список пользователей в файле формата CSV, состоящий из 4 столбцов. 
 Столбцы должны быть заполнены следующим образом: user-id, полное имя, эл. почта, группы. 
-Поля CSV должны быть отделены запятой (,), а строки должны быть заключены в кавычки (""). Обратный слэш используется как прерывание. 
+Поля CSV должны быть отделены запятой (,), а строки должны быть заключены в кавычки (%%""%%). Обратный слэш используется как прерывание.
 В качестве примера можете взять список пользователей, экспортированный через «Экспорт пользователей». 
 Повторяющиеся идентификаторы user-id будут игнорироваться.
 
diff --git a/lib/plugins/usermanager/lang/ru/lang.php b/lib/plugins/usermanager/lang/ru/lang.php
index 83158df319c5538eb9bfe82c8b9a848368bd38c6..8bbfa639c2625c801e134e400de80f1873ea9f91 100644
--- a/lib/plugins/usermanager/lang/ru/lang.php
+++ b/lib/plugins/usermanager/lang/ru/lang.php
@@ -20,6 +20,7 @@
  * @author Ivan I. Udovichenko (sendtome@mymailbox.pp.ua)
  * @author Pavel <ivanovtsk@mail.ru>
  * @author Aleksandr Selivanov <alexgearbox@yandex.ru>
+ * @author Igor Degraf <igordegraf@gmail.com>
  */
 $lang['menu']                  = 'Управление пользователями';
 $lang['noauth']                = '(авторизация пользователей недоступна)';
@@ -77,3 +78,4 @@ $lang['import_error_upload']   = 'Импорт не удался. CSV-файл 
 $lang['import_error_readfail'] = 'Импорт не удался. Невозможно прочесть загруженный файл.';
 $lang['import_error_create']   = 'Невозможно создать пользователя';
 $lang['import_notify_fail']    = 'Оповещение не может быть отправлено импортированному пользователю %s по электронной почте %s.';
+$lang['import_downloadfailures'] = 'Скачать Ошибки в формате CSV для исправления';
diff --git a/lib/plugins/usermanager/lang/sk/import.txt b/lib/plugins/usermanager/lang/sk/import.txt
index 91fa3e3708f3d07063bf687493b539f308cc503f..2207f6162b6451db6a5a5010a7f897db580121f5 100644
--- a/lib/plugins/usermanager/lang/sk/import.txt
+++ b/lib/plugins/usermanager/lang/sk/import.txt
@@ -2,7 +2,7 @@
 
 Vyžaduje CSV súbor používateľov s minimálne 4 stĺpcami.
 Stĺpce musia obsahovať postupne: ID používateľa, meno a priezvisko, emailová adresa a skupiny.
-CVS záznamy by mali byť oddelené čiarkou (,) a reťazce uzavreté úvodzovkami (""). Znak (\) sa používa v spojení so špeciálnymi znakmi.
+CVS záznamy by mali byť oddelené čiarkou (,) a reťazce uzavreté úvodzovkami (%%""%%). Znak (\) sa používa v spojení so špeciálnymi znakmi.
 Príklad vhodného súboru je možné získať funkciou "Export používateľov".
 Duplicitné ID používateľov budú ignorované.
 
diff --git a/lib/plugins/usermanager/lang/th/lang.php b/lib/plugins/usermanager/lang/th/lang.php
index eb88d7b913f3692fd4c0750304db72a792477df4..d6e14f65f657caea8de6df52401a8e4cf576759f 100644
--- a/lib/plugins/usermanager/lang/th/lang.php
+++ b/lib/plugins/usermanager/lang/th/lang.php
@@ -1,7 +1,8 @@
 <?php
+
 /**
- * Thai language file
- *
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * 
  * @author Komgrit Niyomrath <n.komgrit@gmail.com>
  * @author Kittithat Arnontavilas mrtomyum@gmail.com
  * @author Kittithat Arnontavilas <mrtomyum@gmail.com>
diff --git a/lib/plugins/usermanager/lang/zh-tw/import.txt b/lib/plugins/usermanager/lang/zh-tw/import.txt
index a6bb5f6ef3c37492fceed9916750ca2bc88eb362..925cdc9d0712066ae928f1704f362eb407ec1c2d 100644
--- a/lib/plugins/usermanager/lang/zh-tw/import.txt
+++ b/lib/plugins/usermanager/lang/zh-tw/import.txt
@@ -2,7 +2,7 @@
 
 需提供 CSV 格式的使用者列表檔案(UTF-8 編碼)。
 每列至少 4 欄,依序為:帳號、姓名、電郵、群組。
-各欄以半形逗號 (,) 分隔,有半形逗號的字串可用半形雙引號 ("") 分開,引號可用反斜線 (\) 跳脫。
+各欄以半形逗號 (,) 分隔,有半形逗號的字串可用半形雙引號 (%%""%%) 分開,引號可用反斜線 (\) 跳脫。
 重複的使用者帳號會自動忽略。
 如需要範例檔案,可用上面的「匯出使用者」取得。
 
diff --git a/lib/plugins/usermanager/lang/zh-tw/lang.php b/lib/plugins/usermanager/lang/zh-tw/lang.php
index 3fb6b671247d4877eba091784bf00d6976808212..61555254d85d1ae01ad3787825d85b3d6e7e1682 100644
--- a/lib/plugins/usermanager/lang/zh-tw/lang.php
+++ b/lib/plugins/usermanager/lang/zh-tw/lang.php
@@ -16,19 +16,14 @@
  * @author Danny Lin <danny0838@gmail.com>
  */
 $lang['menu']                  = '帳號管理器';
-
-// custom language strings for the plugin
 $lang['noauth']                = '(帳號認證尚未開放)';
 $lang['nosupport']             = '(尚不支援帳號管理)';
-
 $lang['badauth']               = '錯誤的認證機制';
-
 $lang['user_id']               = '帳號';
 $lang['user_pass']             = '密碼';
 $lang['user_name']             = '名稱';
 $lang['user_mail']             = '電郵';
 $lang['user_groups']           = '群組';
-
 $lang['field']                 = '欄位';
 $lang['value']                 = '設定值';
 $lang['add']                   = '增加';
@@ -46,7 +41,6 @@ $lang['export_filtered']       = '匯出篩選後的使用者列表 (CSV)';
 $lang['import']                = '匯入新使用者';
 $lang['line']                  = '列號';
 $lang['error']                 = '錯誤訊息';
-
 $lang['summary']               = '顯示帳號 %1$d-%2$d,共 %3$d 筆符合。共有 %4$d 個帳號。';
 $lang['nonefound']             = '找不到帳號。共有 %d 個帳號。';
 $lang['delete_ok']             = '已刪除 %d 個帳號';
@@ -54,13 +48,10 @@ $lang['delete_fail']           = '%d 個帳號無法刪除。';
 $lang['update_ok']             = '已更新該帳號';
 $lang['update_fail']           = '無法更新該帳號';
 $lang['update_exists']         = '無法變更帳號名稱 (%s) ,因為有同名帳號存在。其他修改則已套用。';
-
 $lang['start']                 = '開始';
 $lang['prev']                  = '上一頁';
 $lang['next']                  = '下一頁';
 $lang['last']                  = '最後一頁';
-
-// added after 2006-03-09 release
 $lang['edit_usermissing']      = '找不到選取的帳號,可能已被刪除或改為其他名稱。';
 $lang['user_notify']           = '通知使用者';
 $lang['note_notify']           = '通知信只會在指定使用者新密碼時寄送。';
@@ -70,8 +61,6 @@ $lang['add_ok']                = '已新增使用者';
 $lang['add_fail']              = '無法新增使用者';
 $lang['notify_ok']             = '通知信已寄出';
 $lang['notify_fail']           = '通知信無法寄出';
-
-// import & errors
 $lang['import_userlistcsv']    = '使用者列表檔案 (CSV):  ';
 $lang['import_header']         = '最近一次匯入 - 失敗';
 $lang['import_success_count']  = '使用者匯入:找到 %d 個使用者,已成功匯入 %d 個。';
diff --git a/lib/plugins/usermanager/lang/zh/import.txt b/lib/plugins/usermanager/lang/zh/import.txt
index eacce5a77da7dbead3dfa4aa93c6f3d27fc5cb3a..243a53e8434acccbf70d7933dafc67400730cfd9 100644
--- a/lib/plugins/usermanager/lang/zh/import.txt
+++ b/lib/plugins/usermanager/lang/zh/import.txt
@@ -1,7 +1,7 @@
 ===== 批量导入用户 =====
 
 需要至少有 4 列的 CSV 格式用户列表文件。列必须按顺序包括:用户ID、全名、电子邮件地址和组。
-CSV 域需要用逗号 (,) 分隔,字符串用英文双引号 ("") 分开。反斜杠可以用来转义。
+CSV 域需要用逗号 (,) 分隔,字符串用英文双引号 (%%""%%) 分开。反斜杠可以用来转义。
 可以尝试上面的“导入用户”功能来查看示例文件。重复的用户ID将被忽略。
 
 密码生成后会通过电子邮件发送给每个成功导入的用户。
\ No newline at end of file
diff --git a/lib/plugins/usermanager/plugin.info.txt b/lib/plugins/usermanager/plugin.info.txt
index 315459122f8ec6fde36d74c0d935a494538fbbf6..ae4f9b9ccab4ead43febf119ee0a153d1c65a830 100644
--- a/lib/plugins/usermanager/plugin.info.txt
+++ b/lib/plugins/usermanager/plugin.info.txt
@@ -1,7 +1,7 @@
 base   usermanager
 author Chris Smith
 email  chris@jalakai.co.uk
-date   2013-02-20
+date   2014-03-05
 name   User Manager
 desc   Manage DokuWiki user accounts
 url    http://dokuwiki.org/plugin:usermanager
diff --git a/lib/scripts/compatibility.js b/lib/scripts/compatibility.js
index 76b135b23fda19837098c641202db66fdb6be8cc..fc020cce80845d7207009b4437d60098ee06b1e5 100644
--- a/lib/scripts/compatibility.js
+++ b/lib/scripts/compatibility.js
@@ -77,9 +77,32 @@ var index = {
 };
 
 var ajax_quicksearch = {
-    init: DEPRECATED_WRAP(dw_qsearch.init, dw_qsearch),
-    clear_results: DEPRECATED_WRAP(dw_qsearch.clear_results, dw_qsearch),
-    onCompletion: DEPRECATED_WRAP(dw_qsearch.onCompletion, dw_qsearch)
+    init: function() {
+        DEPRECATED('Use jQuery().dw_qsearch() instead');
+        jQuery('#qsearch__in').dw_qsearch({
+            output: '#qsearch__out'
+        });
+    },
+    clear_results: function() {
+        DEPRECATED('ajax_quicksearch.clear_results is removed');
+    },
+    onCompletion: function() {
+        DEPRECATED('ajax_quicksearch.onCompletion is removed');
+    }
+};
+var dw_qsearch = {
+    init: function(input, output) {
+        DEPRECATED('Use jQuery().dw_qsearch() instead');
+        jQuery(input).dw_qsearch({
+            output: output
+        });
+    },
+    clear_results: function() {
+        DEPRECATED('dw_qsearch.clear_results is removed');
+    },
+    onCompletion: function() {
+        DEPRECATED('dw_qsearch.onCompletion is removed');
+    }
 };
 
 var linkwiz = {
diff --git a/lib/scripts/fileuploader.js b/lib/scripts/fileuploader.js
index e75b8d3a52364ce34adf13c3c9ae69bb0efc11e4..d6278950b97a87a0a4e495ec4cb937c643767191 100644
--- a/lib/scripts/fileuploader.js
+++ b/lib/scripts/fileuploader.js
@@ -226,7 +226,9 @@ qq.obj2url = function(obj, temp, prefixDone){
     } else if ((typeof obj != 'undefined') && (obj !== null) && (typeof obj === "object")){
         // for anything else but a scalar, we will use for-in-loop
         for (var i in obj){
-            add(obj[i], i);
+            if(obj.hasOwnProperty(i) && typeof obj[i] != 'function') {
+                add(obj[i], i);
+            }
         }
     } else {
         uristrings.push(encodeURIComponent(temp) + '=' + encodeURIComponent(obj));
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png
index 8c47bb636119a9c7a1c81e9aed4c5e35b436daa9..4b8c26b723c23f7e83e5d61edaf0872d7b1bf6df 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_flat_75_ffffff_40x100.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_flat_75_ffffff_40x100.png
index a2fe0297b1313f96917579960d3ae595e743ea01..718a4045414e0dabd438660f79cd4c6f228e6e19 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_flat_75_ffffff_40x100.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_flat_75_ffffff_40x100.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png
index 78eb29e1e1013e44c26270a6d245afde5ee0ca7c..9e3de4335ad12bdadbe7cc0710afb7ad73e42ff1 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_65_ffffff_1x400.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_65_ffffff_1x400.png
index 26d2fa2b4d3d24dd833a570f02b0d3f37ec69b73..18fd8b166728f5ff185aa4bb3df012d08ac78854 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_65_ffffff_1x400.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_65_ffffff_1x400.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_75_dadada_1x400.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_75_dadada_1x400.png
index 16b6247a14a1deb7c2c8f2c4d04a6327620e1fb2..8f31ae15dc12a2fd2e30491065baa6735ae6fd0c 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_75_dadada_1x400.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_75_dadada_1x400.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png
index 72303d6aa1be89059a9d6a136a78a208a162f704..a6effc68ebd9aee94648798a7a6422afebb81618 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png
index 95d5ce6d16653f3b267ca173213ebae0cb06ff4f..c50038affa7e2dd8704b809efca7cc0edd834a69 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png
index 331976d8dd4b83fe2087eabc32c8acaa131d65d4..f08378e9febd56a97ba6699b43b3ec803ae973ae 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_222222_256x240.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_222222_256x240.png
index e672c7f61b216dd9824204bf39547d7dc4a6cab6..8deb23b9d3247e4c0abd245bc0f44857157650db 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_222222_256x240.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_222222_256x240.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_2e83ff_256x240.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_2e83ff_256x240.png
index 4fea42e83c9ca232bc7df0e9025abe27f6949fbd..aa2ddc3b505ab063a07c0cb81fdfaf7050a4223e 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_2e83ff_256x240.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_2e83ff_256x240.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_454545_256x240.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_454545_256x240.png
index 3e2b5c031e4272dfb44aebc3c3f227a6d66a4aa3..ef231bb2550f0ecdfa2470eff59573d80fbe4d74 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_454545_256x240.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_454545_256x240.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_888888_256x240.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_888888_256x240.png
index 95c9d21d1050fb5e293acefdb631543cbb6e099e..8bfb685341064524e810de23eb8b22c45b3fb70a 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_888888_256x240.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_888888_256x240.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_cd0a0a_256x240.png b/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_cd0a0a_256x240.png
index 98487c2499d2b8faebe4ac3d498a22984e326296..d72d6906d1068db96752c0cce7f6253b1a081336 100644
Binary files a/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_cd0a0a_256x240.png and b/lib/scripts/jquery/jquery-ui-theme/images/ui-icons_cd0a0a_256x240.png differ
diff --git a/lib/scripts/jquery/jquery-ui-theme/smoothness.css b/lib/scripts/jquery/jquery-ui-theme/smoothness.css
index 34f3ada3e1f7db4ba031e283fc9588f8cba7714d..93a79cad2dce85399e74ecb7a99935935c93682e 100644
--- a/lib/scripts/jquery/jquery-ui-theme/smoothness.css
+++ b/lib/scripts/jquery/jquery-ui-theme/smoothness.css
@@ -1,6 +1,6 @@
-/*! jQuery UI - v1.10.4 - 2014-01-17
+/*! jQuery UI - v1.11.0 - 2014-06-26
 * http://jqueryui.com
-* 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.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
+* Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
 * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
 * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
 
@@ -90,16 +90,14 @@
 	display: block;
 	cursor: pointer;
 	position: relative;
-	margin-top: 2px;
+	margin: 2px 0 0 0;
 	padding: .5em .5em .5em .7em;
 	min-height: 0; /* support: IE7 */
+	font-size: 100%;
 }
 .ui-accordion .ui-accordion-icons {
 	padding-left: 2.2em;
 }
-.ui-accordion .ui-accordion-noicons {
-	padding-left: .7em;
-}
 .ui-accordion .ui-accordion-icons .ui-accordion-icons {
 	padding-left: 2.2em;
 }
@@ -449,74 +447,62 @@ button.ui-button::-moz-focus-inner {
 .ui-draggable .ui-dialog-titlebar {
 	cursor: move;
 }
+.ui-draggable-handle {
+	-ms-touch-action: none;
+	touch-action: none;
+}
 .ui-menu {
 	list-style: none;
-	padding: 2px;
+	padding: 0;
 	margin: 0;
 	display: block;
 	outline: none;
 }
 .ui-menu .ui-menu {
-	margin-top: -3px;
 	position: absolute;
 }
 .ui-menu .ui-menu-item {
+	position: relative;
 	margin: 0;
-	padding: 0;
-	width: 100%;
+	padding: 3px 1em 3px .4em;
+	cursor: pointer;
+	min-height: 0; /* support: IE7 */
 	/* support: IE10, see #8844 */
-	list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
+	list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
 }
 .ui-menu .ui-menu-divider {
-	margin: 5px -2px 5px -2px;
+	margin: 5px 0;
 	height: 0;
 	font-size: 0;
 	line-height: 0;
 	border-width: 1px 0 0 0;
 }
-.ui-menu .ui-menu-item a {
-	text-decoration: none;
-	display: block;
-	padding: 2px .4em;
-	line-height: 1.5;
-	min-height: 0; /* support: IE7 */
-	font-weight: normal;
-}
-.ui-menu .ui-menu-item a.ui-state-focus,
-.ui-menu .ui-menu-item a.ui-state-active {
-	font-weight: normal;
+.ui-menu .ui-state-focus,
+.ui-menu .ui-state-active {
 	margin: -1px;
 }
 
-.ui-menu .ui-state-disabled {
-	font-weight: normal;
-	margin: .4em 0 .2em;
-	line-height: 1.5;
-}
-.ui-menu .ui-state-disabled a {
-	cursor: default;
-}
-
 /* icon support */
 .ui-menu-icons {
 	position: relative;
 }
-.ui-menu-icons .ui-menu-item a {
-	position: relative;
+.ui-menu-icons .ui-menu-item {
 	padding-left: 2em;
 }
 
 /* left-aligned */
 .ui-menu .ui-icon {
 	position: absolute;
-	top: .2em;
+	top: 0;
+	bottom: 0;
 	left: .2em;
+	margin: auto 0;
 }
 
 /* right-aligned */
 .ui-menu .ui-menu-icon {
-	position: static;
-	float: right;
+	left: auto;
+	right: 0;
 }
 .ui-progressbar {
 	height: 2em;
@@ -543,6 +529,8 @@ button.ui-button::-moz-focus-inner {
 	position: absolute;
 	font-size: 0.1px;
 	display: block;
+	-ms-touch-action: none;
+	touch-action: none;
 }
 .ui-resizable-disabled .ui-resizable-handle,
 .ui-resizable-autohide .ui-resizable-handle {
@@ -604,11 +592,64 @@ button.ui-button::-moz-focus-inner {
 	right: -5px;
 	top: -5px;
 }
+.ui-selectable {
+	-ms-touch-action: none;
+	touch-action: none;
+}
 .ui-selectable-helper {
 	position: absolute;
 	z-index: 100;
 	border: 1px dotted black;
 }
+.ui-selectmenu-menu {
+	padding: 0;
+	margin: 0;
+	position: absolute;
+	top: 0;
+	left: 0;
+	display: none;
+}
+.ui-selectmenu-menu .ui-menu {
+	overflow: auto;
+	/* Support: IE7 */
+	overflow-x: hidden;
+	padding-bottom: 1px;
+}
+.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
+	font-size: 1em;
+	font-weight: bold;
+	line-height: 1.5;
+	padding: 2px 0.4em;
+	margin: 0.5em 0 0 0;
+	height: auto;
+	border: 0;
+}
+.ui-selectmenu-open {
+	display: block;
+}
+.ui-selectmenu-button {
+	display: inline-block;
+	overflow: hidden;
+	position: relative;
+	text-decoration: none;
+	cursor: pointer;
+}
+.ui-selectmenu-button span.ui-icon {
+	right: 0.5em;
+	left: auto;
+	margin-top: -8px;
+	position: absolute;
+	top: 50%;
+}
+.ui-selectmenu-button span.ui-selectmenu-text {
+	text-align: left;
+	padding: 0.4em 2.1em 0.4em 1em;
+	display: block;
+	line-height: 1.4;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	white-space: nowrap;
+}
 .ui-slider {
 	position: relative;
 	text-align: left;
@@ -619,6 +660,8 @@ button.ui-button::-moz-focus-inner {
 	width: 1.2em;
 	height: 1.2em;
 	cursor: default;
+	-ms-touch-action: none;
+	touch-action: none;
 }
 .ui-slider .ui-slider-range {
 	position: absolute;
@@ -672,6 +715,10 @@ button.ui-button::-moz-focus-inner {
 .ui-slider-vertical .ui-slider-range-max {
 	top: 0;
 }
+.ui-sortable-handle {
+	-ms-touch-action: none;
+	touch-action: none;
+}
 .ui-spinner {
 	position: relative;
 	display: inline-block;
@@ -798,7 +845,7 @@ body .ui-tooltip {
 }
 .ui-widget-content {
 	border: 1px solid #aaaaaa;
-	background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
+	background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
 	color: #222222;
 }
 .ui-widget-content a {
@@ -806,7 +853,7 @@ body .ui-tooltip {
 }
 .ui-widget-header {
 	border: 1px solid #aaaaaa;
-	background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
+	background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
 	color: #222222;
 	font-weight: bold;
 }
@@ -820,7 +867,7 @@ body .ui-tooltip {
 .ui-widget-content .ui-state-default,
 .ui-widget-header .ui-state-default {
 	border: 1px solid #d3d3d3;
-	background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
+	background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
 	font-weight: normal;
 	color: #555555;
 }
@@ -837,7 +884,7 @@ body .ui-tooltip {
 .ui-widget-content .ui-state-focus,
 .ui-widget-header .ui-state-focus {
 	border: 1px solid #999999;
-	background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
+	background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
 	font-weight: normal;
 	color: #212121;
 }
@@ -856,7 +903,7 @@ body .ui-tooltip {
 .ui-widget-content .ui-state-active,
 .ui-widget-header .ui-state-active {
 	border: 1px solid #aaaaaa;
-	background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
+	background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
 	font-weight: normal;
 	color: #212121;
 }
@@ -873,7 +920,7 @@ body .ui-tooltip {
 .ui-widget-content .ui-state-highlight,
 .ui-widget-header .ui-state-highlight {
 	border: 1px solid #fcefa1;
-	background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
+	background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
 	color: #363636;
 }
 .ui-state-highlight a,
@@ -885,7 +932,7 @@ body .ui-tooltip {
 .ui-widget-content .ui-state-error,
 .ui-widget-header .ui-state-error {
 	border: 1px solid #cd0a0a;
-	background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
+	background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
 	color: #cd0a0a;
 }
 .ui-state-error a,
@@ -931,27 +978,27 @@ body .ui-tooltip {
 }
 .ui-icon,
 .ui-widget-content .ui-icon {
-	background-image: url(images/ui-icons_222222_256x240.png);
+	background-image: url("images/ui-icons_222222_256x240.png");
 }
 .ui-widget-header .ui-icon {
-	background-image: url(images/ui-icons_222222_256x240.png);
+	background-image: url("images/ui-icons_222222_256x240.png");
 }
 .ui-state-default .ui-icon {
-	background-image: url(images/ui-icons_888888_256x240.png);
+	background-image: url("images/ui-icons_888888_256x240.png");
 }
 .ui-state-hover .ui-icon,
 .ui-state-focus .ui-icon {
-	background-image: url(images/ui-icons_454545_256x240.png);
+	background-image: url("images/ui-icons_454545_256x240.png");
 }
 .ui-state-active .ui-icon {
-	background-image: url(images/ui-icons_454545_256x240.png);
+	background-image: url("images/ui-icons_454545_256x240.png");
 }
 .ui-state-highlight .ui-icon {
-	background-image: url(images/ui-icons_2e83ff_256x240.png);
+	background-image: url("images/ui-icons_2e83ff_256x240.png");
 }
 .ui-state-error .ui-icon,
 .ui-state-error-text .ui-icon {
-	background-image: url(images/ui-icons_cd0a0a_256x240.png);
+	background-image: url("images/ui-icons_cd0a0a_256x240.png");
 }
 
 /* positioning */
@@ -1164,14 +1211,14 @@ body .ui-tooltip {
 
 /* Overlays */
 .ui-widget-overlay {
-	background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
+	background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
 	opacity: .3;
 	filter: Alpha(Opacity=30);
 }
 .ui-widget-shadow {
 	margin: -8px 0 0 -8px;
 	padding: 8px;
-	background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
+	background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
 	opacity: .3;
 	filter: Alpha(Opacity=30);
 	border-radius: 8px;
diff --git a/lib/scripts/jquery/jquery-ui.js b/lib/scripts/jquery/jquery-ui.js
index eb4ec72365fbd6706c1373c9e14ff899d561967a..670e39a8f96e55cac280d4d91318daafd5a73a9e 100644
--- a/lib/scripts/jquery/jquery-ui.js
+++ b/lib/scripts/jquery/jquery-ui.js
@@ -1,18 +1,36 @@
-/*! jQuery UI - v1.10.4 - 2014-01-17
+/*! jQuery UI - v1.11.0 - 2014-06-26
 * http://jqueryui.com
-* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.slider.js, jquery.ui.sortable.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
+* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
 * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
 
-(function( $, undefined ) {
+(function( factory ) {
+	if ( typeof define === "function" && define.amd ) {
+
+		// AMD. Register as an anonymous module.
+		define([ "jquery" ], factory );
+	} else {
+
+		// Browser globals
+		factory( jQuery );
+	}
+}(function( $ ) {
+/*!
+ * jQuery UI Core 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/category/ui-core/
+ */
 
-var uuid = 0,
-	runiqueId = /^ui-id-\d+$/;
 
 // $.ui might exist from components with no dependencies, e.g., $.ui.position
 $.ui = $.ui || {};
 
 $.extend( $.ui, {
-	version: "1.10.4",
+	version: "1.11.0",
 
 	keyCode: {
 		BACKSPACE: 8,
@@ -24,12 +42,6 @@ $.extend( $.ui, {
 		ESCAPE: 27,
 		HOME: 36,
 		LEFT: 37,
-		NUMPAD_ADD: 107,
-		NUMPAD_DECIMAL: 110,
-		NUMPAD_DIVIDE: 111,
-		NUMPAD_ENTER: 108,
-		NUMPAD_MULTIPLY: 106,
-		NUMPAD_SUBTRACT: 109,
 		PAGE_DOWN: 34,
 		PAGE_UP: 33,
 		PERIOD: 190,
@@ -42,77 +54,35 @@ $.extend( $.ui, {
 
 // plugins
 $.fn.extend({
-	focus: (function( orig ) {
-		return function( delay, fn ) {
-			return typeof delay === "number" ?
-				this.each(function() {
-					var elem = this;
-					setTimeout(function() {
-						$( elem ).focus();
-						if ( fn ) {
-							fn.call( elem );
-						}
-					}, delay );
-				}) :
-				orig.apply( this, arguments );
-		};
-	})( $.fn.focus ),
-
 	scrollParent: function() {
-		var scrollParent;
-		if (($.ui.ie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) {
-			scrollParent = this.parents().filter(function() {
-				return (/(relative|absolute|fixed)/).test($.css(this,"position")) && (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
-			}).eq(0);
-		} else {
-			scrollParent = this.parents().filter(function() {
-				return (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
-			}).eq(0);
-		}
+		var position = this.css( "position" ),
+			excludeStaticParent = position === "absolute",
+			scrollParent = this.parents().filter( function() {
+				var parent = $( this );
+				if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
+					return false;
+				}
+				return (/(auto|scroll)/).test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
+			}).eq( 0 );
 
-		return (/fixed/).test(this.css("position")) || !scrollParent.length ? $(document) : scrollParent;
+		return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
 	},
 
-	zIndex: function( zIndex ) {
-		if ( zIndex !== undefined ) {
-			return this.css( "zIndex", zIndex );
-		}
+	uniqueId: (function() {
+		var uuid = 0;
 
-		if ( this.length ) {
-			var elem = $( this[ 0 ] ), position, value;
-			while ( elem.length && elem[ 0 ] !== document ) {
-				// Ignore z-index if position is set to a value where z-index is ignored by the browser
-				// This makes behavior of this function consistent across browsers
-				// WebKit always returns auto if the element is positioned
-				position = elem.css( "position" );
-				if ( position === "absolute" || position === "relative" || position === "fixed" ) {
-					// IE returns 0 when zIndex is not specified
-					// other browsers return a string
-					// we ignore the case of nested elements with an explicit value of 0
-					// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
-					value = parseInt( elem.css( "zIndex" ), 10 );
-					if ( !isNaN( value ) && value !== 0 ) {
-						return value;
-					}
+		return function() {
+			return this.each(function() {
+				if ( !this.id ) {
+					this.id = "ui-id-" + ( ++uuid );
 				}
-				elem = elem.parent();
-			}
-		}
-
-		return 0;
-	},
-
-	uniqueId: function() {
-		return this.each(function() {
-			if ( !this.id ) {
-				this.id = "ui-id-" + (++uuid);
-			}
-		});
-	},
+			});
+		};
+	})(),
 
 	removeUniqueId: function() {
 		return this.each(function() {
-			if ( runiqueId.test( this.id ) ) {
+			if ( /^ui-id-\d+$/.test( this.id ) ) {
 				$( this ).removeAttr( "id" );
 			}
 		});
@@ -240,93 +210,129 @@ if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
 	})( $.fn.removeData );
 }
 
-
-
-
-
 // deprecated
 $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
 
-$.support.selectstart = "onselectstart" in document.createElement( "div" );
 $.fn.extend({
-	disableSelection: function() {
-		return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
-			".ui-disableSelection", function( event ) {
+	focus: (function( orig ) {
+		return function( delay, fn ) {
+			return typeof delay === "number" ?
+				this.each(function() {
+					var elem = this;
+					setTimeout(function() {
+						$( elem ).focus();
+						if ( fn ) {
+							fn.call( elem );
+						}
+					}, delay );
+				}) :
+				orig.apply( this, arguments );
+		};
+	})( $.fn.focus ),
+
+	disableSelection: (function() {
+		var eventType = "onselectstart" in document.createElement( "div" ) ?
+			"selectstart" :
+			"mousedown";
+
+		return function() {
+			return this.bind( eventType + ".ui-disableSelection", function( event ) {
 				event.preventDefault();
 			});
-	},
+		};
+	})(),
 
 	enableSelection: function() {
 		return this.unbind( ".ui-disableSelection" );
-	}
-});
+	},
 
-$.extend( $.ui, {
-	// $.ui.plugin is deprecated. Use $.widget() extensions instead.
-	plugin: {
-		add: function( module, option, set ) {
-			var i,
-				proto = $.ui[ module ].prototype;
-			for ( i in set ) {
-				proto.plugins[ i ] = proto.plugins[ i ] || [];
-				proto.plugins[ i ].push( [ option, set[ i ] ] );
-			}
-		},
-		call: function( instance, name, args ) {
-			var i,
-				set = instance.plugins[ name ];
-			if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
-				return;
-			}
+	zIndex: function( zIndex ) {
+		if ( zIndex !== undefined ) {
+			return this.css( "zIndex", zIndex );
+		}
 
-			for ( i = 0; i < set.length; i++ ) {
-				if ( instance.options[ set[ i ][ 0 ] ] ) {
-					set[ i ][ 1 ].apply( instance.element, args );
+		if ( this.length ) {
+			var elem = $( this[ 0 ] ), position, value;
+			while ( elem.length && elem[ 0 ] !== document ) {
+				// Ignore z-index if position is set to a value where z-index is ignored by the browser
+				// This makes behavior of this function consistent across browsers
+				// WebKit always returns auto if the element is positioned
+				position = elem.css( "position" );
+				if ( position === "absolute" || position === "relative" || position === "fixed" ) {
+					// IE returns 0 when zIndex is not specified
+					// other browsers return a string
+					// we ignore the case of nested elements with an explicit value of 0
+					// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
+					value = parseInt( elem.css( "zIndex" ), 10 );
+					if ( !isNaN( value ) && value !== 0 ) {
+						return value;
+					}
 				}
+				elem = elem.parent();
 			}
 		}
-	},
 
-	// only used by resizable
-	hasScroll: function( el, a ) {
+		return 0;
+	}
+});
 
-		//If overflow is hidden, the element might have extra content, but the user wants to hide it
-		if ( $( el ).css( "overflow" ) === "hidden") {
-			return false;
+// $.ui.plugin is deprecated. Use $.widget() extensions instead.
+$.ui.plugin = {
+	add: function( module, option, set ) {
+		var i,
+			proto = $.ui[ module ].prototype;
+		for ( i in set ) {
+			proto.plugins[ i ] = proto.plugins[ i ] || [];
+			proto.plugins[ i ].push( [ option, set[ i ] ] );
 		}
+	},
+	call: function( instance, name, args, allowDisconnected ) {
+		var i,
+			set = instance.plugins[ name ];
 
-		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
-			has = false;
+		if ( !set ) {
+			return;
+		}
 
-		if ( el[ scroll ] > 0 ) {
-			return true;
+		if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
+			return;
 		}
 
-		// TODO: determine which cases actually cause this to happen
-		// if the element doesn't have the scroll set, see if it's possible to
-		// set the scroll
-		el[ scroll ] = 1;
-		has = ( el[ scroll ] > 0 );
-		el[ scroll ] = 0;
-		return has;
+		for ( i = 0; i < set.length; i++ ) {
+			if ( instance.options[ set[ i ][ 0 ] ] ) {
+				set[ i ][ 1 ].apply( instance.element, args );
+			}
+		}
 	}
-});
+};
 
-})( jQuery );
-(function( $, undefined ) {
 
-var uuid = 0,
-	slice = Array.prototype.slice,
-	_cleanData = $.cleanData;
-$.cleanData = function( elems ) {
-	for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-		try {
-			$( elem ).triggerHandler( "remove" );
-		// http://bugs.jquery.com/ticket/8235
-		} catch( e ) {}
-	}
-	_cleanData( elems );
-};
+/*!
+ * jQuery UI Widget 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/jQuery.widget/
+ */
+
+
+var widget_uuid = 0,
+	widget_slice = Array.prototype.slice;
+
+$.cleanData = (function( orig ) {
+	return function( elems ) {
+		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+			try {
+				$( elem ).triggerHandler( "remove" );
+			// http://bugs.jquery.com/ticket/8235
+			} catch( e ) {}
+		}
+		orig( elems );
+	};
+})( $.cleanData );
 
 $.widget = function( name, base, prototype ) {
 	var fullName, existingConstructor, constructor, basePrototype,
@@ -439,10 +445,12 @@ $.widget = function( name, base, prototype ) {
 	}
 
 	$.widget.bridge( name, constructor );
+
+	return constructor;
 };
 
 $.widget.extend = function( target ) {
-	var input = slice.call( arguments, 1 ),
+	var input = widget_slice.call( arguments, 1 ),
 		inputIndex = 0,
 		inputLength = input.length,
 		key,
@@ -471,7 +479,7 @@ $.widget.bridge = function( name, object ) {
 	var fullName = object.prototype.widgetFullName || name;
 	$.fn[ name ] = function( options ) {
 		var isMethodCall = typeof options === "string",
-			args = slice.call( arguments, 1 ),
+			args = widget_slice.call( arguments, 1 ),
 			returnValue = this;
 
 		// allow multiple hashes to be passed on init
@@ -483,6 +491,10 @@ $.widget.bridge = function( name, object ) {
 			this.each(function() {
 				var methodValue,
 					instance = $.data( this, fullName );
+				if ( options === "instance" ) {
+					returnValue = instance;
+					return false;
+				}
 				if ( !instance ) {
 					return $.error( "cannot call methods on " + name + " prior to initialization; " +
 						"attempted to call method '" + options + "'" );
@@ -502,7 +514,10 @@ $.widget.bridge = function( name, object ) {
 			this.each(function() {
 				var instance = $.data( this, fullName );
 				if ( instance ) {
-					instance.option( options || {} )._init();
+					instance.option( options || {} );
+					if ( instance._init ) {
+						instance._init();
+					}
 				} else {
 					$.data( this, fullName, new object( options, this ) );
 				}
@@ -529,7 +544,7 @@ $.Widget.prototype = {
 	_createWidget: function( options, element ) {
 		element = $( element || this.defaultElement || this )[ 0 ];
 		this.element = $( element );
-		this.uuid = uuid++;
+		this.uuid = widget_uuid++;
 		this.eventNamespace = "." + this.widgetName + this.uuid;
 		this.options = $.widget.extend( {},
 			this.options,
@@ -572,9 +587,6 @@ $.Widget.prototype = {
 		// all event bindings should go through this._on()
 		this.element
 			.unbind( this.eventNamespace )
-			// 1.9 BC for #7810
-			// TODO remove dual storage
-			.removeData( this.widgetName )
 			.removeData( this.widgetFullName )
 			// support: jquery <1.6.3
 			// http://bugs.jquery.com/ticket/9413
@@ -650,20 +662,23 @@ $.Widget.prototype = {
 
 		if ( key === "disabled" ) {
 			this.widget()
-				.toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
-				.attr( "aria-disabled", value );
-			this.hoverable.removeClass( "ui-state-hover" );
-			this.focusable.removeClass( "ui-state-focus" );
+				.toggleClass( this.widgetFullName + "-disabled", !!value );
+
+			// If the widget is becoming disabled, then nothing is interactive
+			if ( value ) {
+				this.hoverable.removeClass( "ui-state-hover" );
+				this.focusable.removeClass( "ui-state-focus" );
+			}
 		}
 
 		return this;
 	},
 
 	enable: function() {
-		return this._setOption( "disabled", false );
+		return this._setOptions({ disabled: false });
 	},
 	disable: function() {
-		return this._setOption( "disabled", true );
+		return this._setOptions({ disabled: true });
 	},
 
 	_on: function( suppressDisabledCheck, element, handlers ) {
@@ -683,7 +698,6 @@ $.Widget.prototype = {
 			element = this.element;
 			delegateElement = this.widget();
 		} else {
-			// accept selectors, DOM elements
 			element = delegateElement = $( element );
 			this.bindings = this.bindings.add( element );
 		}
@@ -708,7 +722,7 @@ $.Widget.prototype = {
 					handler.guid || handlerProxy.guid || $.guid++;
 			}
 
-			var match = event.match( /^(\w+)\s*(.*)$/ ),
+			var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
 				eventName = match[1] + instance.eventNamespace,
 				selector = match[2];
 			if ( selector ) {
@@ -823,16 +837,28 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
 	};
 });
 
-})( jQuery );
-(function( $, undefined ) {
+var widget = $.widget;
+
+
+/*!
+ * jQuery UI Mouse 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/mouse/
+ */
+
 
 var mouseHandled = false;
 $( document ).mouseup( function() {
 	mouseHandled = false;
 });
 
-$.widget("ui.mouse", {
-	version: "1.10.4",
+var mouse = $.widget("ui.mouse", {
+	version: "1.11.0",
 	options: {
 		cancel: "input,textarea,button,select,option",
 		distance: 1,
@@ -842,10 +868,10 @@ $.widget("ui.mouse", {
 		var that = this;
 
 		this.element
-			.bind("mousedown."+this.widgetName, function(event) {
+			.bind("mousedown." + this.widgetName, function(event) {
 				return that._mouseDown(event);
 			})
-			.bind("click."+this.widgetName, function(event) {
+			.bind("click." + this.widgetName, function(event) {
 				if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
 					$.removeData(event.target, that.widgetName + ".preventClickEvent");
 					event.stopImmediatePropagation();
@@ -859,17 +885,19 @@ $.widget("ui.mouse", {
 	// TODO: make sure destroying one instance of mouse doesn't mess with
 	// other instances of mouse
 	_mouseDestroy: function() {
-		this.element.unbind("."+this.widgetName);
+		this.element.unbind("." + this.widgetName);
 		if ( this._mouseMoveDelegate ) {
-			$(document)
-				.unbind("mousemove."+this.widgetName, this._mouseMoveDelegate)
-				.unbind("mouseup."+this.widgetName, this._mouseUpDelegate);
+			this.document
+				.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
+				.unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
 		}
 	},
 
 	_mouseDown: function(event) {
 		// don't let more than one widget handle mouseStart
-		if( mouseHandled ) { return; }
+		if ( mouseHandled ) {
+			return;
+		}
 
 		// we may have missed mouseup (out of window)
 		(this._mouseStarted && this._mouseUp(event));
@@ -912,9 +940,10 @@ $.widget("ui.mouse", {
 		this._mouseUpDelegate = function(event) {
 			return that._mouseUp(event);
 		};
-		$(document)
-			.bind("mousemove."+this.widgetName, this._mouseMoveDelegate)
-			.bind("mouseup."+this.widgetName, this._mouseUpDelegate);
+
+		this.document
+			.bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
+			.bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
 
 		event.preventDefault();
 
@@ -926,6 +955,10 @@ $.widget("ui.mouse", {
 		// IE mouseup check - mouseup happened when mouse was out of window
 		if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
 			return this._mouseUp(event);
+
+		// Iframe mouseup check - mouseup occurred in another document
+		} else if ( !event.which ) {
+			return this._mouseUp( event );
 		}
 
 		if (this._mouseStarted) {
@@ -943,9 +976,9 @@ $.widget("ui.mouse", {
 	},
 
 	_mouseUp: function(event) {
-		$(document)
-			.unbind("mousemove."+this.widgetName, this._mouseMoveDelegate)
-			.unbind("mouseup."+this.widgetName, this._mouseUpDelegate);
+		this.document
+			.unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
+			.unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
 
 		if (this._mouseStarted) {
 			this._mouseStarted = false;
@@ -957,6 +990,7 @@ $.widget("ui.mouse", {
 			this._mouseStop(event);
 		}
 
+		mouseHandled = false;
 		return false;
 	},
 
@@ -979,12 +1013,23 @@ $.widget("ui.mouse", {
 	_mouseCapture: function(/* event */) { return true; }
 });
 
-})(jQuery);
-(function( $, undefined ) {
+
+/*!
+ * jQuery UI Position 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/position/
+ */
+
+(function() {
 
 $.ui = $.ui || {};
 
-var cachedScrollbarWidth,
+var cachedScrollbarWidth, supportsOffsetFractions,
 	max = Math.max,
 	abs = Math.abs,
 	round = Math.round,
@@ -1197,7 +1242,7 @@ $.fn.position = function( options ) {
 		position.top += myOffset[ 1 ];
 
 		// if the browser doesn't support fractions, then round for consistent results
-		if ( !$.support.offsetFractions ) {
+		if ( !supportsOffsetFractions ) {
 			position.left = round( position.left );
 			position.top = round( position.top );
 		}
@@ -1221,7 +1266,7 @@ $.fn.position = function( options ) {
 					my: options.my,
 					at: options.at,
 					within: within,
-					elem : elem
+					elem: elem
 				});
 			}
 		});
@@ -1375,8 +1420,7 @@ $.ui.position = {
 				if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
 					position.left += myOffset + atOffset + offset;
 				}
-			}
-			else if ( overRight > 0 ) {
+			} else if ( overRight > 0 ) {
 				newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
 				if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
 					position.left += myOffset + atOffset + offset;
@@ -1410,8 +1454,7 @@ $.ui.position = {
 				if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {
 					position.top += myOffset + atOffset + offset;
 				}
-			}
-			else if ( overBottom > 0 ) {
+			} else if ( overBottom > 0 ) {
 				newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
 				if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
 					position.top += myOffset + atOffset + offset;
@@ -1432,7 +1475,7 @@ $.ui.position = {
 };
 
 // fraction support test
-(function () {
+(function() {
 	var testElement, testElementParent, testElementStyle, offsetLeft, i,
 		body = document.getElementsByTagName( "body" )[ 0 ],
 		div = document.createElement( "div" );
@@ -1464,26 +1507,31 @@ $.ui.position = {
 	div.style.cssText = "position: absolute; left: 10.7432222px;";
 
 	offsetLeft = $( div ).offset().left;
-	$.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;
+	supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
 
 	testElement.innerHTML = "";
 	testElementParent.removeChild( testElement );
 })();
 
-}( jQuery ) );
-(function( $, undefined ) {
+})();
+
+var position = $.ui.position;
+
 
-var uid = 0,
-	hideProps = {},
-	showProps = {};
+/*!
+ * jQuery UI Accordion 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/accordion/
+ */
 
-hideProps.height = hideProps.paddingTop = hideProps.paddingBottom =
-	hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide";
-showProps.height = showProps.paddingTop = showProps.paddingBottom =
-	showProps.borderTopWidth = showProps.borderBottomWidth = "show";
 
-$.widget( "ui.accordion", {
-	version: "1.10.4",
+var accordion = $.widget( "ui.accordion", {
+	version: "1.11.0",
 	options: {
 		active: 0,
 		animate: {},
@@ -1501,6 +1549,22 @@ $.widget( "ui.accordion", {
 		beforeActivate: null
 	},
 
+	hideProps: {
+		borderTopWidth: "hide",
+		borderBottomWidth: "hide",
+		paddingTop: "hide",
+		paddingBottom: "hide",
+		height: "hide"
+	},
+
+	showProps: {
+		borderTopWidth: "show",
+		borderBottomWidth: "show",
+		paddingTop: "show",
+		paddingBottom: "show",
+		height: "show"
+	},
+
 	_create: function() {
 		var options = this.options;
 		this.prevShow = this.prevHide = $();
@@ -1524,8 +1588,7 @@ $.widget( "ui.accordion", {
 	_getCreateEventData: function() {
 		return {
 			header: this.active,
-			panel: !this.active.length ? $() : this.active.next(),
-			content: !this.active.length ? $() : this.active.next()
+			panel: !this.active.length ? $() : this.active.next()
 		};
 	},
 
@@ -1559,31 +1622,27 @@ $.widget( "ui.accordion", {
 
 		// clean up headers
 		this.headers
-			.removeClass( "ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
+			.removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " +
+				"ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
 			.removeAttr( "role" )
 			.removeAttr( "aria-expanded" )
 			.removeAttr( "aria-selected" )
 			.removeAttr( "aria-controls" )
 			.removeAttr( "tabIndex" )
-			.each(function() {
-				if ( /^ui-accordion/.test( this.id ) ) {
-					this.removeAttribute( "id" );
-				}
-			});
+			.removeUniqueId();
+
 		this._destroyIcons();
 
 		// clean up content panels
 		contents = this.headers.next()
+			.removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " +
+				"ui-accordion-content ui-accordion-content-active ui-state-disabled" )
 			.css( "display", "" )
 			.removeAttr( "role" )
 			.removeAttr( "aria-hidden" )
 			.removeAttr( "aria-labelledby" )
-			.removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled" )
-			.each(function() {
-				if ( /^ui-accordion/.test( this.id ) ) {
-					this.removeAttribute( "id" );
-				}
-			});
+			.removeUniqueId();
+
 		if ( this.options.heightStyle !== "content" ) {
 			contents.css( "height", "" );
 		}
@@ -1620,6 +1679,9 @@ $.widget( "ui.accordion", {
 		// #5332 - opacity doesn't cascade to positioned elements in IE
 		// so we need to add the disabled class to the headers and panels
 		if ( key === "disabled" ) {
+			this.element
+				.toggleClass( "ui-state-disabled", !!value )
+				.attr( "aria-disabled", value );
 			this.headers.add( this.headers.next() )
 				.toggleClass( "ui-state-disabled", !!value );
 		}
@@ -1664,7 +1726,7 @@ $.widget( "ui.accordion", {
 		}
 	},
 
-	_panelKeyDown : function( event ) {
+	_panelKeyDown: function( event ) {
 		if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
 			$( event.currentTarget ).prev().focus();
 		}
@@ -1704,11 +1766,11 @@ $.widget( "ui.accordion", {
 
 	_processPanels: function() {
 		this.headers = this.element.find( this.options.header )
-			.addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" );
+			.addClass( "ui-accordion-header ui-state-default ui-corner-all" );
 
 		this.headers.next()
 			.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
-			.filter(":not(.ui-accordion-content-active)")
+			.filter( ":not(.ui-accordion-content-active)" )
 			.hide();
 	},
 
@@ -1716,9 +1778,7 @@ $.widget( "ui.accordion", {
 		var maxHeight,
 			options = this.options,
 			heightStyle = options.heightStyle,
-			parent = this.element.parent(),
-			accordionId = this.accordionId = "ui-accordion-" +
-				(this.element.attr( "id" ) || ++uid);
+			parent = this.element.parent();
 
 		this.active = this._findActive( options.active )
 			.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
@@ -1729,19 +1789,11 @@ $.widget( "ui.accordion", {
 
 		this.headers
 			.attr( "role", "tab" )
-			.each(function( i ) {
+			.each(function() {
 				var header = $( this ),
-					headerId = header.attr( "id" ),
+					headerId = header.uniqueId().attr( "id" ),
 					panel = header.next(),
-					panelId = panel.attr( "id" );
-				if ( !headerId ) {
-					headerId = accordionId + "-header-" + i;
-					header.attr( "id", headerId );
-				}
-				if ( !panelId ) {
-					panelId = accordionId + "-panel-" + i;
-					panel.attr( "id", panelId );
-				}
+					panelId = panel.uniqueId().attr( "id" );
 				header.attr( "aria-controls", panelId );
 				panel.attr( "aria-labelledby", headerId );
 			})
@@ -1839,7 +1891,7 @@ $.widget( "ui.accordion", {
 			keydown: "_keydown"
 		};
 		if ( event ) {
-			$.each( event.split(" "), function( index, eventName ) {
+			$.each( event.split( " " ), function( index, eventName ) {
 				events[ eventName ] = "_eventHandler";
 			});
 		}
@@ -1977,14 +2029,14 @@ $.widget( "ui.accordion", {
 		duration = duration || options.duration || animate.duration;
 
 		if ( !toHide.length ) {
-			return toShow.animate( showProps, duration, easing, complete );
+			return toShow.animate( this.showProps, duration, easing, complete );
 		}
 		if ( !toShow.length ) {
-			return toHide.animate( hideProps, duration, easing, complete );
+			return toHide.animate( this.hideProps, duration, easing, complete );
 		}
 
 		total = toShow.show().outerHeight();
-		toHide.animate( hideProps, {
+		toHide.animate( this.hideProps, {
 			duration: duration,
 			easing: easing,
 			step: function( now, fx ) {
@@ -1993,7 +2045,7 @@ $.widget( "ui.accordion", {
 		});
 		toShow
 			.hide()
-			.animate( showProps, {
+			.animate( this.showProps, {
 				duration: duration,
 				easing: easing,
 				complete: complete,
@@ -2020,3817 +2072,3719 @@ $.widget( "ui.accordion", {
 
 		// Work around for rendering bug in IE (#5421)
 		if ( toHide.length ) {
-			toHide.parent()[0].className = toHide.parent()[0].className;
+			toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
 		}
 		this._trigger( "activate", null, data );
 	}
 });
 
-})( jQuery );
-(function( $, undefined ) {
 
-$.widget( "ui.autocomplete", {
-	version: "1.10.4",
-	defaultElement: "<input>",
+/*!
+ * jQuery UI Menu 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/menu/
+ */
+
+
+var menu = $.widget( "ui.menu", {
+	version: "1.11.0",
+	defaultElement: "<ul>",
+	delay: 300,
 	options: {
-		appendTo: null,
-		autoFocus: false,
-		delay: 300,
-		minLength: 1,
+		icons: {
+			submenu: "ui-icon-carat-1-e"
+		},
+		items: "> *",
+		menus: "ul",
 		position: {
-			my: "left top",
-			at: "left bottom",
-			collision: "none"
+			my: "left-1 top",
+			at: "right top"
 		},
-		source: null,
+		role: "menu",
 
 		// callbacks
-		change: null,
-		close: null,
+		blur: null,
 		focus: null,
-		open: null,
-		response: null,
-		search: null,
 		select: null
 	},
 
-	requestIndex: 0,
-	pending: 0,
-
 	_create: function() {
-		// Some browsers only repeat keydown events, not keypress events,
-		// so we use the suppressKeyPress flag to determine if we've already
-		// handled the keydown event. #7269
-		// Unfortunately the code for & in keypress is the same as the up arrow,
-		// so we use the suppressKeyPressRepeat flag to avoid handling keypress
-		// events when we know the keydown event was used to modify the
-		// search term. #7799
-		var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
-			nodeName = this.element[0].nodeName.toLowerCase(),
-			isTextarea = nodeName === "textarea",
-			isInput = nodeName === "input";
-
-		this.isMultiLine =
-			// Textareas are always multi-line
-			isTextarea ? true :
-			// Inputs are always single-line, even if inside a contentEditable element
-			// IE also treats inputs as contentEditable
-			isInput ? false :
-			// All other element types are determined by whether or not they're contentEditable
-			this.element.prop( "isContentEditable" );
-
-		this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
-		this.isNewMenu = true;
+		this.activeMenu = this.element;
 
+		// Flag used to prevent firing of the click handler
+		// as the event bubbles up through nested menus
+		this.mouseHandled = false;
 		this.element
-			.addClass( "ui-autocomplete-input" )
-			.attr( "autocomplete", "off" );
+			.uniqueId()
+			.addClass( "ui-menu ui-widget ui-widget-content" )
+			.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
+			.attr({
+				role: this.options.role,
+				tabIndex: 0
+			});
 
-		this._on( this.element, {
-			keydown: function( event ) {
-				if ( this.element.prop( "readOnly" ) ) {
-					suppressKeyPress = true;
-					suppressInput = true;
-					suppressKeyPressRepeat = true;
-					return;
-				}
+		if ( this.options.disabled ) {
+			this.element
+				.addClass( "ui-state-disabled" )
+				.attr( "aria-disabled", "true" );
+		}
 
-				suppressKeyPress = false;
-				suppressInput = false;
-				suppressKeyPressRepeat = false;
-				var keyCode = $.ui.keyCode;
-				switch( event.keyCode ) {
-				case keyCode.PAGE_UP:
-					suppressKeyPress = true;
-					this._move( "previousPage", event );
-					break;
-				case keyCode.PAGE_DOWN:
-					suppressKeyPress = true;
-					this._move( "nextPage", event );
-					break;
-				case keyCode.UP:
-					suppressKeyPress = true;
-					this._keyEvent( "previous", event );
-					break;
-				case keyCode.DOWN:
-					suppressKeyPress = true;
-					this._keyEvent( "next", event );
-					break;
-				case keyCode.ENTER:
-				case keyCode.NUMPAD_ENTER:
-					// when menu is open and has focus
-					if ( this.menu.active ) {
-						// #6055 - Opera still allows the keypress to occur
-						// which causes forms to submit
-						suppressKeyPress = true;
-						event.preventDefault();
-						this.menu.select( event );
-					}
-					break;
-				case keyCode.TAB:
-					if ( this.menu.active ) {
-						this.menu.select( event );
-					}
-					break;
-				case keyCode.ESCAPE:
-					if ( this.menu.element.is( ":visible" ) ) {
-						this._value( this.term );
-						this.close( event );
-						// Different browsers have different default behavior for escape
-						// Single press can mean undo or clear
-						// Double press in IE means clear the whole form
-						event.preventDefault();
-					}
-					break;
-				default:
-					suppressKeyPressRepeat = true;
-					// search timeout should be triggered before the input value is changed
-					this._searchTimeout( event );
-					break;
-				}
+		this._on({
+			// Prevent focus from sticking to links inside menu after clicking
+			// them (focus should always stay on UL during navigation).
+			"mousedown .ui-menu-item": function( event ) {
+				event.preventDefault();
 			},
-			keypress: function( event ) {
-				if ( suppressKeyPress ) {
-					suppressKeyPress = false;
-					if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
-						event.preventDefault();
+			"click .ui-menu-item": function( event ) {
+				var target = $( event.target );
+				if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
+					this.select( event );
+
+					// Only set the mouseHandled flag if the event will bubble, see #9469.
+					if ( !event.isPropagationStopped() ) {
+						this.mouseHandled = true;
 					}
-					return;
-				}
-				if ( suppressKeyPressRepeat ) {
-					return;
-				}
 
-				// replicate some key handlers to allow them to repeat in Firefox and Opera
-				var keyCode = $.ui.keyCode;
-				switch( event.keyCode ) {
-				case keyCode.PAGE_UP:
-					this._move( "previousPage", event );
-					break;
-				case keyCode.PAGE_DOWN:
-					this._move( "nextPage", event );
-					break;
-				case keyCode.UP:
-					this._keyEvent( "previous", event );
-					break;
-				case keyCode.DOWN:
-					this._keyEvent( "next", event );
-					break;
+					// Open submenu on click
+					if ( target.has( ".ui-menu" ).length ) {
+						this.expand( event );
+					} else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
+
+						// Redirect focus to the menu
+						this.element.trigger( "focus", [ true ] );
+
+						// If the active item is on the top level, let it stay active.
+						// Otherwise, blur the active item since it is no longer visible.
+						if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
+							clearTimeout( this.timer );
+						}
+					}
 				}
 			},
-			input: function( event ) {
-				if ( suppressInput ) {
-					suppressInput = false;
-					event.preventDefault();
-					return;
-				}
-				this._searchTimeout( event );
+			"mouseenter .ui-menu-item": function( event ) {
+				var target = $( event.currentTarget );
+				// Remove ui-state-active class from siblings of the newly focused menu item
+				// to avoid a jump caused by adjacent elements both having a class with a border
+				target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
+				this.focus( event, target );
 			},
-			focus: function() {
-				this.selectedItem = null;
-				this.previous = this._value();
+			mouseleave: "collapseAll",
+			"mouseleave .ui-menu": "collapseAll",
+			focus: function( event, keepActiveItem ) {
+				// If there's already an active item, keep it active
+				// If not, activate the first item
+				var item = this.active || this.element.find( this.options.items ).eq( 0 );
+
+				if ( !keepActiveItem ) {
+					this.focus( event, item );
+				}
 			},
 			blur: function( event ) {
-				if ( this.cancelBlur ) {
-					delete this.cancelBlur;
-					return;
+				this._delay(function() {
+					if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
+						this.collapseAll( event );
+					}
+				});
+			},
+			keydown: "_keydown"
+		});
+
+		this.refresh();
+
+		// Clicks outside of a menu collapse any open menus
+		this._on( this.document, {
+			click: function( event ) {
+				if ( this._closeOnDocumentClick( event ) ) {
+					this.collapseAll( event );
 				}
 
-				clearTimeout( this.searching );
-				this.close( event );
-				this._change( event );
+				// Reset the mouseHandled flag
+				this.mouseHandled = false;
 			}
 		});
+	},
 
-		this._initSource();
-		this.menu = $( "<ul>" )
-			.addClass( "ui-autocomplete ui-front" )
-			.appendTo( this._appendTo() )
-			.menu({
-				// disable ARIA support, the live region takes care of that
-				role: null
-			})
-			.hide()
-			.data( "ui-menu" );
+	_destroy: function() {
+		// Destroy (sub)menus
+		this.element
+			.removeAttr( "aria-activedescendant" )
+			.find( ".ui-menu" ).addBack()
+				.removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
+				.removeAttr( "role" )
+				.removeAttr( "tabIndex" )
+				.removeAttr( "aria-labelledby" )
+				.removeAttr( "aria-expanded" )
+				.removeAttr( "aria-hidden" )
+				.removeAttr( "aria-disabled" )
+				.removeUniqueId()
+				.show();
 
-		this._on( this.menu.element, {
-			mousedown: function( event ) {
-				// prevent moving focus out of the text field
-				event.preventDefault();
+		// Destroy menu items
+		this.element.find( ".ui-menu-item" )
+			.removeClass( "ui-menu-item" )
+			.removeAttr( "role" )
+			.removeAttr( "aria-disabled" )
+			.removeUniqueId()
+			.removeClass( "ui-state-hover" )
+			.removeAttr( "tabIndex" )
+			.removeAttr( "role" )
+			.removeAttr( "aria-haspopup" )
+			.children().each( function() {
+				var elem = $( this );
+				if ( elem.data( "ui-menu-submenu-carat" ) ) {
+					elem.remove();
+				}
+			});
 
-				// IE doesn't prevent moving focus even with event.preventDefault()
-				// so we set a flag to know when we should ignore the blur event
-				this.cancelBlur = true;
-				this._delay(function() {
-					delete this.cancelBlur;
-				});
+		// Destroy menu dividers
+		this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
+	},
 
-				// clicking on the scrollbar causes focus to shift to the body
-				// but we can't detect a mouseup or a click immediately afterward
-				// so we have to track the next mousedown and close the menu if
-				// the user clicks somewhere outside of the autocomplete
-				var menuElement = this.menu.element[ 0 ];
-				if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
-					this._delay(function() {
-						var that = this;
-						this.document.one( "mousedown", function( event ) {
-							if ( event.target !== that.element[ 0 ] &&
-									event.target !== menuElement &&
-									!$.contains( menuElement, event.target ) ) {
-								that.close();
-							}
-						});
-					});
-				}
-			},
-			menufocus: function( event, ui ) {
-				// support: Firefox
-				// Prevent accidental activation of menu items in Firefox (#7024 #9118)
-				if ( this.isNewMenu ) {
-					this.isNewMenu = false;
-					if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
-						this.menu.blur();
+	_keydown: function( event ) {
+		var match, prev, character, skip, regex,
+			preventDefault = true;
 
-						this.document.one( "mousemove", function() {
-							$( event.target ).trigger( event.originalEvent );
-						});
+		function escape( value ) {
+			return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
+		}
 
-						return;
-					}
-				}
+		switch ( event.keyCode ) {
+		case $.ui.keyCode.PAGE_UP:
+			this.previousPage( event );
+			break;
+		case $.ui.keyCode.PAGE_DOWN:
+			this.nextPage( event );
+			break;
+		case $.ui.keyCode.HOME:
+			this._move( "first", "first", event );
+			break;
+		case $.ui.keyCode.END:
+			this._move( "last", "last", event );
+			break;
+		case $.ui.keyCode.UP:
+			this.previous( event );
+			break;
+		case $.ui.keyCode.DOWN:
+			this.next( event );
+			break;
+		case $.ui.keyCode.LEFT:
+			this.collapse( event );
+			break;
+		case $.ui.keyCode.RIGHT:
+			if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
+				this.expand( event );
+			}
+			break;
+		case $.ui.keyCode.ENTER:
+		case $.ui.keyCode.SPACE:
+			this._activate( event );
+			break;
+		case $.ui.keyCode.ESCAPE:
+			this.collapse( event );
+			break;
+		default:
+			preventDefault = false;
+			prev = this.previousFilter || "";
+			character = String.fromCharCode( event.keyCode );
+			skip = false;
 
-				var item = ui.item.data( "ui-autocomplete-item" );
-				if ( false !== this._trigger( "focus", event, { item: item } ) ) {
-					// use value to match what will end up in the input, if it was a key event
-					if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
-						this._value( item.value );
-					}
-				} else {
-					// Normally the input is populated with the item's value as the
-					// menu is navigated, causing screen readers to notice a change and
-					// announce the item. Since the focus event was canceled, this doesn't
-					// happen, so we update the live region so that screen readers can
-					// still notice the change and announce it.
-					this.liveRegion.text( item.value );
-				}
-			},
-			menuselect: function( event, ui ) {
-				var item = ui.item.data( "ui-autocomplete-item" ),
-					previous = this.previous;
+			clearTimeout( this.filterTimer );
 
-				// only trigger when focus was lost (click on menu)
-				if ( this.element[0] !== this.document[0].activeElement ) {
-					this.element.focus();
-					this.previous = previous;
-					// #6109 - IE triggers two focus events and the second
-					// is asynchronous, so we need to reset the previous
-					// term synchronously and asynchronously :-(
-					this._delay(function() {
-						this.previous = previous;
-						this.selectedItem = item;
-					});
-				}
+			if ( character === prev ) {
+				skip = true;
+			} else {
+				character = prev + character;
+			}
 
-				if ( false !== this._trigger( "select", event, { item: item } ) ) {
-					this._value( item.value );
+			regex = new RegExp( "^" + escape( character ), "i" );
+			match = this.activeMenu.find( this.options.items ).filter(function() {
+				return regex.test( $( this ).text() );
+			});
+			match = skip && match.index( this.active.next() ) !== -1 ?
+				this.active.nextAll( ".ui-menu-item" ) :
+				match;
+
+			// If no matches on the current filter, reset to the last character pressed
+			// to move down the menu to the first item that starts with that character
+			if ( !match.length ) {
+				character = String.fromCharCode( event.keyCode );
+				regex = new RegExp( "^" + escape( character ), "i" );
+				match = this.activeMenu.find( this.options.items ).filter(function() {
+					return regex.test( $( this ).text() );
+				});
+			}
+
+			if ( match.length ) {
+				this.focus( event, match );
+				if ( match.length > 1 ) {
+					this.previousFilter = character;
+					this.filterTimer = this._delay(function() {
+						delete this.previousFilter;
+					}, 1000 );
+				} else {
+					delete this.previousFilter;
 				}
-				// reset the term after the select event
-				// this allows custom select handling to work properly
-				this.term = this._value();
+			} else {
+				delete this.previousFilter;
+			}
+		}
 
-				this.close( event );
-				this.selectedItem = item;
+		if ( preventDefault ) {
+			event.preventDefault();
+		}
+	},
+
+	_activate: function( event ) {
+		if ( !this.active.is( ".ui-state-disabled" ) ) {
+			if ( this.active.is( "[aria-haspopup='true']" ) ) {
+				this.expand( event );
+			} else {
+				this.select( event );
 			}
-		});
+		}
+	},
 
-		this.liveRegion = $( "<span>", {
-				role: "status",
-				"aria-live": "polite"
+	refresh: function() {
+		var menus, items,
+			that = this,
+			icon = this.options.icons.submenu,
+			submenus = this.element.find( this.options.menus );
+
+		this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
+
+		// Initialize nested menus
+		submenus.filter( ":not(.ui-menu)" )
+			.addClass( "ui-menu ui-widget ui-widget-content ui-front" )
+			.hide()
+			.attr({
+				role: this.options.role,
+				"aria-hidden": "true",
+				"aria-expanded": "false"
 			})
-			.addClass( "ui-helper-hidden-accessible" )
-			.insertBefore( this.element );
+			.each(function() {
+				var menu = $( this ),
+					item = menu.parent(),
+					submenuCarat = $( "<span>" )
+						.addClass( "ui-menu-icon ui-icon " + icon )
+						.data( "ui-menu-submenu-carat", true );
 
-		// turning off autocomplete prevents the browser from remembering the
-		// value when navigating through history, so we re-enable autocomplete
-		// if the page is unloaded before the widget is destroyed. #7790
-		this._on( this.window, {
-			beforeunload: function() {
-				this.element.removeAttr( "autocomplete" );
+				item
+					.attr( "aria-haspopup", "true" )
+					.prepend( submenuCarat );
+				menu.attr( "aria-labelledby", item.attr( "id" ) );
+			});
+
+		menus = submenus.add( this.element );
+		items = menus.find( this.options.items );
+
+		// Initialize menu-items containing spaces and/or dashes only as dividers
+		items.not( ".ui-menu-item" ).each(function() {
+			var item = $( this );
+			if ( that._isDivider( item ) ) {
+				item.addClass( "ui-widget-content ui-menu-divider" );
 			}
 		});
+
+		// Don't refresh list items that are already adapted
+		items.not( ".ui-menu-item, .ui-menu-divider" )
+			.addClass( "ui-menu-item" )
+			.uniqueId()
+			.attr({
+				tabIndex: -1,
+				role: this._itemRole()
+			});
+
+		// Add aria-disabled attribute to any disabled menu item
+		items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
+
+		// If the active item has been removed, blur the menu
+		if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
+			this.blur();
+		}
 	},
 
-	_destroy: function() {
-		clearTimeout( this.searching );
-		this.element
-			.removeClass( "ui-autocomplete-input" )
-			.removeAttr( "autocomplete" );
-		this.menu.element.remove();
-		this.liveRegion.remove();
+	_itemRole: function() {
+		return {
+			menu: "menuitem",
+			listbox: "option"
+		}[ this.options.role ];
 	},
 
 	_setOption: function( key, value ) {
-		this._super( key, value );
-		if ( key === "source" ) {
-			this._initSource();
-		}
-		if ( key === "appendTo" ) {
-			this.menu.element.appendTo( this._appendTo() );
+		if ( key === "icons" ) {
+			this.element.find( ".ui-menu-icon" )
+				.removeClass( this.options.icons.submenu )
+				.addClass( value.submenu );
 		}
-		if ( key === "disabled" && value && this.xhr ) {
-			this.xhr.abort();
+		if ( key === "disabled" ) {
+			this.element
+				.toggleClass( "ui-state-disabled", !!value )
+				.attr( "aria-disabled", value );
 		}
+		this._super( key, value );
 	},
 
-	_appendTo: function() {
-		var element = this.options.appendTo;
+	focus: function( event, item ) {
+		var nested, focused;
+		this.blur( event, event && event.type === "focus" );
 
-		if ( element ) {
-			element = element.jquery || element.nodeType ?
-				$( element ) :
-				this.document.find( element ).eq( 0 );
+		this._scrollIntoView( item );
+
+		this.active = item.first();
+		focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
+		// Only update aria-activedescendant if there's a role
+		// otherwise we assume focus is managed elsewhere
+		if ( this.options.role ) {
+			this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
 		}
 
-		if ( !element ) {
-			element = this.element.closest( ".ui-front" );
+		// Highlight active parent menu item, if any
+		this.active
+			.parent()
+			.closest( ".ui-menu-item" )
+			.addClass( "ui-state-active" );
+
+		if ( event && event.type === "keydown" ) {
+			this._close();
+		} else {
+			this.timer = this._delay(function() {
+				this._close();
+			}, this.delay );
 		}
 
-		if ( !element.length ) {
-			element = this.document[0].body;
+		nested = item.children( ".ui-menu" );
+		if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
+			this._startOpening(nested);
 		}
+		this.activeMenu = item.parent();
 
-		return element;
+		this._trigger( "focus", event, { item: item } );
 	},
 
-	_initSource: function() {
-		var array, url,
-			that = this;
-		if ( $.isArray(this.options.source) ) {
-			array = this.options.source;
-			this.source = function( request, response ) {
-				response( $.ui.autocomplete.filter( array, request.term ) );
-			};
-		} else if ( typeof this.options.source === "string" ) {
-			url = this.options.source;
-			this.source = function( request, response ) {
-				if ( that.xhr ) {
-					that.xhr.abort();
-				}
-				that.xhr = $.ajax({
-					url: url,
-					data: request,
-					dataType: "json",
-					success: function( data ) {
-						response( data );
-					},
-					error: function() {
-						response( [] );
-					}
-				});
-			};
-		} else {
-			this.source = this.options.source;
-		}
-	},
+	_scrollIntoView: function( item ) {
+		var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
+		if ( this._hasScroll() ) {
+			borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
+			paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
+			offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
+			scroll = this.activeMenu.scrollTop();
+			elementHeight = this.activeMenu.height();
+			itemHeight = item.outerHeight();
 
-	_searchTimeout: function( event ) {
-		clearTimeout( this.searching );
-		this.searching = this._delay(function() {
-			// only search if the value has changed
-			if ( this.term !== this._value() ) {
-				this.selectedItem = null;
-				this.search( null, event );
+			if ( offset < 0 ) {
+				this.activeMenu.scrollTop( scroll + offset );
+			} else if ( offset + itemHeight > elementHeight ) {
+				this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
 			}
-		}, this.options.delay );
+		}
 	},
 
-	search: function( value, event ) {
-		value = value != null ? value : this._value();
-
-		// always save the actual value, not the one passed as an argument
-		this.term = this._value();
+	blur: function( event, fromFocus ) {
+		if ( !fromFocus ) {
+			clearTimeout( this.timer );
+		}
 
-		if ( value.length < this.options.minLength ) {
-			return this.close( event );
+		if ( !this.active ) {
+			return;
 		}
 
-		if ( this._trigger( "search", event ) === false ) {
+		this.active.removeClass( "ui-state-focus" );
+		this.active = null;
+
+		this._trigger( "blur", event, { item: this.active } );
+	},
+
+	_startOpening: function( submenu ) {
+		clearTimeout( this.timer );
+
+		// Don't open if already open fixes a Firefox bug that caused a .5 pixel
+		// shift in the submenu position when mousing over the carat icon
+		if ( submenu.attr( "aria-hidden" ) !== "true" ) {
 			return;
 		}
 
-		return this._search( value );
+		this.timer = this._delay(function() {
+			this._close();
+			this._open( submenu );
+		}, this.delay );
 	},
 
-	_search: function( value ) {
-		this.pending++;
-		this.element.addClass( "ui-autocomplete-loading" );
-		this.cancelSearch = false;
+	_open: function( submenu ) {
+		var position = $.extend({
+			of: this.active
+		}, this.options.position );
 
-		this.source( { term: value }, this._response() );
+		clearTimeout( this.timer );
+		this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
+			.hide()
+			.attr( "aria-hidden", "true" );
+
+		submenu
+			.show()
+			.removeAttr( "aria-hidden" )
+			.attr( "aria-expanded", "true" )
+			.position( position );
 	},
 
-	_response: function() {
-		var index = ++this.requestIndex;
+	collapseAll: function( event, all ) {
+		clearTimeout( this.timer );
+		this.timer = this._delay(function() {
+			// If we were passed an event, look for the submenu that contains the event
+			var currentMenu = all ? this.element :
+				$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
 
-		return $.proxy(function( content ) {
-			if ( index === this.requestIndex ) {
-				this.__response( content );
+			// If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
+			if ( !currentMenu.length ) {
+				currentMenu = this.element;
 			}
 
-			this.pending--;
-			if ( !this.pending ) {
-				this.element.removeClass( "ui-autocomplete-loading" );
-			}
-		}, this );
+			this._close( currentMenu );
+
+			this.blur( event );
+			this.activeMenu = currentMenu;
+		}, this.delay );
 	},
 
-	__response: function( content ) {
-		if ( content ) {
-			content = this._normalize( content );
-		}
-		this._trigger( "response", null, { content: content } );
-		if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
-			this._suggest( content );
-			this._trigger( "open" );
-		} else {
-			// use ._close() instead of .close() so we don't cancel future searches
-			this._close();
+	// With no arguments, closes the currently active menu - if nothing is active
+	// it closes all menus.  If passed an argument, it will search for menus BELOW
+	_close: function( startMenu ) {
+		if ( !startMenu ) {
+			startMenu = this.active ? this.active.parent() : this.element;
 		}
-	},
 
-	close: function( event ) {
-		this.cancelSearch = true;
-		this._close( event );
+		startMenu
+			.find( ".ui-menu" )
+				.hide()
+				.attr( "aria-hidden", "true" )
+				.attr( "aria-expanded", "false" )
+			.end()
+			.find( ".ui-state-active" ).not( ".ui-state-focus" )
+				.removeClass( "ui-state-active" );
 	},
 
-	_close: function( event ) {
-		if ( this.menu.element.is( ":visible" ) ) {
-			this.menu.element.hide();
-			this.menu.blur();
-			this.isNewMenu = true;
-			this._trigger( "close", event );
-		}
+	_closeOnDocumentClick: function( event ) {
+		return !$( event.target ).closest( ".ui-menu" ).length;
 	},
 
-	_change: function( event ) {
-		if ( this.previous !== this._value() ) {
-			this._trigger( "change", event, { item: this.selectedItem } );
-		}
+	_isDivider: function( item ) {
+
+		// Match hyphen, em dash, en dash
+		return !/[^\-\u2014\u2013\s]/.test( item.text() );
 	},
 
-	_normalize: function( items ) {
-		// assume all items have the right format when the first item is complete
-		if ( items.length && items[0].label && items[0].value ) {
-			return items;
+	collapse: function( event ) {
+		var newItem = this.active &&
+			this.active.parent().closest( ".ui-menu-item", this.element );
+		if ( newItem && newItem.length ) {
+			this._close();
+			this.focus( event, newItem );
 		}
-		return $.map( items, function( item ) {
-			if ( typeof item === "string" ) {
-				return {
-					label: item,
-					value: item
-				};
-			}
-			return $.extend({
-				label: item.label || item.value,
-				value: item.value || item.label
-			}, item );
-		});
 	},
 
-	_suggest: function( items ) {
-		var ul = this.menu.element.empty();
-		this._renderMenu( ul, items );
-		this.isNewMenu = true;
-		this.menu.refresh();
+	expand: function( event ) {
+		var newItem = this.active &&
+			this.active
+				.children( ".ui-menu " )
+				.find( this.options.items )
+				.first();
 
-		// size and position menu
-		ul.show();
-		this._resizeMenu();
-		ul.position( $.extend({
-			of: this.element
-		}, this.options.position ));
+		if ( newItem && newItem.length ) {
+			this._open( newItem.parent() );
 
-		if ( this.options.autoFocus ) {
-			this.menu.next();
+			// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
+			this._delay(function() {
+				this.focus( event, newItem );
+			});
 		}
 	},
 
-	_resizeMenu: function() {
-		var ul = this.menu.element;
-		ul.outerWidth( Math.max(
-			// Firefox wraps long text (possibly a rounding bug)
-			// so we add 1px to avoid the wrapping (#7513)
-			ul.width( "" ).outerWidth() + 1,
-			this.element.outerWidth()
-		) );
+	next: function( event ) {
+		this._move( "next", "first", event );
 	},
 
-	_renderMenu: function( ul, items ) {
-		var that = this;
-		$.each( items, function( index, item ) {
-			that._renderItemData( ul, item );
-		});
+	previous: function( event ) {
+		this._move( "prev", "last", event );
 	},
 
-	_renderItemData: function( ul, item ) {
-		return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
+	isFirstItem: function() {
+		return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
 	},
 
-	_renderItem: function( ul, item ) {
-		return $( "<li>" )
-			.append( $( "<a>" ).text( item.label ) )
-			.appendTo( ul );
+	isLastItem: function() {
+		return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
 	},
 
-	_move: function( direction, event ) {
-		if ( !this.menu.element.is( ":visible" ) ) {
-			this.search( null, event );
-			return;
+	_move: function( direction, filter, event ) {
+		var next;
+		if ( this.active ) {
+			if ( direction === "first" || direction === "last" ) {
+				next = this.active
+					[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
+					.eq( -1 );
+			} else {
+				next = this.active
+					[ direction + "All" ]( ".ui-menu-item" )
+					.eq( 0 );
+			}
 		}
-		if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
-				this.menu.isLastItem() && /^next/.test( direction ) ) {
-			this._value( this.term );
-			this.menu.blur();
-			return;
+		if ( !next || !next.length || !this.active ) {
+			next = this.activeMenu.find( this.options.items )[ filter ]();
 		}
-		this.menu[ direction ]( event );
-	},
 
-	widget: function() {
-		return this.menu.element;
+		this.focus( event, next );
 	},
 
-	_value: function() {
-		return this.valueMethod.apply( this.element, arguments );
-	},
+	nextPage: function( event ) {
+		var item, base, height;
 
-	_keyEvent: function( keyEvent, event ) {
-		if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
-			this._move( keyEvent, event );
-
-			// prevents moving cursor to beginning/end of the text field in some browsers
-			event.preventDefault();
+		if ( !this.active ) {
+			this.next( event );
+			return;
 		}
-	}
-});
-
-$.extend( $.ui.autocomplete, {
-	escapeRegex: function( value ) {
-		return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
-	},
-	filter: function(array, term) {
-		var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
-		return $.grep( array, function(value) {
-			return matcher.test( value.label || value.value || value );
-		});
-	}
-});
-
+		if ( this.isLastItem() ) {
+			return;
+		}
+		if ( this._hasScroll() ) {
+			base = this.active.offset().top;
+			height = this.element.height();
+			this.active.nextAll( ".ui-menu-item" ).each(function() {
+				item = $( this );
+				return item.offset().top - base - height < 0;
+			});
 
-// live region extension, adding a `messages` option
-// NOTE: This is an experimental API. We are still investigating
-// a full solution for string manipulation and internationalization.
-$.widget( "ui.autocomplete", $.ui.autocomplete, {
-	options: {
-		messages: {
-			noResults: "No search results.",
-			results: function( amount ) {
-				return amount + ( amount > 1 ? " results are" : " result is" ) +
-					" available, use up and down arrow keys to navigate.";
-			}
+			this.focus( event, item );
+		} else {
+			this.focus( event, this.activeMenu.find( this.options.items )
+				[ !this.active ? "first" : "last" ]() );
 		}
 	},
 
-	__response: function( content ) {
-		var message;
-		this._superApply( arguments );
-		if ( this.options.disabled || this.cancelSearch ) {
+	previousPage: function( event ) {
+		var item, base, height;
+		if ( !this.active ) {
+			this.next( event );
 			return;
 		}
-		if ( content && content.length ) {
-			message = this.options.messages.results( content.length );
+		if ( this.isFirstItem() ) {
+			return;
+		}
+		if ( this._hasScroll() ) {
+			base = this.active.offset().top;
+			height = this.element.height();
+			this.active.prevAll( ".ui-menu-item" ).each(function() {
+				item = $( this );
+				return item.offset().top - base + height > 0;
+			});
+
+			this.focus( event, item );
 		} else {
-			message = this.options.messages.noResults;
+			this.focus( event, this.activeMenu.find( this.options.items ).first() );
+		}
+	},
+
+	_hasScroll: function() {
+		return this.element.outerHeight() < this.element.prop( "scrollHeight" );
+	},
+
+	select: function( event ) {
+		// TODO: It should never be possible to not have an active item at this
+		// point, but the tests don't trigger mouseenter before click.
+		this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
+		var ui = { item: this.active };
+		if ( !this.active.has( ".ui-menu" ).length ) {
+			this.collapseAll( event, true );
 		}
-		this.liveRegion.text( message );
+		this._trigger( "select", event, ui );
 	}
 });
 
-}( jQuery ));
-(function( $, undefined ) {
 
-var lastActive,
-	baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
-	typeClasses = "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",
-	formResetHandler = function() {
-		var form = $( this );
-		setTimeout(function() {
-			form.find( ":ui-button" ).button( "refresh" );
-		}, 1 );
-	},
-	radioGroup = function( radio ) {
-		var name = radio.name,
-			form = radio.form,
-			radios = $( [] );
-		if ( name ) {
-			name = name.replace( /'/g, "\\'" );
-			if ( form ) {
-				radios = $( form ).find( "[name='" + name + "']" );
-			} else {
-				radios = $( "[name='" + name + "']", radio.ownerDocument )
-					.filter(function() {
-						return !this.form;
-					});
-			}
-		}
-		return radios;
-	};
+/*!
+ * jQuery UI Autocomplete 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/autocomplete/
+ */
 
-$.widget( "ui.button", {
-	version: "1.10.4",
-	defaultElement: "<button>",
+
+$.widget( "ui.autocomplete", {
+	version: "1.11.0",
+	defaultElement: "<input>",
 	options: {
-		disabled: null,
-		text: true,
-		label: null,
-		icons: {
-			primary: null,
-			secondary: null
-		}
+		appendTo: null,
+		autoFocus: false,
+		delay: 300,
+		minLength: 1,
+		position: {
+			my: "left top",
+			at: "left bottom",
+			collision: "none"
+		},
+		source: null,
+
+		// callbacks
+		change: null,
+		close: null,
+		focus: null,
+		open: null,
+		response: null,
+		search: null,
+		select: null
 	},
-	_create: function() {
-		this.element.closest( "form" )
-			.unbind( "reset" + this.eventNamespace )
-			.bind( "reset" + this.eventNamespace, formResetHandler );
 
-		if ( typeof this.options.disabled !== "boolean" ) {
-			this.options.disabled = !!this.element.prop( "disabled" );
-		} else {
-			this.element.prop( "disabled", this.options.disabled );
-		}
+	requestIndex: 0,
+	pending: 0,
 
-		this._determineButtonType();
-		this.hasTitle = !!this.buttonElement.attr( "title" );
+	_create: function() {
+		// Some browsers only repeat keydown events, not keypress events,
+		// so we use the suppressKeyPress flag to determine if we've already
+		// handled the keydown event. #7269
+		// Unfortunately the code for & in keypress is the same as the up arrow,
+		// so we use the suppressKeyPressRepeat flag to avoid handling keypress
+		// events when we know the keydown event was used to modify the
+		// search term. #7799
+		var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
+			nodeName = this.element[ 0 ].nodeName.toLowerCase(),
+			isTextarea = nodeName === "textarea",
+			isInput = nodeName === "input";
 
-		var that = this,
-			options = this.options,
-			toggleButton = this.type === "checkbox" || this.type === "radio",
-			activeClass = !toggleButton ? "ui-state-active" : "";
+		this.isMultiLine =
+			// Textareas are always multi-line
+			isTextarea ? true :
+			// Inputs are always single-line, even if inside a contentEditable element
+			// IE also treats inputs as contentEditable
+			isInput ? false :
+			// All other element types are determined by whether or not they're contentEditable
+			this.element.prop( "isContentEditable" );
 
-		if ( options.label === null ) {
-			options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
-		}
+		this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
+		this.isNewMenu = true;
 
-		this._hoverable( this.buttonElement );
+		this.element
+			.addClass( "ui-autocomplete-input" )
+			.attr( "autocomplete", "off" );
 
-		this.buttonElement
-			.addClass( baseClasses )
-			.attr( "role", "button" )
-			.bind( "mouseenter" + this.eventNamespace, function() {
-				if ( options.disabled ) {
-					return;
-				}
-				if ( this === lastActive ) {
-					$( this ).addClass( "ui-state-active" );
-				}
-			})
-			.bind( "mouseleave" + this.eventNamespace, function() {
-				if ( options.disabled ) {
+		this._on( this.element, {
+			keydown: function( event ) {
+				if ( this.element.prop( "readOnly" ) ) {
+					suppressKeyPress = true;
+					suppressInput = true;
+					suppressKeyPressRepeat = true;
 					return;
 				}
-				$( this ).removeClass( activeClass );
-			})
-			.bind( "click" + this.eventNamespace, function( event ) {
-				if ( options.disabled ) {
-					event.preventDefault();
-					event.stopImmediatePropagation();
-				}
-			});
-
-		// Can't use _focusable() because the element that receives focus
-		// and the element that gets the ui-state-focus class are different
-		this._on({
-			focus: function() {
-				this.buttonElement.addClass( "ui-state-focus" );
-			},
-			blur: function() {
-				this.buttonElement.removeClass( "ui-state-focus" );
-			}
-		});
-
-		if ( toggleButton ) {
-			this.element.bind( "change" + this.eventNamespace, function() {
-				that.refresh();
-			});
-		}
-
-		if ( this.type === "checkbox" ) {
-			this.buttonElement.bind( "click" + this.eventNamespace, function() {
-				if ( options.disabled ) {
-					return false;
-				}
-			});
-		} else if ( this.type === "radio" ) {
-			this.buttonElement.bind( "click" + this.eventNamespace, function() {
-				if ( options.disabled ) {
-					return false;
-				}
-				$( this ).addClass( "ui-state-active" );
-				that.buttonElement.attr( "aria-pressed", "true" );
 
-				var radio = that.element[ 0 ];
-				radioGroup( radio )
-					.not( radio )
-					.map(function() {
-						return $( this ).button( "widget" )[ 0 ];
-					})
-					.removeClass( "ui-state-active" )
-					.attr( "aria-pressed", "false" );
-			});
-		} else {
-			this.buttonElement
-				.bind( "mousedown" + this.eventNamespace, function() {
-					if ( options.disabled ) {
-						return false;
+				suppressKeyPress = false;
+				suppressInput = false;
+				suppressKeyPressRepeat = false;
+				var keyCode = $.ui.keyCode;
+				switch ( event.keyCode ) {
+				case keyCode.PAGE_UP:
+					suppressKeyPress = true;
+					this._move( "previousPage", event );
+					break;
+				case keyCode.PAGE_DOWN:
+					suppressKeyPress = true;
+					this._move( "nextPage", event );
+					break;
+				case keyCode.UP:
+					suppressKeyPress = true;
+					this._keyEvent( "previous", event );
+					break;
+				case keyCode.DOWN:
+					suppressKeyPress = true;
+					this._keyEvent( "next", event );
+					break;
+				case keyCode.ENTER:
+					// when menu is open and has focus
+					if ( this.menu.active ) {
+						// #6055 - Opera still allows the keypress to occur
+						// which causes forms to submit
+						suppressKeyPress = true;
+						event.preventDefault();
+						this.menu.select( event );
 					}
-					$( this ).addClass( "ui-state-active" );
-					lastActive = this;
-					that.document.one( "mouseup", function() {
-						lastActive = null;
-					});
-				})
-				.bind( "mouseup" + this.eventNamespace, function() {
-					if ( options.disabled ) {
-						return false;
+					break;
+				case keyCode.TAB:
+					if ( this.menu.active ) {
+						this.menu.select( event );
 					}
-					$( this ).removeClass( "ui-state-active" );
-				})
-				.bind( "keydown" + this.eventNamespace, function(event) {
-					if ( options.disabled ) {
-						return false;
+					break;
+				case keyCode.ESCAPE:
+					if ( this.menu.element.is( ":visible" ) ) {
+						this._value( this.term );
+						this.close( event );
+						// Different browsers have different default behavior for escape
+						// Single press can mean undo or clear
+						// Double press in IE means clear the whole form
+						event.preventDefault();
 					}
-					if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
-						$( this ).addClass( "ui-state-active" );
+					break;
+				default:
+					suppressKeyPressRepeat = true;
+					// search timeout should be triggered before the input value is changed
+					this._searchTimeout( event );
+					break;
+				}
+			},
+			keypress: function( event ) {
+				if ( suppressKeyPress ) {
+					suppressKeyPress = false;
+					if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+						event.preventDefault();
 					}
-				})
-				// see #8559, we bind to blur here in case the button element loses
-				// focus between keydown and keyup, it would be left in an "active" state
-				.bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
-					$( this ).removeClass( "ui-state-active" );
-				});
+					return;
+				}
+				if ( suppressKeyPressRepeat ) {
+					return;
+				}
 
-			if ( this.buttonElement.is("a") ) {
-				this.buttonElement.keyup(function(event) {
-					if ( event.keyCode === $.ui.keyCode.SPACE ) {
-						// TODO pass through original event correctly (just as 2nd argument doesn't work)
-						$( this ).click();
-					}
-				});
+				// replicate some key handlers to allow them to repeat in Firefox and Opera
+				var keyCode = $.ui.keyCode;
+				switch ( event.keyCode ) {
+				case keyCode.PAGE_UP:
+					this._move( "previousPage", event );
+					break;
+				case keyCode.PAGE_DOWN:
+					this._move( "nextPage", event );
+					break;
+				case keyCode.UP:
+					this._keyEvent( "previous", event );
+					break;
+				case keyCode.DOWN:
+					this._keyEvent( "next", event );
+					break;
+				}
+			},
+			input: function( event ) {
+				if ( suppressInput ) {
+					suppressInput = false;
+					event.preventDefault();
+					return;
+				}
+				this._searchTimeout( event );
+			},
+			focus: function() {
+				this.selectedItem = null;
+				this.previous = this._value();
+			},
+			blur: function( event ) {
+				if ( this.cancelBlur ) {
+					delete this.cancelBlur;
+					return;
+				}
+
+				clearTimeout( this.searching );
+				this.close( event );
+				this._change( event );
 			}
-		}
+		});
 
-		// TODO: pull out $.Widget's handling for the disabled option into
-		// $.Widget.prototype._setOptionDisabled so it's easy to proxy and can
-		// be overridden by individual plugins
-		this._setOption( "disabled", options.disabled );
-		this._resetButton();
-	},
+		this._initSource();
+		this.menu = $( "<ul>" )
+			.addClass( "ui-autocomplete ui-front" )
+			.appendTo( this._appendTo() )
+			.menu({
+				// disable ARIA support, the live region takes care of that
+				role: null
+			})
+			.hide()
+			.menu( "instance" );
 
-	_determineButtonType: function() {
-		var ancestor, labelSelector, checked;
+		this._on( this.menu.element, {
+			mousedown: function( event ) {
+				// prevent moving focus out of the text field
+				event.preventDefault();
 
-		if ( this.element.is("[type=checkbox]") ) {
-			this.type = "checkbox";
-		} else if ( this.element.is("[type=radio]") ) {
-			this.type = "radio";
-		} else if ( this.element.is("input") ) {
-			this.type = "input";
-		} else {
-			this.type = "button";
-		}
+				// IE doesn't prevent moving focus even with event.preventDefault()
+				// so we set a flag to know when we should ignore the blur event
+				this.cancelBlur = true;
+				this._delay(function() {
+					delete this.cancelBlur;
+				});
 
-		if ( this.type === "checkbox" || this.type === "radio" ) {
-			// we don't search against the document in case the element
-			// is disconnected from the DOM
-			ancestor = this.element.parents().last();
-			labelSelector = "label[for='" + this.element.attr("id") + "']";
-			this.buttonElement = ancestor.find( labelSelector );
-			if ( !this.buttonElement.length ) {
-				ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
-				this.buttonElement = ancestor.filter( labelSelector );
-				if ( !this.buttonElement.length ) {
-					this.buttonElement = ancestor.find( labelSelector );
+				// clicking on the scrollbar causes focus to shift to the body
+				// but we can't detect a mouseup or a click immediately afterward
+				// so we have to track the next mousedown and close the menu if
+				// the user clicks somewhere outside of the autocomplete
+				var menuElement = this.menu.element[ 0 ];
+				if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
+					this._delay(function() {
+						var that = this;
+						this.document.one( "mousedown", function( event ) {
+							if ( event.target !== that.element[ 0 ] &&
+									event.target !== menuElement &&
+									!$.contains( menuElement, event.target ) ) {
+								that.close();
+							}
+						});
+					});
 				}
-			}
-			this.element.addClass( "ui-helper-hidden-accessible" );
-
-			checked = this.element.is( ":checked" );
-			if ( checked ) {
-				this.buttonElement.addClass( "ui-state-active" );
-			}
-			this.buttonElement.prop( "aria-pressed", checked );
-		} else {
-			this.buttonElement = this.element;
-		}
-	},
+			},
+			menufocus: function( event, ui ) {
+				var label, item;
+				// support: Firefox
+				// Prevent accidental activation of menu items in Firefox (#7024 #9118)
+				if ( this.isNewMenu ) {
+					this.isNewMenu = false;
+					if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
+						this.menu.blur();
 
-	widget: function() {
-		return this.buttonElement;
-	},
+						this.document.one( "mousemove", function() {
+							$( event.target ).trigger( event.originalEvent );
+						});
 
-	_destroy: function() {
-		this.element
-			.removeClass( "ui-helper-hidden-accessible" );
-		this.buttonElement
-			.removeClass( baseClasses + " ui-state-active " + typeClasses )
-			.removeAttr( "role" )
-			.removeAttr( "aria-pressed" )
-			.html( this.buttonElement.find(".ui-button-text").html() );
+						return;
+					}
+				}
 
-		if ( !this.hasTitle ) {
-			this.buttonElement.removeAttr( "title" );
-		}
-	},
+				item = ui.item.data( "ui-autocomplete-item" );
+				if ( false !== this._trigger( "focus", event, { item: item } ) ) {
+					// use value to match what will end up in the input, if it was a key event
+					if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
+						this._value( item.value );
+					}
+				}
 
-	_setOption: function( key, value ) {
-		this._super( key, value );
-		if ( key === "disabled" ) {
-			this.element.prop( "disabled", !!value );
-			if ( value ) {
-				this.buttonElement.removeClass( "ui-state-focus" );
-			}
-			return;
-		}
-		this._resetButton();
-	},
+				// Announce the value in the liveRegion
+				label = ui.item.attr( "aria-label" ) || item.value;
+				if ( label && jQuery.trim( label ).length ) {
+					this.liveRegion.children().hide();
+					$( "<div>" ).text( label ).appendTo( this.liveRegion );
+				}
+			},
+			menuselect: function( event, ui ) {
+				var item = ui.item.data( "ui-autocomplete-item" ),
+					previous = this.previous;
 
-	refresh: function() {
-		//See #8237 & #8828
-		var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
+				// only trigger when focus was lost (click on menu)
+				if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
+					this.element.focus();
+					this.previous = previous;
+					// #6109 - IE triggers two focus events and the second
+					// is asynchronous, so we need to reset the previous
+					// term synchronously and asynchronously :-(
+					this._delay(function() {
+						this.previous = previous;
+						this.selectedItem = item;
+					});
+				}
 
-		if ( isDisabled !== this.options.disabled ) {
-			this._setOption( "disabled", isDisabled );
-		}
-		if ( this.type === "radio" ) {
-			radioGroup( this.element[0] ).each(function() {
-				if ( $( this ).is( ":checked" ) ) {
-					$( this ).button( "widget" )
-						.addClass( "ui-state-active" )
-						.attr( "aria-pressed", "true" );
-				} else {
-					$( this ).button( "widget" )
-						.removeClass( "ui-state-active" )
-						.attr( "aria-pressed", "false" );
+				if ( false !== this._trigger( "select", event, { item: item } ) ) {
+					this._value( item.value );
 				}
-			});
-		} else if ( this.type === "checkbox" ) {
-			if ( this.element.is( ":checked" ) ) {
-				this.buttonElement
-					.addClass( "ui-state-active" )
-					.attr( "aria-pressed", "true" );
-			} else {
-				this.buttonElement
-					.removeClass( "ui-state-active" )
-					.attr( "aria-pressed", "false" );
+				// reset the term after the select event
+				// this allows custom select handling to work properly
+				this.term = this._value();
+
+				this.close( event );
+				this.selectedItem = item;
 			}
-		}
-	},
+		});
 
-	_resetButton: function() {
-		if ( this.type === "input" ) {
-			if ( this.options.label ) {
-				this.element.val( this.options.label );
+		this.liveRegion = $( "<span>", {
+				role: "status",
+				"aria-live": "assertive",
+				"aria-relevant": "additions"
+			})
+			.addClass( "ui-helper-hidden-accessible" )
+			.appendTo( this.document[ 0 ].body );
+
+		// turning off autocomplete prevents the browser from remembering the
+		// value when navigating through history, so we re-enable autocomplete
+		// if the page is unloaded before the widget is destroyed. #7790
+		this._on( this.window, {
+			beforeunload: function() {
+				this.element.removeAttr( "autocomplete" );
 			}
-			return;
+		});
+	},
+
+	_destroy: function() {
+		clearTimeout( this.searching );
+		this.element
+			.removeClass( "ui-autocomplete-input" )
+			.removeAttr( "autocomplete" );
+		this.menu.element.remove();
+		this.liveRegion.remove();
+	},
+
+	_setOption: function( key, value ) {
+		this._super( key, value );
+		if ( key === "source" ) {
+			this._initSource();
 		}
-		var buttonElement = this.buttonElement.removeClass( typeClasses ),
-			buttonText = $( "<span></span>", this.document[0] )
-				.addClass( "ui-button-text" )
-				.html( this.options.label )
-				.appendTo( buttonElement.empty() )
-				.text(),
-			icons = this.options.icons,
-			multipleIcons = icons.primary && icons.secondary,
-			buttonClasses = [];
+		if ( key === "appendTo" ) {
+			this.menu.element.appendTo( this._appendTo() );
+		}
+		if ( key === "disabled" && value && this.xhr ) {
+			this.xhr.abort();
+		}
+	},
 
-		if ( icons.primary || icons.secondary ) {
-			if ( this.options.text ) {
-				buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
-			}
+	_appendTo: function() {
+		var element = this.options.appendTo;
 
-			if ( icons.primary ) {
-				buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
-			}
+		if ( element ) {
+			element = element.jquery || element.nodeType ?
+				$( element ) :
+				this.document.find( element ).eq( 0 );
+		}
 
-			if ( icons.secondary ) {
-				buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
-			}
+		if ( !element || !element[ 0 ] ) {
+			element = this.element.closest( ".ui-front" );
+		}
 
-			if ( !this.options.text ) {
-				buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
+		if ( !element.length ) {
+			element = this.document[ 0 ].body;
+		}
 
-				if ( !this.hasTitle ) {
-					buttonElement.attr( "title", $.trim( buttonText ) );
+		return element;
+	},
+
+	_initSource: function() {
+		var array, url,
+			that = this;
+		if ( $.isArray( this.options.source ) ) {
+			array = this.options.source;
+			this.source = function( request, response ) {
+				response( $.ui.autocomplete.filter( array, request.term ) );
+			};
+		} else if ( typeof this.options.source === "string" ) {
+			url = this.options.source;
+			this.source = function( request, response ) {
+				if ( that.xhr ) {
+					that.xhr.abort();
 				}
-			}
+				that.xhr = $.ajax({
+					url: url,
+					data: request,
+					dataType: "json",
+					success: function( data ) {
+						response( data );
+					},
+					error: function() {
+						response([]);
+					}
+				});
+			};
 		} else {
-			buttonClasses.push( "ui-button-text-only" );
+			this.source = this.options.source;
 		}
-		buttonElement.addClass( buttonClasses.join( " " ) );
-	}
-});
-
-$.widget( "ui.buttonset", {
-	version: "1.10.4",
-	options: {
-		items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
 	},
 
-	_create: function() {
-		this.element.addClass( "ui-buttonset" );
-	},
+	_searchTimeout: function( event ) {
+		clearTimeout( this.searching );
+		this.searching = this._delay(function() {
 
-	_init: function() {
-		this.refresh();
+			// Search if the value has changed, or if the user retypes the same value (see #7434)
+			var equalValues = this.term === this._value(),
+				menuVisible = this.menu.element.is( ":visible" ),
+				modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
+
+			if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
+				this.selectedItem = null;
+				this.search( null, event );
+			}
+		}, this.options.delay );
 	},
 
-	_setOption: function( key, value ) {
-		if ( key === "disabled" ) {
-			this.buttons.button( "option", key, value );
+	search: function( value, event ) {
+		value = value != null ? value : this._value();
+
+		// always save the actual value, not the one passed as an argument
+		this.term = this._value();
+
+		if ( value.length < this.options.minLength ) {
+			return this.close( event );
 		}
 
-		this._super( key, value );
+		if ( this._trigger( "search", event ) === false ) {
+			return;
+		}
+
+		return this._search( value );
 	},
 
-	refresh: function() {
-		var rtl = this.element.css( "direction" ) === "rtl";
+	_search: function( value ) {
+		this.pending++;
+		this.element.addClass( "ui-autocomplete-loading" );
+		this.cancelSearch = false;
 
-		this.buttons = this.element.find( this.options.items )
-			.filter( ":ui-button" )
-				.button( "refresh" )
-			.end()
-			.not( ":ui-button" )
-				.button()
-			.end()
-			.map(function() {
-				return $( this ).button( "widget" )[ 0 ];
-			})
-				.removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
-				.filter( ":first" )
-					.addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
-				.end()
-				.filter( ":last" )
-					.addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
-				.end()
-			.end();
+		this.source( { term: value }, this._response() );
 	},
 
-	_destroy: function() {
-		this.element.removeClass( "ui-buttonset" );
-		this.buttons
-			.map(function() {
-				return $( this ).button( "widget" )[ 0 ];
-			})
-				.removeClass( "ui-corner-left ui-corner-right" )
-			.end()
-			.button( "destroy" );
-	}
-});
+	_response: function() {
+		var index = ++this.requestIndex;
 
-}( jQuery ) );
-(function( $, undefined ) {
+		return $.proxy(function( content ) {
+			if ( index === this.requestIndex ) {
+				this.__response( content );
+			}
 
-$.extend($.ui, { datepicker: { version: "1.10.4" } });
+			this.pending--;
+			if ( !this.pending ) {
+				this.element.removeClass( "ui-autocomplete-loading" );
+			}
+		}, this );
+	},
 
-var PROP_NAME = "datepicker",
-	instActive;
+	__response: function( content ) {
+		if ( content ) {
+			content = this._normalize( content );
+		}
+		this._trigger( "response", null, { content: content } );
+		if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
+			this._suggest( content );
+			this._trigger( "open" );
+		} else {
+			// use ._close() instead of .close() so we don't cancel future searches
+			this._close();
+		}
+	},
 
-/* Date picker manager.
-   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
-   Settings for (groups of) date pickers are maintained in an instance object,
-   allowing multiple different settings on the same page. */
+	close: function( event ) {
+		this.cancelSearch = true;
+		this._close( event );
+	},
 
-function Datepicker() {
-	this._curInst = null; // The current instance in use
-	this._keyEvent = false; // If the last event was a key event
-	this._disabledInputs = []; // List of date picker inputs that have been disabled
-	this._datepickerShowing = false; // True if the popup picker is showing , false if not
-	this._inDialog = false; // True if showing within a "dialog", false if not
-	this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
-	this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
-	this._appendClass = "ui-datepicker-append"; // The name of the append marker class
-	this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
-	this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
-	this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
-	this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
-	this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
-	this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
-	this.regional = []; // Available regional settings, indexed by language code
-	this.regional[""] = { // Default regional settings
-		closeText: "Done", // Display text for close link
-		prevText: "Prev", // Display text for previous month link
-		nextText: "Next", // Display text for next month link
-		currentText: "Today", // Display text for current month link
-		monthNames: ["January","February","March","April","May","June",
-			"July","August","September","October","November","December"], // Names of months for drop-down and formatting
-		monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
-		dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
-		dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
-		dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
-		weekHeader: "Wk", // Column header for week of the year
-		dateFormat: "mm/dd/yy", // See format options on parseDate
-		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
-		isRTL: false, // True if right-to-left language, false if left-to-right
-		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
-		yearSuffix: "" // Additional text to append to the year in the month headers
-	};
-	this._defaults = { // Global defaults for all the date picker instances
-		showOn: "focus", // "focus" for popup on focus,
-			// "button" for trigger button, or "both" for either
-		showAnim: "fadeIn", // Name of jQuery animation for popup
-		showOptions: {}, // Options for enhanced animations
-		defaultDate: null, // Used when field is blank: actual date,
-			// +/-number for offset from today, null for today
-		appendText: "", // Display text following the input box, e.g. showing the format
-		buttonText: "...", // Text for trigger button
-		buttonImage: "", // URL for trigger button image
-		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
-		hideIfNoPrevNext: false, // True to hide next/previous month links
-			// if not applicable, false to just disable them
-		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
-		gotoCurrent: false, // True if today link goes back to current selection instead
-		changeMonth: false, // True if month can be selected directly, false if only prev/next
-		changeYear: false, // True if year can be selected directly, false if only prev/next
-		yearRange: "c-10:c+10", // Range of years to display in drop-down,
-			// either relative to today's year (-nn:+nn), relative to currently displayed year
-			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
-		showOtherMonths: false, // True to show dates in other months, false to leave blank
-		selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
-		showWeek: false, // True to show week of the year, false to not show it
-		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
-			// takes a Date and returns the number of the week for it
-		shortYearCutoff: "+10", // Short year values < this are in the current century,
-			// > this are in the previous century,
-			// string value starting with "+" for current year + value
-		minDate: null, // The earliest selectable date, or null for no limit
-		maxDate: null, // The latest selectable date, or null for no limit
-		duration: "fast", // Duration of display/closure
-		beforeShowDay: null, // Function that takes a date and returns an array with
-			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
-			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
-		beforeShow: null, // Function that takes an input field and
-			// returns a set of custom settings for the date picker
-		onSelect: null, // Define a callback function when a date is selected
-		onChangeMonthYear: null, // Define a callback function when the month or year is changed
-		onClose: null, // Define a callback function when the datepicker is closed
-		numberOfMonths: 1, // Number of months to show at a time
-		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
-		stepMonths: 1, // Number of months to step back/forward
-		stepBigMonths: 12, // Number of months to step back/forward for the big links
-		altField: "", // Selector for an alternate field to store selected dates into
-		altFormat: "", // The date format to use for the alternate field
-		constrainInput: true, // The input is constrained by the current date format
-		showButtonPanel: false, // True to show button panel, false to not show it
-		autoSize: false, // True to size the input for the date format, false to leave as is
-		disabled: false // The initial disabled state
-	};
-	$.extend(this._defaults, this.regional[""]);
-	this.dpDiv = bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
-}
+	_close: function( event ) {
+		if ( this.menu.element.is( ":visible" ) ) {
+			this.menu.element.hide();
+			this.menu.blur();
+			this.isNewMenu = true;
+			this._trigger( "close", event );
+		}
+	},
 
-$.extend(Datepicker.prototype, {
-	/* Class name added to elements to indicate already configured with a date picker. */
-	markerClassName: "hasDatepicker",
+	_change: function( event ) {
+		if ( this.previous !== this._value() ) {
+			this._trigger( "change", event, { item: this.selectedItem } );
+		}
+	},
 
-	//Keep track of the maximum number of rows displayed (see #7043)
-	maxRows: 4,
+	_normalize: function( items ) {
+		// assume all items have the right format when the first item is complete
+		if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
+			return items;
+		}
+		return $.map( items, function( item ) {
+			if ( typeof item === "string" ) {
+				return {
+					label: item,
+					value: item
+				};
+			}
+			return $.extend( {}, item, {
+				label: item.label || item.value,
+				value: item.value || item.label
+			});
+		});
+	},
 
-	// TODO rename to "widget" when switching to widget factory
-	_widgetDatepicker: function() {
-		return this.dpDiv;
+	_suggest: function( items ) {
+		var ul = this.menu.element.empty();
+		this._renderMenu( ul, items );
+		this.isNewMenu = true;
+		this.menu.refresh();
+
+		// size and position menu
+		ul.show();
+		this._resizeMenu();
+		ul.position( $.extend({
+			of: this.element
+		}, this.options.position ) );
+
+		if ( this.options.autoFocus ) {
+			this.menu.next();
+		}
 	},
 
-	/* Override the default settings for all instances of the date picker.
-	 * @param  settings  object - the new settings to use as defaults (anonymous object)
-	 * @return the manager object
-	 */
-	setDefaults: function(settings) {
-		extendRemove(this._defaults, settings || {});
-		return this;
+	_resizeMenu: function() {
+		var ul = this.menu.element;
+		ul.outerWidth( Math.max(
+			// Firefox wraps long text (possibly a rounding bug)
+			// so we add 1px to avoid the wrapping (#7513)
+			ul.width( "" ).outerWidth() + 1,
+			this.element.outerWidth()
+		) );
 	},
 
-	/* Attach the date picker to a jQuery selection.
-	 * @param  target	element - the target input field or division or span
-	 * @param  settings  object - the new settings to use for this date picker instance (anonymous)
-	 */
-	_attachDatepicker: function(target, settings) {
-		var nodeName, inline, inst;
-		nodeName = target.nodeName.toLowerCase();
-		inline = (nodeName === "div" || nodeName === "span");
-		if (!target.id) {
-			this.uuid += 1;
-			target.id = "dp" + this.uuid;
-		}
-		inst = this._newInst($(target), inline);
-		inst.settings = $.extend({}, settings || {});
-		if (nodeName === "input") {
-			this._connectDatepicker(target, inst);
-		} else if (inline) {
-			this._inlineDatepicker(target, inst);
-		}
+	_renderMenu: function( ul, items ) {
+		var that = this;
+		$.each( items, function( index, item ) {
+			that._renderItemData( ul, item );
+		});
 	},
 
-	/* Create a new instance object. */
-	_newInst: function(target, inline) {
-		var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
-		return {id: id, input: target, // associated target
-			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
-			drawMonth: 0, drawYear: 0, // month being drawn
-			inline: inline, // is datepicker inline or not
-			dpDiv: (!inline ? this.dpDiv : // presentation div
-			bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
+	_renderItemData: function( ul, item ) {
+		return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
 	},
 
-	/* Attach the date picker to an input field. */
-	_connectDatepicker: function(target, inst) {
-		var input = $(target);
-		inst.append = $([]);
-		inst.trigger = $([]);
-		if (input.hasClass(this.markerClassName)) {
+	_renderItem: function( ul, item ) {
+		return $( "<li>" ).text( item.label ).appendTo( ul );
+	},
+
+	_move: function( direction, event ) {
+		if ( !this.menu.element.is( ":visible" ) ) {
+			this.search( null, event );
 			return;
 		}
-		this._attachments(input, inst);
-		input.addClass(this.markerClassName).keydown(this._doKeyDown).
-			keypress(this._doKeyPress).keyup(this._doKeyUp);
-		this._autoSize(inst);
-		$.data(target, PROP_NAME, inst);
-		//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
-		if( inst.settings.disabled ) {
-			this._disableDatepicker( target );
+		if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
+				this.menu.isLastItem() && /^next/.test( direction ) ) {
+
+			if ( !this.isMultiLine ) {
+				this._value( this.term );
+			}
+
+			this.menu.blur();
+			return;
 		}
+		this.menu[ direction ]( event );
 	},
 
-	/* Make attachments based on settings. */
-	_attachments: function(input, inst) {
-		var showOn, buttonText, buttonImage,
-			appendText = this._get(inst, "appendText"),
-			isRTL = this._get(inst, "isRTL");
+	widget: function() {
+		return this.menu.element;
+	},
 
-		if (inst.append) {
-			inst.append.remove();
-		}
-		if (appendText) {
-			inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
-			input[isRTL ? "before" : "after"](inst.append);
-		}
+	_value: function() {
+		return this.valueMethod.apply( this.element, arguments );
+	},
 
-		input.unbind("focus", this._showDatepicker);
+	_keyEvent: function( keyEvent, event ) {
+		if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+			this._move( keyEvent, event );
 
-		if (inst.trigger) {
-			inst.trigger.remove();
+			// prevents moving cursor to beginning/end of the text field in some browsers
+			event.preventDefault();
 		}
+	}
+});
 
-		showOn = this._get(inst, "showOn");
-		if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
-			input.focus(this._showDatepicker);
-		}
-		if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
-			buttonText = this._get(inst, "buttonText");
-			buttonImage = this._get(inst, "buttonImage");
-			inst.trigger = $(this._get(inst, "buttonImageOnly") ?
-				$("<img/>").addClass(this._triggerClass).
-					attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
-				$("<button type='button'></button>").addClass(this._triggerClass).
-					html(!buttonImage ? buttonText : $("<img/>").attr(
-					{ src:buttonImage, alt:buttonText, title:buttonText })));
-			input[isRTL ? "before" : "after"](inst.trigger);
-			inst.trigger.click(function() {
-				if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
-					$.datepicker._hideDatepicker();
-				} else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
-					$.datepicker._hideDatepicker();
-					$.datepicker._showDatepicker(input[0]);
-				} else {
-					$.datepicker._showDatepicker(input[0]);
-				}
-				return false;
-			});
-		}
-	},
-
-	/* Apply the maximum length for the date format. */
-	_autoSize: function(inst) {
-		if (this._get(inst, "autoSize") && !inst.inline) {
-			var findMax, max, maxI, i,
-				date = new Date(2009, 12 - 1, 20), // Ensure double digits
-				dateFormat = this._get(inst, "dateFormat");
-
-			if (dateFormat.match(/[DM]/)) {
-				findMax = function(names) {
-					max = 0;
-					maxI = 0;
-					for (i = 0; i < names.length; i++) {
-						if (names[i].length > max) {
-							max = names[i].length;
-							maxI = i;
-						}
-					}
-					return maxI;
-				};
-				date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
-					"monthNames" : "monthNamesShort"))));
-				date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
-					"dayNames" : "dayNamesShort"))) + 20 - date.getDay());
-			}
-			inst.input.attr("size", this._formatDate(inst, date).length);
+$.extend( $.ui.autocomplete, {
+	escapeRegex: function( value ) {
+		return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
+	},
+	filter: function( array, term ) {
+		var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
+		return $.grep( array, function( value ) {
+			return matcher.test( value.label || value.value || value );
+		});
+	}
+});
+
+// live region extension, adding a `messages` option
+// NOTE: This is an experimental API. We are still investigating
+// a full solution for string manipulation and internationalization.
+$.widget( "ui.autocomplete", $.ui.autocomplete, {
+	options: {
+		messages: {
+			noResults: "No search results.",
+			results: function( amount ) {
+				return amount + ( amount > 1 ? " results are" : " result is" ) +
+					" available, use up and down arrow keys to navigate.";
+			}
 		}
 	},
 
-	/* Attach an inline date picker to a div. */
-	_inlineDatepicker: function(target, inst) {
-		var divSpan = $(target);
-		if (divSpan.hasClass(this.markerClassName)) {
+	__response: function( content ) {
+		var message;
+		this._superApply( arguments );
+		if ( this.options.disabled || this.cancelSearch ) {
 			return;
 		}
-		divSpan.addClass(this.markerClassName).append(inst.dpDiv);
-		$.data(target, PROP_NAME, inst);
-		this._setDate(inst, this._getDefaultDate(inst), true);
-		this._updateDatepicker(inst);
-		this._updateAlternate(inst);
-		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
-		if( inst.settings.disabled ) {
-			this._disableDatepicker( target );
+		if ( content && content.length ) {
+			message = this.options.messages.results( content.length );
+		} else {
+			message = this.options.messages.noResults;
 		}
-		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
-		// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
-		inst.dpDiv.css( "display", "block" );
-	},
-
-	/* Pop-up the date picker in a "dialog" box.
-	 * @param  input element - ignored
-	 * @param  date	string or Date - the initial date to display
-	 * @param  onSelect  function - the function to call when a date is selected
-	 * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
-	 * @param  pos int[2] - coordinates for the dialog's position within the screen or
-	 *					event - with x/y coordinates or
-	 *					leave empty for default (screen centre)
-	 * @return the manager object
-	 */
-	_dialogDatepicker: function(input, date, onSelect, settings, pos) {
-		var id, browserWidth, browserHeight, scrollX, scrollY,
-			inst = this._dialogInst; // internal instance
+		this.liveRegion.children().hide();
+		$( "<div>" ).text( message ).appendTo( this.liveRegion );
+	}
+});
 
-		if (!inst) {
-			this.uuid += 1;
-			id = "dp" + this.uuid;
-			this._dialogInput = $("<input type='text' id='" + id +
-				"' style='position: absolute; top: -100px; width: 0px;'/>");
-			this._dialogInput.keydown(this._doKeyDown);
-			$("body").append(this._dialogInput);
-			inst = this._dialogInst = this._newInst(this._dialogInput, false);
-			inst.settings = {};
-			$.data(this._dialogInput[0], PROP_NAME, inst);
-		}
-		extendRemove(inst.settings, settings || {});
-		date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
-		this._dialogInput.val(date);
+var autocomplete = $.ui.autocomplete;
 
-		this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
-		if (!this._pos) {
-			browserWidth = document.documentElement.clientWidth;
-			browserHeight = document.documentElement.clientHeight;
-			scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
-			scrollY = document.documentElement.scrollTop || document.body.scrollTop;
-			this._pos = // should use actual width/height below
-				[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
-		}
 
-		// move input on screen for focus, but hidden behind dialog
-		this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
-		inst.settings.onSelect = onSelect;
-		this._inDialog = true;
-		this.dpDiv.addClass(this._dialogClass);
-		this._showDatepicker(this._dialogInput[0]);
-		if ($.blockUI) {
-			$.blockUI(this.dpDiv);
-		}
-		$.data(this._dialogInput[0], PROP_NAME, inst);
-		return this;
-	},
+/*!
+ * jQuery UI Button 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/button/
+ */
 
-	/* Detach a datepicker from its control.
-	 * @param  target	element - the target input field or division or span
-	 */
-	_destroyDatepicker: function(target) {
-		var nodeName,
-			$target = $(target),
-			inst = $.data(target, PROP_NAME);
 
-		if (!$target.hasClass(this.markerClassName)) {
-			return;
+var lastActive,
+	baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
+	typeClasses = "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",
+	formResetHandler = function() {
+		var form = $( this );
+		setTimeout(function() {
+			form.find( ":ui-button" ).button( "refresh" );
+		}, 1 );
+	},
+	radioGroup = function( radio ) {
+		var name = radio.name,
+			form = radio.form,
+			radios = $( [] );
+		if ( name ) {
+			name = name.replace( /'/g, "\\'" );
+			if ( form ) {
+				radios = $( form ).find( "[name='" + name + "'][type=radio]" );
+			} else {
+				radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
+					.filter(function() {
+						return !this.form;
+					});
+			}
 		}
+		return radios;
+	};
 
-		nodeName = target.nodeName.toLowerCase();
-		$.removeData(target, PROP_NAME);
-		if (nodeName === "input") {
-			inst.append.remove();
-			inst.trigger.remove();
-			$target.removeClass(this.markerClassName).
-				unbind("focus", this._showDatepicker).
-				unbind("keydown", this._doKeyDown).
-				unbind("keypress", this._doKeyPress).
-				unbind("keyup", this._doKeyUp);
-		} else if (nodeName === "div" || nodeName === "span") {
-			$target.removeClass(this.markerClassName).empty();
+$.widget( "ui.button", {
+	version: "1.11.0",
+	defaultElement: "<button>",
+	options: {
+		disabled: null,
+		text: true,
+		label: null,
+		icons: {
+			primary: null,
+			secondary: null
 		}
 	},
+	_create: function() {
+		this.element.closest( "form" )
+			.unbind( "reset" + this.eventNamespace )
+			.bind( "reset" + this.eventNamespace, formResetHandler );
 
-	/* Enable the date picker to a jQuery selection.
-	 * @param  target	element - the target input field or division or span
-	 */
-	_enableDatepicker: function(target) {
-		var nodeName, inline,
-			$target = $(target),
-			inst = $.data(target, PROP_NAME);
-
-		if (!$target.hasClass(this.markerClassName)) {
-			return;
+		if ( typeof this.options.disabled !== "boolean" ) {
+			this.options.disabled = !!this.element.prop( "disabled" );
+		} else {
+			this.element.prop( "disabled", this.options.disabled );
 		}
 
-		nodeName = target.nodeName.toLowerCase();
-		if (nodeName === "input") {
-			target.disabled = false;
-			inst.trigger.filter("button").
-				each(function() { this.disabled = false; }).end().
-				filter("img").css({opacity: "1.0", cursor: ""});
-		} else if (nodeName === "div" || nodeName === "span") {
-			inline = $target.children("." + this._inlineClass);
-			inline.children().removeClass("ui-state-disabled");
-			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
-				prop("disabled", false);
-		}
-		this._disabledInputs = $.map(this._disabledInputs,
-			function(value) { return (value === target ? null : value); }); // delete entry
-	},
+		this._determineButtonType();
+		this.hasTitle = !!this.buttonElement.attr( "title" );
 
-	/* Disable the date picker to a jQuery selection.
-	 * @param  target	element - the target input field or division or span
-	 */
-	_disableDatepicker: function(target) {
-		var nodeName, inline,
-			$target = $(target),
-			inst = $.data(target, PROP_NAME);
+		var that = this,
+			options = this.options,
+			toggleButton = this.type === "checkbox" || this.type === "radio",
+			activeClass = !toggleButton ? "ui-state-active" : "";
 
-		if (!$target.hasClass(this.markerClassName)) {
-			return;
+		if ( options.label === null ) {
+			options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
 		}
 
-		nodeName = target.nodeName.toLowerCase();
-		if (nodeName === "input") {
-			target.disabled = true;
-			inst.trigger.filter("button").
-				each(function() { this.disabled = true; }).end().
-				filter("img").css({opacity: "0.5", cursor: "default"});
-		} else if (nodeName === "div" || nodeName === "span") {
-			inline = $target.children("." + this._inlineClass);
-			inline.children().addClass("ui-state-disabled");
-			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
-				prop("disabled", true);
-		}
-		this._disabledInputs = $.map(this._disabledInputs,
-			function(value) { return (value === target ? null : value); }); // delete entry
-		this._disabledInputs[this._disabledInputs.length] = target;
-	},
+		this._hoverable( this.buttonElement );
 
-	/* Is the first field in a jQuery collection disabled as a datepicker?
-	 * @param  target	element - the target input field or division or span
-	 * @return boolean - true if disabled, false if enabled
-	 */
-	_isDisabledDatepicker: function(target) {
-		if (!target) {
-			return false;
-		}
-		for (var i = 0; i < this._disabledInputs.length; i++) {
-			if (this._disabledInputs[i] === target) {
-				return true;
-			}
-		}
-		return false;
-	},
+		this.buttonElement
+			.addClass( baseClasses )
+			.attr( "role", "button" )
+			.bind( "mouseenter" + this.eventNamespace, function() {
+				if ( options.disabled ) {
+					return;
+				}
+				if ( this === lastActive ) {
+					$( this ).addClass( "ui-state-active" );
+				}
+			})
+			.bind( "mouseleave" + this.eventNamespace, function() {
+				if ( options.disabled ) {
+					return;
+				}
+				$( this ).removeClass( activeClass );
+			})
+			.bind( "click" + this.eventNamespace, function( event ) {
+				if ( options.disabled ) {
+					event.preventDefault();
+					event.stopImmediatePropagation();
+				}
+			});
 
-	/* Retrieve the instance data for the target control.
-	 * @param  target  element - the target input field or division or span
-	 * @return  object - the associated instance data
-	 * @throws  error if a jQuery problem getting data
-	 */
-	_getInst: function(target) {
-		try {
-			return $.data(target, PROP_NAME);
-		}
-		catch (err) {
-			throw "Missing instance data for this datepicker";
+		// Can't use _focusable() because the element that receives focus
+		// and the element that gets the ui-state-focus class are different
+		this._on({
+			focus: function() {
+				this.buttonElement.addClass( "ui-state-focus" );
+			},
+			blur: function() {
+				this.buttonElement.removeClass( "ui-state-focus" );
+			}
+		});
+
+		if ( toggleButton ) {
+			this.element.bind( "change" + this.eventNamespace, function() {
+				that.refresh();
+			});
 		}
-	},
 
-	/* Update or retrieve the settings for a date picker attached to an input field or division.
-	 * @param  target  element - the target input field or division or span
-	 * @param  name	object - the new settings to update or
-	 *				string - the name of the setting to change or retrieve,
-	 *				when retrieving also "all" for all instance settings or
-	 *				"defaults" for all global defaults
-	 * @param  value   any - the new value for the setting
-	 *				(omit if above is an object or to retrieve a value)
-	 */
-	_optionDatepicker: function(target, name, value) {
-		var settings, date, minDate, maxDate,
-			inst = this._getInst(target);
+		if ( this.type === "checkbox" ) {
+			this.buttonElement.bind( "click" + this.eventNamespace, function() {
+				if ( options.disabled ) {
+					return false;
+				}
+			});
+		} else if ( this.type === "radio" ) {
+			this.buttonElement.bind( "click" + this.eventNamespace, function() {
+				if ( options.disabled ) {
+					return false;
+				}
+				$( this ).addClass( "ui-state-active" );
+				that.buttonElement.attr( "aria-pressed", "true" );
 
-		if (arguments.length === 2 && typeof name === "string") {
-			return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
-				(inst ? (name === "all" ? $.extend({}, inst.settings) :
-				this._get(inst, name)) : null));
+				var radio = that.element[ 0 ];
+				radioGroup( radio )
+					.not( radio )
+					.map(function() {
+						return $( this ).button( "widget" )[ 0 ];
+					})
+					.removeClass( "ui-state-active" )
+					.attr( "aria-pressed", "false" );
+			});
+		} else {
+			this.buttonElement
+				.bind( "mousedown" + this.eventNamespace, function() {
+					if ( options.disabled ) {
+						return false;
+					}
+					$( this ).addClass( "ui-state-active" );
+					lastActive = this;
+					that.document.one( "mouseup", function() {
+						lastActive = null;
+					});
+				})
+				.bind( "mouseup" + this.eventNamespace, function() {
+					if ( options.disabled ) {
+						return false;
+					}
+					$( this ).removeClass( "ui-state-active" );
+				})
+				.bind( "keydown" + this.eventNamespace, function(event) {
+					if ( options.disabled ) {
+						return false;
+					}
+					if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
+						$( this ).addClass( "ui-state-active" );
+					}
+				})
+				// see #8559, we bind to blur here in case the button element loses
+				// focus between keydown and keyup, it would be left in an "active" state
+				.bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
+					$( this ).removeClass( "ui-state-active" );
+				});
+
+			if ( this.buttonElement.is("a") ) {
+				this.buttonElement.keyup(function(event) {
+					if ( event.keyCode === $.ui.keyCode.SPACE ) {
+						// TODO pass through original event correctly (just as 2nd argument doesn't work)
+						$( this ).click();
+					}
+				});
+			}
 		}
 
-		settings = name || {};
-		if (typeof name === "string") {
-			settings = {};
-			settings[name] = value;
+		this._setOption( "disabled", options.disabled );
+		this._resetButton();
+	},
+
+	_determineButtonType: function() {
+		var ancestor, labelSelector, checked;
+
+		if ( this.element.is("[type=checkbox]") ) {
+			this.type = "checkbox";
+		} else if ( this.element.is("[type=radio]") ) {
+			this.type = "radio";
+		} else if ( this.element.is("input") ) {
+			this.type = "input";
+		} else {
+			this.type = "button";
 		}
 
-		if (inst) {
-			if (this._curInst === inst) {
-				this._hideDatepicker();
+		if ( this.type === "checkbox" || this.type === "radio" ) {
+			// we don't search against the document in case the element
+			// is disconnected from the DOM
+			ancestor = this.element.parents().last();
+			labelSelector = "label[for='" + this.element.attr("id") + "']";
+			this.buttonElement = ancestor.find( labelSelector );
+			if ( !this.buttonElement.length ) {
+				ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
+				this.buttonElement = ancestor.filter( labelSelector );
+				if ( !this.buttonElement.length ) {
+					this.buttonElement = ancestor.find( labelSelector );
+				}
 			}
+			this.element.addClass( "ui-helper-hidden-accessible" );
 
-			date = this._getDateDatepicker(target, true);
-			minDate = this._getMinMaxDate(inst, "min");
-			maxDate = this._getMinMaxDate(inst, "max");
-			extendRemove(inst.settings, settings);
-			// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
-			if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
-				inst.settings.minDate = this._formatDate(inst, minDate);
-			}
-			if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
-				inst.settings.maxDate = this._formatDate(inst, maxDate);
-			}
-			if ( "disabled" in settings ) {
-				if ( settings.disabled ) {
-					this._disableDatepicker(target);
-				} else {
-					this._enableDatepicker(target);
-				}
+			checked = this.element.is( ":checked" );
+			if ( checked ) {
+				this.buttonElement.addClass( "ui-state-active" );
 			}
-			this._attachments($(target), inst);
-			this._autoSize(inst);
-			this._setDate(inst, date);
-			this._updateAlternate(inst);
-			this._updateDatepicker(inst);
+			this.buttonElement.prop( "aria-pressed", checked );
+		} else {
+			this.buttonElement = this.element;
 		}
 	},
 
-	// change method deprecated
-	_changeDatepicker: function(target, name, value) {
-		this._optionDatepicker(target, name, value);
+	widget: function() {
+		return this.buttonElement;
 	},
 
-	/* Redraw the date picker attached to an input field or division.
-	 * @param  target  element - the target input field or division or span
-	 */
-	_refreshDatepicker: function(target) {
-		var inst = this._getInst(target);
-		if (inst) {
-			this._updateDatepicker(inst);
-		}
-	},
+	_destroy: function() {
+		this.element
+			.removeClass( "ui-helper-hidden-accessible" );
+		this.buttonElement
+			.removeClass( baseClasses + " ui-state-active " + typeClasses )
+			.removeAttr( "role" )
+			.removeAttr( "aria-pressed" )
+			.html( this.buttonElement.find(".ui-button-text").html() );
 
-	/* Set the dates for a jQuery selection.
-	 * @param  target element - the target input field or division or span
-	 * @param  date	Date - the new date
-	 */
-	_setDateDatepicker: function(target, date) {
-		var inst = this._getInst(target);
-		if (inst) {
-			this._setDate(inst, date);
-			this._updateDatepicker(inst);
-			this._updateAlternate(inst);
+		if ( !this.hasTitle ) {
+			this.buttonElement.removeAttr( "title" );
 		}
 	},
 
-	/* Get the date(s) for the first entry in a jQuery selection.
-	 * @param  target element - the target input field or division or span
-	 * @param  noDefault boolean - true if no default date is to be used
-	 * @return Date - the current date
-	 */
-	_getDateDatepicker: function(target, noDefault) {
-		var inst = this._getInst(target);
-		if (inst && !inst.inline) {
-			this._setDateFromField(inst, noDefault);
+	_setOption: function( key, value ) {
+		this._super( key, value );
+		if ( key === "disabled" ) {
+			this.widget().toggleClass( "ui-state-disabled", !!value );
+			this.element.prop( "disabled", !!value );
+			if ( value ) {
+				if ( this.type === "checkbox" || this.type === "radio" ) {
+					this.buttonElement.removeClass( "ui-state-focus" );
+				} else {
+					this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
+				}
+			}
+			return;
 		}
-		return (inst ? this._getDate(inst) : null);
+		this._resetButton();
 	},
 
-	/* Handle keystrokes. */
-	_doKeyDown: function(event) {
-		var onSelect, dateStr, sel,
-			inst = $.datepicker._getInst(event.target),
-			handled = true,
-			isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
+	refresh: function() {
+		//See #8237 & #8828
+		var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
 
-		inst._keyEvent = true;
-		if ($.datepicker._datepickerShowing) {
-			switch (event.keyCode) {
-				case 9: $.datepicker._hideDatepicker();
-						handled = false;
-						break; // hide on tab out
-				case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
-									$.datepicker._currentClass + ")", inst.dpDiv);
-						if (sel[0]) {
-							$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
-						}
+		if ( isDisabled !== this.options.disabled ) {
+			this._setOption( "disabled", isDisabled );
+		}
+		if ( this.type === "radio" ) {
+			radioGroup( this.element[0] ).each(function() {
+				if ( $( this ).is( ":checked" ) ) {
+					$( this ).button( "widget" )
+						.addClass( "ui-state-active" )
+						.attr( "aria-pressed", "true" );
+				} else {
+					$( this ).button( "widget" )
+						.removeClass( "ui-state-active" )
+						.attr( "aria-pressed", "false" );
+				}
+			});
+		} else if ( this.type === "checkbox" ) {
+			if ( this.element.is( ":checked" ) ) {
+				this.buttonElement
+					.addClass( "ui-state-active" )
+					.attr( "aria-pressed", "true" );
+			} else {
+				this.buttonElement
+					.removeClass( "ui-state-active" )
+					.attr( "aria-pressed", "false" );
+			}
+		}
+	},
 
-						onSelect = $.datepicker._get(inst, "onSelect");
-						if (onSelect) {
-							dateStr = $.datepicker._formatDate(inst);
+	_resetButton: function() {
+		if ( this.type === "input" ) {
+			if ( this.options.label ) {
+				this.element.val( this.options.label );
+			}
+			return;
+		}
+		var buttonElement = this.buttonElement.removeClass( typeClasses ),
+			buttonText = $( "<span></span>", this.document[0] )
+				.addClass( "ui-button-text" )
+				.html( this.options.label )
+				.appendTo( buttonElement.empty() )
+				.text(),
+			icons = this.options.icons,
+			multipleIcons = icons.primary && icons.secondary,
+			buttonClasses = [];
 
-							// trigger custom callback
-							onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
-						} else {
-							$.datepicker._hideDatepicker();
-						}
+		if ( icons.primary || icons.secondary ) {
+			if ( this.options.text ) {
+				buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
+			}
 
-						return false; // don't submit the form
-				case 27: $.datepicker._hideDatepicker();
-						break; // hide on escape
-				case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
-							-$.datepicker._get(inst, "stepBigMonths") :
-							-$.datepicker._get(inst, "stepMonths")), "M");
-						break; // previous month/year on page up/+ ctrl
-				case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
-							+$.datepicker._get(inst, "stepBigMonths") :
-							+$.datepicker._get(inst, "stepMonths")), "M");
-						break; // next month/year on page down/+ ctrl
-				case 35: if (event.ctrlKey || event.metaKey) {
-							$.datepicker._clearDate(event.target);
-						}
-						handled = event.ctrlKey || event.metaKey;
-						break; // clear on ctrl or command +end
-				case 36: if (event.ctrlKey || event.metaKey) {
-							$.datepicker._gotoToday(event.target);
-						}
-						handled = event.ctrlKey || event.metaKey;
-						break; // current on ctrl or command +home
-				case 37: if (event.ctrlKey || event.metaKey) {
-							$.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
-						}
-						handled = event.ctrlKey || event.metaKey;
-						// -1 day on ctrl or command +left
-						if (event.originalEvent.altKey) {
-							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
-								-$.datepicker._get(inst, "stepBigMonths") :
-								-$.datepicker._get(inst, "stepMonths")), "M");
-						}
-						// next month/year on alt +left on Mac
-						break;
-				case 38: if (event.ctrlKey || event.metaKey) {
-							$.datepicker._adjustDate(event.target, -7, "D");
-						}
-						handled = event.ctrlKey || event.metaKey;
-						break; // -1 week on ctrl or command +up
-				case 39: if (event.ctrlKey || event.metaKey) {
-							$.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
-						}
-						handled = event.ctrlKey || event.metaKey;
-						// +1 day on ctrl or command +right
-						if (event.originalEvent.altKey) {
-							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
-								+$.datepicker._get(inst, "stepBigMonths") :
-								+$.datepicker._get(inst, "stepMonths")), "M");
-						}
-						// next month/year on alt +right
-						break;
-				case 40: if (event.ctrlKey || event.metaKey) {
-							$.datepicker._adjustDate(event.target, +7, "D");
-						}
-						handled = event.ctrlKey || event.metaKey;
-						break; // +1 week on ctrl or command +down
-				default: handled = false;
+			if ( icons.primary ) {
+				buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
+			}
+
+			if ( icons.secondary ) {
+				buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
+			}
+
+			if ( !this.options.text ) {
+				buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
+
+				if ( !this.hasTitle ) {
+					buttonElement.attr( "title", $.trim( buttonText ) );
+				}
 			}
-		} else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
-			$.datepicker._showDatepicker(this);
 		} else {
-			handled = false;
+			buttonClasses.push( "ui-button-text-only" );
 		}
+		buttonElement.addClass( buttonClasses.join( " " ) );
+	}
+});
 
-		if (handled) {
-			event.preventDefault();
-			event.stopPropagation();
-		}
+$.widget( "ui.buttonset", {
+	version: "1.11.0",
+	options: {
+		items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
 	},
 
-	/* Filter entered characters - based on date format. */
-	_doKeyPress: function(event) {
-		var chars, chr,
-			inst = $.datepicker._getInst(event.target);
+	_create: function() {
+		this.element.addClass( "ui-buttonset" );
+	},
 
-		if ($.datepicker._get(inst, "constrainInput")) {
-			chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
-			chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
-			return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
+	_init: function() {
+		this.refresh();
+	},
+
+	_setOption: function( key, value ) {
+		if ( key === "disabled" ) {
+			this.buttons.button( "option", key, value );
 		}
+
+		this._super( key, value );
 	},
 
-	/* Synchronise manual entry and field/alternate field. */
-	_doKeyUp: function(event) {
-		var date,
-			inst = $.datepicker._getInst(event.target);
+	refresh: function() {
+		var rtl = this.element.css( "direction" ) === "rtl",
+			allButtons = this.element.find( this.options.items ),
+			existingButtons = allButtons.filter( ":ui-button" );
 
-		if (inst.input.val() !== inst.lastVal) {
-			try {
-				date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
-					(inst.input ? inst.input.val() : null),
-					$.datepicker._getFormatConfig(inst));
+		// Initialize new buttons
+		allButtons.not( ":ui-button" ).button();
 
-				if (date) { // only if valid
-					$.datepicker._setDateFromField(inst);
-					$.datepicker._updateAlternate(inst);
-					$.datepicker._updateDatepicker(inst);
-				}
-			}
-			catch (err) {
-			}
-		}
-		return true;
+		// Refresh existing buttons
+		existingButtons.button( "refresh" );
+
+		this.buttons = allButtons
+			.map(function() {
+				return $( this ).button( "widget" )[ 0 ];
+			})
+				.removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
+				.filter( ":first" )
+					.addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
+				.end()
+				.filter( ":last" )
+					.addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
+				.end()
+			.end();
 	},
 
-	/* Pop-up the date picker for a given input field.
-	 * If false returned from beforeShow event handler do not show.
-	 * @param  input  element - the input field attached to the date picker or
-	 *					event - if triggered by focus
-	 */
-	_showDatepicker: function(input) {
-		input = input.target || input;
-		if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
-			input = $("input", input.parentNode)[0];
-		}
+	_destroy: function() {
+		this.element.removeClass( "ui-buttonset" );
+		this.buttons
+			.map(function() {
+				return $( this ).button( "widget" )[ 0 ];
+			})
+				.removeClass( "ui-corner-left ui-corner-right" )
+			.end()
+			.button( "destroy" );
+	}
+});
 
-		if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
-			return;
-		}
+var button = $.ui.button;
 
-		var inst, beforeShow, beforeShowSettings, isFixed,
-			offset, showAnim, duration;
 
-		inst = $.datepicker._getInst(input);
-		if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
-			$.datepicker._curInst.dpDiv.stop(true, true);
-			if ( inst && $.datepicker._datepickerShowing ) {
-				$.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
-			}
-		}
+/*!
+ * jQuery UI Datepicker 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/datepicker/
+ */
 
-		beforeShow = $.datepicker._get(inst, "beforeShow");
-		beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
-		if(beforeShowSettings === false){
-			return;
-		}
-		extendRemove(inst.settings, beforeShowSettings);
 
-		inst.lastVal = null;
-		$.datepicker._lastInput = input;
-		$.datepicker._setDateFromField(inst);
+$.extend($.ui, { datepicker: { version: "1.11.0" } });
 
-		if ($.datepicker._inDialog) { // hide cursor
-			input.value = "";
-		}
-		if (!$.datepicker._pos) { // position below input
-			$.datepicker._pos = $.datepicker._findPos(input);
-			$.datepicker._pos[1] += input.offsetHeight; // add the height
+var datepicker_instActive;
+
+function datepicker_getZindex( elem ) {
+	var position, value;
+	while ( elem.length && elem[ 0 ] !== document ) {
+		// Ignore z-index if position is set to a value where z-index is ignored by the browser
+		// This makes behavior of this function consistent across browsers
+		// WebKit always returns auto if the element is positioned
+		position = elem.css( "position" );
+		if ( position === "absolute" || position === "relative" || position === "fixed" ) {
+			// IE returns 0 when zIndex is not specified
+			// other browsers return a string
+			// we ignore the case of nested elements with an explicit value of 0
+			// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
+			value = parseInt( elem.css( "zIndex" ), 10 );
+			if ( !isNaN( value ) && value !== 0 ) {
+				return value;
+			}
 		}
+		elem = elem.parent();
+	}
 
-		isFixed = false;
-		$(input).parents().each(function() {
-			isFixed |= $(this).css("position") === "fixed";
-			return !isFixed;
-		});
-
-		offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
-		$.datepicker._pos = null;
-		//to avoid flashes on Firefox
-		inst.dpDiv.empty();
-		// determine sizing offscreen
-		inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
-		$.datepicker._updateDatepicker(inst);
-		// fix width for dynamic number of date pickers
-		// and adjust position before showing
-		offset = $.datepicker._checkOffset(inst, offset, isFixed);
-		inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
-			"static" : (isFixed ? "fixed" : "absolute")), display: "none",
-			left: offset.left + "px", top: offset.top + "px"});
+	return 0;
+}
+/* Date picker manager.
+   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
+   Settings for (groups of) date pickers are maintained in an instance object,
+   allowing multiple different settings on the same page. */
 
-		if (!inst.inline) {
-			showAnim = $.datepicker._get(inst, "showAnim");
-			duration = $.datepicker._get(inst, "duration");
-			inst.dpDiv.zIndex($(input).zIndex()+1);
-			$.datepicker._datepickerShowing = true;
+function Datepicker() {
+	this._curInst = null; // The current instance in use
+	this._keyEvent = false; // If the last event was a key event
+	this._disabledInputs = []; // List of date picker inputs that have been disabled
+	this._datepickerShowing = false; // True if the popup picker is showing , false if not
+	this._inDialog = false; // True if showing within a "dialog", false if not
+	this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
+	this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
+	this._appendClass = "ui-datepicker-append"; // The name of the append marker class
+	this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
+	this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
+	this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
+	this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
+	this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
+	this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
+	this.regional = []; // Available regional settings, indexed by language code
+	this.regional[""] = { // Default regional settings
+		closeText: "Done", // Display text for close link
+		prevText: "Prev", // Display text for previous month link
+		nextText: "Next", // Display text for next month link
+		currentText: "Today", // Display text for current month link
+		monthNames: ["January","February","March","April","May","June",
+			"July","August","September","October","November","December"], // Names of months for drop-down and formatting
+		monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
+		dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
+		dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
+		dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
+		weekHeader: "Wk", // Column header for week of the year
+		dateFormat: "mm/dd/yy", // See format options on parseDate
+		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
+		isRTL: false, // True if right-to-left language, false if left-to-right
+		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
+		yearSuffix: "" // Additional text to append to the year in the month headers
+	};
+	this._defaults = { // Global defaults for all the date picker instances
+		showOn: "focus", // "focus" for popup on focus,
+			// "button" for trigger button, or "both" for either
+		showAnim: "fadeIn", // Name of jQuery animation for popup
+		showOptions: {}, // Options for enhanced animations
+		defaultDate: null, // Used when field is blank: actual date,
+			// +/-number for offset from today, null for today
+		appendText: "", // Display text following the input box, e.g. showing the format
+		buttonText: "...", // Text for trigger button
+		buttonImage: "", // URL for trigger button image
+		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
+		hideIfNoPrevNext: false, // True to hide next/previous month links
+			// if not applicable, false to just disable them
+		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
+		gotoCurrent: false, // True if today link goes back to current selection instead
+		changeMonth: false, // True if month can be selected directly, false if only prev/next
+		changeYear: false, // True if year can be selected directly, false if only prev/next
+		yearRange: "c-10:c+10", // Range of years to display in drop-down,
+			// either relative to today's year (-nn:+nn), relative to currently displayed year
+			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
+		showOtherMonths: false, // True to show dates in other months, false to leave blank
+		selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
+		showWeek: false, // True to show week of the year, false to not show it
+		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
+			// takes a Date and returns the number of the week for it
+		shortYearCutoff: "+10", // Short year values < this are in the current century,
+			// > this are in the previous century,
+			// string value starting with "+" for current year + value
+		minDate: null, // The earliest selectable date, or null for no limit
+		maxDate: null, // The latest selectable date, or null for no limit
+		duration: "fast", // Duration of display/closure
+		beforeShowDay: null, // Function that takes a date and returns an array with
+			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
+			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
+		beforeShow: null, // Function that takes an input field and
+			// returns a set of custom settings for the date picker
+		onSelect: null, // Define a callback function when a date is selected
+		onChangeMonthYear: null, // Define a callback function when the month or year is changed
+		onClose: null, // Define a callback function when the datepicker is closed
+		numberOfMonths: 1, // Number of months to show at a time
+		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
+		stepMonths: 1, // Number of months to step back/forward
+		stepBigMonths: 12, // Number of months to step back/forward for the big links
+		altField: "", // Selector for an alternate field to store selected dates into
+		altFormat: "", // The date format to use for the alternate field
+		constrainInput: true, // The input is constrained by the current date format
+		showButtonPanel: false, // True to show button panel, false to not show it
+		autoSize: false, // True to size the input for the date format, false to leave as is
+		disabled: false // The initial disabled state
+	};
+	$.extend(this._defaults, this.regional[""]);
+	this.regional.en = $.extend( true, {}, this.regional[ "" ]);
+	this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
+	this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
+}
 
-			if ( $.effects && $.effects.effect[ showAnim ] ) {
-				inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
-			} else {
-				inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
-			}
+$.extend(Datepicker.prototype, {
+	/* Class name added to elements to indicate already configured with a date picker. */
+	markerClassName: "hasDatepicker",
 
-			if ( $.datepicker._shouldFocusInput( inst ) ) {
-				inst.input.focus();
-			}
+	//Keep track of the maximum number of rows displayed (see #7043)
+	maxRows: 4,
 
-			$.datepicker._curInst = inst;
-		}
+	// TODO rename to "widget" when switching to widget factory
+	_widgetDatepicker: function() {
+		return this.dpDiv;
 	},
 
-	/* Generate the date picker content. */
-	_updateDatepicker: function(inst) {
-		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
-		instActive = inst; // for delegate hover events
-		inst.dpDiv.empty().append(this._generateHTML(inst));
-		this._attachHandlers(inst);
-		inst.dpDiv.find("." + this._dayOverClass + " a").mouseover();
-
-		var origyearshtml,
-			numMonths = this._getNumberOfMonths(inst),
-			cols = numMonths[1],
-			width = 17;
-
-		inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
-		if (cols > 1) {
-			inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
-		}
-		inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
-			"Class"]("ui-datepicker-multi");
-		inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
-			"Class"]("ui-datepicker-rtl");
+	/* Override the default settings for all instances of the date picker.
+	 * @param  settings  object - the new settings to use as defaults (anonymous object)
+	 * @return the manager object
+	 */
+	setDefaults: function(settings) {
+		datepicker_extendRemove(this._defaults, settings || {});
+		return this;
+	},
 
-		if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
-			inst.input.focus();
+	/* Attach the date picker to a jQuery selection.
+	 * @param  target	element - the target input field or division or span
+	 * @param  settings  object - the new settings to use for this date picker instance (anonymous)
+	 */
+	_attachDatepicker: function(target, settings) {
+		var nodeName, inline, inst;
+		nodeName = target.nodeName.toLowerCase();
+		inline = (nodeName === "div" || nodeName === "span");
+		if (!target.id) {
+			this.uuid += 1;
+			target.id = "dp" + this.uuid;
 		}
-
-		// deffered render of the years select (to avoid flashes on Firefox)
-		if( inst.yearshtml ){
-			origyearshtml = inst.yearshtml;
-			setTimeout(function(){
-				//assure that inst.yearshtml didn't change.
-				if( origyearshtml === inst.yearshtml && inst.yearshtml ){
-					inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
-				}
-				origyearshtml = inst.yearshtml = null;
-			}, 0);
+		inst = this._newInst($(target), inline);
+		inst.settings = $.extend({}, settings || {});
+		if (nodeName === "input") {
+			this._connectDatepicker(target, inst);
+		} else if (inline) {
+			this._inlineDatepicker(target, inst);
 		}
 	},
 
-	// #6694 - don't focus the input if it's already focused
-	// this breaks the change event in IE
-	// Support: IE and jQuery <1.9
-	_shouldFocusInput: function( inst ) {
-		return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
+	/* Create a new instance object. */
+	_newInst: function(target, inline) {
+		var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
+		return {id: id, input: target, // associated target
+			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
+			drawMonth: 0, drawYear: 0, // month being drawn
+			inline: inline, // is datepicker inline or not
+			dpDiv: (!inline ? this.dpDiv : // presentation div
+			datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
 	},
 
-	/* Check positioning to remain on screen. */
-	_checkOffset: function(inst, offset, isFixed) {
-		var dpWidth = inst.dpDiv.outerWidth(),
-			dpHeight = inst.dpDiv.outerHeight(),
-			inputWidth = inst.input ? inst.input.outerWidth() : 0,
-			inputHeight = inst.input ? inst.input.outerHeight() : 0,
-			viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
-			viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
-
-		offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
-		offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
-		offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
-
-		// now check if datepicker is showing outside window viewport - move to a better place if so.
-		offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
-			Math.abs(offset.left + dpWidth - viewWidth) : 0);
-		offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
-			Math.abs(dpHeight + inputHeight) : 0);
-
-		return offset;
+	/* Attach the date picker to an input field. */
+	_connectDatepicker: function(target, inst) {
+		var input = $(target);
+		inst.append = $([]);
+		inst.trigger = $([]);
+		if (input.hasClass(this.markerClassName)) {
+			return;
+		}
+		this._attachments(input, inst);
+		input.addClass(this.markerClassName).keydown(this._doKeyDown).
+			keypress(this._doKeyPress).keyup(this._doKeyUp);
+		this._autoSize(inst);
+		$.data(target, "datepicker", inst);
+		//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
+		if( inst.settings.disabled ) {
+			this._disableDatepicker( target );
+		}
 	},
 
-	/* Find an object's position on the screen. */
-	_findPos: function(obj) {
-		var position,
-			inst = this._getInst(obj),
+	/* Make attachments based on settings. */
+	_attachments: function(input, inst) {
+		var showOn, buttonText, buttonImage,
+			appendText = this._get(inst, "appendText"),
 			isRTL = this._get(inst, "isRTL");
 
-		while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
-			obj = obj[isRTL ? "previousSibling" : "nextSibling"];
+		if (inst.append) {
+			inst.append.remove();
+		}
+		if (appendText) {
+			inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
+			input[isRTL ? "before" : "after"](inst.append);
 		}
 
-		position = $(obj).offset();
-		return [position.left, position.top];
-	},
+		input.unbind("focus", this._showDatepicker);
 
-	/* Hide the date picker from view.
-	 * @param  input  element - the input field attached to the date picker
-	 */
-	_hideDatepicker: function(input) {
-		var showAnim, duration, postProcess, onClose,
-			inst = this._curInst;
-
-		if (!inst || (input && inst !== $.data(input, PROP_NAME))) {
-			return;
+		if (inst.trigger) {
+			inst.trigger.remove();
 		}
 
-		if (this._datepickerShowing) {
-			showAnim = this._get(inst, "showAnim");
-			duration = this._get(inst, "duration");
-			postProcess = function() {
-				$.datepicker._tidyDialog(inst);
-			};
-
-			// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
-			if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
-				inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
-			} else {
-				inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
-					(showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
-			}
-
-			if (!showAnim) {
-				postProcess();
-			}
-			this._datepickerShowing = false;
+		showOn = this._get(inst, "showOn");
+		if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
+			input.focus(this._showDatepicker);
+		}
+		if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
+			buttonText = this._get(inst, "buttonText");
+			buttonImage = this._get(inst, "buttonImage");
+			inst.trigger = $(this._get(inst, "buttonImageOnly") ?
+				$("<img/>").addClass(this._triggerClass).
+					attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
+				$("<button type='button'></button>").addClass(this._triggerClass).
+					html(!buttonImage ? buttonText : $("<img/>").attr(
+					{ src:buttonImage, alt:buttonText, title:buttonText })));
+			input[isRTL ? "before" : "after"](inst.trigger);
+			inst.trigger.click(function() {
+				if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
+					$.datepicker._hideDatepicker();
+				} else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
+					$.datepicker._hideDatepicker();
+					$.datepicker._showDatepicker(input[0]);
+				} else {
+					$.datepicker._showDatepicker(input[0]);
+				}
+				return false;
+			});
+		}
+	},
 
-			onClose = this._get(inst, "onClose");
-			if (onClose) {
-				onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
-			}
+	/* Apply the maximum length for the date format. */
+	_autoSize: function(inst) {
+		if (this._get(inst, "autoSize") && !inst.inline) {
+			var findMax, max, maxI, i,
+				date = new Date(2009, 12 - 1, 20), // Ensure double digits
+				dateFormat = this._get(inst, "dateFormat");
 
-			this._lastInput = null;
-			if (this._inDialog) {
-				this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
-				if ($.blockUI) {
-					$.unblockUI();
-					$("body").append(this.dpDiv);
-				}
+			if (dateFormat.match(/[DM]/)) {
+				findMax = function(names) {
+					max = 0;
+					maxI = 0;
+					for (i = 0; i < names.length; i++) {
+						if (names[i].length > max) {
+							max = names[i].length;
+							maxI = i;
+						}
+					}
+					return maxI;
+				};
+				date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
+					"monthNames" : "monthNamesShort"))));
+				date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
+					"dayNames" : "dayNamesShort"))) + 20 - date.getDay());
 			}
-			this._inDialog = false;
+			inst.input.attr("size", this._formatDate(inst, date).length);
 		}
 	},
 
-	/* Tidy up after a dialog display. */
-	_tidyDialog: function(inst) {
-		inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
+	/* Attach an inline date picker to a div. */
+	_inlineDatepicker: function(target, inst) {
+		var divSpan = $(target);
+		if (divSpan.hasClass(this.markerClassName)) {
+			return;
+		}
+		divSpan.addClass(this.markerClassName).append(inst.dpDiv);
+		$.data(target, "datepicker", inst);
+		this._setDate(inst, this._getDefaultDate(inst), true);
+		this._updateDatepicker(inst);
+		this._updateAlternate(inst);
+		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
+		if( inst.settings.disabled ) {
+			this._disableDatepicker( target );
+		}
+		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
+		// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
+		inst.dpDiv.css( "display", "block" );
 	},
 
-	/* Close date picker if clicked elsewhere. */
-	_checkExternalClick: function(event) {
-		if (!$.datepicker._curInst) {
-			return;
+	/* Pop-up the date picker in a "dialog" box.
+	 * @param  input element - ignored
+	 * @param  date	string or Date - the initial date to display
+	 * @param  onSelect  function - the function to call when a date is selected
+	 * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
+	 * @param  pos int[2] - coordinates for the dialog's position within the screen or
+	 *					event - with x/y coordinates or
+	 *					leave empty for default (screen centre)
+	 * @return the manager object
+	 */
+	_dialogDatepicker: function(input, date, onSelect, settings, pos) {
+		var id, browserWidth, browserHeight, scrollX, scrollY,
+			inst = this._dialogInst; // internal instance
+
+		if (!inst) {
+			this.uuid += 1;
+			id = "dp" + this.uuid;
+			this._dialogInput = $("<input type='text' id='" + id +
+				"' style='position: absolute; top: -100px; width: 0px;'/>");
+			this._dialogInput.keydown(this._doKeyDown);
+			$("body").append(this._dialogInput);
+			inst = this._dialogInst = this._newInst(this._dialogInput, false);
+			inst.settings = {};
+			$.data(this._dialogInput[0], "datepicker", inst);
 		}
+		datepicker_extendRemove(inst.settings, settings || {});
+		date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
+		this._dialogInput.val(date);
 
-		var $target = $(event.target),
-			inst = $.datepicker._getInst($target[0]);
+		this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
+		if (!this._pos) {
+			browserWidth = document.documentElement.clientWidth;
+			browserHeight = document.documentElement.clientHeight;
+			scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
+			scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+			this._pos = // should use actual width/height below
+				[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
+		}
 
-		if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
-				$target.parents("#" + $.datepicker._mainDivId).length === 0 &&
-				!$target.hasClass($.datepicker.markerClassName) &&
-				!$target.closest("." + $.datepicker._triggerClass).length &&
-				$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
-			( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
-				$.datepicker._hideDatepicker();
+		// move input on screen for focus, but hidden behind dialog
+		this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
+		inst.settings.onSelect = onSelect;
+		this._inDialog = true;
+		this.dpDiv.addClass(this._dialogClass);
+		this._showDatepicker(this._dialogInput[0]);
+		if ($.blockUI) {
+			$.blockUI(this.dpDiv);
 		}
+		$.data(this._dialogInput[0], "datepicker", inst);
+		return this;
 	},
 
-	/* Adjust one of the date sub-fields. */
-	_adjustDate: function(id, offset, period) {
-		var target = $(id),
-			inst = this._getInst(target[0]);
+	/* Detach a datepicker from its control.
+	 * @param  target	element - the target input field or division or span
+	 */
+	_destroyDatepicker: function(target) {
+		var nodeName,
+			$target = $(target),
+			inst = $.data(target, "datepicker");
 
-		if (this._isDisabledDatepicker(target[0])) {
+		if (!$target.hasClass(this.markerClassName)) {
 			return;
 		}
-		this._adjustInstDate(inst, offset +
-			(period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
-			period);
-		this._updateDatepicker(inst);
-	},
-
-	/* Action for current link. */
-	_gotoToday: function(id) {
-		var date,
-			target = $(id),
-			inst = this._getInst(target[0]);
 
-		if (this._get(inst, "gotoCurrent") && inst.currentDay) {
-			inst.selectedDay = inst.currentDay;
-			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
-			inst.drawYear = inst.selectedYear = inst.currentYear;
-		} else {
-			date = new Date();
-			inst.selectedDay = date.getDate();
-			inst.drawMonth = inst.selectedMonth = date.getMonth();
-			inst.drawYear = inst.selectedYear = date.getFullYear();
+		nodeName = target.nodeName.toLowerCase();
+		$.removeData(target, "datepicker");
+		if (nodeName === "input") {
+			inst.append.remove();
+			inst.trigger.remove();
+			$target.removeClass(this.markerClassName).
+				unbind("focus", this._showDatepicker).
+				unbind("keydown", this._doKeyDown).
+				unbind("keypress", this._doKeyPress).
+				unbind("keyup", this._doKeyUp);
+		} else if (nodeName === "div" || nodeName === "span") {
+			$target.removeClass(this.markerClassName).empty();
 		}
-		this._notifyChange(inst);
-		this._adjustDate(target);
 	},
 
-	/* Action for selecting a new month/year. */
-	_selectMonthYear: function(id, select, period) {
-		var target = $(id),
-			inst = this._getInst(target[0]);
+	/* Enable the date picker to a jQuery selection.
+	 * @param  target	element - the target input field or division or span
+	 */
+	_enableDatepicker: function(target) {
+		var nodeName, inline,
+			$target = $(target),
+			inst = $.data(target, "datepicker");
 
-		inst["selected" + (period === "M" ? "Month" : "Year")] =
-		inst["draw" + (period === "M" ? "Month" : "Year")] =
-			parseInt(select.options[select.selectedIndex].value,10);
+		if (!$target.hasClass(this.markerClassName)) {
+			return;
+		}
 
-		this._notifyChange(inst);
-		this._adjustDate(target);
+		nodeName = target.nodeName.toLowerCase();
+		if (nodeName === "input") {
+			target.disabled = false;
+			inst.trigger.filter("button").
+				each(function() { this.disabled = false; }).end().
+				filter("img").css({opacity: "1.0", cursor: ""});
+		} else if (nodeName === "div" || nodeName === "span") {
+			inline = $target.children("." + this._inlineClass);
+			inline.children().removeClass("ui-state-disabled");
+			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
+				prop("disabled", false);
+		}
+		this._disabledInputs = $.map(this._disabledInputs,
+			function(value) { return (value === target ? null : value); }); // delete entry
 	},
 
-	/* Action for selecting a day. */
-	_selectDay: function(id, month, year, td) {
-		var inst,
-			target = $(id);
+	/* Disable the date picker to a jQuery selection.
+	 * @param  target	element - the target input field or division or span
+	 */
+	_disableDatepicker: function(target) {
+		var nodeName, inline,
+			$target = $(target),
+			inst = $.data(target, "datepicker");
 
-		if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
+		if (!$target.hasClass(this.markerClassName)) {
 			return;
 		}
 
-		inst = this._getInst(target[0]);
-		inst.selectedDay = inst.currentDay = $("a", td).html();
-		inst.selectedMonth = inst.currentMonth = month;
-		inst.selectedYear = inst.currentYear = year;
-		this._selectDate(id, this._formatDate(inst,
-			inst.currentDay, inst.currentMonth, inst.currentYear));
+		nodeName = target.nodeName.toLowerCase();
+		if (nodeName === "input") {
+			target.disabled = true;
+			inst.trigger.filter("button").
+				each(function() { this.disabled = true; }).end().
+				filter("img").css({opacity: "0.5", cursor: "default"});
+		} else if (nodeName === "div" || nodeName === "span") {
+			inline = $target.children("." + this._inlineClass);
+			inline.children().addClass("ui-state-disabled");
+			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
+				prop("disabled", true);
+		}
+		this._disabledInputs = $.map(this._disabledInputs,
+			function(value) { return (value === target ? null : value); }); // delete entry
+		this._disabledInputs[this._disabledInputs.length] = target;
 	},
 
-	/* Erase the input field and hide the date picker. */
-	_clearDate: function(id) {
-		var target = $(id);
-		this._selectDate(target, "");
+	/* Is the first field in a jQuery collection disabled as a datepicker?
+	 * @param  target	element - the target input field or division or span
+	 * @return boolean - true if disabled, false if enabled
+	 */
+	_isDisabledDatepicker: function(target) {
+		if (!target) {
+			return false;
+		}
+		for (var i = 0; i < this._disabledInputs.length; i++) {
+			if (this._disabledInputs[i] === target) {
+				return true;
+			}
+		}
+		return false;
 	},
 
-	/* Update the input field with the selected date. */
-	_selectDate: function(id, dateStr) {
-		var onSelect,
-			target = $(id),
-			inst = this._getInst(target[0]);
+	/* Retrieve the instance data for the target control.
+	 * @param  target  element - the target input field or division or span
+	 * @return  object - the associated instance data
+	 * @throws  error if a jQuery problem getting data
+	 */
+	_getInst: function(target) {
+		try {
+			return $.data(target, "datepicker");
+		}
+		catch (err) {
+			throw "Missing instance data for this datepicker";
+		}
+	},
 
-		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
-		if (inst.input) {
-			inst.input.val(dateStr);
+	/* Update or retrieve the settings for a date picker attached to an input field or division.
+	 * @param  target  element - the target input field or division or span
+	 * @param  name	object - the new settings to update or
+	 *				string - the name of the setting to change or retrieve,
+	 *				when retrieving also "all" for all instance settings or
+	 *				"defaults" for all global defaults
+	 * @param  value   any - the new value for the setting
+	 *				(omit if above is an object or to retrieve a value)
+	 */
+	_optionDatepicker: function(target, name, value) {
+		var settings, date, minDate, maxDate,
+			inst = this._getInst(target);
+
+		if (arguments.length === 2 && typeof name === "string") {
+			return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
+				(inst ? (name === "all" ? $.extend({}, inst.settings) :
+				this._get(inst, name)) : null));
 		}
-		this._updateAlternate(inst);
 
-		onSelect = this._get(inst, "onSelect");
-		if (onSelect) {
-			onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
-		} else if (inst.input) {
-			inst.input.trigger("change"); // fire the change event
+		settings = name || {};
+		if (typeof name === "string") {
+			settings = {};
+			settings[name] = value;
 		}
 
-		if (inst.inline){
-			this._updateDatepicker(inst);
-		} else {
-			this._hideDatepicker();
-			this._lastInput = inst.input[0];
-			if (typeof(inst.input[0]) !== "object") {
-				inst.input.focus(); // restore focus
+		if (inst) {
+			if (this._curInst === inst) {
+				this._hideDatepicker();
 			}
-			this._lastInput = null;
+
+			date = this._getDateDatepicker(target, true);
+			minDate = this._getMinMaxDate(inst, "min");
+			maxDate = this._getMinMaxDate(inst, "max");
+			datepicker_extendRemove(inst.settings, settings);
+			// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
+			if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
+				inst.settings.minDate = this._formatDate(inst, minDate);
+			}
+			if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
+				inst.settings.maxDate = this._formatDate(inst, maxDate);
+			}
+			if ( "disabled" in settings ) {
+				if ( settings.disabled ) {
+					this._disableDatepicker(target);
+				} else {
+					this._enableDatepicker(target);
+				}
+			}
+			this._attachments($(target), inst);
+			this._autoSize(inst);
+			this._setDate(inst, date);
+			this._updateAlternate(inst);
+			this._updateDatepicker(inst);
 		}
 	},
 
-	/* Update any alternate field to synchronise with the main field. */
-	_updateAlternate: function(inst) {
-		var altFormat, date, dateStr,
-			altField = this._get(inst, "altField");
+	// change method deprecated
+	_changeDatepicker: function(target, name, value) {
+		this._optionDatepicker(target, name, value);
+	},
 
-		if (altField) { // update alternate field too
-			altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
-			date = this._getDate(inst);
-			dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
-			$(altField).each(function() { $(this).val(dateStr); });
+	/* Redraw the date picker attached to an input field or division.
+	 * @param  target  element - the target input field or division or span
+	 */
+	_refreshDatepicker: function(target) {
+		var inst = this._getInst(target);
+		if (inst) {
+			this._updateDatepicker(inst);
 		}
 	},
 
-	/* Set as beforeShowDay function to prevent selection of weekends.
-	 * @param  date  Date - the date to customise
-	 * @return [boolean, string] - is this date selectable?, what is its CSS class?
+	/* Set the dates for a jQuery selection.
+	 * @param  target element - the target input field or division or span
+	 * @param  date	Date - the new date
 	 */
-	noWeekends: function(date) {
-		var day = date.getDay();
-		return [(day > 0 && day < 6), ""];
+	_setDateDatepicker: function(target, date) {
+		var inst = this._getInst(target);
+		if (inst) {
+			this._setDate(inst, date);
+			this._updateDatepicker(inst);
+			this._updateAlternate(inst);
+		}
 	},
 
-	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
-	 * @param  date  Date - the date to get the week for
-	 * @return  number - the number of the week within the year that contains this date
+	/* Get the date(s) for the first entry in a jQuery selection.
+	 * @param  target element - the target input field or division or span
+	 * @param  noDefault boolean - true if no default date is to be used
+	 * @return Date - the current date
 	 */
-	iso8601Week: function(date) {
-		var time,
-			checkDate = new Date(date.getTime());
+	_getDateDatepicker: function(target, noDefault) {
+		var inst = this._getInst(target);
+		if (inst && !inst.inline) {
+			this._setDateFromField(inst, noDefault);
+		}
+		return (inst ? this._getDate(inst) : null);
+	},
 
-		// Find Thursday of this week starting on Monday
-		checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
+	/* Handle keystrokes. */
+	_doKeyDown: function(event) {
+		var onSelect, dateStr, sel,
+			inst = $.datepicker._getInst(event.target),
+			handled = true,
+			isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
 
-		time = checkDate.getTime();
-		checkDate.setMonth(0); // Compare with Jan 1
-		checkDate.setDate(1);
-		return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
-	},
+		inst._keyEvent = true;
+		if ($.datepicker._datepickerShowing) {
+			switch (event.keyCode) {
+				case 9: $.datepicker._hideDatepicker();
+						handled = false;
+						break; // hide on tab out
+				case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
+									$.datepicker._currentClass + ")", inst.dpDiv);
+						if (sel[0]) {
+							$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
+						}
 
-	/* Parse a string value into a date object.
-	 * See formatDate below for the possible formats.
-	 *
-	 * @param  format string - the expected format of the date
-	 * @param  value string - the date in the above format
-	 * @param  settings Object - attributes include:
-	 *					shortYearCutoff  number - the cutoff year for determining the century (optional)
-	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
-	 *					dayNames		string[7] - names of the days from Sunday (optional)
-	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
-	 *					monthNames		string[12] - names of the months (optional)
-	 * @return  Date - the extracted date value or null if value is blank
-	 */
-	parseDate: function (format, value, settings) {
-		if (format == null || value == null) {
-			throw "Invalid arguments";
-		}
+						onSelect = $.datepicker._get(inst, "onSelect");
+						if (onSelect) {
+							dateStr = $.datepicker._formatDate(inst);
 
-		value = (typeof value === "object" ? value.toString() : value + "");
-		if (value === "") {
-			return null;
-		}
+							// trigger custom callback
+							onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
+						} else {
+							$.datepicker._hideDatepicker();
+						}
 
-		var iFormat, dim, extra,
-			iValue = 0,
-			shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
-			shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
-				new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
-			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
-			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
-			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
-			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
-			year = -1,
-			month = -1,
-			day = -1,
-			doy = -1,
-			literal = false,
-			date,
-			// Check whether a format character is doubled
-			lookAhead = function(match) {
-				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
-				if (matches) {
-					iFormat++;
-				}
-				return matches;
-			},
-			// Extract a number from the string value
-			getNumber = function(match) {
-				var isDoubled = lookAhead(match),
-					size = (match === "@" ? 14 : (match === "!" ? 20 :
-					(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
-					digits = new RegExp("^\\d{1," + size + "}"),
-					num = value.substring(iValue).match(digits);
-				if (!num) {
-					throw "Missing number at position " + iValue;
-				}
-				iValue += num[0].length;
-				return parseInt(num[0], 10);
-			},
-			// Extract a name from the string value and convert to an index
-			getName = function(match, shortNames, longNames) {
-				var index = -1,
-					names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
-						return [ [k, v] ];
-					}).sort(function (a, b) {
-						return -(a[1].length - b[1].length);
-					});
-
-				$.each(names, function (i, pair) {
-					var name = pair[1];
-					if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
-						index = pair[0];
-						iValue += name.length;
-						return false;
-					}
-				});
-				if (index !== -1) {
-					return index + 1;
-				} else {
-					throw "Unknown name at position " + iValue;
-				}
-			},
-			// Confirm that a literal character matches the string value
-			checkLiteral = function() {
-				if (value.charAt(iValue) !== format.charAt(iFormat)) {
-					throw "Unexpected literal at position " + iValue;
-				}
-				iValue++;
-			};
-
-		for (iFormat = 0; iFormat < format.length; iFormat++) {
-			if (literal) {
-				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
-					literal = false;
-				} else {
-					checkLiteral();
-				}
-			} else {
-				switch (format.charAt(iFormat)) {
-					case "d":
-						day = getNumber("d");
-						break;
-					case "D":
-						getName("D", dayNamesShort, dayNames);
-						break;
-					case "o":
-						doy = getNumber("o");
-						break;
-					case "m":
-						month = getNumber("m");
-						break;
-					case "M":
-						month = getName("M", monthNamesShort, monthNames);
-						break;
-					case "y":
-						year = getNumber("y");
-						break;
-					case "@":
-						date = new Date(getNumber("@"));
-						year = date.getFullYear();
-						month = date.getMonth() + 1;
-						day = date.getDate();
-						break;
-					case "!":
-						date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
-						year = date.getFullYear();
-						month = date.getMonth() + 1;
-						day = date.getDate();
+						return false; // don't submit the form
+				case 27: $.datepicker._hideDatepicker();
+						break; // hide on escape
+				case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+							-$.datepicker._get(inst, "stepBigMonths") :
+							-$.datepicker._get(inst, "stepMonths")), "M");
+						break; // previous month/year on page up/+ ctrl
+				case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+							+$.datepicker._get(inst, "stepBigMonths") :
+							+$.datepicker._get(inst, "stepMonths")), "M");
+						break; // next month/year on page down/+ ctrl
+				case 35: if (event.ctrlKey || event.metaKey) {
+							$.datepicker._clearDate(event.target);
+						}
+						handled = event.ctrlKey || event.metaKey;
+						break; // clear on ctrl or command +end
+				case 36: if (event.ctrlKey || event.metaKey) {
+							$.datepicker._gotoToday(event.target);
+						}
+						handled = event.ctrlKey || event.metaKey;
+						break; // current on ctrl or command +home
+				case 37: if (event.ctrlKey || event.metaKey) {
+							$.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
+						}
+						handled = event.ctrlKey || event.metaKey;
+						// -1 day on ctrl or command +left
+						if (event.originalEvent.altKey) {
+							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
+								-$.datepicker._get(inst, "stepBigMonths") :
+								-$.datepicker._get(inst, "stepMonths")), "M");
+						}
+						// next month/year on alt +left on Mac
 						break;
-					case "'":
-						if (lookAhead("'")){
-							checkLiteral();
-						} else {
-							literal = true;
+				case 38: if (event.ctrlKey || event.metaKey) {
+							$.datepicker._adjustDate(event.target, -7, "D");
+						}
+						handled = event.ctrlKey || event.metaKey;
+						break; // -1 week on ctrl or command +up
+				case 39: if (event.ctrlKey || event.metaKey) {
+							$.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
+						}
+						handled = event.ctrlKey || event.metaKey;
+						// +1 day on ctrl or command +right
+						if (event.originalEvent.altKey) {
+							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
+								+$.datepicker._get(inst, "stepBigMonths") :
+								+$.datepicker._get(inst, "stepMonths")), "M");
 						}
+						// next month/year on alt +right
 						break;
-					default:
-						checkLiteral();
-				}
-			}
-		}
-
-		if (iValue < value.length){
-			extra = value.substr(iValue);
-			if (!/^\s+/.test(extra)) {
-				throw "Extra/unparsed characters found in date: " + extra;
+				case 40: if (event.ctrlKey || event.metaKey) {
+							$.datepicker._adjustDate(event.target, +7, "D");
+						}
+						handled = event.ctrlKey || event.metaKey;
+						break; // +1 week on ctrl or command +down
+				default: handled = false;
 			}
+		} else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
+			$.datepicker._showDatepicker(this);
+		} else {
+			handled = false;
 		}
 
-		if (year === -1) {
-			year = new Date().getFullYear();
-		} else if (year < 100) {
-			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
-				(year <= shortYearCutoff ? 0 : -100);
+		if (handled) {
+			event.preventDefault();
+			event.stopPropagation();
 		}
+	},
 
-		if (doy > -1) {
-			month = 1;
-			day = doy;
-			do {
-				dim = this._getDaysInMonth(year, month - 1);
-				if (day <= dim) {
-					break;
-				}
-				month++;
-				day -= dim;
-			} while (true);
-		}
+	/* Filter entered characters - based on date format. */
+	_doKeyPress: function(event) {
+		var chars, chr,
+			inst = $.datepicker._getInst(event.target);
 
-		date = this._daylightSavingAdjust(new Date(year, month - 1, day));
-		if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
-			throw "Invalid date"; // E.g. 31/02/00
+		if ($.datepicker._get(inst, "constrainInput")) {
+			chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
+			chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
+			return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
 		}
-		return date;
 	},
 
-	/* Standard date formats. */
-	ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
-	COOKIE: "D, dd M yy",
-	ISO_8601: "yy-mm-dd",
-	RFC_822: "D, d M y",
-	RFC_850: "DD, dd-M-y",
-	RFC_1036: "D, d M y",
-	RFC_1123: "D, d M yy",
-	RFC_2822: "D, d M yy",
-	RSS: "D, d M y", // RFC 822
-	TICKS: "!",
-	TIMESTAMP: "@",
-	W3C: "yy-mm-dd", // ISO 8601
+	/* Synchronise manual entry and field/alternate field. */
+	_doKeyUp: function(event) {
+		var date,
+			inst = $.datepicker._getInst(event.target);
 
-	_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
-		Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
+		if (inst.input.val() !== inst.lastVal) {
+			try {
+				date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
+					(inst.input ? inst.input.val() : null),
+					$.datepicker._getFormatConfig(inst));
 
-	/* Format a date object into a string value.
-	 * The format can be combinations of the following:
-	 * d  - day of month (no leading zero)
-	 * dd - day of month (two digit)
-	 * o  - day of year (no leading zeros)
-	 * oo - day of year (three digit)
-	 * D  - day name short
-	 * DD - day name long
-	 * m  - month of year (no leading zero)
-	 * mm - month of year (two digit)
-	 * M  - month name short
-	 * MM - month name long
-	 * y  - year (two digit)
-	 * yy - year (four digit)
-	 * @ - Unix timestamp (ms since 01/01/1970)
-	 * ! - Windows ticks (100ns since 01/01/0001)
-	 * "..." - literal text
-	 * '' - single quote
-	 *
-	 * @param  format string - the desired format of the date
-	 * @param  date Date - the date value to format
-	 * @param  settings Object - attributes include:
-	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
-	 *					dayNames		string[7] - names of the days from Sunday (optional)
-	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
-	 *					monthNames		string[12] - names of the months (optional)
-	 * @return  string - the date in the above format
+				if (date) { // only if valid
+					$.datepicker._setDateFromField(inst);
+					$.datepicker._updateAlternate(inst);
+					$.datepicker._updateDatepicker(inst);
+				}
+			}
+			catch (err) {
+			}
+		}
+		return true;
+	},
+
+	/* Pop-up the date picker for a given input field.
+	 * If false returned from beforeShow event handler do not show.
+	 * @param  input  element - the input field attached to the date picker or
+	 *					event - if triggered by focus
 	 */
-	formatDate: function (format, date, settings) {
-		if (!date) {
-			return "";
+	_showDatepicker: function(input) {
+		input = input.target || input;
+		if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
+			input = $("input", input.parentNode)[0];
 		}
 
-		var iFormat,
-			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
-			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
-			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
-			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
-			// Check whether a format character is doubled
-			lookAhead = function(match) {
-				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
-				if (matches) {
-					iFormat++;
-				}
-				return matches;
-			},
-			// Format a number, with leading zero if necessary
-			formatNumber = function(match, value, len) {
-				var num = "" + value;
-				if (lookAhead(match)) {
-					while (num.length < len) {
-						num = "0" + num;
-					}
-				}
-				return num;
-			},
-			// Format a name, short or long as requested
-			formatName = function(match, value, shortNames, longNames) {
-				return (lookAhead(match) ? longNames[value] : shortNames[value]);
-			},
-			output = "",
-			literal = false;
-
-		if (date) {
-			for (iFormat = 0; iFormat < format.length; iFormat++) {
-				if (literal) {
-					if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
-						literal = false;
-					} else {
-						output += format.charAt(iFormat);
-					}
-				} else {
-					switch (format.charAt(iFormat)) {
-						case "d":
-							output += formatNumber("d", date.getDate(), 2);
-							break;
-						case "D":
-							output += formatName("D", date.getDay(), dayNamesShort, dayNames);
-							break;
-						case "o":
-							output += formatNumber("o",
-								Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
-							break;
-						case "m":
-							output += formatNumber("m", date.getMonth() + 1, 2);
-							break;
-						case "M":
-							output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
-							break;
-						case "y":
-							output += (lookAhead("y") ? date.getFullYear() :
-								(date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
-							break;
-						case "@":
-							output += date.getTime();
-							break;
-						case "!":
-							output += date.getTime() * 10000 + this._ticksTo1970;
-							break;
-						case "'":
-							if (lookAhead("'")) {
-								output += "'";
-							} else {
-								literal = true;
-							}
-							break;
-						default:
-							output += format.charAt(iFormat);
-					}
-				}
-			}
+		if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
+			return;
 		}
-		return output;
-	},
 
-	/* Extract all possible characters from the date format. */
-	_possibleChars: function (format) {
-		var iFormat,
-			chars = "",
-			literal = false,
-			// Check whether a format character is doubled
-			lookAhead = function(match) {
-				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
-				if (matches) {
-					iFormat++;
-				}
-				return matches;
-			};
+		var inst, beforeShow, beforeShowSettings, isFixed,
+			offset, showAnim, duration;
 
-		for (iFormat = 0; iFormat < format.length; iFormat++) {
-			if (literal) {
-				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
-					literal = false;
-				} else {
-					chars += format.charAt(iFormat);
-				}
-			} else {
-				switch (format.charAt(iFormat)) {
-					case "d": case "m": case "y": case "@":
-						chars += "0123456789";
-						break;
-					case "D": case "M":
-						return null; // Accept anything
-					case "'":
-						if (lookAhead("'")) {
-							chars += "'";
-						} else {
-							literal = true;
-						}
-						break;
-					default:
-						chars += format.charAt(iFormat);
-				}
+		inst = $.datepicker._getInst(input);
+		if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
+			$.datepicker._curInst.dpDiv.stop(true, true);
+			if ( inst && $.datepicker._datepickerShowing ) {
+				$.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
 			}
 		}
-		return chars;
-	},
-
-	/* Get a setting value, defaulting if necessary. */
-	_get: function(inst, name) {
-		return inst.settings[name] !== undefined ?
-			inst.settings[name] : this._defaults[name];
-	},
 
-	/* Parse existing date and initialise date picker. */
-	_setDateFromField: function(inst, noDefault) {
-		if (inst.input.val() === inst.lastVal) {
+		beforeShow = $.datepicker._get(inst, "beforeShow");
+		beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
+		if(beforeShowSettings === false){
 			return;
 		}
+		datepicker_extendRemove(inst.settings, beforeShowSettings);
 
-		var dateFormat = this._get(inst, "dateFormat"),
-			dates = inst.lastVal = inst.input ? inst.input.val() : null,
-			defaultDate = this._getDefaultDate(inst),
-			date = defaultDate,
-			settings = this._getFormatConfig(inst);
+		inst.lastVal = null;
+		$.datepicker._lastInput = input;
+		$.datepicker._setDateFromField(inst);
 
-		try {
-			date = this.parseDate(dateFormat, dates, settings) || defaultDate;
-		} catch (event) {
-			dates = (noDefault ? "" : dates);
+		if ($.datepicker._inDialog) { // hide cursor
+			input.value = "";
+		}
+		if (!$.datepicker._pos) { // position below input
+			$.datepicker._pos = $.datepicker._findPos(input);
+			$.datepicker._pos[1] += input.offsetHeight; // add the height
 		}
-		inst.selectedDay = date.getDate();
-		inst.drawMonth = inst.selectedMonth = date.getMonth();
-		inst.drawYear = inst.selectedYear = date.getFullYear();
-		inst.currentDay = (dates ? date.getDate() : 0);
-		inst.currentMonth = (dates ? date.getMonth() : 0);
-		inst.currentYear = (dates ? date.getFullYear() : 0);
-		this._adjustInstDate(inst);
-	},
 
-	/* Retrieve the default date shown on opening. */
-	_getDefaultDate: function(inst) {
-		return this._restrictMinMax(inst,
-			this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
-	},
+		isFixed = false;
+		$(input).parents().each(function() {
+			isFixed |= $(this).css("position") === "fixed";
+			return !isFixed;
+		});
 
-	/* A date may be specified as an exact value or a relative one. */
-	_determineDate: function(inst, date, defaultDate) {
-		var offsetNumeric = function(offset) {
-				var date = new Date();
-				date.setDate(date.getDate() + offset);
-				return date;
-			},
-			offsetString = function(offset) {
-				try {
-					return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
-						offset, $.datepicker._getFormatConfig(inst));
-				}
-				catch (e) {
-					// Ignore
-				}
+		offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
+		$.datepicker._pos = null;
+		//to avoid flashes on Firefox
+		inst.dpDiv.empty();
+		// determine sizing offscreen
+		inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
+		$.datepicker._updateDatepicker(inst);
+		// fix width for dynamic number of date pickers
+		// and adjust position before showing
+		offset = $.datepicker._checkOffset(inst, offset, isFixed);
+		inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
+			"static" : (isFixed ? "fixed" : "absolute")), display: "none",
+			left: offset.left + "px", top: offset.top + "px"});
 
-				var date = (offset.toLowerCase().match(/^c/) ?
-					$.datepicker._getDate(inst) : null) || new Date(),
-					year = date.getFullYear(),
-					month = date.getMonth(),
-					day = date.getDate(),
-					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
-					matches = pattern.exec(offset);
+		if (!inst.inline) {
+			showAnim = $.datepicker._get(inst, "showAnim");
+			duration = $.datepicker._get(inst, "duration");
+			inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
+			$.datepicker._datepickerShowing = true;
 
-				while (matches) {
-					switch (matches[2] || "d") {
-						case "d" : case "D" :
-							day += parseInt(matches[1],10); break;
-						case "w" : case "W" :
-							day += parseInt(matches[1],10) * 7; break;
-						case "m" : case "M" :
-							month += parseInt(matches[1],10);
-							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
-							break;
-						case "y": case "Y" :
-							year += parseInt(matches[1],10);
-							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
-							break;
-					}
-					matches = pattern.exec(offset);
-				}
-				return new Date(year, month, day);
-			},
-			newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
-				(typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
+			if ( $.effects && $.effects.effect[ showAnim ] ) {
+				inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
+			} else {
+				inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
+			}
 
-		newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
-		if (newDate) {
-			newDate.setHours(0);
-			newDate.setMinutes(0);
-			newDate.setSeconds(0);
-			newDate.setMilliseconds(0);
+			if ( $.datepicker._shouldFocusInput( inst ) ) {
+				inst.input.focus();
+			}
+
+			$.datepicker._curInst = inst;
 		}
-		return this._daylightSavingAdjust(newDate);
 	},
 
-	/* Handle switch to/from daylight saving.
-	 * Hours may be non-zero on daylight saving cut-over:
-	 * > 12 when midnight changeover, but then cannot generate
-	 * midnight datetime, so jump to 1AM, otherwise reset.
-	 * @param  date  (Date) the date to check
-	 * @return  (Date) the corrected date
-	 */
-	_daylightSavingAdjust: function(date) {
-		if (!date) {
-			return null;
-		}
-		date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
-		return date;
-	},
+	/* Generate the date picker content. */
+	_updateDatepicker: function(inst) {
+		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
+		datepicker_instActive = inst; // for delegate hover events
+		inst.dpDiv.empty().append(this._generateHTML(inst));
+		this._attachHandlers(inst);
+		inst.dpDiv.find("." + this._dayOverClass + " a");
 
-	/* Set the date(s) directly. */
-	_setDate: function(inst, date, noChange) {
-		var clear = !date,
-			origMonth = inst.selectedMonth,
-			origYear = inst.selectedYear,
-			newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
+		var origyearshtml,
+			numMonths = this._getNumberOfMonths(inst),
+			cols = numMonths[1],
+			width = 17;
 
-		inst.selectedDay = inst.currentDay = newDate.getDate();
-		inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
-		inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
-		if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
-			this._notifyChange(inst);
+		inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
+		if (cols > 1) {
+			inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
 		}
-		this._adjustInstDate(inst);
-		if (inst.input) {
-			inst.input.val(clear ? "" : this._formatDate(inst));
+		inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
+			"Class"]("ui-datepicker-multi");
+		inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
+			"Class"]("ui-datepicker-rtl");
+
+		if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
+			inst.input.focus();
+		}
+
+		// deffered render of the years select (to avoid flashes on Firefox)
+		if( inst.yearshtml ){
+			origyearshtml = inst.yearshtml;
+			setTimeout(function(){
+				//assure that inst.yearshtml didn't change.
+				if( origyearshtml === inst.yearshtml && inst.yearshtml ){
+					inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
+				}
+				origyearshtml = inst.yearshtml = null;
+			}, 0);
 		}
 	},
 
-	/* Retrieve the date(s) directly. */
-	_getDate: function(inst) {
-		var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
-			this._daylightSavingAdjust(new Date(
-			inst.currentYear, inst.currentMonth, inst.currentDay)));
-			return startDate;
+	// #6694 - don't focus the input if it's already focused
+	// this breaks the change event in IE
+	// Support: IE and jQuery <1.9
+	_shouldFocusInput: function( inst ) {
+		return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
 	},
 
-	/* Attach the onxxx handlers.  These are declared statically so
-	 * they work with static code transformers like Caja.
-	 */
-	_attachHandlers: function(inst) {
-		var stepMonths = this._get(inst, "stepMonths"),
-			id = "#" + inst.id.replace( /\\\\/g, "\\" );
-		inst.dpDiv.find("[data-handler]").map(function () {
-			var handler = {
-				prev: function () {
-					$.datepicker._adjustDate(id, -stepMonths, "M");
-				},
-				next: function () {
-					$.datepicker._adjustDate(id, +stepMonths, "M");
-				},
-				hide: function () {
-					$.datepicker._hideDatepicker();
-				},
-				today: function () {
-					$.datepicker._gotoToday(id);
-				},
-				selectDay: function () {
-					$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
-					return false;
-				},
-				selectMonth: function () {
-					$.datepicker._selectMonthYear(id, this, "M");
-					return false;
-				},
-				selectYear: function () {
-					$.datepicker._selectMonthYear(id, this, "Y");
-					return false;
-				}
-			};
-			$(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
-		});
+	/* Check positioning to remain on screen. */
+	_checkOffset: function(inst, offset, isFixed) {
+		var dpWidth = inst.dpDiv.outerWidth(),
+			dpHeight = inst.dpDiv.outerHeight(),
+			inputWidth = inst.input ? inst.input.outerWidth() : 0,
+			inputHeight = inst.input ? inst.input.outerHeight() : 0,
+			viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
+			viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
+
+		offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
+		offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
+		offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
+
+		// now check if datepicker is showing outside window viewport - move to a better place if so.
+		offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
+			Math.abs(offset.left + dpWidth - viewWidth) : 0);
+		offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
+			Math.abs(dpHeight + inputHeight) : 0);
+
+		return offset;
 	},
 
-	/* Generate the HTML for the current state of the date picker. */
-	_generateHTML: function(inst) {
-		var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
-			controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
-			monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
-			selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
-			cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
-			printDate, dRow, tbody, daySettings, otherMonth, unselectable,
-			tempDate = new Date(),
-			today = this._daylightSavingAdjust(
-				new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
-			isRTL = this._get(inst, "isRTL"),
-			showButtonPanel = this._get(inst, "showButtonPanel"),
-			hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
-			navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
-			numMonths = this._getNumberOfMonths(inst),
-			showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
-			stepMonths = this._get(inst, "stepMonths"),
-			isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
-			currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
-				new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
-			minDate = this._getMinMaxDate(inst, "min"),
-			maxDate = this._getMinMaxDate(inst, "max"),
-			drawMonth = inst.drawMonth - showCurrentAtPos,
-			drawYear = inst.drawYear;
+	/* Find an object's position on the screen. */
+	_findPos: function(obj) {
+		var position,
+			inst = this._getInst(obj),
+			isRTL = this._get(inst, "isRTL");
 
-		if (drawMonth < 0) {
-			drawMonth += 12;
-			drawYear--;
+		while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
+			obj = obj[isRTL ? "previousSibling" : "nextSibling"];
 		}
-		if (maxDate) {
-			maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
-				maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
-			maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
-			while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
-				drawMonth--;
-				if (drawMonth < 0) {
-					drawMonth = 11;
-					drawYear--;
-				}
-			}
+
+		position = $(obj).offset();
+		return [position.left, position.top];
+	},
+
+	/* Hide the date picker from view.
+	 * @param  input  element - the input field attached to the date picker
+	 */
+	_hideDatepicker: function(input) {
+		var showAnim, duration, postProcess, onClose,
+			inst = this._curInst;
+
+		if (!inst || (input && inst !== $.data(input, "datepicker"))) {
+			return;
 		}
-		inst.drawMonth = drawMonth;
-		inst.drawYear = drawYear;
 
-		prevText = this._get(inst, "prevText");
-		prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
-			this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
-			this._getFormatConfig(inst)));
+		if (this._datepickerShowing) {
+			showAnim = this._get(inst, "showAnim");
+			duration = this._get(inst, "duration");
+			postProcess = function() {
+				$.datepicker._tidyDialog(inst);
+			};
 
-		prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
-			"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
-			" title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
-			(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>"));
+			// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
+			if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
+				inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
+			} else {
+				inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
+					(showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
+			}
 
-		nextText = this._get(inst, "nextText");
-		nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
-			this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
-			this._getFormatConfig(inst)));
+			if (!showAnim) {
+				postProcess();
+			}
+			this._datepickerShowing = false;
 
-		next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
-			"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
-			" title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
-			(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>"));
+			onClose = this._get(inst, "onClose");
+			if (onClose) {
+				onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
+			}
 
-		currentText = this._get(inst, "currentText");
-		gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
-		currentText = (!navigationAsDateFormat ? currentText :
-			this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
+			this._lastInput = null;
+			if (this._inDialog) {
+				this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
+				if ($.blockUI) {
+					$.unblockUI();
+					$("body").append(this.dpDiv);
+				}
+			}
+			this._inDialog = false;
+		}
+	},
 
-		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'>" +
-			this._get(inst, "closeText") + "</button>" : "");
+	/* Tidy up after a dialog display. */
+	_tidyDialog: function(inst) {
+		inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
+	},
 
-		buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
-			(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'" +
-			">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
+	/* Close date picker if clicked elsewhere. */
+	_checkExternalClick: function(event) {
+		if (!$.datepicker._curInst) {
+			return;
+		}
 
-		firstDay = parseInt(this._get(inst, "firstDay"),10);
-		firstDay = (isNaN(firstDay) ? 0 : firstDay);
+		var $target = $(event.target),
+			inst = $.datepicker._getInst($target[0]);
 
-		showWeek = this._get(inst, "showWeek");
-		dayNames = this._get(inst, "dayNames");
-		dayNamesMin = this._get(inst, "dayNamesMin");
-		monthNames = this._get(inst, "monthNames");
-		monthNamesShort = this._get(inst, "monthNamesShort");
-		beforeShowDay = this._get(inst, "beforeShowDay");
-		showOtherMonths = this._get(inst, "showOtherMonths");
-		selectOtherMonths = this._get(inst, "selectOtherMonths");
-		defaultDate = this._getDefaultDate(inst);
-		html = "";
-		dow;
-		for (row = 0; row < numMonths[0]; row++) {
-			group = "";
-			this.maxRows = 4;
-			for (col = 0; col < numMonths[1]; col++) {
-				selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
-				cornerClass = " ui-corner-all";
-				calender = "";
-				if (isMultiMonth) {
-					calender += "<div class='ui-datepicker-group";
-					if (numMonths[1] > 1) {
-						switch (col) {
-							case 0: calender += " ui-datepicker-group-first";
-								cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
-							case numMonths[1]-1: calender += " ui-datepicker-group-last";
-								cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
-							default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
-						}
-					}
-					calender += "'>";
-				}
-				calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
-					(/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
-					(/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
-					this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
-					row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
-					"</div><table class='ui-datepicker-calendar'><thead>" +
-					"<tr>";
-				thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
-				for (dow = 0; dow < 7; dow++) { // days of the week
-					day = (dow + firstDay) % 7;
-					thead += "<th" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
-						"<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
-				}
-				calender += thead + "</tr></thead><tbody>";
-				daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
-				if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
-					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
-				}
-				leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
-				curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
-				numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
-				this.maxRows = numRows;
-				printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
-				for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
-					calender += "<tr>";
-					tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
-						this._get(inst, "calculateWeek")(printDate) + "</td>");
-					for (dow = 0; dow < 7; dow++) { // create date picker days
-						daySettings = (beforeShowDay ?
-							beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
-						otherMonth = (printDate.getMonth() !== drawMonth);
-						unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
-							(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
-						tbody += "<td class='" +
-							((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
-							(otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
-							((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
-							(defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
-							// or defaultDate is current printedDate and defaultDate is selectedDate
-							" " + this._dayOverClass : "") + // highlight selected day
-							(unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") +  // highlight unselectable days
-							(otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
-							(printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
-							(printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
-							((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
-							(unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
-							(otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
-							(unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
-							(printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
-							(printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
-							(otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
-							"' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
-						printDate.setDate(printDate.getDate() + 1);
-						printDate = this._daylightSavingAdjust(printDate);
-					}
-					calender += tbody + "</tr>";
-				}
-				drawMonth++;
-				if (drawMonth > 11) {
-					drawMonth = 0;
-					drawYear++;
-				}
-				calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
-							((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
-				group += calender;
-			}
-			html += group;
+		if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
+				$target.parents("#" + $.datepicker._mainDivId).length === 0 &&
+				!$target.hasClass($.datepicker.markerClassName) &&
+				!$target.closest("." + $.datepicker._triggerClass).length &&
+				$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
+			( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
+				$.datepicker._hideDatepicker();
 		}
-		html += buttonPanel;
-		inst._keyEvent = false;
-		return html;
 	},
 
-	/* Generate the month and year header. */
-	_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
-			secondary, monthNames, monthNamesShort) {
-
-		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
-			changeMonth = this._get(inst, "changeMonth"),
-			changeYear = this._get(inst, "changeYear"),
-			showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
-			html = "<div class='ui-datepicker-title'>",
-			monthHtml = "";
-
-		// month selection
-		if (secondary || !changeMonth) {
-			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
-		} else {
-			inMinYear = (minDate && minDate.getFullYear() === drawYear);
-			inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
-			monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
-			for ( month = 0; month < 12; month++) {
-				if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
-					monthHtml += "<option value='" + month + "'" +
-						(month === drawMonth ? " selected='selected'" : "") +
-						">" + monthNamesShort[month] + "</option>";
-				}
-			}
-			monthHtml += "</select>";
-		}
+	/* Adjust one of the date sub-fields. */
+	_adjustDate: function(id, offset, period) {
+		var target = $(id),
+			inst = this._getInst(target[0]);
 
-		if (!showMonthAfterYear) {
-			html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
+		if (this._isDisabledDatepicker(target[0])) {
+			return;
 		}
+		this._adjustInstDate(inst, offset +
+			(period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
+			period);
+		this._updateDatepicker(inst);
+	},
 
-		// year selection
-		if ( !inst.yearshtml ) {
-			inst.yearshtml = "";
-			if (secondary || !changeYear) {
-				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
-			} else {
-				// determine range of years to display
-				years = this._get(inst, "yearRange").split(":");
-				thisYear = new Date().getFullYear();
-				determineYear = function(value) {
-					var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
-						(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
-						parseInt(value, 10)));
-					return (isNaN(year) ? thisYear : year);
-				};
-				year = determineYear(years[0]);
-				endYear = Math.max(year, determineYear(years[1] || ""));
-				year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
-				endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
-				inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
-				for (; year <= endYear; year++) {
-					inst.yearshtml += "<option value='" + year + "'" +
-						(year === drawYear ? " selected='selected'" : "") +
-						">" + year + "</option>";
-				}
-				inst.yearshtml += "</select>";
-
-				html += inst.yearshtml;
-				inst.yearshtml = null;
-			}
-		}
+	/* Action for current link. */
+	_gotoToday: function(id) {
+		var date,
+			target = $(id),
+			inst = this._getInst(target[0]);
 
-		html += this._get(inst, "yearSuffix");
-		if (showMonthAfterYear) {
-			html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
+		if (this._get(inst, "gotoCurrent") && inst.currentDay) {
+			inst.selectedDay = inst.currentDay;
+			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
+			inst.drawYear = inst.selectedYear = inst.currentYear;
+		} else {
+			date = new Date();
+			inst.selectedDay = date.getDate();
+			inst.drawMonth = inst.selectedMonth = date.getMonth();
+			inst.drawYear = inst.selectedYear = date.getFullYear();
 		}
-		html += "</div>"; // Close datepicker_header
-		return html;
+		this._notifyChange(inst);
+		this._adjustDate(target);
 	},
 
-	/* Adjust one of the date sub-fields. */
-	_adjustInstDate: function(inst, offset, period) {
-		var year = inst.drawYear + (period === "Y" ? offset : 0),
-			month = inst.drawMonth + (period === "M" ? offset : 0),
-			day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
-			date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
+	/* Action for selecting a new month/year. */
+	_selectMonthYear: function(id, select, period) {
+		var target = $(id),
+			inst = this._getInst(target[0]);
 
-		inst.selectedDay = date.getDate();
-		inst.drawMonth = inst.selectedMonth = date.getMonth();
-		inst.drawYear = inst.selectedYear = date.getFullYear();
-		if (period === "M" || period === "Y") {
-			this._notifyChange(inst);
-		}
-	},
+		inst["selected" + (period === "M" ? "Month" : "Year")] =
+		inst["draw" + (period === "M" ? "Month" : "Year")] =
+			parseInt(select.options[select.selectedIndex].value,10);
 
-	/* Ensure a date is within any min/max bounds. */
-	_restrictMinMax: function(inst, date) {
-		var minDate = this._getMinMaxDate(inst, "min"),
-			maxDate = this._getMinMaxDate(inst, "max"),
-			newDate = (minDate && date < minDate ? minDate : date);
-		return (maxDate && newDate > maxDate ? maxDate : newDate);
+		this._notifyChange(inst);
+		this._adjustDate(target);
 	},
 
-	/* Notify change of month/year. */
-	_notifyChange: function(inst) {
-		var onChange = this._get(inst, "onChangeMonthYear");
-		if (onChange) {
-			onChange.apply((inst.input ? inst.input[0] : null),
-				[inst.selectedYear, inst.selectedMonth + 1, inst]);
+	/* Action for selecting a day. */
+	_selectDay: function(id, month, year, td) {
+		var inst,
+			target = $(id);
+
+		if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
+			return;
 		}
-	},
 
-	/* Determine the number of months to show. */
-	_getNumberOfMonths: function(inst) {
-		var numMonths = this._get(inst, "numberOfMonths");
-		return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
+		inst = this._getInst(target[0]);
+		inst.selectedDay = inst.currentDay = $("a", td).html();
+		inst.selectedMonth = inst.currentMonth = month;
+		inst.selectedYear = inst.currentYear = year;
+		this._selectDate(id, this._formatDate(inst,
+			inst.currentDay, inst.currentMonth, inst.currentYear));
 	},
 
-	/* Determine the current maximum date - ensure no time components are set. */
-	_getMinMaxDate: function(inst, minMax) {
-		return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
+	/* Erase the input field and hide the date picker. */
+	_clearDate: function(id) {
+		var target = $(id);
+		this._selectDate(target, "");
 	},
 
-	/* Find the number of days in a given month. */
-	_getDaysInMonth: function(year, month) {
-		return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
-	},
+	/* Update the input field with the selected date. */
+	_selectDate: function(id, dateStr) {
+		var onSelect,
+			target = $(id),
+			inst = this._getInst(target[0]);
 
-	/* Find the day of the week of the first of a month. */
-	_getFirstDayOfMonth: function(year, month) {
-		return new Date(year, month, 1).getDay();
-	},
+		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
+		if (inst.input) {
+			inst.input.val(dateStr);
+		}
+		this._updateAlternate(inst);
 
-	/* Determines if we should allow a "next/prev" month display change. */
-	_canAdjustMonth: function(inst, offset, curYear, curMonth) {
-		var numMonths = this._getNumberOfMonths(inst),
-			date = this._daylightSavingAdjust(new Date(curYear,
-			curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
+		onSelect = this._get(inst, "onSelect");
+		if (onSelect) {
+			onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
+		} else if (inst.input) {
+			inst.input.trigger("change"); // fire the change event
+		}
 
-		if (offset < 0) {
-			date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
+		if (inst.inline){
+			this._updateDatepicker(inst);
+		} else {
+			this._hideDatepicker();
+			this._lastInput = inst.input[0];
+			if (typeof(inst.input[0]) !== "object") {
+				inst.input.focus(); // restore focus
+			}
+			this._lastInput = null;
 		}
-		return this._isInRange(inst, date);
 	},
 
-	/* Is the given date in the accepted range? */
-	_isInRange: function(inst, date) {
-		var yearSplit, currentYear,
-			minDate = this._getMinMaxDate(inst, "min"),
-			maxDate = this._getMinMaxDate(inst, "max"),
-			minYear = null,
-			maxYear = null,
-			years = this._get(inst, "yearRange");
-			if (years){
-				yearSplit = years.split(":");
-				currentYear = new Date().getFullYear();
-				minYear = parseInt(yearSplit[0], 10);
-				maxYear = parseInt(yearSplit[1], 10);
-				if ( yearSplit[0].match(/[+\-].*/) ) {
-					minYear += currentYear;
-				}
-				if ( yearSplit[1].match(/[+\-].*/) ) {
-					maxYear += currentYear;
-				}
-			}
+	/* Update any alternate field to synchronise with the main field. */
+	_updateAlternate: function(inst) {
+		var altFormat, date, dateStr,
+			altField = this._get(inst, "altField");
 
-		return ((!minDate || date.getTime() >= minDate.getTime()) &&
-			(!maxDate || date.getTime() <= maxDate.getTime()) &&
-			(!minYear || date.getFullYear() >= minYear) &&
-			(!maxYear || date.getFullYear() <= maxYear));
+		if (altField) { // update alternate field too
+			altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
+			date = this._getDate(inst);
+			dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
+			$(altField).each(function() { $(this).val(dateStr); });
+		}
 	},
 
-	/* Provide the configuration settings for formatting/parsing. */
-	_getFormatConfig: function(inst) {
-		var shortYearCutoff = this._get(inst, "shortYearCutoff");
-		shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
-			new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
-		return {shortYearCutoff: shortYearCutoff,
-			dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
-			monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
+	/* Set as beforeShowDay function to prevent selection of weekends.
+	 * @param  date  Date - the date to customise
+	 * @return [boolean, string] - is this date selectable?, what is its CSS class?
+	 */
+	noWeekends: function(date) {
+		var day = date.getDay();
+		return [(day > 0 && day < 6), ""];
 	},
 
-	/* Format the given date for display. */
-	_formatDate: function(inst, day, month, year) {
-		if (!day) {
-			inst.currentDay = inst.selectedDay;
-			inst.currentMonth = inst.selectedMonth;
-			inst.currentYear = inst.selectedYear;
-		}
-		var date = (day ? (typeof day === "object" ? day :
-			this._daylightSavingAdjust(new Date(year, month, day))) :
-			this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
-		return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
-	}
-});
+	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
+	 * @param  date  Date - the date to get the week for
+	 * @return  number - the number of the week within the year that contains this date
+	 */
+	iso8601Week: function(date) {
+		var time,
+			checkDate = new Date(date.getTime());
 
-/*
- * Bind hover events for datepicker elements.
- * Done via delegate so the binding only occurs once in the lifetime of the parent div.
- * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
- */
-function bindHover(dpDiv) {
-	var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
-	return dpDiv.delegate(selector, "mouseout", function() {
-			$(this).removeClass("ui-state-hover");
-			if (this.className.indexOf("ui-datepicker-prev") !== -1) {
-				$(this).removeClass("ui-datepicker-prev-hover");
-			}
-			if (this.className.indexOf("ui-datepicker-next") !== -1) {
-				$(this).removeClass("ui-datepicker-next-hover");
-			}
-		})
-		.delegate(selector, "mouseover", function(){
-			if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) {
-				$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
-				$(this).addClass("ui-state-hover");
-				if (this.className.indexOf("ui-datepicker-prev") !== -1) {
-					$(this).addClass("ui-datepicker-prev-hover");
-				}
-				if (this.className.indexOf("ui-datepicker-next") !== -1) {
-					$(this).addClass("ui-datepicker-next-hover");
-				}
-			}
-		});
-}
+		// Find Thursday of this week starting on Monday
+		checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
 
-/* jQuery extend now ignores nulls! */
-function extendRemove(target, props) {
-	$.extend(target, props);
-	for (var name in props) {
-		if (props[name] == null) {
-			target[name] = props[name];
-		}
-	}
-	return target;
-}
+		time = checkDate.getTime();
+		checkDate.setMonth(0); // Compare with Jan 1
+		checkDate.setDate(1);
+		return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
+	},
 
-/* Invoke the datepicker functionality.
-   @param  options  string - a command, optionally followed by additional parameters or
-					Object - settings for attaching new datepicker functionality
-   @return  jQuery object */
-$.fn.datepicker = function(options){
+	/* Parse a string value into a date object.
+	 * See formatDate below for the possible formats.
+	 *
+	 * @param  format string - the expected format of the date
+	 * @param  value string - the date in the above format
+	 * @param  settings Object - attributes include:
+	 *					shortYearCutoff  number - the cutoff year for determining the century (optional)
+	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
+	 *					dayNames		string[7] - names of the days from Sunday (optional)
+	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
+	 *					monthNames		string[12] - names of the months (optional)
+	 * @return  Date - the extracted date value or null if value is blank
+	 */
+	parseDate: function (format, value, settings) {
+		if (format == null || value == null) {
+			throw "Invalid arguments";
+		}
 
-	/* Verify an empty collection wasn't passed - Fixes #6976 */
-	if ( !this.length ) {
-		return this;
-	}
+		value = (typeof value === "object" ? value.toString() : value + "");
+		if (value === "") {
+			return null;
+		}
 
-	/* Initialise the date picker. */
-	if (!$.datepicker.initialized) {
-		$(document).mousedown($.datepicker._checkExternalClick);
-		$.datepicker.initialized = true;
-	}
+		var iFormat, dim, extra,
+			iValue = 0,
+			shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
+			shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
+				new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
+			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
+			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
+			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
+			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
+			year = -1,
+			month = -1,
+			day = -1,
+			doy = -1,
+			literal = false,
+			date,
+			// Check whether a format character is doubled
+			lookAhead = function(match) {
+				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+				if (matches) {
+					iFormat++;
+				}
+				return matches;
+			},
+			// Extract a number from the string value
+			getNumber = function(match) {
+				var isDoubled = lookAhead(match),
+					size = (match === "@" ? 14 : (match === "!" ? 20 :
+					(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
+					digits = new RegExp("^\\d{1," + size + "}"),
+					num = value.substring(iValue).match(digits);
+				if (!num) {
+					throw "Missing number at position " + iValue;
+				}
+				iValue += num[0].length;
+				return parseInt(num[0], 10);
+			},
+			// Extract a name from the string value and convert to an index
+			getName = function(match, shortNames, longNames) {
+				var index = -1,
+					names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
+						return [ [k, v] ];
+					}).sort(function (a, b) {
+						return -(a[1].length - b[1].length);
+					});
 
-	/* Append datepicker main container to body if not exist. */
-	if ($("#"+$.datepicker._mainDivId).length === 0) {
-		$("body").append($.datepicker.dpDiv);
-	}
+				$.each(names, function (i, pair) {
+					var name = pair[1];
+					if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
+						index = pair[0];
+						iValue += name.length;
+						return false;
+					}
+				});
+				if (index !== -1) {
+					return index + 1;
+				} else {
+					throw "Unknown name at position " + iValue;
+				}
+			},
+			// Confirm that a literal character matches the string value
+			checkLiteral = function() {
+				if (value.charAt(iValue) !== format.charAt(iFormat)) {
+					throw "Unexpected literal at position " + iValue;
+				}
+				iValue++;
+			};
 
-	var otherArgs = Array.prototype.slice.call(arguments, 1);
-	if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
-		return $.datepicker["_" + options + "Datepicker"].
-			apply($.datepicker, [this[0]].concat(otherArgs));
-	}
-	if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
-		return $.datepicker["_" + options + "Datepicker"].
-			apply($.datepicker, [this[0]].concat(otherArgs));
-	}
-	return this.each(function() {
-		typeof options === "string" ?
-			$.datepicker["_" + options + "Datepicker"].
-				apply($.datepicker, [this].concat(otherArgs)) :
-			$.datepicker._attachDatepicker(this, options);
-	});
-};
-
-$.datepicker = new Datepicker(); // singleton instance
-$.datepicker.initialized = false;
-$.datepicker.uuid = new Date().getTime();
-$.datepicker.version = "1.10.4";
-
-})(jQuery);
-(function( $, undefined ) {
-
-var sizeRelatedOptions = {
-		buttons: true,
-		height: true,
-		maxHeight: true,
-		maxWidth: true,
-		minHeight: true,
-		minWidth: true,
-		width: true
-	},
-	resizableRelatedOptions = {
-		maxHeight: true,
-		maxWidth: true,
-		minHeight: true,
-		minWidth: true
-	};
-
-$.widget( "ui.dialog", {
-	version: "1.10.4",
-	options: {
-		appendTo: "body",
-		autoOpen: true,
-		buttons: [],
-		closeOnEscape: true,
-		closeText: "close",
-		dialogClass: "",
-		draggable: true,
-		hide: null,
-		height: "auto",
-		maxHeight: null,
-		maxWidth: null,
-		minHeight: 150,
-		minWidth: 150,
-		modal: false,
-		position: {
-			my: "center",
-			at: "center",
-			of: window,
-			collision: "fit",
-			// Ensure the titlebar is always visible
-			using: function( pos ) {
-				var topOffset = $( this ).css( pos ).offset().top;
-				if ( topOffset < 0 ) {
-					$( this ).css( "top", pos.top - topOffset );
+		for (iFormat = 0; iFormat < format.length; iFormat++) {
+			if (literal) {
+				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+					literal = false;
+				} else {
+					checkLiteral();
+				}
+			} else {
+				switch (format.charAt(iFormat)) {
+					case "d":
+						day = getNumber("d");
+						break;
+					case "D":
+						getName("D", dayNamesShort, dayNames);
+						break;
+					case "o":
+						doy = getNumber("o");
+						break;
+					case "m":
+						month = getNumber("m");
+						break;
+					case "M":
+						month = getName("M", monthNamesShort, monthNames);
+						break;
+					case "y":
+						year = getNumber("y");
+						break;
+					case "@":
+						date = new Date(getNumber("@"));
+						year = date.getFullYear();
+						month = date.getMonth() + 1;
+						day = date.getDate();
+						break;
+					case "!":
+						date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
+						year = date.getFullYear();
+						month = date.getMonth() + 1;
+						day = date.getDate();
+						break;
+					case "'":
+						if (lookAhead("'")){
+							checkLiteral();
+						} else {
+							literal = true;
+						}
+						break;
+					default:
+						checkLiteral();
 				}
 			}
-		},
-		resizable: true,
-		show: null,
-		title: null,
-		width: 300,
-
-		// callbacks
-		beforeClose: null,
-		close: null,
-		drag: null,
-		dragStart: null,
-		dragStop: null,
-		focus: null,
-		open: null,
-		resize: null,
-		resizeStart: null,
-		resizeStop: null
-	},
-
-	_create: function() {
-		this.originalCss = {
-			display: this.element[0].style.display,
-			width: this.element[0].style.width,
-			minHeight: this.element[0].style.minHeight,
-			maxHeight: this.element[0].style.maxHeight,
-			height: this.element[0].style.height
-		};
-		this.originalPosition = {
-			parent: this.element.parent(),
-			index: this.element.parent().children().index( this.element )
-		};
-		this.originalTitle = this.element.attr("title");
-		this.options.title = this.options.title || this.originalTitle;
-
-		this._createWrapper();
-
-		this.element
-			.show()
-			.removeAttr("title")
-			.addClass("ui-dialog-content ui-widget-content")
-			.appendTo( this.uiDialog );
-
-		this._createTitlebar();
-		this._createButtonPane();
-
-		if ( this.options.draggable && $.fn.draggable ) {
-			this._makeDraggable();
-		}
-		if ( this.options.resizable && $.fn.resizable ) {
-			this._makeResizable();
 		}
 
-		this._isOpen = false;
-	},
-
-	_init: function() {
-		if ( this.options.autoOpen ) {
-			this.open();
+		if (iValue < value.length){
+			extra = value.substr(iValue);
+			if (!/^\s+/.test(extra)) {
+				throw "Extra/unparsed characters found in date: " + extra;
+			}
 		}
-	},
 
-	_appendTo: function() {
-		var element = this.options.appendTo;
-		if ( element && (element.jquery || element.nodeType) ) {
-			return $( element );
+		if (year === -1) {
+			year = new Date().getFullYear();
+		} else if (year < 100) {
+			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
+				(year <= shortYearCutoff ? 0 : -100);
 		}
-		return this.document.find( element || "body" ).eq( 0 );
-	},
-
-	_destroy: function() {
-		var next,
-			originalPosition = this.originalPosition;
-
-		this._destroyOverlay();
-
-		this.element
-			.removeUniqueId()
-			.removeClass("ui-dialog-content ui-widget-content")
-			.css( this.originalCss )
-			// Without detaching first, the following becomes really slow
-			.detach();
-
-		this.uiDialog.stop( true, true ).remove();
 
-		if ( this.originalTitle ) {
-			this.element.attr( "title", this.originalTitle );
+		if (doy > -1) {
+			month = 1;
+			day = doy;
+			do {
+				dim = this._getDaysInMonth(year, month - 1);
+				if (day <= dim) {
+					break;
+				}
+				month++;
+				day -= dim;
+			} while (true);
 		}
 
-		next = originalPosition.parent.children().eq( originalPosition.index );
-		// Don't try to place the dialog next to itself (#8613)
-		if ( next.length && next[0] !== this.element[0] ) {
-			next.before( this.element );
-		} else {
-			originalPosition.parent.append( this.element );
+		date = this._daylightSavingAdjust(new Date(year, month - 1, day));
+		if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
+			throw "Invalid date"; // E.g. 31/02/00
 		}
+		return date;
 	},
 
-	widget: function() {
-		return this.uiDialog;
-	},
-
-	disable: $.noop,
-	enable: $.noop,
-
-	close: function( event ) {
-		var activeElement,
-			that = this;
-
-		if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
-			return;
-		}
-
-		this._isOpen = false;
-		this._destroyOverlay();
-
-		if ( !this.opener.filter(":focusable").focus().length ) {
-
-			// support: IE9
-			// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
-			try {
-				activeElement = this.document[ 0 ].activeElement;
-
-				// Support: IE9, IE10
-				// If the <body> is blurred, IE will switch windows, see #4520
-				if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) {
+	/* Standard date formats. */
+	ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
+	COOKIE: "D, dd M yy",
+	ISO_8601: "yy-mm-dd",
+	RFC_822: "D, d M y",
+	RFC_850: "DD, dd-M-y",
+	RFC_1036: "D, d M y",
+	RFC_1123: "D, d M yy",
+	RFC_2822: "D, d M yy",
+	RSS: "D, d M y", // RFC 822
+	TICKS: "!",
+	TIMESTAMP: "@",
+	W3C: "yy-mm-dd", // ISO 8601
 
-					// Hiding a focused element doesn't trigger blur in WebKit
-					// so in case we have nothing to focus on, explicitly blur the active element
-					// https://bugs.webkit.org/show_bug.cgi?id=47182
-					$( activeElement ).blur();
-				}
-			} catch ( error ) {}
-		}
+	_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
+		Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
 
-		this._hide( this.uiDialog, this.options.hide, function() {
-			that._trigger( "close", event );
-		});
-	},
-
-	isOpen: function() {
-		return this._isOpen;
-	},
-
-	moveToTop: function() {
-		this._moveToTop();
-	},
-
-	_moveToTop: function( event, silent ) {
-		var moved = !!this.uiDialog.nextAll(":visible").insertBefore( this.uiDialog ).length;
-		if ( moved && !silent ) {
-			this._trigger( "focus", event );
-		}
-		return moved;
-	},
-
-	open: function() {
-		var that = this;
-		if ( this._isOpen ) {
-			if ( this._moveToTop() ) {
-				this._focusTabbable();
-			}
-			return;
+	/* Format a date object into a string value.
+	 * The format can be combinations of the following:
+	 * d  - day of month (no leading zero)
+	 * dd - day of month (two digit)
+	 * o  - day of year (no leading zeros)
+	 * oo - day of year (three digit)
+	 * D  - day name short
+	 * DD - day name long
+	 * m  - month of year (no leading zero)
+	 * mm - month of year (two digit)
+	 * M  - month name short
+	 * MM - month name long
+	 * y  - year (two digit)
+	 * yy - year (four digit)
+	 * @ - Unix timestamp (ms since 01/01/1970)
+	 * ! - Windows ticks (100ns since 01/01/0001)
+	 * "..." - literal text
+	 * '' - single quote
+	 *
+	 * @param  format string - the desired format of the date
+	 * @param  date Date - the date value to format
+	 * @param  settings Object - attributes include:
+	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
+	 *					dayNames		string[7] - names of the days from Sunday (optional)
+	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
+	 *					monthNames		string[12] - names of the months (optional)
+	 * @return  string - the date in the above format
+	 */
+	formatDate: function (format, date, settings) {
+		if (!date) {
+			return "";
 		}
 
-		this._isOpen = true;
-		this.opener = $( this.document[0].activeElement );
-
-		this._size();
-		this._position();
-		this._createOverlay();
-		this._moveToTop( null, true );
-		this._show( this.uiDialog, this.options.show, function() {
-			that._focusTabbable();
-			that._trigger("focus");
-		});
-
-		this._trigger("open");
-	},
-
-	_focusTabbable: function() {
-		// Set focus to the first match:
-		// 1. First element inside the dialog matching [autofocus]
-		// 2. Tabbable element inside the content element
-		// 3. Tabbable element inside the buttonpane
-		// 4. The close button
-		// 5. The dialog itself
-		var hasFocus = this.element.find("[autofocus]");
-		if ( !hasFocus.length ) {
-			hasFocus = this.element.find(":tabbable");
-		}
-		if ( !hasFocus.length ) {
-			hasFocus = this.uiDialogButtonPane.find(":tabbable");
-		}
-		if ( !hasFocus.length ) {
-			hasFocus = this.uiDialogTitlebarClose.filter(":tabbable");
-		}
-		if ( !hasFocus.length ) {
-			hasFocus = this.uiDialog;
-		}
-		hasFocus.eq( 0 ).focus();
-	},
+		var iFormat,
+			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
+			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
+			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
+			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
+			// Check whether a format character is doubled
+			lookAhead = function(match) {
+				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+				if (matches) {
+					iFormat++;
+				}
+				return matches;
+			},
+			// Format a number, with leading zero if necessary
+			formatNumber = function(match, value, len) {
+				var num = "" + value;
+				if (lookAhead(match)) {
+					while (num.length < len) {
+						num = "0" + num;
+					}
+				}
+				return num;
+			},
+			// Format a name, short or long as requested
+			formatName = function(match, value, shortNames, longNames) {
+				return (lookAhead(match) ? longNames[value] : shortNames[value]);
+			},
+			output = "",
+			literal = false;
 
-	_keepFocus: function( event ) {
-		function checkFocus() {
-			var activeElement = this.document[0].activeElement,
-				isActive = this.uiDialog[0] === activeElement ||
-					$.contains( this.uiDialog[0], activeElement );
-			if ( !isActive ) {
-				this._focusTabbable();
+		if (date) {
+			for (iFormat = 0; iFormat < format.length; iFormat++) {
+				if (literal) {
+					if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+						literal = false;
+					} else {
+						output += format.charAt(iFormat);
+					}
+				} else {
+					switch (format.charAt(iFormat)) {
+						case "d":
+							output += formatNumber("d", date.getDate(), 2);
+							break;
+						case "D":
+							output += formatName("D", date.getDay(), dayNamesShort, dayNames);
+							break;
+						case "o":
+							output += formatNumber("o",
+								Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
+							break;
+						case "m":
+							output += formatNumber("m", date.getMonth() + 1, 2);
+							break;
+						case "M":
+							output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
+							break;
+						case "y":
+							output += (lookAhead("y") ? date.getFullYear() :
+								(date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
+							break;
+						case "@":
+							output += date.getTime();
+							break;
+						case "!":
+							output += date.getTime() * 10000 + this._ticksTo1970;
+							break;
+						case "'":
+							if (lookAhead("'")) {
+								output += "'";
+							} else {
+								literal = true;
+							}
+							break;
+						default:
+							output += format.charAt(iFormat);
+					}
+				}
 			}
 		}
-		event.preventDefault();
-		checkFocus.call( this );
-		// support: IE
-		// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
-		// so we check again later
-		this._delay( checkFocus );
+		return output;
 	},
 
-	_createWrapper: function() {
-		this.uiDialog = $("<div>")
-			.addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
-				this.options.dialogClass )
-			.hide()
-			.attr({
-				// Setting tabIndex makes the div focusable
-				tabIndex: -1,
-				role: "dialog"
-			})
-			.appendTo( this._appendTo() );
-
-		this._on( this.uiDialog, {
-			keydown: function( event ) {
-				if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
-						event.keyCode === $.ui.keyCode.ESCAPE ) {
-					event.preventDefault();
-					this.close( event );
-					return;
-				}
-
-				// prevent tabbing out of dialogs
-				if ( event.keyCode !== $.ui.keyCode.TAB ) {
-					return;
+	/* Extract all possible characters from the date format. */
+	_possibleChars: function (format) {
+		var iFormat,
+			chars = "",
+			literal = false,
+			// Check whether a format character is doubled
+			lookAhead = function(match) {
+				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+				if (matches) {
+					iFormat++;
 				}
-				var tabbables = this.uiDialog.find(":tabbable"),
-					first = tabbables.filter(":first"),
-					last  = tabbables.filter(":last");
+				return matches;
+			};
 
-				if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
-					first.focus( 1 );
-					event.preventDefault();
-				} else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
-					last.focus( 1 );
-					event.preventDefault();
+		for (iFormat = 0; iFormat < format.length; iFormat++) {
+			if (literal) {
+				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+					literal = false;
+				} else {
+					chars += format.charAt(iFormat);
 				}
-			},
-			mousedown: function( event ) {
-				if ( this._moveToTop( event ) ) {
-					this._focusTabbable();
+			} else {
+				switch (format.charAt(iFormat)) {
+					case "d": case "m": case "y": case "@":
+						chars += "0123456789";
+						break;
+					case "D": case "M":
+						return null; // Accept anything
+					case "'":
+						if (lookAhead("'")) {
+							chars += "'";
+						} else {
+							literal = true;
+						}
+						break;
+					default:
+						chars += format.charAt(iFormat);
 				}
 			}
-		});
-
-		// We assume that any existing aria-describedby attribute means
-		// that the dialog content is marked up properly
-		// otherwise we brute force the content as the description
-		if ( !this.element.find("[aria-describedby]").length ) {
-			this.uiDialog.attr({
-				"aria-describedby": this.element.uniqueId().attr("id")
-			});
 		}
+		return chars;
 	},
 
-	_createTitlebar: function() {
-		var uiDialogTitle;
+	/* Get a setting value, defaulting if necessary. */
+	_get: function(inst, name) {
+		return inst.settings[name] !== undefined ?
+			inst.settings[name] : this._defaults[name];
+	},
 
-		this.uiDialogTitlebar = $("<div>")
-			.addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix")
-			.prependTo( this.uiDialog );
-		this._on( this.uiDialogTitlebar, {
-			mousedown: function( event ) {
-				// Don't prevent click on close button (#8838)
-				// Focusing a dialog that is partially scrolled out of view
-				// causes the browser to scroll it into view, preventing the click event
-				if ( !$( event.target ).closest(".ui-dialog-titlebar-close") ) {
-					// Dialog isn't getting focus when dragging (#8063)
-					this.uiDialog.focus();
-				}
-			}
-		});
-
-		// support: IE
-		// Use type="button" to prevent enter keypresses in textboxes from closing the
-		// dialog in IE (#9312)
-		this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
-			.button({
-				label: this.options.closeText,
-				icons: {
-					primary: "ui-icon-closethick"
-				},
-				text: false
-			})
-			.addClass("ui-dialog-titlebar-close")
-			.appendTo( this.uiDialogTitlebar );
-		this._on( this.uiDialogTitlebarClose, {
-			click: function( event ) {
-				event.preventDefault();
-				this.close( event );
-			}
-		});
+	/* Parse existing date and initialise date picker. */
+	_setDateFromField: function(inst, noDefault) {
+		if (inst.input.val() === inst.lastVal) {
+			return;
+		}
 
-		uiDialogTitle = $("<span>")
-			.uniqueId()
-			.addClass("ui-dialog-title")
-			.prependTo( this.uiDialogTitlebar );
-		this._title( uiDialogTitle );
+		var dateFormat = this._get(inst, "dateFormat"),
+			dates = inst.lastVal = inst.input ? inst.input.val() : null,
+			defaultDate = this._getDefaultDate(inst),
+			date = defaultDate,
+			settings = this._getFormatConfig(inst);
 
-		this.uiDialog.attr({
-			"aria-labelledby": uiDialogTitle.attr("id")
-		});
+		try {
+			date = this.parseDate(dateFormat, dates, settings) || defaultDate;
+		} catch (event) {
+			dates = (noDefault ? "" : dates);
+		}
+		inst.selectedDay = date.getDate();
+		inst.drawMonth = inst.selectedMonth = date.getMonth();
+		inst.drawYear = inst.selectedYear = date.getFullYear();
+		inst.currentDay = (dates ? date.getDate() : 0);
+		inst.currentMonth = (dates ? date.getMonth() : 0);
+		inst.currentYear = (dates ? date.getFullYear() : 0);
+		this._adjustInstDate(inst);
 	},
 
-	_title: function( title ) {
-		if ( !this.options.title ) {
-			title.html("&#160;");
-		}
-		title.text( this.options.title );
+	/* Retrieve the default date shown on opening. */
+	_getDefaultDate: function(inst) {
+		return this._restrictMinMax(inst,
+			this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
 	},
 
-	_createButtonPane: function() {
-		this.uiDialogButtonPane = $("<div>")
-			.addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");
+	/* A date may be specified as an exact value or a relative one. */
+	_determineDate: function(inst, date, defaultDate) {
+		var offsetNumeric = function(offset) {
+				var date = new Date();
+				date.setDate(date.getDate() + offset);
+				return date;
+			},
+			offsetString = function(offset) {
+				try {
+					return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
+						offset, $.datepicker._getFormatConfig(inst));
+				}
+				catch (e) {
+					// Ignore
+				}
 
-		this.uiButtonSet = $("<div>")
-			.addClass("ui-dialog-buttonset")
-			.appendTo( this.uiDialogButtonPane );
+				var date = (offset.toLowerCase().match(/^c/) ?
+					$.datepicker._getDate(inst) : null) || new Date(),
+					year = date.getFullYear(),
+					month = date.getMonth(),
+					day = date.getDate(),
+					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
+					matches = pattern.exec(offset);
 
-		this._createButtons();
+				while (matches) {
+					switch (matches[2] || "d") {
+						case "d" : case "D" :
+							day += parseInt(matches[1],10); break;
+						case "w" : case "W" :
+							day += parseInt(matches[1],10) * 7; break;
+						case "m" : case "M" :
+							month += parseInt(matches[1],10);
+							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
+							break;
+						case "y": case "Y" :
+							year += parseInt(matches[1],10);
+							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
+							break;
+					}
+					matches = pattern.exec(offset);
+				}
+				return new Date(year, month, day);
+			},
+			newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
+				(typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
+
+		newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
+		if (newDate) {
+			newDate.setHours(0);
+			newDate.setMinutes(0);
+			newDate.setSeconds(0);
+			newDate.setMilliseconds(0);
+		}
+		return this._daylightSavingAdjust(newDate);
 	},
 
-	_createButtons: function() {
-		var that = this,
-			buttons = this.options.buttons;
+	/* Handle switch to/from daylight saving.
+	 * Hours may be non-zero on daylight saving cut-over:
+	 * > 12 when midnight changeover, but then cannot generate
+	 * midnight datetime, so jump to 1AM, otherwise reset.
+	 * @param  date  (Date) the date to check
+	 * @return  (Date) the corrected date
+	 */
+	_daylightSavingAdjust: function(date) {
+		if (!date) {
+			return null;
+		}
+		date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
+		return date;
+	},
 
-		// if we already have a button pane, remove it
-		this.uiDialogButtonPane.remove();
-		this.uiButtonSet.empty();
+	/* Set the date(s) directly. */
+	_setDate: function(inst, date, noChange) {
+		var clear = !date,
+			origMonth = inst.selectedMonth,
+			origYear = inst.selectedYear,
+			newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
 
-		if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
-			this.uiDialog.removeClass("ui-dialog-buttons");
-			return;
+		inst.selectedDay = inst.currentDay = newDate.getDate();
+		inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
+		inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
+		if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
+			this._notifyChange(inst);
+		}
+		this._adjustInstDate(inst);
+		if (inst.input) {
+			inst.input.val(clear ? "" : this._formatDate(inst));
 		}
+	},
 
-		$.each( buttons, function( name, props ) {
-			var click, buttonOptions;
-			props = $.isFunction( props ) ?
-				{ click: props, text: name } :
-				props;
-			// Default to a non-submitting button
-			props = $.extend( { type: "button" }, props );
-			// Change the context for the click callback to be the main element
-			click = props.click;
-			props.click = function() {
-				click.apply( that.element[0], arguments );
-			};
-			buttonOptions = {
-				icons: props.icons,
-				text: props.showText
+	/* Retrieve the date(s) directly. */
+	_getDate: function(inst) {
+		var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
+			this._daylightSavingAdjust(new Date(
+			inst.currentYear, inst.currentMonth, inst.currentDay)));
+			return startDate;
+	},
+
+	/* Attach the onxxx handlers.  These are declared statically so
+	 * they work with static code transformers like Caja.
+	 */
+	_attachHandlers: function(inst) {
+		var stepMonths = this._get(inst, "stepMonths"),
+			id = "#" + inst.id.replace( /\\\\/g, "\\" );
+		inst.dpDiv.find("[data-handler]").map(function () {
+			var handler = {
+				prev: function () {
+					$.datepicker._adjustDate(id, -stepMonths, "M");
+				},
+				next: function () {
+					$.datepicker._adjustDate(id, +stepMonths, "M");
+				},
+				hide: function () {
+					$.datepicker._hideDatepicker();
+				},
+				today: function () {
+					$.datepicker._gotoToday(id);
+				},
+				selectDay: function () {
+					$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
+					return false;
+				},
+				selectMonth: function () {
+					$.datepicker._selectMonthYear(id, this, "M");
+					return false;
+				},
+				selectYear: function () {
+					$.datepicker._selectMonthYear(id, this, "Y");
+					return false;
+				}
 			};
-			delete props.icons;
-			delete props.showText;
-			$( "<button></button>", props )
-				.button( buttonOptions )
-				.appendTo( that.uiButtonSet );
+			$(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
 		});
-		this.uiDialog.addClass("ui-dialog-buttons");
-		this.uiDialogButtonPane.appendTo( this.uiDialog );
 	},
 
-	_makeDraggable: function() {
-		var that = this,
-			options = this.options;
+	/* Generate the HTML for the current state of the date picker. */
+	_generateHTML: function(inst) {
+		var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
+			controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
+			monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
+			selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
+			cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
+			printDate, dRow, tbody, daySettings, otherMonth, unselectable,
+			tempDate = new Date(),
+			today = this._daylightSavingAdjust(
+				new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
+			isRTL = this._get(inst, "isRTL"),
+			showButtonPanel = this._get(inst, "showButtonPanel"),
+			hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
+			navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
+			numMonths = this._getNumberOfMonths(inst),
+			showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
+			stepMonths = this._get(inst, "stepMonths"),
+			isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
+			currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
+				new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
+			minDate = this._getMinMaxDate(inst, "min"),
+			maxDate = this._getMinMaxDate(inst, "max"),
+			drawMonth = inst.drawMonth - showCurrentAtPos,
+			drawYear = inst.drawYear;
 
-		function filteredUi( ui ) {
-			return {
-				position: ui.position,
-				offset: ui.offset
-			};
+		if (drawMonth < 0) {
+			drawMonth += 12;
+			drawYear--;
 		}
-
-		this.uiDialog.draggable({
-			cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
-			handle: ".ui-dialog-titlebar",
-			containment: "document",
-			start: function( event, ui ) {
-				$( this ).addClass("ui-dialog-dragging");
-				that._blockFrames();
-				that._trigger( "dragStart", event, filteredUi( ui ) );
-			},
-			drag: function( event, ui ) {
-				that._trigger( "drag", event, filteredUi( ui ) );
-			},
-			stop: function( event, ui ) {
-				options.position = [
-					ui.position.left - that.document.scrollLeft(),
-					ui.position.top - that.document.scrollTop()
-				];
-				$( this ).removeClass("ui-dialog-dragging");
-				that._unblockFrames();
-				that._trigger( "dragStop", event, filteredUi( ui ) );
+		if (maxDate) {
+			maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
+				maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
+			maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
+			while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
+				drawMonth--;
+				if (drawMonth < 0) {
+					drawMonth = 11;
+					drawYear--;
+				}
 			}
-		});
-	},
+		}
+		inst.drawMonth = drawMonth;
+		inst.drawYear = drawYear;
 
-	_makeResizable: function() {
-		var that = this,
-			options = this.options,
-			handles = options.resizable,
-			// .ui-resizable has position: relative defined in the stylesheet
-			// but dialogs have to use absolute or fixed positioning
-			position = this.uiDialog.css("position"),
-			resizeHandles = typeof handles === "string" ?
-				handles	:
-				"n,e,s,w,se,sw,ne,nw";
+		prevText = this._get(inst, "prevText");
+		prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
+			this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
+			this._getFormatConfig(inst)));
 
-		function filteredUi( ui ) {
-			return {
-				originalPosition: ui.originalPosition,
-				originalSize: ui.originalSize,
-				position: ui.position,
-				size: ui.size
-			};
-		}
+		prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
+			"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
+			" title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
+			(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>"));
 
-		this.uiDialog.resizable({
-			cancel: ".ui-dialog-content",
-			containment: "document",
-			alsoResize: this.element,
-			maxWidth: options.maxWidth,
-			maxHeight: options.maxHeight,
-			minWidth: options.minWidth,
-			minHeight: this._minHeight(),
-			handles: resizeHandles,
-			start: function( event, ui ) {
-				$( this ).addClass("ui-dialog-resizing");
-				that._blockFrames();
-				that._trigger( "resizeStart", event, filteredUi( ui ) );
-			},
-			resize: function( event, ui ) {
-				that._trigger( "resize", event, filteredUi( ui ) );
-			},
-			stop: function( event, ui ) {
-				options.height = $( this ).height();
-				options.width = $( this ).width();
-				$( this ).removeClass("ui-dialog-resizing");
-				that._unblockFrames();
-				that._trigger( "resizeStop", event, filteredUi( ui ) );
+		nextText = this._get(inst, "nextText");
+		nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
+			this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
+			this._getFormatConfig(inst)));
+
+		next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
+			"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
+			" title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
+			(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>"));
+
+		currentText = this._get(inst, "currentText");
+		gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
+		currentText = (!navigationAsDateFormat ? currentText :
+			this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
+
+		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'>" +
+			this._get(inst, "closeText") + "</button>" : "");
+
+		buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
+			(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'" +
+			">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
+
+		firstDay = parseInt(this._get(inst, "firstDay"),10);
+		firstDay = (isNaN(firstDay) ? 0 : firstDay);
+
+		showWeek = this._get(inst, "showWeek");
+		dayNames = this._get(inst, "dayNames");
+		dayNamesMin = this._get(inst, "dayNamesMin");
+		monthNames = this._get(inst, "monthNames");
+		monthNamesShort = this._get(inst, "monthNamesShort");
+		beforeShowDay = this._get(inst, "beforeShowDay");
+		showOtherMonths = this._get(inst, "showOtherMonths");
+		selectOtherMonths = this._get(inst, "selectOtherMonths");
+		defaultDate = this._getDefaultDate(inst);
+		html = "";
+		dow;
+		for (row = 0; row < numMonths[0]; row++) {
+			group = "";
+			this.maxRows = 4;
+			for (col = 0; col < numMonths[1]; col++) {
+				selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
+				cornerClass = " ui-corner-all";
+				calender = "";
+				if (isMultiMonth) {
+					calender += "<div class='ui-datepicker-group";
+					if (numMonths[1] > 1) {
+						switch (col) {
+							case 0: calender += " ui-datepicker-group-first";
+								cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
+							case numMonths[1]-1: calender += " ui-datepicker-group-last";
+								cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
+							default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
+						}
+					}
+					calender += "'>";
+				}
+				calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
+					(/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
+					(/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
+					this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
+					row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
+					"</div><table class='ui-datepicker-calendar'><thead>" +
+					"<tr>";
+				thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
+				for (dow = 0; dow < 7; dow++) { // days of the week
+					day = (dow + firstDay) % 7;
+					thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
+						"<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
+				}
+				calender += thead + "</tr></thead><tbody>";
+				daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
+				if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
+					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
+				}
+				leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
+				curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
+				numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
+				this.maxRows = numRows;
+				printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
+				for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
+					calender += "<tr>";
+					tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
+						this._get(inst, "calculateWeek")(printDate) + "</td>");
+					for (dow = 0; dow < 7; dow++) { // create date picker days
+						daySettings = (beforeShowDay ?
+							beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
+						otherMonth = (printDate.getMonth() !== drawMonth);
+						unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
+							(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
+						tbody += "<td class='" +
+							((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
+							(otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
+							((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
+							(defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
+							// or defaultDate is current printedDate and defaultDate is selectedDate
+							" " + this._dayOverClass : "") + // highlight selected day
+							(unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") +  // highlight unselectable days
+							(otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
+							(printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
+							(printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
+							((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
+							(unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
+							(otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
+							(unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
+							(printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
+							(printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
+							(otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
+							"' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
+						printDate.setDate(printDate.getDate() + 1);
+						printDate = this._daylightSavingAdjust(printDate);
+					}
+					calender += tbody + "</tr>";
+				}
+				drawMonth++;
+				if (drawMonth > 11) {
+					drawMonth = 0;
+					drawYear++;
+				}
+				calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
+							((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
+				group += calender;
 			}
-		})
-		.css( "position", position );
-	},
-
-	_minHeight: function() {
-		var options = this.options;
-
-		return options.height === "auto" ?
-			options.minHeight :
-			Math.min( options.minHeight, options.height );
-	},
-
-	_position: function() {
-		// Need to show the dialog to get the actual offset in the position plugin
-		var isVisible = this.uiDialog.is(":visible");
-		if ( !isVisible ) {
-			this.uiDialog.show();
-		}
-		this.uiDialog.position( this.options.position );
-		if ( !isVisible ) {
-			this.uiDialog.hide();
+			html += group;
 		}
+		html += buttonPanel;
+		inst._keyEvent = false;
+		return html;
 	},
 
-	_setOptions: function( options ) {
-		var that = this,
-			resize = false,
-			resizableOptions = {};
+	/* Generate the month and year header. */
+	_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
+			secondary, monthNames, monthNamesShort) {
 
-		$.each( options, function( key, value ) {
-			that._setOption( key, value );
+		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
+			changeMonth = this._get(inst, "changeMonth"),
+			changeYear = this._get(inst, "changeYear"),
+			showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
+			html = "<div class='ui-datepicker-title'>",
+			monthHtml = "";
 
-			if ( key in sizeRelatedOptions ) {
-				resize = true;
-			}
-			if ( key in resizableRelatedOptions ) {
-				resizableOptions[ key ] = value;
+		// month selection
+		if (secondary || !changeMonth) {
+			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
+		} else {
+			inMinYear = (minDate && minDate.getFullYear() === drawYear);
+			inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
+			monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
+			for ( month = 0; month < 12; month++) {
+				if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
+					monthHtml += "<option value='" + month + "'" +
+						(month === drawMonth ? " selected='selected'" : "") +
+						">" + monthNamesShort[month] + "</option>";
+				}
 			}
-		});
-
-		if ( resize ) {
-			this._size();
-			this._position();
-		}
-		if ( this.uiDialog.is(":data(ui-resizable)") ) {
-			this.uiDialog.resizable( "option", resizableOptions );
-		}
-	},
-
-	_setOption: function( key, value ) {
-		var isDraggable, isResizable,
-			uiDialog = this.uiDialog;
-
-		if ( key === "dialogClass" ) {
-			uiDialog
-				.removeClass( this.options.dialogClass )
-				.addClass( value );
-		}
-
-		if ( key === "disabled" ) {
-			return;
-		}
-
-		this._super( key, value );
-
-		if ( key === "appendTo" ) {
-			this.uiDialog.appendTo( this._appendTo() );
-		}
-
-		if ( key === "buttons" ) {
-			this._createButtons();
+			monthHtml += "</select>";
 		}
 
-		if ( key === "closeText" ) {
-			this.uiDialogTitlebarClose.button({
-				// Ensure that we always pass a string
-				label: "" + value
-			});
+		if (!showMonthAfterYear) {
+			html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
 		}
 
-		if ( key === "draggable" ) {
-			isDraggable = uiDialog.is(":data(ui-draggable)");
-			if ( isDraggable && !value ) {
-				uiDialog.draggable("destroy");
-			}
+		// year selection
+		if ( !inst.yearshtml ) {
+			inst.yearshtml = "";
+			if (secondary || !changeYear) {
+				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
+			} else {
+				// determine range of years to display
+				years = this._get(inst, "yearRange").split(":");
+				thisYear = new Date().getFullYear();
+				determineYear = function(value) {
+					var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
+						(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
+						parseInt(value, 10)));
+					return (isNaN(year) ? thisYear : year);
+				};
+				year = determineYear(years[0]);
+				endYear = Math.max(year, determineYear(years[1] || ""));
+				year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
+				endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
+				inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
+				for (; year <= endYear; year++) {
+					inst.yearshtml += "<option value='" + year + "'" +
+						(year === drawYear ? " selected='selected'" : "") +
+						">" + year + "</option>";
+				}
+				inst.yearshtml += "</select>";
 
-			if ( !isDraggable && value ) {
-				this._makeDraggable();
+				html += inst.yearshtml;
+				inst.yearshtml = null;
 			}
 		}
 
-		if ( key === "position" ) {
-			this._position();
+		html += this._get(inst, "yearSuffix");
+		if (showMonthAfterYear) {
+			html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
 		}
+		html += "</div>"; // Close datepicker_header
+		return html;
+	},
 
-		if ( key === "resizable" ) {
-			// currently resizable, becoming non-resizable
-			isResizable = uiDialog.is(":data(ui-resizable)");
-			if ( isResizable && !value ) {
-				uiDialog.resizable("destroy");
-			}
-
-			// currently resizable, changing handles
-			if ( isResizable && typeof value === "string" ) {
-				uiDialog.resizable( "option", "handles", value );
-			}
-
-			// currently non-resizable, becoming resizable
-			if ( !isResizable && value !== false ) {
-				this._makeResizable();
-			}
-		}
+	/* Adjust one of the date sub-fields. */
+	_adjustInstDate: function(inst, offset, period) {
+		var year = inst.drawYear + (period === "Y" ? offset : 0),
+			month = inst.drawMonth + (period === "M" ? offset : 0),
+			day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
+			date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
 
-		if ( key === "title" ) {
-			this._title( this.uiDialogTitlebar.find(".ui-dialog-title") );
+		inst.selectedDay = date.getDate();
+		inst.drawMonth = inst.selectedMonth = date.getMonth();
+		inst.drawYear = inst.selectedYear = date.getFullYear();
+		if (period === "M" || period === "Y") {
+			this._notifyChange(inst);
 		}
 	},
 
-	_size: function() {
-		// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
-		// divs will both have width and height set, so we need to reset them
-		var nonContentHeight, minContentHeight, maxContentHeight,
-			options = this.options;
-
-		// Reset content sizing
-		this.element.show().css({
-			width: "auto",
-			minHeight: 0,
-			maxHeight: "none",
-			height: 0
-		});
+	/* Ensure a date is within any min/max bounds. */
+	_restrictMinMax: function(inst, date) {
+		var minDate = this._getMinMaxDate(inst, "min"),
+			maxDate = this._getMinMaxDate(inst, "max"),
+			newDate = (minDate && date < minDate ? minDate : date);
+		return (maxDate && newDate > maxDate ? maxDate : newDate);
+	},
 
-		if ( options.minWidth > options.width ) {
-			options.width = options.minWidth;
+	/* Notify change of month/year. */
+	_notifyChange: function(inst) {
+		var onChange = this._get(inst, "onChangeMonthYear");
+		if (onChange) {
+			onChange.apply((inst.input ? inst.input[0] : null),
+				[inst.selectedYear, inst.selectedMonth + 1, inst]);
 		}
+	},
 
-		// reset wrapper sizing
-		// determine the height of all the non-content elements
-		nonContentHeight = this.uiDialog.css({
-				height: "auto",
-				width: options.width
-			})
-			.outerHeight();
-		minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
-		maxContentHeight = typeof options.maxHeight === "number" ?
-			Math.max( 0, options.maxHeight - nonContentHeight ) :
-			"none";
-
-		if ( options.height === "auto" ) {
-			this.element.css({
-				minHeight: minContentHeight,
-				maxHeight: maxContentHeight,
-				height: "auto"
-			});
-		} else {
-			this.element.height( Math.max( 0, options.height - nonContentHeight ) );
-		}
+	/* Determine the number of months to show. */
+	_getNumberOfMonths: function(inst) {
+		var numMonths = this._get(inst, "numberOfMonths");
+		return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
+	},
 
-		if (this.uiDialog.is(":data(ui-resizable)") ) {
-			this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
-		}
+	/* Determine the current maximum date - ensure no time components are set. */
+	_getMinMaxDate: function(inst, minMax) {
+		return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
 	},
 
-	_blockFrames: function() {
-		this.iframeBlocks = this.document.find( "iframe" ).map(function() {
-			var iframe = $( this );
+	/* Find the number of days in a given month. */
+	_getDaysInMonth: function(year, month) {
+		return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
+	},
 
-			return $( "<div>" )
-				.css({
-					position: "absolute",
-					width: iframe.outerWidth(),
-					height: iframe.outerHeight()
-				})
-				.appendTo( iframe.parent() )
-				.offset( iframe.offset() )[0];
-		});
+	/* Find the day of the week of the first of a month. */
+	_getFirstDayOfMonth: function(year, month) {
+		return new Date(year, month, 1).getDay();
 	},
 
-	_unblockFrames: function() {
-		if ( this.iframeBlocks ) {
-			this.iframeBlocks.remove();
-			delete this.iframeBlocks;
+	/* Determines if we should allow a "next/prev" month display change. */
+	_canAdjustMonth: function(inst, offset, curYear, curMonth) {
+		var numMonths = this._getNumberOfMonths(inst),
+			date = this._daylightSavingAdjust(new Date(curYear,
+			curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
+
+		if (offset < 0) {
+			date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
 		}
+		return this._isInRange(inst, date);
 	},
 
-	_allowInteraction: function( event ) {
-		if ( $( event.target ).closest(".ui-dialog").length ) {
-			return true;
-		}
+	/* Is the given date in the accepted range? */
+	_isInRange: function(inst, date) {
+		var yearSplit, currentYear,
+			minDate = this._getMinMaxDate(inst, "min"),
+			maxDate = this._getMinMaxDate(inst, "max"),
+			minYear = null,
+			maxYear = null,
+			years = this._get(inst, "yearRange");
+			if (years){
+				yearSplit = years.split(":");
+				currentYear = new Date().getFullYear();
+				minYear = parseInt(yearSplit[0], 10);
+				maxYear = parseInt(yearSplit[1], 10);
+				if ( yearSplit[0].match(/[+\-].*/) ) {
+					minYear += currentYear;
+				}
+				if ( yearSplit[1].match(/[+\-].*/) ) {
+					maxYear += currentYear;
+				}
+			}
 
-		// TODO: Remove hack when datepicker implements
-		// the .ui-front logic (#8989)
-		return !!$( event.target ).closest(".ui-datepicker").length;
+		return ((!minDate || date.getTime() >= minDate.getTime()) &&
+			(!maxDate || date.getTime() <= maxDate.getTime()) &&
+			(!minYear || date.getFullYear() >= minYear) &&
+			(!maxYear || date.getFullYear() <= maxYear));
 	},
 
-	_createOverlay: function() {
-		if ( !this.options.modal ) {
-			return;
-		}
+	/* Provide the configuration settings for formatting/parsing. */
+	_getFormatConfig: function(inst) {
+		var shortYearCutoff = this._get(inst, "shortYearCutoff");
+		shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
+			new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
+		return {shortYearCutoff: shortYearCutoff,
+			dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
+			monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
+	},
 
-		var that = this,
-			widgetFullName = this.widgetFullName;
-		if ( !$.ui.dialog.overlayInstances ) {
-			// Prevent use of anchors and inputs.
-			// We use a delay in case the overlay is created from an
-			// event that we're going to be cancelling. (#2804)
-			this._delay(function() {
-				// Handle .dialog().dialog("close") (#4065)
-				if ( $.ui.dialog.overlayInstances ) {
-					this.document.bind( "focusin.dialog", function( event ) {
-						if ( !that._allowInteraction( event ) ) {
-							event.preventDefault();
-							$(".ui-dialog:visible:last .ui-dialog-content")
-								.data( widgetFullName )._focusTabbable();
-						}
-					});
-				}
-			});
+	/* Format the given date for display. */
+	_formatDate: function(inst, day, month, year) {
+		if (!day) {
+			inst.currentDay = inst.selectedDay;
+			inst.currentMonth = inst.selectedMonth;
+			inst.currentYear = inst.selectedYear;
 		}
+		var date = (day ? (typeof day === "object" ? day :
+			this._daylightSavingAdjust(new Date(year, month, day))) :
+			this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
+		return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
+	}
+});
 
-		this.overlay = $("<div>")
-			.addClass("ui-widget-overlay ui-front")
-			.appendTo( this._appendTo() );
-		this._on( this.overlay, {
-			mousedown: "_keepFocus"
+/*
+ * Bind hover events for datepicker elements.
+ * Done via delegate so the binding only occurs once in the lifetime of the parent div.
+ * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
+ */
+function datepicker_bindHover(dpDiv) {
+	var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
+	return dpDiv.delegate(selector, "mouseout", function() {
+			$(this).removeClass("ui-state-hover");
+			if (this.className.indexOf("ui-datepicker-prev") !== -1) {
+				$(this).removeClass("ui-datepicker-prev-hover");
+			}
+			if (this.className.indexOf("ui-datepicker-next") !== -1) {
+				$(this).removeClass("ui-datepicker-next-hover");
+			}
+		})
+		.delegate(selector, "mouseover", function(){
+			if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? dpDiv.parent()[0] : datepicker_instActive.input[0])) {
+				$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
+				$(this).addClass("ui-state-hover");
+				if (this.className.indexOf("ui-datepicker-prev") !== -1) {
+					$(this).addClass("ui-datepicker-prev-hover");
+				}
+				if (this.className.indexOf("ui-datepicker-next") !== -1) {
+					$(this).addClass("ui-datepicker-next-hover");
+				}
+			}
 		});
-		$.ui.dialog.overlayInstances++;
-	},
+}
 
-	_destroyOverlay: function() {
-		if ( !this.options.modal ) {
-			return;
+/* jQuery extend now ignores nulls! */
+function datepicker_extendRemove(target, props) {
+	$.extend(target, props);
+	for (var name in props) {
+		if (props[name] == null) {
+			target[name] = props[name];
 		}
+	}
+	return target;
+}
 
-		if ( this.overlay ) {
-			$.ui.dialog.overlayInstances--;
+/* Invoke the datepicker functionality.
+   @param  options  string - a command, optionally followed by additional parameters or
+					Object - settings for attaching new datepicker functionality
+   @return  jQuery object */
+$.fn.datepicker = function(options){
 
-			if ( !$.ui.dialog.overlayInstances ) {
-				this.document.unbind( "focusin.dialog" );
-			}
-			this.overlay.remove();
-			this.overlay = null;
-		}
+	/* Verify an empty collection wasn't passed - Fixes #6976 */
+	if ( !this.length ) {
+		return this;
 	}
-});
 
-$.ui.dialog.overlayInstances = 0;
-
-// DEPRECATED
-if ( $.uiBackCompat !== false ) {
-	// position option with array notation
-	// just override with old implementation
-	$.widget( "ui.dialog", $.ui.dialog, {
-		_position: function() {
-			var position = this.options.position,
-				myAt = [],
-				offset = [ 0, 0 ],
-				isVisible;
-
-			if ( position ) {
-				if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) {
-					myAt = position.split ? position.split(" ") : [ position[0], position[1] ];
-					if ( myAt.length === 1 ) {
-						myAt[1] = myAt[0];
-					}
+	/* Initialise the date picker. */
+	if (!$.datepicker.initialized) {
+		$(document).mousedown($.datepicker._checkExternalClick);
+		$.datepicker.initialized = true;
+	}
 
-					$.each( [ "left", "top" ], function( i, offsetPosition ) {
-						if ( +myAt[ i ] === myAt[ i ] ) {
-							offset[ i ] = myAt[ i ];
-							myAt[ i ] = offsetPosition;
-						}
-					});
+	/* Append datepicker main container to body if not exist. */
+	if ($("#"+$.datepicker._mainDivId).length === 0) {
+		$("body").append($.datepicker.dpDiv);
+	}
 
-					position = {
-						my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " +
-							myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]),
-						at: myAt.join(" ")
-					};
-				}
+	var otherArgs = Array.prototype.slice.call(arguments, 1);
+	if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
+		return $.datepicker["_" + options + "Datepicker"].
+			apply($.datepicker, [this[0]].concat(otherArgs));
+	}
+	if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
+		return $.datepicker["_" + options + "Datepicker"].
+			apply($.datepicker, [this[0]].concat(otherArgs));
+	}
+	return this.each(function() {
+		typeof options === "string" ?
+			$.datepicker["_" + options + "Datepicker"].
+				apply($.datepicker, [this].concat(otherArgs)) :
+			$.datepicker._attachDatepicker(this, options);
+	});
+};
 
-				position = $.extend( {}, $.ui.dialog.prototype.options.position, position );
-			} else {
-				position = $.ui.dialog.prototype.options.position;
-			}
+$.datepicker = new Datepicker(); // singleton instance
+$.datepicker.initialized = false;
+$.datepicker.uuid = new Date().getTime();
+$.datepicker.version = "1.11.0";
+
+var datepicker = $.datepicker;
 
-			// need to show the dialog to get the actual offset in the position plugin
-			isVisible = this.uiDialog.is(":visible");
-			if ( !isVisible ) {
-				this.uiDialog.show();
-			}
-			this.uiDialog.position( position );
-			if ( !isVisible ) {
-				this.uiDialog.hide();
-			}
-		}
-	});
-}
 
-}( jQuery ) );
-(function( $, undefined ) {
+/*!
+ * jQuery UI Draggable 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/draggable/
+ */
+
 
 $.widget("ui.draggable", $.ui.mouse, {
-	version: "1.10.4",
+	version: "1.11.0",
 	widgetEventPrefix: "drag",
 	options: {
 		addClasses: true,
@@ -5874,19 +5828,43 @@ $.widget("ui.draggable", $.ui.mouse, {
 		if (this.options.disabled){
 			this.element.addClass("ui-draggable-disabled");
 		}
+		this._setHandleClassName();
 
 		this._mouseInit();
+	},
 
+	_setOption: function( key, value ) {
+		this._super( key, value );
+		if ( key === "handle" ) {
+			this._setHandleClassName();
+		}
 	},
 
 	_destroy: function() {
+		if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
+			this.destroyOnClear = true;
+			return;
+		}
 		this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
+		this._removeHandleClassName();
 		this._mouseDestroy();
 	},
 
 	_mouseCapture: function(event) {
 
-		var o = this.options;
+		var document = this.document[ 0 ],
+			o = this.options;
+
+		// support: IE9
+		// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
+		try {
+			// Support: IE9+
+			// If the <body> is blurred, IE will switch windows, see #9520
+			if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
+				// Blur any element that currently has focus, see #4261
+				$( document.activeElement ).blur();
+			}
+		} catch ( error ) {}
 
 		// among others, prevent a drag on a resizable-handle
 		if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
@@ -5902,7 +5880,7 @@ $.widget("ui.draggable", $.ui.mouse, {
 		$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
 			$("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>")
 			.css({
-				width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+				width: this.offsetWidth + "px", height: this.offsetHeight + "px",
 				position: "absolute", opacity: "0.001", zIndex: 1000
 			})
 			.css($(this).offset())
@@ -5926,7 +5904,7 @@ $.widget("ui.draggable", $.ui.mouse, {
 		this._cacheHelperProportions();
 
 		//If ddmanager is used for droppables, set the global draggable
-		if($.ui.ddmanager) {
+		if ($.ui.ddmanager) {
 			$.ui.ddmanager.current = this;
 		}
 
@@ -5964,7 +5942,7 @@ $.widget("ui.draggable", $.ui.mouse, {
 		});
 
 		//Generate the original position
-		this.originalPosition = this.position = this._generatePosition(event);
+		this.originalPosition = this.position = this._generatePosition( event, false );
 		this.originalPageX = event.pageX;
 		this.originalPageY = event.pageY;
 
@@ -5975,7 +5953,7 @@ $.widget("ui.draggable", $.ui.mouse, {
 		this._setContainment();
 
 		//Trigger event + callbacks
-		if(this._trigger("start", event) === false) {
+		if (this._trigger("start", event) === false) {
 			this._clear();
 			return false;
 		}
@@ -5988,7 +5966,6 @@ $.widget("ui.draggable", $.ui.mouse, {
 			$.ui.ddmanager.prepareOffsets(this, event);
 		}
 
-
 		this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
 
 		//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
@@ -6006,26 +5983,23 @@ $.widget("ui.draggable", $.ui.mouse, {
 		}
 
 		//Compute the helpers position
-		this.position = this._generatePosition(event);
+		this.position = this._generatePosition( event, true );
 		this.positionAbs = this._convertPositionTo("absolute");
 
 		//Call plugins and callbacks and use the resulting position if something is returned
 		if (!noPropagation) {
 			var ui = this._uiHash();
-			if(this._trigger("drag", event, ui) === false) {
+			if (this._trigger("drag", event, ui) === false) {
 				this._mouseUp({});
 				return false;
 			}
 			this.position = ui.position;
 		}
 
-		if(!this.options.axis || this.options.axis !== "y") {
-			this.helper[0].style.left = this.position.left+"px";
-		}
-		if(!this.options.axis || this.options.axis !== "x") {
-			this.helper[0].style.top = this.position.top+"px";
-		}
-		if($.ui.ddmanager) {
+		this.helper[ 0 ].style.left = this.position.left + "px";
+		this.helper[ 0 ].style.top = this.position.top + "px";
+
+		if ($.ui.ddmanager) {
 			$.ui.ddmanager.drag(this, event);
 		}
 
@@ -6042,24 +6016,19 @@ $.widget("ui.draggable", $.ui.mouse, {
 		}
 
 		//if a drop comes from outside (a sortable)
-		if(this.dropped) {
+		if (this.dropped) {
 			dropped = this.dropped;
 			this.dropped = false;
 		}
 
-		//if the original element is no longer in the DOM don't bother to continue (see #8269)
-		if ( this.options.helper === "original" && !$.contains( this.element[ 0 ].ownerDocument, this.element[ 0 ] ) ) {
-			return false;
-		}
-
-		if((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))) {
+		if ((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))) {
 			$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
-				if(that._trigger("stop", event) !== false) {
+				if (that._trigger("stop", event) !== false) {
 					that._clear();
 				}
 			});
 		} else {
-			if(this._trigger("stop", event) !== false) {
+			if (this._trigger("stop", event) !== false) {
 				this._clear();
 			}
 		}
@@ -6074,16 +6043,19 @@ $.widget("ui.draggable", $.ui.mouse, {
 		});
 
 		//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
-		if( $.ui.ddmanager ) {
+		if ( $.ui.ddmanager ) {
 			$.ui.ddmanager.dragStop(this, event);
 		}
 
+		// The interaction is over; whether or not the click resulted in a drag, focus the element
+		this.element.focus();
+
 		return $.ui.mouse.prototype._mouseUp.call(this, event);
 	},
 
 	cancel: function() {
 
-		if(this.helper.is(".ui-draggable-dragging")) {
+		if (this.helper.is(".ui-draggable-dragging")) {
 			this._mouseUp({});
 		} else {
 			this._clear();
@@ -6099,16 +6071,27 @@ $.widget("ui.draggable", $.ui.mouse, {
 			true;
 	},
 
+	_setHandleClassName: function() {
+		this._removeHandleClassName();
+		$( this.options.handle || this.element ).addClass( "ui-draggable-handle" );
+	},
+
+	_removeHandleClassName: function() {
+		this.element.find( ".ui-draggable-handle" )
+			.addBack()
+			.removeClass( "ui-draggable-handle" );
+	},
+
 	_createHelper: function(event) {
 
 		var o = this.options,
-			helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element);
+			helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[ 0 ], [ event ])) : (o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element);
 
-		if(!helper.parents("body").length) {
+		if (!helper.parents("body").length) {
 			helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
 		}
 
-		if(helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
+		if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
 			helper.css("position", "absolute");
 		}
 
@@ -6121,7 +6104,7 @@ $.widget("ui.draggable", $.ui.mouse, {
 			obj = obj.split(" ");
 		}
 		if ($.isArray(obj)) {
-			obj = {left: +obj[0], top: +obj[1] || 0};
+			obj = { left: +obj[0], top: +obj[1] || 0 };
 		}
 		if ("left" in obj) {
 			this.offset.click.left = obj.left + this.margins.left;
@@ -6137,24 +6120,26 @@ $.widget("ui.draggable", $.ui.mouse, {
 		}
 	},
 
+	_isRootNode: function( element ) {
+		return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
+	},
+
 	_getParentOffset: function() {
 
 		//Get the offsetParent and cache its position
-		var po = this.offsetParent.offset();
+		var po = this.offsetParent.offset(),
+			document = this.document[ 0 ];
 
 		// This is a special case where we need to modify a offset calculated on start, since the following happened:
 		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
 		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
 		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
-		if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
+		if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
 			po.left += this.scrollParent.scrollLeft();
 			po.top += this.scrollParent.scrollTop();
 		}
 
-		//This needs to be actually done for all browsers, since pageX/pageY includes this information
-		//Ugly IE fix
-		if((this.offsetParent[0] === document.body) ||
-			(this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
+		if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
 			po = { top: 0, left: 0 };
 		}
 
@@ -6166,17 +6151,18 @@ $.widget("ui.draggable", $.ui.mouse, {
 	},
 
 	_getRelativeOffset: function() {
-
-		if(this.cssPosition === "relative") {
-			var p = this.element.position();
-			return {
-				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
-				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
-			};
-		} else {
+		if ( this.cssPosition !== "relative" ) {
 			return { top: 0, left: 0 };
 		}
 
+		var p = this.element.position(),
+			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
+
+		return {
+			top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
+			left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
+		};
+
 	},
 
 	_cacheMargins: function() {
@@ -6198,7 +6184,10 @@ $.widget("ui.draggable", $.ui.mouse, {
 	_setContainment: function() {
 
 		var over, c, ce,
-			o = this.options;
+			o = this.options,
+			document = this.document[ 0 ];
+
+		this.relative_container = null;
 
 		if ( !o.containment ) {
 			this.containment = null;
@@ -6237,7 +6226,7 @@ $.widget("ui.draggable", $.ui.mouse, {
 		c = $( o.containment );
 		ce = c[ 0 ];
 
-		if( !ce ) {
+		if ( !ce ) {
 			return;
 		}
 
@@ -6245,7 +6234,7 @@ $.widget("ui.draggable", $.ui.mouse, {
 
 		this.containment = [
 			( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
-			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ) ,
+			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
 			( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - this.helperProportions.width - this.margins.left - this.margins.right,
 			( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - this.helperProportions.height - this.margins.top  - this.margins.bottom
 		];
@@ -6254,46 +6243,44 @@ $.widget("ui.draggable", $.ui.mouse, {
 
 	_convertPositionTo: function(d, pos) {
 
-		if(!pos) {
+		if (!pos) {
 			pos = this.position;
 		}
 
 		var mod = d === "absolute" ? 1 : -1,
-			scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent;
-
-		//Cache the scroll
-		if (!this.offset.scroll) {
-			this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()};
-		}
+			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
 
 		return {
 			top: (
 				pos.top	+																// The absolute mouse position
 				this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
 				this.offset.parent.top * mod -										// The offsetParent's offset without borders (offset + border)
-				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top ) * mod )
+				( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
 			),
 			left: (
 				pos.left +																// The absolute mouse position
 				this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
 				this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
-				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left ) * mod )
+				( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod)
 			)
 		};
 
 	},
 
-	_generatePosition: function(event) {
+	_generatePosition: function( event, constrainPosition ) {
 
 		var containment, co, top, left,
 			o = this.options,
-			scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent,
+			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
 			pageX = event.pageX,
 			pageY = event.pageY;
 
-		//Cache the scroll
-		if (!this.offset.scroll) {
-			this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()};
+		// Cache the scroll
+		if ( !scrollIsRootNode || !this.offset.scroll ) {
+			this.offset.scroll = {
+				top: this.scrollParent.scrollTop(),
+				left: this.scrollParent.scrollLeft()
+			};
 		}
 
 		/*
@@ -6302,7 +6289,7 @@ $.widget("ui.draggable", $.ui.mouse, {
 		 */
 
 		// If we are not dragging yet, we won't check for options
-		if ( this.originalPosition ) {
+		if ( constrainPosition ) {
 			if ( this.containment ) {
 				if ( this.relative_container ){
 					co = this.relative_container.offset();
@@ -6312,26 +6299,25 @@ $.widget("ui.draggable", $.ui.mouse, {
 						this.containment[ 2 ] + co.left,
 						this.containment[ 3 ] + co.top
 					];
-				}
-				else {
+				} else {
 					containment = this.containment;
 				}
 
-				if(event.pageX - this.offset.click.left < containment[0]) {
+				if (event.pageX - this.offset.click.left < containment[0]) {
 					pageX = containment[0] + this.offset.click.left;
 				}
-				if(event.pageY - this.offset.click.top < containment[1]) {
+				if (event.pageY - this.offset.click.top < containment[1]) {
 					pageY = containment[1] + this.offset.click.top;
 				}
-				if(event.pageX - this.offset.click.left > containment[2]) {
+				if (event.pageX - this.offset.click.left > containment[2]) {
 					pageX = containment[2] + this.offset.click.left;
 				}
-				if(event.pageY - this.offset.click.top > containment[3]) {
+				if (event.pageY - this.offset.click.top > containment[3]) {
 					pageY = containment[3] + this.offset.click.top;
 				}
 			}
 
-			if(o.grid) {
+			if (o.grid) {
 				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
 				top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
 				pageY = 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;
@@ -6340,6 +6326,13 @@ $.widget("ui.draggable", $.ui.mouse, {
 				pageX = 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;
 			}
 
+			if ( o.axis === "y" ) {
+				pageX = this.originalPageX;
+			}
+
+			if ( o.axis === "x" ) {
+				pageY = this.originalPageY;
+			}
 		}
 
 		return {
@@ -6348,14 +6341,14 @@ $.widget("ui.draggable", $.ui.mouse, {
 				this.offset.click.top	-												// Click offset (relative to the element)
 				this.offset.relative.top -												// Only for relative positioned nodes: Relative offset from element to offset parent
 				this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
-				( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top )
+				( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
 			),
 			left: (
 				pageX -																	// The absolute mouse position
 				this.offset.click.left -												// Click offset (relative to the element)
 				this.offset.relative.left -												// Only for relative positioned nodes: Relative offset from element to offset parent
 				this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
-				( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left )
+				( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
 			)
 		};
 
@@ -6363,20 +6356,23 @@ $.widget("ui.draggable", $.ui.mouse, {
 
 	_clear: function() {
 		this.helper.removeClass("ui-draggable-dragging");
-		if(this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
+		if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
 			this.helper.remove();
 		}
 		this.helper = null;
 		this.cancelHelperRemoval = false;
+		if ( this.destroyOnClear ) {
+			this.destroy();
+		}
 	},
 
 	// From now on bulk stuff - mainly helpers
 
 	_trigger: function(type, event, ui) {
 		ui = ui || this._uiHash();
-		$.ui.plugin.call(this, type, [event, ui]);
+		$.ui.plugin.call( this, type, [ event, ui, this ], true );
 		//The absolute position has to be recalculated after plugins
-		if(type === "drag") {
+		if (type === "drag") {
 			this.positionAbs = this._convertPositionTo("absolute");
 		}
 		return $.Widget.prototype._trigger.call(this, type, event, ui);
@@ -6396,13 +6392,13 @@ $.widget("ui.draggable", $.ui.mouse, {
 });
 
 $.ui.plugin.add("draggable", "connectToSortable", {
-	start: function(event, ui) {
+	start: function( event, ui, inst ) {
 
-		var inst = $(this).data("ui-draggable"), o = inst.options,
+		var o = inst.options,
 			uiSortable = $.extend({}, ui, { item: inst.element });
 		inst.sortables = [];
 		$(o.connectToSortable).each(function() {
-			var sortable = $.data(this, "ui-sortable");
+			var sortable = $( this ).sortable( "instance" );
 			if (sortable && !sortable.options.disabled) {
 				inst.sortables.push({
 					instance: sortable,
@@ -6414,14 +6410,15 @@ $.ui.plugin.add("draggable", "connectToSortable", {
 		});
 
 	},
-	stop: function(event, ui) {
+	stop: function( event, ui, inst ) {
 
 		//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
-		var inst = $(this).data("ui-draggable"),
-			uiSortable = $.extend({}, ui, { item: inst.element });
+		var uiSortable = $.extend( {}, ui, {
+			item: inst.element
+		});
 
 		$.each(inst.sortables, function() {
-			if(this.instance.isOver) {
+			if (this.instance.isOver) {
 
 				this.instance.isOver = 0;
 
@@ -6429,7 +6426,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
 				this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
 
 				//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: "valid/invalid"
-				if(this.shouldRevert) {
+				if (this.shouldRevert) {
 					this.instance.options.revert = this.shouldRevert;
 				}
 
@@ -6439,7 +6436,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
 				this.instance.options.helper = this.instance.options._helper;
 
 				//If the helper has been the original item, restore properties in the sortable
-				if(inst.options.helper === "original") {
+				if (inst.options.helper === "original") {
 					this.instance.currentItem.css({ top: "auto", left: "auto" });
 				}
 
@@ -6451,9 +6448,9 @@ $.ui.plugin.add("draggable", "connectToSortable", {
 		});
 
 	},
-	drag: function(event, ui) {
+	drag: function( event, ui, inst ) {
 
-		var inst = $(this).data("ui-draggable"), that = this;
+		var that = this;
 
 		$.each(inst.sortables, function() {
 
@@ -6465,9 +6462,9 @@ $.ui.plugin.add("draggable", "connectToSortable", {
 			this.instance.helperProportions = inst.helperProportions;
 			this.instance.offset.click = inst.offset.click;
 
-			if(this.instance._intersectsWith(this.instance.containerCache)) {
+			if (this.instance._intersectsWith(this.instance.containerCache)) {
 				innermostIntersecting = true;
-				$.each(inst.sortables, function () {
+				$.each(inst.sortables, function() {
 					this.instance.positionAbs = inst.positionAbs;
 					this.instance.helperProportions = inst.helperProportions;
 					this.instance.offset.click = inst.offset.click;
@@ -6481,10 +6478,9 @@ $.ui.plugin.add("draggable", "connectToSortable", {
 				});
 			}
 
-
-			if(innermostIntersecting) {
+			if (innermostIntersecting) {
 				//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
-				if(!this.instance.isOver) {
+				if (!this.instance.isOver) {
 
 					this.instance.isOver = 1;
 					//Now we fake the start of dragging for the sortable instance,
@@ -6513,7 +6509,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
 				}
 
 				//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
-				if(this.instance.currentItem) {
+				if (this.instance.currentItem) {
 					this.instance._mouseDrag(event);
 				}
 
@@ -6521,7 +6517,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
 
 				//If it doesn't intersect with the sortable, and it intersected before,
 				//we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
-				if(this.instance.isOver) {
+				if (this.instance.isOver) {
 
 					this.instance.isOver = 0;
 					this.instance.cancelHelperRemoval = true;
@@ -6537,7 +6533,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
 
 					//Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
 					this.instance.currentItem.remove();
-					if(this.instance.placeholder) {
+					if (this.instance.placeholder) {
 						this.instance.placeholder.remove();
 					}
 
@@ -6553,15 +6549,17 @@ $.ui.plugin.add("draggable", "connectToSortable", {
 });
 
 $.ui.plugin.add("draggable", "cursor", {
-	start: function() {
-		var t = $("body"), o = $(this).data("ui-draggable").options;
+	start: function( event, ui, instance ) {
+		var t = $( "body" ),
+			o = instance.options;
+
 		if (t.css("cursor")) {
 			o._cursor = t.css("cursor");
 		}
 		t.css("cursor", o.cursor);
 	},
-	stop: function() {
-		var o = $(this).data("ui-draggable").options;
+	stop: function( event, ui, instance ) {
+		var o = instance.options;
 		if (o._cursor) {
 			$("body").css("cursor", o._cursor);
 		}
@@ -6569,4546 +6567,5040 @@ $.ui.plugin.add("draggable", "cursor", {
 });
 
 $.ui.plugin.add("draggable", "opacity", {
-	start: function(event, ui) {
-		var t = $(ui.helper), o = $(this).data("ui-draggable").options;
-		if(t.css("opacity")) {
+	start: function( event, ui, instance ) {
+		var t = $( ui.helper ),
+			o = instance.options;
+		if (t.css("opacity")) {
 			o._opacity = t.css("opacity");
 		}
 		t.css("opacity", o.opacity);
 	},
-	stop: function(event, ui) {
-		var o = $(this).data("ui-draggable").options;
-		if(o._opacity) {
+	stop: function( event, ui, instance ) {
+		var o = instance.options;
+		if (o._opacity) {
 			$(ui.helper).css("opacity", o._opacity);
 		}
 	}
 });
 
-$.ui.plugin.add("draggable", "scroll", {
-	start: function() {
-		var i = $(this).data("ui-draggable");
-		if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
-			i.overflowOffset = i.scrollParent.offset();
+$.ui.plugin.add("draggable", "scroll", {
+	start: function( event, ui, i ) {
+		if ( i.scrollParent[ 0 ] !== i.document[ 0 ] && i.scrollParent[ 0 ].tagName !== "HTML" ) {
+			i.overflowOffset = i.scrollParent.offset();
+		}
+	},
+	drag: function( event, ui, i  ) {
+
+		var o = i.options,
+			scrolled = false,
+			document = i.document[ 0 ];
+
+		if ( i.scrollParent[ 0 ] !== document && i.scrollParent[ 0 ].tagName !== "HTML" ) {
+			if (!o.axis || o.axis !== "x") {
+				if ((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
+					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+				} else if (event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
+					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+				}
+			}
+
+			if (!o.axis || o.axis !== "y") {
+				if ((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
+					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+				} else if (event.pageX - i.overflowOffset.left < o.scrollSensitivity) {
+					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+				}
+			}
+
+		} else {
+
+			if (!o.axis || o.axis !== "x") {
+				if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
+					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+				} else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
+					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+				}
+			}
+
+			if (!o.axis || o.axis !== "y") {
+				if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
+					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+				} else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
+					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+				}
+			}
+
+		}
+
+		if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
+			$.ui.ddmanager.prepareOffsets(i, event);
+		}
+
+	}
+});
+
+$.ui.plugin.add("draggable", "snap", {
+	start: function( event, ui, i ) {
+
+		var o = i.options;
+
+		i.snapElements = [];
+
+		$(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
+			var $t = $(this),
+				$o = $t.offset();
+			if (this !== i.element[0]) {
+				i.snapElements.push({
+					item: this,
+					width: $t.outerWidth(), height: $t.outerHeight(),
+					top: $o.top, left: $o.left
+				});
+			}
+		});
+
+	},
+	drag: function( event, ui, inst ) {
+
+		var ts, bs, ls, rs, l, r, t, b, i, first,
+			o = inst.options,
+			d = o.snapTolerance,
+			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+		for (i = inst.snapElements.length - 1; i >= 0; i--){
+
+			l = inst.snapElements[i].left;
+			r = l + inst.snapElements[i].width;
+			t = inst.snapElements[i].top;
+			b = t + inst.snapElements[i].height;
+
+			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
+				if (inst.snapElements[i].snapping) {
+					(inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+				}
+				inst.snapElements[i].snapping = false;
+				continue;
+			}
+
+			if (o.snapMode !== "inner") {
+				ts = Math.abs(t - y2) <= d;
+				bs = Math.abs(b - y1) <= d;
+				ls = Math.abs(l - x2) <= d;
+				rs = Math.abs(r - x1) <= d;
+				if (ts) {
+					ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+				}
+				if (bs) {
+					ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
+				}
+				if (ls) {
+					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
+				}
+				if (rs) {
+					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+				}
+			}
+
+			first = (ts || bs || ls || rs);
+
+			if (o.snapMode !== "outer") {
+				ts = Math.abs(t - y1) <= d;
+				bs = Math.abs(b - y2) <= d;
+				ls = Math.abs(l - x1) <= d;
+				rs = Math.abs(r - x2) <= d;
+				if (ts) {
+					ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
+				}
+				if (bs) {
+					ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+				}
+				if (ls) {
+					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
+				}
+				if (rs) {
+					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
+				}
+			}
+
+			if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
+				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+			}
+			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+		}
+
+	}
+});
+
+$.ui.plugin.add("draggable", "stack", {
+	start: function( event, ui, instance ) {
+		var min,
+			o = instance.options,
+			group = $.makeArray($(o.stack)).sort(function(a,b) {
+				return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
+			});
+
+		if (!group.length) { return; }
+
+		min = parseInt($(group[0]).css("zIndex"), 10) || 0;
+		$(group).each(function(i) {
+			$(this).css("zIndex", min + i);
+		});
+		this.css("zIndex", (min + group.length));
+	}
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+	start: function( event, ui, instance ) {
+		var t = $( ui.helper ),
+			o = instance.options;
+
+		if (t.css("zIndex")) {
+			o._zIndex = t.css("zIndex");
+		}
+		t.css("zIndex", o.zIndex);
+	},
+	stop: function( event, ui, instance ) {
+		var o = instance.options;
+
+		if (o._zIndex) {
+			$(ui.helper).css("zIndex", o._zIndex);
+		}
+	}
+});
+
+var draggable = $.ui.draggable;
+
+
+/*!
+ * jQuery UI Resizable 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/resizable/
+ */
+
+
+$.widget("ui.resizable", $.ui.mouse, {
+	version: "1.11.0",
+	widgetEventPrefix: "resize",
+	options: {
+		alsoResize: false,
+		animate: false,
+		animateDuration: "slow",
+		animateEasing: "swing",
+		aspectRatio: false,
+		autoHide: false,
+		containment: false,
+		ghost: false,
+		grid: false,
+		handles: "e,s,se",
+		helper: false,
+		maxHeight: null,
+		maxWidth: null,
+		minHeight: 10,
+		minWidth: 10,
+		// See #7960
+		zIndex: 90,
+
+		// callbacks
+		resize: null,
+		start: null,
+		stop: null
+	},
+
+	_num: function( value ) {
+		return parseInt( value, 10 ) || 0;
+	},
+
+	_isNumber: function( value ) {
+		return !isNaN( parseInt( value , 10 ) );
+	},
+
+	_hasScroll: function( el, a ) {
+
+		if ( $( el ).css( "overflow" ) === "hidden") {
+			return false;
+		}
+
+		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
+			has = false;
+
+		if ( el[ scroll ] > 0 ) {
+			return true;
+		}
+
+		// TODO: determine which cases actually cause this to happen
+		// if the element doesn't have the scroll set, see if it's possible to
+		// set the scroll
+		el[ scroll ] = 1;
+		has = ( el[ scroll ] > 0 );
+		el[ scroll ] = 0;
+		return has;
+	},
+
+	_create: function() {
+
+		var n, i, handle, axis, hname,
+			that = this,
+			o = this.options;
+		this.element.addClass("ui-resizable");
+
+		$.extend(this, {
+			_aspectRatio: !!(o.aspectRatio),
+			aspectRatio: o.aspectRatio,
+			originalElement: this.element,
+			_proportionallyResizeElements: [],
+			_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
+		});
+
+		// Wrap the element if it cannot hold child nodes
+		if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
+
+			this.element.wrap(
+				$("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
+					position: this.element.css("position"),
+					width: this.element.outerWidth(),
+					height: this.element.outerHeight(),
+					top: this.element.css("top"),
+					left: this.element.css("left")
+				})
+			);
+
+			this.element = this.element.parent().data(
+				"ui-resizable", this.element.resizable( "instance" )
+			);
+
+			this.elementIsWrapper = true;
+
+			this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
+			this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
+			// support: Safari
+			// Prevent Safari textarea resize
+			this.originalResizeStyle = this.originalElement.css("resize");
+			this.originalElement.css("resize", "none");
+
+			this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" }));
+
+			// support: IE9
+			// avoid IE jump (hard set the margin)
+			this.originalElement.css({ margin: this.originalElement.css("margin") });
+
+			this._proportionallyResize();
 		}
-	},
-	drag: function( event ) {
 
-		var i = $(this).data("ui-draggable"), o = i.options, scrolled = false;
-
-		if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
+		this.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" });
+		if(this.handles.constructor === String) {
 
-			if(!o.axis || o.axis !== "x") {
-				if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
-					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
-				} else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
-					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
-				}
+			if ( this.handles === "all") {
+				this.handles = "n,e,s,w,se,sw,ne,nw";
 			}
 
-			if(!o.axis || o.axis !== "y") {
-				if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
-					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
-				} else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) {
-					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
-				}
-			}
+			n = this.handles.split(",");
+			this.handles = {};
 
-		} else {
+			for(i = 0; i < n.length; i++) {
 
-			if(!o.axis || o.axis !== "x") {
-				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
-					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
-				} else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
-					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
-				}
-			}
+				handle = $.trim(n[i]);
+				hname = "ui-resizable-"+handle;
+				axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
 
-			if(!o.axis || o.axis !== "y") {
-				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
-					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
-				} else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
-					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+				axis.css({ zIndex: o.zIndex });
+
+				// TODO : What's going on here?
+				if ("se" === handle) {
+					axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
 				}
+
+				this.handles[handle] = ".ui-resizable-"+handle;
+				this.element.append(axis);
 			}
 
 		}
 
-		if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
-			$.ui.ddmanager.prepareOffsets(i, event);
-		}
+		this._renderAxis = function(target) {
 
-	}
-});
+			var i, axis, padPos, padWrapper;
 
-$.ui.plugin.add("draggable", "snap", {
-	start: function() {
+			target = target || this.element;
 
-		var i = $(this).data("ui-draggable"),
-			o = i.options;
+			for(i in this.handles) {
 
-		i.snapElements = [];
+				if(this.handles[i].constructor === String) {
+					this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
+				}
 
-		$(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
-			var $t = $(this),
-				$o = $t.offset();
-			if(this !== i.element[0]) {
-				i.snapElements.push({
-					item: this,
-					width: $t.outerWidth(), height: $t.outerHeight(),
-					top: $o.top, left: $o.left
-				});
-			}
-		});
+				if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
 
-	},
-	drag: function(event, ui) {
+					axis = $(this.handles[i], this.element);
 
-		var ts, bs, ls, rs, l, r, t, b, i, first,
-			inst = $(this).data("ui-draggable"),
-			o = inst.options,
-			d = o.snapTolerance,
-			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
-			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+					padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
 
-		for (i = inst.snapElements.length - 1; i >= 0; i--){
+					padPos = [ "padding",
+						/ne|nw|n/.test(i) ? "Top" :
+						/se|sw|s/.test(i) ? "Bottom" :
+						/^e$/.test(i) ? "Right" : "Left" ].join("");
 
-			l = inst.snapElements[i].left;
-			r = l + inst.snapElements[i].width;
-			t = inst.snapElements[i].top;
-			b = t + inst.snapElements[i].height;
+					target.css(padPos, padWrapper);
 
-			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
-				if(inst.snapElements[i].snapping) {
-					(inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
-				}
-				inst.snapElements[i].snapping = false;
-				continue;
-			}
+					this._proportionallyResize();
 
-			if(o.snapMode !== "inner") {
-				ts = Math.abs(t - y2) <= d;
-				bs = Math.abs(b - y1) <= d;
-				ls = Math.abs(l - x2) <= d;
-				rs = Math.abs(r - x1) <= d;
-				if(ts) {
-					ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
-				}
-				if(bs) {
-					ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
 				}
-				if(ls) {
-					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
-				}
-				if(rs) {
-					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+
+				// TODO: What's that good for? There's not anything to be executed left
+				if(!$(this.handles[i]).length) {
+					continue;
 				}
 			}
+		};
 
-			first = (ts || bs || ls || rs);
+		// TODO: make renderAxis a prototype function
+		this._renderAxis(this.element);
 
-			if(o.snapMode !== "outer") {
-				ts = Math.abs(t - y1) <= d;
-				bs = Math.abs(b - y2) <= d;
-				ls = Math.abs(l - x1) <= d;
-				rs = Math.abs(r - x2) <= d;
-				if(ts) {
-					ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
-				}
-				if(bs) {
-					ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
-				}
-				if(ls) {
-					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
-				}
-				if(rs) {
-					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
-				}
-			}
+		this._handles = $(".ui-resizable-handle", this.element)
+			.disableSelection();
 
-			if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
-				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+		this._handles.mouseover(function() {
+			if (!that.resizing) {
+				if (this.className) {
+					axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
+				}
+				that.axis = axis && axis[1] ? axis[1] : "se";
 			}
-			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+		});
 
+		if (o.autoHide) {
+			this._handles.hide();
+			$(this.element)
+				.addClass("ui-resizable-autohide")
+				.mouseenter(function() {
+					if (o.disabled) {
+						return;
+					}
+					$(this).removeClass("ui-resizable-autohide");
+					that._handles.show();
+				})
+				.mouseleave(function(){
+					if (o.disabled) {
+						return;
+					}
+					if (!that.resizing) {
+						$(this).addClass("ui-resizable-autohide");
+						that._handles.hide();
+					}
+				});
 		}
 
-	}
-});
-
-$.ui.plugin.add("draggable", "stack", {
-	start: function() {
-		var min,
-			o = this.data("ui-draggable").options,
-			group = $.makeArray($(o.stack)).sort(function(a,b) {
-				return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
-			});
+		this._mouseInit();
 
-		if (!group.length) { return; }
+	},
 
-		min = parseInt($(group[0]).css("zIndex"), 10) || 0;
-		$(group).each(function(i) {
-			$(this).css("zIndex", min + i);
-		});
-		this.css("zIndex", (min + group.length));
-	}
-});
+	_destroy: function() {
 
-$.ui.plugin.add("draggable", "zIndex", {
-	start: function(event, ui) {
-		var t = $(ui.helper), o = $(this).data("ui-draggable").options;
-		if(t.css("zIndex")) {
-			o._zIndex = t.css("zIndex");
-		}
-		t.css("zIndex", o.zIndex);
-	},
-	stop: function(event, ui) {
-		var o = $(this).data("ui-draggable").options;
-		if(o._zIndex) {
-			$(ui.helper).css("zIndex", o._zIndex);
-		}
-	}
-});
+		this._mouseDestroy();
 
-})(jQuery);
-(function( $, undefined ) {
+		var wrapper,
+			_destroy = function(exp) {
+				$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
+					.removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove();
+			};
 
-function isOverAxis( x, reference, size ) {
-	return ( x > reference ) && ( x < ( reference + size ) );
-}
+		// TODO: Unwrap at same DOM position
+		if (this.elementIsWrapper) {
+			_destroy(this.element);
+			wrapper = this.element;
+			this.originalElement.css({
+				position: wrapper.css("position"),
+				width: wrapper.outerWidth(),
+				height: wrapper.outerHeight(),
+				top: wrapper.css("top"),
+				left: wrapper.css("left")
+			}).insertAfter( wrapper );
+			wrapper.remove();
+		}
 
-$.widget("ui.droppable", {
-	version: "1.10.4",
-	widgetEventPrefix: "drop",
-	options: {
-		accept: "*",
-		activeClass: false,
-		addClasses: true,
-		greedy: false,
-		hoverClass: false,
-		scope: "default",
-		tolerance: "intersect",
+		this.originalElement.css("resize", this.originalResizeStyle);
+		_destroy(this.originalElement);
 
-		// callbacks
-		activate: null,
-		deactivate: null,
-		drop: null,
-		out: null,
-		over: null
+		return this;
 	},
-	_create: function() {
 
-		var proportions,
-			o = this.options,
-			accept = o.accept;
+	_mouseCapture: function(event) {
+		var i, handle,
+			capture = false;
 
-		this.isover = false;
-		this.isout = true;
+		for (i in this.handles) {
+			handle = $(this.handles[i])[0];
+			if (handle === event.target || $.contains(handle, event.target)) {
+				capture = true;
+			}
+		}
 
-		this.accept = $.isFunction(accept) ? accept : function(d) {
-			return d.is(accept);
-		};
+		return !this.options.disabled && capture;
+	},
 
-		this.proportions = function( /* valueToWrite */ ) {
-			if ( arguments.length ) {
-				// Store the droppable's proportions
-				proportions = arguments[ 0 ];
-			} else {
-				// Retrieve or derive the droppable's proportions
-				return proportions ?
-					proportions :
-					proportions = {
-						width: this.element[ 0 ].offsetWidth,
-						height: this.element[ 0 ].offsetHeight
-					};
-			}
-		};
+	_mouseStart: function(event) {
 
-		// Add the reference and positions to the manager
-		$.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || [];
-		$.ui.ddmanager.droppables[o.scope].push(this);
+		var curleft, curtop, cursor,
+			o = this.options,
+			el = this.element;
 
-		(o.addClasses && this.element.addClass("ui-droppable"));
+		this.resizing = true;
 
-	},
+		this._renderProxy();
 
-	_destroy: function() {
-		var i = 0,
-			drop = $.ui.ddmanager.droppables[this.options.scope];
+		curleft = this._num(this.helper.css("left"));
+		curtop = this._num(this.helper.css("top"));
 
-		for ( ; i < drop.length; i++ ) {
-			if ( drop[i] === this ) {
-				drop.splice(i, 1);
-			}
+		if (o.containment) {
+			curleft += $(o.containment).scrollLeft() || 0;
+			curtop += $(o.containment).scrollTop() || 0;
 		}
 
-		this.element.removeClass("ui-droppable ui-droppable-disabled");
-	},
+		this.offset = this.helper.offset();
+		this.position = { left: curleft, top: curtop };
+		this.size = this._helper ? { width: this.helper.width(), height: this.helper.height() } : { width: el.width(), height: el.height() };
+		this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
+		this.originalPosition = { left: curleft, top: curtop };
+		this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
+		this.originalMousePosition = { left: event.pageX, top: event.pageY };
 
-	_setOption: function(key, value) {
+		this.aspectRatio = (typeof o.aspectRatio === "number") ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
 
-		if(key === "accept") {
-			this.accept = $.isFunction(value) ? value : function(d) {
-				return d.is(value);
-			};
-		}
-		$.Widget.prototype._setOption.apply(this, arguments);
-	},
+		cursor = $(".ui-resizable-" + this.axis).css("cursor");
+		$("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
 
-	_activate: function(event) {
-		var draggable = $.ui.ddmanager.current;
-		if(this.options.activeClass) {
-			this.element.addClass(this.options.activeClass);
-		}
-		if(draggable){
-			this._trigger("activate", event, this.ui(draggable));
-		}
+		el.addClass("ui-resizable-resizing");
+		this._propagate("start", event);
+		return true;
 	},
 
-	_deactivate: function(event) {
-		var draggable = $.ui.ddmanager.current;
-		if(this.options.activeClass) {
-			this.element.removeClass(this.options.activeClass);
-		}
-		if(draggable){
-			this._trigger("deactivate", event, this.ui(draggable));
-		}
-	},
+	_mouseDrag: function(event) {
 
-	_over: function(event) {
+		var data,
+			el = this.helper, props = {},
+			smp = this.originalMousePosition,
+			a = this.axis,
+			dx = (event.pageX-smp.left)||0,
+			dy = (event.pageY-smp.top)||0,
+			trigger = this._change[a];
 
-		var draggable = $.ui.ddmanager.current;
+		this.prevPosition = {
+			top: this.position.top,
+			left: this.position.left
+		};
+		this.prevSize = {
+			width: this.size.width,
+			height: this.size.height
+		};
 
-		// Bail if draggable and droppable are same element
-		if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
-			return;
+		if (!trigger) {
+			return false;
 		}
 
-		if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
-			if(this.options.hoverClass) {
-				this.element.addClass(this.options.hoverClass);
-			}
-			this._trigger("over", event, this.ui(draggable));
+		data = trigger.apply(this, [event, dx, dy]);
+
+		this._updateVirtualBoundaries(event.shiftKey);
+		if (this._aspectRatio || event.shiftKey) {
+			data = this._updateRatio(data, event);
 		}
 
-	},
+		data = this._respectSize(data, event);
 
-	_out: function(event) {
+		this._updateCache(data);
 
-		var draggable = $.ui.ddmanager.current;
+		this._propagate("resize", event);
 
-		// Bail if draggable and droppable are same element
-		if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
-			return;
+		if ( this.position.top !== this.prevPosition.top ) {
+			props.top = this.position.top + "px";
+		}
+		if ( this.position.left !== this.prevPosition.left ) {
+			props.left = this.position.left + "px";
 		}
+		if ( this.size.width !== this.prevSize.width ) {
+			props.width = this.size.width + "px";
+		}
+		if ( this.size.height !== this.prevSize.height ) {
+			props.height = this.size.height + "px";
+		}
+		el.css( props );
 
-		if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
-			if(this.options.hoverClass) {
-				this.element.removeClass(this.options.hoverClass);
-			}
-			this._trigger("out", event, this.ui(draggable));
+		if ( !this._helper && this._proportionallyResizeElements.length ) {
+			this._proportionallyResize();
+		}
+
+		if ( !$.isEmptyObject( props ) ) {
+			this._trigger( "resize", event, this.ui() );
 		}
 
+		return false;
 	},
 
-	_drop: function(event,custom) {
+	_mouseStop: function(event) {
 
-		var draggable = custom || $.ui.ddmanager.current,
-			childrenIntersection = false;
+		this.resizing = false;
+		var pr, ista, soffseth, soffsetw, s, left, top,
+			o = this.options, that = this;
 
-		// Bail if draggable and droppable are same element
-		if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
-			return false;
-		}
+		if(this._helper) {
 
-		this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function() {
-			var inst = $.data(this, "ui-droppable");
-			if(
-				inst.options.greedy &&
-				!inst.options.disabled &&
-				inst.options.scope === draggable.options.scope &&
-				inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) &&
-				$.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)
-			) { childrenIntersection = true; return false; }
-		});
-		if(childrenIntersection) {
-			return false;
-		}
+			pr = this._proportionallyResizeElements;
+			ista = pr.length && (/textarea/i).test(pr[0].nodeName);
+			soffseth = ista && this._hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height;
+			soffsetw = ista ? 0 : that.sizeDiff.width;
+
+			s = { width: (that.helper.width()  - soffsetw), height: (that.helper.height() - soffseth) };
+			left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null;
+			top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
 
-		if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
-			if(this.options.activeClass) {
-				this.element.removeClass(this.options.activeClass);
+			if (!o.animate) {
+				this.element.css($.extend(s, { top: top, left: left }));
 			}
-			if(this.options.hoverClass) {
-				this.element.removeClass(this.options.hoverClass);
+
+			that.helper.height(that.size.height);
+			that.helper.width(that.size.width);
+
+			if (this._helper && !o.animate) {
+				this._proportionallyResize();
 			}
-			this._trigger("drop", event, this.ui(draggable));
-			return this.element;
 		}
 
-		return false;
-
-	},
+		$("body").css("cursor", "auto");
 
-	ui: function(c) {
-		return {
-			draggable: (c.currentItem || c.element),
-			helper: c.helper,
-			position: c.position,
-			offset: c.positionAbs
-		};
-	}
+		this.element.removeClass("ui-resizable-resizing");
 
-});
+		this._propagate("stop", event);
 
-$.ui.intersect = function(draggable, droppable, toleranceMode) {
+		if (this._helper) {
+			this.helper.remove();
+		}
 
-	if (!droppable.offset) {
 		return false;
-	}
-
-	var draggableLeft, draggableTop,
-		x1 = (draggable.positionAbs || draggable.position.absolute).left,
-		y1 = (draggable.positionAbs || draggable.position.absolute).top,
-		x2 = x1 + draggable.helperProportions.width,
-		y2 = y1 + draggable.helperProportions.height,
-		l = droppable.offset.left,
-		t = droppable.offset.top,
-		r = l + droppable.proportions().width,
-		b = t + droppable.proportions().height;
-
-	switch (toleranceMode) {
-		case "fit":
-			return (l <= x1 && x2 <= r && t <= y1 && y2 <= b);
-		case "intersect":
-			return (l < x1 + (draggable.helperProportions.width / 2) && // Right Half
-				x2 - (draggable.helperProportions.width / 2) < r && // Left Half
-				t < y1 + (draggable.helperProportions.height / 2) && // Bottom Half
-				y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
-		case "pointer":
-			draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left);
-			draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top);
-			return isOverAxis( draggableTop, t, droppable.proportions().height ) && isOverAxis( draggableLeft, l, droppable.proportions().width );
-		case "touch":
-			return (
-				(y1 >= t && y1 <= b) ||	// Top edge touching
-				(y2 >= t && y2 <= b) ||	// Bottom edge touching
-				(y1 < t && y2 > b)		// Surrounded vertically
-			) && (
-				(x1 >= l && x1 <= r) ||	// Left edge touching
-				(x2 >= l && x2 <= r) ||	// Right edge touching
-				(x1 < l && x2 > r)		// Surrounded horizontally
-			);
-		default:
-			return false;
-		}
 
-};
+	},
 
-/*
-	This manager tracks offsets of draggables and droppables
-*/
-$.ui.ddmanager = {
-	current: null,
-	droppables: { "default": [] },
-	prepareOffsets: function(t, event) {
+	_updateVirtualBoundaries: function(forceAspectRatio) {
+		var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
+			o = this.options;
 
-		var i, j,
-			m = $.ui.ddmanager.droppables[t.options.scope] || [],
-			type = event ? event.type : null, // workaround for #2317
-			list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack();
+		b = {
+			minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
+			maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
+			minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
+			maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
+		};
 
-		droppablesLoop: for (i = 0; i < m.length; i++) {
+		if(this._aspectRatio || forceAspectRatio) {
+			pMinWidth = b.minHeight * this.aspectRatio;
+			pMinHeight = b.minWidth / this.aspectRatio;
+			pMaxWidth = b.maxHeight * this.aspectRatio;
+			pMaxHeight = b.maxWidth / this.aspectRatio;
 
-			//No disabled and non-accepted
-			if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) {
-				continue;
+			if(pMinWidth > b.minWidth) {
+				b.minWidth = pMinWidth;
 			}
-
-			// Filter out elements in the current dragged item
-			for (j=0; j < list.length; j++) {
-				if(list[j] === m[i].element[0]) {
-					m[i].proportions().height = 0;
-					continue droppablesLoop;
-				}
+			if(pMinHeight > b.minHeight) {
+				b.minHeight = pMinHeight;
 			}
-
-			m[i].visible = m[i].element.css("display") !== "none";
-			if(!m[i].visible) {
-				continue;
+			if(pMaxWidth < b.maxWidth) {
+				b.maxWidth = pMaxWidth;
 			}
-
-			//Activate the droppable if used directly from draggables
-			if(type === "mousedown") {
-				m[i]._activate.call(m[i], event);
+			if(pMaxHeight < b.maxHeight) {
+				b.maxHeight = pMaxHeight;
 			}
+		}
+		this._vBoundaries = b;
+	},
 
-			m[ i ].offset = m[ i ].element.offset();
-			m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
+	_updateCache: function(data) {
+		this.offset = this.helper.offset();
+		if (this._isNumber(data.left)) {
+			this.position.left = data.left;
+		}
+		if (this._isNumber(data.top)) {
+			this.position.top = data.top;
+		}
+		if (this._isNumber(data.height)) {
+			this.size.height = data.height;
+		}
+		if (this._isNumber(data.width)) {
+			this.size.width = data.width;
+		}
+	},
+
+	_updateRatio: function( data ) {
+
+		var cpos = this.position,
+			csize = this.size,
+			a = this.axis;
+
+		if (this._isNumber(data.height)) {
+			data.width = (data.height * this.aspectRatio);
+		} else if (this._isNumber(data.width)) {
+			data.height = (data.width / this.aspectRatio);
+		}
 
+		if (a === "sw") {
+			data.left = cpos.left + (csize.width - data.width);
+			data.top = null;
+		}
+		if (a === "nw") {
+			data.top = cpos.top + (csize.height - data.height);
+			data.left = cpos.left + (csize.width - data.width);
 		}
 
+		return data;
 	},
-	drop: function(draggable, event) {
 
-		var dropped = false;
-		// Create a copy of the droppables in case the list changes during the drop (#9116)
-		$.each(($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(), function() {
+	_respectSize: function( data ) {
 
-			if(!this.options) {
-				return;
-			}
-			if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) {
-				dropped = this._drop.call(this, event) || dropped;
-			}
+		var o = this._vBoundaries,
+			a = this.axis,
+			ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
+			isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
+			dw = this.originalPosition.left + this.originalSize.width,
+			dh = this.position.top + this.size.height,
+			cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
+		if (isminw) {
+			data.width = o.minWidth;
+		}
+		if (isminh) {
+			data.height = o.minHeight;
+		}
+		if (ismaxw) {
+			data.width = o.maxWidth;
+		}
+		if (ismaxh) {
+			data.height = o.maxHeight;
+		}
 
-			if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
-				this.isout = true;
-				this.isover = false;
-				this._deactivate.call(this, event);
-			}
+		if (isminw && cw) {
+			data.left = dw - o.minWidth;
+		}
+		if (ismaxw && cw) {
+			data.left = dw - o.maxWidth;
+		}
+		if (isminh && ch) {
+			data.top = dh - o.minHeight;
+		}
+		if (ismaxh && ch) {
+			data.top = dh - o.maxHeight;
+		}
 
-		});
-		return dropped;
+		// Fixing jump error on top/left - bug #2330
+		if (!data.width && !data.height && !data.left && data.top) {
+			data.top = null;
+		} else if (!data.width && !data.height && !data.top && data.left) {
+			data.left = null;
+		}
 
+		return data;
 	},
-	dragStart: function( draggable, event ) {
-		//Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
-		draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
-			if( !draggable.options.refreshPositions ) {
-				$.ui.ddmanager.prepareOffsets( draggable, event );
-			}
-		});
-	},
-	drag: function(draggable, event) {
 
-		//If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
-		if(draggable.options.refreshPositions) {
-			$.ui.ddmanager.prepareOffsets(draggable, event);
+	_proportionallyResize: function() {
+
+		if (!this._proportionallyResizeElements.length) {
+			return;
 		}
 
-		//Run through all droppables and check their positions based on specific tolerance options
-		$.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
+		var i, j, borders, paddings, prel,
+			element = this.helper || this.element;
 
-			if(this.options.disabled || this.greedyChild || !this.visible) {
-				return;
-			}
+		for ( i=0; i < this._proportionallyResizeElements.length; i++) {
 
-			var parentInstance, scope, parent,
-				intersects = $.ui.intersect(draggable, this, this.options.tolerance),
-				c = !intersects && this.isover ? "isout" : (intersects && !this.isover ? "isover" : null);
-			if(!c) {
-				return;
-			}
+			prel = this._proportionallyResizeElements[i];
 
-			if (this.options.greedy) {
-				// find droppable parents with same scope
-				scope = this.options.scope;
-				parent = this.element.parents(":data(ui-droppable)").filter(function () {
-					return $.data(this, "ui-droppable").options.scope === scope;
-				});
+			if (!this.borderDif) {
+				this.borderDif = [];
+				borders = [prel.css("borderTopWidth"), prel.css("borderRightWidth"), prel.css("borderBottomWidth"), prel.css("borderLeftWidth")];
+				paddings = [prel.css("paddingTop"), prel.css("paddingRight"), prel.css("paddingBottom"), prel.css("paddingLeft")];
 
-				if (parent.length) {
-					parentInstance = $.data(parent[0], "ui-droppable");
-					parentInstance.greedyChild = (c === "isover");
+				for ( j = 0; j < borders.length; j++ ) {
+					this.borderDif[ j ] = ( parseInt( borders[ j ], 10 ) || 0 ) + ( parseInt( paddings[ j ], 10 ) || 0 );
 				}
 			}
 
-			// we just moved into a greedy child
-			if (parentInstance && c === "isover") {
-				parentInstance.isover = false;
-				parentInstance.isout = true;
-				parentInstance._out.call(parentInstance, event);
-			}
-
-			this[c] = true;
-			this[c === "isout" ? "isover" : "isout"] = false;
-			this[c === "isover" ? "_over" : "_out"].call(this, event);
-
-			// we just moved out of a greedy child
-			if (parentInstance && c === "isout") {
-				parentInstance.isout = false;
-				parentInstance.isover = true;
-				parentInstance._over.call(parentInstance, event);
-			}
-		});
+			prel.css({
+				height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
+				width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
+			});
 
-	},
-	dragStop: function( draggable, event ) {
-		draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
-		//Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
-		if( !draggable.options.refreshPositions ) {
-			$.ui.ddmanager.prepareOffsets( draggable, event );
 		}
-	}
-};
 
-})(jQuery);
-(function($, undefined) {
+	},
 
-var dataSpace = "ui-effects-";
+	_renderProxy: function() {
 
-$.effects = {
-	effect: {}
-};
+		var el = this.element, o = this.options;
+		this.elementOffset = el.offset();
 
-/*!
- * jQuery Color Animations v2.1.2
- * https://github.com/jquery/jquery-color
- *
- * Copyright 2013 jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * Date: Wed Jan 16 08:47:09 2013 -0600
- */
-(function( jQuery, undefined ) {
+		if(this._helper) {
 
-	var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
+			this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
 
-	// plusequals test for += 100 -= 100
-	rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
-	// a set of RE's that can match strings and generate color tuples.
-	stringParsers = [{
-			re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
-			parse: function( execResult ) {
-				return [
-					execResult[ 1 ],
-					execResult[ 2 ],
-					execResult[ 3 ],
-					execResult[ 4 ]
-				];
-			}
-		}, {
-			re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
-			parse: function( execResult ) {
-				return [
-					execResult[ 1 ] * 2.55,
-					execResult[ 2 ] * 2.55,
-					execResult[ 3 ] * 2.55,
-					execResult[ 4 ]
-				];
-			}
-		}, {
-			// this regex ignores A-F because it's compared against an already lowercased string
-			re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
-			parse: function( execResult ) {
-				return [
-					parseInt( execResult[ 1 ], 16 ),
-					parseInt( execResult[ 2 ], 16 ),
-					parseInt( execResult[ 3 ], 16 )
-				];
-			}
-		}, {
-			// this regex ignores A-F because it's compared against an already lowercased string
-			re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
-			parse: function( execResult ) {
-				return [
-					parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
-					parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
-					parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
-				];
-			}
-		}, {
-			re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
-			space: "hsla",
-			parse: function( execResult ) {
-				return [
-					execResult[ 1 ],
-					execResult[ 2 ] / 100,
-					execResult[ 3 ] / 100,
-					execResult[ 4 ]
-				];
-			}
-		}],
+			this.helper.addClass(this._helper).css({
+				width: this.element.outerWidth() - 1,
+				height: this.element.outerHeight() - 1,
+				position: "absolute",
+				left: this.elementOffset.left +"px",
+				top: this.elementOffset.top +"px",
+				zIndex: ++o.zIndex //TODO: Don't modify option
+			});
 
-	// jQuery.Color( )
-	color = jQuery.Color = function( color, green, blue, alpha ) {
-		return new jQuery.Color.fn.parse( color, green, blue, alpha );
-	},
-	spaces = {
-		rgba: {
-			props: {
-				red: {
-					idx: 0,
-					type: "byte"
-				},
-				green: {
-					idx: 1,
-					type: "byte"
-				},
-				blue: {
-					idx: 2,
-					type: "byte"
-				}
-			}
-		},
+			this.helper
+				.appendTo("body")
+				.disableSelection();
 
-		hsla: {
-			props: {
-				hue: {
-					idx: 0,
-					type: "degrees"
-				},
-				saturation: {
-					idx: 1,
-					type: "percent"
-				},
-				lightness: {
-					idx: 2,
-					type: "percent"
-				}
-			}
+		} else {
+			this.helper = this.element;
 		}
+
 	},
-	propTypes = {
-		"byte": {
-			floor: true,
-			max: 255
+
+	_change: {
+		e: function(event, dx) {
+			return { width: this.originalSize.width + dx };
 		},
-		"percent": {
-			max: 1
+		w: function(event, dx) {
+			var cs = this.originalSize, sp = this.originalPosition;
+			return { left: sp.left + dx, width: cs.width - dx };
 		},
-		"degrees": {
-			mod: 360,
-			floor: true
+		n: function(event, dx, dy) {
+			var cs = this.originalSize, sp = this.originalPosition;
+			return { top: sp.top + dy, height: cs.height - dy };
+		},
+		s: function(event, dx, dy) {
+			return { height: this.originalSize.height + dy };
+		},
+		se: function(event, dx, dy) {
+			return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
+		},
+		sw: function(event, dx, dy) {
+			return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
+		},
+		ne: function(event, dx, dy) {
+			return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
+		},
+		nw: function(event, dx, dy) {
+			return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
 		}
 	},
-	support = color.support = {},
 
-	// element for support tests
-	supportElem = jQuery( "<p>" )[ 0 ],
+	_propagate: function(n, event) {
+		$.ui.plugin.call(this, n, [event, this.ui()]);
+		(n !== "resize" && this._trigger(n, event, this.ui()));
+	},
 
-	// colors = jQuery.Color.names
-	colors,
+	plugins: {},
 
-	// local aliases of functions called often
-	each = jQuery.each;
+	ui: function() {
+		return {
+			originalElement: this.originalElement,
+			element: this.element,
+			helper: this.helper,
+			position: this.position,
+			size: this.size,
+			originalSize: this.originalSize,
+			originalPosition: this.originalPosition,
+			prevSize: this.prevSize,
+			prevPosition: this.prevPosition
+		};
+	}
 
-// determine rgba support immediately
-supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
-support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
+});
+
+/*
+ * Resizable Extensions
+ */
+
+$.ui.plugin.add("resizable", "animate", {
+
+	stop: function( event ) {
+		var that = $(this).resizable( "instance" ),
+			o = that.options,
+			pr = that._proportionallyResizeElements,
+			ista = pr.length && (/textarea/i).test(pr[0].nodeName),
+			soffseth = ista && that._hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height,
+			soffsetw = ista ? 0 : that.sizeDiff.width,
+			style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
+			left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null,
+			top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
+
+		that.element.animate(
+			$.extend(style, top && left ? { top: top, left: left } : {}), {
+				duration: o.animateDuration,
+				easing: o.animateEasing,
+				step: function() {
+
+					var data = {
+						width: parseInt(that.element.css("width"), 10),
+						height: parseInt(that.element.css("height"), 10),
+						top: parseInt(that.element.css("top"), 10),
+						left: parseInt(that.element.css("left"), 10)
+					};
 
-// define cache name and alpha properties
-// for rgba and hsla spaces
-each( spaces, function( spaceName, space ) {
-	space.cache = "_" + spaceName;
-	space.props.alpha = {
-		idx: 3,
-		type: "percent",
-		def: 1
-	};
-});
+					if (pr && pr.length) {
+						$(pr[0]).css({ width: data.width, height: data.height });
+					}
 
-function clamp( value, prop, allowEmpty ) {
-	var type = propTypes[ prop.type ] || {};
+					// propagating resize, and updating values for each animation step
+					that._updateCache(data);
+					that._propagate("resize", event);
 
-	if ( value == null ) {
-		return (allowEmpty || !prop.def) ? null : prop.def;
+				}
+			}
+		);
 	}
 
-	// ~~ is an short way of doing floor for positive numbers
-	value = type.floor ? ~~value : parseFloat( value );
+});
 
-	// IE will pass in empty strings as value for alpha,
-	// which will hit this case
-	if ( isNaN( value ) ) {
-		return prop.def;
-	}
+$.ui.plugin.add( "resizable", "containment", {
 
-	if ( type.mod ) {
-		// we add mod before modding to make sure that negatives values
-		// get converted properly: -10 -> 350
-		return (value + type.mod) % type.mod;
-	}
+	start: function() {
+		var element, p, co, ch, cw, width, height,
+			that = $( this ).resizable( "instance" ),
+			o = that.options,
+			el = that.element,
+			oc = o.containment,
+			ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
 
-	// for now all property types without mod have min and max
-	return 0 > value ? 0 : type.max < value ? type.max : value;
-}
+		if ( !ce ) {
+			return;
+		}
 
-function stringParse( string ) {
-	var inst = color(),
-		rgba = inst._rgba = [];
+		that.containerElement = $( ce );
 
-	string = string.toLowerCase();
+		if ( /document/.test( oc ) || oc === document ) {
+			that.containerOffset = {
+				left: 0,
+				top: 0
+			};
+			that.containerPosition = {
+				left: 0,
+				top: 0
+			};
 
-	each( stringParsers, function( i, parser ) {
-		var parsed,
-			match = parser.re.exec( string ),
-			values = match && parser.parse( match ),
-			spaceName = parser.space || "rgba";
+			that.parentData = {
+				element: $( document ),
+				left: 0,
+				top: 0,
+				width: $( document ).width(),
+				height: $( document ).height() || document.body.parentNode.scrollHeight
+			};
+		} else {
+			element = $( ce );
+			p = [];
+			$([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) {
+				p[ i ] = that._num( element.css( "padding" + name ) );
+			});
 
-		if ( values ) {
-			parsed = inst[ spaceName ]( values );
+			that.containerOffset = element.offset();
+			that.containerPosition = element.position();
+			that.containerSize = {
+				height: ( element.innerHeight() - p[ 3 ] ),
+				width: ( element.innerWidth() - p[ 1 ] )
+			};
 
-			// if this was an rgba parse the assignment might happen twice
-			// oh well....
-			inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
-			rgba = inst._rgba = parsed._rgba;
+			co = that.containerOffset;
+			ch = that.containerSize.height;
+			cw = that.containerSize.width;
+			width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
+			height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
 
-			// exit each( stringParsers ) here because we matched
-			return false;
+			that.parentData = {
+				element: ce,
+				left: co.left,
+				top: co.top,
+				width: width,
+				height: height
+			};
 		}
-	});
+	},
 
-	// Found a stringParser that handled it
-	if ( rgba.length ) {
+	resize: function( event, ui ) {
+		var woset, hoset, isParent, isOffsetRelative,
+			that = $( this ).resizable( "instance" ),
+			o = that.options,
+			co = that.containerOffset,
+			cp = that.position,
+			pRatio = that._aspectRatio || event.shiftKey,
+			cop = {
+				top: 0,
+				left: 0
+			},
+			ce = that.containerElement,
+			continueResize = true;
 
-		// if this came from a parsed string, force "transparent" when alpha is 0
-		// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
-		if ( rgba.join() === "0,0,0,0" ) {
-			jQuery.extend( rgba, colors.transparent );
+		if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
+			cop = co;
 		}
-		return inst;
-	}
 
-	// named colors
-	return colors[ string ];
-}
+		if ( cp.left < ( that._helper ? co.left : 0 ) ) {
+			that.size.width = that.size.width + ( that._helper ? ( that.position.left - co.left ) : ( that.position.left - cop.left ) );
+			if ( pRatio ) {
+				that.size.height = that.size.width / that.aspectRatio;
+				continueResize = false;
+			}
+			that.position.left = o.helper ? co.left : 0;
+		}
 
-color.fn = jQuery.extend( color.prototype, {
-	parse: function( red, green, blue, alpha ) {
-		if ( red === undefined ) {
-			this._rgba = [ null, null, null, null ];
-			return this;
+		if ( cp.top < ( that._helper ? co.top : 0 ) ) {
+			that.size.height = that.size.height + ( that._helper ? ( that.position.top - co.top ) : that.position.top );
+			if ( pRatio ) {
+				that.size.width = that.size.height * that.aspectRatio;
+				continueResize = false;
+			}
+			that.position.top = that._helper ? co.top : 0;
 		}
-		if ( red.jquery || red.nodeType ) {
-			red = jQuery( red ).css( green );
-			green = undefined;
+
+		that.offset.left = that.parentData.left + that.position.left;
+		that.offset.top = that.parentData.top + that.position.top;
+
+		woset = Math.abs( ( that._helper ? that.offset.left - cop.left : ( that.offset.left - co.left ) ) + that.sizeDiff.width );
+		hoset = Math.abs( ( that._helper ? that.offset.top - cop.top : ( that.offset.top - co.top ) ) + that.sizeDiff.height );
+
+		isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
+		isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
+
+		if ( isParent && isOffsetRelative ) {
+			woset -= Math.abs( that.parentData.left );
 		}
 
-		var inst = this,
-			type = jQuery.type( red ),
-			rgba = this._rgba = [];
+		if ( woset + that.size.width >= that.parentData.width ) {
+			that.size.width = that.parentData.width - woset;
+			if ( pRatio ) {
+				that.size.height = that.size.width / that.aspectRatio;
+				continueResize = false;
+			}
+		}
 
-		// more than 1 argument specified - assume ( red, green, blue, alpha )
-		if ( green !== undefined ) {
-			red = [ red, green, blue, alpha ];
-			type = "array";
+		if ( hoset + that.size.height >= that.parentData.height ) {
+			that.size.height = that.parentData.height - hoset;
+			if ( pRatio ) {
+				that.size.width = that.size.height * that.aspectRatio;
+				continueResize = false;
+			}
 		}
 
-		if ( type === "string" ) {
-			return this.parse( stringParse( red ) || colors._default );
+		if ( !continueResize ){
+			that.position.left = ui.prevPosition.left;
+			that.position.top = ui.prevPosition.top;
+			that.size.width = ui.prevSize.width;
+			that.size.height = ui.prevSize.height;
 		}
+	},
 
-		if ( type === "array" ) {
-			each( spaces.rgba.props, function( key, prop ) {
-				rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
+	stop: function(){
+		var that = $( this ).resizable( "instance" ),
+			o = that.options,
+			co = that.containerOffset,
+			cop = that.containerPosition,
+			ce = that.containerElement,
+			helper = $( that.helper ),
+			ho = helper.offset(),
+			w = helper.outerWidth() - that.sizeDiff.width,
+			h = helper.outerHeight() - that.sizeDiff.height;
+
+		if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
+			$( this ).css({
+				left: ho.left - cop.left - co.left,
+				width: w,
+				height: h
 			});
-			return this;
 		}
 
-		if ( type === "object" ) {
-			if ( red instanceof color ) {
-				each( spaces, function( spaceName, space ) {
-					if ( red[ space.cache ] ) {
-						inst[ space.cache ] = red[ space.cache ].slice();
-					}
-				});
-			} else {
-				each( spaces, function( spaceName, space ) {
-					var cache = space.cache;
-					each( space.props, function( key, prop ) {
-
-						// if the cache doesn't exist, and we know how to convert
-						if ( !inst[ cache ] && space.to ) {
+		if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
+			$( this ).css({
+				left: ho.left - cop.left - co.left,
+				width: w,
+				height: h
+			});
+		}
+	}
+});
 
-							// if the value was null, we don't need to copy it
-							// if the key was alpha, we don't need to copy it either
-							if ( key === "alpha" || red[ key ] == null ) {
-								return;
-							}
-							inst[ cache ] = space.to( inst._rgba );
-						}
+$.ui.plugin.add("resizable", "alsoResize", {
 
-						// this is the only case where we allow nulls for ALL properties.
-						// call clamp with alwaysAllowEmpty
-						inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
+	start: function () {
+		var that = $(this).resizable( "instance" ),
+			o = that.options,
+			_store = function (exp) {
+				$(exp).each(function() {
+					var el = $(this);
+					el.data("ui-resizable-alsoresize", {
+						width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
+						left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
 					});
-
-					// everything defined but alpha?
-					if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
-						// use the default of 1
-						inst[ cache ][ 3 ] = 1;
-						if ( space.from ) {
-							inst._rgba = space.from( inst[ cache ] );
-						}
-					}
 				});
-			}
-			return this;
+			};
+
+		if (typeof(o.alsoResize) === "object" && !o.alsoResize.parentNode) {
+			if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
+			else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
+		}else{
+			_store(o.alsoResize);
 		}
 	},
-	is: function( compare ) {
-		var is = color( compare ),
-			same = true,
-			inst = this;
 
-		each( spaces, function( _, space ) {
-			var localCache,
-				isCache = is[ space.cache ];
-			if (isCache) {
-				localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
-				each( space.props, function( _, prop ) {
-					if ( isCache[ prop.idx ] != null ) {
-						same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
-						return same;
-					}
-				});
-			}
-			return same;
-		});
-		return same;
-	},
-	_space: function() {
-		var used = [],
-			inst = this;
-		each( spaces, function( spaceName, space ) {
-			if ( inst[ space.cache ] ) {
-				used.push( spaceName );
-			}
-		});
-		return used.pop();
-	},
-	transition: function( other, distance ) {
-		var end = color( other ),
-			spaceName = end._space(),
-			space = spaces[ spaceName ],
-			startColor = this.alpha() === 0 ? color( "transparent" ) : this,
-			start = startColor[ space.cache ] || space.to( startColor._rgba ),
-			result = start.slice();
+	resize: function (event, ui) {
+		var that = $(this).resizable( "instance" ),
+			o = that.options,
+			os = that.originalSize,
+			op = that.originalPosition,
+			delta = {
+				height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0,
+				top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0
+			},
 
-		end = end[ space.cache ];
-		each( space.props, function( key, prop ) {
-			var index = prop.idx,
-				startValue = start[ index ],
-				endValue = end[ index ],
-				type = propTypes[ prop.type ] || {};
+			_alsoResize = function (exp, c) {
+				$(exp).each(function() {
+					var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
+						css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
 
-			// if null, don't override start value
-			if ( endValue === null ) {
-				return;
-			}
-			// if null - use end
-			if ( startValue === null ) {
-				result[ index ] = endValue;
-			} else {
-				if ( type.mod ) {
-					if ( endValue - startValue > type.mod / 2 ) {
-						startValue += type.mod;
-					} else if ( startValue - endValue > type.mod / 2 ) {
-						startValue -= type.mod;
-					}
-				}
-				result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
-			}
-		});
-		return this[ spaceName ]( result );
-	},
-	blend: function( opaque ) {
-		// if we are already opaque - return ourself
-		if ( this._rgba[ 3 ] === 1 ) {
-			return this;
-		}
+					$.each(css, function (i, prop) {
+						var sum = (start[prop]||0) + (delta[prop]||0);
+						if (sum && sum >= 0) {
+							style[prop] = sum || null;
+						}
+					});
 
-		var rgb = this._rgba.slice(),
-			a = rgb.pop(),
-			blend = color( opaque )._rgba;
+					el.css(style);
+				});
+			};
 
-		return color( jQuery.map( rgb, function( v, i ) {
-			return ( 1 - a ) * blend[ i ] + a * v;
-		}));
+		if (typeof(o.alsoResize) === "object" && !o.alsoResize.nodeType) {
+			$.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
+		}else{
+			_alsoResize(o.alsoResize);
+		}
 	},
-	toRgbaString: function() {
-		var prefix = "rgba(",
-			rgba = jQuery.map( this._rgba, function( v, i ) {
-				return v == null ? ( i > 2 ? 1 : 0 ) : v;
-			});
 
-		if ( rgba[ 3 ] === 1 ) {
-			rgba.pop();
-			prefix = "rgb(";
-		}
+	stop: function () {
+		$(this).removeData("resizable-alsoresize");
+	}
+});
 
-		return prefix + rgba.join() + ")";
-	},
-	toHslaString: function() {
-		var prefix = "hsla(",
-			hsla = jQuery.map( this.hsla(), function( v, i ) {
-				if ( v == null ) {
-					v = i > 2 ? 1 : 0;
-				}
+$.ui.plugin.add("resizable", "ghost", {
 
-				// catch 1 and 2
-				if ( i && i < 3 ) {
-					v = Math.round( v * 100 ) + "%";
-				}
-				return v;
-			});
+	start: function() {
 
-		if ( hsla[ 3 ] === 1 ) {
-			hsla.pop();
-			prefix = "hsl(";
+		var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
+
+		that.ghost = that.originalElement.clone();
+		that.ghost
+			.css({ opacity: 0.25, display: "block", position: "relative", height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
+			.addClass("ui-resizable-ghost")
+			.addClass(typeof o.ghost === "string" ? o.ghost : "");
+
+		that.ghost.appendTo(that.helper);
+
+	},
+
+	resize: function(){
+		var that = $(this).resizable( "instance" );
+		if (that.ghost) {
+			that.ghost.css({ position: "relative", height: that.size.height, width: that.size.width });
 		}
-		return prefix + hsla.join() + ")";
 	},
-	toHexString: function( includeAlpha ) {
-		var rgba = this._rgba.slice(),
-			alpha = rgba.pop();
 
-		if ( includeAlpha ) {
-			rgba.push( ~~( alpha * 255 ) );
+	stop: function() {
+		var that = $(this).resizable( "instance" );
+		if (that.ghost && that.helper) {
+			that.helper.get(0).removeChild(that.ghost.get(0));
 		}
+	}
 
-		return "#" + jQuery.map( rgba, function( v ) {
+});
 
-			// default to 0 when nulls exist
-			v = ( v || 0 ).toString( 16 );
-			return v.length === 1 ? "0" + v : v;
-		}).join("");
-	},
-	toString: function() {
-		return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
+$.ui.plugin.add("resizable", "grid", {
+
+	resize: function() {
+		var that = $(this).resizable( "instance" ),
+			o = that.options,
+			cs = that.size,
+			os = that.originalSize,
+			op = that.originalPosition,
+			a = that.axis,
+			grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid,
+			gridX = (grid[0]||1),
+			gridY = (grid[1]||1),
+			ox = Math.round((cs.width - os.width) / gridX) * gridX,
+			oy = Math.round((cs.height - os.height) / gridY) * gridY,
+			newWidth = os.width + ox,
+			newHeight = os.height + oy,
+			isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
+			isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
+			isMinWidth = o.minWidth && (o.minWidth > newWidth),
+			isMinHeight = o.minHeight && (o.minHeight > newHeight);
+
+		o.grid = grid;
+
+		if (isMinWidth) {
+			newWidth = newWidth + gridX;
+		}
+		if (isMinHeight) {
+			newHeight = newHeight + gridY;
+		}
+		if (isMaxWidth) {
+			newWidth = newWidth - gridX;
+		}
+		if (isMaxHeight) {
+			newHeight = newHeight - gridY;
+		}
+
+		if (/^(se|s|e)$/.test(a)) {
+			that.size.width = newWidth;
+			that.size.height = newHeight;
+		} else if (/^(ne)$/.test(a)) {
+			that.size.width = newWidth;
+			that.size.height = newHeight;
+			that.position.top = op.top - oy;
+		} else if (/^(sw)$/.test(a)) {
+			that.size.width = newWidth;
+			that.size.height = newHeight;
+			that.position.left = op.left - ox;
+		} else {
+			if ( newHeight - gridY > 0 ) {
+				that.size.height = newHeight;
+				that.position.top = op.top - oy;
+			} else {
+				that.size.height = gridY;
+				that.position.top = op.top + os.height - gridY;
+			}
+			if ( newWidth - gridX > 0 ) {
+				that.size.width = newWidth;
+				that.position.left = op.left - ox;
+			} else {
+				that.size.width = gridX;
+				that.position.left = op.left + os.width - gridX;
+			}
+		}
 	}
+
 });
-color.fn.parse.prototype = color.fn;
 
-// hsla conversions adapted from:
-// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
+var resizable = $.ui.resizable;
 
-function hue2rgb( p, q, h ) {
-	h = ( h + 1 ) % 1;
-	if ( h * 6 < 1 ) {
-		return p + (q - p) * h * 6;
-	}
-	if ( h * 2 < 1) {
-		return q;
-	}
-	if ( h * 3 < 2 ) {
-		return p + (q - p) * ((2/3) - h) * 6;
-	}
-	return p;
-}
 
-spaces.hsla.to = function ( rgba ) {
-	if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
-		return [ null, null, null, rgba[ 3 ] ];
-	}
-	var r = rgba[ 0 ] / 255,
-		g = rgba[ 1 ] / 255,
-		b = rgba[ 2 ] / 255,
-		a = rgba[ 3 ],
-		max = Math.max( r, g, b ),
-		min = Math.min( r, g, b ),
-		diff = max - min,
-		add = max + min,
-		l = add * 0.5,
-		h, s;
+/*!
+ * jQuery UI Dialog 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/dialog/
+ */
 
-	if ( min === max ) {
-		h = 0;
-	} else if ( r === max ) {
-		h = ( 60 * ( g - b ) / diff ) + 360;
-	} else if ( g === max ) {
-		h = ( 60 * ( b - r ) / diff ) + 120;
-	} else {
-		h = ( 60 * ( r - g ) / diff ) + 240;
-	}
 
-	// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
-	// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
-	if ( diff === 0 ) {
-		s = 0;
-	} else if ( l <= 0.5 ) {
-		s = diff / add;
-	} else {
-		s = diff / ( 2 - add );
-	}
-	return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
-};
+var dialog = $.widget( "ui.dialog", {
+	version: "1.11.0",
+	options: {
+		appendTo: "body",
+		autoOpen: true,
+		buttons: [],
+		closeOnEscape: true,
+		closeText: "Close",
+		dialogClass: "",
+		draggable: true,
+		hide: null,
+		height: "auto",
+		maxHeight: null,
+		maxWidth: null,
+		minHeight: 150,
+		minWidth: 150,
+		modal: false,
+		position: {
+			my: "center",
+			at: "center",
+			of: window,
+			collision: "fit",
+			// Ensure the titlebar is always visible
+			using: function( pos ) {
+				var topOffset = $( this ).css( pos ).offset().top;
+				if ( topOffset < 0 ) {
+					$( this ).css( "top", pos.top - topOffset );
+				}
+			}
+		},
+		resizable: true,
+		show: null,
+		title: null,
+		width: 300,
+
+		// callbacks
+		beforeClose: null,
+		close: null,
+		drag: null,
+		dragStart: null,
+		dragStop: null,
+		focus: null,
+		open: null,
+		resize: null,
+		resizeStart: null,
+		resizeStop: null
+	},
 
-spaces.hsla.from = function ( hsla ) {
-	if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
-		return [ null, null, null, hsla[ 3 ] ];
-	}
-	var h = hsla[ 0 ] / 360,
-		s = hsla[ 1 ],
-		l = hsla[ 2 ],
-		a = hsla[ 3 ],
-		q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
-		p = 2 * l - q;
+	sizeRelatedOptions: {
+		buttons: true,
+		height: true,
+		maxHeight: true,
+		maxWidth: true,
+		minHeight: true,
+		minWidth: true,
+		width: true
+	},
 
-	return [
-		Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
-		Math.round( hue2rgb( p, q, h ) * 255 ),
-		Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
-		a
-	];
-};
+	resizableRelatedOptions: {
+		maxHeight: true,
+		maxWidth: true,
+		minHeight: true,
+		minWidth: true
+	},
 
+	_create: function() {
+		this.originalCss = {
+			display: this.element[ 0 ].style.display,
+			width: this.element[ 0 ].style.width,
+			minHeight: this.element[ 0 ].style.minHeight,
+			maxHeight: this.element[ 0 ].style.maxHeight,
+			height: this.element[ 0 ].style.height
+		};
+		this.originalPosition = {
+			parent: this.element.parent(),
+			index: this.element.parent().children().index( this.element )
+		};
+		this.originalTitle = this.element.attr( "title" );
+		this.options.title = this.options.title || this.originalTitle;
 
-each( spaces, function( spaceName, space ) {
-	var props = space.props,
-		cache = space.cache,
-		to = space.to,
-		from = space.from;
+		this._createWrapper();
 
-	// makes rgba() and hsla()
-	color.fn[ spaceName ] = function( value ) {
+		this.element
+			.show()
+			.removeAttr( "title" )
+			.addClass( "ui-dialog-content ui-widget-content" )
+			.appendTo( this.uiDialog );
 
-		// generate a cache for this space if it doesn't exist
-		if ( to && !this[ cache ] ) {
-			this[ cache ] = to( this._rgba );
+		this._createTitlebar();
+		this._createButtonPane();
+
+		if ( this.options.draggable && $.fn.draggable ) {
+			this._makeDraggable();
 		}
-		if ( value === undefined ) {
-			return this[ cache ].slice();
+		if ( this.options.resizable && $.fn.resizable ) {
+			this._makeResizable();
 		}
 
-		var ret,
-			type = jQuery.type( value ),
-			arr = ( type === "array" || type === "object" ) ? value : arguments,
-			local = this[ cache ].slice();
+		this._isOpen = false;
 
-		each( props, function( key, prop ) {
-			var val = arr[ type === "object" ? key : prop.idx ];
-			if ( val == null ) {
-				val = local[ prop.idx ];
-			}
-			local[ prop.idx ] = clamp( val, prop );
-		});
+		this._trackFocus();
+	},
 
-		if ( from ) {
-			ret = color( from( local ) );
-			ret[ cache ] = local;
-			return ret;
-		} else {
-			return color( local );
+	_init: function() {
+		if ( this.options.autoOpen ) {
+			this.open();
 		}
-	};
+	},
 
-	// makes red() green() blue() alpha() hue() saturation() lightness()
-	each( props, function( key, prop ) {
-		// alpha is included in more than one space
-		if ( color.fn[ key ] ) {
-			return;
+	_appendTo: function() {
+		var element = this.options.appendTo;
+		if ( element && (element.jquery || element.nodeType) ) {
+			return $( element );
 		}
-		color.fn[ key ] = function( value ) {
-			var vtype = jQuery.type( value ),
-				fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
-				local = this[ fn ](),
-				cur = local[ prop.idx ],
-				match;
-
-			if ( vtype === "undefined" ) {
-				return cur;
-			}
-
-			if ( vtype === "function" ) {
-				value = value.call( this, cur );
-				vtype = jQuery.type( value );
-			}
-			if ( value == null && prop.empty ) {
-				return this;
-			}
-			if ( vtype === "string" ) {
-				match = rplusequals.exec( value );
-				if ( match ) {
-					value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
-				}
-			}
-			local[ prop.idx ] = value;
-			return this[ fn ]( local );
-		};
-	});
-});
-
-// add cssHook and .fx.step function for each named hook.
-// accept a space separated string of properties
-color.hook = function( hook ) {
-	var hooks = hook.split( " " );
-	each( hooks, function( i, hook ) {
-		jQuery.cssHooks[ hook ] = {
-			set: function( elem, value ) {
-				var parsed, curElem,
-					backgroundColor = "";
+		return this.document.find( element || "body" ).eq( 0 );
+	},
 
-				if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
-					value = color( parsed || value );
-					if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
-						curElem = hook === "backgroundColor" ? elem.parentNode : elem;
-						while (
-							(backgroundColor === "" || backgroundColor === "transparent") &&
-							curElem && curElem.style
-						) {
-							try {
-								backgroundColor = jQuery.css( curElem, "backgroundColor" );
-								curElem = curElem.parentNode;
-							} catch ( e ) {
-							}
-						}
+	_destroy: function() {
+		var next,
+			originalPosition = this.originalPosition;
 
-						value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
-							backgroundColor :
-							"_default" );
-					}
+		this._destroyOverlay();
 
-					value = value.toRgbaString();
-				}
-				try {
-					elem.style[ hook ] = value;
-				} catch( e ) {
-					// wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
-				}
-			}
-		};
-		jQuery.fx.step[ hook ] = function( fx ) {
-			if ( !fx.colorInit ) {
-				fx.start = color( fx.elem, hook );
-				fx.end = color( fx.end );
-				fx.colorInit = true;
-			}
-			jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
-		};
-	});
+		this.element
+			.removeUniqueId()
+			.removeClass( "ui-dialog-content ui-widget-content" )
+			.css( this.originalCss )
+			// Without detaching first, the following becomes really slow
+			.detach();
 
-};
+		this.uiDialog.stop( true, true ).remove();
 
-color.hook( stepHooks );
+		if ( this.originalTitle ) {
+			this.element.attr( "title", this.originalTitle );
+		}
 
-jQuery.cssHooks.borderColor = {
-	expand: function( value ) {
-		var expanded = {};
+		next = originalPosition.parent.children().eq( originalPosition.index );
+		// Don't try to place the dialog next to itself (#8613)
+		if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
+			next.before( this.element );
+		} else {
+			originalPosition.parent.append( this.element );
+		}
+	},
 
-		each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
-			expanded[ "border" + part + "Color" ] = value;
-		});
-		return expanded;
-	}
-};
+	widget: function() {
+		return this.uiDialog;
+	},
 
-// Basic color names only.
-// Usage of any of the other color names requires adding yourself or including
-// jquery.color.svg-names.js.
-colors = jQuery.Color.names = {
-	// 4.1. Basic color keywords
-	aqua: "#00ffff",
-	black: "#000000",
-	blue: "#0000ff",
-	fuchsia: "#ff00ff",
-	gray: "#808080",
-	green: "#008000",
-	lime: "#00ff00",
-	maroon: "#800000",
-	navy: "#000080",
-	olive: "#808000",
-	purple: "#800080",
-	red: "#ff0000",
-	silver: "#c0c0c0",
-	teal: "#008080",
-	white: "#ffffff",
-	yellow: "#ffff00",
+	disable: $.noop,
+	enable: $.noop,
 
-	// 4.2.3. "transparent" color keyword
-	transparent: [ null, null, null, 0 ],
+	close: function( event ) {
+		var activeElement,
+			that = this;
 
-	_default: "#ffffff"
-};
+		if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
+			return;
+		}
 
-})( jQuery );
+		this._isOpen = false;
+		this._focusedElement = null;
+		this._destroyOverlay();
+		this._untrackInstance();
 
+		if ( !this.opener.filter( ":focusable" ).focus().length ) {
 
-/******************************************************************************/
-/****************************** CLASS ANIMATIONS ******************************/
-/******************************************************************************/
-(function() {
+			// support: IE9
+			// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
+			try {
+				activeElement = this.document[ 0 ].activeElement;
 
-var classAnimationActions = [ "add", "remove", "toggle" ],
-	shorthandStyles = {
-		border: 1,
-		borderBottom: 1,
-		borderColor: 1,
-		borderLeft: 1,
-		borderRight: 1,
-		borderTop: 1,
-		borderWidth: 1,
-		margin: 1,
-		padding: 1
-	};
+				// Support: IE9, IE10
+				// If the <body> is blurred, IE will switch windows, see #4520
+				if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) {
 
-$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
-	$.fx.step[ prop ] = function( fx ) {
-		if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
-			jQuery.style( fx.elem, prop, fx.end );
-			fx.setAttr = true;
+					// Hiding a focused element doesn't trigger blur in WebKit
+					// so in case we have nothing to focus on, explicitly blur the active element
+					// https://bugs.webkit.org/show_bug.cgi?id=47182
+					$( activeElement ).blur();
+				}
+			} catch ( error ) {}
 		}
-	};
-});
 
-function getElementStyles( elem ) {
-	var key, len,
-		style = elem.ownerDocument.defaultView ?
-			elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
-			elem.currentStyle,
-		styles = {};
+		this._hide( this.uiDialog, this.options.hide, function() {
+			that._trigger( "close", event );
+		});
+	},
 
-	if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
-		len = style.length;
-		while ( len-- ) {
-			key = style[ len ];
-			if ( typeof style[ key ] === "string" ) {
-				styles[ $.camelCase( key ) ] = style[ key ];
-			}
+	isOpen: function() {
+		return this._isOpen;
+	},
+
+	moveToTop: function() {
+		this._moveToTop();
+	},
+
+	_moveToTop: function( event, silent ) {
+		var moved = false,
+			zIndicies = this.uiDialog.siblings( ".ui-front:visible" ).map(function() {
+				return +$( this ).css( "z-index" );
+			}).get(),
+			zIndexMax = Math.max.apply( null, zIndicies );
+
+		if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
+			this.uiDialog.css( "z-index", zIndexMax + 1 );
+			moved = true;
 		}
-	// support: Opera, IE <9
-	} else {
-		for ( key in style ) {
-			if ( typeof style[ key ] === "string" ) {
-				styles[ key ] = style[ key ];
+
+		if ( moved && !silent ) {
+			this._trigger( "focus", event );
+		}
+		return moved;
+	},
+
+	open: function() {
+		var that = this;
+		if ( this._isOpen ) {
+			if ( this._moveToTop() ) {
+				this._focusTabbable();
 			}
+			return;
 		}
-	}
 
-	return styles;
-}
+		this._isOpen = true;
+		this.opener = $( this.document[ 0 ].activeElement );
 
+		this._size();
+		this._position();
+		this._createOverlay();
+		this._moveToTop( null, true );
+		this._show( this.uiDialog, this.options.show, function() {
+			that._focusTabbable();
+			that._trigger( "focus" );
+		});
 
-function styleDifference( oldStyle, newStyle ) {
-	var diff = {},
-		name, value;
+		this._trigger( "open" );
+	},
 
-	for ( name in newStyle ) {
-		value = newStyle[ name ];
-		if ( oldStyle[ name ] !== value ) {
-			if ( !shorthandStyles[ name ] ) {
-				if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
-					diff[ name ] = value;
-				}
-			}
+	_focusTabbable: function() {
+		// Set focus to the first match:
+		// 1. An element that was focused previously
+		// 2. First element inside the dialog matching [autofocus]
+		// 3. Tabbable element inside the content element
+		// 4. Tabbable element inside the buttonpane
+		// 5. The close button
+		// 6. The dialog itself
+		var hasFocus = this._focusedElement;
+		if ( !hasFocus ) {
+			hasFocus = this.element.find( "[autofocus]" );
 		}
-	}
+		if ( !hasFocus.length ) {
+			hasFocus = this.element.find( ":tabbable" );
+		}
+		if ( !hasFocus.length ) {
+			hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
+		}
+		if ( !hasFocus.length ) {
+			hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
+		}
+		if ( !hasFocus.length ) {
+			hasFocus = this.uiDialog;
+		}
+		hasFocus.eq( 0 ).focus();
+	},
 
-	return diff;
-}
+	_keepFocus: function( event ) {
+		function checkFocus() {
+			var activeElement = this.document[0].activeElement,
+				isActive = this.uiDialog[0] === activeElement ||
+					$.contains( this.uiDialog[0], activeElement );
+			if ( !isActive ) {
+				this._focusTabbable();
+			}
+		}
+		event.preventDefault();
+		checkFocus.call( this );
+		// support: IE
+		// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
+		// so we check again later
+		this._delay( checkFocus );
+	},
 
-// support: jQuery <1.8
-if ( !$.fn.addBack ) {
-	$.fn.addBack = function( selector ) {
-		return this.add( selector == null ?
-			this.prevObject : this.prevObject.filter( selector )
-		);
-	};
-}
+	_createWrapper: function() {
+		this.uiDialog = $("<div>")
+			.addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
+				this.options.dialogClass )
+			.hide()
+			.attr({
+				// Setting tabIndex makes the div focusable
+				tabIndex: -1,
+				role: "dialog"
+			})
+			.appendTo( this._appendTo() );
 
-$.effects.animateClass = function( value, duration, easing, callback ) {
-	var o = $.speed( duration, easing, callback );
+		this._on( this.uiDialog, {
+			keydown: function( event ) {
+				if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
+						event.keyCode === $.ui.keyCode.ESCAPE ) {
+					event.preventDefault();
+					this.close( event );
+					return;
+				}
 
-	return this.queue( function() {
-		var animated = $( this ),
-			baseClass = animated.attr( "class" ) || "",
-			applyClassChange,
-			allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
+				// prevent tabbing out of dialogs
+				if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
+					return;
+				}
+				var tabbables = this.uiDialog.find( ":tabbable" ),
+					first = tabbables.filter( ":first" ),
+					last = tabbables.filter( ":last" );
 
-		// map the animated objects to store the original styles.
-		allAnimations = allAnimations.map(function() {
-			var el = $( this );
-			return {
-				el: el,
-				start: getElementStyles( this )
-			};
+				if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
+					this._delay(function() {
+						first.focus();
+					});
+					event.preventDefault();
+				} else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
+					this._delay(function() {
+						last.focus();
+					});
+					event.preventDefault();
+				}
+			},
+			mousedown: function( event ) {
+				if ( this._moveToTop( event ) ) {
+					this._focusTabbable();
+				}
+			}
 		});
 
-		// apply class change
-		applyClassChange = function() {
-			$.each( classAnimationActions, function(i, action) {
-				if ( value[ action ] ) {
-					animated[ action + "Class" ]( value[ action ] );
-				}
+		// We assume that any existing aria-describedby attribute means
+		// that the dialog content is marked up properly
+		// otherwise we brute force the content as the description
+		if ( !this.element.find( "[aria-describedby]" ).length ) {
+			this.uiDialog.attr({
+				"aria-describedby": this.element.uniqueId().attr( "id" )
 			});
-		};
-		applyClassChange();
+		}
+	},
 
-		// map all animated objects again - calculate new styles and diff
-		allAnimations = allAnimations.map(function() {
-			this.end = getElementStyles( this.el[ 0 ] );
-			this.diff = styleDifference( this.start, this.end );
-			return this;
+	_createTitlebar: function() {
+		var uiDialogTitle;
+
+		this.uiDialogTitlebar = $( "<div>" )
+			.addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
+			.prependTo( this.uiDialog );
+		this._on( this.uiDialogTitlebar, {
+			mousedown: function( event ) {
+				// Don't prevent click on close button (#8838)
+				// Focusing a dialog that is partially scrolled out of view
+				// causes the browser to scroll it into view, preventing the click event
+				if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
+					// Dialog isn't getting focus when dragging (#8063)
+					this.uiDialog.focus();
+				}
+			}
+		});
+
+		// support: IE
+		// Use type="button" to prevent enter keypresses in textboxes from closing the
+		// dialog in IE (#9312)
+		this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
+			.button({
+				label: this.options.closeText,
+				icons: {
+					primary: "ui-icon-closethick"
+				},
+				text: false
+			})
+			.addClass( "ui-dialog-titlebar-close" )
+			.appendTo( this.uiDialogTitlebar );
+		this._on( this.uiDialogTitlebarClose, {
+			click: function( event ) {
+				event.preventDefault();
+				this.close( event );
+			}
+		});
+
+		uiDialogTitle = $( "<span>" )
+			.uniqueId()
+			.addClass( "ui-dialog-title" )
+			.prependTo( this.uiDialogTitlebar );
+		this._title( uiDialogTitle );
+
+		this.uiDialog.attr({
+			"aria-labelledby": uiDialogTitle.attr( "id" )
 		});
+	},
 
-		// apply original class
-		animated.attr( "class", baseClass );
+	_title: function( title ) {
+		if ( !this.options.title ) {
+			title.html( "&#160;" );
+		}
+		title.text( this.options.title );
+	},
 
-		// map all animated objects again - this time collecting a promise
-		allAnimations = allAnimations.map(function() {
-			var styleInfo = this,
-				dfd = $.Deferred(),
-				opts = $.extend({}, o, {
-					queue: false,
-					complete: function() {
-						dfd.resolve( styleInfo );
-					}
-				});
+	_createButtonPane: function() {
+		this.uiDialogButtonPane = $( "<div>" )
+			.addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
 
-			this.el.animate( this.diff, opts );
-			return dfd.promise();
-		});
+		this.uiButtonSet = $( "<div>" )
+			.addClass( "ui-dialog-buttonset" )
+			.appendTo( this.uiDialogButtonPane );
 
-		// once all animations have completed:
-		$.when.apply( $, allAnimations.get() ).done(function() {
+		this._createButtons();
+	},
 
-			// set the final class
-			applyClassChange();
+	_createButtons: function() {
+		var that = this,
+			buttons = this.options.buttons;
 
-			// for each animated element,
-			// clear all css properties that were animated
-			$.each( arguments, function() {
-				var el = this.el;
-				$.each( this.diff, function(key) {
-					el.css( key, "" );
-				});
-			});
+		// if we already have a button pane, remove it
+		this.uiDialogButtonPane.remove();
+		this.uiButtonSet.empty();
 
-			// this is guarnteed to be there if you use jQuery.speed()
-			// it also handles dequeuing the next anim...
-			o.complete.call( animated[ 0 ] );
+		if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
+			this.uiDialog.removeClass( "ui-dialog-buttons" );
+			return;
+		}
+
+		$.each( buttons, function( name, props ) {
+			var click, buttonOptions;
+			props = $.isFunction( props ) ?
+				{ click: props, text: name } :
+				props;
+			// Default to a non-submitting button
+			props = $.extend( { type: "button" }, props );
+			// Change the context for the click callback to be the main element
+			click = props.click;
+			props.click = function() {
+				click.apply( that.element[ 0 ], arguments );
+			};
+			buttonOptions = {
+				icons: props.icons,
+				text: props.showText
+			};
+			delete props.icons;
+			delete props.showText;
+			$( "<button></button>", props )
+				.button( buttonOptions )
+				.appendTo( that.uiButtonSet );
 		});
-	});
-};
+		this.uiDialog.addClass( "ui-dialog-buttons" );
+		this.uiDialogButtonPane.appendTo( this.uiDialog );
+	},
 
-$.fn.extend({
-	addClass: (function( orig ) {
-		return function( classNames, speed, easing, callback ) {
-			return speed ?
-				$.effects.animateClass.call( this,
-					{ add: classNames }, speed, easing, callback ) :
-				orig.apply( this, arguments );
-		};
-	})( $.fn.addClass ),
+	_makeDraggable: function() {
+		var that = this,
+			options = this.options;
 
-	removeClass: (function( orig ) {
-		return function( classNames, speed, easing, callback ) {
-			return arguments.length > 1 ?
-				$.effects.animateClass.call( this,
-					{ remove: classNames }, speed, easing, callback ) :
-				orig.apply( this, arguments );
-		};
-	})( $.fn.removeClass ),
+		function filteredUi( ui ) {
+			return {
+				position: ui.position,
+				offset: ui.offset
+			};
+		}
 
-	toggleClass: (function( orig ) {
-		return function( classNames, force, speed, easing, callback ) {
-			if ( typeof force === "boolean" || force === undefined ) {
-				if ( !speed ) {
-					// without speed parameter
-					return orig.apply( this, arguments );
-				} else {
-					return $.effects.animateClass.call( this,
-						(force ? { add: classNames } : { remove: classNames }),
-						speed, easing, callback );
-				}
-			} else {
-				// without force parameter
-				return $.effects.animateClass.call( this,
-					{ toggle: classNames }, force, speed, easing );
+		this.uiDialog.draggable({
+			cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
+			handle: ".ui-dialog-titlebar",
+			containment: "document",
+			start: function( event, ui ) {
+				$( this ).addClass( "ui-dialog-dragging" );
+				that._blockFrames();
+				that._trigger( "dragStart", event, filteredUi( ui ) );
+			},
+			drag: function( event, ui ) {
+				that._trigger( "drag", event, filteredUi( ui ) );
+			},
+			stop: function( event, ui ) {
+				var left = ui.offset.left - that.document.scrollLeft(),
+					top = ui.offset.top - that.document.scrollTop();
+
+				options.position = {
+					my: "left top",
+					at: "left" + (left >= 0 ? "+" : "") + left + " " +
+						"top" + (top >= 0 ? "+" : "") + top,
+					of: that.window
+				};
+				$( this ).removeClass( "ui-dialog-dragging" );
+				that._unblockFrames();
+				that._trigger( "dragStop", event, filteredUi( ui ) );
 			}
-		};
-	})( $.fn.toggleClass ),
-
-	switchClass: function( remove, add, speed, easing, callback) {
-		return $.effects.animateClass.call( this, {
-			add: add,
-			remove: remove
-		}, speed, easing, callback );
-	}
-});
-
-})();
+		});
+	},
 
-/******************************************************************************/
-/*********************************** EFFECTS **********************************/
-/******************************************************************************/
+	_makeResizable: function() {
+		var that = this,
+			options = this.options,
+			handles = options.resizable,
+			// .ui-resizable has position: relative defined in the stylesheet
+			// but dialogs have to use absolute or fixed positioning
+			position = this.uiDialog.css("position"),
+			resizeHandles = typeof handles === "string" ?
+				handles	:
+				"n,e,s,w,se,sw,ne,nw";
 
-(function() {
+		function filteredUi( ui ) {
+			return {
+				originalPosition: ui.originalPosition,
+				originalSize: ui.originalSize,
+				position: ui.position,
+				size: ui.size
+			};
+		}
 
-$.extend( $.effects, {
-	version: "1.10.4",
+		this.uiDialog.resizable({
+			cancel: ".ui-dialog-content",
+			containment: "document",
+			alsoResize: this.element,
+			maxWidth: options.maxWidth,
+			maxHeight: options.maxHeight,
+			minWidth: options.minWidth,
+			minHeight: this._minHeight(),
+			handles: resizeHandles,
+			start: function( event, ui ) {
+				$( this ).addClass( "ui-dialog-resizing" );
+				that._blockFrames();
+				that._trigger( "resizeStart", event, filteredUi( ui ) );
+			},
+			resize: function( event, ui ) {
+				that._trigger( "resize", event, filteredUi( ui ) );
+			},
+			stop: function( event, ui ) {
+				var offset = that.uiDialog.offset(),
+					left = offset.left - that.document.scrollLeft(),
+					top = offset.top - that.document.scrollTop();
+
+				options.height = that.uiDialog.height();
+				options.width = that.uiDialog.width();
+				options.position = {
+					my: "left top",
+					at: "left" + (left >= 0 ? "+" : "") + left + " " +
+						"top" + (top >= 0 ? "+" : "") + top,
+					of: that.window
+				};
+				$( this ).removeClass( "ui-dialog-resizing" );
+				that._unblockFrames();
+				that._trigger( "resizeStop", event, filteredUi( ui ) );
+			}
+		})
+		.css( "position", position );
+	},
 
-	// Saves a set of properties in a data storage
-	save: function( element, set ) {
-		for( var i=0; i < set.length; i++ ) {
-			if ( set[ i ] !== null ) {
-				element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
+	_trackFocus: function() {
+		this._on( this.widget(), {
+			"focusin": function( event ) {
+				this._untrackInstance();
+				this._trackingInstances().unshift( this );
+				this._focusedElement = $( event.target );
 			}
+		});
+	},
+
+	_untrackInstance: function() {
+		var instances = this._trackingInstances(),
+			exists = $.inArray( this, instances );
+		if ( exists !== -1 ) {
+			instances.splice( exists, 1 );
 		}
 	},
 
-	// Restores a set of previously saved properties from a data storage
-	restore: function( element, set ) {
-		var val, i;
-		for( i=0; i < set.length; i++ ) {
-			if ( set[ i ] !== null ) {
-				val = element.data( dataSpace + set[ i ] );
-				// support: jQuery 1.6.2
-				// http://bugs.jquery.com/ticket/9917
-				// jQuery 1.6.2 incorrectly returns undefined for any falsy value.
-				// We can't differentiate between "" and 0 here, so we just assume
-				// empty string since it's likely to be a more common value...
-				if ( val === undefined ) {
-					val = "";
-				}
-				element.css( set[ i ], val );
-			}
+	_trackingInstances: function() {
+		var instances = this.document.data( "ui-dialog-instances" );
+		if ( !instances ) {
+			instances = [];
+			this.document.data( "ui-dialog-instances", instances );
 		}
+		return instances;
 	},
 
-	setMode: function( el, mode ) {
-		if (mode === "toggle") {
-			mode = el.is( ":hidden" ) ? "show" : "hide";
+	_minHeight: function() {
+		var options = this.options;
+
+		return options.height === "auto" ?
+			options.minHeight :
+			Math.min( options.minHeight, options.height );
+	},
+
+	_position: function() {
+		// Need to show the dialog to get the actual offset in the position plugin
+		var isVisible = this.uiDialog.is( ":visible" );
+		if ( !isVisible ) {
+			this.uiDialog.show();
+		}
+		this.uiDialog.position( this.options.position );
+		if ( !isVisible ) {
+			this.uiDialog.hide();
 		}
-		return mode;
 	},
 
-	// Translates a [top,left] array into a baseline value
-	// this should be a little more flexible in the future to handle a string & hash
-	getBaseline: function( origin, original ) {
-		var y, x;
-		switch ( origin[ 0 ] ) {
-			case "top": y = 0; break;
-			case "middle": y = 0.5; break;
-			case "bottom": y = 1; break;
-			default: y = origin[ 0 ] / original.height;
+	_setOptions: function( options ) {
+		var that = this,
+			resize = false,
+			resizableOptions = {};
+
+		$.each( options, function( key, value ) {
+			that._setOption( key, value );
+
+			if ( key in that.sizeRelatedOptions ) {
+				resize = true;
+			}
+			if ( key in that.resizableRelatedOptions ) {
+				resizableOptions[ key ] = value;
+			}
+		});
+
+		if ( resize ) {
+			this._size();
+			this._position();
 		}
-		switch ( origin[ 1 ] ) {
-			case "left": x = 0; break;
-			case "center": x = 0.5; break;
-			case "right": x = 1; break;
-			default: x = origin[ 1 ] / original.width;
+		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
+			this.uiDialog.resizable( "option", resizableOptions );
 		}
-		return {
-			x: x,
-			y: y
-		};
 	},
 
-	// Wraps the element around a wrapper that copies position properties
-	createWrapper: function( element ) {
+	_setOption: function( key, value ) {
+		var isDraggable, isResizable,
+			uiDialog = this.uiDialog;
 
-		// if the element is already wrapped, return it
-		if ( element.parent().is( ".ui-effects-wrapper" )) {
-			return element.parent();
+		if ( key === "dialogClass" ) {
+			uiDialog
+				.removeClass( this.options.dialogClass )
+				.addClass( value );
 		}
 
-		// wrap the element
-		var props = {
-				width: element.outerWidth(true),
-				height: element.outerHeight(true),
-				"float": element.css( "float" )
-			},
-			wrapper = $( "<div></div>" )
-				.addClass( "ui-effects-wrapper" )
-				.css({
-					fontSize: "100%",
-					background: "transparent",
-					border: "none",
-					margin: 0,
-					padding: 0
-				}),
-			// Store the size in case width/height are defined in % - Fixes #5245
-			size = {
-				width: element.width(),
-				height: element.height()
-			},
-			active = document.activeElement;
-
-		// support: Firefox
-		// Firefox incorrectly exposes anonymous content
-		// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
-		try {
-			active.id;
-		} catch( e ) {
-			active = document.body;
+		if ( key === "disabled" ) {
+			return;
 		}
 
-		element.wrap( wrapper );
+		this._super( key, value );
 
-		// Fixes #7595 - Elements lose focus when wrapped.
-		if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
-			$( active ).focus();
+		if ( key === "appendTo" ) {
+			this.uiDialog.appendTo( this._appendTo() );
 		}
 
-		wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
+		if ( key === "buttons" ) {
+			this._createButtons();
+		}
 
-		// transfer positioning properties to the wrapper
-		if ( element.css( "position" ) === "static" ) {
-			wrapper.css({ position: "relative" });
-			element.css({ position: "relative" });
-		} else {
-			$.extend( props, {
-				position: element.css( "position" ),
-				zIndex: element.css( "z-index" )
-			});
-			$.each([ "top", "left", "bottom", "right" ], function(i, pos) {
-				props[ pos ] = element.css( pos );
-				if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
-					props[ pos ] = "auto";
-				}
-			});
-			element.css({
-				position: "relative",
-				top: 0,
-				left: 0,
-				right: "auto",
-				bottom: "auto"
+		if ( key === "closeText" ) {
+			this.uiDialogTitlebarClose.button({
+				// Ensure that we always pass a string
+				label: "" + value
 			});
 		}
-		element.css(size);
-
-		return wrapper.css( props ).show();
-	},
-
-	removeWrapper: function( element ) {
-		var active = document.activeElement;
 
-		if ( element.parent().is( ".ui-effects-wrapper" ) ) {
-			element.parent().replaceWith( element );
+		if ( key === "draggable" ) {
+			isDraggable = uiDialog.is( ":data(ui-draggable)" );
+			if ( isDraggable && !value ) {
+				uiDialog.draggable( "destroy" );
+			}
 
-			// Fixes #7595 - Elements lose focus when wrapped.
-			if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
-				$( active ).focus();
+			if ( !isDraggable && value ) {
+				this._makeDraggable();
 			}
 		}
 
+		if ( key === "position" ) {
+			this._position();
+		}
 
-		return element;
-	},
+		if ( key === "resizable" ) {
+			// currently resizable, becoming non-resizable
+			isResizable = uiDialog.is( ":data(ui-resizable)" );
+			if ( isResizable && !value ) {
+				uiDialog.resizable( "destroy" );
+			}
 
-	setTransition: function( element, list, factor, value ) {
-		value = value || {};
-		$.each( list, function( i, x ) {
-			var unit = element.cssUnit( x );
-			if ( unit[ 0 ] > 0 ) {
-				value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
+			// currently resizable, changing handles
+			if ( isResizable && typeof value === "string" ) {
+				uiDialog.resizable( "option", "handles", value );
 			}
-		});
-		return value;
-	}
-});
 
-// return an effect options object for the given parameters:
-function _normalizeArguments( effect, options, speed, callback ) {
+			// currently non-resizable, becoming resizable
+			if ( !isResizable && value !== false ) {
+				this._makeResizable();
+			}
+		}
 
-	// allow passing all options as the first parameter
-	if ( $.isPlainObject( effect ) ) {
-		options = effect;
-		effect = effect.effect;
-	}
+		if ( key === "title" ) {
+			this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
+		}
+	},
 
-	// convert to an object
-	effect = { effect: effect };
+	_size: function() {
+		// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
+		// divs will both have width and height set, so we need to reset them
+		var nonContentHeight, minContentHeight, maxContentHeight,
+			options = this.options;
 
-	// catch (effect, null, ...)
-	if ( options == null ) {
-		options = {};
-	}
+		// Reset content sizing
+		this.element.show().css({
+			width: "auto",
+			minHeight: 0,
+			maxHeight: "none",
+			height: 0
+		});
 
-	// catch (effect, callback)
-	if ( $.isFunction( options ) ) {
-		callback = options;
-		speed = null;
-		options = {};
-	}
+		if ( options.minWidth > options.width ) {
+			options.width = options.minWidth;
+		}
 
-	// catch (effect, speed, ?)
-	if ( typeof options === "number" || $.fx.speeds[ options ] ) {
-		callback = speed;
-		speed = options;
-		options = {};
-	}
+		// reset wrapper sizing
+		// determine the height of all the non-content elements
+		nonContentHeight = this.uiDialog.css({
+				height: "auto",
+				width: options.width
+			})
+			.outerHeight();
+		minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
+		maxContentHeight = typeof options.maxHeight === "number" ?
+			Math.max( 0, options.maxHeight - nonContentHeight ) :
+			"none";
 
-	// catch (effect, options, callback)
-	if ( $.isFunction( speed ) ) {
-		callback = speed;
-		speed = null;
-	}
+		if ( options.height === "auto" ) {
+			this.element.css({
+				minHeight: minContentHeight,
+				maxHeight: maxContentHeight,
+				height: "auto"
+			});
+		} else {
+			this.element.height( Math.max( 0, options.height - nonContentHeight ) );
+		}
 
-	// add options to effect
-	if ( options ) {
-		$.extend( effect, options );
-	}
+		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
+			this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
+		}
+	},
 
-	speed = speed || options.duration;
-	effect.duration = $.fx.off ? 0 :
-		typeof speed === "number" ? speed :
-		speed in $.fx.speeds ? $.fx.speeds[ speed ] :
-		$.fx.speeds._default;
+	_blockFrames: function() {
+		this.iframeBlocks = this.document.find( "iframe" ).map(function() {
+			var iframe = $( this );
 
-	effect.complete = callback || options.complete;
+			return $( "<div>" )
+				.css({
+					position: "absolute",
+					width: iframe.outerWidth(),
+					height: iframe.outerHeight()
+				})
+				.appendTo( iframe.parent() )
+				.offset( iframe.offset() )[0];
+		});
+	},
 
-	return effect;
-}
+	_unblockFrames: function() {
+		if ( this.iframeBlocks ) {
+			this.iframeBlocks.remove();
+			delete this.iframeBlocks;
+		}
+	},
 
-function standardAnimationOption( option ) {
-	// Valid standard speeds (nothing, number, named speed)
-	if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
-		return true;
-	}
+	_allowInteraction: function( event ) {
+		if ( $( event.target ).closest( ".ui-dialog" ).length ) {
+			return true;
+		}
 
-	// Invalid strings - treat as "normal" speed
-	if ( typeof option === "string" && !$.effects.effect[ option ] ) {
-		return true;
-	}
+		// TODO: Remove hack when datepicker implements
+		// the .ui-front logic (#8989)
+		return !!$( event.target ).closest( ".ui-datepicker" ).length;
+	},
 
-	// Complete callback
-	if ( $.isFunction( option ) ) {
-		return true;
-	}
+	_createOverlay: function() {
+		if ( !this.options.modal ) {
+			return;
+		}
 
-	// Options hash (but not naming an effect)
-	if ( typeof option === "object" && !option.effect ) {
-		return true;
-	}
+		// We use a delay in case the overlay is created from an
+		// event that we're going to be cancelling (#2804)
+		var isOpening = true;
+		this._delay(function() {
+			isOpening = false;
+		});
 
-	// Didn't match any standard API
-	return false;
-}
+		if ( !this.document.data( "ui-dialog-overlays" ) ) {
 
-$.fn.extend({
-	effect: function( /* effect, options, speed, callback */ ) {
-		var args = _normalizeArguments.apply( this, arguments ),
-			mode = args.mode,
-			queue = args.queue,
-			effectMethod = $.effects.effect[ args.effect ];
+			// Prevent use of anchors and inputs
+			// Using _on() for an event handler shared across many instances is
+			// safe because the dialogs stack and must be closed in reverse order
+			this._on( this.document, {
+				focusin: function( event ) {
+					if ( isOpening ) {
+						return;
+					}
 
-		if ( $.fx.off || !effectMethod ) {
-			// delegate to the original method (e.g., .show()) if possible
-			if ( mode ) {
-				return this[ mode ]( args.duration, args.complete );
-			} else {
-				return this.each( function() {
-					if ( args.complete ) {
-						args.complete.call( this );
+					if ( !this._allowInteraction( event ) ) {
+						event.preventDefault();
+						this._trackingInstances()[ 0 ]._focusTabbable();
 					}
-				});
-			}
+				}
+			});
 		}
 
-		function run( next ) {
-			var elem = $( this ),
-				complete = args.complete,
-				mode = args.mode;
+		this.overlay = $( "<div>" )
+			.addClass( "ui-widget-overlay ui-front" )
+			.appendTo( this._appendTo() );
+		this._on( this.overlay, {
+			mousedown: "_keepFocus"
+		});
+		this.document.data( "ui-dialog-overlays",
+			(this.document.data( "ui-dialog-overlays" ) || 0) + 1 );
+	},
 
-			function done() {
-				if ( $.isFunction( complete ) ) {
-					complete.call( elem[0] );
-				}
-				if ( $.isFunction( next ) ) {
-					next();
-				}
-			}
+	_destroyOverlay: function() {
+		if ( !this.options.modal ) {
+			return;
+		}
 
-			// If the element already has the correct final state, delegate to
-			// the core methods so the internal tracking of "olddisplay" works.
-			if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
-				elem[ mode ]();
-				done();
+		if ( this.overlay ) {
+			var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
+
+			if ( !overlays ) {
+				this.document
+					.unbind( "focusin" )
+					.removeData( "ui-dialog-overlays" );
 			} else {
-				effectMethod.call( elem[0], args, done );
+				this.document.data( "ui-dialog-overlays", overlays );
 			}
+
+			this.overlay.remove();
+			this.overlay = null;
 		}
+	}
+});
 
-		return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
+
+/*!
+ * jQuery UI Droppable 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/droppable/
+ */
+
+
+$.widget( "ui.droppable", {
+	version: "1.11.0",
+	widgetEventPrefix: "drop",
+	options: {
+		accept: "*",
+		activeClass: false,
+		addClasses: true,
+		greedy: false,
+		hoverClass: false,
+		scope: "default",
+		tolerance: "intersect",
+
+		// callbacks
+		activate: null,
+		deactivate: null,
+		drop: null,
+		out: null,
+		over: null
 	},
+	_create: function() {
 
-	show: (function( orig ) {
-		return function( option ) {
-			if ( standardAnimationOption( option ) ) {
-				return orig.apply( this, arguments );
-			} else {
-				var args = _normalizeArguments.apply( this, arguments );
-				args.mode = "show";
-				return this.effect.call( this, args );
-			}
-		};
-	})( $.fn.show ),
+		var proportions,
+			o = this.options,
+			accept = o.accept;
 
-	hide: (function( orig ) {
-		return function( option ) {
-			if ( standardAnimationOption( option ) ) {
-				return orig.apply( this, arguments );
-			} else {
-				var args = _normalizeArguments.apply( this, arguments );
-				args.mode = "hide";
-				return this.effect.call( this, args );
-			}
+		this.isover = false;
+		this.isout = true;
+
+		this.accept = $.isFunction( accept ) ? accept : function( d ) {
+			return d.is( accept );
 		};
-	})( $.fn.hide ),
 
-	toggle: (function( orig ) {
-		return function( option ) {
-			if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
-				return orig.apply( this, arguments );
+		this.proportions = function( /* valueToWrite */ ) {
+			if ( arguments.length ) {
+				// Store the droppable's proportions
+				proportions = arguments[ 0 ];
 			} else {
-				var args = _normalizeArguments.apply( this, arguments );
-				args.mode = "toggle";
-				return this.effect.call( this, args );
+				// Retrieve or derive the droppable's proportions
+				return proportions ?
+					proportions :
+					proportions = {
+						width: this.element[ 0 ].offsetWidth,
+						height: this.element[ 0 ].offsetHeight
+					};
 			}
 		};
-	})( $.fn.toggle ),
-
-	// helper functions
-	cssUnit: function(key) {
-		var style = this.css( key ),
-			val = [];
 
-		$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
-			if ( style.indexOf( unit ) > 0 ) {
-				val = [ parseFloat( style ), unit ];
-			}
-		});
-		return val;
-	}
-});
+		this._addToManager( o.scope );
 
-})();
+		o.addClasses && this.element.addClass( "ui-droppable" );
 
-/******************************************************************************/
-/*********************************** EASING ***********************************/
-/******************************************************************************/
+	},
 
-(function() {
+	_addToManager: function( scope ) {
+		// Add the reference and positions to the manager
+		$.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
+		$.ui.ddmanager.droppables[ scope ].push( this );
+	},
 
-// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
+	_splice: function( drop ) {
+		var i = 0;
+		for ( ; i < drop.length; i++ ) {
+			if ( drop[ i ] === this ) {
+				drop.splice( i, 1 );
+			}
+		}
+	},
 
-var baseEasings = {};
+	_destroy: function() {
+		var drop = $.ui.ddmanager.droppables[ this.options.scope ];
 
-$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
-	baseEasings[ name ] = function( p ) {
-		return Math.pow( p, i + 2 );
-	};
-});
+		this._splice( drop );
 
-$.extend( baseEasings, {
-	Sine: function ( p ) {
-		return 1 - Math.cos( p * Math.PI / 2 );
-	},
-	Circ: function ( p ) {
-		return 1 - Math.sqrt( 1 - p * p );
-	},
-	Elastic: function( p ) {
-		return p === 0 || p === 1 ? p :
-			-Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
-	},
-	Back: function( p ) {
-		return p * p * ( 3 * p - 2 );
+		this.element.removeClass( "ui-droppable ui-droppable-disabled" );
 	},
-	Bounce: function ( p ) {
-		var pow2,
-			bounce = 4;
 
-		while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
-		return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
-	}
-});
+	_setOption: function( key, value ) {
 
-$.each( baseEasings, function( name, easeIn ) {
-	$.easing[ "easeIn" + name ] = easeIn;
-	$.easing[ "easeOut" + name ] = function( p ) {
-		return 1 - easeIn( 1 - p );
-	};
-	$.easing[ "easeInOut" + name ] = function( p ) {
-		return p < 0.5 ?
-			easeIn( p * 2 ) / 2 :
-			1 - easeIn( p * -2 + 2 ) / 2;
-	};
-});
+		if ( key === "accept" ) {
+			this.accept = $.isFunction( value ) ? value : function( d ) {
+				return d.is( value );
+			};
+		} else if ( key === "scope" ) {
+			var drop = $.ui.ddmanager.droppables[ this.options.scope ];
 
-})();
+			this._splice( drop );
+			this._addToManager( value );
+		}
 
-})(jQuery);
-(function( $, undefined ) {
+		this._super( key, value );
+	},
 
-var rvertical = /up|down|vertical/,
-	rpositivemotion = /up|left|vertical|horizontal/;
+	_activate: function( event ) {
+		var draggable = $.ui.ddmanager.current;
+		if ( this.options.activeClass ) {
+			this.element.addClass( this.options.activeClass );
+		}
+		if ( draggable ){
+			this._trigger( "activate", event, this.ui( draggable ) );
+		}
+	},
 
-$.effects.effect.blind = function( o, done ) {
-	// Create element
-	var el = $( this ),
-		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
-		mode = $.effects.setMode( el, o.mode || "hide" ),
-		direction = o.direction || "up",
-		vertical = rvertical.test( direction ),
-		ref = vertical ? "height" : "width",
-		ref2 = vertical ? "top" : "left",
-		motion = rpositivemotion.test( direction ),
-		animation = {},
-		show = mode === "show",
-		wrapper, distance, margin;
+	_deactivate: function( event ) {
+		var draggable = $.ui.ddmanager.current;
+		if ( this.options.activeClass ) {
+			this.element.removeClass( this.options.activeClass );
+		}
+		if ( draggable ){
+			this._trigger( "deactivate", event, this.ui( draggable ) );
+		}
+	},
 
-	// if already wrapped, the wrapper's properties are my property. #6245
-	if ( el.parent().is( ".ui-effects-wrapper" ) ) {
-		$.effects.save( el.parent(), props );
-	} else {
-		$.effects.save( el, props );
-	}
-	el.show();
-	wrapper = $.effects.createWrapper( el ).css({
-		overflow: "hidden"
-	});
+	_over: function( event ) {
 
-	distance = wrapper[ ref ]();
-	margin = parseFloat( wrapper.css( ref2 ) ) || 0;
+		var draggable = $.ui.ddmanager.current;
+
+		// Bail if draggable and droppable are same element
+		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
+			return;
+		}
+
+		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+			if ( this.options.hoverClass ) {
+				this.element.addClass( this.options.hoverClass );
+			}
+			this._trigger( "over", event, this.ui( draggable ) );
+		}
 
-	animation[ ref ] = show ? distance : 0;
-	if ( !motion ) {
-		el
-			.css( vertical ? "bottom" : "right", 0 )
-			.css( vertical ? "top" : "left", "auto" )
-			.css({ position: "absolute" });
+	},
 
-		animation[ ref2 ] = show ? margin : distance + margin;
-	}
+	_out: function( event ) {
 
-	// start at 0 if we are showing
-	if ( show ) {
-		wrapper.css( ref, 0 );
-		if ( ! motion ) {
-			wrapper.css( ref2, margin + distance );
+		var draggable = $.ui.ddmanager.current;
+
+		// Bail if draggable and droppable are same element
+		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
+			return;
 		}
-	}
 
-	// Animate
-	wrapper.animate( animation, {
-		duration: o.duration,
-		easing: o.easing,
-		queue: false,
-		complete: function() {
-			if ( mode === "hide" ) {
-				el.hide();
+		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+			if ( this.options.hoverClass ) {
+				this.element.removeClass( this.options.hoverClass );
 			}
-			$.effects.restore( el, props );
-			$.effects.removeWrapper( el );
-			done();
+			this._trigger( "out", event, this.ui( draggable ) );
 		}
-	});
 
-};
+	},
 
-})(jQuery);
-(function( $, undefined ) {
+	_drop: function( event, custom ) {
 
-$.effects.effect.bounce = function( o, done ) {
-	var el = $( this ),
-		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+		var draggable = custom || $.ui.ddmanager.current,
+			childrenIntersection = false;
 
-		// defaults:
-		mode = $.effects.setMode( el, o.mode || "effect" ),
-		hide = mode === "hide",
-		show = mode === "show",
-		direction = o.direction || "up",
-		distance = o.distance,
-		times = o.times || 5,
+		// Bail if draggable and droppable are same element
+		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
+			return false;
+		}
 
-		// number of internal animations
-		anims = times * 2 + ( show || hide ? 1 : 0 ),
-		speed = o.duration / anims,
-		easing = o.easing,
+		this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
+			var inst = $( this ).droppable( "instance" );
+			if (
+				inst.options.greedy &&
+				!inst.options.disabled &&
+				inst.options.scope === draggable.options.scope &&
+				inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) &&
+				$.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance )
+			) { childrenIntersection = true; return false; }
+		});
+		if ( childrenIntersection ) {
+			return false;
+		}
 
-		// utility:
-		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
-		motion = ( direction === "up" || direction === "left" ),
-		i,
-		upAnim,
-		downAnim,
+		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+			if ( this.options.activeClass ) {
+				this.element.removeClass( this.options.activeClass );
+			}
+			if ( this.options.hoverClass ) {
+				this.element.removeClass( this.options.hoverClass );
+			}
+			this._trigger( "drop", event, this.ui( draggable ) );
+			return this.element;
+		}
 
-		// we will need to re-assemble the queue to stack our animations in place
-		queue = el.queue(),
-		queuelen = queue.length;
+		return false;
 
-	// Avoid touching opacity to prevent clearType and PNG issues in IE
-	if ( show || hide ) {
-		props.push( "opacity" );
+	},
+
+	ui: function( c ) {
+		return {
+			draggable: ( c.currentItem || c.element ),
+			helper: c.helper,
+			position: c.position,
+			offset: c.positionAbs
+		};
 	}
 
-	$.effects.save( el, props );
-	el.show();
-	$.effects.createWrapper( el ); // Create Wrapper
+});
 
-	// default distance for the BIGGEST bounce is the outer Distance / 3
-	if ( !distance ) {
-		distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
+$.ui.intersect = (function() {
+	function isOverAxis( x, reference, size ) {
+		return ( x >= reference ) && ( x < ( reference + size ) );
 	}
 
-	if ( show ) {
-		downAnim = { opacity: 1 };
-		downAnim[ ref ] = 0;
+	return function( draggable, droppable, toleranceMode ) {
 
-		// if we are showing, force opacity 0 and set the initial position
-		// then do the "first" animation
-		el.css( "opacity", 0 )
-			.css( ref, motion ? -distance * 2 : distance * 2 )
-			.animate( downAnim, speed, easing );
-	}
+		if ( !droppable.offset ) {
+			return false;
+		}
 
-	// start at the smallest distance if we are hiding
-	if ( hide ) {
-		distance = distance / Math.pow( 2, times - 1 );
-	}
+		var draggableLeft, draggableTop,
+			x1 = ( draggable.positionAbs || draggable.position.absolute ).left,
+			y1 = ( draggable.positionAbs || draggable.position.absolute ).top,
+			x2 = x1 + draggable.helperProportions.width,
+			y2 = y1 + draggable.helperProportions.height,
+			l = droppable.offset.left,
+			t = droppable.offset.top,
+			r = l + droppable.proportions().width,
+			b = t + droppable.proportions().height;
 
-	downAnim = {};
-	downAnim[ ref ] = 0;
-	// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
-	for ( i = 0; i < times; i++ ) {
-		upAnim = {};
-		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
+		switch ( toleranceMode ) {
+		case "fit":
+			return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
+		case "intersect":
+			return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
+				x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
+				t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
+				y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
+		case "pointer":
+			draggableLeft = ( ( draggable.positionAbs || draggable.position.absolute ).left + ( draggable.clickOffset || draggable.offset.click ).left );
+			draggableTop = ( ( draggable.positionAbs || draggable.position.absolute ).top + ( draggable.clickOffset || draggable.offset.click ).top );
+			return isOverAxis( draggableTop, t, droppable.proportions().height ) && isOverAxis( draggableLeft, l, droppable.proportions().width );
+		case "touch":
+			return (
+				( y1 >= t && y1 <= b ) || // Top edge touching
+				( y2 >= t && y2 <= b ) || // Bottom edge touching
+				( y1 < t && y2 > b ) // Surrounded vertically
+			) && (
+				( x1 >= l && x1 <= r ) || // Left edge touching
+				( x2 >= l && x2 <= r ) || // Right edge touching
+				( x1 < l && x2 > r ) // Surrounded horizontally
+			);
+		default:
+			return false;
+		}
+	};
+})();
 
-		el.animate( upAnim, speed, easing )
-			.animate( downAnim, speed, easing );
+/*
+	This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+	current: null,
+	droppables: { "default": [] },
+	prepareOffsets: function( t, event ) {
 
-		distance = hide ? distance * 2 : distance / 2;
-	}
+		var i, j,
+			m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
+			type = event ? event.type : null, // workaround for #2317
+			list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
 
-	// Last Bounce when Hiding
-	if ( hide ) {
-		upAnim = { opacity: 0 };
-		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
+		droppablesLoop: for ( i = 0; i < m.length; i++ ) {
 
-		el.animate( upAnim, speed, easing );
-	}
+			// No disabled and non-accepted
+			if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) {
+				continue;
+			}
+
+			// Filter out elements in the current dragged item
+			for ( j = 0; j < list.length; j++ ) {
+				if ( list[ j ] === m[ i ].element[ 0 ] ) {
+					m[ i ].proportions().height = 0;
+					continue droppablesLoop;
+				}
+			}
+
+			m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
+			if ( !m[ i ].visible ) {
+				continue;
+			}
+
+			// Activate the droppable if used directly from draggables
+			if ( type === "mousedown" ) {
+				m[ i ]._activate.call( m[ i ], event );
+			}
+
+			m[ i ].offset = m[ i ].element.offset();
+			m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
 
-	el.queue(function() {
-		if ( hide ) {
-			el.hide();
 		}
-		$.effects.restore( el, props );
-		$.effects.removeWrapper( el );
-		done();
-	});
 
-	// inject all the animations we just queued to be first in line (after "inprogress")
-	if ( queuelen > 1) {
-		queue.splice.apply( queue,
-			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
-	}
-	el.dequeue();
+	},
+	drop: function( draggable, event ) {
 
-};
+		var dropped = false;
+		// Create a copy of the droppables in case the list changes during the drop (#9116)
+		$.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
 
-})(jQuery);
-(function( $, undefined ) {
+			if ( !this.options ) {
+				return;
+			}
+			if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance ) ) {
+				dropped = this._drop.call( this, event ) || dropped;
+			}
 
-$.effects.effect.clip = function( o, done ) {
-	// Create element
-	var el = $( this ),
-		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
-		mode = $.effects.setMode( el, o.mode || "hide" ),
-		show = mode === "show",
-		direction = o.direction || "vertical",
-		vert = direction === "vertical",
-		size = vert ? "height" : "width",
-		position = vert ? "top" : "left",
-		animation = {},
-		wrapper, animate, distance;
+			if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+				this.isout = true;
+				this.isover = false;
+				this._deactivate.call( this, event );
+			}
 
-	// Save & Show
-	$.effects.save( el, props );
-	el.show();
+		});
+		return dropped;
 
-	// Create Wrapper
-	wrapper = $.effects.createWrapper( el ).css({
-		overflow: "hidden"
-	});
-	animate = ( el[0].tagName === "IMG" ) ? wrapper : el;
-	distance = animate[ size ]();
+	},
+	dragStart: function( draggable, event ) {
+		// Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
+		draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
+			if ( !draggable.options.refreshPositions ) {
+				$.ui.ddmanager.prepareOffsets( draggable, event );
+			}
+		});
+	},
+	drag: function( draggable, event ) {
 
-	// Shift
-	if ( show ) {
-		animate.css( size, 0 );
-		animate.css( position, distance / 2 );
-	}
+		// If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+		if ( draggable.options.refreshPositions ) {
+			$.ui.ddmanager.prepareOffsets( draggable, event );
+		}
 
-	// Create Animation Object:
-	animation[ size ] = show ? distance : 0;
-	animation[ position ] = show ? 0 : distance / 2;
+		// Run through all droppables and check their positions based on specific tolerance options
+		$.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
 
-	// Animate
-	animate.animate( animation, {
-		queue: false,
-		duration: o.duration,
-		easing: o.easing,
-		complete: function() {
-			if ( !show ) {
-				el.hide();
+			if ( this.options.disabled || this.greedyChild || !this.visible ) {
+				return;
 			}
-			$.effects.restore( el, props );
-			$.effects.removeWrapper( el );
-			done();
+
+			var parentInstance, scope, parent,
+				intersects = $.ui.intersect( draggable, this, this.options.tolerance ),
+				c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
+			if ( !c ) {
+				return;
+			}
+
+			if ( this.options.greedy ) {
+				// find droppable parents with same scope
+				scope = this.options.scope;
+				parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
+					return $( this ).droppable( "instance" ).options.scope === scope;
+				});
+
+				if ( parent.length ) {
+					parentInstance = $( parent[ 0 ] ).droppable( "instance" );
+					parentInstance.greedyChild = ( c === "isover" );
+				}
+			}
+
+			// we just moved into a greedy child
+			if ( parentInstance && c === "isover" ) {
+				parentInstance.isover = false;
+				parentInstance.isout = true;
+				parentInstance._out.call( parentInstance, event );
+			}
+
+			this[ c ] = true;
+			this[c === "isout" ? "isover" : "isout"] = false;
+			this[c === "isover" ? "_over" : "_out"].call( this, event );
+
+			// we just moved out of a greedy child
+			if ( parentInstance && c === "isout" ) {
+				parentInstance.isout = false;
+				parentInstance.isover = true;
+				parentInstance._over.call( parentInstance, event );
+			}
+		});
+
+	},
+	dragStop: function( draggable, event ) {
+		draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
+		// Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
+		if ( !draggable.options.refreshPositions ) {
+			$.ui.ddmanager.prepareOffsets( draggable, event );
 		}
-	});
-
+	}
 };
 
-})(jQuery);
-(function( $, undefined ) {
+var droppable = $.ui.droppable;
 
-$.effects.effect.drop = function( o, done ) {
 
-	var el = $( this ),
-		props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
-		mode = $.effects.setMode( el, o.mode || "hide" ),
-		show = mode === "show",
-		direction = o.direction || "left",
-		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
-		motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
-		animation = {
-			opacity: show ? 1 : 0
-		},
-		distance;
+/*!
+ * jQuery UI Effects 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/category/effects-core/
+ */
 
-	// Adjust
-	$.effects.save( el, props );
-	el.show();
-	$.effects.createWrapper( el );
 
-	distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]( true ) / 2;
+var dataSpace = "ui-effects-";
 
-	if ( show ) {
-		el
-			.css( "opacity", 0 )
-			.css( ref, motion === "pos" ? -distance : distance );
-	}
+$.effects = {
+	effect: {}
+};
 
-	// Animation
-	animation[ ref ] = ( show ?
-		( motion === "pos" ? "+=" : "-=" ) :
-		( motion === "pos" ? "-=" : "+=" ) ) +
-		distance;
+/*!
+ * jQuery Color Animations v2.1.2
+ * https://github.com/jquery/jquery-color
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * Date: Wed Jan 16 08:47:09 2013 -0600
+ */
+(function( jQuery, undefined ) {
 
-	// Animate
-	el.animate( animation, {
-		queue: false,
-		duration: o.duration,
-		easing: o.easing,
-		complete: function() {
-			if ( mode === "hide" ) {
-				el.hide();
+	var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
+
+	// plusequals test for += 100 -= 100
+	rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
+	// a set of RE's that can match strings and generate color tuples.
+	stringParsers = [ {
+			re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
+			parse: function( execResult ) {
+				return [
+					execResult[ 1 ],
+					execResult[ 2 ],
+					execResult[ 3 ],
+					execResult[ 4 ]
+				];
 			}
-			$.effects.restore( el, props );
-			$.effects.removeWrapper( el );
-			done();
-		}
-	});
-};
+		}, {
+			re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
+			parse: function( execResult ) {
+				return [
+					execResult[ 1 ] * 2.55,
+					execResult[ 2 ] * 2.55,
+					execResult[ 3 ] * 2.55,
+					execResult[ 4 ]
+				];
+			}
+		}, {
+			// this regex ignores A-F because it's compared against an already lowercased string
+			re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
+			parse: function( execResult ) {
+				return [
+					parseInt( execResult[ 1 ], 16 ),
+					parseInt( execResult[ 2 ], 16 ),
+					parseInt( execResult[ 3 ], 16 )
+				];
+			}
+		}, {
+			// this regex ignores A-F because it's compared against an already lowercased string
+			re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
+			parse: function( execResult ) {
+				return [
+					parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
+					parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
+					parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
+				];
+			}
+		}, {
+			re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
+			space: "hsla",
+			parse: function( execResult ) {
+				return [
+					execResult[ 1 ],
+					execResult[ 2 ] / 100,
+					execResult[ 3 ] / 100,
+					execResult[ 4 ]
+				];
+			}
+		} ],
 
-})(jQuery);
-(function( $, undefined ) {
+	// jQuery.Color( )
+	color = jQuery.Color = function( color, green, blue, alpha ) {
+		return new jQuery.Color.fn.parse( color, green, blue, alpha );
+	},
+	spaces = {
+		rgba: {
+			props: {
+				red: {
+					idx: 0,
+					type: "byte"
+				},
+				green: {
+					idx: 1,
+					type: "byte"
+				},
+				blue: {
+					idx: 2,
+					type: "byte"
+				}
+			}
+		},
 
-$.effects.effect.explode = function( o, done ) {
+		hsla: {
+			props: {
+				hue: {
+					idx: 0,
+					type: "degrees"
+				},
+				saturation: {
+					idx: 1,
+					type: "percent"
+				},
+				lightness: {
+					idx: 2,
+					type: "percent"
+				}
+			}
+		}
+	},
+	propTypes = {
+		"byte": {
+			floor: true,
+			max: 255
+		},
+		"percent": {
+			max: 1
+		},
+		"degrees": {
+			mod: 360,
+			floor: true
+		}
+	},
+	support = color.support = {},
 
-	var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
-		cells = rows,
-		el = $( this ),
-		mode = $.effects.setMode( el, o.mode || "hide" ),
-		show = mode === "show",
+	// element for support tests
+	supportElem = jQuery( "<p>" )[ 0 ],
 
-		// show and then visibility:hidden the element before calculating offset
-		offset = el.show().css( "visibility", "hidden" ).offset(),
+	// colors = jQuery.Color.names
+	colors,
 
-		// width and height of a piece
-		width = Math.ceil( el.outerWidth() / cells ),
-		height = Math.ceil( el.outerHeight() / rows ),
-		pieces = [],
+	// local aliases of functions called often
+	each = jQuery.each;
 
-		// loop
-		i, j, left, top, mx, my;
+// determine rgba support immediately
+supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
+support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
 
-	// children animate complete:
-	function childComplete() {
-		pieces.push( this );
-		if ( pieces.length === rows * cells ) {
-			animComplete();
-		}
-	}
+// define cache name and alpha properties
+// for rgba and hsla spaces
+each( spaces, function( spaceName, space ) {
+	space.cache = "_" + spaceName;
+	space.props.alpha = {
+		idx: 3,
+		type: "percent",
+		def: 1
+	};
+});
 
-	// clone the element for each row and cell.
-	for( i = 0; i < rows ; i++ ) { // ===>
-		top = offset.top + i * height;
-		my = i - ( rows - 1 ) / 2 ;
+function clamp( value, prop, allowEmpty ) {
+	var type = propTypes[ prop.type ] || {};
 
-		for( j = 0; j < cells ; j++ ) { // |||
-			left = offset.left + j * width;
-			mx = j - ( cells - 1 ) / 2 ;
+	if ( value == null ) {
+		return (allowEmpty || !prop.def) ? null : prop.def;
+	}
 
-			// Create a clone of the now hidden main element that will be absolute positioned
-			// within a wrapper div off the -left and -top equal to size of our pieces
-			el
-				.clone()
-				.appendTo( "body" )
-				.wrap( "<div></div>" )
-				.css({
-					position: "absolute",
-					visibility: "visible",
-					left: -j * width,
-					top: -i * height
-				})
+	// ~~ is an short way of doing floor for positive numbers
+	value = type.floor ? ~~value : parseFloat( value );
 
-			// select the wrapper - make it overflow: hidden and absolute positioned based on
-			// where the original was located +left and +top equal to the size of pieces
-				.parent()
-				.addClass( "ui-effects-explode" )
-				.css({
-					position: "absolute",
-					overflow: "hidden",
-					width: width,
-					height: height,
-					left: left + ( show ? mx * width : 0 ),
-					top: top + ( show ? my * height : 0 ),
-					opacity: show ? 0 : 1
-				}).animate({
-					left: left + ( show ? 0 : mx * width ),
-					top: top + ( show ? 0 : my * height ),
-					opacity: show ? 1 : 0
-				}, o.duration || 500, o.easing, childComplete );
-		}
+	// IE will pass in empty strings as value for alpha,
+	// which will hit this case
+	if ( isNaN( value ) ) {
+		return prop.def;
 	}
 
-	function animComplete() {
-		el.css({
-			visibility: "visible"
-		});
-		$( pieces ).remove();
-		if ( !show ) {
-			el.hide();
-		}
-		done();
+	if ( type.mod ) {
+		// we add mod before modding to make sure that negatives values
+		// get converted properly: -10 -> 350
+		return (value + type.mod) % type.mod;
 	}
-};
 
-})(jQuery);
-(function( $, undefined ) {
-
-$.effects.effect.fade = function( o, done ) {
-	var el = $( this ),
-		mode = $.effects.setMode( el, o.mode || "toggle" );
+	// for now all property types without mod have min and max
+	return 0 > value ? 0 : type.max < value ? type.max : value;
+}
 
-	el.animate({
-		opacity: mode
-	}, {
-		queue: false,
-		duration: o.duration,
-		easing: o.easing,
-		complete: done
-	});
-};
+function stringParse( string ) {
+	var inst = color(),
+		rgba = inst._rgba = [];
 
-})( jQuery );
-(function( $, undefined ) {
+	string = string.toLowerCase();
 
-$.effects.effect.fold = function( o, done ) {
+	each( stringParsers, function( i, parser ) {
+		var parsed,
+			match = parser.re.exec( string ),
+			values = match && parser.parse( match ),
+			spaceName = parser.space || "rgba";
 
-	// Create element
-	var el = $( this ),
-		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
-		mode = $.effects.setMode( el, o.mode || "hide" ),
-		show = mode === "show",
-		hide = mode === "hide",
-		size = o.size || 15,
-		percent = /([0-9]+)%/.exec( size ),
-		horizFirst = !!o.horizFirst,
-		widthFirst = show !== horizFirst,
-		ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ],
-		duration = o.duration / 2,
-		wrapper, distance,
-		animation1 = {},
-		animation2 = {};
+		if ( values ) {
+			parsed = inst[ spaceName ]( values );
 
-	$.effects.save( el, props );
-	el.show();
+			// if this was an rgba parse the assignment might happen twice
+			// oh well....
+			inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
+			rgba = inst._rgba = parsed._rgba;
 
-	// Create Wrapper
-	wrapper = $.effects.createWrapper( el ).css({
-		overflow: "hidden"
+			// exit each( stringParsers ) here because we matched
+			return false;
+		}
 	});
-	distance = widthFirst ?
-		[ wrapper.width(), wrapper.height() ] :
-		[ wrapper.height(), wrapper.width() ];
 
-	if ( percent ) {
-		size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
-	}
-	if ( show ) {
-		wrapper.css( horizFirst ? {
-			height: 0,
-			width: size
-		} : {
-			height: size,
-			width: 0
-		});
-	}
+	// Found a stringParser that handled it
+	if ( rgba.length ) {
 
-	// Animation
-	animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;
-	animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;
+		// if this came from a parsed string, force "transparent" when alpha is 0
+		// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
+		if ( rgba.join() === "0,0,0,0" ) {
+			jQuery.extend( rgba, colors.transparent );
+		}
+		return inst;
+	}
 
-	// Animate
-	wrapper
-		.animate( animation1, duration, o.easing )
-		.animate( animation2, duration, o.easing, function() {
-			if ( hide ) {
-				el.hide();
-			}
-			$.effects.restore( el, props );
-			$.effects.removeWrapper( el );
-			done();
-		});
+	// named colors
+	return colors[ string ];
+}
 
-};
+color.fn = jQuery.extend( color.prototype, {
+	parse: function( red, green, blue, alpha ) {
+		if ( red === undefined ) {
+			this._rgba = [ null, null, null, null ];
+			return this;
+		}
+		if ( red.jquery || red.nodeType ) {
+			red = jQuery( red ).css( green );
+			green = undefined;
+		}
 
-})(jQuery);
-(function( $, undefined ) {
+		var inst = this,
+			type = jQuery.type( red ),
+			rgba = this._rgba = [];
 
-$.effects.effect.highlight = function( o, done ) {
-	var elem = $( this ),
-		props = [ "backgroundImage", "backgroundColor", "opacity" ],
-		mode = $.effects.setMode( elem, o.mode || "show" ),
-		animation = {
-			backgroundColor: elem.css( "backgroundColor" )
-		};
+		// more than 1 argument specified - assume ( red, green, blue, alpha )
+		if ( green !== undefined ) {
+			red = [ red, green, blue, alpha ];
+			type = "array";
+		}
 
-	if (mode === "hide") {
-		animation.opacity = 0;
-	}
+		if ( type === "string" ) {
+			return this.parse( stringParse( red ) || colors._default );
+		}
 
-	$.effects.save( elem, props );
+		if ( type === "array" ) {
+			each( spaces.rgba.props, function( key, prop ) {
+				rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
+			});
+			return this;
+		}
 
-	elem
-		.show()
-		.css({
-			backgroundImage: "none",
-			backgroundColor: o.color || "#ffff99"
-		})
-		.animate( animation, {
-			queue: false,
-			duration: o.duration,
-			easing: o.easing,
-			complete: function() {
-				if ( mode === "hide" ) {
-					elem.hide();
-				}
-				$.effects.restore( elem, props );
-				done();
-			}
-		});
-};
+		if ( type === "object" ) {
+			if ( red instanceof color ) {
+				each( spaces, function( spaceName, space ) {
+					if ( red[ space.cache ] ) {
+						inst[ space.cache ] = red[ space.cache ].slice();
+					}
+				});
+			} else {
+				each( spaces, function( spaceName, space ) {
+					var cache = space.cache;
+					each( space.props, function( key, prop ) {
 
-})(jQuery);
-(function( $, undefined ) {
+						// if the cache doesn't exist, and we know how to convert
+						if ( !inst[ cache ] && space.to ) {
 
-$.effects.effect.pulsate = function( o, done ) {
-	var elem = $( this ),
-		mode = $.effects.setMode( elem, o.mode || "show" ),
-		show = mode === "show",
-		hide = mode === "hide",
-		showhide = ( show || mode === "hide" ),
+							// if the value was null, we don't need to copy it
+							// if the key was alpha, we don't need to copy it either
+							if ( key === "alpha" || red[ key ] == null ) {
+								return;
+							}
+							inst[ cache ] = space.to( inst._rgba );
+						}
 
-		// showing or hiding leaves of the "last" animation
-		anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
-		duration = o.duration / anims,
-		animateTo = 0,
-		queue = elem.queue(),
-		queuelen = queue.length,
-		i;
+						// this is the only case where we allow nulls for ALL properties.
+						// call clamp with alwaysAllowEmpty
+						inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
+					});
 
-	if ( show || !elem.is(":visible")) {
-		elem.css( "opacity", 0 ).show();
-		animateTo = 1;
-	}
+					// everything defined but alpha?
+					if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
+						// use the default of 1
+						inst[ cache ][ 3 ] = 1;
+						if ( space.from ) {
+							inst._rgba = space.from( inst[ cache ] );
+						}
+					}
+				});
+			}
+			return this;
+		}
+	},
+	is: function( compare ) {
+		var is = color( compare ),
+			same = true,
+			inst = this;
 
-	// anims - 1 opacity "toggles"
-	for ( i = 1; i < anims; i++ ) {
-		elem.animate({
-			opacity: animateTo
-		}, duration, o.easing );
-		animateTo = 1 - animateTo;
-	}
+		each( spaces, function( _, space ) {
+			var localCache,
+				isCache = is[ space.cache ];
+			if (isCache) {
+				localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
+				each( space.props, function( _, prop ) {
+					if ( isCache[ prop.idx ] != null ) {
+						same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
+						return same;
+					}
+				});
+			}
+			return same;
+		});
+		return same;
+	},
+	_space: function() {
+		var used = [],
+			inst = this;
+		each( spaces, function( spaceName, space ) {
+			if ( inst[ space.cache ] ) {
+				used.push( spaceName );
+			}
+		});
+		return used.pop();
+	},
+	transition: function( other, distance ) {
+		var end = color( other ),
+			spaceName = end._space(),
+			space = spaces[ spaceName ],
+			startColor = this.alpha() === 0 ? color( "transparent" ) : this,
+			start = startColor[ space.cache ] || space.to( startColor._rgba ),
+			result = start.slice();
 
-	elem.animate({
-		opacity: animateTo
-	}, duration, o.easing);
+		end = end[ space.cache ];
+		each( space.props, function( key, prop ) {
+			var index = prop.idx,
+				startValue = start[ index ],
+				endValue = end[ index ],
+				type = propTypes[ prop.type ] || {};
 
-	elem.queue(function() {
-		if ( hide ) {
-			elem.hide();
+			// if null, don't override start value
+			if ( endValue === null ) {
+				return;
+			}
+			// if null - use end
+			if ( startValue === null ) {
+				result[ index ] = endValue;
+			} else {
+				if ( type.mod ) {
+					if ( endValue - startValue > type.mod / 2 ) {
+						startValue += type.mod;
+					} else if ( startValue - endValue > type.mod / 2 ) {
+						startValue -= type.mod;
+					}
+				}
+				result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
+			}
+		});
+		return this[ spaceName ]( result );
+	},
+	blend: function( opaque ) {
+		// if we are already opaque - return ourself
+		if ( this._rgba[ 3 ] === 1 ) {
+			return this;
 		}
-		done();
-	});
 
-	// We just queued up "anims" animations, we need to put them next in the queue
-	if ( queuelen > 1 ) {
-		queue.splice.apply( queue,
-			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
-	}
-	elem.dequeue();
-};
+		var rgb = this._rgba.slice(),
+			a = rgb.pop(),
+			blend = color( opaque )._rgba;
 
-})(jQuery);
-(function( $, undefined ) {
+		return color( jQuery.map( rgb, function( v, i ) {
+			return ( 1 - a ) * blend[ i ] + a * v;
+		}));
+	},
+	toRgbaString: function() {
+		var prefix = "rgba(",
+			rgba = jQuery.map( this._rgba, function( v, i ) {
+				return v == null ? ( i > 2 ? 1 : 0 ) : v;
+			});
 
-$.effects.effect.puff = function( o, done ) {
-	var elem = $( this ),
-		mode = $.effects.setMode( elem, o.mode || "hide" ),
-		hide = mode === "hide",
-		percent = parseInt( o.percent, 10 ) || 150,
-		factor = percent / 100,
-		original = {
-			height: elem.height(),
-			width: elem.width(),
-			outerHeight: elem.outerHeight(),
-			outerWidth: elem.outerWidth()
-		};
+		if ( rgba[ 3 ] === 1 ) {
+			rgba.pop();
+			prefix = "rgb(";
+		}
 
-	$.extend( o, {
-		effect: "scale",
-		queue: false,
-		fade: true,
-		mode: mode,
-		complete: done,
-		percent: hide ? percent : 100,
-		from: hide ?
-			original :
-			{
-				height: original.height * factor,
-				width: original.width * factor,
-				outerHeight: original.outerHeight * factor,
-				outerWidth: original.outerWidth * factor
-			}
-	});
+		return prefix + rgba.join() + ")";
+	},
+	toHslaString: function() {
+		var prefix = "hsla(",
+			hsla = jQuery.map( this.hsla(), function( v, i ) {
+				if ( v == null ) {
+					v = i > 2 ? 1 : 0;
+				}
 
-	elem.effect( o );
-};
+				// catch 1 and 2
+				if ( i && i < 3 ) {
+					v = Math.round( v * 100 ) + "%";
+				}
+				return v;
+			});
 
-$.effects.effect.scale = function( o, done ) {
+		if ( hsla[ 3 ] === 1 ) {
+			hsla.pop();
+			prefix = "hsl(";
+		}
+		return prefix + hsla.join() + ")";
+	},
+	toHexString: function( includeAlpha ) {
+		var rgba = this._rgba.slice(),
+			alpha = rgba.pop();
 
-	// Create element
-	var el = $( this ),
-		options = $.extend( true, {}, o ),
-		mode = $.effects.setMode( el, o.mode || "effect" ),
-		percent = parseInt( o.percent, 10 ) ||
-			( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
-		direction = o.direction || "both",
-		origin = o.origin,
-		original = {
-			height: el.height(),
-			width: el.width(),
-			outerHeight: el.outerHeight(),
-			outerWidth: el.outerWidth()
-		},
-		factor = {
-			y: direction !== "horizontal" ? (percent / 100) : 1,
-			x: direction !== "vertical" ? (percent / 100) : 1
-		};
+		if ( includeAlpha ) {
+			rgba.push( ~~( alpha * 255 ) );
+		}
 
-	// We are going to pass this effect to the size effect:
-	options.effect = "size";
-	options.queue = false;
-	options.complete = done;
+		return "#" + jQuery.map( rgba, function( v ) {
 
-	// Set default origin and restore for show/hide
-	if ( mode !== "effect" ) {
-		options.origin = origin || ["middle","center"];
-		options.restore = true;
+			// default to 0 when nulls exist
+			v = ( v || 0 ).toString( 16 );
+			return v.length === 1 ? "0" + v : v;
+		}).join("");
+	},
+	toString: function() {
+		return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
 	}
+});
+color.fn.parse.prototype = color.fn;
 
-	options.from = o.from || ( mode === "show" ? {
-		height: 0,
-		width: 0,
-		outerHeight: 0,
-		outerWidth: 0
-	} : original );
-	options.to = {
-		height: original.height * factor.y,
-		width: original.width * factor.x,
-		outerHeight: original.outerHeight * factor.y,
-		outerWidth: original.outerWidth * factor.x
-	};
+// hsla conversions adapted from:
+// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
 
-	// Fade option to support puff
-	if ( options.fade ) {
-		if ( mode === "show" ) {
-			options.from.opacity = 0;
-			options.to.opacity = 1;
-		}
-		if ( mode === "hide" ) {
-			options.from.opacity = 1;
-			options.to.opacity = 0;
-		}
+function hue2rgb( p, q, h ) {
+	h = ( h + 1 ) % 1;
+	if ( h * 6 < 1 ) {
+		return p + ( q - p ) * h * 6;
 	}
+	if ( h * 2 < 1) {
+		return q;
+	}
+	if ( h * 3 < 2 ) {
+		return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
+	}
+	return p;
+}
 
-	// Animate
-	el.effect( options );
-
-};
-
-$.effects.effect.size = function( o, done ) {
-
-	// Create element
-	var original, baseline, factor,
-		el = $( this ),
-		props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
-
-		// Always restore
-		props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
-
-		// Copy for children
-		props2 = [ "width", "height", "overflow" ],
-		cProps = [ "fontSize" ],
-		vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
-		hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
+spaces.hsla.to = function( rgba ) {
+	if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
+		return [ null, null, null, rgba[ 3 ] ];
+	}
+	var r = rgba[ 0 ] / 255,
+		g = rgba[ 1 ] / 255,
+		b = rgba[ 2 ] / 255,
+		a = rgba[ 3 ],
+		max = Math.max( r, g, b ),
+		min = Math.min( r, g, b ),
+		diff = max - min,
+		add = max + min,
+		l = add * 0.5,
+		h, s;
 
-		// Set options
-		mode = $.effects.setMode( el, o.mode || "effect" ),
-		restore = o.restore || mode !== "effect",
-		scale = o.scale || "both",
-		origin = o.origin || [ "middle", "center" ],
-		position = el.css( "position" ),
-		props = restore ? props0 : props1,
-		zero = {
-			height: 0,
-			width: 0,
-			outerHeight: 0,
-			outerWidth: 0
-		};
+	if ( min === max ) {
+		h = 0;
+	} else if ( r === max ) {
+		h = ( 60 * ( g - b ) / diff ) + 360;
+	} else if ( g === max ) {
+		h = ( 60 * ( b - r ) / diff ) + 120;
+	} else {
+		h = ( 60 * ( r - g ) / diff ) + 240;
+	}
 
-	if ( mode === "show" ) {
-		el.show();
+	// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
+	// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
+	if ( diff === 0 ) {
+		s = 0;
+	} else if ( l <= 0.5 ) {
+		s = diff / add;
+	} else {
+		s = diff / ( 2 - add );
 	}
-	original = {
-		height: el.height(),
-		width: el.width(),
-		outerHeight: el.outerHeight(),
-		outerWidth: el.outerWidth()
-	};
+	return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
+};
 
-	if ( o.mode === "toggle" && mode === "show" ) {
-		el.from = o.to || zero;
-		el.to = o.from || original;
-	} else {
-		el.from = o.from || ( mode === "show" ? zero : original );
-		el.to = o.to || ( mode === "hide" ? zero : original );
+spaces.hsla.from = function( hsla ) {
+	if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
+		return [ null, null, null, hsla[ 3 ] ];
 	}
+	var h = hsla[ 0 ] / 360,
+		s = hsla[ 1 ],
+		l = hsla[ 2 ],
+		a = hsla[ 3 ],
+		q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
+		p = 2 * l - q;
 
-	// Set scaling factor
-	factor = {
-		from: {
-			y: el.from.height / original.height,
-			x: el.from.width / original.width
-		},
-		to: {
-			y: el.to.height / original.height,
-			x: el.to.width / original.width
-		}
-	};
+	return [
+		Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
+		Math.round( hue2rgb( p, q, h ) * 255 ),
+		Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
+		a
+	];
+};
 
-	// Scale the css box
-	if ( scale === "box" || scale === "both" ) {
+each( spaces, function( spaceName, space ) {
+	var props = space.props,
+		cache = space.cache,
+		to = space.to,
+		from = space.from;
 
-		// Vertical props scaling
-		if ( factor.from.y !== factor.to.y ) {
-			props = props.concat( vProps );
-			el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
-			el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
-		}
+	// makes rgba() and hsla()
+	color.fn[ spaceName ] = function( value ) {
 
-		// Horizontal props scaling
-		if ( factor.from.x !== factor.to.x ) {
-			props = props.concat( hProps );
-			el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
-			el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
+		// generate a cache for this space if it doesn't exist
+		if ( to && !this[ cache ] ) {
+			this[ cache ] = to( this._rgba );
 		}
-	}
-
-	// Scale the content
-	if ( scale === "content" || scale === "both" ) {
-
-		// Vertical props scaling
-		if ( factor.from.y !== factor.to.y ) {
-			props = props.concat( cProps ).concat( props2 );
-			el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
-			el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
+		if ( value === undefined ) {
+			return this[ cache ].slice();
 		}
-	}
 
-	$.effects.save( el, props );
-	el.show();
-	$.effects.createWrapper( el );
-	el.css( "overflow", "hidden" ).css( el.from );
+		var ret,
+			type = jQuery.type( value ),
+			arr = ( type === "array" || type === "object" ) ? value : arguments,
+			local = this[ cache ].slice();
 
-	// Adjust
-	if (origin) { // Calculate baseline shifts
-		baseline = $.effects.getBaseline( origin, original );
-		el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
-		el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
-		el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
-		el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
-	}
-	el.css( el.from ); // set top & left
+		each( props, function( key, prop ) {
+			var val = arr[ type === "object" ? key : prop.idx ];
+			if ( val == null ) {
+				val = local[ prop.idx ];
+			}
+			local[ prop.idx ] = clamp( val, prop );
+		});
 
-	// Animate
-	if ( scale === "content" || scale === "both" ) { // Scale the children
+		if ( from ) {
+			ret = color( from( local ) );
+			ret[ cache ] = local;
+			return ret;
+		} else {
+			return color( local );
+		}
+	};
 
-		// Add margins/font-size
-		vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);
-		hProps = hProps.concat([ "marginLeft", "marginRight" ]);
-		props2 = props0.concat(vProps).concat(hProps);
+	// makes red() green() blue() alpha() hue() saturation() lightness()
+	each( props, function( key, prop ) {
+		// alpha is included in more than one space
+		if ( color.fn[ key ] ) {
+			return;
+		}
+		color.fn[ key ] = function( value ) {
+			var vtype = jQuery.type( value ),
+				fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
+				local = this[ fn ](),
+				cur = local[ prop.idx ],
+				match;
 
-		el.find( "*[width]" ).each( function(){
-			var child = $( this ),
-				c_original = {
-					height: child.height(),
-					width: child.width(),
-					outerHeight: child.outerHeight(),
-					outerWidth: child.outerWidth()
-				};
-			if (restore) {
-				$.effects.save(child, props2);
+			if ( vtype === "undefined" ) {
+				return cur;
 			}
 
-			child.from = {
-				height: c_original.height * factor.from.y,
-				width: c_original.width * factor.from.x,
-				outerHeight: c_original.outerHeight * factor.from.y,
-				outerWidth: c_original.outerWidth * factor.from.x
-			};
-			child.to = {
-				height: c_original.height * factor.to.y,
-				width: c_original.width * factor.to.x,
-				outerHeight: c_original.height * factor.to.y,
-				outerWidth: c_original.width * factor.to.x
-			};
-
-			// Vertical props scaling
-			if ( factor.from.y !== factor.to.y ) {
-				child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
-				child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
+			if ( vtype === "function" ) {
+				value = value.call( this, cur );
+				vtype = jQuery.type( value );
 			}
-
-			// Horizontal props scaling
-			if ( factor.from.x !== factor.to.x ) {
-				child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
-				child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
+			if ( value == null && prop.empty ) {
+				return this;
 			}
-
-			// Animate children
-			child.css( child.from );
-			child.animate( child.to, o.duration, o.easing, function() {
-
-				// Restore children
-				if ( restore ) {
-					$.effects.restore( child, props2 );
+			if ( vtype === "string" ) {
+				match = rplusequals.exec( value );
+				if ( match ) {
+					value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
 				}
-			});
-		});
-	}
-
-	// Animate
-	el.animate( el.to, {
-		queue: false,
-		duration: o.duration,
-		easing: o.easing,
-		complete: function() {
-			if ( el.to.opacity === 0 ) {
-				el.css( "opacity", el.from.opacity );
 			}
-			if( mode === "hide" ) {
-				el.hide();
-			}
-			$.effects.restore( el, props );
-			if ( !restore ) {
+			local[ prop.idx ] = value;
+			return this[ fn ]( local );
+		};
+	});
+});
 
-				// we need to calculate our new positioning based on the scaling
-				if ( position === "static" ) {
-					el.css({
-						position: "relative",
-						top: el.to.top,
-						left: el.to.left
-					});
-				} else {
-					$.each([ "top", "left" ], function( idx, pos ) {
-						el.css( pos, function( _, str ) {
-							var val = parseInt( str, 10 ),
-								toRef = idx ? el.to.left : el.to.top;
+// add cssHook and .fx.step function for each named hook.
+// accept a space separated string of properties
+color.hook = function( hook ) {
+	var hooks = hook.split( " " );
+	each( hooks, function( i, hook ) {
+		jQuery.cssHooks[ hook ] = {
+			set: function( elem, value ) {
+				var parsed, curElem,
+					backgroundColor = "";
 
-							// if original was "auto", recalculate the new value from wrapper
-							if ( str === "auto" ) {
-								return toRef + "px";
+				if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
+					value = color( parsed || value );
+					if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
+						curElem = hook === "backgroundColor" ? elem.parentNode : elem;
+						while (
+							(backgroundColor === "" || backgroundColor === "transparent") &&
+							curElem && curElem.style
+						) {
+							try {
+								backgroundColor = jQuery.css( curElem, "backgroundColor" );
+								curElem = curElem.parentNode;
+							} catch ( e ) {
 							}
+						}
 
-							return val + toRef + "px";
-						});
-					});
+						value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
+							backgroundColor :
+							"_default" );
+					}
+
+					value = value.toRgbaString();
+				}
+				try {
+					elem.style[ hook ] = value;
+				} catch( e ) {
+					// wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
 				}
 			}
-
-			$.effects.removeWrapper( el );
-			done();
-		}
+		};
+		jQuery.fx.step[ hook ] = function( fx ) {
+			if ( !fx.colorInit ) {
+				fx.start = color( fx.elem, hook );
+				fx.end = color( fx.end );
+				fx.colorInit = true;
+			}
+			jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
+		};
 	});
 
 };
 
-})(jQuery);
-(function( $, undefined ) {
-
-$.effects.effect.shake = function( o, done ) {
-
-	var el = $( this ),
-		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
-		mode = $.effects.setMode( el, o.mode || "effect" ),
-		direction = o.direction || "left",
-		distance = o.distance || 20,
-		times = o.times || 3,
-		anims = times * 2 + 1,
-		speed = Math.round(o.duration/anims),
-		ref = (direction === "up" || direction === "down") ? "top" : "left",
-		positiveMotion = (direction === "up" || direction === "left"),
-		animation = {},
-		animation1 = {},
-		animation2 = {},
-		i,
-
-		// we will need to re-assemble the queue to stack our animations in place
-		queue = el.queue(),
-		queuelen = queue.length;
-
-	$.effects.save( el, props );
-	el.show();
-	$.effects.createWrapper( el );
-
-	// Animation
-	animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
-	animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
-	animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
+color.hook( stepHooks );
 
-	// Animate
-	el.animate( animation, speed, o.easing );
+jQuery.cssHooks.borderColor = {
+	expand: function( value ) {
+		var expanded = {};
 
-	// Shakes
-	for ( i = 1; i < times; i++ ) {
-		el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
-	}
-	el
-		.animate( animation1, speed, o.easing )
-		.animate( animation, speed / 2, o.easing )
-		.queue(function() {
-			if ( mode === "hide" ) {
-				el.hide();
-			}
-			$.effects.restore( el, props );
-			$.effects.removeWrapper( el );
-			done();
+		each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
+			expanded[ "border" + part + "Color" ] = value;
 		});
-
-	// inject all the animations we just queued to be first in line (after "inprogress")
-	if ( queuelen > 1) {
-		queue.splice.apply( queue,
-			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
+		return expanded;
 	}
-	el.dequeue();
-
 };
 
-})(jQuery);
-(function( $, undefined ) {
-
-$.effects.effect.slide = function( o, done ) {
+// Basic color names only.
+// Usage of any of the other color names requires adding yourself or including
+// jquery.color.svg-names.js.
+colors = jQuery.Color.names = {
+	// 4.1. Basic color keywords
+	aqua: "#00ffff",
+	black: "#000000",
+	blue: "#0000ff",
+	fuchsia: "#ff00ff",
+	gray: "#808080",
+	green: "#008000",
+	lime: "#00ff00",
+	maroon: "#800000",
+	navy: "#000080",
+	olive: "#808000",
+	purple: "#800080",
+	red: "#ff0000",
+	silver: "#c0c0c0",
+	teal: "#008080",
+	white: "#ffffff",
+	yellow: "#ffff00",
 
-	// Create element
-	var el = $( this ),
-		props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
-		mode = $.effects.setMode( el, o.mode || "show" ),
-		show = mode === "show",
-		direction = o.direction || "left",
-		ref = (direction === "up" || direction === "down") ? "top" : "left",
-		positiveMotion = (direction === "up" || direction === "left"),
-		distance,
-		animation = {};
+	// 4.2.3. "transparent" color keyword
+	transparent: [ null, null, null, 0 ],
 
-	// Adjust
-	$.effects.save( el, props );
-	el.show();
-	distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
+	_default: "#ffffff"
+};
 
-	$.effects.createWrapper( el ).css({
-		overflow: "hidden"
-	});
+})( jQuery );
 
-	if ( show ) {
-		el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
-	}
+/******************************************************************************/
+/****************************** CLASS ANIMATIONS ******************************/
+/******************************************************************************/
+(function() {
 
-	// Animation
-	animation[ ref ] = ( show ?
-		( positiveMotion ? "+=" : "-=") :
-		( positiveMotion ? "-=" : "+=")) +
-		distance;
+var classAnimationActions = [ "add", "remove", "toggle" ],
+	shorthandStyles = {
+		border: 1,
+		borderBottom: 1,
+		borderColor: 1,
+		borderLeft: 1,
+		borderRight: 1,
+		borderTop: 1,
+		borderWidth: 1,
+		margin: 1,
+		padding: 1
+	};
 
-	// Animate
-	el.animate( animation, {
-		queue: false,
-		duration: o.duration,
-		easing: o.easing,
-		complete: function() {
-			if ( mode === "hide" ) {
-				el.hide();
-			}
-			$.effects.restore( el, props );
-			$.effects.removeWrapper( el );
-			done();
+$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
+	$.fx.step[ prop ] = function( fx ) {
+		if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
+			jQuery.style( fx.elem, prop, fx.end );
+			fx.setAttr = true;
 		}
-	});
-};
-
-})(jQuery);
-(function( $, undefined ) {
+	};
+});
 
-$.effects.effect.transfer = function( o, done ) {
-	var elem = $( this ),
-		target = $( o.to ),
-		targetFixed = target.css( "position" ) === "fixed",
-		body = $("body"),
-		fixTop = targetFixed ? body.scrollTop() : 0,
-		fixLeft = targetFixed ? body.scrollLeft() : 0,
-		endPosition = target.offset(),
-		animation = {
-			top: endPosition.top - fixTop ,
-			left: endPosition.left - fixLeft ,
-			height: target.innerHeight(),
-			width: target.innerWidth()
-		},
-		startPosition = elem.offset(),
-		transfer = $( "<div class='ui-effects-transfer'></div>" )
-			.appendTo( document.body )
-			.addClass( o.className )
-			.css({
-				top: startPosition.top - fixTop ,
-				left: startPosition.left - fixLeft ,
-				height: elem.innerHeight(),
-				width: elem.innerWidth(),
-				position: targetFixed ? "fixed" : "absolute"
-			})
-			.animate( animation, o.duration, o.easing, function() {
-				transfer.remove();
-				done();
-			});
-};
+function getElementStyles( elem ) {
+	var key, len,
+		style = elem.ownerDocument.defaultView ?
+			elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
+			elem.currentStyle,
+		styles = {};
 
-})(jQuery);
-(function( $, undefined ) {
+	if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
+		len = style.length;
+		while ( len-- ) {
+			key = style[ len ];
+			if ( typeof style[ key ] === "string" ) {
+				styles[ $.camelCase( key ) ] = style[ key ];
+			}
+		}
+	// support: Opera, IE <9
+	} else {
+		for ( key in style ) {
+			if ( typeof style[ key ] === "string" ) {
+				styles[ key ] = style[ key ];
+			}
+		}
+	}
 
-$.widget( "ui.menu", {
-	version: "1.10.4",
-	defaultElement: "<ul>",
-	delay: 300,
-	options: {
-		icons: {
-			submenu: "ui-icon-carat-1-e"
-		},
-		menus: "ul",
-		position: {
-			my: "left top",
-			at: "right top"
-		},
-		role: "menu",
+	return styles;
+}
 
-		// callbacks
-		blur: null,
-		focus: null,
-		select: null
-	},
+function styleDifference( oldStyle, newStyle ) {
+	var diff = {},
+		name, value;
 
-	_create: function() {
-		this.activeMenu = this.element;
-		// flag used to prevent firing of the click handler
-		// as the event bubbles up through nested menus
-		this.mouseHandled = false;
-		this.element
-			.uniqueId()
-			.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
-			.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
-			.attr({
-				role: this.options.role,
-				tabIndex: 0
-			})
-			// need to catch all clicks on disabled menu
-			// not possible through _on
-			.bind( "click" + this.eventNamespace, $.proxy(function( event ) {
-				if ( this.options.disabled ) {
-					event.preventDefault();
+	for ( name in newStyle ) {
+		value = newStyle[ name ];
+		if ( oldStyle[ name ] !== value ) {
+			if ( !shorthandStyles[ name ] ) {
+				if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
+					diff[ name ] = value;
 				}
-			}, this ));
-
-		if ( this.options.disabled ) {
-			this.element
-				.addClass( "ui-state-disabled" )
-				.attr( "aria-disabled", "true" );
-		}
-
-		this._on({
-			// Prevent focus from sticking to links inside menu after clicking
-			// them (focus should always stay on UL during navigation).
-			"mousedown .ui-menu-item > a": function( event ) {
-				event.preventDefault();
-			},
-			"click .ui-state-disabled > a": function( event ) {
-				event.preventDefault();
-			},
-			"click .ui-menu-item:has(a)": function( event ) {
-				var target = $( event.target ).closest( ".ui-menu-item" );
-				if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
-					this.select( event );
+			}
+		}
+	}
 
-					// Only set the mouseHandled flag if the event will bubble, see #9469.
-					if ( !event.isPropagationStopped() ) {
-						this.mouseHandled = true;
-					}
+	return diff;
+}
 
-					// Open submenu on click
-					if ( target.has( ".ui-menu" ).length ) {
-						this.expand( event );
-					} else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
+// support: jQuery <1.8
+if ( !$.fn.addBack ) {
+	$.fn.addBack = function( selector ) {
+		return this.add( selector == null ?
+			this.prevObject : this.prevObject.filter( selector )
+		);
+	};
+}
 
-						// Redirect focus to the menu
-						this.element.trigger( "focus", [ true ] );
+$.effects.animateClass = function( value, duration, easing, callback ) {
+	var o = $.speed( duration, easing, callback );
 
-						// If the active item is on the top level, let it stay active.
-						// Otherwise, blur the active item since it is no longer visible.
-						if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
-							clearTimeout( this.timer );
-						}
-					}
-				}
-			},
-			"mouseenter .ui-menu-item": function( event ) {
-				var target = $( event.currentTarget );
-				// Remove ui-state-active class from siblings of the newly focused menu item
-				// to avoid a jump caused by adjacent elements both having a class with a border
-				target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" );
-				this.focus( event, target );
-			},
-			mouseleave: "collapseAll",
-			"mouseleave .ui-menu": "collapseAll",
-			focus: function( event, keepActiveItem ) {
-				// If there's already an active item, keep it active
-				// If not, activate the first item
-				var item = this.active || this.element.children( ".ui-menu-item" ).eq( 0 );
+	return this.queue( function() {
+		var animated = $( this ),
+			baseClass = animated.attr( "class" ) || "",
+			applyClassChange,
+			allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
 
-				if ( !keepActiveItem ) {
-					this.focus( event, item );
-				}
-			},
-			blur: function( event ) {
-				this._delay(function() {
-					if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
-						this.collapseAll( event );
-					}
-				});
-			},
-			keydown: "_keydown"
+		// map the animated objects to store the original styles.
+		allAnimations = allAnimations.map(function() {
+			var el = $( this );
+			return {
+				el: el,
+				start: getElementStyles( this )
+			};
 		});
 
-		this.refresh();
-
-		// Clicks outside of a menu collapse any open menus
-		this._on( this.document, {
-			click: function( event ) {
-				if ( !$( event.target ).closest( ".ui-menu" ).length ) {
-					this.collapseAll( event );
+		// apply class change
+		applyClassChange = function() {
+			$.each( classAnimationActions, function(i, action) {
+				if ( value[ action ] ) {
+					animated[ action + "Class" ]( value[ action ] );
 				}
+			});
+		};
+		applyClassChange();
 
-				// Reset the mouseHandled flag
-				this.mouseHandled = false;
-			}
+		// map all animated objects again - calculate new styles and diff
+		allAnimations = allAnimations.map(function() {
+			this.end = getElementStyles( this.el[ 0 ] );
+			this.diff = styleDifference( this.start, this.end );
+			return this;
 		});
-	},
 
-	_destroy: function() {
-		// Destroy (sub)menus
-		this.element
-			.removeAttr( "aria-activedescendant" )
-			.find( ".ui-menu" ).addBack()
-				.removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" )
-				.removeAttr( "role" )
-				.removeAttr( "tabIndex" )
-				.removeAttr( "aria-labelledby" )
-				.removeAttr( "aria-expanded" )
-				.removeAttr( "aria-hidden" )
-				.removeAttr( "aria-disabled" )
-				.removeUniqueId()
-				.show();
+		// apply original class
+		animated.attr( "class", baseClass );
 
-		// Destroy menu items
-		this.element.find( ".ui-menu-item" )
-			.removeClass( "ui-menu-item" )
-			.removeAttr( "role" )
-			.removeAttr( "aria-disabled" )
-			.children( "a" )
-				.removeUniqueId()
-				.removeClass( "ui-corner-all ui-state-hover" )
-				.removeAttr( "tabIndex" )
-				.removeAttr( "role" )
-				.removeAttr( "aria-haspopup" )
-				.children().each( function() {
-					var elem = $( this );
-					if ( elem.data( "ui-menu-submenu-carat" ) ) {
-						elem.remove();
+		// map all animated objects again - this time collecting a promise
+		allAnimations = allAnimations.map(function() {
+			var styleInfo = this,
+				dfd = $.Deferred(),
+				opts = $.extend({}, o, {
+					queue: false,
+					complete: function() {
+						dfd.resolve( styleInfo );
 					}
 				});
 
-		// Destroy menu dividers
-		this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
-	},
+			this.el.animate( this.diff, opts );
+			return dfd.promise();
+		});
 
-	_keydown: function( event ) {
-		var match, prev, character, skip, regex,
-			preventDefault = true;
+		// once all animations have completed:
+		$.when.apply( $, allAnimations.get() ).done(function() {
 
-		function escape( value ) {
-			return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
-		}
+			// set the final class
+			applyClassChange();
 
-		switch ( event.keyCode ) {
-		case $.ui.keyCode.PAGE_UP:
-			this.previousPage( event );
-			break;
-		case $.ui.keyCode.PAGE_DOWN:
-			this.nextPage( event );
-			break;
-		case $.ui.keyCode.HOME:
-			this._move( "first", "first", event );
-			break;
-		case $.ui.keyCode.END:
-			this._move( "last", "last", event );
-			break;
-		case $.ui.keyCode.UP:
-			this.previous( event );
-			break;
-		case $.ui.keyCode.DOWN:
-			this.next( event );
-			break;
-		case $.ui.keyCode.LEFT:
-			this.collapse( event );
-			break;
-		case $.ui.keyCode.RIGHT:
-			if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
-				this.expand( event );
-			}
-			break;
-		case $.ui.keyCode.ENTER:
-		case $.ui.keyCode.SPACE:
-			this._activate( event );
-			break;
-		case $.ui.keyCode.ESCAPE:
-			this.collapse( event );
-			break;
-		default:
-			preventDefault = false;
-			prev = this.previousFilter || "";
-			character = String.fromCharCode( event.keyCode );
-			skip = false;
+			// for each animated element,
+			// clear all css properties that were animated
+			$.each( arguments, function() {
+				var el = this.el;
+				$.each( this.diff, function(key) {
+					el.css( key, "" );
+				});
+			});
 
-			clearTimeout( this.filterTimer );
+			// this is guarnteed to be there if you use jQuery.speed()
+			// it also handles dequeuing the next anim...
+			o.complete.call( animated[ 0 ] );
+		});
+	});
+};
 
-			if ( character === prev ) {
-				skip = true;
+$.fn.extend({
+	addClass: (function( orig ) {
+		return function( classNames, speed, easing, callback ) {
+			return speed ?
+				$.effects.animateClass.call( this,
+					{ add: classNames }, speed, easing, callback ) :
+				orig.apply( this, arguments );
+		};
+	})( $.fn.addClass ),
+
+	removeClass: (function( orig ) {
+		return function( classNames, speed, easing, callback ) {
+			return arguments.length > 1 ?
+				$.effects.animateClass.call( this,
+					{ remove: classNames }, speed, easing, callback ) :
+				orig.apply( this, arguments );
+		};
+	})( $.fn.removeClass ),
+
+	toggleClass: (function( orig ) {
+		return function( classNames, force, speed, easing, callback ) {
+			if ( typeof force === "boolean" || force === undefined ) {
+				if ( !speed ) {
+					// without speed parameter
+					return orig.apply( this, arguments );
+				} else {
+					return $.effects.animateClass.call( this,
+						(force ? { add: classNames } : { remove: classNames }),
+						speed, easing, callback );
+				}
 			} else {
-				character = prev + character;
+				// without force parameter
+				return $.effects.animateClass.call( this,
+					{ toggle: classNames }, force, speed, easing );
 			}
+		};
+	})( $.fn.toggleClass ),
 
-			regex = new RegExp( "^" + escape( character ), "i" );
-			match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
-				return regex.test( $( this ).children( "a" ).text() );
-			});
-			match = skip && match.index( this.active.next() ) !== -1 ?
-				this.active.nextAll( ".ui-menu-item" ) :
-				match;
+	switchClass: function( remove, add, speed, easing, callback) {
+		return $.effects.animateClass.call( this, {
+			add: add,
+			remove: remove
+		}, speed, easing, callback );
+	}
+});
 
-			// If no matches on the current filter, reset to the last character pressed
-			// to move down the menu to the first item that starts with that character
-			if ( !match.length ) {
-				character = String.fromCharCode( event.keyCode );
-				regex = new RegExp( "^" + escape( character ), "i" );
-				match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
-					return regex.test( $( this ).children( "a" ).text() );
-				});
+})();
+
+/******************************************************************************/
+/*********************************** EFFECTS **********************************/
+/******************************************************************************/
+
+(function() {
+
+$.extend( $.effects, {
+	version: "1.11.0",
+
+	// Saves a set of properties in a data storage
+	save: function( element, set ) {
+		for ( var i = 0; i < set.length; i++ ) {
+			if ( set[ i ] !== null ) {
+				element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
 			}
+		}
+	},
 
-			if ( match.length ) {
-				this.focus( event, match );
-				if ( match.length > 1 ) {
-					this.previousFilter = character;
-					this.filterTimer = this._delay(function() {
-						delete this.previousFilter;
-					}, 1000 );
-				} else {
-					delete this.previousFilter;
+	// Restores a set of previously saved properties from a data storage
+	restore: function( element, set ) {
+		var val, i;
+		for ( i = 0; i < set.length; i++ ) {
+			if ( set[ i ] !== null ) {
+				val = element.data( dataSpace + set[ i ] );
+				// support: jQuery 1.6.2
+				// http://bugs.jquery.com/ticket/9917
+				// jQuery 1.6.2 incorrectly returns undefined for any falsy value.
+				// We can't differentiate between "" and 0 here, so we just assume
+				// empty string since it's likely to be a more common value...
+				if ( val === undefined ) {
+					val = "";
 				}
-			} else {
-				delete this.previousFilter;
+				element.css( set[ i ], val );
 			}
 		}
+	},
 
-		if ( preventDefault ) {
-			event.preventDefault();
+	setMode: function( el, mode ) {
+		if (mode === "toggle") {
+			mode = el.is( ":hidden" ) ? "show" : "hide";
 		}
+		return mode;
 	},
 
-	_activate: function( event ) {
-		if ( !this.active.is( ".ui-state-disabled" ) ) {
-			if ( this.active.children( "a[aria-haspopup='true']" ).length ) {
-				this.expand( event );
-			} else {
-				this.select( event );
-			}
+	// Translates a [top,left] array into a baseline value
+	// this should be a little more flexible in the future to handle a string & hash
+	getBaseline: function( origin, original ) {
+		var y, x;
+		switch ( origin[ 0 ] ) {
+			case "top": y = 0; break;
+			case "middle": y = 0.5; break;
+			case "bottom": y = 1; break;
+			default: y = origin[ 0 ] / original.height;
+		}
+		switch ( origin[ 1 ] ) {
+			case "left": x = 0; break;
+			case "center": x = 0.5; break;
+			case "right": x = 1; break;
+			default: x = origin[ 1 ] / original.width;
 		}
+		return {
+			x: x,
+			y: y
+		};
 	},
 
-	refresh: function() {
-		var menus,
-			icon = this.options.icons.submenu,
-			submenus = this.element.find( this.options.menus );
-
-		this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
+	// Wraps the element around a wrapper that copies position properties
+	createWrapper: function( element ) {
 
-		// Initialize nested menus
-		submenus.filter( ":not(.ui-menu)" )
-			.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
-			.hide()
-			.attr({
-				role: this.options.role,
-				"aria-hidden": "true",
-				"aria-expanded": "false"
-			})
-			.each(function() {
-				var menu = $( this ),
-					item = menu.prev( "a" ),
-					submenuCarat = $( "<span>" )
-						.addClass( "ui-menu-icon ui-icon " + icon )
-						.data( "ui-menu-submenu-carat", true );
+		// if the element is already wrapped, return it
+		if ( element.parent().is( ".ui-effects-wrapper" )) {
+			return element.parent();
+		}
 
-				item
-					.attr( "aria-haspopup", "true" )
-					.prepend( submenuCarat );
-				menu.attr( "aria-labelledby", item.attr( "id" ) );
-			});
+		// wrap the element
+		var props = {
+				width: element.outerWidth(true),
+				height: element.outerHeight(true),
+				"float": element.css( "float" )
+			},
+			wrapper = $( "<div></div>" )
+				.addClass( "ui-effects-wrapper" )
+				.css({
+					fontSize: "100%",
+					background: "transparent",
+					border: "none",
+					margin: 0,
+					padding: 0
+				}),
+			// Store the size in case width/height are defined in % - Fixes #5245
+			size = {
+				width: element.width(),
+				height: element.height()
+			},
+			active = document.activeElement;
 
-		menus = submenus.add( this.element );
+		// support: Firefox
+		// Firefox incorrectly exposes anonymous content
+		// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
+		try {
+			active.id;
+		} catch( e ) {
+			active = document.body;
+		}
 
-		// Don't refresh list items that are already adapted
-		menus.children( ":not(.ui-menu-item):has(a)" )
-			.addClass( "ui-menu-item" )
-			.attr( "role", "presentation" )
-			.children( "a" )
-				.uniqueId()
-				.addClass( "ui-corner-all" )
-				.attr({
-					tabIndex: -1,
-					role: this._itemRole()
-				});
+		element.wrap( wrapper );
 
-		// Initialize unlinked menu-items containing spaces and/or dashes only as dividers
-		menus.children( ":not(.ui-menu-item)" ).each(function() {
-			var item = $( this );
-			// hyphen, em dash, en dash
-			if ( !/[^\-\u2014\u2013\s]/.test( item.text() ) ) {
-				item.addClass( "ui-widget-content ui-menu-divider" );
-			}
-		});
+		// Fixes #7595 - Elements lose focus when wrapped.
+		if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
+			$( active ).focus();
+		}
 
-		// Add aria-disabled attribute to any disabled menu item
-		menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
+		wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
 
-		// If the active item has been removed, blur the menu
-		if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
-			this.blur();
+		// transfer positioning properties to the wrapper
+		if ( element.css( "position" ) === "static" ) {
+			wrapper.css({ position: "relative" });
+			element.css({ position: "relative" });
+		} else {
+			$.extend( props, {
+				position: element.css( "position" ),
+				zIndex: element.css( "z-index" )
+			});
+			$.each([ "top", "left", "bottom", "right" ], function(i, pos) {
+				props[ pos ] = element.css( pos );
+				if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
+					props[ pos ] = "auto";
+				}
+			});
+			element.css({
+				position: "relative",
+				top: 0,
+				left: 0,
+				right: "auto",
+				bottom: "auto"
+			});
 		}
-	},
+		element.css(size);
 
-	_itemRole: function() {
-		return {
-			menu: "menuitem",
-			listbox: "option"
-		}[ this.options.role ];
+		return wrapper.css( props ).show();
 	},
 
-	_setOption: function( key, value ) {
-		if ( key === "icons" ) {
-			this.element.find( ".ui-menu-icon" )
-				.removeClass( this.options.icons.submenu )
-				.addClass( value.submenu );
+	removeWrapper: function( element ) {
+		var active = document.activeElement;
+
+		if ( element.parent().is( ".ui-effects-wrapper" ) ) {
+			element.parent().replaceWith( element );
+
+			// Fixes #7595 - Elements lose focus when wrapped.
+			if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
+				$( active ).focus();
+			}
 		}
-		this._super( key, value );
+
+		return element;
 	},
 
-	focus: function( event, item ) {
-		var nested, focused;
-		this.blur( event, event && event.type === "focus" );
+	setTransition: function( element, list, factor, value ) {
+		value = value || {};
+		$.each( list, function( i, x ) {
+			var unit = element.cssUnit( x );
+			if ( unit[ 0 ] > 0 ) {
+				value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
+			}
+		});
+		return value;
+	}
+});
 
-		this._scrollIntoView( item );
+// return an effect options object for the given parameters:
+function _normalizeArguments( effect, options, speed, callback ) {
+
+	// allow passing all options as the first parameter
+	if ( $.isPlainObject( effect ) ) {
+		options = effect;
+		effect = effect.effect;
+	}
+
+	// convert to an object
+	effect = { effect: effect };
+
+	// catch (effect, null, ...)
+	if ( options == null ) {
+		options = {};
+	}
+
+	// catch (effect, callback)
+	if ( $.isFunction( options ) ) {
+		callback = options;
+		speed = null;
+		options = {};
+	}
+
+	// catch (effect, speed, ?)
+	if ( typeof options === "number" || $.fx.speeds[ options ] ) {
+		callback = speed;
+		speed = options;
+		options = {};
+	}
+
+	// catch (effect, options, callback)
+	if ( $.isFunction( speed ) ) {
+		callback = speed;
+		speed = null;
+	}
+
+	// add options to effect
+	if ( options ) {
+		$.extend( effect, options );
+	}
+
+	speed = speed || options.duration;
+	effect.duration = $.fx.off ? 0 :
+		typeof speed === "number" ? speed :
+		speed in $.fx.speeds ? $.fx.speeds[ speed ] :
+		$.fx.speeds._default;
+
+	effect.complete = callback || options.complete;
+
+	return effect;
+}
 
-		this.active = item.first();
-		focused = this.active.children( "a" ).addClass( "ui-state-focus" );
-		// Only update aria-activedescendant if there's a role
-		// otherwise we assume focus is managed elsewhere
-		if ( this.options.role ) {
-			this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
-		}
+function standardAnimationOption( option ) {
+	// Valid standard speeds (nothing, number, named speed)
+	if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
+		return true;
+	}
 
-		// Highlight active parent menu item, if any
-		this.active
-			.parent()
-			.closest( ".ui-menu-item" )
-			.children( "a:first" )
-			.addClass( "ui-state-active" );
+	// Invalid strings - treat as "normal" speed
+	if ( typeof option === "string" && !$.effects.effect[ option ] ) {
+		return true;
+	}
 
-		if ( event && event.type === "keydown" ) {
-			this._close();
-		} else {
-			this.timer = this._delay(function() {
-				this._close();
-			}, this.delay );
-		}
+	// Complete callback
+	if ( $.isFunction( option ) ) {
+		return true;
+	}
 
-		nested = item.children( ".ui-menu" );
-		if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
-			this._startOpening(nested);
-		}
-		this.activeMenu = item.parent();
+	// Options hash (but not naming an effect)
+	if ( typeof option === "object" && !option.effect ) {
+		return true;
+	}
 
-		this._trigger( "focus", event, { item: item } );
-	},
+	// Didn't match any standard API
+	return false;
+}
 
-	_scrollIntoView: function( item ) {
-		var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
-		if ( this._hasScroll() ) {
-			borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
-			paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
-			offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
-			scroll = this.activeMenu.scrollTop();
-			elementHeight = this.activeMenu.height();
-			itemHeight = item.height();
+$.fn.extend({
+	effect: function( /* effect, options, speed, callback */ ) {
+		var args = _normalizeArguments.apply( this, arguments ),
+			mode = args.mode,
+			queue = args.queue,
+			effectMethod = $.effects.effect[ args.effect ];
 
-			if ( offset < 0 ) {
-				this.activeMenu.scrollTop( scroll + offset );
-			} else if ( offset + itemHeight > elementHeight ) {
-				this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
+		if ( $.fx.off || !effectMethod ) {
+			// delegate to the original method (e.g., .show()) if possible
+			if ( mode ) {
+				return this[ mode ]( args.duration, args.complete );
+			} else {
+				return this.each( function() {
+					if ( args.complete ) {
+						args.complete.call( this );
+					}
+				});
 			}
 		}
-	},
 
-	blur: function( event, fromFocus ) {
-		if ( !fromFocus ) {
-			clearTimeout( this.timer );
-		}
+		function run( next ) {
+			var elem = $( this ),
+				complete = args.complete,
+				mode = args.mode;
 
-		if ( !this.active ) {
-			return;
-		}
+			function done() {
+				if ( $.isFunction( complete ) ) {
+					complete.call( elem[0] );
+				}
+				if ( $.isFunction( next ) ) {
+					next();
+				}
+			}
 
-		this.active.children( "a" ).removeClass( "ui-state-focus" );
-		this.active = null;
+			// If the element already has the correct final state, delegate to
+			// the core methods so the internal tracking of "olddisplay" works.
+			if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
+				elem[ mode ]();
+				done();
+			} else {
+				effectMethod.call( elem[0], args, done );
+			}
+		}
 
-		this._trigger( "blur", event, { item: this.active } );
+		return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
 	},
 
-	_startOpening: function( submenu ) {
-		clearTimeout( this.timer );
+	show: (function( orig ) {
+		return function( option ) {
+			if ( standardAnimationOption( option ) ) {
+				return orig.apply( this, arguments );
+			} else {
+				var args = _normalizeArguments.apply( this, arguments );
+				args.mode = "show";
+				return this.effect.call( this, args );
+			}
+		};
+	})( $.fn.show ),
 
-		// Don't open if already open fixes a Firefox bug that caused a .5 pixel
-		// shift in the submenu position when mousing over the carat icon
-		if ( submenu.attr( "aria-hidden" ) !== "true" ) {
-			return;
-		}
+	hide: (function( orig ) {
+		return function( option ) {
+			if ( standardAnimationOption( option ) ) {
+				return orig.apply( this, arguments );
+			} else {
+				var args = _normalizeArguments.apply( this, arguments );
+				args.mode = "hide";
+				return this.effect.call( this, args );
+			}
+		};
+	})( $.fn.hide ),
 
-		this.timer = this._delay(function() {
-			this._close();
-			this._open( submenu );
-		}, this.delay );
-	},
+	toggle: (function( orig ) {
+		return function( option ) {
+			if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
+				return orig.apply( this, arguments );
+			} else {
+				var args = _normalizeArguments.apply( this, arguments );
+				args.mode = "toggle";
+				return this.effect.call( this, args );
+			}
+		};
+	})( $.fn.toggle ),
 
-	_open: function( submenu ) {
-		var position = $.extend({
-			of: this.active
-		}, this.options.position );
+	// helper functions
+	cssUnit: function(key) {
+		var style = this.css( key ),
+			val = [];
 
-		clearTimeout( this.timer );
-		this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
-			.hide()
-			.attr( "aria-hidden", "true" );
+		$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
+			if ( style.indexOf( unit ) > 0 ) {
+				val = [ parseFloat( style ), unit ];
+			}
+		});
+		return val;
+	}
+});
 
-		submenu
-			.show()
-			.removeAttr( "aria-hidden" )
-			.attr( "aria-expanded", "true" )
-			.position( position );
-	},
+})();
 
-	collapseAll: function( event, all ) {
-		clearTimeout( this.timer );
-		this.timer = this._delay(function() {
-			// If we were passed an event, look for the submenu that contains the event
-			var currentMenu = all ? this.element :
-				$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
+/******************************************************************************/
+/*********************************** EASING ***********************************/
+/******************************************************************************/
 
-			// If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
-			if ( !currentMenu.length ) {
-				currentMenu = this.element;
-			}
+(function() {
 
-			this._close( currentMenu );
+// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
 
-			this.blur( event );
-			this.activeMenu = currentMenu;
-		}, this.delay );
-	},
+var baseEasings = {};
 
-	// With no arguments, closes the currently active menu - if nothing is active
-	// it closes all menus.  If passed an argument, it will search for menus BELOW
-	_close: function( startMenu ) {
-		if ( !startMenu ) {
-			startMenu = this.active ? this.active.parent() : this.element;
-		}
+$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
+	baseEasings[ name ] = function( p ) {
+		return Math.pow( p, i + 2 );
+	};
+});
 
-		startMenu
-			.find( ".ui-menu" )
-				.hide()
-				.attr( "aria-hidden", "true" )
-				.attr( "aria-expanded", "false" )
-			.end()
-			.find( "a.ui-state-active" )
-				.removeClass( "ui-state-active" );
+$.extend( baseEasings, {
+	Sine: function( p ) {
+		return 1 - Math.cos( p * Math.PI / 2 );
 	},
-
-	collapse: function( event ) {
-		var newItem = this.active &&
-			this.active.parent().closest( ".ui-menu-item", this.element );
-		if ( newItem && newItem.length ) {
-			this._close();
-			this.focus( event, newItem );
-		}
+	Circ: function( p ) {
+		return 1 - Math.sqrt( 1 - p * p );
+	},
+	Elastic: function( p ) {
+		return p === 0 || p === 1 ? p :
+			-Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
+	},
+	Back: function( p ) {
+		return p * p * ( 3 * p - 2 );
 	},
+	Bounce: function( p ) {
+		var pow2,
+			bounce = 4;
 
-	expand: function( event ) {
-		var newItem = this.active &&
-			this.active
-				.children( ".ui-menu " )
-				.children( ".ui-menu-item" )
-				.first();
+		while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
+		return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
+	}
+});
+
+$.each( baseEasings, function( name, easeIn ) {
+	$.easing[ "easeIn" + name ] = easeIn;
+	$.easing[ "easeOut" + name ] = function( p ) {
+		return 1 - easeIn( 1 - p );
+	};
+	$.easing[ "easeInOut" + name ] = function( p ) {
+		return p < 0.5 ?
+			easeIn( p * 2 ) / 2 :
+			1 - easeIn( p * -2 + 2 ) / 2;
+	};
+});
 
-		if ( newItem && newItem.length ) {
-			this._open( newItem.parent() );
+})();
 
-			// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
-			this._delay(function() {
-				this.focus( event, newItem );
-			});
-		}
-	},
+var effect = $.effects;
 
-	next: function( event ) {
-		this._move( "next", "first", event );
-	},
 
-	previous: function( event ) {
-		this._move( "prev", "last", event );
-	},
+/*!
+ * jQuery UI Effects Blind 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/blind-effect/
+ */
 
-	isFirstItem: function() {
-		return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
-	},
 
-	isLastItem: function() {
-		return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
-	},
+var effectBlind = $.effects.effect.blind = function( o, done ) {
+	// Create element
+	var el = $( this ),
+		rvertical = /up|down|vertical/,
+		rpositivemotion = /up|left|vertical|horizontal/,
+		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+		mode = $.effects.setMode( el, o.mode || "hide" ),
+		direction = o.direction || "up",
+		vertical = rvertical.test( direction ),
+		ref = vertical ? "height" : "width",
+		ref2 = vertical ? "top" : "left",
+		motion = rpositivemotion.test( direction ),
+		animation = {},
+		show = mode === "show",
+		wrapper, distance, margin;
 
-	_move: function( direction, filter, event ) {
-		var next;
-		if ( this.active ) {
-			if ( direction === "first" || direction === "last" ) {
-				next = this.active
-					[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
-					.eq( -1 );
-			} else {
-				next = this.active
-					[ direction + "All" ]( ".ui-menu-item" )
-					.eq( 0 );
-			}
-		}
-		if ( !next || !next.length || !this.active ) {
-			next = this.activeMenu.children( ".ui-menu-item" )[ filter ]();
-		}
+	// if already wrapped, the wrapper's properties are my property. #6245
+	if ( el.parent().is( ".ui-effects-wrapper" ) ) {
+		$.effects.save( el.parent(), props );
+	} else {
+		$.effects.save( el, props );
+	}
+	el.show();
+	wrapper = $.effects.createWrapper( el ).css({
+		overflow: "hidden"
+	});
 
-		this.focus( event, next );
-	},
+	distance = wrapper[ ref ]();
+	margin = parseFloat( wrapper.css( ref2 ) ) || 0;
 
-	nextPage: function( event ) {
-		var item, base, height;
+	animation[ ref ] = show ? distance : 0;
+	if ( !motion ) {
+		el
+			.css( vertical ? "bottom" : "right", 0 )
+			.css( vertical ? "top" : "left", "auto" )
+			.css({ position: "absolute" });
 
-		if ( !this.active ) {
-			this.next( event );
-			return;
-		}
-		if ( this.isLastItem() ) {
-			return;
-		}
-		if ( this._hasScroll() ) {
-			base = this.active.offset().top;
-			height = this.element.height();
-			this.active.nextAll( ".ui-menu-item" ).each(function() {
-				item = $( this );
-				return item.offset().top - base - height < 0;
-			});
+		animation[ ref2 ] = show ? margin : distance + margin;
+	}
 
-			this.focus( event, item );
-		} else {
-			this.focus( event, this.activeMenu.children( ".ui-menu-item" )
-				[ !this.active ? "first" : "last" ]() );
+	// start at 0 if we are showing
+	if ( show ) {
+		wrapper.css( ref, 0 );
+		if ( !motion ) {
+			wrapper.css( ref2, margin + distance );
 		}
-	},
+	}
 
-	previousPage: function( event ) {
-		var item, base, height;
-		if ( !this.active ) {
-			this.next( event );
-			return;
-		}
-		if ( this.isFirstItem() ) {
-			return;
+	// Animate
+	wrapper.animate( animation, {
+		duration: o.duration,
+		easing: o.easing,
+		queue: false,
+		complete: function() {
+			if ( mode === "hide" ) {
+				el.hide();
+			}
+			$.effects.restore( el, props );
+			$.effects.removeWrapper( el );
+			done();
 		}
-		if ( this._hasScroll() ) {
-			base = this.active.offset().top;
-			height = this.element.height();
-			this.active.prevAll( ".ui-menu-item" ).each(function() {
-				item = $( this );
-				return item.offset().top - base + height > 0;
-			});
+	});
+};
 
-			this.focus( event, item );
-		} else {
-			this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() );
-		}
-	},
 
-	_hasScroll: function() {
-		return this.element.outerHeight() < this.element.prop( "scrollHeight" );
-	},
+/*!
+ * jQuery UI Effects Bounce 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/bounce-effect/
+ */
 
-	select: function( event ) {
-		// TODO: It should never be possible to not have an active item at this
-		// point, but the tests don't trigger mouseenter before click.
-		this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
-		var ui = { item: this.active };
-		if ( !this.active.has( ".ui-menu" ).length ) {
-			this.collapseAll( event, true );
-		}
-		this._trigger( "select", event, ui );
-	}
-});
 
-}( jQuery ));
-(function( $, undefined ) {
+var effectBounce = $.effects.effect.bounce = function( o, done ) {
+	var el = $( this ),
+		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
 
-$.widget( "ui.progressbar", {
-	version: "1.10.4",
-	options: {
-		max: 100,
-		value: 0,
+		// defaults:
+		mode = $.effects.setMode( el, o.mode || "effect" ),
+		hide = mode === "hide",
+		show = mode === "show",
+		direction = o.direction || "up",
+		distance = o.distance,
+		times = o.times || 5,
 
-		change: null,
-		complete: null
-	},
+		// number of internal animations
+		anims = times * 2 + ( show || hide ? 1 : 0 ),
+		speed = o.duration / anims,
+		easing = o.easing,
 
-	min: 0,
+		// utility:
+		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
+		motion = ( direction === "up" || direction === "left" ),
+		i,
+		upAnim,
+		downAnim,
 
-	_create: function() {
-		// Constrain initial value
-		this.oldValue = this.options.value = this._constrainedValue();
+		// we will need to re-assemble the queue to stack our animations in place
+		queue = el.queue(),
+		queuelen = queue.length;
 
-		this.element
-			.addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
-			.attr({
-				// Only set static values, aria-valuenow and aria-valuemax are
-				// set inside _refreshValue()
-				role: "progressbar",
-				"aria-valuemin": this.min
-			});
+	// Avoid touching opacity to prevent clearType and PNG issues in IE
+	if ( show || hide ) {
+		props.push( "opacity" );
+	}
 
-		this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
-			.appendTo( this.element );
+	$.effects.save( el, props );
+	el.show();
+	$.effects.createWrapper( el ); // Create Wrapper
 
-		this._refreshValue();
-	},
+	// default distance for the BIGGEST bounce is the outer Distance / 3
+	if ( !distance ) {
+		distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
+	}
 
-	_destroy: function() {
-		this.element
-			.removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
-			.removeAttr( "role" )
-			.removeAttr( "aria-valuemin" )
-			.removeAttr( "aria-valuemax" )
-			.removeAttr( "aria-valuenow" );
+	if ( show ) {
+		downAnim = { opacity: 1 };
+		downAnim[ ref ] = 0;
 
-		this.valueDiv.remove();
-	},
+		// if we are showing, force opacity 0 and set the initial position
+		// then do the "first" animation
+		el.css( "opacity", 0 )
+			.css( ref, motion ? -distance * 2 : distance * 2 )
+			.animate( downAnim, speed, easing );
+	}
 
-	value: function( newValue ) {
-		if ( newValue === undefined ) {
-			return this.options.value;
-		}
+	// start at the smallest distance if we are hiding
+	if ( hide ) {
+		distance = distance / Math.pow( 2, times - 1 );
+	}
 
-		this.options.value = this._constrainedValue( newValue );
-		this._refreshValue();
-	},
+	downAnim = {};
+	downAnim[ ref ] = 0;
+	// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
+	for ( i = 0; i < times; i++ ) {
+		upAnim = {};
+		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
 
-	_constrainedValue: function( newValue ) {
-		if ( newValue === undefined ) {
-			newValue = this.options.value;
-		}
+		el.animate( upAnim, speed, easing )
+			.animate( downAnim, speed, easing );
+
+		distance = hide ? distance * 2 : distance / 2;
+	}
+
+	// Last Bounce when Hiding
+	if ( hide ) {
+		upAnim = { opacity: 0 };
+		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
 
-		this.indeterminate = newValue === false;
+		el.animate( upAnim, speed, easing );
+	}
 
-		// sanitize value
-		if ( typeof newValue !== "number" ) {
-			newValue = 0;
+	el.queue(function() {
+		if ( hide ) {
+			el.hide();
 		}
+		$.effects.restore( el, props );
+		$.effects.removeWrapper( el );
+		done();
+	});
 
-		return this.indeterminate ? false :
-			Math.min( this.options.max, Math.max( this.min, newValue ) );
-	},
+	// inject all the animations we just queued to be first in line (after "inprogress")
+	if ( queuelen > 1) {
+		queue.splice.apply( queue,
+			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
+	}
+	el.dequeue();
 
-	_setOptions: function( options ) {
-		// Ensure "value" option is set after other values (like max)
-		var value = options.value;
-		delete options.value;
+};
 
-		this._super( options );
 
-		this.options.value = this._constrainedValue( value );
-		this._refreshValue();
-	},
+/*!
+ * jQuery UI Effects Clip 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/clip-effect/
+ */
 
-	_setOption: function( key, value ) {
-		if ( key === "max" ) {
-			// Don't allow a max less than min
-			value = Math.max( this.min, value );
-		}
 
-		this._super( key, value );
-	},
+var effectClip = $.effects.effect.clip = function( o, done ) {
+	// Create element
+	var el = $( this ),
+		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+		mode = $.effects.setMode( el, o.mode || "hide" ),
+		show = mode === "show",
+		direction = o.direction || "vertical",
+		vert = direction === "vertical",
+		size = vert ? "height" : "width",
+		position = vert ? "top" : "left",
+		animation = {},
+		wrapper, animate, distance;
 
-	_percentage: function() {
-		return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
-	},
+	// Save & Show
+	$.effects.save( el, props );
+	el.show();
 
-	_refreshValue: function() {
-		var value = this.options.value,
-			percentage = this._percentage();
+	// Create Wrapper
+	wrapper = $.effects.createWrapper( el ).css({
+		overflow: "hidden"
+	});
+	animate = ( el[0].tagName === "IMG" ) ? wrapper : el;
+	distance = animate[ size ]();
 
-		this.valueDiv
-			.toggle( this.indeterminate || value > this.min )
-			.toggleClass( "ui-corner-right", value === this.options.max )
-			.width( percentage.toFixed(0) + "%" );
+	// Shift
+	if ( show ) {
+		animate.css( size, 0 );
+		animate.css( position, distance / 2 );
+	}
 
-		this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
+	// Create Animation Object:
+	animation[ size ] = show ? distance : 0;
+	animation[ position ] = show ? 0 : distance / 2;
 
-		if ( this.indeterminate ) {
-			this.element.removeAttr( "aria-valuenow" );
-			if ( !this.overlayDiv ) {
-				this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
-			}
-		} else {
-			this.element.attr({
-				"aria-valuemax": this.options.max,
-				"aria-valuenow": value
-			});
-			if ( this.overlayDiv ) {
-				this.overlayDiv.remove();
-				this.overlayDiv = null;
+	// Animate
+	animate.animate( animation, {
+		queue: false,
+		duration: o.duration,
+		easing: o.easing,
+		complete: function() {
+			if ( !show ) {
+				el.hide();
 			}
+			$.effects.restore( el, props );
+			$.effects.removeWrapper( el );
+			done();
 		}
+	});
 
-		if ( this.oldValue !== value ) {
-			this.oldValue = value;
-			this._trigger( "change" );
-		}
-		if ( value === this.options.max ) {
-			this._trigger( "complete" );
-		}
-	}
-});
-
-})( jQuery );
-(function( $, undefined ) {
-
-function num(v) {
-	return parseInt(v, 10) || 0;
-}
-
-function isNumber(value) {
-	return !isNaN(parseInt(value, 10));
-}
+};
 
-$.widget("ui.resizable", $.ui.mouse, {
-	version: "1.10.4",
-	widgetEventPrefix: "resize",
-	options: {
-		alsoResize: false,
-		animate: false,
-		animateDuration: "slow",
-		animateEasing: "swing",
-		aspectRatio: false,
-		autoHide: false,
-		containment: false,
-		ghost: false,
-		grid: false,
-		handles: "e,s,se",
-		helper: false,
-		maxHeight: null,
-		maxWidth: null,
-		minHeight: 10,
-		minWidth: 10,
-		// See #7960
-		zIndex: 90,
 
-		// callbacks
-		resize: null,
-		start: null,
-		stop: null
-	},
-	_create: function() {
+/*!
+ * jQuery UI Effects Drop 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/drop-effect/
+ */
 
-		var n, i, handle, axis, hname,
-			that = this,
-			o = this.options;
-		this.element.addClass("ui-resizable");
 
-		$.extend(this, {
-			_aspectRatio: !!(o.aspectRatio),
-			aspectRatio: o.aspectRatio,
-			originalElement: this.element,
-			_proportionallyResizeElements: [],
-			_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
-		});
+var effectDrop = $.effects.effect.drop = function( o, done ) {
 
-		//Wrap the element if it cannot hold child nodes
-		if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
+	var el = $( this ),
+		props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
+		mode = $.effects.setMode( el, o.mode || "hide" ),
+		show = mode === "show",
+		direction = o.direction || "left",
+		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
+		motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
+		animation = {
+			opacity: show ? 1 : 0
+		},
+		distance;
 
-			//Create a wrapper element and set the wrapper to the new current internal element
-			this.element.wrap(
-				$("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
-					position: this.element.css("position"),
-					width: this.element.outerWidth(),
-					height: this.element.outerHeight(),
-					top: this.element.css("top"),
-					left: this.element.css("left")
-				})
-			);
+	// Adjust
+	$.effects.save( el, props );
+	el.show();
+	$.effects.createWrapper( el );
 
-			//Overwrite the original this.element
-			this.element = this.element.parent().data(
-				"ui-resizable", this.element.data("ui-resizable")
-			);
+	distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]( true ) / 2;
 
-			this.elementIsWrapper = true;
+	if ( show ) {
+		el
+			.css( "opacity", 0 )
+			.css( ref, motion === "pos" ? -distance : distance );
+	}
 
-			//Move margins to the wrapper
-			this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
-			this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
+	// Animation
+	animation[ ref ] = ( show ?
+		( motion === "pos" ? "+=" : "-=" ) :
+		( motion === "pos" ? "-=" : "+=" ) ) +
+		distance;
 
-			//Prevent Safari textarea resize
-			this.originalResizeStyle = this.originalElement.css("resize");
-			this.originalElement.css("resize", "none");
+	// Animate
+	el.animate( animation, {
+		queue: false,
+		duration: o.duration,
+		easing: o.easing,
+		complete: function() {
+			if ( mode === "hide" ) {
+				el.hide();
+			}
+			$.effects.restore( el, props );
+			$.effects.removeWrapper( el );
+			done();
+		}
+	});
+};
 
-			//Push the actual element to our proportionallyResize internal array
-			this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" }));
 
-			// avoid IE jump (hard set the margin)
-			this.originalElement.css({ margin: this.originalElement.css("margin") });
+/*!
+ * jQuery UI Effects Explode 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/explode-effect/
+ */
 
-			// fix handlers offset
-			this._proportionallyResize();
 
-		}
+var effectExplode = $.effects.effect.explode = function( o, done ) {
 
-		this.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" });
-		if(this.handles.constructor === String) {
+	var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
+		cells = rows,
+		el = $( this ),
+		mode = $.effects.setMode( el, o.mode || "hide" ),
+		show = mode === "show",
 
-			if ( this.handles === "all") {
-				this.handles = "n,e,s,w,se,sw,ne,nw";
-			}
+		// show and then visibility:hidden the element before calculating offset
+		offset = el.show().css( "visibility", "hidden" ).offset(),
 
-			n = this.handles.split(",");
-			this.handles = {};
+		// width and height of a piece
+		width = Math.ceil( el.outerWidth() / cells ),
+		height = Math.ceil( el.outerHeight() / rows ),
+		pieces = [],
 
-			for(i = 0; i < n.length; i++) {
+		// loop
+		i, j, left, top, mx, my;
 
-				handle = $.trim(n[i]);
-				hname = "ui-resizable-"+handle;
-				axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
+	// children animate complete:
+	function childComplete() {
+		pieces.push( this );
+		if ( pieces.length === rows * cells ) {
+			animComplete();
+		}
+	}
 
-				// Apply zIndex to all handles - see #7960
-				axis.css({ zIndex: o.zIndex });
+	// clone the element for each row and cell.
+	for ( i = 0; i < rows ; i++ ) { // ===>
+		top = offset.top + i * height;
+		my = i - ( rows - 1 ) / 2 ;
 
-				//TODO : What's going on here?
-				if ("se" === handle) {
-					axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
-				}
+		for ( j = 0; j < cells ; j++ ) { // |||
+			left = offset.left + j * width;
+			mx = j - ( cells - 1 ) / 2 ;
 
-				//Insert into internal handles object and append to element
-				this.handles[handle] = ".ui-resizable-"+handle;
-				this.element.append(axis);
-			}
+			// Create a clone of the now hidden main element that will be absolute positioned
+			// within a wrapper div off the -left and -top equal to size of our pieces
+			el
+				.clone()
+				.appendTo( "body" )
+				.wrap( "<div></div>" )
+				.css({
+					position: "absolute",
+					visibility: "visible",
+					left: -j * width,
+					top: -i * height
+				})
 
+			// select the wrapper - make it overflow: hidden and absolute positioned based on
+			// where the original was located +left and +top equal to the size of pieces
+				.parent()
+				.addClass( "ui-effects-explode" )
+				.css({
+					position: "absolute",
+					overflow: "hidden",
+					width: width,
+					height: height,
+					left: left + ( show ? mx * width : 0 ),
+					top: top + ( show ? my * height : 0 ),
+					opacity: show ? 0 : 1
+				}).animate({
+					left: left + ( show ? 0 : mx * width ),
+					top: top + ( show ? 0 : my * height ),
+					opacity: show ? 1 : 0
+				}, o.duration || 500, o.easing, childComplete );
 		}
+	}
 
-		this._renderAxis = function(target) {
+	function animComplete() {
+		el.css({
+			visibility: "visible"
+		});
+		$( pieces ).remove();
+		if ( !show ) {
+			el.hide();
+		}
+		done();
+	}
+};
 
-			var i, axis, padPos, padWrapper;
 
-			target = target || this.element;
+/*!
+ * jQuery UI Effects Fade 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/fade-effect/
+ */
 
-			for(i in this.handles) {
 
-				if(this.handles[i].constructor === String) {
-					this.handles[i] = $(this.handles[i], this.element).show();
-				}
+var effectFade = $.effects.effect.fade = function( o, done ) {
+	var el = $( this ),
+		mode = $.effects.setMode( el, o.mode || "toggle" );
 
-				//Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
-				if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
+	el.animate({
+		opacity: mode
+	}, {
+		queue: false,
+		duration: o.duration,
+		easing: o.easing,
+		complete: done
+	});
+};
 
-					axis = $(this.handles[i], this.element);
 
-					//Checking the correct pad and border
-					padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
+/*!
+ * jQuery UI Effects Fold 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/fold-effect/
+ */
 
-					//The padding type i have to apply...
-					padPos = [ "padding",
-						/ne|nw|n/.test(i) ? "Top" :
-						/se|sw|s/.test(i) ? "Bottom" :
-						/^e$/.test(i) ? "Right" : "Left" ].join("");
 
-					target.css(padPos, padWrapper);
+var effectFold = $.effects.effect.fold = function( o, done ) {
 
-					this._proportionallyResize();
+	// Create element
+	var el = $( this ),
+		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+		mode = $.effects.setMode( el, o.mode || "hide" ),
+		show = mode === "show",
+		hide = mode === "hide",
+		size = o.size || 15,
+		percent = /([0-9]+)%/.exec( size ),
+		horizFirst = !!o.horizFirst,
+		widthFirst = show !== horizFirst,
+		ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ],
+		duration = o.duration / 2,
+		wrapper, distance,
+		animation1 = {},
+		animation2 = {};
 
-				}
+	$.effects.save( el, props );
+	el.show();
 
-				//TODO: What's that good for? There's not anything to be executed left
-				if(!$(this.handles[i]).length) {
-					continue;
-				}
-			}
-		};
+	// Create Wrapper
+	wrapper = $.effects.createWrapper( el ).css({
+		overflow: "hidden"
+	});
+	distance = widthFirst ?
+		[ wrapper.width(), wrapper.height() ] :
+		[ wrapper.height(), wrapper.width() ];
 
-		//TODO: make renderAxis a prototype function
-		this._renderAxis(this.element);
+	if ( percent ) {
+		size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
+	}
+	if ( show ) {
+		wrapper.css( horizFirst ? {
+			height: 0,
+			width: size
+		} : {
+			height: size,
+			width: 0
+		});
+	}
 
-		this._handles = $(".ui-resizable-handle", this.element)
-			.disableSelection();
+	// Animation
+	animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;
+	animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;
 
-		//Matching axis name
-		this._handles.mouseover(function() {
-			if (!that.resizing) {
-				if (this.className) {
-					axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
-				}
-				//Axis, default = se
-				that.axis = axis && axis[1] ? axis[1] : "se";
+	// Animate
+	wrapper
+		.animate( animation1, duration, o.easing )
+		.animate( animation2, duration, o.easing, function() {
+			if ( hide ) {
+				el.hide();
 			}
+			$.effects.restore( el, props );
+			$.effects.removeWrapper( el );
+			done();
 		});
 
-		//If we want to auto hide the elements
-		if (o.autoHide) {
-			this._handles.hide();
-			$(this.element)
-				.addClass("ui-resizable-autohide")
-				.mouseenter(function() {
-					if (o.disabled) {
-						return;
-					}
-					$(this).removeClass("ui-resizable-autohide");
-					that._handles.show();
-				})
-				.mouseleave(function(){
-					if (o.disabled) {
-						return;
-					}
-					if (!that.resizing) {
-						$(this).addClass("ui-resizable-autohide");
-						that._handles.hide();
-					}
-				});
-		}
-
-		//Initialize the mouse interaction
-		this._mouseInit();
-
-	},
-
-	_destroy: function() {
+};
 
-		this._mouseDestroy();
 
-		var wrapper,
-			_destroy = function(exp) {
-				$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
-					.removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove();
-			};
+/*!
+ * jQuery UI Effects Highlight 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/highlight-effect/
+ */
 
-		//TODO: Unwrap at same DOM position
-		if (this.elementIsWrapper) {
-			_destroy(this.element);
-			wrapper = this.element;
-			this.originalElement.css({
-				position: wrapper.css("position"),
-				width: wrapper.outerWidth(),
-				height: wrapper.outerHeight(),
-				top: wrapper.css("top"),
-				left: wrapper.css("left")
-			}).insertAfter( wrapper );
-			wrapper.remove();
-		}
 
-		this.originalElement.css("resize", this.originalResizeStyle);
-		_destroy(this.originalElement);
+var effectHighlight = $.effects.effect.highlight = function( o, done ) {
+	var elem = $( this ),
+		props = [ "backgroundImage", "backgroundColor", "opacity" ],
+		mode = $.effects.setMode( elem, o.mode || "show" ),
+		animation = {
+			backgroundColor: elem.css( "backgroundColor" )
+		};
 
-		return this;
-	},
+	if (mode === "hide") {
+		animation.opacity = 0;
+	}
 
-	_mouseCapture: function(event) {
-		var i, handle,
-			capture = false;
+	$.effects.save( elem, props );
 
-		for (i in this.handles) {
-			handle = $(this.handles[i])[0];
-			if (handle === event.target || $.contains(handle, event.target)) {
-				capture = true;
+	elem
+		.show()
+		.css({
+			backgroundImage: "none",
+			backgroundColor: o.color || "#ffff99"
+		})
+		.animate( animation, {
+			queue: false,
+			duration: o.duration,
+			easing: o.easing,
+			complete: function() {
+				if ( mode === "hide" ) {
+					elem.hide();
+				}
+				$.effects.restore( elem, props );
+				done();
 			}
-		}
-
-		return !this.options.disabled && capture;
-	},
-
-	_mouseStart: function(event) {
-
-		var curleft, curtop, cursor,
-			o = this.options,
-			iniPos = this.element.position(),
-			el = this.element;
-
-		this.resizing = true;
+		});
+};
 
-		// bugfix for http://dev.jquery.com/ticket/1749
-		if ( (/absolute/).test( el.css("position") ) ) {
-			el.css({ position: "absolute", top: el.css("top"), left: el.css("left") });
-		} else if (el.is(".ui-draggable")) {
-			el.css({ position: "absolute", top: iniPos.top, left: iniPos.left });
-		}
 
-		this._renderProxy();
+/*!
+ * jQuery UI Effects Size 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/size-effect/
+ */
 
-		curleft = num(this.helper.css("left"));
-		curtop = num(this.helper.css("top"));
 
-		if (o.containment) {
-			curleft += $(o.containment).scrollLeft() || 0;
-			curtop += $(o.containment).scrollTop() || 0;
-		}
+var effectSize = $.effects.effect.size = function( o, done ) {
 
-		//Store needed variables
-		this.offset = this.helper.offset();
-		this.position = { left: curleft, top: curtop };
-		this.size = this._helper ? { width: this.helper.width(), height: this.helper.height() } : { width: el.width(), height: el.height() };
-		this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
-		this.originalPosition = { left: curleft, top: curtop };
-		this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
-		this.originalMousePosition = { left: event.pageX, top: event.pageY };
+	// Create element
+	var original, baseline, factor,
+		el = $( this ),
+		props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
 
-		//Aspect Ratio
-		this.aspectRatio = (typeof o.aspectRatio === "number") ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
+		// Always restore
+		props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
 
-		cursor = $(".ui-resizable-" + this.axis).css("cursor");
-		$("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
+		// Copy for children
+		props2 = [ "width", "height", "overflow" ],
+		cProps = [ "fontSize" ],
+		vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
+		hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
 
-		el.addClass("ui-resizable-resizing");
-		this._propagate("start", event);
-		return true;
-	},
+		// Set options
+		mode = $.effects.setMode( el, o.mode || "effect" ),
+		restore = o.restore || mode !== "effect",
+		scale = o.scale || "both",
+		origin = o.origin || [ "middle", "center" ],
+		position = el.css( "position" ),
+		props = restore ? props0 : props1,
+		zero = {
+			height: 0,
+			width: 0,
+			outerHeight: 0,
+			outerWidth: 0
+		};
 
-	_mouseDrag: function(event) {
+	if ( mode === "show" ) {
+		el.show();
+	}
+	original = {
+		height: el.height(),
+		width: el.width(),
+		outerHeight: el.outerHeight(),
+		outerWidth: el.outerWidth()
+	};
 
-		//Increase performance, avoid regex
-		var data,
-			el = this.helper, props = {},
-			smp = this.originalMousePosition,
-			a = this.axis,
-			prevTop = this.position.top,
-			prevLeft = this.position.left,
-			prevWidth = this.size.width,
-			prevHeight = this.size.height,
-			dx = (event.pageX-smp.left)||0,
-			dy = (event.pageY-smp.top)||0,
-			trigger = this._change[a];
+	if ( o.mode === "toggle" && mode === "show" ) {
+		el.from = o.to || zero;
+		el.to = o.from || original;
+	} else {
+		el.from = o.from || ( mode === "show" ? zero : original );
+		el.to = o.to || ( mode === "hide" ? zero : original );
+	}
 
-		if (!trigger) {
-			return false;
+	// Set scaling factor
+	factor = {
+		from: {
+			y: el.from.height / original.height,
+			x: el.from.width / original.width
+		},
+		to: {
+			y: el.to.height / original.height,
+			x: el.to.width / original.width
 		}
+	};
 
-		// Calculate the attrs that will be change
-		data = trigger.apply(this, [event, dx, dy]);
+	// Scale the css box
+	if ( scale === "box" || scale === "both" ) {
 
-		// Put this in the mouseDrag handler since the user can start pressing shift while resizing
-		this._updateVirtualBoundaries(event.shiftKey);
-		if (this._aspectRatio || event.shiftKey) {
-			data = this._updateRatio(data, event);
+		// Vertical props scaling
+		if ( factor.from.y !== factor.to.y ) {
+			props = props.concat( vProps );
+			el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
+			el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
 		}
 
-		data = this._respectSize(data, event);
-
-		this._updateCache(data);
-
-		// plugins callbacks need to be called first
-		this._propagate("resize", event);
-
-		if (this.position.top !== prevTop) {
-			props.top = this.position.top + "px";
-		}
-		if (this.position.left !== prevLeft) {
-			props.left = this.position.left + "px";
-		}
-		if (this.size.width !== prevWidth) {
-			props.width = this.size.width + "px";
-		}
-		if (this.size.height !== prevHeight) {
-			props.height = this.size.height + "px";
+		// Horizontal props scaling
+		if ( factor.from.x !== factor.to.x ) {
+			props = props.concat( hProps );
+			el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
+			el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
 		}
-		el.css(props);
+	}
 
-		if (!this._helper && this._proportionallyResizeElements.length) {
-			this._proportionallyResize();
-		}
+	// Scale the content
+	if ( scale === "content" || scale === "both" ) {
 
-		// Call the user callback if the element was resized
-		if ( ! $.isEmptyObject(props) ) {
-			this._trigger("resize", event, this.ui());
+		// Vertical props scaling
+		if ( factor.from.y !== factor.to.y ) {
+			props = props.concat( cProps ).concat( props2 );
+			el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
+			el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
 		}
+	}
 
-		return false;
-	},
-
-	_mouseStop: function(event) {
-
-		this.resizing = false;
-		var pr, ista, soffseth, soffsetw, s, left, top,
-			o = this.options, that = this;
+	$.effects.save( el, props );
+	el.show();
+	$.effects.createWrapper( el );
+	el.css( "overflow", "hidden" ).css( el.from );
 
-		if(this._helper) {
+	// Adjust
+	if (origin) { // Calculate baseline shifts
+		baseline = $.effects.getBaseline( origin, original );
+		el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
+		el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
+		el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
+		el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
+	}
+	el.css( el.from ); // set top & left
 
-			pr = this._proportionallyResizeElements;
-			ista = pr.length && (/textarea/i).test(pr[0].nodeName);
-			soffseth = ista && $.ui.hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height;
-			soffsetw = ista ? 0 : that.sizeDiff.width;
+	// Animate
+	if ( scale === "content" || scale === "both" ) { // Scale the children
 
-			s = { width: (that.helper.width()  - soffsetw), height: (that.helper.height() - soffseth) };
-			left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null;
-			top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
+		// Add margins/font-size
+		vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);
+		hProps = hProps.concat([ "marginLeft", "marginRight" ]);
+		props2 = props0.concat(vProps).concat(hProps);
 
-			if (!o.animate) {
-				this.element.css($.extend(s, { top: top, left: left }));
+		el.find( "*[width]" ).each( function() {
+			var child = $( this ),
+				c_original = {
+					height: child.height(),
+					width: child.width(),
+					outerHeight: child.outerHeight(),
+					outerWidth: child.outerWidth()
+				};
+			if (restore) {
+				$.effects.save(child, props2);
 			}
 
-			that.helper.height(that.size.height);
-			that.helper.width(that.size.width);
+			child.from = {
+				height: c_original.height * factor.from.y,
+				width: c_original.width * factor.from.x,
+				outerHeight: c_original.outerHeight * factor.from.y,
+				outerWidth: c_original.outerWidth * factor.from.x
+			};
+			child.to = {
+				height: c_original.height * factor.to.y,
+				width: c_original.width * factor.to.x,
+				outerHeight: c_original.height * factor.to.y,
+				outerWidth: c_original.width * factor.to.x
+			};
 
-			if (this._helper && !o.animate) {
-				this._proportionallyResize();
+			// Vertical props scaling
+			if ( factor.from.y !== factor.to.y ) {
+				child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
+				child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
 			}
-		}
-
-		$("body").css("cursor", "auto");
-
-		this.element.removeClass("ui-resizable-resizing");
-
-		this._propagate("stop", event);
-
-		if (this._helper) {
-			this.helper.remove();
-		}
-
-		return false;
-
-	},
 
-	_updateVirtualBoundaries: function(forceAspectRatio) {
-		var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
-			o = this.options;
+			// Horizontal props scaling
+			if ( factor.from.x !== factor.to.x ) {
+				child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
+				child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
+			}
 
-		b = {
-			minWidth: isNumber(o.minWidth) ? o.minWidth : 0,
-			maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,
-			minHeight: isNumber(o.minHeight) ? o.minHeight : 0,
-			maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity
-		};
+			// Animate children
+			child.css( child.from );
+			child.animate( child.to, o.duration, o.easing, function() {
 
-		if(this._aspectRatio || forceAspectRatio) {
-			// We want to create an enclosing box whose aspect ration is the requested one
-			// First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
-			pMinWidth = b.minHeight * this.aspectRatio;
-			pMinHeight = b.minWidth / this.aspectRatio;
-			pMaxWidth = b.maxHeight * this.aspectRatio;
-			pMaxHeight = b.maxWidth / this.aspectRatio;
+				// Restore children
+				if ( restore ) {
+					$.effects.restore( child, props2 );
+				}
+			});
+		});
+	}
 
-			if(pMinWidth > b.minWidth) {
-				b.minWidth = pMinWidth;
-			}
-			if(pMinHeight > b.minHeight) {
-				b.minHeight = pMinHeight;
-			}
-			if(pMaxWidth < b.maxWidth) {
-				b.maxWidth = pMaxWidth;
+	// Animate
+	el.animate( el.to, {
+		queue: false,
+		duration: o.duration,
+		easing: o.easing,
+		complete: function() {
+			if ( el.to.opacity === 0 ) {
+				el.css( "opacity", el.from.opacity );
 			}
-			if(pMaxHeight < b.maxHeight) {
-				b.maxHeight = pMaxHeight;
+			if ( mode === "hide" ) {
+				el.hide();
 			}
-		}
-		this._vBoundaries = b;
-	},
+			$.effects.restore( el, props );
+			if ( !restore ) {
 
-	_updateCache: function(data) {
-		this.offset = this.helper.offset();
-		if (isNumber(data.left)) {
-			this.position.left = data.left;
-		}
-		if (isNumber(data.top)) {
-			this.position.top = data.top;
-		}
-		if (isNumber(data.height)) {
-			this.size.height = data.height;
-		}
-		if (isNumber(data.width)) {
-			this.size.width = data.width;
-		}
-	},
+				// we need to calculate our new positioning based on the scaling
+				if ( position === "static" ) {
+					el.css({
+						position: "relative",
+						top: el.to.top,
+						left: el.to.left
+					});
+				} else {
+					$.each([ "top", "left" ], function( idx, pos ) {
+						el.css( pos, function( _, str ) {
+							var val = parseInt( str, 10 ),
+								toRef = idx ? el.to.left : el.to.top;
 
-	_updateRatio: function( data ) {
+							// if original was "auto", recalculate the new value from wrapper
+							if ( str === "auto" ) {
+								return toRef + "px";
+							}
 
-		var cpos = this.position,
-			csize = this.size,
-			a = this.axis;
+							return val + toRef + "px";
+						});
+					});
+				}
+			}
 
-		if (isNumber(data.height)) {
-			data.width = (data.height * this.aspectRatio);
-		} else if (isNumber(data.width)) {
-			data.height = (data.width / this.aspectRatio);
+			$.effects.removeWrapper( el );
+			done();
 		}
+	});
 
-		if (a === "sw") {
-			data.left = cpos.left + (csize.width - data.width);
-			data.top = null;
-		}
-		if (a === "nw") {
-			data.top = cpos.top + (csize.height - data.height);
-			data.left = cpos.left + (csize.width - data.width);
-		}
+};
 
-		return data;
-	},
 
-	_respectSize: function( data ) {
+/*!
+ * jQuery UI Effects Scale 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/scale-effect/
+ */
 
-		var o = this._vBoundaries,
-			a = this.axis,
-			ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
-			isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
-			dw = this.originalPosition.left + this.originalSize.width,
-			dh = this.position.top + this.size.height,
-			cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
-		if (isminw) {
-			data.width = o.minWidth;
-		}
-		if (isminh) {
-			data.height = o.minHeight;
-		}
-		if (ismaxw) {
-			data.width = o.maxWidth;
-		}
-		if (ismaxh) {
-			data.height = o.maxHeight;
-		}
 
-		if (isminw && cw) {
-			data.left = dw - o.minWidth;
-		}
-		if (ismaxw && cw) {
-			data.left = dw - o.maxWidth;
-		}
-		if (isminh && ch) {
-			data.top = dh - o.minHeight;
-		}
-		if (ismaxh && ch) {
-			data.top = dh - o.maxHeight;
-		}
+var effectScale = $.effects.effect.scale = function( o, done ) {
 
-		// fixing jump error on top/left - bug #2330
-		if (!data.width && !data.height && !data.left && data.top) {
-			data.top = null;
-		} else if (!data.width && !data.height && !data.top && data.left) {
-			data.left = null;
-		}
+	// Create element
+	var el = $( this ),
+		options = $.extend( true, {}, o ),
+		mode = $.effects.setMode( el, o.mode || "effect" ),
+		percent = parseInt( o.percent, 10 ) ||
+			( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
+		direction = o.direction || "both",
+		origin = o.origin,
+		original = {
+			height: el.height(),
+			width: el.width(),
+			outerHeight: el.outerHeight(),
+			outerWidth: el.outerWidth()
+		},
+		factor = {
+			y: direction !== "horizontal" ? (percent / 100) : 1,
+			x: direction !== "vertical" ? (percent / 100) : 1
+		};
 
-		return data;
-	},
+	// We are going to pass this effect to the size effect:
+	options.effect = "size";
+	options.queue = false;
+	options.complete = done;
 
-	_proportionallyResize: function() {
+	// Set default origin and restore for show/hide
+	if ( mode !== "effect" ) {
+		options.origin = origin || [ "middle", "center" ];
+		options.restore = true;
+	}
 
-		if (!this._proportionallyResizeElements.length) {
-			return;
+	options.from = o.from || ( mode === "show" ? {
+		height: 0,
+		width: 0,
+		outerHeight: 0,
+		outerWidth: 0
+	} : original );
+	options.to = {
+		height: original.height * factor.y,
+		width: original.width * factor.x,
+		outerHeight: original.outerHeight * factor.y,
+		outerWidth: original.outerWidth * factor.x
+	};
+
+	// Fade option to support puff
+	if ( options.fade ) {
+		if ( mode === "show" ) {
+			options.from.opacity = 0;
+			options.to.opacity = 1;
+		}
+		if ( mode === "hide" ) {
+			options.from.opacity = 1;
+			options.to.opacity = 0;
 		}
+	}
 
-		var i, j, borders, paddings, prel,
-			element = this.helper || this.element;
+	// Animate
+	el.effect( options );
 
-		for ( i=0; i < this._proportionallyResizeElements.length; i++) {
+};
 
-			prel = this._proportionallyResizeElements[i];
 
-			if (!this.borderDif) {
-				this.borderDif = [];
-				borders = [prel.css("borderTopWidth"), prel.css("borderRightWidth"), prel.css("borderBottomWidth"), prel.css("borderLeftWidth")];
-				paddings = [prel.css("paddingTop"), prel.css("paddingRight"), prel.css("paddingBottom"), prel.css("paddingLeft")];
+/*!
+ * jQuery UI Effects Puff 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/puff-effect/
+ */
 
-				for ( j = 0; j < borders.length; j++ ) {
-					this.borderDif[ j ] = ( parseInt( borders[ j ], 10 ) || 0 ) + ( parseInt( paddings[ j ], 10 ) || 0 );
-				}
-			}
 
-			prel.css({
-				height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
-				width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
-			});
+var effectPuff = $.effects.effect.puff = function( o, done ) {
+	var elem = $( this ),
+		mode = $.effects.setMode( elem, o.mode || "hide" ),
+		hide = mode === "hide",
+		percent = parseInt( o.percent, 10 ) || 150,
+		factor = percent / 100,
+		original = {
+			height: elem.height(),
+			width: elem.width(),
+			outerHeight: elem.outerHeight(),
+			outerWidth: elem.outerWidth()
+		};
 
-		}
+	$.extend( o, {
+		effect: "scale",
+		queue: false,
+		fade: true,
+		mode: mode,
+		complete: done,
+		percent: hide ? percent : 100,
+		from: hide ?
+			original :
+			{
+				height: original.height * factor,
+				width: original.width * factor,
+				outerHeight: original.outerHeight * factor,
+				outerWidth: original.outerWidth * factor
+			}
+	});
 
-	},
+	elem.effect( o );
+};
 
-	_renderProxy: function() {
 
-		var el = this.element, o = this.options;
-		this.elementOffset = el.offset();
+/*!
+ * jQuery UI Effects Pulsate 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/pulsate-effect/
+ */
 
-		if(this._helper) {
 
-			this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
+var effectPulsate = $.effects.effect.pulsate = function( o, done ) {
+	var elem = $( this ),
+		mode = $.effects.setMode( elem, o.mode || "show" ),
+		show = mode === "show",
+		hide = mode === "hide",
+		showhide = ( show || mode === "hide" ),
 
-			this.helper.addClass(this._helper).css({
-				width: this.element.outerWidth() - 1,
-				height: this.element.outerHeight() - 1,
-				position: "absolute",
-				left: this.elementOffset.left +"px",
-				top: this.elementOffset.top +"px",
-				zIndex: ++o.zIndex //TODO: Don't modify option
-			});
+		// showing or hiding leaves of the "last" animation
+		anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
+		duration = o.duration / anims,
+		animateTo = 0,
+		queue = elem.queue(),
+		queuelen = queue.length,
+		i;
 
-			this.helper
-				.appendTo("body")
-				.disableSelection();
+	if ( show || !elem.is(":visible")) {
+		elem.css( "opacity", 0 ).show();
+		animateTo = 1;
+	}
 
-		} else {
-			this.helper = this.element;
-		}
+	// anims - 1 opacity "toggles"
+	for ( i = 1; i < anims; i++ ) {
+		elem.animate({
+			opacity: animateTo
+		}, duration, o.easing );
+		animateTo = 1 - animateTo;
+	}
 
-	},
+	elem.animate({
+		opacity: animateTo
+	}, duration, o.easing);
 
-	_change: {
-		e: function(event, dx) {
-			return { width: this.originalSize.width + dx };
-		},
-		w: function(event, dx) {
-			var cs = this.originalSize, sp = this.originalPosition;
-			return { left: sp.left + dx, width: cs.width - dx };
-		},
-		n: function(event, dx, dy) {
-			var cs = this.originalSize, sp = this.originalPosition;
-			return { top: sp.top + dy, height: cs.height - dy };
-		},
-		s: function(event, dx, dy) {
-			return { height: this.originalSize.height + dy };
-		},
-		se: function(event, dx, dy) {
-			return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
-		},
-		sw: function(event, dx, dy) {
-			return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
-		},
-		ne: function(event, dx, dy) {
-			return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
-		},
-		nw: function(event, dx, dy) {
-			return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
+	elem.queue(function() {
+		if ( hide ) {
+			elem.hide();
 		}
-	},
-
-	_propagate: function(n, event) {
-		$.ui.plugin.call(this, n, [event, this.ui()]);
-		(n !== "resize" && this._trigger(n, event, this.ui()));
-	},
-
-	plugins: {},
+		done();
+	});
 
-	ui: function() {
-		return {
-			originalElement: this.originalElement,
-			element: this.element,
-			helper: this.helper,
-			position: this.position,
-			size: this.size,
-			originalSize: this.originalSize,
-			originalPosition: this.originalPosition
-		};
+	// We just queued up "anims" animations, we need to put them next in the queue
+	if ( queuelen > 1 ) {
+		queue.splice.apply( queue,
+			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
 	}
+	elem.dequeue();
+};
 
-});
 
-/*
- * Resizable Extensions
+/*!
+ * jQuery UI Effects Shake 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/shake-effect/
  */
 
-$.ui.plugin.add("resizable", "animate", {
 
-	stop: function( event ) {
-		var that = $(this).data("ui-resizable"),
-			o = that.options,
-			pr = that._proportionallyResizeElements,
-			ista = pr.length && (/textarea/i).test(pr[0].nodeName),
-			soffseth = ista && $.ui.hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height,
-			soffsetw = ista ? 0 : that.sizeDiff.width,
-			style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
-			left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null,
-			top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
+var effectShake = $.effects.effect.shake = function( o, done ) {
 
-		that.element.animate(
-			$.extend(style, top && left ? { top: top, left: left } : {}), {
-				duration: o.animateDuration,
-				easing: o.animateEasing,
-				step: function() {
+	var el = $( this ),
+		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+		mode = $.effects.setMode( el, o.mode || "effect" ),
+		direction = o.direction || "left",
+		distance = o.distance || 20,
+		times = o.times || 3,
+		anims = times * 2 + 1,
+		speed = Math.round( o.duration / anims ),
+		ref = (direction === "up" || direction === "down") ? "top" : "left",
+		positiveMotion = (direction === "up" || direction === "left"),
+		animation = {},
+		animation1 = {},
+		animation2 = {},
+		i,
 
-					var data = {
-						width: parseInt(that.element.css("width"), 10),
-						height: parseInt(that.element.css("height"), 10),
-						top: parseInt(that.element.css("top"), 10),
-						left: parseInt(that.element.css("left"), 10)
-					};
+		// we will need to re-assemble the queue to stack our animations in place
+		queue = el.queue(),
+		queuelen = queue.length;
 
-					if (pr && pr.length) {
-						$(pr[0]).css({ width: data.width, height: data.height });
-					}
+	$.effects.save( el, props );
+	el.show();
+	$.effects.createWrapper( el );
 
-					// propagating resize, and updating values for each animation step
-					that._updateCache(data);
-					that._propagate("resize", event);
+	// Animation
+	animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
+	animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
+	animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
 
-				}
+	// Animate
+	el.animate( animation, speed, o.easing );
+
+	// Shakes
+	for ( i = 1; i < times; i++ ) {
+		el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
+	}
+	el
+		.animate( animation1, speed, o.easing )
+		.animate( animation, speed / 2, o.easing )
+		.queue(function() {
+			if ( mode === "hide" ) {
+				el.hide();
 			}
-		);
+			$.effects.restore( el, props );
+			$.effects.removeWrapper( el );
+			done();
+		});
+
+	// inject all the animations we just queued to be first in line (after "inprogress")
+	if ( queuelen > 1) {
+		queue.splice.apply( queue,
+			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
 	}
+	el.dequeue();
 
-});
+};
 
-$.ui.plugin.add("resizable", "containment", {
 
-	start: function() {
-		var element, p, co, ch, cw, width, height,
-			that = $(this).data("ui-resizable"),
-			o = that.options,
-			el = that.element,
-			oc = o.containment,
-			ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
+/*!
+ * jQuery UI Effects Slide 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/slide-effect/
+ */
 
-		if (!ce) {
-			return;
-		}
 
-		that.containerElement = $(ce);
+var effectSlide = $.effects.effect.slide = function( o, done ) {
 
-		if (/document/.test(oc) || oc === document) {
-			that.containerOffset = { left: 0, top: 0 };
-			that.containerPosition = { left: 0, top: 0 };
+	// Create element
+	var el = $( this ),
+		props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
+		mode = $.effects.setMode( el, o.mode || "show" ),
+		show = mode === "show",
+		direction = o.direction || "left",
+		ref = (direction === "up" || direction === "down") ? "top" : "left",
+		positiveMotion = (direction === "up" || direction === "left"),
+		distance,
+		animation = {};
 
-			that.parentData = {
-				element: $(document), left: 0, top: 0,
-				width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
-			};
-		}
+	// Adjust
+	$.effects.save( el, props );
+	el.show();
+	distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
 
-		// i'm a node, so compute top, left, right, bottom
-		else {
-			element = $(ce);
-			p = [];
-			$([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
+	$.effects.createWrapper( el ).css({
+		overflow: "hidden"
+	});
 
-			that.containerOffset = element.offset();
-			that.containerPosition = element.position();
-			that.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
+	if ( show ) {
+		el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
+	}
 
-			co = that.containerOffset;
-			ch = that.containerSize.height;
-			cw = that.containerSize.width;
-			width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw );
-			height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
+	// Animation
+	animation[ ref ] = ( show ?
+		( positiveMotion ? "+=" : "-=") :
+		( positiveMotion ? "-=" : "+=")) +
+		distance;
 
-			that.parentData = {
-				element: ce, left: co.left, top: co.top, width: width, height: height
-			};
+	// Animate
+	el.animate( animation, {
+		queue: false,
+		duration: o.duration,
+		easing: o.easing,
+		complete: function() {
+			if ( mode === "hide" ) {
+				el.hide();
+			}
+			$.effects.restore( el, props );
+			$.effects.removeWrapper( el );
+			done();
 		}
-	},
-
-	resize: function( event ) {
-		var woset, hoset, isParent, isOffsetRelative,
-			that = $(this).data("ui-resizable"),
-			o = that.options,
-			co = that.containerOffset, cp = that.position,
-			pRatio = that._aspectRatio || event.shiftKey,
-			cop = { top:0, left:0 }, ce = that.containerElement;
+	});
+};
 
-		if (ce[0] !== document && (/static/).test(ce.css("position"))) {
-			cop = co;
-		}
 
-		if (cp.left < (that._helper ? co.left : 0)) {
-			that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left));
-			if (pRatio) {
-				that.size.height = that.size.width / that.aspectRatio;
-			}
-			that.position.left = o.helper ? co.left : 0;
-		}
+/*!
+ * jQuery UI Effects Transfer 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/transfer-effect/
+ */
 
-		if (cp.top < (that._helper ? co.top : 0)) {
-			that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top);
-			if (pRatio) {
-				that.size.width = that.size.height * that.aspectRatio;
-			}
-			that.position.top = that._helper ? co.top : 0;
-		}
 
-		that.offset.left = that.parentData.left+that.position.left;
-		that.offset.top = that.parentData.top+that.position.top;
+var effectTransfer = $.effects.effect.transfer = function( o, done ) {
+	var elem = $( this ),
+		target = $( o.to ),
+		targetFixed = target.css( "position" ) === "fixed",
+		body = $("body"),
+		fixTop = targetFixed ? body.scrollTop() : 0,
+		fixLeft = targetFixed ? body.scrollLeft() : 0,
+		endPosition = target.offset(),
+		animation = {
+			top: endPosition.top - fixTop,
+			left: endPosition.left - fixLeft,
+			height: target.innerHeight(),
+			width: target.innerWidth()
+		},
+		startPosition = elem.offset(),
+		transfer = $( "<div class='ui-effects-transfer'></div>" )
+			.appendTo( document.body )
+			.addClass( o.className )
+			.css({
+				top: startPosition.top - fixTop,
+				left: startPosition.left - fixLeft,
+				height: elem.innerHeight(),
+				width: elem.innerWidth(),
+				position: targetFixed ? "fixed" : "absolute"
+			})
+			.animate( animation, o.duration, o.easing, function() {
+				transfer.remove();
+				done();
+			});
+};
 
-		woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width );
-		hoset = Math.abs( (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height );
 
-		isParent = that.containerElement.get(0) === that.element.parent().get(0);
-		isOffsetRelative = /relative|absolute/.test(that.containerElement.css("position"));
+/*!
+ * jQuery UI Progressbar 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/progressbar/
+ */
 
-		if ( isParent && isOffsetRelative ) {
-			woset -= Math.abs( that.parentData.left );
-		}
 
-		if (woset + that.size.width >= that.parentData.width) {
-			that.size.width = that.parentData.width - woset;
-			if (pRatio) {
-				that.size.height = that.size.width / that.aspectRatio;
-			}
-		}
+var progressbar = $.widget( "ui.progressbar", {
+	version: "1.11.0",
+	options: {
+		max: 100,
+		value: 0,
 
-		if (hoset + that.size.height >= that.parentData.height) {
-			that.size.height = that.parentData.height - hoset;
-			if (pRatio) {
-				that.size.width = that.size.height * that.aspectRatio;
-			}
-		}
+		change: null,
+		complete: null
 	},
 
-	stop: function(){
-		var that = $(this).data("ui-resizable"),
-			o = that.options,
-			co = that.containerOffset,
-			cop = that.containerPosition,
-			ce = that.containerElement,
-			helper = $(that.helper),
-			ho = helper.offset(),
-			w = helper.outerWidth() - that.sizeDiff.width,
-			h = helper.outerHeight() - that.sizeDiff.height;
-
-		if (that._helper && !o.animate && (/relative/).test(ce.css("position"))) {
-			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-		}
-
-		if (that._helper && !o.animate && (/static/).test(ce.css("position"))) {
-			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-		}
+	min: 0,
 
-	}
-});
+	_create: function() {
+		// Constrain initial value
+		this.oldValue = this.options.value = this._constrainedValue();
 
-$.ui.plugin.add("resizable", "alsoResize", {
+		this.element
+			.addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
+			.attr({
+				// Only set static values, aria-valuenow and aria-valuemax are
+				// set inside _refreshValue()
+				role: "progressbar",
+				"aria-valuemin": this.min
+			});
 
-	start: function () {
-		var that = $(this).data("ui-resizable"),
-			o = that.options,
-			_store = function (exp) {
-				$(exp).each(function() {
-					var el = $(this);
-					el.data("ui-resizable-alsoresize", {
-						width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
-						left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
-					});
-				});
-			};
+		this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
+			.appendTo( this.element );
 
-		if (typeof(o.alsoResize) === "object" && !o.alsoResize.parentNode) {
-			if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
-			else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
-		}else{
-			_store(o.alsoResize);
-		}
+		this._refreshValue();
 	},
 
-	resize: function (event, ui) {
-		var that = $(this).data("ui-resizable"),
-			o = that.options,
-			os = that.originalSize,
-			op = that.originalPosition,
-			delta = {
-				height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0,
-				top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0
-			},
-
-			_alsoResize = function (exp, c) {
-				$(exp).each(function() {
-					var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
-						css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
-
-					$.each(css, function (i, prop) {
-						var sum = (start[prop]||0) + (delta[prop]||0);
-						if (sum && sum >= 0) {
-							style[prop] = sum || null;
-						}
-					});
+	_destroy: function() {
+		this.element
+			.removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
+			.removeAttr( "role" )
+			.removeAttr( "aria-valuemin" )
+			.removeAttr( "aria-valuemax" )
+			.removeAttr( "aria-valuenow" );
 
-					el.css(style);
-				});
-			};
+		this.valueDiv.remove();
+	},
 
-		if (typeof(o.alsoResize) === "object" && !o.alsoResize.nodeType) {
-			$.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
-		}else{
-			_alsoResize(o.alsoResize);
+	value: function( newValue ) {
+		if ( newValue === undefined ) {
+			return this.options.value;
 		}
+
+		this.options.value = this._constrainedValue( newValue );
+		this._refreshValue();
 	},
 
-	stop: function () {
-		$(this).removeData("resizable-alsoresize");
-	}
-});
+	_constrainedValue: function( newValue ) {
+		if ( newValue === undefined ) {
+			newValue = this.options.value;
+		}
 
-$.ui.plugin.add("resizable", "ghost", {
+		this.indeterminate = newValue === false;
 
-	start: function() {
+		// sanitize value
+		if ( typeof newValue !== "number" ) {
+			newValue = 0;
+		}
 
-		var that = $(this).data("ui-resizable"), o = that.options, cs = that.size;
+		return this.indeterminate ? false :
+			Math.min( this.options.max, Math.max( this.min, newValue ) );
+	},
 
-		that.ghost = that.originalElement.clone();
-		that.ghost
-			.css({ opacity: 0.25, display: "block", position: "relative", height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
-			.addClass("ui-resizable-ghost")
-			.addClass(typeof o.ghost === "string" ? o.ghost : "");
+	_setOptions: function( options ) {
+		// Ensure "value" option is set after other values (like max)
+		var value = options.value;
+		delete options.value;
 
-		that.ghost.appendTo(that.helper);
+		this._super( options );
 
+		this.options.value = this._constrainedValue( value );
+		this._refreshValue();
 	},
 
-	resize: function(){
-		var that = $(this).data("ui-resizable");
-		if (that.ghost) {
-			that.ghost.css({ position: "relative", height: that.size.height, width: that.size.width });
+	_setOption: function( key, value ) {
+		if ( key === "max" ) {
+			// Don't allow a max less than min
+			value = Math.max( this.min, value );
 		}
-	},
-
-	stop: function() {
-		var that = $(this).data("ui-resizable");
-		if (that.ghost && that.helper) {
-			that.helper.get(0).removeChild(that.ghost.get(0));
+		if ( key === "disabled" ) {
+			this.element
+				.toggleClass( "ui-state-disabled", !!value )
+				.attr( "aria-disabled", value );
 		}
-	}
-
-});
+		this._super( key, value );
+	},
 
-$.ui.plugin.add("resizable", "grid", {
+	_percentage: function() {
+		return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
+	},
 
-	resize: function() {
-		var that = $(this).data("ui-resizable"),
-			o = that.options,
-			cs = that.size,
-			os = that.originalSize,
-			op = that.originalPosition,
-			a = that.axis,
-			grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid,
-			gridX = (grid[0]||1),
-			gridY = (grid[1]||1),
-			ox = Math.round((cs.width - os.width) / gridX) * gridX,
-			oy = Math.round((cs.height - os.height) / gridY) * gridY,
-			newWidth = os.width + ox,
-			newHeight = os.height + oy,
-			isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
-			isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
-			isMinWidth = o.minWidth && (o.minWidth > newWidth),
-			isMinHeight = o.minHeight && (o.minHeight > newHeight);
+	_refreshValue: function() {
+		var value = this.options.value,
+			percentage = this._percentage();
 
-		o.grid = grid;
+		this.valueDiv
+			.toggle( this.indeterminate || value > this.min )
+			.toggleClass( "ui-corner-right", value === this.options.max )
+			.width( percentage.toFixed(0) + "%" );
 
-		if (isMinWidth) {
-			newWidth = newWidth + gridX;
-		}
-		if (isMinHeight) {
-			newHeight = newHeight + gridY;
-		}
-		if (isMaxWidth) {
-			newWidth = newWidth - gridX;
-		}
-		if (isMaxHeight) {
-			newHeight = newHeight - gridY;
-		}
+		this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
 
-		if (/^(se|s|e)$/.test(a)) {
-			that.size.width = newWidth;
-			that.size.height = newHeight;
-		} else if (/^(ne)$/.test(a)) {
-			that.size.width = newWidth;
-			that.size.height = newHeight;
-			that.position.top = op.top - oy;
-		} else if (/^(sw)$/.test(a)) {
-			that.size.width = newWidth;
-			that.size.height = newHeight;
-			that.position.left = op.left - ox;
-		} else {
-			if ( newHeight - gridY > 0 ) {
-				that.size.height = newHeight;
-				that.position.top = op.top - oy;
-			} else {
-				that.size.height = gridY;
-				that.position.top = op.top + os.height - gridY;
+		if ( this.indeterminate ) {
+			this.element.removeAttr( "aria-valuenow" );
+			if ( !this.overlayDiv ) {
+				this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
 			}
-			if ( newWidth - gridX > 0 ) {
-				that.size.width = newWidth;
-				that.position.left = op.left - ox;
-			} else {
-				that.size.width = gridX;
-				that.position.left = op.left + os.width - gridX;
+		} else {
+			this.element.attr({
+				"aria-valuemax": this.options.max,
+				"aria-valuenow": value
+			});
+			if ( this.overlayDiv ) {
+				this.overlayDiv.remove();
+				this.overlayDiv = null;
 			}
 		}
-	}
 
+		if ( this.oldValue !== value ) {
+			this.oldValue = value;
+			this._trigger( "change" );
+		}
+		if ( value === this.options.max ) {
+			this._trigger( "complete" );
+		}
+	}
 });
 
-})(jQuery);
-(function( $, undefined ) {
 
-$.widget("ui.selectable", $.ui.mouse, {
-	version: "1.10.4",
+/*!
+ * jQuery UI Selectable 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/selectable/
+ */
+
+
+var selectable = $.widget("ui.selectable", $.ui.mouse, {
+	version: "1.11.0",
 	options: {
 		appendTo: "body",
 		autoRefresh: true,
@@ -11175,7 +11667,7 @@ $.widget("ui.selectable", $.ui.mouse, {
 		var that = this,
 			options = this.options;
 
-		this.opos = [event.pageX, event.pageY];
+		this.opos = [ event.pageX, event.pageY ];
 
 		if (this.options.disabled) {
 			return;
@@ -11258,7 +11750,7 @@ $.widget("ui.selectable", $.ui.mouse, {
 
 		if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
 		if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
-		this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
+		this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });
 
 		this.selectees.each(function() {
 			var selectee = $.data(this, "selectable-item"),
@@ -11319,62 +11811,607 @@ $.widget("ui.selectable", $.ui.mouse, {
 						selectee.$element.removeClass("ui-selected");
 						selectee.selected = false;
 
-						selectee.$element.addClass("ui-unselecting");
-						selectee.unselecting = true;
-						// selectable UNSELECTING callback
-						that._trigger("unselecting", event, {
-							unselecting: selectee.element
-						});
-					}
-				}
+						selectee.$element.addClass("ui-unselecting");
+						selectee.unselecting = true;
+						// selectable UNSELECTING callback
+						that._trigger("unselecting", event, {
+							unselecting: selectee.element
+						});
+					}
+				}
+			}
+		});
+
+		return false;
+	},
+
+	_mouseStop: function(event) {
+		var that = this;
+
+		this.dragged = false;
+
+		$(".ui-unselecting", this.element[0]).each(function() {
+			var selectee = $.data(this, "selectable-item");
+			selectee.$element.removeClass("ui-unselecting");
+			selectee.unselecting = false;
+			selectee.startselected = false;
+			that._trigger("unselected", event, {
+				unselected: selectee.element
+			});
+		});
+		$(".ui-selecting", this.element[0]).each(function() {
+			var selectee = $.data(this, "selectable-item");
+			selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
+			selectee.selecting = false;
+			selectee.selected = true;
+			selectee.startselected = true;
+			that._trigger("selected", event, {
+				selected: selectee.element
+			});
+		});
+		this._trigger("stop", event);
+
+		this.helper.remove();
+
+		return false;
+	}
+
+});
+
+
+/*!
+ * jQuery UI Selectmenu 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/selectmenu
+ */
+
+
+var selectmenu = $.widget( "ui.selectmenu", {
+	version: "1.11.0",
+	defaultElement: "<select>",
+	options: {
+		appendTo: null,
+		disabled: null,
+		icons: {
+			button: "ui-icon-triangle-1-s"
+		},
+		position: {
+			my: "left top",
+			at: "left bottom",
+			collision: "none"
+		},
+		width: null,
+
+		// callbacks
+		change: null,
+		close: null,
+		focus: null,
+		open: null,
+		select: null
+	},
+
+	_create: function() {
+		var selectmenuId = this.element.uniqueId().attr( "id" );
+		this.ids = {
+			element: selectmenuId,
+			button: selectmenuId + "-button",
+			menu: selectmenuId + "-menu"
+		};
+
+		this._drawButton();
+		this._drawMenu();
+
+		if ( this.options.disabled ) {
+			this.disable();
+		}
+	},
+
+	_drawButton: function() {
+		var that = this,
+			tabindex = this.element.attr( "tabindex" );
+
+		// Associate existing label with the new button
+		this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button );
+		this._on( this.label, {
+			click: function( event ) {
+				this.button.focus();
+				event.preventDefault();
+			}
+		});
+
+		// Hide original select element
+		this.element.hide();
+
+		// Create button
+		this.button = $( "<span>", {
+			"class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
+			tabindex: tabindex || this.options.disabled ? -1 : 0,
+			id: this.ids.button,
+			role: "combobox",
+			"aria-expanded": "false",
+			"aria-autocomplete": "list",
+			"aria-owns": this.ids.menu,
+			"aria-haspopup": "true"
+		})
+			.insertAfter( this.element );
+
+		$( "<span>", {
+			"class": "ui-icon " + this.options.icons.button
+		})
+			.prependTo( this.button );
+
+		this.buttonText = $( "<span>", {
+			"class": "ui-selectmenu-text"
+		})
+			.appendTo( this.button );
+
+		this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
+		this._setOption( "width", this.options.width );
+
+		this._on( this.button, this._buttonEvents );
+		this.button.one( "focusin", function() {
+
+			// Delay rendering the menu items until the button receives focus.
+			// The menu may have already been rendered via a programmatic open.
+			if ( !that.menuItems ) {
+				that._refreshMenu();
+			}
+		});
+		this._hoverable( this.button );
+		this._focusable( this.button );
+	},
+
+	_drawMenu: function() {
+		var that = this;
+
+		// Create menu
+		this.menu = $( "<ul>", {
+			"aria-hidden": "true",
+			"aria-labelledby": this.ids.button,
+			id: this.ids.menu
+		});
+
+		// Wrap menu
+		this.menuWrap = $( "<div>", {
+			"class": "ui-selectmenu-menu ui-front"
+		})
+			.append( this.menu )
+			.appendTo( this._appendTo() );
+
+		// Initialize menu widget
+		this.menuInstance = this.menu
+			.menu({
+				role: "listbox",
+				select: function( event, ui ) {
+					event.preventDefault();
+					that._select( ui.item.data( "ui-selectmenu-item" ), event );
+				},
+				focus: function( event, ui ) {
+					var item = ui.item.data( "ui-selectmenu-item" );
+
+					// Prevent inital focus from firing and check if its a newly focused item
+					if ( that.focusIndex != null && item.index !== that.focusIndex ) {
+						that._trigger( "focus", event, { item: item } );
+						if ( !that.isOpen ) {
+							that._select( item, event );
+						}
+					}
+					that.focusIndex = item.index;
+
+					that.button.attr( "aria-activedescendant",
+						that.menuItems.eq( item.index ).attr( "id" ) );
+				}
+			})
+			.menu( "instance" );
+
+		// Adjust menu styles to dropdown
+		this.menu
+			.addClass( "ui-corner-bottom" )
+			.removeClass( "ui-corner-all" );
+
+		// Don't close the menu on mouseleave
+		this.menuInstance._off( this.menu, "mouseleave" );
+
+		// Cancel the menu's collapseAll on document click
+		this.menuInstance._closeOnDocumentClick = function() {
+			return false;
+		};
+
+		// Selects often contain empty items, but never contain dividers
+		this.menuInstance._isDivider = function() {
+			return false;
+		};
+	},
+
+	refresh: function() {
+		this._refreshMenu();
+		this._setText( this.buttonText, this._getSelectedItem().text() );
+		this._setOption( "width", this.options.width );
+	},
+
+	_refreshMenu: function() {
+		this.menu.empty();
+
+		var item,
+			options = this.element.find( "option" );
+
+		if ( !options.length ) {
+			return;
+		}
+
+		this._parseOptions( options );
+		this._renderMenu( this.menu, this.items );
+
+		this.menuInstance.refresh();
+		this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
+
+		item = this._getSelectedItem();
+
+		// Update the menu to have the correct item focused
+		this.menuInstance.focus( null, item );
+		this._setAria( item.data( "ui-selectmenu-item" ) );
+
+		// Set disabled state
+		this._setOption( "disabled", this.element.prop( "disabled" ) );
+	},
+
+	open: function( event ) {
+		if ( this.options.disabled ) {
+			return;
+		}
+
+		// If this is the first time the menu is being opened, render the items
+		if ( !this.menuItems ) {
+			this._refreshMenu();
+		} else {
+
+			// Menu clears focus on close, reset focus to selected item
+			this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
+			this.menuInstance.focus( null, this._getSelectedItem() );
+		}
+
+		this.isOpen = true;
+		this._toggleAttr();
+		this._resizeMenu();
+		this._position();
+
+		this._on( this.document, this._documentClick );
+
+		this._trigger( "open", event );
+	},
+
+	_position: function() {
+		this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
+	},
+
+	close: function( event ) {
+		if ( !this.isOpen ) {
+			return;
+		}
+
+		this.isOpen = false;
+		this._toggleAttr();
+
+		this._off( this.document );
+
+		this._trigger( "close", event );
+	},
+
+	widget: function() {
+		return this.button;
+	},
+
+	menuWidget: function() {
+		return this.menu;
+	},
+
+	_renderMenu: function( ul, items ) {
+		var that = this,
+			currentOptgroup = "";
+
+		$.each( items, function( index, item ) {
+			if ( item.optgroup !== currentOptgroup ) {
+				$( "<li>", {
+					"class": "ui-selectmenu-optgroup ui-menu-divider" +
+						( item.element.parent( "optgroup" ).prop( "disabled" ) ?
+							" ui-state-disabled" :
+							"" ),
+					text: item.optgroup
+				})
+					.appendTo( ul );
+
+				currentOptgroup = item.optgroup;
+			}
+
+			that._renderItemData( ul, item );
+		});
+	},
+
+	_renderItemData: function( ul, item ) {
+		return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
+	},
+
+	_renderItem: function( ul, item ) {
+		var li = $( "<li>" );
+
+		if ( item.disabled ) {
+			li.addClass( "ui-state-disabled" );
+		}
+		this._setText( li, item.label );
+
+		return li.appendTo( ul );
+	},
+
+	_setText: function( element, value ) {
+		if ( value ) {
+			element.text( value );
+		} else {
+			element.html( "&#160;" );
+		}
+	},
+
+	_move: function( direction, event ) {
+		var item, next,
+			filter = ".ui-menu-item";
+
+		if ( this.isOpen ) {
+			item = this.menuItems.eq( this.focusIndex );
+		} else {
+			item = this.menuItems.eq( this.element[ 0 ].selectedIndex );
+			filter += ":not(.ui-state-disabled)";
+		}
+
+		if ( direction === "first" || direction === "last" ) {
+			next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
+		} else {
+			next = item[ direction + "All" ]( filter ).eq( 0 );
+		}
+
+		if ( next.length ) {
+			this.menuInstance.focus( event, next );
+		}
+	},
+
+	_getSelectedItem: function() {
+		return this.menuItems.eq( this.element[ 0 ].selectedIndex );
+	},
+
+	_toggle: function( event ) {
+		this[ this.isOpen ? "close" : "open" ]( event );
+	},
+
+	_documentClick: {
+		mousedown: function( event ) {
+			if ( !this.isOpen ) {
+				return;
+			}
+
+			if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
+				this.close( event );
+			}
+		}
+	},
+
+	_buttonEvents: {
+		click: "_toggle",
+		keydown: function( event ) {
+			var preventDefault = true;
+			switch ( event.keyCode ) {
+				case $.ui.keyCode.TAB:
+				case $.ui.keyCode.ESCAPE:
+					this.close( event );
+					preventDefault = false;
+					break;
+				case $.ui.keyCode.ENTER:
+					if ( this.isOpen ) {
+						this._selectFocusedItem( event );
+					}
+					break;
+				case $.ui.keyCode.UP:
+					if ( event.altKey ) {
+						this._toggle( event );
+					} else {
+						this._move( "prev", event );
+					}
+					break;
+				case $.ui.keyCode.DOWN:
+					if ( event.altKey ) {
+						this._toggle( event );
+					} else {
+						this._move( "next", event );
+					}
+					break;
+				case $.ui.keyCode.SPACE:
+					if ( this.isOpen ) {
+						this._selectFocusedItem( event );
+					} else {
+						this._toggle( event );
+					}
+					break;
+				case $.ui.keyCode.LEFT:
+					this._move( "prev", event );
+					break;
+				case $.ui.keyCode.RIGHT:
+					this._move( "next", event );
+					break;
+				case $.ui.keyCode.HOME:
+				case $.ui.keyCode.PAGE_UP:
+					this._move( "first", event );
+					break;
+				case $.ui.keyCode.END:
+				case $.ui.keyCode.PAGE_DOWN:
+					this._move( "last", event );
+					break;
+				default:
+					this.menu.trigger( event );
+					preventDefault = false;
+			}
+
+			if ( preventDefault ) {
+				event.preventDefault();
 			}
-		});
+		}
+	},
 
-		return false;
+	_selectFocusedItem: function( event ) {
+		var item = this.menuItems.eq( this.focusIndex );
+		if ( !item.hasClass( "ui-state-disabled" ) ) {
+			this._select( item.data( "ui-selectmenu-item" ), event );
+		}
 	},
 
-	_mouseStop: function(event) {
-		var that = this;
+	_select: function( item, event ) {
+		var oldIndex = this.element[ 0 ].selectedIndex;
 
-		this.dragged = false;
+		// Change native select element
+		this.element[ 0 ].selectedIndex = item.index;
+		this._setText( this.buttonText, item.label );
+		this._setAria( item );
+		this._trigger( "select", event, { item: item } );
 
-		$(".ui-unselecting", this.element[0]).each(function() {
-			var selectee = $.data(this, "selectable-item");
-			selectee.$element.removeClass("ui-unselecting");
-			selectee.unselecting = false;
-			selectee.startselected = false;
-			that._trigger("unselected", event, {
-				unselected: selectee.element
-			});
+		if ( item.index !== oldIndex ) {
+			this._trigger( "change", event, { item: item } );
+		}
+
+		this.close( event );
+	},
+
+	_setAria: function( item ) {
+		var id = this.menuItems.eq( item.index ).attr( "id" );
+
+		this.button.attr({
+			"aria-labelledby": id,
+			"aria-activedescendant": id
 		});
-		$(".ui-selecting", this.element[0]).each(function() {
-			var selectee = $.data(this, "selectable-item");
-			selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
-			selectee.selecting = false;
-			selectee.selected = true;
-			selectee.startselected = true;
-			that._trigger("selected", event, {
-				selected: selectee.element
+		this.menu.attr( "aria-activedescendant", id );
+	},
+
+	_setOption: function( key, value ) {
+		if ( key === "icons" ) {
+			this.button.find( "span.ui-icon" )
+				.removeClass( this.options.icons.button )
+				.addClass( value.button );
+		}
+
+		this._super( key, value );
+
+		if ( key === "appendTo" ) {
+			this.menuWrap.appendTo( this._appendTo() );
+		}
+
+		if ( key === "disabled" ) {
+			this.menuInstance.option( "disabled", value );
+			this.button
+				.toggleClass( "ui-state-disabled", value )
+				.attr( "aria-disabled", value );
+
+			this.element.prop( "disabled", value );
+			if ( value ) {
+				this.button.attr( "tabindex", -1 );
+				this.close();
+			} else {
+				this.button.attr( "tabindex", 0 );
+			}
+		}
+
+		if ( key === "width" ) {
+			if ( !value ) {
+				value = this.element.outerWidth();
+			}
+			this.button.outerWidth( value );
+		}
+	},
+
+	_appendTo: function() {
+		var element = this.options.appendTo;
+
+		if ( element ) {
+			element = element.jquery || element.nodeType ?
+				$( element ) :
+				this.document.find( element ).eq( 0 );
+		}
+
+		if ( !element || !element[ 0 ] ) {
+			element = this.element.closest( ".ui-front" );
+		}
+
+		if ( !element.length ) {
+			element = this.document[ 0 ].body;
+		}
+
+		return element;
+	},
+
+	_toggleAttr: function() {
+		this.button
+			.toggleClass( "ui-corner-top", this.isOpen )
+			.toggleClass( "ui-corner-all", !this.isOpen )
+			.attr( "aria-expanded", this.isOpen );
+		this.menuWrap.toggleClass( "ui-selectmenu-open", this.isOpen );
+		this.menu.attr( "aria-hidden", !this.isOpen );
+	},
+
+	_resizeMenu: function() {
+		this.menu.outerWidth( Math.max(
+			this.button.outerWidth(),
+
+			// support: IE10
+			// IE10 wraps long text (possibly a rounding bug)
+			// so we add 1px to avoid the wrapping
+			this.menu.width( "" ).outerWidth() + 1
+		) );
+	},
+
+	_getCreateOptions: function() {
+		return { disabled: this.element.prop( "disabled" ) };
+	},
+
+	_parseOptions: function( options ) {
+		var data = [];
+		options.each(function( index, item ) {
+			var option = $( item ),
+				optgroup = option.parent( "optgroup" );
+			data.push({
+				element: option,
+				index: index,
+				value: option.attr( "value" ),
+				label: option.text(),
+				optgroup: optgroup.attr( "label" ) || "",
+				disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
 			});
 		});
-		this._trigger("stop", event);
-
-		this.helper.remove();
+		this.items = data;
+	},
 
-		return false;
+	_destroy: function() {
+		this.menuWrap.remove();
+		this.button.remove();
+		this.element.show();
+		this.element.removeUniqueId();
+		this.label.attr( "for", this.ids.element );
 	}
-
 });
 
-})(jQuery);
-(function( $, undefined ) {
 
-// number of pages in a slider
-// (how many times can you page up/down to go through the whole range)
-var numPages = 5;
+/*!
+ * jQuery UI Slider 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/slider/
+ */
+
 
-$.widget( "ui.slider", $.ui.mouse, {
-	version: "1.10.4",
+var slider = $.widget( "ui.slider", $.ui.mouse, {
+	version: "1.11.0",
 	widgetEventPrefix: "slide",
 
 	options: {
@@ -11395,6 +12432,10 @@ $.widget( "ui.slider", $.ui.mouse, {
 		stop: null
 	},
 
+	// number of pages in a slider
+	// (how many times can you page up/down to go through the whole range)
+	numPages: 5,
+
 	_create: function() {
 		this._keySliding = false;
 		this._mouseSliding = false;
@@ -11427,7 +12468,7 @@ $.widget( "ui.slider", $.ui.mouse, {
 		var i, handleCount,
 			options = this.options,
 			existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
-			handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
+			handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
 			handles = [];
 
 		handleCount = ( options.values && options.values.length ) || 1;
@@ -11493,11 +12534,10 @@ $.widget( "ui.slider", $.ui.mouse, {
 	},
 
 	_setupEvents: function() {
-		var elements = this.handles.add( this.range ).filter( "a" );
-		this._off( elements );
-		this._on( elements, this._handleEvents );
-		this._hoverable( elements );
-		this._focusable( elements );
+		this._off( this.handles );
+		this._on( this.handles, this._handleEvents );
+		this._hoverable( this.handles );
+		this._focusable( this.handles );
 	},
 
 	_destroy: function() {
@@ -11777,7 +12817,7 @@ $.widget( "ui.slider", $.ui.mouse, {
 				this.options.value = this._values( 0 );
 				this.options.values = null;
 			} else if ( value === "max" ) {
-				this.options.value = this._values( this.options.values.length-1 );
+				this.options.value = this._values( this.options.values.length - 1 );
 				this.options.values = null;
 			}
 		}
@@ -11786,7 +12826,11 @@ $.widget( "ui.slider", $.ui.mouse, {
 			valsLength = this.options.values.length;
 		}
 
-		$.Widget.prototype._setOption.apply( this, arguments );
+		if ( key === "disabled" ) {
+			this.element.toggleClass( "ui-state-disabled", !!value );
+		}
+
+		this._super( key, value );
 
 		switch ( key ) {
 			case "orientation":
@@ -11987,10 +13031,13 @@ $.widget( "ui.slider", $.ui.mouse, {
 					newVal = this._valueMax();
 					break;
 				case $.ui.keyCode.PAGE_UP:
-					newVal = this._trimAlignValue( curVal + ( (this._valueMax() - this._valueMin()) / numPages ) );
+					newVal = this._trimAlignValue(
+						curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
+					);
 					break;
 				case $.ui.keyCode.PAGE_DOWN:
-					newVal = this._trimAlignValue( curVal - ( (this._valueMax() - this._valueMin()) / numPages ) );
+					newVal = this._trimAlignValue(
+						curVal - ( (this._valueMax() - this._valueMin()) / this.numPages ) );
 					break;
 				case $.ui.keyCode.UP:
 				case $.ui.keyCode.RIGHT:
@@ -12010,9 +13057,6 @@ $.widget( "ui.slider", $.ui.mouse, {
 
 			this._slide( event, index, newVal );
 		},
-		click: function( event ) {
-			event.preventDefault();
-		},
 		keyup: function( event ) {
 			var index = $( event.target ).data( "ui-slider-handle-index" );
 
@@ -12024,22 +13068,23 @@ $.widget( "ui.slider", $.ui.mouse, {
 			}
 		}
 	}
-
 });
 
-}(jQuery));
-(function( $, undefined ) {
 
-function isOverAxis( x, reference, size ) {
-	return ( x > reference ) && ( x < ( reference + size ) );
-}
+/*!
+ * jQuery UI Sortable 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/sortable/
+ */
 
-function isFloating(item) {
-	return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
-}
 
-$.widget("ui.sortable", $.ui.mouse, {
-	version: "1.10.4",
+var sortable = $.widget("ui.sortable", $.ui.mouse, {
+	version: "1.11.0",
 	widgetEventPrefix: "sort",
 	ready: false,
 	options: {
@@ -12080,6 +13125,15 @@ $.widget("ui.sortable", $.ui.mouse, {
 		stop: null,
 		update: null
 	},
+
+	_isOverAxis: function( x, reference, size ) {
+		return ( x >= reference ) && ( x < ( reference + size ) );
+	},
+
+	_isFloating: function( item ) {
+		return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
+	},
+
 	_create: function() {
 
 		var o = this.options;
@@ -12090,7 +13144,7 @@ $.widget("ui.sortable", $.ui.mouse, {
 		this.refresh();
 
 		//Let's determine if the items are being displayed horizontally
-		this.floating = this.items.length ? o.axis === "x" || isFloating(this.items[0].item) : false;
+		this.floating = this.items.length ? o.axis === "x" || this._isFloating(this.items[0].item) : false;
 
 		//Let's determine the parent's offset
 		this.offset = this.element.offset();
@@ -12098,14 +13152,35 @@ $.widget("ui.sortable", $.ui.mouse, {
 		//Initialize mouse events for interaction
 		this._mouseInit();
 
+		this._setHandleClassName();
+
 		//We're ready to go
 		this.ready = true;
 
 	},
 
+	_setOption: function( key, value ) {
+		this._super( key, value );
+
+		if ( key === "handle" ) {
+			this._setHandleClassName();
+		}
+	},
+
+	_setHandleClassName: function() {
+		this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" );
+		$.each( this.items, function() {
+			( this.instance.options.handle ?
+				this.item.find( this.instance.options.handle ) : this.item )
+				.addClass( "ui-sortable-handle" );
+		});
+	},
+
 	_destroy: function() {
 		this.element
-			.removeClass("ui-sortable ui-sortable-disabled");
+			.removeClass( "ui-sortable ui-sortable-disabled" )
+			.find( ".ui-sortable-handle" )
+				.removeClass( "ui-sortable-handle" );
 		this._mouseDestroy();
 
 		for ( var i = this.items.length - 1; i >= 0; i-- ) {
@@ -12115,17 +13190,6 @@ $.widget("ui.sortable", $.ui.mouse, {
 		return this;
 	},
 
-	_setOption: function(key, value){
-		if ( key === "disabled" ) {
-			this.options[ key ] = value;
-
-			this.widget().toggleClass( "ui-sortable-disabled", !!value );
-		} else {
-			// Don't call widget base _setOption for disable as it adds ui-state-disabled class
-			$.Widget.prototype._setOption.apply(this, arguments);
-		}
-	},
-
 	_mouseCapture: function(event, overrideHandle) {
 		var currentItem = null,
 			validHandle = false,
@@ -12385,7 +13449,7 @@ $.widget("ui.sortable", $.ui.mouse, {
 			// currentContainer is switched before the placeholder is moved.
 			//
 			// Without this, moving items in "sub-sortables" can cause
-			// the placeholder to jitter beetween the outer and inner container.
+			// the placeholder to jitter between the outer and inner container.
 			if (item.instance !== this.currentContainer) {
 				continue;
 			}
@@ -12580,8 +13644,8 @@ $.widget("ui.sortable", $.ui.mouse, {
 
 	_intersectsWithPointer: function(item) {
 
-		var isOverElementHeight = (this.options.axis === "x") || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
-			isOverElementWidth = (this.options.axis === "y") || isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
+		var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
+			isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
 			isOverElement = isOverElementHeight && isOverElementWidth,
 			verticalDirection = this._getDragVerticalDirection(),
 			horizontalDirection = this._getDragHorizontalDirection();
@@ -12598,8 +13662,8 @@ $.widget("ui.sortable", $.ui.mouse, {
 
 	_intersectsWithSides: function(item) {
 
-		var isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
-			isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
+		var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
+			isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
 			verticalDirection = this._getDragVerticalDirection(),
 			horizontalDirection = this._getDragHorizontalDirection();
 
@@ -12623,6 +13687,7 @@ $.widget("ui.sortable", $.ui.mouse, {
 
 	refresh: function(event) {
 		this._refreshItems(event);
+		this._setHandleClassName();
 		this.refreshPositions();
 		return this;
 	},
@@ -12758,7 +13823,7 @@ $.widget("ui.sortable", $.ui.mouse, {
 				p = this.containers[i].element.offset();
 				this.containers[i].containerCache.left = p.left;
 				this.containers[i].containerCache.top = p.top;
-				this.containers[i].containerCache.width	= this.containers[i].element.outerWidth();
+				this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
 				this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
 			}
 		}
@@ -12824,7 +13889,7 @@ $.widget("ui.sortable", $.ui.mouse, {
 	},
 
 	_contactContainers: function(event) {
-		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating,
+		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
 			innermostContainer = null,
 			innermostIndex = null;
 
@@ -12872,10 +13937,11 @@ $.widget("ui.sortable", $.ui.mouse, {
 			//When entering a new container, we will find the item with the least distance and append our item near it
 			dist = 10000;
 			itemWithLeastDistance = null;
-			floating = innermostContainer.floating || isFloating(this.currentItem);
+			floating = innermostContainer.floating || this._isFloating(this.currentItem);
 			posProperty = floating ? "left" : "top";
 			sizeProperty = floating ? "width" : "height";
-			base = this.positionAbs[posProperty] + this.offset.click[posProperty];
+			axis = floating ? "clientX" : "clientY";
+
 			for (j = this.items.length - 1; j >= 0; j--) {
 				if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
 					continue;
@@ -12883,18 +13949,16 @@ $.widget("ui.sortable", $.ui.mouse, {
 				if(this.items[j].item[0] === this.currentItem[0]) {
 					continue;
 				}
-				if (floating && !isOverAxis(this.positionAbs.top + this.offset.click.top, this.items[j].top, this.items[j].height)) {
-					continue;
-				}
+
 				cur = this.items[j].item.offset()[posProperty];
 				nearBottom = false;
-				if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){
+				if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
 					nearBottom = true;
-					cur += this.items[j][sizeProperty];
 				}
 
-				if(Math.abs(cur - base) < dist) {
-					dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
+				if ( Math.abs( event[ axis ] - cur ) < dist ) {
+					dist = Math.abs( event[ axis ] - cur );
+					itemWithLeastDistance = this.items[ j ];
 					this.direction = nearBottom ? "up": "down";
 				}
 			}
@@ -13301,10 +14365,20 @@ $.widget("ui.sortable", $.ui.mouse, {
 
 });
 
-})(jQuery);
-(function( $ ) {
 
-function modifier( fn ) {
+/*!
+ * jQuery UI Spinner 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/spinner/
+ */
+
+
+function spinner_modifier( fn ) {
 	return function() {
 		var previous = this.element.val();
 		fn.apply( this, arguments );
@@ -13315,8 +14389,8 @@ function modifier( fn ) {
 	};
 }
 
-$.widget( "ui.spinner", {
-	version: "1.10.4",
+var spinner = $.widget( "ui.spinner", {
+	version: "1.11.0",
 	defaultElement: "<input>",
 	widgetEventPrefix: "spin",
 	options: {
@@ -13590,7 +14664,7 @@ $.widget( "ui.spinner", {
 		if ( incremental ) {
 			return $.isFunction( incremental ) ?
 				incremental( i ) :
-				Math.floor( i*i*i/50000 - i*i/500 + 17*i/200 + 1 );
+				Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
 		}
 
 		return 1;
@@ -13674,19 +14748,14 @@ $.widget( "ui.spinner", {
 		this._super( key, value );
 
 		if ( key === "disabled" ) {
-			if ( value ) {
-				this.element.prop( "disabled", true );
-				this.buttons.button( "disable" );
-			} else {
-				this.element.prop( "disabled", false );
-				this.buttons.button( "enable" );
-			}
+			this.widget().toggleClass( "ui-state-disabled", !!value );
+			this.element.prop( "disabled", !!value );
+			this.buttons.button( value ? "disable" : "enable" );
 		}
 	},
 
-	_setOptions: modifier(function( options ) {
+	_setOptions: spinner_modifier(function( options ) {
 		this._super( options );
-		this._value( this.element.val() );
 	}),
 
 	_parse: function( val ) {
@@ -13715,6 +14784,18 @@ $.widget( "ui.spinner", {
 		});
 	},
 
+	isValid: function() {
+		var value = this.value();
+
+		// null is invalid
+		if ( value === null ) {
+			return false;
+		}
+
+		// if value gets adjusted, it's invalid
+		return value === this._adjustValue( value );
+	},
+
 	// update the value without triggering change
 	_value: function( value, allowAny ) {
 		var parsed;
@@ -13743,7 +14824,7 @@ $.widget( "ui.spinner", {
 		this.uiSpinner.replaceWith( this.element );
 	},
 
-	stepUp: modifier(function( steps ) {
+	stepUp: spinner_modifier(function( steps ) {
 		this._stepUp( steps );
 	}),
 	_stepUp: function( steps ) {
@@ -13753,7 +14834,7 @@ $.widget( "ui.spinner", {
 		}
 	},
 
-	stepDown: modifier(function( steps ) {
+	stepDown: spinner_modifier(function( steps ) {
 		this._stepDown( steps );
 	}),
 	_stepDown: function( steps ) {
@@ -13763,11 +14844,11 @@ $.widget( "ui.spinner", {
 		}
 	},
 
-	pageUp: modifier(function( pages ) {
+	pageUp: spinner_modifier(function( pages ) {
 		this._stepUp( (pages || 1) * this.options.page );
 	}),
 
-	pageDown: modifier(function( pages ) {
+	pageDown: spinner_modifier(function( pages ) {
 		this._stepDown( (pages || 1) * this.options.page );
 	}),
 
@@ -13775,7 +14856,7 @@ $.widget( "ui.spinner", {
 		if ( !arguments.length ) {
 			return this._parse( this.element.val() );
 		}
-		modifier( this._value ).call( this, newVal );
+		spinner_modifier( this._value ).call( this, newVal );
 	},
 
 	widget: function() {
@@ -13783,28 +14864,21 @@ $.widget( "ui.spinner", {
 	}
 });
 
-}( jQuery ) );
-(function( $, undefined ) {
-
-var tabId = 0,
-	rhash = /#.*$/;
-
-function getNextTabId() {
-	return ++tabId;
-}
 
-function isLocal( anchor ) {
-	// support: IE7
-	// IE7 doesn't normalize the href property when set via script (#9317)
-	anchor = anchor.cloneNode( false );
+/*!
+ * jQuery UI Tabs 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/tabs/
+ */
 
-	return anchor.hash.length > 1 &&
-		decodeURIComponent( anchor.href.replace( rhash, "" ) ) ===
-			decodeURIComponent( location.href.replace( rhash, "" ) );
-}
 
-$.widget( "ui.tabs", {
-	version: "1.10.4",
+var tabs = $.widget( "ui.tabs", {
+	version: "1.11.0",
 	delay: 300,
 	options: {
 		active: null,
@@ -13821,6 +14895,31 @@ $.widget( "ui.tabs", {
 		load: null
 	},
 
+	_isLocal: (function() {
+		var rhash = /#.*$/;
+
+		return function( anchor ) {
+			var anchorUrl, locationUrl;
+
+			// support: IE7
+			// IE7 doesn't normalize the href property when set via script (#9317)
+			anchor = anchor.cloneNode( false );
+
+			anchorUrl = anchor.href.replace( rhash, "" );
+			locationUrl = location.href.replace( rhash, "" );
+
+			// decoding may throw an error if the URL isn't UTF-8 (#9518)
+			try {
+				anchorUrl = decodeURIComponent( anchorUrl );
+			} catch ( error ) {}
+			try {
+				locationUrl = decodeURIComponent( locationUrl );
+			} catch ( error ) {}
+
+			return anchor.hash.length > 1 && anchorUrl === locationUrl;
+		};
+	})(),
+
 	_create: function() {
 		var that = this,
 			options = this.options;
@@ -14068,10 +15167,6 @@ $.widget( "ui.tabs", {
 		}
 	},
 
-	_tabId: function( tab ) {
-		return tab.attr( "aria-controls" ) || "ui-tabs-" + getNextTabId();
-	},
-
 	_sanitizeSelector: function( hash ) {
 		return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
 	},
@@ -14118,12 +15213,12 @@ $.widget( "ui.tabs", {
 
 		this.tabs.not( this.active ).attr({
 			"aria-selected": "false",
+			"aria-expanded": "false",
 			tabIndex: -1
 		});
 		this.panels.not( this._getPanelForTab( this.active ) )
 			.hide()
 			.attr({
-				"aria-expanded": "false",
 				"aria-hidden": "true"
 			});
 
@@ -14135,12 +15230,12 @@ $.widget( "ui.tabs", {
 				.addClass( "ui-tabs-active ui-state-active" )
 				.attr({
 					"aria-selected": "true",
+					"aria-expanded": "true",
 					tabIndex: 0
 				});
 			this._getPanelForTab( this.active )
 				.show()
 				.attr({
-					"aria-expanded": "true",
 					"aria-hidden": "false"
 				});
 		}
@@ -14178,12 +15273,15 @@ $.widget( "ui.tabs", {
 				originalAriaControls = tab.attr( "aria-controls" );
 
 			// inline tab
-			if ( isLocal( anchor ) ) {
+			if ( that._isLocal( anchor ) ) {
 				selector = anchor.hash;
+				panelId = selector.substring( 1 );
 				panel = that.element.find( that._sanitizeSelector( selector ) );
 			// remote tab
 			} else {
-				panelId = that._tabId( tab );
+				// If the tab doesn't already have aria-controls,
+				// generate an id by using a throw-away element
+				panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
 				selector = "#" + panelId;
 				panel = that.element.find( selector );
 				if ( !panel.length ) {
@@ -14200,7 +15298,7 @@ $.widget( "ui.tabs", {
 				tab.data( "ui-tabs-aria-controls", originalAriaControls );
 			}
 			tab.attr({
-				"aria-controls": selector.substring( 1 ),
+				"aria-controls": panelId,
 				"aria-labelledby": anchorId
 			});
 			panel.attr( "aria-labelledby", anchorId );
@@ -14249,11 +15347,7 @@ $.widget( "ui.tabs", {
 	},
 
 	_setupEvents: function( event ) {
-		var events = {
-			click: function( event ) {
-				event.preventDefault();
-			}
-		};
+		var events = {};
 		if ( event ) {
 			$.each( event.split(" "), function( index, eventName ) {
 				events[ eventName ] = "_eventHandler";
@@ -14261,6 +15355,12 @@ $.widget( "ui.tabs", {
 		}
 
 		this._off( this.anchors.add( this.tabs ).add( this.panels ) );
+		// Always prevent the default action, even when disabled
+		this._on( true, this.anchors, {
+			click: function( event ) {
+				event.preventDefault();
+			}
+		});
 		this._on( this.anchors, events );
 		this._on( this.tabs, { keydown: "_tabKeydown" } );
 		this._on( this.panels, { keydown: "_panelKeydown" } );
@@ -14387,11 +15487,11 @@ $.widget( "ui.tabs", {
 			show();
 		}
 
-		toHide.attr({
-			"aria-expanded": "false",
-			"aria-hidden": "true"
+		toHide.attr( "aria-hidden", "true" );
+		eventData.oldTab.attr({
+			"aria-selected": "false",
+			"aria-expanded": "false"
 		});
-		eventData.oldTab.attr( "aria-selected", "false" );
 		// If we're switching tabs, remove the old tab from the tab order.
 		// If we're opening from collapsed state, remove the previous tab from the tab order.
 		// If we're collapsing, then keep the collapsing tab in the tab order.
@@ -14404,12 +15504,10 @@ $.widget( "ui.tabs", {
 			.attr( "tabIndex", -1 );
 		}
 
-		toShow.attr({
-			"aria-expanded": "true",
-			"aria-hidden": "false"
-		});
+		toShow.attr( "aria-hidden", "false" );
 		eventData.newTab.attr({
 			"aria-selected": "true",
+			"aria-expanded": "true",
 			tabIndex: 0
 		});
 	},
@@ -14560,7 +15658,7 @@ $.widget( "ui.tabs", {
 			};
 
 		// not remote
-		if ( isLocal( anchor[ 0 ] ) ) {
+		if ( this._isLocal( anchor[ 0 ] ) ) {
 			return;
 		}
 
@@ -14607,7 +15705,7 @@ $.widget( "ui.tabs", {
 			url: anchor.attr( "href" ),
 			beforeSend: function( jqXHR, settings ) {
 				return that._trigger( "beforeLoad", event,
-					$.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) );
+					$.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
 			}
 		};
 	},
@@ -14618,38 +15716,21 @@ $.widget( "ui.tabs", {
 	}
 });
 
-})( jQuery );
-(function( $ ) {
-
-var increments = 0;
-
-function addDescribedBy( elem, id ) {
-	var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ );
-	describedby.push( id );
-	elem
-		.data( "ui-tooltip-id", id )
-		.attr( "aria-describedby", $.trim( describedby.join( " " ) ) );
-}
 
-function removeDescribedBy( elem ) {
-	var id = elem.data( "ui-tooltip-id" ),
-		describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ),
-		index = $.inArray( id, describedby );
-	if ( index !== -1 ) {
-		describedby.splice( index, 1 );
-	}
+/*!
+ * jQuery UI Tooltip 1.11.0
+ * http://jqueryui.com
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/tooltip/
+ */
 
-	elem.removeData( "ui-tooltip-id" );
-	describedby = $.trim( describedby.join( " " ) );
-	if ( describedby ) {
-		elem.attr( "aria-describedby", describedby );
-	} else {
-		elem.removeAttr( "aria-describedby" );
-	}
-}
 
-$.widget( "ui.tooltip", {
-	version: "1.10.4",
+var tooltip = $.widget( "ui.tooltip", {
+	version: "1.11.0",
 	options: {
 		content: function() {
 			// support: IE<9, Opera in jQuery <1.7
@@ -14675,6 +15756,32 @@ $.widget( "ui.tooltip", {
 		open: null
 	},
 
+	_addDescribedBy: function( elem, id ) {
+		var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ );
+		describedby.push( id );
+		elem
+			.data( "ui-tooltip-id", id )
+			.attr( "aria-describedby", $.trim( describedby.join( " " ) ) );
+	},
+
+	_removeDescribedBy: function( elem ) {
+		var id = elem.data( "ui-tooltip-id" ),
+			describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ),
+			index = $.inArray( id, describedby );
+
+		if ( index !== -1 ) {
+			describedby.splice( index, 1 );
+		}
+
+		elem.removeData( "ui-tooltip-id" );
+		describedby = $.trim( describedby.join( " " ) );
+		if ( describedby ) {
+			elem.attr( "aria-describedby", describedby );
+		} else {
+			elem.removeAttr( "aria-describedby" );
+		}
+	},
+
 	_create: function() {
 		this._on({
 			mouseover: "open",
@@ -14689,6 +15796,16 @@ $.widget( "ui.tooltip", {
 		if ( this.options.disabled ) {
 			this._disable();
 		}
+
+		// Append the aria-live region so tooltips announce correctly
+		this.liveRegion = $( "<div>" )
+			.attr({
+				role: "log",
+				"aria-live": "assertive",
+				"aria-relevant": "additions"
+			})
+			.addClass( "ui-helper-hidden-accessible" )
+			.appendTo( this.document[ 0 ].body );
 	},
 
 	_setOption: function( key, value ) {
@@ -14726,7 +15843,7 @@ $.widget( "ui.tooltip", {
 			if ( element.is( "[title]" ) ) {
 				element
 					.data( "ui-tooltip-title", element.attr( "title" ) )
-					.attr( "title", "" );
+					.removeAttr( "title" );
 			}
 		});
 	},
@@ -14818,7 +15935,7 @@ $.widget( "ui.tooltip", {
 	},
 
 	_open: function( event, target, content ) {
-		var tooltip, events, delayedShow,
+		var tooltip, events, delayedShow, a11yContent,
 			positionOption = $.extend( {}, this.options.position );
 
 		if ( !content ) {
@@ -14849,9 +15966,21 @@ $.widget( "ui.tooltip", {
 		}
 
 		tooltip = this._tooltip( target );
-		addDescribedBy( target, tooltip.attr( "id" ) );
+		this._addDescribedBy( target, tooltip.attr( "id" ) );
 		tooltip.find( ".ui-tooltip-content" ).html( content );
 
+		// Support: Voiceover on OS X, JAWS on IE <= 9
+		// JAWS announces deletions even when aria-relevant="additions"
+		// Voiceover will sometimes re-read the entire log region's contents from the beginning
+		this.liveRegion.children().hide();
+		if ( content.clone ) {
+			a11yContent = content.clone();
+			a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
+		} else {
+			a11yContent = content;
+		}
+		$( "<div>" ).html( a11yContent ).appendTo( this.liveRegion );
+
 		function position( event ) {
 			positionOption.of = event;
 			if ( tooltip.is( ":hidden" ) ) {
@@ -14895,11 +16024,17 @@ $.widget( "ui.tooltip", {
 					fakeEvent.currentTarget = target[0];
 					this.close( fakeEvent, true );
 				}
-			},
-			remove: function() {
-				this._removeTooltip( tooltip );
 			}
 		};
+
+		// Only bind remove handler for delegated targets. Non-delegated
+		// tooltips will handle this in destroy.
+		if ( target[ 0 ] !== this.element[ 0 ] ) {
+			events.remove = function() {
+				this._removeTooltip( tooltip );
+			};
+		}
+
 		if ( !event || event.type === "mouseover" ) {
 			events.mouseleave = "close";
 		}
@@ -14924,11 +16059,12 @@ $.widget( "ui.tooltip", {
 		clearInterval( this.delayedShow );
 
 		// only set title if we had one before (see comment in _open())
-		if ( target.data( "ui-tooltip-title" ) ) {
+		// If the title attribute has changed since open(), don't restore
+		if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
 			target.attr( "title", target.data( "ui-tooltip-title" ) );
 		}
 
-		removeDescribedBy( target );
+		this._removeDescribedBy( target );
 
 		tooltip.stop( true );
 		this._hide( tooltip, this.options.hide, function() {
@@ -14937,8 +16073,9 @@ $.widget( "ui.tooltip", {
 
 		target.removeData( "ui-tooltip-open" );
 		this._off( target, "mouseleave focusout keyup" );
+
 		// Remove 'remove' binding only on delegated targets
-		if ( target[0] !== this.element[0] ) {
+		if ( target[ 0 ] !== this.element[ 0 ] ) {
 			this._off( target, "remove" );
 		}
 		this._off( this.document, "mousemove" );
@@ -14956,17 +16093,16 @@ $.widget( "ui.tooltip", {
 	},
 
 	_tooltip: function( element ) {
-		var id = "ui-tooltip-" + increments++,
-			tooltip = $( "<div>" )
-				.attr({
-					id: id,
-					role: "tooltip"
-				})
+		var tooltip = $( "<div>" )
+				.attr( "role", "tooltip" )
 				.addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
-					( this.options.tooltipClass || "" ) );
+					( this.options.tooltipClass || "" ) ),
+			id = tooltip.uniqueId().attr( "id" );
+
 		$( "<div>" )
 			.addClass( "ui-tooltip-content" )
 			.appendTo( tooltip );
+
 		tooltip.appendTo( this.document[0].body );
 		this.tooltips[ id ] = element;
 		return tooltip;
@@ -14998,11 +16134,17 @@ $.widget( "ui.tooltip", {
 
 			// Restore the title
 			if ( element.data( "ui-tooltip-title" ) ) {
-				element.attr( "title", element.data( "ui-tooltip-title" ) );
+				// If the title attribute has changed since open(), don't restore
+				if ( !element.attr( "title" ) ) {
+					element.attr( "title", element.data( "ui-tooltip-title" ) );
+				}
 				element.removeData( "ui-tooltip-title" );
 			}
 		});
+		this.liveRegion.remove();
 	}
 });
 
-}( jQuery ) );
+
+
+}));
\ No newline at end of file
diff --git a/lib/scripts/jquery/jquery-ui.min.js b/lib/scripts/jquery/jquery-ui.min.js
index 862d0911b8052a0925ff774de3add1ef4f6a9ee3..b2fdf864ae214f18bd1bf566df3738843f04d654 100644
--- a/lib/scripts/jquery/jquery-ui.min.js
+++ b/lib/scripts/jquery/jquery-ui.min.js
@@ -1,7 +1,13 @@
-/*! jQuery UI - v1.10.4 - 2014-01-17
+/*! jQuery UI - v1.11.0 - 2014-06-26
 * http://jqueryui.com
-* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.slider.js, jquery.ui.sortable.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
+* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
 * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
 
-(function(e,t){function i(t,i){var s,a,o,r=t.nodeName.toLowerCase();return"area"===r?(s=t.parentNode,a=s.name,t.href&&a&&"map"===s.nodeName.toLowerCase()?(o=e("img[usemap=#"+a+"]")[0],!!o&&n(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var n,s,a=e(this[0]);a.length&&a[0]!==document;){if(n=a.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){a.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?r["inner"+n].call(this):this.each(function(){e(this).css(o,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each(function(){e(this).css(o,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var s,a=e.ui[t].prototype;for(s in n)a.plugins[s]=a.plugins[s]||[],a.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;s.length>n;n++)e.options[s[n][0]]&&s[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,l=Math.round,h=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,g,m,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),k=t.position.getScrollInfo(y),w=(e.collision||"flip").split(" "),D={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,g=_.height,m=_.offset,v=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),D[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=g:"center"===e.at[1]&&(v.top+=g/2),a=i(D.at,p,g),v.left+=a[0],v.top+=a[1],this.each(function(){var n,h,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),x=u+f+s(this,"marginRight")+k.width,C=d+_+s(this,"marginBottom")+k.height,M=t.extend({},v),T=i(D.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?M.left-=u:"center"===e.my[0]&&(M.left-=u/2),"bottom"===e.my[1]?M.top-=d:"center"===e.my[1]&&(M.top-=d/2),M.left+=T[0],M.top+=T[1],t.support.offsetFractions||(M.left=l(M.left),M.top=l(M.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[w[i]]&&t.ui.position[w[i]][s](M,{targetWidth:p,targetHeight:g,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:x,collisionHeight:C,offset:[a[0]+T[0],a[1]+T[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(h=function(t){var i=m.left-M.left,s=i+p-u,n=m.top-M.top,a=n+g-d,l={target:{element:b,left:m.left,top:m.top,width:p,height:g},element:{element:c,left:M.left,top:M.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(l.horizontal="center"),d>g&&g>r(n+a)&&(l.vertical="middle"),l.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,l)}),c.offset(t.extend(M,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-o-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-o-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-o-a,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(e){var t=0,i={},a={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",a.height=a.paddingTop=a.paddingBottom=a.borderTopWidth=a.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e(),content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),undefined):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t),undefined)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,a=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:n=this.headers[(s+1)%a];break;case i.LEFT:case i.UP:n=this.headers[(s-1+a)%a];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:n=this.headers[0];break;case i.END:n=this.headers[a-1]}n&&(e(t.target).attr("tabIndex",-1),e(n).attr("tabIndex",0),n.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,a=this.options,s=a.heightStyle,n=this.element.parent(),r=this.accordionId="ui-accordion-"+(this.element.attr("id")||++t);this.active=this._findActive(a.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(t){var i=e(this),a=i.attr("id"),s=i.next(),n=s.attr("id");a||(a=r+"-header-"+t,i.attr("id",a)),n||(n=r+"-panel-"+t,s.attr("id",n)),i.attr("aria-controls",n),s.attr("aria-labelledby",a)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(a.event),"fill"===s?(i=n.height(),this.element.siblings(":visible").each(function(){var t=e(this),a=t.css("position");"absolute"!==a&&"fixed"!==a&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(i=0,this.headers.next().each(function(){i=Math.max(i,e(this).css("height","").height())}).height(i))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,a=this.active,s=e(t.currentTarget),n=s[0]===a[0],r=n&&i.collapsible,o=r?e():s.next(),h=a.next(),d={oldHeader:a,oldPanel:h,newHeader:r?e():s,newPanel:o};t.preventDefault(),n&&!i.collapsible||this._trigger("beforeActivate",t,d)===!1||(i.active=r?!1:this.headers.index(s),this.active=n?e():s,this._toggle(d),a.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&a.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),n||(s.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),s.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,a=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=a,this.options.animate?this._animate(i,a,t):(a.hide(),i.show(),this._toggleComplete(t)),a.attr({"aria-hidden":"true"}),a.prev().attr("aria-selected","false"),i.length&&a.length?a.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(e,t,s){var n,r,o,h=this,d=0,c=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},u=c&&l.down||l,v=function(){h._toggleComplete(s)};return"number"==typeof u&&(o=u),"string"==typeof u&&(r=u),r=r||u.easing||l.easing,o=o||u.duration||l.duration,t.length?e.length?(n=e.show().outerHeight(),t.animate(i,{duration:o,easing:r,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(a,{duration:o,easing:r,complete:v,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?d+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(n-t.outerHeight()-d),d=0)}}),undefined):t.animate(i,o,r,v):e.animate(a,o,r,v)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})})(jQuery);(function(e){e.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,undefined;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:s})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):undefined},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(e){var t,i="ui-button ui-widget ui-state-default ui-corner-all",n="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",s=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},a=function(t){var i=t.name,n=t.form,s=e([]);return i&&(i=i.replace(/'/g,"\\'"),s=n?e(n).find("[name='"+i+"']"):e("[name='"+i+"']",t.ownerDocument).filter(function(){return!this.form})),s};e.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,s),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var n=this,o=this.options,r="checkbox"===this.type||"radio"===this.type,h=r?"":"ui-state-active";null===o.label&&(o.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){o.disabled||this===t&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){o.disabled||e(this).removeClass(h)}).bind("click"+this.eventNamespace,function(e){o.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){n.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return o.disabled?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(o.disabled)return!1;e(this).addClass("ui-state-active"),n.buttonElement.attr("aria-pressed","true");var t=n.element[0];a(t).not(t).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return o.disabled?!1:(e(this).addClass("ui-state-active"),t=this,n.document.one("mouseup",function(){t=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return o.disabled?!1:(e(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(t){return o.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",o.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(i+" ui-state-active "+n).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.element.prop("disabled",!!t),t&&this.buttonElement.removeClass("ui-state-focus"),undefined):(this._resetButton(),undefined)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?a(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var t=this.buttonElement.removeClass(n),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,a=s.primary&&s.secondary,o=[];s.primary||s.secondary?(this.options.text&&o.push("ui-button-text-icon"+(a?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(o.push(a?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):o.push("ui-button-text-only"),t.addClass(o.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(e,t){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(n.inline?t.parent()[0]:n.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function s(t,i){e.extend(t,i);for(var a in i)null==i[a]&&(t[a]=i[a]);return t}e.extend(e.ui,{datepicker:{version:"1.10.4"}});var n,r="datepicker";e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return s(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var a,s,n;a=t.nodeName.toLowerCase(),s="div"===a||"span"===a,t.id||(this.uuid+=1,t.id="dp"+this.uuid),n=this._newInst(e(t),s),n.settings=e.extend({},i||{}),"input"===a?this._connectDatepicker(t,n):s&&this._inlineDatepicker(t,n)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var a=e(t);i.append=e([]),i.trigger=e([]),a.hasClass(this.markerClassName)||(this._attachments(a,i),a.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,r,i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var a,s,n,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=e("<span class='"+this._appendClass+"'>"+r+"</span>"),t[o?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),a=this._get(i,"showOn"),("focus"===a||"both"===a)&&t.focus(this._showDatepicker),("button"===a||"both"===a)&&(s=this._get(i,"buttonText"),n=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:n,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(n?e("<img/>").attr({src:n,alt:s,title:s}):s)),t[o?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,a,s,n=new Date(2009,11,20),r=this._get(e,"dateFormat");r.match(/[DM]/)&&(t=function(e){for(i=0,a=0,s=0;e.length>s;s++)e[s].length>i&&(i=e[s].length,a=s);return a},n.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length)}},_inlineDatepicker:function(t,i){var a=e(t);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(i.dpDiv),e.data(t,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,a,n,o){var u,c,h,l,d,p=this._dialogInst;return p||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],r,p)),s(p.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(c=document.documentElement.clientWidth,h=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[c/2-100+l,h/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(t){var i,a=e(t),s=e.data(t,r);a.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,r),"input"===i?(s.append.remove(),s.trigger.remove(),a.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&a.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,a,n){var r,o,u,c,h=this._getInst(i);return 2===arguments.length&&"string"==typeof a?"defaults"===a?e.extend({},e.datepicker._defaults):h?"all"===a?e.extend({},h.settings):this._get(h,a):null:(r=a||{},"string"==typeof a&&(r={},r[a]=n),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),u=this._getMinMaxDate(h,"min"),c=this._getMinMaxDate(h,"max"),s(h.settings,r),null!==u&&r.dateFormat!==t&&r.minDate===t&&(h.settings.minDate=this._formatDate(h,u)),null!==c&&r.dateFormat!==t&&r.maxDate===t&&(h.settings.maxDate=this._formatDate(h,c)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(e(i),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h)),t)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,a,s,n=e.datepicker._getInst(t.target),r=!0,o=n.dpDiv.is(".ui-datepicker-rtl");if(n._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),r=!1;break;case 13:return s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",n.dpDiv),s[0]&&e.datepicker._selectDay(t.target,n.selectedMonth,n.selectedYear,s[0]),i=e.datepicker._get(n,"onSelect"),i?(a=e.datepicker._formatDate(n),i.apply(n.input?n.input[0]:null,[a,n])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(i){var a,s,n=e.datepicker._getInst(i.target);return e.datepicker._get(n,"constrainInput")?(a=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">s||!a||a.indexOf(s)>-1):t},_doKeyUp:function(t){var i,a=e.datepicker._getInst(t.target);if(a.input.val()!==a.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,e.datepicker._getFormatConfig(a)),i&&(e.datepicker._setDateFromField(a),e.datepicker._updateAlternate(a),e.datepicker._updateDatepicker(a))}catch(s){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,a,n,r,o,u,c;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),a=e.datepicker._get(i,"beforeShow"),n=a?a.apply(t,[t,i]):{},n!==!1&&(s(i.settings,n),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),o={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),o=e.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(u=e.datepicker._get(i,"showAnim"),c=e.datepicker._get(i,"duration"),i.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[u]?i.dpDiv.show(u,e.datepicker._get(i,"showOptions"),c):i.dpDiv[u||"show"](u?c:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,n=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,a=this._getNumberOfMonths(t),s=a[1],r=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",r*s+"em"),t.dpDiv[(1!==a[0]||1!==a[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,a){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),r=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,u=document.documentElement.clientWidth+(a?0:e(document).scrollLeft()),c=document.documentElement.clientHeight+(a?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?s-r:0,i.left-=a&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=a&&i.top===t.input.offset().top+o?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>u&&u>s?Math.abs(i.left+s-u):0),i.top-=Math.min(i.top,i.top+n>c&&c>n?Math.abs(n+o):0),i},_findPos:function(t){for(var i,a=this._getInst(t),s=this._get(a,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,a,s,n,o=this._curInst;!o||t&&o!==e.data(t,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),a=this._get(o,"duration"),s=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),a,s):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?a:null,s),i||s(),this._datepickerShowing=!1,n=this._get(o,"onClose"),n&&n.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),a=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==a)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,a){var s=e(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,i+("M"===a?this._get(n,"showCurrentAtPos"):0),a),this._updateDatepicker(n))},_gotoToday:function(t){var i,a=e(t),s=this._getInst(a[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(a)},_selectMonthYear:function(t,i,a){var s=e(t),n=this._getInst(s[0]);n["selected"+("M"===a?"Month":"Year")]=n["draw"+("M"===a?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,i,a,s){var n,r=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(n=this._getInst(r[0]),n.selectedDay=n.currentDay=e("a",s).html(),n.selectedMonth=n.currentMonth=i,n.selectedYear=n.currentYear=a,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var a,s=e(t),n=this._getInst(s[0]);i=null!=i?i:this._formatDate(n),n.input&&n.input.val(i),this._updateAlternate(n),a=this._get(n,"onSelect"),a?a.apply(n.input?n.input[0]:null,[i,n]):n.input&&n.input.trigger("change"),n.inline?this._updateDatepicker(n):(this._hideDatepicker(),this._lastInput=n.input[0],"object"!=typeof n.input[0]&&n.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,a,s,n=this._get(t,"altField");n&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),a=this._getDate(t),s=this.formatDate(i,a,this._getFormatConfig(t)),e(n).each(function(){e(this).val(s)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(i,a,s){if(null==i||null==a)throw"Invalid arguments";if(a="object"==typeof a?""+a:a+"",""===a)return null;var n,r,o,u,c=0,h=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,p=(s?s.dayNames:null)||this._defaults.dayNames,g=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,m=(s?s.monthNames:null)||this._defaults.monthNames,f=-1,_=-1,v=-1,k=-1,y=!1,b=function(e){var t=i.length>n+1&&i.charAt(n+1)===e;return t&&n++,t},D=function(e){var t=b(e),i="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s=RegExp("^\\d{1,"+i+"}"),n=a.substring(c).match(s);if(!n)throw"Missing number at position "+c;return c+=n[0].length,parseInt(n[0],10)},w=function(i,s,n){var r=-1,o=e.map(b(i)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,i){var s=i[1];return a.substr(c,s.length).toLowerCase()===s.toLowerCase()?(r=i[0],c+=s.length,!1):t}),-1!==r)return r+1;throw"Unknown name at position "+c},M=function(){if(a.charAt(c)!==i.charAt(n))throw"Unexpected literal at position "+c;c++};for(n=0;i.length>n;n++)if(y)"'"!==i.charAt(n)||b("'")?M():y=!1;else switch(i.charAt(n)){case"d":v=D("d");break;case"D":w("D",d,p);break;case"o":k=D("o");break;case"m":_=D("m");break;case"M":_=w("M",g,m);break;case"y":f=D("y");break;case"@":u=new Date(D("@")),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"!":u=new Date((D("!")-this._ticksTo1970)/1e4),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"'":b("'")?M():y=!0;break;default:M()}if(a.length>c&&(o=a.substr(c),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===f?f=(new Date).getFullYear():100>f&&(f+=(new Date).getFullYear()-(new Date).getFullYear()%100+(l>=f?0:-100)),k>-1)for(_=1,v=k;;){if(r=this._getDaysInMonth(f,_-1),r>=v)break;_++,v-=r}if(u=this._daylightSavingAdjust(new Date(f,_-1,v)),u.getFullYear()!==f||u.getMonth()+1!==_||u.getDate()!==v)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var a,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,n=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,u=function(t){var i=e.length>a+1&&e.charAt(a+1)===t;return i&&a++,i},c=function(e,t,i){var a=""+t;if(u(e))for(;i>a.length;)a="0"+a;return a},h=function(e,t,i,a){return u(e)?a[t]:i[t]},l="",d=!1;if(t)for(a=0;e.length>a;a++)if(d)"'"!==e.charAt(a)||u("'")?l+=e.charAt(a):d=!1;else switch(e.charAt(a)){case"d":l+=c("d",t.getDate(),2);break;case"D":l+=h("D",t.getDay(),s,n);break;case"o":l+=c("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":l+=c("m",t.getMonth()+1,2);break;case"M":l+=h("M",t.getMonth(),r,o);break;case"y":l+=u("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=1e4*t.getTime()+this._ticksTo1970;break;case"'":u("'")?l+="'":d=!0;break;default:l+=e.charAt(a)}return l},_possibleChars:function(e){var t,i="",a=!1,s=function(i){var a=e.length>t+1&&e.charAt(t+1)===i;return a&&t++,a};for(t=0;e.length>t;t++)if(a)"'"!==e.charAt(t)||s("'")?i+=e.charAt(t):a=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":a=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,i){return e.settings[i]!==t?e.settings[i]:this._defaults[i]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),a=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),n=s,r=this._getFormatConfig(e);try{n=this.parseDate(i,a,r)||s}catch(o){a=t?"":a}e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),e.currentDay=a?n.getDate():0,e.currentMonth=a?n.getMonth():0,e.currentYear=a?n.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,a){var s=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},n=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(a){}for(var s=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,n=s.getFullYear(),r=s.getMonth(),o=s.getDate(),u=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,c=u.exec(i);c;){switch(c[2]||"d"){case"d":case"D":o+=parseInt(c[1],10);break;case"w":case"W":o+=7*parseInt(c[1],10);break;case"m":case"M":r+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r));break;case"y":case"Y":n+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r))}c=u.exec(i)}return new Date(n,r,o)},r=null==i||""===i?a:"string"==typeof i?n(i):"number"==typeof i?isNaN(i)?a:s(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?a:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var a=!t,s=e.selectedMonth,n=e.selectedYear,r=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=r.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=r.getMonth(),e.drawYear=e.selectedYear=e.currentYear=r.getFullYear(),s===e.selectedMonth&&n===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(a?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),a="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(a,-i,"M")},next:function(){e.datepicker._adjustDate(a,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(a)},selectDay:function(){return e.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(a,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,a,s,n,r,o,u,c,h,l,d,p,g,m,f,_,v,k,y,b,D,w,M,C,x,I,N,T,A,E,S,Y,F,P,O,j,K,R,H=new Date,W=this._daylightSavingAdjust(new Date(H.getFullYear(),H.getMonth(),H.getDate())),L=this._get(e,"isRTL"),U=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),z=this._get(e,"navigationAsDateFormat"),q=this._getNumberOfMonths(e),G=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),Q=1!==q[0]||1!==q[1],V=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),X=this._getMinMaxDate(e,"max"),Z=e.drawMonth-G,et=e.drawYear;if(0>Z&&(Z+=12,et--),X)for(t=this._daylightSavingAdjust(new Date(X.getFullYear(),X.getMonth()-q[0]*q[1]+1,X.getDate())),t=$&&$>t?$:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=z?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):i,a=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>",s=this._get(e,"nextText"),s=z?this.formatDate(s,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):s,n=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>",r=this._get(e,"currentText"),o=this._get(e,"gotoCurrent")&&e.currentDay?V:W,r=z?this.formatDate(r,o,this._getFormatConfig(e)):r,u=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",c=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(L?u:"")+(this._isInRange(e,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(L?"":u)+"</div>":"",h=parseInt(this._get(e,"firstDay"),10),h=isNaN(h)?0:h,l=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),g=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),f=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),v=this._get(e,"selectOtherMonths"),k=this._getDefaultDate(e),y="",D=0;q[0]>D;D++){for(w="",this.maxRows=4,M=0;q[1]>M;M++){if(C=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),x=" ui-corner-all",I="",Q){if(I+="<div class='ui-datepicker-group",q[1]>1)switch(M){case 0:I+=" ui-datepicker-group-first",x=" ui-corner-"+(L?"right":"left");break;case q[1]-1:I+=" ui-datepicker-group-last",x=" ui-corner-"+(L?"left":"right");break;default:I+=" ui-datepicker-group-middle",x=""}I+="'>"}for(I+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+x+"'>"+(/all|left/.test(x)&&0===D?L?n:a:"")+(/all|right/.test(x)&&0===D?L?a:n:"")+this._generateMonthYearHeader(e,Z,et,$,X,D>0||M>0,g,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=l?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",b=0;7>b;b++)T=(b+h)%7,N+="<th"+((b+h+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[T]+"'>"+p[T]+"</span></th>";for(I+=N+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),E=(this._getFirstDayOfMonth(et,Z)-h+7)%7,S=Math.ceil((E+A)/7),Y=Q?this.maxRows>S?this.maxRows:S:S,this.maxRows=Y,F=this._daylightSavingAdjust(new Date(et,Z,1-E)),P=0;Y>P;P++){for(I+="<tr>",O=l?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(F)+"</td>":"",b=0;7>b;b++)j=f?f.apply(e.input?e.input[0]:null,[F]):[!0,""],K=F.getMonth()!==Z,R=K&&!v||!j[0]||$&&$>F||X&&F>X,O+="<td class='"+((b+h+6)%7>=5?" ui-datepicker-week-end":"")+(K?" ui-datepicker-other-month":"")+(F.getTime()===C.getTime()&&Z===e.selectedMonth&&e._keyEvent||k.getTime()===F.getTime()&&k.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(K&&!_?"":" "+j[1]+(F.getTime()===V.getTime()?" "+this._currentClass:"")+(F.getTime()===W.getTime()?" ui-datepicker-today":""))+"'"+(K&&!_||!j[2]?"":" title='"+j[2].replace(/'/g,"&#39;")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+F.getMonth()+"' data-year='"+F.getFullYear()+"'")+">"+(K&&!_?"&#xa0;":R?"<span class='ui-state-default'>"+F.getDate()+"</span>":"<a class='ui-state-default"+(F.getTime()===W.getTime()?" ui-state-highlight":"")+(F.getTime()===V.getTime()?" ui-state-active":"")+(K?" ui-priority-secondary":"")+"' href='#'>"+F.getDate()+"</a>")+"</td>",F.setDate(F.getDate()+1),F=this._daylightSavingAdjust(F);I+=O+"</tr>"}Z++,Z>11&&(Z=0,et++),I+="</tbody></table>"+(Q?"</div>"+(q[0]>0&&M===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),w+=I}y+=w}return y+=c,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,a,s,n,r,o){var u,c,h,l,d,p,g,m,f=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),v=this._get(e,"showMonthAfterYear"),k="<div class='ui-datepicker-title'>",y="";if(n||!f)y+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(u=a&&a.getFullYear()===i,c=s&&s.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",h=0;12>h;h++)(!u||h>=a.getMonth())&&(!c||s.getMonth()>=h)&&(y+="<option value='"+h+"'"+(h===t?" selected='selected'":"")+">"+o[h]+"</option>");y+="</select>"}if(v||(k+=y+(!n&&f&&_?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",n||!_)k+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(l=this._get(e,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?d+parseInt(e,10):parseInt(e,10);
-return isNaN(t)?d:t},g=p(l[0]),m=Math.max(g,p(l[1]||"")),g=a?Math.max(g,a.getFullYear()):g,m=s?Math.min(m,s.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=g;g++)e.yearshtml+="<option value='"+g+"'"+(g===i?" selected='selected'":"")+">"+g+"</option>";e.yearshtml+="</select>",k+=e.yearshtml,e.yearshtml=null}return k+=this._get(e,"yearSuffix"),v&&(k+=(!n&&f&&_?"":"&#xa0;")+y),k+="</div>"},_adjustInstDate:function(e,t,i){var a=e.drawYear+("Y"===i?t:0),s=e.drawMonth+("M"===i?t:0),n=Math.min(e.selectedDay,this._getDaysInMonth(a,s))+("D"===i?t:0),r=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(a,s,n)));e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),s=i&&i>t?i:t;return a&&s>a?a:s},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,a){var s=this._getNumberOfMonths(e),n=this._daylightSavingAdjust(new Date(i,a+(0>t?t:s[0]*s[1]),1));return 0>t&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(e,n)},_isInRange:function(e,t){var i,a,s=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=null,o=null,u=this._get(e,"yearRange");return u&&(i=u.split(":"),a=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=a),i[1].match(/[+\-].*/)&&(o+=a)),(!s||t.getTime()>=s.getTime())&&(!n||t.getTime()<=n.getTime())&&(!r||t.getFullYear()>=r)&&(!o||o>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,a){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(a,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.4"})(jQuery);(function(e){var t={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,a=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(s){}this._hide(this.uiDialog,this.options.hide,function(){a._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!t&&this._trigger("focus",e),i},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),undefined;if(t.keyCode===e.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),a=i.filter(":first"),s=i.filter(":last");t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==a[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(s.focus(1),t.preventDefault()):(a.focus(1),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(e.each(i,function(i,a){var s,n;a=e.isFunction(a)?{click:a,text:i}:a,a=e.extend({type:"button"},a),s=a.click,a.click=function(){s.apply(t.element[0],arguments)},n={icons:a.icons,text:a.showText},delete a.icons,delete a.showText,e("<button></button>",a).button(n).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,a=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(a,s){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",a,t(s))},drag:function(e,a){i._trigger("drag",e,t(a))},stop:function(s,n){a.position=[n.position.left-i.document.scrollLeft(),n.position.top-i.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",s,t(n))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,a=this.options,s=a.resizable,n=this.uiDialog.css("position"),r="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:this._minHeight(),handles:r,start:function(a,s){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",a,t(s))},resize:function(e,a){i._trigger("resize",e,t(a))},stop:function(s,n){a.height=e(this).height(),a.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",s,t(n))}}).css("position",n)},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(a){var s=this,n=!1,r={};e.each(a,function(e,a){s._setOption(e,a),e in t&&(n=!0),e in i&&(r[e]=a)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",r)},_setOption:function(e,t){var i,a,s=this.uiDialog;"dialogClass"===e&&s.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=s.is(":data(ui-draggable)"),i&&!t&&s.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(a=s.is(":data(ui-resizable)"),a&&!t&&s.resizable("destroy"),a&&"string"==typeof t&&s.resizable("option","handles",t),a||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,a=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),a.minWidth>a.width&&(a.width=a.minWidth),e=this.uiDialog.css({height:"auto",width:a.width}).outerHeight(),t=Math.max(0,a.minHeight-e),i="number"==typeof a.maxHeight?Math.max(0,a.maxHeight-e):"none","auto"===a.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,a.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=this,i=this.widgetFullName;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(a){t._allowInteraction(a)||(a.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),e.ui.dialog.overlayInstances=0,e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t,i=this.options.position,a=[],s=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(a=i.split?i.split(" "):[i[0],i[1]],1===a.length&&(a[1]=a[0]),e.each(["left","top"],function(e,t){+a[e]===a[e]&&(s[e]=a[e],a[e]=t)}),i={my:a[0]+(0>s[0]?s[0]:"+"+s[0])+" "+a[1]+(0>s[1]?s[1]:"+"+s[1]),at:a.join(" ")}),i=e.extend({},e.ui.dialog.prototype.options.position,i)):i=e.ui.dialog.prototype.options.position,t=this.uiDialog.is(":visible"),t||this.uiDialog.show(),this.uiDialog.position(i),t||this.uiDialog.hide()}})})(jQuery);(function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=e.pageX,h=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,a=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,a))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,a,o,r,l,h,c,u,d,p=t(this).data("ui-draggable"),g=p.options,f=g.snapTolerance,m=i.offset.left,_=m+p.helperProportions.width,v=i.offset.top,b=v+p.helperProportions.height;for(u=p.snapElements.length-1;u>=0;u--)r=p.snapElements[u].left,l=r+p.snapElements[u].width,h=p.snapElements[u].top,c=h+p.snapElements[u].height,r-f>_||m>l+f||h-f>b||v>c+f||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==g.snapMode&&(s=f>=Math.abs(h-b),n=f>=Math.abs(c-v),a=f>=Math.abs(r-_),o=f>=Math.abs(l-m),s&&(i.position.top=p._convertPositionTo("relative",{top:h-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),d=s||n||a||o,"outer"!==g.snapMode&&(s=f>=Math.abs(h-v),n=f>=Math.abs(c-b),a=f>=Math.abs(r-m),o=f>=Math.abs(l-_),s&&(i.position.top=p._convertPositionTo("relative",{top:h,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||a||o||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,a,o=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,l=o+t.helperProportions.width,h=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,d=c+i.proportions().width,p=u+i.proportions().height;switch(s){case"fit":return o>=c&&d>=l&&r>=u&&p>=h;case"intersect":return o+t.helperProportions.width/2>c&&d>l-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&p>h-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,a=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(a,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&p>=r||h>=u&&p>=h||u>r&&h>p)&&(o>=c&&d>=o||l>=c&&d>=l||c>o&&l>d);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,a=t.ui.ddmanager.droppables[e.options.scope]||[],o=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||e&&!a[s].accept.call(a[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue t}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=t.ui.intersect(e,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),a.length&&(s=t.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}})(jQuery);(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,a){var o,r=a.re.exec(i),l=r&&a.parse(r),h=a.space||"rgba";return l?(o=s[h](l),s[c[h].cache]=o[c[h].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,o,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,l],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),a=c[n],o=0===this.alpha()?h("transparent"):this,r=o[a.cache]||a.to(o._rgba),l=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],h=s[a],c=u[n.type]||{};null!==h&&(null===o?l[a]=h:(c.mod&&(h-o>c.mod/2?o+=c.mod:o-h>c.mod/2&&(o-=c.mod)),l[a]=i((h-o)*e+o,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),l=Math.min(s,n,a),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-a)/h+360:n===r?60*(a-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[o]&&(this[o]=l(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[o]=d,n):h(d)},f(a,function(e,i){h.fn[e]||(h.fn[e]=function(n){var a,o=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=h(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var l=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",h=l.children?o.find("*").addBack():o;h=h.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),h=h.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,l=t(this),h=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(l,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;l.parent().is(".ui-effects-wrapper")?t.effects.save(l.parent(),h):t.effects.save(l,h),l.show(),a=t.effects.createWrapper(l).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,m[p]=v?o:0,g||(l.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:o+r),v&&(a.css(p,0),g||a.css(f,r+o)),a.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),t.effects.restore(l,h),t.effects.removeWrapper(l),n()}})}})(jQuery);(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"effect"),h="hide"===l,c="show"===l,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||h?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||h)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,g,m)),h&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m).animate(a,g,m),d=h?2*d:d/2;h&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m)),o.queue(function(){h&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"hide"),h="show"===l,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),h&&(n.css(d,0),n.css(p,a/2)),f[d]=h?a:0,f[p]=h?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(h,"pos"===c?-s:s),u[h]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),g||p.hide(),i()}var a,o,r,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),g="show"===f,m=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(l=m.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=m.left+o*v,h=o-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(g?h*v:0),top:l+(g?c*_:0),opacity:g?0:1}).animate({left:r+(g?0:h*v),top:l+(g?0:c*_),opacity:g?1:0},e.duration||500,e.easing,s)}})(jQuery);(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),l="show"===r,h="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=l!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[h?0:1]),l&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=l?n[0]:c,v[f[1]]=l?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){h&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,l=o||"hide"===a,h=2*(e.times||5)+(l?1:0),c=e.duration/h,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;h>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,h+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?l:{height:l.height*r,width:l.width*r,outerHeight:l.outerHeight*r,outerWidth:l.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",l=e.origin,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=l||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:h),n.to={height:h.height*c.y,width:h.width*c.x,outerHeight:h.outerHeight*c.y,outerWidth:h.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],v=o.css("position"),_=f?r:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===g||"both"===g)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===g||"both"===g)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(h),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(n=t.effects.getBaseline(m,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),h=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,h),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,h)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",l=e.distance||20,h=e.times||3,c=2*h+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+l,g[d]=(p?"+=":"-=")+2*l,m[d]=(p?"-=":"+=")+2*l,n.animate(f,u,e.easing),s=1;h>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(h,c?isNaN(s)?"-"+s:-s:s),u[h]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,l=a?o.scrollLeft():0,h=n.offset(),c={top:h.top-r,left:h.left-l,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,l=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:l=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);(function(t,e){t.widget("ui.progressbar",{version:"1.10.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);(function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{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"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),a="ui-resizable-"+s,n=t("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,a;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,a),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(t(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),o.containment&&(s+=t(o.containment).scrollLeft()||0,n+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-a.left||0,d=e.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,a=s?0:c.sizeDiff.width,o={width:c.helper.width()-a,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(o,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidth<t.width,a=i(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=i(t.width)&&e.minWidth&&e.minWidth>t.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return o&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),a&&(t.height=e.maxHeight),o&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),a&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,a=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:o,h=t.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,a,o=t(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,c=o._aspectRatio||e.shiftKey,u={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-u.left),c&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),c&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-u.left:o.offset.left-u.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-u.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=Math.abs(o.parentData.left)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,c&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,c&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,a=e.containerElement,o=t(e.helper),r=o.offset(),h=o.outerWidth()-e.sizeDiff.width,l=o.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(a[e]=i||null)}),e.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,a=e.originalPosition,o=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(o)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.top=a.top-u):/^(sw)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.left=a.left-c):(p-l>0?(e.size.height=p,e.position.top=a.top-u):(e.size.height=l,e.position.top=a.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=a.left-c):(e.size.width=h,e.position.left=a.left+n.width-h))}})})(jQuery);(function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=t(i.options.filter,i.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=e.pageX,l=e.pageY;return a>r&&(i=r,r=a,a=i),o>l&&(i=l,l=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:l-o}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),h=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?h=!(i.left>r||a>i.right||i.top>l||o>i.bottom):"fit"===n.tolerance&&(h=i.left>a&&r>i.right&&i.top>o&&l>i.bottom),h?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,l,h,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),l=a.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-a.width()/2,top:e.pageY-l.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),u["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](u,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[h?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[h?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):undefined}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-t(document).scrollTop()<a.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed)),e.pageX-t(document).scrollLeft()<a.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return n?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td>&#160;</td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._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")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t=t.cloneNode(!1),t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,c))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.4",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=o),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function o(t){l.of=t,a.is(":hidden")||a.position(l)}var a,r,h,l=t.extend({},this.options.position);if(n){if(a=this._find(s),a.length)return a.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),a=this._tooltip(s),e(s,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(t.extend({of:s},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){a.is(":visible")&&(o(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:a}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(a)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),o.stop(!0),this._hide(o,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery);
\ No newline at end of file
+(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap=#"+a+"]")[0],!!o&&i(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(g.inline?t.parent()[0]:g.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function o(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function r(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.0",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(){var t=this.css("position"),i="absolute"===t,s=this.parents().filter(function(){var t=e(this);return i&&"static"===t.css("position")?!1:/(auto|scroll)/.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==t&&s.length?s:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var h=0,l=Array.prototype.slice;e.cleanData=function(t){return function(i){for(var s,n=0;null!=(s=i[n]);n++)try{e(s).triggerHandler("remove")}catch(a){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=l.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=l.call(arguments,1),r=this;return n=!a&&o.length?e.widget.extend.apply(null,[n].concat(o)):n,a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))}),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var u=!1;e(document).mouseup(function(){u=!1}),e.widget("ui.mouse",{version:"1.11.0",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!u){this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),u=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):t.which?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),u=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,M=e.extend({},y),N=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?M.left-=d:"center"===n.my[0]&&(M.left-=d/2),"bottom"===n.my[1]?M.top-=c:"center"===n.my[1]&&(M.top-=c/2),M.left+=N[0],M.top+=N[1],a||(M.left=h(M.left),M.top=h(M.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](M,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+N[0],p[1]+N[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-M.left,i=t+m-d,s=v.top-M.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:M.left,top:M.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,e.top+p+f+m>u&&(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,e.top+p+f+m>d&&(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.0",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},u=h&&l.down||l,d=function(){o._toggleComplete(i)};return"number"==typeof u&&(a=u),"string"==typeof u&&(n=u),n=n||u.easing||l.easing,a=a||u.duration||l.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:d,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?r+=i.now:"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,d):e.animate(this.showProps,a,n,d)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.0",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1
+}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(t.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.find(this.options.items).filter(function(){return r.test(e(this).text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(t.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.find(this.options.items).filter(function(){return r.test(e(this).text())})),s.length?(this.focus(t,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)}}),e.widget("ui.autocomplete",{version:"1.11.0",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&jQuery.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var d,c="ui-button ui-widget ui-state-default ui-corner-all",p="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",f=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},m=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.0",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(c).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===d&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];m(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),d=this,t.document.one("mouseup",function(){d=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(c+" ui-state-active "+p).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?m(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(p),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.0",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.0"}});var g;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return o(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var r,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),o(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,r,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),r=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),o(l.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,r)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))
+}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,r,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(o(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,g=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a");var i,s=this._getNumberOfMonths(t),n=s[1],a=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n=RegExp("^\\d{1,"+s+"}"),a=i.substring(h).match(n);if(!a)throw"Missing number at position "+h;return h+=a[0].length,parseInt(a[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,N,C,A,I,P,z,H,F,E,j,O,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="<div class='ui-datepicker-group",K[1]>1)switch(T){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)C=(x+u)%7,N+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[C]+"'>"+p[C]+"</span></th>";for(M+=N+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),I=(this._getFirstDayOfMonth(et,Z)-u+7)%7,P=Math.ceil((I+A)/7),z=Q?this.maxRows>P?this.maxRows:P:P,this.maxRows=z,H=this._daylightSavingAdjust(new Date(et,Z,1-I)),F=0;z>F;F++){for(M+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(H)+"</td>":"",x=0;7>x;x++)j=g?g.apply(e.input?e.input[0]:null,[H]):[!0,""],O=H.getMonth()!==Z,W=O&&!y||!j[0]||X&&X>H||$&&H>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(O?" ui-datepicker-other-month":"")+(H.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===H.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(W?" "+this._unselectableClass+" ui-state-disabled":"")+(O&&!v?"":" "+j[1]+(H.getTime()===G.getTime()?" "+this._currentClass:"")+(H.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(O&&!v||!j[2]?"":" title='"+j[2].replace(/'/g,"&#39;")+"'")+(W?"":" data-handler='selectDay' data-event='click' data-month='"+H.getMonth()+"' data-year='"+H.getFullYear()+"'")+">"+(O&&!v?"&#xa0;":W?"<span class='ui-state-default'>"+H.getDate()+"</span>":"<a class='ui-state-default"+(H.getTime()===R.getTime()?" ui-state-highlight":"")+(H.getTime()===G.getTime()?" ui-state-active":"")+(O?" ui-priority-secondary":"")+"' href='#'>"+H.getDate()+"</a>")+"</td>",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(Q?"</div>"+(K[0]>0&&T===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.0",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.0",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.document[0],s=this.options;try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(n){}return this.helper||s.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(s.iframeFix===!0?"iframe":s.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this._removeHandleClassName(),e(this.options.handle||this.element).addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.element.find(".ui-draggable-handle").addBack().removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relative_container=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}
+},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i,s){var n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParent[0]!==i.document[0]&&"HTML"!==i.scrollParent[0].tagName&&(i.overflowOffset=i.scrollParent.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.document[0];s.scrollParent[0]!==o&&"HTML"!==s.scrollParent[0].tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+s.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?s.scrollParent[0].scrollTop=a=s.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(s.scrollParent[0].scrollTop=a=s.scrollParent[0].scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+s.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?s.scrollParent[0].scrollLeft=a=s.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(s.scrollParent[0].scrollLeft=a=s.scrollParent[0].scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(o).scrollTop()<n.scrollSensitivity?a=e(o).scrollTop(e(o).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(o).scrollTop())<n.scrollSensitivity&&(a=e(o).scrollTop(e(o).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(o).scrollLeft()<n.scrollSensitivity?a=e(o).scrollLeft(e(o).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(o).scrollLeft())<n.scrollSensitivity&&(a=e(o).scrollLeft(e(o).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left,l=h+s.snapElements[c].width,u=s.snapElements[c].top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top-s.margins.top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top-s.margins.top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left-s.margins.left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left-s.margins.left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top-s.margins.top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top-s.margins.top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left-s.margins.left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left-s.margins.left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.0",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{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"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=this.element.children(this.handles[i]).first().show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.originalPosition={left:i,top:s},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=t.pageX-a.left||0,h=t.pageY-a.top||0,l=this._change[o];return this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height},l?(i=l.apply(this,[t,r,h]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==this.prevPosition.top&&(n.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(n.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(n.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(n)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,n,a=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(n=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition,prevSize:this.prevSize,prevPosition:this.prevPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t,i){var s,n,a,o,r=e(this).resizable("instance"),h=r.options,l=r.containerOffset,u=r.position,d=r._aspectRatio||t.shiftKey,c={top:0,left:0},p=r.containerElement,f=!0;p[0]!==document&&/static/.test(p.css("position"))&&(c=l),u.left<(r._helper?l.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-l.left:r.position.left-c.left),d&&(r.size.height=r.size.width/r.aspectRatio,f=!1),r.position.left=h.helper?l.left:0),u.top<(r._helper?l.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-l.top:r.position.top),d&&(r.size.width=r.size.height*r.aspectRatio,f=!1),r.position.top=r._helper?l.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top,s=Math.abs((r._helper?r.offset.left-c.left:r.offset.left-l.left)+r.sizeDiff.width),n=Math.abs((r._helper?r.offset.top-c.top:r.offset.top-l.top)+r.sizeDiff.height),a=r.containerElement.get(0)===r.element.parent().get(0),o=/relative|absolute/.test(r.containerElement.css("position")),a&&o&&(s-=Math.abs(r.parentData.left)),s+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-s,d&&(r.size.height=r.size.width/r.aspectRatio,f=!1)),n+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-n,d&&(r.size.width=r.size.height*r.aspectRatio,f=!1)),f||(r.position.left=i.prevPosition.left,r.position.top=i.prevPosition.top,r.size.width=i.prevSize.width,r.size.height=i.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size,n=t.originalSize,a=t.originalPosition,o=t.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,u=Math.round((s.width-n.width)/h)*h,d=Math.round((s.height-n.height)/l)*l,c=n.width+u,p=n.height+d,f=i.maxWidth&&c>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>c,v=i.minHeight&&i.minHeight>p;i.grid=r,g&&(c+=h),v&&(p+=l),f&&(c-=h),m&&(p-=l),/^(se|s|e)$/.test(o)?(t.size.width=c,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=c,t.size.height=p,t.position.top=a.top-d):/^(sw)$/.test(o)?(t.size.width=c,t.size.height=p,t.position.left=a.left-u):(p-l>0?(t.size.height=p,t.position.top=a.top-d):(t.size.height=l,t.position.top=a.top+n.height-l),c-h>0?(t.size.width=c,t.position.left=a.left-u):(t.size.width=h,t.position.left=a.left+n.width-h))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.0",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()
+}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._untrackInstance(),this._trackingInstances().unshift(this),this._focusedElement=e(t.target)}})},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.0",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e(this).droppable("instance");return t.options.greedy&&!t.options.disabled&&t.options.scope===s.options.scope&&t.accept.call(t.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s){if(!i.offset)return!1;var n,a,o=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,h=o+t.helperProportions.width,l=r+t.helperProportions.height,u=i.offset.left,d=i.offset.top,c=u+i.proportions().width,p=d+i.proportions().height;switch(s){case"fit":return o>=u&&c>=h&&r>=d&&p>=l;case"intersect":return o+t.helperProportions.width/2>u&&c>h-t.helperProportions.width/2&&r+t.helperProportions.height/2>d&&p>l-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,a=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(a,d,i.proportions().height)&&e(n,u,i.proportions().width);case"touch":return(r>=d&&p>=r||l>=d&&p>=l||d>r&&l>p)&&(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable;var v="ui-effects-";e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(jQuery.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.0",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(v+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(v+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};
+f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})},e.widget("ui.progressbar",{version:"1.11.0",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.0",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.0",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var t=this,i=this.element.attr("tabindex");this.label=e("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:i||this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),e("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=e("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._setOption("width",this.options.width),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){t.menuItems||t._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(e,i){e.preventDefault(),t._select(i.item.data("ui-selectmenu-item"),e)},focus:function(e,i){var s=i.item.data("ui-selectmenu-item");null!=t.focusIndex&&s.index!==t.focusIndex&&(t._trigger("focus",e,{item:s}),t.isOpen||t._select(s,e)),t.focusIndex=s.index,t.button.attr("aria-activedescendant",t.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this._setOption("width",this.options.width)},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var s=this,n="";e.each(i,function(i,a){a.optgroup!==n&&(e("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(a.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:a.optgroup}).appendTo(t),n=a.optgroup),s._renderItemData(t,a)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var s=e("<li>");return i.disabled&&s.addClass("ui-state-disabled"),this._setText(s,i.label),s.appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex):(i=this.menuItems.eq(this.element[0].selectedIndex),n+=":not(.ui-state-disabled)"),s="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](n).eq(-1):i[e+"All"](n).eq(0),s.length&&this.menuInstance.focus(t,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(t))}},_buttonEvents:{click:"_toggle",keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===e&&(t||(t=this.element.outerWidth()),this.button.outerWidth(t))},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(t){var i=[];t.each(function(t,s){var n=e(s),a=n.parent("optgroup");i.push({element:n,index:t,value:n.attr("value"),label:n.text(),optgroup:a.attr("label")||"",disabled:a.prop("disabled")||n.prop("disabled")})}),this.items=i},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.0",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,d=this.options;return d.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===d.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.0",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===e.axis||this._isFloating(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));
+return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-e(document).scrollTop()<o.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-o.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<o.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+o.scrollSpeed)),t.pageX-e(document).scrollLeft()<o.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-o.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<o.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?t.currentItem.children().each(function(){e("<td>&#160;</td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._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")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(e("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!t){for(this._trigger("beforeStop",e,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.11.0",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:r(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:r(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:r(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:r(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(r(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.0",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]
+}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){o.html(e),s._trigger("load",i,r)},1)}).complete(function(e,t){setTimeout(function(){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.0",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){e.data("ui-tooltip-open")&&n._delay(function(){t&&(t.type=a),this._open(t,e,i)})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,a.is(":hidden")||a.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i),a.length)return a.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("<div>").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):a.position(e.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:a}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}},i[0]!==this.element[0]&&(o.remove=function(){this._removeTooltip(a)}),t&&"mouseover"!==t.type||(o.mouseleave="close"),t&&"focusin"!==t.type||(o.focusout="close"),this._on(!0,i,o)}},close:function(t){var i=this,s=e(t?t.currentTarget:this.element),n=this._find(s);this.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.stop(!0),this._hide(n,this.options.hide,function(){i._removeTooltip(e(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,s){e(s.element).attr("title",s.title),delete i.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:n}),this.closing=!1)},_tooltip:function(t){var i=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]=t,i},_find:function(t){var i=t.data("ui-tooltip-id");return i?e("#"+i):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s[0],t.close(n,!0),e("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title")||s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})});
\ No newline at end of file
diff --git a/lib/scripts/jquery/jquery.js b/lib/scripts/jquery/jquery.js
index c5c648255c1574dcc95c506b82c25044f0972dfd..d4b67f7e6c1a94df167f31657769717a71581066 100644
--- a/lib/scripts/jquery/jquery.js
+++ b/lib/scripts/jquery/jquery.js
@@ -1,91 +1,82 @@
 /*!
- * jQuery JavaScript Library v1.10.2
+ * jQuery JavaScript Library v1.11.1
  * http://jquery.com/
  *
  * Includes Sizzle.js
  * http://sizzlejs.com/
  *
- * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
+ * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
  * Released under the MIT license
  * http://jquery.org/license
  *
- * Date: 2013-07-03T13:48Z
+ * Date: 2014-05-01T17:42Z
  */
-(function( window, undefined ) {
+
+(function( global, factory ) {
+
+	if ( typeof module === "object" && typeof module.exports === "object" ) {
+		// For CommonJS and CommonJS-like environments where a proper window is present,
+		// execute the factory and get jQuery
+		// For environments that do not inherently posses a window with a document
+		// (such as Node.js), expose a jQuery-making factory as module.exports
+		// This accentuates the need for the creation of a real window
+		// e.g. var jQuery = require("jquery")(window);
+		// See ticket #14549 for more info
+		module.exports = global.document ?
+			factory( global, true ) :
+			function( w ) {
+				if ( !w.document ) {
+					throw new Error( "jQuery requires a window with a document" );
+				}
+				return factory( w );
+			};
+	} else {
+		factory( global );
+	}
+
+// Pass this if window is not defined yet
+}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
 
 // Can't do this because several apps including ASP.NET trace
 // the stack via arguments.caller.callee and Firefox dies if
 // you try to trace through "use strict" call chains. (#13335)
 // Support: Firefox 18+
-//"use strict";
-var
-	// The deferred used on DOM ready
-	readyList,
+//
 
-	// A central reference to the root jQuery(document)
-	rootjQuery,
+var deletedIds = [];
 
-	// Support: IE<10
-	// For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
-	core_strundefined = typeof undefined,
+var slice = deletedIds.slice;
 
-	// Use the correct document accordingly with window argument (sandbox)
-	location = window.location,
-	document = window.document,
-	docElem = document.documentElement,
+var concat = deletedIds.concat;
 
-	// Map over jQuery in case of overwrite
-	_jQuery = window.jQuery,
+var push = deletedIds.push;
 
-	// Map over the $ in case of overwrite
-	_$ = window.$,
+var indexOf = deletedIds.indexOf;
 
-	// [[Class]] -> type pairs
-	class2type = {},
+var class2type = {};
 
-	// List of deleted data cache ids, so we can reuse them
-	core_deletedIds = [],
+var toString = class2type.toString;
 
-	core_version = "1.10.2",
+var hasOwn = class2type.hasOwnProperty;
 
-	// Save a reference to some core methods
-	core_concat = core_deletedIds.concat,
-	core_push = core_deletedIds.push,
-	core_slice = core_deletedIds.slice,
-	core_indexOf = core_deletedIds.indexOf,
-	core_toString = class2type.toString,
-	core_hasOwn = class2type.hasOwnProperty,
-	core_trim = core_version.trim,
+var support = {};
+
+
+
+var
+	version = "1.11.1",
 
 	// Define a local copy of jQuery
 	jQuery = function( selector, context ) {
 		// The jQuery object is actually just the init constructor 'enhanced'
-		return new jQuery.fn.init( selector, context, rootjQuery );
+		// Need init if jQuery is called (just allow error to be thrown if not included)
+		return new jQuery.fn.init( selector, context );
 	},
 
-	// Used for matching numbers
-	core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
-
-	// Used for splitting on whitespace
-	core_rnotwhite = /\S+/g,
-
-	// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
+	// Support: Android<4.1, IE<9
+	// Make sure we trim BOM and NBSP
 	rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
 
-	// A simple way to check for HTML strings
-	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-	// Strict HTML recognition (#11290: must start with <)
-	rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
-
-	// Match a standalone tag
-	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
-
-	// JSON RegExp
-	rvalidchars = /^[\],:{}\s]*$/,
-	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-	rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
-	rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
-
 	// Matches dashed string for camelizing
 	rmsPrefix = /^-ms-/,
 	rdashAlpha = /-([\da-z])/gi,
@@ -93,134 +84,13 @@ var
 	// Used by jQuery.camelCase as callback to replace()
 	fcamelCase = function( all, letter ) {
 		return letter.toUpperCase();
-	},
-
-	// The ready event handler
-	completed = function( event ) {
-
-		// readyState === "complete" is good enough for us to call the dom ready in oldIE
-		if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
-			detach();
-			jQuery.ready();
-		}
-	},
-	// Clean-up method for dom ready events
-	detach = function() {
-		if ( document.addEventListener ) {
-			document.removeEventListener( "DOMContentLoaded", completed, false );
-			window.removeEventListener( "load", completed, false );
-
-		} else {
-			document.detachEvent( "onreadystatechange", completed );
-			window.detachEvent( "onload", completed );
-		}
 	};
 
 jQuery.fn = jQuery.prototype = {
 	// The current version of jQuery being used
-	jquery: core_version,
+	jquery: version,
 
 	constructor: jQuery,
-	init: function( selector, context, rootjQuery ) {
-		var match, elem;
-
-		// HANDLE: $(""), $(null), $(undefined), $(false)
-		if ( !selector ) {
-			return this;
-		}
-
-		// Handle HTML strings
-		if ( typeof selector === "string" ) {
-			if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
-				// Assume that strings that start and end with <> are HTML and skip the regex check
-				match = [ null, selector, null ];
-
-			} else {
-				match = rquickExpr.exec( selector );
-			}
-
-			// Match html or make sure no context is specified for #id
-			if ( match && (match[1] || !context) ) {
-
-				// HANDLE: $(html) -> $(array)
-				if ( match[1] ) {
-					context = context instanceof jQuery ? context[0] : context;
-
-					// scripts is true for back-compat
-					jQuery.merge( this, jQuery.parseHTML(
-						match[1],
-						context && context.nodeType ? context.ownerDocument || context : document,
-						true
-					) );
-
-					// HANDLE: $(html, props)
-					if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
-						for ( match in context ) {
-							// Properties of context are called as methods if possible
-							if ( jQuery.isFunction( this[ match ] ) ) {
-								this[ match ]( context[ match ] );
-
-							// ...and otherwise set as attributes
-							} else {
-								this.attr( match, context[ match ] );
-							}
-						}
-					}
-
-					return this;
-
-				// HANDLE: $(#id)
-				} else {
-					elem = document.getElementById( match[2] );
-
-					// Check parentNode to catch when Blackberry 4.6 returns
-					// nodes that are no longer in the document #6963
-					if ( elem && elem.parentNode ) {
-						// Handle the case where IE and Opera return items
-						// by name instead of ID
-						if ( elem.id !== match[2] ) {
-							return rootjQuery.find( selector );
-						}
-
-						// Otherwise, we inject the element directly into the jQuery object
-						this.length = 1;
-						this[0] = elem;
-					}
-
-					this.context = document;
-					this.selector = selector;
-					return this;
-				}
-
-			// HANDLE: $(expr, $(...))
-			} else if ( !context || context.jquery ) {
-				return ( context || rootjQuery ).find( selector );
-
-			// HANDLE: $(expr, context)
-			// (which is just equivalent to: $(context).find(expr)
-			} else {
-				return this.constructor( context ).find( selector );
-			}
-
-		// HANDLE: $(DOMElement)
-		} else if ( selector.nodeType ) {
-			this.context = this[0] = selector;
-			this.length = 1;
-			return this;
-
-		// HANDLE: $(function)
-		// Shortcut for document ready
-		} else if ( jQuery.isFunction( selector ) ) {
-			return rootjQuery.ready( selector );
-		}
-
-		if ( selector.selector !== undefined ) {
-			this.selector = selector.selector;
-			this.context = selector.context;
-		}
-
-		return jQuery.makeArray( selector, this );
-	},
 
 	// Start with an empty selector
 	selector: "",
@@ -229,19 +99,19 @@ jQuery.fn = jQuery.prototype = {
 	length: 0,
 
 	toArray: function() {
-		return core_slice.call( this );
+		return slice.call( this );
 	},
 
 	// Get the Nth element in the matched element set OR
 	// Get the whole matched element set as a clean array
 	get: function( num ) {
-		return num == null ?
+		return num != null ?
 
-			// Return a 'clean' array
-			this.toArray() :
+			// Return just the one element from the set
+			( num < 0 ? this[ num + this.length ] : this[ num ] ) :
 
-			// Return just the object
-			( num < 0 ? this[ this.length + num ] : this[ num ] );
+			// Return all the elements in a clean array
+			slice.call( this );
 	},
 
 	// Take an array of elements and push it onto the stack
@@ -266,15 +136,14 @@ jQuery.fn = jQuery.prototype = {
 		return jQuery.each( this, callback, args );
 	},
 
-	ready: function( fn ) {
-		// Add the callback
-		jQuery.ready.promise().done( fn );
-
-		return this;
+	map: function( callback ) {
+		return this.pushStack( jQuery.map(this, function( elem, i ) {
+			return callback.call( elem, i, elem );
+		}));
 	},
 
 	slice: function() {
-		return this.pushStack( core_slice.apply( this, arguments ) );
+		return this.pushStack( slice.apply( this, arguments ) );
 	},
 
 	first: function() {
@@ -291,26 +160,17 @@ jQuery.fn = jQuery.prototype = {
 		return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
 	},
 
-	map: function( callback ) {
-		return this.pushStack( jQuery.map(this, function( elem, i ) {
-			return callback.call( elem, i, elem );
-		}));
-	},
-
 	end: function() {
 		return this.prevObject || this.constructor(null);
 	},
 
 	// For internal use only.
 	// Behaves like an Array's method, not like a jQuery method.
-	push: core_push,
-	sort: [].sort,
-	splice: [].splice
+	push: push,
+	sort: deletedIds.sort,
+	splice: deletedIds.splice
 };
 
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
 jQuery.extend = jQuery.fn.extend = function() {
 	var src, copyIsArray, copy, name, options, clone,
 		target = arguments[0] || {},
@@ -321,9 +181,10 @@ jQuery.extend = jQuery.fn.extend = function() {
 	// Handle a deep copy situation
 	if ( typeof target === "boolean" ) {
 		deep = target;
-		target = arguments[1] || {};
+
 		// skip the boolean and the target
-		i = 2;
+		target = arguments[ i ] || {};
+		i++;
 	}
 
 	// Handle case when target is a string or something (possible in deep copy)
@@ -332,9 +193,9 @@ jQuery.extend = jQuery.fn.extend = function() {
 	}
 
 	// extend jQuery itself if only one argument is passed
-	if ( length === i ) {
+	if ( i === length ) {
 		target = this;
-		--i;
+		i--;
 	}
 
 	for ( ; i < length; i++ ) {
@@ -377,66 +238,16 @@ jQuery.extend = jQuery.fn.extend = function() {
 
 jQuery.extend({
 	// Unique for each copy of jQuery on the page
-	// Non-digits removed to match rinlinejQuery
-	expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
-
-	noConflict: function( deep ) {
-		if ( window.$ === jQuery ) {
-			window.$ = _$;
-		}
-
-		if ( deep && window.jQuery === jQuery ) {
-			window.jQuery = _jQuery;
-		}
-
-		return jQuery;
-	},
-
-	// Is the DOM ready to be used? Set to true once it occurs.
-	isReady: false,
+	expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
 
-	// A counter to track how many items to wait for before
-	// the ready event fires. See #6781
-	readyWait: 1,
+	// Assume jQuery is ready without the ready module
+	isReady: true,
 
-	// Hold (or release) the ready event
-	holdReady: function( hold ) {
-		if ( hold ) {
-			jQuery.readyWait++;
-		} else {
-			jQuery.ready( true );
-		}
+	error: function( msg ) {
+		throw new Error( msg );
 	},
 
-	// Handle when the DOM is ready
-	ready: function( wait ) {
-
-		// Abort if there are pending holds or we're already ready
-		if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
-			return;
-		}
-
-		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-		if ( !document.body ) {
-			return setTimeout( jQuery.ready );
-		}
-
-		// Remember that the DOM is ready
-		jQuery.isReady = true;
-
-		// If a normal DOM Ready event fired, decrement, and wait if need be
-		if ( wait !== true && --jQuery.readyWait > 0 ) {
-			return;
-		}
-
-		// If there are functions bound, to execute
-		readyList.resolveWith( document, [ jQuery ] );
-
-		// Trigger any bound ready events
-		if ( jQuery.fn.trigger ) {
-			jQuery( document ).trigger("ready").off("ready");
-		}
-	},
+	noop: function() {},
 
 	// See test/unit/core.js for details concerning isFunction.
 	// Since version 1.3, DOM methods and functions like alert
@@ -455,16 +266,18 @@ jQuery.extend({
 	},
 
 	isNumeric: function( obj ) {
-		return !isNaN( parseFloat(obj) ) && isFinite( obj );
+		// parseFloat NaNs numeric-cast false positives (null|true|false|"")
+		// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
+		// subtraction forces infinities to NaN
+		return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0;
 	},
 
-	type: function( obj ) {
-		if ( obj == null ) {
-			return String( obj );
+	isEmptyObject: function( obj ) {
+		var name;
+		for ( name in obj ) {
+			return false;
 		}
-		return typeof obj === "object" || typeof obj === "function" ?
-			class2type[ core_toString.call(obj) ] || "object" :
-			typeof obj;
+		return true;
 	},
 
 	isPlainObject: function( obj ) {
@@ -480,8 +293,8 @@ jQuery.extend({
 		try {
 			// Not own constructor property must be Object
 			if ( obj.constructor &&
-				!core_hasOwn.call(obj, "constructor") &&
-				!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+				!hasOwn.call(obj, "constructor") &&
+				!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
 				return false;
 			}
 		} catch ( e ) {
@@ -491,9 +304,9 @@ jQuery.extend({
 
 		// Support: IE<9
 		// Handle iteration over inherited properties before own properties.
-		if ( jQuery.support.ownLast ) {
+		if ( support.ownLast ) {
 			for ( key in obj ) {
-				return core_hasOwn.call( obj, key );
+				return hasOwn.call( obj, key );
 			}
 		}
 
@@ -501,105 +314,18 @@ jQuery.extend({
 		// if last one is own, then all properties are own.
 		for ( key in obj ) {}
 
-		return key === undefined || core_hasOwn.call( obj, key );
-	},
-
-	isEmptyObject: function( obj ) {
-		var name;
-		for ( name in obj ) {
-			return false;
-		}
-		return true;
-	},
-
-	error: function( msg ) {
-		throw new Error( msg );
-	},
-
-	// data: string of html
-	// context (optional): If specified, the fragment will be created in this context, defaults to document
-	// keepScripts (optional): If true, will include scripts passed in the html string
-	parseHTML: function( data, context, keepScripts ) {
-		if ( !data || typeof data !== "string" ) {
-			return null;
-		}
-		if ( typeof context === "boolean" ) {
-			keepScripts = context;
-			context = false;
-		}
-		context = context || document;
-
-		var parsed = rsingleTag.exec( data ),
-			scripts = !keepScripts && [];
-
-		// Single tag
-		if ( parsed ) {
-			return [ context.createElement( parsed[1] ) ];
-		}
-
-		parsed = jQuery.buildFragment( [ data ], context, scripts );
-		if ( scripts ) {
-			jQuery( scripts ).remove();
-		}
-		return jQuery.merge( [], parsed.childNodes );
-	},
-
-	parseJSON: function( data ) {
-		// Attempt to parse using the native JSON parser first
-		if ( window.JSON && window.JSON.parse ) {
-			return window.JSON.parse( data );
-		}
-
-		if ( data === null ) {
-			return data;
-		}
-
-		if ( typeof data === "string" ) {
-
-			// Make sure leading/trailing whitespace is removed (IE can't handle it)
-			data = jQuery.trim( data );
-
-			if ( data ) {
-				// Make sure the incoming data is actual JSON
-				// Logic borrowed from http://json.org/json2.js
-				if ( rvalidchars.test( data.replace( rvalidescape, "@" )
-					.replace( rvalidtokens, "]" )
-					.replace( rvalidbraces, "")) ) {
-
-					return ( new Function( "return " + data ) )();
-				}
-			}
-		}
-
-		jQuery.error( "Invalid JSON: " + data );
+		return key === undefined || hasOwn.call( obj, key );
 	},
 
-	// Cross-browser xml parsing
-	parseXML: function( data ) {
-		var xml, tmp;
-		if ( !data || typeof data !== "string" ) {
-			return null;
-		}
-		try {
-			if ( window.DOMParser ) { // Standard
-				tmp = new DOMParser();
-				xml = tmp.parseFromString( data , "text/xml" );
-			} else { // IE
-				xml = new ActiveXObject( "Microsoft.XMLDOM" );
-				xml.async = "false";
-				xml.loadXML( data );
-			}
-		} catch( e ) {
-			xml = undefined;
-		}
-		if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
-			jQuery.error( "Invalid XML: " + data );
+	type: function( obj ) {
+		if ( obj == null ) {
+			return obj + "";
 		}
-		return xml;
+		return typeof obj === "object" || typeof obj === "function" ?
+			class2type[ toString.call(obj) ] || "object" :
+			typeof obj;
 	},
 
-	noop: function() {},
-
 	// Evaluates a script in a global context
 	// Workarounds based on findings by Jim Driscoll
 	// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
@@ -674,20 +400,12 @@ jQuery.extend({
 		return obj;
 	},
 
-	// Use native String.trim function wherever possible
-	trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
-		function( text ) {
-			return text == null ?
-				"" :
-				core_trim.call( text );
-		} :
-
-		// Otherwise use our own trimming functionality
-		function( text ) {
-			return text == null ?
-				"" :
-				( text + "" ).replace( rtrim, "" );
-		},
+	// Support: Android<4.1, IE<9
+	trim: function( text ) {
+		return text == null ?
+			"" :
+			( text + "" ).replace( rtrim, "" );
+	},
 
 	// results is for internal usage only
 	makeArray: function( arr, results ) {
@@ -700,7 +418,7 @@ jQuery.extend({
 					[ arr ] : arr
 				);
 			} else {
-				core_push.call( ret, arr );
+				push.call( ret, arr );
 			}
 		}
 
@@ -711,8 +429,8 @@ jQuery.extend({
 		var len;
 
 		if ( arr ) {
-			if ( core_indexOf ) {
-				return core_indexOf.call( arr, elem, i );
+			if ( indexOf ) {
+				return indexOf.call( arr, elem, i );
 			}
 
 			len = arr.length;
@@ -730,15 +448,17 @@ jQuery.extend({
 	},
 
 	merge: function( first, second ) {
-		var l = second.length,
-			i = first.length,
-			j = 0;
+		var len = +second.length,
+			j = 0,
+			i = first.length;
 
-		if ( typeof l === "number" ) {
-			for ( ; j < l; j++ ) {
-				first[ i++ ] = second[ j ];
-			}
-		} else {
+		while ( j < len ) {
+			first[ i++ ] = second[ j++ ];
+		}
+
+		// Support: IE<9
+		// Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
+		if ( len !== len ) {
 			while ( second[j] !== undefined ) {
 				first[ i++ ] = second[ j++ ];
 			}
@@ -749,23 +469,23 @@ jQuery.extend({
 		return first;
 	},
 
-	grep: function( elems, callback, inv ) {
-		var retVal,
-			ret = [],
+	grep: function( elems, callback, invert ) {
+		var callbackInverse,
+			matches = [],
 			i = 0,
-			length = elems.length;
-		inv = !!inv;
+			length = elems.length,
+			callbackExpect = !invert;
 
 		// Go through the array, only saving the items
 		// that pass the validator function
 		for ( ; i < length; i++ ) {
-			retVal = !!callback( elems[ i ], i );
-			if ( inv !== retVal ) {
-				ret.push( elems[ i ] );
+			callbackInverse = !callback( elems[ i ], i );
+			if ( callbackInverse !== callbackExpect ) {
+				matches.push( elems[ i ] );
 			}
 		}
 
-		return ret;
+		return matches;
 	},
 
 	// arg is for internal usage only
@@ -776,13 +496,13 @@ jQuery.extend({
 			isArray = isArraylike( elems ),
 			ret = [];
 
-		// Go through the array, translating each of the items to their
+		// Go through the array, translating each of the items to their new values
 		if ( isArray ) {
 			for ( ; i < length; i++ ) {
 				value = callback( elems[ i ], i, arg );
 
 				if ( value != null ) {
-					ret[ ret.length ] = value;
+					ret.push( value );
 				}
 			}
 
@@ -792,13 +512,13 @@ jQuery.extend({
 				value = callback( elems[ i ], i, arg );
 
 				if ( value != null ) {
-					ret[ ret.length ] = value;
+					ret.push( value );
 				}
 			}
 		}
 
 		// Flatten any nested arrays
-		return core_concat.apply( [], ret );
+		return concat.apply( [], ret );
 	},
 
 	// A global GUID counter for objects
@@ -822,9 +542,9 @@ jQuery.extend({
 		}
 
 		// Simulated bind
-		args = core_slice.call( arguments, 2 );
+		args = slice.call( arguments, 2 );
 		proxy = function() {
-			return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
+			return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
 		};
 
 		// Set the guid of unique handler to the same of original handler, so it can be removed
@@ -833,148 +553,15 @@ jQuery.extend({
 		return proxy;
 	},
 
-	// Multifunctional method to get and set values of a collection
-	// The value/s can optionally be executed if it's a function
-	access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
-		var i = 0,
-			length = elems.length,
-			bulk = key == null;
-
-		// Sets many values
-		if ( jQuery.type( key ) === "object" ) {
-			chainable = true;
-			for ( i in key ) {
-				jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
-			}
-
-		// Sets one value
-		} else if ( value !== undefined ) {
-			chainable = true;
-
-			if ( !jQuery.isFunction( value ) ) {
-				raw = true;
-			}
-
-			if ( bulk ) {
-				// Bulk operations run against the entire set
-				if ( raw ) {
-					fn.call( elems, value );
-					fn = null;
-
-				// ...except when executing function values
-				} else {
-					bulk = fn;
-					fn = function( elem, key, value ) {
-						return bulk.call( jQuery( elem ), value );
-					};
-				}
-			}
-
-			if ( fn ) {
-				for ( ; i < length; i++ ) {
-					fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
-				}
-			}
-		}
-
-		return chainable ?
-			elems :
-
-			// Gets
-			bulk ?
-				fn.call( elems ) :
-				length ? fn( elems[0], key ) : emptyGet;
-	},
-
 	now: function() {
-		return ( new Date() ).getTime();
+		return +( new Date() );
 	},
 
-	// A method for quickly swapping in/out CSS properties to get correct calculations.
-	// Note: this method belongs to the css module but it's needed here for the support module.
-	// If support gets modularized, this method should be moved back to the css module.
-	swap: function( elem, options, callback, args ) {
-		var ret, name,
-			old = {};
-
-		// Remember the old values, and insert the new ones
-		for ( name in options ) {
-			old[ name ] = elem.style[ name ];
-			elem.style[ name ] = options[ name ];
-		}
-
-		ret = callback.apply( elem, args || [] );
-
-		// Revert the old values
-		for ( name in options ) {
-			elem.style[ name ] = old[ name ];
-		}
-
-		return ret;
-	}
+	// jQuery.support is not used in Core but other projects attach their
+	// properties to it so it needs to exist.
+	support: support
 });
 
-jQuery.ready.promise = function( obj ) {
-	if ( !readyList ) {
-
-		readyList = jQuery.Deferred();
-
-		// Catch cases where $(document).ready() is called after the browser event has already occurred.
-		// we once tried to use readyState "interactive" here, but it caused issues like the one
-		// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
-		if ( document.readyState === "complete" ) {
-			// Handle it asynchronously to allow scripts the opportunity to delay ready
-			setTimeout( jQuery.ready );
-
-		// Standards-based browsers support DOMContentLoaded
-		} else if ( document.addEventListener ) {
-			// Use the handy event callback
-			document.addEventListener( "DOMContentLoaded", completed, false );
-
-			// A fallback to window.onload, that will always work
-			window.addEventListener( "load", completed, false );
-
-		// If IE event model is used
-		} else {
-			// Ensure firing before onload, maybe late but safe also for iframes
-			document.attachEvent( "onreadystatechange", completed );
-
-			// A fallback to window.onload, that will always work
-			window.attachEvent( "onload", completed );
-
-			// If IE and not a frame
-			// continually check to see if the document is ready
-			var top = false;
-
-			try {
-				top = window.frameElement == null && document.documentElement;
-			} catch(e) {}
-
-			if ( top && top.doScroll ) {
-				(function doScrollCheck() {
-					if ( !jQuery.isReady ) {
-
-						try {
-							// Use the trick by Diego Perini
-							// http://javascript.nwbox.com/IEContentLoaded/
-							top.doScroll("left");
-						} catch(e) {
-							return setTimeout( doScrollCheck, 50 );
-						}
-
-						// detach all dom ready events
-						detach();
-
-						// and execute any waiting functions
-						jQuery.ready();
-					}
-				})();
-			}
-		}
-	}
-	return readyList.promise( obj );
-};
-
 // Populate the class2type map
 jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
 	class2type[ "[object " + name + "]" ] = name.toLowerCase();
@@ -984,7 +571,7 @@ function isArraylike( obj ) {
 	var length = obj.length,
 		type = jQuery.type( obj );
 
-	if ( jQuery.isWindow( obj ) ) {
+	if ( type === "function" || jQuery.isWindow( obj ) ) {
 		return false;
 	}
 
@@ -992,34 +579,33 @@ function isArraylike( obj ) {
 		return true;
 	}
 
-	return type === "array" || type !== "function" &&
-		( length === 0 ||
-		typeof length === "number" && length > 0 && ( length - 1 ) in obj );
+	return type === "array" || length === 0 ||
+		typeof length === "number" && length > 0 && ( length - 1 ) in obj;
 }
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
+var Sizzle =
 /*!
- * Sizzle CSS Selector Engine v1.10.2
+ * Sizzle CSS Selector Engine v1.10.19
  * http://sizzlejs.com/
  *
  * Copyright 2013 jQuery Foundation, Inc. and other contributors
  * Released under the MIT license
  * http://jquery.org/license
  *
- * Date: 2013-07-03
+ * Date: 2014-04-18
  */
-(function( window, undefined ) {
+(function( window ) {
 
 var i,
 	support,
-	cachedruns,
 	Expr,
 	getText,
 	isXML,
+	tokenize,
 	compile,
+	select,
 	outermostContext,
 	sortInput,
+	hasDuplicate,
 
 	// Local document vars
 	setDocument,
@@ -1039,11 +625,9 @@ var i,
 	classCache = createCache(),
 	tokenCache = createCache(),
 	compilerCache = createCache(),
-	hasDuplicate = false,
 	sortOrder = function( a, b ) {
 		if ( a === b ) {
 			hasDuplicate = true;
-			return 0;
 		}
 		return 0;
 	},
@@ -1085,17 +669,23 @@ var i,
 	// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
 	identifier = characterEncoding.replace( "w", "w#" ),
 
-	// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
-	attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
-		"*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
-
-	// Prefer arguments quoted,
-	//   then not containing pseudos/brackets,
-	//   then attribute selectors/non-parenthetical expressions,
-	//   then anything else
-	// These preferences are here to reduce the number of selectors
-	//   needing tokenize in the PSEUDO preFilter
-	pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
+	// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+	attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
+		// Operator (capture 2)
+		"*([*^$|!~]?=)" + whitespace +
+		// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
+		"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
+		"*\\]",
+
+	pseudos = ":(" + characterEncoding + ")(?:\\((" +
+		// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
+		// 1. quoted (capture 3; capture 4 or capture 5)
+		"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
+		// 2. simple (capture 6)
+		"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
+		// 3. anything else (capture 2)
+		".*" +
+		")\\)|)",
 
 	// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
 	rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
@@ -1103,8 +693,7 @@ var i,
 	rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
 	rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
 
-	rsibling = new RegExp( whitespace + "*[+~]" ),
-	rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
+	rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
 
 	rpseudo = new RegExp( pseudos ),
 	ridentifier = new RegExp( "^" + identifier + "$" ),
@@ -1125,14 +714,15 @@ var i,
 			whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
 	},
 
+	rinputs = /^(?:input|select|textarea|button)$/i,
+	rheader = /^h\d$/i,
+
 	rnative = /^[^{]+\{\s*\[native \w/,
 
 	// Easily-parseable/retrievable ID or TAG or CLASS selectors
 	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
 
-	rinputs = /^(?:input|select|textarea|button)$/i,
-	rheader = /^h\d$/i,
-
+	rsibling = /[+~]/,
 	rescape = /'|\\/g,
 
 	// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
@@ -1140,12 +730,12 @@ var i,
 	funescape = function( _, escaped, escapedWhitespace ) {
 		var high = "0x" + escaped - 0x10000;
 		// NaN means non-codepoint
-		// Support: Firefox
+		// Support: Firefox<24
 		// Workaround erroneous numeric interpretation of +"0x"
 		return high !== high || escapedWhitespace ?
 			escaped :
-			// BMP codepoint
 			high < 0 ?
+				// BMP codepoint
 				String.fromCharCode( high + 0x10000 ) :
 				// Supplemental Plane codepoint (surrogate pair)
 				String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
@@ -1209,7 +799,7 @@ function Sizzle( selector, context, results, seed ) {
 				if ( nodeType === 9 ) {
 					elem = context.getElementById( m );
 					// Check parentNode to catch when Blackberry 4.6 returns
-					// nodes that are no longer in the document #6963
+					// nodes that are no longer in the document (jQuery #6963)
 					if ( elem && elem.parentNode ) {
 						// Handle the case where IE, Opera, and Webkit return items
 						// by name instead of ID
@@ -1265,7 +855,7 @@ function Sizzle( selector, context, results, seed ) {
 				while ( i-- ) {
 					groups[i] = nid + toSelector( groups[i] );
 				}
-				newContext = rsibling.test( selector ) && context.parentNode || context;
+				newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
 				newSelector = groups.join(",");
 			}
 
@@ -1300,11 +890,11 @@ function createCache() {
 
 	function cache( key, value ) {
 		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
-		if ( keys.push( key += " " ) > Expr.cacheLength ) {
+		if ( keys.push( key + " " ) > Expr.cacheLength ) {
 			// Only keep the most recent entries
 			delete cache[ keys.shift() ];
 		}
-		return (cache[ key ] = value);
+		return (cache[ key + " " ] = value);
 	}
 	return cache;
 }
@@ -1427,8 +1017,21 @@ function createPositionalPseudo( fn ) {
 }
 
 /**
- * Detect xml
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+	return context && typeof context.getElementsByTagName !== strundefined && context;
+}
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
  * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
  */
 isXML = Sizzle.isXML = function( elem ) {
 	// documentElement is verified for cases where it doesn't yet exist
@@ -1437,16 +1040,14 @@ isXML = Sizzle.isXML = function( elem ) {
 	return documentElement ? documentElement.nodeName !== "HTML" : false;
 };
 
-// Expose support vars for convenience
-support = Sizzle.support = {};
-
 /**
  * Sets document-related variables once based on the current document
  * @param {Element|Object} [doc] An element or document object to use to set the document
  * @returns {Object} Returns the current document
  */
 setDocument = Sizzle.setDocument = function( node ) {
-	var doc = node ? node.ownerDocument || node : preferredDoc,
+	var hasCompare,
+		doc = node ? node.ownerDocument || node : preferredDoc,
 		parent = doc.defaultView;
 
 	// If no document and documentElement is available, return
@@ -1465,10 +1066,17 @@ setDocument = Sizzle.setDocument = function( node ) {
 	// If iframe document is assigned to "document" variable and if iframe has been reloaded,
 	// IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
 	// IE6-8 do not support the defaultView property so parent will be undefined
-	if ( parent && parent.attachEvent && parent !== parent.top ) {
-		parent.attachEvent( "onbeforeunload", function() {
-			setDocument();
-		});
+	if ( parent && parent !== parent.top ) {
+		// IE11 does not have attachEvent, so all must suffer
+		if ( parent.addEventListener ) {
+			parent.addEventListener( "unload", function() {
+				setDocument();
+			}, false );
+		} else if ( parent.attachEvent ) {
+			parent.attachEvent( "onunload", function() {
+				setDocument();
+			});
+		}
 	}
 
 	/* Attributes
@@ -1491,7 +1099,7 @@ setDocument = Sizzle.setDocument = function( node ) {
 	});
 
 	// Check if getElementsByClassName can be trusted
-	support.getElementsByClassName = assert(function( div ) {
+	support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
 		div.innerHTML = "<div class='a'></div><div class='a i'></div>";
 
 		// Support: Safari<4
@@ -1518,7 +1126,7 @@ setDocument = Sizzle.setDocument = function( node ) {
 				var m = context.getElementById( id );
 				// Check parentNode to catch when Blackberry 4.6 returns
 				// nodes that are no longer in the document #6963
-				return m && m.parentNode ? [m] : [];
+				return m && m.parentNode ? [ m ] : [];
 			}
 		};
 		Expr.filter["ID"] = function( id ) {
@@ -1598,7 +1206,15 @@ setDocument = Sizzle.setDocument = function( node ) {
 			// setting a boolean content attribute,
 			// since its presence should be enough
 			// http://bugs.jquery.com/ticket/12359
-			div.innerHTML = "<select><option selected=''></option></select>";
+			div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
+
+			// Support: IE8, Opera 11-12.16
+			// Nothing should be selected when empty strings follow ^= or $= or *=
+			// The test attribute must be unknown in Opera but "safe" for WinRT
+			// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
+			if ( div.querySelectorAll("[msallowclip^='']").length ) {
+				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+			}
 
 			// Support: IE8
 			// Boolean attributes and "value" are not treated correctly
@@ -1615,18 +1231,16 @@ setDocument = Sizzle.setDocument = function( node ) {
 		});
 
 		assert(function( div ) {
-
-			// Support: Opera 10-12/IE8
-			// ^= $= *= and empty values
-			// Should not select anything
 			// Support: Windows 8 Native Apps
-			// The type attribute is restricted during .innerHTML assignment
+			// The type and name attributes are restricted during .innerHTML assignment
 			var input = doc.createElement("input");
 			input.setAttribute( "type", "hidden" );
-			div.appendChild( input ).setAttribute( "t", "" );
+			div.appendChild( input ).setAttribute( "name", "D" );
 
-			if ( div.querySelectorAll("[t^='']").length ) {
-				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+			// Support: IE8
+			// Enforce case-sensitivity of name attribute
+			if ( div.querySelectorAll("[name=d]").length ) {
+				rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
 			}
 
 			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
@@ -1641,7 +1255,8 @@ setDocument = Sizzle.setDocument = function( node ) {
 		});
 	}
 
-	if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
+	if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
+		docElem.webkitMatchesSelector ||
 		docElem.mozMatchesSelector ||
 		docElem.oMatchesSelector ||
 		docElem.msMatchesSelector) )) ) {
@@ -1663,11 +1278,12 @@ setDocument = Sizzle.setDocument = function( node ) {
 
 	/* Contains
 	---------------------------------------------------------------------- */
+	hasCompare = rnative.test( docElem.compareDocumentPosition );
 
 	// Element contains another
 	// Purposefully does not implement inclusive descendent
 	// As in, an element does not contain itself
-	contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?
+	contains = hasCompare || rnative.test( docElem.contains ) ?
 		function( a, b ) {
 			var adown = a.nodeType === 9 ? a.documentElement : a,
 				bup = b && b.parentNode;
@@ -1692,7 +1308,7 @@ setDocument = Sizzle.setDocument = function( node ) {
 	---------------------------------------------------------------------- */
 
 	// Document order sorting
-	sortOrder = docElem.compareDocumentPosition ?
+	sortOrder = hasCompare ?
 	function( a, b ) {
 
 		// Flag for duplicate removal
@@ -1701,34 +1317,46 @@ setDocument = Sizzle.setDocument = function( node ) {
 			return 0;
 		}
 
-		var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
-
+		// Sort on method existence if only one input has compareDocumentPosition
+		var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
 		if ( compare ) {
-			// Disconnected nodes
-			if ( compare & 1 ||
-				(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+			return compare;
+		}
 
-				// Choose the first element that is related to our preferred document
-				if ( a === doc || contains(preferredDoc, a) ) {
-					return -1;
-				}
-				if ( b === doc || contains(preferredDoc, b) ) {
-					return 1;
-				}
+		// Calculate position if both inputs belong to the same document
+		compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+			a.compareDocumentPosition( b ) :
+
+			// Otherwise we know they are disconnected
+			1;
 
-				// Maintain original order
-				return sortInput ?
-					( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
-					0;
+		// Disconnected nodes
+		if ( compare & 1 ||
+			(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+			// Choose the first element that is related to our preferred document
+			if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+				return -1;
+			}
+			if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+				return 1;
 			}
 
-			return compare & 4 ? -1 : 1;
+			// Maintain original order
+			return sortInput ?
+				( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+				0;
 		}
 
-		// Not directly comparable, sort on existence of method
-		return a.compareDocumentPosition ? -1 : 1;
+		return compare & 4 ? -1 : 1;
 	} :
 	function( a, b ) {
+		// Exit early if the nodes are identical
+		if ( a === b ) {
+			hasDuplicate = true;
+			return 0;
+		}
+
 		var cur,
 			i = 0,
 			aup = a.parentNode,
@@ -1736,13 +1364,8 @@ setDocument = Sizzle.setDocument = function( node ) {
 			ap = [ a ],
 			bp = [ b ];
 
-		// Exit early if the nodes are identical
-		if ( a === b ) {
-			hasDuplicate = true;
-			return 0;
-
 		// Parentless nodes are either documents or disconnected
-		} else if ( !aup || !bup ) {
+		if ( !aup || !bup ) {
 			return a === doc ? -1 :
 				b === doc ? 1 :
 				aup ? -1 :
@@ -1814,7 +1437,7 @@ Sizzle.matchesSelector = function( elem, expr ) {
 		} catch(e) {}
 	}
 
-	return Sizzle( expr, document, null, [elem] ).length > 0;
+	return Sizzle( expr, document, null, [ elem ] ).length > 0;
 };
 
 Sizzle.contains = function( context, elem ) {
@@ -1837,13 +1460,13 @@ Sizzle.attr = function( elem, name ) {
 			fn( elem, name, !documentIsHTML ) :
 			undefined;
 
-	return val === undefined ?
+	return val !== undefined ?
+		val :
 		support.attributes || !documentIsHTML ?
 			elem.getAttribute( name ) :
 			(val = elem.getAttributeNode(name)) && val.specified ?
 				val.value :
-				null :
-		val;
+				null;
 };
 
 Sizzle.error = function( msg ) {
@@ -1876,6 +1499,10 @@ Sizzle.uniqueSort = function( results ) {
 		}
 	}
 
+	// Clear input after sorting to release objects
+	// See https://github.com/jquery/sizzle/pull/225
+	sortInput = null;
+
 	return results;
 };
 
@@ -1891,13 +1518,13 @@ getText = Sizzle.getText = function( elem ) {
 
 	if ( !nodeType ) {
 		// If no nodeType, this is expected to be an array
-		for ( ; (node = elem[i]); i++ ) {
+		while ( (node = elem[i++]) ) {
 			// Do not traverse comment nodes
 			ret += getText( node );
 		}
 	} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
 		// Use textContent for elements
-		// innerText usage removed for consistency of new lines (see #11153)
+		// innerText usage removed for consistency of new lines (jQuery #11153)
 		if ( typeof elem.textContent === "string" ) {
 			return elem.textContent;
 		} else {
@@ -1939,7 +1566,7 @@ Expr = Sizzle.selectors = {
 			match[1] = match[1].replace( runescape, funescape );
 
 			// Move the given value to match[3] whether quoted or unquoted
-			match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
+			match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
 
 			if ( match[2] === "~=" ) {
 				match[3] = " " + match[3] + " ";
@@ -1982,15 +1609,15 @@ Expr = Sizzle.selectors = {
 
 		"PSEUDO": function( match ) {
 			var excess,
-				unquoted = !match[5] && match[2];
+				unquoted = !match[6] && match[2];
 
 			if ( matchExpr["CHILD"].test( match[0] ) ) {
 				return null;
 			}
 
 			// Accept quoted arguments as-is
-			if ( match[3] && match[4] !== undefined ) {
-				match[2] = match[4];
+			if ( match[3] ) {
+				match[2] = match[4] || match[5] || "";
 
 			// Strip excess characters from unquoted arguments
 			} else if ( unquoted && rpseudo.test( unquoted ) &&
@@ -2294,12 +1921,11 @@ Expr = Sizzle.selectors = {
 		// Contents
 		"empty": function( elem ) {
 			// http://www.w3.org/TR/selectors/#empty-pseudo
-			// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
-			//   not comment, processing instructions, or others
-			// Thanks to Diego Perini for the nodeName shortcut
-			//   Greater than "@" means alpha characters (specifically not starting with "#" or "?")
+			// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
+			//   but not by others (comment: 8; processing instruction: 7; etc.)
+			// nodeType < 6 works because attributes (2) do not appear as children
 			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
-				if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
+				if ( elem.nodeType < 6 ) {
 					return false;
 				}
 			}
@@ -2326,11 +1952,12 @@ Expr = Sizzle.selectors = {
 
 		"text": function( elem ) {
 			var attr;
-			// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
-			// use getAttribute instead to test this case
 			return elem.nodeName.toLowerCase() === "input" &&
 				elem.type === "text" &&
-				( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
+
+				// Support: IE<8
+				// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+				( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
 		},
 
 		// Position-in-collection
@@ -2395,7 +2022,7 @@ function setFilters() {}
 setFilters.prototype = Expr.filters = Expr.pseudos;
 Expr.setFilters = new setFilters();
 
-function tokenize( selector, parseOnly ) {
+tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
 	var matched, match, tokens, type,
 		soFar, groups, preFilters,
 		cached = tokenCache[ selector + " " ];
@@ -2416,7 +2043,7 @@ function tokenize( selector, parseOnly ) {
 				// Don't consume trailing commas as valid
 				soFar = soFar.slice( match[0].length ) || soFar;
 			}
-			groups.push( tokens = [] );
+			groups.push( (tokens = []) );
 		}
 
 		matched = false;
@@ -2460,7 +2087,7 @@ function tokenize( selector, parseOnly ) {
 			Sizzle.error( selector ) :
 			// Cache the tokens
 			tokenCache( selector, groups ).slice( 0 );
-}
+};
 
 function toSelector( tokens ) {
 	var i = 0,
@@ -2489,8 +2116,8 @@ function addCombinator( matcher, combinator, base ) {
 
 		// Check against all ancestor/preceding elements
 		function( elem, context, xml ) {
-			var data, cache, outerCache,
-				dirkey = dirruns + " " + doneName;
+			var oldCache, outerCache,
+				newCache = [ dirruns, doneName ];
 
 			// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
 			if ( xml ) {
@@ -2505,14 +2132,17 @@ function addCombinator( matcher, combinator, base ) {
 				while ( (elem = elem[ dir ]) ) {
 					if ( elem.nodeType === 1 || checkNonElements ) {
 						outerCache = elem[ expando ] || (elem[ expando ] = {});
-						if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
-							if ( (data = cache[1]) === true || data === cachedruns ) {
-								return data === true;
-							}
+						if ( (oldCache = outerCache[ dir ]) &&
+							oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+							// Assign to newCache so results back-propagate to previous elements
+							return (newCache[ 2 ] = oldCache[ 2 ]);
 						} else {
-							cache = outerCache[ dir ] = [ dirkey ];
-							cache[1] = matcher( elem, context, xml ) || cachedruns;
-							if ( cache[1] === true ) {
+							// Reuse newcache so results back-propagate to previous elements
+							outerCache[ dir ] = newCache;
+
+							// A match means we're done; a fail means we have to keep checking
+							if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
 								return true;
 							}
 						}
@@ -2536,6 +2166,15 @@ function elementMatcher( matchers ) {
 		matchers[0];
 }
 
+function multipleContexts( selector, contexts, results ) {
+	var i = 0,
+		len = contexts.length;
+	for ( ; i < len; i++ ) {
+		Sizzle( selector, contexts[i], results );
+	}
+	return results;
+}
+
 function condense( unmatched, map, filter, context, xml ) {
 	var elem,
 		newUnmatched = [],
@@ -2706,31 +2345,30 @@ function matcherFromTokens( tokens ) {
 }
 
 function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
-	// A counter to specify which element is currently being matched
-	var matcherCachedRuns = 0,
-		bySet = setMatchers.length > 0,
+	var bySet = setMatchers.length > 0,
 		byElement = elementMatchers.length > 0,
-		superMatcher = function( seed, context, xml, results, expandContext ) {
+		superMatcher = function( seed, context, xml, results, outermost ) {
 			var elem, j, matcher,
-				setMatched = [],
 				matchedCount = 0,
 				i = "0",
 				unmatched = seed && [],
-				outermost = expandContext != null,
+				setMatched = [],
 				contextBackup = outermostContext,
-				// We must always have either seed elements or context
-				elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
+				// We must always have either seed elements or outermost context
+				elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
 				// Use integer dirruns iff this is the outermost matcher
-				dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
+				dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+				len = elems.length;
 
 			if ( outermost ) {
 				outermostContext = context !== document && context;
-				cachedruns = matcherCachedRuns;
 			}
 
 			// Add elements passing elementMatchers directly to results
 			// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
-			for ( ; (elem = elems[i]) != null; i++ ) {
+			// Support: IE<9, Safari
+			// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
+			for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
 				if ( byElement && elem ) {
 					j = 0;
 					while ( (matcher = elementMatchers[j++]) ) {
@@ -2741,7 +2379,6 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
 					}
 					if ( outermost ) {
 						dirruns = dirrunsUnique;
-						cachedruns = ++matcherCachedRuns;
 					}
 				}
 
@@ -2806,7 +2443,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
 		superMatcher;
 }
 
-compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
 	var i,
 		setMatchers = [],
 		elementMatchers = [],
@@ -2814,12 +2451,12 @@ compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
 
 	if ( !cached ) {
 		// Generate a function of recursive functions that can be used to check each element
-		if ( !group ) {
-			group = tokenize( selector );
+		if ( !match ) {
+			match = tokenize( selector );
 		}
-		i = group.length;
+		i = match.length;
 		while ( i-- ) {
-			cached = matcherFromTokens( group[i] );
+			cached = matcherFromTokens( match[i] );
 			if ( cached[ expando ] ) {
 				setMatchers.push( cached );
 			} else {
@@ -2829,82 +2466,91 @@ compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
 
 		// Cache the compiled function
 		cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+
+		// Save selector and tokenization
+		cached.selector = selector;
 	}
 	return cached;
 };
 
-function multipleContexts( selector, contexts, results ) {
-	var i = 0,
-		len = contexts.length;
-	for ( ; i < len; i++ ) {
-		Sizzle( selector, contexts[i], results );
-	}
-	return results;
-}
-
-function select( selector, context, results, seed ) {
+/**
+ * A low-level selection function that works with Sizzle's compiled
+ *  selector functions
+ * @param {String|Function} selector A selector or a pre-compiled
+ *  selector function built with Sizzle.compile
+ * @param {Element} context
+ * @param {Array} [results]
+ * @param {Array} [seed] A set of elements to match against
+ */
+select = Sizzle.select = function( selector, context, results, seed ) {
 	var i, tokens, token, type, find,
-		match = tokenize( selector );
+		compiled = typeof selector === "function" && selector,
+		match = !seed && tokenize( (selector = compiled.selector || selector) );
 
-	if ( !seed ) {
-		// Try to minimize operations if there is only one group
-		if ( match.length === 1 ) {
+	results = results || [];
 
-			// Take a shortcut and set the context if the root selector is an ID
-			tokens = match[0] = match[0].slice( 0 );
-			if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
-					support.getById && context.nodeType === 9 && documentIsHTML &&
-					Expr.relative[ tokens[1].type ] ) {
+	// Try to minimize operations if there is no seed and only one group
+	if ( match.length === 1 ) {
 
-				context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
-				if ( !context ) {
-					return results;
-				}
-				selector = selector.slice( tokens.shift().value.length );
+		// Take a shortcut and set the context if the root selector is an ID
+		tokens = match[0] = match[0].slice( 0 );
+		if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+				support.getById && context.nodeType === 9 && documentIsHTML &&
+				Expr.relative[ tokens[1].type ] ) {
+
+			context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+			if ( !context ) {
+				return results;
+
+			// Precompiled matchers will still verify ancestry, so step up a level
+			} else if ( compiled ) {
+				context = context.parentNode;
 			}
 
-			// Fetch a seed set for right-to-left matching
-			i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
-			while ( i-- ) {
-				token = tokens[i];
+			selector = selector.slice( tokens.shift().value.length );
+		}
 
-				// Abort if we hit a combinator
-				if ( Expr.relative[ (type = token.type) ] ) {
-					break;
-				}
-				if ( (find = Expr.find[ type ]) ) {
-					// Search, expanding context for leading sibling combinators
-					if ( (seed = find(
-						token.matches[0].replace( runescape, funescape ),
-						rsibling.test( tokens[0].type ) && context.parentNode || context
-					)) ) {
-
-						// If seed is empty or no tokens remain, we can return early
-						tokens.splice( i, 1 );
-						selector = seed.length && toSelector( tokens );
-						if ( !selector ) {
-							push.apply( results, seed );
-							return results;
-						}
+		// Fetch a seed set for right-to-left matching
+		i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+		while ( i-- ) {
+			token = tokens[i];
 
-						break;
+			// Abort if we hit a combinator
+			if ( Expr.relative[ (type = token.type) ] ) {
+				break;
+			}
+			if ( (find = Expr.find[ type ]) ) {
+				// Search, expanding context for leading sibling combinators
+				if ( (seed = find(
+					token.matches[0].replace( runescape, funescape ),
+					rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+				)) ) {
+
+					// If seed is empty or no tokens remain, we can return early
+					tokens.splice( i, 1 );
+					selector = seed.length && toSelector( tokens );
+					if ( !selector ) {
+						push.apply( results, seed );
+						return results;
 					}
+
+					break;
 				}
 			}
 		}
 	}
 
-	// Compile and execute a filtering function
+	// Compile and execute a filtering function if one is not provided
 	// Provide `match` to avoid retokenization if we modified the selector above
-	compile( selector, match )(
+	( compiled || compile( selector, match ) )(
 		seed,
 		context,
 		!documentIsHTML,
 		results,
-		rsibling.test( selector )
+		rsibling.test( selector ) && testContext( context.parentNode ) || context
 	);
 	return results;
-}
+};
 
 // One-time assignments
 
@@ -2913,7 +2559,7 @@ support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
 
 // Support: Chrome<14
 // Always assume duplicates if they aren't passed to the comparison function
-support.detectDuplicates = hasDuplicate;
+support.detectDuplicates = !!hasDuplicate;
 
 // Initialize against the default document
 setDocument();
@@ -2961,13 +2607,20 @@ if ( !assert(function( div ) {
 	addHandle( booleans, function( elem, name, isXML ) {
 		var val;
 		if ( !isXML ) {
-			return (val = elem.getAttributeNode( name )) && val.specified ?
-				val.value :
-				elem[ name ] === true ? name.toLowerCase() : null;
+			return elem[ name ] === true ? name.toLowerCase() :
+					(val = elem.getAttributeNode( name )) && val.specified ?
+					val.value :
+				null;
 		}
 	});
 }
 
+return Sizzle;
+
+})( window );
+
+
+
 jQuery.find = Sizzle;
 jQuery.expr = Sizzle.selectors;
 jQuery.expr[":"] = jQuery.expr.pseudos;
@@ -2977,54 +2630,472 @@ jQuery.isXMLDoc = Sizzle.isXML;
 jQuery.contains = Sizzle.contains;
 
 
-})( window );
-// String to Object options format cache
-var optionsCache = {};
 
-// Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
-	var object = optionsCache[ options ] = {};
-	jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
-		object[ flag ] = true;
-	});
-	return object;
-}
+var rneedsContext = jQuery.expr.match.needsContext;
 
-/*
- * Create a callback list using the following parameters:
- *
- *	options: an optional list of space-separated options that will change how
- *			the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- *	once:			will ensure the callback list can only be fired once (like a Deferred)
- *
- *	memory:			will keep track of previous values and will call any callback added
- *					after the list has been fired right away with the latest "memorized"
- *					values (like a Deferred)
- *
- *	unique:			will ensure a callback can only be added once (no duplicate in the list)
- *
- *	stopOnFalse:	interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( options ) {
+var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
 
-	// Convert options from String-formatted to Object-formatted if needed
-	// (we check in cache first)
-	options = typeof options === "string" ?
-		( optionsCache[ options ] || createOptions( options ) ) :
-		jQuery.extend( {}, options );
 
-	var // Flag to know if list is currently firing
-		firing,
-		// Last fire value (for non-forgettable lists)
-		memory,
-		// Flag to know if list was already fired
+
+var risSimple = /^.[^:#\[\.,]*$/;
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, not ) {
+	if ( jQuery.isFunction( qualifier ) ) {
+		return jQuery.grep( elements, function( elem, i ) {
+			/* jshint -W018 */
+			return !!qualifier.call( elem, i, elem ) !== not;
+		});
+
+	}
+
+	if ( qualifier.nodeType ) {
+		return jQuery.grep( elements, function( elem ) {
+			return ( elem === qualifier ) !== not;
+		});
+
+	}
+
+	if ( typeof qualifier === "string" ) {
+		if ( risSimple.test( qualifier ) ) {
+			return jQuery.filter( qualifier, elements, not );
+		}
+
+		qualifier = jQuery.filter( qualifier, elements );
+	}
+
+	return jQuery.grep( elements, function( elem ) {
+		return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
+	});
+}
+
+jQuery.filter = function( expr, elems, not ) {
+	var elem = elems[ 0 ];
+
+	if ( not ) {
+		expr = ":not(" + expr + ")";
+	}
+
+	return elems.length === 1 && elem.nodeType === 1 ?
+		jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
+		jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+			return elem.nodeType === 1;
+		}));
+};
+
+jQuery.fn.extend({
+	find: function( selector ) {
+		var i,
+			ret = [],
+			self = this,
+			len = self.length;
+
+		if ( typeof selector !== "string" ) {
+			return this.pushStack( jQuery( selector ).filter(function() {
+				for ( i = 0; i < len; i++ ) {
+					if ( jQuery.contains( self[ i ], this ) ) {
+						return true;
+					}
+				}
+			}) );
+		}
+
+		for ( i = 0; i < len; i++ ) {
+			jQuery.find( selector, self[ i ], ret );
+		}
+
+		// Needed because $( selector, context ) becomes $( context ).find( selector )
+		ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
+		ret.selector = this.selector ? this.selector + " " + selector : selector;
+		return ret;
+	},
+	filter: function( selector ) {
+		return this.pushStack( winnow(this, selector || [], false) );
+	},
+	not: function( selector ) {
+		return this.pushStack( winnow(this, selector || [], true) );
+	},
+	is: function( selector ) {
+		return !!winnow(
+			this,
+
+			// If this is a positional/relative selector, check membership in the returned set
+			// so $("p:first").is("p:last") won't return true for a doc with two "p".
+			typeof selector === "string" && rneedsContext.test( selector ) ?
+				jQuery( selector ) :
+				selector || [],
+			false
+		).length;
+	}
+});
+
+
+// Initialize a jQuery object
+
+
+// A central reference to the root jQuery(document)
+var rootjQuery,
+
+	// Use the correct document accordingly with window argument (sandbox)
+	document = window.document,
+
+	// A simple way to check for HTML strings
+	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+	// Strict HTML recognition (#11290: must start with <)
+	rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+	init = jQuery.fn.init = function( selector, context ) {
+		var match, elem;
+
+		// HANDLE: $(""), $(null), $(undefined), $(false)
+		if ( !selector ) {
+			return this;
+		}
+
+		// Handle HTML strings
+		if ( typeof selector === "string" ) {
+			if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+				// Assume that strings that start and end with <> are HTML and skip the regex check
+				match = [ null, selector, null ];
+
+			} else {
+				match = rquickExpr.exec( selector );
+			}
+
+			// Match html or make sure no context is specified for #id
+			if ( match && (match[1] || !context) ) {
+
+				// HANDLE: $(html) -> $(array)
+				if ( match[1] ) {
+					context = context instanceof jQuery ? context[0] : context;
+
+					// scripts is true for back-compat
+					// Intentionally let the error be thrown if parseHTML is not present
+					jQuery.merge( this, jQuery.parseHTML(
+						match[1],
+						context && context.nodeType ? context.ownerDocument || context : document,
+						true
+					) );
+
+					// HANDLE: $(html, props)
+					if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+						for ( match in context ) {
+							// Properties of context are called as methods if possible
+							if ( jQuery.isFunction( this[ match ] ) ) {
+								this[ match ]( context[ match ] );
+
+							// ...and otherwise set as attributes
+							} else {
+								this.attr( match, context[ match ] );
+							}
+						}
+					}
+
+					return this;
+
+				// HANDLE: $(#id)
+				} else {
+					elem = document.getElementById( match[2] );
+
+					// Check parentNode to catch when Blackberry 4.6 returns
+					// nodes that are no longer in the document #6963
+					if ( elem && elem.parentNode ) {
+						// Handle the case where IE and Opera return items
+						// by name instead of ID
+						if ( elem.id !== match[2] ) {
+							return rootjQuery.find( selector );
+						}
+
+						// Otherwise, we inject the element directly into the jQuery object
+						this.length = 1;
+						this[0] = elem;
+					}
+
+					this.context = document;
+					this.selector = selector;
+					return this;
+				}
+
+			// HANDLE: $(expr, $(...))
+			} else if ( !context || context.jquery ) {
+				return ( context || rootjQuery ).find( selector );
+
+			// HANDLE: $(expr, context)
+			// (which is just equivalent to: $(context).find(expr)
+			} else {
+				return this.constructor( context ).find( selector );
+			}
+
+		// HANDLE: $(DOMElement)
+		} else if ( selector.nodeType ) {
+			this.context = this[0] = selector;
+			this.length = 1;
+			return this;
+
+		// HANDLE: $(function)
+		// Shortcut for document ready
+		} else if ( jQuery.isFunction( selector ) ) {
+			return typeof rootjQuery.ready !== "undefined" ?
+				rootjQuery.ready( selector ) :
+				// Execute immediately if ready is not present
+				selector( jQuery );
+		}
+
+		if ( selector.selector !== undefined ) {
+			this.selector = selector.selector;
+			this.context = selector.context;
+		}
+
+		return jQuery.makeArray( selector, this );
+	};
+
+// Give the init function the jQuery prototype for later instantiation
+init.prototype = jQuery.fn;
+
+// Initialize central reference
+rootjQuery = jQuery( document );
+
+
+var rparentsprev = /^(?:parents|prev(?:Until|All))/,
+	// methods guaranteed to produce a unique set when starting from a unique set
+	guaranteedUnique = {
+		children: true,
+		contents: true,
+		next: true,
+		prev: true
+	};
+
+jQuery.extend({
+	dir: function( elem, dir, until ) {
+		var matched = [],
+			cur = elem[ dir ];
+
+		while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+			if ( cur.nodeType === 1 ) {
+				matched.push( cur );
+			}
+			cur = cur[dir];
+		}
+		return matched;
+	},
+
+	sibling: function( n, elem ) {
+		var r = [];
+
+		for ( ; n; n = n.nextSibling ) {
+			if ( n.nodeType === 1 && n !== elem ) {
+				r.push( n );
+			}
+		}
+
+		return r;
+	}
+});
+
+jQuery.fn.extend({
+	has: function( target ) {
+		var i,
+			targets = jQuery( target, this ),
+			len = targets.length;
+
+		return this.filter(function() {
+			for ( i = 0; i < len; i++ ) {
+				if ( jQuery.contains( this, targets[i] ) ) {
+					return true;
+				}
+			}
+		});
+	},
+
+	closest: function( selectors, context ) {
+		var cur,
+			i = 0,
+			l = this.length,
+			matched = [],
+			pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
+				jQuery( selectors, context || this.context ) :
+				0;
+
+		for ( ; i < l; i++ ) {
+			for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
+				// Always skip document fragments
+				if ( cur.nodeType < 11 && (pos ?
+					pos.index(cur) > -1 :
+
+					// Don't pass non-elements to Sizzle
+					cur.nodeType === 1 &&
+						jQuery.find.matchesSelector(cur, selectors)) ) {
+
+					matched.push( cur );
+					break;
+				}
+			}
+		}
+
+		return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
+	},
+
+	// Determine the position of an element within
+	// the matched set of elements
+	index: function( elem ) {
+
+		// No argument, return index in parent
+		if ( !elem ) {
+			return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
+		}
+
+		// index in selector
+		if ( typeof elem === "string" ) {
+			return jQuery.inArray( this[0], jQuery( elem ) );
+		}
+
+		// Locate the position of the desired element
+		return jQuery.inArray(
+			// If it receives a jQuery object, the first element is used
+			elem.jquery ? elem[0] : elem, this );
+	},
+
+	add: function( selector, context ) {
+		return this.pushStack(
+			jQuery.unique(
+				jQuery.merge( this.get(), jQuery( selector, context ) )
+			)
+		);
+	},
+
+	addBack: function( selector ) {
+		return this.add( selector == null ?
+			this.prevObject : this.prevObject.filter(selector)
+		);
+	}
+});
+
+function sibling( cur, dir ) {
+	do {
+		cur = cur[ dir ];
+	} while ( cur && cur.nodeType !== 1 );
+
+	return cur;
+}
+
+jQuery.each({
+	parent: function( elem ) {
+		var parent = elem.parentNode;
+		return parent && parent.nodeType !== 11 ? parent : null;
+	},
+	parents: function( elem ) {
+		return jQuery.dir( elem, "parentNode" );
+	},
+	parentsUntil: function( elem, i, until ) {
+		return jQuery.dir( elem, "parentNode", until );
+	},
+	next: function( elem ) {
+		return sibling( elem, "nextSibling" );
+	},
+	prev: function( elem ) {
+		return sibling( elem, "previousSibling" );
+	},
+	nextAll: function( elem ) {
+		return jQuery.dir( elem, "nextSibling" );
+	},
+	prevAll: function( elem ) {
+		return jQuery.dir( elem, "previousSibling" );
+	},
+	nextUntil: function( elem, i, until ) {
+		return jQuery.dir( elem, "nextSibling", until );
+	},
+	prevUntil: function( elem, i, until ) {
+		return jQuery.dir( elem, "previousSibling", until );
+	},
+	siblings: function( elem ) {
+		return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
+	},
+	children: function( elem ) {
+		return jQuery.sibling( elem.firstChild );
+	},
+	contents: function( elem ) {
+		return jQuery.nodeName( elem, "iframe" ) ?
+			elem.contentDocument || elem.contentWindow.document :
+			jQuery.merge( [], elem.childNodes );
+	}
+}, function( name, fn ) {
+	jQuery.fn[ name ] = function( until, selector ) {
+		var ret = jQuery.map( this, fn, until );
+
+		if ( name.slice( -5 ) !== "Until" ) {
+			selector = until;
+		}
+
+		if ( selector && typeof selector === "string" ) {
+			ret = jQuery.filter( selector, ret );
+		}
+
+		if ( this.length > 1 ) {
+			// Remove duplicates
+			if ( !guaranteedUnique[ name ] ) {
+				ret = jQuery.unique( ret );
+			}
+
+			// Reverse order for parents* and prev-derivatives
+			if ( rparentsprev.test( name ) ) {
+				ret = ret.reverse();
+			}
+		}
+
+		return this.pushStack( ret );
+	};
+});
+var rnotwhite = (/\S+/g);
+
+
+
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+	var object = optionsCache[ options ] = {};
+	jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
+		object[ flag ] = true;
+	});
+	return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ *	options: an optional list of space-separated options that will change how
+ *			the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ *	once:			will ensure the callback list can only be fired once (like a Deferred)
+ *
+ *	memory:			will keep track of previous values and will call any callback added
+ *					after the list has been fired right away with the latest "memorized"
+ *					values (like a Deferred)
+ *
+ *	unique:			will ensure a callback can only be added once (no duplicate in the list)
+ *
+ *	stopOnFalse:	interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+	// Convert options from String-formatted to Object-formatted if needed
+	// (we check in cache first)
+	options = typeof options === "string" ?
+		( optionsCache[ options ] || createOptions( options ) ) :
+		jQuery.extend( {}, options );
+
+	var // Flag to know if list is currently firing
+		firing,
+		// Last fire value (for non-forgettable lists)
+		memory,
+		// Flag to know if list was already fired
 		fired,
 		// End of the loop when firing
 		firingLength,
@@ -3101,7 +3172,7 @@ jQuery.Callbacks = function( options ) {
 				if ( list ) {
 					jQuery.each( arguments, function( _, arg ) {
 						var index;
-						while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+						while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
 							list.splice( index, 1 );
 							// Handle firing indexes
 							if ( firing ) {
@@ -3175,6 +3246,8 @@ jQuery.Callbacks = function( options ) {
 
 	return self;
 };
+
+
 jQuery.extend({
 
 	Deferred: function( func ) {
@@ -3197,8 +3270,7 @@ jQuery.extend({
 					var fns = arguments;
 					return jQuery.Deferred(function( newDefer ) {
 						jQuery.each( tuples, function( i, tuple ) {
-							var action = tuple[ 0 ],
-								fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+							var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
 							// deferred[ done | fail | progress ] for forwarding actions to newDefer
 							deferred[ tuple[1] ](function() {
 								var returned = fn && fn.apply( this, arguments );
@@ -3208,7 +3280,7 @@ jQuery.extend({
 										.fail( newDefer.reject )
 										.progress( newDefer.notify );
 								} else {
-									newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+									newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
 								}
 							});
 						});
@@ -3267,7 +3339,7 @@ jQuery.extend({
 	// Deferred helper
 	when: function( subordinate /* , ..., subordinateN */ ) {
 		var i = 0,
-			resolveValues = core_slice.call( arguments ),
+			resolveValues = slice.call( arguments ),
 			length = resolveValues.length,
 
 			// the count of uncompleted subordinates
@@ -3280,10 +3352,11 @@ jQuery.extend({
 			updateFunc = function( i, contexts, values ) {
 				return function( value ) {
 					contexts[ i ] = this;
-					values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
-					if( values === progressValues ) {
+					values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
+					if ( values === progressValues ) {
 						deferred.notifyWith( contexts, values );
-					} else if ( !( --remaining ) ) {
+
+					} else if ( !(--remaining) ) {
 						deferred.resolveWith( contexts, values );
 					}
 				};
@@ -3316,256 +3389,296 @@ jQuery.extend({
 		return deferred.promise();
 	}
 });
-jQuery.support = (function( support ) {
 
-	var all, a, input, select, fragment, opt, eventName, isSupported, i,
-		div = document.createElement("div");
 
-	// Setup
-	div.setAttribute( "className", "t" );
-	div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+// The deferred used on DOM ready
+var readyList;
 
-	// Finish early in limited (non-browser) environments
-	all = div.getElementsByTagName("*") || [];
-	a = div.getElementsByTagName("a")[ 0 ];
-	if ( !a || !a.style || !all.length ) {
-		return support;
-	}
+jQuery.fn.ready = function( fn ) {
+	// Add the callback
+	jQuery.ready.promise().done( fn );
 
-	// First batch of tests
-	select = document.createElement("select");
-	opt = select.appendChild( document.createElement("option") );
-	input = div.getElementsByTagName("input")[ 0 ];
+	return this;
+};
 
-	a.style.cssText = "top:1px;float:left;opacity:.5";
+jQuery.extend({
+	// Is the DOM ready to be used? Set to true once it occurs.
+	isReady: false,
 
-	// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
-	support.getSetAttribute = div.className !== "t";
+	// A counter to track how many items to wait for before
+	// the ready event fires. See #6781
+	readyWait: 1,
 
-	// IE strips leading whitespace when .innerHTML is used
-	support.leadingWhitespace = div.firstChild.nodeType === 3;
+	// Hold (or release) the ready event
+	holdReady: function( hold ) {
+		if ( hold ) {
+			jQuery.readyWait++;
+		} else {
+			jQuery.ready( true );
+		}
+	},
 
-	// Make sure that tbody elements aren't automatically inserted
-	// IE will insert them into empty tables
-	support.tbody = !div.getElementsByTagName("tbody").length;
+	// Handle when the DOM is ready
+	ready: function( wait ) {
 
-	// Make sure that link elements get serialized correctly by innerHTML
-	// This requires a wrapper element in IE
-	support.htmlSerialize = !!div.getElementsByTagName("link").length;
+		// Abort if there are pending holds or we're already ready
+		if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+			return;
+		}
 
-	// Get the style information from getAttribute
-	// (IE uses .cssText instead)
-	support.style = /top/.test( a.getAttribute("style") );
+		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+		if ( !document.body ) {
+			return setTimeout( jQuery.ready );
+		}
 
-	// Make sure that URLs aren't manipulated
-	// (IE normalizes it by default)
-	support.hrefNormalized = a.getAttribute("href") === "/a";
+		// Remember that the DOM is ready
+		jQuery.isReady = true;
 
-	// Make sure that element opacity exists
-	// (IE uses filter instead)
-	// Use a regex to work around a WebKit issue. See #5145
-	support.opacity = /^0.5/.test( a.style.opacity );
+		// If a normal DOM Ready event fired, decrement, and wait if need be
+		if ( wait !== true && --jQuery.readyWait > 0 ) {
+			return;
+		}
 
-	// Verify style float existence
-	// (IE uses styleFloat instead of cssFloat)
-	support.cssFloat = !!a.style.cssFloat;
+		// If there are functions bound, to execute
+		readyList.resolveWith( document, [ jQuery ] );
 
-	// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
-	support.checkOn = !!input.value;
+		// Trigger any bound ready events
+		if ( jQuery.fn.triggerHandler ) {
+			jQuery( document ).triggerHandler( "ready" );
+			jQuery( document ).off( "ready" );
+		}
+	}
+});
 
-	// Make sure that a selected-by-default option has a working selected property.
-	// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
-	support.optSelected = opt.selected;
+/**
+ * Clean-up method for dom ready events
+ */
+function detach() {
+	if ( document.addEventListener ) {
+		document.removeEventListener( "DOMContentLoaded", completed, false );
+		window.removeEventListener( "load", completed, false );
 
-	// Tests for enctype support on a form (#6743)
-	support.enctype = !!document.createElement("form").enctype;
+	} else {
+		document.detachEvent( "onreadystatechange", completed );
+		window.detachEvent( "onload", completed );
+	}
+}
 
-	// Makes sure cloning an html5 element does not cause problems
-	// Where outerHTML is undefined, this still works
-	support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>";
+/**
+ * The ready event handler and self cleanup method
+ */
+function completed() {
+	// readyState === "complete" is good enough for us to call the dom ready in oldIE
+	if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
+		detach();
+		jQuery.ready();
+	}
+}
 
-	// Will be defined later
-	support.inlineBlockNeedsLayout = false;
-	support.shrinkWrapBlocks = false;
-	support.pixelPosition = false;
-	support.deleteExpando = true;
-	support.noCloneEvent = true;
-	support.reliableMarginRight = true;
-	support.boxSizingReliable = true;
+jQuery.ready.promise = function( obj ) {
+	if ( !readyList ) {
 
-	// Make sure checked status is properly cloned
-	input.checked = true;
-	support.noCloneChecked = input.cloneNode( true ).checked;
+		readyList = jQuery.Deferred();
 
-	// Make sure that the options inside disabled selects aren't marked as disabled
-	// (WebKit marks them as disabled)
-	select.disabled = true;
-	support.optDisabled = !opt.disabled;
+		// Catch cases where $(document).ready() is called after the browser event has already occurred.
+		// we once tried to use readyState "interactive" here, but it caused issues like the one
+		// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+		if ( document.readyState === "complete" ) {
+			// Handle it asynchronously to allow scripts the opportunity to delay ready
+			setTimeout( jQuery.ready );
 
-	// Support: IE<9
-	try {
-		delete div.test;
-	} catch( e ) {
-		support.deleteExpando = false;
-	}
+		// Standards-based browsers support DOMContentLoaded
+		} else if ( document.addEventListener ) {
+			// Use the handy event callback
+			document.addEventListener( "DOMContentLoaded", completed, false );
 
-	// Check if we can trust getAttribute("value")
-	input = document.createElement("input");
-	input.setAttribute( "value", "" );
-	support.input = input.getAttribute( "value" ) === "";
+			// A fallback to window.onload, that will always work
+			window.addEventListener( "load", completed, false );
 
-	// Check if an input maintains its value after becoming a radio
-	input.value = "t";
-	input.setAttribute( "type", "radio" );
-	support.radioValue = input.value === "t";
+		// If IE event model is used
+		} else {
+			// Ensure firing before onload, maybe late but safe also for iframes
+			document.attachEvent( "onreadystatechange", completed );
 
-	// #11217 - WebKit loses check when the name is after the checked attribute
-	input.setAttribute( "checked", "t" );
-	input.setAttribute( "name", "t" );
+			// A fallback to window.onload, that will always work
+			window.attachEvent( "onload", completed );
 
-	fragment = document.createDocumentFragment();
-	fragment.appendChild( input );
+			// If IE and not a frame
+			// continually check to see if the document is ready
+			var top = false;
 
-	// Check if a disconnected checkbox will retain its checked
-	// value of true after appended to the DOM (IE6/7)
-	support.appendChecked = input.checked;
+			try {
+				top = window.frameElement == null && document.documentElement;
+			} catch(e) {}
 
-	// WebKit doesn't clone checked state correctly in fragments
-	support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+			if ( top && top.doScroll ) {
+				(function doScrollCheck() {
+					if ( !jQuery.isReady ) {
 
-	// Support: IE<9
-	// Opera does not clone events (and typeof div.attachEvent === undefined).
-	// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
-	if ( div.attachEvent ) {
-		div.attachEvent( "onclick", function() {
-			support.noCloneEvent = false;
-		});
+						try {
+							// Use the trick by Diego Perini
+							// http://javascript.nwbox.com/IEContentLoaded/
+							top.doScroll("left");
+						} catch(e) {
+							return setTimeout( doScrollCheck, 50 );
+						}
 
-		div.cloneNode( true ).click();
+						// detach all dom ready events
+						detach();
+
+						// and execute any waiting functions
+						jQuery.ready();
+					}
+				})();
+			}
+		}
 	}
+	return readyList.promise( obj );
+};
 
-	// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
-	// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
-	for ( i in { submit: true, change: true, focusin: true }) {
-		div.setAttribute( eventName = "on" + i, "t" );
 
-		support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
-	}
+var strundefined = typeof undefined;
 
-	div.style.backgroundClip = "content-box";
-	div.cloneNode( true ).style.backgroundClip = "";
-	support.clearCloneStyle = div.style.backgroundClip === "content-box";
 
-	// Support: IE<9
-	// Iteration over object's inherited properties before its own.
-	for ( i in jQuery( support ) ) {
-		break;
+
+// Support: IE<9
+// Iteration over object's inherited properties before its own
+var i;
+for ( i in jQuery( support ) ) {
+	break;
+}
+support.ownLast = i !== "0";
+
+// Note: most support tests are defined in their respective modules.
+// false until the test is run
+support.inlineBlockNeedsLayout = false;
+
+// Execute ASAP in case we need to set body.style.zoom
+jQuery(function() {
+	// Minified: var a,b,c,d
+	var val, div, body, container;
+
+	body = document.getElementsByTagName( "body" )[ 0 ];
+	if ( !body || !body.style ) {
+		// Return for frameset docs that don't have a body
+		return;
+	}
+
+	// Setup
+	div = document.createElement( "div" );
+	container = document.createElement( "div" );
+	container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
+	body.appendChild( container ).appendChild( div );
+
+	if ( typeof div.style.zoom !== strundefined ) {
+		// Support: IE<8
+		// Check if natively block-level elements act like inline-block
+		// elements when setting their display to 'inline' and giving
+		// them layout
+		div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
+
+		support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
+		if ( val ) {
+			// Prevent IE 6 from affecting layout for positioned elements #11048
+			// Prevent IE from shrinking the body in IE 7 mode #12869
+			// Support: IE<8
+			body.style.zoom = 1;
+		}
 	}
-	support.ownLast = i !== "0";
 
-	// Run tests that need a body at doc ready
-	jQuery(function() {
-		var container, marginDiv, tds,
-			divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
-			body = document.getElementsByTagName("body")[0];
+	body.removeChild( container );
+});
 
-		if ( !body ) {
-			// Return for frameset docs that don't have a body
-			return;
+
+
+
+(function() {
+	var div = document.createElement( "div" );
+
+	// Execute the test only if not already executed in another module.
+	if (support.deleteExpando == null) {
+		// Support: IE<9
+		support.deleteExpando = true;
+		try {
+			delete div.test;
+		} catch( e ) {
+			support.deleteExpando = false;
 		}
+	}
 
-		container = document.createElement("div");
-		container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
+	// Null elements to avoid leaks in IE.
+	div = null;
+})();
+
+
+/**
+ * Determines whether an object can have data
+ */
+jQuery.acceptData = function( elem ) {
+	var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
+		nodeType = +elem.nodeType || 1;
 
-		body.appendChild( container ).appendChild( div );
+	// Do not set data on non-element DOM nodes because it will not be cleared (#8335).
+	return nodeType !== 1 && nodeType !== 9 ?
+		false :
 
-		// Support: IE8
-		// Check if table cells still have offsetWidth/Height when they are set
-		// to display:none and there are still other visible table cells in a
-		// table row; if so, offsetWidth/Height are not reliable for use when
-		// determining if an element has been hidden directly using
-		// display:none (it is still safe to use offsets if a parent element is
-		// hidden; don safety goggles and see bug #4512 for more information).
-		div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
-		tds = div.getElementsByTagName("td");
-		tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
-		isSupported = ( tds[ 0 ].offsetHeight === 0 );
+		// Nodes accept data unless otherwise specified; rejection can be conditional
+		!noData || noData !== true && elem.getAttribute("classid") === noData;
+};
 
-		tds[ 0 ].style.display = "";
-		tds[ 1 ].style.display = "none";
 
-		// Support: IE8
-		// Check if empty table cells still have offsetWidth/Height
-		support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
+	rmultiDash = /([A-Z])/g;
 
-		// Check box-sizing and margin behavior.
-		div.innerHTML = "";
-		div.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%;";
+function dataAttr( elem, key, data ) {
+	// If nothing was found internally, try to fetch any
+	// data from the HTML5 data-* attribute
+	if ( data === undefined && elem.nodeType === 1 ) {
 
-		// Workaround failing boxSizing test due to offsetWidth returning wrong value
-		// with some non-1 values of body zoom, ticket #13543
-		jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
-			support.boxSizing = div.offsetWidth === 4;
-		});
+		var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
 
-		// Use window.getComputedStyle because jsdom on node.js will break without it.
-		if ( window.getComputedStyle ) {
-			support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
-			support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+		data = elem.getAttribute( name );
 
-			// Check if div with explicit width and no margin-right incorrectly
-			// gets computed margin-right based on width of container. (#3333)
-			// Fails in WebKit before Feb 2011 nightlies
-			// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-			marginDiv = div.appendChild( document.createElement("div") );
-			marginDiv.style.cssText = div.style.cssText = divReset;
-			marginDiv.style.marginRight = marginDiv.style.width = "0";
-			div.style.width = "1px";
+		if ( typeof data === "string" ) {
+			try {
+				data = data === "true" ? true :
+					data === "false" ? false :
+					data === "null" ? null :
+					// Only convert to a number if it doesn't change the string
+					+data + "" === data ? +data :
+					rbrace.test( data ) ? jQuery.parseJSON( data ) :
+					data;
+			} catch( e ) {}
 
-			support.reliableMarginRight =
-				!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
-		}
+			// Make sure we set the data so it isn't changed later
+			jQuery.data( elem, key, data );
 
-		if ( typeof div.style.zoom !== core_strundefined ) {
-			// Support: IE<8
-			// Check if natively block-level elements act like inline-block
-			// elements when setting their display to 'inline' and giving
-			// them layout
-			div.innerHTML = "";
-			div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
-			support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
-			// Support: IE6
-			// Check if elements with layout shrink-wrap their children
-			div.style.display = "block";
-			div.innerHTML = "<div></div>";
-			div.firstChild.style.width = "5px";
-			support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
-
-			if ( support.inlineBlockNeedsLayout ) {
-				// Prevent IE 6 from affecting layout for positioned elements #11048
-				// Prevent IE from shrinking the body in IE 7 mode #12869
-				// Support: IE<8
-				body.style.zoom = 1;
-			}
+		} else {
+			data = undefined;
 		}
+	}
 
-		body.removeChild( container );
-
-		// Null elements to avoid leaks in IE
-		container = div = tds = marginDiv = null;
-	});
+	return data;
+}
 
-	// Null elements to avoid leaks in IE
-	all = select = fragment = opt = a = input = null;
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+	var name;
+	for ( name in obj ) {
 
-	return support;
-})({});
+		// if the public data object is empty, the private is still empty
+		if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+			continue;
+		}
+		if ( name !== "toJSON" ) {
+			return false;
+		}
+	}
 
-var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
-	rmultiDash = /([A-Z])/g;
+	return true;
+}
 
-function internalData( elem, name, data, pvt /* Internal Use Only */ ){
+function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
 	if ( !jQuery.acceptData( elem ) ) {
 		return;
 	}
@@ -3595,7 +3708,7 @@ function internalData( elem, name, data, pvt /* Internal Use Only */ ){
 		// Only DOM nodes need a new unique ID for each element since their data
 		// ends up in the global cache
 		if ( isNode ) {
-			id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++;
+			id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
 		} else {
 			id = internalKey;
 		}
@@ -3734,7 +3847,7 @@ function internalRemoveData( elem, name, pvt ) {
 
 	// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
 	/* jshint eqeqeq: false */
-	} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
+	} else if ( support.deleteExpando || cache != cache.window ) {
 		/* jshint eqeqeq: true */
 		delete cache[ id ];
 
@@ -3747,13 +3860,13 @@ function internalRemoveData( elem, name, pvt ) {
 jQuery.extend({
 	cache: {},
 
-	// The following elements throw uncatchable exceptions if you
-	// attempt to add expando properties to them.
+	// The following elements (space-suffixed to avoid Object.prototype collisions)
+	// throw uncatchable exceptions if you attempt to set expando properties
 	noData: {
-		"applet": true,
-		"embed": true,
-		// Ban all objects except for Flash (which handle expandos)
-		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+		"applet ": true,
+		"embed ": true,
+		// ...but Flash objects (which have this classid) *can* handle expandos
+		"object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 	},
 
 	hasData: function( elem ) {
@@ -3776,28 +3889,14 @@ jQuery.extend({
 
 	_removeData: function( elem, name ) {
 		return internalRemoveData( elem, name, true );
-	},
-
-	// A method for determining if a DOM node can handle the data expando
-	acceptData: function( elem ) {
-		// Do not set data on non-element because it will not be cleared (#8335).
-		if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
-			return false;
-		}
-
-		var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
-
-		// nodes accept data unless otherwise specified; rejection can be conditional
-		return !noData || noData !== true && elem.getAttribute("classid") === noData;
 	}
 });
 
 jQuery.fn.extend({
 	data: function( key, value ) {
-		var attrs, name,
-			data = null,
-			i = 0,
-			elem = this[0];
+		var i, name, data,
+			elem = this[0],
+			attrs = elem && elem.attributes;
 
 		// Special expections of .data basically thwart jQuery.access,
 		// so implement the relevant behavior ourselves
@@ -3808,14 +3907,17 @@ jQuery.fn.extend({
 				data = jQuery.data( elem );
 
 				if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
-					attrs = elem.attributes;
-					for ( ; i < attrs.length; i++ ) {
-						name = attrs[i].name;
-
-						if ( name.indexOf("data-") === 0 ) {
-							name = jQuery.camelCase( name.slice(5) );
+					i = attrs.length;
+					while ( i-- ) {
 
-							dataAttr( elem, name, data[ name ] );
+						// Support: IE11+
+						// The attrs elements can be null (#14894)
+						if ( attrs[ i ] ) {
+							name = attrs[ i ].name;
+							if ( name.indexOf( "data-" ) === 0 ) {
+								name = jQuery.camelCase( name.slice(5) );
+								dataAttr( elem, name, data[ name ] );
+							}
 						}
 					}
 					jQuery._data( elem, "parsedAttrs", true );
@@ -3841,7 +3943,7 @@ jQuery.fn.extend({
 
 			// Gets one value
 			// Try to fetch any internally stored data first
-			elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
+			elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
 	},
 
 	removeData: function( key ) {
@@ -3851,53 +3953,7 @@ jQuery.fn.extend({
 	}
 });
 
-function dataAttr( elem, key, data ) {
-	// If nothing was found internally, try to fetch any
-	// data from the HTML5 data-* attribute
-	if ( data === undefined && elem.nodeType === 1 ) {
-
-		var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
-		data = elem.getAttribute( name );
-
-		if ( typeof data === "string" ) {
-			try {
-				data = data === "true" ? true :
-					data === "false" ? false :
-					data === "null" ? null :
-					// Only convert to a number if it doesn't change the string
-					+data + "" === data ? +data :
-					rbrace.test( data ) ? jQuery.parseJSON( data ) :
-						data;
-			} catch( e ) {}
-
-			// Make sure we set the data so it isn't changed later
-			jQuery.data( elem, key, data );
-
-		} else {
-			data = undefined;
-		}
-	}
-
-	return data;
-}
-
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
-	var name;
-	for ( name in obj ) {
-
-		// if the public data object is empty, the private is still empty
-		if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
-			continue;
-		}
-		if ( name !== "toJSON" ) {
-			return false;
-		}
-	}
 
-	return true;
-}
 jQuery.extend({
 	queue: function( elem, type, data ) {
 		var queue;
@@ -3997,5605 +4053,5989 @@ jQuery.fn.extend({
 			jQuery.dequeue( this, type );
 		});
 	},
-	// Based off of the plugin by Clint Helfers, with permission.
-	// http://blindsignals.com/index.php/2009/07/jquery-delay/
-	delay: function( time, type ) {
-		time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+	clearQueue: function( type ) {
+		return this.queue( type || "fx", [] );
+	},
+	// Get a promise resolved when queues of a certain type
+	// are emptied (fx is the type by default)
+	promise: function( type, obj ) {
+		var tmp,
+			count = 1,
+			defer = jQuery.Deferred(),
+			elements = this,
+			i = this.length,
+			resolve = function() {
+				if ( !( --count ) ) {
+					defer.resolveWith( elements, [ elements ] );
+				}
+			};
+
+		if ( typeof type !== "string" ) {
+			obj = type;
+			type = undefined;
+		}
 		type = type || "fx";
 
-		return this.queue( type, function( next, hooks ) {
-			var timeout = setTimeout( next, time );
-			hooks.stop = function() {
-				clearTimeout( timeout );
-			};
-		});
-	},
-	clearQueue: function( type ) {
-		return this.queue( type || "fx", [] );
-	},
-	// Get a promise resolved when queues of a certain type
-	// are emptied (fx is the type by default)
-	promise: function( type, obj ) {
-		var tmp,
-			count = 1,
-			defer = jQuery.Deferred(),
-			elements = this,
-			i = this.length,
-			resolve = function() {
-				if ( !( --count ) ) {
-					defer.resolveWith( elements, [ elements ] );
-				}
-			};
+		while ( i-- ) {
+			tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+			if ( tmp && tmp.empty ) {
+				count++;
+				tmp.empty.add( resolve );
+			}
+		}
+		resolve();
+		return defer.promise( obj );
+	}
+});
+var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
+
+var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
+
+var isHidden = function( elem, el ) {
+		// isHidden might be called from jQuery#filter function;
+		// in that case, element will be second argument
+		elem = el || elem;
+		return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
+	};
+
+
+
+// Multifunctional method to get and set values of a collection
+// The value/s can optionally be executed if it's a function
+var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
+	var i = 0,
+		length = elems.length,
+		bulk = key == null;
+
+	// Sets many values
+	if ( jQuery.type( key ) === "object" ) {
+		chainable = true;
+		for ( i in key ) {
+			jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
+		}
+
+	// Sets one value
+	} else if ( value !== undefined ) {
+		chainable = true;
+
+		if ( !jQuery.isFunction( value ) ) {
+			raw = true;
+		}
+
+		if ( bulk ) {
+			// Bulk operations run against the entire set
+			if ( raw ) {
+				fn.call( elems, value );
+				fn = null;
+
+			// ...except when executing function values
+			} else {
+				bulk = fn;
+				fn = function( elem, key, value ) {
+					return bulk.call( jQuery( elem ), value );
+				};
+			}
+		}
+
+		if ( fn ) {
+			for ( ; i < length; i++ ) {
+				fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
+			}
+		}
+	}
+
+	return chainable ?
+		elems :
+
+		// Gets
+		bulk ?
+			fn.call( elems ) :
+			length ? fn( elems[0], key ) : emptyGet;
+};
+var rcheckableType = (/^(?:checkbox|radio)$/i);
+
+
+
+(function() {
+	// Minified: var a,b,c
+	var input = document.createElement( "input" ),
+		div = document.createElement( "div" ),
+		fragment = document.createDocumentFragment();
+
+	// Setup
+	div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+
+	// IE strips leading whitespace when .innerHTML is used
+	support.leadingWhitespace = div.firstChild.nodeType === 3;
+
+	// Make sure that tbody elements aren't automatically inserted
+	// IE will insert them into empty tables
+	support.tbody = !div.getElementsByTagName( "tbody" ).length;
+
+	// Make sure that link elements get serialized correctly by innerHTML
+	// This requires a wrapper element in IE
+	support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
+
+	// Makes sure cloning an html5 element does not cause problems
+	// Where outerHTML is undefined, this still works
+	support.html5Clone =
+		document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
+
+	// Check if a disconnected checkbox will retain its checked
+	// value of true after appended to the DOM (IE6/7)
+	input.type = "checkbox";
+	input.checked = true;
+	fragment.appendChild( input );
+	support.appendChecked = input.checked;
+
+	// Make sure textarea (and checkbox) defaultValue is properly cloned
+	// Support: IE6-IE11+
+	div.innerHTML = "<textarea>x</textarea>";
+	support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
+
+	// #11217 - WebKit loses check when the name is after the checked attribute
+	fragment.appendChild( div );
+	div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
+
+	// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
+	// old WebKit doesn't clone checked state correctly in fragments
+	support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+	// Support: IE<9
+	// Opera does not clone events (and typeof div.attachEvent === undefined).
+	// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
+	support.noCloneEvent = true;
+	if ( div.attachEvent ) {
+		div.attachEvent( "onclick", function() {
+			support.noCloneEvent = false;
+		});
+
+		div.cloneNode( true ).click();
+	}
+
+	// Execute the test only if not already executed in another module.
+	if (support.deleteExpando == null) {
+		// Support: IE<9
+		support.deleteExpando = true;
+		try {
+			delete div.test;
+		} catch( e ) {
+			support.deleteExpando = false;
+		}
+	}
+})();
+
+
+(function() {
+	var i, eventName,
+		div = document.createElement( "div" );
+
+	// Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
+	for ( i in { submit: true, change: true, focusin: true }) {
+		eventName = "on" + i;
+
+		if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
+			// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
+			div.setAttribute( eventName, "t" );
+			support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
+		}
+	}
+
+	// Null elements to avoid leaks in IE.
+	div = null;
+})();
+
+
+var rformElems = /^(?:input|select|textarea)$/i,
+	rkeyEvent = /^key/,
+	rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
+	rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+	rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+
+function returnTrue() {
+	return true;
+}
+
+function returnFalse() {
+	return false;
+}
+
+function safeActiveElement() {
+	try {
+		return document.activeElement;
+	} catch ( err ) { }
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+	global: {},
 
-		if ( typeof type !== "string" ) {
-			obj = type;
-			type = undefined;
+	add: function( elem, types, handler, data, selector ) {
+		var tmp, events, t, handleObjIn,
+			special, eventHandle, handleObj,
+			handlers, type, namespaces, origType,
+			elemData = jQuery._data( elem );
+
+		// Don't attach events to noData or text/comment nodes (but allow plain objects)
+		if ( !elemData ) {
+			return;
 		}
-		type = type || "fx";
 
-		while( i-- ) {
-			tmp = jQuery._data( elements[ i ], type + "queueHooks" );
-			if ( tmp && tmp.empty ) {
-				count++;
-				tmp.empty.add( resolve );
-			}
+		// Caller can pass in an object of custom data in lieu of the handler
+		if ( handler.handler ) {
+			handleObjIn = handler;
+			handler = handleObjIn.handler;
+			selector = handleObjIn.selector;
 		}
-		resolve();
-		return defer.promise( obj );
-	}
-});
-var nodeHook, boolHook,
-	rclass = /[\t\r\n\f]/g,
-	rreturn = /\r/g,
-	rfocusable = /^(?:input|select|textarea|button|object)$/i,
-	rclickable = /^(?:a|area)$/i,
-	ruseDefault = /^(?:checked|selected)$/i,
-	getSetAttribute = jQuery.support.getSetAttribute,
-	getSetInput = jQuery.support.input;
 
-jQuery.fn.extend({
-	attr: function( name, value ) {
-		return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
-	},
+		// Make sure that the handler has a unique ID, used to find/remove it later
+		if ( !handler.guid ) {
+			handler.guid = jQuery.guid++;
+		}
 
-	removeAttr: function( name ) {
-		return this.each(function() {
-			jQuery.removeAttr( this, name );
-		});
-	},
+		// Init the element's event structure and main handler, if this is the first
+		if ( !(events = elemData.events) ) {
+			events = elemData.events = {};
+		}
+		if ( !(eventHandle = elemData.handle) ) {
+			eventHandle = elemData.handle = function( e ) {
+				// Discard the second event of a jQuery.event.trigger() and
+				// when an event is called after a page has unloaded
+				return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
+					jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+					undefined;
+			};
+			// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+			eventHandle.elem = elem;
+		}
 
-	prop: function( name, value ) {
-		return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
-	},
+		// Handle multiple events separated by a space
+		types = ( types || "" ).match( rnotwhite ) || [ "" ];
+		t = types.length;
+		while ( t-- ) {
+			tmp = rtypenamespace.exec( types[t] ) || [];
+			type = origType = tmp[1];
+			namespaces = ( tmp[2] || "" ).split( "." ).sort();
 
-	removeProp: function( name ) {
-		name = jQuery.propFix[ name ] || name;
-		return this.each(function() {
-			// try/catch handles cases where IE balks (such as removing a property on window)
-			try {
-				this[ name ] = undefined;
-				delete this[ name ];
-			} catch( e ) {}
-		});
-	},
+			// There *must* be a type, no attaching namespace-only handlers
+			if ( !type ) {
+				continue;
+			}
 
-	addClass: function( value ) {
-		var classes, elem, cur, clazz, j,
-			i = 0,
-			len = this.length,
-			proceed = typeof value === "string" && value;
+			// If event changes its type, use the special event handlers for the changed type
+			special = jQuery.event.special[ type ] || {};
 
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).addClass( value.call( this, j, this.className ) );
-			});
-		}
+			// If selector defined, determine special event api type, otherwise given type
+			type = ( selector ? special.delegateType : special.bindType ) || type;
 
-		if ( proceed ) {
-			// The disjunction here is for better compressibility (see removeClass)
-			classes = ( value || "" ).match( core_rnotwhite ) || [];
+			// Update special based on newly reset type
+			special = jQuery.event.special[ type ] || {};
 
-			for ( ; i < len; i++ ) {
-				elem = this[ i ];
-				cur = elem.nodeType === 1 && ( elem.className ?
-					( " " + elem.className + " " ).replace( rclass, " " ) :
-					" "
-				);
+			// handleObj is passed to all event handlers
+			handleObj = jQuery.extend({
+				type: type,
+				origType: origType,
+				data: data,
+				handler: handler,
+				guid: handler.guid,
+				selector: selector,
+				needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+				namespace: namespaces.join(".")
+			}, handleObjIn );
 
-				if ( cur ) {
-					j = 0;
-					while ( (clazz = classes[j++]) ) {
-						if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
-							cur += clazz + " ";
-						}
+			// Init the event handler queue if we're the first
+			if ( !(handlers = events[ type ]) ) {
+				handlers = events[ type ] = [];
+				handlers.delegateCount = 0;
+
+				// Only use addEventListener/attachEvent if the special events handler returns false
+				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+					// Bind the global event handler to the element
+					if ( elem.addEventListener ) {
+						elem.addEventListener( type, eventHandle, false );
+
+					} else if ( elem.attachEvent ) {
+						elem.attachEvent( "on" + type, eventHandle );
 					}
-					elem.className = jQuery.trim( cur );
+				}
+			}
 
+			if ( special.add ) {
+				special.add.call( elem, handleObj );
+
+				if ( !handleObj.handler.guid ) {
+					handleObj.handler.guid = handler.guid;
 				}
 			}
+
+			// Add to the element's handler list, delegates in front
+			if ( selector ) {
+				handlers.splice( handlers.delegateCount++, 0, handleObj );
+			} else {
+				handlers.push( handleObj );
+			}
+
+			// Keep track of which events have ever been used, for event optimization
+			jQuery.event.global[ type ] = true;
 		}
 
-		return this;
+		// Nullify elem to prevent memory leaks in IE
+		elem = null;
 	},
 
-	removeClass: function( value ) {
-		var classes, elem, cur, clazz, j,
-			i = 0,
-			len = this.length,
-			proceed = arguments.length === 0 || typeof value === "string" && value;
+	// Detach an event or set of events from an element
+	remove: function( elem, types, handler, selector, mappedTypes ) {
+		var j, handleObj, tmp,
+			origCount, t, events,
+			special, handlers, type,
+			namespaces, origType,
+			elemData = jQuery.hasData( elem ) && jQuery._data( elem );
 
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).removeClass( value.call( this, j, this.className ) );
-			});
+		if ( !elemData || !(events = elemData.events) ) {
+			return;
 		}
-		if ( proceed ) {
-			classes = ( value || "" ).match( core_rnotwhite ) || [];
 
-			for ( ; i < len; i++ ) {
-				elem = this[ i ];
-				// This expression is here for better compressibility (see addClass)
-				cur = elem.nodeType === 1 && ( elem.className ?
-					( " " + elem.className + " " ).replace( rclass, " " ) :
-					""
-				);
+		// Once for each type.namespace in types; type may be omitted
+		types = ( types || "" ).match( rnotwhite ) || [ "" ];
+		t = types.length;
+		while ( t-- ) {
+			tmp = rtypenamespace.exec( types[t] ) || [];
+			type = origType = tmp[1];
+			namespaces = ( tmp[2] || "" ).split( "." ).sort();
 
-				if ( cur ) {
-					j = 0;
-					while ( (clazz = classes[j++]) ) {
-						// Remove *all* instances
-						while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
-							cur = cur.replace( " " + clazz + " ", " " );
-						}
-					}
-					elem.className = value ? jQuery.trim( cur ) : "";
+			// Unbind all events (on this namespace, if provided) for the element
+			if ( !type ) {
+				for ( type in events ) {
+					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
 				}
+				continue;
 			}
-		}
-
-		return this;
-	},
-
-	toggleClass: function( value, stateVal ) {
-		var type = typeof value;
 
-		if ( typeof stateVal === "boolean" && type === "string" ) {
-			return stateVal ? this.addClass( value ) : this.removeClass( value );
-		}
+			special = jQuery.event.special[ type ] || {};
+			type = ( selector ? special.delegateType : special.bindType ) || type;
+			handlers = events[ type ] || [];
+			tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
 
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
-			});
-		}
+			// Remove matching events
+			origCount = j = handlers.length;
+			while ( j-- ) {
+				handleObj = handlers[ j ];
 
-		return this.each(function() {
-			if ( type === "string" ) {
-				// toggle individual class names
-				var className,
-					i = 0,
-					self = jQuery( this ),
-					classNames = value.match( core_rnotwhite ) || [];
+				if ( ( mappedTypes || origType === handleObj.origType ) &&
+					( !handler || handler.guid === handleObj.guid ) &&
+					( !tmp || tmp.test( handleObj.namespace ) ) &&
+					( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+					handlers.splice( j, 1 );
 
-				while ( (className = classNames[ i++ ]) ) {
-					// check each className given, space separated list
-					if ( self.hasClass( className ) ) {
-						self.removeClass( className );
-					} else {
-						self.addClass( className );
+					if ( handleObj.selector ) {
+						handlers.delegateCount--;
+					}
+					if ( special.remove ) {
+						special.remove.call( elem, handleObj );
 					}
 				}
+			}
 
-			// Toggle whole class name
-			} else if ( type === core_strundefined || type === "boolean" ) {
-				if ( this.className ) {
-					// store className if set
-					jQuery._data( this, "__className__", this.className );
+			// Remove generic event handler if we removed something and no more handlers exist
+			// (avoids potential for endless recursion during removal of special event handlers)
+			if ( origCount && !handlers.length ) {
+				if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+					jQuery.removeEvent( elem, type, elemData.handle );
 				}
 
-				// If the element has a class name or if we're passed "false",
-				// then remove the whole classname (if there was one, the above saved it).
-				// Otherwise bring back whatever was previously saved (if anything),
-				// falling back to the empty string if nothing was stored.
-				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+				delete events[ type ];
 			}
-		});
+		}
+
+		// Remove the expando if it's no longer used
+		if ( jQuery.isEmptyObject( events ) ) {
+			delete elemData.handle;
+
+			// removeData also checks for emptiness and clears the expando if empty
+			// so use it instead of delete
+			jQuery._removeData( elem, "events" );
+		}
 	},
 
-	hasClass: function( selector ) {
-		var className = " " + selector + " ",
-			i = 0,
-			l = this.length;
-		for ( ; i < l; i++ ) {
-			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
-				return true;
-			}
+	trigger: function( event, data, elem, onlyHandlers ) {
+		var handle, ontype, cur,
+			bubbleType, special, tmp, i,
+			eventPath = [ elem || document ],
+			type = hasOwn.call( event, "type" ) ? event.type : event,
+			namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
+
+		cur = tmp = elem = elem || document;
+
+		// Don't do events on text and comment nodes
+		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+			return;
 		}
 
-		return false;
-	},
+		// focus/blur morphs to focusin/out; ensure we're not firing them right now
+		if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+			return;
+		}
 
-	val: function( value ) {
-		var ret, hooks, isFunction,
-			elem = this[0];
+		if ( type.indexOf(".") >= 0 ) {
+			// Namespaced trigger; create a regexp to match event type in handle()
+			namespaces = type.split(".");
+			type = namespaces.shift();
+			namespaces.sort();
+		}
+		ontype = type.indexOf(":") < 0 && "on" + type;
 
-		if ( !arguments.length ) {
-			if ( elem ) {
-				hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+		// Caller can pass in a jQuery.Event object, Object, or just an event type string
+		event = event[ jQuery.expando ] ?
+			event :
+			new jQuery.Event( type, typeof event === "object" && event );
 
-				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
-					return ret;
-				}
+		// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+		event.isTrigger = onlyHandlers ? 2 : 3;
+		event.namespace = namespaces.join(".");
+		event.namespace_re = event.namespace ?
+			new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
+			null;
 
-				ret = elem.value;
+		// Clean up the event in case it is being reused
+		event.result = undefined;
+		if ( !event.target ) {
+			event.target = elem;
+		}
 
-				return typeof ret === "string" ?
-					// handle most common string cases
-					ret.replace(rreturn, "") :
-					// handle cases where value is null/undef or number
-					ret == null ? "" : ret;
-			}
+		// Clone any incoming data and prepend the event, creating the handler arg list
+		data = data == null ?
+			[ event ] :
+			jQuery.makeArray( data, [ event ] );
 
+		// Allow special events to draw outside the lines
+		special = jQuery.event.special[ type ] || {};
+		if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
 			return;
 		}
 
-		isFunction = jQuery.isFunction( value );
-
-		return this.each(function( i ) {
-			var val;
+		// Determine event propagation path in advance, per W3C events spec (#9951)
+		// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+		if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
 
-			if ( this.nodeType !== 1 ) {
-				return;
+			bubbleType = special.delegateType || type;
+			if ( !rfocusMorph.test( bubbleType + type ) ) {
+				cur = cur.parentNode;
 			}
-
-			if ( isFunction ) {
-				val = value.call( this, i, jQuery( this ).val() );
-			} else {
-				val = value;
+			for ( ; cur; cur = cur.parentNode ) {
+				eventPath.push( cur );
+				tmp = cur;
 			}
 
-			// Treat null/undefined as ""; convert numbers to string
-			if ( val == null ) {
-				val = "";
-			} else if ( typeof val === "number" ) {
-				val += "";
-			} else if ( jQuery.isArray( val ) ) {
-				val = jQuery.map(val, function ( value ) {
-					return value == null ? "" : value + "";
-				});
+			// Only add window if we got to document (e.g., not plain obj or detached DOM)
+			if ( tmp === (elem.ownerDocument || document) ) {
+				eventPath.push( tmp.defaultView || tmp.parentWindow || window );
 			}
+		}
 
-			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+		// Fire handlers on the event path
+		i = 0;
+		while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
 
-			// If set returns undefined, fall back to normal setting
-			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
-				this.value = val;
+			event.type = i > 1 ?
+				bubbleType :
+				special.bindType || type;
+
+			// jQuery handler
+			handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+			if ( handle ) {
+				handle.apply( cur, data );
 			}
-		});
-	}
-});
 
-jQuery.extend({
-	valHooks: {
-		option: {
-			get: function( elem ) {
-				// Use proper attribute retrieval(#6932, #12072)
-				var val = jQuery.find.attr( elem, "value" );
-				return val != null ?
-					val :
-					elem.text;
+			// Native handler
+			handle = ontype && cur[ ontype ];
+			if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
+				event.result = handle.apply( cur, data );
+				if ( event.result === false ) {
+					event.preventDefault();
+				}
 			}
-		},
-		select: {
-			get: function( elem ) {
-				var value, option,
-					options = elem.options,
-					index = elem.selectedIndex,
-					one = elem.type === "select-one" || index < 0,
-					values = one ? null : [],
-					max = one ? index + 1 : options.length,
-					i = index < 0 ?
-						max :
-						one ? index : 0;
+		}
+		event.type = type;
 
-				// Loop through all the selected options
-				for ( ; i < max; i++ ) {
-					option = options[ i ];
+		// If nobody prevented the default action, do it now
+		if ( !onlyHandlers && !event.isDefaultPrevented() ) {
 
-					// oldIE doesn't update selected after form reset (#2551)
-					if ( ( option.selected || i === index ) &&
-							// Don't return options that are disabled or in a disabled optgroup
-							( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
-							( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+			if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
+				jQuery.acceptData( elem ) ) {
 
-						// Get the specific value for the option
-						value = jQuery( option ).val();
+				// Call a native DOM method on the target with the same name name as the event.
+				// Can't use an .isFunction() check here because IE6/7 fails that test.
+				// Don't do default actions on window, that's where global variables be (#6170)
+				if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
 
-						// We don't need an array for one selects
-						if ( one ) {
-							return value;
-						}
+					// Don't re-trigger an onFOO event when we call its FOO() method
+					tmp = elem[ ontype ];
 
-						// Multi-Selects return an array
-						values.push( value );
+					if ( tmp ) {
+						elem[ ontype ] = null;
 					}
-				}
-
-				return values;
-			},
-
-			set: function( elem, value ) {
-				var optionSet, option,
-					options = elem.options,
-					values = jQuery.makeArray( value ),
-					i = options.length;
 
-				while ( i-- ) {
-					option = options[ i ];
-					if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
-						optionSet = true;
+					// Prevent re-triggering of the same event, since we already bubbled it above
+					jQuery.event.triggered = type;
+					try {
+						elem[ type ]();
+					} catch ( e ) {
+						// IE<9 dies on focus/blur to hidden element (#1486,#12518)
+						// only reproducible on winXP IE8 native, not IE9 in IE8 mode
 					}
-				}
+					jQuery.event.triggered = undefined;
 
-				// force browsers to behave consistently when non-matching value is set
-				if ( !optionSet ) {
-					elem.selectedIndex = -1;
+					if ( tmp ) {
+						elem[ ontype ] = tmp;
+					}
 				}
-				return values;
 			}
 		}
+
+		return event.result;
 	},
 
-	attr: function( elem, name, value ) {
-		var hooks, ret,
-			nType = elem.nodeType;
+	dispatch: function( event ) {
 
-		// don't get/set attributes on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
+		// Make a writable jQuery.Event from the native event object
+		event = jQuery.event.fix( event );
 
-		// Fallback to prop when attributes are not supported
-		if ( typeof elem.getAttribute === core_strundefined ) {
-			return jQuery.prop( elem, name, value );
-		}
+		var i, ret, handleObj, matched, j,
+			handlerQueue = [],
+			args = slice.call( arguments ),
+			handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
+			special = jQuery.event.special[ event.type ] || {};
 
-		// All attributes are lowercase
-		// Grab necessary hook if one is defined
-		if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
-			name = name.toLowerCase();
-			hooks = jQuery.attrHooks[ name ] ||
-				( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
+		// Use the fix-ed jQuery.Event rather than the (read-only) native event
+		args[0] = event;
+		event.delegateTarget = this;
+
+		// Call the preDispatch hook for the mapped type, and let it bail if desired
+		if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+			return;
 		}
 
-		if ( value !== undefined ) {
+		// Determine handlers
+		handlerQueue = jQuery.event.handlers.call( this, event, handlers );
 
-			if ( value === null ) {
-				jQuery.removeAttr( elem, name );
+		// Run delegates first; they may want to stop propagation beneath us
+		i = 0;
+		while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
+			event.currentTarget = matched.elem;
 
-			} else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
+			j = 0;
+			while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
 
-			} else {
-				elem.setAttribute( name, value + "" );
-				return value;
-			}
+				// Triggered event must either 1) have no namespace, or
+				// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+				if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
 
-		} else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-			return ret;
+					event.handleObj = handleObj;
+					event.data = handleObj.data;
 
-		} else {
-			ret = jQuery.find.attr( elem, name );
+					ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+							.apply( matched.elem, args );
 
-			// Non-existent attributes return null, we normalize to undefined
-			return ret == null ?
-				undefined :
-				ret;
+					if ( ret !== undefined ) {
+						if ( (event.result = ret) === false ) {
+							event.preventDefault();
+							event.stopPropagation();
+						}
+					}
+				}
+			}
+		}
+
+		// Call the postDispatch hook for the mapped type
+		if ( special.postDispatch ) {
+			special.postDispatch.call( this, event );
 		}
+
+		return event.result;
 	},
 
-	removeAttr: function( elem, value ) {
-		var name, propName,
-			i = 0,
-			attrNames = value && value.match( core_rnotwhite );
+	handlers: function( event, handlers ) {
+		var sel, handleObj, matches, i,
+			handlerQueue = [],
+			delegateCount = handlers.delegateCount,
+			cur = event.target;
 
-		if ( attrNames && elem.nodeType === 1 ) {
-			while ( (name = attrNames[i++]) ) {
-				propName = jQuery.propFix[ name ] || name;
+		// Find delegate handlers
+		// Black-hole SVG <use> instance trees (#13180)
+		// Avoid non-left-click bubbling in Firefox (#3861)
+		if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
 
-				// Boolean attributes get special treatment (#10870)
-				if ( jQuery.expr.match.bool.test( name ) ) {
-					// Set corresponding property to false
-					if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
-						elem[ propName ] = false;
-					// Support: IE<9
-					// Also clear defaultChecked/defaultSelected (if appropriate)
-					} else {
-						elem[ jQuery.camelCase( "default-" + name ) ] =
-							elem[ propName ] = false;
-					}
+			/* jshint eqeqeq: false */
+			for ( ; cur != this; cur = cur.parentNode || this ) {
+				/* jshint eqeqeq: true */
 
-				// See #9699 for explanation of this approach (setting first, then removal)
-				} else {
-					jQuery.attr( elem, name, "" );
-				}
+				// Don't check non-elements (#13208)
+				// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+				if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
+					matches = [];
+					for ( i = 0; i < delegateCount; i++ ) {
+						handleObj = handlers[ i ];
 
-				elem.removeAttribute( getSetAttribute ? name : propName );
-			}
-		}
-	},
+						// Don't conflict with Object.prototype properties (#13203)
+						sel = handleObj.selector + " ";
 
-	attrHooks: {
-		type: {
-			set: function( elem, value ) {
-				if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
-					// Setting the type on a radio button after the value resets the value in IE6-9
-					// Reset value to default in case type is set after value during creation
-					var val = elem.value;
-					elem.setAttribute( "type", value );
-					if ( val ) {
-						elem.value = val;
+						if ( matches[ sel ] === undefined ) {
+							matches[ sel ] = handleObj.needsContext ?
+								jQuery( sel, this ).index( cur ) >= 0 :
+								jQuery.find( sel, this, null, [ cur ] ).length;
+						}
+						if ( matches[ sel ] ) {
+							matches.push( handleObj );
+						}
+					}
+					if ( matches.length ) {
+						handlerQueue.push({ elem: cur, handlers: matches });
 					}
-					return value;
 				}
 			}
 		}
-	},
-
-	propFix: {
-		"for": "htmlFor",
-		"class": "className"
-	},
-
-	prop: function( elem, name, value ) {
-		var ret, hooks, notxml,
-			nType = elem.nodeType;
 
-		// don't get/set properties on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
+		// Add the remaining (directly-bound) handlers
+		if ( delegateCount < handlers.length ) {
+			handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
 		}
 
-		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+		return handlerQueue;
+	},
 
-		if ( notxml ) {
-			// Fix name and attach hooks
-			name = jQuery.propFix[ name ] || name;
-			hooks = jQuery.propHooks[ name ];
+	fix: function( event ) {
+		if ( event[ jQuery.expando ] ) {
+			return event;
 		}
 
-		if ( value !== undefined ) {
-			return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
-				ret :
-				( elem[ name ] = value );
+		// Create a writable copy of the event object and normalize some properties
+		var i, prop, copy,
+			type = event.type,
+			originalEvent = event,
+			fixHook = this.fixHooks[ type ];
 
-		} else {
-			return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
-				ret :
-				elem[ name ];
+		if ( !fixHook ) {
+			this.fixHooks[ type ] = fixHook =
+				rmouseEvent.test( type ) ? this.mouseHooks :
+				rkeyEvent.test( type ) ? this.keyHooks :
+				{};
 		}
-	},
+		copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
 
-	propHooks: {
-		tabIndex: {
-			get: function( elem ) {
-				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-				// Use proper attribute retrieval(#12072)
-				var tabindex = jQuery.find.attr( elem, "tabindex" );
+		event = new jQuery.Event( originalEvent );
 
-				return tabindex ?
-					parseInt( tabindex, 10 ) :
-					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
-						0 :
-						-1;
-			}
+		i = copy.length;
+		while ( i-- ) {
+			prop = copy[ i ];
+			event[ prop ] = originalEvent[ prop ];
 		}
-	}
-});
 
-// Hooks for boolean attributes
-boolHook = {
-	set: function( elem, value, name ) {
-		if ( value === false ) {
-			// Remove boolean attributes when set to false
-			jQuery.removeAttr( elem, name );
-		} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
-			// IE<8 needs the *property* name
-			elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
+		// Support: IE<9
+		// Fix target property (#1925)
+		if ( !event.target ) {
+			event.target = originalEvent.srcElement || document;
+		}
 
-		// Use defaultChecked and defaultSelected for oldIE
-		} else {
-			elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
+		// Support: Chrome 23+, Safari?
+		// Target should not be a text node (#504, #13143)
+		if ( event.target.nodeType === 3 ) {
+			event.target = event.target.parentNode;
 		}
 
-		return name;
-	}
-};
-jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
-	var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
+		// Support: IE<9
+		// For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
+		event.metaKey = !!event.metaKey;
 
-	jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
-		function( elem, name, isXML ) {
-			var fn = jQuery.expr.attrHandle[ name ],
-				ret = isXML ?
-					undefined :
-					/* jshint eqeqeq: false */
-					(jQuery.expr.attrHandle[ name ] = undefined) !=
-						getter( elem, name, isXML ) ?
-
-						name.toLowerCase() :
-						null;
-			jQuery.expr.attrHandle[ name ] = fn;
-			return ret;
-		} :
-		function( elem, name, isXML ) {
-			return isXML ?
-				undefined :
-				elem[ jQuery.camelCase( "default-" + name ) ] ?
-					name.toLowerCase() :
-					null;
-		};
-});
+		return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
+	},
 
-// fix oldIE attroperties
-if ( !getSetInput || !getSetAttribute ) {
-	jQuery.attrHooks.value = {
-		set: function( elem, value, name ) {
-			if ( jQuery.nodeName( elem, "input" ) ) {
-				// Does not return so that setAttribute is also used
-				elem.defaultValue = value;
-			} else {
-				// Use nodeHook if defined (#1954); otherwise setAttribute is fine
-				return nodeHook && nodeHook.set( elem, value, name );
-			}
-		}
-	};
-}
+	// Includes some event props shared by KeyEvent and MouseEvent
+	props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
 
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
+	fixHooks: {},
 
-	// Use this for any attribute in IE6/7
-	// This fixes almost every IE6/7 issue
-	nodeHook = {
-		set: function( elem, value, name ) {
-			// Set the existing or create a new attribute node
-			var ret = elem.getAttributeNode( name );
-			if ( !ret ) {
-				elem.setAttributeNode(
-					(ret = elem.ownerDocument.createAttribute( name ))
-				);
-			}
+	keyHooks: {
+		props: "char charCode key keyCode".split(" "),
+		filter: function( event, original ) {
 
-			ret.value = value += "";
+			// Add which for key events
+			if ( event.which == null ) {
+				event.which = original.charCode != null ? original.charCode : original.keyCode;
+			}
 
-			// Break association with cloned elements by also using setAttribute (#9646)
-			return name === "value" || value === elem.getAttribute( name ) ?
-				value :
-				undefined;
+			return event;
 		}
-	};
-	jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords =
-		// Some attributes are constructed with empty-string values when not defined
-		function( elem, name, isXML ) {
-			var ret;
-			return isXML ?
-				undefined :
-				(ret = elem.getAttributeNode( name )) && ret.value !== "" ?
-					ret.value :
-					null;
-		};
-	jQuery.valHooks.button = {
-		get: function( elem, name ) {
-			var ret = elem.getAttributeNode( name );
-			return ret && ret.specified ?
-				ret.value :
-				undefined;
-		},
-		set: nodeHook.set
-	};
+	},
 
-	// Set contenteditable to false on removals(#10429)
-	// Setting to empty string throws an error as an invalid value
-	jQuery.attrHooks.contenteditable = {
-		set: function( elem, value, name ) {
-			nodeHook.set( elem, value === "" ? false : value, name );
-		}
-	};
+	mouseHooks: {
+		props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
+		filter: function( event, original ) {
+			var body, eventDoc, doc,
+				button = original.button,
+				fromElement = original.fromElement;
 
-	// Set width and height to auto instead of 0 on empty string( Bug #8150 )
-	// This is for removals
-	jQuery.each([ "width", "height" ], function( i, name ) {
-		jQuery.attrHooks[ name ] = {
-			set: function( elem, value ) {
-				if ( value === "" ) {
-					elem.setAttribute( name, "auto" );
-					return value;
-				}
+			// Calculate pageX/Y if missing and clientX/Y available
+			if ( event.pageX == null && original.clientX != null ) {
+				eventDoc = event.target.ownerDocument || document;
+				doc = eventDoc.documentElement;
+				body = eventDoc.body;
+
+				event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+				event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
 			}
-		};
-	});
-}
 
+			// Add relatedTarget, if necessary
+			if ( !event.relatedTarget && fromElement ) {
+				event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
+			}
 
-// Some attributes require a special call on IE
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !jQuery.support.hrefNormalized ) {
-	// href/src property should get the full normalized URL (#10299/#12915)
-	jQuery.each([ "href", "src" ], function( i, name ) {
-		jQuery.propHooks[ name ] = {
-			get: function( elem ) {
-				return elem.getAttribute( name, 4 );
+			// Add which for click: 1 === left; 2 === middle; 3 === right
+			// Note: button is not normalized, so don't use it
+			if ( !event.which && button !== undefined ) {
+				event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
 			}
-		};
-	});
-}
 
-if ( !jQuery.support.style ) {
-	jQuery.attrHooks.style = {
-		get: function( elem ) {
-			// Return undefined in the case of empty string
-			// Note: IE uppercases css property names, but if we were to .toLowerCase()
-			// .cssText, that would destroy case senstitivity in URL's, like in "background"
-			return elem.style.cssText || undefined;
-		},
-		set: function( elem, value ) {
-			return ( elem.style.cssText = value + "" );
+			return event;
 		}
-	};
-}
+	},
 
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
-	jQuery.propHooks.selected = {
-		get: function( elem ) {
-			var parent = elem.parentNode;
+	special: {
+		load: {
+			// Prevent triggered image.load events from bubbling to window.load
+			noBubble: true
+		},
+		focus: {
+			// Fire native event if possible so blur/focus sequence is correct
+			trigger: function() {
+				if ( this !== safeActiveElement() && this.focus ) {
+					try {
+						this.focus();
+						return false;
+					} catch ( e ) {
+						// Support: IE<9
+						// If we error on focus to hidden element (#1486, #12518),
+						// let .trigger() run the handlers
+					}
+				}
+			},
+			delegateType: "focusin"
+		},
+		blur: {
+			trigger: function() {
+				if ( this === safeActiveElement() && this.blur ) {
+					this.blur();
+					return false;
+				}
+			},
+			delegateType: "focusout"
+		},
+		click: {
+			// For checkbox, fire native event so checked state will be right
+			trigger: function() {
+				if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
+					this.click();
+					return false;
+				}
+			},
 
-			if ( parent ) {
-				parent.selectedIndex;
+			// For cross-browser consistency, don't fire native .click() on links
+			_default: function( event ) {
+				return jQuery.nodeName( event.target, "a" );
+			}
+		},
 
-				// Make sure that it also works with optgroups, see #5701
-				if ( parent.parentNode ) {
-					parent.parentNode.selectedIndex;
+		beforeunload: {
+			postDispatch: function( event ) {
+
+				// Support: Firefox 20+
+				// Firefox doesn't alert if the returnValue field is not set.
+				if ( event.result !== undefined && event.originalEvent ) {
+					event.originalEvent.returnValue = event.result;
 				}
 			}
-			return null;
 		}
-	};
-}
+	},
 
-jQuery.each([
-	"tabIndex",
-	"readOnly",
-	"maxLength",
-	"cellSpacing",
-	"cellPadding",
-	"rowSpan",
-	"colSpan",
-	"useMap",
-	"frameBorder",
-	"contentEditable"
-], function() {
-	jQuery.propFix[ this.toLowerCase() ] = this;
-});
+	simulate: function( type, elem, event, bubble ) {
+		// Piggyback on a donor event to simulate a different one.
+		// Fake originalEvent to avoid donor's stopPropagation, but if the
+		// simulated event prevents default then we do the same on the donor.
+		var e = jQuery.extend(
+			new jQuery.Event(),
+			event,
+			{
+				type: type,
+				isSimulated: true,
+				originalEvent: {}
+			}
+		);
+		if ( bubble ) {
+			jQuery.event.trigger( e, null, elem );
+		} else {
+			jQuery.event.dispatch.call( elem, e );
+		}
+		if ( e.isDefaultPrevented() ) {
+			event.preventDefault();
+		}
+	}
+};
 
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
-	jQuery.propFix.enctype = "encoding";
-}
+jQuery.removeEvent = document.removeEventListener ?
+	function( elem, type, handle ) {
+		if ( elem.removeEventListener ) {
+			elem.removeEventListener( type, handle, false );
+		}
+	} :
+	function( elem, type, handle ) {
+		var name = "on" + type;
 
-// Radios and checkboxes getter/setter
-jQuery.each([ "radio", "checkbox" ], function() {
-	jQuery.valHooks[ this ] = {
-		set: function( elem, value ) {
-			if ( jQuery.isArray( value ) ) {
-				return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+		if ( elem.detachEvent ) {
+
+			// #8545, #7054, preventing memory leaks for custom events in IE6-8
+			// detachEvent needed property on element, by name of that event, to properly expose it to GC
+			if ( typeof elem[ name ] === strundefined ) {
+				elem[ name ] = null;
 			}
+
+			elem.detachEvent( name, handle );
 		}
 	};
-	if ( !jQuery.support.checkOn ) {
-		jQuery.valHooks[ this ].get = function( elem ) {
-			// Support: Webkit
-			// "" is returned instead of "on" if a value isn't specified
-			return elem.getAttribute("value") === null ? "on" : elem.value;
-		};
+
+jQuery.Event = function( src, props ) {
+	// Allow instantiation without the 'new' keyword
+	if ( !(this instanceof jQuery.Event) ) {
+		return new jQuery.Event( src, props );
 	}
-});
-var rformElems = /^(?:input|select|textarea)$/i,
-	rkeyEvent = /^key/,
-	rmouseEvent = /^(?:mouse|contextmenu)|click/,
-	rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
-	rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
 
-function returnTrue() {
-	return true;
-}
+	// Event object
+	if ( src && src.type ) {
+		this.originalEvent = src;
+		this.type = src.type;
 
-function returnFalse() {
-	return false;
-}
+		// Events bubbling up the document may have been marked as prevented
+		// by a handler lower down the tree; reflect the correct value.
+		this.isDefaultPrevented = src.defaultPrevented ||
+				src.defaultPrevented === undefined &&
+				// Support: IE < 9, Android < 4.0
+				src.returnValue === false ?
+			returnTrue :
+			returnFalse;
 
-function safeActiveElement() {
-	try {
-		return document.activeElement;
-	} catch ( err ) { }
-}
+	// Event type
+	} else {
+		this.type = src;
+	}
 
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
+	// Put explicitly provided properties onto the event object
+	if ( props ) {
+		jQuery.extend( this, props );
+	}
 
-	global: {},
+	// Create a timestamp if incoming event doesn't have one
+	this.timeStamp = src && src.timeStamp || jQuery.now();
+
+	// Mark it as fixed
+	this[ jQuery.expando ] = true;
+};
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+	isDefaultPrevented: returnFalse,
+	isPropagationStopped: returnFalse,
+	isImmediatePropagationStopped: returnFalse,
 
-	add: function( elem, types, handler, data, selector ) {
-		var tmp, events, t, handleObjIn,
-			special, eventHandle, handleObj,
-			handlers, type, namespaces, origType,
-			elemData = jQuery._data( elem );
+	preventDefault: function() {
+		var e = this.originalEvent;
 
-		// Don't attach events to noData or text/comment nodes (but allow plain objects)
-		if ( !elemData ) {
+		this.isDefaultPrevented = returnTrue;
+		if ( !e ) {
 			return;
 		}
 
-		// Caller can pass in an object of custom data in lieu of the handler
-		if ( handler.handler ) {
-			handleObjIn = handler;
-			handler = handleObjIn.handler;
-			selector = handleObjIn.selector;
-		}
+		// If preventDefault exists, run it on the original event
+		if ( e.preventDefault ) {
+			e.preventDefault();
 
-		// Make sure that the handler has a unique ID, used to find/remove it later
-		if ( !handler.guid ) {
-			handler.guid = jQuery.guid++;
+		// Support: IE
+		// Otherwise set the returnValue property of the original event to false
+		} else {
+			e.returnValue = false;
 		}
+	},
+	stopPropagation: function() {
+		var e = this.originalEvent;
 
-		// Init the element's event structure and main handler, if this is the first
-		if ( !(events = elemData.events) ) {
-			events = elemData.events = {};
+		this.isPropagationStopped = returnTrue;
+		if ( !e ) {
+			return;
 		}
-		if ( !(eventHandle = elemData.handle) ) {
-			eventHandle = elemData.handle = function( e ) {
-				// Discard the second event of a jQuery.event.trigger() and
-				// when an event is called after a page has unloaded
-				return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
-					jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
-					undefined;
-			};
-			// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
-			eventHandle.elem = elem;
+		// If stopPropagation exists, run it on the original event
+		if ( e.stopPropagation ) {
+			e.stopPropagation();
 		}
 
-		// Handle multiple events separated by a space
-		types = ( types || "" ).match( core_rnotwhite ) || [""];
-		t = types.length;
-		while ( t-- ) {
-			tmp = rtypenamespace.exec( types[t] ) || [];
-			type = origType = tmp[1];
-			namespaces = ( tmp[2] || "" ).split( "." ).sort();
+		// Support: IE
+		// Set the cancelBubble property of the original event to true
+		e.cancelBubble = true;
+	},
+	stopImmediatePropagation: function() {
+		var e = this.originalEvent;
 
-			// There *must* be a type, no attaching namespace-only handlers
-			if ( !type ) {
-				continue;
-			}
+		this.isImmediatePropagationStopped = returnTrue;
 
-			// If event changes its type, use the special event handlers for the changed type
-			special = jQuery.event.special[ type ] || {};
+		if ( e && e.stopImmediatePropagation ) {
+			e.stopImmediatePropagation();
+		}
 
-			// If selector defined, determine special event api type, otherwise given type
-			type = ( selector ? special.delegateType : special.bindType ) || type;
+		this.stopPropagation();
+	}
+};
 
-			// Update special based on newly reset type
-			special = jQuery.event.special[ type ] || {};
+// Create mouseenter/leave events using mouseover/out and event-time checks
+jQuery.each({
+	mouseenter: "mouseover",
+	mouseleave: "mouseout",
+	pointerenter: "pointerover",
+	pointerleave: "pointerout"
+}, function( orig, fix ) {
+	jQuery.event.special[ orig ] = {
+		delegateType: fix,
+		bindType: fix,
 
-			// handleObj is passed to all event handlers
-			handleObj = jQuery.extend({
-				type: type,
-				origType: origType,
-				data: data,
-				handler: handler,
-				guid: handler.guid,
-				selector: selector,
-				needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
-				namespace: namespaces.join(".")
-			}, handleObjIn );
+		handle: function( event ) {
+			var ret,
+				target = this,
+				related = event.relatedTarget,
+				handleObj = event.handleObj;
 
-			// Init the event handler queue if we're the first
-			if ( !(handlers = events[ type ]) ) {
-				handlers = events[ type ] = [];
-				handlers.delegateCount = 0;
+			// For mousenter/leave call the handler if related is outside the target.
+			// NB: No relatedTarget if the mouse left/entered the browser window
+			if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
+				event.type = handleObj.origType;
+				ret = handleObj.handler.apply( this, arguments );
+				event.type = fix;
+			}
+			return ret;
+		}
+	};
+});
 
-				// Only use addEventListener/attachEvent if the special events handler returns false
-				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-					// Bind the global event handler to the element
-					if ( elem.addEventListener ) {
-						elem.addEventListener( type, eventHandle, false );
+// IE submit delegation
+if ( !support.submitBubbles ) {
 
-					} else if ( elem.attachEvent ) {
-						elem.attachEvent( "on" + type, eventHandle );
-					}
-				}
+	jQuery.event.special.submit = {
+		setup: function() {
+			// Only need this for delegated form submit events
+			if ( jQuery.nodeName( this, "form" ) ) {
+				return false;
 			}
 
-			if ( special.add ) {
-				special.add.call( elem, handleObj );
+			// Lazy-add a submit handler when a descendant form may potentially be submitted
+			jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
+				// Node name check avoids a VML-related crash in IE (#9807)
+				var elem = e.target,
+					form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
+				if ( form && !jQuery._data( form, "submitBubbles" ) ) {
+					jQuery.event.add( form, "submit._submit", function( event ) {
+						event._submit_bubble = true;
+					});
+					jQuery._data( form, "submitBubbles", true );
+				}
+			});
+			// return undefined since we don't need an event listener
+		},
 
-				if ( !handleObj.handler.guid ) {
-					handleObj.handler.guid = handler.guid;
+		postDispatch: function( event ) {
+			// If form was submitted by the user, bubble the event up the tree
+			if ( event._submit_bubble ) {
+				delete event._submit_bubble;
+				if ( this.parentNode && !event.isTrigger ) {
+					jQuery.event.simulate( "submit", this.parentNode, event, true );
 				}
 			}
+		},
 
-			// Add to the element's handler list, delegates in front
-			if ( selector ) {
-				handlers.splice( handlers.delegateCount++, 0, handleObj );
-			} else {
-				handlers.push( handleObj );
+		teardown: function() {
+			// Only need this for delegated form submit events
+			if ( jQuery.nodeName( this, "form" ) ) {
+				return false;
 			}
 
-			// Keep track of which events have ever been used, for event optimization
-			jQuery.event.global[ type ] = true;
+			// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
+			jQuery.event.remove( this, "._submit" );
 		}
+	};
+}
 
-		// Nullify elem to prevent memory leaks in IE
-		elem = null;
-	},
+// IE change delegation and checkbox/radio fix
+if ( !support.changeBubbles ) {
 
-	// Detach an event or set of events from an element
-	remove: function( elem, types, handler, selector, mappedTypes ) {
-		var j, handleObj, tmp,
-			origCount, t, events,
-			special, handlers, type,
-			namespaces, origType,
-			elemData = jQuery.hasData( elem ) && jQuery._data( elem );
+	jQuery.event.special.change = {
 
-		if ( !elemData || !(events = elemData.events) ) {
-			return;
+		setup: function() {
+
+			if ( rformElems.test( this.nodeName ) ) {
+				// IE doesn't fire change on a check/radio until blur; trigger it on click
+				// after a propertychange. Eat the blur-change in special.change.handle.
+				// This still fires onchange a second time for check/radio after blur.
+				if ( this.type === "checkbox" || this.type === "radio" ) {
+					jQuery.event.add( this, "propertychange._change", function( event ) {
+						if ( event.originalEvent.propertyName === "checked" ) {
+							this._just_changed = true;
+						}
+					});
+					jQuery.event.add( this, "click._change", function( event ) {
+						if ( this._just_changed && !event.isTrigger ) {
+							this._just_changed = false;
+						}
+						// Allow triggered, simulated change events (#11500)
+						jQuery.event.simulate( "change", this, event, true );
+					});
+				}
+				return false;
+			}
+			// Delegated event; lazy-add a change handler on descendant inputs
+			jQuery.event.add( this, "beforeactivate._change", function( e ) {
+				var elem = e.target;
+
+				if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
+					jQuery.event.add( elem, "change._change", function( event ) {
+						if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
+							jQuery.event.simulate( "change", this.parentNode, event, true );
+						}
+					});
+					jQuery._data( elem, "changeBubbles", true );
+				}
+			});
+		},
+
+		handle: function( event ) {
+			var elem = event.target;
+
+			// Swallow native change events from checkbox/radio, we already triggered them above
+			if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
+				return event.handleObj.handler.apply( this, arguments );
+			}
+		},
+
+		teardown: function() {
+			jQuery.event.remove( this, "._change" );
+
+			return !rformElems.test( this.nodeName );
 		}
+	};
+}
 
-		// Once for each type.namespace in types; type may be omitted
-		types = ( types || "" ).match( core_rnotwhite ) || [""];
-		t = types.length;
-		while ( t-- ) {
-			tmp = rtypenamespace.exec( types[t] ) || [];
-			type = origType = tmp[1];
-			namespaces = ( tmp[2] || "" ).split( "." ).sort();
+// Create "bubbling" focus and blur events
+if ( !support.focusinBubbles ) {
+	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+		// Attach a single capturing handler on the document while someone wants focusin/focusout
+		var handler = function( event ) {
+				jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+			};
+
+		jQuery.event.special[ fix ] = {
+			setup: function() {
+				var doc = this.ownerDocument || this,
+					attaches = jQuery._data( doc, fix );
+
+				if ( !attaches ) {
+					doc.addEventListener( orig, handler, true );
+				}
+				jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
+			},
+			teardown: function() {
+				var doc = this.ownerDocument || this,
+					attaches = jQuery._data( doc, fix ) - 1;
 
-			// Unbind all events (on this namespace, if provided) for the element
-			if ( !type ) {
-				for ( type in events ) {
-					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+				if ( !attaches ) {
+					doc.removeEventListener( orig, handler, true );
+					jQuery._removeData( doc, fix );
+				} else {
+					jQuery._data( doc, fix, attaches );
 				}
-				continue;
 			}
+		};
+	});
+}
 
-			special = jQuery.event.special[ type ] || {};
-			type = ( selector ? special.delegateType : special.bindType ) || type;
-			handlers = events[ type ] || [];
-			tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
-
-			// Remove matching events
-			origCount = j = handlers.length;
-			while ( j-- ) {
-				handleObj = handlers[ j ];
+jQuery.fn.extend({
 
-				if ( ( mappedTypes || origType === handleObj.origType ) &&
-					( !handler || handler.guid === handleObj.guid ) &&
-					( !tmp || tmp.test( handleObj.namespace ) ) &&
-					( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
-					handlers.splice( j, 1 );
+	on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
+		var type, origFn;
 
-					if ( handleObj.selector ) {
-						handlers.delegateCount--;
-					}
-					if ( special.remove ) {
-						special.remove.call( elem, handleObj );
-					}
-				}
+		// Types can be a map of types/handlers
+		if ( typeof types === "object" ) {
+			// ( types-Object, selector, data )
+			if ( typeof selector !== "string" ) {
+				// ( types-Object, data )
+				data = data || selector;
+				selector = undefined;
+			}
+			for ( type in types ) {
+				this.on( type, selector, data, types[ type ], one );
 			}
+			return this;
+		}
 
-			// Remove generic event handler if we removed something and no more handlers exist
-			// (avoids potential for endless recursion during removal of special event handlers)
-			if ( origCount && !handlers.length ) {
-				if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
-					jQuery.removeEvent( elem, type, elemData.handle );
-				}
+		if ( data == null && fn == null ) {
+			// ( types, fn )
+			fn = selector;
+			data = selector = undefined;
+		} else if ( fn == null ) {
+			if ( typeof selector === "string" ) {
+				// ( types, selector, fn )
+				fn = data;
+				data = undefined;
+			} else {
+				// ( types, data, fn )
+				fn = data;
+				data = selector;
+				selector = undefined;
+			}
+		}
+		if ( fn === false ) {
+			fn = returnFalse;
+		} else if ( !fn ) {
+			return this;
+		}
 
-				delete events[ type ];
+		if ( one === 1 ) {
+			origFn = fn;
+			fn = function( event ) {
+				// Can use an empty set, since event contains the info
+				jQuery().off( event );
+				return origFn.apply( this, arguments );
+			};
+			// Use same guid so caller can remove using origFn
+			fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+		}
+		return this.each( function() {
+			jQuery.event.add( this, types, fn, data, selector );
+		});
+	},
+	one: function( types, selector, data, fn ) {
+		return this.on( types, selector, data, fn, 1 );
+	},
+	off: function( types, selector, fn ) {
+		var handleObj, type;
+		if ( types && types.preventDefault && types.handleObj ) {
+			// ( event )  dispatched jQuery.Event
+			handleObj = types.handleObj;
+			jQuery( types.delegateTarget ).off(
+				handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
+				handleObj.selector,
+				handleObj.handler
+			);
+			return this;
+		}
+		if ( typeof types === "object" ) {
+			// ( types-object [, selector] )
+			for ( type in types ) {
+				this.off( type, selector, types[ type ] );
 			}
+			return this;
+		}
+		if ( selector === false || typeof selector === "function" ) {
+			// ( types [, fn] )
+			fn = selector;
+			selector = undefined;
+		}
+		if ( fn === false ) {
+			fn = returnFalse;
 		}
+		return this.each(function() {
+			jQuery.event.remove( this, types, fn, selector );
+		});
+	},
 
-		// Remove the expando if it's no longer used
-		if ( jQuery.isEmptyObject( events ) ) {
-			delete elemData.handle;
+	trigger: function( type, data ) {
+		return this.each(function() {
+			jQuery.event.trigger( type, data, this );
+		});
+	},
+	triggerHandler: function( type, data ) {
+		var elem = this[0];
+		if ( elem ) {
+			return jQuery.event.trigger( type, data, elem, true );
+		}
+	}
+});
 
-			// removeData also checks for emptiness and clears the expando if empty
-			// so use it instead of delete
-			jQuery._removeData( elem, "events" );
+
+function createSafeFragment( document ) {
+	var list = nodeNames.split( "|" ),
+		safeFrag = document.createDocumentFragment();
+
+	if ( safeFrag.createElement ) {
+		while ( list.length ) {
+			safeFrag.createElement(
+				list.pop()
+			);
 		}
+	}
+	return safeFrag;
+}
+
+var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
+		"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
+	rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
+	rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
+	rleadingWhitespace = /^\s+/,
+	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
+	rtagName = /<([\w:]+)/,
+	rtbody = /<tbody/i,
+	rhtml = /<|&#?\w+;/,
+	rnoInnerhtml = /<(?:script|style|link)/i,
+	// checked="checked" or checked
+	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+	rscriptType = /^$|\/(?:java|ecma)script/i,
+	rscriptTypeMasked = /^true\/(.*)/,
+	rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
+
+	// We have to close these tags to support XHTML (#13200)
+	wrapMap = {
+		option: [ 1, "<select multiple='multiple'>", "</select>" ],
+		legend: [ 1, "<fieldset>", "</fieldset>" ],
+		area: [ 1, "<map>", "</map>" ],
+		param: [ 1, "<object>", "</object>" ],
+		thead: [ 1, "<table>", "</table>" ],
+		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+		col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+
+		// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
+		// unless wrapped in a div with non-breaking characters in front of it.
+		_default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>"  ]
 	},
+	safeFragment = createSafeFragment( document ),
+	fragmentDiv = safeFragment.appendChild( document.createElement("div") );
 
-	trigger: function( event, data, elem, onlyHandlers ) {
-		var handle, ontype, cur,
-			bubbleType, special, tmp, i,
-			eventPath = [ elem || document ],
-			type = core_hasOwn.call( event, "type" ) ? event.type : event,
-			namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
 
-		cur = tmp = elem = elem || document;
+function getAll( context, tag ) {
+	var elems, elem,
+		i = 0,
+		found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
+			typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
+			undefined;
 
-		// Don't do events on text and comment nodes
-		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return;
+	if ( !found ) {
+		for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
+			if ( !tag || jQuery.nodeName( elem, tag ) ) {
+				found.push( elem );
+			} else {
+				jQuery.merge( found, getAll( elem, tag ) );
+			}
 		}
+	}
 
-		// focus/blur morphs to focusin/out; ensure we're not firing them right now
-		if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
-			return;
-		}
+	return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
+		jQuery.merge( [ context ], found ) :
+		found;
+}
 
-		if ( type.indexOf(".") >= 0 ) {
-			// Namespaced trigger; create a regexp to match event type in handle()
-			namespaces = type.split(".");
-			type = namespaces.shift();
-			namespaces.sort();
-		}
-		ontype = type.indexOf(":") < 0 && "on" + type;
+// Used in buildFragment, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+	if ( rcheckableType.test( elem.type ) ) {
+		elem.defaultChecked = elem.checked;
+	}
+}
 
-		// Caller can pass in a jQuery.Event object, Object, or just an event type string
-		event = event[ jQuery.expando ] ?
-			event :
-			new jQuery.Event( type, typeof event === "object" && event );
+// Support: IE<8
+// Manipulating tables requires a tbody
+function manipulationTarget( elem, content ) {
+	return jQuery.nodeName( elem, "table" ) &&
+		jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
 
-		// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
-		event.isTrigger = onlyHandlers ? 2 : 3;
-		event.namespace = namespaces.join(".");
-		event.namespace_re = event.namespace ?
-			new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
-			null;
+		elem.getElementsByTagName("tbody")[0] ||
+			elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
+		elem;
+}
+
+// Replace/restore the type attribute of script elements for safe DOM manipulation
+function disableScript( elem ) {
+	elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
+	return elem;
+}
+function restoreScript( elem ) {
+	var match = rscriptTypeMasked.exec( elem.type );
+	if ( match ) {
+		elem.type = match[1];
+	} else {
+		elem.removeAttribute("type");
+	}
+	return elem;
+}
 
-		// Clean up the event in case it is being reused
-		event.result = undefined;
-		if ( !event.target ) {
-			event.target = elem;
-		}
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+	var elem,
+		i = 0;
+	for ( ; (elem = elems[i]) != null; i++ ) {
+		jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
+	}
+}
 
-		// Clone any incoming data and prepend the event, creating the handler arg list
-		data = data == null ?
-			[ event ] :
-			jQuery.makeArray( data, [ event ] );
+function cloneCopyEvent( src, dest ) {
 
-		// Allow special events to draw outside the lines
-		special = jQuery.event.special[ type ] || {};
-		if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
-			return;
-		}
+	if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+		return;
+	}
 
-		// Determine event propagation path in advance, per W3C events spec (#9951)
-		// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
-		if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+	var type, i, l,
+		oldData = jQuery._data( src ),
+		curData = jQuery._data( dest, oldData ),
+		events = oldData.events;
 
-			bubbleType = special.delegateType || type;
-			if ( !rfocusMorph.test( bubbleType + type ) ) {
-				cur = cur.parentNode;
-			}
-			for ( ; cur; cur = cur.parentNode ) {
-				eventPath.push( cur );
-				tmp = cur;
-			}
+	if ( events ) {
+		delete curData.handle;
+		curData.events = {};
 
-			// Only add window if we got to document (e.g., not plain obj or detached DOM)
-			if ( tmp === (elem.ownerDocument || document) ) {
-				eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+		for ( type in events ) {
+			for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+				jQuery.event.add( dest, type, events[ type ][ i ] );
 			}
 		}
+	}
 
-		// Fire handlers on the event path
-		i = 0;
-		while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
-
-			event.type = i > 1 ?
-				bubbleType :
-				special.bindType || type;
+	// make the cloned public data object a copy from the original
+	if ( curData.data ) {
+		curData.data = jQuery.extend( {}, curData.data );
+	}
+}
 
-			// jQuery handler
-			handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
-			if ( handle ) {
-				handle.apply( cur, data );
-			}
+function fixCloneNodeIssues( src, dest ) {
+	var nodeName, e, data;
 
-			// Native handler
-			handle = ontype && cur[ ontype ];
-			if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
-				event.preventDefault();
-			}
-		}
-		event.type = type;
+	// We do not need to do anything for non-Elements
+	if ( dest.nodeType !== 1 ) {
+		return;
+	}
 
-		// If nobody prevented the default action, do it now
-		if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+	nodeName = dest.nodeName.toLowerCase();
 
-			if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
-				jQuery.acceptData( elem ) ) {
+	// IE6-8 copies events bound via attachEvent when using cloneNode.
+	if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
+		data = jQuery._data( dest );
 
-				// Call a native DOM method on the target with the same name name as the event.
-				// Can't use an .isFunction() check here because IE6/7 fails that test.
-				// Don't do default actions on window, that's where global variables be (#6170)
-				if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
+		for ( e in data.events ) {
+			jQuery.removeEvent( dest, e, data.handle );
+		}
 
-					// Don't re-trigger an onFOO event when we call its FOO() method
-					tmp = elem[ ontype ];
+		// Event data gets referenced instead of copied if the expando gets copied too
+		dest.removeAttribute( jQuery.expando );
+	}
 
-					if ( tmp ) {
-						elem[ ontype ] = null;
-					}
+	// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
+	if ( nodeName === "script" && dest.text !== src.text ) {
+		disableScript( dest ).text = src.text;
+		restoreScript( dest );
 
-					// Prevent re-triggering of the same event, since we already bubbled it above
-					jQuery.event.triggered = type;
-					try {
-						elem[ type ]();
-					} catch ( e ) {
-						// IE<9 dies on focus/blur to hidden element (#1486,#12518)
-						// only reproducible on winXP IE8 native, not IE9 in IE8 mode
-					}
-					jQuery.event.triggered = undefined;
+	// IE6-10 improperly clones children of object elements using classid.
+	// IE10 throws NoModificationAllowedError if parent is null, #12132.
+	} else if ( nodeName === "object" ) {
+		if ( dest.parentNode ) {
+			dest.outerHTML = src.outerHTML;
+		}
 
-					if ( tmp ) {
-						elem[ ontype ] = tmp;
-					}
-				}
-			}
+		// This path appears unavoidable for IE9. When cloning an object
+		// element in IE9, the outerHTML strategy above is not sufficient.
+		// If the src has innerHTML and the destination does not,
+		// copy the src.innerHTML into the dest.innerHTML. #10324
+		if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
+			dest.innerHTML = src.innerHTML;
 		}
 
-		return event.result;
-	},
+	} else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
+		// IE6-8 fails to persist the checked state of a cloned checkbox
+		// or radio button. Worse, IE6-7 fail to give the cloned element
+		// a checked appearance if the defaultChecked value isn't also set
 
-	dispatch: function( event ) {
+		dest.defaultChecked = dest.checked = src.checked;
 
-		// Make a writable jQuery.Event from the native event object
-		event = jQuery.event.fix( event );
+		// IE6-7 get confused and end up setting the value of a cloned
+		// checkbox/radio button to an empty string instead of "on"
+		if ( dest.value !== src.value ) {
+			dest.value = src.value;
+		}
 
-		var i, ret, handleObj, matched, j,
-			handlerQueue = [],
-			args = core_slice.call( arguments ),
-			handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
-			special = jQuery.event.special[ event.type ] || {};
+	// IE6-8 fails to return the selected option to the default selected
+	// state when cloning options
+	} else if ( nodeName === "option" ) {
+		dest.defaultSelected = dest.selected = src.defaultSelected;
 
-		// Use the fix-ed jQuery.Event rather than the (read-only) native event
-		args[0] = event;
-		event.delegateTarget = this;
+	// IE6-8 fails to set the defaultValue to the correct value when
+	// cloning other types of input fields
+	} else if ( nodeName === "input" || nodeName === "textarea" ) {
+		dest.defaultValue = src.defaultValue;
+	}
+}
 
-		// Call the preDispatch hook for the mapped type, and let it bail if desired
-		if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
-			return;
-		}
+jQuery.extend({
+	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+		var destElements, node, clone, i, srcElements,
+			inPage = jQuery.contains( elem.ownerDocument, elem );
 
-		// Determine handlers
-		handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+		if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
+			clone = elem.cloneNode( true );
 
-		// Run delegates first; they may want to stop propagation beneath us
-		i = 0;
-		while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
-			event.currentTarget = matched.elem;
+		// IE<=8 does not properly clone detached, unknown element nodes
+		} else {
+			fragmentDiv.innerHTML = elem.outerHTML;
+			fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
+		}
 
-			j = 0;
-			while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
+		if ( (!support.noCloneEvent || !support.noCloneChecked) &&
+				(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
 
-				// Triggered event must either 1) have no namespace, or
-				// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
-				if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
+			// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
+			destElements = getAll( clone );
+			srcElements = getAll( elem );
 
-					event.handleObj = handleObj;
-					event.data = handleObj.data;
+			// Fix all IE cloning issues
+			for ( i = 0; (node = srcElements[i]) != null; ++i ) {
+				// Ensure that the destination node is not null; Fixes #9587
+				if ( destElements[i] ) {
+					fixCloneNodeIssues( node, destElements[i] );
+				}
+			}
+		}
 
-					ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
-							.apply( matched.elem, args );
+		// Copy the events from the original to the clone
+		if ( dataAndEvents ) {
+			if ( deepDataAndEvents ) {
+				srcElements = srcElements || getAll( elem );
+				destElements = destElements || getAll( clone );
 
-					if ( ret !== undefined ) {
-						if ( (event.result = ret) === false ) {
-							event.preventDefault();
-							event.stopPropagation();
-						}
-					}
+				for ( i = 0; (node = srcElements[i]) != null; i++ ) {
+					cloneCopyEvent( node, destElements[i] );
 				}
+			} else {
+				cloneCopyEvent( elem, clone );
 			}
 		}
 
-		// Call the postDispatch hook for the mapped type
-		if ( special.postDispatch ) {
-			special.postDispatch.call( this, event );
+		// Preserve script evaluation history
+		destElements = getAll( clone, "script" );
+		if ( destElements.length > 0 ) {
+			setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
 		}
 
-		return event.result;
+		destElements = srcElements = node = null;
+
+		// Return the cloned set
+		return clone;
 	},
 
-	handlers: function( event, handlers ) {
-		var sel, handleObj, matches, i,
-			handlerQueue = [],
-			delegateCount = handlers.delegateCount,
-			cur = event.target;
+	buildFragment: function( elems, context, scripts, selection ) {
+		var j, elem, contains,
+			tmp, tag, tbody, wrap,
+			l = elems.length,
+
+			// Ensure a safe fragment
+			safe = createSafeFragment( context ),
+
+			nodes = [],
+			i = 0;
+
+		for ( ; i < l; i++ ) {
+			elem = elems[ i ];
+
+			if ( elem || elem === 0 ) {
+
+				// Add nodes directly
+				if ( jQuery.type( elem ) === "object" ) {
+					jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
 
-		// Find delegate handlers
-		// Black-hole SVG <use> instance trees (#13180)
-		// Avoid non-left-click bubbling in Firefox (#3861)
-		if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
+				// Convert non-html into a text node
+				} else if ( !rhtml.test( elem ) ) {
+					nodes.push( context.createTextNode( elem ) );
 
-			/* jshint eqeqeq: false */
-			for ( ; cur != this; cur = cur.parentNode || this ) {
-				/* jshint eqeqeq: true */
+				// Convert html into DOM nodes
+				} else {
+					tmp = tmp || safe.appendChild( context.createElement("div") );
 
-				// Don't check non-elements (#13208)
-				// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
-				if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
-					matches = [];
-					for ( i = 0; i < delegateCount; i++ ) {
-						handleObj = handlers[ i ];
+					// Deserialize a standard representation
+					tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
+					wrap = wrapMap[ tag ] || wrapMap._default;
 
-						// Don't conflict with Object.prototype properties (#13203)
-						sel = handleObj.selector + " ";
+					tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
 
-						if ( matches[ sel ] === undefined ) {
-							matches[ sel ] = handleObj.needsContext ?
-								jQuery( sel, this ).index( cur ) >= 0 :
-								jQuery.find( sel, this, null, [ cur ] ).length;
-						}
-						if ( matches[ sel ] ) {
-							matches.push( handleObj );
-						}
+					// Descend through wrappers to the right content
+					j = wrap[0];
+					while ( j-- ) {
+						tmp = tmp.lastChild;
 					}
-					if ( matches.length ) {
-						handlerQueue.push({ elem: cur, handlers: matches });
+
+					// Manually add leading whitespace removed by IE
+					if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+						nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
 					}
-				}
-			}
-		}
 
-		// Add the remaining (directly-bound) handlers
-		if ( delegateCount < handlers.length ) {
-			handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
-		}
+					// Remove IE's autoinserted <tbody> from table fragments
+					if ( !support.tbody ) {
 
-		return handlerQueue;
-	},
+						// String was a <table>, *may* have spurious <tbody>
+						elem = tag === "table" && !rtbody.test( elem ) ?
+							tmp.firstChild :
 
-	fix: function( event ) {
-		if ( event[ jQuery.expando ] ) {
-			return event;
-		}
+							// String was a bare <thead> or <tfoot>
+							wrap[1] === "<table>" && !rtbody.test( elem ) ?
+								tmp :
+								0;
 
-		// Create a writable copy of the event object and normalize some properties
-		var i, prop, copy,
-			type = event.type,
-			originalEvent = event,
-			fixHook = this.fixHooks[ type ];
+						j = elem && elem.childNodes.length;
+						while ( j-- ) {
+							if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
+								elem.removeChild( tbody );
+							}
+						}
+					}
 
-		if ( !fixHook ) {
-			this.fixHooks[ type ] = fixHook =
-				rmouseEvent.test( type ) ? this.mouseHooks :
-				rkeyEvent.test( type ) ? this.keyHooks :
-				{};
-		}
-		copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+					jQuery.merge( nodes, tmp.childNodes );
 
-		event = new jQuery.Event( originalEvent );
+					// Fix #12392 for WebKit and IE > 9
+					tmp.textContent = "";
 
-		i = copy.length;
-		while ( i-- ) {
-			prop = copy[ i ];
-			event[ prop ] = originalEvent[ prop ];
-		}
+					// Fix #12392 for oldIE
+					while ( tmp.firstChild ) {
+						tmp.removeChild( tmp.firstChild );
+					}
 
-		// Support: IE<9
-		// Fix target property (#1925)
-		if ( !event.target ) {
-			event.target = originalEvent.srcElement || document;
+					// Remember the top-level container for proper cleanup
+					tmp = safe.lastChild;
+				}
+			}
 		}
 
-		// Support: Chrome 23+, Safari?
-		// Target should not be a text node (#504, #13143)
-		if ( event.target.nodeType === 3 ) {
-			event.target = event.target.parentNode;
+		// Fix #11356: Clear elements from fragment
+		if ( tmp ) {
+			safe.removeChild( tmp );
 		}
 
-		// Support: IE<9
-		// For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
-		event.metaKey = !!event.metaKey;
+		// Reset defaultChecked for any radios and checkboxes
+		// about to be appended to the DOM in IE 6/7 (#8060)
+		if ( !support.appendChecked ) {
+			jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
+		}
 
-		return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
-	},
+		i = 0;
+		while ( (elem = nodes[ i++ ]) ) {
 
-	// Includes some event props shared by KeyEvent and MouseEvent
-	props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
+			// #4087 - If origin and destination elements are the same, and this is
+			// that element, do not do anything
+			if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
+				continue;
+			}
 
-	fixHooks: {},
+			contains = jQuery.contains( elem.ownerDocument, elem );
 
-	keyHooks: {
-		props: "char charCode key keyCode".split(" "),
-		filter: function( event, original ) {
+			// Append to fragment
+			tmp = getAll( safe.appendChild( elem ), "script" );
 
-			// Add which for key events
-			if ( event.which == null ) {
-				event.which = original.charCode != null ? original.charCode : original.keyCode;
+			// Preserve script evaluation history
+			if ( contains ) {
+				setGlobalEval( tmp );
 			}
 
-			return event;
+			// Capture executables
+			if ( scripts ) {
+				j = 0;
+				while ( (elem = tmp[ j++ ]) ) {
+					if ( rscriptType.test( elem.type || "" ) ) {
+						scripts.push( elem );
+					}
+				}
+			}
 		}
-	},
 
-	mouseHooks: {
-		props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
-		filter: function( event, original ) {
-			var body, eventDoc, doc,
-				button = original.button,
-				fromElement = original.fromElement;
+		tmp = null;
 
-			// Calculate pageX/Y if missing and clientX/Y available
-			if ( event.pageX == null && original.clientX != null ) {
-				eventDoc = event.target.ownerDocument || document;
-				doc = eventDoc.documentElement;
-				body = eventDoc.body;
+		return safe;
+	},
 
-				event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
-				event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
-			}
+	cleanData: function( elems, /* internal */ acceptData ) {
+		var elem, type, id, data,
+			i = 0,
+			internalKey = jQuery.expando,
+			cache = jQuery.cache,
+			deleteExpando = support.deleteExpando,
+			special = jQuery.event.special;
 
-			// Add relatedTarget, if necessary
-			if ( !event.relatedTarget && fromElement ) {
-				event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
-			}
+		for ( ; (elem = elems[i]) != null; i++ ) {
+			if ( acceptData || jQuery.acceptData( elem ) ) {
 
-			// Add which for click: 1 === left; 2 === middle; 3 === right
-			// Note: button is not normalized, so don't use it
-			if ( !event.which && button !== undefined ) {
-				event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
-			}
+				id = elem[ internalKey ];
+				data = id && cache[ id ];
 
-			return event;
-		}
-	},
+				if ( data ) {
+					if ( data.events ) {
+						for ( type in data.events ) {
+							if ( special[ type ] ) {
+								jQuery.event.remove( elem, type );
 
-	special: {
-		load: {
-			// Prevent triggered image.load events from bubbling to window.load
-			noBubble: true
-		},
-		focus: {
-			// Fire native event if possible so blur/focus sequence is correct
-			trigger: function() {
-				if ( this !== safeActiveElement() && this.focus ) {
-					try {
-						this.focus();
-						return false;
-					} catch ( e ) {
-						// Support: IE<9
-						// If we error on focus to hidden element (#1486, #12518),
-						// let .trigger() run the handlers
+							// This is a shortcut to avoid jQuery.event.remove's overhead
+							} else {
+								jQuery.removeEvent( elem, type, data.handle );
+							}
+						}
 					}
-				}
-			},
-			delegateType: "focusin"
-		},
-		blur: {
-			trigger: function() {
-				if ( this === safeActiveElement() && this.blur ) {
-					this.blur();
-					return false;
-				}
-			},
-			delegateType: "focusout"
-		},
-		click: {
-			// For checkbox, fire native event so checked state will be right
-			trigger: function() {
-				if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
-					this.click();
-					return false;
-				}
-			},
 
-			// For cross-browser consistency, don't fire native .click() on links
-			_default: function( event ) {
-				return jQuery.nodeName( event.target, "a" );
-			}
-		},
+					// Remove cache only if it was not already removed by jQuery.event.remove
+					if ( cache[ id ] ) {
 
-		beforeunload: {
-			postDispatch: function( event ) {
+						delete cache[ id ];
+
+						// IE does not allow us to delete expando properties from nodes,
+						// nor does it have a removeAttribute function on Document nodes;
+						// we must handle all of these cases
+						if ( deleteExpando ) {
+							delete elem[ internalKey ];
+
+						} else if ( typeof elem.removeAttribute !== strundefined ) {
+							elem.removeAttribute( internalKey );
+
+						} else {
+							elem[ internalKey ] = null;
+						}
 
-				// Even when returnValue equals to undefined Firefox will still show alert
-				if ( event.result !== undefined ) {
-					event.originalEvent.returnValue = event.result;
+						deletedIds.push( id );
+					}
 				}
 			}
 		}
-	},
-
-	simulate: function( type, elem, event, bubble ) {
-		// Piggyback on a donor event to simulate a different one.
-		// Fake originalEvent to avoid donor's stopPropagation, but if the
-		// simulated event prevents default then we do the same on the donor.
-		var e = jQuery.extend(
-			new jQuery.Event(),
-			event,
-			{
-				type: type,
-				isSimulated: true,
-				originalEvent: {}
-			}
-		);
-		if ( bubble ) {
-			jQuery.event.trigger( e, null, elem );
-		} else {
-			jQuery.event.dispatch.call( elem, e );
-		}
-		if ( e.isDefaultPrevented() ) {
-			event.preventDefault();
-		}
 	}
-};
+});
 
-jQuery.removeEvent = document.removeEventListener ?
-	function( elem, type, handle ) {
-		if ( elem.removeEventListener ) {
-			elem.removeEventListener( type, handle, false );
-		}
-	} :
-	function( elem, type, handle ) {
-		var name = "on" + type;
+jQuery.fn.extend({
+	text: function( value ) {
+		return access( this, function( value ) {
+			return value === undefined ?
+				jQuery.text( this ) :
+				this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
+		}, null, value, arguments.length );
+	},
 
-		if ( elem.detachEvent ) {
+	append: function() {
+		return this.domManip( arguments, function( elem ) {
+			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+				var target = manipulationTarget( this, elem );
+				target.appendChild( elem );
+			}
+		});
+	},
 
-			// #8545, #7054, preventing memory leaks for custom events in IE6-8
-			// detachEvent needed property on element, by name of that event, to properly expose it to GC
-			if ( typeof elem[ name ] === core_strundefined ) {
-				elem[ name ] = null;
+	prepend: function() {
+		return this.domManip( arguments, function( elem ) {
+			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+				var target = manipulationTarget( this, elem );
+				target.insertBefore( elem, target.firstChild );
 			}
+		});
+	},
 
-			elem.detachEvent( name, handle );
-		}
-	};
+	before: function() {
+		return this.domManip( arguments, function( elem ) {
+			if ( this.parentNode ) {
+				this.parentNode.insertBefore( elem, this );
+			}
+		});
+	},
 
-jQuery.Event = function( src, props ) {
-	// Allow instantiation without the 'new' keyword
-	if ( !(this instanceof jQuery.Event) ) {
-		return new jQuery.Event( src, props );
-	}
+	after: function() {
+		return this.domManip( arguments, function( elem ) {
+			if ( this.parentNode ) {
+				this.parentNode.insertBefore( elem, this.nextSibling );
+			}
+		});
+	},
 
-	// Event object
-	if ( src && src.type ) {
-		this.originalEvent = src;
-		this.type = src.type;
+	remove: function( selector, keepData /* Internal Use Only */ ) {
+		var elem,
+			elems = selector ? jQuery.filter( selector, this ) : this,
+			i = 0;
 
-		// Events bubbling up the document may have been marked as prevented
-		// by a handler lower down the tree; reflect the correct value.
-		this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
-			src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
+		for ( ; (elem = elems[i]) != null; i++ ) {
 
-	// Event type
-	} else {
-		this.type = src;
-	}
+			if ( !keepData && elem.nodeType === 1 ) {
+				jQuery.cleanData( getAll( elem ) );
+			}
 
-	// Put explicitly provided properties onto the event object
-	if ( props ) {
-		jQuery.extend( this, props );
-	}
+			if ( elem.parentNode ) {
+				if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
+					setGlobalEval( getAll( elem, "script" ) );
+				}
+				elem.parentNode.removeChild( elem );
+			}
+		}
 
-	// Create a timestamp if incoming event doesn't have one
-	this.timeStamp = src && src.timeStamp || jQuery.now();
+		return this;
+	},
 
-	// Mark it as fixed
-	this[ jQuery.expando ] = true;
-};
+	empty: function() {
+		var elem,
+			i = 0;
 
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
-	isDefaultPrevented: returnFalse,
-	isPropagationStopped: returnFalse,
-	isImmediatePropagationStopped: returnFalse,
+		for ( ; (elem = this[i]) != null; i++ ) {
+			// Remove element nodes and prevent memory leaks
+			if ( elem.nodeType === 1 ) {
+				jQuery.cleanData( getAll( elem, false ) );
+			}
 
-	preventDefault: function() {
-		var e = this.originalEvent;
+			// Remove any remaining nodes
+			while ( elem.firstChild ) {
+				elem.removeChild( elem.firstChild );
+			}
 
-		this.isDefaultPrevented = returnTrue;
-		if ( !e ) {
-			return;
+			// If this is a select, ensure that it displays empty (#12336)
+			// Support: IE<9
+			if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
+				elem.options.length = 0;
+			}
 		}
 
-		// If preventDefault exists, run it on the original event
-		if ( e.preventDefault ) {
-			e.preventDefault();
-
-		// Support: IE
-		// Otherwise set the returnValue property of the original event to false
-		} else {
-			e.returnValue = false;
-		}
+		return this;
 	},
-	stopPropagation: function() {
-		var e = this.originalEvent;
 
-		this.isPropagationStopped = returnTrue;
-		if ( !e ) {
-			return;
-		}
-		// If stopPropagation exists, run it on the original event
-		if ( e.stopPropagation ) {
-			e.stopPropagation();
-		}
+	clone: function( dataAndEvents, deepDataAndEvents ) {
+		dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+		deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
 
-		// Support: IE
-		// Set the cancelBubble property of the original event to true
-		e.cancelBubble = true;
+		return this.map(function() {
+			return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+		});
 	},
-	stopImmediatePropagation: function() {
-		this.isImmediatePropagationStopped = returnTrue;
-		this.stopPropagation();
-	}
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-jQuery.each({
-	mouseenter: "mouseover",
-	mouseleave: "mouseout"
-}, function( orig, fix ) {
-	jQuery.event.special[ orig ] = {
-		delegateType: fix,
-		bindType: fix,
 
-		handle: function( event ) {
-			var ret,
-				target = this,
-				related = event.relatedTarget,
-				handleObj = event.handleObj;
+	html: function( value ) {
+		return access( this, function( value ) {
+			var elem = this[ 0 ] || {},
+				i = 0,
+				l = this.length;
 
-			// For mousenter/leave call the handler if related is outside the target.
-			// NB: No relatedTarget if the mouse left/entered the browser window
-			if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
-				event.type = handleObj.origType;
-				ret = handleObj.handler.apply( this, arguments );
-				event.type = fix;
+			if ( value === undefined ) {
+				return elem.nodeType === 1 ?
+					elem.innerHTML.replace( rinlinejQuery, "" ) :
+					undefined;
 			}
-			return ret;
-		}
-	};
-});
-
-// IE submit delegation
-if ( !jQuery.support.submitBubbles ) {
 
-	jQuery.event.special.submit = {
-		setup: function() {
-			// Only need this for delegated form submit events
-			if ( jQuery.nodeName( this, "form" ) ) {
-				return false;
-			}
+			// See if we can take a shortcut and just use innerHTML
+			if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+				( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
+				( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
+				!wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
 
-			// Lazy-add a submit handler when a descendant form may potentially be submitted
-			jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
-				// Node name check avoids a VML-related crash in IE (#9807)
-				var elem = e.target,
-					form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
-				if ( form && !jQuery._data( form, "submitBubbles" ) ) {
-					jQuery.event.add( form, "submit._submit", function( event ) {
-						event._submit_bubble = true;
-					});
-					jQuery._data( form, "submitBubbles", true );
-				}
-			});
-			// return undefined since we don't need an event listener
-		},
+				value = value.replace( rxhtmlTag, "<$1></$2>" );
 
-		postDispatch: function( event ) {
-			// If form was submitted by the user, bubble the event up the tree
-			if ( event._submit_bubble ) {
-				delete event._submit_bubble;
-				if ( this.parentNode && !event.isTrigger ) {
-					jQuery.event.simulate( "submit", this.parentNode, event, true );
-				}
-			}
-		},
+				try {
+					for (; i < l; i++ ) {
+						// Remove element nodes and prevent memory leaks
+						elem = this[i] || {};
+						if ( elem.nodeType === 1 ) {
+							jQuery.cleanData( getAll( elem, false ) );
+							elem.innerHTML = value;
+						}
+					}
 
-		teardown: function() {
-			// Only need this for delegated form submit events
-			if ( jQuery.nodeName( this, "form" ) ) {
-				return false;
+					elem = 0;
+
+				// If using innerHTML throws an exception, use the fallback method
+				} catch(e) {}
 			}
 
-			// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
-			jQuery.event.remove( this, "._submit" );
-		}
-	};
-}
+			if ( elem ) {
+				this.empty().append( value );
+			}
+		}, null, value, arguments.length );
+	},
 
-// IE change delegation and checkbox/radio fix
-if ( !jQuery.support.changeBubbles ) {
+	replaceWith: function() {
+		var arg = arguments[ 0 ];
 
-	jQuery.event.special.change = {
+		// Make the changes, replacing each context element with the new content
+		this.domManip( arguments, function( elem ) {
+			arg = this.parentNode;
 
-		setup: function() {
+			jQuery.cleanData( getAll( this ) );
 
-			if ( rformElems.test( this.nodeName ) ) {
-				// IE doesn't fire change on a check/radio until blur; trigger it on click
-				// after a propertychange. Eat the blur-change in special.change.handle.
-				// This still fires onchange a second time for check/radio after blur.
-				if ( this.type === "checkbox" || this.type === "radio" ) {
-					jQuery.event.add( this, "propertychange._change", function( event ) {
-						if ( event.originalEvent.propertyName === "checked" ) {
-							this._just_changed = true;
-						}
-					});
-					jQuery.event.add( this, "click._change", function( event ) {
-						if ( this._just_changed && !event.isTrigger ) {
-							this._just_changed = false;
-						}
-						// Allow triggered, simulated change events (#11500)
-						jQuery.event.simulate( "change", this, event, true );
-					});
-				}
-				return false;
+			if ( arg ) {
+				arg.replaceChild( elem, this );
 			}
-			// Delegated event; lazy-add a change handler on descendant inputs
-			jQuery.event.add( this, "beforeactivate._change", function( e ) {
-				var elem = e.target;
+		});
 
-				if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
-					jQuery.event.add( elem, "change._change", function( event ) {
-						if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
-							jQuery.event.simulate( "change", this.parentNode, event, true );
-						}
-					});
-					jQuery._data( elem, "changeBubbles", true );
+		// Force removal if there was no new content (e.g., from empty arguments)
+		return arg && (arg.length || arg.nodeType) ? this : this.remove();
+	},
+
+	detach: function( selector ) {
+		return this.remove( selector, true );
+	},
+
+	domManip: function( args, callback ) {
+
+		// Flatten any nested arrays
+		args = concat.apply( [], args );
+
+		var first, node, hasScripts,
+			scripts, doc, fragment,
+			i = 0,
+			l = this.length,
+			set = this,
+			iNoClone = l - 1,
+			value = args[0],
+			isFunction = jQuery.isFunction( value );
+
+		// We can't cloneNode fragments that contain checked, in WebKit
+		if ( isFunction ||
+				( l > 1 && typeof value === "string" &&
+					!support.checkClone && rchecked.test( value ) ) ) {
+			return this.each(function( index ) {
+				var self = set.eq( index );
+				if ( isFunction ) {
+					args[0] = value.call( this, index, self.html() );
 				}
+				self.domManip( args, callback );
 			});
-		},
+		}
 
-		handle: function( event ) {
-			var elem = event.target;
+		if ( l ) {
+			fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
+			first = fragment.firstChild;
 
-			// Swallow native change events from checkbox/radio, we already triggered them above
-			if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
-				return event.handleObj.handler.apply( this, arguments );
+			if ( fragment.childNodes.length === 1 ) {
+				fragment = first;
 			}
-		},
 
-		teardown: function() {
-			jQuery.event.remove( this, "._change" );
+			if ( first ) {
+				scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
+				hasScripts = scripts.length;
 
-			return !rformElems.test( this.nodeName );
-		}
-	};
-}
+				// Use the original fragment for the last item instead of the first because it can end up
+				// being emptied incorrectly in certain situations (#8070).
+				for ( ; i < l; i++ ) {
+					node = fragment;
 
-// Create "bubbling" focus and blur events
-if ( !jQuery.support.focusinBubbles ) {
-	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+					if ( i !== iNoClone ) {
+						node = jQuery.clone( node, true, true );
 
-		// Attach a single capturing handler while someone wants focusin/focusout
-		var attaches = 0,
-			handler = function( event ) {
-				jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
-			};
+						// Keep references to cloned scripts for later restoration
+						if ( hasScripts ) {
+							jQuery.merge( scripts, getAll( node, "script" ) );
+						}
+					}
 
-		jQuery.event.special[ fix ] = {
-			setup: function() {
-				if ( attaches++ === 0 ) {
-					document.addEventListener( orig, handler, true );
-				}
-			},
-			teardown: function() {
-				if ( --attaches === 0 ) {
-					document.removeEventListener( orig, handler, true );
+					callback.call( this[i], node, i );
 				}
-			}
-		};
-	});
-}
 
-jQuery.fn.extend({
+				if ( hasScripts ) {
+					doc = scripts[ scripts.length - 1 ].ownerDocument;
 
-	on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
-		var type, origFn;
+					// Reenable scripts
+					jQuery.map( scripts, restoreScript );
 
-		// Types can be a map of types/handlers
-		if ( typeof types === "object" ) {
-			// ( types-Object, selector, data )
-			if ( typeof selector !== "string" ) {
-				// ( types-Object, data )
-				data = data || selector;
-				selector = undefined;
-			}
-			for ( type in types ) {
-				this.on( type, selector, data, types[ type ], one );
-			}
-			return this;
-		}
+					// Evaluate executable scripts on first document insertion
+					for ( i = 0; i < hasScripts; i++ ) {
+						node = scripts[ i ];
+						if ( rscriptType.test( node.type || "" ) &&
+							!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
 
-		if ( data == null && fn == null ) {
-			// ( types, fn )
-			fn = selector;
-			data = selector = undefined;
-		} else if ( fn == null ) {
-			if ( typeof selector === "string" ) {
-				// ( types, selector, fn )
-				fn = data;
-				data = undefined;
-			} else {
-				// ( types, data, fn )
-				fn = data;
-				data = selector;
-				selector = undefined;
-			}
-		}
-		if ( fn === false ) {
-			fn = returnFalse;
-		} else if ( !fn ) {
-			return this;
-		}
+							if ( node.src ) {
+								// Optional AJAX dependency, but won't run scripts if not present
+								if ( jQuery._evalUrl ) {
+									jQuery._evalUrl( node.src );
+								}
+							} else {
+								jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
+							}
+						}
+					}
+				}
 
-		if ( one === 1 ) {
-			origFn = fn;
-			fn = function( event ) {
-				// Can use an empty set, since event contains the info
-				jQuery().off( event );
-				return origFn.apply( this, arguments );
-			};
-			// Use same guid so caller can remove using origFn
-			fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
-		}
-		return this.each( function() {
-			jQuery.event.add( this, types, fn, data, selector );
-		});
-	},
-	one: function( types, selector, data, fn ) {
-		return this.on( types, selector, data, fn, 1 );
-	},
-	off: function( types, selector, fn ) {
-		var handleObj, type;
-		if ( types && types.preventDefault && types.handleObj ) {
-			// ( event )  dispatched jQuery.Event
-			handleObj = types.handleObj;
-			jQuery( types.delegateTarget ).off(
-				handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
-				handleObj.selector,
-				handleObj.handler
-			);
-			return this;
-		}
-		if ( typeof types === "object" ) {
-			// ( types-object [, selector] )
-			for ( type in types ) {
-				this.off( type, selector, types[ type ] );
+				// Fix #11809: Avoid leaking memory
+				fragment = first = null;
 			}
-			return this;
-		}
-		if ( selector === false || typeof selector === "function" ) {
-			// ( types [, fn] )
-			fn = selector;
-			selector = undefined;
-		}
-		if ( fn === false ) {
-			fn = returnFalse;
 		}
-		return this.each(function() {
-			jQuery.event.remove( this, types, fn, selector );
-		});
-	},
 
-	trigger: function( type, data ) {
-		return this.each(function() {
-			jQuery.event.trigger( type, data, this );
-		});
-	},
-	triggerHandler: function( type, data ) {
-		var elem = this[0];
-		if ( elem ) {
-			return jQuery.event.trigger( type, data, elem, true );
-		}
+		return this;
 	}
 });
-var isSimple = /^.[^:#\[\.,]*$/,
-	rparentsprev = /^(?:parents|prev(?:Until|All))/,
-	rneedsContext = jQuery.expr.match.needsContext,
-	// methods guaranteed to produce a unique set when starting from a unique set
-	guaranteedUnique = {
-		children: true,
-		contents: true,
-		next: true,
-		prev: true
-	};
 
-jQuery.fn.extend({
-	find: function( selector ) {
-		var i,
+jQuery.each({
+	appendTo: "append",
+	prependTo: "prepend",
+	insertBefore: "before",
+	insertAfter: "after",
+	replaceAll: "replaceWith"
+}, function( name, original ) {
+	jQuery.fn[ name ] = function( selector ) {
+		var elems,
+			i = 0,
 			ret = [],
-			self = this,
-			len = self.length;
+			insert = jQuery( selector ),
+			last = insert.length - 1;
 
-		if ( typeof selector !== "string" ) {
-			return this.pushStack( jQuery( selector ).filter(function() {
-				for ( i = 0; i < len; i++ ) {
-					if ( jQuery.contains( self[ i ], this ) ) {
-						return true;
-					}
-				}
-			}) );
-		}
+		for ( ; i <= last; i++ ) {
+			elems = i === last ? this : this.clone(true);
+			jQuery( insert[i] )[ original ]( elems );
 
-		for ( i = 0; i < len; i++ ) {
-			jQuery.find( selector, self[ i ], ret );
+			// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
+			push.apply( ret, elems.get() );
 		}
 
-		// Needed because $( selector, context ) becomes $( context ).find( selector )
-		ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
-		ret.selector = this.selector ? this.selector + " " + selector : selector;
-		return ret;
-	},
+		return this.pushStack( ret );
+	};
+});
 
-	has: function( target ) {
-		var i,
-			targets = jQuery( target, this ),
-			len = targets.length;
 
-		return this.filter(function() {
-			for ( i = 0; i < len; i++ ) {
-				if ( jQuery.contains( this, targets[i] ) ) {
-					return true;
-				}
-			}
-		});
-	},
+var iframe,
+	elemdisplay = {};
 
-	not: function( selector ) {
-		return this.pushStack( winnow(this, selector || [], true) );
-	},
+/**
+ * Retrieve the actual display of a element
+ * @param {String} name nodeName of the element
+ * @param {Object} doc Document object
+ */
+// Called only from within defaultDisplay
+function actualDisplay( name, doc ) {
+	var style,
+		elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
 
-	filter: function( selector ) {
-		return this.pushStack( winnow(this, selector || [], false) );
-	},
+		// getDefaultComputedStyle might be reliably used only on attached element
+		display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
 
-	is: function( selector ) {
-		return !!winnow(
-			this,
+			// Use of this method is a temporary fix (more like optmization) until something better comes along,
+			// since it was removed from specification and supported only in FF
+			style.display : jQuery.css( elem[ 0 ], "display" );
 
-			// If this is a positional/relative selector, check membership in the returned set
-			// so $("p:first").is("p:last") won't return true for a doc with two "p".
-			typeof selector === "string" && rneedsContext.test( selector ) ?
-				jQuery( selector ) :
-				selector || [],
-			false
-		).length;
-	},
+	// We don't have any data stored on the element,
+	// so use "detach" method as fast way to get rid of the element
+	elem.detach();
 
-	closest: function( selectors, context ) {
-		var cur,
-			i = 0,
-			l = this.length,
-			ret = [],
-			pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
-				jQuery( selectors, context || this.context ) :
-				0;
+	return display;
+}
 
-		for ( ; i < l; i++ ) {
-			for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
-				// Always skip document fragments
-				if ( cur.nodeType < 11 && (pos ?
-					pos.index(cur) > -1 :
+/**
+ * Try to determine the default display value of an element
+ * @param {String} nodeName
+ */
+function defaultDisplay( nodeName ) {
+	var doc = document,
+		display = elemdisplay[ nodeName ];
 
-					// Don't pass non-elements to Sizzle
-					cur.nodeType === 1 &&
-						jQuery.find.matchesSelector(cur, selectors)) ) {
+	if ( !display ) {
+		display = actualDisplay( nodeName, doc );
 
-					cur = ret.push( cur );
-					break;
-				}
-			}
+		// If the simple way fails, read from inside an iframe
+		if ( display === "none" || !display ) {
+
+			// Use the already-created iframe if possible
+			iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
+
+			// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
+			doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
+
+			// Support: IE
+			doc.write();
+			doc.close();
+
+			display = actualDisplay( nodeName, doc );
+			iframe.detach();
 		}
 
-		return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
-	},
+		// Store the correct default display
+		elemdisplay[ nodeName ] = display;
+	}
 
-	// Determine the position of an element within
-	// the matched set of elements
-	index: function( elem ) {
+	return display;
+}
 
-		// No argument, return index in parent
-		if ( !elem ) {
-			return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
+
+(function() {
+	var shrinkWrapBlocksVal;
+
+	support.shrinkWrapBlocks = function() {
+		if ( shrinkWrapBlocksVal != null ) {
+			return shrinkWrapBlocksVal;
 		}
 
-		// index in selector
-		if ( typeof elem === "string" ) {
-			return jQuery.inArray( this[0], jQuery( elem ) );
+		// Will be changed later if needed.
+		shrinkWrapBlocksVal = false;
+
+		// Minified: var b,c,d
+		var div, body, container;
+
+		body = document.getElementsByTagName( "body" )[ 0 ];
+		if ( !body || !body.style ) {
+			// Test fired too early or in an unsupported environment, exit.
+			return;
 		}
 
-		// Locate the position of the desired element
-		return jQuery.inArray(
-			// If it receives a jQuery object, the first element is used
-			elem.jquery ? elem[0] : elem, this );
-	},
+		// Setup
+		div = document.createElement( "div" );
+		container = document.createElement( "div" );
+		container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
+		body.appendChild( container ).appendChild( div );
 
-	add: function( selector, context ) {
-		var set = typeof selector === "string" ?
-				jQuery( selector, context ) :
-				jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
-			all = jQuery.merge( this.get(), set );
+		// Support: IE6
+		// Check if elements with layout shrink-wrap their children
+		if ( typeof div.style.zoom !== strundefined ) {
+			// Reset CSS: box-sizing; display; margin; border
+			div.style.cssText =
+				// Support: Firefox<29, Android 2.3
+				// Vendor-prefix box-sizing
+				"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
+				"box-sizing:content-box;display:block;margin:0;border:0;" +
+				"padding:1px;width:1px;zoom:1";
+			div.appendChild( document.createElement( "div" ) ).style.width = "5px";
+			shrinkWrapBlocksVal = div.offsetWidth !== 3;
+		}
 
-		return this.pushStack( jQuery.unique(all) );
-	},
+		body.removeChild( container );
 
-	addBack: function( selector ) {
-		return this.add( selector == null ?
-			this.prevObject : this.prevObject.filter(selector)
-		);
-	}
-});
+		return shrinkWrapBlocksVal;
+	};
 
-function sibling( cur, dir ) {
-	do {
-		cur = cur[ dir ];
-	} while ( cur && cur.nodeType !== 1 );
+})();
+var rmargin = (/^margin/);
 
-	return cur;
-}
+var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
 
-jQuery.each({
-	parent: function( elem ) {
-		var parent = elem.parentNode;
-		return parent && parent.nodeType !== 11 ? parent : null;
-	},
-	parents: function( elem ) {
-		return jQuery.dir( elem, "parentNode" );
-	},
-	parentsUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "parentNode", until );
-	},
-	next: function( elem ) {
-		return sibling( elem, "nextSibling" );
-	},
-	prev: function( elem ) {
-		return sibling( elem, "previousSibling" );
-	},
-	nextAll: function( elem ) {
-		return jQuery.dir( elem, "nextSibling" );
-	},
-	prevAll: function( elem ) {
-		return jQuery.dir( elem, "previousSibling" );
-	},
-	nextUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "nextSibling", until );
-	},
-	prevUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "previousSibling", until );
-	},
-	siblings: function( elem ) {
-		return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
-	},
-	children: function( elem ) {
-		return jQuery.sibling( elem.firstChild );
-	},
-	contents: function( elem ) {
-		return jQuery.nodeName( elem, "iframe" ) ?
-			elem.contentDocument || elem.contentWindow.document :
-			jQuery.merge( [], elem.childNodes );
-	}
-}, function( name, fn ) {
-	jQuery.fn[ name ] = function( until, selector ) {
-		var ret = jQuery.map( this, fn, until );
 
-		if ( name.slice( -5 ) !== "Until" ) {
-			selector = until;
+
+var getStyles, curCSS,
+	rposition = /^(top|right|bottom|left)$/;
+
+if ( window.getComputedStyle ) {
+	getStyles = function( elem ) {
+		return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+	};
+
+	curCSS = function( elem, name, computed ) {
+		var width, minWidth, maxWidth, ret,
+			style = elem.style;
+
+		computed = computed || getStyles( elem );
+
+		// getPropertyValue is only needed for .css('filter') in IE9, see #12537
+		ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
+
+		if ( computed ) {
+
+			if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+				ret = jQuery.style( elem, name );
+			}
+
+			// A tribute to the "awesome hack by Dean Edwards"
+			// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
+			// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
+			// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
+			if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+
+				// Remember the original values
+				width = style.width;
+				minWidth = style.minWidth;
+				maxWidth = style.maxWidth;
+
+				// Put in the new values to get a computed value out
+				style.minWidth = style.maxWidth = style.width = ret;
+				ret = computed.width;
+
+				// Revert the changed values
+				style.width = width;
+				style.minWidth = minWidth;
+				style.maxWidth = maxWidth;
+			}
 		}
 
-		if ( selector && typeof selector === "string" ) {
-			ret = jQuery.filter( selector, ret );
+		// Support: IE
+		// IE returns zIndex value as an integer.
+		return ret === undefined ?
+			ret :
+			ret + "";
+	};
+} else if ( document.documentElement.currentStyle ) {
+	getStyles = function( elem ) {
+		return elem.currentStyle;
+	};
+
+	curCSS = function( elem, name, computed ) {
+		var left, rs, rsLeft, ret,
+			style = elem.style;
+
+		computed = computed || getStyles( elem );
+		ret = computed ? computed[ name ] : undefined;
+
+		// Avoid setting ret to empty string here
+		// so we don't default to auto
+		if ( ret == null && style && style[ name ] ) {
+			ret = style[ name ];
 		}
 
-		if ( this.length > 1 ) {
-			// Remove duplicates
-			if ( !guaranteedUnique[ name ] ) {
-				ret = jQuery.unique( ret );
+		// From the awesome hack by Dean Edwards
+		// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+		// If we're not dealing with a regular pixel number
+		// but a number that has a weird ending, we need to convert it to pixels
+		// but not position css attributes, as those are proportional to the parent element instead
+		// and we can't measure the parent instead because it might trigger a "stacking dolls" problem
+		if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
+
+			// Remember the original values
+			left = style.left;
+			rs = elem.runtimeStyle;
+			rsLeft = rs && rs.left;
+
+			// Put in the new values to get a computed value out
+			if ( rsLeft ) {
+				rs.left = elem.currentStyle.left;
 			}
+			style.left = name === "fontSize" ? "1em" : ret;
+			ret = style.pixelLeft + "px";
 
-			// Reverse order for parents* and prev-derivatives
-			if ( rparentsprev.test( name ) ) {
-				ret = ret.reverse();
+			// Revert the changed values
+			style.left = left;
+			if ( rsLeft ) {
+				rs.left = rsLeft;
 			}
 		}
 
-		return this.pushStack( ret );
+		// Support: IE
+		// IE returns zIndex value as an integer.
+		return ret === undefined ?
+			ret :
+			ret + "" || "auto";
 	};
-});
+}
 
-jQuery.extend({
-	filter: function( expr, elems, not ) {
-		var elem = elems[ 0 ];
 
-		if ( not ) {
-			expr = ":not(" + expr + ")";
-		}
 
-		return elems.length === 1 && elem.nodeType === 1 ?
-			jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
-			jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
-				return elem.nodeType === 1;
-			}));
-	},
 
-	dir: function( elem, dir, until ) {
-		var matched = [],
-			cur = elem[ dir ];
+function addGetHookIf( conditionFn, hookFn ) {
+	// Define the hook, we'll check on the first run if it's really needed.
+	return {
+		get: function() {
+			var condition = conditionFn();
 
-		while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
-			if ( cur.nodeType === 1 ) {
-				matched.push( cur );
+			if ( condition == null ) {
+				// The test was not ready at this point; screw the hook this time
+				// but check again when needed next time.
+				return;
 			}
-			cur = cur[dir];
-		}
-		return matched;
-	},
-
-	sibling: function( n, elem ) {
-		var r = [];
 
-		for ( ; n; n = n.nextSibling ) {
-			if ( n.nodeType === 1 && n !== elem ) {
-				r.push( n );
+			if ( condition ) {
+				// Hook not needed (or it's not possible to use it due to missing dependency),
+				// remove it.
+				// Since there are no other hooks for marginRight, remove the whole object.
+				delete this.get;
+				return;
 			}
-		}
-
-		return r;
-	}
-});
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, not ) {
-	if ( jQuery.isFunction( qualifier ) ) {
-		return jQuery.grep( elements, function( elem, i ) {
-			/* jshint -W018 */
-			return !!qualifier.call( elem, i, elem ) !== not;
-		});
-
-	}
-
-	if ( qualifier.nodeType ) {
-		return jQuery.grep( elements, function( elem ) {
-			return ( elem === qualifier ) !== not;
-		});
 
-	}
+			// Hook needed; redefine it so that the support test is not executed again.
 
-	if ( typeof qualifier === "string" ) {
-		if ( isSimple.test( qualifier ) ) {
-			return jQuery.filter( qualifier, elements, not );
+			return (this.get = hookFn).apply( this, arguments );
 		}
-
-		qualifier = jQuery.filter( qualifier, elements );
-	}
-
-	return jQuery.grep( elements, function( elem ) {
-		return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
-	});
+	};
 }
-function createSafeFragment( document ) {
-	var list = nodeNames.split( "|" ),
-		safeFrag = document.createDocumentFragment();
 
-	if ( safeFrag.createElement ) {
-		while ( list.length ) {
-			safeFrag.createElement(
-				list.pop()
-			);
-		}
-	}
-	return safeFrag;
-}
 
-var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
-		"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
-	rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
-	rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
-	rleadingWhitespace = /^\s+/,
-	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
-	rtagName = /<([\w:]+)/,
-	rtbody = /<tbody/i,
-	rhtml = /<|&#?\w+;/,
-	rnoInnerhtml = /<(?:script|style|link)/i,
-	manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
-	// checked="checked" or checked
-	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
-	rscriptType = /^$|\/(?:java|ecma)script/i,
-	rscriptTypeMasked = /^true\/(.*)/,
-	rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
+(function() {
+	// Minified: var b,c,d,e,f,g, h,i
+	var div, style, a, pixelPositionVal, boxSizingReliableVal,
+		reliableHiddenOffsetsVal, reliableMarginRightVal;
 
-	// We have to close these tags to support XHTML (#13200)
-	wrapMap = {
-		option: [ 1, "<select multiple='multiple'>", "</select>" ],
-		legend: [ 1, "<fieldset>", "</fieldset>" ],
-		area: [ 1, "<map>", "</map>" ],
-		param: [ 1, "<object>", "</object>" ],
-		thead: [ 1, "<table>", "</table>" ],
-		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
-		col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
-		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+	// Setup
+	div = document.createElement( "div" );
+	div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+	a = div.getElementsByTagName( "a" )[ 0 ];
+	style = a && a.style;
 
-		// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
-		// unless wrapped in a div with non-breaking characters in front of it.
-		_default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>"  ]
-	},
-	safeFragment = createSafeFragment( document ),
-	fragmentDiv = safeFragment.appendChild( document.createElement("div") );
+	// Finish early in limited (non-browser) environments
+	if ( !style ) {
+		return;
+	}
 
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
+	style.cssText = "float:left;opacity:.5";
 
-jQuery.fn.extend({
-	text: function( value ) {
-		return jQuery.access( this, function( value ) {
-			return value === undefined ?
-				jQuery.text( this ) :
-				this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
-		}, null, value, arguments.length );
-	},
+	// Support: IE<9
+	// Make sure that element opacity exists (as opposed to filter)
+	support.opacity = style.opacity === "0.5";
 
-	append: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
-				var target = manipulationTarget( this, elem );
-				target.appendChild( elem );
-			}
-		});
-	},
+	// Verify style float existence
+	// (IE uses styleFloat instead of cssFloat)
+	support.cssFloat = !!style.cssFloat;
 
-	prepend: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
-				var target = manipulationTarget( this, elem );
-				target.insertBefore( elem, target.firstChild );
-			}
-		});
-	},
+	div.style.backgroundClip = "content-box";
+	div.cloneNode( true ).style.backgroundClip = "";
+	support.clearCloneStyle = div.style.backgroundClip === "content-box";
 
-	before: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.parentNode ) {
-				this.parentNode.insertBefore( elem, this );
-			}
-		});
-	},
+	// Support: Firefox<29, Android 2.3
+	// Vendor-prefix box-sizing
+	support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||
+		style.WebkitBoxSizing === "";
 
-	after: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.parentNode ) {
-				this.parentNode.insertBefore( elem, this.nextSibling );
+	jQuery.extend(support, {
+		reliableHiddenOffsets: function() {
+			if ( reliableHiddenOffsetsVal == null ) {
+				computeStyleTests();
 			}
-		});
-	},
-
-	// keepData is for internal use only--do not document
-	remove: function( selector, keepData ) {
-		var elem,
-			elems = selector ? jQuery.filter( selector, this ) : this,
-			i = 0;
-
-		for ( ; (elem = elems[i]) != null; i++ ) {
+			return reliableHiddenOffsetsVal;
+		},
 
-			if ( !keepData && elem.nodeType === 1 ) {
-				jQuery.cleanData( getAll( elem ) );
+		boxSizingReliable: function() {
+			if ( boxSizingReliableVal == null ) {
+				computeStyleTests();
 			}
+			return boxSizingReliableVal;
+		},
 
-			if ( elem.parentNode ) {
-				if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
-					setGlobalEval( getAll( elem, "script" ) );
-				}
-				elem.parentNode.removeChild( elem );
+		pixelPosition: function() {
+			if ( pixelPositionVal == null ) {
+				computeStyleTests();
 			}
-		}
-
-		return this;
-	},
-
-	empty: function() {
-		var elem,
-			i = 0;
+			return pixelPositionVal;
+		},
 
-		for ( ; (elem = this[i]) != null; i++ ) {
-			// Remove element nodes and prevent memory leaks
-			if ( elem.nodeType === 1 ) {
-				jQuery.cleanData( getAll( elem, false ) );
+		// Support: Android 2.3
+		reliableMarginRight: function() {
+			if ( reliableMarginRightVal == null ) {
+				computeStyleTests();
 			}
+			return reliableMarginRightVal;
+		}
+	});
 
-			// Remove any remaining nodes
-			while ( elem.firstChild ) {
-				elem.removeChild( elem.firstChild );
-			}
+	function computeStyleTests() {
+		// Minified: var b,c,d,j
+		var div, body, container, contents;
 
-			// If this is a select, ensure that it displays empty (#12336)
-			// Support: IE<9
-			if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
-				elem.options.length = 0;
-			}
+		body = document.getElementsByTagName( "body" )[ 0 ];
+		if ( !body || !body.style ) {
+			// Test fired too early or in an unsupported environment, exit.
+			return;
 		}
 
-		return this;
-	},
-
-	clone: function( dataAndEvents, deepDataAndEvents ) {
-		dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
-		deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+		// Setup
+		div = document.createElement( "div" );
+		container = document.createElement( "div" );
+		container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
+		body.appendChild( container ).appendChild( div );
 
-		return this.map( function () {
-			return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
-		});
-	},
+		div.style.cssText =
+			// Support: Firefox<29, Android 2.3
+			// Vendor-prefix box-sizing
+			"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
+			"box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
+			"border:1px;padding:1px;width:4px;position:absolute";
 
-	html: function( value ) {
-		return jQuery.access( this, function( value ) {
-			var elem = this[0] || {},
-				i = 0,
-				l = this.length;
+		// Support: IE<9
+		// Assume reasonable values in the absence of getComputedStyle
+		pixelPositionVal = boxSizingReliableVal = false;
+		reliableMarginRightVal = true;
 
-			if ( value === undefined ) {
-				return elem.nodeType === 1 ?
-					elem.innerHTML.replace( rinlinejQuery, "" ) :
-					undefined;
-			}
+		// Check for getComputedStyle so that this code is not run in IE<9.
+		if ( window.getComputedStyle ) {
+			pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+			boxSizingReliableVal =
+				( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
 
-			// See if we can take a shortcut and just use innerHTML
-			if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
-				( jQuery.support.htmlSerialize || !rnoshimcache.test( value )  ) &&
-				( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
-				!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
+			// Support: Android 2.3
+			// Div with explicit width and no margin-right incorrectly
+			// gets computed margin-right based on width of container (#3333)
+			// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+			contents = div.appendChild( document.createElement( "div" ) );
+
+			// Reset CSS: box-sizing; display; margin; border; padding
+			contents.style.cssText = div.style.cssText =
+				// Support: Firefox<29, Android 2.3
+				// Vendor-prefix box-sizing
+				"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
+				"box-sizing:content-box;display:block;margin:0;border:0;padding:0";
+			contents.style.marginRight = contents.style.width = "0";
+			div.style.width = "1px";
 
-				value = value.replace( rxhtmlTag, "<$1></$2>" );
+			reliableMarginRightVal =
+				!parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
+		}
 
-				try {
-					for (; i < l; i++ ) {
-						// Remove element nodes and prevent memory leaks
-						elem = this[i] || {};
-						if ( elem.nodeType === 1 ) {
-							jQuery.cleanData( getAll( elem, false ) );
-							elem.innerHTML = value;
-						}
-					}
+		// Support: IE8
+		// Check if table cells still have offsetWidth/Height when they are set
+		// to display:none and there are still other visible table cells in a
+		// table row; if so, offsetWidth/Height are not reliable for use when
+		// determining if an element has been hidden directly using
+		// display:none (it is still safe to use offsets if a parent element is
+		// hidden; don safety goggles and see bug #4512 for more information).
+		div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
+		contents = div.getElementsByTagName( "td" );
+		contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
+		reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
+		if ( reliableHiddenOffsetsVal ) {
+			contents[ 0 ].style.display = "";
+			contents[ 1 ].style.display = "none";
+			reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
+		}
 
-					elem = 0;
+		body.removeChild( container );
+	}
 
-				// If using innerHTML throws an exception, use the fallback method
-				} catch(e) {}
-			}
+})();
 
-			if ( elem ) {
-				this.empty().append( value );
-			}
-		}, null, value, arguments.length );
-	},
 
-	replaceWith: function() {
-		var
-			// Snapshot the DOM in case .domManip sweeps something relevant into its fragment
-			args = jQuery.map( this, function( elem ) {
-				return [ elem.nextSibling, elem.parentNode ];
-			}),
-			i = 0;
+// A method for quickly swapping in/out CSS properties to get correct calculations.
+jQuery.swap = function( elem, options, callback, args ) {
+	var ret, name,
+		old = {};
 
-		// Make the changes, replacing each context element with the new content
-		this.domManip( arguments, function( elem ) {
-			var next = args[ i++ ],
-				parent = args[ i++ ];
+	// Remember the old values, and insert the new ones
+	for ( name in options ) {
+		old[ name ] = elem.style[ name ];
+		elem.style[ name ] = options[ name ];
+	}
 
-			if ( parent ) {
-				// Don't use the snapshot next if it has moved (#13810)
-				if ( next && next.parentNode !== parent ) {
-					next = this.nextSibling;
-				}
-				jQuery( this ).remove();
-				parent.insertBefore( elem, next );
-			}
-		// Allow new content to include elements from the context set
-		}, true );
+	ret = callback.apply( elem, args || [] );
 
-		// Force removal if there was no new content (e.g., from empty arguments)
-		return i ? this : this.remove();
-	},
+	// Revert the old values
+	for ( name in options ) {
+		elem.style[ name ] = old[ name ];
+	}
 
-	detach: function( selector ) {
-		return this.remove( selector, true );
-	},
+	return ret;
+};
 
-	domManip: function( args, callback, allowIntersection ) {
 
-		// Flatten any nested arrays
-		args = core_concat.apply( [], args );
+var
+		ralpha = /alpha\([^)]*\)/i,
+	ropacity = /opacity\s*=\s*([^)]*)/,
 
-		var first, node, hasScripts,
-			scripts, doc, fragment,
-			i = 0,
-			l = this.length,
-			set = this,
-			iNoClone = l - 1,
-			value = args[0],
-			isFunction = jQuery.isFunction( value );
+	// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
+	// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+	rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+	rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
+	rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
 
-		// We can't cloneNode fragments that contain checked, in WebKit
-		if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
-			return this.each(function( index ) {
-				var self = set.eq( index );
-				if ( isFunction ) {
-					args[0] = value.call( this, index, self.html() );
-				}
-				self.domManip( args, callback, allowIntersection );
-			});
-		}
+	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+	cssNormalTransform = {
+		letterSpacing: "0",
+		fontWeight: "400"
+	},
 
-		if ( l ) {
-			fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );
-			first = fragment.firstChild;
+	cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
 
-			if ( fragment.childNodes.length === 1 ) {
-				fragment = first;
-			}
 
-			if ( first ) {
-				scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
-				hasScripts = scripts.length;
+// return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( style, name ) {
 
-				// Use the original fragment for the last item instead of the first because it can end up
-				// being emptied incorrectly in certain situations (#8070).
-				for ( ; i < l; i++ ) {
-					node = fragment;
+	// shortcut for names that are not vendor prefixed
+	if ( name in style ) {
+		return name;
+	}
 
-					if ( i !== iNoClone ) {
-						node = jQuery.clone( node, true, true );
+	// check for vendor prefixed names
+	var capName = name.charAt(0).toUpperCase() + name.slice(1),
+		origName = name,
+		i = cssPrefixes.length;
 
-						// Keep references to cloned scripts for later restoration
-						if ( hasScripts ) {
-							jQuery.merge( scripts, getAll( node, "script" ) );
-						}
-					}
+	while ( i-- ) {
+		name = cssPrefixes[ i ] + capName;
+		if ( name in style ) {
+			return name;
+		}
+	}
 
-					callback.call( this[i], node, i );
-				}
+	return origName;
+}
 
-				if ( hasScripts ) {
-					doc = scripts[ scripts.length - 1 ].ownerDocument;
+function showHide( elements, show ) {
+	var display, elem, hidden,
+		values = [],
+		index = 0,
+		length = elements.length;
 
-					// Reenable scripts
-					jQuery.map( scripts, restoreScript );
+	for ( ; index < length; index++ ) {
+		elem = elements[ index ];
+		if ( !elem.style ) {
+			continue;
+		}
 
-					// Evaluate executable scripts on first document insertion
-					for ( i = 0; i < hasScripts; i++ ) {
-						node = scripts[ i ];
-						if ( rscriptType.test( node.type || "" ) &&
-							!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
+		values[ index ] = jQuery._data( elem, "olddisplay" );
+		display = elem.style.display;
+		if ( show ) {
+			// Reset the inline display of this element to learn if it is
+			// being hidden by cascaded rules or not
+			if ( !values[ index ] && display === "none" ) {
+				elem.style.display = "";
+			}
 
-							if ( node.src ) {
-								// Hope ajax is available...
-								jQuery._evalUrl( node.src );
-							} else {
-								jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
-							}
-						}
-					}
-				}
+			// Set elements which have been overridden with display: none
+			// in a stylesheet to whatever the default browser style is
+			// for such an element
+			if ( elem.style.display === "" && isHidden( elem ) ) {
+				values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
+			}
+		} else {
+			hidden = isHidden( elem );
 
-				// Fix #11809: Avoid leaking memory
-				fragment = first = null;
+			if ( display && display !== "none" || !hidden ) {
+				jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
 			}
 		}
-
-		return this;
 	}
-});
 
-// Support: IE<8
-// Manipulating tables requires a tbody
-function manipulationTarget( elem, content ) {
-	return jQuery.nodeName( elem, "table" ) &&
-		jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ?
+	// Set the display of most of the elements in a second loop
+	// to avoid the constant reflow
+	for ( index = 0; index < length; index++ ) {
+		elem = elements[ index ];
+		if ( !elem.style ) {
+			continue;
+		}
+		if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
+			elem.style.display = show ? values[ index ] || "" : "none";
+		}
+	}
 
-		elem.getElementsByTagName("tbody")[0] ||
-			elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
-		elem;
+	return elements;
 }
 
-// Replace/restore the type attribute of script elements for safe DOM manipulation
-function disableScript( elem ) {
-	elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
-	return elem;
-}
-function restoreScript( elem ) {
-	var match = rscriptTypeMasked.exec( elem.type );
-	if ( match ) {
-		elem.type = match[1];
-	} else {
-		elem.removeAttribute("type");
-	}
-	return elem;
+function setPositiveNumber( elem, value, subtract ) {
+	var matches = rnumsplit.exec( value );
+	return matches ?
+		// Guard against undefined "subtract", e.g., when used as in cssHooks
+		Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+		value;
 }
 
-// Mark scripts as having already been evaluated
-function setGlobalEval( elems, refElements ) {
-	var elem,
-		i = 0;
-	for ( ; (elem = elems[i]) != null; i++ ) {
-		jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
-	}
-}
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
+	var i = extra === ( isBorderBox ? "border" : "content" ) ?
+		// If we already have the right measurement, avoid augmentation
+		4 :
+		// Otherwise initialize for horizontal or vertical properties
+		name === "width" ? 1 : 0,
 
-function cloneCopyEvent( src, dest ) {
+		val = 0;
 
-	if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
-		return;
-	}
+	for ( ; i < 4; i += 2 ) {
+		// both box models exclude margin, so add it if we want it
+		if ( extra === "margin" ) {
+			val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
+		}
 
-	var type, i, l,
-		oldData = jQuery._data( src ),
-		curData = jQuery._data( dest, oldData ),
-		events = oldData.events;
+		if ( isBorderBox ) {
+			// border-box includes padding, so remove it if we want content
+			if ( extra === "content" ) {
+				val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+			}
 
-	if ( events ) {
-		delete curData.handle;
-		curData.events = {};
+			// at this point, extra isn't border nor margin, so remove border
+			if ( extra !== "margin" ) {
+				val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+			}
+		} else {
+			// at this point, extra isn't content, so add padding
+			val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
 
-		for ( type in events ) {
-			for ( i = 0, l = events[ type ].length; i < l; i++ ) {
-				jQuery.event.add( dest, type, events[ type ][ i ] );
+			// at this point, extra isn't content nor padding, so add border
+			if ( extra !== "padding" ) {
+				val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
 			}
 		}
 	}
 
-	// make the cloned public data object a copy from the original
-	if ( curData.data ) {
-		curData.data = jQuery.extend( {}, curData.data );
+	return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+	// Start with offset property, which is equivalent to the border-box value
+	var valueIsBorderBox = true,
+		val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+		styles = getStyles( elem ),
+		isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+
+	// some non-html elements return undefined for offsetWidth, so check for null/undefined
+	// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
+	// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
+	if ( val <= 0 || val == null ) {
+		// Fall back to computed then uncomputed css if necessary
+		val = curCSS( elem, name, styles );
+		if ( val < 0 || val == null ) {
+			val = elem.style[ name ];
+		}
+
+		// Computed unit is not pixels. Stop here and return.
+		if ( rnumnonpx.test(val) ) {
+			return val;
+		}
+
+		// we need the check for style in case a browser which returns unreliable values
+		// for getComputedStyle silently falls back to the reliable elem.style
+		valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
+
+		// Normalize "", auto, and prepare for extra
+		val = parseFloat( val ) || 0;
 	}
+
+	// use the active box-sizing model to add/subtract irrelevant styles
+	return ( val +
+		augmentWidthOrHeight(
+			elem,
+			name,
+			extra || ( isBorderBox ? "border" : "content" ),
+			valueIsBorderBox,
+			styles
+		)
+	) + "px";
 }
 
-function fixCloneNodeIssues( src, dest ) {
-	var nodeName, e, data;
-
-	// We do not need to do anything for non-Elements
-	if ( dest.nodeType !== 1 ) {
-		return;
-	}
+jQuery.extend({
+	// Add in style property hooks for overriding the default
+	// behavior of getting and setting a style property
+	cssHooks: {
+		opacity: {
+			get: function( elem, computed ) {
+				if ( computed ) {
+					// We should always get a number back from opacity
+					var ret = curCSS( elem, "opacity" );
+					return ret === "" ? "1" : ret;
+				}
+			}
+		}
+	},
 
-	nodeName = dest.nodeName.toLowerCase();
+	// Don't automatically add "px" to these possibly-unitless properties
+	cssNumber: {
+		"columnCount": true,
+		"fillOpacity": true,
+		"flexGrow": true,
+		"flexShrink": true,
+		"fontWeight": true,
+		"lineHeight": true,
+		"opacity": true,
+		"order": true,
+		"orphans": true,
+		"widows": true,
+		"zIndex": true,
+		"zoom": true
+	},
 
-	// IE6-8 copies events bound via attachEvent when using cloneNode.
-	if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
-		data = jQuery._data( dest );
+	// Add in properties whose names you wish to fix before
+	// setting or getting the value
+	cssProps: {
+		// normalize float css property
+		"float": support.cssFloat ? "cssFloat" : "styleFloat"
+	},
 
-		for ( e in data.events ) {
-			jQuery.removeEvent( dest, e, data.handle );
+	// Get and set the style property on a DOM Node
+	style: function( elem, name, value, extra ) {
+		// Don't set styles on text and comment nodes
+		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+			return;
 		}
 
-		// Event data gets referenced instead of copied if the expando gets copied too
-		dest.removeAttribute( jQuery.expando );
-	}
+		// Make sure that we're working with the right name
+		var ret, type, hooks,
+			origName = jQuery.camelCase( name ),
+			style = elem.style;
 
-	// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
-	if ( nodeName === "script" && dest.text !== src.text ) {
-		disableScript( dest ).text = src.text;
-		restoreScript( dest );
+		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
 
-	// IE6-10 improperly clones children of object elements using classid.
-	// IE10 throws NoModificationAllowedError if parent is null, #12132.
-	} else if ( nodeName === "object" ) {
-		if ( dest.parentNode ) {
-			dest.outerHTML = src.outerHTML;
-		}
+		// gets hook for the prefixed version
+		// followed by the unprefixed version
+		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
 
-		// This path appears unavoidable for IE9. When cloning an object
-		// element in IE9, the outerHTML strategy above is not sufficient.
-		// If the src has innerHTML and the destination does not,
-		// copy the src.innerHTML into the dest.innerHTML. #10324
-		if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
-			dest.innerHTML = src.innerHTML;
-		}
+		// Check if we're setting a value
+		if ( value !== undefined ) {
+			type = typeof value;
 
-	} else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
-		// IE6-8 fails to persist the checked state of a cloned checkbox
-		// or radio button. Worse, IE6-7 fail to give the cloned element
-		// a checked appearance if the defaultChecked value isn't also set
+			// convert relative number strings (+= or -=) to relative numbers. #7345
+			if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+				value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
+				// Fixes bug #9237
+				type = "number";
+			}
 
-		dest.defaultChecked = dest.checked = src.checked;
+			// Make sure that null and NaN values aren't set. See: #7116
+			if ( value == null || value !== value ) {
+				return;
+			}
 
-		// IE6-7 get confused and end up setting the value of a cloned
-		// checkbox/radio button to an empty string instead of "on"
-		if ( dest.value !== src.value ) {
-			dest.value = src.value;
-		}
+			// If a number was passed in, add 'px' to the (except for certain CSS properties)
+			if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+				value += "px";
+			}
 
-	// IE6-8 fails to return the selected option to the default selected
-	// state when cloning options
-	} else if ( nodeName === "option" ) {
-		dest.defaultSelected = dest.selected = src.defaultSelected;
+			// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
+			// but it would mean to define eight (for every problematic property) identical functions
+			if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
+				style[ name ] = "inherit";
+			}
 
-	// IE6-8 fails to set the defaultValue to the correct value when
-	// cloning other types of input fields
-	} else if ( nodeName === "input" || nodeName === "textarea" ) {
-		dest.defaultValue = src.defaultValue;
-	}
-}
+			// If a hook was provided, use that value, otherwise just set the specified value
+			if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
 
-jQuery.each({
-	appendTo: "append",
-	prependTo: "prepend",
-	insertBefore: "before",
-	insertAfter: "after",
-	replaceAll: "replaceWith"
-}, function( name, original ) {
-	jQuery.fn[ name ] = function( selector ) {
-		var elems,
-			i = 0,
-			ret = [],
-			insert = jQuery( selector ),
-			last = insert.length - 1;
+				// Support: IE
+				// Swallow errors from 'invalid' CSS values (#5509)
+				try {
+					style[ name ] = value;
+				} catch(e) {}
+			}
 
-		for ( ; i <= last; i++ ) {
-			elems = i === last ? this : this.clone(true);
-			jQuery( insert[i] )[ original ]( elems );
+		} else {
+			// If a hook was provided get the non-computed value from there
+			if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+				return ret;
+			}
 
-			// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
-			core_push.apply( ret, elems.get() );
+			// Otherwise just get the value from the style object
+			return style[ name ];
 		}
+	},
 
-		return this.pushStack( ret );
-	};
-});
+	css: function( elem, name, extra, styles ) {
+		var num, val, hooks,
+			origName = jQuery.camelCase( name );
 
-function getAll( context, tag ) {
-	var elems, elem,
-		i = 0,
-		found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
-			typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
-			undefined;
+		// Make sure that we're working with the right name
+		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
 
-	if ( !found ) {
-		for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
-			if ( !tag || jQuery.nodeName( elem, tag ) ) {
-				found.push( elem );
-			} else {
-				jQuery.merge( found, getAll( elem, tag ) );
-			}
+		// gets hook for the prefixed version
+		// followed by the unprefixed version
+		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+		// If a hook was provided get the computed value from there
+		if ( hooks && "get" in hooks ) {
+			val = hooks.get( elem, true, extra );
 		}
-	}
 
-	return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
-		jQuery.merge( [ context ], found ) :
-		found;
-}
+		// Otherwise, if a way to get the computed value exists, use that
+		if ( val === undefined ) {
+			val = curCSS( elem, name, styles );
+		}
 
-// Used in buildFragment, fixes the defaultChecked property
-function fixDefaultChecked( elem ) {
-	if ( manipulation_rcheckableType.test( elem.type ) ) {
-		elem.defaultChecked = elem.checked;
-	}
-}
+		//convert "normal" to computed value
+		if ( val === "normal" && name in cssNormalTransform ) {
+			val = cssNormalTransform[ name ];
+		}
 
-jQuery.extend({
-	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
-		var destElements, node, clone, i, srcElements,
-			inPage = jQuery.contains( elem.ownerDocument, elem );
+		// Return, converting to number if forced or a qualifier was provided and val looks numeric
+		if ( extra === "" || extra ) {
+			num = parseFloat( val );
+			return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
+		}
+		return val;
+	}
+});
 
-		if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
-			clone = elem.cloneNode( true );
+jQuery.each([ "height", "width" ], function( i, name ) {
+	jQuery.cssHooks[ name ] = {
+		get: function( elem, computed, extra ) {
+			if ( computed ) {
+				// certain elements can have dimension info if we invisibly show them
+				// however, it must have a current display style that would benefit from this
+				return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
+					jQuery.swap( elem, cssShow, function() {
+						return getWidthOrHeight( elem, name, extra );
+					}) :
+					getWidthOrHeight( elem, name, extra );
+			}
+		},
 
-		// IE<=8 does not properly clone detached, unknown element nodes
-		} else {
-			fragmentDiv.innerHTML = elem.outerHTML;
-			fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
+		set: function( elem, value, extra ) {
+			var styles = extra && getStyles( elem );
+			return setPositiveNumber( elem, value, extra ?
+				augmentWidthOrHeight(
+					elem,
+					name,
+					extra,
+					support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+					styles
+				) : 0
+			);
 		}
+	};
+});
 
-		if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
-				(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+if ( !support.opacity ) {
+	jQuery.cssHooks.opacity = {
+		get: function( elem, computed ) {
+			// IE uses filters for opacity
+			return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+				( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
+				computed ? "1" : "";
+		},
 
-			// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
-			destElements = getAll( clone );
-			srcElements = getAll( elem );
+		set: function( elem, value ) {
+			var style = elem.style,
+				currentStyle = elem.currentStyle,
+				opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
+				filter = currentStyle && currentStyle.filter || style.filter || "";
 
-			// Fix all IE cloning issues
-			for ( i = 0; (node = srcElements[i]) != null; ++i ) {
-				// Ensure that the destination node is not null; Fixes #9587
-				if ( destElements[i] ) {
-					fixCloneNodeIssues( node, destElements[i] );
-				}
-			}
-		}
+			// IE has trouble with opacity if it does not have layout
+			// Force it by setting the zoom level
+			style.zoom = 1;
 
-		// Copy the events from the original to the clone
-		if ( dataAndEvents ) {
-			if ( deepDataAndEvents ) {
-				srcElements = srcElements || getAll( elem );
-				destElements = destElements || getAll( clone );
+			// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
+			// if value === "", then remove inline opacity #12685
+			if ( ( value >= 1 || value === "" ) &&
+					jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
+					style.removeAttribute ) {
 
-				for ( i = 0; (node = srcElements[i]) != null; i++ ) {
-					cloneCopyEvent( node, destElements[i] );
+				// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+				// if "filter:" is present at all, clearType is disabled, we want to avoid this
+				// style.removeAttribute is IE Only, but so apparently is this code path...
+				style.removeAttribute( "filter" );
+
+				// if there is no filter style applied in a css rule or unset inline opacity, we are done
+				if ( value === "" || currentStyle && !currentStyle.filter ) {
+					return;
 				}
-			} else {
-				cloneCopyEvent( elem, clone );
 			}
+
+			// otherwise, set new filter values
+			style.filter = ralpha.test( filter ) ?
+				filter.replace( ralpha, opacity ) :
+				filter + " " + opacity;
 		}
+	};
+}
 
-		// Preserve script evaluation history
-		destElements = getAll( clone, "script" );
-		if ( destElements.length > 0 ) {
-			setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
+jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
+	function( elem, computed ) {
+		if ( computed ) {
+			// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+			// Work around by temporarily setting element display to inline-block
+			return jQuery.swap( elem, { "display": "inline-block" },
+				curCSS, [ elem, "marginRight" ] );
 		}
+	}
+);
 
-		destElements = srcElements = node = null;
+// These hooks are used by animate to expand properties
+jQuery.each({
+	margin: "",
+	padding: "",
+	border: "Width"
+}, function( prefix, suffix ) {
+	jQuery.cssHooks[ prefix + suffix ] = {
+		expand: function( value ) {
+			var i = 0,
+				expanded = {},
 
-		// Return the cloned set
-		return clone;
-	},
+				// assumes a single number if not a string
+				parts = typeof value === "string" ? value.split(" ") : [ value ];
 
-	buildFragment: function( elems, context, scripts, selection ) {
-		var j, elem, contains,
-			tmp, tag, tbody, wrap,
-			l = elems.length,
+			for ( ; i < 4; i++ ) {
+				expanded[ prefix + cssExpand[ i ] + suffix ] =
+					parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+			}
 
-			// Ensure a safe fragment
-			safe = createSafeFragment( context ),
+			return expanded;
+		}
+	};
 
-			nodes = [],
-			i = 0;
+	if ( !rmargin.test( prefix ) ) {
+		jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+	}
+});
 
-		for ( ; i < l; i++ ) {
-			elem = elems[ i ];
+jQuery.fn.extend({
+	css: function( name, value ) {
+		return access( this, function( elem, name, value ) {
+			var styles, len,
+				map = {},
+				i = 0;
 
-			if ( elem || elem === 0 ) {
+			if ( jQuery.isArray( name ) ) {
+				styles = getStyles( elem );
+				len = name.length;
 
-				// Add nodes directly
-				if ( jQuery.type( elem ) === "object" ) {
-					jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+				for ( ; i < len; i++ ) {
+					map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
+				}
 
-				// Convert non-html into a text node
-				} else if ( !rhtml.test( elem ) ) {
-					nodes.push( context.createTextNode( elem ) );
+				return map;
+			}
 
-				// Convert html into DOM nodes
-				} else {
-					tmp = tmp || safe.appendChild( context.createElement("div") );
+			return value !== undefined ?
+				jQuery.style( elem, name, value ) :
+				jQuery.css( elem, name );
+		}, name, value, arguments.length > 1 );
+	},
+	show: function() {
+		return showHide( this, true );
+	},
+	hide: function() {
+		return showHide( this );
+	},
+	toggle: function( state ) {
+		if ( typeof state === "boolean" ) {
+			return state ? this.show() : this.hide();
+		}
 
-					// Deserialize a standard representation
-					tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
-					wrap = wrapMap[ tag ] || wrapMap._default;
+		return this.each(function() {
+			if ( isHidden( this ) ) {
+				jQuery( this ).show();
+			} else {
+				jQuery( this ).hide();
+			}
+		});
+	}
+});
 
-					tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
 
-					// Descend through wrappers to the right content
-					j = wrap[0];
-					while ( j-- ) {
-						tmp = tmp.lastChild;
-					}
+function Tween( elem, options, prop, end, easing ) {
+	return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
 
-					// Manually add leading whitespace removed by IE
-					if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
-						nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
-					}
+Tween.prototype = {
+	constructor: Tween,
+	init: function( elem, options, prop, end, easing, unit ) {
+		this.elem = elem;
+		this.prop = prop;
+		this.easing = easing || "swing";
+		this.options = options;
+		this.start = this.now = this.cur();
+		this.end = end;
+		this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+	},
+	cur: function() {
+		var hooks = Tween.propHooks[ this.prop ];
 
-					// Remove IE's autoinserted <tbody> from table fragments
-					if ( !jQuery.support.tbody ) {
+		return hooks && hooks.get ?
+			hooks.get( this ) :
+			Tween.propHooks._default.get( this );
+	},
+	run: function( percent ) {
+		var eased,
+			hooks = Tween.propHooks[ this.prop ];
 
-						// String was a <table>, *may* have spurious <tbody>
-						elem = tag === "table" && !rtbody.test( elem ) ?
-							tmp.firstChild :
+		if ( this.options.duration ) {
+			this.pos = eased = jQuery.easing[ this.easing ](
+				percent, this.options.duration * percent, 0, 1, this.options.duration
+			);
+		} else {
+			this.pos = eased = percent;
+		}
+		this.now = ( this.end - this.start ) * eased + this.start;
 
-							// String was a bare <thead> or <tfoot>
-							wrap[1] === "<table>" && !rtbody.test( elem ) ?
-								tmp :
-								0;
+		if ( this.options.step ) {
+			this.options.step.call( this.elem, this.now, this );
+		}
 
-						j = elem && elem.childNodes.length;
-						while ( j-- ) {
-							if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
-								elem.removeChild( tbody );
-							}
-						}
-					}
+		if ( hooks && hooks.set ) {
+			hooks.set( this );
+		} else {
+			Tween.propHooks._default.set( this );
+		}
+		return this;
+	}
+};
 
-					jQuery.merge( nodes, tmp.childNodes );
+Tween.prototype.init.prototype = Tween.prototype;
 
-					// Fix #12392 for WebKit and IE > 9
-					tmp.textContent = "";
+Tween.propHooks = {
+	_default: {
+		get: function( tween ) {
+			var result;
 
-					// Fix #12392 for oldIE
-					while ( tmp.firstChild ) {
-						tmp.removeChild( tmp.firstChild );
-					}
+			if ( tween.elem[ tween.prop ] != null &&
+				(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+				return tween.elem[ tween.prop ];
+			}
 
-					// Remember the top-level container for proper cleanup
-					tmp = safe.lastChild;
-				}
+			// passing an empty string as a 3rd parameter to .css will automatically
+			// attempt a parseFloat and fallback to a string if the parse fails
+			// so, simple values such as "10px" are parsed to Float.
+			// complex values such as "rotate(1rad)" are returned as is.
+			result = jQuery.css( tween.elem, tween.prop, "" );
+			// Empty strings, null, undefined and "auto" are converted to 0.
+			return !result || result === "auto" ? 0 : result;
+		},
+		set: function( tween ) {
+			// use step hook for back compat - use cssHook if its there - use .style if its
+			// available and use plain properties where available
+			if ( jQuery.fx.step[ tween.prop ] ) {
+				jQuery.fx.step[ tween.prop ]( tween );
+			} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+				jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+			} else {
+				tween.elem[ tween.prop ] = tween.now;
 			}
 		}
+	}
+};
 
-		// Fix #11356: Clear elements from fragment
-		if ( tmp ) {
-			safe.removeChild( tmp );
-		}
+// Support: IE <=9
+// Panic based approach to setting things on disconnected nodes
 
-		// Reset defaultChecked for any radios and checkboxes
-		// about to be appended to the DOM in IE 6/7 (#8060)
-		if ( !jQuery.support.appendChecked ) {
-			jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+	set: function( tween ) {
+		if ( tween.elem.nodeType && tween.elem.parentNode ) {
+			tween.elem[ tween.prop ] = tween.now;
 		}
+	}
+};
+
+jQuery.easing = {
+	linear: function( p ) {
+		return p;
+	},
+	swing: function( p ) {
+		return 0.5 - Math.cos( p * Math.PI ) / 2;
+	}
+};
+
+jQuery.fx = Tween.prototype.init;
+
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
 
-		i = 0;
-		while ( (elem = nodes[ i++ ]) ) {
 
-			// #4087 - If origin and destination elements are the same, and this is
-			// that element, do not do anything
-			if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
-				continue;
-			}
 
-			contains = jQuery.contains( elem.ownerDocument, elem );
 
-			// Append to fragment
-			tmp = getAll( safe.appendChild( elem ), "script" );
+var
+	fxNow, timerId,
+	rfxtypes = /^(?:toggle|show|hide)$/,
+	rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
+	rrun = /queueHooks$/,
+	animationPrefilters = [ defaultPrefilter ],
+	tweeners = {
+		"*": [ function( prop, value ) {
+			var tween = this.createTween( prop, value ),
+				target = tween.cur(),
+				parts = rfxnum.exec( value ),
+				unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
 
-			// Preserve script evaluation history
-			if ( contains ) {
-				setGlobalEval( tmp );
-			}
+				// Starting value computation is required for potential unit mismatches
+				start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
+					rfxnum.exec( jQuery.css( tween.elem, prop ) ),
+				scale = 1,
+				maxIterations = 20;
 
-			// Capture executables
-			if ( scripts ) {
-				j = 0;
-				while ( (elem = tmp[ j++ ]) ) {
-					if ( rscriptType.test( elem.type || "" ) ) {
-						scripts.push( elem );
-					}
-				}
-			}
-		}
+			if ( start && start[ 3 ] !== unit ) {
+				// Trust units reported by jQuery.css
+				unit = unit || start[ 3 ];
 
-		tmp = null;
+				// Make sure we update the tween properties later on
+				parts = parts || [];
 
-		return safe;
-	},
+				// Iteratively approximate from a nonzero starting point
+				start = +target || 1;
 
-	cleanData: function( elems, /* internal */ acceptData ) {
-		var elem, type, id, data,
-			i = 0,
-			internalKey = jQuery.expando,
-			cache = jQuery.cache,
-			deleteExpando = jQuery.support.deleteExpando,
-			special = jQuery.event.special;
+				do {
+					// If previous iteration zeroed out, double until we get *something*
+					// Use a string for doubling factor so we don't accidentally see scale as unchanged below
+					scale = scale || ".5";
 
-		for ( ; (elem = elems[i]) != null; i++ ) {
+					// Adjust and apply
+					start = start / scale;
+					jQuery.style( tween.elem, prop, start + unit );
 
-			if ( acceptData || jQuery.acceptData( elem ) ) {
+				// Update scale, tolerating zero or NaN from tween.cur()
+				// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+				} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+			}
 
-				id = elem[ internalKey ];
-				data = id && cache[ id ];
+			// Update tween properties
+			if ( parts ) {
+				start = tween.start = +start || +target || 0;
+				tween.unit = unit;
+				// If a +=/-= token was provided, we're doing a relative animation
+				tween.end = parts[ 1 ] ?
+					start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
+					+parts[ 2 ];
+			}
 
-				if ( data ) {
-					if ( data.events ) {
-						for ( type in data.events ) {
-							if ( special[ type ] ) {
-								jQuery.event.remove( elem, type );
+			return tween;
+		} ]
+	};
 
-							// This is a shortcut to avoid jQuery.event.remove's overhead
-							} else {
-								jQuery.removeEvent( elem, type, data.handle );
-							}
-						}
-					}
+// Animations created synchronously will run synchronously
+function createFxNow() {
+	setTimeout(function() {
+		fxNow = undefined;
+	});
+	return ( fxNow = jQuery.now() );
+}
 
-					// Remove cache only if it was not already removed by jQuery.event.remove
-					if ( cache[ id ] ) {
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+	var which,
+		attrs = { height: type },
+		i = 0;
 
-						delete cache[ id ];
+	// if we include width, step value is 1 to do all cssExpand values,
+	// if we don't include width, step value is 2 to skip over Left and Right
+	includeWidth = includeWidth ? 1 : 0;
+	for ( ; i < 4 ; i += 2 - includeWidth ) {
+		which = cssExpand[ i ];
+		attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+	}
 
-						// IE does not allow us to delete expando properties from nodes,
-						// nor does it have a removeAttribute function on Document nodes;
-						// we must handle all of these cases
-						if ( deleteExpando ) {
-							delete elem[ internalKey ];
+	if ( includeWidth ) {
+		attrs.opacity = attrs.width = type;
+	}
 
-						} else if ( typeof elem.removeAttribute !== core_strundefined ) {
-							elem.removeAttribute( internalKey );
+	return attrs;
+}
 
-						} else {
-							elem[ internalKey ] = null;
-						}
+function createTween( value, prop, animation ) {
+	var tween,
+		collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+		index = 0,
+		length = collection.length;
+	for ( ; index < length; index++ ) {
+		if ( (tween = collection[ index ].call( animation, prop, value )) ) {
 
-						core_deletedIds.push( id );
-					}
+			// we're done with this property
+			return tween;
+		}
+	}
+}
+
+function defaultPrefilter( elem, props, opts ) {
+	/* jshint validthis: true */
+	var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
+		anim = this,
+		orig = {},
+		style = elem.style,
+		hidden = elem.nodeType && isHidden( elem ),
+		dataShow = jQuery._data( elem, "fxshow" );
+
+	// handle queue: false promises
+	if ( !opts.queue ) {
+		hooks = jQuery._queueHooks( elem, "fx" );
+		if ( hooks.unqueued == null ) {
+			hooks.unqueued = 0;
+			oldfire = hooks.empty.fire;
+			hooks.empty.fire = function() {
+				if ( !hooks.unqueued ) {
+					oldfire();
 				}
-			}
+			};
 		}
-	},
+		hooks.unqueued++;
 
-	_evalUrl: function( url ) {
-		return jQuery.ajax({
-			url: url,
-			type: "GET",
-			dataType: "script",
-			async: false,
-			global: false,
-			"throws": true
+		anim.always(function() {
+			// doing this makes sure that the complete handler will be called
+			// before this completes
+			anim.always(function() {
+				hooks.unqueued--;
+				if ( !jQuery.queue( elem, "fx" ).length ) {
+					hooks.empty.fire();
+				}
+			});
 		});
 	}
-});
-jQuery.fn.extend({
-	wrapAll: function( html ) {
-		if ( jQuery.isFunction( html ) ) {
-			return this.each(function(i) {
-				jQuery(this).wrapAll( html.call(this, i) );
-			});
-		}
 
-		if ( this[0] ) {
-			// The elements to wrap the target around
-			var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+	// height/width overflow pass
+	if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+		// Make sure that nothing sneaks out
+		// Record all 3 overflow attributes because IE does not
+		// change the overflow attribute when overflowX and
+		// overflowY are set to the same value
+		opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
 
-			if ( this[0].parentNode ) {
-				wrap.insertBefore( this[0] );
-			}
+		// Set display property to inline-block for height/width
+		// animations on inline elements that are having width/height animated
+		display = jQuery.css( elem, "display" );
 
-			wrap.map(function() {
-				var elem = this;
+		// Test default display if display is currently "none"
+		checkDisplay = display === "none" ?
+			jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
 
-				while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
-					elem = elem.firstChild;
-				}
+		if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
 
-				return elem;
-			}).append( this );
+			// inline-level elements accept inline-block;
+			// block-level elements need to be inline with layout
+			if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
+				style.display = "inline-block";
+			} else {
+				style.zoom = 1;
+			}
 		}
+	}
 
-		return this;
-	},
-
-	wrapInner: function( html ) {
-		if ( jQuery.isFunction( html ) ) {
-			return this.each(function(i) {
-				jQuery(this).wrapInner( html.call(this, i) );
+	if ( opts.overflow ) {
+		style.overflow = "hidden";
+		if ( !support.shrinkWrapBlocks() ) {
+			anim.always(function() {
+				style.overflow = opts.overflow[ 0 ];
+				style.overflowX = opts.overflow[ 1 ];
+				style.overflowY = opts.overflow[ 2 ];
 			});
 		}
+	}
 
-		return this.each(function() {
-			var self = jQuery( this ),
-				contents = self.contents();
-
-			if ( contents.length ) {
-				contents.wrapAll( html );
+	// show/hide pass
+	for ( prop in props ) {
+		value = props[ prop ];
+		if ( rfxtypes.exec( value ) ) {
+			delete props[ prop ];
+			toggle = toggle || value === "toggle";
+			if ( value === ( hidden ? "hide" : "show" ) ) {
 
-			} else {
-				self.append( html );
+				// If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
+				if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
+					hidden = true;
+				} else {
+					continue;
+				}
 			}
-		});
-	},
+			orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
 
-	wrap: function( html ) {
-		var isFunction = jQuery.isFunction( html );
+		// Any non-fx value stops us from restoring the original display value
+		} else {
+			display = undefined;
+		}
+	}
+
+	if ( !jQuery.isEmptyObject( orig ) ) {
+		if ( dataShow ) {
+			if ( "hidden" in dataShow ) {
+				hidden = dataShow.hidden;
+			}
+		} else {
+			dataShow = jQuery._data( elem, "fxshow", {} );
+		}
 
-		return this.each(function(i) {
-			jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
+		// store state if its toggle - enables .stop().toggle() to "reverse"
+		if ( toggle ) {
+			dataShow.hidden = !hidden;
+		}
+		if ( hidden ) {
+			jQuery( elem ).show();
+		} else {
+			anim.done(function() {
+				jQuery( elem ).hide();
+			});
+		}
+		anim.done(function() {
+			var prop;
+			jQuery._removeData( elem, "fxshow" );
+			for ( prop in orig ) {
+				jQuery.style( elem, prop, orig[ prop ] );
+			}
 		});
-	},
+		for ( prop in orig ) {
+			tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
 
-	unwrap: function() {
-		return this.parent().each(function() {
-			if ( !jQuery.nodeName( this, "body" ) ) {
-				jQuery( this ).replaceWith( this.childNodes );
+			if ( !( prop in dataShow ) ) {
+				dataShow[ prop ] = tween.start;
+				if ( hidden ) {
+					tween.end = tween.start;
+					tween.start = prop === "width" || prop === "height" ? 1 : 0;
+				}
 			}
-		}).end();
-	}
-});
-var iframe, getStyles, curCSS,
-	ralpha = /alpha\([^)]*\)/i,
-	ropacity = /opacity\s*=\s*([^)]*)/,
-	rposition = /^(top|right|bottom|left)$/,
-	// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
-	// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
-	rdisplayswap = /^(none|table(?!-c[ea]).+)/,
-	rmargin = /^margin/,
-	rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
-	rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
-	rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
-	elemdisplay = { BODY: "block" },
+		}
 
-	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
-	cssNormalTransform = {
-		letterSpacing: 0,
-		fontWeight: 400
-	},
+	// If this is a noop like .hide().hide(), restore an overwritten display value
+	} else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
+		style.display = display;
+	}
+}
 
-	cssExpand = [ "Top", "Right", "Bottom", "Left" ],
-	cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
+function propFilter( props, specialEasing ) {
+	var index, name, easing, value, hooks;
 
-// return a css property mapped to a potentially vendor prefixed property
-function vendorPropName( style, name ) {
+	// camelCase, specialEasing and expand cssHook pass
+	for ( index in props ) {
+		name = jQuery.camelCase( index );
+		easing = specialEasing[ name ];
+		value = props[ index ];
+		if ( jQuery.isArray( value ) ) {
+			easing = value[ 1 ];
+			value = props[ index ] = value[ 0 ];
+		}
 
-	// shortcut for names that are not vendor prefixed
-	if ( name in style ) {
-		return name;
-	}
+		if ( index !== name ) {
+			props[ name ] = value;
+			delete props[ index ];
+		}
 
-	// check for vendor prefixed names
-	var capName = name.charAt(0).toUpperCase() + name.slice(1),
-		origName = name,
-		i = cssPrefixes.length;
+		hooks = jQuery.cssHooks[ name ];
+		if ( hooks && "expand" in hooks ) {
+			value = hooks.expand( value );
+			delete props[ name ];
 
-	while ( i-- ) {
-		name = cssPrefixes[ i ] + capName;
-		if ( name in style ) {
-			return name;
+			// not quite $.extend, this wont overwrite keys already present.
+			// also - reusing 'index' from above because we have the correct "name"
+			for ( index in value ) {
+				if ( !( index in props ) ) {
+					props[ index ] = value[ index ];
+					specialEasing[ index ] = easing;
+				}
+			}
+		} else {
+			specialEasing[ name ] = easing;
 		}
 	}
-
-	return origName;
 }
 
-function isHidden( elem, el ) {
-	// isHidden might be called from jQuery#filter function;
-	// in that case, element will be second argument
-	elem = el || elem;
-	return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
-}
-
-function showHide( elements, show ) {
-	var display, elem, hidden,
-		values = [],
+function Animation( elem, properties, options ) {
+	var result,
+		stopped,
 		index = 0,
-		length = elements.length;
-
-	for ( ; index < length; index++ ) {
-		elem = elements[ index ];
-		if ( !elem.style ) {
-			continue;
-		}
-
-		values[ index ] = jQuery._data( elem, "olddisplay" );
-		display = elem.style.display;
-		if ( show ) {
-			// Reset the inline display of this element to learn if it is
-			// being hidden by cascaded rules or not
-			if ( !values[ index ] && display === "none" ) {
-				elem.style.display = "";
+		length = animationPrefilters.length,
+		deferred = jQuery.Deferred().always( function() {
+			// don't match elem in the :animated selector
+			delete tick.elem;
+		}),
+		tick = function() {
+			if ( stopped ) {
+				return false;
 			}
+			var currentTime = fxNow || createFxNow(),
+				remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+				// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
+				temp = remaining / animation.duration || 0,
+				percent = 1 - temp,
+				index = 0,
+				length = animation.tweens.length;
 
-			// Set elements which have been overridden with display: none
-			// in a stylesheet to whatever the default browser style is
-			// for such an element
-			if ( elem.style.display === "" && isHidden( elem ) ) {
-				values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
+			for ( ; index < length ; index++ ) {
+				animation.tweens[ index ].run( percent );
 			}
-		} else {
 
-			if ( !values[ index ] ) {
-				hidden = isHidden( elem );
+			deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
+			if ( percent < 1 && length ) {
+				return remaining;
+			} else {
+				deferred.resolveWith( elem, [ animation ] );
+				return false;
+			}
+		},
+		animation = deferred.promise({
+			elem: elem,
+			props: jQuery.extend( {}, properties ),
+			opts: jQuery.extend( true, { specialEasing: {} }, options ),
+			originalProperties: properties,
+			originalOptions: options,
+			startTime: fxNow || createFxNow(),
+			duration: options.duration,
+			tweens: [],
+			createTween: function( prop, end ) {
+				var tween = jQuery.Tween( elem, animation.opts, prop, end,
+						animation.opts.specialEasing[ prop ] || animation.opts.easing );
+				animation.tweens.push( tween );
+				return tween;
+			},
+			stop: function( gotoEnd ) {
+				var index = 0,
+					// if we are going to the end, we want to run all the tweens
+					// otherwise we skip this part
+					length = gotoEnd ? animation.tweens.length : 0;
+				if ( stopped ) {
+					return this;
+				}
+				stopped = true;
+				for ( ; index < length ; index++ ) {
+					animation.tweens[ index ].run( 1 );
+				}
 
-				if ( display && display !== "none" || !hidden ) {
-					jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
+				// resolve when we played the last frame
+				// otherwise, reject
+				if ( gotoEnd ) {
+					deferred.resolveWith( elem, [ animation, gotoEnd ] );
+				} else {
+					deferred.rejectWith( elem, [ animation, gotoEnd ] );
 				}
+				return this;
 			}
-		}
-	}
+		}),
+		props = animation.props;
 
-	// Set the display of most of the elements in a second loop
-	// to avoid the constant reflow
-	for ( index = 0; index < length; index++ ) {
-		elem = elements[ index ];
-		if ( !elem.style ) {
-			continue;
-		}
-		if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
-			elem.style.display = show ? values[ index ] || "" : "none";
+	propFilter( props, animation.opts.specialEasing );
+
+	for ( ; index < length ; index++ ) {
+		result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+		if ( result ) {
+			return result;
 		}
 	}
 
-	return elements;
-}
+	jQuery.map( props, createTween, animation );
 
-jQuery.fn.extend({
-	css: function( name, value ) {
-		return jQuery.access( this, function( elem, name, value ) {
-			var len, styles,
-				map = {},
-				i = 0;
+	if ( jQuery.isFunction( animation.opts.start ) ) {
+		animation.opts.start.call( elem, animation );
+	}
 
-			if ( jQuery.isArray( name ) ) {
-				styles = getStyles( elem );
-				len = name.length;
+	jQuery.fx.timer(
+		jQuery.extend( tick, {
+			elem: elem,
+			anim: animation,
+			queue: animation.opts.queue
+		})
+	);
 
-				for ( ; i < len; i++ ) {
-					map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
-				}
+	// attach callbacks from options
+	return animation.progress( animation.opts.progress )
+		.done( animation.opts.done, animation.opts.complete )
+		.fail( animation.opts.fail )
+		.always( animation.opts.always );
+}
 
-				return map;
-			}
+jQuery.Animation = jQuery.extend( Animation, {
+	tweener: function( props, callback ) {
+		if ( jQuery.isFunction( props ) ) {
+			callback = props;
+			props = [ "*" ];
+		} else {
+			props = props.split(" ");
+		}
 
-			return value !== undefined ?
-				jQuery.style( elem, name, value ) :
-				jQuery.css( elem, name );
-		}, name, value, arguments.length > 1 );
-	},
-	show: function() {
-		return showHide( this, true );
-	},
-	hide: function() {
-		return showHide( this );
-	},
-	toggle: function( state ) {
-		if ( typeof state === "boolean" ) {
-			return state ? this.show() : this.hide();
+		var prop,
+			index = 0,
+			length = props.length;
+
+		for ( ; index < length ; index++ ) {
+			prop = props[ index ];
+			tweeners[ prop ] = tweeners[ prop ] || [];
+			tweeners[ prop ].unshift( callback );
 		}
+	},
 
-		return this.each(function() {
-			if ( isHidden( this ) ) {
-				jQuery( this ).show();
-			} else {
-				jQuery( this ).hide();
-			}
-		});
+	prefilter: function( callback, prepend ) {
+		if ( prepend ) {
+			animationPrefilters.unshift( callback );
+		} else {
+			animationPrefilters.push( callback );
+		}
 	}
 });
 
-jQuery.extend({
-	// Add in style property hooks for overriding the default
-	// behavior of getting and setting a style property
-	cssHooks: {
-		opacity: {
-			get: function( elem, computed ) {
-				if ( computed ) {
-					// We should always get a number back from opacity
-					var ret = curCSS( elem, "opacity" );
-					return ret === "" ? "1" : ret;
-				}
-			}
-		}
-	},
+jQuery.speed = function( speed, easing, fn ) {
+	var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+		complete: fn || !fn && easing ||
+			jQuery.isFunction( speed ) && speed,
+		duration: speed,
+		easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+	};
 
-	// Don't automatically add "px" to these possibly-unitless properties
-	cssNumber: {
-		"columnCount": true,
-		"fillOpacity": true,
-		"fontWeight": true,
-		"lineHeight": true,
-		"opacity": true,
-		"order": true,
-		"orphans": true,
-		"widows": true,
-		"zIndex": true,
-		"zoom": true
-	},
+	opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+		opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
 
-	// Add in properties whose names you wish to fix before
-	// setting or getting the value
-	cssProps: {
-		// normalize float css property
-		"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
-	},
+	// normalize opt.queue - true/undefined/null -> "fx"
+	if ( opt.queue == null || opt.queue === true ) {
+		opt.queue = "fx";
+	}
 
-	// Get and set the style property on a DOM Node
-	style: function( elem, name, value, extra ) {
-		// Don't set styles on text and comment nodes
-		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
-			return;
+	// Queueing
+	opt.old = opt.complete;
+
+	opt.complete = function() {
+		if ( jQuery.isFunction( opt.old ) ) {
+			opt.old.call( this );
 		}
 
-		// Make sure that we're working with the right name
-		var ret, type, hooks,
-			origName = jQuery.camelCase( name ),
-			style = elem.style;
+		if ( opt.queue ) {
+			jQuery.dequeue( this, opt.queue );
+		}
+	};
 
-		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
+	return opt;
+};
 
-		// gets hook for the prefixed version
-		// followed by the unprefixed version
-		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+jQuery.fn.extend({
+	fadeTo: function( speed, to, easing, callback ) {
 
-		// Check if we're setting a value
-		if ( value !== undefined ) {
-			type = typeof value;
+		// show any hidden elements after setting opacity to 0
+		return this.filter( isHidden ).css( "opacity", 0 ).show()
 
-			// convert relative number strings (+= or -=) to relative numbers. #7345
-			if ( type === "string" && (ret = rrelNum.exec( value )) ) {
-				value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
-				// Fixes bug #9237
-				type = "number";
-			}
+			// animate to the value specified
+			.end().animate({ opacity: to }, speed, easing, callback );
+	},
+	animate: function( prop, speed, easing, callback ) {
+		var empty = jQuery.isEmptyObject( prop ),
+			optall = jQuery.speed( speed, easing, callback ),
+			doAnimation = function() {
+				// Operate on a copy of prop so per-property easing won't be lost
+				var anim = Animation( this, jQuery.extend( {}, prop ), optall );
 
-			// Make sure that NaN and null values aren't set. See: #7116
-			if ( value == null || type === "number" && isNaN( value ) ) {
-				return;
-			}
+				// Empty animations, or finishing resolves immediately
+				if ( empty || jQuery._data( this, "finish" ) ) {
+					anim.stop( true );
+				}
+			};
+			doAnimation.finish = doAnimation;
 
-			// If a number was passed in, add 'px' to the (except for certain CSS properties)
-			if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
-				value += "px";
-			}
+		return empty || optall.queue === false ?
+			this.each( doAnimation ) :
+			this.queue( optall.queue, doAnimation );
+	},
+	stop: function( type, clearQueue, gotoEnd ) {
+		var stopQueue = function( hooks ) {
+			var stop = hooks.stop;
+			delete hooks.stop;
+			stop( gotoEnd );
+		};
 
-			// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
-			// but it would mean to define eight (for every problematic property) identical functions
-			if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
-				style[ name ] = "inherit";
-			}
+		if ( typeof type !== "string" ) {
+			gotoEnd = clearQueue;
+			clearQueue = type;
+			type = undefined;
+		}
+		if ( clearQueue && type !== false ) {
+			this.queue( type || "fx", [] );
+		}
 
-			// If a hook was provided, use that value, otherwise just set the specified value
-			if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
+		return this.each(function() {
+			var dequeue = true,
+				index = type != null && type + "queueHooks",
+				timers = jQuery.timers,
+				data = jQuery._data( this );
 
-				// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
-				// Fixes bug #5509
-				try {
-					style[ name ] = value;
-				} catch(e) {}
+			if ( index ) {
+				if ( data[ index ] && data[ index ].stop ) {
+					stopQueue( data[ index ] );
+				}
+			} else {
+				for ( index in data ) {
+					if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+						stopQueue( data[ index ] );
+					}
+				}
 			}
 
-		} else {
-			// If a hook was provided get the non-computed value from there
-			if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
-				return ret;
+			for ( index = timers.length; index--; ) {
+				if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+					timers[ index ].anim.stop( gotoEnd );
+					dequeue = false;
+					timers.splice( index, 1 );
+				}
 			}
 
-			// Otherwise just get the value from the style object
-			return style[ name ];
-		}
+			// start the next in the queue if the last step wasn't forced
+			// timers currently will call their complete callbacks, which will dequeue
+			// but only if they were gotoEnd
+			if ( dequeue || !gotoEnd ) {
+				jQuery.dequeue( this, type );
+			}
+		});
 	},
+	finish: function( type ) {
+		if ( type !== false ) {
+			type = type || "fx";
+		}
+		return this.each(function() {
+			var index,
+				data = jQuery._data( this ),
+				queue = data[ type + "queue" ],
+				hooks = data[ type + "queueHooks" ],
+				timers = jQuery.timers,
+				length = queue ? queue.length : 0;
 
-	css: function( elem, name, extra, styles ) {
-		var num, val, hooks,
-			origName = jQuery.camelCase( name );
-
-		// Make sure that we're working with the right name
-		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
+			// enable finishing flag on private data
+			data.finish = true;
 
-		// gets hook for the prefixed version
-		// followed by the unprefixed version
-		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+			// empty the queue first
+			jQuery.queue( this, type, [] );
 
-		// If a hook was provided get the computed value from there
-		if ( hooks && "get" in hooks ) {
-			val = hooks.get( elem, true, extra );
-		}
+			if ( hooks && hooks.stop ) {
+				hooks.stop.call( this, true );
+			}
 
-		// Otherwise, if a way to get the computed value exists, use that
-		if ( val === undefined ) {
-			val = curCSS( elem, name, styles );
-		}
+			// look for any active animations, and finish them
+			for ( index = timers.length; index--; ) {
+				if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+					timers[ index ].anim.stop( true );
+					timers.splice( index, 1 );
+				}
+			}
 
-		//convert "normal" to computed value
-		if ( val === "normal" && name in cssNormalTransform ) {
-			val = cssNormalTransform[ name ];
-		}
+			// look for any animations in the old queue and finish them
+			for ( index = 0; index < length; index++ ) {
+				if ( queue[ index ] && queue[ index ].finish ) {
+					queue[ index ].finish.call( this );
+				}
+			}
 
-		// Return, converting to number if forced or a qualifier was provided and val looks numeric
-		if ( extra === "" || extra ) {
-			num = parseFloat( val );
-			return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
-		}
-		return val;
+			// turn off finishing flag
+			delete data.finish;
+		});
 	}
 });
 
-// NOTE: we've included the "window" in window.getComputedStyle
-// because jsdom on node.js will break without it.
-if ( window.getComputedStyle ) {
-	getStyles = function( elem ) {
-		return window.getComputedStyle( elem, null );
-	};
-
-	curCSS = function( elem, name, _computed ) {
-		var width, minWidth, maxWidth,
-			computed = _computed || getStyles( elem ),
-
-			// getPropertyValue is only needed for .css('filter') in IE9, see #12537
-			ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
-			style = elem.style;
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+	var cssFn = jQuery.fn[ name ];
+	jQuery.fn[ name ] = function( speed, easing, callback ) {
+		return speed == null || typeof speed === "boolean" ?
+			cssFn.apply( this, arguments ) :
+			this.animate( genFx( name, true ), speed, easing, callback );
+	};
+});
 
-		if ( computed ) {
+// Generate shortcuts for custom animations
+jQuery.each({
+	slideDown: genFx("show"),
+	slideUp: genFx("hide"),
+	slideToggle: genFx("toggle"),
+	fadeIn: { opacity: "show" },
+	fadeOut: { opacity: "hide" },
+	fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+	jQuery.fn[ name ] = function( speed, easing, callback ) {
+		return this.animate( props, speed, easing, callback );
+	};
+});
 
-			if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
-				ret = jQuery.style( elem, name );
-			}
+jQuery.timers = [];
+jQuery.fx.tick = function() {
+	var timer,
+		timers = jQuery.timers,
+		i = 0;
 
-			// A tribute to the "awesome hack by Dean Edwards"
-			// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
-			// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
-			// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
-			if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+	fxNow = jQuery.now();
 
-				// Remember the original values
-				width = style.width;
-				minWidth = style.minWidth;
-				maxWidth = style.maxWidth;
+	for ( ; i < timers.length; i++ ) {
+		timer = timers[ i ];
+		// Checks the timer has not already been removed
+		if ( !timer() && timers[ i ] === timer ) {
+			timers.splice( i--, 1 );
+		}
+	}
 
-				// Put in the new values to get a computed value out
-				style.minWidth = style.maxWidth = style.width = ret;
-				ret = computed.width;
+	if ( !timers.length ) {
+		jQuery.fx.stop();
+	}
+	fxNow = undefined;
+};
 
-				// Revert the changed values
-				style.width = width;
-				style.minWidth = minWidth;
-				style.maxWidth = maxWidth;
-			}
-		}
+jQuery.fx.timer = function( timer ) {
+	jQuery.timers.push( timer );
+	if ( timer() ) {
+		jQuery.fx.start();
+	} else {
+		jQuery.timers.pop();
+	}
+};
 
-		return ret;
-	};
-} else if ( document.documentElement.currentStyle ) {
-	getStyles = function( elem ) {
-		return elem.currentStyle;
-	};
+jQuery.fx.interval = 13;
 
-	curCSS = function( elem, name, _computed ) {
-		var left, rs, rsLeft,
-			computed = _computed || getStyles( elem ),
-			ret = computed ? computed[ name ] : undefined,
-			style = elem.style;
+jQuery.fx.start = function() {
+	if ( !timerId ) {
+		timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+	}
+};
 
-		// Avoid setting ret to empty string here
-		// so we don't default to auto
-		if ( ret == null && style && style[ name ] ) {
-			ret = style[ name ];
-		}
+jQuery.fx.stop = function() {
+	clearInterval( timerId );
+	timerId = null;
+};
 
-		// From the awesome hack by Dean Edwards
-		// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+jQuery.fx.speeds = {
+	slow: 600,
+	fast: 200,
+	// Default speed
+	_default: 400
+};
 
-		// If we're not dealing with a regular pixel number
-		// but a number that has a weird ending, we need to convert it to pixels
-		// but not position css attributes, as those are proportional to the parent element instead
-		// and we can't measure the parent instead because it might trigger a "stacking dolls" problem
-		if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
 
-			// Remember the original values
-			left = style.left;
-			rs = elem.runtimeStyle;
-			rsLeft = rs && rs.left;
+// Based off of the plugin by Clint Helfers, with permission.
+// http://blindsignals.com/index.php/2009/07/jquery-delay/
+jQuery.fn.delay = function( time, type ) {
+	time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+	type = type || "fx";
 
-			// Put in the new values to get a computed value out
-			if ( rsLeft ) {
-				rs.left = elem.currentStyle.left;
-			}
-			style.left = name === "fontSize" ? "1em" : ret;
-			ret = style.pixelLeft + "px";
+	return this.queue( type, function( next, hooks ) {
+		var timeout = setTimeout( next, time );
+		hooks.stop = function() {
+			clearTimeout( timeout );
+		};
+	});
+};
 
-			// Revert the changed values
-			style.left = left;
-			if ( rsLeft ) {
-				rs.left = rsLeft;
-			}
-		}
 
-		return ret === "" ? "auto" : ret;
-	};
-}
+(function() {
+	// Minified: var a,b,c,d,e
+	var input, div, select, a, opt;
 
-function setPositiveNumber( elem, value, subtract ) {
-	var matches = rnumsplit.exec( value );
-	return matches ?
-		// Guard against undefined "subtract", e.g., when used as in cssHooks
-		Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
-		value;
-}
+	// Setup
+	div = document.createElement( "div" );
+	div.setAttribute( "className", "t" );
+	div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+	a = div.getElementsByTagName("a")[ 0 ];
 
-function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
-	var i = extra === ( isBorderBox ? "border" : "content" ) ?
-		// If we already have the right measurement, avoid augmentation
-		4 :
-		// Otherwise initialize for horizontal or vertical properties
-		name === "width" ? 1 : 0,
+	// First batch of tests.
+	select = document.createElement("select");
+	opt = select.appendChild( document.createElement("option") );
+	input = div.getElementsByTagName("input")[ 0 ];
 
-		val = 0;
+	a.style.cssText = "top:1px";
 
-	for ( ; i < 4; i += 2 ) {
-		// both box models exclude margin, so add it if we want it
-		if ( extra === "margin" ) {
-			val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
-		}
+	// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+	support.getSetAttribute = div.className !== "t";
 
-		if ( isBorderBox ) {
-			// border-box includes padding, so remove it if we want content
-			if ( extra === "content" ) {
-				val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-			}
+	// Get the style information from getAttribute
+	// (IE uses .cssText instead)
+	support.style = /top/.test( a.getAttribute("style") );
 
-			// at this point, extra isn't border nor margin, so remove border
-			if ( extra !== "margin" ) {
-				val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-			}
-		} else {
-			// at this point, extra isn't content, so add padding
-			val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+	// Make sure that URLs aren't manipulated
+	// (IE normalizes it by default)
+	support.hrefNormalized = a.getAttribute("href") === "/a";
 
-			// at this point, extra isn't content nor padding, so add border
-			if ( extra !== "padding" ) {
-				val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-			}
-		}
-	}
+	// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
+	support.checkOn = !!input.value;
 
-	return val;
-}
+	// Make sure that a selected-by-default option has a working selected property.
+	// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+	support.optSelected = opt.selected;
 
-function getWidthOrHeight( elem, name, extra ) {
+	// Tests for enctype support on a form (#6743)
+	support.enctype = !!document.createElement("form").enctype;
 
-	// Start with offset property, which is equivalent to the border-box value
-	var valueIsBorderBox = true,
-		val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
-		styles = getStyles( elem ),
-		isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+	// Make sure that the options inside disabled selects aren't marked as disabled
+	// (WebKit marks them as disabled)
+	select.disabled = true;
+	support.optDisabled = !opt.disabled;
 
-	// some non-html elements return undefined for offsetWidth, so check for null/undefined
-	// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
-	// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
-	if ( val <= 0 || val == null ) {
-		// Fall back to computed then uncomputed css if necessary
-		val = curCSS( elem, name, styles );
-		if ( val < 0 || val == null ) {
-			val = elem.style[ name ];
-		}
+	// Support: IE8 only
+	// Check if we can trust getAttribute("value")
+	input = document.createElement( "input" );
+	input.setAttribute( "value", "" );
+	support.input = input.getAttribute( "value" ) === "";
 
-		// Computed unit is not pixels. Stop here and return.
-		if ( rnumnonpx.test(val) ) {
-			return val;
-		}
+	// Check if an input maintains its value after becoming a radio
+	input.value = "t";
+	input.setAttribute( "type", "radio" );
+	support.radioValue = input.value === "t";
+})();
 
-		// we need the check for style in case a browser which returns unreliable values
-		// for getComputedStyle silently falls back to the reliable elem.style
-		valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
 
-		// Normalize "", auto, and prepare for extra
-		val = parseFloat( val ) || 0;
-	}
+var rreturn = /\r/g;
 
-	// use the active box-sizing model to add/subtract irrelevant styles
-	return ( val +
-		augmentWidthOrHeight(
-			elem,
-			name,
-			extra || ( isBorderBox ? "border" : "content" ),
-			valueIsBorderBox,
-			styles
-		)
-	) + "px";
-}
+jQuery.fn.extend({
+	val: function( value ) {
+		var hooks, ret, isFunction,
+			elem = this[0];
 
-// Try to determine the default display value of an element
-function css_defaultDisplay( nodeName ) {
-	var doc = document,
-		display = elemdisplay[ nodeName ];
+		if ( !arguments.length ) {
+			if ( elem ) {
+				hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
 
-	if ( !display ) {
-		display = actualDisplay( nodeName, doc );
+				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+					return ret;
+				}
 
-		// If the simple way fails, read from inside an iframe
-		if ( display === "none" || !display ) {
-			// Use the already-created iframe if possible
-			iframe = ( iframe ||
-				jQuery("<iframe frameborder='0' width='0' height='0'/>")
-				.css( "cssText", "display:block !important" )
-			).appendTo( doc.documentElement );
+				ret = elem.value;
 
-			// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
-			doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
-			doc.write("<!doctype html><html><body>");
-			doc.close();
+				return typeof ret === "string" ?
+					// handle most common string cases
+					ret.replace(rreturn, "") :
+					// handle cases where value is null/undef or number
+					ret == null ? "" : ret;
+			}
 
-			display = actualDisplay( nodeName, doc );
-			iframe.detach();
+			return;
 		}
 
-		// Store the correct default display
-		elemdisplay[ nodeName ] = display;
-	}
+		isFunction = jQuery.isFunction( value );
+
+		return this.each(function( i ) {
+			var val;
 
-	return display;
-}
+			if ( this.nodeType !== 1 ) {
+				return;
+			}
 
-// Called ONLY from within css_defaultDisplay
-function actualDisplay( name, doc ) {
-	var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
-		display = jQuery.css( elem[0], "display" );
-	elem.remove();
-	return display;
-}
+			if ( isFunction ) {
+				val = value.call( this, i, jQuery( this ).val() );
+			} else {
+				val = value;
+			}
 
-jQuery.each([ "height", "width" ], function( i, name ) {
-	jQuery.cssHooks[ name ] = {
-		get: function( elem, computed, extra ) {
-			if ( computed ) {
-				// certain elements can have dimension info if we invisibly show them
-				// however, it must have a current display style that would benefit from this
-				return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
-					jQuery.swap( elem, cssShow, function() {
-						return getWidthOrHeight( elem, name, extra );
-					}) :
-					getWidthOrHeight( elem, name, extra );
+			// Treat null/undefined as ""; convert numbers to string
+			if ( val == null ) {
+				val = "";
+			} else if ( typeof val === "number" ) {
+				val += "";
+			} else if ( jQuery.isArray( val ) ) {
+				val = jQuery.map( val, function( value ) {
+					return value == null ? "" : value + "";
+				});
 			}
-		},
 
-		set: function( elem, value, extra ) {
-			var styles = extra && getStyles( elem );
-			return setPositiveNumber( elem, value, extra ?
-				augmentWidthOrHeight(
-					elem,
-					name,
-					extra,
-					jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
-					styles
-				) : 0
-			);
-		}
-	};
+			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+			// If set returns undefined, fall back to normal setting
+			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+				this.value = val;
+			}
+		});
+	}
 });
 
-if ( !jQuery.support.opacity ) {
-	jQuery.cssHooks.opacity = {
-		get: function( elem, computed ) {
-			// IE uses filters for opacity
-			return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
-				( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
-				computed ? "1" : "";
+jQuery.extend({
+	valHooks: {
+		option: {
+			get: function( elem ) {
+				var val = jQuery.find.attr( elem, "value" );
+				return val != null ?
+					val :
+					// Support: IE10-11+
+					// option.text throws exceptions (#14686, #14858)
+					jQuery.trim( jQuery.text( elem ) );
+			}
 		},
+		select: {
+			get: function( elem ) {
+				var value, option,
+					options = elem.options,
+					index = elem.selectedIndex,
+					one = elem.type === "select-one" || index < 0,
+					values = one ? null : [],
+					max = one ? index + 1 : options.length,
+					i = index < 0 ?
+						max :
+						one ? index : 0;
 
-		set: function( elem, value ) {
-			var style = elem.style,
-				currentStyle = elem.currentStyle,
-				opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
-				filter = currentStyle && currentStyle.filter || style.filter || "";
+				// Loop through all the selected options
+				for ( ; i < max; i++ ) {
+					option = options[ i ];
 
-			// IE has trouble with opacity if it does not have layout
-			// Force it by setting the zoom level
-			style.zoom = 1;
+					// oldIE doesn't update selected after form reset (#2551)
+					if ( ( option.selected || i === index ) &&
+							// Don't return options that are disabled or in a disabled optgroup
+							( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
+							( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
 
-			// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
-			// if value === "", then remove inline opacity #12685
-			if ( ( value >= 1 || value === "" ) &&
-					jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
-					style.removeAttribute ) {
+						// Get the specific value for the option
+						value = jQuery( option ).val();
 
-				// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
-				// if "filter:" is present at all, clearType is disabled, we want to avoid this
-				// style.removeAttribute is IE Only, but so apparently is this code path...
-				style.removeAttribute( "filter" );
+						// We don't need an array for one selects
+						if ( one ) {
+							return value;
+						}
 
-				// if there is no filter style applied in a css rule or unset inline opacity, we are done
-				if ( value === "" || currentStyle && !currentStyle.filter ) {
-					return;
+						// Multi-Selects return an array
+						values.push( value );
+					}
 				}
-			}
 
-			// otherwise, set new filter values
-			style.filter = ralpha.test( filter ) ?
-				filter.replace( ralpha, opacity ) :
-				filter + " " + opacity;
-		}
-	};
-}
+				return values;
+			},
 
-// These hooks cannot be added until DOM ready because the support test
-// for it is not run until after DOM ready
-jQuery(function() {
-	if ( !jQuery.support.reliableMarginRight ) {
-		jQuery.cssHooks.marginRight = {
-			get: function( elem, computed ) {
-				if ( computed ) {
-					// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-					// Work around by temporarily setting element display to inline-block
-					return jQuery.swap( elem, { "display": "inline-block" },
-						curCSS, [ elem, "marginRight" ] );
-				}
-			}
-		};
-	}
+			set: function( elem, value ) {
+				var optionSet, option,
+					options = elem.options,
+					values = jQuery.makeArray( value ),
+					i = options.length;
 
-	// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
-	// getComputedStyle returns percent when specified for top/left/bottom/right
-	// rather than make the css module depend on the offset module, we just check for it here
-	if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
-		jQuery.each( [ "top", "left" ], function( i, prop ) {
-			jQuery.cssHooks[ prop ] = {
-				get: function( elem, computed ) {
-					if ( computed ) {
-						computed = curCSS( elem, prop );
-						// if curCSS returns percentage, fallback to offset
-						return rnumnonpx.test( computed ) ?
-							jQuery( elem ).position()[ prop ] + "px" :
-							computed;
-					}
-				}
-			};
-		});
-	}
+				while ( i-- ) {
+					option = options[ i ];
 
-});
+					if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
 
-if ( jQuery.expr && jQuery.expr.filters ) {
-	jQuery.expr.filters.hidden = function( elem ) {
-		// Support: Opera <= 12.12
-		// Opera reports offsetWidths and offsetHeights less than zero on some elements
-		return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
-			(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
-	};
+						// Support: IE6
+						// When new option element is added to select box we need to
+						// force reflow of newly added node in order to workaround delay
+						// of initialization properties
+						try {
+							option.selected = optionSet = true;
 
-	jQuery.expr.filters.visible = function( elem ) {
-		return !jQuery.expr.filters.hidden( elem );
-	};
-}
+						} catch ( _ ) {
 
-// These hooks are used by animate to expand properties
-jQuery.each({
-	margin: "",
-	padding: "",
-	border: "Width"
-}, function( prefix, suffix ) {
-	jQuery.cssHooks[ prefix + suffix ] = {
-		expand: function( value ) {
-			var i = 0,
-				expanded = {},
+							// Will be executed only in IE6
+							option.scrollHeight;
+						}
 
-				// assumes a single number if not a string
-				parts = typeof value === "string" ? value.split(" ") : [ value ];
+					} else {
+						option.selected = false;
+					}
+				}
 
-			for ( ; i < 4; i++ ) {
-				expanded[ prefix + cssExpand[ i ] + suffix ] =
-					parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+				// Force browsers to behave consistently when non-matching value is set
+				if ( !optionSet ) {
+					elem.selectedIndex = -1;
+				}
+
+				return options;
 			}
+		}
+	}
+});
 
-			return expanded;
+// Radios and checkboxes getter/setter
+jQuery.each([ "radio", "checkbox" ], function() {
+	jQuery.valHooks[ this ] = {
+		set: function( elem, value ) {
+			if ( jQuery.isArray( value ) ) {
+				return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+			}
 		}
 	};
-
-	if ( !rmargin.test( prefix ) ) {
-		jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+	if ( !support.checkOn ) {
+		jQuery.valHooks[ this ].get = function( elem ) {
+			// Support: Webkit
+			// "" is returned instead of "on" if a value isn't specified
+			return elem.getAttribute("value") === null ? "on" : elem.value;
+		};
 	}
 });
-var r20 = /%20/g,
-	rbracket = /\[\]$/,
-	rCRLF = /\r?\n/g,
-	rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
-	rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+
+
+
+var nodeHook, boolHook,
+	attrHandle = jQuery.expr.attrHandle,
+	ruseDefault = /^(?:checked|selected)$/i,
+	getSetAttribute = support.getSetAttribute,
+	getSetInput = support.input;
 
 jQuery.fn.extend({
-	serialize: function() {
-		return jQuery.param( this.serializeArray() );
+	attr: function( name, value ) {
+		return access( this, jQuery.attr, name, value, arguments.length > 1 );
 	},
-	serializeArray: function() {
-		return this.map(function(){
-			// Can add propHook for "elements" to filter or add form elements
-			var elements = jQuery.prop( this, "elements" );
-			return elements ? jQuery.makeArray( elements ) : this;
-		})
-		.filter(function(){
-			var type = this.type;
-			// Use .is(":disabled") so that fieldset[disabled] works
-			return this.name && !jQuery( this ).is( ":disabled" ) &&
-				rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
-				( this.checked || !manipulation_rcheckableType.test( type ) );
-		})
-		.map(function( i, elem ){
-			var val = jQuery( this ).val();
 
-			return val == null ?
-				null :
-				jQuery.isArray( val ) ?
-					jQuery.map( val, function( val ){
-						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-					}) :
-					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-		}).get();
+	removeAttr: function( name ) {
+		return this.each(function() {
+			jQuery.removeAttr( this, name );
+		});
 	}
 });
 
-//Serialize an array of form elements or a set of
-//key/values into a query string
-jQuery.param = function( a, traditional ) {
-	var prefix,
-		s = [],
-		add = function( key, value ) {
-			// If value is a function, invoke it and return its value
-			value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
-			s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
-		};
+jQuery.extend({
+	attr: function( elem, name, value ) {
+		var hooks, ret,
+			nType = elem.nodeType;
 
-	// Set traditional to true for jQuery <= 1.3.2 behavior.
-	if ( traditional === undefined ) {
-		traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
-	}
+		// don't get/set attributes on text, comment and attribute nodes
+		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+			return;
+		}
 
-	// If an array was passed in, assume that it is an array of form elements.
-	if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
-		// Serialize the form elements
-		jQuery.each( a, function() {
-			add( this.name, this.value );
-		});
+		// Fallback to prop when attributes are not supported
+		if ( typeof elem.getAttribute === strundefined ) {
+			return jQuery.prop( elem, name, value );
+		}
 
-	} else {
-		// If traditional, encode the "old" way (the way 1.3.2 or older
-		// did it), otherwise encode params recursively.
-		for ( prefix in a ) {
-			buildParams( prefix, a[ prefix ], traditional, add );
+		// All attributes are lowercase
+		// Grab necessary hook if one is defined
+		if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+			name = name.toLowerCase();
+			hooks = jQuery.attrHooks[ name ] ||
+				( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
 		}
-	}
 
-	// Return the resulting serialization
-	return s.join( "&" ).replace( r20, "+" );
-};
+		if ( value !== undefined ) {
 
-function buildParams( prefix, obj, traditional, add ) {
-	var name;
+			if ( value === null ) {
+				jQuery.removeAttr( elem, name );
 
-	if ( jQuery.isArray( obj ) ) {
-		// Serialize array item.
-		jQuery.each( obj, function( i, v ) {
-			if ( traditional || rbracket.test( prefix ) ) {
-				// Treat each array item as a scalar.
-				add( prefix, v );
+			} else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+				return ret;
 
 			} else {
-				// Item is non-scalar (array or object), encode its numeric index.
-				buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+				elem.setAttribute( name, value + "" );
+				return value;
 			}
-		});
 
-	} else if ( !traditional && jQuery.type( obj ) === "object" ) {
-		// Serialize object item.
-		for ( name in obj ) {
-			buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+		} else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+			return ret;
+
+		} else {
+			ret = jQuery.find.attr( elem, name );
+
+			// Non-existent attributes return null, we normalize to undefined
+			return ret == null ?
+				undefined :
+				ret;
 		}
+	},
 
-	} else {
-		// Serialize scalar item.
-		add( prefix, obj );
-	}
-}
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
-	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
-	"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
+	removeAttr: function( elem, value ) {
+		var name, propName,
+			i = 0,
+			attrNames = value && value.match( rnotwhite );
 
-	// Handle event binding
-	jQuery.fn[ name ] = function( data, fn ) {
-		return arguments.length > 0 ?
-			this.on( name, null, data, fn ) :
-			this.trigger( name );
-	};
-});
+		if ( attrNames && elem.nodeType === 1 ) {
+			while ( (name = attrNames[i++]) ) {
+				propName = jQuery.propFix[ name ] || name;
 
-jQuery.fn.extend({
-	hover: function( fnOver, fnOut ) {
-		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
-	},
+				// Boolean attributes get special treatment (#10870)
+				if ( jQuery.expr.match.bool.test( name ) ) {
+					// Set corresponding property to false
+					if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+						elem[ propName ] = false;
+					// Support: IE<9
+					// Also clear defaultChecked/defaultSelected (if appropriate)
+					} else {
+						elem[ jQuery.camelCase( "default-" + name ) ] =
+							elem[ propName ] = false;
+					}
 
-	bind: function( types, data, fn ) {
-		return this.on( types, null, data, fn );
-	},
-	unbind: function( types, fn ) {
-		return this.off( types, null, fn );
-	},
+				// See #9699 for explanation of this approach (setting first, then removal)
+				} else {
+					jQuery.attr( elem, name, "" );
+				}
 
-	delegate: function( selector, types, data, fn ) {
-		return this.on( types, selector, data, fn );
+				elem.removeAttribute( getSetAttribute ? name : propName );
+			}
+		}
 	},
-	undelegate: function( selector, types, fn ) {
-		// ( namespace ) or ( selector, types [, fn] )
-		return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
+
+	attrHooks: {
+		type: {
+			set: function( elem, value ) {
+				if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+					// Setting the type on a radio button after the value resets the value in IE6-9
+					// Reset value to default in case type is set after value during creation
+					var val = elem.value;
+					elem.setAttribute( "type", value );
+					if ( val ) {
+						elem.value = val;
+					}
+					return value;
+				}
+			}
+		}
 	}
 });
-var
-	// Document location
-	ajaxLocParts,
-	ajaxLocation,
-	ajax_nonce = jQuery.now(),
 
-	ajax_rquery = /\?/,
-	rhash = /#.*$/,
-	rts = /([?&])_=[^&]*/,
-	rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
-	// #7653, #8125, #8152: local protocol detection
-	rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
-	rnoContent = /^(?:GET|HEAD)$/,
-	rprotocol = /^\/\//,
-	rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
+// Hook for boolean attributes
+boolHook = {
+	set: function( elem, value, name ) {
+		if ( value === false ) {
+			// Remove boolean attributes when set to false
+			jQuery.removeAttr( elem, name );
+		} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+			// IE<8 needs the *property* name
+			elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
 
-	// Keep a copy of the old load method
-	_load = jQuery.fn.load,
+		// Use defaultChecked and defaultSelected for oldIE
+		} else {
+			elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
+		}
 
-	/* Prefilters
-	 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
-	 * 2) These are called:
-	 *    - BEFORE asking for a transport
-	 *    - AFTER param serialization (s.data is a string if s.processData is true)
-	 * 3) key is the dataType
-	 * 4) the catchall symbol "*" can be used
-	 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
-	 */
-	prefilters = {},
+		return name;
+	}
+};
 
-	/* Transports bindings
-	 * 1) key is the dataType
-	 * 2) the catchall symbol "*" can be used
-	 * 3) selection will start with transport dataType and THEN go to "*" if needed
-	 */
-	transports = {},
+// Retrieve booleans specially
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
 
-	// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
-	allTypes = "*/".concat("*");
+	var getter = attrHandle[ name ] || jQuery.find.attr;
 
-// #8138, IE may throw an exception when accessing
-// a field from window.location if document.domain has been set
-try {
-	ajaxLocation = location.href;
-} catch( e ) {
-	// Use the href attribute of an A element
-	// since IE will modify it given document.location
-	ajaxLocation = document.createElement( "a" );
-	ajaxLocation.href = "";
-	ajaxLocation = ajaxLocation.href;
+	attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
+		function( elem, name, isXML ) {
+			var ret, handle;
+			if ( !isXML ) {
+				// Avoid an infinite loop by temporarily removing this function from the getter
+				handle = attrHandle[ name ];
+				attrHandle[ name ] = ret;
+				ret = getter( elem, name, isXML ) != null ?
+					name.toLowerCase() :
+					null;
+				attrHandle[ name ] = handle;
+			}
+			return ret;
+		} :
+		function( elem, name, isXML ) {
+			if ( !isXML ) {
+				return elem[ jQuery.camelCase( "default-" + name ) ] ?
+					name.toLowerCase() :
+					null;
+			}
+		};
+});
+
+// fix oldIE attroperties
+if ( !getSetInput || !getSetAttribute ) {
+	jQuery.attrHooks.value = {
+		set: function( elem, value, name ) {
+			if ( jQuery.nodeName( elem, "input" ) ) {
+				// Does not return so that setAttribute is also used
+				elem.defaultValue = value;
+			} else {
+				// Use nodeHook if defined (#1954); otherwise setAttribute is fine
+				return nodeHook && nodeHook.set( elem, value, name );
+			}
+		}
+	};
 }
 
-// Segment location into parts
-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
 
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
+	// Use this for any attribute in IE6/7
+	// This fixes almost every IE6/7 issue
+	nodeHook = {
+		set: function( elem, value, name ) {
+			// Set the existing or create a new attribute node
+			var ret = elem.getAttributeNode( name );
+			if ( !ret ) {
+				elem.setAttributeNode(
+					(ret = elem.ownerDocument.createAttribute( name ))
+				);
+			}
 
-	// dataTypeExpression is optional and defaults to "*"
-	return function( dataTypeExpression, func ) {
+			ret.value = value += "";
 
-		if ( typeof dataTypeExpression !== "string" ) {
-			func = dataTypeExpression;
-			dataTypeExpression = "*";
+			// Break association with cloned elements by also using setAttribute (#9646)
+			if ( name === "value" || value === elem.getAttribute( name ) ) {
+				return value;
+			}
 		}
+	};
 
-		var dataType,
-			i = 0,
-			dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
+	// Some attributes are constructed with empty-string values when not defined
+	attrHandle.id = attrHandle.name = attrHandle.coords =
+		function( elem, name, isXML ) {
+			var ret;
+			if ( !isXML ) {
+				return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
+					ret.value :
+					null;
+			}
+		};
 
-		if ( jQuery.isFunction( func ) ) {
-			// For each dataType in the dataTypeExpression
-			while ( (dataType = dataTypes[i++]) ) {
-				// Prepend if requested
-				if ( dataType[0] === "+" ) {
-					dataType = dataType.slice( 1 ) || "*";
-					(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
+	// Fixing value retrieval on a button requires this module
+	jQuery.valHooks.button = {
+		get: function( elem, name ) {
+			var ret = elem.getAttributeNode( name );
+			if ( ret && ret.specified ) {
+				return ret.value;
+			}
+		},
+		set: nodeHook.set
+	};
 
-				// Otherwise append
-				} else {
-					(structure[ dataType ] = structure[ dataType ] || []).push( func );
+	// Set contenteditable to false on removals(#10429)
+	// Setting to empty string throws an error as an invalid value
+	jQuery.attrHooks.contenteditable = {
+		set: function( elem, value, name ) {
+			nodeHook.set( elem, value === "" ? false : value, name );
+		}
+	};
+
+	// Set width and height to auto instead of 0 on empty string( Bug #8150 )
+	// This is for removals
+	jQuery.each([ "width", "height" ], function( i, name ) {
+		jQuery.attrHooks[ name ] = {
+			set: function( elem, value ) {
+				if ( value === "" ) {
+					elem.setAttribute( name, "auto" );
+					return value;
 				}
 			}
+		};
+	});
+}
+
+if ( !support.style ) {
+	jQuery.attrHooks.style = {
+		get: function( elem ) {
+			// Return undefined in the case of empty string
+			// Note: IE uppercases css property names, but if we were to .toLowerCase()
+			// .cssText, that would destroy case senstitivity in URL's, like in "background"
+			return elem.style.cssText || undefined;
+		},
+		set: function( elem, value ) {
+			return ( elem.style.cssText = value + "" );
 		}
 	};
 }
 
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
 
-	var inspected = {},
-		seekingTransport = ( structure === transports );
 
-	function inspect( dataType ) {
-		var selected;
-		inspected[ dataType ] = true;
-		jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
-			var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
-			if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
-				options.dataTypes.unshift( dataTypeOrTransport );
-				inspect( dataTypeOrTransport );
-				return false;
-			} else if ( seekingTransport ) {
-				return !( selected = dataTypeOrTransport );
-			}
+
+var rfocusable = /^(?:input|select|textarea|button|object)$/i,
+	rclickable = /^(?:a|area)$/i;
+
+jQuery.fn.extend({
+	prop: function( name, value ) {
+		return access( this, jQuery.prop, name, value, arguments.length > 1 );
+	},
+
+	removeProp: function( name ) {
+		name = jQuery.propFix[ name ] || name;
+		return this.each(function() {
+			// try/catch handles cases where IE balks (such as removing a property on window)
+			try {
+				this[ name ] = undefined;
+				delete this[ name ];
+			} catch( e ) {}
 		});
-		return selected;
 	}
+});
 
-	return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
-}
+jQuery.extend({
+	propFix: {
+		"for": "htmlFor",
+		"class": "className"
+	},
 
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
-	var deep, key,
-		flatOptions = jQuery.ajaxSettings.flatOptions || {};
+	prop: function( elem, name, value ) {
+		var ret, hooks, notxml,
+			nType = elem.nodeType;
 
-	for ( key in src ) {
-		if ( src[ key ] !== undefined ) {
-			( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
+		// don't get/set properties on text, comment and attribute nodes
+		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+			return;
 		}
-	}
-	if ( deep ) {
-		jQuery.extend( true, target, deep );
-	}
 
-	return target;
-}
+		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
 
-jQuery.fn.load = function( url, params, callback ) {
-	if ( typeof url !== "string" && _load ) {
-		return _load.apply( this, arguments );
-	}
+		if ( notxml ) {
+			// Fix name and attach hooks
+			name = jQuery.propFix[ name ] || name;
+			hooks = jQuery.propHooks[ name ];
+		}
 
-	var selector, response, type,
-		self = this,
-		off = url.indexOf(" ");
+		if ( value !== undefined ) {
+			return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
+				ret :
+				( elem[ name ] = value );
 
-	if ( off >= 0 ) {
-		selector = url.slice( off, url.length );
-		url = url.slice( 0, off );
+		} else {
+			return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
+				ret :
+				elem[ name ];
+		}
+	},
+
+	propHooks: {
+		tabIndex: {
+			get: function( elem ) {
+				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+				// Use proper attribute retrieval(#12072)
+				var tabindex = jQuery.find.attr( elem, "tabindex" );
+
+				return tabindex ?
+					parseInt( tabindex, 10 ) :
+					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+						0 :
+						-1;
+			}
+		}
 	}
+});
 
-	// If it's a function
-	if ( jQuery.isFunction( params ) ) {
+// Some attributes require a special call on IE
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !support.hrefNormalized ) {
+	// href/src property should get the full normalized URL (#10299/#12915)
+	jQuery.each([ "href", "src" ], function( i, name ) {
+		jQuery.propHooks[ name ] = {
+			get: function( elem ) {
+				return elem.getAttribute( name, 4 );
+			}
+		};
+	});
+}
 
-		// We assume that it's the callback
-		callback = params;
-		params = undefined;
+// Support: Safari, IE9+
+// mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !support.optSelected ) {
+	jQuery.propHooks.selected = {
+		get: function( elem ) {
+			var parent = elem.parentNode;
 
-	// Otherwise, build a param string
-	} else if ( params && typeof params === "object" ) {
-		type = "POST";
-	}
+			if ( parent ) {
+				parent.selectedIndex;
 
-	// If we have elements to modify, make the request
-	if ( self.length > 0 ) {
-		jQuery.ajax({
-			url: url,
+				// Make sure that it also works with optgroups, see #5701
+				if ( parent.parentNode ) {
+					parent.parentNode.selectedIndex;
+				}
+			}
+			return null;
+		}
+	};
+}
 
-			// if "type" variable is undefined, then "GET" method will be used
-			type: type,
-			dataType: "html",
-			data: params
-		}).done(function( responseText ) {
+jQuery.each([
+	"tabIndex",
+	"readOnly",
+	"maxLength",
+	"cellSpacing",
+	"cellPadding",
+	"rowSpan",
+	"colSpan",
+	"useMap",
+	"frameBorder",
+	"contentEditable"
+], function() {
+	jQuery.propFix[ this.toLowerCase() ] = this;
+});
 
-			// Save response for use in complete callback
-			response = arguments;
+// IE6/7 call enctype encoding
+if ( !support.enctype ) {
+	jQuery.propFix.enctype = "encoding";
+}
 
-			self.html( selector ?
 
-				// If a selector was specified, locate the right elements in a dummy div
-				// Exclude scripts to avoid IE 'Permission Denied' errors
-				jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
 
-				// Otherwise use the full result
-				responseText );
 
-		}).complete( callback && function( jqXHR, status ) {
-			self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
-		});
-	}
+var rclass = /[\t\r\n\f]/g;
 
-	return this;
-};
+jQuery.fn.extend({
+	addClass: function( value ) {
+		var classes, elem, cur, clazz, j, finalValue,
+			i = 0,
+			len = this.length,
+			proceed = typeof value === "string" && value;
 
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
-	jQuery.fn[ type ] = function( fn ){
-		return this.on( type, fn );
-	};
-});
+		if ( jQuery.isFunction( value ) ) {
+			return this.each(function( j ) {
+				jQuery( this ).addClass( value.call( this, j, this.className ) );
+			});
+		}
 
-jQuery.extend({
+		if ( proceed ) {
+			// The disjunction here is for better compressibility (see removeClass)
+			classes = ( value || "" ).match( rnotwhite ) || [];
 
-	// Counter for holding the number of active queries
-	active: 0,
+			for ( ; i < len; i++ ) {
+				elem = this[ i ];
+				cur = elem.nodeType === 1 && ( elem.className ?
+					( " " + elem.className + " " ).replace( rclass, " " ) :
+					" "
+				);
 
-	// Last-Modified header cache for next request
-	lastModified: {},
-	etag: {},
+				if ( cur ) {
+					j = 0;
+					while ( (clazz = classes[j++]) ) {
+						if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+							cur += clazz + " ";
+						}
+					}
 
-	ajaxSettings: {
-		url: ajaxLocation,
-		type: "GET",
-		isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
-		global: true,
-		processData: true,
-		async: true,
-		contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-		/*
-		timeout: 0,
-		data: null,
-		dataType: null,
-		username: null,
-		password: null,
-		cache: null,
-		throws: false,
-		traditional: false,
-		headers: {},
-		*/
+					// only assign if different to avoid unneeded rendering.
+					finalValue = jQuery.trim( cur );
+					if ( elem.className !== finalValue ) {
+						elem.className = finalValue;
+					}
+				}
+			}
+		}
 
-		accepts: {
-			"*": allTypes,
-			text: "text/plain",
-			html: "text/html",
-			xml: "application/xml, text/xml",
-			json: "application/json, text/javascript"
-		},
+		return this;
+	},
 
-		contents: {
-			xml: /xml/,
-			html: /html/,
-			json: /json/
-		},
+	removeClass: function( value ) {
+		var classes, elem, cur, clazz, j, finalValue,
+			i = 0,
+			len = this.length,
+			proceed = arguments.length === 0 || typeof value === "string" && value;
 
-		responseFields: {
-			xml: "responseXML",
-			text: "responseText",
-			json: "responseJSON"
-		},
+		if ( jQuery.isFunction( value ) ) {
+			return this.each(function( j ) {
+				jQuery( this ).removeClass( value.call( this, j, this.className ) );
+			});
+		}
+		if ( proceed ) {
+			classes = ( value || "" ).match( rnotwhite ) || [];
 
-		// Data converters
-		// Keys separate source (or catchall "*") and destination types with a single space
-		converters: {
+			for ( ; i < len; i++ ) {
+				elem = this[ i ];
+				// This expression is here for better compressibility (see addClass)
+				cur = elem.nodeType === 1 && ( elem.className ?
+					( " " + elem.className + " " ).replace( rclass, " " ) :
+					""
+				);
 
-			// Convert anything to text
-			"* text": String,
+				if ( cur ) {
+					j = 0;
+					while ( (clazz = classes[j++]) ) {
+						// Remove *all* instances
+						while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
+							cur = cur.replace( " " + clazz + " ", " " );
+						}
+					}
 
-			// Text to html (true = no transformation)
-			"text html": true,
+					// only assign if different to avoid unneeded rendering.
+					finalValue = value ? jQuery.trim( cur ) : "";
+					if ( elem.className !== finalValue ) {
+						elem.className = finalValue;
+					}
+				}
+			}
+		}
 
-			// Evaluate text as a json expression
-			"text json": jQuery.parseJSON,
+		return this;
+	},
 
-			// Parse text as xml
-			"text xml": jQuery.parseXML
-		},
+	toggleClass: function( value, stateVal ) {
+		var type = typeof value;
 
-		// For options that shouldn't be deep extended:
-		// you can add your own custom options here if
-		// and when you create one that shouldn't be
-		// deep extended (see ajaxExtend)
-		flatOptions: {
-			url: true,
-			context: true
+		if ( typeof stateVal === "boolean" && type === "string" ) {
+			return stateVal ? this.addClass( value ) : this.removeClass( value );
 		}
-	},
 
-	// Creates a full fledged settings object into target
-	// with both ajaxSettings and settings fields.
-	// If target is omitted, writes into ajaxSettings.
-	ajaxSetup: function( target, settings ) {
-		return settings ?
+		if ( jQuery.isFunction( value ) ) {
+			return this.each(function( i ) {
+				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+			});
+		}
 
-			// Building a settings object
-			ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+		return this.each(function() {
+			if ( type === "string" ) {
+				// toggle individual class names
+				var className,
+					i = 0,
+					self = jQuery( this ),
+					classNames = value.match( rnotwhite ) || [];
 
-			// Extending ajaxSettings
-			ajaxExtend( jQuery.ajaxSettings, target );
-	},
+				while ( (className = classNames[ i++ ]) ) {
+					// check each className given, space separated list
+					if ( self.hasClass( className ) ) {
+						self.removeClass( className );
+					} else {
+						self.addClass( className );
+					}
+				}
 
-	ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
-	ajaxTransport: addToPrefiltersOrTransports( transports ),
+			// Toggle whole class name
+			} else if ( type === strundefined || type === "boolean" ) {
+				if ( this.className ) {
+					// store className if set
+					jQuery._data( this, "__className__", this.className );
+				}
 
-	// Main method
-	ajax: function( url, options ) {
+				// If the element has a class name or if we're passed "false",
+				// then remove the whole classname (if there was one, the above saved it).
+				// Otherwise bring back whatever was previously saved (if anything),
+				// falling back to the empty string if nothing was stored.
+				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+			}
+		});
+	},
 
-		// If url is an object, simulate pre-1.5 signature
-		if ( typeof url === "object" ) {
-			options = url;
-			url = undefined;
+	hasClass: function( selector ) {
+		var className = " " + selector + " ",
+			i = 0,
+			l = this.length;
+		for ( ; i < l; i++ ) {
+			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
+				return true;
+			}
 		}
 
-		// Force options to be an object
-		options = options || {};
+		return false;
+	}
+});
 
-		var // Cross-domain detection vars
-			parts,
-			// Loop variable
-			i,
-			// URL without anti-cache param
-			cacheURL,
-			// Response headers as string
-			responseHeadersString,
-			// timeout handle
-			timeoutTimer,
 
-			// To know if global events are to be dispatched
-			fireGlobals,
 
-			transport,
-			// Response headers
-			responseHeaders,
-			// Create the final options object
-			s = jQuery.ajaxSetup( {}, options ),
-			// Callbacks context
-			callbackContext = s.context || s,
-			// Context for global events is callbackContext if it is a DOM node or jQuery collection
-			globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
-				jQuery( callbackContext ) :
-				jQuery.event,
-			// Deferreds
-			deferred = jQuery.Deferred(),
-			completeDeferred = jQuery.Callbacks("once memory"),
-			// Status-dependent callbacks
-			statusCode = s.statusCode || {},
-			// Headers (they are sent all at once)
-			requestHeaders = {},
-			requestHeadersNames = {},
-			// The jqXHR state
-			state = 0,
-			// Default abort message
-			strAbort = "canceled",
-			// Fake xhr
-			jqXHR = {
-				readyState: 0,
 
-				// Builds headers hashtable if needed
-				getResponseHeader: function( key ) {
-					var match;
-					if ( state === 2 ) {
-						if ( !responseHeaders ) {
-							responseHeaders = {};
-							while ( (match = rheaders.exec( responseHeadersString )) ) {
-								responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
-							}
-						}
-						match = responseHeaders[ key.toLowerCase() ];
-					}
-					return match == null ? null : match;
-				},
+// Return jQuery for attributes-only inclusion
 
-				// Raw string
-				getAllResponseHeaders: function() {
-					return state === 2 ? responseHeadersString : null;
-				},
 
-				// Caches the header
-				setRequestHeader: function( name, value ) {
-					var lname = name.toLowerCase();
-					if ( !state ) {
-						name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
-						requestHeaders[ name ] = value;
-					}
-					return this;
-				},
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+	"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
 
-				// Overrides response content-type header
-				overrideMimeType: function( type ) {
-					if ( !state ) {
-						s.mimeType = type;
-					}
-					return this;
-				},
+	// Handle event binding
+	jQuery.fn[ name ] = function( data, fn ) {
+		return arguments.length > 0 ?
+			this.on( name, null, data, fn ) :
+			this.trigger( name );
+	};
+});
+
+jQuery.fn.extend({
+	hover: function( fnOver, fnOut ) {
+		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+	},
+
+	bind: function( types, data, fn ) {
+		return this.on( types, null, data, fn );
+	},
+	unbind: function( types, fn ) {
+		return this.off( types, null, fn );
+	},
+
+	delegate: function( selector, types, data, fn ) {
+		return this.on( types, selector, data, fn );
+	},
+	undelegate: function( selector, types, fn ) {
+		// ( namespace ) or ( selector, types [, fn] )
+		return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
+	}
+});
 
-				// Status-dependent callbacks
-				statusCode: function( map ) {
-					var code;
-					if ( map ) {
-						if ( state < 2 ) {
-							for ( code in map ) {
-								// Lazy-add the new callback in a way that preserves old ones
-								statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
-							}
-						} else {
-							// Execute the appropriate callbacks
-							jqXHR.always( map[ jqXHR.status ] );
-						}
-					}
-					return this;
-				},
 
-				// Cancel the request
-				abort: function( statusText ) {
-					var finalText = statusText || strAbort;
-					if ( transport ) {
-						transport.abort( finalText );
-					}
-					done( 0, finalText );
-					return this;
-				}
-			};
+var nonce = jQuery.now();
 
-		// Attach deferreds
-		deferred.promise( jqXHR ).complete = completeDeferred.add;
-		jqXHR.success = jqXHR.done;
-		jqXHR.error = jqXHR.fail;
+var rquery = (/\?/);
 
-		// Remove hash character (#7531: and string promotion)
-		// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
-		// Handle falsy url in the settings object (#10093: consistency with old signature)
-		// We also use the url parameter if available
-		s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
 
-		// Alias method option to type as per ticket #12004
-		s.type = options.method || options.type || s.method || s.type;
 
-		// Extract dataTypes list
-		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
+var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
 
-		// A cross-domain request is in order when we have a protocol:host:port mismatch
-		if ( s.crossDomain == null ) {
-			parts = rurl.exec( s.url.toLowerCase() );
-			s.crossDomain = !!( parts &&
-				( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
-					( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
-						( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
-			);
+jQuery.parseJSON = function( data ) {
+	// Attempt to parse using the native JSON parser first
+	if ( window.JSON && window.JSON.parse ) {
+		// Support: Android 2.3
+		// Workaround failure to string-cast null input
+		return window.JSON.parse( data + "" );
+	}
+
+	var requireNonComma,
+		depth = null,
+		str = jQuery.trim( data + "" );
+
+	// Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
+	// after removing valid tokens
+	return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
+
+		// Force termination if we see a misplaced comma
+		if ( requireNonComma && comma ) {
+			depth = 0;
 		}
 
-		// Convert data if not already a string
-		if ( s.data && s.processData && typeof s.data !== "string" ) {
-			s.data = jQuery.param( s.data, s.traditional );
+		// Perform no more replacements after returning to outermost depth
+		if ( depth === 0 ) {
+			return token;
 		}
 
-		// Apply prefilters
-		inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+		// Commas must not follow "[", "{", or ","
+		requireNonComma = open || comma;
 
-		// If request was aborted inside a prefilter, stop there
-		if ( state === 2 ) {
-			return jqXHR;
-		}
+		// Determine new depth
+		// array/object open ("[" or "{"): depth += true - false (increment)
+		// array/object close ("]" or "}"): depth += false - true (decrement)
+		// other cases ("," or primitive): depth += true - true (numeric cast)
+		depth += !close - !open;
 
-		// We can fire global events as of now if asked to
-		fireGlobals = s.global;
+		// Remove this token
+		return "";
+	}) ) ?
+		( Function( "return " + str ) )() :
+		jQuery.error( "Invalid JSON: " + data );
+};
 
-		// Watch for a new set of requests
-		if ( fireGlobals && jQuery.active++ === 0 ) {
-			jQuery.event.trigger("ajaxStart");
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+	var xml, tmp;
+	if ( !data || typeof data !== "string" ) {
+		return null;
+	}
+	try {
+		if ( window.DOMParser ) { // Standard
+			tmp = new DOMParser();
+			xml = tmp.parseFromString( data, "text/xml" );
+		} else { // IE
+			xml = new ActiveXObject( "Microsoft.XMLDOM" );
+			xml.async = "false";
+			xml.loadXML( data );
 		}
+	} catch( e ) {
+		xml = undefined;
+	}
+	if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+		jQuery.error( "Invalid XML: " + data );
+	}
+	return xml;
+};
 
-		// Uppercase the type
-		s.type = s.type.toUpperCase();
 
-		// Determine if request has content
-		s.hasContent = !rnoContent.test( s.type );
+var
+	// Document location
+	ajaxLocParts,
+	ajaxLocation,
 
-		// Save the URL in case we're toying with the If-Modified-Since
-		// and/or If-None-Match header later on
-		cacheURL = s.url;
+	rhash = /#.*$/,
+	rts = /([?&])_=[^&]*/,
+	rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+	// #7653, #8125, #8152: local protocol detection
+	rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
+	rnoContent = /^(?:GET|HEAD)$/,
+	rprotocol = /^\/\//,
+	rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
 
-		// More options handling for requests with no content
-		if ( !s.hasContent ) {
+	/* Prefilters
+	 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+	 * 2) These are called:
+	 *    - BEFORE asking for a transport
+	 *    - AFTER param serialization (s.data is a string if s.processData is true)
+	 * 3) key is the dataType
+	 * 4) the catchall symbol "*" can be used
+	 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+	 */
+	prefilters = {},
 
-			// If data is available, append data to url
-			if ( s.data ) {
-				cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
-				// #9682: remove data so that it's not used in an eventual retry
-				delete s.data;
-			}
+	/* Transports bindings
+	 * 1) key is the dataType
+	 * 2) the catchall symbol "*" can be used
+	 * 3) selection will start with transport dataType and THEN go to "*" if needed
+	 */
+	transports = {},
 
-			// Add anti-cache in url if needed
-			if ( s.cache === false ) {
-				s.url = rts.test( cacheURL ) ?
+	// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+	allTypes = "*/".concat("*");
 
-					// If there is already a '_' parameter, set its value
-					cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+	ajaxLocation = location.href;
+} catch( e ) {
+	// Use the href attribute of an A element
+	// since IE will modify it given document.location
+	ajaxLocation = document.createElement( "a" );
+	ajaxLocation.href = "";
+	ajaxLocation = ajaxLocation.href;
+}
 
-					// Otherwise add one to the end
-					cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
-			}
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+	// dataTypeExpression is optional and defaults to "*"
+	return function( dataTypeExpression, func ) {
+
+		if ( typeof dataTypeExpression !== "string" ) {
+			func = dataTypeExpression;
+			dataTypeExpression = "*";
 		}
 
-		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-		if ( s.ifModified ) {
-			if ( jQuery.lastModified[ cacheURL ] ) {
-				jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+		var dataType,
+			i = 0,
+			dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
+
+		if ( jQuery.isFunction( func ) ) {
+			// For each dataType in the dataTypeExpression
+			while ( (dataType = dataTypes[i++]) ) {
+				// Prepend if requested
+				if ( dataType.charAt( 0 ) === "+" ) {
+					dataType = dataType.slice( 1 ) || "*";
+					(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
+
+				// Otherwise append
+				} else {
+					(structure[ dataType ] = structure[ dataType ] || []).push( func );
+				}
 			}
-			if ( jQuery.etag[ cacheURL ] ) {
-				jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+		}
+	};
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+
+	var inspected = {},
+		seekingTransport = ( structure === transports );
+
+	function inspect( dataType ) {
+		var selected;
+		inspected[ dataType ] = true;
+		jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
+			var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
+			if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+				options.dataTypes.unshift( dataTypeOrTransport );
+				inspect( dataTypeOrTransport );
+				return false;
+			} else if ( seekingTransport ) {
+				return !( selected = dataTypeOrTransport );
 			}
+		});
+		return selected;
+	}
+
+	return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+	var deep, key,
+		flatOptions = jQuery.ajaxSettings.flatOptions || {};
+
+	for ( key in src ) {
+		if ( src[ key ] !== undefined ) {
+			( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
 		}
+	}
+	if ( deep ) {
+		jQuery.extend( true, target, deep );
+	}
 
-		// Set the correct header, if data is being sent
-		if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
-			jqXHR.setRequestHeader( "Content-Type", s.contentType );
+	return target;
+}
+
+/* Handles responses to an ajax request:
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+	var firstDataType, ct, finalDataType, type,
+		contents = s.contents,
+		dataTypes = s.dataTypes;
+
+	// Remove auto dataType and get content-type in the process
+	while ( dataTypes[ 0 ] === "*" ) {
+		dataTypes.shift();
+		if ( ct === undefined ) {
+			ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
 		}
+	}
 
-		// Set the Accepts header for the server, depending on the dataType
-		jqXHR.setRequestHeader(
-			"Accept",
-			s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
-				s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
-				s.accepts[ "*" ]
-		);
+	// Check if we're dealing with a known content-type
+	if ( ct ) {
+		for ( type in contents ) {
+			if ( contents[ type ] && contents[ type ].test( ct ) ) {
+				dataTypes.unshift( type );
+				break;
+			}
+		}
+	}
 
-		// Check for headers option
-		for ( i in s.headers ) {
-			jqXHR.setRequestHeader( i, s.headers[ i ] );
+	// Check to see if we have a response for the expected dataType
+	if ( dataTypes[ 0 ] in responses ) {
+		finalDataType = dataTypes[ 0 ];
+	} else {
+		// Try convertible dataTypes
+		for ( type in responses ) {
+			if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+				finalDataType = type;
+				break;
+			}
+			if ( !firstDataType ) {
+				firstDataType = type;
+			}
 		}
+		// Or just use first one
+		finalDataType = finalDataType || firstDataType;
+	}
 
-		// Allow custom headers/mimetypes and early abort
-		if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
-			// Abort if not done already and return
-			return jqXHR.abort();
+	// If we found a dataType
+	// We add the dataType to the list if needed
+	// and return the corresponding response
+	if ( finalDataType ) {
+		if ( finalDataType !== dataTypes[ 0 ] ) {
+			dataTypes.unshift( finalDataType );
 		}
+		return responses[ finalDataType ];
+	}
+}
 
-		// aborting is no longer a cancellation
-		strAbort = "abort";
+/* Chain conversions given the request and the original response
+ * Also sets the responseXXX fields on the jqXHR instance
+ */
+function ajaxConvert( s, response, jqXHR, isSuccess ) {
+	var conv2, current, conv, tmp, prev,
+		converters = {},
+		// Work with a copy of dataTypes in case we need to modify it for conversion
+		dataTypes = s.dataTypes.slice();
 
-		// Install callbacks on deferreds
-		for ( i in { success: 1, error: 1, complete: 1 } ) {
-			jqXHR[ i ]( s[ i ] );
+	// Create converters map with lowercased keys
+	if ( dataTypes[ 1 ] ) {
+		for ( conv in s.converters ) {
+			converters[ conv.toLowerCase() ] = s.converters[ conv ];
 		}
+	}
 
-		// Get transport
-		transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
-		// If no transport, we auto-abort
-		if ( !transport ) {
-			done( -1, "No Transport" );
-		} else {
-			jqXHR.readyState = 1;
+	current = dataTypes.shift();
 
-			// Send global event
-			if ( fireGlobals ) {
-				globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
-			}
-			// Timeout
-			if ( s.async && s.timeout > 0 ) {
-				timeoutTimer = setTimeout(function() {
-					jqXHR.abort("timeout");
-				}, s.timeout );
-			}
+	// Convert to each sequential dataType
+	while ( current ) {
 
-			try {
-				state = 1;
-				transport.send( requestHeaders, done );
-			} catch ( e ) {
-				// Propagate exception as error if not done
-				if ( state < 2 ) {
-					done( -1, e );
-				// Simply rethrow otherwise
-				} else {
-					throw e;
-				}
-			}
+		if ( s.responseFields[ current ] ) {
+			jqXHR[ s.responseFields[ current ] ] = response;
 		}
 
-		// Callback for when everything is done
-		function done( status, nativeStatusText, responses, headers ) {
-			var isSuccess, success, error, response, modified,
-				statusText = nativeStatusText;
-
-			// Called once
-			if ( state === 2 ) {
-				return;
-			}
+		// Apply the dataFilter if provided
+		if ( !prev && isSuccess && s.dataFilter ) {
+			response = s.dataFilter( response, s.dataType );
+		}
 
-			// State is "done" now
-			state = 2;
+		prev = current;
+		current = dataTypes.shift();
 
-			// Clear timeout if it exists
-			if ( timeoutTimer ) {
-				clearTimeout( timeoutTimer );
-			}
+		if ( current ) {
 
-			// Dereference transport for early garbage collection
-			// (no matter how long the jqXHR object will be used)
-			transport = undefined;
+			// There's only work to do if current dataType is non-auto
+			if ( current === "*" ) {
 
-			// Cache response headers
-			responseHeadersString = headers || "";
+				current = prev;
 
-			// Set readyState
-			jqXHR.readyState = status > 0 ? 4 : 0;
+			// Convert response if prev dataType is non-auto and differs from current
+			} else if ( prev !== "*" && prev !== current ) {
 
-			// Determine if successful
-			isSuccess = status >= 200 && status < 300 || status === 304;
+				// Seek a direct converter
+				conv = converters[ prev + " " + current ] || converters[ "* " + current ];
 
-			// Get response data
-			if ( responses ) {
-				response = ajaxHandleResponses( s, jqXHR, responses );
-			}
+				// If none found, seek a pair
+				if ( !conv ) {
+					for ( conv2 in converters ) {
 
-			// Convert no matter what (that way responseXXX fields are always set)
-			response = ajaxConvert( s, response, jqXHR, isSuccess );
+						// If conv2 outputs current
+						tmp = conv2.split( " " );
+						if ( tmp[ 1 ] === current ) {
 
-			// If successful, handle type chaining
-			if ( isSuccess ) {
+							// If prev can be converted to accepted input
+							conv = converters[ prev + " " + tmp[ 0 ] ] ||
+								converters[ "* " + tmp[ 0 ] ];
+							if ( conv ) {
+								// Condense equivalence converters
+								if ( conv === true ) {
+									conv = converters[ conv2 ];
 
-				// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-				if ( s.ifModified ) {
-					modified = jqXHR.getResponseHeader("Last-Modified");
-					if ( modified ) {
-						jQuery.lastModified[ cacheURL ] = modified;
-					}
-					modified = jqXHR.getResponseHeader("etag");
-					if ( modified ) {
-						jQuery.etag[ cacheURL ] = modified;
+								// Otherwise, insert the intermediate dataType
+								} else if ( converters[ conv2 ] !== true ) {
+									current = tmp[ 0 ];
+									dataTypes.unshift( tmp[ 1 ] );
+								}
+								break;
+							}
+						}
 					}
 				}
 
-				// if no content
-				if ( status === 204 || s.type === "HEAD" ) {
-					statusText = "nocontent";
-
-				// if not modified
-				} else if ( status === 304 ) {
-					statusText = "notmodified";
+				// Apply converter (if not an equivalence)
+				if ( conv !== true ) {
 
-				// If we have data, let's convert it
-				} else {
-					statusText = response.state;
-					success = response.data;
-					error = response.error;
-					isSuccess = !error;
-				}
-			} else {
-				// We extract error from statusText
-				// then normalize statusText and status for non-aborts
-				error = statusText;
-				if ( status || !statusText ) {
-					statusText = "error";
-					if ( status < 0 ) {
-						status = 0;
+					// Unless errors are allowed to bubble, catch and return them
+					if ( conv && s[ "throws" ] ) {
+						response = conv( response );
+					} else {
+						try {
+							response = conv( response );
+						} catch ( e ) {
+							return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+						}
 					}
 				}
 			}
+		}
+	}
 
-			// Set data for the fake xhr object
-			jqXHR.status = status;
-			jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+	return { state: "success", data: response };
+}
 
-			// Success/Error
-			if ( isSuccess ) {
-				deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
-			} else {
-				deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
-			}
+jQuery.extend({
 
-			// Status-dependent callbacks
-			jqXHR.statusCode( statusCode );
-			statusCode = undefined;
+	// Counter for holding the number of active queries
+	active: 0,
 
-			if ( fireGlobals ) {
-				globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
-					[ jqXHR, s, isSuccess ? success : error ] );
-			}
+	// Last-Modified header cache for next request
+	lastModified: {},
+	etag: {},
 
-			// Complete
-			completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+	ajaxSettings: {
+		url: ajaxLocation,
+		type: "GET",
+		isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+		global: true,
+		processData: true,
+		async: true,
+		contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+		/*
+		timeout: 0,
+		data: null,
+		dataType: null,
+		username: null,
+		password: null,
+		cache: null,
+		throws: false,
+		traditional: false,
+		headers: {},
+		*/
 
-			if ( fireGlobals ) {
-				globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
-				// Handle the global AJAX counter
-				if ( !( --jQuery.active ) ) {
-					jQuery.event.trigger("ajaxStop");
-				}
-			}
-		}
+		accepts: {
+			"*": allTypes,
+			text: "text/plain",
+			html: "text/html",
+			xml: "application/xml, text/xml",
+			json: "application/json, text/javascript"
+		},
 
-		return jqXHR;
-	},
+		contents: {
+			xml: /xml/,
+			html: /html/,
+			json: /json/
+		},
 
-	getJSON: function( url, data, callback ) {
-		return jQuery.get( url, data, callback, "json" );
-	},
+		responseFields: {
+			xml: "responseXML",
+			text: "responseText",
+			json: "responseJSON"
+		},
 
-	getScript: function( url, callback ) {
-		return jQuery.get( url, undefined, callback, "script" );
-	}
-});
+		// Data converters
+		// Keys separate source (or catchall "*") and destination types with a single space
+		converters: {
+
+			// Convert anything to text
+			"* text": String,
+
+			// Text to html (true = no transformation)
+			"text html": true,
+
+			// Evaluate text as a json expression
+			"text json": jQuery.parseJSON,
 
-jQuery.each( [ "get", "post" ], function( i, method ) {
-	jQuery[ method ] = function( url, data, callback, type ) {
-		// shift arguments if data argument was omitted
-		if ( jQuery.isFunction( data ) ) {
-			type = type || callback;
-			callback = data;
-			data = undefined;
+			// Parse text as xml
+			"text xml": jQuery.parseXML
+		},
+
+		// For options that shouldn't be deep extended:
+		// you can add your own custom options here if
+		// and when you create one that shouldn't be
+		// deep extended (see ajaxExtend)
+		flatOptions: {
+			url: true,
+			context: true
 		}
+	},
 
-		return jQuery.ajax({
-			url: url,
-			type: method,
-			dataType: type,
-			data: data,
-			success: callback
-		});
-	};
-});
+	// Creates a full fledged settings object into target
+	// with both ajaxSettings and settings fields.
+	// If target is omitted, writes into ajaxSettings.
+	ajaxSetup: function( target, settings ) {
+		return settings ?
 
-/* Handles responses to an ajax request:
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
-	var firstDataType, ct, finalDataType, type,
-		contents = s.contents,
-		dataTypes = s.dataTypes;
+			// Building a settings object
+			ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
 
-	// Remove auto dataType and get content-type in the process
-	while( dataTypes[ 0 ] === "*" ) {
-		dataTypes.shift();
-		if ( ct === undefined ) {
-			ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
-		}
-	}
+			// Extending ajaxSettings
+			ajaxExtend( jQuery.ajaxSettings, target );
+	},
 
-	// Check if we're dealing with a known content-type
-	if ( ct ) {
-		for ( type in contents ) {
-			if ( contents[ type ] && contents[ type ].test( ct ) ) {
-				dataTypes.unshift( type );
-				break;
-			}
-		}
-	}
+	ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+	ajaxTransport: addToPrefiltersOrTransports( transports ),
 
-	// Check to see if we have a response for the expected dataType
-	if ( dataTypes[ 0 ] in responses ) {
-		finalDataType = dataTypes[ 0 ];
-	} else {
-		// Try convertible dataTypes
-		for ( type in responses ) {
-			if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
-				finalDataType = type;
-				break;
-			}
-			if ( !firstDataType ) {
-				firstDataType = type;
-			}
-		}
-		// Or just use first one
-		finalDataType = finalDataType || firstDataType;
-	}
+	// Main method
+	ajax: function( url, options ) {
 
-	// If we found a dataType
-	// We add the dataType to the list if needed
-	// and return the corresponding response
-	if ( finalDataType ) {
-		if ( finalDataType !== dataTypes[ 0 ] ) {
-			dataTypes.unshift( finalDataType );
+		// If url is an object, simulate pre-1.5 signature
+		if ( typeof url === "object" ) {
+			options = url;
+			url = undefined;
 		}
-		return responses[ finalDataType ];
-	}
-}
 
-/* Chain conversions given the request and the original response
- * Also sets the responseXXX fields on the jqXHR instance
- */
-function ajaxConvert( s, response, jqXHR, isSuccess ) {
-	var conv2, current, conv, tmp, prev,
-		converters = {},
-		// Work with a copy of dataTypes in case we need to modify it for conversion
-		dataTypes = s.dataTypes.slice();
+		// Force options to be an object
+		options = options || {};
 
-	// Create converters map with lowercased keys
-	if ( dataTypes[ 1 ] ) {
-		for ( conv in s.converters ) {
-			converters[ conv.toLowerCase() ] = s.converters[ conv ];
-		}
-	}
+		var // Cross-domain detection vars
+			parts,
+			// Loop variable
+			i,
+			// URL without anti-cache param
+			cacheURL,
+			// Response headers as string
+			responseHeadersString,
+			// timeout handle
+			timeoutTimer,
 
-	current = dataTypes.shift();
+			// To know if global events are to be dispatched
+			fireGlobals,
 
-	// Convert to each sequential dataType
-	while ( current ) {
+			transport,
+			// Response headers
+			responseHeaders,
+			// Create the final options object
+			s = jQuery.ajaxSetup( {}, options ),
+			// Callbacks context
+			callbackContext = s.context || s,
+			// Context for global events is callbackContext if it is a DOM node or jQuery collection
+			globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
+				jQuery( callbackContext ) :
+				jQuery.event,
+			// Deferreds
+			deferred = jQuery.Deferred(),
+			completeDeferred = jQuery.Callbacks("once memory"),
+			// Status-dependent callbacks
+			statusCode = s.statusCode || {},
+			// Headers (they are sent all at once)
+			requestHeaders = {},
+			requestHeadersNames = {},
+			// The jqXHR state
+			state = 0,
+			// Default abort message
+			strAbort = "canceled",
+			// Fake xhr
+			jqXHR = {
+				readyState: 0,
 
-		if ( s.responseFields[ current ] ) {
-			jqXHR[ s.responseFields[ current ] ] = response;
-		}
+				// Builds headers hashtable if needed
+				getResponseHeader: function( key ) {
+					var match;
+					if ( state === 2 ) {
+						if ( !responseHeaders ) {
+							responseHeaders = {};
+							while ( (match = rheaders.exec( responseHeadersString )) ) {
+								responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+							}
+						}
+						match = responseHeaders[ key.toLowerCase() ];
+					}
+					return match == null ? null : match;
+				},
 
-		// Apply the dataFilter if provided
-		if ( !prev && isSuccess && s.dataFilter ) {
-			response = s.dataFilter( response, s.dataType );
-		}
+				// Raw string
+				getAllResponseHeaders: function() {
+					return state === 2 ? responseHeadersString : null;
+				},
 
-		prev = current;
-		current = dataTypes.shift();
+				// Caches the header
+				setRequestHeader: function( name, value ) {
+					var lname = name.toLowerCase();
+					if ( !state ) {
+						name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+						requestHeaders[ name ] = value;
+					}
+					return this;
+				},
 
-		if ( current ) {
+				// Overrides response content-type header
+				overrideMimeType: function( type ) {
+					if ( !state ) {
+						s.mimeType = type;
+					}
+					return this;
+				},
 
-			// There's only work to do if current dataType is non-auto
-			if ( current === "*" ) {
+				// Status-dependent callbacks
+				statusCode: function( map ) {
+					var code;
+					if ( map ) {
+						if ( state < 2 ) {
+							for ( code in map ) {
+								// Lazy-add the new callback in a way that preserves old ones
+								statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+							}
+						} else {
+							// Execute the appropriate callbacks
+							jqXHR.always( map[ jqXHR.status ] );
+						}
+					}
+					return this;
+				},
 
-				current = prev;
+				// Cancel the request
+				abort: function( statusText ) {
+					var finalText = statusText || strAbort;
+					if ( transport ) {
+						transport.abort( finalText );
+					}
+					done( 0, finalText );
+					return this;
+				}
+			};
 
-			// Convert response if prev dataType is non-auto and differs from current
-			} else if ( prev !== "*" && prev !== current ) {
+		// Attach deferreds
+		deferred.promise( jqXHR ).complete = completeDeferred.add;
+		jqXHR.success = jqXHR.done;
+		jqXHR.error = jqXHR.fail;
 
-				// Seek a direct converter
-				conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+		// Remove hash character (#7531: and string promotion)
+		// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+		// Handle falsy url in the settings object (#10093: consistency with old signature)
+		// We also use the url parameter if available
+		s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
 
-				// If none found, seek a pair
-				if ( !conv ) {
-					for ( conv2 in converters ) {
+		// Alias method option to type as per ticket #12004
+		s.type = options.method || options.type || s.method || s.type;
 
-						// If conv2 outputs current
-						tmp = conv2.split( " " );
-						if ( tmp[ 1 ] === current ) {
+		// Extract dataTypes list
+		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
 
-							// If prev can be converted to accepted input
-							conv = converters[ prev + " " + tmp[ 0 ] ] ||
-								converters[ "* " + tmp[ 0 ] ];
-							if ( conv ) {
-								// Condense equivalence converters
-								if ( conv === true ) {
-									conv = converters[ conv2 ];
+		// A cross-domain request is in order when we have a protocol:host:port mismatch
+		if ( s.crossDomain == null ) {
+			parts = rurl.exec( s.url.toLowerCase() );
+			s.crossDomain = !!( parts &&
+				( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+					( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+						( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
+			);
+		}
 
-								// Otherwise, insert the intermediate dataType
-								} else if ( converters[ conv2 ] !== true ) {
-									current = tmp[ 0 ];
-									dataTypes.unshift( tmp[ 1 ] );
-								}
-								break;
-							}
-						}
-					}
-				}
+		// Convert data if not already a string
+		if ( s.data && s.processData && typeof s.data !== "string" ) {
+			s.data = jQuery.param( s.data, s.traditional );
+		}
 
-				// Apply converter (if not an equivalence)
-				if ( conv !== true ) {
+		// Apply prefilters
+		inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
 
-					// Unless errors are allowed to bubble, catch and return them
-					if ( conv && s[ "throws" ] ) {
-						response = conv( response );
-					} else {
-						try {
-							response = conv( response );
-						} catch ( e ) {
-							return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
-						}
-					}
-				}
-			}
+		// If request was aborted inside a prefilter, stop there
+		if ( state === 2 ) {
+			return jqXHR;
 		}
-	}
 
-	return { state: "success", data: response };
-}
-// Install script dataType
-jQuery.ajaxSetup({
-	accepts: {
-		script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
-	},
-	contents: {
-		script: /(?:java|ecma)script/
-	},
-	converters: {
-		"text script": function( text ) {
-			jQuery.globalEval( text );
-			return text;
+		// We can fire global events as of now if asked to
+		fireGlobals = s.global;
+
+		// Watch for a new set of requests
+		if ( fireGlobals && jQuery.active++ === 0 ) {
+			jQuery.event.trigger("ajaxStart");
 		}
-	}
-});
 
-// Handle cache's special case and global
-jQuery.ajaxPrefilter( "script", function( s ) {
-	if ( s.cache === undefined ) {
-		s.cache = false;
-	}
-	if ( s.crossDomain ) {
-		s.type = "GET";
-		s.global = false;
-	}
-});
+		// Uppercase the type
+		s.type = s.type.toUpperCase();
 
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function(s) {
+		// Determine if request has content
+		s.hasContent = !rnoContent.test( s.type );
 
-	// This transport only deals with cross domain requests
-	if ( s.crossDomain ) {
+		// Save the URL in case we're toying with the If-Modified-Since
+		// and/or If-None-Match header later on
+		cacheURL = s.url;
 
-		var script,
-			head = document.head || jQuery("head")[0] || document.documentElement;
+		// More options handling for requests with no content
+		if ( !s.hasContent ) {
 
-		return {
+			// If data is available, append data to url
+			if ( s.data ) {
+				cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+				// #9682: remove data so that it's not used in an eventual retry
+				delete s.data;
+			}
 
-			send: function( _, callback ) {
+			// Add anti-cache in url if needed
+			if ( s.cache === false ) {
+				s.url = rts.test( cacheURL ) ?
 
-				script = document.createElement("script");
+					// If there is already a '_' parameter, set its value
+					cacheURL.replace( rts, "$1_=" + nonce++ ) :
 
-				script.async = true;
+					// Otherwise add one to the end
+					cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
+			}
+		}
 
-				if ( s.scriptCharset ) {
-					script.charset = s.scriptCharset;
-				}
+		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+		if ( s.ifModified ) {
+			if ( jQuery.lastModified[ cacheURL ] ) {
+				jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+			}
+			if ( jQuery.etag[ cacheURL ] ) {
+				jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+			}
+		}
 
-				script.src = s.url;
+		// Set the correct header, if data is being sent
+		if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+			jqXHR.setRequestHeader( "Content-Type", s.contentType );
+		}
 
-				// Attach handlers for all browsers
-				script.onload = script.onreadystatechange = function( _, isAbort ) {
+		// Set the Accepts header for the server, depending on the dataType
+		jqXHR.setRequestHeader(
+			"Accept",
+			s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+				s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+				s.accepts[ "*" ]
+		);
 
-					if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+		// Check for headers option
+		for ( i in s.headers ) {
+			jqXHR.setRequestHeader( i, s.headers[ i ] );
+		}
 
-						// Handle memory leak in IE
-						script.onload = script.onreadystatechange = null;
+		// Allow custom headers/mimetypes and early abort
+		if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+			// Abort if not done already and return
+			return jqXHR.abort();
+		}
 
-						// Remove the script
-						if ( script.parentNode ) {
-							script.parentNode.removeChild( script );
-						}
+		// aborting is no longer a cancellation
+		strAbort = "abort";
 
-						// Dereference the script
-						script = null;
+		// Install callbacks on deferreds
+		for ( i in { success: 1, error: 1, complete: 1 } ) {
+			jqXHR[ i ]( s[ i ] );
+		}
 
-						// Callback if not abort
-						if ( !isAbort ) {
-							callback( 200, "success" );
-						}
-					}
-				};
+		// Get transport
+		transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
 
-				// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
-				// Use native DOM manipulation to avoid our domManip AJAX trickery
-				head.insertBefore( script, head.firstChild );
-			},
+		// If no transport, we auto-abort
+		if ( !transport ) {
+			done( -1, "No Transport" );
+		} else {
+			jqXHR.readyState = 1;
 
-			abort: function() {
-				if ( script ) {
-					script.onload( undefined, true );
+			// Send global event
+			if ( fireGlobals ) {
+				globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+			}
+			// Timeout
+			if ( s.async && s.timeout > 0 ) {
+				timeoutTimer = setTimeout(function() {
+					jqXHR.abort("timeout");
+				}, s.timeout );
+			}
+
+			try {
+				state = 1;
+				transport.send( requestHeaders, done );
+			} catch ( e ) {
+				// Propagate exception as error if not done
+				if ( state < 2 ) {
+					done( -1, e );
+				// Simply rethrow otherwise
+				} else {
+					throw e;
 				}
 			}
-		};
-	}
-});
-var oldCallbacks = [],
-	rjsonp = /(=)\?(?=&|$)|\?\?/;
+		}
 
-// Default jsonp settings
-jQuery.ajaxSetup({
-	jsonp: "callback",
-	jsonpCallback: function() {
-		var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
-		this[ callback ] = true;
-		return callback;
-	}
-});
+		// Callback for when everything is done
+		function done( status, nativeStatusText, responses, headers ) {
+			var isSuccess, success, error, response, modified,
+				statusText = nativeStatusText;
 
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+			// Called once
+			if ( state === 2 ) {
+				return;
+			}
 
-	var callbackName, overwritten, responseContainer,
-		jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
-			"url" :
-			typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
-		);
+			// State is "done" now
+			state = 2;
 
-	// Handle iff the expected data type is "jsonp" or we have a parameter to set
-	if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+			// Clear timeout if it exists
+			if ( timeoutTimer ) {
+				clearTimeout( timeoutTimer );
+			}
 
-		// Get callback name, remembering preexisting value associated with it
-		callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
-			s.jsonpCallback() :
-			s.jsonpCallback;
+			// Dereference transport for early garbage collection
+			// (no matter how long the jqXHR object will be used)
+			transport = undefined;
 
-		// Insert callback into url or form data
-		if ( jsonProp ) {
-			s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
-		} else if ( s.jsonp !== false ) {
-			s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
-		}
+			// Cache response headers
+			responseHeadersString = headers || "";
 
-		// Use data converter to retrieve json after script execution
-		s.converters["script json"] = function() {
-			if ( !responseContainer ) {
-				jQuery.error( callbackName + " was not called" );
+			// Set readyState
+			jqXHR.readyState = status > 0 ? 4 : 0;
+
+			// Determine if successful
+			isSuccess = status >= 200 && status < 300 || status === 304;
+
+			// Get response data
+			if ( responses ) {
+				response = ajaxHandleResponses( s, jqXHR, responses );
 			}
-			return responseContainer[ 0 ];
-		};
 
-		// force json dataType
-		s.dataTypes[ 0 ] = "json";
+			// Convert no matter what (that way responseXXX fields are always set)
+			response = ajaxConvert( s, response, jqXHR, isSuccess );
 
-		// Install callback
-		overwritten = window[ callbackName ];
-		window[ callbackName ] = function() {
-			responseContainer = arguments;
-		};
+			// If successful, handle type chaining
+			if ( isSuccess ) {
 
-		// Clean-up function (fires after converters)
-		jqXHR.always(function() {
-			// Restore preexisting value
-			window[ callbackName ] = overwritten;
+				// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+				if ( s.ifModified ) {
+					modified = jqXHR.getResponseHeader("Last-Modified");
+					if ( modified ) {
+						jQuery.lastModified[ cacheURL ] = modified;
+					}
+					modified = jqXHR.getResponseHeader("etag");
+					if ( modified ) {
+						jQuery.etag[ cacheURL ] = modified;
+					}
+				}
 
-			// Save back as free
-			if ( s[ callbackName ] ) {
-				// make sure that re-using the options doesn't screw things around
-				s.jsonpCallback = originalSettings.jsonpCallback;
+				// if no content
+				if ( status === 204 || s.type === "HEAD" ) {
+					statusText = "nocontent";
 
-				// save the callback name for future use
-				oldCallbacks.push( callbackName );
-			}
+				// if not modified
+				} else if ( status === 304 ) {
+					statusText = "notmodified";
 
-			// Call if it was a function and we have a response
-			if ( responseContainer && jQuery.isFunction( overwritten ) ) {
-				overwritten( responseContainer[ 0 ] );
+				// If we have data, let's convert it
+				} else {
+					statusText = response.state;
+					success = response.data;
+					error = response.error;
+					isSuccess = !error;
+				}
+			} else {
+				// We extract error from statusText
+				// then normalize statusText and status for non-aborts
+				error = statusText;
+				if ( status || !statusText ) {
+					statusText = "error";
+					if ( status < 0 ) {
+						status = 0;
+					}
+				}
 			}
 
-			responseContainer = overwritten = undefined;
-		});
+			// Set data for the fake xhr object
+			jqXHR.status = status;
+			jqXHR.statusText = ( nativeStatusText || statusText ) + "";
 
-		// Delegate to script
-		return "script";
-	}
-});
-var xhrCallbacks, xhrSupported,
-	xhrId = 0,
-	// #5280: Internet Explorer will keep connections alive if we don't abort on unload
-	xhrOnUnloadAbort = window.ActiveXObject && function() {
-		// Abort all pending requests
-		var key;
-		for ( key in xhrCallbacks ) {
-			xhrCallbacks[ key ]( undefined, true );
-		}
-	};
+			// Success/Error
+			if ( isSuccess ) {
+				deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+			} else {
+				deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+			}
 
-// Functions to create xhrs
-function createStandardXHR() {
-	try {
-		return new window.XMLHttpRequest();
-	} catch( e ) {}
-}
+			// Status-dependent callbacks
+			jqXHR.statusCode( statusCode );
+			statusCode = undefined;
 
-function createActiveXHR() {
-	try {
-		return new window.ActiveXObject("Microsoft.XMLHTTP");
-	} catch( e ) {}
-}
+			if ( fireGlobals ) {
+				globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+					[ jqXHR, s, isSuccess ? success : error ] );
+			}
 
-// Create the request object
-// (This is still attached to ajaxSettings for backward compatibility)
-jQuery.ajaxSettings.xhr = window.ActiveXObject ?
-	/* Microsoft failed to properly
-	 * implement the XMLHttpRequest in IE7 (can't request local files),
-	 * so we use the ActiveXObject when it is available
-	 * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
-	 * we need a fallback.
-	 */
-	function() {
-		return !this.isLocal && createStandardXHR() || createActiveXHR();
-	} :
-	// For all other browsers, use the standard XMLHttpRequest object
-	createStandardXHR;
+			// Complete
+			completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
 
-// Determine support properties
-xhrSupported = jQuery.ajaxSettings.xhr();
-jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
-xhrSupported = jQuery.support.ajax = !!xhrSupported;
+			if ( fireGlobals ) {
+				globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+				// Handle the global AJAX counter
+				if ( !( --jQuery.active ) ) {
+					jQuery.event.trigger("ajaxStop");
+				}
+			}
+		}
 
-// Create transport if the browser can provide an xhr
-if ( xhrSupported ) {
+		return jqXHR;
+	},
 
-	jQuery.ajaxTransport(function( s ) {
-		// Cross domain only allowed if supported through XMLHttpRequest
-		if ( !s.crossDomain || jQuery.support.cors ) {
+	getJSON: function( url, data, callback ) {
+		return jQuery.get( url, data, callback, "json" );
+	},
 
-			var callback;
+	getScript: function( url, callback ) {
+		return jQuery.get( url, undefined, callback, "script" );
+	}
+});
 
-			return {
-				send: function( headers, complete ) {
+jQuery.each( [ "get", "post" ], function( i, method ) {
+	jQuery[ method ] = function( url, data, callback, type ) {
+		// shift arguments if data argument was omitted
+		if ( jQuery.isFunction( data ) ) {
+			type = type || callback;
+			callback = data;
+			data = undefined;
+		}
 
-					// Get a new xhr
-					var handle, i,
-						xhr = s.xhr();
+		return jQuery.ajax({
+			url: url,
+			type: method,
+			dataType: type,
+			data: data,
+			success: callback
+		});
+	};
+});
 
-					// Open the socket
-					// Passing null username, generates a login popup on Opera (#2865)
-					if ( s.username ) {
-						xhr.open( s.type, s.url, s.async, s.username, s.password );
-					} else {
-						xhr.open( s.type, s.url, s.async );
-					}
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
+	jQuery.fn[ type ] = function( fn ) {
+		return this.on( type, fn );
+	};
+});
 
-					// Apply custom fields if provided
-					if ( s.xhrFields ) {
-						for ( i in s.xhrFields ) {
-							xhr[ i ] = s.xhrFields[ i ];
-						}
-					}
 
-					// Override mime type if needed
-					if ( s.mimeType && xhr.overrideMimeType ) {
-						xhr.overrideMimeType( s.mimeType );
-					}
+jQuery._evalUrl = function( url ) {
+	return jQuery.ajax({
+		url: url,
+		type: "GET",
+		dataType: "script",
+		async: false,
+		global: false,
+		"throws": true
+	});
+};
 
-					// X-Requested-With header
-					// For cross-domain requests, seeing as conditions for a preflight are
-					// akin to a jigsaw puzzle, we simply never set it to be sure.
-					// (it can always be set on a per-request basis or even using ajaxSetup)
-					// For same-domain requests, won't change header if already provided.
-					if ( !s.crossDomain && !headers["X-Requested-With"] ) {
-						headers["X-Requested-With"] = "XMLHttpRequest";
-					}
 
-					// Need an extra try/catch for cross domain requests in Firefox 3
-					try {
-						for ( i in headers ) {
-							xhr.setRequestHeader( i, headers[ i ] );
-						}
-					} catch( err ) {}
+jQuery.fn.extend({
+	wrapAll: function( html ) {
+		if ( jQuery.isFunction( html ) ) {
+			return this.each(function(i) {
+				jQuery(this).wrapAll( html.call(this, i) );
+			});
+		}
 
-					// Do send the request
-					// This may raise an exception which is actually
-					// handled in jQuery.ajax (so no try/catch here)
-					xhr.send( ( s.hasContent && s.data ) || null );
+		if ( this[0] ) {
+			// The elements to wrap the target around
+			var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
 
-					// Listener
-					callback = function( _, isAbort ) {
-						var status, responseHeaders, statusText, responses;
+			if ( this[0].parentNode ) {
+				wrap.insertBefore( this[0] );
+			}
 
-						// Firefox throws exceptions when accessing properties
-						// of an xhr when a network error occurred
-						// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
-						try {
+			wrap.map(function() {
+				var elem = this;
 
-							// Was never called and is aborted or complete
-							if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+				while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+					elem = elem.firstChild;
+				}
 
-								// Only called once
-								callback = undefined;
+				return elem;
+			}).append( this );
+		}
 
-								// Do not keep as active anymore
-								if ( handle ) {
-									xhr.onreadystatechange = jQuery.noop;
-									if ( xhrOnUnloadAbort ) {
-										delete xhrCallbacks[ handle ];
-									}
-								}
+		return this;
+	},
 
-								// If it's an abort
-								if ( isAbort ) {
-									// Abort it manually if needed
-									if ( xhr.readyState !== 4 ) {
-										xhr.abort();
-									}
-								} else {
-									responses = {};
-									status = xhr.status;
-									responseHeaders = xhr.getAllResponseHeaders();
-
-									// When requesting binary data, IE6-9 will throw an exception
-									// on any attempt to access responseText (#11426)
-									if ( typeof xhr.responseText === "string" ) {
-										responses.text = xhr.responseText;
-									}
+	wrapInner: function( html ) {
+		if ( jQuery.isFunction( html ) ) {
+			return this.each(function(i) {
+				jQuery(this).wrapInner( html.call(this, i) );
+			});
+		}
 
-									// Firefox throws an exception when accessing
-									// statusText for faulty cross-domain requests
-									try {
-										statusText = xhr.statusText;
-									} catch( e ) {
-										// We normalize with Webkit giving an empty statusText
-										statusText = "";
-									}
+		return this.each(function() {
+			var self = jQuery( this ),
+				contents = self.contents();
 
-									// Filter status for non standard behaviors
+			if ( contents.length ) {
+				contents.wrapAll( html );
 
-									// If the request is local and we have data: assume a success
-									// (success with no data won't get notified, that's the best we
-									// can do given current implementations)
-									if ( !status && s.isLocal && !s.crossDomain ) {
-										status = responses.text ? 200 : 404;
-									// IE - #1450: sometimes returns 1223 when it should be 204
-									} else if ( status === 1223 ) {
-										status = 204;
-									}
-								}
-							}
-						} catch( firefoxAccessException ) {
-							if ( !isAbort ) {
-								complete( -1, firefoxAccessException );
-							}
-						}
+			} else {
+				self.append( html );
+			}
+		});
+	},
 
-						// Call complete if needed
-						if ( responses ) {
-							complete( status, statusText, responses, responseHeaders );
-						}
-					};
+	wrap: function( html ) {
+		var isFunction = jQuery.isFunction( html );
 
-					if ( !s.async ) {
-						// if we're in sync mode we fire the callback
-						callback();
-					} else if ( xhr.readyState === 4 ) {
-						// (IE6 & IE7) if it's in cache and has been
-						// retrieved directly we need to fire the callback
-						setTimeout( callback );
-					} else {
-						handle = ++xhrId;
-						if ( xhrOnUnloadAbort ) {
-							// Create the active xhrs callbacks list if needed
-							// and attach the unload handler
-							if ( !xhrCallbacks ) {
-								xhrCallbacks = {};
-								jQuery( window ).unload( xhrOnUnloadAbort );
-							}
-							// Add to list of active xhrs callbacks
-							xhrCallbacks[ handle ] = callback;
-						}
-						xhr.onreadystatechange = callback;
-					}
-				},
+		return this.each(function(i) {
+			jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
+		});
+	},
+
+	unwrap: function() {
+		return this.parent().each(function() {
+			if ( !jQuery.nodeName( this, "body" ) ) {
+				jQuery( this ).replaceWith( this.childNodes );
+			}
+		}).end();
+	}
+});
 
-				abort: function() {
-					if ( callback ) {
-						callback( undefined, true );
-					}
-				}
-			};
-		}
-	});
-}
-var fxNow, timerId,
-	rfxtypes = /^(?:toggle|show|hide)$/,
-	rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
-	rrun = /queueHooks$/,
-	animationPrefilters = [ defaultPrefilter ],
-	tweeners = {
-		"*": [function( prop, value ) {
-			var tween = this.createTween( prop, value ),
-				target = tween.cur(),
-				parts = rfxnum.exec( value ),
-				unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
 
-				// Starting value computation is required for potential unit mismatches
-				start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
-					rfxnum.exec( jQuery.css( tween.elem, prop ) ),
-				scale = 1,
-				maxIterations = 20;
+jQuery.expr.filters.hidden = function( elem ) {
+	// Support: Opera <= 12.12
+	// Opera reports offsetWidths and offsetHeights less than zero on some elements
+	return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
+		(!support.reliableHiddenOffsets() &&
+			((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
+};
 
-			if ( start && start[ 3 ] !== unit ) {
-				// Trust units reported by jQuery.css
-				unit = unit || start[ 3 ];
+jQuery.expr.filters.visible = function( elem ) {
+	return !jQuery.expr.filters.hidden( elem );
+};
 
-				// Make sure we update the tween properties later on
-				parts = parts || [];
 
-				// Iteratively approximate from a nonzero starting point
-				start = +target || 1;
 
-				do {
-					// If previous iteration zeroed out, double until we get *something*
-					// Use a string for doubling factor so we don't accidentally see scale as unchanged below
-					scale = scale || ".5";
 
-					// Adjust and apply
-					start = start / scale;
-					jQuery.style( tween.elem, prop, start + unit );
+var r20 = /%20/g,
+	rbracket = /\[\]$/,
+	rCRLF = /\r?\n/g,
+	rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
+	rsubmittable = /^(?:input|select|textarea|keygen)/i;
 
-				// Update scale, tolerating zero or NaN from tween.cur()
-				// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
-				} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
-			}
+function buildParams( prefix, obj, traditional, add ) {
+	var name;
 
-			// Update tween properties
-			if ( parts ) {
-				start = tween.start = +start || +target || 0;
-				tween.unit = unit;
-				// If a +=/-= token was provided, we're doing a relative animation
-				tween.end = parts[ 1 ] ?
-					start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
-					+parts[ 2 ];
+	if ( jQuery.isArray( obj ) ) {
+		// Serialize array item.
+		jQuery.each( obj, function( i, v ) {
+			if ( traditional || rbracket.test( prefix ) ) {
+				// Treat each array item as a scalar.
+				add( prefix, v );
+
+			} else {
+				// Item is non-scalar (array or object), encode its numeric index.
+				buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
 			}
+		});
 
-			return tween;
-		}]
-	};
+	} else if ( !traditional && jQuery.type( obj ) === "object" ) {
+		// Serialize object item.
+		for ( name in obj ) {
+			buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+		}
 
-// Animations created synchronously will run synchronously
-function createFxNow() {
-	setTimeout(function() {
-		fxNow = undefined;
-	});
-	return ( fxNow = jQuery.now() );
+	} else {
+		// Serialize scalar item.
+		add( prefix, obj );
+	}
 }
 
-function createTween( value, prop, animation ) {
-	var tween,
-		collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
-		index = 0,
-		length = collection.length;
-	for ( ; index < length; index++ ) {
-		if ( (tween = collection[ index ].call( animation, prop, value )) ) {
+// Serialize an array of form elements or a set of
+// key/values into a query string
+jQuery.param = function( a, traditional ) {
+	var prefix,
+		s = [],
+		add = function( key, value ) {
+			// If value is a function, invoke it and return its value
+			value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
+			s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+		};
 
-			// we're done with this property
-			return tween;
+	// Set traditional to true for jQuery <= 1.3.2 behavior.
+	if ( traditional === undefined ) {
+		traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
+	}
+
+	// If an array was passed in, assume that it is an array of form elements.
+	if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+		// Serialize the form elements
+		jQuery.each( a, function() {
+			add( this.name, this.value );
+		});
+
+	} else {
+		// If traditional, encode the "old" way (the way 1.3.2 or older
+		// did it), otherwise encode params recursively.
+		for ( prefix in a ) {
+			buildParams( prefix, a[ prefix ], traditional, add );
 		}
 	}
-}
 
-function Animation( elem, properties, options ) {
-	var result,
-		stopped,
-		index = 0,
-		length = animationPrefilters.length,
-		deferred = jQuery.Deferred().always( function() {
-			// don't match elem in the :animated selector
-			delete tick.elem;
-		}),
-		tick = function() {
-			if ( stopped ) {
-				return false;
-			}
-			var currentTime = fxNow || createFxNow(),
-				remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
-				// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
-				temp = remaining / animation.duration || 0,
-				percent = 1 - temp,
-				index = 0,
-				length = animation.tweens.length;
+	// Return the resulting serialization
+	return s.join( "&" ).replace( r20, "+" );
+};
 
-			for ( ; index < length ; index++ ) {
-				animation.tweens[ index ].run( percent );
-			}
+jQuery.fn.extend({
+	serialize: function() {
+		return jQuery.param( this.serializeArray() );
+	},
+	serializeArray: function() {
+		return this.map(function() {
+			// Can add propHook for "elements" to filter or add form elements
+			var elements = jQuery.prop( this, "elements" );
+			return elements ? jQuery.makeArray( elements ) : this;
+		})
+		.filter(function() {
+			var type = this.type;
+			// Use .is(":disabled") so that fieldset[disabled] works
+			return this.name && !jQuery( this ).is( ":disabled" ) &&
+				rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
+				( this.checked || !rcheckableType.test( type ) );
+		})
+		.map(function( i, elem ) {
+			var val = jQuery( this ).val();
 
-			deferred.notifyWith( elem, [ animation, percent, remaining ]);
+			return val == null ?
+				null :
+				jQuery.isArray( val ) ?
+					jQuery.map( val, function( val ) {
+						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+					}) :
+					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+		}).get();
+	}
+});
 
-			if ( percent < 1 && length ) {
-				return remaining;
-			} else {
-				deferred.resolveWith( elem, [ animation ] );
-				return false;
-			}
-		},
-		animation = deferred.promise({
-			elem: elem,
-			props: jQuery.extend( {}, properties ),
-			opts: jQuery.extend( true, { specialEasing: {} }, options ),
-			originalProperties: properties,
-			originalOptions: options,
-			startTime: fxNow || createFxNow(),
-			duration: options.duration,
-			tweens: [],
-			createTween: function( prop, end ) {
-				var tween = jQuery.Tween( elem, animation.opts, prop, end,
-						animation.opts.specialEasing[ prop ] || animation.opts.easing );
-				animation.tweens.push( tween );
-				return tween;
-			},
-			stop: function( gotoEnd ) {
-				var index = 0,
-					// if we are going to the end, we want to run all the tweens
-					// otherwise we skip this part
-					length = gotoEnd ? animation.tweens.length : 0;
-				if ( stopped ) {
-					return this;
-				}
-				stopped = true;
-				for ( ; index < length ; index++ ) {
-					animation.tweens[ index ].run( 1 );
-				}
 
-				// resolve when we played the last frame
-				// otherwise, reject
-				if ( gotoEnd ) {
-					deferred.resolveWith( elem, [ animation, gotoEnd ] );
-				} else {
-					deferred.rejectWith( elem, [ animation, gotoEnd ] );
-				}
-				return this;
-			}
-		}),
-		props = animation.props;
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
+	// Support: IE6+
+	function() {
 
-	propFilter( props, animation.opts.specialEasing );
+		// XHR cannot access local files, always use ActiveX for that case
+		return !this.isLocal &&
 
-	for ( ; index < length ; index++ ) {
-		result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
-		if ( result ) {
-			return result;
+			// Support: IE7-8
+			// oldIE XHR does not support non-RFC2616 methods (#13240)
+			// See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
+			// and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
+			// Although this check for six methods instead of eight
+			// since IE also does not support "trace" and "connect"
+			/^(get|post|head|put|delete|options)$/i.test( this.type ) &&
+
+			createStandardXHR() || createActiveXHR();
+	} :
+	// For all other browsers, use the standard XMLHttpRequest object
+	createStandardXHR;
+
+var xhrId = 0,
+	xhrCallbacks = {},
+	xhrSupported = jQuery.ajaxSettings.xhr();
+
+// Support: IE<10
+// Open requests must be manually aborted on unload (#5280)
+if ( window.ActiveXObject ) {
+	jQuery( window ).on( "unload", function() {
+		for ( var key in xhrCallbacks ) {
+			xhrCallbacks[ key ]( undefined, true );
 		}
-	}
+	});
+}
 
-	jQuery.map( props, createTween, animation );
+// Determine support properties
+support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+xhrSupported = support.ajax = !!xhrSupported;
 
-	if ( jQuery.isFunction( animation.opts.start ) ) {
-		animation.opts.start.call( elem, animation );
-	}
+// Create transport if the browser can provide an xhr
+if ( xhrSupported ) {
 
-	jQuery.fx.timer(
-		jQuery.extend( tick, {
-			elem: elem,
-			anim: animation,
-			queue: animation.opts.queue
-		})
-	);
+	jQuery.ajaxTransport(function( options ) {
+		// Cross domain only allowed if supported through XMLHttpRequest
+		if ( !options.crossDomain || support.cors ) {
+
+			var callback;
 
-	// attach callbacks from options
-	return animation.progress( animation.opts.progress )
-		.done( animation.opts.done, animation.opts.complete )
-		.fail( animation.opts.fail )
-		.always( animation.opts.always );
-}
+			return {
+				send: function( headers, complete ) {
+					var i,
+						xhr = options.xhr(),
+						id = ++xhrId;
 
-function propFilter( props, specialEasing ) {
-	var index, name, easing, value, hooks;
+					// Open the socket
+					xhr.open( options.type, options.url, options.async, options.username, options.password );
 
-	// camelCase, specialEasing and expand cssHook pass
-	for ( index in props ) {
-		name = jQuery.camelCase( index );
-		easing = specialEasing[ name ];
-		value = props[ index ];
-		if ( jQuery.isArray( value ) ) {
-			easing = value[ 1 ];
-			value = props[ index ] = value[ 0 ];
-		}
+					// Apply custom fields if provided
+					if ( options.xhrFields ) {
+						for ( i in options.xhrFields ) {
+							xhr[ i ] = options.xhrFields[ i ];
+						}
+					}
 
-		if ( index !== name ) {
-			props[ name ] = value;
-			delete props[ index ];
-		}
+					// Override mime type if needed
+					if ( options.mimeType && xhr.overrideMimeType ) {
+						xhr.overrideMimeType( options.mimeType );
+					}
 
-		hooks = jQuery.cssHooks[ name ];
-		if ( hooks && "expand" in hooks ) {
-			value = hooks.expand( value );
-			delete props[ name ];
+					// X-Requested-With header
+					// For cross-domain requests, seeing as conditions for a preflight are
+					// akin to a jigsaw puzzle, we simply never set it to be sure.
+					// (it can always be set on a per-request basis or even using ajaxSetup)
+					// For same-domain requests, won't change header if already provided.
+					if ( !options.crossDomain && !headers["X-Requested-With"] ) {
+						headers["X-Requested-With"] = "XMLHttpRequest";
+					}
 
-			// not quite $.extend, this wont overwrite keys already present.
-			// also - reusing 'index' from above because we have the correct "name"
-			for ( index in value ) {
-				if ( !( index in props ) ) {
-					props[ index ] = value[ index ];
-					specialEasing[ index ] = easing;
-				}
-			}
-		} else {
-			specialEasing[ name ] = easing;
-		}
-	}
-}
+					// Set headers
+					for ( i in headers ) {
+						// Support: IE<9
+						// IE's ActiveXObject throws a 'Type Mismatch' exception when setting
+						// request header to a null-value.
+						//
+						// To keep consistent with other XHR implementations, cast the value
+						// to string and ignore `undefined`.
+						if ( headers[ i ] !== undefined ) {
+							xhr.setRequestHeader( i, headers[ i ] + "" );
+						}
+					}
 
-jQuery.Animation = jQuery.extend( Animation, {
+					// Do send the request
+					// This may raise an exception which is actually
+					// handled in jQuery.ajax (so no try/catch here)
+					xhr.send( ( options.hasContent && options.data ) || null );
 
-	tweener: function( props, callback ) {
-		if ( jQuery.isFunction( props ) ) {
-			callback = props;
-			props = [ "*" ];
-		} else {
-			props = props.split(" ");
-		}
+					// Listener
+					callback = function( _, isAbort ) {
+						var status, statusText, responses;
+
+						// Was never called and is aborted or complete
+						if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+							// Clean up
+							delete xhrCallbacks[ id ];
+							callback = undefined;
+							xhr.onreadystatechange = jQuery.noop;
+
+							// Abort manually if needed
+							if ( isAbort ) {
+								if ( xhr.readyState !== 4 ) {
+									xhr.abort();
+								}
+							} else {
+								responses = {};
+								status = xhr.status;
+
+								// Support: IE<10
+								// Accessing binary-data responseText throws an exception
+								// (#11426)
+								if ( typeof xhr.responseText === "string" ) {
+									responses.text = xhr.responseText;
+								}
 
-		var prop,
-			index = 0,
-			length = props.length;
+								// Firefox throws an exception when accessing
+								// statusText for faulty cross-domain requests
+								try {
+									statusText = xhr.statusText;
+								} catch( e ) {
+									// We normalize with Webkit giving an empty statusText
+									statusText = "";
+								}
 
-		for ( ; index < length ; index++ ) {
-			prop = props[ index ];
-			tweeners[ prop ] = tweeners[ prop ] || [];
-			tweeners[ prop ].unshift( callback );
-		}
-	},
+								// Filter status for non standard behaviors
 
-	prefilter: function( callback, prepend ) {
-		if ( prepend ) {
-			animationPrefilters.unshift( callback );
-		} else {
-			animationPrefilters.push( callback );
-		}
-	}
-});
+								// If the request is local and we have data: assume a success
+								// (success with no data won't get notified, that's the best we
+								// can do given current implementations)
+								if ( !status && options.isLocal && !options.crossDomain ) {
+									status = responses.text ? 200 : 404;
+								// IE - #1450: sometimes returns 1223 when it should be 204
+								} else if ( status === 1223 ) {
+									status = 204;
+								}
+							}
+						}
 
-function defaultPrefilter( elem, props, opts ) {
-	/* jshint validthis: true */
-	var prop, value, toggle, tween, hooks, oldfire,
-		anim = this,
-		orig = {},
-		style = elem.style,
-		hidden = elem.nodeType && isHidden( elem ),
-		dataShow = jQuery._data( elem, "fxshow" );
+						// Call complete if needed
+						if ( responses ) {
+							complete( status, statusText, responses, xhr.getAllResponseHeaders() );
+						}
+					};
 
-	// handle queue: false promises
-	if ( !opts.queue ) {
-		hooks = jQuery._queueHooks( elem, "fx" );
-		if ( hooks.unqueued == null ) {
-			hooks.unqueued = 0;
-			oldfire = hooks.empty.fire;
-			hooks.empty.fire = function() {
-				if ( !hooks.unqueued ) {
-					oldfire();
+					if ( !options.async ) {
+						// if we're in sync mode we fire the callback
+						callback();
+					} else if ( xhr.readyState === 4 ) {
+						// (IE6 & IE7) if it's in cache and has been
+						// retrieved directly we need to fire the callback
+						setTimeout( callback );
+					} else {
+						// Add to the list of active xhr callbacks
+						xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
+					}
+				},
+
+				abort: function() {
+					if ( callback ) {
+						callback( undefined, true );
+					}
 				}
 			};
 		}
-		hooks.unqueued++;
+	});
+}
 
-		anim.always(function() {
-			// doing this makes sure that the complete handler will be called
-			// before this completes
-			anim.always(function() {
-				hooks.unqueued--;
-				if ( !jQuery.queue( elem, "fx" ).length ) {
-					hooks.empty.fire();
-				}
-			});
-		});
-	}
+// Functions to create xhrs
+function createStandardXHR() {
+	try {
+		return new window.XMLHttpRequest();
+	} catch( e ) {}
+}
 
-	// height/width overflow pass
-	if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
-		// Make sure that nothing sneaks out
-		// Record all 3 overflow attributes because IE does not
-		// change the overflow attribute when overflowX and
-		// overflowY are set to the same value
-		opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+function createActiveXHR() {
+	try {
+		return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+	} catch( e ) {}
+}
 
-		// Set display property to inline-block for height/width
-		// animations on inline elements that are having width/height animated
-		if ( jQuery.css( elem, "display" ) === "inline" &&
-				jQuery.css( elem, "float" ) === "none" ) {
 
-			// inline-level elements accept inline-block;
-			// block-level elements need to be inline with layout
-			if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
-				style.display = "inline-block";
 
-			} else {
-				style.zoom = 1;
-			}
-		}
-	}
 
-	if ( opts.overflow ) {
-		style.overflow = "hidden";
-		if ( !jQuery.support.shrinkWrapBlocks ) {
-			anim.always(function() {
-				style.overflow = opts.overflow[ 0 ];
-				style.overflowX = opts.overflow[ 1 ];
-				style.overflowY = opts.overflow[ 2 ];
-			});
+// Install script dataType
+jQuery.ajaxSetup({
+	accepts: {
+		script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+	},
+	contents: {
+		script: /(?:java|ecma)script/
+	},
+	converters: {
+		"text script": function( text ) {
+			jQuery.globalEval( text );
+			return text;
 		}
 	}
+});
 
-
-	// show/hide pass
-	for ( prop in props ) {
-		value = props[ prop ];
-		if ( rfxtypes.exec( value ) ) {
-			delete props[ prop ];
-			toggle = toggle || value === "toggle";
-			if ( value === ( hidden ? "hide" : "show" ) ) {
-				continue;
-			}
-			orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
-		}
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+	if ( s.cache === undefined ) {
+		s.cache = false;
+	}
+	if ( s.crossDomain ) {
+		s.type = "GET";
+		s.global = false;
 	}
+});
 
-	if ( !jQuery.isEmptyObject( orig ) ) {
-		if ( dataShow ) {
-			if ( "hidden" in dataShow ) {
-				hidden = dataShow.hidden;
-			}
-		} else {
-			dataShow = jQuery._data( elem, "fxshow", {} );
-		}
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
 
-		// store state if its toggle - enables .stop().toggle() to "reverse"
-		if ( toggle ) {
-			dataShow.hidden = !hidden;
-		}
-		if ( hidden ) {
-			jQuery( elem ).show();
-		} else {
-			anim.done(function() {
-				jQuery( elem ).hide();
-			});
-		}
-		anim.done(function() {
-			var prop;
-			jQuery._removeData( elem, "fxshow" );
-			for ( prop in orig ) {
-				jQuery.style( elem, prop, orig[ prop ] );
-			}
-		});
-		for ( prop in orig ) {
-			tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
+	// This transport only deals with cross domain requests
+	if ( s.crossDomain ) {
 
-			if ( !( prop in dataShow ) ) {
-				dataShow[ prop ] = tween.start;
-				if ( hidden ) {
-					tween.end = tween.start;
-					tween.start = prop === "width" || prop === "height" ? 1 : 0;
-				}
-			}
-		}
-	}
-}
+		var script,
+			head = document.head || jQuery("head")[0] || document.documentElement;
+
+		return {
 
-function Tween( elem, options, prop, end, easing ) {
-	return new Tween.prototype.init( elem, options, prop, end, easing );
-}
-jQuery.Tween = Tween;
+			send: function( _, callback ) {
 
-Tween.prototype = {
-	constructor: Tween,
-	init: function( elem, options, prop, end, easing, unit ) {
-		this.elem = elem;
-		this.prop = prop;
-		this.easing = easing || "swing";
-		this.options = options;
-		this.start = this.now = this.cur();
-		this.end = end;
-		this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
-	},
-	cur: function() {
-		var hooks = Tween.propHooks[ this.prop ];
+				script = document.createElement("script");
 
-		return hooks && hooks.get ?
-			hooks.get( this ) :
-			Tween.propHooks._default.get( this );
-	},
-	run: function( percent ) {
-		var eased,
-			hooks = Tween.propHooks[ this.prop ];
+				script.async = true;
 
-		if ( this.options.duration ) {
-			this.pos = eased = jQuery.easing[ this.easing ](
-				percent, this.options.duration * percent, 0, 1, this.options.duration
-			);
-		} else {
-			this.pos = eased = percent;
-		}
-		this.now = ( this.end - this.start ) * eased + this.start;
+				if ( s.scriptCharset ) {
+					script.charset = s.scriptCharset;
+				}
 
-		if ( this.options.step ) {
-			this.options.step.call( this.elem, this.now, this );
-		}
+				script.src = s.url;
 
-		if ( hooks && hooks.set ) {
-			hooks.set( this );
-		} else {
-			Tween.propHooks._default.set( this );
-		}
-		return this;
-	}
-};
+				// Attach handlers for all browsers
+				script.onload = script.onreadystatechange = function( _, isAbort ) {
 
-Tween.prototype.init.prototype = Tween.prototype;
+					if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
 
-Tween.propHooks = {
-	_default: {
-		get: function( tween ) {
-			var result;
+						// Handle memory leak in IE
+						script.onload = script.onreadystatechange = null;
 
-			if ( tween.elem[ tween.prop ] != null &&
-				(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
-				return tween.elem[ tween.prop ];
-			}
+						// Remove the script
+						if ( script.parentNode ) {
+							script.parentNode.removeChild( script );
+						}
 
-			// passing an empty string as a 3rd parameter to .css will automatically
-			// attempt a parseFloat and fallback to a string if the parse fails
-			// so, simple values such as "10px" are parsed to Float.
-			// complex values such as "rotate(1rad)" are returned as is.
-			result = jQuery.css( tween.elem, tween.prop, "" );
-			// Empty strings, null, undefined and "auto" are converted to 0.
-			return !result || result === "auto" ? 0 : result;
-		},
-		set: function( tween ) {
-			// use step hook for back compat - use cssHook if its there - use .style if its
-			// available and use plain properties where available
-			if ( jQuery.fx.step[ tween.prop ] ) {
-				jQuery.fx.step[ tween.prop ]( tween );
-			} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
-				jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
-			} else {
-				tween.elem[ tween.prop ] = tween.now;
-			}
-		}
-	}
-};
+						// Dereference the script
+						script = null;
 
-// Support: IE <=9
-// Panic based approach to setting things on disconnected nodes
+						// Callback if not abort
+						if ( !isAbort ) {
+							callback( 200, "success" );
+						}
+					}
+				};
 
-Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
-	set: function( tween ) {
-		if ( tween.elem.nodeType && tween.elem.parentNode ) {
-			tween.elem[ tween.prop ] = tween.now;
-		}
-	}
-};
+				// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
+				// Use native DOM manipulation to avoid our domManip AJAX trickery
+				head.insertBefore( script, head.firstChild );
+			},
 
-jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
-	var cssFn = jQuery.fn[ name ];
-	jQuery.fn[ name ] = function( speed, easing, callback ) {
-		return speed == null || typeof speed === "boolean" ?
-			cssFn.apply( this, arguments ) :
-			this.animate( genFx( name, true ), speed, easing, callback );
-	};
+			abort: function() {
+				if ( script ) {
+					script.onload( undefined, true );
+				}
+			}
+		};
+	}
 });
 
-jQuery.fn.extend({
-	fadeTo: function( speed, to, easing, callback ) {
 
-		// show any hidden elements after setting opacity to 0
-		return this.filter( isHidden ).css( "opacity", 0 ).show()
 
-			// animate to the value specified
-			.end().animate({ opacity: to }, speed, easing, callback );
-	},
-	animate: function( prop, speed, easing, callback ) {
-		var empty = jQuery.isEmptyObject( prop ),
-			optall = jQuery.speed( speed, easing, callback ),
-			doAnimation = function() {
-				// Operate on a copy of prop so per-property easing won't be lost
-				var anim = Animation( this, jQuery.extend( {}, prop ), optall );
 
-				// Empty animations, or finishing resolves immediately
-				if ( empty || jQuery._data( this, "finish" ) ) {
-					anim.stop( true );
-				}
-			};
-			doAnimation.finish = doAnimation;
+var oldCallbacks = [],
+	rjsonp = /(=)\?(?=&|$)|\?\?/;
 
-		return empty || optall.queue === false ?
-			this.each( doAnimation ) :
-			this.queue( optall.queue, doAnimation );
-	},
-	stop: function( type, clearQueue, gotoEnd ) {
-		var stopQueue = function( hooks ) {
-			var stop = hooks.stop;
-			delete hooks.stop;
-			stop( gotoEnd );
-		};
+// Default jsonp settings
+jQuery.ajaxSetup({
+	jsonp: "callback",
+	jsonpCallback: function() {
+		var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
+		this[ callback ] = true;
+		return callback;
+	}
+});
 
-		if ( typeof type !== "string" ) {
-			gotoEnd = clearQueue;
-			clearQueue = type;
-			type = undefined;
-		}
-		if ( clearQueue && type !== false ) {
-			this.queue( type || "fx", [] );
-		}
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
 
-		return this.each(function() {
-			var dequeue = true,
-				index = type != null && type + "queueHooks",
-				timers = jQuery.timers,
-				data = jQuery._data( this );
+	var callbackName, overwritten, responseContainer,
+		jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+			"url" :
+			typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
+		);
 
-			if ( index ) {
-				if ( data[ index ] && data[ index ].stop ) {
-					stopQueue( data[ index ] );
-				}
-			} else {
-				for ( index in data ) {
-					if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
-						stopQueue( data[ index ] );
-					}
-				}
-			}
+	// Handle iff the expected data type is "jsonp" or we have a parameter to set
+	if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
 
-			for ( index = timers.length; index--; ) {
-				if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
-					timers[ index ].anim.stop( gotoEnd );
-					dequeue = false;
-					timers.splice( index, 1 );
-				}
-			}
+		// Get callback name, remembering preexisting value associated with it
+		callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+			s.jsonpCallback() :
+			s.jsonpCallback;
 
-			// start the next in the queue if the last step wasn't forced
-			// timers currently will call their complete callbacks, which will dequeue
-			// but only if they were gotoEnd
-			if ( dequeue || !gotoEnd ) {
-				jQuery.dequeue( this, type );
-			}
-		});
-	},
-	finish: function( type ) {
-		if ( type !== false ) {
-			type = type || "fx";
+		// Insert callback into url or form data
+		if ( jsonProp ) {
+			s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+		} else if ( s.jsonp !== false ) {
+			s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
 		}
-		return this.each(function() {
-			var index,
-				data = jQuery._data( this ),
-				queue = data[ type + "queue" ],
-				hooks = data[ type + "queueHooks" ],
-				timers = jQuery.timers,
-				length = queue ? queue.length : 0;
 
-			// enable finishing flag on private data
-			data.finish = true;
+		// Use data converter to retrieve json after script execution
+		s.converters["script json"] = function() {
+			if ( !responseContainer ) {
+				jQuery.error( callbackName + " was not called" );
+			}
+			return responseContainer[ 0 ];
+		};
 
-			// empty the queue first
-			jQuery.queue( this, type, [] );
+		// force json dataType
+		s.dataTypes[ 0 ] = "json";
 
-			if ( hooks && hooks.stop ) {
-				hooks.stop.call( this, true );
-			}
+		// Install callback
+		overwritten = window[ callbackName ];
+		window[ callbackName ] = function() {
+			responseContainer = arguments;
+		};
+
+		// Clean-up function (fires after converters)
+		jqXHR.always(function() {
+			// Restore preexisting value
+			window[ callbackName ] = overwritten;
+
+			// Save back as free
+			if ( s[ callbackName ] ) {
+				// make sure that re-using the options doesn't screw things around
+				s.jsonpCallback = originalSettings.jsonpCallback;
 
-			// look for any active animations, and finish them
-			for ( index = timers.length; index--; ) {
-				if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
-					timers[ index ].anim.stop( true );
-					timers.splice( index, 1 );
-				}
+				// save the callback name for future use
+				oldCallbacks.push( callbackName );
 			}
 
-			// look for any animations in the old queue and finish them
-			for ( index = 0; index < length; index++ ) {
-				if ( queue[ index ] && queue[ index ].finish ) {
-					queue[ index ].finish.call( this );
-				}
+			// Call if it was a function and we have a response
+			if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+				overwritten( responseContainer[ 0 ] );
 			}
 
-			// turn off finishing flag
-			delete data.finish;
+			responseContainer = overwritten = undefined;
 		});
+
+		// Delegate to script
+		return "script";
 	}
 });
 
-// Generate parameters to create a standard animation
-function genFx( type, includeWidth ) {
-	var which,
-		attrs = { height: type },
-		i = 0;
 
-	// if we include width, step value is 1 to do all cssExpand values,
-	// if we don't include width, step value is 2 to skip over Left and Right
-	includeWidth = includeWidth? 1 : 0;
-	for( ; i < 4 ; i += 2 - includeWidth ) {
-		which = cssExpand[ i ];
-		attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+
+
+// data: string of html
+// context (optional): If specified, the fragment will be created in this context, defaults to document
+// keepScripts (optional): If true, will include scripts passed in the html string
+jQuery.parseHTML = function( data, context, keepScripts ) {
+	if ( !data || typeof data !== "string" ) {
+		return null;
+	}
+	if ( typeof context === "boolean" ) {
+		keepScripts = context;
+		context = false;
 	}
+	context = context || document;
 
-	if ( includeWidth ) {
-		attrs.opacity = attrs.width = type;
+	var parsed = rsingleTag.exec( data ),
+		scripts = !keepScripts && [];
+
+	// Single tag
+	if ( parsed ) {
+		return [ context.createElement( parsed[1] ) ];
 	}
 
-	return attrs;
-}
+	parsed = jQuery.buildFragment( [ data ], context, scripts );
 
-// Generate shortcuts for custom animations
-jQuery.each({
-	slideDown: genFx("show"),
-	slideUp: genFx("hide"),
-	slideToggle: genFx("toggle"),
-	fadeIn: { opacity: "show" },
-	fadeOut: { opacity: "hide" },
-	fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
-	jQuery.fn[ name ] = function( speed, easing, callback ) {
-		return this.animate( props, speed, easing, callback );
-	};
-});
+	if ( scripts && scripts.length ) {
+		jQuery( scripts ).remove();
+	}
 
-jQuery.speed = function( speed, easing, fn ) {
-	var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
-		complete: fn || !fn && easing ||
-			jQuery.isFunction( speed ) && speed,
-		duration: speed,
-		easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
-	};
+	return jQuery.merge( [], parsed.childNodes );
+};
 
-	opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
-		opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
 
-	// normalize opt.queue - true/undefined/null -> "fx"
-	if ( opt.queue == null || opt.queue === true ) {
-		opt.queue = "fx";
+// Keep a copy of the old load method
+var _load = jQuery.fn.load;
+
+/**
+ * Load a url into a page
+ */
+jQuery.fn.load = function( url, params, callback ) {
+	if ( typeof url !== "string" && _load ) {
+		return _load.apply( this, arguments );
 	}
 
-	// Queueing
-	opt.old = opt.complete;
+	var selector, response, type,
+		self = this,
+		off = url.indexOf(" ");
 
-	opt.complete = function() {
-		if ( jQuery.isFunction( opt.old ) ) {
-			opt.old.call( this );
-		}
+	if ( off >= 0 ) {
+		selector = jQuery.trim( url.slice( off, url.length ) );
+		url = url.slice( 0, off );
+	}
 
-		if ( opt.queue ) {
-			jQuery.dequeue( this, opt.queue );
-		}
-	};
+	// If it's a function
+	if ( jQuery.isFunction( params ) ) {
 
-	return opt;
-};
+		// We assume that it's the callback
+		callback = params;
+		params = undefined;
 
-jQuery.easing = {
-	linear: function( p ) {
-		return p;
-	},
-	swing: function( p ) {
-		return 0.5 - Math.cos( p*Math.PI ) / 2;
+	// Otherwise, build a param string
+	} else if ( params && typeof params === "object" ) {
+		type = "POST";
 	}
-};
 
-jQuery.timers = [];
-jQuery.fx = Tween.prototype.init;
-jQuery.fx.tick = function() {
-	var timer,
-		timers = jQuery.timers,
-		i = 0;
+	// If we have elements to modify, make the request
+	if ( self.length > 0 ) {
+		jQuery.ajax({
+			url: url,
 
-	fxNow = jQuery.now();
+			// if "type" variable is undefined, then "GET" method will be used
+			type: type,
+			dataType: "html",
+			data: params
+		}).done(function( responseText ) {
 
-	for ( ; i < timers.length; i++ ) {
-		timer = timers[ i ];
-		// Checks the timer has not already been removed
-		if ( !timer() && timers[ i ] === timer ) {
-			timers.splice( i--, 1 );
-		}
-	}
+			// Save response for use in complete callback
+			response = arguments;
 
-	if ( !timers.length ) {
-		jQuery.fx.stop();
-	}
-	fxNow = undefined;
-};
+			self.html( selector ?
 
-jQuery.fx.timer = function( timer ) {
-	if ( timer() && jQuery.timers.push( timer ) ) {
-		jQuery.fx.start();
-	}
-};
+				// If a selector was specified, locate the right elements in a dummy div
+				// Exclude scripts to avoid IE 'Permission Denied' errors
+				jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
 
-jQuery.fx.interval = 13;
+				// Otherwise use the full result
+				responseText );
 
-jQuery.fx.start = function() {
-	if ( !timerId ) {
-		timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+		}).complete( callback && function( jqXHR, status ) {
+			self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+		});
 	}
-};
 
-jQuery.fx.stop = function() {
-	clearInterval( timerId );
-	timerId = null;
+	return this;
 };
 
-jQuery.fx.speeds = {
-	slow: 600,
-	fast: 200,
-	// Default speed
-	_default: 400
-};
 
-// Back Compat <1.8 extension point
-jQuery.fx.step = {};
 
-if ( jQuery.expr && jQuery.expr.filters ) {
-	jQuery.expr.filters.animated = function( elem ) {
-		return jQuery.grep(jQuery.timers, function( fn ) {
-			return elem === fn.elem;
-		}).length;
-	};
-}
-jQuery.fn.offset = function( options ) {
-	if ( arguments.length ) {
-		return options === undefined ?
-			this :
-			this.each(function( i ) {
-				jQuery.offset.setOffset( this, options, i );
-			});
-	}
 
-	var docElem, win,
-		box = { top: 0, left: 0 },
-		elem = this[ 0 ],
-		doc = elem && elem.ownerDocument;
+jQuery.expr.filters.animated = function( elem ) {
+	return jQuery.grep(jQuery.timers, function( fn ) {
+		return elem === fn.elem;
+	}).length;
+};
 
-	if ( !doc ) {
-		return;
-	}
 
-	docElem = doc.documentElement;
 
-	// Make sure it's not a disconnected DOM node
-	if ( !jQuery.contains( docElem, elem ) ) {
-		return box;
-	}
 
-	// If we don't have gBCR, just use 0,0 rather than error
-	// BlackBerry 5, iOS 3 (original iPhone)
-	if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
-		box = elem.getBoundingClientRect();
-	}
-	win = getWindow( doc );
-	return {
-		top: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),
-		left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
-	};
-};
 
-jQuery.offset = {
+var docElem = window.document.documentElement;
+
+/**
+ * Gets a window from an element
+ */
+function getWindow( elem ) {
+	return jQuery.isWindow( elem ) ?
+		elem :
+		elem.nodeType === 9 ?
+			elem.defaultView || elem.parentWindow :
+			false;
+}
 
+jQuery.offset = {
 	setOffset: function( elem, options, i ) {
-		var position = jQuery.css( elem, "position" );
+		var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
+			position = jQuery.css( elem, "position" ),
+			curElem = jQuery( elem ),
+			props = {};
 
 		// set position first, in-case top/left are set even on static elem
 		if ( position === "static" ) {
 			elem.style.position = "relative";
 		}
 
-		var curElem = jQuery( elem ),
-			curOffset = curElem.offset(),
-			curCSSTop = jQuery.css( elem, "top" ),
-			curCSSLeft = jQuery.css( elem, "left" ),
-			calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
-			props = {}, curPosition = {}, curTop, curLeft;
+		curOffset = curElem.offset();
+		curCSSTop = jQuery.css( elem, "top" );
+		curCSSLeft = jQuery.css( elem, "left" );
+		calculatePosition = ( position === "absolute" || position === "fixed" ) &&
+			jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
 
 		// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
 		if ( calculatePosition ) {
@@ -9626,8 +10066,43 @@ jQuery.offset = {
 	}
 };
 
-
 jQuery.fn.extend({
+	offset: function( options ) {
+		if ( arguments.length ) {
+			return options === undefined ?
+				this :
+				this.each(function( i ) {
+					jQuery.offset.setOffset( this, options, i );
+				});
+		}
+
+		var docElem, win,
+			box = { top: 0, left: 0 },
+			elem = this[ 0 ],
+			doc = elem && elem.ownerDocument;
+
+		if ( !doc ) {
+			return;
+		}
+
+		docElem = doc.documentElement;
+
+		// Make sure it's not a disconnected DOM node
+		if ( !jQuery.contains( docElem, elem ) ) {
+			return box;
+		}
+
+		// If we don't have gBCR, just use 0,0 rather than error
+		// BlackBerry 5, iOS 3 (original iPhone)
+		if ( typeof elem.getBoundingClientRect !== strundefined ) {
+			box = elem.getBoundingClientRect();
+		}
+		win = getWindow( doc );
+		return {
+			top: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),
+			left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
+		};
+	},
 
 	position: function() {
 		if ( !this[ 0 ] ) {
@@ -9638,7 +10113,7 @@ jQuery.fn.extend({
 			parentOffset = { top: 0, left: 0 },
 			elem = this[ 0 ];
 
-		// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
+		// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
 		if ( jQuery.css( elem, "position" ) === "fixed" ) {
 			// we assume that getBoundingClientRect is available when computed position is fixed
 			offset = elem.getBoundingClientRect();
@@ -9669,7 +10144,8 @@ jQuery.fn.extend({
 	offsetParent: function() {
 		return this.map(function() {
 			var offsetParent = this.offsetParent || docElem;
-			while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
+
+			while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
 				offsetParent = offsetParent.offsetParent;
 			}
 			return offsetParent || docElem;
@@ -9677,13 +10153,12 @@ jQuery.fn.extend({
 	}
 });
 
-
 // Create scrollLeft and scrollTop methods
-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
+jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
 	var top = /Y/.test( prop );
 
 	jQuery.fn[ method ] = function( val ) {
-		return jQuery.access( this, function( elem, method, val ) {
+		return access( this, function( elem, method, val ) {
 			var win = getWindow( elem );
 
 			if ( val === undefined ) {
@@ -9705,13 +10180,25 @@ jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( me
 	};
 });
 
-function getWindow( elem ) {
-	return jQuery.isWindow( elem ) ?
-		elem :
-		elem.nodeType === 9 ?
-			elem.defaultView || elem.parentWindow :
-			false;
-}
+// Add the top/left cssHooks using jQuery.fn.position
+// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+// getComputedStyle returns percent when specified for top/left/bottom/right
+// rather than make the css module depend on the offset module, we just check for it here
+jQuery.each( [ "top", "left" ], function( i, prop ) {
+	jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
+		function( elem, computed ) {
+			if ( computed ) {
+				computed = curCSS( elem, prop );
+				// if curCSS returns percentage, fallback to offset
+				return rnumnonpx.test( computed ) ?
+					jQuery( elem ).position()[ prop ] + "px" :
+					computed;
+			}
+		}
+	);
+});
+
+
 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
 	jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
@@ -9720,7 +10207,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
 			var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
 				extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
 
-			return jQuery.access( this, function( elem, type, value ) {
+			return access( this, function( elem, type, value ) {
 				var doc;
 
 				if ( jQuery.isWindow( elem ) ) {
@@ -9753,8 +10240,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
 		};
 	});
 });
-// Limit scope pollution from any deprecated API
-// (function() {
+
 
 // The number of elements contained in the matched element set
 jQuery.fn.size = function() {
@@ -9763,27 +10249,60 @@ jQuery.fn.size = function() {
 
 jQuery.fn.andSelf = jQuery.fn.addBack;
 
-// })();
-if ( typeof module === "object" && module && typeof module.exports === "object" ) {
-	// Expose jQuery as module.exports in loaders that implement the Node
-	// module pattern (including browserify). Do not create the global, since
-	// the user will be storing it themselves locally, and globals are frowned
-	// upon in the Node module world.
-	module.exports = jQuery;
-} else {
-	// Otherwise expose jQuery to the global object as usual
-	window.jQuery = window.$ = jQuery;
 
-	// Register as a named AMD module, since jQuery can be concatenated with other
-	// files that may use define, but not via a proper concatenation script that
-	// understands anonymous AMD modules. A named AMD is safest and most robust
-	// way to register. Lowercase jquery is used because AMD module names are
-	// derived from file names, and jQuery is normally delivered in a lowercase
-	// file name. Do this after creating the global so that if an AMD module wants
-	// to call noConflict to hide this version of jQuery, it will work.
-	if ( typeof define === "function" && define.amd ) {
-		define( "jquery", [], function () { return jQuery; } );
+
+
+// Register as a named AMD module, since jQuery can be concatenated with other
+// files that may use define, but not via a proper concatenation script that
+// understands anonymous AMD modules. A named AMD is safest and most robust
+// way to register. Lowercase jquery is used because AMD module names are
+// derived from file names, and jQuery is normally delivered in a lowercase
+// file name. Do this after creating the global so that if an AMD module wants
+// to call noConflict to hide this version of jQuery, it will work.
+
+// Note that for maximum portability, libraries that are not jQuery should
+// declare themselves as anonymous modules, and avoid setting a global if an
+// AMD loader is present. jQuery is a special case. For more information, see
+// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
+
+if ( typeof define === "function" && define.amd ) {
+	define( "jquery", [], function() {
+		return jQuery;
+	});
+}
+
+
+
+
+var
+	// Map over jQuery in case of overwrite
+	_jQuery = window.jQuery,
+
+	// Map over the $ in case of overwrite
+	_$ = window.$;
+
+jQuery.noConflict = function( deep ) {
+	if ( window.$ === jQuery ) {
+		window.$ = _$;
+	}
+
+	if ( deep && window.jQuery === jQuery ) {
+		window.jQuery = _jQuery;
 	}
+
+	return jQuery;
+};
+
+// Expose jQuery and $ identifiers, even in
+// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
+// and CommonJS for browser emulators (#13566)
+if ( typeof noGlobal === strundefined ) {
+	window.jQuery = window.$ = jQuery;
 }
 
-})( window );
+
+
+
+return jQuery;
+
+}));
diff --git a/lib/scripts/jquery/jquery.min.js b/lib/scripts/jquery/jquery.min.js
index ce1b6b6e0b0b5ce5af1d689f7b5b1f2c5b063fd6..ab28a24729b320bffd3d2f60302af949db39ab85 100644
--- a/lib/scripts/jquery/jquery.min.js
+++ b/lib/scripts/jquery/jquery.min.js
@@ -1,5 +1,4 @@
-/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
-*/
-(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.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%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
-}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
-u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
+/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;
+if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")
+},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
diff --git a/lib/scripts/jquery/update.sh b/lib/scripts/jquery/update.sh
index 719a0829d718ebb45184b6a0eae15feb5cd32785..741fcff1cf4d6789f7077f48d838f72f822275e1 100755
--- a/lib/scripts/jquery/update.sh
+++ b/lib/scripts/jquery/update.sh
@@ -1,46 +1,50 @@
 #!/bin/sh
 #
-# This script loads the latest jQuery and jQuery-UI 1.* versions from Google's and jQuery's CDN
+# This script loads the latest jQuery and jQuery-UI 1.* versions from jQuery's CDN
 #
 # It also loads the 'smoothness' jQuery-UI theme and all referenced images.
 #
 # @author Andreas Gohr <andi@splitbrain.org>
 # @author Stefan Grönke <stefan@gronke.net>
-# @link   https://code.google.com/apis/libraries/devguide.html#jquery
 # @link   http://code.jquery.com/
 
+# Adjust version for jQuery-UI here - there's no good latest link
+JQUI_VERSION='1.11.0'
+JQUI_HOST="https://code.jquery.com/ui/$JQUI_VERSION"
+JQUI_GIT="https://raw.githubusercontent.com/jquery/jquery-ui/$JQUI_VERSION/ui"
+
 # load jQuery
 wget -nv http://code.jquery.com/jquery-latest.min.js      -O jquery.min.js
 wget -nv http://code.jquery.com/jquery-latest.js          -O jquery.js
 
 # load jQuery-UI
-wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js -O jquery-ui.min.js
-wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.js     -O jquery-ui.js
+wget -nv "$JQUI_HOST/jquery-ui.min.js" -O jquery-ui.min.js
+wget -nv "$JQUI_HOST/jquery-ui.js"     -O jquery-ui.js
 
 # load the smoothness theme
 mkdir -p jquery-ui-theme/images
-wget -nv -qO- https://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/smoothness/jquery-ui.css | sed "s/font-family:[^;]*;//" > jquery-ui-theme/smoothness.css
+wget -nv -qO- "$JQUI_HOST/themes/smoothness/jquery-ui.css" | sed "s/font-family:[^;]*;//" > jquery-ui-theme/smoothness.css
 images=`gawk 'match($0, /url\("?(images\/[^\)"]+)"?\)/, m) { print m[1] }' jquery-ui-theme/smoothness.css`
 for img in $images
 do
-    wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/smoothness/$img -O jquery-ui-theme/$img
+    wget -nv "$JQUI_HOST/themes/smoothness/$img" -O jquery-ui-theme/$img
 done
 
 # load the localization data for jquery ui
 for LNG in ../../../inc/lang/*
 do
     CODE=`basename $LNG`
-    wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/i18n/jquery.ui.datepicker-$CODE.js -O $LNG/jquery.ui.datepicker.js
+    wget -nv "$JQUI_GIT/i18n/datepicker-$CODE.js" -O $LNG/jquery.ui.datepicker.js
     if [ ! -s "$LNG/jquery.ui.datepicker.js" ]; then
         rm -f $LNG/jquery.ui.datepicker.js
     fi
 done
 
 # some custom language codes
-wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/i18n/jquery.ui.datepicker-de.js -O ../../../inc/lang/de-informal/jquery.ui.datepicker.js
-wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/i18n/jquery.ui.datepicker-pt-BR.js -O ../../../inc/lang/pt-br/jquery.ui.datepicker.js
-wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/i18n/jquery.ui.datepicker-zh-CN.js -O ../../../inc/lang/zh/jquery.ui.datepicker.js
-wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/i18n/jquery.ui.datepicker-zh-TW.js -O ../../../inc/lang/zh-tw/jquery.ui.datepicker.js
+wget -nv "$JQUI_GIT/i18n/datepicker-de.js" -O ../../../inc/lang/de-informal/jquery.ui.datepicker.js
+wget -nv "$JQUI_GIT/i18n/datepicker-pt-BR.js" -O ../../../inc/lang/pt-br/jquery.ui.datepicker.js
+wget -nv "$JQUI_GIT/i18n/datepicker-zh-CN.js" -O ../../../inc/lang/zh/jquery.ui.datepicker.js
+wget -nv "$JQUI_GIT/i18n/datepicker-zh-TW.js" -O ../../../inc/lang/zh-tw/jquery.ui.datepicker.js
 
 # strip source maps
 sed -i '/sourceMappingURL/d' *.min.js
diff --git a/lib/tpl/dokuwiki/css/sites/abcwiki.css b/lib/tpl/dokuwiki/css/sites/abcwiki.css
deleted file mode 100644
index 9f436516bd430abc477047b22a5f37e6ddc167fb..0000000000000000000000000000000000000000
--- a/lib/tpl/dokuwiki/css/sites/abcwiki.css
+++ /dev/null
@@ -1,39 +0,0 @@
-
-html,
-body {
-    background-color: #369;
-}
-
-#dokuwiki__header,
-#dokuwiki__aside,
-.docInfo,
-#dokuwiki__footer {
-    color: #fff;
-}
-
-#dokuwiki__header a,
-#dokuwiki__aside a,
-.docInfo a,
-#dokuwiki__footer a {
-    color: #ff9 !important;
-}
-
-h1,
-h2,
-h3,
-h4,
-h5,
-h6 {
-    color: #036;
-}
-
-.dokuwiki div.breadcrumbs {
-    border-top-color: #999;
-    border-bottom-color: #666;
-}
-.dokuwiki div.breadcrumbs div:first-child {
-    border-bottom-color: #999;
-}
-.dokuwiki div.breadcrumbs div:last-child {
-    border-top-color: #666;
-}
diff --git a/lib/tpl/dokuwiki/css/sites/paralis.css b/lib/tpl/dokuwiki/css/sites/paralis.css
deleted file mode 100644
index 201bca936ac90bc9d59fe5d11736e56e07702e92..0000000000000000000000000000000000000000
--- a/lib/tpl/dokuwiki/css/sites/paralis.css
+++ /dev/null
@@ -1,58 +0,0 @@
-
-@media screen {
-
-body {
-    font: normal 100%/1.4 Frutiger, Calibri, "Myriad Pro", Myriad, "Nimbus Sans L", Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;
-}
-
-h1,
-h2,
-h3,
-h4,
-h5,
-h6 {
-    font-family: Constantia, Utopia, Lucidabright, Lucida, Georgia, "Nimbus Roman No9 L", serif;
-    color: @ini_text_neu;
-}
-
-q {
-    font-style: italic;
-}
-
-#dokuwiki__header h1 a {
-    color: @ini_link;
-    font-weight: bold;
-}
-
-div.dokuwiki p.plugin__pagenav {
-    margin: 0 0 1.4em;
-}
-
-
-} /* /@media */
-
-
-#dokuwiki__header h1 {
-    position: relative;
-}
-#dokuwiki__header h1 img {
-    position: absolute;
-    top: -27px;
-    left: -33px;
-    max-width: none;
-}
-#dokuwiki__header h1 {
-    padding-left: 110px;
-}
-#dokuwiki__header p.claim {
-    padding-left: 110px;
-}
-
-
-@media print {
-
-.dokuwiki p.plugin__pagenav {
-    display: none;
-}
-
-} /* /@media */
diff --git a/lib/tpl/dokuwiki/template.info.txt b/lib/tpl/dokuwiki/template.info.txt
index 9d062655df47515be53150ef02f092d07a3cad77..804d595ae39f357b3fe071bc6837790d662b6007 100644
--- a/lib/tpl/dokuwiki/template.info.txt
+++ b/lib/tpl/dokuwiki/template.info.txt
@@ -1,7 +1,7 @@
 base     dokuwiki
 author   Anika Henke
 email    anika@selfthinker.org
-date     2013-05-02
+date     2014-06-04
 name     DokuWiki Template
 desc     DokuWiki's default template since 2012
 url      http://www.dokuwiki.org/template:dokuwiki
diff --git a/lib/tpl/index.php b/lib/tpl/index.php
index 3c00ab8e89c4d6bf212969d97cf7df19723504eb..558f262a7ad4fa090234db761ab67d2048764022 100644
--- a/lib/tpl/index.php
+++ b/lib/tpl/index.php
@@ -46,7 +46,7 @@ require_once(DOKU_INC.'inc/init.php');
 // get merged style.ini
 define('SIMPLE_TEST', true); // hack to prevent css output and headers
 require_once(DOKU_INC.'lib/exe/css.php');
-$ini = css_styleini(tpl_incdir());
+$ini = css_styleini($conf['template']);
 
 if ($ini) {
     echo '<table>';