HM_DeveloperToolbar - Version 2.0.7

Version Notes

+ New design
+ More features
+ Store Offline

Download this release

Release Info

Developer Hai Nguyen
Extension HM_DeveloperToolbar
Version 2.0.7
Comparing to
See all releases


Code changes from version 1.0 to 2.0.7

app/code/community/HM/DeveloperToolbar/controllers/IndexController.php DELETED
@@ -1,71 +0,0 @@
1
- <?php
2
-
3
- class HM_DeveloperToolbar_IndexController extends Mage_Core_Controller_Front_Action
4
- {
5
- public function hintsAction()
6
- {
7
- $enabled = $this->getRequest()->getParam('enabled');
8
- $type = $this->getRequest()->getParam('type');
9
-
10
- $scope = $type === 'front' ? 'stores' : 'default';
11
- $scope_id = $type === 'front' ? Mage::app()->getStore()->getStoreId() : '0';
12
- Mage::getConfig()->saveConfig('dev/debug/template_hints', $enabled, $scope, $scope_id);
13
- Mage::getConfig()->saveConfig('dev/debug/template_hints_blocks', $enabled, $scope, $scope_id);
14
-
15
- $this->_redirectReferer();
16
- }
17
-
18
- public function logAction()
19
- {
20
- $scope = 'stores';
21
- $scope_id = Mage::app()->getStore()->getStoreId();
22
- $enabled = $this->getRequest()->getParam('enabled');
23
- Mage::getConfig()->saveConfig('dev/log/active', $enabled, $scope, $scope_id);
24
- $this->_redirectReferer();
25
- }
26
-
27
- public function jsAction()
28
- {
29
- $scope = 'stores';
30
- $scope_id = Mage::app()->getStore()->getStoreId();
31
- $enabled = $this->getRequest()->getParam('enabled');
32
- Mage::getConfig()->saveConfig('dev/js/merge_files', $enabled, $scope, $scope_id);
33
- $this->_redirectReferer();
34
- }
35
-
36
- public function urlAction()
37
- {
38
- $enabled = $this->getRequest()->getParam('enabled');
39
- Mage::getConfig()->saveConfig('web/url/use_store', $enabled);
40
- $this->_redirectReferer();
41
- }
42
-
43
- public function seoAction()
44
- {
45
- $enabled = $this->getRequest()->getParam('enabled');
46
- Mage::getConfig()->saveConfig('web/seo/use_rewrites', $enabled);
47
- $this->_redirectReferer();
48
- }
49
-
50
- public function translateAction()
51
- {
52
- $scope = 'stores';
53
- $scope_id = Mage::app()->getStore()->getStoreId();
54
- $enabled = $this->getRequest()->getParam('enabled');
55
- Mage::getConfig()->saveConfig('dev/translate_inline/active', $enabled, $scope, $scope_id);
56
- $this->_redirectReferer();
57
- }
58
-
59
- public function cacheAction()
60
- {
61
- Mage::app()->cleanCache();
62
- $cacheTypes = array_keys(Mage::helper('core')->getCacheTypes());
63
- $enable = array();
64
- foreach ($cacheTypes as $type) {
65
- $enable[$type] = 0;
66
- }
67
- Mage::app()->saveUseCache($enable);
68
- $this->_redirectReferer();
69
- }
70
- }
71
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/HM/DeveloperToolbar/etc/config.xml DELETED
@@ -1,35 +0,0 @@
1
- <?xml version="1.0"?>
2
-
3
- <config>
4
- <modules>
5
- <HM_DeveloperToolbar>
6
- <version>1.0.0</version>
7
- </HM_DeveloperToolbar>
8
- </modules>
9
- <frontend>
10
- <routers>
11
- <developertoolbar>
12
- <use>standard</use>
13
- <args>
14
- <module>HM_DeveloperToolbar</module>
15
- <frontName>developertoolbar</frontName>
16
- </args>
17
- </developertoolbar>
18
- </routers>
19
- <layout>
20
- <updates>
21
- <developertoolbar>
22
- <file>developertoolbar.xml</file>
23
- </developertoolbar>
24
- </updates>
25
- </layout>
26
- </frontend>
27
-
28
- <default>
29
- <dev>
30
- <developertoolbar>
31
- <enabled>1</enabled>
32
- </developertoolbar>
33
- </dev>
34
- </default>
35
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/HM/DeveloperToolbar/etc/system.xml DELETED
@@ -1,61 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Magento
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Academic Free License (AFL 3.0)
9
- * that is bundled with this package in the file LICENSE_AFL.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/afl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to license@magentocommerce.com so we can send you a copy immediately.
15
- *
16
- * DISCLAIMER
17
- *
18
- * Do not edit or add to this file if you wish to upgrade Magento to newer
19
- * versions in the future. If you wish to customize Magento for your
20
- * needs please refer to http://www.magentocommerce.com for more information.
21
- *
22
- * @category Mage
23
- * @package Mage_Contacts
24
- * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
25
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
- */
27
- -->
28
- <config>
29
- <sections>
30
- <dev translate="label" module="core">
31
- <label>Developer</label>
32
- <tab>advanced</tab>
33
- <frontend_type>text</frontend_type>
34
- <sort_order>920</sort_order>
35
- <show_in_default>1</show_in_default>
36
- <show_in_website>1</show_in_website>
37
- <show_in_store>1</show_in_store>
38
- <groups>
39
- <developertoolbar translate="label">
40
- <label>Developer Toolbar</label>
41
- <frontend_type>text</frontend_type>
42
- <sort_order>1000</sort_order>
43
- <show_in_default>1</show_in_default>
44
- <show_in_website>1</show_in_website>
45
- <show_in_store>1</show_in_store>
46
- <fields>
47
- <enabled translate="label">
48
- <label>Enabled</label>
49
- <frontend_type>select</frontend_type>
50
- <source_model>adminhtml/system_config_source_yesno</source_model>
51
- <sort_order>20</sort_order>
52
- <show_in_default>1</show_in_default>
53
- <show_in_website>1</show_in_website>
54
- <show_in_store>1</show_in_store>
55
- </enabled>
56
- </fields>
57
- </developertoolbar>
58
- </groups>
59
- </dev>
60
- </sections>
61
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/MW/Developertoolbar/Block/Switch.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Page
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Store and language switcher block
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Core
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class MW_Developertoolbar_Block_Switch extends Mage_Core_Block_Template
35
+ {
36
+ protected $_storeInUrl;
37
+
38
+ public function getCurrentWebsiteId()
39
+ {
40
+ return Mage::app()->getStore()->getWebsiteId();
41
+ }
42
+
43
+ public function getCurrentGroupId()
44
+ {
45
+ return Mage::app()->getStore()->getGroupId();
46
+ }
47
+
48
+ public function getCurrentStoreId()
49
+ {
50
+ return Mage::app()->getStore()->getId();
51
+ }
52
+
53
+ public function getRawGroups()
54
+ {
55
+ if (!$this->hasData('raw_groups')) {
56
+ $websiteGroups = Mage::app()->getWebsite()->getGroups();
57
+
58
+ $groups = array();
59
+ foreach ($websiteGroups as $group) {
60
+ $groups[$group->getId()] = $group;
61
+ }
62
+ $this->setData('raw_groups', $groups);
63
+ }
64
+ return $this->getData('raw_groups');
65
+ }
66
+
67
+ public function getRawStores()
68
+ {
69
+ if (!$this->hasData('raw_stores')) {
70
+ $websiteStores = Mage::app()->getWebsite()->getStores();
71
+ $stores = array();
72
+ foreach ($websiteStores as $store) {
73
+ /* @var $store Mage_Core_Model_Store */
74
+ if (!$store->getIsActive()) {
75
+ continue;
76
+ }
77
+ $store->setLocaleCode(Mage::getStoreConfig('general/locale/code', $store->getId()));
78
+
79
+ $params = array(
80
+ '_query' => array()
81
+ );
82
+ if (!$this->isStoreInUrl()) {
83
+ $params['_query']['___store'] = $store->getCode();
84
+ }
85
+ $baseUrl = $store->getUrl('', $params);
86
+
87
+ $store->setHomeUrl($baseUrl);
88
+ $stores[$store->getGroupId()][$store->getId()] = $store;
89
+ }
90
+ $this->setData('raw_stores', $stores);
91
+ }
92
+ return $this->getData('raw_stores');
93
+ }
94
+
95
+ public function getGroups()
96
+ {
97
+ if (!$this->hasData('groups')) {
98
+ $rawGroups = $this->getRawGroups();
99
+ $rawStores = $this->getRawStores();
100
+
101
+ $groups = array();
102
+ $localeCode = Mage::getStoreConfig('general/locale/code');
103
+ foreach ($rawGroups as $group) {
104
+ if (!isset($rawStores[$group->getId()])) {
105
+ continue;
106
+ }
107
+ if ($group->getId() == $this->getCurrentGroupId()) {
108
+ $groups[] = $group;
109
+ continue;
110
+ }
111
+ $store = false;
112
+ foreach ($rawStores[$group->getId()] as $s) {
113
+ if ($s->getLocaleCode() == $localeCode) {
114
+ $store = $s;
115
+ break;
116
+ }
117
+ }
118
+ if (!$store && isset($rawStores[$group->getId()][$group->getDefaultStoreId()])) {
119
+ $store = $rawStores[$group->getId()][$group->getDefaultStoreId()];
120
+ }
121
+ if ($store) {
122
+ $group->setHomeUrl($store->getHomeUrl());
123
+ $groups[] = $group;
124
+ }
125
+ }
126
+ $this->setData('groups', $groups);
127
+ }
128
+ return $this->getData('groups');
129
+ }
130
+
131
+ public function getStores()
132
+ {
133
+ if (!$this->getData('stores')) {
134
+ $rawStores = $this->getRawStores();
135
+
136
+ $groupId = $this->getCurrentGroupId();
137
+ if (!isset($rawStores[$groupId])) {
138
+ $stores = array();
139
+ } else {
140
+ $stores = $rawStores[$groupId];
141
+ }
142
+ $this->setData('stores', $stores);
143
+ }
144
+ return $this->getData('stores');
145
+ }
146
+
147
+ public function getCurrentStoreCode()
148
+ {
149
+ return Mage::app()->getStore()->getCode();
150
+ }
151
+
152
+ public function isStoreInUrl()
153
+ {
154
+ if (is_null($this->_storeInUrl)) {
155
+ $this->_storeInUrl = Mage::getStoreConfigFlag(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL);
156
+ }
157
+ return $this->_storeInUrl;
158
+ }
159
+ }
app/code/local/MW/Developertoolbar/Controller/Router/Standard.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MW_Developertoolbar_Controller_Router_Standard extends Mage_Core_Controller_Varien_Router_Standard
3
+ {
4
+
5
+ public function match(Zend_Controller_Request_Http $request)
6
+ {
7
+
8
+ $storeenabled = Mage::getStoreConfig('dev/config/enabled_offline', $request->getStoreCodeFromPath());
9
+
10
+ if ($storeenabled)
11
+ {
12
+ Mage::getSingleton('core/session', array('name' => 'adminhtml'));
13
+ $helper = Mage::helper('developertoolbar/data');
14
+ if($helper->checkAllowsIps() == 0)
15
+ {
16
+ Mage::getSingleton('core/session', array('name' => 'front'));
17
+
18
+ $front = $this->getFront();
19
+ $response = $front->getResponse();
20
+ $response->setHeader('HTTP/1.1','503 Service Temporarily Unavailable');
21
+ $response->setHeader('Status','503 Service Temporarily Unavailable');
22
+ $response->setHeader('Retry-After','5000');
23
+
24
+ $response->setBody(html_entity_decode( Mage::getStoreConfig('dev/config/message', $request->getStoreCodeFromPath()), ENT_QUOTES, "utf-8" ));
25
+ $response->sendHeaders();
26
+ $response->outputBody();
27
+
28
+ exit;
29
+ }
30
+ else
31
+ {
32
+ $showreminder = Mage::getStoreConfig('dev/config/showreminder', $request->getStoreCodeFromPath());
33
+ if ($showreminder)
34
+ {
35
+ $front = $this->getFront();
36
+ $response = $front->getResponse()->clearBody();
37
+ $response = $front->getResponse()->appendBody('<div style="height:12px; background:red; color: white; position:relative; width:100%;padding:3px; z-index:100000;text-trasform:capitalize;">Offline</div>');
38
+ }
39
+ }
40
+ }
41
+ return parent::match($request);
42
+
43
+ }
44
+
45
+
46
+
47
+ }
app/code/local/MW/Developertoolbar/Helper/Data.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MW_Developertoolbar_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ public function checkAllowsIps()
6
+ {
7
+ $dem = 0;
8
+ $allowedIps = Mage::getStoreConfig('dev/restrict/allow_ips');
9
+ $remoteAddr = Mage::helper('core/http')->getRemoteAddr();
10
+ $allowedIps_arr = explode(",",$allowedIps);
11
+ foreach ($allowedIps_arr as $value) {
12
+ if(trim($remoteAddr) == trim($value))
13
+ {
14
+ $dem++;
15
+ break;
16
+ }
17
+ }
18
+ return $dem;
19
+ }
20
+ }
app/code/local/MW/Developertoolbar/controllers/IndexController.php ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MW_Developertoolbar_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function storeofflineAction(){
5
+ $enabled = $this->getRequest()->getParam('enabled');
6
+ Mage::getConfig()->saveConfig('dev/config/enabled_offline', $enabled);
7
+ Mage::getConfig()->saveConfig('dev/config/showreminder', $enabled);
8
+
9
+ Mage::app()->cleanCache();
10
+
11
+ $this->_redirectReferer();
12
+ }
13
+ public function hintsAction()
14
+ {
15
+ $helper = Mage::helper('developertoolbar/data');
16
+ if($helper->checkAllowsIps() > 0){
17
+ $enabled = $this->getRequest()->getParam('enabled');
18
+ $type = $this->getRequest()->getParam('type');
19
+
20
+ $scope = $type === 'front' ? 'stores' : 'default';
21
+ $scope_id = $type === 'front' ? Mage::app()->getStore()->getStoreId() : '0';
22
+ Mage::getConfig()->saveConfig('dev/debug/template_hints', $enabled, $scope, $scope_id);
23
+ Mage::getConfig()->saveConfig('dev/debug/template_hints_blocks', $enabled, $scope, $scope_id);
24
+ Mage::app()->cleanCache();
25
+ }
26
+ $this->_redirectReferer();
27
+ }
28
+
29
+ public function logAction()
30
+ {
31
+ $helper = Mage::helper('developertoolbar/data');
32
+ if($helper->checkAllowsIps() > 0){
33
+ $scope = 'stores';
34
+ $scope_id = Mage::app()->getStore()->getStoreId();
35
+ $enabled = $this->getRequest()->getParam('enabled');
36
+ Mage::getConfig()->saveConfig('dev/log/active', $enabled, $scope, $scope_id);
37
+ }
38
+ $this->_redirectReferer();
39
+ }
40
+
41
+ public function jsAction()
42
+ {
43
+ $helper = Mage::helper('developertoolbar/data');
44
+ if($helper->checkAllowsIps() > 0){
45
+ $scope = 'stores';
46
+ $scope_id = Mage::app()->getStore()->getStoreId();
47
+ $enabled = $this->getRequest()->getParam('enabled');
48
+ Mage::getConfig()->saveConfig('dev/js/merge_files', $enabled, $scope, $scope_id);
49
+ Mage::getModel('core/design_package')->cleanMergedJsCss();
50
+ }
51
+ $this->_redirectReferer();
52
+ }
53
+
54
+ public function urlAction()
55
+ {
56
+ $helper = Mage::helper('developertoolbar/data');
57
+ if($helper->checkAllowsIps() > 0){
58
+ $enabled = $this->getRequest()->getParam('enabled');
59
+ Mage::getConfig()->saveConfig('web/url/use_store', $enabled);
60
+ Mage::app()->cleanCache();
61
+ }
62
+ $this->_redirectReferer();
63
+ }
64
+
65
+ public function seoAction()
66
+ {
67
+ $helper = Mage::helper('developertoolbar/data');
68
+ if($helper->checkAllowsIps() > 0){
69
+ $enabled = $this->getRequest()->getParam('enabled');
70
+ Mage::getConfig()->saveConfig('web/seo/use_rewrites', $enabled);
71
+ Mage::app()->cleanCache();
72
+ }
73
+ $this->_redirectReferer();
74
+ }
75
+
76
+ public function translateAction()
77
+ {
78
+ $helper = Mage::helper('developertoolbar/data');
79
+ if($helper->checkAllowsIps() > 0){
80
+ $scope = 'stores';
81
+ $scope_id = Mage::app()->getStore()->getStoreId();
82
+ $enabled = $this->getRequest()->getParam('enabled');
83
+ Mage::getConfig()->saveConfig('dev/translate_inline/active', $enabled, $scope, $scope_id);
84
+
85
+ Mage::app()->cleanCache();
86
+ }
87
+ $this->_redirectReferer();
88
+ }
89
+
90
+ public function cssAction()
91
+ {
92
+ $helper = Mage::helper('developertoolbar/data');
93
+ if($helper->checkAllowsIps() > 0){
94
+ $scope = 'stores';
95
+ $scope_id = Mage::app()->getStore()->getStoreId();
96
+ $enabled = $this->getRequest()->getParam('enabled');
97
+ Mage::getConfig()->saveConfig('dev/css/merge_css_files', $enabled, $scope, $scope_id);
98
+ Mage::getModel('core/design_package')->cleanMergedJsCss();
99
+ }
100
+ $this->_redirectReferer();
101
+ }
102
+
103
+ public function profilerAction()
104
+ {
105
+ $helper = Mage::helper('developertoolbar/data');
106
+ if($helper->checkAllowsIps() > 0){
107
+ $scope = 'stores';
108
+ $scope_id = Mage::app()->getStore()->getStoreId();
109
+ $enabled = $this->getRequest()->getParam('enabled');
110
+ Mage::getConfig()->saveConfig('dev/debug/profiler', $enabled, $scope, $scope_id);
111
+
112
+ Mage::app()->cleanCache();
113
+ }
114
+ $this->_redirectReferer();
115
+ }
116
+
117
+ public function symlinkAction()
118
+ {
119
+ $helper = Mage::helper('developertoolbar/data');
120
+ if($helper->checkAllowsIps() > 0){
121
+ $scope = 'stores';
122
+ $scope_id = Mage::app()->getStore()->getStoreId();
123
+ $enabled = $this->getRequest()->getParam('enabled');
124
+ Mage::getConfig()->saveConfig('dev/template/allow_symlink', $enabled, $scope, $scope_id);
125
+ }
126
+ $this->_redirectReferer();
127
+ }
128
+
129
+ public function encacheAction()
130
+ {
131
+ $helper = Mage::helper('developertoolbar/data');
132
+ if($helper->checkAllowsIps() > 0){
133
+ Mage::app()->cleanCache();
134
+ $cacheTypes = array_keys(Mage::helper('core')->getCacheTypes());
135
+ //Zend_debug::dump($cacheTypes);die;
136
+ $enable = array();
137
+ foreach ($cacheTypes as $type) {
138
+ $enable[$type] = 1;
139
+ }
140
+
141
+ Mage::app()->saveUseCache($enable);
142
+ }
143
+ $this->_redirectReferer();
144
+ }
145
+
146
+ public function discacheAction()
147
+ {
148
+ $helper = Mage::helper('developertoolbar/data');
149
+ if($helper->checkAllowsIps() > 0){
150
+ Mage::app()->cleanCache();
151
+ $cacheTypes = array_keys(Mage::helper('core')->getCacheTypes());
152
+ $enable = array();
153
+ foreach ($cacheTypes as $type) {
154
+ $enable[$type] = 0;
155
+ }
156
+ Mage::app()->saveUseCache($enable);
157
+ }
158
+ $this->_redirectReferer();
159
+ }
160
+
161
+ public function refreshAction()
162
+ {
163
+ $helper = Mage::helper('developertoolbar/data');
164
+ if($helper->checkAllowsIps() > 0){
165
+ Mage::app()->cleanCache();
166
+ $cacheTypes = array_keys(Mage::helper('core')->getCacheTypes());
167
+ //Zend_debug::dump($cacheTypes);die;
168
+ $enable = array();
169
+ foreach ($cacheTypes as $type) {
170
+ $enable[$type] = 1;
171
+ }
172
+ Mage::app()->saveUseCache($enable);
173
+ }
174
+ $this->_redirectReferer();
175
+ }
176
+
177
+ public function flushcachedataAction()
178
+ {
179
+ $helper = Mage::helper('developertoolbar/data');
180
+ if($helper->checkAllowsIps() > 0){
181
+ $types = Mage::app()->getCacheInstance()->getTypes();
182
+ //flush();
183
+ foreach ($types as $type => $data) {
184
+ Mage::app()->getCacheInstance()->clean($data["tags"]);
185
+ }
186
+ }
187
+ $this->_redirectReferer();
188
+ }
189
+
190
+ public function flushcachestorageAction()
191
+ {
192
+ $helper = Mage::helper('developertoolbar/data');
193
+ if($helper->checkAllowsIps() > 0){
194
+ //flush();
195
+ Mage::app()->getCacheInstance()->clean();
196
+ }
197
+ $this->_redirectReferer();
198
+ }
199
+
200
+ public function flushcachejsAction()
201
+ {
202
+ $helper = Mage::helper('developertoolbar/data');
203
+ if($helper->checkAllowsIps() > 0){
204
+ //flush();
205
+ Mage::getModel('core/design_package')->cleanMergedJsCss();
206
+ }
207
+ $this->_redirectReferer();
208
+ }
209
+
210
+ public function flushcacheimageAction()
211
+ {
212
+ $helper = Mage::helper('developertoolbar/data');
213
+ if($helper->checkAllowsIps() > 0){
214
+ //flush();
215
+ Mage::getModel('catalog/product_image')->clearCache();
216
+ }
217
+ $this->_redirectReferer();
218
+ }
219
+ }
app/code/local/MW/Developertoolbar/etc/config.xml ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <MW_Developertoolbar>
5
+ <version>1.0.0</version>
6
+ </MW_Developertoolbar>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <developertoolbar>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>MW_Developertoolbar</module>
14
+ <frontName>developertoolbar</frontName>
15
+ </args>
16
+ </developertoolbar>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <developertoolbar>
21
+ <file>mw_developertoolbar.xml</file>
22
+ </developertoolbar>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <developertoolbar>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>MW_Developertoolbar</module>
32
+ <frontName>developertoolbar</frontName>
33
+ </args>
34
+ </developertoolbar>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+ <layout>
39
+ <updates>
40
+ <developertoolbar>
41
+ <file>mw_developertoolbar.xml</file>
42
+ </developertoolbar>
43
+ </updates>
44
+ </layout>
45
+ </adminhtml>
46
+ <global>
47
+ <!--
48
+ <models>
49
+ <developertoolbar>
50
+ <class>MW_Developertoolbar_Model</class>
51
+ </developertoolbar>
52
+ </models>
53
+ -->
54
+ <blocks>
55
+ <developertoolbar>
56
+ <class>MW_Developertoolbar_Block</class>
57
+ </developertoolbar>
58
+ </blocks>
59
+ <helpers>
60
+ <developertoolbar>
61
+ <class>MW_Developertoolbar_Helper</class>
62
+ </developertoolbar>
63
+ </helpers>
64
+ </global>
65
+ <stores>
66
+ <default>
67
+ <web>
68
+ <routers>
69
+ <standard><area>frontend</area><class>MW_Developertoolbar_Controller_Router_Standard</class></standard>
70
+ </routers>
71
+ </web>
72
+ </default>
73
+ </stores>
74
+ <default>
75
+ <dev>
76
+ <config>
77
+ <enabled>1</enabled>
78
+
79
+ </config>
80
+ </dev>
81
+
82
+ <web>
83
+ <routers>
84
+ <standard><area>frontend</area><class>MW_Developertoolbar_Controller_Router_Standard</class></standard>
85
+ </routers>
86
+ </web>
87
+ <dev>
88
+ <config>
89
+ <enabled_offline>0</enabled_offline>
90
+ <message><![CDATA[
91
+ <style>
92
+ body {
93
+ margin:0;
94
+ padding:0;
95
+ background: #618498;
96
+ color: #FFFFFF;
97
+
98
+ font-family: Arial,Verdana,Tahoma;
99
+ text-align:center;
100
+ }
101
+ h1 {
102
+ margin:0px;
103
+ padding:0px;
104
+ margin-top:20%;
105
+
106
+ font-size: 24pt;
107
+ display:block;
108
+ }
109
+ h2 {
110
+ padding:0px;
111
+ margin-top: 5px;
112
+ font-size: 18pt;
113
+ }
114
+
115
+ </style>
116
+ </head>
117
+
118
+ <body>
119
+ <h1>Our site is currently down for maintenance</h1>
120
+ <h2>We expect to be back online shortly. Thanks for your patience!</h2>
121
+ </body>
122
+ ]]>
123
+ </message>
124
+ </config>
125
+ </dev>
126
+ </default>
127
+ </config>
app/code/local/MW/Developertoolbar/etc/system.xml ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <dev translate="label" module="core"> <!-- note name -->
5
+ <label>Developer</label>
6
+ <tab>advanced</tab>
7
+ <frontend_type>text</frontend_type>
8
+ <sort_order>920</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>1</show_in_store>
12
+ <groups>
13
+ <config translate="label">
14
+ <label>Developer Toolbar</label>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>11</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <fields>
21
+ <enabled translate="label">
22
+ <label>Enable</label>
23
+ <frontend_type>select</frontend_type>
24
+ <source_model>adminhtml/system_config_source_yesno</source_model>
25
+ <comment>Only enable with Ips in Allowed IPs of Developer Client Restrictions</comment>
26
+ <sort_order>0</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </enabled>
31
+
32
+ <enabled_offline translate="label">
33
+ <label>Store Offline</label>
34
+ <frontend_type>select</frontend_type>
35
+ <source_model>adminhtml/system_config_source_yesno</source_model>
36
+ <sort_order>1</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>0</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ </enabled_offline>
41
+
42
+ <showreminder translate="label">
43
+ <label>Show Website Status </label>
44
+ <frontend_type>select</frontend_type>
45
+ <source_model>adminhtml/system_config_source_yesno</source_model>
46
+ <sort_order>2</sort_order>
47
+ <show_in_default>1</show_in_default>
48
+ <show_in_website>0</show_in_website>
49
+ <show_in_store>1</show_in_store>
50
+ </showreminder>
51
+
52
+ <message translate="label">
53
+ <label>Message</label>
54
+ <frontend_type>textarea</frontend_type>
55
+ <comment>Only enable with Ips not in Allowed IPs of Developer Client Restrictions</comment>
56
+ <sort_order>3</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>0</show_in_website>
59
+ <show_in_store>1</show_in_store>
60
+ </message>
61
+ </fields>
62
+
63
+ <comment>The Developer Toolbar is powered by &lt;a href="http://www.mage-world.com/"&gt;www.Mage-World.com&lt;/a&gt;.
64
+ If you need any question or problem, feel free to contact us at &lt;a href="mailto:support@mage-world.com"&gt;support@mage-world.com&lt;/a&gt;.
65
+ </comment>
66
+ </config>
67
+
68
+ <!--
69
+ <author_information translate="label">
70
+ <label>Author Information</label>
71
+ <frontend_type>text</frontend_type>
72
+ <sort_order>301</sort_order>
73
+ <show_in_default>1</show_in_default>
74
+ <show_in_website>1</show_in_website>
75
+ <show_in_store>1</show_in_store>
76
+ <comment>The Developer Toolbar is powered by &lt;a href="http://www.mage-world.com/"&gt;www.Mage-World.com&lt;/a&gt;.
77
+ If you need any question or problem, feel free to contact us at &lt;a href="mailto:support@mage-world.com"&gt;support@mage-world.com&lt;/a&gt;.
78
+ </comment>
79
+ </author_information>
80
+ -->
81
+
82
+ </groups>
83
+
84
+ </dev>
85
+ </sections>
86
+ </config>
app/design/frontend/default/default/layout/developertoolbar.xml DELETED
@@ -1,11 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
-
4
- <default>
5
- <reference name="before_body_end">
6
- <block type="core/template" template="developertoolbar/toolbar.phtml">
7
- </block>
8
- </reference>
9
- </default>
10
-
11
- </layout>
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/layout/mw_developertoolbar.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addJs"><script>mw_js/jquery.js</script></action>
6
+ <action method="addJs"><script>mw_js/jquery_noconflict.js</script></action>
7
+ <action method="addJs"><script>mw_developertoolbar/popupdevtool.js</script></action>
8
+ </reference>
9
+ <reference name="content">
10
+ <block type="developertoolbar/switch" name="developertoolbar" template="mw_developertoolbar/devtool.phtml" />
11
+ </reference>
12
+ </default>
13
+ </layout>
app/design/frontend/default/default/template/developertoolbar/toolbar.phtml DELETED
@@ -1,92 +0,0 @@
1
- <?php if(Mage::getStoreConfig('dev/developertoolbar/enabled')): ?>
2
- <style>
3
- .developertoolbar {
4
- position: fixed;
5
- left: 0px;
6
- bottom: 0px;
7
- width: 100%;
8
- text-align: center;
9
- background: #0A263C;
10
- border-top: 1px solid #415966;
11
- z-index: 10000;
12
- }
13
- .developertoolbar a {
14
- color: #FF822F;
15
- font-weight:bold;
16
- font-size:11px;
17
- text-decoration: none;
18
- padding-left: 8px;
19
- padding-right: 8px;
20
- }
21
-
22
- .developertoolbar a:hover {
23
- color: #A7C6DD;
24
- }
25
-
26
- .developertoolbar .bar_name {
27
- color: #D96708;
28
- font-size: 10px;
29
- font-weight:bold;
30
- float: left;
31
- cursor:pointer;
32
- padding-left: 3px;
33
- }
34
-
35
- .developertoolbar .hide_me {
36
- color: #D96708;
37
- font-size: 9px;
38
- font-weight:bold;
39
- padding-right: 3px;
40
- }
41
-
42
- .developertoolbar .seperate {
43
- width: 1px;
44
- border-right: 1px solid #415966;
45
- }
46
-
47
- .developertoolbar .disabled {
48
- color: #666;
49
- }
50
- </style>
51
-
52
- <script language="javascript">
53
- function hide_developer_toolbar(){
54
- if (document.getElementById('bar_content').style.display == 'none') {
55
- document.getElementById('bar_content').style.display = "inline";
56
- document.getElementById('developertoolbar').style.width = "100%";
57
- } else {
58
- document.getElementById('bar_content').style.display = "none";
59
- document.getElementById('developertoolbar').style.width = "100px";
60
- }
61
- }
62
- </script>
63
- <div class="developertoolbar" id="developertoolbar">
64
- <a href="" onclick="hide_developer_toolbar(); return false;"><span class="bar_name">Developer Toolbar</span></a>
65
-
66
-
67
- <span id="bar_content">
68
- <a <?php if (Mage::getStoreConfig('dev/debug/template_hints') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/hints/enabled/'.(Mage::getStoreConfig('dev/debug/template_hints')!='1'?1:0).'/type/front') ?>">Frontend Hints</a>
69
-
70
- <span class="seperate"></span>
71
- <a <?php if (Mage::getStoreConfig('dev/debug/template_hints', 0) != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/hints/enabled/'.(Mage::getStoreConfig('dev/debug/template_hints', 0)!='1'?1:0).'/type/back') ?>">Backend Hints</a>
72
-
73
- <span class="seperate"></span>
74
- <a <?php if (Mage::getStoreConfig('dev/log/active') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/log/enabled/'.(Mage::getStoreConfig('dev/log/active')!='1'?1:0)) ?>">Logs</a>
75
-
76
- <span class="seperate"></span>
77
- <a <?php if (Mage::getStoreConfig('dev/js/merge_files') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/js/enabled/'.(Mage::getStoreConfig('dev/js/merge_files')!='1'?1:0)) ?>">Merge JS</a>
78
-
79
- <span class="seperate"></span>
80
- <a <?php if (Mage::getStoreConfig('web/url/use_store') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/url/enabled/'.(Mage::getStoreConfig('web/url/use_store')!='1'?1:0)) ?>">Store Code in Urls</a>
81
-
82
- <span class="seperate"></span>
83
- <a <?php if (Mage::getStoreConfig('web/seo/use_rewrites') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/seo/enabled/'.(Mage::getStoreConfig('web/seo/use_rewrites')!='1'?1:0)) ?>">SEO Rewrites</a>
84
-
85
- <span class="seperate"></span>
86
- <a <?php if (Mage::getStoreConfig('dev/translate_inline/active') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/translate/enabled/'.(Mage::getStoreConfig('dev/translate_inline/active')!='1'?1:0)) ?>">Translate Inline</a>
87
-
88
- <span class="seperate"></span>
89
- <a style="color:#FF0000;" href="<?php echo $this->getUrl('developertoolbar/index/cache/') ?>">Clean & Disable All Cache</a>
90
- </span>
91
- </div>
92
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/mw_developertoolbar/devtool.phtml ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $active = Mage::getStoreConfig("dev/config/enabled");
3
+ $helper = Mage::helper('developertoolbar/data');
4
+ if($helper->checkAllowsIps() == 0){
5
+ $active = 0;
6
+ }
7
+ ?>
8
+ <link href="<?php echo $this->getSkinUrl('mw_developertoolbar/css/general.css')?>" type="text/css" rel="stylesheet" />
9
+ <div id="mw_devtoolbar">
10
+ <div id= "title_devtool" style="cursor: pointer;">
11
+ <ul id="func_devtoolbar">
12
+
13
+ <li id="hide_toolbar"><a class="min" title="Hide this window">Hide</a></li>
14
+ <li id="show_toolbar" style="display: none;"><a class="max" title="Show this window">Show</a></li>
15
+ <!--
16
+ <li id="hide_toolbar"></li>
17
+ <li id="show_toolbar" style="display: none;"></li>
18
+ -->
19
+ <li id="close_toolbar"><a class="close" title="Close this window">Close</a></li>
20
+ </ul>
21
+ <!--
22
+ <a id="popupContactClose"><span></span></a>
23
+ <a id="popupContactShow"><span></span></a>
24
+ -->
25
+ <h1><span><?php echo $this->__('DEVERLOPER TOOLBAR')?></span></h1>
26
+ </div>
27
+
28
+ <?php
29
+ ///////////////////////////////////////////////////////////
30
+ // content in popup
31
+ ///////////////////////////////////////////////////////////
32
+
33
+ ?>
34
+ <input type="hidden" name="activemddev" value="<?php echo $active?>" id="active_devtool"/>
35
+
36
+ <div class="content_toolbar">
37
+
38
+ <span id="bar_content">
39
+ <?php if(count($this->getStores())>1): ?>
40
+ <div class="seperate_vertical_devtool">
41
+ <label style="margin-right:5px;" for="select-language"><?php echo $this->__('Select Store View:') ?></label>
42
+ <select id="select-language" title="<?php echo $this->__('Select Store View') ?>" onchange="window.location.href=this.value">
43
+ <?php foreach ($this->getStores() as $_lang): ?>
44
+ <?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' selected="selected"' : '' ?>
45
+ <option value="<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option>
46
+ <?php endforeach; ?>
47
+ </select>
48
+ </div>
49
+ <?php endif; ?>
50
+
51
+ <!-- template cache -->
52
+ <?php
53
+ $dem = 0;
54
+ $res = Mage::app()->getCacheInstance();
55
+ $cache = Mage::getModel('core/cache')->getTypes();
56
+ foreach ($cache as $value) {
57
+ $res = $value->getData();
58
+ if($res['status'] == 0) {$dem++;break;}
59
+ }
60
+ ?>
61
+ <div class="clear_both"><span></span></div>
62
+ <div class="store_all">
63
+ <span class ="seperate_vertical_devtool">Cache:</span>
64
+ <?php if ($dem>0) { //neu enabled?>
65
+ <span class="en_dis">Disabled</span>
66
+ <span class="en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/encache') ?>">Enable</a>)</span>
67
+ <?php } if ($dem == 0) { //neu disabled?>
68
+ <span class="en_dis">Enabled</span>
69
+ <span class="en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/discache') ?>">Disable</a> / <a href="<?php echo $this->getUrl('developertoolbar/index/refresh') ?>">Refresh</a>)</span>
70
+
71
+ <?php }?>
72
+
73
+ </div>
74
+ <div><span class ="seperate_vertical_flush">+ <a href="<?php echo $this->getUrl('developertoolbar/index/flushcachedata'); ?> ">Flush Magento Cache</a></span></div>
75
+ <div><span class ="seperate_vertical_flush">+ <a href="<?php echo $this->getUrl('developertoolbar/index/flushcachestorage'); ?> ">Flush Cache Storage</a></span></div>
76
+ <div><span class ="seperate_vertical_flush">+ <a href="<?php echo $this->getUrl('developertoolbar/index/flushcachejs'); ?> ">Flush Catalog Images Cache</a></span></div>
77
+ <div><span class ="seperate_vertical_flush">+ <a href="<?php echo $this->getUrl('developertoolbar/index/flushcacheimage'); ?> ">Flush JavaScript/CSS Cache</a></span></div>
78
+
79
+ <div class="clear_both"><span></span></div>
80
+ <!-- template Profiler -->
81
+ <?php if (Mage::getStoreConfig('dev/debug/profiler') != '1') {?>
82
+ <div class="store_all">
83
+ <span class ="seperate_vertical_devtool">Profiler:</span>
84
+ <span class = "en_dis">Disabled</span>
85
+ <span class="en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/profiler/enabled/'.(Mage::getStoreConfig('dev/debug/profiler')!='1'?1:0)) ?>">Enable</a>)</span>
86
+ </div >
87
+ <div class="clear_both"><span></span></div>
88
+ <?php } else {?>
89
+ <div class="store_all">
90
+ <span class ="seperate_vertical_devtool">Profiler:</span>
91
+ <span class = "en_dis">Enabled</span>
92
+ <span class="en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/profiler/enabled/'.(Mage::getStoreConfig('dev/debug/profiler')!='1'?1:0)) ?>">Disable</a>)</span>
93
+ </div>
94
+ <div class="clear_both"><span></span></div>
95
+ <?php }?>
96
+
97
+ <!-- template path hint -->
98
+ <span class="seperate_vertical_devtool">Template Path Hints</span>
99
+ <?php if (Mage::getStoreConfig('dev/debug/template_hints') != '1') {?>
100
+ <div class="store_all">
101
+ <span class ="seperate_vertical_devtool_plus">+ Frontend:</span>
102
+ <span class = "en_dis">Disabled</span>
103
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/hints/enabled/'.(Mage::getStoreConfig('dev/debug/template_hints')!='1'?1:0).'/type/front') ?>">Enable</a>)</span>
104
+ </div>
105
+ <div class="clear_both"><span></span></div>
106
+ <?php } else {?>
107
+ <div class="store_all">
108
+ <span class ="seperate_vertical_devtool_plus">+ Frontend:</span>
109
+ <span class = "en_dis">Enabled</span>
110
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/hints/enabled/'.(Mage::getStoreConfig('dev/debug/template_hints')!='1'?1:0).'/type/front') ?>">Disable</a>)</span>
111
+ </div>
112
+ <div class="clear_both"><span></span></div>
113
+ <?php }?>
114
+
115
+ <!-- template backend hint -->
116
+ <?php if (Mage::getStoreConfig('dev/debug/template_hints', 0) != '1') {?>
117
+ <div class="store_all">
118
+ <span class ="seperate_vertical_devtool_plus">+ Backend:</span>
119
+ <span class = "en_dis">Disabled</span>
120
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/hints/enabled/'.(Mage::getStoreConfig('dev/debug/template_hints', 0)!='1'?1:0).'/type/back') ?>">Enable</a>)</span>
121
+ </div>
122
+ <div class="clear_both"><span></span></div>
123
+ <?php } else {?>
124
+ <div class="store_all">
125
+ <span class ="seperate_vertical_devtool_plus">+ Backend:</span>
126
+ <span class = "en_dis">Enabled</span>
127
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/hints/enabled/'.(Mage::getStoreConfig('dev/debug/template_hints', 0)!='1'?1:0).'/type/back') ?>">Disable</a>)</span>
128
+ </div>
129
+ <div class="clear_both"><span></span></div>
130
+ <?php }?>
131
+
132
+ <!-- template logs hint -->
133
+ <?php if (Mage::getStoreConfig('dev/log/active') != '1') {?>
134
+ <div class="store_all">
135
+ <span class ="seperate_vertical_devtool">Logs:</span>
136
+ <span class = "en_dis">Disabled</span>
137
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/log/enabled/'.(Mage::getStoreConfig('dev/log/active')!='1'?1:0)) ?>">Enable</a>)</span>
138
+ </div>
139
+ <div class="clear_both"><span></span></div>
140
+ <?php } else {?>
141
+ <div class="store_all">
142
+ <span class ="seperate_vertical_devtool">Logs:</span>
143
+ <span class = "en_dis">Enabled</span>
144
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/log/enabled/'.(Mage::getStoreConfig('dev/log/active')!='1'?1:0)) ?>">Disable</a>)</span>
145
+ </div>
146
+ <div class="clear_both"><span></span></div>
147
+ <?php }?>
148
+
149
+ <!-- template allow symplink -->
150
+ <?php if (Mage::getStoreConfig('dev/template/allow_symlink') != '1') {?>
151
+ <div class="store_all">
152
+ <span class ="seperate_vertical_devtool">Allow Symlinks:</span>
153
+ <span class = "en_dis">Disabled</span>
154
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/symlink/enabled/'.(Mage::getStoreConfig('dev/template/allow_symlink')!='1'?1:0)) ?>">Enable</a>)</span>
155
+ </div>
156
+ <div class="clear_both"><span></span></div>
157
+ <?php } else {?>
158
+ <div class="store_all">
159
+ <span class ="seperate_vertical_devtool">Allow Symlinks:</span>
160
+ <span class = "en_dis">Enabled</span>
161
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/symlink/enabled/'.(Mage::getStoreConfig('dev/template/allow_symlink')!='1'?1:0)) ?>">Disable</a>)</span>
162
+ </div>
163
+ <div class="clear_both"><span></span></div>
164
+ <?php }?>
165
+
166
+ <!-- template Translate Inline -->
167
+ <span class="seperate_vertical_devtool">Translate Inline</span>
168
+ <div class="clear_both"><span></span></div>
169
+ <?php if (Mage::getStoreConfig('dev/translate_inline/active') != '1') {?>
170
+ <div class="store_all">
171
+ <span class ="seperate_vertical_devtool_plus">+ Frontend:</span>
172
+ <span class = "en_dis">Disabled</span>
173
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/translate/enabled/'.(Mage::getStoreConfig('dev/translate_inline/active')!='1'?1:0)) ?>">Enable</a>)</span>
174
+ </div>
175
+ <div class="clear_both"><span></span></div>
176
+ <?php } else {?>
177
+ <div class="store_all">
178
+ <span class ="seperate_vertical_devtool_plus">+ Frontend:</span>
179
+ <span class = "en_dis">Enabled</span>
180
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/translate/enabled/'.(Mage::getStoreConfig('dev/translate_inline/active')!='1'?1:0)) ?>">Disable</a>)</span>
181
+ </div>
182
+ <div class="clear_both"><span></span></div>
183
+ <?php }?>
184
+
185
+ <!-- template marge js -->
186
+ <?php
187
+ if (Mage::getStoreConfig('dev/js/merge_files') != '1') {?>
188
+ <div class="store_all">
189
+ <span class ="seperate_vertical_devtool">Merge JavaScript Files</span>
190
+ <span class = "en_dis">Disabled</span>
191
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/js/enabled/'.(Mage::getStoreConfig('dev/js/merge_files')!='1'?1:0)) ?>">Enable</a>)</span>
192
+ </div>
193
+ <div class="clear_both"><span></span></div>
194
+ <?php } else {?>
195
+ <div class="store_all">
196
+ <span class ="seperate_vertical_devtool">Merge JavaScript Files</span>
197
+ <span class = "en_dis">Enabled</span>
198
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/js/enabled/'.(Mage::getStoreConfig('dev/js/merge_files')!='1'?1:0)) ?>">Disable</a>)</span>
199
+ </div>
200
+ <div class="clear_both"><span></span></div>
201
+ <?php }?>
202
+
203
+ <!-- template CSS Settings -->
204
+ <?php if (Mage::getStoreConfig('dev/css/merge_css_files') != '1') {?>
205
+ <div class="store_all">
206
+ <span class ="seperate_vertical_devtool">Merge CSS Files:</span>
207
+ <span class = "en_dis">Disabled</span>
208
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/css/enabled/'.(Mage::getStoreConfig('dev/css/merge_css_files')!='1'?1:0)) ?>">Enable</a>)</span>
209
+ </div>
210
+ <div class="clear_both"><span></span></div>
211
+ <?php } else {?>
212
+ <div class="store_all">
213
+ <span class ="seperate_vertical_devtool">Merge CSS Files:</span>
214
+ <span class = "en_dis">Enabled</span>
215
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/css/enabled/'.(Mage::getStoreConfig('dev/css/merge_css_files')!='1'?1:0)) ?>">Disable</a>)</span>
216
+ </div>
217
+ <div class="clear_both"><span></span></div>
218
+ <?php }?>
219
+
220
+ <!-- template seo url -->
221
+ <?php if (Mage::getStoreConfig('web/seo/use_rewrites') != '1') {?>
222
+ <div class="store_all">
223
+ <span class ="seperate_vertical_devtool">URL Rewrite:</span>
224
+ <span class = "en_dis">Disabled</span>
225
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/seo/enabled/'.(Mage::getStoreConfig('web/seo/use_rewrites')!='1'?1:0)) ?>">Enable</a>)</span>
226
+ </div>
227
+ <div class="clear_both"><span></span></div>
228
+ <?php } else {?>
229
+ <div class="store_all">
230
+ <span class ="seperate_vertical_devtool">URL Rewrite:</span>
231
+ <span class = "en_dis">Enabled</span>
232
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/seo/enabled/'.(Mage::getStoreConfig('web/seo/use_rewrites')!='1'?1:0))?>">Disable</a>)</span>
233
+ </div>
234
+ <div class="clear_both"><span></span></div>
235
+ <?php }?>
236
+
237
+ <!-- template store code url -->
238
+ <?php if (Mage::getStoreConfig('web/url/use_store') != '1') {?>
239
+ <div class="store_all">
240
+ <span class ="seperate_vertical_devtool">Add Store Code to Urls:</span>
241
+ <span class = "en_dis">Disabled</span>
242
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/url/enabled/'.(Mage::getStoreConfig('web/url/use_store')!='1'?1:0)) ?>">Enable</a>)</span>
243
+ </div>
244
+ <div class="clear_both"><span></span></div>
245
+ <?php } else {?>
246
+ <div class="store_all">
247
+ <span class ="seperate_vertical_devtool">Add Store Code to Urls:</span>
248
+ <span class = "en_dis">Enabled</span>
249
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/url/enabled/'.(Mage::getStoreConfig('web/url/use_store')!='1'?1:0)) ?>">Disable</a>)</span>
250
+ </div>
251
+ <div class="clear_both"><span></span></div>
252
+ <?php }?>
253
+
254
+ <!-- template store offline -->
255
+ <?php if (Mage::getStoreConfig('dev/config/enabled_offline') != '1') {?>
256
+ <div class="store_all">
257
+ <span class ="seperate_vertical_devtool">Store Offline:</span>
258
+ <span class = "en_dis">Disabled</span>
259
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/storeoffline/enabled/'.(Mage::getStoreConfig('dev/config/enabled_offline')!='1'?1:0)) ?>">Enable</a>)</span>
260
+ </div>
261
+ <div class="clear_both"><span></span></div>
262
+ <?php } else {?>
263
+ <div class="store_all">
264
+ <span class ="seperate_vertical_devtool">Store Offline:</span>
265
+ <span class = "en_dis">Enabled</span>
266
+ <span class = "en_dis">(<a href="<?php echo $this->getUrl('developertoolbar/index/storeoffline/enabled/'.(Mage::getStoreConfig('dev/config/enabled_offline')!='1'?1:0)) ?>">Disable</a>)</span>
267
+ </div>
268
+ <div class="clear_both"><span></span></div>
269
+ <?php }?>
270
+ <div id="close_devtoolbar" class="bottom_devtoolbar">Powered by </span><a href="http://www.mage-world.com/">Mage-World.com</a></div>
271
+ </span>
272
+ </div>
273
+ </div>
app/etc/modules/HM_DeveloperToolbar.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <HM_DeveloperToolbar>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- </HM_DeveloperToolbar>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
app/etc/modules/MW_Developertoolbar.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <MW_Developertoolbar>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </MW_Developertoolbar>
8
+ </modules>
9
+ </config>
js/mw_developertoolbar/jquery.js ADDED
@@ -0,0 +1,9406 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery JavaScript Library v1.7.2
3
+ * http://jquery.com/
4
+ *
5
+ * Copyright 2011, John Resig
6
+ * Dual licensed under the MIT or GPL Version 2 licenses.
7
+ * http://jquery.org/license
8
+ *
9
+ * Includes Sizzle.js
10
+ * http://sizzlejs.com/
11
+ * Copyright 2011, The Dojo Foundation
12
+ * Released under the MIT, BSD, and GPL Licenses.
13
+ *
14
+ * Date: Wed Mar 21 12:46:34 2012 -0700
15
+ */
16
+ (function( window, undefined ) {
17
+
18
+ // Use the correct document accordingly with window argument (sandbox)
19
+ var document = window.document,
20
+ navigator = window.navigator,
21
+ location = window.location;
22
+ var jQuery = (function() {
23
+
24
+ // Define a local copy of jQuery
25
+ var jQuery = function( selector, context ) {
26
+ // The jQuery object is actually just the init constructor 'enhanced'
27
+ return new jQuery.fn.init( selector, context, rootjQuery );
28
+ },
29
+
30
+ // Map over jQuery in case of overwrite
31
+ _jQuery = window.jQuery,
32
+
33
+ // Map over the $ in case of overwrite
34
+ _$ = window.$,
35
+
36
+ // A central reference to the root jQuery(document)
37
+ rootjQuery,
38
+
39
+ // A simple way to check for HTML strings or ID strings
40
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
41
+ quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
42
+
43
+ // Check if a string has a non-whitespace character in it
44
+ rnotwhite = /\S/,
45
+
46
+ // Used for trimming whitespace
47
+ trimLeft = /^\s+/,
48
+ trimRight = /\s+$/,
49
+
50
+ // Match a standalone tag
51
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
52
+
53
+ // JSON RegExp
54
+ rvalidchars = /^[\],:{}\s]*$/,
55
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
56
+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
57
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
58
+
59
+ // Useragent RegExp
60
+ rwebkit = /(webkit)[ \/]([\w.]+)/,
61
+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
62
+ rmsie = /(msie) ([\w.]+)/,
63
+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
64
+
65
+ // Matches dashed string for camelizing
66
+ rdashAlpha = /-([a-z]|[0-9])/ig,
67
+ rmsPrefix = /^-ms-/,
68
+
69
+ // Used by jQuery.camelCase as callback to replace()
70
+ fcamelCase = function( all, letter ) {
71
+ return ( letter + "" ).toUpperCase();
72
+ },
73
+
74
+ // Keep a UserAgent string for use with jQuery.browser
75
+ userAgent = navigator.userAgent,
76
+
77
+ // For matching the engine and version of the browser
78
+ browserMatch,
79
+
80
+ // The deferred used on DOM ready
81
+ readyList,
82
+
83
+ // The ready event handler
84
+ DOMContentLoaded,
85
+
86
+ // Save a reference to some core methods
87
+ toString = Object.prototype.toString,
88
+ hasOwn = Object.prototype.hasOwnProperty,
89
+ push = Array.prototype.push,
90
+ slice = Array.prototype.slice,
91
+ trim = String.prototype.trim,
92
+ indexOf = Array.prototype.indexOf,
93
+
94
+ // [[Class]] -> type pairs
95
+ class2type = {};
96
+
97
+ jQuery.fn = jQuery.prototype = {
98
+ constructor: jQuery,
99
+ init: function( selector, context, rootjQuery ) {
100
+ var match, elem, ret, doc;
101
+
102
+ // Handle $(""), $(null), or $(undefined)
103
+ if ( !selector ) {
104
+ return this;
105
+ }
106
+
107
+ // Handle $(DOMElement)
108
+ if ( selector.nodeType ) {
109
+ this.context = this[0] = selector;
110
+ this.length = 1;
111
+ return this;
112
+ }
113
+
114
+ // The body element only exists once, optimize finding it
115
+ if ( selector === "body" && !context && document.body ) {
116
+ this.context = document;
117
+ this[0] = document.body;
118
+ this.selector = selector;
119
+ this.length = 1;
120
+ return this;
121
+ }
122
+
123
+ // Handle HTML strings
124
+ if ( typeof selector === "string" ) {
125
+ // Are we dealing with HTML string or an ID?
126
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
127
+ // Assume that strings that start and end with <> are HTML and skip the regex check
128
+ match = [ null, selector, null ];
129
+
130
+ } else {
131
+ match = quickExpr.exec( selector );
132
+ }
133
+
134
+ // Verify a match, and that no context was specified for #id
135
+ if ( match && (match[1] || !context) ) {
136
+
137
+ // HANDLE: $(html) -> $(array)
138
+ if ( match[1] ) {
139
+ context = context instanceof jQuery ? context[0] : context;
140
+ doc = ( context ? context.ownerDocument || context : document );
141
+
142
+ // If a single string is passed in and it's a single tag
143
+ // just do a createElement and skip the rest
144
+ ret = rsingleTag.exec( selector );
145
+
146
+ if ( ret ) {
147
+ if ( jQuery.isPlainObject( context ) ) {
148
+ selector = [ document.createElement( ret[1] ) ];
149
+ jQuery.fn.attr.call( selector, context, true );
150
+
151
+ } else {
152
+ selector = [ doc.createElement( ret[1] ) ];
153
+ }
154
+
155
+ } else {
156
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
157
+ selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
158
+ }
159
+
160
+ return jQuery.merge( this, selector );
161
+
162
+ // HANDLE: $("#id")
163
+ } else {
164
+ elem = document.getElementById( match[2] );
165
+
166
+ // Check parentNode to catch when Blackberry 4.6 returns
167
+ // nodes that are no longer in the document #6963
168
+ if ( elem && elem.parentNode ) {
169
+ // Handle the case where IE and Opera return items
170
+ // by name instead of ID
171
+ if ( elem.id !== match[2] ) {
172
+ return rootjQuery.find( selector );
173
+ }
174
+
175
+ // Otherwise, we inject the element directly into the jQuery object
176
+ this.length = 1;
177
+ this[0] = elem;
178
+ }
179
+
180
+ this.context = document;
181
+ this.selector = selector;
182
+ return this;
183
+ }
184
+
185
+ // HANDLE: $(expr, $(...))
186
+ } else if ( !context || context.jquery ) {
187
+ return ( context || rootjQuery ).find( selector );
188
+
189
+ // HANDLE: $(expr, context)
190
+ // (which is just equivalent to: $(context).find(expr)
191
+ } else {
192
+ return this.constructor( context ).find( selector );
193
+ }
194
+
195
+ // HANDLE: $(function)
196
+ // Shortcut for document ready
197
+ } else if ( jQuery.isFunction( selector ) ) {
198
+ return rootjQuery.ready( selector );
199
+ }
200
+
201
+ if ( selector.selector !== undefined ) {
202
+ this.selector = selector.selector;
203
+ this.context = selector.context;
204
+ }
205
+
206
+ return jQuery.makeArray( selector, this );
207
+ },
208
+
209
+ // Start with an empty selector
210
+ selector: "",
211
+
212
+ // The current version of jQuery being used
213
+ jquery: "1.7.2",
214
+
215
+ // The default length of a jQuery object is 0
216
+ length: 0,
217
+
218
+ // The number of elements contained in the matched element set
219
+ size: function() {
220
+ return this.length;
221
+ },
222
+
223
+ toArray: function() {
224
+ return slice.call( this, 0 );
225
+ },
226
+
227
+ // Get the Nth element in the matched element set OR
228
+ // Get the whole matched element set as a clean array
229
+ get: function( num ) {
230
+ return num == null ?
231
+
232
+ // Return a 'clean' array
233
+ this.toArray() :
234
+
235
+ // Return just the object
236
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
237
+ },
238
+
239
+ // Take an array of elements and push it onto the stack
240
+ // (returning the new matched element set)
241
+ pushStack: function( elems, name, selector ) {
242
+ // Build a new jQuery matched element set
243
+ var ret = this.constructor();
244
+
245
+ if ( jQuery.isArray( elems ) ) {
246
+ push.apply( ret, elems );
247
+
248
+ } else {
249
+ jQuery.merge( ret, elems );
250
+ }
251
+
252
+ // Add the old object onto the stack (as a reference)
253
+ ret.prevObject = this;
254
+
255
+ ret.context = this.context;
256
+
257
+ if ( name === "find" ) {
258
+ ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
259
+ } else if ( name ) {
260
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
261
+ }
262
+
263
+ // Return the newly-formed element set
264
+ return ret;
265
+ },
266
+
267
+ // Execute a callback for every element in the matched set.
268
+ // (You can seed the arguments with an array of args, but this is
269
+ // only used internally.)
270
+ each: function( callback, args ) {
271
+ return jQuery.each( this, callback, args );
272
+ },
273
+
274
+ ready: function( fn ) {
275
+ // Attach the listeners
276
+ jQuery.bindReady();
277
+
278
+ // Add the callback
279
+ readyList.add( fn );
280
+
281
+ return this;
282
+ },
283
+
284
+ eq: function( i ) {
285
+ i = +i;
286
+ return i === -1 ?
287
+ this.slice( i ) :
288
+ this.slice( i, i + 1 );
289
+ },
290
+
291
+ first: function() {
292
+ return this.eq( 0 );
293
+ },
294
+
295
+ last: function() {
296
+ return this.eq( -1 );
297
+ },
298
+
299
+ slice: function() {
300
+ return this.pushStack( slice.apply( this, arguments ),
301
+ "slice", slice.call(arguments).join(",") );
302
+ },
303
+
304
+ map: function( callback ) {
305
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
306
+ return callback.call( elem, i, elem );
307
+ }));
308
+ },
309
+
310
+ end: function() {
311
+ return this.prevObject || this.constructor(null);
312
+ },
313
+
314
+ // For internal use only.
315
+ // Behaves like an Array's method, not like a jQuery method.
316
+ push: push,
317
+ sort: [].sort,
318
+ splice: [].splice
319
+ };
320
+
321
+ // Give the init function the jQuery prototype for later instantiation
322
+ jQuery.fn.init.prototype = jQuery.fn;
323
+
324
+ jQuery.extend = jQuery.fn.extend = function() {
325
+ var options, name, src, copy, copyIsArray, clone,
326
+ target = arguments[0] || {},
327
+ i = 1,
328
+ length = arguments.length,
329
+ deep = false;
330
+
331
+ // Handle a deep copy situation
332
+ if ( typeof target === "boolean" ) {
333
+ deep = target;
334
+ target = arguments[1] || {};
335
+ // skip the boolean and the target
336
+ i = 2;
337
+ }
338
+
339
+ // Handle case when target is a string or something (possible in deep copy)
340
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
341
+ target = {};
342
+ }
343
+
344
+ // extend jQuery itself if only one argument is passed
345
+ if ( length === i ) {
346
+ target = this;
347
+ --i;
348
+ }
349
+
350
+ for ( ; i < length; i++ ) {
351
+ // Only deal with non-null/undefined values
352
+ if ( (options = arguments[ i ]) != null ) {
353
+ // Extend the base object
354
+ for ( name in options ) {
355
+ src = target[ name ];
356
+ copy = options[ name ];
357
+
358
+ // Prevent never-ending loop
359
+ if ( target === copy ) {
360
+ continue;
361
+ }
362
+
363
+ // Recurse if we're merging plain objects or arrays
364
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
365
+ if ( copyIsArray ) {
366
+ copyIsArray = false;
367
+ clone = src && jQuery.isArray(src) ? src : [];
368
+
369
+ } else {
370
+ clone = src && jQuery.isPlainObject(src) ? src : {};
371
+ }
372
+
373
+ // Never move original objects, clone them
374
+ target[ name ] = jQuery.extend( deep, clone, copy );
375
+
376
+ // Don't bring in undefined values
377
+ } else if ( copy !== undefined ) {
378
+ target[ name ] = copy;
379
+ }
380
+ }
381
+ }
382
+ }
383
+
384
+ // Return the modified object
385
+ return target;
386
+ };
387
+
388
+ jQuery.extend({
389
+ noConflict: function( deep ) {
390
+ if ( window.$ === jQuery ) {
391
+ window.$ = _$;
392
+ }
393
+
394
+ if ( deep && window.jQuery === jQuery ) {
395
+ window.jQuery = _jQuery;
396
+ }
397
+
398
+ return jQuery;
399
+ },
400
+
401
+ // Is the DOM ready to be used? Set to true once it occurs.
402
+ isReady: false,
403
+
404
+ // A counter to track how many items to wait for before
405
+ // the ready event fires. See #6781
406
+ readyWait: 1,
407
+
408
+ // Hold (or release) the ready event
409
+ holdReady: function( hold ) {
410
+ if ( hold ) {
411
+ jQuery.readyWait++;
412
+ } else {
413
+ jQuery.ready( true );
414
+ }
415
+ },
416
+
417
+ // Handle when the DOM is ready
418
+ ready: function( wait ) {
419
+ // Either a released hold or an DOMready/load event and not yet ready
420
+ if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
421
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
422
+ if ( !document.body ) {
423
+ return setTimeout( jQuery.ready, 1 );
424
+ }
425
+
426
+ // Remember that the DOM is ready
427
+ jQuery.isReady = true;
428
+
429
+ // If a normal DOM Ready event fired, decrement, and wait if need be
430
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
431
+ return;
432
+ }
433
+
434
+ // If there are functions bound, to execute
435
+ readyList.fireWith( document, [ jQuery ] );
436
+
437
+ // Trigger any bound ready events
438
+ if ( jQuery.fn.trigger ) {
439
+ jQuery( document ).trigger( "ready" ).off( "ready" );
440
+ }
441
+ }
442
+ },
443
+
444
+ bindReady: function() {
445
+ if ( readyList ) {
446
+ return;
447
+ }
448
+
449
+ readyList = jQuery.Callbacks( "once memory" );
450
+
451
+ // Catch cases where $(document).ready() is called after the
452
+ // browser event has already occurred.
453
+ if ( document.readyState === "complete" ) {
454
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
455
+ return setTimeout( jQuery.ready, 1 );
456
+ }
457
+
458
+ // Mozilla, Opera and webkit nightlies currently support this event
459
+ if ( document.addEventListener ) {
460
+ // Use the handy event callback
461
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
462
+
463
+ // A fallback to window.onload, that will always work
464
+ window.addEventListener( "load", jQuery.ready, false );
465
+
466
+ // If IE event model is used
467
+ } else if ( document.attachEvent ) {
468
+ // ensure firing before onload,
469
+ // maybe late but safe also for iframes
470
+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
471
+
472
+ // A fallback to window.onload, that will always work
473
+ window.attachEvent( "onload", jQuery.ready );
474
+
475
+ // If IE and not a frame
476
+ // continually check to see if the document is ready
477
+ var toplevel = false;
478
+
479
+ try {
480
+ toplevel = window.frameElement == null;
481
+ } catch(e) {}
482
+
483
+ if ( document.documentElement.doScroll && toplevel ) {
484
+ doScrollCheck();
485
+ }
486
+ }
487
+ },
488
+
489
+ // See test/unit/core.js for details concerning isFunction.
490
+ // Since version 1.3, DOM methods and functions like alert
491
+ // aren't supported. They return false on IE (#2968).
492
+ isFunction: function( obj ) {
493
+ return jQuery.type(obj) === "function";
494
+ },
495
+
496
+ isArray: Array.isArray || function( obj ) {
497
+ return jQuery.type(obj) === "array";
498
+ },
499
+
500
+ isWindow: function( obj ) {
501
+ return obj != null && obj == obj.window;
502
+ },
503
+
504
+ isNumeric: function( obj ) {
505
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
506
+ },
507
+
508
+ type: function( obj ) {
509
+ return obj == null ?
510
+ String( obj ) :
511
+ class2type[ toString.call(obj) ] || "object";
512
+ },
513
+
514
+ isPlainObject: function( obj ) {
515
+ // Must be an Object.
516
+ // Because of IE, we also have to check the presence of the constructor property.
517
+ // Make sure that DOM nodes and window objects don't pass through, as well
518
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
519
+ return false;
520
+ }
521
+
522
+ try {
523
+ // Not own constructor property must be Object
524
+ if ( obj.constructor &&
525
+ !hasOwn.call(obj, "constructor") &&
526
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
527
+ return false;
528
+ }
529
+ } catch ( e ) {
530
+ // IE8,9 Will throw exceptions on certain host objects #9897
531
+ return false;
532
+ }
533
+
534
+ // Own properties are enumerated firstly, so to speed up,
535
+ // if last one is own, then all properties are own.
536
+
537
+ var key;
538
+ for ( key in obj ) {}
539
+
540
+ return key === undefined || hasOwn.call( obj, key );
541
+ },
542
+
543
+ isEmptyObject: function( obj ) {
544
+ for ( var name in obj ) {
545
+ return false;
546
+ }
547
+ return true;
548
+ },
549
+
550
+ error: function( msg ) {
551
+ throw new Error( msg );
552
+ },
553
+
554
+ parseJSON: function( data ) {
555
+ if ( typeof data !== "string" || !data ) {
556
+ return null;
557
+ }
558
+
559
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
560
+ data = jQuery.trim( data );
561
+
562
+ // Attempt to parse using the native JSON parser first
563
+ if ( window.JSON && window.JSON.parse ) {
564
+ return window.JSON.parse( data );
565
+ }
566
+
567
+ // Make sure the incoming data is actual JSON
568
+ // Logic borrowed from http://json.org/json2.js
569
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
570
+ .replace( rvalidtokens, "]" )
571
+ .replace( rvalidbraces, "")) ) {
572
+
573
+ return ( new Function( "return " + data ) )();
574
+
575
+ }
576
+ jQuery.error( "Invalid JSON: " + data );
577
+ },
578
+
579
+ // Cross-browser xml parsing
580
+ parseXML: function( data ) {
581
+ if ( typeof data !== "string" || !data ) {
582
+ return null;
583
+ }
584
+ var xml, tmp;
585
+ try {
586
+ if ( window.DOMParser ) { // Standard
587
+ tmp = new DOMParser();
588
+ xml = tmp.parseFromString( data , "text/xml" );
589
+ } else { // IE
590
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
591
+ xml.async = "false";
592
+ xml.loadXML( data );
593
+ }
594
+ } catch( e ) {
595
+ xml = undefined;
596
+ }
597
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
598
+ jQuery.error( "Invalid XML: " + data );
599
+ }
600
+ return xml;
601
+ },
602
+
603
+ noop: function() {},
604
+
605
+ // Evaluates a script in a global context
606
+ // Workarounds based on findings by Jim Driscoll
607
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
608
+ globalEval: function( data ) {
609
+ if ( data && rnotwhite.test( data ) ) {
610
+ // We use execScript on Internet Explorer
611
+ // We use an anonymous function so that context is window
612
+ // rather than jQuery in Firefox
613
+ ( window.execScript || function( data ) {
614
+ window[ "eval" ].call( window, data );
615
+ } )( data );
616
+ }
617
+ },
618
+
619
+ // Convert dashed to camelCase; used by the css and data modules
620
+ // Microsoft forgot to hump their vendor prefix (#9572)
621
+ camelCase: function( string ) {
622
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
623
+ },
624
+
625
+ nodeName: function( elem, name ) {
626
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
627
+ },
628
+
629
+ // args is for internal usage only
630
+ each: function( object, callback, args ) {
631
+ var name, i = 0,
632
+ length = object.length,
633
+ isObj = length === undefined || jQuery.isFunction( object );
634
+
635
+ if ( args ) {
636
+ if ( isObj ) {
637
+ for ( name in object ) {
638
+ if ( callback.apply( object[ name ], args ) === false ) {
639
+ break;
640
+ }
641
+ }
642
+ } else {
643
+ for ( ; i < length; ) {
644
+ if ( callback.apply( object[ i++ ], args ) === false ) {
645
+ break;
646
+ }
647
+ }
648
+ }
649
+
650
+ // A special, fast, case for the most common use of each
651
+ } else {
652
+ if ( isObj ) {
653
+ for ( name in object ) {
654
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
655
+ break;
656
+ }
657
+ }
658
+ } else {
659
+ for ( ; i < length; ) {
660
+ if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
661
+ break;
662
+ }
663
+ }
664
+ }
665
+ }
666
+
667
+ return object;
668
+ },
669
+
670
+ // Use native String.trim function wherever possible
671
+ trim: trim ?
672
+ function( text ) {
673
+ return text == null ?
674
+ "" :
675
+ trim.call( text );
676
+ } :
677
+
678
+ // Otherwise use our own trimming functionality
679
+ function( text ) {
680
+ return text == null ?
681
+ "" :
682
+ text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
683
+ },
684
+
685
+ // results is for internal usage only
686
+ makeArray: function( array, results ) {
687
+ var ret = results || [];
688
+
689
+ if ( array != null ) {
690
+ // The window, strings (and functions) also have 'length'
691
+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
692
+ var type = jQuery.type( array );
693
+
694
+ if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
695
+ push.call( ret, array );
696
+ } else {
697
+ jQuery.merge( ret, array );
698
+ }
699
+ }
700
+
701
+ return ret;
702
+ },
703
+
704
+ inArray: function( elem, array, i ) {
705
+ var len;
706
+
707
+ if ( array ) {
708
+ if ( indexOf ) {
709
+ return indexOf.call( array, elem, i );
710
+ }
711
+
712
+ len = array.length;
713
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
714
+
715
+ for ( ; i < len; i++ ) {
716
+ // Skip accessing in sparse arrays
717
+ if ( i in array && array[ i ] === elem ) {
718
+ return i;
719
+ }
720
+ }
721
+ }
722
+
723
+ return -1;
724
+ },
725
+
726
+ merge: function( first, second ) {
727
+ var i = first.length,
728
+ j = 0;
729
+
730
+ if ( typeof second.length === "number" ) {
731
+ for ( var l = second.length; j < l; j++ ) {
732
+ first[ i++ ] = second[ j ];
733
+ }
734
+
735
+ } else {
736
+ while ( second[j] !== undefined ) {
737
+ first[ i++ ] = second[ j++ ];
738
+ }
739
+ }
740
+
741
+ first.length = i;
742
+
743
+ return first;
744
+ },
745
+
746
+ grep: function( elems, callback, inv ) {
747
+ var ret = [], retVal;
748
+ inv = !!inv;
749
+
750
+ // Go through the array, only saving the items
751
+ // that pass the validator function
752
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
753
+ retVal = !!callback( elems[ i ], i );
754
+ if ( inv !== retVal ) {
755
+ ret.push( elems[ i ] );
756
+ }
757
+ }
758
+
759
+ return ret;
760
+ },
761
+
762
+ // arg is for internal usage only
763
+ map: function( elems, callback, arg ) {
764
+ var value, key, ret = [],
765
+ i = 0,
766
+ length = elems.length,
767
+ // jquery objects are treated as arrays
768
+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
769
+
770
+ // Go through the array, translating each of the items to their
771
+ if ( isArray ) {
772
+ for ( ; i < length; i++ ) {
773
+ value = callback( elems[ i ], i, arg );
774
+
775
+ if ( value != null ) {
776
+ ret[ ret.length ] = value;
777
+ }
778
+ }
779
+
780
+ // Go through every key on the object,
781
+ } else {
782
+ for ( key in elems ) {
783
+ value = callback( elems[ key ], key, arg );
784
+
785
+ if ( value != null ) {
786
+ ret[ ret.length ] = value;
787
+ }
788
+ }
789
+ }
790
+
791
+ // Flatten any nested arrays
792
+ return ret.concat.apply( [], ret );
793
+ },
794
+
795
+ // A global GUID counter for objects
796
+ guid: 1,
797
+
798
+ // Bind a function to a context, optionally partially applying any
799
+ // arguments.
800
+ proxy: function( fn, context ) {
801
+ if ( typeof context === "string" ) {
802
+ var tmp = fn[ context ];
803
+ context = fn;
804
+ fn = tmp;
805
+ }
806
+
807
+ // Quick check to determine if target is callable, in the spec
808
+ // this throws a TypeError, but we will just return undefined.
809
+ if ( !jQuery.isFunction( fn ) ) {
810
+ return undefined;
811
+ }
812
+
813
+ // Simulated bind
814
+ var args = slice.call( arguments, 2 ),
815
+ proxy = function() {
816
+ return fn.apply( context, args.concat( slice.call( arguments ) ) );
817
+ };
818
+
819
+ // Set the guid of unique handler to the same of original handler, so it can be removed
820
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
821
+
822
+ return proxy;
823
+ },
824
+
825
+ // Mutifunctional method to get and set values to a collection
826
+ // The value/s can optionally be executed if it's a function
827
+ access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
828
+ var exec,
829
+ bulk = key == null,
830
+ i = 0,
831
+ length = elems.length;
832
+
833
+ // Sets many values
834
+ if ( key && typeof key === "object" ) {
835
+ for ( i in key ) {
836
+ jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
837
+ }
838
+ chainable = 1;
839
+
840
+ // Sets one value
841
+ } else if ( value !== undefined ) {
842
+ // Optionally, function values get executed if exec is true
843
+ exec = pass === undefined && jQuery.isFunction( value );
844
+
845
+ if ( bulk ) {
846
+ // Bulk operations only iterate when executing function values
847
+ if ( exec ) {
848
+ exec = fn;
849
+ fn = function( elem, key, value ) {
850
+ return exec.call( jQuery( elem ), value );
851
+ };
852
+
853
+ // Otherwise they run against the entire set
854
+ } else {
855
+ fn.call( elems, value );
856
+ fn = null;
857
+ }
858
+ }
859
+
860
+ if ( fn ) {
861
+ for (; i < length; i++ ) {
862
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
863
+ }
864
+ }
865
+
866
+ chainable = 1;
867
+ }
868
+
869
+ return chainable ?
870
+ elems :
871
+
872
+ // Gets
873
+ bulk ?
874
+ fn.call( elems ) :
875
+ length ? fn( elems[0], key ) : emptyGet;
876
+ },
877
+
878
+ now: function() {
879
+ return ( new Date() ).getTime();
880
+ },
881
+
882
+ // Use of jQuery.browser is frowned upon.
883
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
884
+ uaMatch: function( ua ) {
885
+ ua = ua.toLowerCase();
886
+
887
+ var match = rwebkit.exec( ua ) ||
888
+ ropera.exec( ua ) ||
889
+ rmsie.exec( ua ) ||
890
+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
891
+ [];
892
+
893
+ return { browser: match[1] || "", version: match[2] || "0" };
894
+ },
895
+
896
+ sub: function() {
897
+ function jQuerySub( selector, context ) {
898
+ return new jQuerySub.fn.init( selector, context );
899
+ }
900
+ jQuery.extend( true, jQuerySub, this );
901
+ jQuerySub.superclass = this;
902
+ jQuerySub.fn = jQuerySub.prototype = this();
903
+ jQuerySub.fn.constructor = jQuerySub;
904
+ jQuerySub.sub = this.sub;
905
+ jQuerySub.fn.init = function init( selector, context ) {
906
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
907
+ context = jQuerySub( context );
908
+ }
909
+
910
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
911
+ };
912
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
913
+ var rootjQuerySub = jQuerySub(document);
914
+ return jQuerySub;
915
+ },
916
+
917
+ browser: {}
918
+ });
919
+
920
+ // Populate the class2type map
921
+ jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
922
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
923
+ });
924
+
925
+ browserMatch = jQuery.uaMatch( userAgent );
926
+ if ( browserMatch.browser ) {
927
+ jQuery.browser[ browserMatch.browser ] = true;
928
+ jQuery.browser.version = browserMatch.version;
929
+ }
930
+
931
+ // Deprecated, use jQuery.browser.webkit instead
932
+ if ( jQuery.browser.webkit ) {
933
+ jQuery.browser.safari = true;
934
+ }
935
+
936
+ // IE doesn't match non-breaking spaces with \s
937
+ if ( rnotwhite.test( "\xA0" ) ) {
938
+ trimLeft = /^[\s\xA0]+/;
939
+ trimRight = /[\s\xA0]+$/;
940
+ }
941
+
942
+ // All jQuery objects should point back to these
943
+ rootjQuery = jQuery(document);
944
+
945
+ // Cleanup functions for the document ready method
946
+ if ( document.addEventListener ) {
947
+ DOMContentLoaded = function() {
948
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
949
+ jQuery.ready();
950
+ };
951
+
952
+ } else if ( document.attachEvent ) {
953
+ DOMContentLoaded = function() {
954
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
955
+ if ( document.readyState === "complete" ) {
956
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
957
+ jQuery.ready();
958
+ }
959
+ };
960
+ }
961
+
962
+ // The DOM ready check for Internet Explorer
963
+ function doScrollCheck() {
964
+ if ( jQuery.isReady ) {
965
+ return;
966
+ }
967
+
968
+ try {
969
+ // If IE is used, use the trick by Diego Perini
970
+ // http://javascript.nwbox.com/IEContentLoaded/
971
+ document.documentElement.doScroll("left");
972
+ } catch(e) {
973
+ setTimeout( doScrollCheck, 1 );
974
+ return;
975
+ }
976
+
977
+ // and execute any waiting functions
978
+ jQuery.ready();
979
+ }
980
+
981
+ return jQuery;
982
+
983
+ })();
984
+
985
+
986
+ // String to Object flags format cache
987
+ var flagsCache = {};
988
+
989
+ // Convert String-formatted flags into Object-formatted ones and store in cache
990
+ function createFlags( flags ) {
991
+ var object = flagsCache[ flags ] = {},
992
+ i, length;
993
+ flags = flags.split( /\s+/ );
994
+ for ( i = 0, length = flags.length; i < length; i++ ) {
995
+ object[ flags[i] ] = true;
996
+ }
997
+ return object;
998
+ }
999
+
1000
+ /*
1001
+ * Create a callback list using the following parameters:
1002
+ *
1003
+ * flags: an optional list of space-separated flags that will change how
1004
+ * the callback list behaves
1005
+ *
1006
+ * By default a callback list will act like an event callback list and can be
1007
+ * "fired" multiple times.
1008
+ *
1009
+ * Possible flags:
1010
+ *
1011
+ * once: will ensure the callback list can only be fired once (like a Deferred)
1012
+ *
1013
+ * memory: will keep track of previous values and will call any callback added
1014
+ * after the list has been fired right away with the latest "memorized"
1015
+ * values (like a Deferred)
1016
+ *
1017
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
1018
+ *
1019
+ * stopOnFalse: interrupt callings when a callback returns false
1020
+ *
1021
+ */
1022
+ jQuery.Callbacks = function( flags ) {
1023
+
1024
+ // Convert flags from String-formatted to Object-formatted
1025
+ // (we check in cache first)
1026
+ flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
1027
+
1028
+ var // Actual callback list
1029
+ list = [],
1030
+ // Stack of fire calls for repeatable lists
1031
+ stack = [],
1032
+ // Last fire value (for non-forgettable lists)
1033
+ memory,
1034
+ // Flag to know if list was already fired
1035
+ fired,
1036
+ // Flag to know if list is currently firing
1037
+ firing,
1038
+ // First callback to fire (used internally by add and fireWith)
1039
+ firingStart,
1040
+ // End of the loop when firing
1041
+ firingLength,
1042
+ // Index of currently firing callback (modified by remove if needed)
1043
+ firingIndex,
1044
+ // Add one or several callbacks to the list
1045
+ add = function( args ) {
1046
+ var i,
1047
+ length,
1048
+ elem,
1049
+ type,
1050
+ actual;
1051
+ for ( i = 0, length = args.length; i < length; i++ ) {
1052
+ elem = args[ i ];
1053
+ type = jQuery.type( elem );
1054
+ if ( type === "array" ) {
1055
+ // Inspect recursively
1056
+ add( elem );
1057
+ } else if ( type === "function" ) {
1058
+ // Add if not in unique mode and callback is not in
1059
+ if ( !flags.unique || !self.has( elem ) ) {
1060
+ list.push( elem );
1061
+ }
1062
+ }
1063
+ }
1064
+ },
1065
+ // Fire callbacks
1066
+ fire = function( context, args ) {
1067
+ args = args || [];
1068
+ memory = !flags.memory || [ context, args ];
1069
+ fired = true;
1070
+ firing = true;
1071
+ firingIndex = firingStart || 0;
1072
+ firingStart = 0;
1073
+ firingLength = list.length;
1074
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
1075
+ if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
1076
+ memory = true; // Mark as halted
1077
+ break;
1078
+ }
1079
+ }
1080
+ firing = false;
1081
+ if ( list ) {
1082
+ if ( !flags.once ) {
1083
+ if ( stack && stack.length ) {
1084
+ memory = stack.shift();
1085
+ self.fireWith( memory[ 0 ], memory[ 1 ] );
1086
+ }
1087
+ } else if ( memory === true ) {
1088
+ self.disable();
1089
+ } else {
1090
+ list = [];
1091
+ }
1092
+ }
1093
+ },
1094
+ // Actual Callbacks object
1095
+ self = {
1096
+ // Add a callback or a collection of callbacks to the list
1097
+ add: function() {
1098
+ if ( list ) {
1099
+ var length = list.length;
1100
+ add( arguments );
1101
+ // Do we need to add the callbacks to the
1102
+ // current firing batch?
1103
+ if ( firing ) {
1104
+ firingLength = list.length;
1105
+ // With memory, if we're not firing then
1106
+ // we should call right away, unless previous
1107
+ // firing was halted (stopOnFalse)
1108
+ } else if ( memory && memory !== true ) {
1109
+ firingStart = length;
1110
+ fire( memory[ 0 ], memory[ 1 ] );
1111
+ }
1112
+ }
1113
+ return this;
1114
+ },
1115
+ // Remove a callback from the list
1116
+ remove: function() {
1117
+ if ( list ) {
1118
+ var args = arguments,
1119
+ argIndex = 0,
1120
+ argLength = args.length;
1121
+ for ( ; argIndex < argLength ; argIndex++ ) {
1122
+ for ( var i = 0; i < list.length; i++ ) {
1123
+ if ( args[ argIndex ] === list[ i ] ) {
1124
+ // Handle firingIndex and firingLength
1125
+ if ( firing ) {
1126
+ if ( i <= firingLength ) {
1127
+ firingLength--;
1128
+ if ( i <= firingIndex ) {
1129
+ firingIndex--;
1130
+ }
1131
+ }
1132
+ }
1133
+ // Remove the element
1134
+ list.splice( i--, 1 );
1135
+ // If we have some unicity property then
1136
+ // we only need to do this once
1137
+ if ( flags.unique ) {
1138
+ break;
1139
+ }
1140
+ }
1141
+ }
1142
+ }
1143
+ }
1144
+ return this;
1145
+ },
1146
+ // Control if a given callback is in the list
1147
+ has: function( fn ) {
1148
+ if ( list ) {
1149
+ var i = 0,
1150
+ length = list.length;
1151
+ for ( ; i < length; i++ ) {
1152
+ if ( fn === list[ i ] ) {
1153
+ return true;
1154
+ }
1155
+ }
1156
+ }
1157
+ return false;
1158
+ },
1159
+ // Remove all callbacks from the list
1160
+ empty: function() {
1161
+ list = [];
1162
+ return this;
1163
+ },
1164
+ // Have the list do nothing anymore
1165
+ disable: function() {
1166
+ list = stack = memory = undefined;
1167
+ return this;
1168
+ },
1169
+ // Is it disabled?
1170
+ disabled: function() {
1171
+ return !list;
1172
+ },
1173
+ // Lock the list in its current state
1174
+ lock: function() {
1175
+ stack = undefined;
1176
+ if ( !memory || memory === true ) {
1177
+ self.disable();
1178
+ }
1179
+ return this;
1180
+ },
1181
+ // Is it locked?
1182
+ locked: function() {
1183
+ return !stack;
1184
+ },
1185
+ // Call all callbacks with the given context and arguments
1186
+ fireWith: function( context, args ) {
1187
+ if ( stack ) {
1188
+ if ( firing ) {
1189
+ if ( !flags.once ) {
1190
+ stack.push( [ context, args ] );
1191
+ }
1192
+ } else if ( !( flags.once && memory ) ) {
1193
+ fire( context, args );
1194
+ }
1195
+ }
1196
+ return this;
1197
+ },
1198
+ // Call all the callbacks with the given arguments
1199
+ fire: function() {
1200
+ self.fireWith( this, arguments );
1201
+ return this;
1202
+ },
1203
+ // To know if the callbacks have already been called at least once
1204
+ fired: function() {
1205
+ return !!fired;
1206
+ }
1207
+ };
1208
+
1209
+ return self;
1210
+ };
1211
+
1212
+
1213
+
1214
+
1215
+ var // Static reference to slice
1216
+ sliceDeferred = [].slice;
1217
+
1218
+ jQuery.extend({
1219
+
1220
+ Deferred: function( func ) {
1221
+ var doneList = jQuery.Callbacks( "once memory" ),
1222
+ failList = jQuery.Callbacks( "once memory" ),
1223
+ progressList = jQuery.Callbacks( "memory" ),
1224
+ state = "pending",
1225
+ lists = {
1226
+ resolve: doneList,
1227
+ reject: failList,
1228
+ notify: progressList
1229
+ },
1230
+ promise = {
1231
+ done: doneList.add,
1232
+ fail: failList.add,
1233
+ progress: progressList.add,
1234
+
1235
+ state: function() {
1236
+ return state;
1237
+ },
1238
+
1239
+ // Deprecated
1240
+ isResolved: doneList.fired,
1241
+ isRejected: failList.fired,
1242
+
1243
+ then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
1244
+ deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
1245
+ return this;
1246
+ },
1247
+ always: function() {
1248
+ deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
1249
+ return this;
1250
+ },
1251
+ pipe: function( fnDone, fnFail, fnProgress ) {
1252
+ return jQuery.Deferred(function( newDefer ) {
1253
+ jQuery.each( {
1254
+ done: [ fnDone, "resolve" ],
1255
+ fail: [ fnFail, "reject" ],
1256
+ progress: [ fnProgress, "notify" ]
1257
+ }, function( handler, data ) {
1258
+ var fn = data[ 0 ],
1259
+ action = data[ 1 ],
1260
+ returned;
1261
+ if ( jQuery.isFunction( fn ) ) {
1262
+ deferred[ handler ](function() {
1263
+ returned = fn.apply( this, arguments );
1264
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
1265
+ returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
1266
+ } else {
1267
+ newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
1268
+ }
1269
+ });
1270
+ } else {
1271
+ deferred[ handler ]( newDefer[ action ] );
1272
+ }
1273
+ });
1274
+ }).promise();
1275
+ },
1276
+ // Get a promise for this deferred
1277
+ // If obj is provided, the promise aspect is added to the object
1278
+ promise: function( obj ) {
1279
+ if ( obj == null ) {
1280
+ obj = promise;
1281
+ } else {
1282
+ for ( var key in promise ) {
1283
+ obj[ key ] = promise[ key ];
1284
+ }
1285
+ }
1286
+ return obj;
1287
+ }
1288
+ },
1289
+ deferred = promise.promise({}),
1290
+ key;
1291
+
1292
+ for ( key in lists ) {
1293
+ deferred[ key ] = lists[ key ].fire;
1294
+ deferred[ key + "With" ] = lists[ key ].fireWith;
1295
+ }
1296
+
1297
+ // Handle state
1298
+ deferred.done( function() {
1299
+ state = "resolved";
1300
+ }, failList.disable, progressList.lock ).fail( function() {
1301
+ state = "rejected";
1302
+ }, doneList.disable, progressList.lock );
1303
+
1304
+ // Call given func if any
1305
+ if ( func ) {
1306
+ func.call( deferred, deferred );
1307
+ }
1308
+
1309
+ // All done!
1310
+ return deferred;
1311
+ },
1312
+
1313
+ // Deferred helper
1314
+ when: function( firstParam ) {
1315
+ var args = sliceDeferred.call( arguments, 0 ),
1316
+ i = 0,
1317
+ length = args.length,
1318
+ pValues = new Array( length ),
1319
+ count = length,
1320
+ pCount = length,
1321
+ deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
1322
+ firstParam :
1323
+ jQuery.Deferred(),
1324
+ promise = deferred.promise();
1325
+ function resolveFunc( i ) {
1326
+ return function( value ) {
1327
+ args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
1328
+ if ( !( --count ) ) {
1329
+ deferred.resolveWith( deferred, args );
1330
+ }
1331
+ };
1332
+ }
1333
+ function progressFunc( i ) {
1334
+ return function( value ) {
1335
+ pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
1336
+ deferred.notifyWith( promise, pValues );
1337
+ };
1338
+ }
1339
+ if ( length > 1 ) {
1340
+ for ( ; i < length; i++ ) {
1341
+ if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
1342
+ args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
1343
+ } else {
1344
+ --count;
1345
+ }
1346
+ }
1347
+ if ( !count ) {
1348
+ deferred.resolveWith( deferred, args );
1349
+ }
1350
+ } else if ( deferred !== firstParam ) {
1351
+ deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
1352
+ }
1353
+ return promise;
1354
+ }
1355
+ });
1356
+
1357
+
1358
+
1359
+
1360
+ jQuery.support = (function() {
1361
+
1362
+ var support,
1363
+ all,
1364
+ a,
1365
+ select,
1366
+ opt,
1367
+ input,
1368
+ fragment,
1369
+ tds,
1370
+ events,
1371
+ eventName,
1372
+ i,
1373
+ isSupported,
1374
+ div = document.createElement( "div" ),
1375
+ documentElement = document.documentElement;
1376
+
1377
+ // Preliminary tests
1378
+ div.setAttribute("className", "t");
1379
+ div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
1380
+
1381
+ all = div.getElementsByTagName( "*" );
1382
+ a = div.getElementsByTagName( "a" )[ 0 ];
1383
+
1384
+ // Can't get basic test support
1385
+ if ( !all || !all.length || !a ) {
1386
+ return {};
1387
+ }
1388
+
1389
+ // First batch of supports tests
1390
+ select = document.createElement( "select" );
1391
+ opt = select.appendChild( document.createElement("option") );
1392
+ input = div.getElementsByTagName( "input" )[ 0 ];
1393
+
1394
+ support = {
1395
+ // IE strips leading whitespace when .innerHTML is used
1396
+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),
1397
+
1398
+ // Make sure that tbody elements aren't automatically inserted
1399
+ // IE will insert them into empty tables
1400
+ tbody: !div.getElementsByTagName("tbody").length,
1401
+
1402
+ // Make sure that link elements get serialized correctly by innerHTML
1403
+ // This requires a wrapper element in IE
1404
+ htmlSerialize: !!div.getElementsByTagName("link").length,
1405
+
1406
+ // Get the style information from getAttribute
1407
+ // (IE uses .cssText instead)
1408
+ style: /top/.test( a.getAttribute("style") ),
1409
+
1410
+ // Make sure that URLs aren't manipulated
1411
+ // (IE normalizes it by default)
1412
+ hrefNormalized: ( a.getAttribute("href") === "/a" ),
1413
+
1414
+ // Make sure that element opacity exists
1415
+ // (IE uses filter instead)
1416
+ // Use a regex to work around a WebKit issue. See #5145
1417
+ opacity: /^0.55/.test( a.style.opacity ),
1418
+
1419
+ // Verify style float existence
1420
+ // (IE uses styleFloat instead of cssFloat)
1421
+ cssFloat: !!a.style.cssFloat,
1422
+
1423
+ // Make sure that if no value is specified for a checkbox
1424
+ // that it defaults to "on".
1425
+ // (WebKit defaults to "" instead)
1426
+ checkOn: ( input.value === "on" ),
1427
+
1428
+ // Make sure that a selected-by-default option has a working selected property.
1429
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
1430
+ optSelected: opt.selected,
1431
+
1432
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
1433
+ getSetAttribute: div.className !== "t",
1434
+
1435
+ // Tests for enctype support on a form(#6743)
1436
+ enctype: !!document.createElement("form").enctype,
1437
+
1438
+ // Makes sure cloning an html5 element does not cause problems
1439
+ // Where outerHTML is undefined, this still works
1440
+ html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
1441
+
1442
+ // Will be defined later
1443
+ submitBubbles: true,
1444
+ changeBubbles: true,
1445
+ focusinBubbles: false,
1446
+ deleteExpando: true,
1447
+ noCloneEvent: true,
1448
+ inlineBlockNeedsLayout: false,
1449
+ shrinkWrapBlocks: false,
1450
+ reliableMarginRight: true,
1451
+ pixelMargin: true
1452
+ };
1453
+
1454
+ // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
1455
+ jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
1456
+
1457
+ // Make sure checked status is properly cloned
1458
+ input.checked = true;
1459
+ support.noCloneChecked = input.cloneNode( true ).checked;
1460
+
1461
+ // Make sure that the options inside disabled selects aren't marked as disabled
1462
+ // (WebKit marks them as disabled)
1463
+ select.disabled = true;
1464
+ support.optDisabled = !opt.disabled;
1465
+
1466
+ // Test to see if it's possible to delete an expando from an element
1467
+ // Fails in Internet Explorer
1468
+ try {
1469
+ delete div.test;
1470
+ } catch( e ) {
1471
+ support.deleteExpando = false;
1472
+ }
1473
+
1474
+ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
1475
+ div.attachEvent( "onclick", function() {
1476
+ // Cloning a node shouldn't copy over any
1477
+ // bound event handlers (IE does this)
1478
+ support.noCloneEvent = false;
1479
+ });
1480
+ div.cloneNode( true ).fireEvent( "onclick" );
1481
+ }
1482
+
1483
+ // Check if a radio maintains its value
1484
+ // after being appended to the DOM
1485
+ input = document.createElement("input");
1486
+ input.value = "t";
1487
+ input.setAttribute("type", "radio");
1488
+ support.radioValue = input.value === "t";
1489
+
1490
+ input.setAttribute("checked", "checked");
1491
+
1492
+ // #11217 - WebKit loses check when the name is after the checked attribute
1493
+ input.setAttribute( "name", "t" );
1494
+
1495
+ div.appendChild( input );
1496
+ fragment = document.createDocumentFragment();
1497
+ fragment.appendChild( div.lastChild );
1498
+
1499
+ // WebKit doesn't clone checked state correctly in fragments
1500
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
1501
+
1502
+ // Check if a disconnected checkbox will retain its checked
1503
+ // value of true after appended to the DOM (IE6/7)
1504
+ support.appendChecked = input.checked;
1505
+
1506
+ fragment.removeChild( input );
1507
+ fragment.appendChild( div );
1508
+
1509
+ // Technique from Juriy Zaytsev
1510
+ // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
1511
+ // We only care about the case where non-standard event systems
1512
+ // are used, namely in IE. Short-circuiting here helps us to
1513
+ // avoid an eval call (in setAttribute) which can cause CSP
1514
+ // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
1515
+ if ( div.attachEvent ) {
1516
+ for ( i in {
1517
+ submit: 1,
1518
+ change: 1,
1519
+ focusin: 1
1520
+ }) {
1521
+ eventName = "on" + i;
1522
+ isSupported = ( eventName in div );
1523
+ if ( !isSupported ) {
1524
+ div.setAttribute( eventName, "return;" );
1525
+ isSupported = ( typeof div[ eventName ] === "function" );
1526
+ }
1527
+ support[ i + "Bubbles" ] = isSupported;
1528
+ }
1529
+ }
1530
+
1531
+ fragment.removeChild( div );
1532
+
1533
+ // Null elements to avoid leaks in IE
1534
+ fragment = select = opt = div = input = null;
1535
+
1536
+ // Run tests that need a body at doc ready
1537
+ jQuery(function() {
1538
+ var container, outer, inner, table, td, offsetSupport,
1539
+ marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
1540
+ paddingMarginBorderVisibility, paddingMarginBorder,
1541
+ body = document.getElementsByTagName("body")[0];
1542
+
1543
+ if ( !body ) {
1544
+ // Return for frameset docs that don't have a body
1545
+ return;
1546
+ }
1547
+
1548
+ conMarginTop = 1;
1549
+ paddingMarginBorder = "padding:0;margin:0;border:";
1550
+ positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
1551
+ paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
1552
+ style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
1553
+ html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
1554
+ "<table " + style + "' cellpadding='0' cellspacing='0'>" +
1555
+ "<tr><td></td></tr></table>";
1556
+
1557
+ container = document.createElement("div");
1558
+ container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
1559
+ body.insertBefore( container, body.firstChild );
1560
+
1561
+ // Construct the test element
1562
+ div = document.createElement("div");
1563
+ container.appendChild( div );
1564
+
1565
+ // Check if table cells still have offsetWidth/Height when they are set
1566
+ // to display:none and there are still other visible table cells in a
1567
+ // table row; if so, offsetWidth/Height are not reliable for use when
1568
+ // determining if an element has been hidden directly using
1569
+ // display:none (it is still safe to use offsets if a parent element is
1570
+ // hidden; don safety goggles and see bug #4512 for more information).
1571
+ // (only IE 8 fails this test)
1572
+ div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
1573
+ tds = div.getElementsByTagName( "td" );
1574
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
1575
+
1576
+ tds[ 0 ].style.display = "";
1577
+ tds[ 1 ].style.display = "none";
1578
+
1579
+ // Check if empty table cells still have offsetWidth/Height
1580
+ // (IE <= 8 fail this test)
1581
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
1582
+
1583
+ // Check if div with explicit width and no margin-right incorrectly
1584
+ // gets computed margin-right based on width of container. For more
1585
+ // info see bug #3333
1586
+ // Fails in WebKit before Feb 2011 nightlies
1587
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1588
+ if ( window.getComputedStyle ) {
1589
+ div.innerHTML = "";
1590
+ marginDiv = document.createElement( "div" );
1591
+ marginDiv.style.width = "0";
1592
+ marginDiv.style.marginRight = "0";
1593
+ div.style.width = "2px";
1594
+ div.appendChild( marginDiv );
1595
+ support.reliableMarginRight =
1596
+ ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
1597
+ }
1598
+
1599
+ if ( typeof div.style.zoom !== "undefined" ) {
1600
+ // Check if natively block-level elements act like inline-block
1601
+ // elements when setting their display to 'inline' and giving
1602
+ // them layout
1603
+ // (IE < 8 does this)
1604
+ div.innerHTML = "";
1605
+ div.style.width = div.style.padding = "1px";
1606
+ div.style.border = 0;
1607
+ div.style.overflow = "hidden";
1608
+ div.style.display = "inline";
1609
+ div.style.zoom = 1;
1610
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
1611
+
1612
+ // Check if elements with layout shrink-wrap their children
1613
+ // (IE 6 does this)
1614
+ div.style.display = "block";
1615
+ div.style.overflow = "visible";
1616
+ div.innerHTML = "<div style='width:5px;'></div>";
1617
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
1618
+ }
1619
+
1620
+ div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
1621
+ div.innerHTML = html;
1622
+
1623
+ outer = div.firstChild;
1624
+ inner = outer.firstChild;
1625
+ td = outer.nextSibling.firstChild.firstChild;
1626
+
1627
+ offsetSupport = {
1628
+ doesNotAddBorder: ( inner.offsetTop !== 5 ),
1629
+ doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
1630
+ };
1631
+
1632
+ inner.style.position = "fixed";
1633
+ inner.style.top = "20px";
1634
+
1635
+ // safari subtracts parent border width here which is 5px
1636
+ offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
1637
+ inner.style.position = inner.style.top = "";
1638
+
1639
+ outer.style.overflow = "hidden";
1640
+ outer.style.position = "relative";
1641
+
1642
+ offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
1643
+ offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
1644
+
1645
+ if ( window.getComputedStyle ) {
1646
+ div.style.marginTop = "1%";
1647
+ support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
1648
+ }
1649
+
1650
+ if ( typeof container.style.zoom !== "undefined" ) {
1651
+ container.style.zoom = 1;
1652
+ }
1653
+
1654
+ body.removeChild( container );
1655
+ marginDiv = div = container = null;
1656
+
1657
+ jQuery.extend( support, offsetSupport );
1658
+ });
1659
+
1660
+ return support;
1661
+ })();
1662
+
1663
+
1664
+
1665
+
1666
+ var rbrace = /^(?:\{.*\}|\[.*\])$/,
1667
+ rmultiDash = /([A-Z])/g;
1668
+
1669
+ jQuery.extend({
1670
+ cache: {},
1671
+
1672
+ // Please use with caution
1673
+ uuid: 0,
1674
+
1675
+ // Unique for each copy of jQuery on the page
1676
+ // Non-digits removed to match rinlinejQuery
1677
+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
1678
+
1679
+ // The following elements throw uncatchable exceptions if you
1680
+ // attempt to add expando properties to them.
1681
+ noData: {
1682
+ "embed": true,
1683
+ // Ban all objects except for Flash (which handle expandos)
1684
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
1685
+ "applet": true
1686
+ },
1687
+
1688
+ hasData: function( elem ) {
1689
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
1690
+ return !!elem && !isEmptyDataObject( elem );
1691
+ },
1692
+
1693
+ data: function( elem, name, data, pvt /* Internal Use Only */ ) {
1694
+ if ( !jQuery.acceptData( elem ) ) {
1695
+ return;
1696
+ }
1697
+
1698
+ var privateCache, thisCache, ret,
1699
+ internalKey = jQuery.expando,
1700
+ getByName = typeof name === "string",
1701
+
1702
+ // We have to handle DOM nodes and JS objects differently because IE6-7
1703
+ // can't GC object references properly across the DOM-JS boundary
1704
+ isNode = elem.nodeType,
1705
+
1706
+ // Only DOM nodes need the global jQuery cache; JS object data is
1707
+ // attached directly to the object so GC can occur automatically
1708
+ cache = isNode ? jQuery.cache : elem,
1709
+
1710
+ // Only defining an ID for JS objects if its cache already exists allows
1711
+ // the code to shortcut on the same path as a DOM node with no cache
1712
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
1713
+ isEvents = name === "events";
1714
+
1715
+ // Avoid doing any more work than we need to when trying to get data on an
1716
+ // object that has no data at all
1717
+ if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
1718
+ return;
1719
+ }
1720
+
1721
+ if ( !id ) {
1722
+ // Only DOM nodes need a new unique ID for each element since their data
1723
+ // ends up in the global cache
1724
+ if ( isNode ) {
1725
+ elem[ internalKey ] = id = ++jQuery.uuid;
1726
+ } else {
1727
+ id = internalKey;
1728
+ }
1729
+ }
1730
+
1731
+ if ( !cache[ id ] ) {
1732
+ cache[ id ] = {};
1733
+
1734
+ // Avoids exposing jQuery metadata on plain JS objects when the object
1735
+ // is serialized using JSON.stringify
1736
+ if ( !isNode ) {
1737
+ cache[ id ].toJSON = jQuery.noop;
1738
+ }
1739
+ }
1740
+
1741
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
1742
+ // shallow copied over onto the existing cache
1743
+ if ( typeof name === "object" || typeof name === "function" ) {
1744
+ if ( pvt ) {
1745
+ cache[ id ] = jQuery.extend( cache[ id ], name );
1746
+ } else {
1747
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
1748
+ }
1749
+ }
1750
+
1751
+ privateCache = thisCache = cache[ id ];
1752
+
1753
+ // jQuery data() is stored in a separate object inside the object's internal data
1754
+ // cache in order to avoid key collisions between internal data and user-defined
1755
+ // data.
1756
+ if ( !pvt ) {
1757
+ if ( !thisCache.data ) {
1758
+ thisCache.data = {};
1759
+ }
1760
+
1761
+ thisCache = thisCache.data;
1762
+ }
1763
+
1764
+ if ( data !== undefined ) {
1765
+ thisCache[ jQuery.camelCase( name ) ] = data;
1766
+ }
1767
+
1768
+ // Users should not attempt to inspect the internal events object using jQuery.data,
1769
+ // it is undocumented and subject to change. But does anyone listen? No.
1770
+ if ( isEvents && !thisCache[ name ] ) {
1771
+ return privateCache.events;
1772
+ }
1773
+
1774
+ // Check for both converted-to-camel and non-converted data property names
1775
+ // If a data property was specified
1776
+ if ( getByName ) {
1777
+
1778
+ // First Try to find as-is property data
1779
+ ret = thisCache[ name ];
1780
+
1781
+ // Test for null|undefined property data
1782
+ if ( ret == null ) {
1783
+
1784
+ // Try to find the camelCased property
1785
+ ret = thisCache[ jQuery.camelCase( name ) ];
1786
+ }
1787
+ } else {
1788
+ ret = thisCache;
1789
+ }
1790
+
1791
+ return ret;
1792
+ },
1793
+
1794
+ removeData: function( elem, name, pvt /* Internal Use Only */ ) {
1795
+ if ( !jQuery.acceptData( elem ) ) {
1796
+ return;
1797
+ }
1798
+
1799
+ var thisCache, i, l,
1800
+
1801
+ // Reference to internal data cache key
1802
+ internalKey = jQuery.expando,
1803
+
1804
+ isNode = elem.nodeType,
1805
+
1806
+ // See jQuery.data for more information
1807
+ cache = isNode ? jQuery.cache : elem,
1808
+
1809
+ // See jQuery.data for more information
1810
+ id = isNode ? elem[ internalKey ] : internalKey;
1811
+
1812
+ // If there is already no cache entry for this object, there is no
1813
+ // purpose in continuing
1814
+ if ( !cache[ id ] ) {
1815
+ return;
1816
+ }
1817
+
1818
+ if ( name ) {
1819
+
1820
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
1821
+
1822
+ if ( thisCache ) {
1823
+
1824
+ // Support array or space separated string names for data keys
1825
+ if ( !jQuery.isArray( name ) ) {
1826
+
1827
+ // try the string as a key before any manipulation
1828
+ if ( name in thisCache ) {
1829
+ name = [ name ];
1830
+ } else {
1831
+
1832
+ // split the camel cased version by spaces unless a key with the spaces exists
1833
+ name = jQuery.camelCase( name );
1834
+ if ( name in thisCache ) {
1835
+ name = [ name ];
1836
+ } else {
1837
+ name = name.split( " " );
1838
+ }
1839
+ }
1840
+ }
1841
+
1842
+ for ( i = 0, l = name.length; i < l; i++ ) {
1843
+ delete thisCache[ name[i] ];
1844
+ }
1845
+
1846
+ // If there is no data left in the cache, we want to continue
1847
+ // and let the cache object itself get destroyed
1848
+ if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
1849
+ return;
1850
+ }
1851
+ }
1852
+ }
1853
+
1854
+ // See jQuery.data for more information
1855
+ if ( !pvt ) {
1856
+ delete cache[ id ].data;
1857
+
1858
+ // Don't destroy the parent cache unless the internal data object
1859
+ // had been the only thing left in it
1860
+ if ( !isEmptyDataObject(cache[ id ]) ) {
1861
+ return;
1862
+ }
1863
+ }
1864
+
1865
+ // Browsers that fail expando deletion also refuse to delete expandos on
1866
+ // the window, but it will allow it on all other JS objects; other browsers
1867
+ // don't care
1868
+ // Ensure that `cache` is not a window object #10080
1869
+ if ( jQuery.support.deleteExpando || !cache.setInterval ) {
1870
+ delete cache[ id ];
1871
+ } else {
1872
+ cache[ id ] = null;
1873
+ }
1874
+
1875
+ // We destroyed the cache and need to eliminate the expando on the node to avoid
1876
+ // false lookups in the cache for entries that no longer exist
1877
+ if ( isNode ) {
1878
+ // IE does not allow us to delete expando properties from nodes,
1879
+ // nor does it have a removeAttribute function on Document nodes;
1880
+ // we must handle all of these cases
1881
+ if ( jQuery.support.deleteExpando ) {
1882
+ delete elem[ internalKey ];
1883
+ } else if ( elem.removeAttribute ) {
1884
+ elem.removeAttribute( internalKey );
1885
+ } else {
1886
+ elem[ internalKey ] = null;
1887
+ }
1888
+ }
1889
+ },
1890
+
1891
+ // For internal use only.
1892
+ _data: function( elem, name, data ) {
1893
+ return jQuery.data( elem, name, data, true );
1894
+ },
1895
+
1896
+ // A method for determining if a DOM node can handle the data expando
1897
+ acceptData: function( elem ) {
1898
+ if ( elem.nodeName ) {
1899
+ var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
1900
+
1901
+ if ( match ) {
1902
+ return !(match === true || elem.getAttribute("classid") !== match);
1903
+ }
1904
+ }
1905
+
1906
+ return true;
1907
+ }
1908
+ });
1909
+
1910
+ jQuery.fn.extend({
1911
+ data: function( key, value ) {
1912
+ var parts, part, attr, name, l,
1913
+ elem = this[0],
1914
+ i = 0,
1915
+ data = null;
1916
+
1917
+ // Gets all values
1918
+ if ( key === undefined ) {
1919
+ if ( this.length ) {
1920
+ data = jQuery.data( elem );
1921
+
1922
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
1923
+ attr = elem.attributes;
1924
+ for ( l = attr.length; i < l; i++ ) {
1925
+ name = attr[i].name;
1926
+
1927
+ if ( name.indexOf( "data-" ) === 0 ) {
1928
+ name = jQuery.camelCase( name.substring(5) );
1929
+
1930
+ dataAttr( elem, name, data[ name ] );
1931
+ }
1932
+ }
1933
+ jQuery._data( elem, "parsedAttrs", true );
1934
+ }
1935
+ }
1936
+
1937
+ return data;
1938
+ }
1939
+
1940
+ // Sets multiple values
1941
+ if ( typeof key === "object" ) {
1942
+ return this.each(function() {
1943
+ jQuery.data( this, key );
1944
+ });
1945
+ }
1946
+
1947
+ parts = key.split( ".", 2 );
1948
+ parts[1] = parts[1] ? "." + parts[1] : "";
1949
+ part = parts[1] + "!";
1950
+
1951
+ return jQuery.access( this, function( value ) {
1952
+
1953
+ if ( value === undefined ) {
1954
+ data = this.triggerHandler( "getData" + part, [ parts[0] ] );
1955
+
1956
+ // Try to fetch any internally stored data first
1957
+ if ( data === undefined && elem ) {
1958
+ data = jQuery.data( elem, key );
1959
+ data = dataAttr( elem, key, data );
1960
+ }
1961
+
1962
+ return data === undefined && parts[1] ?
1963
+ this.data( parts[0] ) :
1964
+ data;
1965
+ }
1966
+
1967
+ parts[1] = value;
1968
+ this.each(function() {
1969
+ var self = jQuery( this );
1970
+
1971
+ self.triggerHandler( "setData" + part, parts );
1972
+ jQuery.data( this, key, value );
1973
+ self.triggerHandler( "changeData" + part, parts );
1974
+ });
1975
+ }, null, value, arguments.length > 1, null, false );
1976
+ },
1977
+
1978
+ removeData: function( key ) {
1979
+ return this.each(function() {
1980
+ jQuery.removeData( this, key );
1981
+ });
1982
+ }
1983
+ });
1984
+
1985
+ function dataAttr( elem, key, data ) {
1986
+ // If nothing was found internally, try to fetch any
1987
+ // data from the HTML5 data-* attribute
1988
+ if ( data === undefined && elem.nodeType === 1 ) {
1989
+
1990
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
1991
+
1992
+ data = elem.getAttribute( name );
1993
+
1994
+ if ( typeof data === "string" ) {
1995
+ try {
1996
+ data = data === "true" ? true :
1997
+ data === "false" ? false :
1998
+ data === "null" ? null :
1999
+ jQuery.isNumeric( data ) ? +data :
2000
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
2001
+ data;
2002
+ } catch( e ) {}
2003
+
2004
+ // Make sure we set the data so it isn't changed later
2005
+ jQuery.data( elem, key, data );
2006
+
2007
+ } else {
2008
+ data = undefined;
2009
+ }
2010
+ }
2011
+
2012
+ return data;
2013
+ }
2014
+
2015
+ // checks a cache object for emptiness
2016
+ function isEmptyDataObject( obj ) {
2017
+ for ( var name in obj ) {
2018
+
2019
+ // if the public data object is empty, the private is still empty
2020
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
2021
+ continue;
2022
+ }
2023
+ if ( name !== "toJSON" ) {
2024
+ return false;
2025
+ }
2026
+ }
2027
+
2028
+ return true;
2029
+ }
2030
+
2031
+
2032
+
2033
+
2034
+ function handleQueueMarkDefer( elem, type, src ) {
2035
+ var deferDataKey = type + "defer",
2036
+ queueDataKey = type + "queue",
2037
+ markDataKey = type + "mark",
2038
+ defer = jQuery._data( elem, deferDataKey );
2039
+ if ( defer &&
2040
+ ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
2041
+ ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
2042
+ // Give room for hard-coded callbacks to fire first
2043
+ // and eventually mark/queue something else on the element
2044
+ setTimeout( function() {
2045
+ if ( !jQuery._data( elem, queueDataKey ) &&
2046
+ !jQuery._data( elem, markDataKey ) ) {
2047
+ jQuery.removeData( elem, deferDataKey, true );
2048
+ defer.fire();
2049
+ }
2050
+ }, 0 );
2051
+ }
2052
+ }
2053
+
2054
+ jQuery.extend({
2055
+
2056
+ _mark: function( elem, type ) {
2057
+ if ( elem ) {
2058
+ type = ( type || "fx" ) + "mark";
2059
+ jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
2060
+ }
2061
+ },
2062
+
2063
+ _unmark: function( force, elem, type ) {
2064
+ if ( force !== true ) {
2065
+ type = elem;
2066
+ elem = force;
2067
+ force = false;
2068
+ }
2069
+ if ( elem ) {
2070
+ type = type || "fx";
2071
+ var key = type + "mark",
2072
+ count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
2073
+ if ( count ) {
2074
+ jQuery._data( elem, key, count );
2075
+ } else {
2076
+ jQuery.removeData( elem, key, true );
2077
+ handleQueueMarkDefer( elem, type, "mark" );
2078
+ }
2079
+ }
2080
+ },
2081
+
2082
+ queue: function( elem, type, data ) {
2083
+ var q;
2084
+ if ( elem ) {
2085
+ type = ( type || "fx" ) + "queue";
2086
+ q = jQuery._data( elem, type );
2087
+
2088
+ // Speed up dequeue by getting out quickly if this is just a lookup
2089
+ if ( data ) {
2090
+ if ( !q || jQuery.isArray(data) ) {
2091
+ q = jQuery._data( elem, type, jQuery.makeArray(data) );
2092
+ } else {
2093
+ q.push( data );
2094
+ }
2095
+ }
2096
+ return q || [];
2097
+ }
2098
+ },
2099
+
2100
+ dequeue: function( elem, type ) {
2101
+ type = type || "fx";
2102
+
2103
+ var queue = jQuery.queue( elem, type ),
2104
+ fn = queue.shift(),
2105
+ hooks = {};
2106
+
2107
+ // If the fx queue is dequeued, always remove the progress sentinel
2108
+ if ( fn === "inprogress" ) {
2109
+ fn = queue.shift();
2110
+ }
2111
+
2112
+ if ( fn ) {
2113
+ // Add a progress sentinel to prevent the fx queue from being
2114
+ // automatically dequeued
2115
+ if ( type === "fx" ) {
2116
+ queue.unshift( "inprogress" );
2117
+ }
2118
+
2119
+ jQuery._data( elem, type + ".run", hooks );
2120
+ fn.call( elem, function() {
2121
+ jQuery.dequeue( elem, type );
2122
+ }, hooks );
2123
+ }
2124
+
2125
+ if ( !queue.length ) {
2126
+ jQuery.removeData( elem, type + "queue " + type + ".run", true );
2127
+ handleQueueMarkDefer( elem, type, "queue" );
2128
+ }
2129
+ }
2130
+ });
2131
+
2132
+ jQuery.fn.extend({
2133
+ queue: function( type, data ) {
2134
+ var setter = 2;
2135
+
2136
+ if ( typeof type !== "string" ) {
2137
+ data = type;
2138
+ type = "fx";
2139
+ setter--;
2140
+ }
2141
+
2142
+ if ( arguments.length < setter ) {
2143
+ return jQuery.queue( this[0], type );
2144
+ }
2145
+
2146
+ return data === undefined ?
2147
+ this :
2148
+ this.each(function() {
2149
+ var queue = jQuery.queue( this, type, data );
2150
+
2151
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
2152
+ jQuery.dequeue( this, type );
2153
+ }
2154
+ });
2155
+ },
2156
+ dequeue: function( type ) {
2157
+ return this.each(function() {
2158
+ jQuery.dequeue( this, type );
2159
+ });
2160
+ },
2161
+ // Based off of the plugin by Clint Helfers, with permission.
2162
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
2163
+ delay: function( time, type ) {
2164
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
2165
+ type = type || "fx";
2166
+
2167
+ return this.queue( type, function( next, hooks ) {
2168
+ var timeout = setTimeout( next, time );
2169
+ hooks.stop = function() {
2170
+ clearTimeout( timeout );
2171
+ };
2172
+ });
2173
+ },
2174
+ clearQueue: function( type ) {
2175
+ return this.queue( type || "fx", [] );
2176
+ },
2177
+ // Get a promise resolved when queues of a certain type
2178
+ // are emptied (fx is the type by default)
2179
+ promise: function( type, object ) {
2180
+ if ( typeof type !== "string" ) {
2181
+ object = type;
2182
+ type = undefined;
2183
+ }
2184
+ type = type || "fx";
2185
+ var defer = jQuery.Deferred(),
2186
+ elements = this,
2187
+ i = elements.length,
2188
+ count = 1,
2189
+ deferDataKey = type + "defer",
2190
+ queueDataKey = type + "queue",
2191
+ markDataKey = type + "mark",
2192
+ tmp;
2193
+ function resolve() {
2194
+ if ( !( --count ) ) {
2195
+ defer.resolveWith( elements, [ elements ] );
2196
+ }
2197
+ }
2198
+ while( i-- ) {
2199
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
2200
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
2201
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
2202
+ jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
2203
+ count++;
2204
+ tmp.add( resolve );
2205
+ }
2206
+ }
2207
+ resolve();
2208
+ return defer.promise( object );
2209
+ }
2210
+ });
2211
+
2212
+
2213
+
2214
+
2215
+ var rclass = /[\n\t\r]/g,
2216
+ rspace = /\s+/,
2217
+ rreturn = /\r/g,
2218
+ rtype = /^(?:button|input)$/i,
2219
+ rfocusable = /^(?:button|input|object|select|textarea)$/i,
2220
+ rclickable = /^a(?:rea)?$/i,
2221
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
2222
+ getSetAttribute = jQuery.support.getSetAttribute,
2223
+ nodeHook, boolHook, fixSpecified;
2224
+
2225
+ jQuery.fn.extend({
2226
+ attr: function( name, value ) {
2227
+ return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
2228
+ },
2229
+
2230
+ removeAttr: function( name ) {
2231
+ return this.each(function() {
2232
+ jQuery.removeAttr( this, name );
2233
+ });
2234
+ },
2235
+
2236
+ prop: function( name, value ) {
2237
+ return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
2238
+ },
2239
+
2240
+ removeProp: function( name ) {
2241
+ name = jQuery.propFix[ name ] || name;
2242
+ return this.each(function() {
2243
+ // try/catch handles cases where IE balks (such as removing a property on window)
2244
+ try {
2245
+ this[ name ] = undefined;
2246
+ delete this[ name ];
2247
+ } catch( e ) {}
2248
+ });
2249
+ },
2250
+
2251
+ addClass: function( value ) {
2252
+ var classNames, i, l, elem,
2253
+ setClass, c, cl;
2254
+
2255
+ if ( jQuery.isFunction( value ) ) {
2256
+ return this.each(function( j ) {
2257
+ jQuery( this ).addClass( value.call(this, j, this.className) );
2258
+ });
2259
+ }
2260
+
2261
+ if ( value && typeof value === "string" ) {
2262
+ classNames = value.split( rspace );
2263
+
2264
+ for ( i = 0, l = this.length; i < l; i++ ) {
2265
+ elem = this[ i ];
2266
+
2267
+ if ( elem.nodeType === 1 ) {
2268
+ if ( !elem.className && classNames.length === 1 ) {
2269
+ elem.className = value;
2270
+
2271
+ } else {
2272
+ setClass = " " + elem.className + " ";
2273
+
2274
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
2275
+ if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
2276
+ setClass += classNames[ c ] + " ";
2277
+ }
2278
+ }
2279
+ elem.className = jQuery.trim( setClass );
2280
+ }
2281
+ }
2282
+ }
2283
+ }
2284
+
2285
+ return this;
2286
+ },
2287
+
2288
+ removeClass: function( value ) {
2289
+ var classNames, i, l, elem, className, c, cl;
2290
+
2291
+ if ( jQuery.isFunction( value ) ) {
2292
+ return this.each(function( j ) {
2293
+ jQuery( this ).removeClass( value.call(this, j, this.className) );
2294
+ });
2295
+ }
2296
+
2297
+ if ( (value && typeof value === "string") || value === undefined ) {
2298
+ classNames = ( value || "" ).split( rspace );
2299
+
2300
+ for ( i = 0, l = this.length; i < l; i++ ) {
2301
+ elem = this[ i ];
2302
+
2303
+ if ( elem.nodeType === 1 && elem.className ) {
2304
+ if ( value ) {
2305
+ className = (" " + elem.className + " ").replace( rclass, " " );
2306
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
2307
+ className = className.replace(" " + classNames[ c ] + " ", " ");
2308
+ }
2309
+ elem.className = jQuery.trim( className );
2310
+
2311
+ } else {
2312
+ elem.className = "";
2313
+ }
2314
+ }
2315
+ }
2316
+ }
2317
+
2318
+ return this;
2319
+ },
2320
+
2321
+ toggleClass: function( value, stateVal ) {
2322
+ var type = typeof value,
2323
+ isBool = typeof stateVal === "boolean";
2324
+
2325
+ if ( jQuery.isFunction( value ) ) {
2326
+ return this.each(function( i ) {
2327
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
2328
+ });
2329
+ }
2330
+
2331
+ return this.each(function() {
2332
+ if ( type === "string" ) {
2333
+ // toggle individual class names
2334
+ var className,
2335
+ i = 0,
2336
+ self = jQuery( this ),
2337
+ state = stateVal,
2338
+ classNames = value.split( rspace );
2339
+
2340
+ while ( (className = classNames[ i++ ]) ) {
2341
+ // check each className given, space seperated list
2342
+ state = isBool ? state : !self.hasClass( className );
2343
+ self[ state ? "addClass" : "removeClass" ]( className );
2344
+ }
2345
+
2346
+ } else if ( type === "undefined" || type === "boolean" ) {
2347
+ if ( this.className ) {
2348
+ // store className if set
2349
+ jQuery._data( this, "__className__", this.className );
2350
+ }
2351
+
2352
+ // toggle whole className
2353
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
2354
+ }
2355
+ });
2356
+ },
2357
+
2358
+ hasClass: function( selector ) {
2359
+ var className = " " + selector + " ",
2360
+ i = 0,
2361
+ l = this.length;
2362
+ for ( ; i < l; i++ ) {
2363
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
2364
+ return true;
2365
+ }
2366
+ }
2367
+
2368
+ return false;
2369
+ },
2370
+
2371
+ val: function( value ) {
2372
+ var hooks, ret, isFunction,
2373
+ elem = this[0];
2374
+
2375
+ if ( !arguments.length ) {
2376
+ if ( elem ) {
2377
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
2378
+
2379
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
2380
+ return ret;
2381
+ }
2382
+
2383
+ ret = elem.value;
2384
+
2385
+ return typeof ret === "string" ?
2386
+ // handle most common string cases
2387
+ ret.replace(rreturn, "") :
2388
+ // handle cases where value is null/undef or number
2389
+ ret == null ? "" : ret;
2390
+ }
2391
+
2392
+ return;
2393
+ }
2394
+
2395
+ isFunction = jQuery.isFunction( value );
2396
+
2397
+ return this.each(function( i ) {
2398
+ var self = jQuery(this), val;
2399
+
2400
+ if ( this.nodeType !== 1 ) {
2401
+ return;
2402
+ }
2403
+
2404
+ if ( isFunction ) {
2405
+ val = value.call( this, i, self.val() );
2406
+ } else {
2407
+ val = value;
2408
+ }
2409
+
2410
+ // Treat null/undefined as ""; convert numbers to string
2411
+ if ( val == null ) {
2412
+ val = "";
2413
+ } else if ( typeof val === "number" ) {
2414
+ val += "";
2415
+ } else if ( jQuery.isArray( val ) ) {
2416
+ val = jQuery.map(val, function ( value ) {
2417
+ return value == null ? "" : value + "";
2418
+ });
2419
+ }
2420
+
2421
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
2422
+
2423
+ // If set returns undefined, fall back to normal setting
2424
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
2425
+ this.value = val;
2426
+ }
2427
+ });
2428
+ }
2429
+ });
2430
+
2431
+ jQuery.extend({
2432
+ valHooks: {
2433
+ option: {
2434
+ get: function( elem ) {
2435
+ // attributes.value is undefined in Blackberry 4.7 but
2436
+ // uses .value. See #6932
2437
+ var val = elem.attributes.value;
2438
+ return !val || val.specified ? elem.value : elem.text;
2439
+ }
2440
+ },
2441
+ select: {
2442
+ get: function( elem ) {
2443
+ var value, i, max, option,
2444
+ index = elem.selectedIndex,
2445
+ values = [],
2446
+ options = elem.options,
2447
+ one = elem.type === "select-one";
2448
+
2449
+ // Nothing was selected
2450
+ if ( index < 0 ) {
2451
+ return null;
2452
+ }
2453
+
2454
+ // Loop through all the selected options
2455
+ i = one ? index : 0;
2456
+ max = one ? index + 1 : options.length;
2457
+ for ( ; i < max; i++ ) {
2458
+ option = options[ i ];
2459
+
2460
+ // Don't return options that are disabled or in a disabled optgroup
2461
+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
2462
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
2463
+
2464
+ // Get the specific value for the option
2465
+ value = jQuery( option ).val();
2466
+
2467
+ // We don't need an array for one selects
2468
+ if ( one ) {
2469
+ return value;
2470
+ }
2471
+
2472
+ // Multi-Selects return an array
2473
+ values.push( value );
2474
+ }
2475
+ }
2476
+
2477
+ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
2478
+ if ( one && !values.length && options.length ) {
2479
+ return jQuery( options[ index ] ).val();
2480
+ }
2481
+
2482
+ return values;
2483
+ },
2484
+
2485
+ set: function( elem, value ) {
2486
+ var values = jQuery.makeArray( value );
2487
+
2488
+ jQuery(elem).find("option").each(function() {
2489
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
2490
+ });
2491
+
2492
+ if ( !values.length ) {
2493
+ elem.selectedIndex = -1;
2494
+ }
2495
+ return values;
2496
+ }
2497
+ }
2498
+ },
2499
+
2500
+ attrFn: {
2501
+ val: true,
2502
+ css: true,
2503
+ html: true,
2504
+ text: true,
2505
+ data: true,
2506
+ width: true,
2507
+ height: true,
2508
+ offset: true
2509
+ },
2510
+
2511
+ attr: function( elem, name, value, pass ) {
2512
+ var ret, hooks, notxml,
2513
+ nType = elem.nodeType;
2514
+
2515
+ // don't get/set attributes on text, comment and attribute nodes
2516
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2517
+ return;
2518
+ }
2519
+
2520
+ if ( pass && name in jQuery.attrFn ) {
2521
+ return jQuery( elem )[ name ]( value );
2522
+ }
2523
+
2524
+ // Fallback to prop when attributes are not supported
2525
+ if ( typeof elem.getAttribute === "undefined" ) {
2526
+ return jQuery.prop( elem, name, value );
2527
+ }
2528
+
2529
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2530
+
2531
+ // All attributes are lowercase
2532
+ // Grab necessary hook if one is defined
2533
+ if ( notxml ) {
2534
+ name = name.toLowerCase();
2535
+ hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
2536
+ }
2537
+
2538
+ if ( value !== undefined ) {
2539
+
2540
+ if ( value === null ) {
2541
+ jQuery.removeAttr( elem, name );
2542
+ return;
2543
+
2544
+ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
2545
+ return ret;
2546
+
2547
+ } else {
2548
+ elem.setAttribute( name, "" + value );
2549
+ return value;
2550
+ }
2551
+
2552
+ } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
2553
+ return ret;
2554
+
2555
+ } else {
2556
+
2557
+ ret = elem.getAttribute( name );
2558
+
2559
+ // Non-existent attributes return null, we normalize to undefined
2560
+ return ret === null ?
2561
+ undefined :
2562
+ ret;
2563
+ }
2564
+ },
2565
+
2566
+ removeAttr: function( elem, value ) {
2567
+ var propName, attrNames, name, l, isBool,
2568
+ i = 0;
2569
+
2570
+ if ( value && elem.nodeType === 1 ) {
2571
+ attrNames = value.toLowerCase().split( rspace );
2572
+ l = attrNames.length;
2573
+
2574
+ for ( ; i < l; i++ ) {
2575
+ name = attrNames[ i ];
2576
+
2577
+ if ( name ) {
2578
+ propName = jQuery.propFix[ name ] || name;
2579
+ isBool = rboolean.test( name );
2580
+
2581
+ // See #9699 for explanation of this approach (setting first, then removal)
2582
+ // Do not do this for boolean attributes (see #10870)
2583
+ if ( !isBool ) {
2584
+ jQuery.attr( elem, name, "" );
2585
+ }
2586
+ elem.removeAttribute( getSetAttribute ? name : propName );
2587
+
2588
+ // Set corresponding property to false for boolean attributes
2589
+ if ( isBool && propName in elem ) {
2590
+ elem[ propName ] = false;
2591
+ }
2592
+ }
2593
+ }
2594
+ }
2595
+ },
2596
+
2597
+ attrHooks: {
2598
+ type: {
2599
+ set: function( elem, value ) {
2600
+ // We can't allow the type property to be changed (since it causes problems in IE)
2601
+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
2602
+ jQuery.error( "type property can't be changed" );
2603
+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
2604
+ // Setting the type on a radio button after the value resets the value in IE6-9
2605
+ // Reset value to it's default in case type is set after value
2606
+ // This is for element creation
2607
+ var val = elem.value;
2608
+ elem.setAttribute( "type", value );
2609
+ if ( val ) {
2610
+ elem.value = val;
2611
+ }
2612
+ return value;
2613
+ }
2614
+ }
2615
+ },
2616
+ // Use the value property for back compat
2617
+ // Use the nodeHook for button elements in IE6/7 (#1954)
2618
+ value: {
2619
+ get: function( elem, name ) {
2620
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
2621
+ return nodeHook.get( elem, name );
2622
+ }
2623
+ return name in elem ?
2624
+ elem.value :
2625
+ null;
2626
+ },
2627
+ set: function( elem, value, name ) {
2628
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
2629
+ return nodeHook.set( elem, value, name );
2630
+ }
2631
+ // Does not return so that setAttribute is also used
2632
+ elem.value = value;
2633
+ }
2634
+ }
2635
+ },
2636
+
2637
+ propFix: {
2638
+ tabindex: "tabIndex",
2639
+ readonly: "readOnly",
2640
+ "for": "htmlFor",
2641
+ "class": "className",
2642
+ maxlength: "maxLength",
2643
+ cellspacing: "cellSpacing",
2644
+ cellpadding: "cellPadding",
2645
+ rowspan: "rowSpan",
2646
+ colspan: "colSpan",
2647
+ usemap: "useMap",
2648
+ frameborder: "frameBorder",
2649
+ contenteditable: "contentEditable"
2650
+ },
2651
+
2652
+ prop: function( elem, name, value ) {
2653
+ var ret, hooks, notxml,
2654
+ nType = elem.nodeType;
2655
+
2656
+ // don't get/set properties on text, comment and attribute nodes
2657
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2658
+ return;
2659
+ }
2660
+
2661
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2662
+
2663
+ if ( notxml ) {
2664
+ // Fix name and attach hooks
2665
+ name = jQuery.propFix[ name ] || name;
2666
+ hooks = jQuery.propHooks[ name ];
2667
+ }
2668
+
2669
+ if ( value !== undefined ) {
2670
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
2671
+ return ret;
2672
+
2673
+ } else {
2674
+ return ( elem[ name ] = value );
2675
+ }
2676
+
2677
+ } else {
2678
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
2679
+ return ret;
2680
+
2681
+ } else {
2682
+ return elem[ name ];
2683
+ }
2684
+ }
2685
+ },
2686
+
2687
+ propHooks: {
2688
+ tabIndex: {
2689
+ get: function( elem ) {
2690
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
2691
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
2692
+ var attributeNode = elem.getAttributeNode("tabindex");
2693
+
2694
+ return attributeNode && attributeNode.specified ?
2695
+ parseInt( attributeNode.value, 10 ) :
2696
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
2697
+ 0 :
2698
+ undefined;
2699
+ }
2700
+ }
2701
+ }
2702
+ });
2703
+
2704
+ // Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
2705
+ jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
2706
+
2707
+ // Hook for boolean attributes
2708
+ boolHook = {
2709
+ get: function( elem, name ) {
2710
+ // Align boolean attributes with corresponding properties
2711
+ // Fall back to attribute presence where some booleans are not supported
2712
+ var attrNode,
2713
+ property = jQuery.prop( elem, name );
2714
+ return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
2715
+ name.toLowerCase() :
2716
+ undefined;
2717
+ },
2718
+ set: function( elem, value, name ) {
2719
+ var propName;
2720
+ if ( value === false ) {
2721
+ // Remove boolean attributes when set to false
2722
+ jQuery.removeAttr( elem, name );
2723
+ } else {
2724
+ // value is true since we know at this point it's type boolean and not false
2725
+ // Set boolean attributes to the same name and set the DOM property
2726
+ propName = jQuery.propFix[ name ] || name;
2727
+ if ( propName in elem ) {
2728
+ // Only set the IDL specifically if it already exists on the element
2729
+ elem[ propName ] = true;
2730
+ }
2731
+
2732
+ elem.setAttribute( name, name.toLowerCase() );
2733
+ }
2734
+ return name;
2735
+ }
2736
+ };
2737
+
2738
+ // IE6/7 do not support getting/setting some attributes with get/setAttribute
2739
+ if ( !getSetAttribute ) {
2740
+
2741
+ fixSpecified = {
2742
+ name: true,
2743
+ id: true,
2744
+ coords: true
2745
+ };
2746
+
2747
+ // Use this for any attribute in IE6/7
2748
+ // This fixes almost every IE6/7 issue
2749
+ nodeHook = jQuery.valHooks.button = {
2750
+ get: function( elem, name ) {
2751
+ var ret;
2752
+ ret = elem.getAttributeNode( name );
2753
+ return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
2754
+ ret.nodeValue :
2755
+ undefined;
2756
+ },
2757
+ set: function( elem, value, name ) {
2758
+ // Set the existing or create a new attribute node
2759
+ var ret = elem.getAttributeNode( name );
2760
+ if ( !ret ) {
2761
+ ret = document.createAttribute( name );
2762
+ elem.setAttributeNode( ret );
2763
+ }
2764
+ return ( ret.nodeValue = value + "" );
2765
+ }
2766
+ };
2767
+
2768
+ // Apply the nodeHook to tabindex
2769
+ jQuery.attrHooks.tabindex.set = nodeHook.set;
2770
+
2771
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
2772
+ // This is for removals
2773
+ jQuery.each([ "width", "height" ], function( i, name ) {
2774
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2775
+ set: function( elem, value ) {
2776
+ if ( value === "" ) {
2777
+ elem.setAttribute( name, "auto" );
2778
+ return value;
2779
+ }
2780
+ }
2781
+ });
2782
+ });
2783
+
2784
+ // Set contenteditable to false on removals(#10429)
2785
+ // Setting to empty string throws an error as an invalid value
2786
+ jQuery.attrHooks.contenteditable = {
2787
+ get: nodeHook.get,
2788
+ set: function( elem, value, name ) {
2789
+ if ( value === "" ) {
2790
+ value = "false";
2791
+ }
2792
+ nodeHook.set( elem, value, name );
2793
+ }
2794
+ };
2795
+ }
2796
+
2797
+
2798
+ // Some attributes require a special call on IE
2799
+ if ( !jQuery.support.hrefNormalized ) {
2800
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
2801
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2802
+ get: function( elem ) {
2803
+ var ret = elem.getAttribute( name, 2 );
2804
+ return ret === null ? undefined : ret;
2805
+ }
2806
+ });
2807
+ });
2808
+ }
2809
+
2810
+ if ( !jQuery.support.style ) {
2811
+ jQuery.attrHooks.style = {
2812
+ get: function( elem ) {
2813
+ // Return undefined in the case of empty string
2814
+ // Normalize to lowercase since IE uppercases css property names
2815
+ return elem.style.cssText.toLowerCase() || undefined;
2816
+ },
2817
+ set: function( elem, value ) {
2818
+ return ( elem.style.cssText = "" + value );
2819
+ }
2820
+ };
2821
+ }
2822
+
2823
+ // Safari mis-reports the default selected property of an option
2824
+ // Accessing the parent's selectedIndex property fixes it
2825
+ if ( !jQuery.support.optSelected ) {
2826
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
2827
+ get: function( elem ) {
2828
+ var parent = elem.parentNode;
2829
+
2830
+ if ( parent ) {
2831
+ parent.selectedIndex;
2832
+
2833
+ // Make sure that it also works with optgroups, see #5701
2834
+ if ( parent.parentNode ) {
2835
+ parent.parentNode.selectedIndex;
2836
+ }
2837
+ }
2838
+ return null;
2839
+ }
2840
+ });
2841
+ }
2842
+
2843
+ // IE6/7 call enctype encoding
2844
+ if ( !jQuery.support.enctype ) {
2845
+ jQuery.propFix.enctype = "encoding";
2846
+ }
2847
+
2848
+ // Radios and checkboxes getter/setter
2849
+ if ( !jQuery.support.checkOn ) {
2850
+ jQuery.each([ "radio", "checkbox" ], function() {
2851
+ jQuery.valHooks[ this ] = {
2852
+ get: function( elem ) {
2853
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
2854
+ return elem.getAttribute("value") === null ? "on" : elem.value;
2855
+ }
2856
+ };
2857
+ });
2858
+ }
2859
+ jQuery.each([ "radio", "checkbox" ], function() {
2860
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
2861
+ set: function( elem, value ) {
2862
+ if ( jQuery.isArray( value ) ) {
2863
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
2864
+ }
2865
+ }
2866
+ });
2867
+ });
2868
+
2869
+
2870
+
2871
+
2872
+ var rformElems = /^(?:textarea|input|select)$/i,
2873
+ rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
2874
+ rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
2875
+ rkeyEvent = /^key/,
2876
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
2877
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
2878
+ rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
2879
+ quickParse = function( selector ) {
2880
+ var quick = rquickIs.exec( selector );
2881
+ if ( quick ) {
2882
+ // 0 1 2 3
2883
+ // [ _, tag, id, class ]
2884
+ quick[1] = ( quick[1] || "" ).toLowerCase();
2885
+ quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
2886
+ }
2887
+ return quick;
2888
+ },
2889
+ quickIs = function( elem, m ) {
2890
+ var attrs = elem.attributes || {};
2891
+ return (
2892
+ (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
2893
+ (!m[2] || (attrs.id || {}).value === m[2]) &&
2894
+ (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
2895
+ );
2896
+ },
2897
+ hoverHack = function( events ) {
2898
+ return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
2899
+ };
2900
+
2901
+ /*
2902
+ * Helper functions for managing events -- not part of the public interface.
2903
+ * Props to Dean Edwards' addEvent library for many of the ideas.
2904
+ */
2905
+ jQuery.event = {
2906
+
2907
+ add: function( elem, types, handler, data, selector ) {
2908
+
2909
+ var elemData, eventHandle, events,
2910
+ t, tns, type, namespaces, handleObj,
2911
+ handleObjIn, quick, handlers, special;
2912
+
2913
+ // Don't attach events to noData or text/comment nodes (allow plain objects tho)
2914
+ if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
2915
+ return;
2916
+ }
2917
+
2918
+ // Caller can pass in an object of custom data in lieu of the handler
2919
+ if ( handler.handler ) {
2920
+ handleObjIn = handler;
2921
+ handler = handleObjIn.handler;
2922
+ selector = handleObjIn.selector;
2923
+ }
2924
+
2925
+ // Make sure that the handler has a unique ID, used to find/remove it later
2926
+ if ( !handler.guid ) {
2927
+ handler.guid = jQuery.guid++;
2928
+ }
2929
+
2930
+ // Init the element's event structure and main handler, if this is the first
2931
+ events = elemData.events;
2932
+ if ( !events ) {
2933
+ elemData.events = events = {};
2934
+ }
2935
+ eventHandle = elemData.handle;
2936
+ if ( !eventHandle ) {
2937
+ elemData.handle = eventHandle = function( e ) {
2938
+ // Discard the second event of a jQuery.event.trigger() and
2939
+ // when an event is called after a page has unloaded
2940
+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
2941
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
2942
+ undefined;
2943
+ };
2944
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
2945
+ eventHandle.elem = elem;
2946
+ }
2947
+
2948
+ // Handle multiple events separated by a space
2949
+ // jQuery(...).bind("mouseover mouseout", fn);
2950
+ types = jQuery.trim( hoverHack(types) ).split( " " );
2951
+ for ( t = 0; t < types.length; t++ ) {
2952
+
2953
+ tns = rtypenamespace.exec( types[t] ) || [];
2954
+ type = tns[1];
2955
+ namespaces = ( tns[2] || "" ).split( "." ).sort();
2956
+
2957
+ // If event changes its type, use the special event handlers for the changed type
2958
+ special = jQuery.event.special[ type ] || {};
2959
+
2960
+ // If selector defined, determine special event api type, otherwise given type
2961
+ type = ( selector ? special.delegateType : special.bindType ) || type;
2962
+
2963
+ // Update special based on newly reset type
2964
+ special = jQuery.event.special[ type ] || {};
2965
+
2966
+ // handleObj is passed to all event handlers
2967
+ handleObj = jQuery.extend({
2968
+ type: type,
2969
+ origType: tns[1],
2970
+ data: data,
2971
+ handler: handler,
2972
+ guid: handler.guid,
2973
+ selector: selector,
2974
+ quick: selector && quickParse( selector ),
2975
+ namespace: namespaces.join(".")
2976
+ }, handleObjIn );
2977
+
2978
+ // Init the event handler queue if we're the first
2979
+ handlers = events[ type ];
2980
+ if ( !handlers ) {
2981
+ handlers = events[ type ] = [];
2982
+ handlers.delegateCount = 0;
2983
+
2984
+ // Only use addEventListener/attachEvent if the special events handler returns false
2985
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
2986
+ // Bind the global event handler to the element
2987
+ if ( elem.addEventListener ) {
2988
+ elem.addEventListener( type, eventHandle, false );
2989
+
2990
+ } else if ( elem.attachEvent ) {
2991
+ elem.attachEvent( "on" + type, eventHandle );
2992
+ }
2993
+ }
2994
+ }
2995
+
2996
+ if ( special.add ) {
2997
+ special.add.call( elem, handleObj );
2998
+
2999
+ if ( !handleObj.handler.guid ) {
3000
+ handleObj.handler.guid = handler.guid;
3001
+ }
3002
+ }
3003
+
3004
+ // Add to the element's handler list, delegates in front
3005
+ if ( selector ) {
3006
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
3007
+ } else {
3008
+ handlers.push( handleObj );
3009
+ }
3010
+
3011
+ // Keep track of which events have ever been used, for event optimization
3012
+ jQuery.event.global[ type ] = true;
3013
+ }
3014
+
3015
+ // Nullify elem to prevent memory leaks in IE
3016
+ elem = null;
3017
+ },
3018
+
3019
+ global: {},
3020
+
3021
+ // Detach an event or set of events from an element
3022
+ remove: function( elem, types, handler, selector, mappedTypes ) {
3023
+
3024
+ var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
3025
+ t, tns, type, origType, namespaces, origCount,
3026
+ j, events, special, handle, eventType, handleObj;
3027
+
3028
+ if ( !elemData || !(events = elemData.events) ) {
3029
+ return;
3030
+ }
3031
+
3032
+ // Once for each type.namespace in types; type may be omitted
3033
+ types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
3034
+ for ( t = 0; t < types.length; t++ ) {
3035
+ tns = rtypenamespace.exec( types[t] ) || [];
3036
+ type = origType = tns[1];
3037
+ namespaces = tns[2];
3038
+
3039
+ // Unbind all events (on this namespace, if provided) for the element
3040
+ if ( !type ) {
3041
+ for ( type in events ) {
3042
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
3043
+ }
3044
+ continue;
3045
+ }
3046
+
3047
+ special = jQuery.event.special[ type ] || {};
3048
+ type = ( selector? special.delegateType : special.bindType ) || type;
3049
+ eventType = events[ type ] || [];
3050
+ origCount = eventType.length;
3051
+ namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
3052
+
3053
+ // Remove matching events
3054
+ for ( j = 0; j < eventType.length; j++ ) {
3055
+ handleObj = eventType[ j ];
3056
+
3057
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
3058
+ ( !handler || handler.guid === handleObj.guid ) &&
3059
+ ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
3060
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
3061
+ eventType.splice( j--, 1 );
3062
+
3063
+ if ( handleObj.selector ) {
3064
+ eventType.delegateCount--;
3065
+ }
3066
+ if ( special.remove ) {
3067
+ special.remove.call( elem, handleObj );
3068
+ }
3069
+ }
3070
+ }
3071
+
3072
+ // Remove generic event handler if we removed something and no more handlers exist
3073
+ // (avoids potential for endless recursion during removal of special event handlers)
3074
+ if ( eventType.length === 0 && origCount !== eventType.length ) {
3075
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
3076
+ jQuery.removeEvent( elem, type, elemData.handle );
3077
+ }
3078
+
3079
+ delete events[ type ];
3080
+ }
3081
+ }
3082
+
3083
+ // Remove the expando if it's no longer used
3084
+ if ( jQuery.isEmptyObject( events ) ) {
3085
+ handle = elemData.handle;
3086
+ if ( handle ) {
3087
+ handle.elem = null;
3088
+ }
3089
+
3090
+ // removeData also checks for emptiness and clears the expando if empty
3091
+ // so use it instead of delete
3092
+ jQuery.removeData( elem, [ "events", "handle" ], true );
3093
+ }
3094
+ },
3095
+
3096
+ // Events that are safe to short-circuit if no handlers are attached.
3097
+ // Native DOM events should not be added, they may have inline handlers.
3098
+ customEvent: {
3099
+ "getData": true,
3100
+ "setData": true,
3101
+ "changeData": true
3102
+ },
3103
+
3104
+ trigger: function( event, data, elem, onlyHandlers ) {
3105
+ // Don't do events on text and comment nodes
3106
+ if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
3107
+ return;
3108
+ }
3109
+
3110
+ // Event object or event type
3111
+ var type = event.type || event,
3112
+ namespaces = [],
3113
+ cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
3114
+
3115
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
3116
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
3117
+ return;
3118
+ }
3119
+
3120
+ if ( type.indexOf( "!" ) >= 0 ) {
3121
+ // Exclusive events trigger only for the exact event (no namespaces)
3122
+ type = type.slice(0, -1);
3123
+ exclusive = true;
3124
+ }
3125
+
3126
+ if ( type.indexOf( "." ) >= 0 ) {
3127
+ // Namespaced trigger; create a regexp to match event type in handle()
3128
+ namespaces = type.split(".");
3129
+ type = namespaces.shift();
3130
+ namespaces.sort();
3131
+ }
3132
+
3133
+ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
3134
+ // No jQuery handlers for this event type, and it can't have inline handlers
3135
+ return;
3136
+ }
3137
+
3138
+ // Caller can pass in an Event, Object, or just an event type string
3139
+ event = typeof event === "object" ?
3140
+ // jQuery.Event object
3141
+ event[ jQuery.expando ] ? event :
3142
+ // Object literal
3143
+ new jQuery.Event( type, event ) :
3144
+ // Just the event type (string)
3145
+ new jQuery.Event( type );
3146
+
3147
+ event.type = type;
3148
+ event.isTrigger = true;
3149
+ event.exclusive = exclusive;
3150
+ event.namespace = namespaces.join( "." );
3151
+ event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
3152
+ ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
3153
+
3154
+ // Handle a global trigger
3155
+ if ( !elem ) {
3156
+
3157
+ // TODO: Stop taunting the data cache; remove global events and always attach to document
3158
+ cache = jQuery.cache;
3159
+ for ( i in cache ) {
3160
+ if ( cache[ i ].events && cache[ i ].events[ type ] ) {
3161
+ jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
3162
+ }
3163
+ }
3164
+ return;
3165
+ }
3166
+
3167
+ // Clean up the event in case it is being reused
3168
+ event.result = undefined;
3169
+ if ( !event.target ) {
3170
+ event.target = elem;
3171
+ }
3172
+
3173
+ // Clone any incoming data and prepend the event, creating the handler arg list
3174
+ data = data != null ? jQuery.makeArray( data ) : [];
3175
+ data.unshift( event );
3176
+
3177
+ // Allow special events to draw outside the lines
3178
+ special = jQuery.event.special[ type ] || {};
3179
+ if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
3180
+ return;
3181
+ }
3182
+
3183
+ // Determine event propagation path in advance, per W3C events spec (#9951)
3184
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
3185
+ eventPath = [[ elem, special.bindType || type ]];
3186
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
3187
+
3188
+ bubbleType = special.delegateType || type;
3189
+ cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
3190
+ old = null;
3191
+ for ( ; cur; cur = cur.parentNode ) {
3192
+ eventPath.push([ cur, bubbleType ]);
3193
+ old = cur;
3194
+ }
3195
+
3196
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
3197
+ if ( old && old === elem.ownerDocument ) {
3198
+ eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
3199
+ }
3200
+ }
3201
+
3202
+ // Fire handlers on the event path
3203
+ for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
3204
+
3205
+ cur = eventPath[i][0];
3206
+ event.type = eventPath[i][1];
3207
+
3208
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
3209
+ if ( handle ) {
3210
+ handle.apply( cur, data );
3211
+ }
3212
+ // Note that this is a bare JS function and not a jQuery handler
3213
+ handle = ontype && cur[ ontype ];
3214
+ if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
3215
+ event.preventDefault();
3216
+ }
3217
+ }
3218
+ event.type = type;
3219
+
3220
+ // If nobody prevented the default action, do it now
3221
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
3222
+
3223
+ if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
3224
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
3225
+
3226
+ // Call a native DOM method on the target with the same name name as the event.
3227
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
3228
+ // Don't do default actions on window, that's where global variables be (#6170)
3229
+ // IE<9 dies on focus/blur to hidden element (#1486)
3230
+ if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
3231
+
3232
+ // Don't re-trigger an onFOO event when we call its FOO() method
3233
+ old = elem[ ontype ];
3234
+
3235
+ if ( old ) {
3236
+ elem[ ontype ] = null;
3237
+ }
3238
+
3239
+ // Prevent re-triggering of the same event, since we already bubbled it above
3240
+ jQuery.event.triggered = type;
3241
+ elem[ type ]();
3242
+ jQuery.event.triggered = undefined;
3243
+
3244
+ if ( old ) {
3245
+ elem[ ontype ] = old;
3246
+ }
3247
+ }
3248
+ }
3249
+ }
3250
+
3251
+ return event.result;
3252
+ },
3253
+
3254
+ dispatch: function( event ) {
3255
+
3256
+ // Make a writable jQuery.Event from the native event object
3257
+ event = jQuery.event.fix( event || window.event );
3258
+
3259
+ var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
3260
+ delegateCount = handlers.delegateCount,
3261
+ args = [].slice.call( arguments, 0 ),
3262
+ run_all = !event.exclusive && !event.namespace,
3263
+ special = jQuery.event.special[ event.type ] || {},
3264
+ handlerQueue = [],
3265
+ i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
3266
+
3267
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
3268
+ args[0] = event;
3269
+ event.delegateTarget = this;
3270
+
3271
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
3272
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
3273
+ return;
3274
+ }
3275
+
3276
+ // Determine handlers that should run if there are delegated events
3277
+ // Avoid non-left-click bubbling in Firefox (#3861)
3278
+ if ( delegateCount && !(event.button && event.type === "click") ) {
3279
+
3280
+ // Pregenerate a single jQuery object for reuse with .is()
3281
+ jqcur = jQuery(this);
3282
+ jqcur.context = this.ownerDocument || this;
3283
+
3284
+ for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
3285
+
3286
+ // Don't process events on disabled elements (#6911, #8165)
3287
+ if ( cur.disabled !== true ) {
3288
+ selMatch = {};
3289
+ matches = [];
3290
+ jqcur[0] = cur;
3291
+ for ( i = 0; i < delegateCount; i++ ) {
3292
+ handleObj = handlers[ i ];
3293
+ sel = handleObj.selector;
3294
+
3295
+ if ( selMatch[ sel ] === undefined ) {
3296
+ selMatch[ sel ] = (
3297
+ handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
3298
+ );
3299
+ }
3300
+ if ( selMatch[ sel ] ) {
3301
+ matches.push( handleObj );
3302
+ }
3303
+ }
3304
+ if ( matches.length ) {
3305
+ handlerQueue.push({ elem: cur, matches: matches });
3306
+ }
3307
+ }
3308
+ }
3309
+ }
3310
+
3311
+ // Add the remaining (directly-bound) handlers
3312
+ if ( handlers.length > delegateCount ) {
3313
+ handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
3314
+ }
3315
+
3316
+ // Run delegates first; they may want to stop propagation beneath us
3317
+ for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
3318
+ matched = handlerQueue[ i ];
3319
+ event.currentTarget = matched.elem;
3320
+
3321
+ for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
3322
+ handleObj = matched.matches[ j ];
3323
+
3324
+ // Triggered event must either 1) be non-exclusive and have no namespace, or
3325
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
3326
+ if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
3327
+
3328
+ event.data = handleObj.data;
3329
+ event.handleObj = handleObj;
3330
+
3331
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
3332
+ .apply( matched.elem, args );
3333
+
3334
+ if ( ret !== undefined ) {
3335
+ event.result = ret;
3336
+ if ( ret === false ) {
3337
+ event.preventDefault();
3338
+ event.stopPropagation();
3339
+ }
3340
+ }
3341
+ }
3342
+ }
3343
+ }
3344
+
3345
+ // Call the postDispatch hook for the mapped type
3346
+ if ( special.postDispatch ) {
3347
+ special.postDispatch.call( this, event );
3348
+ }
3349
+
3350
+ return event.result;
3351
+ },
3352
+
3353
+ // Includes some event props shared by KeyEvent and MouseEvent
3354
+ // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
3355
+ props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
3356
+
3357
+ fixHooks: {},
3358
+
3359
+ keyHooks: {
3360
+ props: "char charCode key keyCode".split(" "),
3361
+ filter: function( event, original ) {
3362
+
3363
+ // Add which for key events
3364
+ if ( event.which == null ) {
3365
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
3366
+ }
3367
+
3368
+ return event;
3369
+ }
3370
+ },
3371
+
3372
+ mouseHooks: {
3373
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
3374
+ filter: function( event, original ) {
3375
+ var eventDoc, doc, body,
3376
+ button = original.button,
3377
+ fromElement = original.fromElement;
3378
+
3379
+ // Calculate pageX/Y if missing and clientX/Y available
3380
+ if ( event.pageX == null && original.clientX != null ) {
3381
+ eventDoc = event.target.ownerDocument || document;
3382
+ doc = eventDoc.documentElement;
3383
+ body = eventDoc.body;
3384
+
3385
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
3386
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
3387
+ }
3388
+
3389
+ // Add relatedTarget, if necessary
3390
+ if ( !event.relatedTarget && fromElement ) {
3391
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
3392
+ }
3393
+
3394
+ // Add which for click: 1 === left; 2 === middle; 3 === right
3395
+ // Note: button is not normalized, so don't use it
3396
+ if ( !event.which && button !== undefined ) {
3397
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
3398
+ }
3399
+
3400
+ return event;
3401
+ }
3402
+ },
3403
+
3404
+ fix: function( event ) {
3405
+ if ( event[ jQuery.expando ] ) {
3406
+ return event;
3407
+ }
3408
+
3409
+ // Create a writable copy of the event object and normalize some properties
3410
+ var i, prop,
3411
+ originalEvent = event,
3412
+ fixHook = jQuery.event.fixHooks[ event.type ] || {},
3413
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
3414
+
3415
+ event = jQuery.Event( originalEvent );
3416
+
3417
+ for ( i = copy.length; i; ) {
3418
+ prop = copy[ --i ];
3419
+ event[ prop ] = originalEvent[ prop ];
3420
+ }
3421
+
3422
+ // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
3423
+ if ( !event.target ) {
3424
+ event.target = originalEvent.srcElement || document;
3425
+ }
3426
+
3427
+ // Target should not be a text node (#504, Safari)
3428
+ if ( event.target.nodeType === 3 ) {
3429
+ event.target = event.target.parentNode;
3430
+ }
3431
+
3432
+ // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
3433
+ if ( event.metaKey === undefined ) {
3434
+ event.metaKey = event.ctrlKey;
3435
+ }
3436
+
3437
+ return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
3438
+ },
3439
+
3440
+ special: {
3441
+ ready: {
3442
+ // Make sure the ready event is setup
3443
+ setup: jQuery.bindReady
3444
+ },
3445
+
3446
+ load: {
3447
+ // Prevent triggered image.load events from bubbling to window.load
3448
+ noBubble: true
3449
+ },
3450
+
3451
+ focus: {
3452
+ delegateType: "focusin"
3453
+ },
3454
+ blur: {
3455
+ delegateType: "focusout"
3456
+ },
3457
+
3458
+ beforeunload: {
3459
+ setup: function( data, namespaces, eventHandle ) {
3460
+ // We only want to do this special case on windows
3461
+ if ( jQuery.isWindow( this ) ) {
3462
+ this.onbeforeunload = eventHandle;
3463
+ }
3464
+ },
3465
+
3466
+ teardown: function( namespaces, eventHandle ) {
3467
+ if ( this.onbeforeunload === eventHandle ) {
3468
+ this.onbeforeunload = null;
3469
+ }
3470
+ }
3471
+ }
3472
+ },
3473
+
3474
+ simulate: function( type, elem, event, bubble ) {
3475
+ // Piggyback on a donor event to simulate a different one.
3476
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
3477
+ // simulated event prevents default then we do the same on the donor.
3478
+ var e = jQuery.extend(
3479
+ new jQuery.Event(),
3480
+ event,
3481
+ { type: type,
3482
+ isSimulated: true,
3483
+ originalEvent: {}
3484
+ }
3485
+ );
3486
+ if ( bubble ) {
3487
+ jQuery.event.trigger( e, null, elem );
3488
+ } else {
3489
+ jQuery.event.dispatch.call( elem, e );
3490
+ }
3491
+ if ( e.isDefaultPrevented() ) {
3492
+ event.preventDefault();
3493
+ }
3494
+ }
3495
+ };
3496
+
3497
+ // Some plugins are using, but it's undocumented/deprecated and will be removed.
3498
+ // The 1.7 special event interface should provide all the hooks needed now.
3499
+ jQuery.event.handle = jQuery.event.dispatch;
3500
+
3501
+ jQuery.removeEvent = document.removeEventListener ?
3502
+ function( elem, type, handle ) {
3503
+ if ( elem.removeEventListener ) {
3504
+ elem.removeEventListener( type, handle, false );
3505
+ }
3506
+ } :
3507
+ function( elem, type, handle ) {
3508
+ if ( elem.detachEvent ) {
3509
+ elem.detachEvent( "on" + type, handle );
3510
+ }
3511
+ };
3512
+
3513
+ jQuery.Event = function( src, props ) {
3514
+ // Allow instantiation without the 'new' keyword
3515
+ if ( !(this instanceof jQuery.Event) ) {
3516
+ return new jQuery.Event( src, props );
3517
+ }
3518
+
3519
+ // Event object
3520
+ if ( src && src.type ) {
3521
+ this.originalEvent = src;
3522
+ this.type = src.type;
3523
+
3524
+ // Events bubbling up the document may have been marked as prevented
3525
+ // by a handler lower down the tree; reflect the correct value.
3526
+ this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
3527
+ src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
3528
+
3529
+ // Event type
3530
+ } else {
3531
+ this.type = src;
3532
+ }
3533
+
3534
+ // Put explicitly provided properties onto the event object
3535
+ if ( props ) {
3536
+ jQuery.extend( this, props );
3537
+ }
3538
+
3539
+ // Create a timestamp if incoming event doesn't have one
3540
+ this.timeStamp = src && src.timeStamp || jQuery.now();
3541
+
3542
+ // Mark it as fixed
3543
+ this[ jQuery.expando ] = true;
3544
+ };
3545
+
3546
+ function returnFalse() {
3547
+ return false;
3548
+ }
3549
+ function returnTrue() {
3550
+ return true;
3551
+ }
3552
+
3553
+ // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
3554
+ // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
3555
+ jQuery.Event.prototype = {
3556
+ preventDefault: function() {
3557
+ this.isDefaultPrevented = returnTrue;
3558
+
3559
+ var e = this.originalEvent;
3560
+ if ( !e ) {
3561
+ return;
3562
+ }
3563
+
3564
+ // if preventDefault exists run it on the original event
3565
+ if ( e.preventDefault ) {
3566
+ e.preventDefault();
3567
+
3568
+ // otherwise set the returnValue property of the original event to false (IE)
3569
+ } else {
3570
+ e.returnValue = false;
3571
+ }
3572
+ },
3573
+ stopPropagation: function() {
3574
+ this.isPropagationStopped = returnTrue;
3575
+
3576
+ var e = this.originalEvent;
3577
+ if ( !e ) {
3578
+ return;
3579
+ }
3580
+ // if stopPropagation exists run it on the original event
3581
+ if ( e.stopPropagation ) {
3582
+ e.stopPropagation();
3583
+ }
3584
+ // otherwise set the cancelBubble property of the original event to true (IE)
3585
+ e.cancelBubble = true;
3586
+ },
3587
+ stopImmediatePropagation: function() {
3588
+ this.isImmediatePropagationStopped = returnTrue;
3589
+ this.stopPropagation();
3590
+ },
3591
+ isDefaultPrevented: returnFalse,
3592
+ isPropagationStopped: returnFalse,
3593
+ isImmediatePropagationStopped: returnFalse
3594
+ };
3595
+
3596
+ // Create mouseenter/leave events using mouseover/out and event-time checks
3597
+ jQuery.each({
3598
+ mouseenter: "mouseover",
3599
+ mouseleave: "mouseout"
3600
+ }, function( orig, fix ) {
3601
+ jQuery.event.special[ orig ] = {
3602
+ delegateType: fix,
3603
+ bindType: fix,
3604
+
3605
+ handle: function( event ) {
3606
+ var target = this,
3607
+ related = event.relatedTarget,
3608
+ handleObj = event.handleObj,
3609
+ selector = handleObj.selector,
3610
+ ret;
3611
+
3612
+ // For mousenter/leave call the handler if related is outside the target.
3613
+ // NB: No relatedTarget if the mouse left/entered the browser window
3614
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
3615
+ event.type = handleObj.origType;
3616
+ ret = handleObj.handler.apply( this, arguments );
3617
+ event.type = fix;
3618
+ }
3619
+ return ret;
3620
+ }
3621
+ };
3622
+ });
3623
+
3624
+ // IE submit delegation
3625
+ if ( !jQuery.support.submitBubbles ) {
3626
+
3627
+ jQuery.event.special.submit = {
3628
+ setup: function() {
3629
+ // Only need this for delegated form submit events
3630
+ if ( jQuery.nodeName( this, "form" ) ) {
3631
+ return false;
3632
+ }
3633
+
3634
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
3635
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
3636
+ // Node name check avoids a VML-related crash in IE (#9807)
3637
+ var elem = e.target,
3638
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
3639
+ if ( form && !form._submit_attached ) {
3640
+ jQuery.event.add( form, "submit._submit", function( event ) {
3641
+ event._submit_bubble = true;
3642
+ });
3643
+ form._submit_attached = true;
3644
+ }
3645
+ });
3646
+ // return undefined since we don't need an event listener
3647
+ },
3648
+
3649
+ postDispatch: function( event ) {
3650
+ // If form was submitted by the user, bubble the event up the tree
3651
+ if ( event._submit_bubble ) {
3652
+ delete event._submit_bubble;
3653
+ if ( this.parentNode && !event.isTrigger ) {
3654
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
3655
+ }
3656
+ }
3657
+ },
3658
+
3659
+ teardown: function() {
3660
+ // Only need this for delegated form submit events
3661
+ if ( jQuery.nodeName( this, "form" ) ) {
3662
+ return false;
3663
+ }
3664
+
3665
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
3666
+ jQuery.event.remove( this, "._submit" );
3667
+ }
3668
+ };
3669
+ }
3670
+
3671
+ // IE change delegation and checkbox/radio fix
3672
+ if ( !jQuery.support.changeBubbles ) {
3673
+
3674
+ jQuery.event.special.change = {
3675
+
3676
+ setup: function() {
3677
+
3678
+ if ( rformElems.test( this.nodeName ) ) {
3679
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
3680
+ // after a propertychange. Eat the blur-change in special.change.handle.
3681
+ // This still fires onchange a second time for check/radio after blur.
3682
+ if ( this.type === "checkbox" || this.type === "radio" ) {
3683
+ jQuery.event.add( this, "propertychange._change", function( event ) {
3684
+ if ( event.originalEvent.propertyName === "checked" ) {
3685
+ this._just_changed = true;
3686
+ }
3687
+ });
3688
+ jQuery.event.add( this, "click._change", function( event ) {
3689
+ if ( this._just_changed && !event.isTrigger ) {
3690
+ this._just_changed = false;
3691
+ jQuery.event.simulate( "change", this, event, true );
3692
+ }
3693
+ });
3694
+ }
3695
+ return false;
3696
+ }
3697
+ // Delegated event; lazy-add a change handler on descendant inputs
3698
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
3699
+ var elem = e.target;
3700
+
3701
+ if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
3702
+ jQuery.event.add( elem, "change._change", function( event ) {
3703
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
3704
+ jQuery.event.simulate( "change", this.parentNode, event, true );
3705
+ }
3706
+ });
3707
+ elem._change_attached = true;
3708
+ }
3709
+ });
3710
+ },
3711
+
3712
+ handle: function( event ) {
3713
+ var elem = event.target;
3714
+
3715
+ // Swallow native change events from checkbox/radio, we already triggered them above
3716
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
3717
+ return event.handleObj.handler.apply( this, arguments );
3718
+ }
3719
+ },
3720
+
3721
+ teardown: function() {
3722
+ jQuery.event.remove( this, "._change" );
3723
+
3724
+ return rformElems.test( this.nodeName );
3725
+ }
3726
+ };
3727
+ }
3728
+
3729
+ // Create "bubbling" focus and blur events
3730
+ if ( !jQuery.support.focusinBubbles ) {
3731
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
3732
+
3733
+ // Attach a single capturing handler while someone wants focusin/focusout
3734
+ var attaches = 0,
3735
+ handler = function( event ) {
3736
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
3737
+ };
3738
+
3739
+ jQuery.event.special[ fix ] = {
3740
+ setup: function() {
3741
+ if ( attaches++ === 0 ) {
3742
+ document.addEventListener( orig, handler, true );
3743
+ }
3744
+ },
3745
+ teardown: function() {
3746
+ if ( --attaches === 0 ) {
3747
+ document.removeEventListener( orig, handler, true );
3748
+ }
3749
+ }
3750
+ };
3751
+ });
3752
+ }
3753
+
3754
+ jQuery.fn.extend({
3755
+
3756
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
3757
+ var origFn, type;
3758
+
3759
+ // Types can be a map of types/handlers
3760
+ if ( typeof types === "object" ) {
3761
+ // ( types-Object, selector, data )
3762
+ if ( typeof selector !== "string" ) { // && selector != null
3763
+ // ( types-Object, data )
3764
+ data = data || selector;
3765
+ selector = undefined;
3766
+ }
3767
+ for ( type in types ) {
3768
+ this.on( type, selector, data, types[ type ], one );
3769
+ }
3770
+ return this;
3771
+ }
3772
+
3773
+ if ( data == null && fn == null ) {
3774
+ // ( types, fn )
3775
+ fn = selector;
3776
+ data = selector = undefined;
3777
+ } else if ( fn == null ) {
3778
+ if ( typeof selector === "string" ) {
3779
+ // ( types, selector, fn )
3780
+ fn = data;
3781
+ data = undefined;
3782
+ } else {
3783
+ // ( types, data, fn )
3784
+ fn = data;
3785
+ data = selector;
3786
+ selector = undefined;
3787
+ }
3788
+ }
3789
+ if ( fn === false ) {
3790
+ fn = returnFalse;
3791
+ } else if ( !fn ) {
3792
+ return this;
3793
+ }
3794
+
3795
+ if ( one === 1 ) {
3796
+ origFn = fn;
3797
+ fn = function( event ) {
3798
+ // Can use an empty set, since event contains the info
3799
+ jQuery().off( event );
3800
+ return origFn.apply( this, arguments );
3801
+ };
3802
+ // Use same guid so caller can remove using origFn
3803
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
3804
+ }
3805
+ return this.each( function() {
3806
+ jQuery.event.add( this, types, fn, data, selector );
3807
+ });
3808
+ },
3809
+ one: function( types, selector, data, fn ) {
3810
+ return this.on( types, selector, data, fn, 1 );
3811
+ },
3812
+ off: function( types, selector, fn ) {
3813
+ if ( types && types.preventDefault && types.handleObj ) {
3814
+ // ( event ) dispatched jQuery.Event
3815
+ var handleObj = types.handleObj;
3816
+ jQuery( types.delegateTarget ).off(
3817
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
3818
+ handleObj.selector,
3819
+ handleObj.handler
3820
+ );
3821
+ return this;
3822
+ }
3823
+ if ( typeof types === "object" ) {
3824
+ // ( types-object [, selector] )
3825
+ for ( var type in types ) {
3826
+ this.off( type, selector, types[ type ] );
3827
+ }
3828
+ return this;
3829
+ }
3830
+ if ( selector === false || typeof selector === "function" ) {
3831
+ // ( types [, fn] )
3832
+ fn = selector;
3833
+ selector = undefined;
3834
+ }
3835
+ if ( fn === false ) {
3836
+ fn = returnFalse;
3837
+ }
3838
+ return this.each(function() {
3839
+ jQuery.event.remove( this, types, fn, selector );
3840
+ });
3841
+ },
3842
+
3843
+ bind: function( types, data, fn ) {
3844
+ return this.on( types, null, data, fn );
3845
+ },
3846
+ unbind: function( types, fn ) {
3847
+ return this.off( types, null, fn );
3848
+ },
3849
+
3850
+ live: function( types, data, fn ) {
3851
+ jQuery( this.context ).on( types, this.selector, data, fn );
3852
+ return this;
3853
+ },
3854
+ die: function( types, fn ) {
3855
+ jQuery( this.context ).off( types, this.selector || "**", fn );
3856
+ return this;
3857
+ },
3858
+
3859
+ delegate: function( selector, types, data, fn ) {
3860
+ return this.on( types, selector, data, fn );
3861
+ },
3862
+ undelegate: function( selector, types, fn ) {
3863
+ // ( namespace ) or ( selector, types [, fn] )
3864
+ return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
3865
+ },
3866
+
3867
+ trigger: function( type, data ) {
3868
+ return this.each(function() {
3869
+ jQuery.event.trigger( type, data, this );
3870
+ });
3871
+ },
3872
+ triggerHandler: function( type, data ) {
3873
+ if ( this[0] ) {
3874
+ return jQuery.event.trigger( type, data, this[0], true );
3875
+ }
3876
+ },
3877
+
3878
+ toggle: function( fn ) {
3879
+ // Save reference to arguments for access in closure
3880
+ var args = arguments,
3881
+ guid = fn.guid || jQuery.guid++,
3882
+ i = 0,
3883
+ toggler = function( event ) {
3884
+ // Figure out which function to execute
3885
+ var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
3886
+ jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
3887
+
3888
+ // Make sure that clicks stop
3889
+ event.preventDefault();
3890
+
3891
+ // and execute the function
3892
+ return args[ lastToggle ].apply( this, arguments ) || false;
3893
+ };
3894
+
3895
+ // link all the functions, so any of them can unbind this click handler
3896
+ toggler.guid = guid;
3897
+ while ( i < args.length ) {
3898
+ args[ i++ ].guid = guid;
3899
+ }
3900
+
3901
+ return this.click( toggler );
3902
+ },
3903
+
3904
+ hover: function( fnOver, fnOut ) {
3905
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
3906
+ }
3907
+ });
3908
+
3909
+ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
3910
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
3911
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
3912
+
3913
+ // Handle event binding
3914
+ jQuery.fn[ name ] = function( data, fn ) {
3915
+ if ( fn == null ) {
3916
+ fn = data;
3917
+ data = null;
3918
+ }
3919
+
3920
+ return arguments.length > 0 ?
3921
+ this.on( name, null, data, fn ) :
3922
+ this.trigger( name );
3923
+ };
3924
+
3925
+ if ( jQuery.attrFn ) {
3926
+ jQuery.attrFn[ name ] = true;
3927
+ }
3928
+
3929
+ if ( rkeyEvent.test( name ) ) {
3930
+ jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
3931
+ }
3932
+
3933
+ if ( rmouseEvent.test( name ) ) {
3934
+ jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
3935
+ }
3936
+ });
3937
+
3938
+
3939
+
3940
+ /*!
3941
+ * Sizzle CSS Selector Engine
3942
+ * Copyright 2011, The Dojo Foundation
3943
+ * Released under the MIT, BSD, and GPL Licenses.
3944
+ * More information: http://sizzlejs.com/
3945
+ */
3946
+ (function(){
3947
+
3948
+ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
3949
+ expando = "sizcache" + (Math.random() + '').replace('.', ''),
3950
+ done = 0,
3951
+ toString = Object.prototype.toString,
3952
+ hasDuplicate = false,
3953
+ baseHasDuplicate = true,
3954
+ rBackslash = /\\/g,
3955
+ rReturn = /\r\n/g,
3956
+ rNonWord = /\W/;
3957
+
3958
+ // Here we check if the JavaScript engine is using some sort of
3959
+ // optimization where it does not always call our comparision
3960
+ // function. If that is the case, discard the hasDuplicate value.
3961
+ // Thus far that includes Google Chrome.
3962
+ [0, 0].sort(function() {
3963
+ baseHasDuplicate = false;
3964
+ return 0;
3965
+ });
3966
+
3967
+ var Sizzle = function( selector, context, results, seed ) {
3968
+ results = results || [];
3969
+ context = context || document;
3970
+
3971
+ var origContext = context;
3972
+
3973
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
3974
+ return [];
3975
+ }
3976
+
3977
+ if ( !selector || typeof selector !== "string" ) {
3978
+ return results;
3979
+ }
3980
+
3981
+ var m, set, checkSet, extra, ret, cur, pop, i,
3982
+ prune = true,
3983
+ contextXML = Sizzle.isXML( context ),
3984
+ parts = [],
3985
+ soFar = selector;
3986
+
3987
+ // Reset the position of the chunker regexp (start from head)
3988
+ do {
3989
+ chunker.exec( "" );
3990
+ m = chunker.exec( soFar );
3991
+
3992
+ if ( m ) {
3993
+ soFar = m[3];
3994
+
3995
+ parts.push( m[1] );
3996
+
3997
+ if ( m[2] ) {
3998
+ extra = m[3];
3999
+ break;
4000
+ }
4001
+ }
4002
+ } while ( m );
4003
+
4004
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
4005
+
4006
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
4007
+ set = posProcess( parts[0] + parts[1], context, seed );
4008
+
4009
+ } else {
4010
+ set = Expr.relative[ parts[0] ] ?
4011
+ [ context ] :
4012
+ Sizzle( parts.shift(), context );
4013
+
4014
+ while ( parts.length ) {
4015
+ selector = parts.shift();
4016
+
4017
+ if ( Expr.relative[ selector ] ) {
4018
+ selector += parts.shift();
4019
+ }
4020
+
4021
+ set = posProcess( selector, set, seed );
4022
+ }
4023
+ }
4024
+
4025
+
4026
+ } else {
4027
+ // Take a shortcut and set the context if the root selector is an ID
4028
+ // (but not if it'll be faster if the inner selector is an ID)
4029
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
4030
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
4031
+
4032
+ ret = Sizzle.find( parts.shift(), context, contextXML );
4033
+ context = ret.expr ?
4034
+ Sizzle.filter( ret.expr, ret.set )[0] :
4035
+ ret.set[0];
4036
+ }
4037
+
4038
+ if ( context ) {
4039
+ ret = seed ?
4040
+ { expr: parts.pop(), set: makeArray(seed) } :
4041
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
4042
+
4043
+ set = ret.expr ?
4044
+ Sizzle.filter( ret.expr, ret.set ) :
4045
+ ret.set;
4046
+
4047
+ if ( parts.length > 0 ) {
4048
+ checkSet = makeArray( set );
4049
+
4050
+ } else {
4051
+ prune = false;
4052
+ }
4053
+
4054
+ while ( parts.length ) {
4055
+ cur = parts.pop();
4056
+ pop = cur;
4057
+
4058
+ if ( !Expr.relative[ cur ] ) {
4059
+ cur = "";
4060
+ } else {
4061
+ pop = parts.pop();
4062
+ }
4063
+
4064
+ if ( pop == null ) {
4065
+ pop = context;
4066
+ }
4067
+
4068
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
4069
+ }
4070
+
4071
+ } else {
4072
+ checkSet = parts = [];
4073
+ }
4074
+ }
4075
+
4076
+ if ( !checkSet ) {
4077
+ checkSet = set;
4078
+ }
4079
+
4080
+ if ( !checkSet ) {
4081
+ Sizzle.error( cur || selector );
4082
+ }
4083
+
4084
+ if ( toString.call(checkSet) === "[object Array]" ) {
4085
+ if ( !prune ) {
4086
+ results.push.apply( results, checkSet );
4087
+
4088
+ } else if ( context && context.nodeType === 1 ) {
4089
+ for ( i = 0; checkSet[i] != null; i++ ) {
4090
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
4091
+ results.push( set[i] );
4092
+ }
4093
+ }
4094
+
4095
+ } else {
4096
+ for ( i = 0; checkSet[i] != null; i++ ) {
4097
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
4098
+ results.push( set[i] );
4099
+ }
4100
+ }
4101
+ }
4102
+
4103
+ } else {
4104
+ makeArray( checkSet, results );
4105
+ }
4106
+
4107
+ if ( extra ) {
4108
+ Sizzle( extra, origContext, results, seed );
4109
+ Sizzle.uniqueSort( results );
4110
+ }
4111
+
4112
+ return results;
4113
+ };
4114
+
4115
+ Sizzle.uniqueSort = function( results ) {
4116
+ if ( sortOrder ) {
4117
+ hasDuplicate = baseHasDuplicate;
4118
+ results.sort( sortOrder );
4119
+
4120
+ if ( hasDuplicate ) {
4121
+ for ( var i = 1; i < results.length; i++ ) {
4122
+ if ( results[i] === results[ i - 1 ] ) {
4123
+ results.splice( i--, 1 );
4124
+ }
4125
+ }
4126
+ }
4127
+ }
4128
+
4129
+ return results;
4130
+ };
4131
+
4132
+ Sizzle.matches = function( expr, set ) {
4133
+ return Sizzle( expr, null, null, set );
4134
+ };
4135
+
4136
+ Sizzle.matchesSelector = function( node, expr ) {
4137
+ return Sizzle( expr, null, null, [node] ).length > 0;
4138
+ };
4139
+
4140
+ Sizzle.find = function( expr, context, isXML ) {
4141
+ var set, i, len, match, type, left;
4142
+
4143
+ if ( !expr ) {
4144
+ return [];
4145
+ }
4146
+
4147
+ for ( i = 0, len = Expr.order.length; i < len; i++ ) {
4148
+ type = Expr.order[i];
4149
+
4150
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
4151
+ left = match[1];
4152
+ match.splice( 1, 1 );
4153
+
4154
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
4155
+ match[1] = (match[1] || "").replace( rBackslash, "" );
4156
+ set = Expr.find[ type ]( match, context, isXML );
4157
+
4158
+ if ( set != null ) {
4159
+ expr = expr.replace( Expr.match[ type ], "" );
4160
+ break;
4161
+ }
4162
+ }
4163
+ }
4164
+ }
4165
+
4166
+ if ( !set ) {
4167
+ set = typeof context.getElementsByTagName !== "undefined" ?
4168
+ context.getElementsByTagName( "*" ) :
4169
+ [];
4170
+ }
4171
+
4172
+ return { set: set, expr: expr };
4173
+ };
4174
+
4175
+ Sizzle.filter = function( expr, set, inplace, not ) {
4176
+ var match, anyFound,
4177
+ type, found, item, filter, left,
4178
+ i, pass,
4179
+ old = expr,
4180
+ result = [],
4181
+ curLoop = set,
4182
+ isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
4183
+
4184
+ while ( expr && set.length ) {
4185
+ for ( type in Expr.filter ) {
4186
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
4187
+ filter = Expr.filter[ type ];
4188
+ left = match[1];
4189
+
4190
+ anyFound = false;
4191
+
4192
+ match.splice(1,1);
4193
+
4194
+ if ( left.substr( left.length - 1 ) === "\\" ) {
4195
+ continue;
4196
+ }
4197
+
4198
+ if ( curLoop === result ) {
4199
+ result = [];
4200
+ }
4201
+
4202
+ if ( Expr.preFilter[ type ] ) {
4203
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
4204
+
4205
+ if ( !match ) {
4206
+ anyFound = found = true;
4207
+
4208
+ } else if ( match === true ) {
4209
+ continue;
4210
+ }
4211
+ }
4212
+
4213
+ if ( match ) {
4214
+ for ( i = 0; (item = curLoop[i]) != null; i++ ) {
4215
+ if ( item ) {
4216
+ found = filter( item, match, i, curLoop );
4217
+ pass = not ^ found;
4218
+
4219
+ if ( inplace && found != null ) {
4220
+ if ( pass ) {
4221
+ anyFound = true;
4222
+
4223
+ } else {
4224
+ curLoop[i] = false;
4225
+ }
4226
+
4227
+ } else if ( pass ) {
4228
+ result.push( item );
4229
+ anyFound = true;
4230
+ }
4231
+ }
4232
+ }
4233
+ }
4234
+
4235
+ if ( found !== undefined ) {
4236
+ if ( !inplace ) {
4237
+ curLoop = result;
4238
+ }
4239
+
4240
+ expr = expr.replace( Expr.match[ type ], "" );
4241
+
4242
+ if ( !anyFound ) {
4243
+ return [];
4244
+ }
4245
+
4246
+ break;
4247
+ }
4248
+ }
4249
+ }
4250
+
4251
+ // Improper expression
4252
+ if ( expr === old ) {
4253
+ if ( anyFound == null ) {
4254
+ Sizzle.error( expr );
4255
+
4256
+ } else {
4257
+ break;
4258
+ }
4259
+ }
4260
+
4261
+ old = expr;
4262
+ }
4263
+
4264
+ return curLoop;
4265
+ };
4266
+
4267
+ Sizzle.error = function( msg ) {
4268
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
4269
+ };
4270
+
4271
+ /**
4272
+ * Utility function for retreiving the text value of an array of DOM nodes
4273
+ * @param {Array|Element} elem
4274
+ */
4275
+ var getText = Sizzle.getText = function( elem ) {
4276
+ var i, node,
4277
+ nodeType = elem.nodeType,
4278
+ ret = "";
4279
+
4280
+ if ( nodeType ) {
4281
+ if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
4282
+ // Use textContent || innerText for elements
4283
+ if ( typeof elem.textContent === 'string' ) {
4284
+ return elem.textContent;
4285
+ } else if ( typeof elem.innerText === 'string' ) {
4286
+ // Replace IE's carriage returns
4287
+ return elem.innerText.replace( rReturn, '' );
4288
+ } else {
4289
+ // Traverse it's children
4290
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
4291
+ ret += getText( elem );
4292
+ }
4293
+ }
4294
+ } else if ( nodeType === 3 || nodeType === 4 ) {
4295
+ return elem.nodeValue;
4296
+ }
4297
+ } else {
4298
+
4299
+ // If no nodeType, this is expected to be an array
4300
+ for ( i = 0; (node = elem[i]); i++ ) {
4301
+ // Do not traverse comment nodes
4302
+ if ( node.nodeType !== 8 ) {
4303
+ ret += getText( node );
4304
+ }
4305
+ }
4306
+ }
4307
+ return ret;
4308
+ };
4309
+
4310
+ var Expr = Sizzle.selectors = {
4311
+ order: [ "ID", "NAME", "TAG" ],
4312
+
4313
+ match: {
4314
+ ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
4315
+ CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
4316
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
4317
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
4318
+ TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
4319
+ CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
4320
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
4321
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
4322
+ },
4323
+
4324
+ leftMatch: {},
4325
+
4326
+ attrMap: {
4327
+ "class": "className",
4328
+ "for": "htmlFor"
4329
+ },
4330
+
4331
+ attrHandle: {
4332
+ href: function( elem ) {
4333
+ return elem.getAttribute( "href" );
4334
+ },
4335
+ type: function( elem ) {
4336
+ return elem.getAttribute( "type" );
4337
+ }
4338
+ },
4339
+
4340
+ relative: {
4341
+ "+": function(checkSet, part){
4342
+ var isPartStr = typeof part === "string",
4343
+ isTag = isPartStr && !rNonWord.test( part ),
4344
+ isPartStrNotTag = isPartStr && !isTag;
4345
+
4346
+ if ( isTag ) {
4347
+ part = part.toLowerCase();
4348
+ }
4349
+
4350
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
4351
+ if ( (elem = checkSet[i]) ) {
4352
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
4353
+
4354
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
4355
+ elem || false :
4356
+ elem === part;
4357
+ }
4358
+ }
4359
+
4360
+ if ( isPartStrNotTag ) {
4361
+ Sizzle.filter( part, checkSet, true );
4362
+ }
4363
+ },
4364
+
4365
+ ">": function( checkSet, part ) {
4366
+ var elem,
4367
+ isPartStr = typeof part === "string",
4368
+ i = 0,
4369
+ l = checkSet.length;
4370
+
4371
+ if ( isPartStr && !rNonWord.test( part ) ) {
4372
+ part = part.toLowerCase();
4373
+
4374
+ for ( ; i < l; i++ ) {
4375
+ elem = checkSet[i];
4376
+
4377
+ if ( elem ) {
4378
+ var parent = elem.parentNode;
4379
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
4380
+ }
4381
+ }
4382
+
4383
+ } else {
4384
+ for ( ; i < l; i++ ) {
4385
+ elem = checkSet[i];
4386
+
4387
+ if ( elem ) {
4388
+ checkSet[i] = isPartStr ?
4389
+ elem.parentNode :
4390
+ elem.parentNode === part;
4391
+ }
4392
+ }
4393
+
4394
+ if ( isPartStr ) {
4395
+ Sizzle.filter( part, checkSet, true );
4396
+ }
4397
+ }
4398
+ },
4399
+
4400
+ "": function(checkSet, part, isXML){
4401
+ var nodeCheck,
4402
+ doneName = done++,
4403
+ checkFn = dirCheck;
4404
+
4405
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
4406
+ part = part.toLowerCase();
4407
+ nodeCheck = part;
4408
+ checkFn = dirNodeCheck;
4409
+ }
4410
+
4411
+ checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
4412
+ },
4413
+
4414
+ "~": function( checkSet, part, isXML ) {
4415
+ var nodeCheck,
4416
+ doneName = done++,
4417
+ checkFn = dirCheck;
4418
+
4419
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
4420
+ part = part.toLowerCase();
4421
+ nodeCheck = part;
4422
+ checkFn = dirNodeCheck;
4423
+ }
4424
+
4425
+ checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
4426
+ }
4427
+ },
4428
+
4429
+ find: {
4430
+ ID: function( match, context, isXML ) {
4431
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
4432
+ var m = context.getElementById(match[1]);
4433
+ // Check parentNode to catch when Blackberry 4.6 returns
4434
+ // nodes that are no longer in the document #6963
4435
+ return m && m.parentNode ? [m] : [];
4436
+ }
4437
+ },
4438
+
4439
+ NAME: function( match, context ) {
4440
+ if ( typeof context.getElementsByName !== "undefined" ) {
4441
+ var ret = [],
4442
+ results = context.getElementsByName( match[1] );
4443
+
4444
+ for ( var i = 0, l = results.length; i < l; i++ ) {
4445
+ if ( results[i].getAttribute("name") === match[1] ) {
4446
+ ret.push( results[i] );
4447
+ }
4448
+ }
4449
+
4450
+ return ret.length === 0 ? null : ret;
4451
+ }
4452
+ },
4453
+
4454
+ TAG: function( match, context ) {
4455
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
4456
+ return context.getElementsByTagName( match[1] );
4457
+ }
4458
+ }
4459
+ },
4460
+ preFilter: {
4461
+ CLASS: function( match, curLoop, inplace, result, not, isXML ) {
4462
+ match = " " + match[1].replace( rBackslash, "" ) + " ";
4463
+
4464
+ if ( isXML ) {
4465
+ return match;
4466
+ }
4467
+
4468
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
4469
+ if ( elem ) {
4470
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
4471
+ if ( !inplace ) {
4472
+ result.push( elem );
4473
+ }
4474
+
4475
+ } else if ( inplace ) {
4476
+ curLoop[i] = false;
4477
+ }
4478
+ }
4479
+ }
4480
+
4481
+ return false;
4482
+ },
4483
+
4484
+ ID: function( match ) {
4485
+ return match[1].replace( rBackslash, "" );
4486
+ },
4487
+
4488
+ TAG: function( match, curLoop ) {
4489
+ return match[1].replace( rBackslash, "" ).toLowerCase();
4490
+ },
4491
+
4492
+ CHILD: function( match ) {
4493
+ if ( match[1] === "nth" ) {
4494
+ if ( !match[2] ) {
4495
+ Sizzle.error( match[0] );
4496
+ }
4497
+
4498
+ match[2] = match[2].replace(/^\+|\s*/g, '');
4499
+
4500
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
4501
+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
4502
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
4503
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
4504
+
4505
+ // calculate the numbers (first)n+(last) including if they are negative
4506
+ match[2] = (test[1] + (test[2] || 1)) - 0;
4507
+ match[3] = test[3] - 0;
4508
+ }
4509
+ else if ( match[2] ) {
4510
+ Sizzle.error( match[0] );
4511
+ }
4512
+
4513
+ // TODO: Move to normal caching system
4514
+ match[0] = done++;
4515
+
4516
+ return match;
4517
+ },
4518
+
4519
+ ATTR: function( match, curLoop, inplace, result, not, isXML ) {
4520
+ var name = match[1] = match[1].replace( rBackslash, "" );
4521
+
4522
+ if ( !isXML && Expr.attrMap[name] ) {
4523
+ match[1] = Expr.attrMap[name];
4524
+ }
4525
+
4526
+ // Handle if an un-quoted value was used
4527
+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
4528
+
4529
+ if ( match[2] === "~=" ) {
4530
+ match[4] = " " + match[4] + " ";
4531
+ }
4532
+
4533
+ return match;
4534
+ },
4535
+
4536
+ PSEUDO: function( match, curLoop, inplace, result, not ) {
4537
+ if ( match[1] === "not" ) {
4538
+ // If we're dealing with a complex expression, or a simple one
4539
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
4540
+ match[3] = Sizzle(match[3], null, null, curLoop);
4541
+
4542
+ } else {
4543
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
4544
+
4545
+ if ( !inplace ) {
4546
+ result.push.apply( result, ret );
4547
+ }
4548
+
4549
+ return false;
4550
+ }
4551
+
4552
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
4553
+ return true;
4554
+ }
4555
+
4556
+ return match;
4557
+ },
4558
+
4559
+ POS: function( match ) {
4560
+ match.unshift( true );
4561
+
4562
+ return match;
4563
+ }
4564
+ },
4565
+
4566
+ filters: {
4567
+ enabled: function( elem ) {
4568
+ return elem.disabled === false && elem.type !== "hidden";
4569
+ },
4570
+
4571
+ disabled: function( elem ) {
4572
+ return elem.disabled === true;
4573
+ },
4574
+
4575
+ checked: function( elem ) {
4576
+ return elem.checked === true;
4577
+ },
4578
+
4579
+ selected: function( elem ) {
4580
+ // Accessing this property makes selected-by-default
4581
+ // options in Safari work properly
4582
+ if ( elem.parentNode ) {
4583
+ elem.parentNode.selectedIndex;
4584
+ }
4585
+
4586
+ return elem.selected === true;
4587
+ },
4588
+
4589
+ parent: function( elem ) {
4590
+ return !!elem.firstChild;
4591
+ },
4592
+
4593
+ empty: function( elem ) {
4594
+ return !elem.firstChild;
4595
+ },
4596
+
4597
+ has: function( elem, i, match ) {
4598
+ return !!Sizzle( match[3], elem ).length;
4599
+ },
4600
+
4601
+ header: function( elem ) {
4602
+ return (/h\d/i).test( elem.nodeName );
4603
+ },
4604
+
4605
+ text: function( elem ) {
4606
+ var attr = elem.getAttribute( "type" ), type = elem.type;
4607
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
4608
+ // use getAttribute instead to test this case
4609
+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
4610
+ },
4611
+
4612
+ radio: function( elem ) {
4613
+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
4614
+ },
4615
+
4616
+ checkbox: function( elem ) {
4617
+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
4618
+ },
4619
+
4620
+ file: function( elem ) {
4621
+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
4622
+ },
4623
+
4624
+ password: function( elem ) {
4625
+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
4626
+ },
4627
+
4628
+ submit: function( elem ) {
4629
+ var name = elem.nodeName.toLowerCase();
4630
+ return (name === "input" || name === "button") && "submit" === elem.type;
4631
+ },
4632
+
4633
+ image: function( elem ) {
4634
+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
4635
+ },
4636
+
4637
+ reset: function( elem ) {
4638
+ var name = elem.nodeName.toLowerCase();
4639
+ return (name === "input" || name === "button") && "reset" === elem.type;
4640
+ },
4641
+
4642
+ button: function( elem ) {
4643
+ var name = elem.nodeName.toLowerCase();
4644
+ return name === "input" && "button" === elem.type || name === "button";
4645
+ },
4646
+
4647
+ input: function( elem ) {
4648
+ return (/input|select|textarea|button/i).test( elem.nodeName );
4649
+ },
4650
+
4651
+ focus: function( elem ) {
4652
+ return elem === elem.ownerDocument.activeElement;
4653
+ }
4654
+ },
4655
+ setFilters: {
4656
+ first: function( elem, i ) {
4657
+ return i === 0;
4658
+ },
4659
+
4660
+ last: function( elem, i, match, array ) {
4661
+ return i === array.length - 1;
4662
+ },
4663
+
4664
+ even: function( elem, i ) {
4665
+ return i % 2 === 0;
4666
+ },
4667
+
4668
+ odd: function( elem, i ) {
4669
+ return i % 2 === 1;
4670
+ },
4671
+
4672
+ lt: function( elem, i, match ) {
4673
+ return i < match[3] - 0;
4674
+ },
4675
+
4676
+ gt: function( elem, i, match ) {
4677
+ return i > match[3] - 0;
4678
+ },
4679
+
4680
+ nth: function( elem, i, match ) {
4681
+ return match[3] - 0 === i;
4682
+ },
4683
+
4684
+ eq: function( elem, i, match ) {
4685
+ return match[3] - 0 === i;
4686
+ }
4687
+ },
4688
+ filter: {
4689
+ PSEUDO: function( elem, match, i, array ) {
4690
+ var name = match[1],
4691
+ filter = Expr.filters[ name ];
4692
+
4693
+ if ( filter ) {
4694
+ return filter( elem, i, match, array );
4695
+
4696
+ } else if ( name === "contains" ) {
4697
+ return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
4698
+
4699
+ } else if ( name === "not" ) {
4700
+ var not = match[3];
4701
+
4702
+ for ( var j = 0, l = not.length; j < l; j++ ) {
4703
+ if ( not[j] === elem ) {
4704
+ return false;
4705
+ }
4706
+ }
4707
+
4708
+ return true;
4709
+
4710
+ } else {
4711
+ Sizzle.error( name );
4712
+ }
4713
+ },
4714
+
4715
+ CHILD: function( elem, match ) {
4716
+ var first, last,
4717
+ doneName, parent, cache,
4718
+ count, diff,
4719
+ type = match[1],
4720
+ node = elem;
4721
+
4722
+ switch ( type ) {
4723
+ case "only":
4724
+ case "first":
4725
+ while ( (node = node.previousSibling) ) {
4726
+ if ( node.nodeType === 1 ) {
4727
+ return false;
4728
+ }
4729
+ }
4730
+
4731
+ if ( type === "first" ) {
4732
+ return true;
4733
+ }
4734
+
4735
+ node = elem;
4736
+
4737
+ /* falls through */
4738
+ case "last":
4739
+ while ( (node = node.nextSibling) ) {
4740
+ if ( node.nodeType === 1 ) {
4741
+ return false;
4742
+ }
4743
+ }
4744
+
4745
+ return true;
4746
+
4747
+ case "nth":
4748
+ first = match[2];
4749
+ last = match[3];
4750
+
4751
+ if ( first === 1 && last === 0 ) {
4752
+ return true;
4753
+ }
4754
+
4755
+ doneName = match[0];
4756
+ parent = elem.parentNode;
4757
+
4758
+ if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
4759
+ count = 0;
4760
+
4761
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
4762
+ if ( node.nodeType === 1 ) {
4763
+ node.nodeIndex = ++count;
4764
+ }
4765
+ }
4766
+
4767
+ parent[ expando ] = doneName;
4768
+ }
4769
+
4770
+ diff = elem.nodeIndex - last;
4771
+
4772
+ if ( first === 0 ) {
4773
+ return diff === 0;
4774
+
4775
+ } else {
4776
+ return ( diff % first === 0 && diff / first >= 0 );
4777
+ }
4778
+ }
4779
+ },
4780
+
4781
+ ID: function( elem, match ) {
4782
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
4783
+ },
4784
+
4785
+ TAG: function( elem, match ) {
4786
+ return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
4787
+ },
4788
+
4789
+ CLASS: function( elem, match ) {
4790
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
4791
+ .indexOf( match ) > -1;
4792
+ },
4793
+
4794
+ ATTR: function( elem, match ) {
4795
+ var name = match[1],
4796
+ result = Sizzle.attr ?
4797
+ Sizzle.attr( elem, name ) :
4798
+ Expr.attrHandle[ name ] ?
4799
+ Expr.attrHandle[ name ]( elem ) :
4800
+ elem[ name ] != null ?
4801
+ elem[ name ] :
4802
+ elem.getAttribute( name ),
4803
+ value = result + "",
4804
+ type = match[2],
4805
+ check = match[4];
4806
+
4807
+ return result == null ?
4808
+ type === "!=" :
4809
+ !type && Sizzle.attr ?
4810
+ result != null :
4811
+ type === "=" ?
4812
+ value === check :
4813
+ type === "*=" ?
4814
+ value.indexOf(check) >= 0 :
4815
+ type === "~=" ?
4816
+ (" " + value + " ").indexOf(check) >= 0 :
4817
+ !check ?
4818
+ value && result !== false :
4819
+ type === "!=" ?
4820
+ value !== check :
4821
+ type === "^=" ?
4822
+ value.indexOf(check) === 0 :
4823
+ type === "$=" ?
4824
+ value.substr(value.length - check.length) === check :
4825
+ type === "|=" ?
4826
+ value === check || value.substr(0, check.length + 1) === check + "-" :
4827
+ false;
4828
+ },
4829
+
4830
+ POS: function( elem, match, i, array ) {
4831
+ var name = match[2],
4832
+ filter = Expr.setFilters[ name ];
4833
+
4834
+ if ( filter ) {
4835
+ return filter( elem, i, match, array );
4836
+ }
4837
+ }
4838
+ }
4839
+ };
4840
+
4841
+ var origPOS = Expr.match.POS,
4842
+ fescape = function(all, num){
4843
+ return "\\" + (num - 0 + 1);
4844
+ };
4845
+
4846
+ for ( var type in Expr.match ) {
4847
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
4848
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
4849
+ }
4850
+ // Expose origPOS
4851
+ // "global" as in regardless of relation to brackets/parens
4852
+ Expr.match.globalPOS = origPOS;
4853
+
4854
+ var makeArray = function( array, results ) {
4855
+ array = Array.prototype.slice.call( array, 0 );
4856
+
4857
+ if ( results ) {
4858
+ results.push.apply( results, array );
4859
+ return results;
4860
+ }
4861
+
4862
+ return array;
4863
+ };
4864
+
4865
+ // Perform a simple check to determine if the browser is capable of
4866
+ // converting a NodeList to an array using builtin methods.
4867
+ // Also verifies that the returned array holds DOM nodes
4868
+ // (which is not the case in the Blackberry browser)
4869
+ try {
4870
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
4871
+
4872
+ // Provide a fallback method if it does not work
4873
+ } catch( e ) {
4874
+ makeArray = function( array, results ) {
4875
+ var i = 0,
4876
+ ret = results || [];
4877
+
4878
+ if ( toString.call(array) === "[object Array]" ) {
4879
+ Array.prototype.push.apply( ret, array );
4880
+
4881
+ } else {
4882
+ if ( typeof array.length === "number" ) {
4883
+ for ( var l = array.length; i < l; i++ ) {
4884
+ ret.push( array[i] );
4885
+ }
4886
+
4887
+ } else {
4888
+ for ( ; array[i]; i++ ) {
4889
+ ret.push( array[i] );
4890
+ }
4891
+ }
4892
+ }
4893
+
4894
+ return ret;
4895
+ };
4896
+ }
4897
+
4898
+ var sortOrder, siblingCheck;
4899
+
4900
+ if ( document.documentElement.compareDocumentPosition ) {
4901
+ sortOrder = function( a, b ) {
4902
+ if ( a === b ) {
4903
+ hasDuplicate = true;
4904
+ return 0;
4905
+ }
4906
+
4907
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
4908
+ return a.compareDocumentPosition ? -1 : 1;
4909
+ }
4910
+
4911
+ return a.compareDocumentPosition(b) & 4 ? -1 : 1;
4912
+ };
4913
+
4914
+ } else {
4915
+ sortOrder = function( a, b ) {
4916
+ // The nodes are identical, we can exit early
4917
+ if ( a === b ) {
4918
+ hasDuplicate = true;
4919
+ return 0;
4920
+
4921
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes
4922
+ } else if ( a.sourceIndex && b.sourceIndex ) {
4923
+ return a.sourceIndex - b.sourceIndex;
4924
+ }
4925
+
4926
+ var al, bl,
4927
+ ap = [],
4928
+ bp = [],
4929
+ aup = a.parentNode,
4930
+ bup = b.parentNode,
4931
+ cur = aup;
4932
+
4933
+ // If the nodes are siblings (or identical) we can do a quick check
4934
+ if ( aup === bup ) {
4935
+ return siblingCheck( a, b );
4936
+
4937
+ // If no parents were found then the nodes are disconnected
4938
+ } else if ( !aup ) {
4939
+ return -1;
4940
+
4941
+ } else if ( !bup ) {
4942
+ return 1;
4943
+ }
4944
+
4945
+ // Otherwise they're somewhere else in the tree so we need
4946
+ // to build up a full list of the parentNodes for comparison
4947
+ while ( cur ) {
4948
+ ap.unshift( cur );
4949
+ cur = cur.parentNode;
4950
+ }
4951
+
4952
+ cur = bup;
4953
+
4954
+ while ( cur ) {
4955
+ bp.unshift( cur );
4956
+ cur = cur.parentNode;
4957
+ }
4958
+
4959
+ al = ap.length;
4960
+ bl = bp.length;
4961
+
4962
+ // Start walking down the tree looking for a discrepancy
4963
+ for ( var i = 0; i < al && i < bl; i++ ) {
4964
+ if ( ap[i] !== bp[i] ) {
4965
+ return siblingCheck( ap[i], bp[i] );
4966
+ }
4967
+ }
4968
+
4969
+ // We ended someplace up the tree so do a sibling check
4970
+ return i === al ?
4971
+ siblingCheck( a, bp[i], -1 ) :
4972
+ siblingCheck( ap[i], b, 1 );
4973
+ };
4974
+
4975
+ siblingCheck = function( a, b, ret ) {
4976
+ if ( a === b ) {
4977
+ return ret;
4978
+ }
4979
+
4980
+ var cur = a.nextSibling;
4981
+
4982
+ while ( cur ) {
4983
+ if ( cur === b ) {
4984
+ return -1;
4985
+ }
4986
+
4987
+ cur = cur.nextSibling;
4988
+ }
4989
+
4990
+ return 1;
4991
+ };
4992
+ }
4993
+
4994
+ // Check to see if the browser returns elements by name when
4995
+ // querying by getElementById (and provide a workaround)
4996
+ (function(){
4997
+ // We're going to inject a fake input element with a specified name
4998
+ var form = document.createElement("div"),
4999
+ id = "script" + (new Date()).getTime(),
5000
+ root = document.documentElement;
5001
+
5002
+ form.innerHTML = "<a name='" + id + "'/>";
5003
+
5004
+ // Inject it into the root element, check its status, and remove it quickly
5005
+ root.insertBefore( form, root.firstChild );
5006
+
5007
+ // The workaround has to do additional checks after a getElementById
5008
+ // Which slows things down for other browsers (hence the branching)
5009
+ if ( document.getElementById( id ) ) {
5010
+ Expr.find.ID = function( match, context, isXML ) {
5011
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
5012
+ var m = context.getElementById(match[1]);
5013
+
5014
+ return m ?
5015
+ m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
5016
+ [m] :
5017
+ undefined :
5018
+ [];
5019
+ }
5020
+ };
5021
+
5022
+ Expr.filter.ID = function( elem, match ) {
5023
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
5024
+
5025
+ return elem.nodeType === 1 && node && node.nodeValue === match;
5026
+ };
5027
+ }
5028
+
5029
+ root.removeChild( form );
5030
+
5031
+ // release memory in IE
5032
+ root = form = null;
5033
+ })();
5034
+
5035
+ (function(){
5036
+ // Check to see if the browser returns only elements
5037
+ // when doing getElementsByTagName("*")
5038
+
5039
+ // Create a fake element
5040
+ var div = document.createElement("div");
5041
+ div.appendChild( document.createComment("") );
5042
+
5043
+ // Make sure no comments are found
5044
+ if ( div.getElementsByTagName("*").length > 0 ) {
5045
+ Expr.find.TAG = function( match, context ) {
5046
+ var results = context.getElementsByTagName( match[1] );
5047
+
5048
+ // Filter out possible comments
5049
+ if ( match[1] === "*" ) {
5050
+ var tmp = [];
5051
+
5052
+ for ( var i = 0; results[i]; i++ ) {
5053
+ if ( results[i].nodeType === 1 ) {
5054
+ tmp.push( results[i] );
5055
+ }
5056
+ }
5057
+
5058
+ results = tmp;
5059
+ }
5060
+
5061
+ return results;
5062
+ };
5063
+ }
5064
+
5065
+ // Check to see if an attribute returns normalized href attributes
5066
+ div.innerHTML = "<a href='#'></a>";
5067
+
5068
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
5069
+ div.firstChild.getAttribute("href") !== "#" ) {
5070
+
5071
+ Expr.attrHandle.href = function( elem ) {
5072
+ return elem.getAttribute( "href", 2 );
5073
+ };
5074
+ }
5075
+
5076
+ // release memory in IE
5077
+ div = null;
5078
+ })();
5079
+
5080
+ if ( document.querySelectorAll ) {
5081
+ (function(){
5082
+ var oldSizzle = Sizzle,
5083
+ div = document.createElement("div"),
5084
+ id = "__sizzle__";
5085
+
5086
+ div.innerHTML = "<p class='TEST'></p>";
5087
+
5088
+ // Safari can't handle uppercase or unicode characters when
5089
+ // in quirks mode.
5090
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
5091
+ return;
5092
+ }
5093
+
5094
+ Sizzle = function( query, context, extra, seed ) {
5095
+ context = context || document;
5096
+
5097
+ // Only use querySelectorAll on non-XML documents
5098
+ // (ID selectors don't work in non-HTML documents)
5099
+ if ( !seed && !Sizzle.isXML(context) ) {
5100
+ // See if we find a selector to speed up
5101
+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
5102
+
5103
+ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
5104
+ // Speed-up: Sizzle("TAG")
5105
+ if ( match[1] ) {
5106
+ return makeArray( context.getElementsByTagName( query ), extra );
5107
+
5108
+ // Speed-up: Sizzle(".CLASS")
5109
+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
5110
+ return makeArray( context.getElementsByClassName( match[2] ), extra );
5111
+ }
5112
+ }
5113
+
5114
+ if ( context.nodeType === 9 ) {
5115
+ // Speed-up: Sizzle("body")
5116
+ // The body element only exists once, optimize finding it
5117
+ if ( query === "body" && context.body ) {
5118
+ return makeArray( [ context.body ], extra );
5119
+
5120
+ // Speed-up: Sizzle("#ID")
5121
+ } else if ( match && match[3] ) {
5122
+ var elem = context.getElementById( match[3] );
5123
+
5124
+ // Check parentNode to catch when Blackberry 4.6 returns
5125
+ // nodes that are no longer in the document #6963
5126
+ if ( elem && elem.parentNode ) {
5127
+ // Handle the case where IE and Opera return items
5128
+ // by name instead of ID
5129
+ if ( elem.id === match[3] ) {
5130
+ return makeArray( [ elem ], extra );
5131
+ }
5132
+
5133
+ } else {
5134
+ return makeArray( [], extra );
5135
+ }
5136
+ }
5137
+
5138
+ try {
5139
+ return makeArray( context.querySelectorAll(query), extra );
5140
+ } catch(qsaError) {}
5141
+
5142
+ // qSA works strangely on Element-rooted queries
5143
+ // We can work around this by specifying an extra ID on the root
5144
+ // and working up from there (Thanks to Andrew Dupont for the technique)
5145
+ // IE 8 doesn't work on object elements
5146
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
5147
+ var oldContext = context,
5148
+ old = context.getAttribute( "id" ),
5149
+ nid = old || id,
5150
+ hasParent = context.parentNode,
5151
+ relativeHierarchySelector = /^\s*[+~]/.test( query );
5152
+
5153
+ if ( !old ) {
5154
+ context.setAttribute( "id", nid );
5155
+ } else {
5156
+ nid = nid.replace( /'/g, "\\$&" );
5157
+ }
5158
+ if ( relativeHierarchySelector && hasParent ) {
5159
+ context = context.parentNode;
5160
+ }
5161
+
5162
+ try {
5163
+ if ( !relativeHierarchySelector || hasParent ) {
5164
+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
5165
+ }
5166
+
5167
+ } catch(pseudoError) {
5168
+ } finally {
5169
+ if ( !old ) {
5170
+ oldContext.removeAttribute( "id" );
5171
+ }
5172
+ }
5173
+ }
5174
+ }
5175
+
5176
+ return oldSizzle(query, context, extra, seed);
5177
+ };
5178
+
5179
+ for ( var prop in oldSizzle ) {
5180
+ Sizzle[ prop ] = oldSizzle[ prop ];
5181
+ }
5182
+
5183
+ // release memory in IE
5184
+ div = null;
5185
+ })();
5186
+ }
5187
+
5188
+ (function(){
5189
+ var html = document.documentElement,
5190
+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
5191
+
5192
+ if ( matches ) {
5193
+ // Check to see if it's possible to do matchesSelector
5194
+ // on a disconnected node (IE 9 fails this)
5195
+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
5196
+ pseudoWorks = false;
5197
+
5198
+ try {
5199
+ // This should fail with an exception
5200
+ // Gecko does not error, returns false instead
5201
+ matches.call( document.documentElement, "[test!='']:sizzle" );
5202
+
5203
+ } catch( pseudoError ) {
5204
+ pseudoWorks = true;
5205
+ }
5206
+
5207
+ Sizzle.matchesSelector = function( node, expr ) {
5208
+ // Make sure that attribute selectors are quoted
5209
+ expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
5210
+
5211
+ if ( !Sizzle.isXML( node ) ) {
5212
+ try {
5213
+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
5214
+ var ret = matches.call( node, expr );
5215
+
5216
+ // IE 9's matchesSelector returns false on disconnected nodes
5217
+ if ( ret || !disconnectedMatch ||
5218
+ // As well, disconnected nodes are said to be in a document
5219
+ // fragment in IE 9, so check for that
5220
+ node.document && node.document.nodeType !== 11 ) {
5221
+ return ret;
5222
+ }
5223
+ }
5224
+ } catch(e) {}
5225
+ }
5226
+
5227
+ return Sizzle(expr, null, null, [node]).length > 0;
5228
+ };
5229
+ }
5230
+ })();
5231
+
5232
+ (function(){
5233
+ var div = document.createElement("div");
5234
+
5235
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
5236
+
5237
+ // Opera can't find a second classname (in 9.6)
5238
+ // Also, make sure that getElementsByClassName actually exists
5239
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
5240
+ return;
5241
+ }
5242
+
5243
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
5244
+ div.lastChild.className = "e";
5245
+
5246
+ if ( div.getElementsByClassName("e").length === 1 ) {
5247
+ return;
5248
+ }
5249
+
5250
+ Expr.order.splice(1, 0, "CLASS");
5251
+ Expr.find.CLASS = function( match, context, isXML ) {
5252
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
5253
+ return context.getElementsByClassName(match[1]);
5254
+ }
5255
+ };
5256
+
5257
+ // release memory in IE
5258
+ div = null;
5259
+ })();
5260
+
5261
+ function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
5262
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
5263
+ var elem = checkSet[i];
5264
+
5265
+ if ( elem ) {
5266
+ var match = false;
5267
+
5268
+ elem = elem[dir];
5269
+
5270
+ while ( elem ) {
5271
+ if ( elem[ expando ] === doneName ) {
5272
+ match = checkSet[elem.sizset];
5273
+ break;
5274
+ }
5275
+
5276
+ if ( elem.nodeType === 1 && !isXML ){
5277
+ elem[ expando ] = doneName;
5278
+ elem.sizset = i;
5279
+ }
5280
+
5281
+ if ( elem.nodeName.toLowerCase() === cur ) {
5282
+ match = elem;
5283
+ break;
5284
+ }
5285
+
5286
+ elem = elem[dir];
5287
+ }
5288
+
5289
+ checkSet[i] = match;
5290
+ }
5291
+ }
5292
+ }
5293
+
5294
+ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
5295
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
5296
+ var elem = checkSet[i];
5297
+
5298
+ if ( elem ) {
5299
+ var match = false;
5300
+
5301
+ elem = elem[dir];
5302
+
5303
+ while ( elem ) {
5304
+ if ( elem[ expando ] === doneName ) {
5305
+ match = checkSet[elem.sizset];
5306
+ break;
5307
+ }
5308
+
5309
+ if ( elem.nodeType === 1 ) {
5310
+ if ( !isXML ) {
5311
+ elem[ expando ] = doneName;
5312
+ elem.sizset = i;
5313
+ }
5314
+
5315
+ if ( typeof cur !== "string" ) {
5316
+ if ( elem === cur ) {
5317
+ match = true;
5318
+ break;
5319
+ }
5320
+
5321
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
5322
+ match = elem;
5323
+ break;
5324
+ }
5325
+ }
5326
+
5327
+ elem = elem[dir];
5328
+ }
5329
+
5330
+ checkSet[i] = match;
5331
+ }
5332
+ }
5333
+ }
5334
+
5335
+ if ( document.documentElement.contains ) {
5336
+ Sizzle.contains = function( a, b ) {
5337
+ return a !== b && (a.contains ? a.contains(b) : true);
5338
+ };
5339
+
5340
+ } else if ( document.documentElement.compareDocumentPosition ) {
5341
+ Sizzle.contains = function( a, b ) {
5342
+ return !!(a.compareDocumentPosition(b) & 16);
5343
+ };
5344
+
5345
+ } else {
5346
+ Sizzle.contains = function() {
5347
+ return false;
5348
+ };
5349
+ }
5350
+
5351
+ Sizzle.isXML = function( elem ) {
5352
+ // documentElement is verified for cases where it doesn't yet exist
5353
+ // (such as loading iframes in IE - #4833)
5354
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
5355
+
5356
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
5357
+ };
5358
+
5359
+ var posProcess = function( selector, context, seed ) {
5360
+ var match,
5361
+ tmpSet = [],
5362
+ later = "",
5363
+ root = context.nodeType ? [context] : context;
5364
+
5365
+ // Position selectors must be done after the filter
5366
+ // And so must :not(positional) so we move all PSEUDOs to the end
5367
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
5368
+ later += match[0];
5369
+ selector = selector.replace( Expr.match.PSEUDO, "" );
5370
+ }
5371
+
5372
+ selector = Expr.relative[selector] ? selector + "*" : selector;
5373
+
5374
+ for ( var i = 0, l = root.length; i < l; i++ ) {
5375
+ Sizzle( selector, root[i], tmpSet, seed );
5376
+ }
5377
+
5378
+ return Sizzle.filter( later, tmpSet );
5379
+ };
5380
+
5381
+ // EXPOSE
5382
+ // Override sizzle attribute retrieval
5383
+ Sizzle.attr = jQuery.attr;
5384
+ Sizzle.selectors.attrMap = {};
5385
+ jQuery.find = Sizzle;
5386
+ jQuery.expr = Sizzle.selectors;
5387
+ jQuery.expr[":"] = jQuery.expr.filters;
5388
+ jQuery.unique = Sizzle.uniqueSort;
5389
+ jQuery.text = Sizzle.getText;
5390
+ jQuery.isXMLDoc = Sizzle.isXML;
5391
+ jQuery.contains = Sizzle.contains;
5392
+
5393
+
5394
+ })();
5395
+
5396
+
5397
+ var runtil = /Until$/,
5398
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
5399
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
5400
+ rmultiselector = /,/,
5401
+ isSimple = /^.[^:#\[\.,]*$/,
5402
+ slice = Array.prototype.slice,
5403
+ POS = jQuery.expr.match.globalPOS,
5404
+ // methods guaranteed to produce a unique set when starting from a unique set
5405
+ guaranteedUnique = {
5406
+ children: true,
5407
+ contents: true,
5408
+ next: true,
5409
+ prev: true
5410
+ };
5411
+
5412
+ jQuery.fn.extend({
5413
+ find: function( selector ) {
5414
+ var self = this,
5415
+ i, l;
5416
+
5417
+ if ( typeof selector !== "string" ) {
5418
+ return jQuery( selector ).filter(function() {
5419
+ for ( i = 0, l = self.length; i < l; i++ ) {
5420
+ if ( jQuery.contains( self[ i ], this ) ) {
5421
+ return true;
5422
+ }
5423
+ }
5424
+ });
5425
+ }
5426
+
5427
+ var ret = this.pushStack( "", "find", selector ),
5428
+ length, n, r;
5429
+
5430
+ for ( i = 0, l = this.length; i < l; i++ ) {
5431
+ length = ret.length;
5432
+ jQuery.find( selector, this[i], ret );
5433
+
5434
+ if ( i > 0 ) {
5435
+ // Make sure that the results are unique
5436
+ for ( n = length; n < ret.length; n++ ) {
5437
+ for ( r = 0; r < length; r++ ) {
5438
+ if ( ret[r] === ret[n] ) {
5439
+ ret.splice(n--, 1);
5440
+ break;
5441
+ }
5442
+ }
5443
+ }
5444
+ }
5445
+ }
5446
+
5447
+ return ret;
5448
+ },
5449
+
5450
+ has: function( target ) {
5451
+ var targets = jQuery( target );
5452
+ return this.filter(function() {
5453
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
5454
+ if ( jQuery.contains( this, targets[i] ) ) {
5455
+ return true;
5456
+ }
5457
+ }
5458
+ });
5459
+ },
5460
+
5461
+ not: function( selector ) {
5462
+ return this.pushStack( winnow(this, selector, false), "not", selector);
5463
+ },
5464
+
5465
+ filter: function( selector ) {
5466
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
5467
+ },
5468
+
5469
+ is: function( selector ) {
5470
+ return !!selector && (
5471
+ typeof selector === "string" ?
5472
+ // If this is a positional selector, check membership in the returned set
5473
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
5474
+ POS.test( selector ) ?
5475
+ jQuery( selector, this.context ).index( this[0] ) >= 0 :
5476
+ jQuery.filter( selector, this ).length > 0 :
5477
+ this.filter( selector ).length > 0 );
5478
+ },
5479
+
5480
+ closest: function( selectors, context ) {
5481
+ var ret = [], i, l, cur = this[0];
5482
+
5483
+ // Array (deprecated as of jQuery 1.7)
5484
+ if ( jQuery.isArray( selectors ) ) {
5485
+ var level = 1;
5486
+
5487
+ while ( cur && cur.ownerDocument && cur !== context ) {
5488
+ for ( i = 0; i < selectors.length; i++ ) {
5489
+
5490
+ if ( jQuery( cur ).is( selectors[ i ] ) ) {
5491
+ ret.push({ selector: selectors[ i ], elem: cur, level: level });
5492
+ }
5493
+ }
5494
+
5495
+ cur = cur.parentNode;
5496
+ level++;
5497
+ }
5498
+
5499
+ return ret;
5500
+ }
5501
+
5502
+ // String
5503
+ var pos = POS.test( selectors ) || typeof selectors !== "string" ?
5504
+ jQuery( selectors, context || this.context ) :
5505
+ 0;
5506
+
5507
+ for ( i = 0, l = this.length; i < l; i++ ) {
5508
+ cur = this[i];
5509
+
5510
+ while ( cur ) {
5511
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
5512
+ ret.push( cur );
5513
+ break;
5514
+
5515
+ } else {
5516
+ cur = cur.parentNode;
5517
+ if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
5518
+ break;
5519
+ }
5520
+ }
5521
+ }
5522
+ }
5523
+
5524
+ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
5525
+
5526
+ return this.pushStack( ret, "closest", selectors );
5527
+ },
5528
+
5529
+ // Determine the position of an element within
5530
+ // the matched set of elements
5531
+ index: function( elem ) {
5532
+
5533
+ // No argument, return index in parent
5534
+ if ( !elem ) {
5535
+ return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
5536
+ }
5537
+
5538
+ // index in selector
5539
+ if ( typeof elem === "string" ) {
5540
+ return jQuery.inArray( this[0], jQuery( elem ) );
5541
+ }
5542
+
5543
+ // Locate the position of the desired element
5544
+ return jQuery.inArray(
5545
+ // If it receives a jQuery object, the first element is used
5546
+ elem.jquery ? elem[0] : elem, this );
5547
+ },
5548
+
5549
+ add: function( selector, context ) {
5550
+ var set = typeof selector === "string" ?
5551
+ jQuery( selector, context ) :
5552
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
5553
+ all = jQuery.merge( this.get(), set );
5554
+
5555
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
5556
+ all :
5557
+ jQuery.unique( all ) );
5558
+ },
5559
+
5560
+ andSelf: function() {
5561
+ return this.add( this.prevObject );
5562
+ }
5563
+ });
5564
+
5565
+ // A painfully simple check to see if an element is disconnected
5566
+ // from a document (should be improved, where feasible).
5567
+ function isDisconnected( node ) {
5568
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
5569
+ }
5570
+
5571
+ jQuery.each({
5572
+ parent: function( elem ) {
5573
+ var parent = elem.parentNode;
5574
+ return parent && parent.nodeType !== 11 ? parent : null;
5575
+ },
5576
+ parents: function( elem ) {
5577
+ return jQuery.dir( elem, "parentNode" );
5578
+ },
5579
+ parentsUntil: function( elem, i, until ) {
5580
+ return jQuery.dir( elem, "parentNode", until );
5581
+ },
5582
+ next: function( elem ) {
5583
+ return jQuery.nth( elem, 2, "nextSibling" );
5584
+ },
5585
+ prev: function( elem ) {
5586
+ return jQuery.nth( elem, 2, "previousSibling" );
5587
+ },
5588
+ nextAll: function( elem ) {
5589
+ return jQuery.dir( elem, "nextSibling" );
5590
+ },
5591
+ prevAll: function( elem ) {
5592
+ return jQuery.dir( elem, "previousSibling" );
5593
+ },
5594
+ nextUntil: function( elem, i, until ) {
5595
+ return jQuery.dir( elem, "nextSibling", until );
5596
+ },
5597
+ prevUntil: function( elem, i, until ) {
5598
+ return jQuery.dir( elem, "previousSibling", until );
5599
+ },
5600
+ siblings: function( elem ) {
5601
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
5602
+ },
5603
+ children: function( elem ) {
5604
+ return jQuery.sibling( elem.firstChild );
5605
+ },
5606
+ contents: function( elem ) {
5607
+ return jQuery.nodeName( elem, "iframe" ) ?
5608
+ elem.contentDocument || elem.contentWindow.document :
5609
+ jQuery.makeArray( elem.childNodes );
5610
+ }
5611
+ }, function( name, fn ) {
5612
+ jQuery.fn[ name ] = function( until, selector ) {
5613
+ var ret = jQuery.map( this, fn, until );
5614
+
5615
+ if ( !runtil.test( name ) ) {
5616
+ selector = until;
5617
+ }
5618
+
5619
+ if ( selector && typeof selector === "string" ) {
5620
+ ret = jQuery.filter( selector, ret );
5621
+ }
5622
+
5623
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
5624
+
5625
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
5626
+ ret = ret.reverse();
5627
+ }
5628
+
5629
+ return this.pushStack( ret, name, slice.call( arguments ).join(",") );
5630
+ };
5631
+ });
5632
+
5633
+ jQuery.extend({
5634
+ filter: function( expr, elems, not ) {
5635
+ if ( not ) {
5636
+ expr = ":not(" + expr + ")";
5637
+ }
5638
+
5639
+ return elems.length === 1 ?
5640
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
5641
+ jQuery.find.matches(expr, elems);
5642
+ },
5643
+
5644
+ dir: function( elem, dir, until ) {
5645
+ var matched = [],
5646
+ cur = elem[ dir ];
5647
+
5648
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
5649
+ if ( cur.nodeType === 1 ) {
5650
+ matched.push( cur );
5651
+ }
5652
+ cur = cur[dir];
5653
+ }
5654
+ return matched;
5655
+ },
5656
+
5657
+ nth: function( cur, result, dir, elem ) {
5658
+ result = result || 1;
5659
+ var num = 0;
5660
+
5661
+ for ( ; cur; cur = cur[dir] ) {
5662
+ if ( cur.nodeType === 1 && ++num === result ) {
5663
+ break;
5664
+ }
5665
+ }
5666
+
5667
+ return cur;
5668
+ },
5669
+
5670
+ sibling: function( n, elem ) {
5671
+ var r = [];
5672
+
5673
+ for ( ; n; n = n.nextSibling ) {
5674
+ if ( n.nodeType === 1 && n !== elem ) {
5675
+ r.push( n );
5676
+ }
5677
+ }
5678
+
5679
+ return r;
5680
+ }
5681
+ });
5682
+
5683
+ // Implement the identical functionality for filter and not
5684
+ function winnow( elements, qualifier, keep ) {
5685
+
5686
+ // Can't pass null or undefined to indexOf in Firefox 4
5687
+ // Set to 0 to skip string check
5688
+ qualifier = qualifier || 0;
5689
+
5690
+ if ( jQuery.isFunction( qualifier ) ) {
5691
+ return jQuery.grep(elements, function( elem, i ) {
5692
+ var retVal = !!qualifier.call( elem, i, elem );
5693
+ return retVal === keep;
5694
+ });
5695
+
5696
+ } else if ( qualifier.nodeType ) {
5697
+ return jQuery.grep(elements, function( elem, i ) {
5698
+ return ( elem === qualifier ) === keep;
5699
+ });
5700
+
5701
+ } else if ( typeof qualifier === "string" ) {
5702
+ var filtered = jQuery.grep(elements, function( elem ) {
5703
+ return elem.nodeType === 1;
5704
+ });
5705
+
5706
+ if ( isSimple.test( qualifier ) ) {
5707
+ return jQuery.filter(qualifier, filtered, !keep);
5708
+ } else {
5709
+ qualifier = jQuery.filter( qualifier, filtered );
5710
+ }
5711
+ }
5712
+
5713
+ return jQuery.grep(elements, function( elem, i ) {
5714
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
5715
+ });
5716
+ }
5717
+
5718
+
5719
+
5720
+
5721
+ function createSafeFragment( document ) {
5722
+ var list = nodeNames.split( "|" ),
5723
+ safeFrag = document.createDocumentFragment();
5724
+
5725
+ if ( safeFrag.createElement ) {
5726
+ while ( list.length ) {
5727
+ safeFrag.createElement(
5728
+ list.pop()
5729
+ );
5730
+ }
5731
+ }
5732
+ return safeFrag;
5733
+ }
5734
+
5735
+ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
5736
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
5737
+ rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
5738
+ rleadingWhitespace = /^\s+/,
5739
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
5740
+ rtagName = /<([\w:]+)/,
5741
+ rtbody = /<tbody/i,
5742
+ rhtml = /<|&#?\w+;/,
5743
+ rnoInnerhtml = /<(?:script|style)/i,
5744
+ rnocache = /<(?:script|object|embed|option|style)/i,
5745
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
5746
+ // checked="checked" or checked
5747
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5748
+ rscriptType = /\/(java|ecma)script/i,
5749
+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
5750
+ wrapMap = {
5751
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
5752
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
5753
+ thead: [ 1, "<table>", "</table>" ],
5754
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
5755
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
5756
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
5757
+ area: [ 1, "<map>", "</map>" ],
5758
+ _default: [ 0, "", "" ]
5759
+ },
5760
+ safeFragment = createSafeFragment( document );
5761
+
5762
+ wrapMap.optgroup = wrapMap.option;
5763
+ wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
5764
+ wrapMap.th = wrapMap.td;
5765
+
5766
+ // IE can't serialize <link> and <script> tags normally
5767
+ if ( !jQuery.support.htmlSerialize ) {
5768
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
5769
+ }
5770
+
5771
+ jQuery.fn.extend({
5772
+ text: function( value ) {
5773
+ return jQuery.access( this, function( value ) {
5774
+ return value === undefined ?
5775
+ jQuery.text( this ) :
5776
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
5777
+ }, null, value, arguments.length );
5778
+ },
5779
+
5780
+ wrapAll: function( html ) {
5781
+ if ( jQuery.isFunction( html ) ) {
5782
+ return this.each(function(i) {
5783
+ jQuery(this).wrapAll( html.call(this, i) );
5784
+ });
5785
+ }
5786
+
5787
+ if ( this[0] ) {
5788
+ // The elements to wrap the target around
5789
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
5790
+
5791
+ if ( this[0].parentNode ) {
5792
+ wrap.insertBefore( this[0] );
5793
+ }
5794
+
5795
+ wrap.map(function() {
5796
+ var elem = this;
5797
+
5798
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
5799
+ elem = elem.firstChild;
5800
+ }
5801
+
5802
+ return elem;
5803
+ }).append( this );
5804
+ }
5805
+
5806
+ return this;
5807
+ },
5808
+
5809
+ wrapInner: function( html ) {
5810
+ if ( jQuery.isFunction( html ) ) {
5811
+ return this.each(function(i) {
5812
+ jQuery(this).wrapInner( html.call(this, i) );
5813
+ });
5814
+ }
5815
+
5816
+ return this.each(function() {
5817
+ var self = jQuery( this ),
5818
+ contents = self.contents();
5819
+
5820
+ if ( contents.length ) {
5821
+ contents.wrapAll( html );
5822
+
5823
+ } else {
5824
+ self.append( html );
5825
+ }
5826
+ });
5827
+ },
5828
+
5829
+ wrap: function( html ) {
5830
+ var isFunction = jQuery.isFunction( html );
5831
+
5832
+ return this.each(function(i) {
5833
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
5834
+ });
5835
+ },
5836
+
5837
+ unwrap: function() {
5838
+ return this.parent().each(function() {
5839
+ if ( !jQuery.nodeName( this, "body" ) ) {
5840
+ jQuery( this ).replaceWith( this.childNodes );
5841
+ }
5842
+ }).end();
5843
+ },
5844
+
5845
+ append: function() {
5846
+ return this.domManip(arguments, true, function( elem ) {
5847
+ if ( this.nodeType === 1 ) {
5848
+ this.appendChild( elem );
5849
+ }
5850
+ });
5851
+ },
5852
+
5853
+ prepend: function() {
5854
+ return this.domManip(arguments, true, function( elem ) {
5855
+ if ( this.nodeType === 1 ) {
5856
+ this.insertBefore( elem, this.firstChild );
5857
+ }
5858
+ });
5859
+ },
5860
+
5861
+ before: function() {
5862
+ if ( this[0] && this[0].parentNode ) {
5863
+ return this.domManip(arguments, false, function( elem ) {
5864
+ this.parentNode.insertBefore( elem, this );
5865
+ });
5866
+ } else if ( arguments.length ) {
5867
+ var set = jQuery.clean( arguments );
5868
+ set.push.apply( set, this.toArray() );
5869
+ return this.pushStack( set, "before", arguments );
5870
+ }
5871
+ },
5872
+
5873
+ after: function() {
5874
+ if ( this[0] && this[0].parentNode ) {
5875
+ return this.domManip(arguments, false, function( elem ) {
5876
+ this.parentNode.insertBefore( elem, this.nextSibling );
5877
+ });
5878
+ } else if ( arguments.length ) {
5879
+ var set = this.pushStack( this, "after", arguments );
5880
+ set.push.apply( set, jQuery.clean(arguments) );
5881
+ return set;
5882
+ }
5883
+ },
5884
+
5885
+ // keepData is for internal use only--do not document
5886
+ remove: function( selector, keepData ) {
5887
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
5888
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
5889
+ if ( !keepData && elem.nodeType === 1 ) {
5890
+ jQuery.cleanData( elem.getElementsByTagName("*") );
5891
+ jQuery.cleanData( [ elem ] );
5892
+ }
5893
+
5894
+ if ( elem.parentNode ) {
5895
+ elem.parentNode.removeChild( elem );
5896
+ }
5897
+ }
5898
+ }
5899
+
5900
+ return this;
5901
+ },
5902
+
5903
+ empty: function() {
5904
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
5905
+ // Remove element nodes and prevent memory leaks
5906
+ if ( elem.nodeType === 1 ) {
5907
+ jQuery.cleanData( elem.getElementsByTagName("*") );
5908
+ }
5909
+
5910
+ // Remove any remaining nodes
5911
+ while ( elem.firstChild ) {
5912
+ elem.removeChild( elem.firstChild );
5913
+ }
5914
+ }
5915
+
5916
+ return this;
5917
+ },
5918
+
5919
+ clone: function( dataAndEvents, deepDataAndEvents ) {
5920
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5921
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5922
+
5923
+ return this.map( function () {
5924
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5925
+ });
5926
+ },
5927
+
5928
+ html: function( value ) {
5929
+ return jQuery.access( this, function( value ) {
5930
+ var elem = this[0] || {},
5931
+ i = 0,
5932
+ l = this.length;
5933
+
5934
+ if ( value === undefined ) {
5935
+ return elem.nodeType === 1 ?
5936
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
5937
+ null;
5938
+ }
5939
+
5940
+
5941
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5942
+ ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
5943
+ !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
5944
+
5945
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
5946
+
5947
+ try {
5948
+ for (; i < l; i++ ) {
5949
+ // Remove element nodes and prevent memory leaks
5950
+ elem = this[i] || {};
5951
+ if ( elem.nodeType === 1 ) {
5952
+ jQuery.cleanData( elem.getElementsByTagName( "*" ) );
5953
+ elem.innerHTML = value;
5954
+ }
5955
+ }
5956
+
5957
+ elem = 0;
5958
+
5959
+ // If using innerHTML throws an exception, use the fallback method
5960
+ } catch(e) {}
5961
+ }
5962
+
5963
+ if ( elem ) {
5964
+ this.empty().append( value );
5965
+ }
5966
+ }, null, value, arguments.length );
5967
+ },
5968
+
5969
+ replaceWith: function( value ) {
5970
+ if ( this[0] && this[0].parentNode ) {
5971
+ // Make sure that the elements are removed from the DOM before they are inserted
5972
+ // this can help fix replacing a parent with child elements
5973
+ if ( jQuery.isFunction( value ) ) {
5974
+ return this.each(function(i) {
5975
+ var self = jQuery(this), old = self.html();
5976
+ self.replaceWith( value.call( this, i, old ) );
5977
+ });
5978
+ }
5979
+
5980
+ if ( typeof value !== "string" ) {
5981
+ value = jQuery( value ).detach();
5982
+ }
5983
+
5984
+ return this.each(function() {
5985
+ var next = this.nextSibling,
5986
+ parent = this.parentNode;
5987
+
5988
+ jQuery( this ).remove();
5989
+
5990
+ if ( next ) {
5991
+ jQuery(next).before( value );
5992
+ } else {
5993
+ jQuery(parent).append( value );
5994
+ }
5995
+ });
5996
+ } else {
5997
+ return this.length ?
5998
+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
5999
+ this;
6000
+ }
6001
+ },
6002
+
6003
+ detach: function( selector ) {
6004
+ return this.remove( selector, true );
6005
+ },
6006
+
6007
+ domManip: function( args, table, callback ) {
6008
+ var results, first, fragment, parent,
6009
+ value = args[0],
6010
+ scripts = [];
6011
+
6012
+ // We can't cloneNode fragments that contain checked, in WebKit
6013
+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
6014
+ return this.each(function() {
6015
+ jQuery(this).domManip( args, table, callback, true );
6016
+ });
6017
+ }
6018
+
6019
+ if ( jQuery.isFunction(value) ) {
6020
+ return this.each(function(i) {
6021
+ var self = jQuery(this);
6022
+ args[0] = value.call(this, i, table ? self.html() : undefined);
6023
+ self.domManip( args, table, callback );
6024
+ });
6025
+ }
6026
+
6027
+ if ( this[0] ) {
6028
+ parent = value && value.parentNode;
6029
+
6030
+ // If we're in a fragment, just use that instead of building a new one
6031
+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
6032
+ results = { fragment: parent };
6033
+
6034
+ } else {
6035
+ results = jQuery.buildFragment( args, this, scripts );
6036
+ }
6037
+
6038
+ fragment = results.fragment;
6039
+
6040
+ if ( fragment.childNodes.length === 1 ) {
6041
+ first = fragment = fragment.firstChild;
6042
+ } else {
6043
+ first = fragment.firstChild;
6044
+ }
6045
+
6046
+ if ( first ) {
6047
+ table = table && jQuery.nodeName( first, "tr" );
6048
+
6049
+ for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
6050
+ callback.call(
6051
+ table ?
6052
+ root(this[i], first) :
6053
+ this[i],
6054
+ // Make sure that we do not leak memory by inadvertently discarding
6055
+ // the original fragment (which might have attached data) instead of
6056
+ // using it; in addition, use the original fragment object for the last
6057
+ // item instead of first because it can end up being emptied incorrectly
6058
+ // in certain situations (Bug #8070).
6059
+ // Fragments from the fragment cache must always be cloned and never used
6060
+ // in place.
6061
+ results.cacheable || ( l > 1 && i < lastIndex ) ?
6062
+ jQuery.clone( fragment, true, true ) :
6063
+ fragment
6064
+ );
6065
+ }
6066
+ }
6067
+
6068
+ if ( scripts.length ) {
6069
+ jQuery.each( scripts, function( i, elem ) {
6070
+ if ( elem.src ) {
6071
+ jQuery.ajax({
6072
+ type: "GET",
6073
+ global: false,
6074
+ url: elem.src,
6075
+ async: false,
6076
+ dataType: "script"
6077
+ });
6078
+ } else {
6079
+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
6080
+ }
6081
+
6082
+ if ( elem.parentNode ) {
6083
+ elem.parentNode.removeChild( elem );
6084
+ }
6085
+ });
6086
+ }
6087
+ }
6088
+
6089
+ return this;
6090
+ }
6091
+ });
6092
+
6093
+ function root( elem, cur ) {
6094
+ return jQuery.nodeName(elem, "table") ?
6095
+ (elem.getElementsByTagName("tbody")[0] ||
6096
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
6097
+ elem;
6098
+ }
6099
+
6100
+ function cloneCopyEvent( src, dest ) {
6101
+
6102
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
6103
+ return;
6104
+ }
6105
+
6106
+ var type, i, l,
6107
+ oldData = jQuery._data( src ),
6108
+ curData = jQuery._data( dest, oldData ),
6109
+ events = oldData.events;
6110
+
6111
+ if ( events ) {
6112
+ delete curData.handle;
6113
+ curData.events = {};
6114
+
6115
+ for ( type in events ) {
6116
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
6117
+ jQuery.event.add( dest, type, events[ type ][ i ] );
6118
+ }
6119
+ }
6120
+ }
6121
+
6122
+ // make the cloned public data object a copy from the original
6123
+ if ( curData.data ) {
6124
+ curData.data = jQuery.extend( {}, curData.data );
6125
+ }
6126
+ }
6127
+
6128
+ function cloneFixAttributes( src, dest ) {
6129
+ var nodeName;
6130
+
6131
+ // We do not need to do anything for non-Elements
6132
+ if ( dest.nodeType !== 1 ) {
6133
+ return;
6134
+ }
6135
+
6136
+ // clearAttributes removes the attributes, which we don't want,
6137
+ // but also removes the attachEvent events, which we *do* want
6138
+ if ( dest.clearAttributes ) {
6139
+ dest.clearAttributes();
6140
+ }
6141
+
6142
+ // mergeAttributes, in contrast, only merges back on the
6143
+ // original attributes, not the events
6144
+ if ( dest.mergeAttributes ) {
6145
+ dest.mergeAttributes( src );
6146
+ }
6147
+
6148
+ nodeName = dest.nodeName.toLowerCase();
6149
+
6150
+ // IE6-8 fail to clone children inside object elements that use
6151
+ // the proprietary classid attribute value (rather than the type
6152
+ // attribute) to identify the type of content to display
6153
+ if ( nodeName === "object" ) {
6154
+ dest.outerHTML = src.outerHTML;
6155
+
6156
+ } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
6157
+ // IE6-8 fails to persist the checked state of a cloned checkbox
6158
+ // or radio button. Worse, IE6-7 fail to give the cloned element
6159
+ // a checked appearance if the defaultChecked value isn't also set
6160
+ if ( src.checked ) {
6161
+ dest.defaultChecked = dest.checked = src.checked;
6162
+ }
6163
+
6164
+ // IE6-7 get confused and end up setting the value of a cloned
6165
+ // checkbox/radio button to an empty string instead of "on"
6166
+ if ( dest.value !== src.value ) {
6167
+ dest.value = src.value;
6168
+ }
6169
+
6170
+ // IE6-8 fails to return the selected option to the default selected
6171
+ // state when cloning options
6172
+ } else if ( nodeName === "option" ) {
6173
+ dest.selected = src.defaultSelected;
6174
+
6175
+ // IE6-8 fails to set the defaultValue to the correct value when
6176
+ // cloning other types of input fields
6177
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
6178
+ dest.defaultValue = src.defaultValue;
6179
+
6180
+ // IE blanks contents when cloning scripts
6181
+ } else if ( nodeName === "script" && dest.text !== src.text ) {
6182
+ dest.text = src.text;
6183
+ }
6184
+
6185
+ // Event data gets referenced instead of copied if the expando
6186
+ // gets copied too
6187
+ dest.removeAttribute( jQuery.expando );
6188
+
6189
+ // Clear flags for bubbling special change/submit events, they must
6190
+ // be reattached when the newly cloned events are first activated
6191
+ dest.removeAttribute( "_submit_attached" );
6192
+ dest.removeAttribute( "_change_attached" );
6193
+ }
6194
+
6195
+ jQuery.buildFragment = function( args, nodes, scripts ) {
6196
+ var fragment, cacheable, cacheresults, doc,
6197
+ first = args[ 0 ];
6198
+
6199
+ // nodes may contain either an explicit document object,
6200
+ // a jQuery collection or context object.
6201
+ // If nodes[0] contains a valid object to assign to doc
6202
+ if ( nodes && nodes[0] ) {
6203
+ doc = nodes[0].ownerDocument || nodes[0];
6204
+ }
6205
+
6206
+ // Ensure that an attr object doesn't incorrectly stand in as a document object
6207
+ // Chrome and Firefox seem to allow this to occur and will throw exception
6208
+ // Fixes #8950
6209
+ if ( !doc.createDocumentFragment ) {
6210
+ doc = document;
6211
+ }
6212
+
6213
+ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
6214
+ // Cloning options loses the selected state, so don't cache them
6215
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
6216
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
6217
+ // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
6218
+ if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
6219
+ first.charAt(0) === "<" && !rnocache.test( first ) &&
6220
+ (jQuery.support.checkClone || !rchecked.test( first )) &&
6221
+ (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
6222
+
6223
+ cacheable = true;
6224
+
6225
+ cacheresults = jQuery.fragments[ first ];
6226
+ if ( cacheresults && cacheresults !== 1 ) {
6227
+ fragment = cacheresults;
6228
+ }
6229
+ }
6230
+
6231
+ if ( !fragment ) {
6232
+ fragment = doc.createDocumentFragment();
6233
+ jQuery.clean( args, doc, fragment, scripts );
6234
+ }
6235
+
6236
+ if ( cacheable ) {
6237
+ jQuery.fragments[ first ] = cacheresults ? fragment : 1;
6238
+ }
6239
+
6240
+ return { fragment: fragment, cacheable: cacheable };
6241
+ };
6242
+
6243
+ jQuery.fragments = {};
6244
+
6245
+ jQuery.each({
6246
+ appendTo: "append",
6247
+ prependTo: "prepend",
6248
+ insertBefore: "before",
6249
+ insertAfter: "after",
6250
+ replaceAll: "replaceWith"
6251
+ }, function( name, original ) {
6252
+ jQuery.fn[ name ] = function( selector ) {
6253
+ var ret = [],
6254
+ insert = jQuery( selector ),
6255
+ parent = this.length === 1 && this[0].parentNode;
6256
+
6257
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
6258
+ insert[ original ]( this[0] );
6259
+ return this;
6260
+
6261
+ } else {
6262
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
6263
+ var elems = ( i > 0 ? this.clone(true) : this ).get();
6264
+ jQuery( insert[i] )[ original ]( elems );
6265
+ ret = ret.concat( elems );
6266
+ }
6267
+
6268
+ return this.pushStack( ret, name, insert.selector );
6269
+ }
6270
+ };
6271
+ });
6272
+
6273
+ function getAll( elem ) {
6274
+ if ( typeof elem.getElementsByTagName !== "undefined" ) {
6275
+ return elem.getElementsByTagName( "*" );
6276
+
6277
+ } else if ( typeof elem.querySelectorAll !== "undefined" ) {
6278
+ return elem.querySelectorAll( "*" );
6279
+
6280
+ } else {
6281
+ return [];
6282
+ }
6283
+ }
6284
+
6285
+ // Used in clean, fixes the defaultChecked property
6286
+ function fixDefaultChecked( elem ) {
6287
+ if ( elem.type === "checkbox" || elem.type === "radio" ) {
6288
+ elem.defaultChecked = elem.checked;
6289
+ }
6290
+ }
6291
+ // Finds all inputs and passes them to fixDefaultChecked
6292
+ function findInputs( elem ) {
6293
+ var nodeName = ( elem.nodeName || "" ).toLowerCase();
6294
+ if ( nodeName === "input" ) {
6295
+ fixDefaultChecked( elem );
6296
+ // Skip scripts, get other children
6297
+ } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
6298
+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
6299
+ }
6300
+ }
6301
+
6302
+ // Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
6303
+ function shimCloneNode( elem ) {
6304
+ var div = document.createElement( "div" );
6305
+ safeFragment.appendChild( div );
6306
+
6307
+ div.innerHTML = elem.outerHTML;
6308
+ return div.firstChild;
6309
+ }
6310
+
6311
+ jQuery.extend({
6312
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
6313
+ var srcElements,
6314
+ destElements,
6315
+ i,
6316
+ // IE<=8 does not properly clone detached, unknown element nodes
6317
+ clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
6318
+ elem.cloneNode( true ) :
6319
+ shimCloneNode( elem );
6320
+
6321
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
6322
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
6323
+ // IE copies events bound via attachEvent when using cloneNode.
6324
+ // Calling detachEvent on the clone will also remove the events
6325
+ // from the original. In order to get around this, we use some
6326
+ // proprietary methods to clear the events. Thanks to MooTools
6327
+ // guys for this hotness.
6328
+
6329
+ cloneFixAttributes( elem, clone );
6330
+
6331
+ // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
6332
+ srcElements = getAll( elem );
6333
+ destElements = getAll( clone );
6334
+
6335
+ // Weird iteration because IE will replace the length property
6336
+ // with an element if you are cloning the body and one of the
6337
+ // elements on the page has a name or id of "length"
6338
+ for ( i = 0; srcElements[i]; ++i ) {
6339
+ // Ensure that the destination node is not null; Fixes #9587
6340
+ if ( destElements[i] ) {
6341
+ cloneFixAttributes( srcElements[i], destElements[i] );
6342
+ }
6343
+ }
6344
+ }
6345
+
6346
+ // Copy the events from the original to the clone
6347
+ if ( dataAndEvents ) {
6348
+ cloneCopyEvent( elem, clone );
6349
+
6350
+ if ( deepDataAndEvents ) {
6351
+ srcElements = getAll( elem );
6352
+ destElements = getAll( clone );
6353
+
6354
+ for ( i = 0; srcElements[i]; ++i ) {
6355
+ cloneCopyEvent( srcElements[i], destElements[i] );
6356
+ }
6357
+ }
6358
+ }
6359
+
6360
+ srcElements = destElements = null;
6361
+
6362
+ // Return the cloned set
6363
+ return clone;
6364
+ },
6365
+
6366
+ clean: function( elems, context, fragment, scripts ) {
6367
+ var checkScriptType, script, j,
6368
+ ret = [];
6369
+
6370
+ context = context || document;
6371
+
6372
+ // !context.createElement fails in IE with an error but returns typeof 'object'
6373
+ if ( typeof context.createElement === "undefined" ) {
6374
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
6375
+ }
6376
+
6377
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
6378
+ if ( typeof elem === "number" ) {
6379
+ elem += "";
6380
+ }
6381
+
6382
+ if ( !elem ) {
6383
+ continue;
6384
+ }
6385
+
6386
+ // Convert html string into DOM nodes
6387
+ if ( typeof elem === "string" ) {
6388
+ if ( !rhtml.test( elem ) ) {
6389
+ elem = context.createTextNode( elem );
6390
+ } else {
6391
+ // Fix "XHTML"-style tags in all browsers
6392
+ elem = elem.replace(rxhtmlTag, "<$1></$2>");
6393
+
6394
+ // Trim whitespace, otherwise indexOf won't work as expected
6395
+ var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
6396
+ wrap = wrapMap[ tag ] || wrapMap._default,
6397
+ depth = wrap[0],
6398
+ div = context.createElement("div"),
6399
+ safeChildNodes = safeFragment.childNodes,
6400
+ remove;
6401
+
6402
+ // Append wrapper element to unknown element safe doc fragment
6403
+ if ( context === document ) {
6404
+ // Use the fragment we've already created for this document
6405
+ safeFragment.appendChild( div );
6406
+ } else {
6407
+ // Use a fragment created with the owner document
6408
+ createSafeFragment( context ).appendChild( div );
6409
+ }
6410
+
6411
+ // Go to html and back, then peel off extra wrappers
6412
+ div.innerHTML = wrap[1] + elem + wrap[2];
6413
+
6414
+ // Move to the right depth
6415
+ while ( depth-- ) {
6416
+ div = div.lastChild;
6417
+ }
6418
+
6419
+ // Remove IE's autoinserted <tbody> from table fragments
6420
+ if ( !jQuery.support.tbody ) {
6421
+
6422
+ // String was a <table>, *may* have spurious <tbody>
6423
+ var hasBody = rtbody.test(elem),
6424
+ tbody = tag === "table" && !hasBody ?
6425
+ div.firstChild && div.firstChild.childNodes :
6426
+
6427
+ // String was a bare <thead> or <tfoot>
6428
+ wrap[1] === "<table>" && !hasBody ?
6429
+ div.childNodes :
6430
+ [];
6431
+
6432
+ for ( j = tbody.length - 1; j >= 0 ; --j ) {
6433
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
6434
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
6435
+ }
6436
+ }
6437
+ }
6438
+
6439
+ // IE completely kills leading whitespace when innerHTML is used
6440
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
6441
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
6442
+ }
6443
+
6444
+ elem = div.childNodes;
6445
+
6446
+ // Clear elements from DocumentFragment (safeFragment or otherwise)
6447
+ // to avoid hoarding elements. Fixes #11356
6448
+ if ( div ) {
6449
+ div.parentNode.removeChild( div );
6450
+
6451
+ // Guard against -1 index exceptions in FF3.6
6452
+ if ( safeChildNodes.length > 0 ) {
6453
+ remove = safeChildNodes[ safeChildNodes.length - 1 ];
6454
+
6455
+ if ( remove && remove.parentNode ) {
6456
+ remove.parentNode.removeChild( remove );
6457
+ }
6458
+ }
6459
+ }
6460
+ }
6461
+ }
6462
+
6463
+ // Resets defaultChecked for any radios and checkboxes
6464
+ // about to be appended to the DOM in IE 6/7 (#8060)
6465
+ var len;
6466
+ if ( !jQuery.support.appendChecked ) {
6467
+ if ( elem[0] && typeof (len = elem.length) === "number" ) {
6468
+ for ( j = 0; j < len; j++ ) {
6469
+ findInputs( elem[j] );
6470
+ }
6471
+ } else {
6472
+ findInputs( elem );
6473
+ }
6474
+ }
6475
+
6476
+ if ( elem.nodeType ) {
6477
+ ret.push( elem );
6478
+ } else {
6479
+ ret = jQuery.merge( ret, elem );
6480
+ }
6481
+ }
6482
+
6483
+ if ( fragment ) {
6484
+ checkScriptType = function( elem ) {
6485
+ return !elem.type || rscriptType.test( elem.type );
6486
+ };
6487
+ for ( i = 0; ret[i]; i++ ) {
6488
+ script = ret[i];
6489
+ if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) {
6490
+ scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script );
6491
+
6492
+ } else {
6493
+ if ( script.nodeType === 1 ) {
6494
+ var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType );
6495
+
6496
+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
6497
+ }
6498
+ fragment.appendChild( script );
6499
+ }
6500
+ }
6501
+ }
6502
+
6503
+ return ret;
6504
+ },
6505
+
6506
+ cleanData: function( elems ) {
6507
+ var data, id,
6508
+ cache = jQuery.cache,
6509
+ special = jQuery.event.special,
6510
+ deleteExpando = jQuery.support.deleteExpando;
6511
+
6512
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
6513
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
6514
+ continue;
6515
+ }
6516
+
6517
+ id = elem[ jQuery.expando ];
6518
+
6519
+ if ( id ) {
6520
+ data = cache[ id ];
6521
+
6522
+ if ( data && data.events ) {
6523
+ for ( var type in data.events ) {
6524
+ if ( special[ type ] ) {
6525
+ jQuery.event.remove( elem, type );
6526
+
6527
+ // This is a shortcut to avoid jQuery.event.remove's overhead
6528
+ } else {
6529
+ jQuery.removeEvent( elem, type, data.handle );
6530
+ }
6531
+ }
6532
+
6533
+ // Null the DOM reference to avoid IE6/7/8 leak (#7054)
6534
+ if ( data.handle ) {
6535
+ data.handle.elem = null;
6536
+ }
6537
+ }
6538
+
6539
+ if ( deleteExpando ) {
6540
+ delete elem[ jQuery.expando ];
6541
+
6542
+ } else if ( elem.removeAttribute ) {
6543
+ elem.removeAttribute( jQuery.expando );
6544
+ }
6545
+
6546
+ delete cache[ id ];
6547
+ }
6548
+ }
6549
+ }
6550
+ });
6551
+
6552
+
6553
+
6554
+
6555
+ var ralpha = /alpha\([^)]*\)/i,
6556
+ ropacity = /opacity=([^)]*)/,
6557
+ // fixed for IE9, see #8346
6558
+ rupper = /([A-Z]|^ms)/g,
6559
+ rnum = /^[\-+]?(?:\d*\.)?\d+$/i,
6560
+ rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
6561
+ rrelNum = /^([\-+])=([\-+.\de]+)/,
6562
+ rmargin = /^margin/,
6563
+
6564
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6565
+
6566
+ // order is important!
6567
+ cssExpand = [ "Top", "Right", "Bottom", "Left" ],
6568
+
6569
+ curCSS,
6570
+
6571
+ getComputedStyle,
6572
+ currentStyle;
6573
+
6574
+ jQuery.fn.css = function( name, value ) {
6575
+ return jQuery.access( this, function( elem, name, value ) {
6576
+ return value !== undefined ?
6577
+ jQuery.style( elem, name, value ) :
6578
+ jQuery.css( elem, name );
6579
+ }, name, value, arguments.length > 1 );
6580
+ };
6581
+
6582
+ jQuery.extend({
6583
+ // Add in style property hooks for overriding the default
6584
+ // behavior of getting and setting a style property
6585
+ cssHooks: {
6586
+ opacity: {
6587
+ get: function( elem, computed ) {
6588
+ if ( computed ) {
6589
+ // We should always get a number back from opacity
6590
+ var ret = curCSS( elem, "opacity" );
6591
+ return ret === "" ? "1" : ret;
6592
+
6593
+ } else {
6594
+ return elem.style.opacity;
6595
+ }
6596
+ }
6597
+ }
6598
+ },
6599
+
6600
+ // Exclude the following css properties to add px
6601
+ cssNumber: {
6602
+ "fillOpacity": true,
6603
+ "fontWeight": true,
6604
+ "lineHeight": true,
6605
+ "opacity": true,
6606
+ "orphans": true,
6607
+ "widows": true,
6608
+ "zIndex": true,
6609
+ "zoom": true
6610
+ },
6611
+
6612
+ // Add in properties whose names you wish to fix before
6613
+ // setting or getting the value
6614
+ cssProps: {
6615
+ // normalize float css property
6616
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
6617
+ },
6618
+
6619
+ // Get and set the style property on a DOM Node
6620
+ style: function( elem, name, value, extra ) {
6621
+ // Don't set styles on text and comment nodes
6622
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6623
+ return;
6624
+ }
6625
+
6626
+ // Make sure that we're working with the right name
6627
+ var ret, type, origName = jQuery.camelCase( name ),
6628
+ style = elem.style, hooks = jQuery.cssHooks[ origName ];
6629
+
6630
+ name = jQuery.cssProps[ origName ] || origName;
6631
+
6632
+ // Check if we're setting a value
6633
+ if ( value !== undefined ) {
6634
+ type = typeof value;
6635
+
6636
+ // convert relative number strings (+= or -=) to relative numbers. #7345
6637
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
6638
+ value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
6639
+ // Fixes bug #9237
6640
+ type = "number";
6641
+ }
6642
+
6643
+ // Make sure that NaN and null values aren't set. See: #7116
6644
+ if ( value == null || type === "number" && isNaN( value ) ) {
6645
+ return;
6646
+ }
6647
+
6648
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
6649
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
6650
+ value += "px";
6651
+ }
6652
+
6653
+ // If a hook was provided, use that value, otherwise just set the specified value
6654
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
6655
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
6656
+ // Fixes bug #5509
6657
+ try {
6658
+ style[ name ] = value;
6659
+ } catch(e) {}
6660
+ }
6661
+
6662
+ } else {
6663
+ // If a hook was provided get the non-computed value from there
6664
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
6665
+ return ret;
6666
+ }
6667
+
6668
+ // Otherwise just get the value from the style object
6669
+ return style[ name ];
6670
+ }
6671
+ },
6672
+
6673
+ css: function( elem, name, extra ) {
6674
+ var ret, hooks;
6675
+
6676
+ // Make sure that we're working with the right name
6677
+ name = jQuery.camelCase( name );
6678
+ hooks = jQuery.cssHooks[ name ];
6679
+ name = jQuery.cssProps[ name ] || name;
6680
+
6681
+ // cssFloat needs a special treatment
6682
+ if ( name === "cssFloat" ) {
6683
+ name = "float";
6684
+ }
6685
+
6686
+ // If a hook was provided get the computed value from there
6687
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
6688
+ return ret;
6689
+
6690
+ // Otherwise, if a way to get the computed value exists, use that
6691
+ } else if ( curCSS ) {
6692
+ return curCSS( elem, name );
6693
+ }
6694
+ },
6695
+
6696
+ // A method for quickly swapping in/out CSS properties to get correct calculations
6697
+ swap: function( elem, options, callback ) {
6698
+ var old = {},
6699
+ ret, name;
6700
+
6701
+ // Remember the old values, and insert the new ones
6702
+ for ( name in options ) {
6703
+ old[ name ] = elem.style[ name ];
6704
+ elem.style[ name ] = options[ name ];
6705
+ }
6706
+
6707
+ ret = callback.call( elem );
6708
+
6709
+ // Revert the old values
6710
+ for ( name in options ) {
6711
+ elem.style[ name ] = old[ name ];
6712
+ }
6713
+
6714
+ return ret;
6715
+ }
6716
+ });
6717
+
6718
+ // DEPRECATED in 1.3, Use jQuery.css() instead
6719
+ jQuery.curCSS = jQuery.css;
6720
+
6721
+ if ( document.defaultView && document.defaultView.getComputedStyle ) {
6722
+ getComputedStyle = function( elem, name ) {
6723
+ var ret, defaultView, computedStyle, width,
6724
+ style = elem.style;
6725
+
6726
+ name = name.replace( rupper, "-$1" ).toLowerCase();
6727
+
6728
+ if ( (defaultView = elem.ownerDocument.defaultView) &&
6729
+ (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
6730
+
6731
+ ret = computedStyle.getPropertyValue( name );
6732
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
6733
+ ret = jQuery.style( elem, name );
6734
+ }
6735
+ }
6736
+
6737
+ // A tribute to the "awesome hack by Dean Edwards"
6738
+ // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
6739
+ // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
6740
+ if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) {
6741
+ width = style.width;
6742
+ style.width = ret;
6743
+ ret = computedStyle.width;
6744
+ style.width = width;
6745
+ }
6746
+
6747
+ return ret;
6748
+ };
6749
+ }
6750
+
6751
+ if ( document.documentElement.currentStyle ) {
6752
+ currentStyle = function( elem, name ) {
6753
+ var left, rsLeft, uncomputed,
6754
+ ret = elem.currentStyle && elem.currentStyle[ name ],
6755
+ style = elem.style;
6756
+
6757
+ // Avoid setting ret to empty string here
6758
+ // so we don't default to auto
6759
+ if ( ret == null && style && (uncomputed = style[ name ]) ) {
6760
+ ret = uncomputed;
6761
+ }
6762
+
6763
+ // From the awesome hack by Dean Edwards
6764
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
6765
+
6766
+ // If we're not dealing with a regular pixel number
6767
+ // but a number that has a weird ending, we need to convert it to pixels
6768
+ if ( rnumnonpx.test( ret ) ) {
6769
+
6770
+ // Remember the original values
6771
+ left = style.left;
6772
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
6773
+
6774
+ // Put in the new values to get a computed value out
6775
+ if ( rsLeft ) {
6776
+ elem.runtimeStyle.left = elem.currentStyle.left;
6777
+ }
6778
+ style.left = name === "fontSize" ? "1em" : ret;
6779
+ ret = style.pixelLeft + "px";
6780
+
6781
+ // Revert the changed values
6782
+ style.left = left;
6783
+ if ( rsLeft ) {
6784
+ elem.runtimeStyle.left = rsLeft;
6785
+ }
6786
+ }
6787
+
6788
+ return ret === "" ? "auto" : ret;
6789
+ };
6790
+ }
6791
+
6792
+ curCSS = getComputedStyle || currentStyle;
6793
+
6794
+ function getWidthOrHeight( elem, name, extra ) {
6795
+
6796
+ // Start with offset property
6797
+ var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
6798
+ i = name === "width" ? 1 : 0,
6799
+ len = 4;
6800
+
6801
+ if ( val > 0 ) {
6802
+ if ( extra !== "border" ) {
6803
+ for ( ; i < len; i += 2 ) {
6804
+ if ( !extra ) {
6805
+ val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
6806
+ }
6807
+ if ( extra === "margin" ) {
6808
+ val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0;
6809
+ } else {
6810
+ val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
6811
+ }
6812
+ }
6813
+ }
6814
+
6815
+ return val + "px";
6816
+ }
6817
+
6818
+ // Fall back to computed then uncomputed css if necessary
6819
+ val = curCSS( elem, name );
6820
+ if ( val < 0 || val == null ) {
6821
+ val = elem.style[ name ];
6822
+ }
6823
+
6824
+ // Computed unit is not pixels. Stop here and return.
6825
+ if ( rnumnonpx.test(val) ) {
6826
+ return val;
6827
+ }
6828
+
6829
+ // Normalize "", auto, and prepare for extra
6830
+ val = parseFloat( val ) || 0;
6831
+
6832
+ // Add padding, border, margin
6833
+ if ( extra ) {
6834
+ for ( ; i < len; i += 2 ) {
6835
+ val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
6836
+ if ( extra !== "padding" ) {
6837
+ val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
6838
+ }
6839
+ if ( extra === "margin" ) {
6840
+ val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0;
6841
+ }
6842
+ }
6843
+ }
6844
+
6845
+ return val + "px";
6846
+ }
6847
+
6848
+ jQuery.each([ "height", "width" ], function( i, name ) {
6849
+ jQuery.cssHooks[ name ] = {
6850
+ get: function( elem, computed, extra ) {
6851
+ if ( computed ) {
6852
+ if ( elem.offsetWidth !== 0 ) {
6853
+ return getWidthOrHeight( elem, name, extra );
6854
+ } else {
6855
+ return jQuery.swap( elem, cssShow, function() {
6856
+ return getWidthOrHeight( elem, name, extra );
6857
+ });
6858
+ }
6859
+ }
6860
+ },
6861
+
6862
+ set: function( elem, value ) {
6863
+ return rnum.test( value ) ?
6864
+ value + "px" :
6865
+ value;
6866
+ }
6867
+ };
6868
+ });
6869
+
6870
+ if ( !jQuery.support.opacity ) {
6871
+ jQuery.cssHooks.opacity = {
6872
+ get: function( elem, computed ) {
6873
+ // IE uses filters for opacity
6874
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
6875
+ ( parseFloat( RegExp.$1 ) / 100 ) + "" :
6876
+ computed ? "1" : "";
6877
+ },
6878
+
6879
+ set: function( elem, value ) {
6880
+ var style = elem.style,
6881
+ currentStyle = elem.currentStyle,
6882
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
6883
+ filter = currentStyle && currentStyle.filter || style.filter || "";
6884
+
6885
+ // IE has trouble with opacity if it does not have layout
6886
+ // Force it by setting the zoom level
6887
+ style.zoom = 1;
6888
+
6889
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
6890
+ if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
6891
+
6892
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
6893
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
6894
+ // style.removeAttribute is IE Only, but so apparently is this code path...
6895
+ style.removeAttribute( "filter" );
6896
+
6897
+ // if there there is no filter style applied in a css rule, we are done
6898
+ if ( currentStyle && !currentStyle.filter ) {
6899
+ return;
6900
+ }
6901
+ }
6902
+
6903
+ // otherwise, set new filter values
6904
+ style.filter = ralpha.test( filter ) ?
6905
+ filter.replace( ralpha, opacity ) :
6906
+ filter + " " + opacity;
6907
+ }
6908
+ };
6909
+ }
6910
+
6911
+ jQuery(function() {
6912
+ // This hook cannot be added until DOM ready because the support test
6913
+ // for it is not run until after DOM ready
6914
+ if ( !jQuery.support.reliableMarginRight ) {
6915
+ jQuery.cssHooks.marginRight = {
6916
+ get: function( elem, computed ) {
6917
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6918
+ // Work around by temporarily setting element display to inline-block
6919
+ return jQuery.swap( elem, { "display": "inline-block" }, function() {
6920
+ if ( computed ) {
6921
+ return curCSS( elem, "margin-right" );
6922
+ } else {
6923
+ return elem.style.marginRight;
6924
+ }
6925
+ });
6926
+ }
6927
+ };
6928
+ }
6929
+ });
6930
+
6931
+ if ( jQuery.expr && jQuery.expr.filters ) {
6932
+ jQuery.expr.filters.hidden = function( elem ) {
6933
+ var width = elem.offsetWidth,
6934
+ height = elem.offsetHeight;
6935
+
6936
+ return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
6937
+ };
6938
+
6939
+ jQuery.expr.filters.visible = function( elem ) {
6940
+ return !jQuery.expr.filters.hidden( elem );
6941
+ };
6942
+ }
6943
+
6944
+ // These hooks are used by animate to expand properties
6945
+ jQuery.each({
6946
+ margin: "",
6947
+ padding: "",
6948
+ border: "Width"
6949
+ }, function( prefix, suffix ) {
6950
+
6951
+ jQuery.cssHooks[ prefix + suffix ] = {
6952
+ expand: function( value ) {
6953
+ var i,
6954
+
6955
+ // assumes a single number if not a string
6956
+ parts = typeof value === "string" ? value.split(" ") : [ value ],
6957
+ expanded = {};
6958
+
6959
+ for ( i = 0; i < 4; i++ ) {
6960
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
6961
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6962
+ }
6963
+
6964
+ return expanded;
6965
+ }
6966
+ };
6967
+ });
6968
+
6969
+
6970
+
6971
+
6972
+ var r20 = /%20/g,
6973
+ rbracket = /\[\]$/,
6974
+ rCRLF = /\r?\n/g,
6975
+ rhash = /#.*$/,
6976
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
6977
+ rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
6978
+ // #7653, #8125, #8152: local protocol detection
6979
+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
6980
+ rnoContent = /^(?:GET|HEAD)$/,
6981
+ rprotocol = /^\/\//,
6982
+ rquery = /\?/,
6983
+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
6984
+ rselectTextarea = /^(?:select|textarea)/i,
6985
+ rspacesAjax = /\s+/,
6986
+ rts = /([?&])_=[^&]*/,
6987
+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
6988
+
6989
+ // Keep a copy of the old load method
6990
+ _load = jQuery.fn.load,
6991
+
6992
+ /* Prefilters
6993
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
6994
+ * 2) These are called:
6995
+ * - BEFORE asking for a transport
6996
+ * - AFTER param serialization (s.data is a string if s.processData is true)
6997
+ * 3) key is the dataType
6998
+ * 4) the catchall symbol "*" can be used
6999
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
7000
+ */
7001
+ prefilters = {},
7002
+
7003
+ /* Transports bindings
7004
+ * 1) key is the dataType
7005
+ * 2) the catchall symbol "*" can be used
7006
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
7007
+ */
7008
+ transports = {},
7009
+
7010
+ // Document location
7011
+ ajaxLocation,
7012
+
7013
+ // Document location segments
7014
+ ajaxLocParts,
7015
+
7016
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
7017
+ allTypes = ["*/"] + ["*"];
7018
+
7019
+ // #8138, IE may throw an exception when accessing
7020
+ // a field from window.location if document.domain has been set
7021
+ try {
7022
+ ajaxLocation = location.href;
7023
+ } catch( e ) {
7024
+ // Use the href attribute of an A element
7025
+ // since IE will modify it given document.location
7026
+ ajaxLocation = document.createElement( "a" );
7027
+ ajaxLocation.href = "";
7028
+ ajaxLocation = ajaxLocation.href;
7029
+ }
7030
+
7031
+ // Segment location into parts
7032
+ ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
7033
+
7034
+ // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
7035
+ function addToPrefiltersOrTransports( structure ) {
7036
+
7037
+ // dataTypeExpression is optional and defaults to "*"
7038
+ return function( dataTypeExpression, func ) {
7039
+
7040
+ if ( typeof dataTypeExpression !== "string" ) {
7041
+ func = dataTypeExpression;
7042
+ dataTypeExpression = "*";
7043
+ }
7044
+
7045
+ if ( jQuery.isFunction( func ) ) {
7046
+ var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
7047
+ i = 0,
7048
+ length = dataTypes.length,
7049
+ dataType,
7050
+ list,
7051
+ placeBefore;
7052
+
7053
+ // For each dataType in the dataTypeExpression
7054
+ for ( ; i < length; i++ ) {
7055
+ dataType = dataTypes[ i ];
7056
+ // We control if we're asked to add before
7057
+ // any existing element
7058
+ placeBefore = /^\+/.test( dataType );
7059
+ if ( placeBefore ) {
7060
+ dataType = dataType.substr( 1 ) || "*";
7061
+ }
7062
+ list = structure[ dataType ] = structure[ dataType ] || [];
7063
+ // then we add to the structure accordingly
7064
+ list[ placeBefore ? "unshift" : "push" ]( func );
7065
+ }
7066
+ }
7067
+ };
7068
+ }
7069
+
7070
+ // Base inspection function for prefilters and transports
7071
+ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
7072
+ dataType /* internal */, inspected /* internal */ ) {
7073
+
7074
+ dataType = dataType || options.dataTypes[ 0 ];
7075
+ inspected = inspected || {};
7076
+
7077
+ inspected[ dataType ] = true;
7078
+
7079
+ var list = structure[ dataType ],
7080
+ i = 0,
7081
+ length = list ? list.length : 0,
7082
+ executeOnly = ( structure === prefilters ),
7083
+ selection;
7084
+
7085
+ for ( ; i < length && ( executeOnly || !selection ); i++ ) {
7086
+ selection = list[ i ]( options, originalOptions, jqXHR );
7087
+ // If we got redirected to another dataType
7088
+ // we try there if executing only and not done already
7089
+ if ( typeof selection === "string" ) {
7090
+ if ( !executeOnly || inspected[ selection ] ) {
7091
+ selection = undefined;
7092
+ } else {
7093
+ options.dataTypes.unshift( selection );
7094
+ selection = inspectPrefiltersOrTransports(
7095
+ structure, options, originalOptions, jqXHR, selection, inspected );
7096
+ }
7097
+ }
7098
+ }
7099
+ // If we're only executing or nothing was selected
7100
+ // we try the catchall dataType if not done already
7101
+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
7102
+ selection = inspectPrefiltersOrTransports(
7103
+ structure, options, originalOptions, jqXHR, "*", inspected );
7104
+ }
7105
+ // unnecessary when only executing (prefilters)
7106
+ // but it'll be ignored by the caller in that case
7107
+ return selection;
7108
+ }
7109
+
7110
+ // A special extend for ajax options
7111
+ // that takes "flat" options (not to be deep extended)
7112
+ // Fixes #9887
7113
+ function ajaxExtend( target, src ) {
7114
+ var key, deep,
7115
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
7116
+ for ( key in src ) {
7117
+ if ( src[ key ] !== undefined ) {
7118
+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
7119
+ }
7120
+ }
7121
+ if ( deep ) {
7122
+ jQuery.extend( true, target, deep );
7123
+ }
7124
+ }
7125
+
7126
+ jQuery.fn.extend({
7127
+ load: function( url, params, callback ) {
7128
+ if ( typeof url !== "string" && _load ) {
7129
+ return _load.apply( this, arguments );
7130
+
7131
+ // Don't do a request if no elements are being requested
7132
+ } else if ( !this.length ) {
7133
+ return this;
7134
+ }
7135
+
7136
+ var off = url.indexOf( " " );
7137
+ if ( off >= 0 ) {
7138
+ var selector = url.slice( off, url.length );
7139
+ url = url.slice( 0, off );
7140
+ }
7141
+
7142
+ // Default to a GET request
7143
+ var type = "GET";
7144
+
7145
+ // If the second parameter was provided
7146
+ if ( params ) {
7147
+ // If it's a function
7148
+ if ( jQuery.isFunction( params ) ) {
7149
+ // We assume that it's the callback
7150
+ callback = params;
7151
+ params = undefined;
7152
+
7153
+ // Otherwise, build a param string
7154
+ } else if ( typeof params === "object" ) {
7155
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
7156
+ type = "POST";
7157
+ }
7158
+ }
7159
+
7160
+ var self = this;
7161
+
7162
+ // Request the remote document
7163
+ jQuery.ajax({
7164
+ url: url,
7165
+ type: type,
7166
+ dataType: "html",
7167
+ data: params,
7168
+ // Complete callback (responseText is used internally)
7169
+ complete: function( jqXHR, status, responseText ) {
7170
+ // Store the response as specified by the jqXHR object
7171
+ responseText = jqXHR.responseText;
7172
+ // If successful, inject the HTML into all the matched elements
7173
+ if ( jqXHR.isResolved() ) {
7174
+ // #4825: Get the actual response in case
7175
+ // a dataFilter is present in ajaxSettings
7176
+ jqXHR.done(function( r ) {
7177
+ responseText = r;
7178
+ });
7179
+ // See if a selector was specified
7180
+ self.html( selector ?
7181
+ // Create a dummy div to hold the results
7182
+ jQuery("<div>")
7183
+ // inject the contents of the document in, removing the scripts
7184
+ // to avoid any 'Permission Denied' errors in IE
7185
+ .append(responseText.replace(rscript, ""))
7186
+
7187
+ // Locate the specified elements
7188
+ .find(selector) :
7189
+
7190
+ // If not, just inject the full result
7191
+ responseText );
7192
+ }
7193
+
7194
+ if ( callback ) {
7195
+ self.each( callback, [ responseText, status, jqXHR ] );
7196
+ }
7197
+ }
7198
+ });
7199
+
7200
+ return this;
7201
+ },
7202
+
7203
+ serialize: function() {
7204
+ return jQuery.param( this.serializeArray() );
7205
+ },
7206
+
7207
+ serializeArray: function() {
7208
+ return this.map(function(){
7209
+ return this.elements ? jQuery.makeArray( this.elements ) : this;
7210
+ })
7211
+ .filter(function(){
7212
+ return this.name && !this.disabled &&
7213
+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
7214
+ rinput.test( this.type ) );
7215
+ })
7216
+ .map(function( i, elem ){
7217
+ var val = jQuery( this ).val();
7218
+
7219
+ return val == null ?
7220
+ null :
7221
+ jQuery.isArray( val ) ?
7222
+ jQuery.map( val, function( val, i ){
7223
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7224
+ }) :
7225
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7226
+ }).get();
7227
+ }
7228
+ });
7229
+
7230
+ // Attach a bunch of functions for handling common AJAX events
7231
+ jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
7232
+ jQuery.fn[ o ] = function( f ){
7233
+ return this.on( o, f );
7234
+ };
7235
+ });
7236
+
7237
+ jQuery.each( [ "get", "post" ], function( i, method ) {
7238
+ jQuery[ method ] = function( url, data, callback, type ) {
7239
+ // shift arguments if data argument was omitted
7240
+ if ( jQuery.isFunction( data ) ) {
7241
+ type = type || callback;
7242
+ callback = data;
7243
+ data = undefined;
7244
+ }
7245
+
7246
+ return jQuery.ajax({
7247
+ type: method,
7248
+ url: url,
7249
+ data: data,
7250
+ success: callback,
7251
+ dataType: type
7252
+ });
7253
+ };
7254
+ });
7255
+
7256
+ jQuery.extend({
7257
+
7258
+ getScript: function( url, callback ) {
7259
+ return jQuery.get( url, undefined, callback, "script" );
7260
+ },
7261
+
7262
+ getJSON: function( url, data, callback ) {
7263
+ return jQuery.get( url, data, callback, "json" );
7264
+ },
7265
+
7266
+ // Creates a full fledged settings object into target
7267
+ // with both ajaxSettings and settings fields.
7268
+ // If target is omitted, writes into ajaxSettings.
7269
+ ajaxSetup: function( target, settings ) {
7270
+ if ( settings ) {
7271
+ // Building a settings object
7272
+ ajaxExtend( target, jQuery.ajaxSettings );
7273
+ } else {
7274
+ // Extending ajaxSettings
7275
+ settings = target;
7276
+ target = jQuery.ajaxSettings;
7277
+ }
7278
+ ajaxExtend( target, settings );
7279
+ return target;
7280
+ },
7281
+
7282
+ ajaxSettings: {
7283
+ url: ajaxLocation,
7284
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
7285
+ global: true,
7286
+ type: "GET",
7287
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
7288
+ processData: true,
7289
+ async: true,
7290
+ /*
7291
+ timeout: 0,
7292
+ data: null,
7293
+ dataType: null,
7294
+ username: null,
7295
+ password: null,
7296
+ cache: null,
7297
+ traditional: false,
7298
+ headers: {},
7299
+ */
7300
+
7301
+ accepts: {
7302
+ xml: "application/xml, text/xml",
7303
+ html: "text/html",
7304
+ text: "text/plain",
7305
+ json: "application/json, text/javascript",
7306
+ "*": allTypes
7307
+ },
7308
+
7309
+ contents: {
7310
+ xml: /xml/,
7311
+ html: /html/,
7312
+ json: /json/
7313
+ },
7314
+
7315
+ responseFields: {
7316
+ xml: "responseXML",
7317
+ text: "responseText"
7318
+ },
7319
+
7320
+ // List of data converters
7321
+ // 1) key format is "source_type destination_type" (a single space in-between)
7322
+ // 2) the catchall symbol "*" can be used for source_type
7323
+ converters: {
7324
+
7325
+ // Convert anything to text
7326
+ "* text": window.String,
7327
+
7328
+ // Text to html (true = no transformation)
7329
+ "text html": true,
7330
+
7331
+ // Evaluate text as a json expression
7332
+ "text json": jQuery.parseJSON,
7333
+
7334
+ // Parse text as xml
7335
+ "text xml": jQuery.parseXML
7336
+ },
7337
+
7338
+ // For options that shouldn't be deep extended:
7339
+ // you can add your own custom options here if
7340
+ // and when you create one that shouldn't be
7341
+ // deep extended (see ajaxExtend)
7342
+ flatOptions: {
7343
+ context: true,
7344
+ url: true
7345
+ }
7346
+ },
7347
+
7348
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
7349
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
7350
+
7351
+ // Main method
7352
+ ajax: function( url, options ) {
7353
+
7354
+ // If url is an object, simulate pre-1.5 signature
7355
+ if ( typeof url === "object" ) {
7356
+ options = url;
7357
+ url = undefined;
7358
+ }
7359
+
7360
+ // Force options to be an object
7361
+ options = options || {};
7362
+
7363
+ var // Create the final options object
7364
+ s = jQuery.ajaxSetup( {}, options ),
7365
+ // Callbacks context
7366
+ callbackContext = s.context || s,
7367
+ // Context for global events
7368
+ // It's the callbackContext if one was provided in the options
7369
+ // and if it's a DOM node or a jQuery collection
7370
+ globalEventContext = callbackContext !== s &&
7371
+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
7372
+ jQuery( callbackContext ) : jQuery.event,
7373
+ // Deferreds
7374
+ deferred = jQuery.Deferred(),
7375
+ completeDeferred = jQuery.Callbacks( "once memory" ),
7376
+ // Status-dependent callbacks
7377
+ statusCode = s.statusCode || {},
7378
+ // ifModified key
7379
+ ifModifiedKey,
7380
+ // Headers (they are sent all at once)
7381
+ requestHeaders = {},
7382
+ requestHeadersNames = {},
7383
+ // Response headers
7384
+ responseHeadersString,
7385
+ responseHeaders,
7386
+ // transport
7387
+ transport,
7388
+ // timeout handle
7389
+ timeoutTimer,
7390
+ // Cross-domain detection vars
7391
+ parts,
7392
+ // The jqXHR state
7393
+ state = 0,
7394
+ // To know if global events are to be dispatched
7395
+ fireGlobals,
7396
+ // Loop variable
7397
+ i,
7398
+ // Fake xhr
7399
+ jqXHR = {
7400
+
7401
+ readyState: 0,
7402
+
7403
+ // Caches the header
7404
+ setRequestHeader: function( name, value ) {
7405
+ if ( !state ) {
7406
+ var lname = name.toLowerCase();
7407
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
7408
+ requestHeaders[ name ] = value;
7409
+ }
7410
+ return this;
7411
+ },
7412
+
7413
+ // Raw string
7414
+ getAllResponseHeaders: function() {
7415
+ return state === 2 ? responseHeadersString : null;
7416
+ },
7417
+
7418
+ // Builds headers hashtable if needed
7419
+ getResponseHeader: function( key ) {
7420
+ var match;
7421
+ if ( state === 2 ) {
7422
+ if ( !responseHeaders ) {
7423
+ responseHeaders = {};
7424
+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
7425
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
7426
+ }
7427
+ }
7428
+ match = responseHeaders[ key.toLowerCase() ];
7429
+ }
7430
+ return match === undefined ? null : match;
7431
+ },
7432
+
7433
+ // Overrides response content-type header
7434
+ overrideMimeType: function( type ) {
7435
+ if ( !state ) {
7436
+ s.mimeType = type;
7437
+ }
7438
+ return this;
7439
+ },
7440
+
7441
+ // Cancel the request
7442
+ abort: function( statusText ) {
7443
+ statusText = statusText || "abort";
7444
+ if ( transport ) {
7445
+ transport.abort( statusText );
7446
+ }
7447
+ done( 0, statusText );
7448
+ return this;
7449
+ }
7450
+ };
7451
+
7452
+ // Callback for when everything is done
7453
+ // It is defined here because jslint complains if it is declared
7454
+ // at the end of the function (which would be more logical and readable)
7455
+ function done( status, nativeStatusText, responses, headers ) {
7456
+
7457
+ // Called once
7458
+ if ( state === 2 ) {
7459
+ return;
7460
+ }
7461
+
7462
+ // State is "done" now
7463
+ state = 2;
7464
+
7465
+ // Clear timeout if it exists
7466
+ if ( timeoutTimer ) {
7467
+ clearTimeout( timeoutTimer );
7468
+ }
7469
+
7470
+ // Dereference transport for early garbage collection
7471
+ // (no matter how long the jqXHR object will be used)
7472
+ transport = undefined;
7473
+
7474
+ // Cache response headers
7475
+ responseHeadersString = headers || "";
7476
+
7477
+ // Set readyState
7478
+ jqXHR.readyState = status > 0 ? 4 : 0;
7479
+
7480
+ var isSuccess,
7481
+ success,
7482
+ error,
7483
+ statusText = nativeStatusText,
7484
+ response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
7485
+ lastModified,
7486
+ etag;
7487
+
7488
+ // If successful, handle type chaining
7489
+ if ( status >= 200 && status < 300 || status === 304 ) {
7490
+
7491
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
7492
+ if ( s.ifModified ) {
7493
+
7494
+ if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
7495
+ jQuery.lastModified[ ifModifiedKey ] = lastModified;
7496
+ }
7497
+ if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
7498
+ jQuery.etag[ ifModifiedKey ] = etag;
7499
+ }
7500
+ }
7501
+
7502
+ // If not modified
7503
+ if ( status === 304 ) {
7504
+
7505
+ statusText = "notmodified";
7506
+ isSuccess = true;
7507
+
7508
+ // If we have data
7509
+ } else {
7510
+
7511
+ try {
7512
+ success = ajaxConvert( s, response );
7513
+ statusText = "success";
7514
+ isSuccess = true;
7515
+ } catch(e) {
7516
+ // We have a parsererror
7517
+ statusText = "parsererror";
7518
+ error = e;
7519
+ }
7520
+ }
7521
+ } else {
7522
+ // We extract error from statusText
7523
+ // then normalize statusText and status for non-aborts
7524
+ error = statusText;
7525
+ if ( !statusText || status ) {
7526
+ statusText = "error";
7527
+ if ( status < 0 ) {
7528
+ status = 0;
7529
+ }
7530
+ }
7531
+ }
7532
+
7533
+ // Set data for the fake xhr object
7534
+ jqXHR.status = status;
7535
+ jqXHR.statusText = "" + ( nativeStatusText || statusText );
7536
+
7537
+ // Success/Error
7538
+ if ( isSuccess ) {
7539
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
7540
+ } else {
7541
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
7542
+ }
7543
+
7544
+ // Status-dependent callbacks
7545
+ jqXHR.statusCode( statusCode );
7546
+ statusCode = undefined;
7547
+
7548
+ if ( fireGlobals ) {
7549
+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
7550
+ [ jqXHR, s, isSuccess ? success : error ] );
7551
+ }
7552
+
7553
+ // Complete
7554
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
7555
+
7556
+ if ( fireGlobals ) {
7557
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
7558
+ // Handle the global AJAX counter
7559
+ if ( !( --jQuery.active ) ) {
7560
+ jQuery.event.trigger( "ajaxStop" );
7561
+ }
7562
+ }
7563
+ }
7564
+
7565
+ // Attach deferreds
7566
+ deferred.promise( jqXHR );
7567
+ jqXHR.success = jqXHR.done;
7568
+ jqXHR.error = jqXHR.fail;
7569
+ jqXHR.complete = completeDeferred.add;
7570
+
7571
+ // Status-dependent callbacks
7572
+ jqXHR.statusCode = function( map ) {
7573
+ if ( map ) {
7574
+ var tmp;
7575
+ if ( state < 2 ) {
7576
+ for ( tmp in map ) {
7577
+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
7578
+ }
7579
+ } else {
7580
+ tmp = map[ jqXHR.status ];
7581
+ jqXHR.then( tmp, tmp );
7582
+ }
7583
+ }
7584
+ return this;
7585
+ };
7586
+
7587
+ // Remove hash character (#7531: and string promotion)
7588
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
7589
+ // We also use the url parameter if available
7590
+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
7591
+
7592
+ // Extract dataTypes list
7593
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
7594
+
7595
+ // Determine if a cross-domain request is in order
7596
+ if ( s.crossDomain == null ) {
7597
+ parts = rurl.exec( s.url.toLowerCase() );
7598
+ s.crossDomain = !!( parts &&
7599
+ ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
7600
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
7601
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
7602
+ );
7603
+ }
7604
+
7605
+ // Convert data if not already a string
7606
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
7607
+ s.data = jQuery.param( s.data, s.traditional );
7608
+ }
7609
+
7610
+ // Apply prefilters
7611
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
7612
+
7613
+ // If request was aborted inside a prefilter, stop there
7614
+ if ( state === 2 ) {
7615
+ return false;
7616
+ }
7617
+
7618
+ // We can fire global events as of now if asked to
7619
+ fireGlobals = s.global;
7620
+
7621
+ // Uppercase the type
7622
+ s.type = s.type.toUpperCase();
7623
+
7624
+ // Determine if request has content
7625
+ s.hasContent = !rnoContent.test( s.type );
7626
+
7627
+ // Watch for a new set of requests
7628
+ if ( fireGlobals && jQuery.active++ === 0 ) {
7629
+ jQuery.event.trigger( "ajaxStart" );
7630
+ }
7631
+
7632
+ // More options handling for requests with no content
7633
+ if ( !s.hasContent ) {
7634
+
7635
+ // If data is available, append data to url
7636
+ if ( s.data ) {
7637
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
7638
+ // #9682: remove data so that it's not used in an eventual retry
7639
+ delete s.data;
7640
+ }
7641
+
7642
+ // Get ifModifiedKey before adding the anti-cache parameter
7643
+ ifModifiedKey = s.url;
7644
+
7645
+ // Add anti-cache in url if needed
7646
+ if ( s.cache === false ) {
7647
+
7648
+ var ts = jQuery.now(),
7649
+ // try replacing _= if it is there
7650
+ ret = s.url.replace( rts, "$1_=" + ts );
7651
+
7652
+ // if nothing was replaced, add timestamp to the end
7653
+ s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
7654
+ }
7655
+ }
7656
+
7657
+ // Set the correct header, if data is being sent
7658
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
7659
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
7660
+ }
7661
+
7662
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
7663
+ if ( s.ifModified ) {
7664
+ ifModifiedKey = ifModifiedKey || s.url;
7665
+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
7666
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
7667
+ }
7668
+ if ( jQuery.etag[ ifModifiedKey ] ) {
7669
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
7670
+ }
7671
+ }
7672
+
7673
+ // Set the Accepts header for the server, depending on the dataType
7674
+ jqXHR.setRequestHeader(
7675
+ "Accept",
7676
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
7677
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
7678
+ s.accepts[ "*" ]
7679
+ );
7680
+
7681
+ // Check for headers option
7682
+ for ( i in s.headers ) {
7683
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
7684
+ }
7685
+
7686
+ // Allow custom headers/mimetypes and early abort
7687
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
7688
+ // Abort if not done already
7689
+ jqXHR.abort();
7690
+ return false;
7691
+
7692
+ }
7693
+
7694
+ // Install callbacks on deferreds
7695
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
7696
+ jqXHR[ i ]( s[ i ] );
7697
+ }
7698
+
7699
+ // Get transport
7700
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
7701
+
7702
+ // If no transport, we auto-abort
7703
+ if ( !transport ) {
7704
+ done( -1, "No Transport" );
7705
+ } else {
7706
+ jqXHR.readyState = 1;
7707
+ // Send global event
7708
+ if ( fireGlobals ) {
7709
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
7710
+ }
7711
+ // Timeout
7712
+ if ( s.async && s.timeout > 0 ) {
7713
+ timeoutTimer = setTimeout( function(){
7714
+ jqXHR.abort( "timeout" );
7715
+ }, s.timeout );
7716
+ }
7717
+
7718
+ try {
7719
+ state = 1;
7720
+ transport.send( requestHeaders, done );
7721
+ } catch (e) {
7722
+ // Propagate exception as error if not done
7723
+ if ( state < 2 ) {
7724
+ done( -1, e );
7725
+ // Simply rethrow otherwise
7726
+ } else {
7727
+ throw e;
7728
+ }
7729
+ }
7730
+ }
7731
+
7732
+ return jqXHR;
7733
+ },
7734
+
7735
+ // Serialize an array of form elements or a set of
7736
+ // key/values into a query string
7737
+ param: function( a, traditional ) {
7738
+ var s = [],
7739
+ add = function( key, value ) {
7740
+ // If value is a function, invoke it and return its value
7741
+ value = jQuery.isFunction( value ) ? value() : value;
7742
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
7743
+ };
7744
+
7745
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
7746
+ if ( traditional === undefined ) {
7747
+ traditional = jQuery.ajaxSettings.traditional;
7748
+ }
7749
+
7750
+ // If an array was passed in, assume that it is an array of form elements.
7751
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
7752
+ // Serialize the form elements
7753
+ jQuery.each( a, function() {
7754
+ add( this.name, this.value );
7755
+ });
7756
+
7757
+ } else {
7758
+ // If traditional, encode the "old" way (the way 1.3.2 or older
7759
+ // did it), otherwise encode params recursively.
7760
+ for ( var prefix in a ) {
7761
+ buildParams( prefix, a[ prefix ], traditional, add );
7762
+ }
7763
+ }
7764
+
7765
+ // Return the resulting serialization
7766
+ return s.join( "&" ).replace( r20, "+" );
7767
+ }
7768
+ });
7769
+
7770
+ function buildParams( prefix, obj, traditional, add ) {
7771
+ if ( jQuery.isArray( obj ) ) {
7772
+ // Serialize array item.
7773
+ jQuery.each( obj, function( i, v ) {
7774
+ if ( traditional || rbracket.test( prefix ) ) {
7775
+ // Treat each array item as a scalar.
7776
+ add( prefix, v );
7777
+
7778
+ } else {
7779
+ // If array item is non-scalar (array or object), encode its
7780
+ // numeric index to resolve deserialization ambiguity issues.
7781
+ // Note that rack (as of 1.0.0) can't currently deserialize
7782
+ // nested arrays properly, and attempting to do so may cause
7783
+ // a server error. Possible fixes are to modify rack's
7784
+ // deserialization algorithm or to provide an option or flag
7785
+ // to force array serialization to be shallow.
7786
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
7787
+ }
7788
+ });
7789
+
7790
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
7791
+ // Serialize object item.
7792
+ for ( var name in obj ) {
7793
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
7794
+ }
7795
+
7796
+ } else {
7797
+ // Serialize scalar item.
7798
+ add( prefix, obj );
7799
+ }
7800
+ }
7801
+
7802
+ // This is still on the jQuery object... for now
7803
+ // Want to move this to jQuery.ajax some day
7804
+ jQuery.extend({
7805
+
7806
+ // Counter for holding the number of active queries
7807
+ active: 0,
7808
+
7809
+ // Last-Modified header cache for next request
7810
+ lastModified: {},
7811
+ etag: {}
7812
+
7813
+ });
7814
+
7815
+ /* Handles responses to an ajax request:
7816
+ * - sets all responseXXX fields accordingly
7817
+ * - finds the right dataType (mediates between content-type and expected dataType)
7818
+ * - returns the corresponding response
7819
+ */
7820
+ function ajaxHandleResponses( s, jqXHR, responses ) {
7821
+
7822
+ var contents = s.contents,
7823
+ dataTypes = s.dataTypes,
7824
+ responseFields = s.responseFields,
7825
+ ct,
7826
+ type,
7827
+ finalDataType,
7828
+ firstDataType;
7829
+
7830
+ // Fill responseXXX fields
7831
+ for ( type in responseFields ) {
7832
+ if ( type in responses ) {
7833
+ jqXHR[ responseFields[type] ] = responses[ type ];
7834
+ }
7835
+ }
7836
+
7837
+ // Remove auto dataType and get content-type in the process
7838
+ while( dataTypes[ 0 ] === "*" ) {
7839
+ dataTypes.shift();
7840
+ if ( ct === undefined ) {
7841
+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
7842
+ }
7843
+ }
7844
+
7845
+ // Check if we're dealing with a known content-type
7846
+ if ( ct ) {
7847
+ for ( type in contents ) {
7848
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
7849
+ dataTypes.unshift( type );
7850
+ break;
7851
+ }
7852
+ }
7853
+ }
7854
+
7855
+ // Check to see if we have a response for the expected dataType
7856
+ if ( dataTypes[ 0 ] in responses ) {
7857
+ finalDataType = dataTypes[ 0 ];
7858
+ } else {
7859
+ // Try convertible dataTypes
7860
+ for ( type in responses ) {
7861
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
7862
+ finalDataType = type;
7863
+ break;
7864
+ }
7865
+ if ( !firstDataType ) {
7866
+ firstDataType = type;
7867
+ }
7868
+ }
7869
+ // Or just use first one
7870
+ finalDataType = finalDataType || firstDataType;
7871
+ }
7872
+
7873
+ // If we found a dataType
7874
+ // We add the dataType to the list if needed
7875
+ // and return the corresponding response
7876
+ if ( finalDataType ) {
7877
+ if ( finalDataType !== dataTypes[ 0 ] ) {
7878
+ dataTypes.unshift( finalDataType );
7879
+ }
7880
+ return responses[ finalDataType ];
7881
+ }
7882
+ }
7883
+
7884
+ // Chain conversions given the request and the original response
7885
+ function ajaxConvert( s, response ) {
7886
+
7887
+ // Apply the dataFilter if provided
7888
+ if ( s.dataFilter ) {
7889
+ response = s.dataFilter( response, s.dataType );
7890
+ }
7891
+
7892
+ var dataTypes = s.dataTypes,
7893
+ converters = {},
7894
+ i,
7895
+ key,
7896
+ length = dataTypes.length,
7897
+ tmp,
7898
+ // Current and previous dataTypes
7899
+ current = dataTypes[ 0 ],
7900
+ prev,
7901
+ // Conversion expression
7902
+ conversion,
7903
+ // Conversion function
7904
+ conv,
7905
+ // Conversion functions (transitive conversion)
7906
+ conv1,
7907
+ conv2;
7908
+
7909
+ // For each dataType in the chain
7910
+ for ( i = 1; i < length; i++ ) {
7911
+
7912
+ // Create converters map
7913
+ // with lowercased keys
7914
+ if ( i === 1 ) {
7915
+ for ( key in s.converters ) {
7916
+ if ( typeof key === "string" ) {
7917
+ converters[ key.toLowerCase() ] = s.converters[ key ];
7918
+ }
7919
+ }
7920
+ }
7921
+
7922
+ // Get the dataTypes
7923
+ prev = current;
7924
+ current = dataTypes[ i ];
7925
+
7926
+ // If current is auto dataType, update it to prev
7927
+ if ( current === "*" ) {
7928
+ current = prev;
7929
+ // If no auto and dataTypes are actually different
7930
+ } else if ( prev !== "*" && prev !== current ) {
7931
+
7932
+ // Get the converter
7933
+ conversion = prev + " " + current;
7934
+ conv = converters[ conversion ] || converters[ "* " + current ];
7935
+
7936
+ // If there is no direct converter, search transitively
7937
+ if ( !conv ) {
7938
+ conv2 = undefined;
7939
+ for ( conv1 in converters ) {
7940
+ tmp = conv1.split( " " );
7941
+ if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
7942
+ conv2 = converters[ tmp[1] + " " + current ];
7943
+ if ( conv2 ) {
7944
+ conv1 = converters[ conv1 ];
7945
+ if ( conv1 === true ) {
7946
+ conv = conv2;
7947
+ } else if ( conv2 === true ) {
7948
+ conv = conv1;
7949
+ }
7950
+ break;
7951
+ }
7952
+ }
7953
+ }
7954
+ }
7955
+ // If we found no converter, dispatch an error
7956
+ if ( !( conv || conv2 ) ) {
7957
+ jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
7958
+ }
7959
+ // If found converter is not an equivalence
7960
+ if ( conv !== true ) {
7961
+ // Convert with 1 or 2 converters accordingly
7962
+ response = conv ? conv( response ) : conv2( conv1(response) );
7963
+ }
7964
+ }
7965
+ }
7966
+ return response;
7967
+ }
7968
+
7969
+
7970
+
7971
+
7972
+ var jsc = jQuery.now(),
7973
+ jsre = /(\=)\?(&|$)|\?\?/i;
7974
+
7975
+ // Default jsonp settings
7976
+ jQuery.ajaxSetup({
7977
+ jsonp: "callback",
7978
+ jsonpCallback: function() {
7979
+ return jQuery.expando + "_" + ( jsc++ );
7980
+ }
7981
+ });
7982
+
7983
+ // Detect, normalize options and install callbacks for jsonp requests
7984
+ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
7985
+
7986
+ var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType );
7987
+
7988
+ if ( s.dataTypes[ 0 ] === "jsonp" ||
7989
+ s.jsonp !== false && ( jsre.test( s.url ) ||
7990
+ inspectData && jsre.test( s.data ) ) ) {
7991
+
7992
+ var responseContainer,
7993
+ jsonpCallback = s.jsonpCallback =
7994
+ jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
7995
+ previous = window[ jsonpCallback ],
7996
+ url = s.url,
7997
+ data = s.data,
7998
+ replace = "$1" + jsonpCallback + "$2";
7999
+
8000
+ if ( s.jsonp !== false ) {
8001
+ url = url.replace( jsre, replace );
8002
+ if ( s.url === url ) {
8003
+ if ( inspectData ) {
8004
+ data = data.replace( jsre, replace );
8005
+ }
8006
+ if ( s.data === data ) {
8007
+ // Add callback manually
8008
+ url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
8009
+ }
8010
+ }
8011
+ }
8012
+
8013
+ s.url = url;
8014
+ s.data = data;
8015
+
8016
+ // Install callback
8017
+ window[ jsonpCallback ] = function( response ) {
8018
+ responseContainer = [ response ];
8019
+ };
8020
+
8021
+ // Clean-up function
8022
+ jqXHR.always(function() {
8023
+ // Set callback back to previous value
8024
+ window[ jsonpCallback ] = previous;
8025
+ // Call if it was a function and we have a response
8026
+ if ( responseContainer && jQuery.isFunction( previous ) ) {
8027
+ window[ jsonpCallback ]( responseContainer[ 0 ] );
8028
+ }
8029
+ });
8030
+
8031
+ // Use data converter to retrieve json after script execution
8032
+ s.converters["script json"] = function() {
8033
+ if ( !responseContainer ) {
8034
+ jQuery.error( jsonpCallback + " was not called" );
8035
+ }
8036
+ return responseContainer[ 0 ];
8037
+ };
8038
+
8039
+ // force json dataType
8040
+ s.dataTypes[ 0 ] = "json";
8041
+
8042
+ // Delegate to script
8043
+ return "script";
8044
+ }
8045
+ });
8046
+
8047
+
8048
+
8049
+
8050
+ // Install script dataType
8051
+ jQuery.ajaxSetup({
8052
+ accepts: {
8053
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
8054
+ },
8055
+ contents: {
8056
+ script: /javascript|ecmascript/
8057
+ },
8058
+ converters: {
8059
+ "text script": function( text ) {
8060
+ jQuery.globalEval( text );
8061
+ return text;
8062
+ }
8063
+ }
8064
+ });
8065
+
8066
+ // Handle cache's special case and global
8067
+ jQuery.ajaxPrefilter( "script", function( s ) {
8068
+ if ( s.cache === undefined ) {
8069
+ s.cache = false;
8070
+ }
8071
+ if ( s.crossDomain ) {
8072
+ s.type = "GET";
8073
+ s.global = false;
8074
+ }
8075
+ });
8076
+
8077
+ // Bind script tag hack transport
8078
+ jQuery.ajaxTransport( "script", function(s) {
8079
+
8080
+ // This transport only deals with cross domain requests
8081
+ if ( s.crossDomain ) {
8082
+
8083
+ var script,
8084
+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
8085
+
8086
+ return {
8087
+
8088
+ send: function( _, callback ) {
8089
+
8090
+ script = document.createElement( "script" );
8091
+
8092
+ script.async = "async";
8093
+
8094
+ if ( s.scriptCharset ) {
8095
+ script.charset = s.scriptCharset;
8096
+ }
8097
+
8098
+ script.src = s.url;
8099
+
8100
+ // Attach handlers for all browsers
8101
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
8102
+
8103
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
8104
+
8105
+ // Handle memory leak in IE
8106
+ script.onload = script.onreadystatechange = null;
8107
+
8108
+ // Remove the script
8109
+ if ( head && script.parentNode ) {
8110
+ head.removeChild( script );
8111
+ }
8112
+
8113
+ // Dereference the script
8114
+ script = undefined;
8115
+
8116
+ // Callback if not abort
8117
+ if ( !isAbort ) {
8118
+ callback( 200, "success" );
8119
+ }
8120
+ }
8121
+ };
8122
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
8123
+ // This arises when a base node is used (#2709 and #4378).
8124
+ head.insertBefore( script, head.firstChild );
8125
+ },
8126
+
8127
+ abort: function() {
8128
+ if ( script ) {
8129
+ script.onload( 0, 1 );
8130
+ }
8131
+ }
8132
+ };
8133
+ }
8134
+ });
8135
+
8136
+
8137
+
8138
+
8139
+ var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
8140
+ xhrOnUnloadAbort = window.ActiveXObject ? function() {
8141
+ // Abort all pending requests
8142
+ for ( var key in xhrCallbacks ) {
8143
+ xhrCallbacks[ key ]( 0, 1 );
8144
+ }
8145
+ } : false,
8146
+ xhrId = 0,
8147
+ xhrCallbacks;
8148
+
8149
+ // Functions to create xhrs
8150
+ function createStandardXHR() {
8151
+ try {
8152
+ return new window.XMLHttpRequest();
8153
+ } catch( e ) {}
8154
+ }
8155
+
8156
+ function createActiveXHR() {
8157
+ try {
8158
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
8159
+ } catch( e ) {}
8160
+ }
8161
+
8162
+ // Create the request object
8163
+ // (This is still attached to ajaxSettings for backward compatibility)
8164
+ jQuery.ajaxSettings.xhr = window.ActiveXObject ?
8165
+ /* Microsoft failed to properly
8166
+ * implement the XMLHttpRequest in IE7 (can't request local files),
8167
+ * so we use the ActiveXObject when it is available
8168
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
8169
+ * we need a fallback.
8170
+ */
8171
+ function() {
8172
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
8173
+ } :
8174
+ // For all other browsers, use the standard XMLHttpRequest object
8175
+ createStandardXHR;
8176
+
8177
+ // Determine support properties
8178
+ (function( xhr ) {
8179
+ jQuery.extend( jQuery.support, {
8180
+ ajax: !!xhr,
8181
+ cors: !!xhr && ( "withCredentials" in xhr )
8182
+ });
8183
+ })( jQuery.ajaxSettings.xhr() );
8184
+
8185
+ // Create transport if the browser can provide an xhr
8186
+ if ( jQuery.support.ajax ) {
8187
+
8188
+ jQuery.ajaxTransport(function( s ) {
8189
+ // Cross domain only allowed if supported through XMLHttpRequest
8190
+ if ( !s.crossDomain || jQuery.support.cors ) {
8191
+
8192
+ var callback;
8193
+
8194
+ return {
8195
+ send: function( headers, complete ) {
8196
+
8197
+ // Get a new xhr
8198
+ var xhr = s.xhr(),
8199
+ handle,
8200
+ i;
8201
+
8202
+ // Open the socket
8203
+ // Passing null username, generates a login popup on Opera (#2865)
8204
+ if ( s.username ) {
8205
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
8206
+ } else {
8207
+ xhr.open( s.type, s.url, s.async );
8208
+ }
8209
+
8210
+ // Apply custom fields if provided
8211
+ if ( s.xhrFields ) {
8212
+ for ( i in s.xhrFields ) {
8213
+ xhr[ i ] = s.xhrFields[ i ];
8214
+ }
8215
+ }
8216
+
8217
+ // Override mime type if needed
8218
+ if ( s.mimeType && xhr.overrideMimeType ) {
8219
+ xhr.overrideMimeType( s.mimeType );
8220
+ }
8221
+
8222
+ // X-Requested-With header
8223
+ // For cross-domain requests, seeing as conditions for a preflight are
8224
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
8225
+ // (it can always be set on a per-request basis or even using ajaxSetup)
8226
+ // For same-domain requests, won't change header if already provided.
8227
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
8228
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
8229
+ }
8230
+
8231
+ // Need an extra try/catch for cross domain requests in Firefox 3
8232
+ try {
8233
+ for ( i in headers ) {
8234
+ xhr.setRequestHeader( i, headers[ i ] );
8235
+ }
8236
+ } catch( _ ) {}
8237
+
8238
+ // Do send the request
8239
+ // This may raise an exception which is actually
8240
+ // handled in jQuery.ajax (so no try/catch here)
8241
+ xhr.send( ( s.hasContent && s.data ) || null );
8242
+
8243
+ // Listener
8244
+ callback = function( _, isAbort ) {
8245
+
8246
+ var status,
8247
+ statusText,
8248
+ responseHeaders,
8249
+ responses,
8250
+ xml;
8251
+
8252
+ // Firefox throws exceptions when accessing properties
8253
+ // of an xhr when a network error occured
8254
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
8255
+ try {
8256
+
8257
+ // Was never called and is aborted or complete
8258
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
8259
+
8260
+ // Only called once
8261
+ callback = undefined;
8262
+
8263
+ // Do not keep as active anymore
8264
+ if ( handle ) {
8265
+ xhr.onreadystatechange = jQuery.noop;
8266
+ if ( xhrOnUnloadAbort ) {
8267
+ delete xhrCallbacks[ handle ];
8268
+ }
8269
+ }
8270
+
8271
+ // If it's an abort
8272
+ if ( isAbort ) {
8273
+ // Abort it manually if needed
8274
+ if ( xhr.readyState !== 4 ) {
8275
+ xhr.abort();
8276
+ }
8277
+ } else {
8278
+ status = xhr.status;
8279
+ responseHeaders = xhr.getAllResponseHeaders();
8280
+ responses = {};
8281
+ xml = xhr.responseXML;
8282
+
8283
+ // Construct response list
8284
+ if ( xml && xml.documentElement /* #4958 */ ) {
8285
+ responses.xml = xml;
8286
+ }
8287
+
8288
+ // When requesting binary data, IE6-9 will throw an exception
8289
+ // on any attempt to access responseText (#11426)
8290
+ try {
8291
+ responses.text = xhr.responseText;
8292
+ } catch( _ ) {
8293
+ }
8294
+
8295
+ // Firefox throws an exception when accessing
8296
+ // statusText for faulty cross-domain requests
8297
+ try {
8298
+ statusText = xhr.statusText;
8299
+ } catch( e ) {
8300
+ // We normalize with Webkit giving an empty statusText
8301
+ statusText = "";
8302
+ }
8303
+
8304
+ // Filter status for non standard behaviors
8305
+
8306
+ // If the request is local and we have data: assume a success
8307
+ // (success with no data won't get notified, that's the best we
8308
+ // can do given current implementations)
8309
+ if ( !status && s.isLocal && !s.crossDomain ) {
8310
+ status = responses.text ? 200 : 404;
8311
+ // IE - #1450: sometimes returns 1223 when it should be 204
8312
+ } else if ( status === 1223 ) {
8313
+ status = 204;
8314
+ }
8315
+ }
8316
+ }
8317
+ } catch( firefoxAccessException ) {
8318
+ if ( !isAbort ) {
8319
+ complete( -1, firefoxAccessException );
8320
+ }
8321
+ }
8322
+
8323
+ // Call complete if needed
8324
+ if ( responses ) {
8325
+ complete( status, statusText, responses, responseHeaders );
8326
+ }
8327
+ };
8328
+
8329
+ // if we're in sync mode or it's in cache
8330
+ // and has been retrieved directly (IE6 & IE7)
8331
+ // we need to manually fire the callback
8332
+ if ( !s.async || xhr.readyState === 4 ) {
8333
+ callback();
8334
+ } else {
8335
+ handle = ++xhrId;
8336
+ if ( xhrOnUnloadAbort ) {
8337
+ // Create the active xhrs callbacks list if needed
8338
+ // and attach the unload handler
8339
+ if ( !xhrCallbacks ) {
8340
+ xhrCallbacks = {};
8341
+ jQuery( window ).unload( xhrOnUnloadAbort );
8342
+ }
8343
+ // Add to list of active xhrs callbacks
8344
+ xhrCallbacks[ handle ] = callback;
8345
+ }
8346
+ xhr.onreadystatechange = callback;
8347
+ }
8348
+ },
8349
+
8350
+ abort: function() {
8351
+ if ( callback ) {
8352
+ callback(0,1);
8353
+ }
8354
+ }
8355
+ };
8356
+ }
8357
+ });
8358
+ }
8359
+
8360
+
8361
+
8362
+
8363
+ var elemdisplay = {},
8364
+ iframe, iframeDoc,
8365
+ rfxtypes = /^(?:toggle|show|hide)$/,
8366
+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
8367
+ timerId,
8368
+ fxAttrs = [
8369
+ // height animations
8370
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
8371
+ // width animations
8372
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
8373
+ // opacity animations
8374
+ [ "opacity" ]
8375
+ ],
8376
+ fxNow;
8377
+
8378
+ jQuery.fn.extend({
8379
+ show: function( speed, easing, callback ) {
8380
+ var elem, display;
8381
+
8382
+ if ( speed || speed === 0 ) {
8383
+ return this.animate( genFx("show", 3), speed, easing, callback );
8384
+
8385
+ } else {
8386
+ for ( var i = 0, j = this.length; i < j; i++ ) {
8387
+ elem = this[ i ];
8388
+
8389
+ if ( elem.style ) {
8390
+ display = elem.style.display;
8391
+
8392
+ // Reset the inline display of this element to learn if it is
8393
+ // being hidden by cascaded rules or not
8394
+ if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
8395
+ display = elem.style.display = "";
8396
+ }
8397
+
8398
+ // Set elements which have been overridden with display: none
8399
+ // in a stylesheet to whatever the default browser style is
8400
+ // for such an element
8401
+ if ( (display === "" && jQuery.css(elem, "display") === "none") ||
8402
+ !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
8403
+ jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
8404
+ }
8405
+ }
8406
+ }
8407
+
8408
+ // Set the display of most of the elements in a second loop
8409
+ // to avoid the constant reflow
8410
+ for ( i = 0; i < j; i++ ) {
8411
+ elem = this[ i ];
8412
+
8413
+ if ( elem.style ) {
8414
+ display = elem.style.display;
8415
+
8416
+ if ( display === "" || display === "none" ) {
8417
+ elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
8418
+ }
8419
+ }
8420
+ }
8421
+
8422
+ return this;
8423
+ }
8424
+ },
8425
+
8426
+ hide: function( speed, easing, callback ) {
8427
+ if ( speed || speed === 0 ) {
8428
+ return this.animate( genFx("hide", 3), speed, easing, callback);
8429
+
8430
+ } else {
8431
+ var elem, display,
8432
+ i = 0,
8433
+ j = this.length;
8434
+
8435
+ for ( ; i < j; i++ ) {
8436
+ elem = this[i];
8437
+ if ( elem.style ) {
8438
+ display = jQuery.css( elem, "display" );
8439
+
8440
+ if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
8441
+ jQuery._data( elem, "olddisplay", display );
8442
+ }
8443
+ }
8444
+ }
8445
+
8446
+ // Set the display of the elements in a second loop
8447
+ // to avoid the constant reflow
8448
+ for ( i = 0; i < j; i++ ) {
8449
+ if ( this[i].style ) {
8450
+ this[i].style.display = "none";
8451
+ }
8452
+ }
8453
+
8454
+ return this;
8455
+ }
8456
+ },
8457
+
8458
+ // Save the old toggle function
8459
+ _toggle: jQuery.fn.toggle,
8460
+
8461
+ toggle: function( fn, fn2, callback ) {
8462
+ var bool = typeof fn === "boolean";
8463
+
8464
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
8465
+ this._toggle.apply( this, arguments );
8466
+
8467
+ } else if ( fn == null || bool ) {
8468
+ this.each(function() {
8469
+ var state = bool ? fn : jQuery(this).is(":hidden");
8470
+ jQuery(this)[ state ? "show" : "hide" ]();
8471
+ });
8472
+
8473
+ } else {
8474
+ this.animate(genFx("toggle", 3), fn, fn2, callback);
8475
+ }
8476
+
8477
+ return this;
8478
+ },
8479
+
8480
+ fadeTo: function( speed, to, easing, callback ) {
8481
+ return this.filter(":hidden").css("opacity", 0).show().end()
8482
+ .animate({opacity: to}, speed, easing, callback);
8483
+ },
8484
+
8485
+ animate: function( prop, speed, easing, callback ) {
8486
+ var optall = jQuery.speed( speed, easing, callback );
8487
+
8488
+ if ( jQuery.isEmptyObject( prop ) ) {
8489
+ return this.each( optall.complete, [ false ] );
8490
+ }
8491
+
8492
+ // Do not change referenced properties as per-property easing will be lost
8493
+ prop = jQuery.extend( {}, prop );
8494
+
8495
+ function doAnimation() {
8496
+ // XXX 'this' does not always have a nodeName when running the
8497
+ // test suite
8498
+
8499
+ if ( optall.queue === false ) {
8500
+ jQuery._mark( this );
8501
+ }
8502
+
8503
+ var opt = jQuery.extend( {}, optall ),
8504
+ isElement = this.nodeType === 1,
8505
+ hidden = isElement && jQuery(this).is(":hidden"),
8506
+ name, val, p, e, hooks, replace,
8507
+ parts, start, end, unit,
8508
+ method;
8509
+
8510
+ // will store per property easing and be used to determine when an animation is complete
8511
+ opt.animatedProperties = {};
8512
+
8513
+ // first pass over propertys to expand / normalize
8514
+ for ( p in prop ) {
8515
+ name = jQuery.camelCase( p );
8516
+ if ( p !== name ) {
8517
+ prop[ name ] = prop[ p ];
8518
+ delete prop[ p ];
8519
+ }
8520
+
8521
+ if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) {
8522
+ replace = hooks.expand( prop[ name ] );
8523
+ delete prop[ name ];
8524
+
8525
+ // not quite $.extend, this wont overwrite keys already present.
8526
+ // also - reusing 'p' from above because we have the correct "name"
8527
+ for ( p in replace ) {
8528
+ if ( ! ( p in prop ) ) {
8529
+ prop[ p ] = replace[ p ];
8530
+ }
8531
+ }
8532
+ }
8533
+ }
8534
+
8535
+ for ( name in prop ) {
8536
+ val = prop[ name ];
8537
+ // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
8538
+ if ( jQuery.isArray( val ) ) {
8539
+ opt.animatedProperties[ name ] = val[ 1 ];
8540
+ val = prop[ name ] = val[ 0 ];
8541
+ } else {
8542
+ opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
8543
+ }
8544
+
8545
+ if ( val === "hide" && hidden || val === "show" && !hidden ) {
8546
+ return opt.complete.call( this );
8547
+ }
8548
+
8549
+ if ( isElement && ( name === "height" || name === "width" ) ) {
8550
+ // Make sure that nothing sneaks out
8551
+ // Record all 3 overflow attributes because IE does not
8552
+ // change the overflow attribute when overflowX and
8553
+ // overflowY are set to the same value
8554
+ opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
8555
+
8556
+ // Set display property to inline-block for height/width
8557
+ // animations on inline elements that are having width/height animated
8558
+ if ( jQuery.css( this, "display" ) === "inline" &&
8559
+ jQuery.css( this, "float" ) === "none" ) {
8560
+
8561
+ // inline-level elements accept inline-block;
8562
+ // block-level elements need to be inline with layout
8563
+ if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
8564
+ this.style.display = "inline-block";
8565
+
8566
+ } else {
8567
+ this.style.zoom = 1;
8568
+ }
8569
+ }
8570
+ }
8571
+ }
8572
+
8573
+ if ( opt.overflow != null ) {
8574
+ this.style.overflow = "hidden";
8575
+ }
8576
+
8577
+ for ( p in prop ) {
8578
+ e = new jQuery.fx( this, opt, p );
8579
+ val = prop[ p ];
8580
+
8581
+ if ( rfxtypes.test( val ) ) {
8582
+
8583
+ // Tracks whether to show or hide based on private
8584
+ // data attached to the element
8585
+ method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
8586
+ if ( method ) {
8587
+ jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
8588
+ e[ method ]();
8589
+ } else {
8590
+ e[ val ]();
8591
+ }
8592
+
8593
+ } else {
8594
+ parts = rfxnum.exec( val );
8595
+ start = e.cur();
8596
+
8597
+ if ( parts ) {
8598
+ end = parseFloat( parts[2] );
8599
+ unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
8600
+
8601
+ // We need to compute starting value
8602
+ if ( unit !== "px" ) {
8603
+ jQuery.style( this, p, (end || 1) + unit);
8604
+ start = ( (end || 1) / e.cur() ) * start;
8605
+ jQuery.style( this, p, start + unit);
8606
+ }
8607
+
8608
+ // If a +=/-= token was provided, we're doing a relative animation
8609
+ if ( parts[1] ) {
8610
+ end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
8611
+ }
8612
+
8613
+ e.custom( start, end, unit );
8614
+
8615
+ } else {
8616
+ e.custom( start, val, "" );
8617
+ }
8618
+ }
8619
+ }
8620
+
8621
+ // For JS strict compliance
8622
+ return true;
8623
+ }
8624
+
8625
+ return optall.queue === false ?
8626
+ this.each( doAnimation ) :
8627
+ this.queue( optall.queue, doAnimation );
8628
+ },
8629
+
8630
+ stop: function( type, clearQueue, gotoEnd ) {
8631
+ if ( typeof type !== "string" ) {
8632
+ gotoEnd = clearQueue;
8633
+ clearQueue = type;
8634
+ type = undefined;
8635
+ }
8636
+ if ( clearQueue && type !== false ) {
8637
+ this.queue( type || "fx", [] );
8638
+ }
8639
+
8640
+ return this.each(function() {
8641
+ var index,
8642
+ hadTimers = false,
8643
+ timers = jQuery.timers,
8644
+ data = jQuery._data( this );
8645
+
8646
+ // clear marker counters if we know they won't be
8647
+ if ( !gotoEnd ) {
8648
+ jQuery._unmark( true, this );
8649
+ }
8650
+
8651
+ function stopQueue( elem, data, index ) {
8652
+ var hooks = data[ index ];
8653
+ jQuery.removeData( elem, index, true );
8654
+ hooks.stop( gotoEnd );
8655
+ }
8656
+
8657
+ if ( type == null ) {
8658
+ for ( index in data ) {
8659
+ if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
8660
+ stopQueue( this, data, index );
8661
+ }
8662
+ }
8663
+ } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
8664
+ stopQueue( this, data, index );
8665
+ }
8666
+
8667
+ for ( index = timers.length; index--; ) {
8668
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
8669
+ if ( gotoEnd ) {
8670
+
8671
+ // force the next step to be the last
8672
+ timers[ index ]( true );
8673
+ } else {
8674
+ timers[ index ].saveState();
8675
+ }
8676
+ hadTimers = true;
8677
+ timers.splice( index, 1 );
8678
+ }
8679
+ }
8680
+
8681
+ // start the next in the queue if the last step wasn't forced
8682
+ // timers currently will call their complete callbacks, which will dequeue
8683
+ // but only if they were gotoEnd
8684
+ if ( !( gotoEnd && hadTimers ) ) {
8685
+ jQuery.dequeue( this, type );
8686
+ }
8687
+ });
8688
+
8689
+ }
8690
+
8691
+ });
8692
+
8693
+ // Animations created synchronously will run synchronously
8694
+ function createFxNow() {
8695
+ setTimeout( clearFxNow, 0 );
8696
+ return ( fxNow = jQuery.now() );
8697
+ }
8698
+
8699
+ function clearFxNow() {
8700
+ fxNow = undefined;
8701
+ }
8702
+
8703
+ // Generate parameters to create a standard animation
8704
+ function genFx( type, num ) {
8705
+ var obj = {};
8706
+
8707
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
8708
+ obj[ this ] = type;
8709
+ });
8710
+
8711
+ return obj;
8712
+ }
8713
+
8714
+ // Generate shortcuts for custom animations
8715
+ jQuery.each({
8716
+ slideDown: genFx( "show", 1 ),
8717
+ slideUp: genFx( "hide", 1 ),
8718
+ slideToggle: genFx( "toggle", 1 ),
8719
+ fadeIn: { opacity: "show" },
8720
+ fadeOut: { opacity: "hide" },
8721
+ fadeToggle: { opacity: "toggle" }
8722
+ }, function( name, props ) {
8723
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
8724
+ return this.animate( props, speed, easing, callback );
8725
+ };
8726
+ });
8727
+
8728
+ jQuery.extend({
8729
+ speed: function( speed, easing, fn ) {
8730
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
8731
+ complete: fn || !fn && easing ||
8732
+ jQuery.isFunction( speed ) && speed,
8733
+ duration: speed,
8734
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
8735
+ };
8736
+
8737
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
8738
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
8739
+
8740
+ // normalize opt.queue - true/undefined/null -> "fx"
8741
+ if ( opt.queue == null || opt.queue === true ) {
8742
+ opt.queue = "fx";
8743
+ }
8744
+
8745
+ // Queueing
8746
+ opt.old = opt.complete;
8747
+
8748
+ opt.complete = function( noUnmark ) {
8749
+ if ( jQuery.isFunction( opt.old ) ) {
8750
+ opt.old.call( this );
8751
+ }
8752
+
8753
+ if ( opt.queue ) {
8754
+ jQuery.dequeue( this, opt.queue );
8755
+ } else if ( noUnmark !== false ) {
8756
+ jQuery._unmark( this );
8757
+ }
8758
+ };
8759
+
8760
+ return opt;
8761
+ },
8762
+
8763
+ easing: {
8764
+ linear: function( p ) {
8765
+ return p;
8766
+ },
8767
+ swing: function( p ) {
8768
+ return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5;
8769
+ }
8770
+ },
8771
+
8772
+ timers: [],
8773
+
8774
+ fx: function( elem, options, prop ) {
8775
+ this.options = options;
8776
+ this.elem = elem;
8777
+ this.prop = prop;
8778
+
8779
+ options.orig = options.orig || {};
8780
+ }
8781
+
8782
+ });
8783
+
8784
+ jQuery.fx.prototype = {
8785
+ // Simple function for setting a style value
8786
+ update: function() {
8787
+ if ( this.options.step ) {
8788
+ this.options.step.call( this.elem, this.now, this );
8789
+ }
8790
+
8791
+ ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
8792
+ },
8793
+
8794
+ // Get the current size
8795
+ cur: function() {
8796
+ if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
8797
+ return this.elem[ this.prop ];
8798
+ }
8799
+
8800
+ var parsed,
8801
+ r = jQuery.css( this.elem, this.prop );
8802
+ // Empty strings, null, undefined and "auto" are converted to 0,
8803
+ // complex values such as "rotate(1rad)" are returned as is,
8804
+ // simple values such as "10px" are parsed to Float.
8805
+ return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
8806
+ },
8807
+
8808
+ // Start an animation from one number to another
8809
+ custom: function( from, to, unit ) {
8810
+ var self = this,
8811
+ fx = jQuery.fx;
8812
+
8813
+ this.startTime = fxNow || createFxNow();
8814
+ this.end = to;
8815
+ this.now = this.start = from;
8816
+ this.pos = this.state = 0;
8817
+ this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
8818
+
8819
+ function t( gotoEnd ) {
8820
+ return self.step( gotoEnd );
8821
+ }
8822
+
8823
+ t.queue = this.options.queue;
8824
+ t.elem = this.elem;
8825
+ t.saveState = function() {
8826
+ if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
8827
+ if ( self.options.hide ) {
8828
+ jQuery._data( self.elem, "fxshow" + self.prop, self.start );
8829
+ } else if ( self.options.show ) {
8830
+ jQuery._data( self.elem, "fxshow" + self.prop, self.end );
8831
+ }
8832
+ }
8833
+ };
8834
+
8835
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
8836
+ timerId = setInterval( fx.tick, fx.interval );
8837
+ }
8838
+ },
8839
+
8840
+ // Simple 'show' function
8841
+ show: function() {
8842
+ var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
8843
+
8844
+ // Remember where we started, so that we can go back to it later
8845
+ this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
8846
+ this.options.show = true;
8847
+
8848
+ // Begin the animation
8849
+ // Make sure that we start at a small width/height to avoid any flash of content
8850
+ if ( dataShow !== undefined ) {
8851
+ // This show is picking up where a previous hide or show left off
8852
+ this.custom( this.cur(), dataShow );
8853
+ } else {
8854
+ this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
8855
+ }
8856
+
8857
+ // Start by showing the element
8858
+ jQuery( this.elem ).show();
8859
+ },
8860
+
8861
+ // Simple 'hide' function
8862
+ hide: function() {
8863
+ // Remember where we started, so that we can go back to it later
8864
+ this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
8865
+ this.options.hide = true;
8866
+
8867
+ // Begin the animation
8868
+ this.custom( this.cur(), 0 );
8869
+ },
8870
+
8871
+ // Each step of an animation
8872
+ step: function( gotoEnd ) {
8873
+ var p, n, complete,
8874
+ t = fxNow || createFxNow(),
8875
+ done = true,
8876
+ elem = this.elem,
8877
+ options = this.options;
8878
+
8879
+ if ( gotoEnd || t >= options.duration + this.startTime ) {
8880
+ this.now = this.end;
8881
+ this.pos = this.state = 1;
8882
+ this.update();
8883
+
8884
+ options.animatedProperties[ this.prop ] = true;
8885
+
8886
+ for ( p in options.animatedProperties ) {
8887
+ if ( options.animatedProperties[ p ] !== true ) {
8888
+ done = false;
8889
+ }
8890
+ }
8891
+
8892
+ if ( done ) {
8893
+ // Reset the overflow
8894
+ if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
8895
+
8896
+ jQuery.each( [ "", "X", "Y" ], function( index, value ) {
8897
+ elem.style[ "overflow" + value ] = options.overflow[ index ];
8898
+ });
8899
+ }
8900
+
8901
+ // Hide the element if the "hide" operation was done
8902
+ if ( options.hide ) {
8903
+ jQuery( elem ).hide();
8904
+ }
8905
+
8906
+ // Reset the properties, if the item has been hidden or shown
8907
+ if ( options.hide || options.show ) {
8908
+ for ( p in options.animatedProperties ) {
8909
+ jQuery.style( elem, p, options.orig[ p ] );
8910
+ jQuery.removeData( elem, "fxshow" + p, true );
8911
+ // Toggle data is no longer needed
8912
+ jQuery.removeData( elem, "toggle" + p, true );
8913
+ }
8914
+ }
8915
+
8916
+ // Execute the complete function
8917
+ // in the event that the complete function throws an exception
8918
+ // we must ensure it won't be called twice. #5684
8919
+
8920
+ complete = options.complete;
8921
+ if ( complete ) {
8922
+
8923
+ options.complete = false;
8924
+ complete.call( elem );
8925
+ }
8926
+ }
8927
+
8928
+ return false;
8929
+
8930
+ } else {
8931
+ // classical easing cannot be used with an Infinity duration
8932
+ if ( options.duration == Infinity ) {
8933
+ this.now = t;
8934
+ } else {
8935
+ n = t - this.startTime;
8936
+ this.state = n / options.duration;
8937
+
8938
+ // Perform the easing function, defaults to swing
8939
+ this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
8940
+ this.now = this.start + ( (this.end - this.start) * this.pos );
8941
+ }
8942
+ // Perform the next step of the animation
8943
+ this.update();
8944
+ }
8945
+
8946
+ return true;
8947
+ }
8948
+ };
8949
+
8950
+ jQuery.extend( jQuery.fx, {
8951
+ tick: function() {
8952
+ var timer,
8953
+ timers = jQuery.timers,
8954
+ i = 0;
8955
+
8956
+ for ( ; i < timers.length; i++ ) {
8957
+ timer = timers[ i ];
8958
+ // Checks the timer has not already been removed
8959
+ if ( !timer() && timers[ i ] === timer ) {
8960
+ timers.splice( i--, 1 );
8961
+ }
8962
+ }
8963
+
8964
+ if ( !timers.length ) {
8965
+ jQuery.fx.stop();
8966
+ }
8967
+ },
8968
+
8969
+ interval: 13,
8970
+
8971
+ stop: function() {
8972
+ clearInterval( timerId );
8973
+ timerId = null;
8974
+ },
8975
+
8976
+ speeds: {
8977
+ slow: 600,
8978
+ fast: 200,
8979
+ // Default speed
8980
+ _default: 400
8981
+ },
8982
+
8983
+ step: {
8984
+ opacity: function( fx ) {
8985
+ jQuery.style( fx.elem, "opacity", fx.now );
8986
+ },
8987
+
8988
+ _default: function( fx ) {
8989
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
8990
+ fx.elem.style[ fx.prop ] = fx.now + fx.unit;
8991
+ } else {
8992
+ fx.elem[ fx.prop ] = fx.now;
8993
+ }
8994
+ }
8995
+ }
8996
+ });
8997
+
8998
+ // Ensure props that can't be negative don't go there on undershoot easing
8999
+ jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
9000
+ // exclude marginTop, marginLeft, marginBottom and marginRight from this list
9001
+ if ( prop.indexOf( "margin" ) ) {
9002
+ jQuery.fx.step[ prop ] = function( fx ) {
9003
+ jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
9004
+ };
9005
+ }
9006
+ });
9007
+
9008
+ if ( jQuery.expr && jQuery.expr.filters ) {
9009
+ jQuery.expr.filters.animated = function( elem ) {
9010
+ return jQuery.grep(jQuery.timers, function( fn ) {
9011
+ return elem === fn.elem;
9012
+ }).length;
9013
+ };
9014
+ }
9015
+
9016
+ // Try to restore the default display value of an element
9017
+ function defaultDisplay( nodeName ) {
9018
+
9019
+ if ( !elemdisplay[ nodeName ] ) {
9020
+
9021
+ var body = document.body,
9022
+ elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
9023
+ display = elem.css( "display" );
9024
+ elem.remove();
9025
+
9026
+ // If the simple way fails,
9027
+ // get element's real default display by attaching it to a temp iframe
9028
+ if ( display === "none" || display === "" ) {
9029
+ // No iframe to use yet, so create it
9030
+ if ( !iframe ) {
9031
+ iframe = document.createElement( "iframe" );
9032
+ iframe.frameBorder = iframe.width = iframe.height = 0;
9033
+ }
9034
+
9035
+ body.appendChild( iframe );
9036
+
9037
+ // Create a cacheable copy of the iframe document on first call.
9038
+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
9039
+ // document to it; WebKit & Firefox won't allow reusing the iframe document.
9040
+ if ( !iframeDoc || !iframe.createElement ) {
9041
+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
9042
+ iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" );
9043
+ iframeDoc.close();
9044
+ }
9045
+
9046
+ elem = iframeDoc.createElement( nodeName );
9047
+
9048
+ iframeDoc.body.appendChild( elem );
9049
+
9050
+ display = jQuery.css( elem, "display" );
9051
+ body.removeChild( iframe );
9052
+ }
9053
+
9054
+ // Store the correct default display
9055
+ elemdisplay[ nodeName ] = display;
9056
+ }
9057
+
9058
+ return elemdisplay[ nodeName ];
9059
+ }
9060
+
9061
+
9062
+
9063
+
9064
+ var getOffset,
9065
+ rtable = /^t(?:able|d|h)$/i,
9066
+ rroot = /^(?:body|html)$/i;
9067
+
9068
+ if ( "getBoundingClientRect" in document.documentElement ) {
9069
+ getOffset = function( elem, doc, docElem, box ) {
9070
+ try {
9071
+ box = elem.getBoundingClientRect();
9072
+ } catch(e) {}
9073
+
9074
+ // Make sure we're not dealing with a disconnected DOM node
9075
+ if ( !box || !jQuery.contains( docElem, elem ) ) {
9076
+ return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
9077
+ }
9078
+
9079
+ var body = doc.body,
9080
+ win = getWindow( doc ),
9081
+ clientTop = docElem.clientTop || body.clientTop || 0,
9082
+ clientLeft = docElem.clientLeft || body.clientLeft || 0,
9083
+ scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
9084
+ scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
9085
+ top = box.top + scrollTop - clientTop,
9086
+ left = box.left + scrollLeft - clientLeft;
9087
+
9088
+ return { top: top, left: left };
9089
+ };
9090
+
9091
+ } else {
9092
+ getOffset = function( elem, doc, docElem ) {
9093
+ var computedStyle,
9094
+ offsetParent = elem.offsetParent,
9095
+ prevOffsetParent = elem,
9096
+ body = doc.body,
9097
+ defaultView = doc.defaultView,
9098
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
9099
+ top = elem.offsetTop,
9100
+ left = elem.offsetLeft;
9101
+
9102
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
9103
+ if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
9104
+ break;
9105
+ }
9106
+
9107
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
9108
+ top -= elem.scrollTop;
9109
+ left -= elem.scrollLeft;
9110
+
9111
+ if ( elem === offsetParent ) {
9112
+ top += elem.offsetTop;
9113
+ left += elem.offsetLeft;
9114
+
9115
+ if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
9116
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
9117
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
9118
+ }
9119
+
9120
+ prevOffsetParent = offsetParent;
9121
+ offsetParent = elem.offsetParent;
9122
+ }
9123
+
9124
+ if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
9125
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
9126
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
9127
+ }
9128
+
9129
+ prevComputedStyle = computedStyle;
9130
+ }
9131
+
9132
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
9133
+ top += body.offsetTop;
9134
+ left += body.offsetLeft;
9135
+ }
9136
+
9137
+ if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
9138
+ top += Math.max( docElem.scrollTop, body.scrollTop );
9139
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
9140
+ }
9141
+
9142
+ return { top: top, left: left };
9143
+ };
9144
+ }
9145
+
9146
+ jQuery.fn.offset = function( options ) {
9147
+ if ( arguments.length ) {
9148
+ return options === undefined ?
9149
+ this :
9150
+ this.each(function( i ) {
9151
+ jQuery.offset.setOffset( this, options, i );
9152
+ });
9153
+ }
9154
+
9155
+ var elem = this[0],
9156
+ doc = elem && elem.ownerDocument;
9157
+
9158
+ if ( !doc ) {
9159
+ return null;
9160
+ }
9161
+
9162
+ if ( elem === doc.body ) {
9163
+ return jQuery.offset.bodyOffset( elem );
9164
+ }
9165
+
9166
+ return getOffset( elem, doc, doc.documentElement );
9167
+ };
9168
+
9169
+ jQuery.offset = {
9170
+
9171
+ bodyOffset: function( body ) {
9172
+ var top = body.offsetTop,
9173
+ left = body.offsetLeft;
9174
+
9175
+ if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
9176
+ top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
9177
+ left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
9178
+ }
9179
+
9180
+ return { top: top, left: left };
9181
+ },
9182
+
9183
+ setOffset: function( elem, options, i ) {
9184
+ var position = jQuery.css( elem, "position" );
9185
+
9186
+ // set position first, in-case top/left are set even on static elem
9187
+ if ( position === "static" ) {
9188
+ elem.style.position = "relative";
9189
+ }
9190
+
9191
+ var curElem = jQuery( elem ),
9192
+ curOffset = curElem.offset(),
9193
+ curCSSTop = jQuery.css( elem, "top" ),
9194
+ curCSSLeft = jQuery.css( elem, "left" ),
9195
+ calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
9196
+ props = {}, curPosition = {}, curTop, curLeft;
9197
+
9198
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
9199
+ if ( calculatePosition ) {
9200
+ curPosition = curElem.position();
9201
+ curTop = curPosition.top;
9202
+ curLeft = curPosition.left;
9203
+ } else {
9204
+ curTop = parseFloat( curCSSTop ) || 0;
9205
+ curLeft = parseFloat( curCSSLeft ) || 0;
9206
+ }
9207
+
9208
+ if ( jQuery.isFunction( options ) ) {
9209
+ options = options.call( elem, i, curOffset );
9210
+ }
9211
+
9212
+ if ( options.top != null ) {
9213
+ props.top = ( options.top - curOffset.top ) + curTop;
9214
+ }
9215
+ if ( options.left != null ) {
9216
+ props.left = ( options.left - curOffset.left ) + curLeft;
9217
+ }
9218
+
9219
+ if ( "using" in options ) {
9220
+ options.using.call( elem, props );
9221
+ } else {
9222
+ curElem.css( props );
9223
+ }
9224
+ }
9225
+ };
9226
+
9227
+
9228
+ jQuery.fn.extend({
9229
+
9230
+ position: function() {
9231
+ if ( !this[0] ) {
9232
+ return null;
9233
+ }
9234
+
9235
+ var elem = this[0],
9236
+
9237
+ // Get *real* offsetParent
9238
+ offsetParent = this.offsetParent(),
9239
+
9240
+ // Get correct offsets
9241
+ offset = this.offset(),
9242
+ parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
9243
+
9244
+ // Subtract element margins
9245
+ // note: when an element has margin: auto the offsetLeft and marginLeft
9246
+ // are the same in Safari causing offset.left to incorrectly be 0
9247
+ offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
9248
+ offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
9249
+
9250
+ // Add offsetParent borders
9251
+ parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
9252
+ parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
9253
+
9254
+ // Subtract the two offsets
9255
+ return {
9256
+ top: offset.top - parentOffset.top,
9257
+ left: offset.left - parentOffset.left
9258
+ };
9259
+ },
9260
+
9261
+ offsetParent: function() {
9262
+ return this.map(function() {
9263
+ var offsetParent = this.offsetParent || document.body;
9264
+ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
9265
+ offsetParent = offsetParent.offsetParent;
9266
+ }
9267
+ return offsetParent;
9268
+ });
9269
+ }
9270
+ });
9271
+
9272
+
9273
+ // Create scrollLeft and scrollTop methods
9274
+ jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
9275
+ var top = /Y/.test( prop );
9276
+
9277
+ jQuery.fn[ method ] = function( val ) {
9278
+ return jQuery.access( this, function( elem, method, val ) {
9279
+ var win = getWindow( elem );
9280
+
9281
+ if ( val === undefined ) {
9282
+ return win ? (prop in win) ? win[ prop ] :
9283
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
9284
+ win.document.body[ method ] :
9285
+ elem[ method ];
9286
+ }
9287
+
9288
+ if ( win ) {
9289
+ win.scrollTo(
9290
+ !top ? val : jQuery( win ).scrollLeft(),
9291
+ top ? val : jQuery( win ).scrollTop()
9292
+ );
9293
+
9294
+ } else {
9295
+ elem[ method ] = val;
9296
+ }
9297
+ }, method, val, arguments.length, null );
9298
+ };
9299
+ });
9300
+
9301
+ function getWindow( elem ) {
9302
+ return jQuery.isWindow( elem ) ?
9303
+ elem :
9304
+ elem.nodeType === 9 ?
9305
+ elem.defaultView || elem.parentWindow :
9306
+ false;
9307
+ }
9308
+
9309
+
9310
+
9311
+
9312
+ // Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
9313
+ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
9314
+ var clientProp = "client" + name,
9315
+ scrollProp = "scroll" + name,
9316
+ offsetProp = "offset" + name;
9317
+
9318
+ // innerHeight and innerWidth
9319
+ jQuery.fn[ "inner" + name ] = function() {
9320
+ var elem = this[0];
9321
+ return elem ?
9322
+ elem.style ?
9323
+ parseFloat( jQuery.css( elem, type, "padding" ) ) :
9324
+ this[ type ]() :
9325
+ null;
9326
+ };
9327
+
9328
+ // outerHeight and outerWidth
9329
+ jQuery.fn[ "outer" + name ] = function( margin ) {
9330
+ var elem = this[0];
9331
+ return elem ?
9332
+ elem.style ?
9333
+ parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
9334
+ this[ type ]() :
9335
+ null;
9336
+ };
9337
+
9338
+ jQuery.fn[ type ] = function( value ) {
9339
+ return jQuery.access( this, function( elem, type, value ) {
9340
+ var doc, docElemProp, orig, ret;
9341
+
9342
+ if ( jQuery.isWindow( elem ) ) {
9343
+ // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
9344
+ doc = elem.document;
9345
+ docElemProp = doc.documentElement[ clientProp ];
9346
+ return jQuery.support.boxModel && docElemProp ||
9347
+ doc.body && doc.body[ clientProp ] || docElemProp;
9348
+ }
9349
+
9350
+ // Get document width or height
9351
+ if ( elem.nodeType === 9 ) {
9352
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
9353
+ doc = elem.documentElement;
9354
+
9355
+ // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height]
9356
+ // so we can't use max, as it'll choose the incorrect offset[Width/Height]
9357
+ // instead we use the correct client[Width/Height]
9358
+ // support:IE6
9359
+ if ( doc[ clientProp ] >= doc[ scrollProp ] ) {
9360
+ return doc[ clientProp ];
9361
+ }
9362
+
9363
+ return Math.max(
9364
+ elem.body[ scrollProp ], doc[ scrollProp ],
9365
+ elem.body[ offsetProp ], doc[ offsetProp ]
9366
+ );
9367
+ }
9368
+
9369
+ // Get width or height on the element
9370
+ if ( value === undefined ) {
9371
+ orig = jQuery.css( elem, type );
9372
+ ret = parseFloat( orig );
9373
+ return jQuery.isNumeric( ret ) ? ret : orig;
9374
+ }
9375
+
9376
+ // Set the width or height on the element
9377
+ jQuery( elem ).css( type, value );
9378
+ }, type, value, arguments.length, null );
9379
+ };
9380
+ });
9381
+
9382
+
9383
+
9384
+
9385
+ // Expose jQuery to the global object
9386
+ window.jQuery = window.$ = jQuery;
9387
+
9388
+ // Expose jQuery as an AMD module, but only for AMD loaders that
9389
+ // understand the issues with loading multiple versions of jQuery
9390
+ // in a page that all might call define(). The loader will indicate
9391
+ // they have special allowances for multiple jQuery versions by
9392
+ // specifying define.amd.jQuery = true. Register as a named module,
9393
+ // since jQuery can be concatenated with other files that may use define,
9394
+ // but not use a proper concatenation script that understands anonymous
9395
+ // AMD modules. A named AMD is safest and most robust way to register.
9396
+ // Lowercase jquery is used because AMD module names are derived from
9397
+ // file names, and jQuery is normally delivered in a lowercase file name.
9398
+ // Do this after creating the global so that if an AMD module wants to call
9399
+ // noConflict to hide this version of jQuery, it will work.
9400
+ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
9401
+ define( "jquery", [], function () { return jQuery; } );
9402
+ }
9403
+
9404
+
9405
+
9406
+ })( window );
js/mw_developertoolbar/popupdevtool.js ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 
2
+ var popupStatus = 0;
3
+ var is_dev_click = 0;
4
+ var $j_mw_devtoolbar = jQuery.noConflict();
5
+
6
+ ////loading popup with jQuery magic!
7
+ //function loadPopup_devtool(){
8
+ // //loads popup only if it is disabled
9
+ // if(popupStatus==0){
10
+ // $j_mw_devtoolbar("#mw_devtoolbar").fadeIn("slow");
11
+ // popupStatus = 1;
12
+ // }
13
+ //}
14
+
15
+ //disabling popup with jQuery magic!
16
+ function disablePopup_devtool(){
17
+ // //disables popup only if it is enabled
18
+ // if(popupStatus==1){
19
+ $j_mw_devtoolbar("#mw_devtoolbar").fadeOut("slow");
20
+ // popupStatus = 0;
21
+ // }
22
+ }
23
+
24
+ //centering popup
25
+ function centerPopup_devtool(){
26
+ //centering
27
+ $j_mw_devtoolbar("#mw_devtoolbar").css({
28
+ "position": "fixed",
29
+ "bottom": 0,
30
+ "left": 0
31
+ });
32
+ }
33
+
34
+ //for slide down box
35
+ function HideDialog_devtool() {
36
+ // var i = 0;
37
+ popupStatus = 0;
38
+ $j_mw_devtoolbar('#mw_devtoolbar').css('posision','fixed');
39
+ $j_mw_devtoolbar('#mw_devtoolbar').css('display','block');
40
+ var i = $j_mw_devtoolbar("#mw_devtoolbar").height();
41
+ while(i >= 18)
42
+ {
43
+ $j_mw_devtoolbar('#mw_devtoolbar').animate({'bottom': '-=1px'}, 0.0001);
44
+ i-=1;
45
+ }
46
+ }
47
+
48
+ //for slide up box
49
+ function ShowDialog_devtool() {
50
+ var i = 0;
51
+ popupStatus = 1;
52
+ $j_mw_devtoolbar('#mw_devtoolbar').css('posision','fixed');
53
+ //$j_mw_devtoolbar('#popupContact').animate({'bottom': '+=25px'},50);
54
+ //$('#popupContact').css('bottom','0px');
55
+ $j_mw_devtoolbar('#mw_devtoolbar').css('display','block');
56
+ var popupHeight = $j_mw_devtoolbar("#mw_devtoolbar").height()-18;
57
+ while(i <= popupHeight)
58
+ {
59
+ $j_mw_devtoolbar('#mw_devtoolbar').animate({'bottom': '+=1px'}, 0.0001);
60
+ i+=1;
61
+ //if(i == 25) {$('#popupContact').css('posision','fixed');}
62
+ }
63
+ //$('#popupContact').css('bottom','0px');
64
+ }
65
+
66
+
67
+ //////////////////////////////////////
68
+
69
+ function clickhide_devtool(){
70
+ document.getElementById('hide_toolbar').style.display='none';
71
+ document.getElementById('show_toolbar').style.display='inline';
72
+ //pf204652IntervalId = setInterval ( 'hide_toolbar()', 5 );
73
+ }
74
+ function clickshow_devtool(){
75
+ document.getElementById('hide_toolbar').style.display='inline';
76
+ document.getElementById('show_toolbar').style.display='none';
77
+ //pf204652IntervalId = setInterval ( 'show_toolbar()', 5 );
78
+ }
79
+
80
+ //-------------------------------------------------------------
81
+
82
+ //CONTROLLING EVENTS IN jQuery
83
+ $j_mw_devtoolbar(document).ready(function(){
84
+ var _active;
85
+ _active = $j_mw_devtoolbar("#active_devtool").val();
86
+ if( _active == "1"){
87
+ centerPopup_devtool();
88
+ HideDialog_devtool();
89
+ clickhide_devtool();
90
+
91
+ //CLOSING POPUP
92
+ //Click the x event!
93
+ $j_mw_devtoolbar("#close_toolbar").click(function(){
94
+ disablePopup_devtool();
95
+ });
96
+
97
+ // $j_mw_devtoolbar("#hide_toolbar").click(function(){
98
+ // //HideDialog_devtool();
99
+ // $j_mw_devtoolbar("#hide_toolbar").addClass("min");
100
+ // });
101
+
102
+ $j_mw_devtoolbar("#title_devtool").click(function(){
103
+ is_dev_click = 1;
104
+ if(popupStatus == 1)
105
+ {
106
+ HideDialog_devtool();
107
+ clickhide_devtool();
108
+ popupStatus = 0;
109
+ //$j_mw_devtoolbar("#hide_toolbar").addClass("min");
110
+ }
111
+ else {
112
+ ShowDialog_devtool();
113
+ popupStatus = 1;
114
+ //$j_mw_devtoolbar("#show_toolbar").addClass("max");
115
+ clickshow_devtool();
116
+ }
117
+
118
+ });
119
+
120
+ $j_mw_devtoolbar("#show_toolbar").click(function(){
121
+ //ShowDialog_devtool();
122
+ popupStatus = 0;
123
+ //$j_mw_devtoolbar("#show_toolbar").addClass("max");
124
+ });
125
+
126
+ $j_mw_devtoolbar("#close_devtoolbar").click(function(){
127
+ HideDialog_devtool();
128
+ clickhide_devtool();
129
+ popupStatus = 0;
130
+ });
131
+ }
132
+ });
js/mw_js/jquery.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery JavaScript Library v1.3.2
3
+ * http://jquery.com/
4
+ *
5
+ * Copyright (c) 2009 John Resig
6
+ * Dual licensed under the MIT and GPL licenses.
7
+ * http://docs.jquery.com/License
8
+ *
9
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
10
+ * Revision: 6246
11
+ */
12
+ (function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
13
+ /*
14
+ * Sizzle CSS Selector Engine - v0.9.3
15
+ * Copyright 2009, The Dojo Foundation
16
+ * Released under the MIT, BSD, and GPL Licenses.
17
+ * More information: http://sizzlejs.com/
18
+ */
19
+ (function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
js/mw_js/jquery_noconflict.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.noConflict();
package.xml CHANGED
@@ -1,18 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>HM_DeveloperToolbar</name>
4
- <version>1.0</version>
5
  <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>DeveloperToolbar</summary>
10
- <description>DeveloperToolbar is useful extension that allow the developers to access some common configuration quickly and easily without logging in to admin panel.</description>
11
- <notes>Compatible with magento 1.2.x - 1.3.x</notes>
12
- <authors><author><name>Hai NGUYEN</name><user>auto-converted</user><email>haint@hello-magento.com</email></author></authors>
13
- <date>2009-11-05</date>
14
- <time>02:55:46</time>
15
- <contents><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="developertoolbar.xml" hash="04e3440fab602230c373870eed65d2da"/></dir><dir name="template"><dir name="developertoolbar"><file name="toolbar.phtml" hash="28bb1b032cc255e17beb0cd6c1cc79f6"/></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="HM"><dir name="DeveloperToolbar"><dir name="controllers"><file name="IndexController.php" hash="9b51ca0d357576b3ba0c892c39cab231"/></dir><dir name="etc"><file name="config.xml" hash="88dccd6de1a371868366e88d2b46e457"/><file name="system.xml" hash="d3a464b2dafd444f734c948f4c8e43b8"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="HM_DeveloperToolbar.xml" hash="08f56679bb2ba0892395f48520b0c09a"/></dir></target></contents>
 
 
16
  <compatible/>
17
- <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>HM_DeveloperToolbar</name>
4
+ <version>2.0.7</version>
5
  <stability>stable</stability>
6
+ <license>Free</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Magento Developer Toolbar</summary>
10
+ <description>Developer Toolbar is an useful tool for magento developer. It allows you access quickly to regular used functions without logging in to admin. Specially, the version 2 allows admin to set store offline for maintenance by just one click.</description>
11
+ <notes>+ New design&#xD;
12
+ + More features&#xD;
13
+ + Store Offline</notes>
14
+ <authors><author><name>Mage World</name><user>mageworld</user><email>haint@mage-world.com</email></author></authors>
15
+ <date>2012-07-25</date>
16
+ <time>15:35:32</time>
17
+ <contents><target name="magelocal"><dir name="MW"><dir name="Developertoolbar"><dir><dir name="Block"><file name="Switch.php" hash="47e821512222d73eb4af3b4163319e08"/></dir><dir name="Controller"><dir name="Router"><file name="Standard.php" hash="f08f537d1b2778712ec6fc39e898efb5"/></dir></dir><dir name="Helper"><file name="Data.php" hash="3e491341aa8181aa076e5bd2d8fbea53"/></dir><dir name="controllers"><file name="IndexController.php" hash="a287df74723f1341c3de36f59fc9cb7b"/></dir><dir name="etc"><file name="config.xml" hash="7067330c640013332d47d00fc5cad480"/><file name="system.xml" hash="9ff6f01af6d0767a0081be6c7a5bc044"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="mw_developertoolbar.xml" hash="d79fafa6af77ddeb785e8fb307f8f8c8"/></dir><dir name="template"><dir name="mw_developertoolbar"><file name="devtool.phtml" hash="8d8e1c7ed429fa69ddaa1db7529976b2"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="MW_Developertoolbar.xml" hash="c5e31981fb0e3fc665cf291ba512c6fb"/></dir></target><target name="mage"><dir name="js"><dir name="mw_developertoolbar"><file name="jquery.js" hash="ca37b3a863ae3af5c59a3da4e115e60e"/><file name="popupdevtool.js" hash="1741390590ea5e9d2ade5c5757670769"/></dir><dir name="mw_js"><file name="jquery.js" hash="2f707d60838815edabe31a749ef6ff40"/><file name="jquery_noconflict.js" hash="afdd9b4ecb226d898fe655136f849752"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="mw_developertoolbar"><dir name="css"><file name="general.css" hash="29b9ff486ebb14577b9c11d4a076bcb9"/></dir><dir name="images"><file name="close_window.gif" hash="d164675bd43403dae70b0bf28640603e"/><file name="hide.gif" hash="7f174d5d119c76df7ad91afe95d15281"/><file name="show.gif" hash="7a801852174271879960a4111220c75c"/></dir></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
skin/frontend/default/default/mw_developertoolbar/css/general.css ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #mw_devtoolbar{
2
+ display:none;
3
+ position:fixed;
4
+ _position:absolute; /* hack for internet explorer 6*/
5
+ height:auto;
6
+ background:#FFFFFF;
7
+ z-index:999;
8
+ padding: 6px 9px 5px 12px;
9
+ font-size:12px;
10
+ border-top: 2px solid #000000;
11
+ border-right: 1px solid #F0F0F0;
12
+ box-shadow: 0 4px 10px #666666;
13
+ width: 245px;
14
+ }
15
+
16
+ #func_devtoolbar{position:relative;}
17
+ #hide_toolbar{position:absolute; right:16px; top:0;}
18
+ #show_toolbar{position:absolute; right:16px; top:2px;}
19
+
20
+ #func_devtoolbar li a{text-indent:-999em; width:13px; height:13px; display: block;}
21
+
22
+ #func_devtoolbar li a.min{background: url(../images/show.gif) center center no-repeat;}
23
+
24
+ #func_devtoolbar li a.max{background: url(../images/hide.gif) center center no-repeat; margin-top: -2px;}
25
+ #func_devtoolbar li a.min:hover{background: url(../images/hide.gif) center center no-repeat;}
26
+ #func_devtoolbar li a.max:hover{background: url(../images/show.gif) center center no-repeat;}
27
+
28
+ #mw_devtoolbar h1{
29
+ text-align:left;
30
+ color:#777777;
31
+ font-size:12px;
32
+ font-weight:700;
33
+ border-bottom:1px dotted #D3D3D3;
34
+ padding-bottom:6px;
35
+ line-height:12px;
36
+ }
37
+
38
+ #close_toolbar{
39
+ font-size:14px;
40
+ line-height:14px;
41
+ right:0;
42
+ top:0;
43
+ position:absolute;
44
+ color:#6fa5fd;
45
+ font-weight:700;
46
+ display:block;
47
+ height:13px;
48
+ width:13px;
49
+ }
50
+
51
+ #close_toolbar a.close{text-indent: -9999; background: url(../images/close_window.gif) center center no-repeat;
52
+ display: block;
53
+ text-indent: -9999em;
54
+ }
55
+
56
+ .content_toolbar{
57
+ line-height:17px;
58
+ margin-top:5px;
59
+ margin-bottom:2px;
60
+ text-align:left;
61
+ font-weight: bold;
62
+ }
63
+
64
+ .content_toolbar .en_dis{
65
+ font-weight: normal;
66
+ padding-left: 3px;
67
+ }
68
+ .clear_both{
69
+ clear:both;
70
+ height:1px;
71
+ display:block;
72
+ overflow: hidden;
73
+ }
74
+
75
+ .seperate_vertical_devtool {
76
+ color:#777777;
77
+ }
78
+
79
+ .mw_devtoolbar .menu_bottom{
80
+ margin-top:12px;
81
+ }
82
+ .store_all{line-height:22px;}
83
+ .store_all .en_dis{color:#000;}
84
+ #mw_devtoolbar .a{color:#000;}
85
+ .seperate_vertical_devtool_plus{color:#777777;}
86
+
87
+ .seperate_vertical_flush{
88
+ color:#777777;
89
+ margin-left:35px;
90
+ font-weight: normal;
91
+ }
92
+
93
+
94
+ .bottom_devtoolbar{
95
+ border-top: 1px dotted #D3D3D3;
96
+ font-size: 11px;
97
+ line-height: 22px;
98
+ margin-bottom: -2px;
99
+ margin-top: 4px;
100
+ text-align: right;
101
+ width: 100%;
102
+
103
+ }
skin/frontend/default/default/mw_developertoolbar/images/close_window.gif ADDED
Binary file
skin/frontend/default/default/mw_developertoolbar/images/hide.gif ADDED
Binary file
skin/frontend/default/default/mw_developertoolbar/images/show.gif ADDED
Binary file