Etatvasoft_Product_File_Attachment - Version 1.1.0

Version Notes

Easily attach additional downloadable files of any extension to your Magento products. This module helps to customers for download files, manuals, media files, audio files and other.
Using this extension admin can attach various types of files to store, so customers can download that files. This extension adds separate tab into the product add/edit page so admin can attach any product specific files.
Admin can set the title

Download this release

Release Info

Developer Etatvasoft
Extension Etatvasoft_Product_File_Attachment
Version 1.1.0
Comparing to
See all releases


Version 1.1.0

Files changed (53) hide show
  1. app/code/local/Tatva/Files/Block/Catalog/Product/Edit/Tab/File.php +93 -0
  2. app/code/local/Tatva/Files/Block/Catalog/Product/Edit/Tab/Sample.php +170 -0
  3. app/code/local/Tatva/Files/Block/Catalog/Product/Edit/Tabs.php +31 -0
  4. app/code/local/Tatva/Files/Block/Product/View.php +23 -0
  5. app/code/local/Tatva/Files/Helper/Data.php +5 -0
  6. app/code/local/Tatva/Files/Model/Files.php +33 -0
  7. app/code/local/Tatva/Files/Model/Mysql4/Files.php +9 -0
  8. app/code/local/Tatva/Files/Model/Mysql4/Files/Collection.php +28 -0
  9. app/code/local/Tatva/Files/Model/System/Config/Source/Dropdown/Values.php +21 -0
  10. app/code/local/Tatva/Files/controllers/Adminhtml/Downloadable/FileController.php +60 -0
  11. app/code/local/Tatva/Files/controllers/Catalog/ProductController.php +256 -0
  12. app/code/local/Tatva/Files/controllers/IndexController.php +64 -0
  13. app/code/local/Tatva/Files/etc/adminhtml.xml +25 -0
  14. app/code/local/Tatva/Files/etc/config.xml +120 -0
  15. app/code/local/Tatva/Files/etc/system.xml +164 -0
  16. app/code/local/Tatva/Files/sql/files_setup/mysql4-install-0.1.0.php +25 -0
  17. app/code/local/Tatva/Files/sql/files_setup/mysql4-upgrade-0.1.0-0.1.1.php +12 -0
  18. app/code/local/Tatva/Files/sql/files_setup/mysql4-upgrade-0.1.1-0.1.2.php +10 -0
  19. app/design/adminhtml/default/default/template/catalog/product/edit/files.phtml +274 -0
  20. app/design/adminhtml/default/default/template/catalog/product/edit/files/sample.phtml +213 -0
  21. app/design/frontend/default/default/layout/files/files.xml +8 -0
  22. app/design/frontend/default/default/template/files/files.phtml +68 -0
  23. app/etc/modules/Tatva_Files.xml +10 -0
  24. media/file_type_icons/3gp.png +0 -0
  25. media/file_type_icons/avi.png +0 -0
  26. media/file_type_icons/bmp.png +0 -0
  27. media/file_type_icons/default.png +0 -0
  28. media/file_type_icons/doc.png +0 -0
  29. media/file_type_icons/docx.png +0 -0
  30. media/file_type_icons/flv.png +0 -0
  31. media/file_type_icons/gif.png +0 -0
  32. media/file_type_icons/jpeg.png +0 -0
  33. media/file_type_icons/jpg.png +0 -0
  34. media/file_type_icons/mp3.png +0 -0
  35. media/file_type_icons/mp4.png +0 -0
  36. media/file_type_icons/odf.png +0 -0
  37. media/file_type_icons/odt.png +0 -0
  38. media/file_type_icons/pdf.png +0 -0
  39. media/file_type_icons/png.png +0 -0
  40. media/file_type_icons/ppt.png +0 -0
  41. media/file_type_icons/pptx.png +0 -0
  42. media/file_type_icons/psd.png +0 -0
  43. media/file_type_icons/rar.png +0 -0
  44. media/file_type_icons/sql.png +0 -0
  45. media/file_type_icons/swf.png +0 -0
  46. media/file_type_icons/tiff.png +0 -0
  47. media/file_type_icons/txt.png +0 -0
  48. media/file_type_icons/xls.png +0 -0
  49. media/file_type_icons/xlsx.png +0 -0
  50. media/file_type_icons/zip.png +0 -0
  51. package.xml +22 -0
  52. skin/adminhtml/default/default/js/product_files/jquery-1.10.2.min.js +3348 -0
  53. skin/frontend/default/default/css/files.css +15 -0
app/code/local/Tatva/Files/Block/Catalog/Product/Edit/Tab/File.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Files_Block_Catalog_Product_Edit_Tab_File extends Mage_Adminhtml_Block_Widget implements Mage_Adminhtml_Block_Widget_Tab_Interface
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setTemplate('catalog/product/edit/files.phtml');
8
+ }
9
+
10
+ public function getProduct()
11
+ {
12
+ return Mage::registry('current_product');
13
+ }
14
+ public function isReadonly()
15
+ {
16
+ return false;
17
+ }
18
+ /**
19
+ * Get tab label
20
+ *
21
+ * @return string
22
+ */
23
+ public function getTabLabel()
24
+ {
25
+ return Mage::helper('files')->__('Upload Files');
26
+ }
27
+
28
+ /**
29
+ * Get tab title
30
+ *
31
+ * @return string
32
+ */
33
+ public function getTabTitle()
34
+ {
35
+ return Mage::helper('files')->__('Product Files Information');
36
+ }
37
+
38
+ /**
39
+ * Check if tab can be displayed
40
+ *
41
+ * @return boolean
42
+ */
43
+ public function canShowTab()
44
+ {
45
+ return true;
46
+ }
47
+
48
+ /**
49
+ * Check if tab is hidden
50
+ *
51
+ * @return boolean
52
+ */
53
+ public function isHidden()
54
+ {
55
+ return false;
56
+ }
57
+
58
+ /**
59
+ * Render block HTML
60
+ *
61
+ * @return string
62
+ */
63
+ protected function _toHtml()
64
+ {
65
+ $accordion = $this->getLayout()->createBlock('adminhtml/widget_accordion')
66
+ ->setId('documentsInfo');
67
+
68
+ if(Mage::getStoreConfig('files/files/status'))
69
+ {
70
+ $accordion->addItem('uploads', array(
71
+ 'title' => Mage::helper('files')->__('Upload File'),
72
+ 'content' => $this->getLayout()
73
+ ->createBlock('files/catalog_product_edit_tab_sample')->toHtml(),
74
+ 'open' => true,
75
+ ));
76
+
77
+
78
+ }
79
+ else
80
+ {
81
+ $accordion->addItem('nouploadmessage', array(
82
+ 'title' => Mage::helper('files')->__('Uploading Disabled'),
83
+ 'content' => '<div style="margin:20px 30px;"><b>Uploading functionality is currently disabled. <u>To enable file uploading</u> go to Upload Product Files Setting in System Configuration and set "Allow Product File Uploads" field to Yes.</b></div>',
84
+ 'open' => true,
85
+ ));
86
+
87
+ }
88
+ $this->setChild('accordion', $accordion);
89
+
90
+ return parent::_toHtml();
91
+ }
92
+
93
+ }
app/code/local/Tatva/Files/Block/Catalog/Product/Edit/Tab/Sample.php ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Files_Block_Catalog_Product_Edit_Tab_Sample extends Mage_Adminhtml_Block_Widget
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setTemplate('catalog/product/edit/files/sample.phtml');
8
+ }
9
+
10
+ public function getProduct()
11
+ {
12
+ return Mage::registry('current_product');
13
+ }
14
+
15
+ /**
16
+ * Check block is readonly
17
+ *
18
+ * @return boolean
19
+ */
20
+ public function isReadonly()
21
+ {
22
+ return false;
23
+ }
24
+
25
+
26
+ /**
27
+ * Retrieve Add Button HTML
28
+ *
29
+ * @return string
30
+ */
31
+ public function getAddButtonHtml()
32
+ {
33
+ $addButton = $this->getLayout()->createBlock('adminhtml/widget_button')
34
+ ->setData(array(
35
+ 'label' => Mage::helper('files')->__('Add New File'),
36
+ 'id' => 'add_sample_item',
37
+ 'class' => 'add',
38
+ ));
39
+ return $addButton->toHtml();
40
+ }
41
+
42
+ /**
43
+ * Retrieve samples array
44
+ *
45
+ * @return array
46
+ */
47
+ public function getSampleData()
48
+ {
49
+ $samplesArr = array();
50
+ $model= Mage::getModel('files/files')->getProductFilesData($this->getProduct()->getId());
51
+
52
+ foreach ($model->getData() as $item=>$value)
53
+ {
54
+ $tmpSampleItem = array(
55
+ 'sample_id' => $value['file_id'],
56
+ 'title' => $value['file_title'],
57
+ 'sample_url' => 'sample_url',
58
+ 'sample_type' => 'file',
59
+ 'sort_order' => $value['file_sortorder'],
60
+ );
61
+ $path=Mage::getBaseDir('media').DS.'product_custom_files';
62
+ $file = Mage::helper('downloadable/file')->getFilePath(
63
+ $path, $value['prod_file']
64
+ );
65
+ if ($value['prod_file'] && !is_file($file)) {
66
+ Mage::helper('core/file_storage_database')->saveFileToFilesystem($file);
67
+ }
68
+ if ($value['prod_file'] && is_file($file)) {
69
+ $tmpSampleItem['file_save'] = array(
70
+ array(
71
+ 'file' => $value['prod_file'],
72
+ 'name' => Mage::helper('downloadable/file')->getFileFromPathFile($value['prod_file']),
73
+ 'size' => filesize($file),
74
+ 'status' => 'old'
75
+ ));
76
+ }
77
+ if ($this->getProduct() && $value['file_title']) {
78
+ $tmpSampleItem['store_title'] = $value['file_title'];
79
+ }
80
+ $samplesArr[] = new Varien_Object($tmpSampleItem);
81
+ }
82
+
83
+ return $samplesArr;
84
+ }
85
+
86
+ /**
87
+ * Check exists defined samples title
88
+ *
89
+ * @return bool
90
+ */
91
+ public function getUsedDefault()
92
+ {
93
+ return $this->getProduct()->getAttributeDefaultValue('samples_title') === false;
94
+ }
95
+
96
+ /**
97
+ * Retrieve Default samples title
98
+ *
99
+ * @return string
100
+ */
101
+ public function getSamplesTitle()
102
+ {
103
+ return Mage::getStoreConfig(Mage_Downloadable_Model_Sample::XML_PATH_SAMPLES_TITLE);
104
+ }
105
+
106
+ /**
107
+ * Prepare layout
108
+ *
109
+ */
110
+ protected function _prepareLayout()
111
+ {
112
+ $this->setChild(
113
+ 'upload_button',
114
+ $this->getLayout()->createBlock('adminhtml/widget_button')
115
+ ->addData(array(
116
+ 'id' => '',
117
+ 'label' => Mage::helper('adminhtml')->__('Upload Files'),
118
+ 'type' => 'button',
119
+ 'onclick' => 'Downloadable.massUploadByType(\'samples\')'
120
+ ))
121
+ );
122
+ }
123
+
124
+ /**
125
+ * Retrieve Upload button HTML
126
+ *
127
+ * @return string
128
+ */
129
+ public function getUploadButtonHtml()
130
+ {
131
+ return $this->getChild('upload_button')->toHtml();
132
+ }
133
+
134
+ /**
135
+ * Retrive config json
136
+ *
137
+ * @return string
138
+ */
139
+ public function getConfigJson()
140
+ {
141
+ $this->getConfig()->setUrl(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/downloadable_file/uploadfile', array('_secure' => true)));
142
+ $this->getConfig()->setParams(array('form_key' => $this->getFormKey()));
143
+ $this->getConfig()->setFileField('samples');
144
+ $this->getConfig()->setFilters(array(
145
+ 'all' => array(
146
+ 'label' => Mage::helper('adminhtml')->__('All Files'),
147
+ 'files' => array('*.*')
148
+ )
149
+ ));
150
+ $this->getConfig()->setReplaceBrowseWithRemove(true);
151
+ $this->getConfig()->setWidth('32');
152
+ $this->getConfig()->setHideUploadButton(true);
153
+ return Mage::helper('core')->jsonEncode($this->getConfig()->getData());
154
+ }
155
+
156
+ /**
157
+ * Retrive config object
158
+ *
159
+ * @return Varien_Config
160
+ */
161
+ public function getConfig()
162
+ {
163
+ if(is_null($this->_config)) {
164
+ $this->_config = new Varien_Object();
165
+ }
166
+
167
+ return $this->_config;
168
+ }
169
+
170
+ }
app/code/local/Tatva/Files/Block/Catalog/Product/Edit/Tabs.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Files_Block_Catalog_Product_Edit_Tabs extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ }
8
+ /**
9
+ * Add tab under Product Information section
10
+ * Tab will not be added of product type is 'Downloadable'
11
+ * Tab name : 'Product Files'
12
+ */
13
+ protected function _prepareLayout()
14
+ {
15
+ parent::_prepareLayout();
16
+ if(Mage::registry('current_product')->getTypeID()!='downloadable')
17
+ {
18
+ $product = $this->getProduct();
19
+ if (!($setId = $product->getAttributeSetId())) {
20
+ $setId = $this->getRequest()->getParam('set', null);
21
+ }
22
+ if ($setId) {
23
+ $this->addTab('files', array(
24
+ 'label' => Mage::helper('files')->__('Product Files'),
25
+ 'content' => $this->getLayout()
26
+ ->createBlock('files/catalog_product_edit_tab_file')->_toHtml(),
27
+ ));
28
+ }
29
+ }
30
+ }
31
+ }
app/code/local/Tatva/Files/Block/Product/View.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Files_Block_Product_View extends Mage_Catalog_Block_Product_View
3
+ {
4
+ /** Convert file size
5
+ * to readable format
6
+ * @param : file size in bytes
7
+ * output : depending on size output will be in B,KB or MB.
8
+ */
9
+ public function getModifiedFileSize($size)
10
+ {
11
+ $divCount=0;
12
+ while($size>1024.00)
13
+ {
14
+ $size=(float)$size/1024;
15
+ $divCount++;
16
+ }
17
+ if($divCount==0){$sizeAppend=" B ";}
18
+ else if($divCount==1){$sizeAppend=" KB ";}
19
+ else if($divCount==2){$sizeAppend=" MB ";}
20
+ $size=round($size, 2).$sizeAppend;
21
+ return $size;
22
+ }
23
+ }
app/code/local/Tatva/Files/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Files_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
app/code/local/Tatva/Files/Model/Files.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Files_Model_Files extends Mage_Core_Model_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init('files/files');
8
+ }
9
+
10
+ public function getProductFilesData($productId)
11
+ {
12
+ $collection = Mage::getModel('files/files')->getCollection()
13
+ ->addFieldToFilter('prod_id',$productId);
14
+
15
+ return $collection;
16
+ }
17
+
18
+ /**
19
+ * Get file collection for Frontend in sorted manner
20
+ */
21
+ public function getFileCollection($productId)
22
+ {
23
+ $sortBy=Mage::getStoreConfig('files/files/linkssortby');
24
+ $sortOrder='DESC';
25
+ if($sortBy=='file_sortorder')
26
+ $sortOrder='ASC';
27
+ $collection = Mage::getModel('files/files')->getCollection()
28
+ ->addFieldToFilter('prod_id',$productId)
29
+ ->setOrder($sortBy, $sortOrder);
30
+
31
+ return $collection;
32
+ }
33
+ }
app/code/local/Tatva/Files/Model/Mysql4/Files.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Files_Model_Mysql4_Files extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ // Note that the slider_id refers to the key field in your database table.
7
+ $this->_init('files/files', 'file_id');
8
+ }
9
+ }
app/code/local/Tatva/Files/Model/Mysql4/Files/Collection.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Files_Model_Mysql4_Files_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+
6
+ protected $_previewFlag;
7
+
8
+
9
+ public function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->_init('files/files');
13
+ }
14
+
15
+ public function orderBySort(){
16
+ $this->getSelect()->order('sortorder');
17
+ return $this;
18
+ }
19
+
20
+ /**
21
+ * Add Filter by store
22
+ *
23
+ * @param int|Mage_Core_Model_Store $store Store to be filtered
24
+ * @return Tatva_Slider_Model_Mysql4_Slider_Collection Self
25
+ */
26
+
27
+
28
+ }
app/code/local/Tatva/Files/Model/System/Config/Source/Dropdown/Values.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Files_Model_System_Config_Source_Dropdown_Values
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array(
8
+ 'value' => 'file_sortorder',
9
+ 'label' => 'File sort-order(default)',
10
+ ),
11
+ array(
12
+ 'value' => 'file_downloads',
13
+ 'label' => 'Download count',
14
+ ),
15
+ array(
16
+ 'value' => 'file_size',
17
+ 'label' => 'File size',
18
+ ),
19
+ );
20
+ }
21
+ }
app/code/local/Tatva/Files/controllers/Adminhtml/Downloadable/FileController.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once 'Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php';
3
+
4
+ class Tatva_Files_Adminhtml_Downloadable_FileController extends Mage_Downloadable_Adminhtml_Downloadable_FileController
5
+ {
6
+ /**
7
+ * Upload file controller action
8
+ */
9
+ public function uploadfileAction()
10
+ {
11
+ $folderName=Mage::getBaseDir('media').DS.'product_custom_files';
12
+ $tmpPath = $folderName;
13
+ $result = array();
14
+ $allowedFormats=array();
15
+ $allowedFormats=Mage::getStoreConfig('files/files/formats');
16
+ $allowedFormats=explode(",",$allowedFormats);
17
+
18
+ try {
19
+ $uploader = new Mage_Core_Model_File_Uploader('samples');
20
+ $uploader->setAllowedExtensions($allowedFormats);
21
+ $uploader->setAllowRenameFiles(true);
22
+ $uploader->setAllowCreateFolders(true);
23
+ $uploader->setFilesDispersion(true);
24
+ $allowedFileSize=$_FILES['samples']['size'];
25
+ if($allowedFileSize > Mage::getStoreConfig('files/files/filesize'))
26
+ {
27
+ throw new Exception('File size exceeded.');
28
+ }
29
+ $result = $uploader->save($tmpPath);
30
+ if (isset($result['file'])) {
31
+ $fullPath = rtrim($tmpPath, DS) . DS . ltrim($result['file'], DS);
32
+ Mage::helper('core/file_storage_database')->saveFile($fullPath);
33
+
34
+ }
35
+
36
+ $result['cookie'] = array(
37
+ 'name' => session_name(),
38
+ 'value' => $this->_getSession()->getSessionId(),
39
+ 'lifetime' => $this->_getSession()->getCookieLifetime(),
40
+ 'path' => $this->_getSession()->getCookiePath(),
41
+ 'domain' => $this->_getSession()->getCookieDomain()
42
+ );
43
+ } catch (Exception $e) {
44
+ $result = array('error'=>$e->getMessage(), 'errorcode'=>$e->getCode());
45
+ }
46
+
47
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
48
+ }
49
+
50
+ /**
51
+ * Check admin permissions for this controller
52
+ *
53
+ * @return boolean
54
+ */
55
+ protected function _isAllowed()
56
+ {
57
+ return Mage::getSingleton('admin/session')->isAllowed('catalog/products');
58
+ }
59
+
60
+ }
app/code/local/Tatva/Files/controllers/Catalog/ProductController.php ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once 'Mage/Adminhtml/controllers/Catalog/ProductController.php';
3
+
4
+ class Tatva_Files_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController
5
+ {
6
+ /**
7
+ * Save product data action
8
+ * operation : add/edit/delete uploaded file(s) data to/from custom table 'files' for this product
9
+ */
10
+ public function saveAction()
11
+ {
12
+ $storeId = $this->getRequest()->getParam('store');
13
+ $redirectBack = $this->getRequest()->getParam('back', false);
14
+ $productId = $this->getRequest()->getParam('id');
15
+ $isEdit = (int)($this->getRequest()->getParam('id') != null);
16
+
17
+ $data = $this->getRequest()->getPost();
18
+
19
+ if ($data) {
20
+ if (!isset($data['product']['stock_data']['use_config_manage_stock'])) {
21
+ $data['product']['stock_data']['use_config_manage_stock'] = 0;
22
+ }
23
+ $product = $this->_initProductSave();
24
+
25
+ try {
26
+ $product->save();
27
+ $productId = $product->getId();
28
+
29
+ if(count($data['downloadable']['sample'])>0 && $product->getTypeID()!='downloadable')
30
+ {
31
+ foreach($data['downloadable']['sample'] as $currentFile)
32
+ {
33
+ $filesModel = Mage::getModel('files/files');
34
+
35
+ $fileInfo=$this->getFileName($currentFile['file']);
36
+ $fileDetails=explode(",",$fileInfo);
37
+ $fileExt=$this->getFileExtension($fileDetails[0]);
38
+ if($currentFile['is_delete']==null && $currentFile['sample_id']==0)
39
+ {
40
+ $filesModel->setProdId($productId)
41
+ ->setFileTitle($currentFile['title'])
42
+ ->setProdFile($fileDetails[0])
43
+ ->setFileType($fileExt)
44
+ ->setFileSize($fileDetails[1])
45
+ ->setFileSortorder($currentFile['sort_order'])
46
+ ->setFileCreation(date("Y-m-d H:i:s"))
47
+ ->setFileLastmodification(date("Y-m-d H:i:s"))
48
+ ->setFileTimestamp(time())
49
+ ->save();
50
+ }
51
+ else if($currentFile['is_delete']==null && $currentFile['sample_id']!=0)
52
+ {
53
+ $fileDetailsModificationFlag=$this->checkIfFileDetailsModified($currentFile['sample_id'],$currentFile['title'],$fileDetails[0],$currentFile['sort_order']);
54
+ $filesModel->load($currentFile['sample_id'])
55
+ ->setProdId($productId)
56
+ ->setFileTitle($currentFile['title'])
57
+ ->setProdFile($fileDetails[0])
58
+ ->setFileType($fileExt)
59
+ ->setFileSize($fileDetails[1])
60
+ ->setFileSortorder($currentFile['sort_order'])
61
+ ->save();
62
+
63
+ if($fileDetailsModificationFlag==0)
64
+ {
65
+ $filesModel->load($currentFile['sample_id'])
66
+ ->setFileLastmodification(date("Y-m-d H:i:s"))
67
+ ->save();
68
+ }
69
+ }
70
+ else if($currentFile['is_delete']==1 && $currentFile['sample_id']!=0)
71
+ {
72
+ $filesModel->setId($currentFile['sample_id'])->delete();
73
+ }
74
+ else if($currentFile['is_delete']==1 && $currentFile['sample_id']==0 && $currentFile['file']!='[]')
75
+ {
76
+ $filesModel->setId($currentFile['sample_id'])->delete();
77
+ $fileData = json_decode($currentFile['file']);
78
+ $fileDir = Mage::getBaseDir('media').DS."product_custom_files";
79
+ $fileDir.= $fileData[0]->file;
80
+ if(file_exists($fileDir))
81
+ {
82
+ unlink($fileDir);
83
+ }
84
+ }
85
+ $filesModel->unsetData();
86
+ sleep(1);
87
+ }
88
+ }
89
+ if (isset($data['copy_to_stores'])) {
90
+ foreach ($data['copy_to_stores'] as $storeTo=>$storeFrom) {
91
+ $newProduct = Mage::getModel('catalog/product')
92
+ ->setStoreId($storeFrom)
93
+ ->load($productId)
94
+ ->setStoreId($storeTo)
95
+ ->save();
96
+ }
97
+ }
98
+
99
+ //Mage::getModel('catalogrule/rule')->applyAllRulesToProduct($productId);
100
+
101
+ $this->_getSession()->addSuccess($this->__('The product has been saved.'));
102
+ } catch (Mage_Core_Exception $e) {
103
+ $this->_getSession()->addError($e->getMessage())
104
+ ->setProductData($data);
105
+ $redirectBack = true;
106
+ } catch (Exception $e) {
107
+ Mage::logException($e);
108
+ $this->_getSession()->addError($e->getMessage());
109
+ $redirectBack = true;
110
+ }
111
+ }
112
+
113
+ if ($redirectBack) {
114
+ $this->_redirect('*/*/edit', array(
115
+ 'id' => $productId,
116
+ '_current'=>true
117
+ ));
118
+ } elseif($this->getRequest()->getParam('popup')) {
119
+ $this->_redirect('*/*/created', array(
120
+ '_current' => true,
121
+ 'id' => $productId,
122
+ 'edit' => $isEdit
123
+ ));
124
+ } else {
125
+ $this->_redirect('*/*/', array('store'=>$storeId));
126
+ }
127
+ }
128
+
129
+ /**
130
+ * Duplicate product data action
131
+ * operation : Copy and insert uploaded file(s) data to custom table 'files' for this product
132
+ */
133
+ public function duplicateAction()
134
+ {
135
+ $product = $this->_initProduct();
136
+ try
137
+ {
138
+ $newProduct = $product->duplicate();
139
+ if($product->getTypeID()!='downloadable')
140
+ {
141
+ $productFiles = Mage::getModel('files/files')->getCollection()
142
+ ->addFieldToFilter('prod_id',$product->getId());
143
+ $filesModel = Mage::getModel('files/files');
144
+
145
+ foreach($productFiles->getData() as $currentFile)
146
+ {
147
+
148
+ $filesModel->setProdId($newProduct->getId())
149
+ ->setFileTitle($currentFile['file_title'])
150
+ ->setProdFile($currentFile['prod_file'])
151
+ ->setFileType($currentFile['file_type'])
152
+ ->setFileSize($currentFile['file_size'])
153
+ ->setFileSortorder($currentFile['file_sortorder'])
154
+ ->setFileCreation(date("Y-m-d H:i:s"))
155
+ ->setFileLastmodification(date("Y-m-d H:i:s"))
156
+ ->setFileTimestamp(time())
157
+ ->save();
158
+ $filesModel->unsetData();
159
+ }
160
+ }
161
+ $this->_getSession()->addSuccess($this->__('The product has been duplicated.'));
162
+ $this->_redirect('*/*/edit', array('_current'=>true, 'id'=>$newProduct->getId()));
163
+ } catch (Exception $e) {
164
+ Mage::logException($e);
165
+ $this->_getSession()->addError($e->getMessage());
166
+ $this->_redirect('*/*/edit', array('_current'=>true));
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Get file name from string pattern
172
+ */
173
+ protected function getFileName($string)
174
+ {
175
+ $tempString = substr($string, 2);
176
+ $arr1=array();
177
+ $arr1 = explode("}",$tempString);
178
+ $arr2=array();
179
+ $arr2=explode(",",$arr1[0]);
180
+ $dataArray=explode(":",$arr2[0]);
181
+ $fileName=$dataArray[1];
182
+
183
+ $charPosition= strpos($fileName, "\"");
184
+ $fileName=substr($fileName,$charPosition+1);
185
+
186
+ $arr3=array();
187
+ $arr3 = explode("\"",$fileName);
188
+ $fileName=$arr3[0];
189
+ $dataArray=explode(":",$arr2[2]);
190
+ $fileSize=$dataArray[1];
191
+ $fileInfo=$fileName.",".$fileSize;
192
+
193
+ return $fileInfo;
194
+ }
195
+
196
+ /**
197
+ * Get file extension from file name
198
+ * output : File extension
199
+ */
200
+ protected function getFileExtension($fileName)
201
+ {
202
+ $charPosition= strrpos($fileName, ".");
203
+ $fileExt=substr($fileName,$charPosition+1);
204
+ return $fileExt;
205
+ }
206
+
207
+ /**
208
+ * Check if this file's title,sort-order and/or file itself has been modified or not
209
+ * output : flag-> 0: modified , 1: not modified
210
+ */
211
+ protected function checkIfFileDetailsModified($fileId,$currentFileTitle,$currentFile,$currentFileSortorder)
212
+ {
213
+ $fileData = Mage::getModel('files/files')->getCollection()
214
+ ->addFieldToFilter('file_id',$fileId)
215
+ ->addFieldToSelect('file_title')
216
+ ->addFieldToSelect('prod_file')
217
+ ->addFieldToSelect('file_sortorder');
218
+ $savedDetails=$fileData->getData();
219
+
220
+ if(strcmp($currentFileTitle,$savedDetails[0]['file_title'])!=0)
221
+ return 0;
222
+ else if(strcmp($currentFile,$savedDetails[0]['prod_file'])!=0)
223
+ return 0;
224
+ else if($currentFileSortorder!=$savedDetails[0]['file_sortorder'])
225
+ return 0;
226
+
227
+ return 1;
228
+ }
229
+
230
+ /**
231
+ * Operations ::
232
+ * 1.Delete record frmom database ,
233
+ * 2.Physically deleting file
234
+ */
235
+ public function deleteRecordAction()
236
+ {
237
+ $fileDir = Mage::getBaseDir('media').DS."product_custom_files";
238
+
239
+ $fileId = $this->getRequest()->getParam('file_id');
240
+ $fileData = Mage::getModel('files/files')->getCollection()
241
+ ->addFieldToFilter('file_id',$fileId);
242
+ foreach($fileData as $file)
243
+ {
244
+ if($file!=null || $file->getData()!=null)
245
+ {
246
+ $fileDir.= $file->getProdFile();
247
+ if(file_exists($fileDir))
248
+ {
249
+ unlink($fileDir);
250
+ }
251
+ $file->delete();
252
+ }
253
+ }
254
+ }
255
+
256
+ }
app/code/local/Tatva/Files/controllers/IndexController.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Files_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ /**
5
+ * Function to handle request to download file for Files module
6
+ * @param : file_timestamp
7
+ * operation : increase file download count by 1
8
+ */
9
+ public function downloadAction()
10
+ {
11
+ $sampleId = $this->getRequest()->getParam('id', 0);
12
+ $sample = Mage::getModel('files/files')->load($sampleId, 'file_timestamp');
13
+ if ($sample->getId())
14
+ {
15
+ $resource = Mage::getBaseDir('media').DS.'product_custom_files'. $sample->getProdFile();
16
+ $resourceType = 'file';
17
+ try {
18
+ $this->_processDownload($sample,$resource, $resourceType);
19
+ $downloadCount=$sample->getFileDownloads();
20
+ Mage::getModel('files/files')->load($sample->getId())
21
+ ->setFileDownloads(++$downloadCount)
22
+ ->save();
23
+ exit(0);
24
+ } catch (Mage_Core_Exception $e) {
25
+ $this->_getSession()->addError(Mage::helper('files')->__('An error occurred while getting requested content. Please contact the store owner.'));
26
+ }
27
+ }
28
+ }
29
+ protected function _processDownload($sample,$resource, $resourceType)
30
+ {
31
+ $contentDisposition='product/files/content_disposition';
32
+ $fileName=$sample->getProdFile();
33
+ $charPosition= strrpos($fileName, "/");
34
+ $fileName=substr($fileName,$charPosition+1);
35
+ if (function_exists('mime_content_type')) {
36
+ $contentType = mime_content_type($fileName);
37
+ } else {
38
+ $contentType=$sample->getFileType();
39
+ }
40
+ $this->getResponse()
41
+ ->setHttpResponseCode(200)
42
+ ->setHeader('Pragma', 'public', true)
43
+ ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)
44
+ ->setHeader('Content-type', $contentType, true)
45
+ ->setHeader('Content-Length', $sample->getFileSize())
46
+ ->setHeader('Content-Disposition', $contentDisposition . '; filename='.$fileName);
47
+
48
+ $this->getResponse()
49
+ ->clearBody();
50
+ $this->getResponse()
51
+ ->sendHeaders();
52
+
53
+ $handle = new Varien_Io_File();
54
+ $handle->open(array('path'=>Mage::getBaseDir('var')));
55
+ if (!$handle->fileExists($resource, true)) {
56
+ Mage::throwException(Mage::helper('downloadable')->__('The file does not exist.'));
57
+ }
58
+ $handle->streamOpen($resource, 'r');
59
+
60
+ while ($buffer = $handle->streamRead()) {
61
+ print $buffer;
62
+ }
63
+ }
64
+ }
app/code/local/Tatva/Files/etc/adminhtml.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <all>
6
+ <title>Allow Everything</title>
7
+ </all>
8
+ <admin>
9
+ <children>
10
+ <system>
11
+ <children>
12
+ <config>
13
+ <children>
14
+ <files translate="title" module="files">
15
+ <title>Product Files Settings</title>
16
+ </files>
17
+ </children>
18
+ </config>
19
+ </children>
20
+ </system>
21
+ </children>
22
+ </admin>
23
+ </resources>
24
+ </acl>
25
+ </config>
app/code/local/Tatva/Files/etc/config.xml ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Tatva_Files>
5
+ <version>0.1.2</version>
6
+ </Tatva_Files>
7
+ </modules>
8
+ <admin>
9
+ <routers>
10
+ <adminhtml>
11
+ <args>
12
+ <modules>
13
+ <Tatva_Files before="Mage_Adminhtml">Tatva_Files</Tatva_Files>
14
+ <Tatva_Files_Adminhtml before="Mage_Downloadable">Tatva_Files_Adminhtml</Tatva_Files_Adminhtml>
15
+ </modules>
16
+ </args>
17
+ </adminhtml>
18
+ </routers>
19
+ </admin>
20
+ <frontend>
21
+ <routers>
22
+ <files>
23
+ <use>standard</use>
24
+ <args>
25
+ <module>Tatva_Files</module>
26
+ <frontName>files</frontName>
27
+ </args>
28
+ </files>
29
+ </routers>
30
+ <layout>
31
+ <updates>
32
+ <files>
33
+ <file>files/files.xml</file>
34
+ </files>
35
+ </updates>
36
+ </layout>
37
+ </frontend>
38
+ <global>
39
+ <blocks>
40
+ <files>
41
+ <class>Tatva_Files_Block</class>
42
+ </files>
43
+ <catalog>
44
+ <rewrite>
45
+ <product_view>Tatva_Files_Block_Product_View</product_view>
46
+ </rewrite>
47
+ </catalog>
48
+ <adminhtml>
49
+ <rewrite>
50
+ <catalog_product_edit_tabs>Tatva_Files_Block_Catalog_Product_Edit_Tabs</catalog_product_edit_tabs>
51
+ </rewrite>
52
+ </adminhtml>
53
+ </blocks>
54
+ <helpers>
55
+ <files>
56
+ <class>Tatva_Files_Helper</class>
57
+ </files>
58
+ </helpers>
59
+ <models>
60
+ <files>
61
+ <class>Tatva_Files_Model</class>
62
+ <resourceModel>files_mysql4</resourceModel>
63
+ </files>
64
+ <files_mysql4>
65
+ <class>Tatva_Files_Model_Mysql4</class>
66
+ <entities>
67
+ <files>
68
+ <table>files</table>
69
+ </files>
70
+ </entities>
71
+ </files_mysql4>
72
+ </models>
73
+ <resources>
74
+ <files_setup>
75
+ <setup>
76
+ <module>Tatva_Files</module>
77
+ </setup>
78
+ <connection>
79
+ <use>core_setup</use>
80
+ </connection>
81
+ </files_setup>
82
+ <files_write>
83
+ <connection>
84
+ <use>core_write</use>
85
+ </connection>
86
+ </files_write>
87
+ <files_read>
88
+ <connection>
89
+ <use>core_read</use>
90
+ </connection>
91
+ </files_read>
92
+ </resources>
93
+ </global>
94
+ <stores>
95
+ <admin>
96
+ <design>
97
+ <theme>
98
+ <default>tatva</default>
99
+ </theme>
100
+ </design>
101
+ </admin>
102
+ </stores>
103
+ <default>
104
+ <files>
105
+ <files>
106
+ <status>0</status>
107
+ <formats>3gp,avi,bmp,doc,docx,flv,gif,jpeg,jpg,mp3,mp4,odf,odt,pdf,png,ppt,pptx,psd,rar,sql,swf,tiff,txt,xls,xlsx,zip</formats>
108
+ <filesize>2000000</filesize>
109
+ <allowdownload>0</allowdownload>
110
+ <registerdownload>1</registerdownload>
111
+ <linkssortby></linkssortby>
112
+ <frontendlinks>3</frontendlinks>
113
+ <showimage>1</showimage>
114
+ <defaultimage>default</defaultimage>
115
+ <typeimageheight>20</typeimageheight>
116
+ <typeimagewidth>20</typeimagewidth>
117
+ </files>
118
+ </files>
119
+ </default>
120
+ </config>
app/code/local/Tatva/Files/etc/system.xml ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+ <config>
3
+ <tabs>
4
+ <tatva translate="label" module="files">
5
+ <label>Tatvasoft</label>
6
+ <sort_order>101</sort_order>
7
+ </tatva>
8
+ </tabs>
9
+ <sections>
10
+ <files translate="label" module="files">
11
+ <label>Product File Attachment Configuration</label>
12
+ <class>separator-top</class>
13
+ <tab>tatva</tab>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>30</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
+ <readme translate="label">
21
+ <label>Information for Developer</label>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>1</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+ <fields>
28
+ <information>
29
+ <label>The Code Snippet</label>
30
+ <comment>
31
+ <![CDATA[<strong>echo $this->getLayout()->createBlock('files/product_view')->setTemplate('files/files.phtml')->toHtml();</strong><br />Place it in product details page(view.phtml) of your theme]]>
32
+ </comment>
33
+ <frontend_type>label</frontend_type>
34
+ <sort_order>1</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
+ </information>
39
+ </fields>
40
+ </readme>
41
+ <files translate="label" module="files">
42
+ <label>Settings</label>
43
+ <frontend_type>text</frontend_type>
44
+ <sort_order>100</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ <fields>
49
+ <status translate="label" module="files">
50
+ <label>Allow Product File Uploads</label>
51
+ <frontend_type>select</frontend_type>
52
+ <source_model>adminhtml/system_config_source_yesno</source_model>
53
+ <sort_order>1</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>1</show_in_website>
56
+ <show_in_store>1</show_in_store>
57
+ </status>
58
+ <formats translate="label" module="files">
59
+ <label>Allowed File Types</label>
60
+ <frontend_type>textarea</frontend_type>
61
+ <depends><status>1</status></depends>
62
+ <sort_order>3</sort_order>
63
+ <show_in_default>1</show_in_default>
64
+ <show_in_website>1</show_in_website>
65
+ <show_in_store>1</show_in_store>
66
+ <comment>Add comma(,) between two file formats. i.e. jpg,pdf,txt</comment>
67
+ </formats>
68
+ <filesize translate="label" module="files">
69
+ <label>Max. File Size</label>
70
+ <frontend_type>text</frontend_type>
71
+ <validate>validate-digits validate-greater-than-zero</validate>
72
+ <depends><status>1</status></depends>
73
+ <sort_order>4</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>1</show_in_store>
77
+ <comment>in Bytes</comment>
78
+ </filesize>
79
+ <allowdownload translate="label" module="files">
80
+ <label>Allow Product File Downloads</label>
81
+ <frontend_type>select</frontend_type>
82
+ <source_model>adminhtml/system_config_source_yesno</source_model>
83
+ <sort_order>8</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ </allowdownload>
88
+ <registerdownload translate="label" module="files">
89
+ <label>Guest Download</label>
90
+ <frontend_type>select</frontend_type>
91
+ <source_model>adminhtml/system_config_source_yesno</source_model>
92
+ <sort_order>8</sort_order>
93
+ <show_in_default>1</show_in_default>
94
+ <show_in_website>1</show_in_website>
95
+ <show_in_store>1</show_in_store>
96
+ </registerdownload>
97
+ <linkssortby translate="label" module="files">
98
+ <label>Sort Links By</label>
99
+ <frontend_type>select</frontend_type>
100
+ <source_model>files/system_config_source_dropdown_values</source_model>
101
+ <depends><allowdownload>1</allowdownload></depends>
102
+ <sort_order>9</sort_order>
103
+ <show_in_default>1</show_in_default>
104
+ <show_in_website>1</show_in_website>
105
+ <show_in_store>1</show_in_store>
106
+ </linkssortby>
107
+ <frontendlinks translate="label" module="files">
108
+ <label>Number of Links to be displayed in Frontend</label>
109
+ <frontend_type>text</frontend_type>
110
+ <validate>validate-digits validate-greater-than-zero</validate>
111
+ <depends><allowdownload>1</allowdownload></depends>
112
+ <sort_order>10</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>1</show_in_store>
116
+ </frontendlinks>
117
+ <showimage translate="label" module="files">
118
+ <label>Display File Type Image</label>
119
+ <frontend_type>select</frontend_type>
120
+ <source_model>adminhtml/system_config_source_yesno</source_model>
121
+ <depends><allowdownload>1</allowdownload></depends>
122
+ <sort_order>11</sort_order>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>1</show_in_store>
126
+ </showimage>
127
+ <defaultimage translate="label" module="files">
128
+ <label>Default Image Name</label>
129
+ <frontend_type>text</frontend_type>
130
+ <depends><allowdownload>1</allowdownload><showimage>1</showimage></depends>
131
+ <sort_order>12</sort_order>
132
+ <comment>Write only name of image without its extension i.e baseimage</comment>
133
+ <show_in_default>1</show_in_default>
134
+ <show_in_website>1</show_in_website>
135
+ <show_in_store>1</show_in_store>
136
+ </defaultimage>
137
+ <typeimageheight translate="label" module="files">
138
+ <label>Image Height</label>
139
+ <frontend_type>text</frontend_type>
140
+ <validate>validate-digits validate-greater-than-zero</validate>
141
+ <depends><allowdownload>1</allowdownload><showimage>1</showimage></depends>
142
+ <sort_order>13</sort_order>
143
+ <comment>In pixels</comment>
144
+ <show_in_default>1</show_in_default>
145
+ <show_in_website>1</show_in_website>
146
+ <show_in_store>1</show_in_store>
147
+ </typeimageheight>
148
+ <typeimagewidth translate="label" module="files">
149
+ <label>Image Width</label>
150
+ <frontend_type>text</frontend_type>
151
+ <validate>validate-digits validate-greater-than-zero</validate>
152
+ <depends><allowdownload>1</allowdownload><showimage>1</showimage></depends>
153
+ <sort_order>14</sort_order>
154
+ <comment>In pixels</comment>
155
+ <show_in_default>1</show_in_default>
156
+ <show_in_website>1</show_in_website>
157
+ <show_in_store>1</show_in_store>
158
+ </typeimagewidth>
159
+ </fields>
160
+ </files>
161
+ </groups>
162
+ </files>
163
+ </sections>
164
+ </config>
app/code/local/Tatva/Files/sql/files_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->run("
6
+ DROP TABLE IF EXISTS {$this->getTable('files')};
7
+
8
+ CREATE TABLE {$this->getTable('files')} (
9
+ file_id int(11) NOT NULL AUTO_INCREMENT,
10
+ prod_id int(10) UNSIGNED NOT NULL,
11
+ file_title text NOT NULL ,
12
+ prod_file varchar(255) NOT NULL,
13
+ file_type varchar(10) NOT NULL ,
14
+ file_size int(15) NOT NULL ,
15
+ file_sortorder int(5) NOT NULL,
16
+ PRIMARY KEY (file_id)
17
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
18
+
19
+ ALTER TABLE {$this->getTable('files')}
20
+ ADD
21
+ CONSTRAINT `FK_FILES_PROD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`prod_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
22
+
23
+ ");
24
+
25
+ $installer->endSetup();
app/code/local/Tatva/Files/sql/files_setup/mysql4-upgrade-0.1.0-0.1.1.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->run("
6
+ ALTER TABLE {$this->getTable('files')}
7
+ ADD COLUMN file_downloads INT(10) NOT NULL ,
8
+ ADD COLUMN file_creation DATETIME,
9
+ ADD COLUMN file_lastmodification DATETIME
10
+ ");
11
+
12
+ $installer->endSetup();
app/code/local/Tatva/Files/sql/files_setup/mysql4-upgrade-0.1.1-0.1.2.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->run("
6
+ ALTER TABLE {$this->getTable('files')}
7
+ ADD COLUMN file_timestamp BIGINT(10)
8
+ ");
9
+
10
+ $installer->endSetup();
app/design/adminhtml/default/default/template/catalog/product/edit/files.phtml ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-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 design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php
29
+ /**
30
+ * @see Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable
31
+ */
32
+ ?>
33
+ <script type="text/javascript">
34
+ //<![CDATA[>
35
+
36
+ var uploaderTemplate = '<div class="no-display" id="[[idName]]-template">' +
37
+ '<div id="{{id}}" class="file-row file-row-narrow">' +
38
+ '<span class="file-info">' +
39
+ '<span class="file-info-name">{{name}}</span>' +
40
+ ' ' +
41
+ '<span class="file-info-size">({{size}})</span>' +
42
+ '</span>' +
43
+ '<span class="progress-text"></span>' +
44
+ '<div class="clear"></div>' +
45
+ '</div>' +
46
+ '</div>' +
47
+ '<div class="no-display" id="[[idName]]-template-progress">' +
48
+ '{{percent}}% {{uploaded}} / {{total}}' +
49
+ '</div>';
50
+
51
+ var fileListTemplate = '<span class="file-info">' +
52
+ '<span class="file-info-name">{{name}}</span>' +
53
+ ' ' +
54
+ '<span class="file-info-size">({{size}})</span>' +
55
+ '</span>';
56
+
57
+ var Downloadable = {
58
+ uploaderObj : $H({}),
59
+ objCount : 0,
60
+ setUploaderObj : function(type, key, obj){
61
+ if (!this.uploaderObj.get(type)) {
62
+ this.uploaderObj.set(type, $H({}));
63
+ }
64
+ this.uploaderObj.get(type).set(key, obj);
65
+ },
66
+ getUploaderObj : function(type, key){
67
+ try {
68
+ return this.uploaderObj.get(type).get(key);
69
+ } catch (e) {
70
+ try {
71
+ console.log(e);
72
+ } catch (e2) {
73
+ alert(e.name + '\n' + e.message);
74
+ }
75
+ }
76
+ },
77
+ unsetUploaderObj : function(type, key){
78
+ try {
79
+ this.uploaderObj.get(type).unset(key);
80
+ } catch (e) {
81
+ try {
82
+ console.log(e);
83
+ } catch (e2) {
84
+ alert(e.name + '\n' + e.message);
85
+ }
86
+ }
87
+ },
88
+ massUploadByType : function(type){
89
+ try {
90
+ this.uploaderObj.get(type).each(function(item){
91
+ container = item.value.container.up('tr');
92
+ if (container.visible() && !container.hasClassName('no-display')) {
93
+ item.value.upload();
94
+ } else {
95
+ Downloadable.unsetUploaderObj(type, item.key);
96
+ }
97
+ });
98
+ } catch (e) {
99
+ try {
100
+ console.log(e);
101
+ } catch (e2) {
102
+ alert(e.name + '\n' + e.message);
103
+ }
104
+ }
105
+ }
106
+ };
107
+
108
+ Downloadable.FileUploader = Class.create();
109
+ Downloadable.FileUploader.prototype = {
110
+ type : null,
111
+ key : null, //key, identifier of uploader obj
112
+ elmContainer : null, //insert Flex object and templates to elmContainer
113
+ fileValueName : null, //name of field of JSON data of saved file
114
+ fileValue : null,
115
+ idName : null, //id name of elements for unique uploader
116
+ uploaderText: uploaderTemplate,
117
+ uploaderSyntax : /(^|.|\r|\n)(\[\[(\w+)\]\])/,
118
+ uploaderObj : $H({}),
119
+ config : null,
120
+ initialize: function (type, key, elmContainer, fileValueName, fileValue ,idName, config) {
121
+ this.type = type;
122
+ this.key = key;
123
+ this.elmContainer = elmContainer;
124
+ this.fileValueName = fileValueName;
125
+ this.fileValue = fileValue;
126
+ this.idName = idName;
127
+ this.config = config;
128
+ uploaderTemplate = new Template(this.uploaderText, this.uploaderSyntax);
129
+ <?php if (!$this->isReadonly()):?>
130
+ Element.insert(
131
+ elmContainer,
132
+ {'top' : uploaderTemplate.evaluate({
133
+ 'idName' : this.idName,
134
+ 'fileValueName' : this.fileValueName,
135
+ 'uploaderObj' : 'Downloadable.getUploaderObj(\''+this.type+'\', \''+this.key+'\')'
136
+ })
137
+ }
138
+ );
139
+ if ($(this.idName+'_save')) {
140
+ $(this.idName+'_save').value = this.fileValue.toJSON
141
+ ? this.fileValue.toJSON()
142
+ : Object.toJSON(this.fileValue);
143
+ }
144
+ Downloadable.setUploaderObj(
145
+ this.type,
146
+ this.key,
147
+ new Flex.Uploader(this.idName, '<?php echo $this->getSkinUrl('media/uploaderSingle.swf') ?>', this.config)
148
+ );
149
+ if (varienGlobalEvents) {
150
+ varienGlobalEvents.attachEventHandler('tabChangeBefore', Downloadable.getUploaderObj(type, key).onContainerHideBefore);
151
+ }
152
+ new Downloadable.FileList(this.idName, Downloadable.getUploaderObj(type, key));
153
+ <?php endif;?>
154
+ }
155
+ }
156
+
157
+ Downloadable.FileList = Class.create();
158
+ Downloadable.FileList.prototype = {
159
+ file: [],
160
+ containerId: '',
161
+ container: null,
162
+ uploader: null,
163
+ fileListTemplate: fileListTemplate,
164
+ templatePattern : /(^|.|\r|\n)({{(\w+)}})/,
165
+ listTemplate : null,
166
+ initialize: function (containerId, uploader) {
167
+ this.containerId = containerId,
168
+ this.container = $(this.containerId);
169
+ this.uploader = uploader;
170
+ this.uploader.onFilesComplete = this.handleUploadComplete.bind(this);
171
+ this.file = this.getElement('save').value.evalJSON();
172
+ this.listTemplate = new Template(this.fileListTemplate, this.templatePattern);
173
+ this.updateFiles();
174
+ this.uploader.onFileRemoveAll = this.handleFileRemoveAll.bind(this);
175
+ this.uploader.onFileSelect = this.handleFileSelect.bind(this);
176
+ },
177
+ handleFileRemoveAll: function(fileId) {
178
+ $(this.containerId+'-new').hide();
179
+ $(this.containerId+'-old').show();
180
+ },
181
+ handleFileSelect: function() {
182
+ $(this.containerId+'_type').checked = true;
183
+ },
184
+ getElement: function (name) {
185
+ return $(this.containerId + '_' + name);
186
+ },
187
+ handleUploadComplete: function (files) {
188
+ files.each(function(item) {
189
+ item.response = item.response.toString().replace(new RegExp(/\\/g),"/");
190
+ if (!item.response.isJSON()) {
191
+ try {
192
+ console.log(item.response);
193
+ } catch (e2) {
194
+ alert(item.response);
195
+ }
196
+ return;
197
+ }
198
+ var response = item.response.evalJSON();
199
+ if (response.error) {
200
+ return;
201
+ }
202
+ var newFile = {};
203
+ newFile.file = response.file;
204
+ newFile.name = response.name;
205
+ newFile.size = response.size;
206
+ newFile.status = 'new';
207
+ this.file[0] = newFile;
208
+ this.uploader.removeFile(item.id);
209
+ }.bind(this));
210
+ this.updateFiles();
211
+ },
212
+ updateFiles: function() {
213
+ this.getElement('save').value = this.file.toJSON
214
+ ? this.file.toJSON()
215
+ : Object.toJSON(this.file);
216
+ this.file.each(function(row){
217
+ row.size = this.uploader.formatSize(row.size);
218
+ $(this.containerId + '-old').innerHTML = this.listTemplate.evaluate(row);
219
+ $(this.containerId + '-new').hide();
220
+ $(this.containerId + '-old').show();
221
+ }.bind(this));
222
+ }
223
+ }
224
+
225
+ var alertAlreadyDisplayed = false;
226
+
227
+ Validation.addAllThese([
228
+ ['validate-downloadable-file', 'Please upload a file.', function(v,element) {
229
+ linkType = element.up(0).down('input[value="file"]');
230
+ if (linkType.checked && (v == '' || v == '[]')) {
231
+ newFileContainer = element.up(0).down('div.new-file');
232
+ if (!alertAlreadyDisplayed && (newFileContainer.empty() || newFileContainer.style.display != 'none')) {
233
+ alertAlreadyDisplayed = true;
234
+ alert('<?php echo $this->jsQuoteEscape($this->__('There are files that were selected but not uploaded yet. Please upload or remove them first'));?>');
235
+ }
236
+ return false;
237
+ }
238
+ return true;
239
+ }]
240
+ ]);
241
+
242
+ Validation.addAllThese([
243
+ ['validate-downloadable-url', 'Please specify Url.', function(v,element) {
244
+ linkType = element.up(0).down('input[value="url"]');
245
+ if (linkType.checked && v == '') {
246
+ return false;
247
+ }
248
+ return true;
249
+ }]
250
+ ]);
251
+ //]]>
252
+ </script>
253
+
254
+ <div id="alert_messages_block"><?php echo $this->getMessageHtml() ?></div>
255
+
256
+ <div class="entry-edit">
257
+ <?php echo $this->getChildHtml('accordion') ?>
258
+ </div>
259
+ <div style="display:none">
260
+ <div id="custom-advice-container"></div>
261
+ </div>
262
+ <?php if ($this->isReadonly()): ?>
263
+ <script type="text/javascript">
264
+ $('downloadableInfo').select('input', 'select', 'textarea', 'button').each(function (item){
265
+ item.disabled = true;
266
+ if (item.tagName.toLowerCase() == 'button') {
267
+ item.addClassName('disabled');
268
+ }
269
+ });
270
+ </script>
271
+ <?php endif; ?>
272
+ <!--
273
+ <div><input type="hidden" name="affect_downloadable_information" value="1" /></div>
274
+ -->
app/design/adminhtml/default/default/template/catalog/product/edit/files/sample.phtml ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-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 design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable_Samples
30
+ */
31
+ ?>
32
+
33
+ <?php $_product = $this->getProduct(); ?>
34
+ <div class="fieldset">
35
+ <div class="grid">
36
+ <div class="hor-scroll">
37
+ <table cellspacing="0" class="data border">
38
+ <col />
39
+ <col width="1" />
40
+ <col width="1" />
41
+ <col width="1" />
42
+ <thead>
43
+ <tr class="headings">
44
+ <th><?php echo Mage::helper('files')->__('Title') ?> <span class="required">*</span></th>
45
+ <th><?php echo Mage::helper('files')->__('File') ?></th>
46
+ <th><span class="nobr"><?php echo Mage::helper('files')->__('Sort Order') ?></span></th>
47
+ <th>&nbsp;</th>
48
+ </tr>
49
+ </thead>
50
+ <tfoot>
51
+ <tr>
52
+ <td colspan="4" class="a-right"><?php echo $this->getAddButtonHtml() ?>&nbsp;<?php echo $this->getUploadButtonHtml() ?></td>
53
+ </tr>
54
+ </tfoot>
55
+ <tbody id="sample_items_body">
56
+ </tbody>
57
+ </table>
58
+ <div><small><?php //echo Mage::helper('files')->__('Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'.')?></small></div>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/product_files/jquery-1.10.2.min.js') ?>"></script>
63
+ <script type="text/javascript">
64
+ //<![CDATA[>
65
+ var sampleTemplate = '<tr>'+
66
+ '<td>'+
67
+ '<input type="hidden" class="__delete__" name="downloadable[sample][{{id}}][is_delete]" value="" />'+
68
+ '<input type="hidden" name="downloadable[sample][{{id}}][sample_id]" value="{{sample_id}}" />'+
69
+ '<input type="text" class="required-entry input-text" name="downloadable[sample][{{id}}][title]" value="{{title}}" />'+
70
+ '<?php echo $_product->getStoreId()?'<br /><input type="checkbox" id="downloadable_sample_{{id}}_title" name="downloadable[sample][{{id}}][use_default_title]" value="1" /><label class="normal" for="downloadable_sample_{{id}}_title">Use Default Value</label>':'' ?>'+
71
+ '</td>'+
72
+ '<td>'+
73
+ '<div class="files-wide">'+
74
+ '<div class="row">'+
75
+ '<label for="downloadable_sample_{{id}}_file_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_sample_{{id}}_file_type" name="downloadable[sample][{{id}}][type]" value="file"{{file_checked}} /> File:</label>'+
76
+ '<input type="hidden" class="validate-downloadable-file" id="downloadable_sample_{{id}}_file_save" name="downloadable[sample][{{id}}][file]" value="{{file_save}}" />'+
77
+ '<div id="downloadable_sample_{{id}}_file" class="uploader">'+
78
+ '<div id="downloadable_sample_{{id}}_file-old" class="file-row-info"></div>'+
79
+ '<div id="downloadable_sample_{{id}}_file-new" class="file-row-info new-file"></div>'+
80
+ '<div class="buttons">'+
81
+ '<div id="downloadable_sample_{{id}}_file-install-flash" style="display:none">'+
82
+ '<?php echo $this->jsQuoteEscape(Mage::helper('media')->__('This content requires last version of Adobe Flash Player. <a href="%s">Get Flash</a>', 'http://www.adobe.com/go/getflash/')) ?>'+
83
+ '</div>'+
84
+ '</div>'+
85
+ '<div class="clear"></div>'+
86
+ '</div>'+
87
+ '</div>'+
88
+ '<div class="row">'+
89
+ '<label for="downloadable_sample_{{id}}_url_type"><input type="hidden" class="radio validate-one-required-by-name" id="downloadable_sample_{{id}}_url_type" name="downloadable[sample][{{id}}][type]" value="url"{{url_checked}} /> </label> <input type="hidden" class="validate-downloadable-url input-text" name="downloadable[sample][{{id}}][sample_url]" value="{{sample_url}}" />'+
90
+ '</div>'+
91
+ '<div>'+
92
+ '<span id="downloadable_sample_{{id}}_container"></span>'+
93
+ '</div>'+
94
+ '</div>'+
95
+
96
+ '</td>'+
97
+ '<td class="a-center"><input type="text" name="downloadable[sample][{{id}}][sort_order]" value="{{sort_order}}" class="input-text sort" /></td>'+
98
+ '<td>'+
99
+ '<button type="button" class="scalable delete icon-btn delete-sample-item" id="{{sample_id}}"><span>Delete</span></button>'+
100
+ '</td>'+
101
+ '</tr>';
102
+ var sampleItems = {
103
+ tbody : $('sample_items_body'),
104
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
105
+ templateText : sampleTemplate,
106
+ itemCount : 0,
107
+ add : function(data) {
108
+ alertAlreadyDisplayed = false;
109
+ this.template = new Template(this.templateText, this.templateSyntax);
110
+
111
+ if(!data.sample_id){
112
+ data = {};
113
+ data.sample_type = 'file';
114
+ data.sample_id = 0;
115
+ }
116
+
117
+ data.id = this.itemCount;
118
+
119
+ if (data.sample_type == 'url') {
120
+ data.url_checked = ' checked="checked"';
121
+ } else if (data.sample_type == 'file') {
122
+ data.file_checked = ' checked="checked"';
123
+ }
124
+
125
+ Element.insert(this.tbody, {'bottom':this.template.evaluate(data)});
126
+
127
+ scopeTitle = $('downloadable_sample_'+data.id+'_title');
128
+ if (scopeTitle) {
129
+ Event.observe(scopeTitle, 'click', function(event){
130
+ scopeElm = $(Event.findElement(event, 'input'));
131
+ titleField = scopeElm.up(0).down('input[type="text"]');
132
+ if (scopeElm.checked == true) {
133
+ titleField.disabled = true;
134
+ } else {
135
+ titleField.disabled = false;
136
+ }
137
+ });
138
+ }
139
+ if (!data.store_title && scopeTitle) {
140
+ scopeTitle.up(0).down('input[type="text"]').disabled = true;
141
+ scopeTitle.checked = true;
142
+ }
143
+
144
+ sampleUrl = $('downloadable_sample_'+data.id+'_url_type');
145
+
146
+ if (!data.file_save) {
147
+ data.file_save = [];
148
+ }
149
+ new Downloadable.FileUploader(
150
+ 'samples',
151
+ data.id,
152
+ sampleUrl.up('td').down('div.uploader'),
153
+ 'downloadable[sample]['+data.id+']',
154
+ data.file_save,
155
+ 'downloadable_sample_'+data.id+'_file',
156
+ <?php echo $this->getConfigJson() ?>
157
+ );
158
+ sampleUrl.advaiceContainer = 'downloadable_sample_'+data.id+'_container';
159
+ sampleFile = $('downloadable_sample_'+data.id+'_file_type');
160
+ sampleFile.advaiceContainer = 'downloadable_sample_'+data.id+'_container';
161
+ $('downloadable_sample_'+data.id+'_file_save').advaiceContainer = 'downloadable_sample_'+data.id+'_container';
162
+
163
+ this.itemCount++;
164
+ this.bindRemoveButtons();
165
+ },
166
+ remove : function(event){
167
+ var element = $(Event.findElement(event, 'tr'));
168
+ alertAlreadyDisplayed = false;
169
+ if(element){
170
+ element.down('input[type="hidden"].__delete__').value = '1';
171
+ element.down('div.flex').remove();
172
+ element.addClassName('no-display');
173
+ element.addClassName('ignore-validate');
174
+ element.hide();
175
+ }
176
+ },
177
+ bindRemoveButtons : function(){
178
+ var buttons = $$('tbody#sample_items_body .delete-sample-item');
179
+ for(var i=0;i<buttons.length;i++){
180
+ if(!$(buttons[i]).binded){
181
+ $(buttons[i]).binded = true;
182
+ Event.observe(buttons[i], 'click', this.remove.bind(this));
183
+ }
184
+ }
185
+ }
186
+ }
187
+
188
+ sampleItems.bindRemoveButtons();
189
+
190
+ if($('add_sample_item')){
191
+ Event.observe('add_sample_item', 'click', sampleItems.add.bind(sampleItems));
192
+ }
193
+
194
+ <?php foreach ($this->getSampleData() as $item): ?>
195
+ sampleItems.add(<?php echo $item->toJson() ?>);
196
+ <?php endforeach; ?>
197
+
198
+ //]]>
199
+
200
+ jQuery(document).on('click','#sample_items_body button',function(){
201
+ sample_id = jQuery(this).attr('id');
202
+ if(sample_id!=0)
203
+ {
204
+ jQuery.ajax({
205
+ url: '<?php echo $this->getUrl("files/catalog_product/deleteRecord")."?isAjax=true" ?>',
206
+ type: 'GET',
207
+ data: { 'file_id': sample_id },
208
+ success: function(data) { }
209
+ });
210
+ }
211
+ });
212
+
213
+ </script>
app/design/frontend/default/default/layout/files/files.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addCss"><stylesheet>css/files.css</stylesheet></action>
6
+ </reference>
7
+ </default>
8
+ </layout>
app/design/frontend/default/default/template/files/files.phtml ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $login = Mage::getSingleton('customer/session')->isLoggedIn();
3
+
4
+ $user_register = Mage::getStoreConfig('files/files/registerdownload');
5
+
6
+
7
+ if(Mage::getStoreConfig('files/files/allowdownload'))
8
+ {
9
+ if($user_register == 1 || ($user_register == 0 && !empty($login)))
10
+ {
11
+ $productId=$this->getProduct()->getId();
12
+ $collection=Mage::getModel('files/files')->getFileCollection($productId);
13
+ $fileCollection=$collection->getData();
14
+ $showImageFlag=0;
15
+ $divHeigth=25;
16
+ $imageBaseDir=Mage::getBaseDir('media').DS.'file_type_icons';
17
+ $imageBaseUrl=Mage::getBaseUrl('media').'file_type_icons';
18
+ $maxLinks=Mage::getStoreConfig('files/files/frontendlinks') ? Mage::getStoreConfig('files/files/frontendlinks') : 1;
19
+ if(Mage::getStoreConfig('files/files/showimage'))
20
+ {
21
+ $showImageFlag=1;
22
+ $imageHeight= Mage::getStoreConfig('files/files/typeimageheight') ? Mage::getStoreConfig('files/files/typeimageheight') : 25;
23
+ $imageWidth= Mage::getStoreConfig('files/files/typeimagewidth') ? Mage::getStoreConfig('files/files/typeimagewidth') : 25;
24
+ $divHeigth=$imageHeight;
25
+ }
26
+ if(count($fileCollection)>0)
27
+ {
28
+ ?>
29
+ <b>Download Attachment</b>
30
+ <div class='mainDiv'>
31
+ <table>
32
+ <?php
33
+ $linksCount=1;
34
+ foreach($fileCollection as $currentFile)
35
+ {
36
+ $imageDirPath=$imageBaseDir.DS.$currentFile['file_type'].'.png';
37
+
38
+ $imageName=$currentFile['file_type'];
39
+ if(!file_exists($imageDirPath))
40
+ $imageName=Mage::getStoreConfig('files/files/defaultimage') ? Mage::getStoreConfig('files/files/defaultimage') : 'default';
41
+
42
+ $path=Mage::getUrl('files/index/download'.'/id/'.$currentFile['file_timestamp']);
43
+ $imagePath=$imageBaseUrl."/".$imageName.'.png';
44
+ $size=$this->getModifiedFileSize($currentFile['file_size']);
45
+
46
+ echo "<tr>";
47
+ if($showImageFlag)
48
+ echo "<td class='fileImageDiv' style='height:".$divHeigth.";'><img src='".$imagePath."' height='".$imageHeight."' width='".$imageWidth."' alt='".$currentFile['file_type']."' /></td>";
49
+ echo "<td class='fileTitleDiv' style='height:".$divHeigth.";'><b>".$currentFile['file_title']."</b>";
50
+ echo "<font>(".$size;
51
+ if(!$showImageFlag)
52
+ echo " - ".$currentFile['file_type'];
53
+ echo ")</font></td>";
54
+ echo "<td style='height:".$divHeigth.";'><a href='".$path."'/>Download</a></td>";
55
+ echo "</tr>";
56
+ if($linksCount < $maxLinks)
57
+ $linksCount++;
58
+ else
59
+ break;
60
+ }
61
+ ?>
62
+ </table>
63
+ </div>
64
+ <?php
65
+ }
66
+ }
67
+ }
68
+ ?>
app/etc/modules/Tatva_Files.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Tatva_Files>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ <version>1.0</version>
8
+ </Tatva_Files>
9
+ </modules>
10
+ </config>
media/file_type_icons/3gp.png ADDED
Binary file
media/file_type_icons/avi.png ADDED
Binary file
media/file_type_icons/bmp.png ADDED
Binary file
media/file_type_icons/default.png ADDED
Binary file
media/file_type_icons/doc.png ADDED
Binary file
media/file_type_icons/docx.png ADDED
Binary file
media/file_type_icons/flv.png ADDED
Binary file
media/file_type_icons/gif.png ADDED
Binary file
media/file_type_icons/jpeg.png ADDED
Binary file
media/file_type_icons/jpg.png ADDED
Binary file
media/file_type_icons/mp3.png ADDED
Binary file
media/file_type_icons/mp4.png ADDED
Binary file
media/file_type_icons/odf.png ADDED
Binary file
media/file_type_icons/odt.png ADDED
Binary file
media/file_type_icons/pdf.png ADDED
Binary file
media/file_type_icons/png.png ADDED
Binary file
media/file_type_icons/ppt.png ADDED
Binary file
media/file_type_icons/pptx.png ADDED
Binary file
media/file_type_icons/psd.png ADDED
Binary file
media/file_type_icons/rar.png ADDED
Binary file
media/file_type_icons/sql.png ADDED
Binary file
media/file_type_icons/swf.png ADDED
Binary file
media/file_type_icons/tiff.png ADDED
Binary file
media/file_type_icons/txt.png ADDED
Binary file
media/file_type_icons/xls.png ADDED
Binary file
media/file_type_icons/xlsx.png ADDED
Binary file
media/file_type_icons/zip.png ADDED
Binary file
package.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Etatvasoft_Product_File_Attachment</name>
4
+ <version>1.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>Attach additional download files, manuals, media files, audio files with products for customer download. </summary>
10
+ <description>Easily attach additional downloadable files of any extension to your Magento products. This module helps to customers for download files, manuals, media files, audio files and other. &#xD;
11
+ Using this extension admin can attach various types of files to store, so customers can download that files. This extension adds separate tab into the product add/edit page so admin can attach any product specific files.&#xD;
12
+ Admin can set the title </description>
13
+ <notes>Easily attach additional downloadable files of any extension to your Magento products. This module helps to customers for download files, manuals, media files, audio files and other. &#xD;
14
+ Using this extension admin can attach various types of files to store, so customers can download that files. This extension adds separate tab into the product add/edit page so admin can attach any product specific files.&#xD;
15
+ Admin can set the title </notes>
16
+ <authors><author><name>Etatvasoft</name><user>Etatvasoft</user><email>etatvasoft.magentodevelopment@gmail.com</email></author></authors>
17
+ <date>2013-10-16</date>
18
+ <time>12:21:35</time>
19
+ <contents><target name="magelocal"><dir name="Tatva"><dir name="Files"><dir name="Block"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="File.php" hash="b5a5c2b99eb8e06ca8ead9414f37c0a6"/><file name="Sample.php" hash="285583930988527707ec85c8cab3000f"/></dir><file name="Tabs.php" hash="0a248164c23e5bb1f29f5f71fd2f0621"/></dir></dir></dir><dir name="Product"><file name="View.php" hash="1caa0e6049a51395ee24845f137dd499"/></dir></dir><dir name="Helper"><file name="Data.php" hash="64a7f3b92607f12c0426f43a53bf96bd"/></dir><dir name="Model"><file name="Files.php" hash="171fe6c8245a169717d92d1a3a5791e1"/><dir name="Mysql4"><dir name="Files"><file name="Collection.php" hash="1bd2694d700db0c8a1c4ac8ba1cf7778"/></dir><file name="Files.php" hash="709a0476762933832d5428fb75af93bb"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Dropdown"><file name="Values.php" hash="8aa56bf1d73e7eeb9dee9732aa235a56"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Downloadable"><file name="FileController.php" hash="f651b5a5916e5d8741a3fae546fa0f08"/></dir></dir><dir name="Catalog"><file name="ProductController.php" hash="7c449b47e3d8cf2507579796a6db396d"/></dir><file name="IndexController.php" hash="8a2c99337a2dff882cbf6ed95eb9aa3b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c915c632d94f084566a1d85f58248ea2"/><file name="config.xml" hash="d84dd4aa2abae19cbb0f454a47d7cb6c"/><file name="system.xml" hash="a45c0d715290e807c905b7f1e09d5799"/></dir><dir name="sql"><dir name="files_setup"><file name="mysql4-install-0.1.0.php" hash="ff36e4670a69584c7b8bab83f4fd0290"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="e07f1ae02b4ece15c17a79542a73060a"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="bdab5d062d12e270e7f9f1adc08be37d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><dir name="files"><file name="files.xml" hash="05469281f2202b86fe80aa6413fa9738"/></dir></dir><dir name="template"><dir name="files"><file name="files.phtml" hash="b2e71dac14f710d4132c5ac3c00c0191"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="catalog"><dir name="product"><dir name="edit"><file name="files.phtml" hash="4efc3768500b392249a108fbebf5c997"/><dir name="files"><file name="sample.phtml" hash="080051db0828f5869964f937152be31a"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Tatva_Files.xml" hash="9bf2792358ef16463b3fba911d8e7fd2"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="files.css" hash="420b5f622b1bf48de0ce3b5010495953"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="js"><dir name="product_files"><file name="jquery-1.10.2.min.js" hash="e5185711b136d28c39ac10dc9730c43f"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="file_type_icons"><file name="3gp.png" hash="1112e178f2bcc7d192fd978240fbab27"/><file name="avi.png" hash="8a81be5118b9df50015b8a3fd203fc4f"/><file name="bmp.png" hash="d2bf552a756d7906d50e680e57ebff51"/><file name="default.png" hash="c362d1f34ea703c0fc073eb71da3190c"/><file name="doc.png" hash="12d4d74806a1cfc843e5dec6f2cacb78"/><file name="docx.png" hash="d8410c4b56dc05dd4142667ed8ec8400"/><file name="flv.png" hash="c6a5a03169823820541068ab369c1aaa"/><file name="gif.png" hash="3e57033094ef310ea58112d2eb9211d6"/><file name="jpeg.png" hash="5646db29e5073e3f3cf24d0d80210bcc"/><file name="jpg.png" hash="5646db29e5073e3f3cf24d0d80210bcc"/><file name="mp3.png" hash="65522b600db026d86a94c67f24674f7e"/><file name="mp4.png" hash="ef8ab955212abea1437805e06027db5f"/><file name="odf.png" hash="3516e9c591e7ab5cc657d3714d92ac60"/><file name="odt.png" hash="27d3f92692ecb30538da020872645e95"/><file name="pdf.png" hash="d179747e0f6783ef80a1bc66f43f5cc1"/><file name="png.png" hash="e66b1d2284d487ba2631e91f29ecec6f"/><file name="ppt.png" hash="d24652ba9d994f7fadf930ee8449a043"/><file name="pptx.png" hash="d24652ba9d994f7fadf930ee8449a043"/><file name="psd.png" hash="67267451b0130722c352012b1f07b0ac"/><file name="rar.png" hash="b09f8ea3b9055a5771bf72b9bc73120f"/><file name="sql.png" hash="bbde922a4ecfe09331b6208826c2bcd7"/><file name="swf.png" hash="c6a5a03169823820541068ab369c1aaa"/><file name="tiff.png" hash="6d5e8ef866ed26a9c05f8c5f6b4f1241"/><file name="txt.png" hash="102b4cd5210f61bf3690a29590bfe082"/><file name="xls.png" hash="2da497f1731dd206bc3293a17f3d4ced"/><file name="xlsx.png" hash="2da497f1731dd206bc3293a17f3d4ced"/><file name="zip.png" hash="97ecf06e8de7842aa4dc486922673933"/></dir></target></contents>
20
+ <compatible/>
21
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
22
+ </package>
skin/adminhtml/default/default/js/product_files/jquery-1.10.2.min.js ADDED
@@ -0,0 +1,3348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
2
+ //@ sourceMappingURL=jquery-1.10.2.min.map
3
+ */
4
+ (function (e, t) {
5
+ var n, r, i = typeof t,
6
+ o = e.location,
7
+ a = e.document,
8
+ s = a.documentElement,
9
+ l = e.jQuery,
10
+ u = e.$,
11
+ c = {}, p = [],
12
+ f = "1.10.2",
13
+ d = p.concat,
14
+ h = p.push,
15
+ g = p.slice,
16
+ m = p.indexOf,
17
+ y = c.toString,
18
+ v = c.hasOwnProperty,
19
+ b = f.trim,
20
+ x = function (e, t) {
21
+ return new x.fn.init(e, t, r)
22
+ }, w = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
23
+ T = /\S+/g,
24
+ C = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
25
+ N = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
26
+ k = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
27
+ E = /^[\],:{}\s]*$/,
28
+ S = /(?:^|:|,)(?:\s*\[)+/g,
29
+ A = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
30
+ j = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
31
+ D = /^-ms-/,
32
+ L = /-([\da-z])/gi,
33
+ H = function (e, t) {
34
+ return t.toUpperCase()
35
+ }, q = function (e) {
36
+ (a.addEventListener || "load" === e.type || "complete" === a.readyState) && (_(), x.ready())
37
+ }, _ = function () {
38
+ a.addEventListener ? (a.removeEventListener("DOMContentLoaded", q, !1), e.removeEventListener("load", q, !1)) : (a.detachEvent("onreadystatechange", q), e.detachEvent("onload", q))
39
+ };
40
+ x.fn = x.prototype = {
41
+ jquery: f,
42
+ constructor: x,
43
+ init: function (e, n, r) {
44
+ var i, o;
45
+ if (!e) return this;
46
+ if ("string" == typeof e) {
47
+ if (i = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : N.exec(e), !i || !i[1] && n) return !n || n.jquery ? (n || r).find(e) : this.constructor(n).find(e);
48
+ if (i[1]) {
49
+ if (n = n instanceof x ? n[0] : n, x.merge(this, x.parseHTML(i[1], n && n.nodeType ? n.ownerDocument || n : a, !0)), k.test(i[1]) && x.isPlainObject(n))
50
+ for (i in n) x.isFunction(this[i]) ? this[i](n[i]) : this.attr(i, n[i]);
51
+ return this
52
+ }
53
+ if (o = a.getElementById(i[2]), o && o.parentNode) {
54
+ if (o.id !== i[2]) return r.find(e);
55
+ this.length = 1, this[0] = o
56
+ }
57
+ return this.context = a, this.selector = e, this
58
+ }
59
+ return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : x.isFunction(e) ? r.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), x.makeArray(e, this))
60
+ },
61
+ selector: "",
62
+ length: 0,
63
+ toArray: function () {
64
+ return g.call(this)
65
+ },
66
+ get: function (e) {
67
+ return null == e ? this.toArray() : 0 > e ? this[this.length + e] : this[e]
68
+ },
69
+ pushStack: function (e) {
70
+ var t = x.merge(this.constructor(), e);
71
+ return t.prevObject = this, t.context = this.context, t
72
+ },
73
+ each: function (e, t) {
74
+ return x.each(this, e, t)
75
+ },
76
+ ready: function (e) {
77
+ return x.ready.promise().done(e), this
78
+ },
79
+ slice: function () {
80
+ return this.pushStack(g.apply(this, arguments))
81
+ },
82
+ first: function () {
83
+ return this.eq(0)
84
+ },
85
+ last: function () {
86
+ return this.eq(-1)
87
+ },
88
+ eq: function (e) {
89
+ var t = this.length,
90
+ n = +e + (0 > e ? t : 0);
91
+ return this.pushStack(n >= 0 && t > n ? [this[n]] : [])
92
+ },
93
+ map: function (e) {
94
+ return this.pushStack(x.map(this, function (t, n) {
95
+ return e.call(t, n, t)
96
+ }))
97
+ },
98
+ end: function () {
99
+ return this.prevObject || this.constructor(null)
100
+ },
101
+ push: h,
102
+ sort: [].sort,
103
+ splice: [].splice
104
+ }, x.fn.init.prototype = x.fn, x.extend = x.fn.extend = function () {
105
+ var e, n, r, i, o, a, s = arguments[0] || {}, l = 1,
106
+ u = arguments.length,
107
+ c = !1;
108
+ for ("boolean" == typeof s && (c = s, s = arguments[1] || {}, l = 2), "object" == typeof s || x.isFunction(s) || (s = {}), u === l && (s = this, --l); u > l; l++)
109
+ if (null != (o = arguments[l]))
110
+ for (i in o) e = s[i], r = o[i], s !== r && (c && r && (x.isPlainObject(r) || (n = x.isArray(r))) ? (n ? (n = !1, a = e && x.isArray(e) ? e : []) : a = e && x.isPlainObject(e) ? e : {}, s[i] = x.extend(c, a, r)) : r !== t && (s[i] = r));
111
+ return s
112
+ }, x.extend({
113
+ expando: "jQuery" + (f + Math.random()).replace(/\D/g, ""),
114
+ noConflict: function (t) {
115
+ return e.$ === x && (e.$ = u), t && e.jQuery === x && (e.jQuery = l), x
116
+ },
117
+ isReady: !1,
118
+ readyWait: 1,
119
+ holdReady: function (e) {
120
+ e ? x.readyWait++ : x.ready(!0)
121
+ },
122
+ ready: function (e) {
123
+ if (e === !0 ? !--x.readyWait : !x.isReady) {
124
+ if (!a.body) return setTimeout(x.ready);
125
+ x.isReady = !0, e !== !0 && --x.readyWait > 0 || (n.resolveWith(a, [x]), x.fn.trigger && x(a).trigger("ready").off("ready"))
126
+ }
127
+ },
128
+ isFunction: function (e) {
129
+ return "function" === x.type(e)
130
+ },
131
+ isArray: Array.isArray || function (e) {
132
+ return "array" === x.type(e)
133
+ },
134
+ isWindow: function (e) {
135
+ return null != e && e == e.window
136
+ },
137
+ isNumeric: function (e) {
138
+ return !isNaN(parseFloat(e)) && isFinite(e)
139
+ },
140
+ type: function (e) {
141
+ return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? c[y.call(e)] || "object" : typeof e
142
+ },
143
+ isPlainObject: function (e) {
144
+ var n;
145
+ if (!e || "object" !== x.type(e) || e.nodeType || x.isWindow(e)) return !1;
146
+ try {
147
+ if (e.constructor && !v.call(e, "constructor") && !v.call(e.constructor.prototype, "isPrototypeOf")) return !1
148
+ } catch (r) {
149
+ return !1
150
+ }
151
+ if (x.support.ownLast)
152
+ for (n in e) return v.call(e, n);
153
+ for (n in e);
154
+ return n === t || v.call(e, n)
155
+ },
156
+ isEmptyObject: function (e) {
157
+ var t;
158
+ for (t in e) return !1;
159
+ return !0
160
+ },
161
+ error: function (e) {
162
+ throw Error(e)
163
+ },
164
+ parseHTML: function (e, t, n) {
165
+ if (!e || "string" != typeof e) return null;
166
+ "boolean" == typeof t && (n = t, t = !1), t = t || a;
167
+ var r = k.exec(e),
168
+ i = !n && [];
169
+ return r ? [t.createElement(r[1])] : (r = x.buildFragment([e], t, i), i && x(i).remove(), x.merge([], r.childNodes))
170
+ },
171
+ parseJSON: function (n) {
172
+ return e.JSON && e.JSON.parse ? e.JSON.parse(n) : null === n ? n : "string" == typeof n && (n = x.trim(n), n && E.test(n.replace(A, "@").replace(j, "]").replace(S, ""))) ? Function("return " + n)() : (x.error("Invalid JSON: " + n), t)
173
+ },
174
+ parseXML: function (n) {
175
+ var r, i;
176
+ if (!n || "string" != typeof n) return null;
177
+ try {
178
+ e.DOMParser ? (i = new DOMParser, r = i.parseFromString(n, "text/xml")) : (r = new ActiveXObject("Microsoft.XMLDOM"), r.async = "false", r.loadXML(n))
179
+ } catch (o) {
180
+ r = t
181
+ }
182
+ return r && r.documentElement && !r.getElementsByTagName("parsererror").length || x.error("Invalid XML: " + n), r
183
+ },
184
+ noop: function () {},
185
+ globalEval: function (t) {
186
+ t && x.trim(t) && (e.execScript || function (t) {
187
+ e.eval.call(e, t)
188
+ })(t)
189
+ },
190
+ camelCase: function (e) {
191
+ return e.replace(D, "ms-").replace(L, H)
192
+ },
193
+ nodeName: function (e, t) {
194
+ return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase()
195
+ },
196
+ each: function (e, t, n) {
197
+ var r, i = 0,
198
+ o = e.length,
199
+ a = M(e);
200
+ if (n) {
201
+ if (a) {
202
+ for (; o > i; i++)
203
+ if (r = t.apply(e[i], n), r === !1) break
204
+ } else
205
+ for (i in e)
206
+ if (r = t.apply(e[i], n), r === !1) break
207
+ } else if (a) {
208
+ for (; o > i; i++)
209
+ if (r = t.call(e[i], i, e[i]), r === !1) break
210
+ } else
211
+ for (i in e)
212
+ if (r = t.call(e[i], i, e[i]), r === !1) break; return e
213
+ },
214
+ trim: b && !b.call("\ufeff\u00a0") ? function (e) {
215
+ return null == e ? "" : b.call(e)
216
+ } : function (e) {
217
+ return null == e ? "" : (e + "").replace(C, "")
218
+ },
219
+ makeArray: function (e, t) {
220
+ var n = t || [];
221
+ return null != e && (M(Object(e)) ? x.merge(n, "string" == typeof e ? [e] : e) : h.call(n, e)), n
222
+ },
223
+ inArray: function (e, t, n) {
224
+ var r;
225
+ if (t) {
226
+ if (m) return m.call(t, e, n);
227
+ for (r = t.length, n = n ? 0 > n ? Math.max(0, r + n) : n : 0; r > n; n++)
228
+ if (n in t && t[n] === e) return n
229
+ }
230
+ return -1
231
+ },
232
+ merge: function (e, n) {
233
+ var r = n.length,
234
+ i = e.length,
235
+ o = 0;
236
+ if ("number" == typeof r)
237
+ for (; r > o; o++) e[i++] = n[o];
238
+ else
239
+ while (n[o] !== t) e[i++] = n[o++];
240
+ return e.length = i, e
241
+ },
242
+ grep: function (e, t, n) {
243
+ var r, i = [],
244
+ o = 0,
245
+ a = e.length;
246
+ for (n = !! n; a > o; o++) r = !! t(e[o], o), n !== r && i.push(e[o]);
247
+ return i
248
+ },
249
+ map: function (e, t, n) {
250
+ var r, i = 0,
251
+ o = e.length,
252
+ a = M(e),
253
+ s = [];
254
+ if (a)
255
+ for (; o > i; i++) r = t(e[i], i, n), null != r && (s[s.length] = r);
256
+ else
257
+ for (i in e) r = t(e[i], i, n), null != r && (s[s.length] = r);
258
+ return d.apply([], s)
259
+ },
260
+ guid: 1,
261
+ proxy: function (e, n) {
262
+ var r, i, o;
263
+ return "string" == typeof n && (o = e[n], n = e, e = o), x.isFunction(e) ? (r = g.call(arguments, 2), i = function () {
264
+ return e.apply(n || this, r.concat(g.call(arguments)))
265
+ }, i.guid = e.guid = e.guid || x.guid++, i) : t
266
+ },
267
+ access: function (e, n, r, i, o, a, s) {
268
+ var l = 0,
269
+ u = e.length,
270
+ c = null == r;
271
+ if ("object" === x.type(r)) {
272
+ o = !0;
273
+ for (l in r) x.access(e, n, l, r[l], !0, a, s)
274
+ } else if (i !== t && (o = !0, x.isFunction(i) || (s = !0), c && (s ? (n.call(e, i), n = null) : (c = n, n = function (e, t, n) {
275
+ return c.call(x(e), n)
276
+ })), n))
277
+ for (; u > l; l++) n(e[l], r, s ? i : i.call(e[l], l, n(e[l], r)));
278
+ return o ? e : c ? n.call(e) : u ? n(e[0], r) : a
279
+ },
280
+ now: function () {
281
+ return (new Date).getTime()
282
+ },
283
+ swap: function (e, t, n, r) {
284
+ var i, o, a = {};
285
+ for (o in t) a[o] = e.style[o], e.style[o] = t[o];
286
+ i = n.apply(e, r || []);
287
+ for (o in t) e.style[o] = a[o];
288
+ return i
289
+ }
290
+ }), x.ready.promise = function (t) {
291
+ if (!n)
292
+ if (n = x.Deferred(), "complete" === a.readyState) setTimeout(x.ready);
293
+ else if (a.addEventListener) a.addEventListener("DOMContentLoaded", q, !1), e.addEventListener("load", q, !1);
294
+ else {
295
+ a.attachEvent("onreadystatechange", q), e.attachEvent("onload", q);
296
+ var r = !1;
297
+ try {
298
+ r = null == e.frameElement && a.documentElement
299
+ } catch (i) {}
300
+ r && r.doScroll && function o() {
301
+ if (!x.isReady) {
302
+ try {
303
+ r.doScroll("left")
304
+ } catch (e) {
305
+ return setTimeout(o, 50)
306
+ }
307
+ _(), x.ready()
308
+ }
309
+ }()
310
+ }
311
+ return n.promise(t)
312
+ }, x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (e, t) {
313
+ c["[object " + t + "]"] = t.toLowerCase()
314
+ });
315
+
316
+ function M(e) {
317
+ var t = e.length,
318
+ n = x.type(e);
319
+ return x.isWindow(e) ? !1 : 1 === e.nodeType && t ? !0 : "array" === n || "function" !== n && (0 === t || "number" == typeof t && t > 0 && t - 1 in e)
320
+ }
321
+ r = x(a),
322
+ function (e, t) {
323
+ var n, r, i, o, a, s, l, u, c, p, f, d, h, g, m, y, v, b = "sizzle" + -new Date,
324
+ w = e.document,
325
+ T = 0,
326
+ C = 0,
327
+ N = st(),
328
+ k = st(),
329
+ E = st(),
330
+ S = !1,
331
+ A = function (e, t) {
332
+ return e === t ? (S = !0, 0) : 0
333
+ }, j = typeof t,
334
+ D = 1 << 31,
335
+ L = {}.hasOwnProperty,
336
+ H = [],
337
+ q = H.pop,
338
+ _ = H.push,
339
+ M = H.push,
340
+ O = H.slice,
341
+ F = H.indexOf || function (e) {
342
+ var t = 0,
343
+ n = this.length;
344
+ for (; n > t; t++)
345
+ if (this[t] === e) return t;
346
+ return -1
347
+ }, B = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
348
+ P = "[\\x20\\t\\r\\n\\f]",
349
+ R = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
350
+ W = R.replace("w", "w#"),
351
+ $ = "\\[" + P + "*(" + R + ")" + P + "*(?:([*^$|!~]?=)" + P + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + W + ")|)|)" + P + "*\\]",
352
+ I = ":(" + R + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + $.replace(3, 8) + ")*)|.*)\\)|)",
353
+ z = RegExp("^" + P + "+|((?:^|[^\\\\])(?:\\\\.)*)" + P + "+$", "g"),
354
+ X = RegExp("^" + P + "*," + P + "*"),
355
+ U = RegExp("^" + P + "*([>+~]|" + P + ")" + P + "*"),
356
+ V = RegExp(P + "*[+~]"),
357
+ Y = RegExp("=" + P + "*([^\\]'\"]*)" + P + "*\\]", "g"),
358
+ J = RegExp(I),
359
+ G = RegExp("^" + W + "$"),
360
+ Q = {
361
+ ID: RegExp("^#(" + R + ")"),
362
+ CLASS: RegExp("^\\.(" + R + ")"),
363
+ TAG: RegExp("^(" + R.replace("w", "w*") + ")"),
364
+ ATTR: RegExp("^" + $),
365
+ PSEUDO: RegExp("^" + I),
366
+ CHILD: RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + P + "*(even|odd|(([+-]|)(\\d*)n|)" + P + "*(?:([+-]|)" + P + "*(\\d+)|))" + P + "*\\)|)", "i"),
367
+ bool: RegExp("^(?:" + B + ")$", "i"),
368
+ needsContext: RegExp("^" + P + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + P + "*((?:-\\d)?\\d*)" + P + "*\\)|)(?=[^-]|$)", "i")
369
+ }, K = /^[^{]+\{\s*\[native \w/,
370
+ Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
371
+ et = /^(?:input|select|textarea|button)$/i,
372
+ tt = /^h\d$/i,
373
+ nt = /'|\\/g,
374
+ rt = RegExp("\\\\([\\da-f]{1,6}" + P + "?|(" + P + ")|.)", "ig"),
375
+ it = function (e, t, n) {
376
+ var r = "0x" + t - 65536;
377
+ return r !== r || n ? t : 0 > r ? String.fromCharCode(r + 65536) : String.fromCharCode(55296 | r >> 10, 56320 | 1023 & r)
378
+ };
379
+ try {
380
+ M.apply(H = O.call(w.childNodes), w.childNodes), H[w.childNodes.length].nodeType
381
+ } catch (ot) {
382
+ M = {
383
+ apply: H.length ? function (e, t) {
384
+ _.apply(e, O.call(t))
385
+ } : function (e, t) {
386
+ var n = e.length,
387
+ r = 0;
388
+ while (e[n++] = t[r++]);
389
+ e.length = n - 1
390
+ }
391
+ }
392
+ }
393
+
394
+ function at(e, t, n, i) {
395
+ var o, a, s, l, u, c, d, m, y, x;
396
+ if ((t ? t.ownerDocument || t : w) !== f && p(t), t = t || f, n = n || [], !e || "string" != typeof e) return n;
397
+ if (1 !== (l = t.nodeType) && 9 !== l) return [];
398
+ if (h && !i) {
399
+ if (o = Z.exec(e))
400
+ if (s = o[1]) {
401
+ if (9 === l) {
402
+ if (a = t.getElementById(s), !a || !a.parentNode) return n;
403
+ if (a.id === s) return n.push(a), n
404
+ } else if (t.ownerDocument && (a = t.ownerDocument.getElementById(s)) && v(t, a) && a.id === s) return n.push(a), n
405
+ } else {
406
+ if (o[2]) return M.apply(n, t.getElementsByTagName(e)), n;
407
+ if ((s = o[3]) && r.getElementsByClassName && t.getElementsByClassName) return M.apply(n, t.getElementsByClassName(s)), n
408
+ }
409
+ if (r.qsa && (!g || !g.test(e))) {
410
+ if (m = d = b, y = t, x = 9 === l && e, 1 === l && "object" !== t.nodeName.toLowerCase()) {
411
+ c = mt(e), (d = t.getAttribute("id")) ? m = d.replace(nt, "\\$&") : t.setAttribute("id", m), m = "[id='" + m + "'] ", u = c.length;
412
+ while (u--) c[u] = m + yt(c[u]);
413
+ y = V.test(e) && t.parentNode || t, x = c.join(",")
414
+ }
415
+ if (x) try {
416
+ return M.apply(n, y.querySelectorAll(x)), n
417
+ } catch (T) {} finally {
418
+ d || t.removeAttribute("id")
419
+ }
420
+ }
421
+ }
422
+ return kt(e.replace(z, "$1"), t, n, i)
423
+ }
424
+
425
+ function st() {
426
+ var e = [];
427
+
428
+ function t(n, r) {
429
+ return e.push(n += " ") > o.cacheLength && delete t[e.shift()], t[n] = r
430
+ }
431
+ return t
432
+ }
433
+
434
+ function lt(e) {
435
+ return e[b] = !0, e
436
+ }
437
+
438
+ function ut(e) {
439
+ var t = f.createElement("div");
440
+ try {
441
+ return !!e(t)
442
+ } catch (n) {
443
+ return !1
444
+ } finally {
445
+ t.parentNode && t.parentNode.removeChild(t), t = null
446
+ }
447
+ }
448
+
449
+ function ct(e, t) {
450
+ var n = e.split("|"),
451
+ r = e.length;
452
+ while (r--) o.attrHandle[n[r]] = t
453
+ }
454
+
455
+ function pt(e, t) {
456
+ var n = t && e,
457
+ r = n && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || D) - (~e.sourceIndex || D);
458
+ if (r) return r;
459
+ if (n)
460
+ while (n = n.nextSibling)
461
+ if (n === t) return -1;
462
+ return e ? 1 : -1
463
+ }
464
+
465
+ function ft(e) {
466
+ return function (t) {
467
+ var n = t.nodeName.toLowerCase();
468
+ return "input" === n && t.type === e
469
+ }
470
+ }
471
+
472
+ function dt(e) {
473
+ return function (t) {
474
+ var n = t.nodeName.toLowerCase();
475
+ return ("input" === n || "button" === n) && t.type === e
476
+ }
477
+ }
478
+
479
+ function ht(e) {
480
+ return lt(function (t) {
481
+ return t = +t, lt(function (n, r) {
482
+ var i, o = e([], n.length, t),
483
+ a = o.length;
484
+ while (a--) n[i = o[a]] && (n[i] = !(r[i] = n[i]))
485
+ })
486
+ })
487
+ }
488
+ s = at.isXML = function (e) {
489
+ var t = e && (e.ownerDocument || e).documentElement;
490
+ return t ? "HTML" !== t.nodeName : !1
491
+ }, r = at.support = {}, p = at.setDocument = function (e) {
492
+ var n = e ? e.ownerDocument || e : w,
493
+ i = n.defaultView;
494
+ return n !== f && 9 === n.nodeType && n.documentElement ? (f = n, d = n.documentElement, h = !s(n), i && i.attachEvent && i !== i.top && i.attachEvent("onbeforeunload", function () {
495
+ p()
496
+ }), r.attributes = ut(function (e) {
497
+ return e.className = "i", !e.getAttribute("className")
498
+ }), r.getElementsByTagName = ut(function (e) {
499
+ return e.appendChild(n.createComment("")), !e.getElementsByTagName("*").length
500
+ }), r.getElementsByClassName = ut(function (e) {
501
+ return e.innerHTML = "<div class='a'></div><div class='a i'></div>", e.firstChild.className = "i", 2 === e.getElementsByClassName("i").length
502
+ }), r.getById = ut(function (e) {
503
+ return d.appendChild(e).id = b, !n.getElementsByName || !n.getElementsByName(b).length
504
+ }), r.getById ? (o.find.ID = function (e, t) {
505
+ if (typeof t.getElementById !== j && h) {
506
+ var n = t.getElementById(e);
507
+ return n && n.parentNode ? [n] : []
508
+ }
509
+ }, o.filter.ID = function (e) {
510
+ var t = e.replace(rt, it);
511
+ return function (e) {
512
+ return e.getAttribute("id") === t
513
+ }
514
+ }) : (delete o.find.ID, o.filter.ID = function (e) {
515
+ var t = e.replace(rt, it);
516
+ return function (e) {
517
+ var n = typeof e.getAttributeNode !== j && e.getAttributeNode("id");
518
+ return n && n.value === t
519
+ }
520
+ }), o.find.TAG = r.getElementsByTagName ? function (e, n) {
521
+ return typeof n.getElementsByTagName !== j ? n.getElementsByTagName(e) : t
522
+ } : function (e, t) {
523
+ var n, r = [],
524
+ i = 0,
525
+ o = t.getElementsByTagName(e);
526
+ if ("*" === e) {
527
+ while (n = o[i++]) 1 === n.nodeType && r.push(n);
528
+ return r
529
+ }
530
+ return o
531
+ }, o.find.CLASS = r.getElementsByClassName && function (e, n) {
532
+ return typeof n.getElementsByClassName !== j && h ? n.getElementsByClassName(e) : t
533
+ }, m = [], g = [], (r.qsa = K.test(n.querySelectorAll)) && (ut(function (e) {
534
+ e.innerHTML = "<select><option selected=''></option></select>", e.querySelectorAll("[selected]").length || g.push("\\[" + P + "*(?:value|" + B + ")"), e.querySelectorAll(":checked").length || g.push(":checked")
535
+ }), ut(function (e) {
536
+ var t = n.createElement("input");
537
+ t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("t", ""), e.querySelectorAll("[t^='']").length && g.push("[*^$]=" + P + "*(?:''|\"\")"), e.querySelectorAll(":enabled").length || g.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), g.push(",.*:")
538
+ })), (r.matchesSelector = K.test(y = d.webkitMatchesSelector || d.mozMatchesSelector || d.oMatchesSelector || d.msMatchesSelector)) && ut(function (e) {
539
+ r.disconnectedMatch = y.call(e, "div"), y.call(e, "[s!='']:x"), m.push("!=", I)
540
+ }), g = g.length && RegExp(g.join("|")), m = m.length && RegExp(m.join("|")), v = K.test(d.contains) || d.compareDocumentPosition ? function (e, t) {
541
+ var n = 9 === e.nodeType ? e.documentElement : e,
542
+ r = t && t.parentNode;
543
+ return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r)))
544
+ } : function (e, t) {
545
+ if (t)
546
+ while (t = t.parentNode)
547
+ if (t === e) return !0;
548
+ return !1
549
+ }, A = d.compareDocumentPosition ? function (e, t) {
550
+ if (e === t) return S = !0, 0;
551
+ var i = t.compareDocumentPosition && e.compareDocumentPosition && e.compareDocumentPosition(t);
552
+ return i ? 1 & i || !r.sortDetached && t.compareDocumentPosition(e) === i ? e === n || v(w, e) ? -1 : t === n || v(w, t) ? 1 : c ? F.call(c, e) - F.call(c, t) : 0 : 4 & i ? -1 : 1 : e.compareDocumentPosition ? -1 : 1
553
+ } : function (e, t) {
554
+ var r, i = 0,
555
+ o = e.parentNode,
556
+ a = t.parentNode,
557
+ s = [e],
558
+ l = [t];
559
+ if (e === t) return S = !0, 0;
560
+ if (!o || !a) return e === n ? -1 : t === n ? 1 : o ? -1 : a ? 1 : c ? F.call(c, e) - F.call(c, t) : 0;
561
+ if (o === a) return pt(e, t);
562
+ r = e;
563
+ while (r = r.parentNode) s.unshift(r);
564
+ r = t;
565
+ while (r = r.parentNode) l.unshift(r);
566
+ while (s[i] === l[i]) i++;
567
+ return i ? pt(s[i], l[i]) : s[i] === w ? -1 : l[i] === w ? 1 : 0
568
+ }, n) : f
569
+ }, at.matches = function (e, t) {
570
+ return at(e, null, null, t)
571
+ }, at.matchesSelector = function (e, t) {
572
+ if ((e.ownerDocument || e) !== f && p(e), t = t.replace(Y, "='$1']"), !(!r.matchesSelector || !h || m && m.test(t) || g && g.test(t))) try {
573
+ var n = y.call(e, t);
574
+ if (n || r.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n
575
+ } catch (i) {}
576
+ return at(t, f, null, [e]).length > 0
577
+ }, at.contains = function (e, t) {
578
+ return (e.ownerDocument || e) !== f && p(e), v(e, t)
579
+ }, at.attr = function (e, n) {
580
+ (e.ownerDocument || e) !== f && p(e);
581
+ var i = o.attrHandle[n.toLowerCase()],
582
+ a = i && L.call(o.attrHandle, n.toLowerCase()) ? i(e, n, !h) : t;
583
+ return a === t ? r.attributes || !h ? e.getAttribute(n) : (a = e.getAttributeNode(n)) && a.specified ? a.value : null : a
584
+ }, at.error = function (e) {
585
+ throw Error("Syntax error, unrecognized expression: " + e)
586
+ }, at.uniqueSort = function (e) {
587
+ var t, n = [],
588
+ i = 0,
589
+ o = 0;
590
+ if (S = !r.detectDuplicates, c = !r.sortStable && e.slice(0), e.sort(A), S) {
591
+ while (t = e[o++]) t === e[o] && (i = n.push(o));
592
+ while (i--) e.splice(n[i], 1)
593
+ }
594
+ return e
595
+ }, a = at.getText = function (e) {
596
+ var t, n = "",
597
+ r = 0,
598
+ i = e.nodeType;
599
+ if (i) {
600
+ if (1 === i || 9 === i || 11 === i) {
601
+ if ("string" == typeof e.textContent) return e.textContent;
602
+ for (e = e.firstChild; e; e = e.nextSibling) n += a(e)
603
+ } else if (3 === i || 4 === i) return e.nodeValue
604
+ } else
605
+ for (; t = e[r]; r++) n += a(t);
606
+ return n
607
+ }, o = at.selectors = {
608
+ cacheLength: 50,
609
+ createPseudo: lt,
610
+ match: Q,
611
+ attrHandle: {},
612
+ find: {},
613
+ relative: {
614
+ ">": {
615
+ dir: "parentNode",
616
+ first: !0
617
+ },
618
+ " ": {
619
+ dir: "parentNode"
620
+ },
621
+ "+": {
622
+ dir: "previousSibling",
623
+ first: !0
624
+ },
625
+ "~": {
626
+ dir: "previousSibling"
627
+ }
628
+ },
629
+ preFilter: {
630
+ ATTR: function (e) {
631
+ return e[1] = e[1].replace(rt, it), e[3] = (e[4] || e[5] || "").replace(rt, it), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4)
632
+ },
633
+ CHILD: function (e) {
634
+ return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || at.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && at.error(e[0]), e
635
+ },
636
+ PSEUDO: function (e) {
637
+ var n, r = !e[5] && e[2];
638
+ return Q.CHILD.test(e[0]) ? null : (e[3] && e[4] !== t ? e[2] = e[4] : r && J.test(r) && (n = mt(r, !0)) && (n = r.indexOf(")", r.length - n) - r.length) && (e[0] = e[0].slice(0, n), e[2] = r.slice(0, n)), e.slice(0, 3))
639
+ }
640
+ },
641
+ filter: {
642
+ TAG: function (e) {
643
+ var t = e.replace(rt, it).toLowerCase();
644
+ return "*" === e ? function () {
645
+ return !0
646
+ } : function (e) {
647
+ return e.nodeName && e.nodeName.toLowerCase() === t
648
+ }
649
+ },
650
+ CLASS: function (e) {
651
+ var t = N[e + " "];
652
+ return t || (t = RegExp("(^|" + P + ")" + e + "(" + P + "|$)")) && N(e, function (e) {
653
+ return t.test("string" == typeof e.className && e.className || typeof e.getAttribute !== j && e.getAttribute("class") || "")
654
+ })
655
+ },
656
+ ATTR: function (e, t, n) {
657
+ return function (r) {
658
+ var i = at.attr(r, e);
659
+ return null == i ? "!=" === t : t ? (i += "", "=" === t ? i === n : "!=" === t ? i !== n : "^=" === t ? n && 0 === i.indexOf(n) : "*=" === t ? n && i.indexOf(n) > -1 : "$=" === t ? n && i.slice(-n.length) === n : "~=" === t ? (" " + i + " ").indexOf(n) > -1 : "|=" === t ? i === n || i.slice(0, n.length + 1) === n + "-" : !1) : !0
660
+ }
661
+ },
662
+ CHILD: function (e, t, n, r, i) {
663
+ var o = "nth" !== e.slice(0, 3),
664
+ a = "last" !== e.slice(-4),
665
+ s = "of-type" === t;
666
+ return 1 === r && 0 === i ? function (e) {
667
+ return !!e.parentNode
668
+ } : function (t, n, l) {
669
+ var u, c, p, f, d, h, g = o !== a ? "nextSibling" : "previousSibling",
670
+ m = t.parentNode,
671
+ y = s && t.nodeName.toLowerCase(),
672
+ v = !l && !s;
673
+ if (m) {
674
+ if (o) {
675
+ while (g) {
676
+ p = t;
677
+ while (p = p[g])
678
+ if (s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) return !1;
679
+ h = g = "only" === e && !h && "nextSibling"
680
+ }
681
+ return !0
682
+ }
683
+ if (h = [a ? m.firstChild : m.lastChild], a && v) {
684
+ c = m[b] || (m[b] = {}), u = c[e] || [], d = u[0] === T && u[1], f = u[0] === T && u[2], p = d && m.childNodes[d];
685
+ while (p = ++d && p && p[g] || (f = d = 0) || h.pop())
686
+ if (1 === p.nodeType && ++f && p === t) {
687
+ c[e] = [T, d, f];
688
+ break
689
+ }
690
+ } else if (v && (u = (t[b] || (t[b] = {}))[e]) && u[0] === T) f = u[1];
691
+ else
692
+ while (p = ++d && p && p[g] || (f = d = 0) || h.pop())
693
+ if ((s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) && ++f && (v && ((p[b] || (p[b] = {}))[e] = [T, f]), p === t)) break; return f -= i, f === r || 0 === f % r && f / r >= 0
694
+ }
695
+ }
696
+ },
697
+ PSEUDO: function (e, t) {
698
+ var n, r = o.pseudos[e] || o.setFilters[e.toLowerCase()] || at.error("unsupported pseudo: " + e);
699
+ return r[b] ? r(t) : r.length > 1 ? (n = [e, e, "", t], o.setFilters.hasOwnProperty(e.toLowerCase()) ? lt(function (e, n) {
700
+ var i, o = r(e, t),
701
+ a = o.length;
702
+ while (a--) i = F.call(e, o[a]), e[i] = !(n[i] = o[a])
703
+ }) : function (e) {
704
+ return r(e, 0, n)
705
+ }) : r
706
+ }
707
+ },
708
+ pseudos: {
709
+ not: lt(function (e) {
710
+ var t = [],
711
+ n = [],
712
+ r = l(e.replace(z, "$1"));
713
+ return r[b] ? lt(function (e, t, n, i) {
714
+ var o, a = r(e, null, i, []),
715
+ s = e.length;
716
+ while (s--)(o = a[s]) && (e[s] = !(t[s] = o))
717
+ }) : function (e, i, o) {
718
+ return t[0] = e, r(t, null, o, n), !n.pop()
719
+ }
720
+ }),
721
+ has: lt(function (e) {
722
+ return function (t) {
723
+ return at(e, t).length > 0
724
+ }
725
+ }),
726
+ contains: lt(function (e) {
727
+ return function (t) {
728
+ return (t.textContent || t.innerText || a(t)).indexOf(e) > -1
729
+ }
730
+ }),
731
+ lang: lt(function (e) {
732
+ return G.test(e || "") || at.error("unsupported lang: " + e), e = e.replace(rt, it).toLowerCase(),
733
+ function (t) {
734
+ var n;
735
+ do
736
+ if (n = h ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return n = n.toLowerCase(), n === e || 0 === n.indexOf(e + "-"); while ((t = t.parentNode) && 1 === t.nodeType);
737
+ return !1
738
+ }
739
+ }),
740
+ target: function (t) {
741
+ var n = e.location && e.location.hash;
742
+ return n && n.slice(1) === t.id
743
+ },
744
+ root: function (e) {
745
+ return e === d
746
+ },
747
+ focus: function (e) {
748
+ return e === f.activeElement && (!f.hasFocus || f.hasFocus()) && !! (e.type || e.href || ~e.tabIndex)
749
+ },
750
+ enabled: function (e) {
751
+ return e.disabled === !1
752
+ },
753
+ disabled: function (e) {
754
+ return e.disabled === !0
755
+ },
756
+ checked: function (e) {
757
+ var t = e.nodeName.toLowerCase();
758
+ return "input" === t && !! e.checked || "option" === t && !! e.selected
759
+ },
760
+ selected: function (e) {
761
+ return e.parentNode && e.parentNode.selectedIndex, e.selected === !0
762
+ },
763
+ empty: function (e) {
764
+ for (e = e.firstChild; e; e = e.nextSibling)
765
+ if (e.nodeName > "@" || 3 === e.nodeType || 4 === e.nodeType) return !1;
766
+ return !0
767
+ },
768
+ parent: function (e) {
769
+ return !o.pseudos.empty(e)
770
+ },
771
+ header: function (e) {
772
+ return tt.test(e.nodeName)
773
+ },
774
+ input: function (e) {
775
+ return et.test(e.nodeName)
776
+ },
777
+ button: function (e) {
778
+ var t = e.nodeName.toLowerCase();
779
+ return "input" === t && "button" === e.type || "button" === t
780
+ },
781
+ text: function (e) {
782
+ var t;
783
+ return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || t.toLowerCase() === e.type)
784
+ },
785
+ first: ht(function () {
786
+ return [0]
787
+ }),
788
+ last: ht(function (e, t) {
789
+ return [t - 1]
790
+ }),
791
+ eq: ht(function (e, t, n) {
792
+ return [0 > n ? n + t : n]
793
+ }),
794
+ even: ht(function (e, t) {
795
+ var n = 0;
796
+ for (; t > n; n += 2) e.push(n);
797
+ return e
798
+ }),
799
+ odd: ht(function (e, t) {
800
+ var n = 1;
801
+ for (; t > n; n += 2) e.push(n);
802
+ return e
803
+ }),
804
+ lt: ht(function (e, t, n) {
805
+ var r = 0 > n ? n + t : n;
806
+ for (; --r >= 0;) e.push(r);
807
+ return e
808
+ }),
809
+ gt: ht(function (e, t, n) {
810
+ var r = 0 > n ? n + t : n;
811
+ for (; t > ++r;) e.push(r);
812
+ return e
813
+ })
814
+ }
815
+ }, o.pseudos.nth = o.pseudos.eq;
816
+ for (n in {
817
+ radio: !0,
818
+ checkbox: !0,
819
+ file: !0,
820
+ password: !0,
821
+ image: !0
822
+ }) o.pseudos[n] = ft(n);
823
+ for (n in {
824
+ submit: !0,
825
+ reset: !0
826
+ }) o.pseudos[n] = dt(n);
827
+
828
+ function gt() {}
829
+ gt.prototype = o.filters = o.pseudos, o.setFilters = new gt;
830
+
831
+ function mt(e, t) {
832
+ var n, r, i, a, s, l, u, c = k[e + " "];
833
+ if (c) return t ? 0 : c.slice(0);
834
+ s = e, l = [], u = o.preFilter;
835
+ while (s) {
836
+ (!n || (r = X.exec(s))) && (r && (s = s.slice(r[0].length) || s), l.push(i = [])), n = !1, (r = U.exec(s)) && (n = r.shift(), i.push({
837
+ value: n,
838
+ type: r[0].replace(z, " ")
839
+ }), s = s.slice(n.length));
840
+ for (a in o.filter)!(r = Q[a].exec(s)) || u[a] && !(r = u[a](r)) || (n = r.shift(), i.push({
841
+ value: n,
842
+ type: a,
843
+ matches: r
844
+ }), s = s.slice(n.length));
845
+ if (!n) break
846
+ }
847
+ return t ? s.length : s ? at.error(e) : k(e, l).slice(0)
848
+ }
849
+
850
+ function yt(e) {
851
+ var t = 0,
852
+ n = e.length,
853
+ r = "";
854
+ for (; n > t; t++) r += e[t].value;
855
+ return r
856
+ }
857
+
858
+ function vt(e, t, n) {
859
+ var r = t.dir,
860
+ o = n && "parentNode" === r,
861
+ a = C++;
862
+ return t.first ? function (t, n, i) {
863
+ while (t = t[r])
864
+ if (1 === t.nodeType || o) return e(t, n, i)
865
+ } : function (t, n, s) {
866
+ var l, u, c, p = T + " " + a;
867
+ if (s) {
868
+ while (t = t[r])
869
+ if ((1 === t.nodeType || o) && e(t, n, s)) return !0
870
+ } else
871
+ while (t = t[r])
872
+ if (1 === t.nodeType || o)
873
+ if (c = t[b] || (t[b] = {}), (u = c[r]) && u[0] === p) {
874
+ if ((l = u[1]) === !0 || l === i) return l === !0
875
+ } else if (u = c[r] = [p], u[1] = e(t, n, s) || i, u[1] === !0) return !0
876
+ }
877
+ }
878
+
879
+ function bt(e) {
880
+ return e.length > 1 ? function (t, n, r) {
881
+ var i = e.length;
882
+ while (i--)
883
+ if (!e[i](t, n, r)) return !1;
884
+ return !0
885
+ } : e[0]
886
+ }
887
+
888
+ function xt(e, t, n, r, i) {
889
+ var o, a = [],
890
+ s = 0,
891
+ l = e.length,
892
+ u = null != t;
893
+ for (; l > s; s++)(o = e[s]) && (!n || n(o, r, i)) && (a.push(o), u && t.push(s));
894
+ return a
895
+ }
896
+
897
+ function wt(e, t, n, r, i, o) {
898
+ return r && !r[b] && (r = wt(r)), i && !i[b] && (i = wt(i, o)), lt(function (o, a, s, l) {
899
+ var u, c, p, f = [],
900
+ d = [],
901
+ h = a.length,
902
+ g = o || Nt(t || "*", s.nodeType ? [s] : s, []),
903
+ m = !e || !o && t ? g : xt(g, f, e, s, l),
904
+ y = n ? i || (o ? e : h || r) ? [] : a : m;
905
+ if (n && n(m, y, s, l), r) {
906
+ u = xt(y, d), r(u, [], s, l), c = u.length;
907
+ while (c--)(p = u[c]) && (y[d[c]] = !(m[d[c]] = p))
908
+ }
909
+ if (o) {
910
+ if (i || e) {
911
+ if (i) {
912
+ u = [], c = y.length;
913
+ while (c--)(p = y[c]) && u.push(m[c] = p);
914
+ i(null, y = [], u, l)
915
+ }
916
+ c = y.length;
917
+ while (c--)(p = y[c]) && (u = i ? F.call(o, p) : f[c]) > -1 && (o[u] = !(a[u] = p))
918
+ }
919
+ } else y = xt(y === a ? y.splice(h, y.length) : y), i ? i(null, a, y, l) : M.apply(a, y)
920
+ })
921
+ }
922
+
923
+ function Tt(e) {
924
+ var t, n, r, i = e.length,
925
+ a = o.relative[e[0].type],
926
+ s = a || o.relative[" "],
927
+ l = a ? 1 : 0,
928
+ c = vt(function (e) {
929
+ return e === t
930
+ }, s, !0),
931
+ p = vt(function (e) {
932
+ return F.call(t, e) > -1
933
+ }, s, !0),
934
+ f = [
935
+ function (e, n, r) {
936
+ return !a && (r || n !== u) || ((t = n).nodeType ? c(e, n, r) : p(e, n, r))
937
+ }
938
+ ];
939
+ for (; i > l; l++)
940
+ if (n = o.relative[e[l].type]) f = [vt(bt(f), n)];
941
+ else {
942
+ if (n = o.filter[e[l].type].apply(null, e[l].matches), n[b]) {
943
+ for (r = ++l; i > r; r++)
944
+ if (o.relative[e[r].type]) break;
945
+ return wt(l > 1 && bt(f), l > 1 && yt(e.slice(0, l - 1).concat({
946
+ value: " " === e[l - 2].type ? "*" : ""
947
+ })).replace(z, "$1"), n, r > l && Tt(e.slice(l, r)), i > r && Tt(e = e.slice(r)), i > r && yt(e))
948
+ }
949
+ f.push(n)
950
+ }
951
+ return bt(f)
952
+ }
953
+
954
+ function Ct(e, t) {
955
+ var n = 0,
956
+ r = t.length > 0,
957
+ a = e.length > 0,
958
+ s = function (s, l, c, p, d) {
959
+ var h, g, m, y = [],
960
+ v = 0,
961
+ b = "0",
962
+ x = s && [],
963
+ w = null != d,
964
+ C = u,
965
+ N = s || a && o.find.TAG("*", d && l.parentNode || l),
966
+ k = T += null == C ? 1 : Math.random() || .1;
967
+ for (w && (u = l !== f && l, i = n); null != (h = N[b]); b++) {
968
+ if (a && h) {
969
+ g = 0;
970
+ while (m = e[g++])
971
+ if (m(h, l, c)) {
972
+ p.push(h);
973
+ break
974
+ }
975
+ w && (T = k, i = ++n)
976
+ }
977
+ r && ((h = !m && h) && v--, s && x.push(h))
978
+ }
979
+ if (v += b, r && b !== v) {
980
+ g = 0;
981
+ while (m = t[g++]) m(x, y, l, c);
982
+ if (s) {
983
+ if (v > 0)
984
+ while (b--) x[b] || y[b] || (y[b] = q.call(p));
985
+ y = xt(y)
986
+ }
987
+ M.apply(p, y), w && !s && y.length > 0 && v + t.length > 1 && at.uniqueSort(p)
988
+ }
989
+ return w && (T = k, u = C), x
990
+ };
991
+ return r ? lt(s) : s
992
+ }
993
+ l = at.compile = function (e, t) {
994
+ var n, r = [],
995
+ i = [],
996
+ o = E[e + " "];
997
+ if (!o) {
998
+ t || (t = mt(e)), n = t.length;
999
+ while (n--) o = Tt(t[n]), o[b] ? r.push(o) : i.push(o);
1000
+ o = E(e, Ct(i, r))
1001
+ }
1002
+ return o
1003
+ };
1004
+
1005
+ function Nt(e, t, n) {
1006
+ var r = 0,
1007
+ i = t.length;
1008
+ for (; i > r; r++) at(e, t[r], n);
1009
+ return n
1010
+ }
1011
+
1012
+ function kt(e, t, n, i) {
1013
+ var a, s, u, c, p, f = mt(e);
1014
+ if (!i && 1 === f.length) {
1015
+ if (s = f[0] = f[0].slice(0), s.length > 2 && "ID" === (u = s[0]).type && r.getById && 9 === t.nodeType && h && o.relative[s[1].type]) {
1016
+ if (t = (o.find.ID(u.matches[0].replace(rt, it), t) || [])[0], !t) return n;
1017
+ e = e.slice(s.shift().value.length)
1018
+ }
1019
+ a = Q.needsContext.test(e) ? 0 : s.length;
1020
+ while (a--) {
1021
+ if (u = s[a], o.relative[c = u.type]) break;
1022
+ if ((p = o.find[c]) && (i = p(u.matches[0].replace(rt, it), V.test(s[0].type) && t.parentNode || t))) {
1023
+ if (s.splice(a, 1), e = i.length && yt(s), !e) return M.apply(n, i), n;
1024
+ break
1025
+ }
1026
+ }
1027
+ }
1028
+ return l(e, f)(i, t, !h, n, V.test(e)), n
1029
+ }
1030
+ r.sortStable = b.split("").sort(A).join("") === b, r.detectDuplicates = S, p(), r.sortDetached = ut(function (e) {
1031
+ return 1 & e.compareDocumentPosition(f.createElement("div"))
1032
+ }), ut(function (e) {
1033
+ return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href")
1034
+ }) || ct("type|href|height|width", function (e, n, r) {
1035
+ return r ? t : e.getAttribute(n, "type" === n.toLowerCase() ? 1 : 2)
1036
+ }), r.attributes && ut(function (e) {
1037
+ return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value")
1038
+ }) || ct("value", function (e, n, r) {
1039
+ return r || "input" !== e.nodeName.toLowerCase() ? t : e.defaultValue
1040
+ }), ut(function (e) {
1041
+ return null == e.getAttribute("disabled")
1042
+ }) || ct(B, function (e, n, r) {
1043
+ var i;
1044
+ return r ? t : (i = e.getAttributeNode(n)) && i.specified ? i.value : e[n] === !0 ? n.toLowerCase() : null
1045
+ }), x.find = at, x.expr = at.selectors, x.expr[":"] = x.expr.pseudos, x.unique = at.uniqueSort, x.text = at.getText, x.isXMLDoc = at.isXML, x.contains = at.contains
1046
+ }(e);
1047
+ var O = {};
1048
+
1049
+ function F(e) {
1050
+ var t = O[e] = {};
1051
+ return x.each(e.match(T) || [], function (e, n) {
1052
+ t[n] = !0
1053
+ }), t
1054
+ }
1055
+ x.Callbacks = function (e) {
1056
+ e = "string" == typeof e ? O[e] || F(e) : x.extend({}, e);
1057
+ var n, r, i, o, a, s, l = [],
1058
+ u = !e.once && [],
1059
+ c = function (t) {
1060
+ for (r = e.memory && t, i = !0, a = s || 0, s = 0, o = l.length, n = !0; l && o > a; a++)
1061
+ if (l[a].apply(t[0], t[1]) === !1 && e.stopOnFalse) {
1062
+ r = !1;
1063
+ break
1064
+ }
1065
+ n = !1, l && (u ? u.length && c(u.shift()) : r ? l = [] : p.disable())
1066
+ }, p = {
1067
+ add: function () {
1068
+ if (l) {
1069
+ var t = l.length;
1070
+ (function i(t) {
1071
+ x.each(t, function (t, n) {
1072
+ var r = x.type(n);
1073
+ "function" === r ? e.unique && p.has(n) || l.push(n) : n && n.length && "string" !== r && i(n)
1074
+ })
1075
+ })(arguments), n ? o = l.length : r && (s = t, c(r))
1076
+ }
1077
+ return this
1078
+ },
1079
+ remove: function () {
1080
+ return l && x.each(arguments, function (e, t) {
1081
+ var r;
1082
+ while ((r = x.inArray(t, l, r)) > -1) l.splice(r, 1), n && (o >= r && o--, a >= r && a--)
1083
+ }), this
1084
+ },
1085
+ has: function (e) {
1086
+ return e ? x.inArray(e, l) > -1 : !(!l || !l.length)
1087
+ },
1088
+ empty: function () {
1089
+ return l = [], o = 0, this
1090
+ },
1091
+ disable: function () {
1092
+ return l = u = r = t, this
1093
+ },
1094
+ disabled: function () {
1095
+ return !l
1096
+ },
1097
+ lock: function () {
1098
+ return u = t, r || p.disable(), this
1099
+ },
1100
+ locked: function () {
1101
+ return !u
1102
+ },
1103
+ fireWith: function (e, t) {
1104
+ return !l || i && !u || (t = t || [], t = [e, t.slice ? t.slice() : t], n ? u.push(t) : c(t)), this
1105
+ },
1106
+ fire: function () {
1107
+ return p.fireWith(this, arguments), this
1108
+ },
1109
+ fired: function () {
1110
+ return !!i
1111
+ }
1112
+ };
1113
+ return p
1114
+ }, x.extend({
1115
+ Deferred: function (e) {
1116
+ var t = [
1117
+ ["resolve", "done", x.Callbacks("once memory"), "resolved"],
1118
+ ["reject", "fail", x.Callbacks("once memory"), "rejected"],
1119
+ ["notify", "progress", x.Callbacks("memory")]
1120
+ ],
1121
+ n = "pending",
1122
+ r = {
1123
+ state: function () {
1124
+ return n
1125
+ },
1126
+ always: function () {
1127
+ return i.done(arguments).fail(arguments), this
1128
+ },
1129
+ then: function () {
1130
+ var e = arguments;
1131
+ return x.Deferred(function (n) {
1132
+ x.each(t, function (t, o) {
1133
+ var a = o[0],
1134
+ s = x.isFunction(e[t]) && e[t];
1135
+ i[o[1]](function () {
1136
+ var e = s && s.apply(this, arguments);
1137
+ e && x.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[a + "With"](this === r ? n.promise() : this, s ? [e] : arguments)
1138
+ })
1139
+ }), e = null
1140
+ }).promise()
1141
+ },
1142
+ promise: function (e) {
1143
+ return null != e ? x.extend(e, r) : r
1144
+ }
1145
+ }, i = {};
1146
+ return r.pipe = r.then, x.each(t, function (e, o) {
1147
+ var a = o[2],
1148
+ s = o[3];
1149
+ r[o[1]] = a.add, s && a.add(function () {
1150
+ n = s
1151
+ }, t[1 ^ e][2].disable, t[2][2].lock), i[o[0]] = function () {
1152
+ return i[o[0] + "With"](this === i ? r : this, arguments), this
1153
+ }, i[o[0] + "With"] = a.fireWith
1154
+ }), r.promise(i), e && e.call(i, i), i
1155
+ },
1156
+ when: function (e) {
1157
+ var t = 0,
1158
+ n = g.call(arguments),
1159
+ r = n.length,
1160
+ i = 1 !== r || e && x.isFunction(e.promise) ? r : 0,
1161
+ o = 1 === i ? e : x.Deferred(),
1162
+ a = function (e, t, n) {
1163
+ return function (r) {
1164
+ t[e] = this, n[e] = arguments.length > 1 ? g.call(arguments) : r, n === s ? o.notifyWith(t, n) : --i || o.resolveWith(t, n)
1165
+ }
1166
+ }, s, l, u;
1167
+ if (r > 1)
1168
+ for (s = Array(r), l = Array(r), u = Array(r); r > t; t++) n[t] && x.isFunction(n[t].promise) ? n[t].promise().done(a(t, u, n)).fail(o.reject).progress(a(t, l, s)) : --i;
1169
+ return i || o.resolveWith(u, n), o.promise()
1170
+ }
1171
+ }), x.support = function (t) {
1172
+ var n, r, o, s, l, u, c, p, f, d = a.createElement("div");
1173
+ if (d.setAttribute("className", "t"), d.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", n = d.getElementsByTagName("*") || [], r = d.getElementsByTagName("a")[0], !r || !r.style || !n.length) return t;
1174
+ s = a.createElement("select"), u = s.appendChild(a.createElement("option")), o = d.getElementsByTagName("input")[0], r.style.cssText = "top:1px;float:left;opacity:.5", t.getSetAttribute = "t" !== d.className, t.leadingWhitespace = 3 === d.firstChild.nodeType, t.tbody = !d.getElementsByTagName("tbody").length, t.htmlSerialize = !! d.getElementsByTagName("link").length, t.style = /top/.test(r.getAttribute("style")), t.hrefNormalized = "/a" === r.getAttribute("href"), t.opacity = /^0.5/.test(r.style.opacity), t.cssFloat = !! r.style.cssFloat, t.checkOn = !! o.value, t.optSelected = u.selected, t.enctype = !! a.createElement("form").enctype, t.html5Clone = "<:nav></:nav>" !== a.createElement("nav").cloneNode(!0).outerHTML, t.inlineBlockNeedsLayout = !1, t.shrinkWrapBlocks = !1, t.pixelPosition = !1, t.deleteExpando = !0, t.noCloneEvent = !0, t.reliableMarginRight = !0, t.boxSizingReliable = !0, o.checked = !0, t.noCloneChecked = o.cloneNode(!0).checked, s.disabled = !0, t.optDisabled = !u.disabled;
1175
+ try {
1176
+ delete d.test
1177
+ } catch (h) {
1178
+ t.deleteExpando = !1
1179
+ }
1180
+ o = a.createElement("input"), o.setAttribute("value", ""), t.input = "" === o.getAttribute("value"), o.value = "t", o.setAttribute("type", "radio"), t.radioValue = "t" === o.value, o.setAttribute("checked", "t"), o.setAttribute("name", "t"), l = a.createDocumentFragment(), l.appendChild(o), t.appendChecked = o.checked, t.checkClone = l.cloneNode(!0).cloneNode(!0).lastChild.checked, d.attachEvent && (d.attachEvent("onclick", function () {
1181
+ t.noCloneEvent = !1
1182
+ }), d.cloneNode(!0).click());
1183
+ for (f in {
1184
+ submit: !0,
1185
+ change: !0,
1186
+ focusin: !0
1187
+ }) d.setAttribute(c = "on" + f, "t"), t[f + "Bubbles"] = c in e || d.attributes[c].expando === !1;
1188
+ d.style.backgroundClip = "content-box", d.cloneNode(!0).style.backgroundClip = "", t.clearCloneStyle = "content-box" === d.style.backgroundClip;
1189
+ for (f in x(t)) break;
1190
+ return t.ownLast = "0" !== f, x(function () {
1191
+ var n, r, o, s = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
1192
+ l = a.getElementsByTagName("body")[0];
1193
+ l && (n = a.createElement("div"), n.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", l.appendChild(n).appendChild(d), d.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", o = d.getElementsByTagName("td"), o[0].style.cssText = "padding:0;margin:0;border:0;display:none", p = 0 === o[0].offsetHeight, o[0].style.display = "", o[1].style.display = "none", t.reliableHiddenOffsets = p && 0 === o[0].offsetHeight, d.innerHTML = "", d.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", x.swap(l, null != l.style.zoom ? {
1194
+ zoom: 1
1195
+ } : {}, function () {
1196
+ t.boxSizing = 4 === d.offsetWidth
1197
+ }), e.getComputedStyle && (t.pixelPosition = "1%" !== (e.getComputedStyle(d, null) || {}).top, t.boxSizingReliable = "4px" === (e.getComputedStyle(d, null) || {
1198
+ width: "4px"
1199
+ }).width, r = d.appendChild(a.createElement("div")), r.style.cssText = d.style.cssText = s, r.style.marginRight = r.style.width = "0", d.style.width = "1px", t.reliableMarginRight = !parseFloat((e.getComputedStyle(r, null) || {}).marginRight)), typeof d.style.zoom !== i && (d.innerHTML = "", d.style.cssText = s + "width:1px;padding:1px;display:inline;zoom:1", t.inlineBlockNeedsLayout = 3 === d.offsetWidth, d.style.display = "block", d.innerHTML = "<div></div>", d.firstChild.style.width = "5px", t.shrinkWrapBlocks = 3 !== d.offsetWidth, t.inlineBlockNeedsLayout && (l.style.zoom = 1)), l.removeChild(n), n = d = o = r = null)
1200
+ }), n = s = l = u = r = o = null, t
1201
+ }({});
1202
+ var B = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
1203
+ P = /([A-Z])/g;
1204
+
1205
+ function R(e, n, r, i) {
1206
+ if (x.acceptData(e)) {
1207
+ var o, a, s = x.expando,
1208
+ l = e.nodeType,
1209
+ u = l ? x.cache : e,
1210
+ c = l ? e[s] : e[s] && s;
1211
+ if (c && u[c] && (i || u[c].data) || r !== t || "string" != typeof n) return c || (c = l ? e[s] = p.pop() || x.guid++ : s), u[c] || (u[c] = l ? {} : {
1212
+ toJSON: x.noop
1213
+ }), ("object" == typeof n || "function" == typeof n) && (i ? u[c] = x.extend(u[c], n) : u[c].data = x.extend(u[c].data, n)), a = u[c], i || (a.data || (a.data = {}), a = a.data), r !== t && (a[x.camelCase(n)] = r), "string" == typeof n ? (o = a[n], null == o && (o = a[x.camelCase(n)])) : o = a, o
1214
+ }
1215
+ }
1216
+
1217
+ function W(e, t, n) {
1218
+ if (x.acceptData(e)) {
1219
+ var r, i, o = e.nodeType,
1220
+ a = o ? x.cache : e,
1221
+ s = o ? e[x.expando] : x.expando;
1222
+ if (a[s]) {
1223
+ if (t && (r = n ? a[s] : a[s].data)) {
1224
+ x.isArray(t) ? t = t.concat(x.map(t, x.camelCase)) : t in r ? t = [t] : (t = x.camelCase(t), t = t in r ? [t] : t.split(" ")), i = t.length;
1225
+ while (i--) delete r[t[i]];
1226
+ if (n ? !I(r) : !x.isEmptyObject(r)) return
1227
+ }(n || (delete a[s].data, I(a[s]))) && (o ? x.cleanData([e], !0) : x.support.deleteExpando || a != a.window ? delete a[s] : a[s] = null)
1228
+ }
1229
+ }
1230
+ }
1231
+ x.extend({
1232
+ cache: {},
1233
+ noData: {
1234
+ applet: !0,
1235
+ embed: !0,
1236
+ object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
1237
+ },
1238
+ hasData: function (e) {
1239
+ return e = e.nodeType ? x.cache[e[x.expando]] : e[x.expando], !! e && !I(e)
1240
+ },
1241
+ data: function (e, t, n) {
1242
+ return R(e, t, n)
1243
+ },
1244
+ removeData: function (e, t) {
1245
+ return W(e, t)
1246
+ },
1247
+ _data: function (e, t, n) {
1248
+ return R(e, t, n, !0)
1249
+ },
1250
+ _removeData: function (e, t) {
1251
+ return W(e, t, !0)
1252
+ },
1253
+ acceptData: function (e) {
1254
+ if (e.nodeType && 1 !== e.nodeType && 9 !== e.nodeType) return !1;
1255
+ var t = e.nodeName && x.noData[e.nodeName.toLowerCase()];
1256
+ return !t || t !== !0 && e.getAttribute("classid") === t
1257
+ }
1258
+ }), x.fn.extend({
1259
+ data: function (e, n) {
1260
+ var r, i, o = null,
1261
+ a = 0,
1262
+ s = this[0];
1263
+ if (e === t) {
1264
+ if (this.length && (o = x.data(s), 1 === s.nodeType && !x._data(s, "parsedAttrs"))) {
1265
+ for (r = s.attributes; r.length > a; a++) i = r[a].name, 0 === i.indexOf("data-") && (i = x.camelCase(i.slice(5)), $(s, i, o[i]));
1266
+ x._data(s, "parsedAttrs", !0)
1267
+ }
1268
+ return o
1269
+ }
1270
+ return "object" == typeof e ? this.each(function () {
1271
+ x.data(this, e)
1272
+ }) : arguments.length > 1 ? this.each(function () {
1273
+ x.data(this, e, n)
1274
+ }) : s ? $(s, e, x.data(s, e)) : null
1275
+ },
1276
+ removeData: function (e) {
1277
+ return this.each(function () {
1278
+ x.removeData(this, e)
1279
+ })
1280
+ }
1281
+ });
1282
+
1283
+ function $(e, n, r) {
1284
+ if (r === t && 1 === e.nodeType) {
1285
+ var i = "data-" + n.replace(P, "-$1").toLowerCase();
1286
+ if (r = e.getAttribute(i), "string" == typeof r) {
1287
+ try {
1288
+ r = "true" === r ? !0 : "false" === r ? !1 : "null" === r ? null : +r + "" === r ? +r : B.test(r) ? x.parseJSON(r) : r
1289
+ } catch (o) {}
1290
+ x.data(e, n, r)
1291
+ } else r = t
1292
+ }
1293
+ return r
1294
+ }
1295
+
1296
+ function I(e) {
1297
+ var t;
1298
+ for (t in e)
1299
+ if (("data" !== t || !x.isEmptyObject(e[t])) && "toJSON" !== t) return !1;
1300
+ return !0
1301
+ }
1302
+ x.extend({
1303
+ queue: function (e, n, r) {
1304
+ var i;
1305
+ return e ? (n = (n || "fx") + "queue", i = x._data(e, n), r && (!i || x.isArray(r) ? i = x._data(e, n, x.makeArray(r)) : i.push(r)), i || []) : t
1306
+ },
1307
+ dequeue: function (e, t) {
1308
+ t = t || "fx";
1309
+ var n = x.queue(e, t),
1310
+ r = n.length,
1311
+ i = n.shift(),
1312
+ o = x._queueHooks(e, t),
1313
+ a = function () {
1314
+ x.dequeue(e, t)
1315
+ };
1316
+ "inprogress" === i && (i = n.shift(), r--), i && ("fx" === t && n.unshift("inprogress"), delete o.stop, i.call(e, a, o)), !r && o && o.empty.fire()
1317
+ },
1318
+ _queueHooks: function (e, t) {
1319
+ var n = t + "queueHooks";
1320
+ return x._data(e, n) || x._data(e, n, {
1321
+ empty: x.Callbacks("once memory").add(function () {
1322
+ x._removeData(e, t + "queue"), x._removeData(e, n)
1323
+ })
1324
+ })
1325
+ }
1326
+ }), x.fn.extend({
1327
+ queue: function (e, n) {
1328
+ var r = 2;
1329
+ return "string" != typeof e && (n = e, e = "fx", r--), r > arguments.length ? x.queue(this[0], e) : n === t ? this : this.each(function () {
1330
+ var t = x.queue(this, e, n);
1331
+ x._queueHooks(this, e), "fx" === e && "inprogress" !== t[0] && x.dequeue(this, e)
1332
+ })
1333
+ },
1334
+ dequeue: function (e) {
1335
+ return this.each(function () {
1336
+ x.dequeue(this, e)
1337
+ })
1338
+ },
1339
+ delay: function (e, t) {
1340
+ return e = x.fx ? x.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function (t, n) {
1341
+ var r = setTimeout(t, e);
1342
+ n.stop = function () {
1343
+ clearTimeout(r)
1344
+ }
1345
+ })
1346
+ },
1347
+ clearQueue: function (e) {
1348
+ return this.queue(e || "fx", [])
1349
+ },
1350
+ promise: function (e, n) {
1351
+ var r, i = 1,
1352
+ o = x.Deferred(),
1353
+ a = this,
1354
+ s = this.length,
1355
+ l = function () {
1356
+ --i || o.resolveWith(a, [a])
1357
+ };
1358
+ "string" != typeof e && (n = e, e = t), e = e || "fx";
1359
+ while (s--) r = x._data(a[s], e + "queueHooks"), r && r.empty && (i++, r.empty.add(l));
1360
+ return l(), o.promise(n)
1361
+ }
1362
+ });
1363
+ var z, X, U = /[\t\r\n\f]/g,
1364
+ V = /\r/g,
1365
+ Y = /^(?:input|select|textarea|button|object)$/i,
1366
+ J = /^(?:a|area)$/i,
1367
+ G = /^(?:checked|selected)$/i,
1368
+ Q = x.support.getSetAttribute,
1369
+ K = x.support.input;
1370
+ x.fn.extend({
1371
+ attr: function (e, t) {
1372
+ return x.access(this, x.attr, e, t, arguments.length > 1)
1373
+ },
1374
+ removeAttr: function (e) {
1375
+ return this.each(function () {
1376
+ x.removeAttr(this, e)
1377
+ })
1378
+ },
1379
+ prop: function (e, t) {
1380
+ return x.access(this, x.prop, e, t, arguments.length > 1)
1381
+ },
1382
+ removeProp: function (e) {
1383
+ return e = x.propFix[e] || e, this.each(function () {
1384
+ try {
1385
+ this[e] = t, delete this[e]
1386
+ } catch (n) {}
1387
+ })
1388
+ },
1389
+ addClass: function (e) {
1390
+ var t, n, r, i, o, a = 0,
1391
+ s = this.length,
1392
+ l = "string" == typeof e && e;
1393
+ if (x.isFunction(e)) return this.each(function (t) {
1394
+ x(this).addClass(e.call(this, t, this.className))
1395
+ });
1396
+ if (l)
1397
+ for (t = (e || "").match(T) || []; s > a; a++)
1398
+ if (n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(U, " ") : " ")) {
1399
+ o = 0;
1400
+ while (i = t[o++]) 0 > r.indexOf(" " + i + " ") && (r += i + " ");
1401
+ n.className = x.trim(r)
1402
+ }
1403
+ return this
1404
+ },
1405
+ removeClass: function (e) {
1406
+ var t, n, r, i, o, a = 0,
1407
+ s = this.length,
1408
+ l = 0 === arguments.length || "string" == typeof e && e;
1409
+ if (x.isFunction(e)) return this.each(function (t) {
1410
+ x(this).removeClass(e.call(this, t, this.className))
1411
+ });
1412
+ if (l)
1413
+ for (t = (e || "").match(T) || []; s > a; a++)
1414
+ if (n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(U, " ") : "")) {
1415
+ o = 0;
1416
+ while (i = t[o++])
1417
+ while (r.indexOf(" " + i + " ") >= 0) r = r.replace(" " + i + " ", " ");
1418
+ n.className = e ? x.trim(r) : ""
1419
+ }
1420
+ return this
1421
+ },
1422
+ toggleClass: function (e, t) {
1423
+ var n = typeof e;
1424
+ return "boolean" == typeof t && "string" === n ? t ? this.addClass(e) : this.removeClass(e) : x.isFunction(e) ? this.each(function (n) {
1425
+ x(this).toggleClass(e.call(this, n, this.className, t), t)
1426
+ }) : this.each(function () {
1427
+ if ("string" === n) {
1428
+ var t, r = 0,
1429
+ o = x(this),
1430
+ a = e.match(T) || [];
1431
+ while (t = a[r++]) o.hasClass(t) ? o.removeClass(t) : o.addClass(t)
1432
+ } else(n === i || "boolean" === n) && (this.className && x._data(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : x._data(this, "__className__") || "")
1433
+ })
1434
+ },
1435
+ hasClass: function (e) {
1436
+ var t = " " + e + " ",
1437
+ n = 0,
1438
+ r = this.length;
1439
+ for (; r > n; n++)
1440
+ if (1 === this[n].nodeType && (" " + this[n].className + " ").replace(U, " ").indexOf(t) >= 0) return !0;
1441
+ return !1
1442
+ },
1443
+ val: function (e) {
1444
+ var n, r, i, o = this[0]; {
1445
+ if (arguments.length) return i = x.isFunction(e), this.each(function (n) {
1446
+ var o;
1447
+ 1 === this.nodeType && (o = i ? e.call(this, n, x(this).val()) : e, null == o ? o = "" : "number" == typeof o ? o += "" : x.isArray(o) && (o = x.map(o, function (e) {
1448
+ return null == e ? "" : e + ""
1449
+ })), r = x.valHooks[this.type] || x.valHooks[this.nodeName.toLowerCase()], r && "set" in r && r.set(this, o, "value") !== t || (this.value = o))
1450
+ });
1451
+ if (o) return r = x.valHooks[o.type] || x.valHooks[o.nodeName.toLowerCase()], r && "get" in r && (n = r.get(o, "value")) !== t ? n : (n = o.value, "string" == typeof n ? n.replace(V, "") : null == n ? "" : n)
1452
+ }
1453
+ }
1454
+ }), x.extend({
1455
+ valHooks: {
1456
+ option: {
1457
+ get: function (e) {
1458
+ var t = x.find.attr(e, "value");
1459
+ return null != t ? t : e.text
1460
+ }
1461
+ },
1462
+ select: {
1463
+ get: function (e) {
1464
+ var t, n, r = e.options,
1465
+ i = e.selectedIndex,
1466
+ o = "select-one" === e.type || 0 > i,
1467
+ a = o ? null : [],
1468
+ s = o ? i + 1 : r.length,
1469
+ l = 0 > i ? s : o ? i : 0;
1470
+ for (; s > l; l++)
1471
+ if (n = r[l], !(!n.selected && l !== i || (x.support.optDisabled ? n.disabled : null !== n.getAttribute("disabled")) || n.parentNode.disabled && x.nodeName(n.parentNode, "optgroup"))) {
1472
+ if (t = x(n).val(), o) return t;
1473
+ a.push(t)
1474
+ }
1475
+ return a
1476
+ },
1477
+ set: function (e, t) {
1478
+ var n, r, i = e.options,
1479
+ o = x.makeArray(t),
1480
+ a = i.length;
1481
+ while (a--) r = i[a], (r.selected = x.inArray(x(r).val(), o) >= 0) && (n = !0);
1482
+ return n || (e.selectedIndex = -1), o
1483
+ }
1484
+ }
1485
+ },
1486
+ attr: function (e, n, r) {
1487
+ var o, a, s = e.nodeType;
1488
+ if (e && 3 !== s && 8 !== s && 2 !== s) return typeof e.getAttribute === i ? x.prop(e, n, r) : (1 === s && x.isXMLDoc(e) || (n = n.toLowerCase(), o = x.attrHooks[n] || (x.expr.match.bool.test(n) ? X : z)), r === t ? o && "get" in o && null !== (a = o.get(e, n)) ? a : (a = x.find.attr(e, n), null == a ? t : a) : null !== r ? o && "set" in o && (a = o.set(e, r, n)) !== t ? a : (e.setAttribute(n, r + ""), r) : (x.removeAttr(e, n), t))
1489
+ },
1490
+ removeAttr: function (e, t) {
1491
+ var n, r, i = 0,
1492
+ o = t && t.match(T);
1493
+ if (o && 1 === e.nodeType)
1494
+ while (n = o[i++]) r = x.propFix[n] || n, x.expr.match.bool.test(n) ? K && Q || !G.test(n) ? e[r] = !1 : e[x.camelCase("default-" + n)] = e[r] = !1 : x.attr(e, n, ""), e.removeAttribute(Q ? n : r)
1495
+ },
1496
+ attrHooks: {
1497
+ type: {
1498
+ set: function (e, t) {
1499
+ if (!x.support.radioValue && "radio" === t && x.nodeName(e, "input")) {
1500
+ var n = e.value;
1501
+ return e.setAttribute("type", t), n && (e.value = n), t
1502
+ }
1503
+ }
1504
+ }
1505
+ },
1506
+ propFix: {
1507
+ "for": "htmlFor",
1508
+ "class": "className"
1509
+ },
1510
+ prop: function (e, n, r) {
1511
+ var i, o, a, s = e.nodeType;
1512
+ if (e && 3 !== s && 8 !== s && 2 !== s) return a = 1 !== s || !x.isXMLDoc(e), a && (n = x.propFix[n] || n, o = x.propHooks[n]), r !== t ? o && "set" in o && (i = o.set(e, r, n)) !== t ? i : e[n] = r : o && "get" in o && null !== (i = o.get(e, n)) ? i : e[n]
1513
+ },
1514
+ propHooks: {
1515
+ tabIndex: {
1516
+ get: function (e) {
1517
+ var t = x.find.attr(e, "tabindex");
1518
+ return t ? parseInt(t, 10) : Y.test(e.nodeName) || J.test(e.nodeName) && e.href ? 0 : -1
1519
+ }
1520
+ }
1521
+ }
1522
+ }), X = {
1523
+ set: function (e, t, n) {
1524
+ return t === !1 ? x.removeAttr(e, n) : K && Q || !G.test(n) ? e.setAttribute(!Q && x.propFix[n] || n, n) : e[x.camelCase("default-" + n)] = e[n] = !0, n
1525
+ }
1526
+ }, x.each(x.expr.match.bool.source.match(/\w+/g), function (e, n) {
1527
+ var r = x.expr.attrHandle[n] || x.find.attr;
1528
+ x.expr.attrHandle[n] = K && Q || !G.test(n) ? function (e, n, i) {
1529
+ var o = x.expr.attrHandle[n],
1530
+ a = i ? t : (x.expr.attrHandle[n] = t) != r(e, n, i) ? n.toLowerCase() : null;
1531
+ return x.expr.attrHandle[n] = o, a
1532
+ } : function (e, n, r) {
1533
+ return r ? t : e[x.camelCase("default-" + n)] ? n.toLowerCase() : null
1534
+ }
1535
+ }), K && Q || (x.attrHooks.value = {
1536
+ set: function (e, n, r) {
1537
+ return x.nodeName(e, "input") ? (e.defaultValue = n, t) : z && z.set(e, n, r)
1538
+ }
1539
+ }), Q || (z = {
1540
+ set: function (e, n, r) {
1541
+ var i = e.getAttributeNode(r);
1542
+ return i || e.setAttributeNode(i = e.ownerDocument.createAttribute(r)), i.value = n += "", "value" === r || n === e.getAttribute(r) ? n : t
1543
+ }
1544
+ }, x.expr.attrHandle.id = x.expr.attrHandle.name = x.expr.attrHandle.coords = function (e, n, r) {
1545
+ var i;
1546
+ return r ? t : (i = e.getAttributeNode(n)) && "" !== i.value ? i.value : null
1547
+ }, x.valHooks.button = {
1548
+ get: function (e, n) {
1549
+ var r = e.getAttributeNode(n);
1550
+ return r && r.specified ? r.value : t
1551
+ },
1552
+ set: z.set
1553
+ }, x.attrHooks.contenteditable = {
1554
+ set: function (e, t, n) {
1555
+ z.set(e, "" === t ? !1 : t, n)
1556
+ }
1557
+ }, x.each(["width", "height"], function (e, n) {
1558
+ x.attrHooks[n] = {
1559
+ set: function (e, r) {
1560
+ return "" === r ? (e.setAttribute(n, "auto"), r) : t
1561
+ }
1562
+ }
1563
+ })), x.support.hrefNormalized || x.each(["href", "src"], function (e, t) {
1564
+ x.propHooks[t] = {
1565
+ get: function (e) {
1566
+ return e.getAttribute(t, 4)
1567
+ }
1568
+ }
1569
+ }), x.support.style || (x.attrHooks.style = {
1570
+ get: function (e) {
1571
+ return e.style.cssText || t
1572
+ },
1573
+ set: function (e, t) {
1574
+ return e.style.cssText = t + ""
1575
+ }
1576
+ }), x.support.optSelected || (x.propHooks.selected = {
1577
+ get: function (e) {
1578
+ var t = e.parentNode;
1579
+ return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null
1580
+ }
1581
+ }), x.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () {
1582
+ x.propFix[this.toLowerCase()] = this
1583
+ }), x.support.enctype || (x.propFix.enctype = "encoding"), x.each(["radio", "checkbox"], function () {
1584
+ x.valHooks[this] = {
1585
+ set: function (e, n) {
1586
+ return x.isArray(n) ? e.checked = x.inArray(x(e).val(), n) >= 0 : t
1587
+ }
1588
+ }, x.support.checkOn || (x.valHooks[this].get = function (e) {
1589
+ return null === e.getAttribute("value") ? "on" : e.value
1590
+ })
1591
+ });
1592
+ var Z = /^(?:input|select|textarea)$/i,
1593
+ et = /^key/,
1594
+ tt = /^(?:mouse|contextmenu)|click/,
1595
+ nt = /^(?:focusinfocus|focusoutblur)$/,
1596
+ rt = /^([^.]*)(?:\.(.+)|)$/;
1597
+
1598
+ function it() {
1599
+ return !0
1600
+ }
1601
+
1602
+ function ot() {
1603
+ return !1
1604
+ }
1605
+
1606
+ function at() {
1607
+ try {
1608
+ return a.activeElement
1609
+ } catch (e) {}
1610
+ }
1611
+ x.event = {
1612
+ global: {},
1613
+ add: function (e, n, r, o, a) {
1614
+ var s, l, u, c, p, f, d, h, g, m, y, v = x._data(e);
1615
+ if (v) {
1616
+ r.handler && (c = r, r = c.handler, a = c.selector), r.guid || (r.guid = x.guid++), (l = v.events) || (l = v.events = {}), (f = v.handle) || (f = v.handle = function (e) {
1617
+ return typeof x === i || e && x.event.triggered === e.type ? t : x.event.dispatch.apply(f.elem, arguments)
1618
+ }, f.elem = e), n = (n || "").match(T) || [""], u = n.length;
1619
+ while (u--) s = rt.exec(n[u]) || [], g = y = s[1], m = (s[2] || "").split(".").sort(), g && (p = x.event.special[g] || {}, g = (a ? p.delegateType : p.bindType) || g, p = x.event.special[g] || {}, d = x.extend({
1620
+ type: g,
1621
+ origType: y,
1622
+ data: o,
1623
+ handler: r,
1624
+ guid: r.guid,
1625
+ selector: a,
1626
+ needsContext: a && x.expr.match.needsContext.test(a),
1627
+ namespace: m.join(".")
1628
+ }, c), (h = l[g]) || (h = l[g] = [], h.delegateCount = 0, p.setup && p.setup.call(e, o, m, f) !== !1 || (e.addEventListener ? e.addEventListener(g, f, !1) : e.attachEvent && e.attachEvent("on" + g, f))), p.add && (p.add.call(e, d), d.handler.guid || (d.handler.guid = r.guid)), a ? h.splice(h.delegateCount++, 0, d) : h.push(d), x.event.global[g] = !0);
1629
+ e = null
1630
+ }
1631
+ },
1632
+ remove: function (e, t, n, r, i) {
1633
+ var o, a, s, l, u, c, p, f, d, h, g, m = x.hasData(e) && x._data(e);
1634
+ if (m && (c = m.events)) {
1635
+ t = (t || "").match(T) || [""], u = t.length;
1636
+ while (u--)
1637
+ if (s = rt.exec(t[u]) || [], d = g = s[1], h = (s[2] || "").split(".").sort(), d) {
1638
+ p = x.event.special[d] || {}, d = (r ? p.delegateType : p.bindType) || d, f = c[d] || [], s = s[2] && RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), l = o = f.length;
1639
+ while (o--) a = f[o], !i && g !== a.origType || n && n.guid !== a.guid || s && !s.test(a.namespace) || r && r !== a.selector && ("**" !== r || !a.selector) || (f.splice(o, 1), a.selector && f.delegateCount--, p.remove && p.remove.call(e, a));
1640
+ l && !f.length && (p.teardown && p.teardown.call(e, h, m.handle) !== !1 || x.removeEvent(e, d, m.handle), delete c[d])
1641
+ } else
1642
+ for (d in c) x.event.remove(e, d + t[u], n, r, !0);
1643
+ x.isEmptyObject(c) && (delete m.handle, x._removeData(e, "events"))
1644
+ }
1645
+ },
1646
+ trigger: function (n, r, i, o) {
1647
+ var s, l, u, c, p, f, d, h = [i || a],
1648
+ g = v.call(n, "type") ? n.type : n,
1649
+ m = v.call(n, "namespace") ? n.namespace.split(".") : [];
1650
+ if (u = f = i = i || a, 3 !== i.nodeType && 8 !== i.nodeType && !nt.test(g + x.event.triggered) && (g.indexOf(".") >= 0 && (m = g.split("."), g = m.shift(), m.sort()), l = 0 > g.indexOf(":") && "on" + g, n = n[x.expando] ? n : new x.Event(g, "object" == typeof n && n), n.isTrigger = o ? 2 : 3, n.namespace = m.join("."), n.namespace_re = n.namespace ? RegExp("(^|\\.)" + m.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, n.result = t, n.target || (n.target = i), r = null == r ? [n] : x.makeArray(r, [n]), p = x.event.special[g] || {}, o || !p.trigger || p.trigger.apply(i, r) !== !1)) {
1651
+ if (!o && !p.noBubble && !x.isWindow(i)) {
1652
+ for (c = p.delegateType || g, nt.test(c + g) || (u = u.parentNode); u; u = u.parentNode) h.push(u), f = u;
1653
+ f === (i.ownerDocument || a) && h.push(f.defaultView || f.parentWindow || e)
1654
+ }
1655
+ d = 0;
1656
+ while ((u = h[d++]) && !n.isPropagationStopped()) n.type = d > 1 ? c : p.bindType || g, s = (x._data(u, "events") || {})[n.type] && x._data(u, "handle"), s && s.apply(u, r), s = l && u[l], s && x.acceptData(u) && s.apply && s.apply(u, r) === !1 && n.preventDefault();
1657
+ if (n.type = g, !o && !n.isDefaultPrevented() && (!p._default || p._default.apply(h.pop(), r) === !1) && x.acceptData(i) && l && i[g] && !x.isWindow(i)) {
1658
+ f = i[l], f && (i[l] = null), x.event.triggered = g;
1659
+ try {
1660
+ i[g]()
1661
+ } catch (y) {}
1662
+ x.event.triggered = t, f && (i[l] = f)
1663
+ }
1664
+ return n.result
1665
+ }
1666
+ },
1667
+ dispatch: function (e) {
1668
+ e = x.event.fix(e);
1669
+ var n, r, i, o, a, s = [],
1670
+ l = g.call(arguments),
1671
+ u = (x._data(this, "events") || {})[e.type] || [],
1672
+ c = x.event.special[e.type] || {};
1673
+ if (l[0] = e, e.delegateTarget = this, !c.preDispatch || c.preDispatch.call(this, e) !== !1) {
1674
+ s = x.event.handlers.call(this, e, u), n = 0;
1675
+ while ((o = s[n++]) && !e.isPropagationStopped()) {
1676
+ e.currentTarget = o.elem, a = 0;
1677
+ while ((i = o.handlers[a++]) && !e.isImmediatePropagationStopped())(!e.namespace_re || e.namespace_re.test(i.namespace)) && (e.handleObj = i, e.data = i.data, r = ((x.event.special[i.origType] || {}).handle || i.handler).apply(o.elem, l), r !== t && (e.result = r) === !1 && (e.preventDefault(), e.stopPropagation()))
1678
+ }
1679
+ return c.postDispatch && c.postDispatch.call(this, e), e.result
1680
+ }
1681
+ },
1682
+ handlers: function (e, n) {
1683
+ var r, i, o, a, s = [],
1684
+ l = n.delegateCount,
1685
+ u = e.target;
1686
+ if (l && u.nodeType && (!e.button || "click" !== e.type))
1687
+ for (; u != this; u = u.parentNode || this)
1688
+ if (1 === u.nodeType && (u.disabled !== !0 || "click" !== e.type)) {
1689
+ for (o = [], a = 0; l > a; a++) i = n[a], r = i.selector + " ", o[r] === t && (o[r] = i.needsContext ? x(r, this).index(u) >= 0 : x.find(r, this, null, [u]).length), o[r] && o.push(i);
1690
+ o.length && s.push({
1691
+ elem: u,
1692
+ handlers: o
1693
+ })
1694
+ }
1695
+ return n.length > l && s.push({
1696
+ elem: this,
1697
+ handlers: n.slice(l)
1698
+ }), s
1699
+ },
1700
+ fix: function (e) {
1701
+ if (e[x.expando]) return e;
1702
+ var t, n, r, i = e.type,
1703
+ o = e,
1704
+ s = this.fixHooks[i];
1705
+ s || (this.fixHooks[i] = s = tt.test(i) ? this.mouseHooks : et.test(i) ? this.keyHooks : {}), r = s.props ? this.props.concat(s.props) : this.props, e = new x.Event(o), t = r.length;
1706
+ while (t--) n = r[t], e[n] = o[n];
1707
+ return e.target || (e.target = o.srcElement || a), 3 === e.target.nodeType && (e.target = e.target.parentNode), e.metaKey = !! e.metaKey, s.filter ? s.filter(e, o) : e
1708
+ },
1709
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
1710
+ fixHooks: {},
1711
+ keyHooks: {
1712
+ props: "char charCode key keyCode".split(" "),
1713
+ filter: function (e, t) {
1714
+ return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e
1715
+ }
1716
+ },
1717
+ mouseHooks: {
1718
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
1719
+ filter: function (e, n) {
1720
+ var r, i, o, s = n.button,
1721
+ l = n.fromElement;
1722
+ return null == e.pageX && null != n.clientX && (i = e.target.ownerDocument || a, o = i.documentElement, r = i.body, e.pageX = n.clientX + (o && o.scrollLeft || r && r.scrollLeft || 0) - (o && o.clientLeft || r && r.clientLeft || 0), e.pageY = n.clientY + (o && o.scrollTop || r && r.scrollTop || 0) - (o && o.clientTop || r && r.clientTop || 0)), !e.relatedTarget && l && (e.relatedTarget = l === e.target ? n.toElement : l), e.which || s === t || (e.which = 1 & s ? 1 : 2 & s ? 3 : 4 & s ? 2 : 0), e
1723
+ }
1724
+ },
1725
+ special: {
1726
+ load: {
1727
+ noBubble: !0
1728
+ },
1729
+ focus: {
1730
+ trigger: function () {
1731
+ if (this !== at() && this.focus) try {
1732
+ return this.focus(), !1
1733
+ } catch (e) {}
1734
+ },
1735
+ delegateType: "focusin"
1736
+ },
1737
+ blur: {
1738
+ trigger: function () {
1739
+ return this === at() && this.blur ? (this.blur(), !1) : t
1740
+ },
1741
+ delegateType: "focusout"
1742
+ },
1743
+ click: {
1744
+ trigger: function () {
1745
+ return x.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : t
1746
+ },
1747
+ _default: function (e) {
1748
+ return x.nodeName(e.target, "a")
1749
+ }
1750
+ },
1751
+ beforeunload: {
1752
+ postDispatch: function (e) {
1753
+ e.result !== t && (e.originalEvent.returnValue = e.result)
1754
+ }
1755
+ }
1756
+ },
1757
+ simulate: function (e, t, n, r) {
1758
+ var i = x.extend(new x.Event, n, {
1759
+ type: e,
1760
+ isSimulated: !0,
1761
+ originalEvent: {}
1762
+ });
1763
+ r ? x.event.trigger(i, null, t) : x.event.dispatch.call(t, i), i.isDefaultPrevented() && n.preventDefault()
1764
+ }
1765
+ }, x.removeEvent = a.removeEventListener ? function (e, t, n) {
1766
+ e.removeEventListener && e.removeEventListener(t, n, !1)
1767
+ } : function (e, t, n) {
1768
+ var r = "on" + t;
1769
+ e.detachEvent && (typeof e[r] === i && (e[r] = null), e.detachEvent(r, n))
1770
+ }, x.Event = function (e, n) {
1771
+ return this instanceof x.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || e.returnValue === !1 || e.getPreventDefault && e.getPreventDefault() ? it : ot) : this.type = e, n && x.extend(this, n), this.timeStamp = e && e.timeStamp || x.now(), this[x.expando] = !0, t) : new x.Event(e, n)
1772
+ }, x.Event.prototype = {
1773
+ isDefaultPrevented: ot,
1774
+ isPropagationStopped: ot,
1775
+ isImmediatePropagationStopped: ot,
1776
+ preventDefault: function () {
1777
+ var e = this.originalEvent;
1778
+ this.isDefaultPrevented = it, e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1)
1779
+ },
1780
+ stopPropagation: function () {
1781
+ var e = this.originalEvent;
1782
+ this.isPropagationStopped = it, e && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0)
1783
+ },
1784
+ stopImmediatePropagation: function () {
1785
+ this.isImmediatePropagationStopped = it, this.stopPropagation()
1786
+ }
1787
+ }, x.each({
1788
+ mouseenter: "mouseover",
1789
+ mouseleave: "mouseout"
1790
+ }, function (e, t) {
1791
+ x.event.special[e] = {
1792
+ delegateType: t,
1793
+ bindType: t,
1794
+ handle: function (e) {
1795
+ var n, r = this,
1796
+ i = e.relatedTarget,
1797
+ o = e.handleObj;
1798
+ return (!i || i !== r && !x.contains(r, i)) && (e.type = o.origType, n = o.handler.apply(this, arguments), e.type = t), n
1799
+ }
1800
+ }
1801
+ }), x.support.submitBubbles || (x.event.special.submit = {
1802
+ setup: function () {
1803
+ return x.nodeName(this, "form") ? !1 : (x.event.add(this, "click._submit keypress._submit", function (e) {
1804
+ var n = e.target,
1805
+ r = x.nodeName(n, "input") || x.nodeName(n, "button") ? n.form : t;
1806
+ r && !x._data(r, "submitBubbles") && (x.event.add(r, "submit._submit", function (e) {
1807
+ e._submit_bubble = !0
1808
+ }), x._data(r, "submitBubbles", !0))
1809
+ }), t)
1810
+ },
1811
+ postDispatch: function (e) {
1812
+ e._submit_bubble && (delete e._submit_bubble, this.parentNode && !e.isTrigger && x.event.simulate("submit", this.parentNode, e, !0))
1813
+ },
1814
+ teardown: function () {
1815
+ return x.nodeName(this, "form") ? !1 : (x.event.remove(this, "._submit"), t)
1816
+ }
1817
+ }), x.support.changeBubbles || (x.event.special.change = {
1818
+ setup: function () {
1819
+ return Z.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (x.event.add(this, "propertychange._change", function (e) {
1820
+ "checked" === e.originalEvent.propertyName && (this._just_changed = !0)
1821
+ }), x.event.add(this, "click._change", function (e) {
1822
+ this._just_changed && !e.isTrigger && (this._just_changed = !1), x.event.simulate("change", this, e, !0)
1823
+ })), !1) : (x.event.add(this, "beforeactivate._change", function (e) {
1824
+ var t = e.target;
1825
+ Z.test(t.nodeName) && !x._data(t, "changeBubbles") && (x.event.add(t, "change._change", function (e) {
1826
+ !this.parentNode || e.isSimulated || e.isTrigger || x.event.simulate("change", this.parentNode, e, !0)
1827
+ }), x._data(t, "changeBubbles", !0))
1828
+ }), t)
1829
+ },
1830
+ handle: function (e) {
1831
+ var n = e.target;
1832
+ return this !== n || e.isSimulated || e.isTrigger || "radio" !== n.type && "checkbox" !== n.type ? e.handleObj.handler.apply(this, arguments) : t
1833
+ },
1834
+ teardown: function () {
1835
+ return x.event.remove(this, "._change"), !Z.test(this.nodeName)
1836
+ }
1837
+ }), x.support.focusinBubbles || x.each({
1838
+ focus: "focusin",
1839
+ blur: "focusout"
1840
+ }, function (e, t) {
1841
+ var n = 0,
1842
+ r = function (e) {
1843
+ x.event.simulate(t, e.target, x.event.fix(e), !0)
1844
+ };
1845
+ x.event.special[t] = {
1846
+ setup: function () {
1847
+ 0 === n++ && a.addEventListener(e, r, !0)
1848
+ },
1849
+ teardown: function () {
1850
+ 0 === --n && a.removeEventListener(e, r, !0)
1851
+ }
1852
+ }
1853
+ }), x.fn.extend({
1854
+ on: function (e, n, r, i, o) {
1855
+ var a, s;
1856
+ if ("object" == typeof e) {
1857
+ "string" != typeof n && (r = r || n, n = t);
1858
+ for (a in e) this.on(a, n, r, e[a], o);
1859
+ return this
1860
+ }
1861
+ if (null == r && null == i ? (i = n, r = n = t) : null == i && ("string" == typeof n ? (i = r, r = t) : (i = r, r = n, n = t)), i === !1) i = ot;
1862
+ else if (!i) return this;
1863
+ return 1 === o && (s = i, i = function (e) {
1864
+ return x().off(e), s.apply(this, arguments)
1865
+ }, i.guid = s.guid || (s.guid = x.guid++)), this.each(function () {
1866
+ x.event.add(this, e, i, r, n)
1867
+ })
1868
+ },
1869
+ one: function (e, t, n, r) {
1870
+ return this.on(e, t, n, r, 1)
1871
+ },
1872
+ off: function (e, n, r) {
1873
+ var i, o;
1874
+ if (e && e.preventDefault && e.handleObj) return i = e.handleObj, x(e.delegateTarget).off(i.namespace ? i.origType + "." + i.namespace : i.origType, i.selector, i.handler), this;
1875
+ if ("object" == typeof e) {
1876
+ for (o in e) this.off(o, n, e[o]);
1877
+ return this
1878
+ }
1879
+ return (n === !1 || "function" == typeof n) && (r = n, n = t), r === !1 && (r = ot), this.each(function () {
1880
+ x.event.remove(this, e, r, n)
1881
+ })
1882
+ },
1883
+ trigger: function (e, t) {
1884
+ return this.each(function () {
1885
+ x.event.trigger(e, t, this)
1886
+ })
1887
+ },
1888
+ triggerHandler: function (e, n) {
1889
+ var r = this[0];
1890
+ return r ? x.event.trigger(e, n, r, !0) : t
1891
+ }
1892
+ });
1893
+ var st = /^.[^:#\[\.,]*$/,
1894
+ lt = /^(?:parents|prev(?:Until|All))/,
1895
+ ut = x.expr.match.needsContext,
1896
+ ct = {
1897
+ children: !0,
1898
+ contents: !0,
1899
+ next: !0,
1900
+ prev: !0
1901
+ };
1902
+ x.fn.extend({
1903
+ find: function (e) {
1904
+ var t, n = [],
1905
+ r = this,
1906
+ i = r.length;
1907
+ if ("string" != typeof e) return this.pushStack(x(e).filter(function () {
1908
+ for (t = 0; i > t; t++)
1909
+ if (x.contains(r[t], this)) return !0
1910
+ }));
1911
+ for (t = 0; i > t; t++) x.find(e, r[t], n);
1912
+ return n = this.pushStack(i > 1 ? x.unique(n) : n), n.selector = this.selector ? this.selector + " " + e : e, n
1913
+ },
1914
+ has: function (e) {
1915
+ var t, n = x(e, this),
1916
+ r = n.length;
1917
+ return this.filter(function () {
1918
+ for (t = 0; r > t; t++)
1919
+ if (x.contains(this, n[t])) return !0
1920
+ })
1921
+ },
1922
+ not: function (e) {
1923
+ return this.pushStack(ft(this, e || [], !0))
1924
+ },
1925
+ filter: function (e) {
1926
+ return this.pushStack(ft(this, e || [], !1))
1927
+ },
1928
+ is: function (e) {
1929
+ return !!ft(this, "string" == typeof e && ut.test(e) ? x(e) : e || [], !1).length
1930
+ },
1931
+ closest: function (e, t) {
1932
+ var n, r = 0,
1933
+ i = this.length,
1934
+ o = [],
1935
+ a = ut.test(e) || "string" != typeof e ? x(e, t || this.context) : 0;
1936
+ for (; i > r; r++)
1937
+ for (n = this[r]; n && n !== t; n = n.parentNode)
1938
+ if (11 > n.nodeType && (a ? a.index(n) > -1 : 1 === n.nodeType && x.find.matchesSelector(n, e))) {
1939
+ n = o.push(n);
1940
+ break
1941
+ }
1942
+ return this.pushStack(o.length > 1 ? x.unique(o) : o)
1943
+ },
1944
+ index: function (e) {
1945
+ return e ? "string" == typeof e ? x.inArray(this[0], x(e)) : x.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
1946
+ },
1947
+ add: function (e, t) {
1948
+ var n = "string" == typeof e ? x(e, t) : x.makeArray(e && e.nodeType ? [e] : e),
1949
+ r = x.merge(this.get(), n);
1950
+ return this.pushStack(x.unique(r))
1951
+ },
1952
+ addBack: function (e) {
1953
+ return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
1954
+ }
1955
+ });
1956
+
1957
+ function pt(e, t) {
1958
+ do e = e[t]; while (e && 1 !== e.nodeType);
1959
+ return e
1960
+ }
1961
+ x.each({
1962
+ parent: function (e) {
1963
+ var t = e.parentNode;
1964
+ return t && 11 !== t.nodeType ? t : null
1965
+ },
1966
+ parents: function (e) {
1967
+ return x.dir(e, "parentNode")
1968
+ },
1969
+ parentsUntil: function (e, t, n) {
1970
+ return x.dir(e, "parentNode", n)
1971
+ },
1972
+ next: function (e) {
1973
+ return pt(e, "nextSibling")
1974
+ },
1975
+ prev: function (e) {
1976
+ return pt(e, "previousSibling")
1977
+ },
1978
+ nextAll: function (e) {
1979
+ return x.dir(e, "nextSibling")
1980
+ },
1981
+ prevAll: function (e) {
1982
+ return x.dir(e, "previousSibling")
1983
+ },
1984
+ nextUntil: function (e, t, n) {
1985
+ return x.dir(e, "nextSibling", n)
1986
+ },
1987
+ prevUntil: function (e, t, n) {
1988
+ return x.dir(e, "previousSibling", n)
1989
+ },
1990
+ siblings: function (e) {
1991
+ return x.sibling((e.parentNode || {}).firstChild, e)
1992
+ },
1993
+ children: function (e) {
1994
+ return x.sibling(e.firstChild)
1995
+ },
1996
+ contents: function (e) {
1997
+ return x.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : x.merge([], e.childNodes)
1998
+ }
1999
+ }, function (e, t) {
2000
+ x.fn[e] = function (n, r) {
2001
+ var i = x.map(this, t, n);
2002
+ return "Until" !== e.slice(-5) && (r = n), r && "string" == typeof r && (i = x.filter(r, i)), this.length > 1 && (ct[e] || (i = x.unique(i)), lt.test(e) && (i = i.reverse())), this.pushStack(i)
2003
+ }
2004
+ }), x.extend({
2005
+ filter: function (e, t, n) {
2006
+ var r = t[0];
2007
+ return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === r.nodeType ? x.find.matchesSelector(r, e) ? [r] : [] : x.find.matches(e, x.grep(t, function (e) {
2008
+ return 1 === e.nodeType
2009
+ }))
2010
+ },
2011
+ dir: function (e, n, r) {
2012
+ var i = [],
2013
+ o = e[n];
2014
+ while (o && 9 !== o.nodeType && (r === t || 1 !== o.nodeType || !x(o).is(r))) 1 === o.nodeType && i.push(o), o = o[n];
2015
+ return i
2016
+ },
2017
+ sibling: function (e, t) {
2018
+ var n = [];
2019
+ for (; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e);
2020
+ return n
2021
+ }
2022
+ });
2023
+
2024
+ function ft(e, t, n) {
2025
+ if (x.isFunction(t)) return x.grep(e, function (e, r) {
2026
+ return !!t.call(e, r, e) !== n
2027
+ });
2028
+ if (t.nodeType) return x.grep(e, function (e) {
2029
+ return e === t !== n
2030
+ });
2031
+ if ("string" == typeof t) {
2032
+ if (st.test(t)) return x.filter(t, e, n);
2033
+ t = x.filter(t, e)
2034
+ }
2035
+ return x.grep(e, function (e) {
2036
+ return x.inArray(e, t) >= 0 !== n
2037
+ })
2038
+ }
2039
+
2040
+ function dt(e) {
2041
+ var t = ht.split("|"),
2042
+ n = e.createDocumentFragment();
2043
+ if (n.createElement)
2044
+ while (t.length) n.createElement(t.pop());
2045
+ return n
2046
+ }
2047
+ var ht = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
2048
+ gt = / jQuery\d+="(?:null|\d+)"/g,
2049
+ mt = RegExp("<(?:" + ht + ")[\\s/>]", "i"),
2050
+ yt = /^\s+/,
2051
+ vt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
2052
+ bt = /<([\w:]+)/,
2053
+ xt = /<tbody/i,
2054
+ wt = /<|&#?\w+;/,
2055
+ Tt = /<(?:script|style|link)/i,
2056
+ Ct = /^(?:checkbox|radio)$/i,
2057
+ Nt = /checked\s*(?:[^=]|=\s*.checked.)/i,
2058
+ kt = /^$|\/(?:java|ecma)script/i,
2059
+ Et = /^true\/(.*)/,
2060
+ St = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
2061
+ At = {
2062
+ option: [1, "<select multiple='multiple'>", "</select>"],
2063
+ legend: [1, "<fieldset>", "</fieldset>"],
2064
+ area: [1, "<map>", "</map>"],
2065
+ param: [1, "<object>", "</object>"],
2066
+ thead: [1, "<table>", "</table>"],
2067
+ tr: [2, "<table><tbody>", "</tbody></table>"],
2068
+ col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
2069
+ td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
2070
+ _default: x.support.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"]
2071
+ }, jt = dt(a),
2072
+ Dt = jt.appendChild(a.createElement("div"));
2073
+ At.optgroup = At.option, At.tbody = At.tfoot = At.colgroup = At.caption = At.thead, At.th = At.td, x.fn.extend({
2074
+ text: function (e) {
2075
+ return x.access(this, function (e) {
2076
+ return e === t ? x.text(this) : this.empty().append((this[0] && this[0].ownerDocument || a).createTextNode(e))
2077
+ }, null, e, arguments.length)
2078
+ },
2079
+ append: function () {
2080
+ return this.domManip(arguments, function (e) {
2081
+ if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
2082
+ var t = Lt(this, e);
2083
+ t.appendChild(e)
2084
+ }
2085
+ })
2086
+ },
2087
+ prepend: function () {
2088
+ return this.domManip(arguments, function (e) {
2089
+ if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
2090
+ var t = Lt(this, e);
2091
+ t.insertBefore(e, t.firstChild)
2092
+ }
2093
+ })
2094
+ },
2095
+ before: function () {
2096
+ return this.domManip(arguments, function (e) {
2097
+ this.parentNode && this.parentNode.insertBefore(e, this)
2098
+ })
2099
+ },
2100
+ after: function () {
2101
+ return this.domManip(arguments, function (e) {
2102
+ this.parentNode && this.parentNode.insertBefore(e, this.nextSibling)
2103
+ })
2104
+ },
2105
+ remove: function (e, t) {
2106
+ var n, r = e ? x.filter(e, this) : this,
2107
+ i = 0;
2108
+ for (; null != (n = r[i]); i++) t || 1 !== n.nodeType || x.cleanData(Ft(n)), n.parentNode && (t && x.contains(n.ownerDocument, n) && _t(Ft(n, "script")), n.parentNode.removeChild(n));
2109
+ return this
2110
+ },
2111
+ empty: function () {
2112
+ var e, t = 0;
2113
+ for (; null != (e = this[t]); t++) {
2114
+ 1 === e.nodeType && x.cleanData(Ft(e, !1));
2115
+ while (e.firstChild) e.removeChild(e.firstChild);
2116
+ e.options && x.nodeName(e, "select") && (e.options.length = 0)
2117
+ }
2118
+ return this
2119
+ },
2120
+ clone: function (e, t) {
2121
+ return e = null == e ? !1 : e, t = null == t ? e : t, this.map(function () {
2122
+ return x.clone(this, e, t)
2123
+ })
2124
+ },
2125
+ html: function (e) {
2126
+ return x.access(this, function (e) {
2127
+ var n = this[0] || {}, r = 0,
2128
+ i = this.length;
2129
+ if (e === t) return 1 === n.nodeType ? n.innerHTML.replace(gt, "") : t;
2130
+ if (!("string" != typeof e || Tt.test(e) || !x.support.htmlSerialize && mt.test(e) || !x.support.leadingWhitespace && yt.test(e) || At[(bt.exec(e) || ["", ""])[1].toLowerCase()])) {
2131
+ e = e.replace(vt, "<$1></$2>");
2132
+ try {
2133
+ for (; i > r; r++) n = this[r] || {}, 1 === n.nodeType && (x.cleanData(Ft(n, !1)), n.innerHTML = e);
2134
+ n = 0
2135
+ } catch (o) {}
2136
+ }
2137
+ n && this.empty().append(e)
2138
+ }, null, e, arguments.length)
2139
+ },
2140
+ replaceWith: function () {
2141
+ var e = x.map(this, function (e) {
2142
+ return [e.nextSibling, e.parentNode]
2143
+ }),
2144
+ t = 0;
2145
+ return this.domManip(arguments, function (n) {
2146
+ var r = e[t++],
2147
+ i = e[t++];
2148
+ i && (r && r.parentNode !== i && (r = this.nextSibling), x(this).remove(), i.insertBefore(n, r))
2149
+ }, !0), t ? this : this.remove()
2150
+ },
2151
+ detach: function (e) {
2152
+ return this.remove(e, !0)
2153
+ },
2154
+ domManip: function (e, t, n) {
2155
+ e = d.apply([], e);
2156
+ var r, i, o, a, s, l, u = 0,
2157
+ c = this.length,
2158
+ p = this,
2159
+ f = c - 1,
2160
+ h = e[0],
2161
+ g = x.isFunction(h);
2162
+ if (g || !(1 >= c || "string" != typeof h || x.support.checkClone) && Nt.test(h)) return this.each(function (r) {
2163
+ var i = p.eq(r);
2164
+ g && (e[0] = h.call(this, r, i.html())), i.domManip(e, t, n)
2165
+ });
2166
+ if (c && (l = x.buildFragment(e, this[0].ownerDocument, !1, !n && this), r = l.firstChild, 1 === l.childNodes.length && (l = r), r)) {
2167
+ for (a = x.map(Ft(l, "script"), Ht), o = a.length; c > u; u++) i = l, u !== f && (i = x.clone(i, !0, !0), o && x.merge(a, Ft(i, "script"))), t.call(this[u], i, u);
2168
+ if (o)
2169
+ for (s = a[a.length - 1].ownerDocument, x.map(a, qt), u = 0; o > u; u++) i = a[u], kt.test(i.type || "") && !x._data(i, "globalEval") && x.contains(s, i) && (i.src ? x._evalUrl(i.src) : x.globalEval((i.text || i.textContent || i.innerHTML || "").replace(St, "")));
2170
+ l = r = null
2171
+ }
2172
+ return this
2173
+ }
2174
+ });
2175
+
2176
+ function Lt(e, t) {
2177
+ return x.nodeName(e, "table") && x.nodeName(1 === t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e
2178
+ }
2179
+
2180
+ function Ht(e) {
2181
+ return e.type = (null !== x.find.attr(e, "type")) + "/" + e.type, e
2182
+ }
2183
+
2184
+ function qt(e) {
2185
+ var t = Et.exec(e.type);
2186
+ return t ? e.type = t[1] : e.removeAttribute("type"), e
2187
+ }
2188
+
2189
+ function _t(e, t) {
2190
+ var n, r = 0;
2191
+ for (; null != (n = e[r]); r++) x._data(n, "globalEval", !t || x._data(t[r], "globalEval"))
2192
+ }
2193
+
2194
+ function Mt(e, t) {
2195
+ if (1 === t.nodeType && x.hasData(e)) {
2196
+ var n, r, i, o = x._data(e),
2197
+ a = x._data(t, o),
2198
+ s = o.events;
2199
+ if (s) {
2200
+ delete a.handle, a.events = {};
2201
+ for (n in s)
2202
+ for (r = 0, i = s[n].length; i > r; r++) x.event.add(t, n, s[n][r])
2203
+ }
2204
+ a.data && (a.data = x.extend({}, a.data))
2205
+ }
2206
+ }
2207
+
2208
+ function Ot(e, t) {
2209
+ var n, r, i;
2210
+ if (1 === t.nodeType) {
2211
+ if (n = t.nodeName.toLowerCase(), !x.support.noCloneEvent && t[x.expando]) {
2212
+ i = x._data(t);
2213
+ for (r in i.events) x.removeEvent(t, r, i.handle);
2214
+ t.removeAttribute(x.expando)
2215
+ }
2216
+ "script" === n && t.text !== e.text ? (Ht(t).text = e.text, qt(t)) : "object" === n ? (t.parentNode && (t.outerHTML = e.outerHTML), x.support.html5Clone && e.innerHTML && !x.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : "input" === n && Ct.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : "option" === n ? t.defaultSelected = t.selected = e.defaultSelected : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue)
2217
+ }
2218
+ }
2219
+ x.each({
2220
+ appendTo: "append",
2221
+ prependTo: "prepend",
2222
+ insertBefore: "before",
2223
+ insertAfter: "after",
2224
+ replaceAll: "replaceWith"
2225
+ }, function (e, t) {
2226
+ x.fn[e] = function (e) {
2227
+ var n, r = 0,
2228
+ i = [],
2229
+ o = x(e),
2230
+ a = o.length - 1;
2231
+ for (; a >= r; r++) n = r === a ? this : this.clone(!0), x(o[r])[t](n), h.apply(i, n.get());
2232
+ return this.pushStack(i)
2233
+ }
2234
+ });
2235
+
2236
+ function Ft(e, n) {
2237
+ var r, o, a = 0,
2238
+ s = typeof e.getElementsByTagName !== i ? e.getElementsByTagName(n || "*") : typeof e.querySelectorAll !== i ? e.querySelectorAll(n || "*") : t;
2239
+ if (!s)
2240
+ for (s = [], r = e.childNodes || e; null != (o = r[a]); a++)!n || x.nodeName(o, n) ? s.push(o) : x.merge(s, Ft(o, n));
2241
+ return n === t || n && x.nodeName(e, n) ? x.merge([e], s) : s
2242
+ }
2243
+
2244
+ function Bt(e) {
2245
+ Ct.test(e.type) && (e.defaultChecked = e.checked)
2246
+ }
2247
+ x.extend({
2248
+ clone: function (e, t, n) {
2249
+ var r, i, o, a, s, l = x.contains(e.ownerDocument, e);
2250
+ if (x.support.html5Clone || x.isXMLDoc(e) || !mt.test("<" + e.nodeName + ">") ? o = e.cloneNode(!0) : (Dt.innerHTML = e.outerHTML, Dt.removeChild(o = Dt.firstChild)), !(x.support.noCloneEvent && x.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || x.isXMLDoc(e)))
2251
+ for (r = Ft(o), s = Ft(e), a = 0; null != (i = s[a]); ++a) r[a] && Ot(i, r[a]);
2252
+ if (t)
2253
+ if (n)
2254
+ for (s = s || Ft(e), r = r || Ft(o), a = 0; null != (i = s[a]); a++) Mt(i, r[a]);
2255
+ else Mt(e, o);
2256
+ return r = Ft(o, "script"), r.length > 0 && _t(r, !l && Ft(e, "script")), r = s = i = null, o
2257
+ },
2258
+ buildFragment: function (e, t, n, r) {
2259
+ var i, o, a, s, l, u, c, p = e.length,
2260
+ f = dt(t),
2261
+ d = [],
2262
+ h = 0;
2263
+ for (; p > h; h++)
2264
+ if (o = e[h], o || 0 === o)
2265
+ if ("object" === x.type(o)) x.merge(d, o.nodeType ? [o] : o);
2266
+ else if (wt.test(o)) {
2267
+ s = s || f.appendChild(t.createElement("div")), l = (bt.exec(o) || ["", ""])[1].toLowerCase(), c = At[l] || At._default, s.innerHTML = c[1] + o.replace(vt, "<$1></$2>") + c[2], i = c[0];
2268
+ while (i--) s = s.lastChild;
2269
+ if (!x.support.leadingWhitespace && yt.test(o) && d.push(t.createTextNode(yt.exec(o)[0])), !x.support.tbody) {
2270
+ o = "table" !== l || xt.test(o) ? "<table>" !== c[1] || xt.test(o) ? 0 : s : s.firstChild, i = o && o.childNodes.length;
2271
+ while (i--) x.nodeName(u = o.childNodes[i], "tbody") && !u.childNodes.length && o.removeChild(u)
2272
+ }
2273
+ x.merge(d, s.childNodes), s.textContent = "";
2274
+ while (s.firstChild) s.removeChild(s.firstChild);
2275
+ s = f.lastChild
2276
+ } else d.push(t.createTextNode(o));
2277
+ s && f.removeChild(s), x.support.appendChecked || x.grep(Ft(d, "input"), Bt), h = 0;
2278
+ while (o = d[h++])
2279
+ if ((!r || -1 === x.inArray(o, r)) && (a = x.contains(o.ownerDocument, o), s = Ft(f.appendChild(o), "script"), a && _t(s), n)) {
2280
+ i = 0;
2281
+ while (o = s[i++]) kt.test(o.type || "") && n.push(o)
2282
+ }
2283
+ return s = null, f
2284
+ },
2285
+ cleanData: function (e, t) {
2286
+ var n, r, o, a, s = 0,
2287
+ l = x.expando,
2288
+ u = x.cache,
2289
+ c = x.support.deleteExpando,
2290
+ f = x.event.special;
2291
+ for (; null != (n = e[s]); s++)
2292
+ if ((t || x.acceptData(n)) && (o = n[l], a = o && u[o])) {
2293
+ if (a.events)
2294
+ for (r in a.events) f[r] ? x.event.remove(n, r) : x.removeEvent(n, r, a.handle);
2295
+ u[o] && (delete u[o], c ? delete n[l] : typeof n.removeAttribute !== i ? n.removeAttribute(l) : n[l] = null, p.push(o))
2296
+ }
2297
+ },
2298
+ _evalUrl: function (e) {
2299
+ return x.ajax({
2300
+ url: e,
2301
+ type: "GET",
2302
+ dataType: "script",
2303
+ async: !1,
2304
+ global: !1,
2305
+ "throws": !0
2306
+ })
2307
+ }
2308
+ }), x.fn.extend({
2309
+ wrapAll: function (e) {
2310
+ if (x.isFunction(e)) return this.each(function (t) {
2311
+ x(this).wrapAll(e.call(this, t))
2312
+ });
2313
+ if (this[0]) {
2314
+ var t = x(e, this[0].ownerDocument).eq(0).clone(!0);
2315
+ this[0].parentNode && t.insertBefore(this[0]), t.map(function () {
2316
+ var e = this;
2317
+ while (e.firstChild && 1 === e.firstChild.nodeType) e = e.firstChild;
2318
+ return e
2319
+ }).append(this)
2320
+ }
2321
+ return this
2322
+ },
2323
+ wrapInner: function (e) {
2324
+ return x.isFunction(e) ? this.each(function (t) {
2325
+ x(this).wrapInner(e.call(this, t))
2326
+ }) : this.each(function () {
2327
+ var t = x(this),
2328
+ n = t.contents();
2329
+ n.length ? n.wrapAll(e) : t.append(e)
2330
+ })
2331
+ },
2332
+ wrap: function (e) {
2333
+ var t = x.isFunction(e);
2334
+ return this.each(function (n) {
2335
+ x(this).wrapAll(t ? e.call(this, n) : e)
2336
+ })
2337
+ },
2338
+ unwrap: function () {
2339
+ return this.parent().each(function () {
2340
+ x.nodeName(this, "body") || x(this).replaceWith(this.childNodes)
2341
+ }).end()
2342
+ }
2343
+ });
2344
+ var Pt, Rt, Wt, $t = /alpha\([^)]*\)/i,
2345
+ It = /opacity\s*=\s*([^)]*)/,
2346
+ zt = /^(top|right|bottom|left)$/,
2347
+ Xt = /^(none|table(?!-c[ea]).+)/,
2348
+ Ut = /^margin/,
2349
+ Vt = RegExp("^(" + w + ")(.*)$", "i"),
2350
+ Yt = RegExp("^(" + w + ")(?!px)[a-z%]+$", "i"),
2351
+ Jt = RegExp("^([+-])=(" + w + ")", "i"),
2352
+ Gt = {
2353
+ BODY: "block"
2354
+ }, Qt = {
2355
+ position: "absolute",
2356
+ visibility: "hidden",
2357
+ display: "block"
2358
+ }, Kt = {
2359
+ letterSpacing: 0,
2360
+ fontWeight: 400
2361
+ }, Zt = ["Top", "Right", "Bottom", "Left"],
2362
+ en = ["Webkit", "O", "Moz", "ms"];
2363
+
2364
+ function tn(e, t) {
2365
+ if (t in e) return t;
2366
+ var n = t.charAt(0).toUpperCase() + t.slice(1),
2367
+ r = t,
2368
+ i = en.length;
2369
+ while (i--)
2370
+ if (t = en[i] + n, t in e) return t;
2371
+ return r
2372
+ }
2373
+
2374
+ function nn(e, t) {
2375
+ return e = t || e, "none" === x.css(e, "display") || !x.contains(e.ownerDocument, e)
2376
+ }
2377
+
2378
+ function rn(e, t) {
2379
+ var n, r, i, o = [],
2380
+ a = 0,
2381
+ s = e.length;
2382
+ for (; s > a; a++) r = e[a], r.style && (o[a] = x._data(r, "olddisplay"), n = r.style.display, t ? (o[a] || "none" !== n || (r.style.display = ""), "" === r.style.display && nn(r) && (o[a] = x._data(r, "olddisplay", ln(r.nodeName)))) : o[a] || (i = nn(r), (n && "none" !== n || !i) && x._data(r, "olddisplay", i ? n : x.css(r, "display"))));
2383
+ for (a = 0; s > a; a++) r = e[a], r.style && (t && "none" !== r.style.display && "" !== r.style.display || (r.style.display = t ? o[a] || "" : "none"));
2384
+ return e
2385
+ }
2386
+ x.fn.extend({
2387
+ css: function (e, n) {
2388
+ return x.access(this, function (e, n, r) {
2389
+ var i, o, a = {}, s = 0;
2390
+ if (x.isArray(n)) {
2391
+ for (o = Rt(e), i = n.length; i > s; s++) a[n[s]] = x.css(e, n[s], !1, o);
2392
+ return a
2393
+ }
2394
+ return r !== t ? x.style(e, n, r) : x.css(e, n)
2395
+ }, e, n, arguments.length > 1)
2396
+ },
2397
+ show: function () {
2398
+ return rn(this, !0)
2399
+ },
2400
+ hide: function () {
2401
+ return rn(this)
2402
+ },
2403
+ toggle: function (e) {
2404
+ return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function () {
2405
+ nn(this) ? x(this).show() : x(this).hide()
2406
+ })
2407
+ }
2408
+ }), x.extend({
2409
+ cssHooks: {
2410
+ opacity: {
2411
+ get: function (e, t) {
2412
+ if (t) {
2413
+ var n = Wt(e, "opacity");
2414
+ return "" === n ? "1" : n
2415
+ }
2416
+ }
2417
+ }
2418
+ },
2419
+ cssNumber: {
2420
+ columnCount: !0,
2421
+ fillOpacity: !0,
2422
+ fontWeight: !0,
2423
+ lineHeight: !0,
2424
+ opacity: !0,
2425
+ order: !0,
2426
+ orphans: !0,
2427
+ widows: !0,
2428
+ zIndex: !0,
2429
+ zoom: !0
2430
+ },
2431
+ cssProps: {
2432
+ "float": x.support.cssFloat ? "cssFloat" : "styleFloat"
2433
+ },
2434
+ style: function (e, n, r, i) {
2435
+ if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
2436
+ var o, a, s, l = x.camelCase(n),
2437
+ u = e.style;
2438
+ if (n = x.cssProps[l] || (x.cssProps[l] = tn(u, l)), s = x.cssHooks[n] || x.cssHooks[l], r === t) return s && "get" in s && (o = s.get(e, !1, i)) !== t ? o : u[n];
2439
+ if (a = typeof r, "string" === a && (o = Jt.exec(r)) && (r = (o[1] + 1) * o[2] + parseFloat(x.css(e, n)), a = "number"), !(null == r || "number" === a && isNaN(r) || ("number" !== a || x.cssNumber[l] || (r += "px"), x.support.clearCloneStyle || "" !== r || 0 !== n.indexOf("background") || (u[n] = "inherit"), s && "set" in s && (r = s.set(e, r, i)) === t))) try {
2440
+ u[n] = r
2441
+ } catch (c) {}
2442
+ }
2443
+ },
2444
+ css: function (e, n, r, i) {
2445
+ var o, a, s, l = x.camelCase(n);
2446
+ return n = x.cssProps[l] || (x.cssProps[l] = tn(e.style, l)), s = x.cssHooks[n] || x.cssHooks[l], s && "get" in s && (a = s.get(e, !0, r)), a === t && (a = Wt(e, n, i)), "normal" === a && n in Kt && (a = Kt[n]), "" === r || r ? (o = parseFloat(a), r === !0 || x.isNumeric(o) ? o || 0 : a) : a
2447
+ }
2448
+ }), e.getComputedStyle ? (Rt = function (t) {
2449
+ return e.getComputedStyle(t, null)
2450
+ }, Wt = function (e, n, r) {
2451
+ var i, o, a, s = r || Rt(e),
2452
+ l = s ? s.getPropertyValue(n) || s[n] : t,
2453
+ u = e.style;
2454
+ return s && ("" !== l || x.contains(e.ownerDocument, e) || (l = x.style(e, n)), Yt.test(l) && Ut.test(n) && (i = u.width, o = u.minWidth, a = u.maxWidth, u.minWidth = u.maxWidth = u.width = l, l = s.width, u.width = i, u.minWidth = o, u.maxWidth = a)), l
2455
+ }) : a.documentElement.currentStyle && (Rt = function (e) {
2456
+ return e.currentStyle
2457
+ }, Wt = function (e, n, r) {
2458
+ var i, o, a, s = r || Rt(e),
2459
+ l = s ? s[n] : t,
2460
+ u = e.style;
2461
+ return null == l && u && u[n] && (l = u[n]), Yt.test(l) && !zt.test(n) && (i = u.left, o = e.runtimeStyle, a = o && o.left, a && (o.left = e.currentStyle.left), u.left = "fontSize" === n ? "1em" : l, l = u.pixelLeft + "px", u.left = i, a && (o.left = a)), "" === l ? "auto" : l
2462
+ });
2463
+
2464
+ function on(e, t, n) {
2465
+ var r = Vt.exec(t);
2466
+ return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : t
2467
+ }
2468
+
2469
+ function an(e, t, n, r, i) {
2470
+ var o = n === (r ? "border" : "content") ? 4 : "width" === t ? 1 : 0,
2471
+ a = 0;
2472
+ for (; 4 > o; o += 2) "margin" === n && (a += x.css(e, n + Zt[o], !0, i)), r ? ("content" === n && (a -= x.css(e, "padding" + Zt[o], !0, i)), "margin" !== n && (a -= x.css(e, "border" + Zt[o] + "Width", !0, i))) : (a += x.css(e, "padding" + Zt[o], !0, i), "padding" !== n && (a += x.css(e, "border" + Zt[o] + "Width", !0, i)));
2473
+ return a
2474
+ }
2475
+
2476
+ function sn(e, t, n) {
2477
+ var r = !0,
2478
+ i = "width" === t ? e.offsetWidth : e.offsetHeight,
2479
+ o = Rt(e),
2480
+ a = x.support.boxSizing && "border-box" === x.css(e, "boxSizing", !1, o);
2481
+ if (0 >= i || null == i) {
2482
+ if (i = Wt(e, t, o), (0 > i || null == i) && (i = e.style[t]), Yt.test(i)) return i;
2483
+ r = a && (x.support.boxSizingReliable || i === e.style[t]), i = parseFloat(i) || 0
2484
+ }
2485
+ return i + an(e, t, n || (a ? "border" : "content"), r, o) + "px"
2486
+ }
2487
+
2488
+ function ln(e) {
2489
+ var t = a,
2490
+ n = Gt[e];
2491
+ return n || (n = un(e, t), "none" !== n && n || (Pt = (Pt || x("<iframe frameborder='0' width='0' height='0'/>").css("cssText", "display:block !important")).appendTo(t.documentElement), t = (Pt[0].contentWindow || Pt[0].contentDocument).document, t.write("<!doctype html><html><body>"), t.close(), n = un(e, t), Pt.detach()), Gt[e] = n), n
2492
+ }
2493
+
2494
+ function un(e, t) {
2495
+ var n = x(t.createElement(e)).appendTo(t.body),
2496
+ r = x.css(n[0], "display");
2497
+ return n.remove(), r
2498
+ }
2499
+ x.each(["height", "width"], function (e, n) {
2500
+ x.cssHooks[n] = {
2501
+ get: function (e, r, i) {
2502
+ return r ? 0 === e.offsetWidth && Xt.test(x.css(e, "display")) ? x.swap(e, Qt, function () {
2503
+ return sn(e, n, i)
2504
+ }) : sn(e, n, i) : t
2505
+ },
2506
+ set: function (e, t, r) {
2507
+ var i = r && Rt(e);
2508
+ return on(e, t, r ? an(e, n, r, x.support.boxSizing && "border-box" === x.css(e, "boxSizing", !1, i), i) : 0)
2509
+ }
2510
+ }
2511
+ }), x.support.opacity || (x.cssHooks.opacity = {
2512
+ get: function (e, t) {
2513
+ return It.test((t && e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : t ? "1" : ""
2514
+ },
2515
+ set: function (e, t) {
2516
+ var n = e.style,
2517
+ r = e.currentStyle,
2518
+ i = x.isNumeric(t) ? "alpha(opacity=" + 100 * t + ")" : "",
2519
+ o = r && r.filter || n.filter || "";
2520
+ n.zoom = 1, (t >= 1 || "" === t) && "" === x.trim(o.replace($t, "")) && n.removeAttribute && (n.removeAttribute("filter"), "" === t || r && !r.filter) || (n.filter = $t.test(o) ? o.replace($t, i) : o + " " + i)
2521
+ }
2522
+ }), x(function () {
2523
+ x.support.reliableMarginRight || (x.cssHooks.marginRight = {
2524
+ get: function (e, n) {
2525
+ return n ? x.swap(e, {
2526
+ display: "inline-block"
2527
+ }, Wt, [e, "marginRight"]) : t
2528
+ }
2529
+ }), !x.support.pixelPosition && x.fn.position && x.each(["top", "left"], function (e, n) {
2530
+ x.cssHooks[n] = {
2531
+ get: function (e, r) {
2532
+ return r ? (r = Wt(e, n), Yt.test(r) ? x(e).position()[n] + "px" : r) : t
2533
+ }
2534
+ }
2535
+ })
2536
+ }), x.expr && x.expr.filters && (x.expr.filters.hidden = function (e) {
2537
+ return 0 >= e.offsetWidth && 0 >= e.offsetHeight || !x.support.reliableHiddenOffsets && "none" === (e.style && e.style.display || x.css(e, "display"))
2538
+ }, x.expr.filters.visible = function (e) {
2539
+ return !x.expr.filters.hidden(e)
2540
+ }), x.each({
2541
+ margin: "",
2542
+ padding: "",
2543
+ border: "Width"
2544
+ }, function (e, t) {
2545
+ x.cssHooks[e + t] = {
2546
+ expand: function (n) {
2547
+ var r = 0,
2548
+ i = {}, o = "string" == typeof n ? n.split(" ") : [n];
2549
+ for (; 4 > r; r++) i[e + Zt[r] + t] = o[r] || o[r - 2] || o[0];
2550
+ return i
2551
+ }
2552
+ }, Ut.test(e) || (x.cssHooks[e + t].set = on)
2553
+ });
2554
+ var cn = /%20/g,
2555
+ pn = /\[\]$/,
2556
+ fn = /\r?\n/g,
2557
+ dn = /^(?:submit|button|image|reset|file)$/i,
2558
+ hn = /^(?:input|select|textarea|keygen)/i;
2559
+ x.fn.extend({
2560
+ serialize: function () {
2561
+ return x.param(this.serializeArray())
2562
+ },
2563
+ serializeArray: function () {
2564
+ return this.map(function () {
2565
+ var e = x.prop(this, "elements");
2566
+ return e ? x.makeArray(e) : this
2567
+ }).filter(function () {
2568
+ var e = this.type;
2569
+ return this.name && !x(this).is(":disabled") && hn.test(this.nodeName) && !dn.test(e) && (this.checked || !Ct.test(e))
2570
+ }).map(function (e, t) {
2571
+ var n = x(this).val();
2572
+ return null == n ? null : x.isArray(n) ? x.map(n, function (e) {
2573
+ return {
2574
+ name: t.name,
2575
+ value: e.replace(fn, "\r\n")
2576
+ }
2577
+ }) : {
2578
+ name: t.name,
2579
+ value: n.replace(fn, "\r\n")
2580
+ }
2581
+ }).get()
2582
+ }
2583
+ }), x.param = function (e, n) {
2584
+ var r, i = [],
2585
+ o = function (e, t) {
2586
+ t = x.isFunction(t) ? t() : null == t ? "" : t, i[i.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t)
2587
+ };
2588
+ if (n === t && (n = x.ajaxSettings && x.ajaxSettings.traditional), x.isArray(e) || e.jquery && !x.isPlainObject(e)) x.each(e, function () {
2589
+ o(this.name, this.value)
2590
+ });
2591
+ else
2592
+ for (r in e) gn(r, e[r], n, o);
2593
+ return i.join("&").replace(cn, "+")
2594
+ };
2595
+
2596
+ function gn(e, t, n, r) {
2597
+ var i;
2598
+ if (x.isArray(t)) x.each(t, function (t, i) {
2599
+ n || pn.test(e) ? r(e, i) : gn(e + "[" + ("object" == typeof i ? t : "") + "]", i, n, r)
2600
+ });
2601
+ else if (n || "object" !== x.type(t)) r(e, t);
2602
+ else
2603
+ for (i in t) gn(e + "[" + i + "]", t[i], n, r)
2604
+ }
2605
+ x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (e, t) {
2606
+ x.fn[t] = function (e, n) {
2607
+ return arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t)
2608
+ }
2609
+ }), x.fn.extend({
2610
+ hover: function (e, t) {
2611
+ return this.mouseenter(e).mouseleave(t || e)
2612
+ },
2613
+ bind: function (e, t, n) {
2614
+ return this.on(e, null, t, n)
2615
+ },
2616
+ unbind: function (e, t) {
2617
+ return this.off(e, null, t)
2618
+ },
2619
+ delegate: function (e, t, n, r) {
2620
+ return this.on(t, e, n, r)
2621
+ },
2622
+ undelegate: function (e, t, n) {
2623
+ return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n)
2624
+ }
2625
+ });
2626
+ var mn, yn, vn = x.now(),
2627
+ bn = /\?/,
2628
+ xn = /#.*$/,
2629
+ wn = /([?&])_=[^&]*/,
2630
+ Tn = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm,
2631
+ Cn = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
2632
+ Nn = /^(?:GET|HEAD)$/,
2633
+ kn = /^\/\//,
2634
+ En = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
2635
+ Sn = x.fn.load,
2636
+ An = {}, jn = {}, Dn = "*/".concat("*");
2637
+ try {
2638
+ yn = o.href
2639
+ } catch (Ln) {
2640
+ yn = a.createElement("a"), yn.href = "", yn = yn.href
2641
+ }
2642
+ mn = En.exec(yn.toLowerCase()) || [];
2643
+
2644
+ function Hn(e) {
2645
+ return function (t, n) {
2646
+ "string" != typeof t && (n = t, t = "*");
2647
+ var r, i = 0,
2648
+ o = t.toLowerCase().match(T) || [];
2649
+ if (x.isFunction(n))
2650
+ while (r = o[i++]) "+" === r[0] ? (r = r.slice(1) || "*", (e[r] = e[r] || []).unshift(n)) : (e[r] = e[r] || []).push(n)
2651
+ }
2652
+ }
2653
+
2654
+ function qn(e, n, r, i) {
2655
+ var o = {}, a = e === jn;
2656
+
2657
+ function s(l) {
2658
+ var u;
2659
+ return o[l] = !0, x.each(e[l] || [], function (e, l) {
2660
+ var c = l(n, r, i);
2661
+ return "string" != typeof c || a || o[c] ? a ? !(u = c) : t : (n.dataTypes.unshift(c), s(c), !1)
2662
+ }), u
2663
+ }
2664
+ return s(n.dataTypes[0]) || !o["*"] && s("*")
2665
+ }
2666
+
2667
+ function _n(e, n) {
2668
+ var r, i, o = x.ajaxSettings.flatOptions || {};
2669
+ for (i in n) n[i] !== t && ((o[i] ? e : r || (r = {}))[i] = n[i]);
2670
+ return r && x.extend(!0, e, r), e
2671
+ }
2672
+ x.fn.load = function (e, n, r) {
2673
+ if ("string" != typeof e && Sn) return Sn.apply(this, arguments);
2674
+ var i, o, a, s = this,
2675
+ l = e.indexOf(" ");
2676
+ return l >= 0 && (i = e.slice(l, e.length), e = e.slice(0, l)), x.isFunction(n) ? (r = n, n = t) : n && "object" == typeof n && (a = "POST"), s.length > 0 && x.ajax({
2677
+ url: e,
2678
+ type: a,
2679
+ dataType: "html",
2680
+ data: n
2681
+ }).done(function (e) {
2682
+ o = arguments, s.html(i ? x("<div>").append(x.parseHTML(e)).find(i) : e)
2683
+ }).complete(r && function (e, t) {
2684
+ s.each(r, o || [e.responseText, t, e])
2685
+ }), this
2686
+ }, x.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (e, t) {
2687
+ x.fn[t] = function (e) {
2688
+ return this.on(t, e)
2689
+ }
2690
+ }), x.extend({
2691
+ active: 0,
2692
+ lastModified: {},
2693
+ etag: {},
2694
+ ajaxSettings: {
2695
+ url: yn,
2696
+ type: "GET",
2697
+ isLocal: Cn.test(mn[1]),
2698
+ global: !0,
2699
+ processData: !0,
2700
+ async: !0,
2701
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
2702
+ accepts: {
2703
+ "*": Dn,
2704
+ text: "text/plain",
2705
+ html: "text/html",
2706
+ xml: "application/xml, text/xml",
2707
+ json: "application/json, text/javascript"
2708
+ },
2709
+ contents: {
2710
+ xml: /xml/,
2711
+ html: /html/,
2712
+ json: /json/
2713
+ },
2714
+ responseFields: {
2715
+ xml: "responseXML",
2716
+ text: "responseText",
2717
+ json: "responseJSON"
2718
+ },
2719
+ converters: {
2720
+ "* text": String,
2721
+ "text html": !0,
2722
+ "text json": x.parseJSON,
2723
+ "text xml": x.parseXML
2724
+ },
2725
+ flatOptions: {
2726
+ url: !0,
2727
+ context: !0
2728
+ }
2729
+ },
2730
+ ajaxSetup: function (e, t) {
2731
+ return t ? _n(_n(e, x.ajaxSettings), t) : _n(x.ajaxSettings, e)
2732
+ },
2733
+ ajaxPrefilter: Hn(An),
2734
+ ajaxTransport: Hn(jn),
2735
+ ajax: function (e, n) {
2736
+ "object" == typeof e && (n = e, e = t), n = n || {};
2737
+ var r, i, o, a, s, l, u, c, p = x.ajaxSetup({}, n),
2738
+ f = p.context || p,
2739
+ d = p.context && (f.nodeType || f.jquery) ? x(f) : x.event,
2740
+ h = x.Deferred(),
2741
+ g = x.Callbacks("once memory"),
2742
+ m = p.statusCode || {}, y = {}, v = {}, b = 0,
2743
+ w = "canceled",
2744
+ C = {
2745
+ readyState: 0,
2746
+ getResponseHeader: function (e) {
2747
+ var t;
2748
+ if (2 === b) {
2749
+ if (!c) {
2750
+ c = {};
2751
+ while (t = Tn.exec(a)) c[t[1].toLowerCase()] = t[2]
2752
+ }
2753
+ t = c[e.toLowerCase()]
2754
+ }
2755
+ return null == t ? null : t
2756
+ },
2757
+ getAllResponseHeaders: function () {
2758
+ return 2 === b ? a : null
2759
+ },
2760
+ setRequestHeader: function (e, t) {
2761
+ var n = e.toLowerCase();
2762
+ return b || (e = v[n] = v[n] || e, y[e] = t), this
2763
+ },
2764
+ overrideMimeType: function (e) {
2765
+ return b || (p.mimeType = e), this
2766
+ },
2767
+ statusCode: function (e) {
2768
+ var t;
2769
+ if (e)
2770
+ if (2 > b)
2771
+ for (t in e) m[t] = [m[t], e[t]];
2772
+ else C.always(e[C.status]);
2773
+ return this
2774
+ },
2775
+ abort: function (e) {
2776
+ var t = e || w;
2777
+ return u && u.abort(t), k(0, t), this
2778
+ }
2779
+ };
2780
+ if (h.promise(C).complete = g.add, C.success = C.done, C.error = C.fail, p.url = ((e || p.url || yn) + "").replace(xn, "").replace(kn, mn[1] + "//"), p.type = n.method || n.type || p.method || p.type, p.dataTypes = x.trim(p.dataType || "*").toLowerCase().match(T) || [""], null == p.crossDomain && (r = En.exec(p.url.toLowerCase()), p.crossDomain = !(!r || r[1] === mn[1] && r[2] === mn[2] && (r[3] || ("http:" === r[1] ? "80" : "443")) === (mn[3] || ("http:" === mn[1] ? "80" : "443")))), p.data && p.processData && "string" != typeof p.data && (p.data = x.param(p.data, p.traditional)), qn(An, p, n, C), 2 === b) return C;
2781
+ l = p.global, l && 0 === x.active++ && x.event.trigger("ajaxStart"), p.type = p.type.toUpperCase(), p.hasContent = !Nn.test(p.type), o = p.url, p.hasContent || (p.data && (o = p.url += (bn.test(o) ? "&" : "?") + p.data, delete p.data), p.cache === !1 && (p.url = wn.test(o) ? o.replace(wn, "$1_=" + vn++) : o + (bn.test(o) ? "&" : "?") + "_=" + vn++)), p.ifModified && (x.lastModified[o] && C.setRequestHeader("If-Modified-Since", x.lastModified[o]), x.etag[o] && C.setRequestHeader("If-None-Match", x.etag[o])), (p.data && p.hasContent && p.contentType !== !1 || n.contentType) && C.setRequestHeader("Content-Type", p.contentType), C.setRequestHeader("Accept", p.dataTypes[0] && p.accepts[p.dataTypes[0]] ? p.accepts[p.dataTypes[0]] + ("*" !== p.dataTypes[0] ? ", " + Dn + "; q=0.01" : "") : p.accepts["*"]);
2782
+ for (i in p.headers) C.setRequestHeader(i, p.headers[i]);
2783
+ if (p.beforeSend && (p.beforeSend.call(f, C, p) === !1 || 2 === b)) return C.abort();
2784
+ w = "abort";
2785
+ for (i in {
2786
+ success: 1,
2787
+ error: 1,
2788
+ complete: 1
2789
+ }) C[i](p[i]);
2790
+ if (u = qn(jn, p, n, C)) {
2791
+ C.readyState = 1, l && d.trigger("ajaxSend", [C, p]), p.async && p.timeout > 0 && (s = setTimeout(function () {
2792
+ C.abort("timeout")
2793
+ }, p.timeout));
2794
+ try {
2795
+ b = 1, u.send(y, k)
2796
+ } catch (N) {
2797
+ if (!(2 > b)) throw N;
2798
+ k(-1, N)
2799
+ }
2800
+ } else k(-1, "No Transport");
2801
+
2802
+ function k(e, n, r, i) {
2803
+ var c, y, v, w, T, N = n;
2804
+ 2 !== b && (b = 2, s && clearTimeout(s), u = t, a = i || "", C.readyState = e > 0 ? 4 : 0, c = e >= 200 && 300 > e || 304 === e, r && (w = Mn(p, C, r)), w = On(p, w, C, c), c ? (p.ifModified && (T = C.getResponseHeader("Last-Modified"), T && (x.lastModified[o] = T), T = C.getResponseHeader("etag"), T && (x.etag[o] = T)), 204 === e || "HEAD" === p.type ? N = "nocontent" : 304 === e ? N = "notmodified" : (N = w.state, y = w.data, v = w.error, c = !v)) : (v = N, (e || !N) && (N = "error", 0 > e && (e = 0))), C.status = e, C.statusText = (n || N) + "", c ? h.resolveWith(f, [y, N, C]) : h.rejectWith(f, [C, N, v]), C.statusCode(m), m = t, l && d.trigger(c ? "ajaxSuccess" : "ajaxError", [C, p, c ? y : v]), g.fireWith(f, [C, N]), l && (d.trigger("ajaxComplete", [C, p]), --x.active || x.event.trigger("ajaxStop")))
2805
+ }
2806
+ return C
2807
+ },
2808
+ getJSON: function (e, t, n) {
2809
+ return x.get(e, t, n, "json")
2810
+ },
2811
+ getScript: function (e, n) {
2812
+ return x.get(e, t, n, "script")
2813
+ }
2814
+ }), x.each(["get", "post"], function (e, n) {
2815
+ x[n] = function (e, r, i, o) {
2816
+ return x.isFunction(r) && (o = o || i, i = r, r = t), x.ajax({
2817
+ url: e,
2818
+ type: n,
2819
+ dataType: o,
2820
+ data: r,
2821
+ success: i
2822
+ })
2823
+ }
2824
+ });
2825
+
2826
+ function Mn(e, n, r) {
2827
+ var i, o, a, s, l = e.contents,
2828
+ u = e.dataTypes;
2829
+ while ("*" === u[0]) u.shift(), o === t && (o = e.mimeType || n.getResponseHeader("Content-Type"));
2830
+ if (o)
2831
+ for (s in l)
2832
+ if (l[s] && l[s].test(o)) {
2833
+ u.unshift(s);
2834
+ break
2835
+ }
2836
+ if (u[0] in r) a = u[0];
2837
+ else {
2838
+ for (s in r) {
2839
+ if (!u[0] || e.converters[s + " " + u[0]]) {
2840
+ a = s;
2841
+ break
2842
+ }
2843
+ i || (i = s)
2844
+ }
2845
+ a = a || i
2846
+ }
2847
+ return a ? (a !== u[0] && u.unshift(a), r[a]) : t
2848
+ }
2849
+
2850
+ function On(e, t, n, r) {
2851
+ var i, o, a, s, l, u = {}, c = e.dataTypes.slice();
2852
+ if (c[1])
2853
+ for (a in e.converters) u[a.toLowerCase()] = e.converters[a];
2854
+ o = c.shift();
2855
+ while (o)
2856
+ if (e.responseFields[o] && (n[e.responseFields[o]] = t), !l && r && e.dataFilter && (t = e.dataFilter(t, e.dataType)), l = o, o = c.shift())
2857
+ if ("*" === o) o = l;
2858
+ else if ("*" !== l && l !== o) {
2859
+ if (a = u[l + " " + o] || u["* " + o], !a)
2860
+ for (i in u)
2861
+ if (s = i.split(" "), s[1] === o && (a = u[l + " " + s[0]] || u["* " + s[0]])) {
2862
+ a === !0 ? a = u[i] : u[i] !== !0 && (o = s[0], c.unshift(s[1]));
2863
+ break
2864
+ }
2865
+ if (a !== !0)
2866
+ if (a && e["throws"]) t = a(t);
2867
+ else try {
2868
+ t = a(t)
2869
+ } catch (p) {
2870
+ return {
2871
+ state: "parsererror",
2872
+ error: a ? p : "No conversion from " + l + " to " + o
2873
+ }
2874
+ }
2875
+ }
2876
+ return {
2877
+ state: "success",
2878
+ data: t
2879
+ }
2880
+ }
2881
+ x.ajaxSetup({
2882
+ accepts: {
2883
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
2884
+ },
2885
+ contents: {
2886
+ script: /(?:java|ecma)script/
2887
+ },
2888
+ converters: {
2889
+ "text script": function (e) {
2890
+ return x.globalEval(e), e
2891
+ }
2892
+ }
2893
+ }), x.ajaxPrefilter("script", function (e) {
2894
+ e.cache === t && (e.cache = !1), e.crossDomain && (e.type = "GET", e.global = !1)
2895
+ }), x.ajaxTransport("script", function (e) {
2896
+ if (e.crossDomain) {
2897
+ var n, r = a.head || x("head")[0] || a.documentElement;
2898
+ return {
2899
+ send: function (t, i) {
2900
+ n = a.createElement("script"), n.async = !0, e.scriptCharset && (n.charset = e.scriptCharset), n.src = e.url, n.onload = n.onreadystatechange = function (e, t) {
2901
+ (t || !n.readyState || /loaded|complete/.test(n.readyState)) && (n.onload = n.onreadystatechange = null, n.parentNode && n.parentNode.removeChild(n), n = null, t || i(200, "success"))
2902
+ }, r.insertBefore(n, r.firstChild)
2903
+ },
2904
+ abort: function () {
2905
+ n && n.onload(t, !0)
2906
+ }
2907
+ }
2908
+ }
2909
+ });
2910
+ var Fn = [],
2911
+ Bn = /(=)\?(?=&|$)|\?\?/;
2912
+ x.ajaxSetup({
2913
+ jsonp: "callback",
2914
+ jsonpCallback: function () {
2915
+ var e = Fn.pop() || x.expando + "_" + vn++;
2916
+ return this[e] = !0, e
2917
+ }
2918
+ }), x.ajaxPrefilter("json jsonp", function (n, r, i) {
2919
+ var o, a, s, l = n.jsonp !== !1 && (Bn.test(n.url) ? "url" : "string" == typeof n.data && !(n.contentType || "").indexOf("application/x-www-form-urlencoded") && Bn.test(n.data) && "data");
2920
+ return l || "jsonp" === n.dataTypes[0] ? (o = n.jsonpCallback = x.isFunction(n.jsonpCallback) ? n.jsonpCallback() : n.jsonpCallback, l ? n[l] = n[l].replace(Bn, "$1" + o) : n.jsonp !== !1 && (n.url += (bn.test(n.url) ? "&" : "?") + n.jsonp + "=" + o), n.converters["script json"] = function () {
2921
+ return s || x.error(o + " was not called"), s[0]
2922
+ }, n.dataTypes[0] = "json", a = e[o], e[o] = function () {
2923
+ s = arguments
2924
+ }, i.always(function () {
2925
+ e[o] = a, n[o] && (n.jsonpCallback = r.jsonpCallback, Fn.push(o)), s && x.isFunction(a) && a(s[0]), s = a = t
2926
+ }), "script") : t
2927
+ });
2928
+ var Pn, Rn, Wn = 0,
2929
+ $n = e.ActiveXObject && function () {
2930
+ var e;
2931
+ for (e in Pn) Pn[e](t, !0)
2932
+ };
2933
+
2934
+ function In() {
2935
+ try {
2936
+ return new e.XMLHttpRequest
2937
+ } catch (t) {}
2938
+ }
2939
+
2940
+ function zn() {
2941
+ try {
2942
+ return new e.ActiveXObject("Microsoft.XMLHTTP")
2943
+ } catch (t) {}
2944
+ }
2945
+ x.ajaxSettings.xhr = e.ActiveXObject ? function () {
2946
+ return !this.isLocal && In() || zn()
2947
+ } : In, Rn = x.ajaxSettings.xhr(), x.support.cors = !! Rn && "withCredentials" in Rn, Rn = x.support.ajax = !! Rn, Rn && x.ajaxTransport(function (n) {
2948
+ if (!n.crossDomain || x.support.cors) {
2949
+ var r;
2950
+ return {
2951
+ send: function (i, o) {
2952
+ var a, s, l = n.xhr();
2953
+ if (n.username ? l.open(n.type, n.url, n.async, n.username, n.password) : l.open(n.type, n.url, n.async), n.xhrFields)
2954
+ for (s in n.xhrFields) l[s] = n.xhrFields[s];
2955
+ n.mimeType && l.overrideMimeType && l.overrideMimeType(n.mimeType), n.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest");
2956
+ try {
2957
+ for (s in i) l.setRequestHeader(s, i[s])
2958
+ } catch (u) {}
2959
+ l.send(n.hasContent && n.data || null), r = function (e, i) {
2960
+ var s, u, c, p;
2961
+ try {
2962
+ if (r && (i || 4 === l.readyState))
2963
+ if (r = t, a && (l.onreadystatechange = x.noop, $n && delete Pn[a]), i) 4 !== l.readyState && l.abort();
2964
+ else {
2965
+ p = {}, s = l.status, u = l.getAllResponseHeaders(), "string" == typeof l.responseText && (p.text = l.responseText);
2966
+ try {
2967
+ c = l.statusText
2968
+ } catch (f) {
2969
+ c = ""
2970
+ }
2971
+ s || !n.isLocal || n.crossDomain ? 1223 === s && (s = 204) : s = p.text ? 200 : 404
2972
+ }
2973
+ } catch (d) {
2974
+ i || o(-1, d)
2975
+ }
2976
+ p && o(s, c, p, u)
2977
+ }, n.async ? 4 === l.readyState ? setTimeout(r) : (a = ++Wn, $n && (Pn || (Pn = {}, x(e).unload($n)), Pn[a] = r), l.onreadystatechange = r) : r()
2978
+ },
2979
+ abort: function () {
2980
+ r && r(t, !0)
2981
+ }
2982
+ }
2983
+ }
2984
+ });
2985
+ var Xn, Un, Vn = /^(?:toggle|show|hide)$/,
2986
+ Yn = RegExp("^(?:([+-])=|)(" + w + ")([a-z%]*)$", "i"),
2987
+ Jn = /queueHooks$/,
2988
+ Gn = [nr],
2989
+ Qn = {
2990
+ "*": [
2991
+ function (e, t) {
2992
+ var n = this.createTween(e, t),
2993
+ r = n.cur(),
2994
+ i = Yn.exec(t),
2995
+ o = i && i[3] || (x.cssNumber[e] ? "" : "px"),
2996
+ a = (x.cssNumber[e] || "px" !== o && +r) && Yn.exec(x.css(n.elem, e)),
2997
+ s = 1,
2998
+ l = 20;
2999
+ if (a && a[3] !== o) {
3000
+ o = o || a[3], i = i || [], a = +r || 1;
3001
+ do s = s || ".5", a /= s, x.style(n.elem, e, a + o); while (s !== (s = n.cur() / r) && 1 !== s && --l)
3002
+ }
3003
+ return i && (a = n.start = +a || +r || 0, n.unit = o, n.end = i[1] ? a + (i[1] + 1) * i[2] : +i[2]), n
3004
+ }
3005
+ ]
3006
+ };
3007
+
3008
+ function Kn() {
3009
+ return setTimeout(function () {
3010
+ Xn = t
3011
+ }), Xn = x.now()
3012
+ }
3013
+
3014
+ function Zn(e, t, n) {
3015
+ var r, i = (Qn[t] || []).concat(Qn["*"]),
3016
+ o = 0,
3017
+ a = i.length;
3018
+ for (; a > o; o++)
3019
+ if (r = i[o].call(n, t, e)) return r
3020
+ }
3021
+
3022
+ function er(e, t, n) {
3023
+ var r, i, o = 0,
3024
+ a = Gn.length,
3025
+ s = x.Deferred().always(function () {
3026
+ delete l.elem
3027
+ }),
3028
+ l = function () {
3029
+ if (i) return !1;
3030
+ var t = Xn || Kn(),
3031
+ n = Math.max(0, u.startTime + u.duration - t),
3032
+ r = n / u.duration || 0,
3033
+ o = 1 - r,
3034
+ a = 0,
3035
+ l = u.tweens.length;
3036
+ for (; l > a; a++) u.tweens[a].run(o);
3037
+ return s.notifyWith(e, [u, o, n]), 1 > o && l ? n : (s.resolveWith(e, [u]), !1)
3038
+ }, u = s.promise({
3039
+ elem: e,
3040
+ props: x.extend({}, t),
3041
+ opts: x.extend(!0, {
3042
+ specialEasing: {}
3043
+ }, n),
3044
+ originalProperties: t,
3045
+ originalOptions: n,
3046
+ startTime: Xn || Kn(),
3047
+ duration: n.duration,
3048
+ tweens: [],
3049
+ createTween: function (t, n) {
3050
+ var r = x.Tween(e, u.opts, t, n, u.opts.specialEasing[t] || u.opts.easing);
3051
+ return u.tweens.push(r), r
3052
+ },
3053
+ stop: function (t) {
3054
+ var n = 0,
3055
+ r = t ? u.tweens.length : 0;
3056
+ if (i) return this;
3057
+ for (i = !0; r > n; n++) u.tweens[n].run(1);
3058
+ return t ? s.resolveWith(e, [u, t]) : s.rejectWith(e, [u, t]), this
3059
+ }
3060
+ }),
3061
+ c = u.props;
3062
+ for (tr(c, u.opts.specialEasing); a > o; o++)
3063
+ if (r = Gn[o].call(u, e, c, u.opts)) return r;
3064
+ return x.map(c, Zn, u), x.isFunction(u.opts.start) && u.opts.start.call(e, u), x.fx.timer(x.extend(l, {
3065
+ elem: e,
3066
+ anim: u,
3067
+ queue: u.opts.queue
3068
+ })), u.progress(u.opts.progress).done(u.opts.done, u.opts.complete).fail(u.opts.fail).always(u.opts.always)
3069
+ }
3070
+
3071
+ function tr(e, t) {
3072
+ var n, r, i, o, a;
3073
+ for (n in e)
3074
+ if (r = x.camelCase(n), i = t[r], o = e[n], x.isArray(o) && (i = o[1], o = e[n] = o[0]), n !== r && (e[r] = o, delete e[n]), a = x.cssHooks[r], a && "expand" in a) {
3075
+ o = a.expand(o), delete e[r];
3076
+ for (n in o) n in e || (e[n] = o[n], t[n] = i)
3077
+ } else t[r] = i
3078
+ }
3079
+ x.Animation = x.extend(er, {
3080
+ tweener: function (e, t) {
3081
+ x.isFunction(e) ? (t = e, e = ["*"]) : e = e.split(" ");
3082
+ var n, r = 0,
3083
+ i = e.length;
3084
+ for (; i > r; r++) n = e[r], Qn[n] = Qn[n] || [], Qn[n].unshift(t)
3085
+ },
3086
+ prefilter: function (e, t) {
3087
+ t ? Gn.unshift(e) : Gn.push(e)
3088
+ }
3089
+ });
3090
+
3091
+ function nr(e, t, n) {
3092
+ var r, i, o, a, s, l, u = this,
3093
+ c = {}, p = e.style,
3094
+ f = e.nodeType && nn(e),
3095
+ d = x._data(e, "fxshow");
3096
+ n.queue || (s = x._queueHooks(e, "fx"), null == s.unqueued && (s.unqueued = 0, l = s.empty.fire, s.empty.fire = function () {
3097
+ s.unqueued || l()
3098
+ }), s.unqueued++, u.always(function () {
3099
+ u.always(function () {
3100
+ s.unqueued--, x.queue(e, "fx").length || s.empty.fire()
3101
+ })
3102
+ })), 1 === e.nodeType && ("height" in t || "width" in t) && (n.overflow = [p.overflow, p.overflowX, p.overflowY], "inline" === x.css(e, "display") && "none" === x.css(e, "float") && (x.support.inlineBlockNeedsLayout && "inline" !== ln(e.nodeName) ? p.zoom = 1 : p.display = "inline-block")), n.overflow && (p.overflow = "hidden", x.support.shrinkWrapBlocks || u.always(function () {
3103
+ p.overflow = n.overflow[0], p.overflowX = n.overflow[1], p.overflowY = n.overflow[2]
3104
+ }));
3105
+ for (r in t)
3106
+ if (i = t[r], Vn.exec(i)) {
3107
+ if (delete t[r], o = o || "toggle" === i, i === (f ? "hide" : "show")) continue;
3108
+ c[r] = d && d[r] || x.style(e, r)
3109
+ }
3110
+ if (!x.isEmptyObject(c)) {
3111
+ d ? "hidden" in d && (f = d.hidden) : d = x._data(e, "fxshow", {}), o && (d.hidden = !f), f ? x(e).show() : u.done(function () {
3112
+ x(e).hide()
3113
+ }), u.done(function () {
3114
+ var t;
3115
+ x._removeData(e, "fxshow");
3116
+ for (t in c) x.style(e, t, c[t])
3117
+ });
3118
+ for (r in c) a = Zn(f ? d[r] : 0, r, u), r in d || (d[r] = a.start, f && (a.end = a.start, a.start = "width" === r || "height" === r ? 1 : 0))
3119
+ }
3120
+ }
3121
+
3122
+ function rr(e, t, n, r, i) {
3123
+ return new rr.prototype.init(e, t, n, r, i)
3124
+ }
3125
+ x.Tween = rr, rr.prototype = {
3126
+ constructor: rr,
3127
+ init: function (e, t, n, r, i, o) {
3128
+ this.elem = e, this.prop = n, this.easing = i || "swing", this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = o || (x.cssNumber[n] ? "" : "px")
3129
+ },
3130
+ cur: function () {
3131
+ var e = rr.propHooks[this.prop];
3132
+ return e && e.get ? e.get(this) : rr.propHooks._default.get(this)
3133
+ },
3134
+ run: function (e) {
3135
+ var t, n = rr.propHooks[this.prop];
3136
+ return this.pos = t = this.options.duration ? x.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : rr.propHooks._default.set(this), this
3137
+ }
3138
+ }, rr.prototype.init.prototype = rr.prototype, rr.propHooks = {
3139
+ _default: {
3140
+ get: function (e) {
3141
+ var t;
3142
+ return null == e.elem[e.prop] || e.elem.style && null != e.elem.style[e.prop] ? (t = x.css(e.elem, e.prop, ""), t && "auto" !== t ? t : 0) : e.elem[e.prop]
3143
+ },
3144
+ set: function (e) {
3145
+ x.fx.step[e.prop] ? x.fx.step[e.prop](e) : e.elem.style && (null != e.elem.style[x.cssProps[e.prop]] || x.cssHooks[e.prop]) ? x.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now
3146
+ }
3147
+ }
3148
+ }, rr.propHooks.scrollTop = rr.propHooks.scrollLeft = {
3149
+ set: function (e) {
3150
+ e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now)
3151
+ }
3152
+ }, x.each(["toggle", "show", "hide"], function (e, t) {
3153
+ var n = x.fn[t];
3154
+ x.fn[t] = function (e, r, i) {
3155
+ return null == e || "boolean" == typeof e ? n.apply(this, arguments) : this.animate(ir(t, !0), e, r, i)
3156
+ }
3157
+ }), x.fn.extend({
3158
+ fadeTo: function (e, t, n, r) {
3159
+ return this.filter(nn).css("opacity", 0).show().end().animate({
3160
+ opacity: t
3161
+ }, e, n, r)
3162
+ },
3163
+ animate: function (e, t, n, r) {
3164
+ var i = x.isEmptyObject(e),
3165
+ o = x.speed(t, n, r),
3166
+ a = function () {
3167
+ var t = er(this, x.extend({}, e), o);
3168
+ (i || x._data(this, "finish")) && t.stop(!0)
3169
+ };
3170
+ return a.finish = a, i || o.queue === !1 ? this.each(a) : this.queue(o.queue, a)
3171
+ },
3172
+ stop: function (e, n, r) {
3173
+ var i = function (e) {
3174
+ var t = e.stop;
3175
+ delete e.stop, t(r)
3176
+ };
3177
+ return "string" != typeof e && (r = n, n = e, e = t), n && e !== !1 && this.queue(e || "fx", []), this.each(function () {
3178
+ var t = !0,
3179
+ n = null != e && e + "queueHooks",
3180
+ o = x.timers,
3181
+ a = x._data(this);
3182
+ if (n) a[n] && a[n].stop && i(a[n]);
3183
+ else
3184
+ for (n in a) a[n] && a[n].stop && Jn.test(n) && i(a[n]);
3185
+ for (n = o.length; n--;) o[n].elem !== this || null != e && o[n].queue !== e || (o[n].anim.stop(r), t = !1, o.splice(n, 1));
3186
+ (t || !r) && x.dequeue(this, e)
3187
+ })
3188
+ },
3189
+ finish: function (e) {
3190
+ return e !== !1 && (e = e || "fx"), this.each(function () {
3191
+ var t, n = x._data(this),
3192
+ r = n[e + "queue"],
3193
+ i = n[e + "queueHooks"],
3194
+ o = x.timers,
3195
+ a = r ? r.length : 0;
3196
+ for (n.finish = !0, x.queue(this, e, []), i && i.stop && i.stop.call(this, !0), t = o.length; t--;) o[t].elem === this && o[t].queue === e && (o[t].anim.stop(!0), o.splice(t, 1));
3197
+ for (t = 0; a > t; t++) r[t] && r[t].finish && r[t].finish.call(this);
3198
+ delete n.finish
3199
+ })
3200
+ }
3201
+ });
3202
+
3203
+ function ir(e, t) {
3204
+ var n, r = {
3205
+ height: e
3206
+ }, i = 0;
3207
+ for (t = t ? 1 : 0; 4 > i; i += 2 - t) n = Zt[i], r["margin" + n] = r["padding" + n] = e;
3208
+ return t && (r.opacity = r.width = e), r
3209
+ }
3210
+ x.each({
3211
+ slideDown: ir("show"),
3212
+ slideUp: ir("hide"),
3213
+ slideToggle: ir("toggle"),
3214
+ fadeIn: {
3215
+ opacity: "show"
3216
+ },
3217
+ fadeOut: {
3218
+ opacity: "hide"
3219
+ },
3220
+ fadeToggle: {
3221
+ opacity: "toggle"
3222
+ }
3223
+ }, function (e, t) {
3224
+ x.fn[e] = function (e, n, r) {
3225
+ return this.animate(t, e, n, r)
3226
+ }
3227
+ }), x.speed = function (e, t, n) {
3228
+ var r = e && "object" == typeof e ? x.extend({}, e) : {
3229
+ complete: n || !n && t || x.isFunction(e) && e,
3230
+ duration: e,
3231
+ easing: n && t || t && !x.isFunction(t) && t
3232
+ };
3233
+ return r.duration = x.fx.off ? 0 : "number" == typeof r.duration ? r.duration : r.duration in x.fx.speeds ? x.fx.speeds[r.duration] : x.fx.speeds._default, (null == r.queue || r.queue === !0) && (r.queue = "fx"), r.old = r.complete, r.complete = function () {
3234
+ x.isFunction(r.old) && r.old.call(this), r.queue && x.dequeue(this, r.queue)
3235
+ }, r
3236
+ }, x.easing = {
3237
+ linear: function (e) {
3238
+ return e
3239
+ },
3240
+ swing: function (e) {
3241
+ return .5 - Math.cos(e * Math.PI) / 2
3242
+ }
3243
+ }, x.timers = [], x.fx = rr.prototype.init, x.fx.tick = function () {
3244
+ var e, n = x.timers,
3245
+ r = 0;
3246
+ for (Xn = x.now(); n.length > r; r++) e = n[r], e() || n[r] !== e || n.splice(r--, 1);
3247
+ n.length || x.fx.stop(), Xn = t
3248
+ }, x.fx.timer = function (e) {
3249
+ e() && x.timers.push(e) && x.fx.start()
3250
+ }, x.fx.interval = 13, x.fx.start = function () {
3251
+ Un || (Un = setInterval(x.fx.tick, x.fx.interval))
3252
+ }, x.fx.stop = function () {
3253
+ clearInterval(Un), Un = null
3254
+ }, x.fx.speeds = {
3255
+ slow: 600,
3256
+ fast: 200,
3257
+ _default: 400
3258
+ }, x.fx.step = {}, x.expr && x.expr.filters && (x.expr.filters.animated = function (e) {
3259
+ return x.grep(x.timers, function (t) {
3260
+ return e === t.elem
3261
+ }).length
3262
+ }), x.fn.offset = function (e) {
3263
+ if (arguments.length) return e === t ? this : this.each(function (t) {
3264
+ x.offset.setOffset(this, e, t)
3265
+ });
3266
+ var n, r, o = {
3267
+ top: 0,
3268
+ left: 0
3269
+ }, a = this[0],
3270
+ s = a && a.ownerDocument;
3271
+ if (s) return n = s.documentElement, x.contains(n, a) ? (typeof a.getBoundingClientRect !== i && (o = a.getBoundingClientRect()), r = or(s), {
3272
+ top: o.top + (r.pageYOffset || n.scrollTop) - (n.clientTop || 0),
3273
+ left: o.left + (r.pageXOffset || n.scrollLeft) - (n.clientLeft || 0)
3274
+ }) : o
3275
+ }, x.offset = {
3276
+ setOffset: function (e, t, n) {
3277
+ var r = x.css(e, "position");
3278
+ "static" === r && (e.style.position = "relative");
3279
+ var i = x(e),
3280
+ o = i.offset(),
3281
+ a = x.css(e, "top"),
3282
+ s = x.css(e, "left"),
3283
+ l = ("absolute" === r || "fixed" === r) && x.inArray("auto", [a, s]) > -1,
3284
+ u = {}, c = {}, p, f;
3285
+ l ? (c = i.position(), p = c.top, f = c.left) : (p = parseFloat(a) || 0, f = parseFloat(s) || 0), x.isFunction(t) && (t = t.call(e, n, o)), null != t.top && (u.top = t.top - o.top + p), null != t.left && (u.left = t.left - o.left + f), "using" in t ? t.using.call(e, u) : i.css(u)
3286
+ }
3287
+ }, x.fn.extend({
3288
+ position: function () {
3289
+ if (this[0]) {
3290
+ var e, t, n = {
3291
+ top: 0,
3292
+ left: 0
3293
+ }, r = this[0];
3294
+ return "fixed" === x.css(r, "position") ? t = r.getBoundingClientRect() : (e = this.offsetParent(), t = this.offset(), x.nodeName(e[0], "html") || (n = e.offset()), n.top += x.css(e[0], "borderTopWidth", !0), n.left += x.css(e[0], "borderLeftWidth", !0)), {
3295
+ top: t.top - n.top - x.css(r, "marginTop", !0),
3296
+ left: t.left - n.left - x.css(r, "marginLeft", !0)
3297
+ }
3298
+ }
3299
+ },
3300
+ offsetParent: function () {
3301
+ return this.map(function () {
3302
+ var e = this.offsetParent || s;
3303
+ while (e && !x.nodeName(e, "html") && "static" === x.css(e, "position")) e = e.offsetParent;
3304
+ return e || s
3305
+ })
3306
+ }
3307
+ }), x.each({
3308
+ scrollLeft: "pageXOffset",
3309
+ scrollTop: "pageYOffset"
3310
+ }, function (e, n) {
3311
+ var r = /Y/.test(n);
3312
+ x.fn[e] = function (i) {
3313
+ return x.access(this, function (e, i, o) {
3314
+ var a = or(e);
3315
+ return o === t ? a ? n in a ? a[n] : a.document.documentElement[i] : e[i] : (a ? a.scrollTo(r ? x(a).scrollLeft() : o, r ? o : x(a).scrollTop()) : e[i] = o, t)
3316
+ }, e, i, arguments.length, null)
3317
+ }
3318
+ });
3319
+
3320
+ function or(e) {
3321
+ return x.isWindow(e) ? e : 9 === e.nodeType ? e.defaultView || e.parentWindow : !1
3322
+ }
3323
+ x.each({
3324
+ Height: "height",
3325
+ Width: "width"
3326
+ }, function (e, n) {
3327
+ x.each({
3328
+ padding: "inner" + e,
3329
+ content: n,
3330
+ "": "outer" + e
3331
+ }, function (r, i) {
3332
+ x.fn[i] = function (i, o) {
3333
+ var a = arguments.length && (r || "boolean" != typeof i),
3334
+ s = r || (i === !0 || o === !0 ? "margin" : "border");
3335
+ return x.access(this, function (n, r, i) {
3336
+ var o;
3337
+ return x.isWindow(n) ? n.document.documentElement["client" + e] : 9 === n.nodeType ? (o = n.documentElement, Math.max(n.body["scroll" + e], o["scroll" + e], n.body["offset" + e], o["offset" + e], o["client" + e])) : i === t ? x.css(n, r, s) : x.style(n, r, i, s)
3338
+ }, n, a ? i : t, a, null)
3339
+ }
3340
+ })
3341
+ }), x.fn.size = function () {
3342
+ return this.length
3343
+ }, x.fn.andSelf = x.fn.addBack, "object" == typeof module && module && "object" == typeof module.exports ? module.exports = x : (e.jQuery = e.$ = x, "function" == typeof define && define.amd && define("jquery", [], function () {
3344
+ return x
3345
+ }))
3346
+ })(window);
3347
+
3348
+ jQuery.noConflict();
skin/frontend/default/default/css/files.css ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .mainDiv
2
+ {
3
+ margin:10px 0px;
4
+ }
5
+ .fileTitleDiv
6
+ {
7
+ float: left;
8
+ margin-right:20px;
9
+ width:150px;
10
+ }
11
+ .fileImageDiv
12
+ {
13
+ margin-right:10px;
14
+ float: left;
15
+ }