Elogic_Slider - Version 1.0.0

Version Notes

First stable release

Download this release

Release Info

Developer eLogic LLC
Extension Elogic_Slider
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (54) hide show
  1. app/code/local/Elogic/Slider/Block/Adminhtml/Slider.php +36 -0
  2. app/code/local/Elogic/Slider/Block/Adminhtml/Slider/Edit/Container.php +173 -0
  3. app/code/local/Elogic/Slider/Block/Adminhtml/Slider/Edit/Form.php +73 -0
  4. app/code/local/Elogic/Slider/Block/Adminhtml/Slider/Edit/Slide.php +95 -0
  5. app/code/local/Elogic/Slider/Block/Adminhtml/Slider/Grid.php +84 -0
  6. app/code/local/Elogic/Slider/Block/Slider.php +68 -0
  7. app/code/local/Elogic/Slider/Helper/Data.php +22 -0
  8. app/code/local/Elogic/Slider/Model/Resource/Slider.php +22 -0
  9. app/code/local/Elogic/Slider/Model/Resource/Slider/Collection.php +22 -0
  10. app/code/local/Elogic/Slider/Model/Resource/Slider/Slides.php +18 -0
  11. app/code/local/Elogic/Slider/Model/Resource/Slider/Slides/Collection.php +21 -0
  12. app/code/local/Elogic/Slider/Model/Slider.php +56 -0
  13. app/code/local/Elogic/Slider/Model/Slider/Slides.php +44 -0
  14. app/code/local/Elogic/Slider/controllers/Adminhtml/SliderController.php +264 -0
  15. app/code/local/Elogic/Slider/etc/adminhtml.xml +43 -0
  16. app/code/local/Elogic/Slider/etc/config.xml +103 -0
  17. app/code/local/Elogic/Slider/etc/system.xml +75 -0
  18. app/code/local/Elogic/Slider/sql/elogic_slider_setup/mysql4-install-0.1.0.php +78 -0
  19. app/code/local/Elogic/Slider/sql/elogic_slider_setup/mysql4-install-1.0.0.php +78 -0
  20. app/design/adminhtml/default/default/layout/elogic/slider/layout.xml +84 -0
  21. app/design/adminhtml/default/default/template/elogic/slider/container.phtml +60 -0
  22. app/design/adminhtml/default/default/template/elogic/slider/slide.phtml +58 -0
  23. app/design/frontend/base/default/layout/elogic/slider.xml +40 -0
  24. app/design/frontend/base/default/template/elogic/slider.phtml +43 -0
  25. app/etc/modules/Elogic_Slider.xml +16 -0
  26. package.xml +18 -0
  27. skin/adminhtml/default/default/elogic/slider/css/custom.css +94 -0
  28. skin/adminhtml/default/default/elogic/slider/css/imgareaselect-default.css +41 -0
  29. skin/adminhtml/default/default/elogic/slider/images/arrow_sort_move.gif +0 -0
  30. skin/adminhtml/default/default/elogic/slider/images/border-anim-h.gif +0 -0
  31. skin/adminhtml/default/default/elogic/slider/images/border-anim-v.gif +0 -0
  32. skin/adminhtml/default/default/elogic/slider/images/border-h.gif +0 -0
  33. skin/adminhtml/default/default/elogic/slider/images/border-v.gif +0 -0
  34. skin/adminhtml/default/default/elogic/slider/images/btn_gr_bg.gif +0 -0
  35. skin/adminhtml/default/default/elogic/slider/images/btn_gr_on.gif +0 -0
  36. skin/adminhtml/default/default/elogic/slider/images/btn_gr_over.gif +0 -0
  37. skin/adminhtml/default/default/elogic/slider/images/cancel_btn_icon.gif +0 -0
  38. skin/adminhtml/default/default/elogic/slider/js/plugins/jquery-1.7.2.min.js +4 -0
  39. skin/adminhtml/default/default/elogic/slider/js/plugins/jquery-2.2.1.min.js +4 -0
  40. skin/adminhtml/default/default/elogic/slider/js/plugins/jquery-noconflict.js +2 -0
  41. skin/adminhtml/default/default/elogic/slider/js/plugins/jquery-sortable.js +693 -0
  42. skin/adminhtml/default/default/elogic/slider/js/plugins/jquery.form.js +1277 -0
  43. skin/adminhtml/default/default/elogic/slider/js/plugins/jquery.imgareaselect.js +730 -0
  44. skin/adminhtml/default/default/elogic/slider/js/plugins/jquery.imgareaselect.min.js +1 -0
  45. skin/adminhtml/default/default/elogic/slider/js/plugins/jquery.imgareaselect.pack.js +1 -0
  46. skin/adminhtml/default/default/elogic/slider/js/slider-form.js +362 -0
  47. skin/frontend/base/default/elogic/slider/css/flexslider.css +275 -0
  48. skin/frontend/base/default/elogic/slider/css/slider.css +22 -0
  49. skin/frontend/base/default/elogic/slider/fonts/flexslider-icon.eot +0 -0
  50. skin/frontend/base/default/elogic/slider/fonts/flexslider-icon.svg +19 -0
  51. skin/frontend/base/default/elogic/slider/fonts/flexslider-icon.ttf +0 -0
  52. skin/frontend/base/default/elogic/slider/fonts/flexslider-icon.woff +0 -0
  53. skin/frontend/base/default/elogic/slider/js/jquery.flexslider-min.js +5 -0
  54. skin/frontend/base/default/elogic/slider/js/tooltip.js +24 -0
app/code/local/Elogic/Slider/Block/Adminhtml/Slider.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Slider admin block
5
+ *
6
+ * @author elogic
7
+ */
8
+
9
+ /**
10
+ * Class Elogic_Slider_Block_Adminhtml_Slider
11
+ */
12
+ class Elogic_Slider_Block_Adminhtml_Slider extends Mage_Adminhtml_Block_Widget_Grid_Container
13
+ {
14
+ /**
15
+ * Block constructor
16
+ */
17
+ protected function _construct()
18
+ {
19
+ parent::_construct();
20
+
21
+ $this->_blockGroup = 'elogic_slider';
22
+ $this->_controller = 'adminhtml_slider';
23
+ $this->_headerText = Mage::helper('elogic_slider')->__('Sliders');
24
+
25
+ }
26
+
27
+ /**
28
+ * create url
29
+ *
30
+ * @return mixed
31
+ */
32
+ public function getCreateUrl()
33
+ {
34
+ return $this->getUrl('elogic_slider/adminhtml_slider/new');
35
+ }
36
+ }
app/code/local/Elogic/Slider/Block/Adminhtml/Slider/Edit/Container.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Slider admin edit container
4
+ *
5
+ * @author elogic
6
+ */
7
+
8
+ /**
9
+ * Class Elogic_Slider_Block_Adminhtml_Slider_Edit_Container
10
+ */
11
+ class Elogic_Slider_Block_Adminhtml_Slider_Edit_Container extends Mage_Adminhtml_Block_Widget_Form_Container
12
+ {
13
+ protected $_slider;
14
+ protected $_slides = null;
15
+ protected $_formKey = null;
16
+
17
+ /**
18
+ * Elogic_Slider_Block_Adminhtml_Slider_Edit_Container constructor.
19
+ */
20
+
21
+ public function __construct()
22
+ {
23
+ parent::__construct();
24
+ $this->setTemplate('elogic/slider/container.phtml');
25
+ $this->_slider = Mage::registry('elogic_slider_data');
26
+ $this->_updateButton('delete', 'label', Mage::helper('elogic_slider')->__('Delete Slider'));
27
+ $this->_updateButton('save', 'onclick', '');
28
+ $this->_updateButton('save', 'class', 'save-slider');
29
+ $this->_removeButton('reset');
30
+ $this->_formKey = Mage::getSingleton('core/session')->getFormKey();
31
+ }
32
+
33
+ /**
34
+ * @return Mage_Core_Block_Abstract
35
+ */
36
+
37
+ protected function _prepareLayout()
38
+ {
39
+ $this->setChild('edit_content_form',
40
+ $this->getLayout()->createBlock('elogic_slider/adminhtml_slider_edit_form')
41
+ );
42
+
43
+ return parent::_prepareLayout();
44
+ }
45
+
46
+ /**
47
+ * @return string
48
+ */
49
+
50
+ public function getContentFormHtml()
51
+ {
52
+ return $this->getChildHtml('edit_content_form');
53
+ }
54
+
55
+ /**
56
+ * @return string
57
+ */
58
+ protected function _getHeader()
59
+ {
60
+ return Mage::helper('elogic_slider')->__("Slider Content");
61
+ }
62
+
63
+ /**
64
+ * URL delete
65
+ * @return mixed
66
+ * @throws Exception
67
+ */
68
+ public function getDeleteUrl()
69
+ {
70
+ return $this->getUrl('*/*/delete', array($this->_objectId => $this->getRequest()->getParam($this->_objectId)));
71
+ }
72
+
73
+ /**
74
+ * Add slide URL
75
+ *
76
+ * @return mixed
77
+ * @throws Exception
78
+ */
79
+
80
+ public function getAddSlideUrl()
81
+ {
82
+ return $this->getUrl('*/*/addSlide', array($this->_objectId => $this->getRequest()->getParam($this->_objectId), 'form_key' => $this->_formKey));
83
+ }
84
+
85
+ /**
86
+ * Uppload Thumb URL
87
+ *
88
+ * @return mixed
89
+ * @throws Exception
90
+ */
91
+
92
+ public function getUploadThumbUrl()
93
+ {
94
+ return $this->getUrl('*/*/uploadThumb', array($this->_objectId => $this->getRequest()->getParam($this->_objectId), 'form_key' => $this->_formKey));
95
+ }
96
+
97
+ /**
98
+ * SAve Slider URL
99
+ *
100
+ * @return mixed
101
+ * @throws Exception
102
+ */
103
+
104
+ public function getSaveSliderUrl()
105
+ {
106
+ return $this->getUrl('*/*/saveSlider', array($this->_objectId => $this->getRequest()->getParam($this->_objectId), 'form_key' => $this->_formKey));
107
+ }
108
+
109
+ /**
110
+ * @return mixed
111
+ */
112
+ public function getSlider()
113
+ {
114
+ return $this->_slider;
115
+ }
116
+
117
+
118
+ /**
119
+ * Slides
120
+ *
121
+ */
122
+ public function getSlides()
123
+ {
124
+ if (!$this->_slides) {
125
+ $slides = $this->getSlider()->getSlides();
126
+
127
+ if ($slides) {
128
+ $slideBlock = $this->getLayout()->createBlock('elogic_slider/adminhtml_slider_edit_slide');
129
+
130
+ foreach ($slides as $slide) {
131
+ $slideBlock->setSlide($slide);
132
+ $this->_slides[] = array(
133
+ 'row' => $slideBlock->getSlideRow(),
134
+ 'html' => $slideBlock->toHtml()
135
+ );
136
+ }
137
+ }
138
+ }
139
+ return $this->_slides;
140
+ }
141
+
142
+ /**
143
+ * @return mixed
144
+ */
145
+
146
+ public function getJsonSliderConfig()
147
+ {
148
+ $config = array('slides' => []);
149
+ $sliderData = $this->getSlider()->getData();
150
+
151
+ if (!empty($sliderData)) {
152
+ unset($sliderData['slides']);
153
+ $config = array_merge($config, $sliderData);
154
+ }
155
+ $slides = $this->getSlider()->getSlides();
156
+ if ($slides) {
157
+ foreach ($slides as $slide) {
158
+ $slideData = array();
159
+ // { ["id"]=> string(1) "1" ["slider_id"]=> string(1) "4" ["position"]=> string(1) "0" ["title"]=> string(7) "Slide 1"
160
+ // foreach($slide->getData() as $key => $val){
161
+ // $slideDataTemp[$key] = $val;
162
+ // }
163
+ $slideData = array_merge($slideData, $slide->getData());
164
+ $slideData['image'] = $slide->getImagePath();
165
+ $slideData['blocks'] = $slide->getParams() ?: array();
166
+ unset($slideData['params']);
167
+ $config['slides'][$slide->getId()] = $slideData;
168
+ }
169
+ }
170
+ return Mage::helper('core')->jsonEncode($config);
171
+ }
172
+
173
+ }
app/code/local/Elogic/Slider/Block/Adminhtml/Slider/Edit/Form.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Slider admin edit form block
4
+ *
5
+ * @author elogic
6
+ */
7
+
8
+ /**
9
+ * Class Elogic_Slider_Block_Adminhtml_Slider_Edit_Form
10
+ */
11
+ class Elogic_Slider_Block_Adminhtml_Slider_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
12
+ {
13
+ public function __construct()
14
+ {
15
+ parent::__construct();
16
+ }
17
+
18
+ /**
19
+ * Form action
20
+ *
21
+ * @return Mage_Adminhtml_Block_Widget_Form
22
+ * @throws Exception
23
+ */
24
+ protected function _prepareForm()
25
+ {
26
+ $form = new Varien_Data_Form();
27
+
28
+ $fieldset = $form->addFieldset('slider', array('legend' => Mage::helper('elogic_slider')->__('Slider')));
29
+ $fieldset->addField('name', 'text', array(
30
+ 'label' => Mage::helper('elogic_slider')->__('Name'),
31
+ 'name' => 'name',
32
+ 'required' => true,
33
+ 'class' => 'required-entry validate-no-html-tags',
34
+ ));
35
+ $fieldset->addField('store_id', 'select', array(
36
+ 'label' => Mage::helper('elogic_slider')->__('Sore'),
37
+ 'name' => 'store_id',
38
+ 'required' => true,
39
+ 'class' => 'required-entry validate-no-html-tags',
40
+ 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()
41
+ ));
42
+ $fieldset->addField('is_active', 'select', array(
43
+ 'label' => Mage::helper('elogic_slider')->__('Is active'),
44
+ 'name' => 'is_active',
45
+ 'required' => true,
46
+ 'class' => 'required-entry',
47
+ 'values' => array(
48
+ array(
49
+ 'value' => 0,
50
+ 'label' => $this->__('No')
51
+ ),
52
+ array(
53
+ 'value' => 1,
54
+ 'label' => $this->__('Yes')
55
+ )
56
+ )
57
+ ));
58
+
59
+ if (Mage::getSingleton('adminhtml/session')->getFormData()) {
60
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getFormData());
61
+ Mage::getSingleton('adminhtml/session')->setFormData(null);
62
+ } elseif (Mage::registry('elogic_slider_data')) {
63
+ $form->setValues(Mage::registry('elogic_slider_data')->getData());
64
+ }
65
+
66
+ $form->setMethod('post');
67
+ $form->setId('edit_slider_form');
68
+ $form->setUseContainer(true);
69
+ $form->setAction($this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))));
70
+ $this->setForm($form);
71
+ return parent::_prepareForm();
72
+ }
73
+ }
app/code/local/Elogic/Slider/Block/Adminhtml/Slider/Edit/Slide.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Slider admin template container
4
+ *
5
+ * @author elogic
6
+ */
7
+
8
+ /**
9
+ * Class Elogic_Slider_Block_Adminhtml_Slider_Edit_Slide
10
+ */
11
+ class Elogic_Slider_Block_Adminhtml_Slider_Edit_Slide extends Mage_Adminhtml_Block_Template
12
+ {
13
+
14
+ protected $_slide = null;
15
+ protected $_slider;
16
+ protected $_uniqId = null;
17
+
18
+ /**
19
+ * set template
20
+ */
21
+ protected function _construct()
22
+ {
23
+ $this->setTemplate('elogic/slider/slide.phtml');
24
+ parent::_construct();
25
+ }
26
+
27
+ /**
28
+ * @param $slide
29
+ */
30
+
31
+ public function setSlide($slide)
32
+ {
33
+ $this->_slide = $slide;
34
+ }
35
+
36
+ public function getSlide()
37
+ {
38
+ return $this->_slide;
39
+ }
40
+
41
+ public function setSlider($slider)
42
+ {
43
+ $this->_uniqId = null;
44
+ $this->_slider = $slider;
45
+ }
46
+
47
+ /**
48
+ * @return mixed
49
+ */
50
+
51
+ public function getSlider()
52
+ {
53
+ if (!$this->_slider) {
54
+ $this->_slider = Mage::registry('elogic_slider_data');
55
+ }
56
+
57
+ return $this->_slider;
58
+ }
59
+
60
+ /**
61
+ * @return null|string
62
+ */
63
+
64
+ public function getUniqId()
65
+ {
66
+ if ($this->getSlide()) {
67
+ $this->_uniqId = $this->getSlide()->getId();
68
+ }
69
+ if (!$this->_uniqId) {
70
+ $this->_uniqId = 'new' . uniqid();
71
+ }
72
+
73
+ return $this->_uniqId;
74
+ }
75
+
76
+ /**
77
+ * @return string html
78
+ */
79
+
80
+ public function getSlideRow()
81
+ {
82
+ $rowHtml = '<li class="slide-row" id="' . $this->getUniqId() . '"';
83
+
84
+ if ($slide = $this->getSlide()) {
85
+ $rowHtml .= ' data-id="' . $slide->getId() . '"><i class="icon-move"></i>';
86
+ $rowHtml .= $slide->getTitle() ?: $this->__('Slide %s', $slide->getId());
87
+ } else {
88
+ $rowHtml .= '><i class="icon-move"></i>' . $this->__('New Slide');
89
+ }
90
+
91
+ $rowHtml .= '<i class="icon-delete"> - </i>';
92
+ $rowHtml .= '</li>';
93
+ return $rowHtml;
94
+ }
95
+ }
app/code/local/Elogic/Slider/Block/Adminhtml/Slider/Grid.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Slider admin grid container
4
+ *
5
+ * @author elogic
6
+ */
7
+
8
+ /**
9
+ * Class Elogic_Slider_Block_Adminhtml_Slider_Grid
10
+ */
11
+ class Elogic_Slider_Block_Adminhtml_Slider_Grid extends Mage_Adminhtml_Block_Widget_Grid
12
+ {
13
+ /**
14
+ * Collection for Grid
15
+ *
16
+ * @return Mage_Adminhtml_Block_Widget_Grid
17
+ */
18
+ protected function _prepareCollection()
19
+ {
20
+ $collection = Mage::getResourceModel('elogic_slider/slider_collection');
21
+
22
+ $this->setCollection($collection);
23
+ return parent::_prepareCollection();
24
+ }
25
+
26
+ /**
27
+ * Return row URL
28
+ * @param $row
29
+ * @return mixed
30
+ */
31
+
32
+ public function getRowUrl($row)
33
+ {
34
+ return $this->getUrl('elogic_slider/adminhtml_slider/edit', array('id' => $row->getId()));
35
+ }
36
+
37
+ /**
38
+ * Grid Columns
39
+ *
40
+ * @return $this
41
+ * @throws Exception
42
+ */
43
+
44
+ protected function _prepareColumns()
45
+ {
46
+ $this->addColumn('id', array(
47
+ 'header' => $this->_getHelper()->__('ID'),
48
+ 'type' => 'number',
49
+ 'index' => 'id',
50
+ ));
51
+
52
+ $this->addColumn('name', array(
53
+ 'header' => $this->_getHelper()->__('Name'),
54
+ 'type' => 'text',
55
+ 'index' => 'name',
56
+ ));
57
+
58
+ $this->addColumn('store_id', array(
59
+ 'header' => $this->_getHelper()->__('Store id'),
60
+ 'type' => 'store',
61
+ 'index' => 'store_id',
62
+ 'width' => '200px',
63
+ ));
64
+
65
+ $this->addColumn('is_active', array(
66
+ 'header' => $this->_getHelper()->__('is Active'),
67
+ 'type' => 'checkbox',
68
+ 'width' => '100px',
69
+ 'index' => 'is_active',
70
+ ));
71
+
72
+ return parent::_prepareColumns();
73
+ }
74
+
75
+ /**
76
+ * @return Mage_Core_Helper_Abstract
77
+ */
78
+
79
+ protected function _getHelper()
80
+ {
81
+ return Mage::helper('elogic_slider');
82
+ }
83
+
84
+ }
app/code/local/Elogic/Slider/Block/Slider.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Slider block
4
+ *
5
+ * @author elogic
6
+ *
7
+ */
8
+
9
+ /**
10
+ * Class Elogic_Slider_Block_Slider
11
+ */
12
+ class Elogic_Slider_Block_Slider extends Mage_Core_Block_Template
13
+ {
14
+ /**
15
+ * @var null
16
+ */
17
+ protected $_sliderId = null;
18
+ protected $_slider = null;
19
+
20
+ /**
21
+ * default speed slider
22
+ */
23
+ const default_speed = '5000';
24
+
25
+
26
+ public function setSliderId($sliderId)
27
+ {
28
+ $this->_sliderId = (int)$sliderId;
29
+ }
30
+
31
+ /**
32
+ * slider collection
33
+ *
34
+ * @return Elogic_Slider_Model_Resource_Slider_Collection
35
+ */
36
+
37
+ public function getSlider()
38
+ {
39
+ if (!$this->_slider && !empty($this->_sliderId)) {
40
+ $collection = Mage::getModel('elogic_slider/slider')->getCollection()
41
+ ->addFieldToFilter('store_id', array('eq' => Mage::app()->getStore()->getId()))
42
+ ->addFieldToFilter('id', array('eq' => $this->_sliderId))
43
+ ->addFieldToFilter('is_active', array('eq' => 1));
44
+ if ($collection) {
45
+ $this->_slider = $collection->getFirstItem();
46
+ }
47
+ }
48
+
49
+ return $this->_slider;
50
+ }
51
+
52
+ /**
53
+ * speed slider
54
+ *
55
+ * @return mixed|string
56
+ */
57
+
58
+
59
+ public function speedSlider()
60
+ {
61
+ $speed_slider = Mage::getStoreConfig('elogic_slider/slider/speed');
62
+ if ($speed_slider) {
63
+ return $speed_slider;
64
+ } else {
65
+ return self::default_speed;
66
+ }
67
+ }
68
+ }
app/code/local/Elogic/Slider/Helper/Data.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Slider Data helper
4
+ */
5
+
6
+ /**
7
+ * Class Elogic_Slider_Helper_Data
8
+ */
9
+ class Elogic_Slider_Helper_Data extends Mage_Core_Helper_Abstract
10
+ {
11
+ /**
12
+ * @return mixed
13
+ *
14
+ * get Id slider
15
+ * config setup system
16
+ */
17
+
18
+ public function getHomeSliderId()
19
+ {
20
+ return Mage::getStoreConfig('elogic_slider/slider/slider_id');
21
+ }
22
+ }
app/code/local/Elogic/Slider/Model/Resource/Slider.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Slider item resource model
4
+ *
5
+ * @author elogic
6
+ */
7
+
8
+
9
+ /**
10
+ * Class Elogic_Slider_Model_Resource_Slider
11
+ */
12
+ class Elogic_Slider_Model_Resource_Slider extends Mage_Core_Model_Resource_Db_Abstract
13
+ {
14
+ /**
15
+ * Initialize connection and define main table and primary key
16
+ */
17
+
18
+ protected function _construct()
19
+ {
20
+ $this->_init('elogic_slider/slider', 'id');
21
+ }
22
+ }
app/code/local/Elogic/Slider/Model/Resource/Slider/Collection.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Slider collection
4
+ *
5
+ * @author elogic
6
+ */
7
+
8
+ /**
9
+ * Class Elogic_Slider_Model_Resource_Slider_Collection
10
+ *
11
+ */
12
+ class Elogic_Slider_Model_Resource_Slider_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
13
+ {
14
+ /**
15
+ * Define collection model
16
+ */
17
+ protected function _construct()
18
+ {
19
+ parent::_construct();
20
+ $this->_init('elogic_slider/slider');
21
+ }
22
+ }
app/code/local/Elogic/Slider/Model/Resource/Slider/Slides.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @author elogic
5
+ */
6
+
7
+ /**
8
+ * Class Elogic_Slider_Model_Resource_Slider_Slides
9
+ */
10
+
11
+ class Elogic_Slider_Model_Resource_Slider_Slides extends Mage_Core_Model_Resource_Db_Abstract
12
+ {
13
+
14
+ protected function _construct()
15
+ {
16
+ $this->_init('elogic_slider/slider_slides', 'id');
17
+ }
18
+ }
app/code/local/Elogic/Slider/Model/Resource/Slider/Slides/Collection.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Slider collection
4
+ *
5
+ * @author elogic
6
+ */
7
+
8
+ /**
9
+ * Class Elogic_Slider_Model_Resource_Slider_Slides_Collection
10
+ */
11
+ class Elogic_Slider_Model_Resource_Slider_Slides_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
12
+ {
13
+ /**
14
+ * constructor
15
+ */
16
+ protected function _construct()
17
+ {
18
+ parent::_construct();
19
+ $this->_init('elogic_slider/slider_slides');
20
+ }
21
+ }
app/code/local/Elogic/Slider/Model/Slider.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Slider item model
5
+ *
6
+ * @author elogic
7
+ */
8
+
9
+ /**
10
+ * Class Elogic_Slider_Model_Slider
11
+ */
12
+ class Elogic_Slider_Model_Slider extends Mage_Core_Model_Abstract
13
+ {
14
+ const STATUS_INACTIVE = 0;
15
+ const STATUS_ACTIVE = 1;
16
+ const DEFAULT_SLIDES_LIMIT = 5;
17
+ const CONFIG_SLIDES_LIMIT = 'elogic_slider/slider/limit';
18
+
19
+ /**
20
+ * Define resource model
21
+ */
22
+ protected function _construct()
23
+ {
24
+ $this->_init('elogic_slider/slider');
25
+ }
26
+
27
+ /**
28
+ * @return mixed
29
+ *
30
+ * collection slides
31
+ */
32
+
33
+ public function getSlides()
34
+ {
35
+ if($this->getData('slides') == null){
36
+ $collectionSlides = Mage::getModel('elogic_slider/slider_slides')->getCollection()
37
+ ->addFieldToFilter('slider_id',array('eq'=> $this->getId()))
38
+ ->setOrder('position','ASC');
39
+
40
+ $this->setData('slides',$collectionSlides);
41
+ }
42
+
43
+ return $this->getData('slides');
44
+ }
45
+
46
+ /**
47
+ * @param int $storeId
48
+ * @return int
49
+ */
50
+
51
+ public function getSlidesLimit($storeId = 0)
52
+ {
53
+ $maxSlides = Mage::app()->getConfig(self::CONFIG_SLIDES_LIMIT,$storeId);
54
+ return $maxSlides?: self::DEFAULT_SLIDES_LIMIT;
55
+ }
56
+ }
app/code/local/Elogic/Slider/Model/Slider/Slides.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @author elogic
5
+ */
6
+
7
+
8
+ /**
9
+ * Class Elogic_Slider_Model_Slider_Slides
10
+ */
11
+ class Elogic_Slider_Model_Slider_Slides extends Mage_Core_Model_Abstract
12
+ {
13
+ protected function _construct()
14
+ {
15
+ $this->_init('elogic_slider/slider_slides');
16
+ }
17
+
18
+ public function getParams()
19
+ {
20
+ return json_decode($this->getData('params'),true);
21
+ }
22
+
23
+ /**
24
+ * @param bool $url
25
+ * @return string
26
+ *
27
+ * get Image Path
28
+ */
29
+
30
+ public function getImagePath($url = true)
31
+ {
32
+ $filePath = '';
33
+
34
+ if($this->getImage()){
35
+ if($url){
36
+ $filePath = Mage::getBaseUrl('media') . 'elogic/slider/' . $this->getSliderId() . '/' . $this->getId() . '/'. $this->getImage();
37
+ }else{
38
+ $filePath = Mage::getBaseDir('media'). DS . 'elogic' . DS . 'slider' . DS . $this->getSliderId() . DS . $this->getId() . DS . $this->getImage();
39
+ }
40
+ }
41
+
42
+ return $filePath;
43
+ }
44
+ }
app/code/local/Elogic/Slider/controllers/Adminhtml/SliderController.php ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Slider admin controller
4
+ *
5
+ * @author elogic
6
+ */
7
+
8
+
9
+ /**
10
+ * Class Elogic_Slider_Adminhtml_SliderController
11
+ */
12
+ class Elogic_Slider_Adminhtml_SliderController extends Mage_Adminhtml_Controller_Action
13
+ {
14
+ /**
15
+ * Index action
16
+ */
17
+ public function indexAction()
18
+ {
19
+ $contentBlock = $this->getLayout()->createBlock('elogic_slider/adminhtml_slider');
20
+ $this->loadLayout();
21
+ $this->_setActiveMenu('elogic_slider');
22
+ $this->_addContent($contentBlock)->renderLayout();
23
+ }
24
+ /**
25
+ * New slide action
26
+ */
27
+
28
+ public function newAction()
29
+ {
30
+ $this->_forward('edit');
31
+ }
32
+
33
+ /**
34
+ * Edit slide action
35
+ */
36
+
37
+ public function editAction()
38
+ {
39
+ $id = $this->getRequest()->getParam('id');
40
+ $slider = Mage::getModel('elogic_slider/slider')->load($id);
41
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
42
+
43
+ if (!empty($data)) {
44
+ $slider->setData($data);
45
+ }
46
+
47
+ Mage::register('elogic_slider_data', $slider);
48
+
49
+ $this->loadLayout();
50
+ $this->_setActiveMenu('elogic_slider');
51
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
52
+ $this->_addContent($this->getLayout()->createBlock('elogic_slider/adminhtml_slider_edit_container'));
53
+
54
+ $this->renderLayout();
55
+ }
56
+
57
+ /**
58
+ * Add new slide action
59
+ */
60
+
61
+ public function addSlideAction()
62
+ {
63
+ $response = array('success' => true);
64
+ $blockSlide = $this->getLayout()->createBlock('elogic_slider/adminhtml_slider_edit_slide');
65
+ $response['row'] = $blockSlide->getSlideRow();
66
+ $response['html'] = $blockSlide->toHtml();
67
+
68
+ return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
69
+ }
70
+
71
+ /**
72
+ * Upload thumb image action
73
+ */
74
+
75
+ public function uploadThumbAction()
76
+ {
77
+ $response = array('success' => true);
78
+ try {
79
+ $postData = $this->getRequest()->getPost();
80
+ $imgFilename = NULL;
81
+
82
+ $uploader = new Varien_File_Uploader('image');
83
+
84
+ $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'png'));
85
+ $uploader->setAllowRenameFiles(false);
86
+ $uploader->setFilesDispersion(false);
87
+
88
+ // Set media as the upload dir
89
+ $media_path = Mage::getBaseDir('media') . DS . 'elogic' . DS . 'temp' . DS;
90
+ $imgFilename = $media_path . $postData['image'];
91
+
92
+ while (file_exists($imgFilename)) {
93
+ $pieces = array();
94
+ $res = preg_match('/^(.+)_(\d+)$/', $imgFilename, $pieces);
95
+
96
+ if (!$res) {
97
+ $imgFilename .= '_1';
98
+ } else {
99
+ $imgFilename .= '_' . strval(intval($pieces[2]) + 1);
100
+ }
101
+ }
102
+
103
+ if (!file_exists($media_path)) {
104
+ mkdir($media_path, 0777);
105
+ }
106
+ // Upload the image
107
+ $res = $uploader->save($media_path, $postData['image']);
108
+ $response['path'] = Mage::getBaseUrl('media') . 'elogic/temp/' . $res['file'];
109
+ return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
110
+ } catch (Exception $e) {
111
+ $response['success'] = false;
112
+ $response['message'] = $e->getMessage();
113
+ return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Save slide action
119
+ */
120
+
121
+ public function saveSliderAction()
122
+ {
123
+ $response = array('success' => true);
124
+ $slider = Mage::getModel('elogic_slider/slider');
125
+ $params = $this->getRequest()->getParams();
126
+ $paramSlides = null;
127
+
128
+ if (array_key_exists('slides', $params)) {
129
+ $paramSlides = $params['slides'];
130
+ unset($params['slides']);
131
+ }
132
+
133
+ if ($id = $this->getRequest()->getPost('id')) {
134
+ $slider->load($id);
135
+ }
136
+
137
+ $slider->setData($params);
138
+
139
+ try {
140
+ $slider->save();
141
+ $slidesIds = $slider->getSlides()->getAllIds();
142
+
143
+ if (!empty($paramSlides)) {
144
+ foreach ($paramSlides as $slide) {
145
+ $slideData = array();
146
+ $image = null;
147
+
148
+ foreach ($slide as $slideParam) {
149
+ if (array_key_exists('blocks', $slideParam)) {
150
+ $slideParam['params'] = json_encode($slideParam['blocks']);
151
+ unset($slideParam['blocks']);
152
+ } else {
153
+ $slideParam['params'] = '';
154
+ }
155
+
156
+ if (array_key_exists('image', $slideParam)) {
157
+ $image = explode('/', $slideParam['image']);
158
+ $slideParam['image'] = $image[count($image) - 1];
159
+ }
160
+ $slideData = array_merge($slideData, $slideParam);
161
+ }
162
+
163
+ $slideModel = Mage::getModel('elogic_slider/slider_slides');
164
+
165
+ if (array_key_exists('id', $slideData)) {
166
+ $slideModel->load($slideData['id']);
167
+
168
+ if (!empty($slidesIds)) {
169
+ foreach ($slidesIds as $key => $val) {
170
+ if ($val == $slideData['id']) {
171
+ unset($slidesIds[$key]);
172
+ }
173
+ }
174
+ }
175
+ $imagePath = $slideModel->getImagePath(false);
176
+ }
177
+
178
+ $slideModel->setData($slideData);
179
+ $slideModel->setSliderId($slider->getId());
180
+ $slideModel->save();
181
+
182
+ if (array_key_exists('image', $slideData) && preg_match('/temp/', implode('/', $image))) {
183
+ $mediaTempImg = Mage::getBaseDir('media') . DS . 'elogic' . DS . 'temp' . DS . $slideData['image'];
184
+
185
+ if (array_key_exists('id', $slideData)) {
186
+ if (isset($imagePath) && file_exists($imagePath)) {
187
+ unlink($imagePath);
188
+ }
189
+ }
190
+
191
+ if (file_exists($mediaTempImg)) {
192
+ $sliderPath = Mage::getBaseDir('media') . DS . 'elogic' . DS . 'slider' . DS . $slider->getId() . DS;
193
+ $filePath = $sliderPath . $slideModel->getId() . DS;
194
+
195
+ if (!file_exists(Mage::getBaseDir('media') . DS . 'elogic' . DS . 'slider' . DS)) {
196
+ mkdir(Mage::getBaseDir('media') . DS . 'elogic' . DS . 'slider' . DS, 0777);
197
+
198
+ }
199
+
200
+ if (!file_exists($sliderPath)) {
201
+ mkdir($sliderPath, 0777);
202
+ }
203
+
204
+ if (!file_exists($filePath)) {
205
+ mkdir($filePath, 0777);
206
+ }
207
+
208
+ copy($mediaTempImg, $filePath . $slideData['image']);
209
+ unlink($mediaTempImg);
210
+ }
211
+ }
212
+ }
213
+
214
+ if (!empty($slidesIds)) {
215
+ foreach ($slidesIds as $oldSlide) {
216
+ $slideModel = Mage::getModel('elogic_slider/slider_slides')->load($oldSlide);
217
+ $slideModel->delete();
218
+ }
219
+ }
220
+ }
221
+
222
+ $response['message'] = Mage::helper('elogic_slider')->__('Slider has been saved successfully');
223
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
224
+ $response['redirect'] = $this->getUrl('*/*/');
225
+ return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
226
+ } catch (Exception $e) {
227
+ $response['success'] = false;
228
+ $response['message'] = $e->getMessage();
229
+ return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
230
+ }
231
+ }
232
+
233
+ /**
234
+ * Delete slide action
235
+ */
236
+
237
+ public function deleteAction()
238
+ {
239
+ if ($id = $this->getRequest()->getParam('id', false)) {
240
+ try {
241
+ $slider = Mage::getModel('elogic_slider/slider')->load($id);
242
+ $slider->delete();
243
+
244
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('elogic_slider')->__('Slider has been deleted.'));
245
+ $this->_redirect('*/*/');
246
+ return;
247
+ } catch (Exception $e) {
248
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
249
+ $this->_redirect('*/*/');
250
+ return;
251
+ }
252
+ }
253
+
254
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('elogic_slider')->__('Unable to find the slider to delete.'));
255
+ $this->_redirect('*/*/');
256
+ }
257
+
258
+ protected function _isAllowed()
259
+ {
260
+ return true;
261
+ }
262
+
263
+
264
+ }
app/code/local/Elogic/Slider/etc/adminhtml.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Slider Admin config
5
+ *
6
+ * @author elogic
7
+ */
8
+ -->
9
+ <config>
10
+ <menu>
11
+ <elogic_slider translate="title" module="elogic_slider">
12
+ <title>Elogic Slider</title>
13
+ <sort_order>60</sort_order>
14
+ <depends>
15
+ <module>Elogic_Slider</module>
16
+ </depends>
17
+ <children>
18
+ <sliders translate="title" module="elogic_slider">
19
+ <title>Sliders</title>
20
+ <sort_order>10</sort_order>
21
+ <action>elogic_slider/adminhtml_slider</action>
22
+ </sliders>
23
+ </children>
24
+ </elogic_slider>
25
+ </menu>
26
+ <acl>
27
+ <resources>
28
+ <admin>
29
+ <children>
30
+ <elogic_slider translate="title" module="elogic_slider">
31
+ <title>Elogic Slider</title>
32
+ <sort_order>60</sort_order>
33
+ <children>
34
+ <sliders translate="title" module="elogic_slider">
35
+ <title>Sliders</title>
36
+ </sliders>
37
+ </children>
38
+ </elogic_slider>
39
+ </children>
40
+ </admin>
41
+ </resources>
42
+ </acl>
43
+ </config>
app/code/local/Elogic/Slider/etc/config.xml ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Module configuration
5
+ *
6
+ * @author elogic
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <Elogic_Slider>
12
+ <version>0.1.0</version>
13
+ </Elogic_Slider>
14
+ </modules>
15
+ <global>
16
+ <blocks>
17
+ <elogic_slider>
18
+ <class>Elogic_Slider_Block</class>
19
+ </elogic_slider>
20
+ </blocks>
21
+ <helpers>
22
+ <elogic_slider>
23
+ <class>Elogic_Slider_Helper</class>
24
+ </elogic_slider>
25
+ </helpers>
26
+ <models>
27
+ <elogic_slider>
28
+ <class>Elogic_Slider_Model</class>
29
+ <resourceModel>elogic_slider_resource</resourceModel>
30
+ </elogic_slider>
31
+ <elogic_slider_resource>
32
+ <class>Elogic_Slider_Model_Resource</class>
33
+ <entities>
34
+ <slider>
35
+ <table>elogic_slider</table>
36
+ </slider>
37
+ <slider_slides>
38
+ <table>elogic_slider_slides</table>
39
+ </slider_slides>
40
+ </entities>
41
+ </elogic_slider_resource>
42
+ </models>
43
+ <resources>
44
+ <elogic_slider_setup>
45
+ <setup>
46
+ <module>Elogic_Slider</module>
47
+ <class>Mage_Core_Model_Resource_Setup</class>
48
+ </setup>
49
+ <connection>
50
+ <use>core_setup</use>
51
+ </connection>
52
+ </elogic_slider_setup>
53
+ </resources>
54
+ </global>
55
+ <frontend>
56
+ <layout>
57
+ <updates>
58
+ <elogic_slider module="Elogic_Slider">
59
+ <file>elogic/slider.xml</file>
60
+ </elogic_slider>
61
+ </updates>
62
+ </layout>
63
+ </frontend>
64
+ <admin>
65
+ <routers>
66
+ <elogic_slider>
67
+ <use>admin</use>
68
+ <args>
69
+ <module>Elogic_Slider</module>
70
+ <frontName>elogic_slider</frontName>
71
+ </args>
72
+ </elogic_slider>
73
+ </routers>
74
+ </admin>
75
+ <adminhtml>
76
+ <acl>
77
+ <resources>
78
+ <admin>
79
+ <children>
80
+ <system>
81
+ <children>
82
+ <config>
83
+ <children>
84
+ <elogic_slider translate="title" module="elogic_slider">
85
+ <title>Elogic</title>
86
+ </elogic_slider>
87
+ </children>
88
+ </config>
89
+ </children>
90
+ </system>
91
+ </children>
92
+ </admin>
93
+ </resources>
94
+ </acl>
95
+ <layout>
96
+ <updates>
97
+ <elogic_slider module="Elogic_Slider">
98
+ <file>elogic/slider/layout.xml</file>
99
+ </elogic_slider>
100
+ </updates>
101
+ </layout>
102
+ </adminhtml>
103
+ </config>
app/code/local/Elogic/Slider/etc/system.xml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Slider Admin configuration section config
5
+ * @author elogic
6
+ */
7
+ -->
8
+
9
+ <config>
10
+ <tabs>
11
+ <elogic translate="label">
12
+ <label>Elogic</label>
13
+ <sort_order>100</sort_order>
14
+ </elogic>
15
+ </tabs>
16
+ <sections>
17
+ <elogic_slider translate="label" module="elogic_slider">
18
+ <label>Elogic Slider</label>
19
+ <tab>elogic</tab>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>500</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <groups>
26
+ <slider translate="label">
27
+ <label>Slider Settings</label>
28
+ <frontend_type>text</frontend_type>
29
+ <sort_order>1</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ <fields>
34
+ <active translate="label">
35
+ <label>Enabled</label>
36
+ <coment>Show slider on home page</coment>
37
+ <frontend_type>select</frontend_type>
38
+ <source_model>adminhtml/system_config_source_yesno</source_model>
39
+ <sort_order>1</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ </active>
44
+ <slider_id translate="label">
45
+ <label>Homepage slider ID</label>
46
+ <frontend_type>text</frontend_type>
47
+ <sort_order>10</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>1</show_in_website>
50
+ <show_in_store>1</show_in_store>
51
+ </slider_id>
52
+ <!-- <limit translate="label">
53
+ <label>Max slides(in slider)</label>
54
+ <frontend_type>text</frontend_type>
55
+ <comment>Default limit 5</comment>
56
+ <sort_order>15</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>1</show_in_store>
60
+ </limit>-->
61
+ <speed translate="label">
62
+ <label>Speed slider</label>
63
+ <frontend_type>text</frontend_type>
64
+ <comment>Default 5s. 1s = 1000</comment>
65
+ <sort_order>16</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>1</show_in_website>
68
+ <show_in_store>1</show_in_store>
69
+ </speed>
70
+ </fields>
71
+ </slider>
72
+ </groups>
73
+ </elogic_slider>
74
+ </sections>
75
+ </config>
app/code/local/Elogic/Slider/sql/elogic_slider_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * News installation script
4
+ *
5
+ * @author elogic
6
+ */
7
+
8
+ /**
9
+ * @var $installer Mage_Core_Model_Resource_Setup
10
+ */
11
+
12
+ $installer = $this;
13
+
14
+ /**
15
+ * Creating table elogic_slider_slides
16
+ */
17
+
18
+ $installer->startSetup();
19
+
20
+ $installer->getConnection()->dropTable($installer->getTable('elogic_slider/slider'));
21
+ $table = $installer->getConnection()
22
+ ->newTable($installer->getTable('elogic_slider/slider'))
23
+ ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
24
+ 'unsigned' => true,
25
+ 'nullable' => false,
26
+ 'primary' => true,
27
+ 'auto_increment' => true,
28
+ ))
29
+ ->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
30
+ 'nullable' => false,
31
+ 'unsigned' => true,
32
+ ))
33
+ ->addColumn('name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
34
+ 'nullable' => false,
35
+ 'length' => 255
36
+ ))
37
+ ->addColumn('is_active', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array(
38
+ 'nullable' => false,
39
+ ));
40
+ $installer->getConnection()->createTable($table);
41
+
42
+ $installer->getConnection()->dropTable($installer->getTable('elogic_slider/slider_slides'));
43
+ $table = $installer->getConnection()
44
+ ->newTable($installer->getTable('elogic_slider/slider_slides'))
45
+ ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
46
+ 'unsigned' => true,
47
+ 'nullable' => false,
48
+ 'primary' => true,
49
+ 'auto_increment' => true,
50
+ ))
51
+ ->addColumn('slider_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
52
+ 'nullable' => false,
53
+ 'unsigned' => true,
54
+ ))
55
+ ->addColumn('position', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
56
+ 'nullable' => false,
57
+ 'unsigned' => true,
58
+ ))
59
+ ->addColumn('title', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
60
+ 'nullable' => false,
61
+ 'length' => 25,
62
+ ))
63
+ ->addColumn('image', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
64
+ 'nullable' => false,
65
+ 'length' => 35,
66
+ ))
67
+ ->addColumn('params', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
68
+ 'nullable' => false,
69
+ 'length' => 240,
70
+ ))
71
+ ->addForeignKey($installer->getFkName('elogic_slider/slider_slides', 'slider_id', 'elogic_slider/slider', 'id'),
72
+ 'slider_id', $installer->getTable('elogic_slider/slider'), 'id',
73
+ Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_NO_ACTION
74
+ );
75
+ $installer->getConnection()->createTable($table);
76
+
77
+
78
+ $installer->endSetup();
app/code/local/Elogic/Slider/sql/elogic_slider_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * News installation script
4
+ *
5
+ * @author elogic
6
+ */
7
+
8
+ /**
9
+ * @var $installer Mage_Core_Model_Resource_Setup
10
+ */
11
+
12
+ $installer = $this;
13
+
14
+ /**
15
+ * Creating table elogic_slider_slides
16
+ */
17
+
18
+ $installer->startSetup();
19
+
20
+ $installer->getConnection()->dropTable($installer->getTable('elogic_slider/slider'));
21
+ $table = $installer->getConnection()
22
+ ->newTable($installer->getTable('elogic_slider/slider'))
23
+ ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
24
+ 'unsigned' => true,
25
+ 'nullable' => false,
26
+ 'primary' => true,
27
+ 'auto_increment' => true,
28
+ ))
29
+ ->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
30
+ 'nullable' => false,
31
+ 'unsigned' => true,
32
+ ))
33
+ ->addColumn('name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
34
+ 'nullable' => false,
35
+ 'length' => 255
36
+ ))
37
+ ->addColumn('is_active', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array(
38
+ 'nullable' => false,
39
+ ));
40
+ $installer->getConnection()->createTable($table);
41
+
42
+ $installer->getConnection()->dropTable($installer->getTable('elogic_slider/slider_slides'));
43
+ $table = $installer->getConnection()
44
+ ->newTable($installer->getTable('elogic_slider/slider_slides'))
45
+ ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
46
+ 'unsigned' => true,
47
+ 'nullable' => false,
48
+ 'primary' => true,
49
+ 'auto_increment' => true,
50
+ ))
51
+ ->addColumn('slider_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
52
+ 'nullable' => false,
53
+ 'unsigned' => true,
54
+ ))
55
+ ->addColumn('position', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
56
+ 'nullable' => false,
57
+ 'unsigned' => true,
58
+ ))
59
+ ->addColumn('title', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
60
+ 'nullable' => false,
61
+ 'length' => 25,
62
+ ))
63
+ ->addColumn('image', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
64
+ 'nullable' => false,
65
+ 'length' => 35,
66
+ ))
67
+ ->addColumn('params', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
68
+ 'nullable' => false,
69
+ 'length' => 240,
70
+ ))
71
+ ->addForeignKey($installer->getFkName('elogic_slider/slider_slides', 'slider_id', 'elogic_slider/slider', 'id'),
72
+ 'slider_id', $installer->getTable('elogic_slider/slider'), 'id',
73
+ Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_NO_ACTION
74
+ );
75
+ $installer->getConnection()->createTable($table);
76
+
77
+
78
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/elogic/slider/layout.xml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Slider backend layout
5
+ * @author elogic
6
+ */
7
+ -->
8
+
9
+ <layout version="0.1.0">
10
+ <elogic_slider_adminhtml_slider_new>
11
+ <reference name="head">
12
+ <action method="addItem">
13
+ <type>skin_js</type>
14
+ <name>elogic/slider/js/plugins/jquery-1.7.2.min.js</name>
15
+ </action>
16
+ <action method="addItem">
17
+ <type>skin_js</type>
18
+ <name>elogic/slider/js/plugins/jquery-noconflict.js</name>
19
+ </action>
20
+ <action method="addItem">
21
+ <type>skin_js</type>
22
+ <name>elogic/slider/js/plugins/jquery-sortable.js</name>
23
+ </action>
24
+ <action method="addItem">
25
+ <type>skin_js</type>
26
+ <name>elogic/slider/js/plugins/jquery.imgareaselect.min.js</name>
27
+ </action>
28
+ <action method="addItem">
29
+ <type>skin_js</type>
30
+ <name>elogic/slider/js/plugins/jquery.form.js</name>
31
+ </action>
32
+ <action method="addItem">
33
+ <type>skin_js</type>
34
+ <name>elogic/slider/js/slider-form.js</name>
35
+ </action>
36
+ <action method="addItem">
37
+ <type>skin_css</type>
38
+ <name>elogic/slider/css/imgareaselect-default.css</name>
39
+ </action>
40
+ <action method="addItem">
41
+ <type>skin_css</type>
42
+ <name>elogic/slider/css/custom.css</name>
43
+ </action>
44
+ </reference>
45
+ </elogic_slider_adminhtml_slider_new>
46
+
47
+ <elogic_slider_adminhtml_slider_edit>
48
+ <reference name="head">
49
+ <action method="addItem">
50
+ <type>skin_js</type>
51
+ <name>elogic/slider/js/plugins/jquery-1.7.2.min.js</name>
52
+ </action>
53
+ <action method="addItem">
54
+ <type>skin_js</type>
55
+ <name>elogic/slider/js/plugins/jquery-noconflict.js</name>
56
+ </action>
57
+ <action method="addItem">
58
+ <type>skin_js</type>
59
+ <name>elogic/slider/js/plugins/jquery-sortable.js</name>
60
+ </action>
61
+ <action method="addItem">
62
+ <type>skin_js</type>
63
+ <name>elogic/slider/js/plugins/jquery.imgareaselect.min.js</name>
64
+ </action>
65
+ <action method="addItem">
66
+ <type>skin_js</type>
67
+ <name>elogic/slider/js/plugins/jquery.form.js</name>
68
+ </action>
69
+ <action method="addItem">
70
+ <type>skin_js</type>
71
+ <name>elogic/slider/js/slider-form.js</name>
72
+ </action>
73
+
74
+ <action method="addItem">
75
+ <type>skin_css</type>
76
+ <name>elogic/slider/css/imgareaselect-default.css</name>
77
+ </action>
78
+ <action method="addItem">
79
+ <type>skin_css</type>
80
+ <name>elogic/slider/css/custom.css</name>
81
+ </action>
82
+ </reference>
83
+ </elogic_slider_adminhtml_slider_edit>
84
+ </layout>
app/design/adminhtml/default/default/template/elogic/slider/container.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_slider = $this->getSlider() ?>
2
+ <?php $slides = $this->getSlides()?>
3
+ <?php echo $this->getFormInitScripts() ?>
4
+ <div class="slider-container">
5
+ <div class="content-header">
6
+ <table cellspacing="0">
7
+ <tr>
8
+ <td>
9
+ <h3 class="icon-head head-product-attribute-sets">
10
+ <?php echo $this->escapeHtml($this->_getHeader()) ?>
11
+ </h3>
12
+ </td>
13
+ <td class="form-buttons">
14
+ <?php echo $this->getButtonsHtml('header') ?>
15
+ </td>
16
+ </tr>
17
+ </table>
18
+ </div>
19
+ <table cellspacing="15" width="100%">
20
+ <tr>
21
+ <td class="form-cols" style="width:340px">
22
+ <?php echo $this->getContentFormHtml(); ?>
23
+ </td>
24
+ <td class="form-cols" style="width:180px">
25
+ <div class="content-header skip-header">
26
+ <h3><?php echo Mage::helper('elogic_slider')->__('Slides') ?></h3>
27
+ <button class="add-new-slide">
28
+ <?php echo Mage::helper('elogic_slider')->__('Add slide') ?>
29
+ </button>
30
+ </div>
31
+ <div>
32
+ <ul class="slides-list sortable" id="slides-list">
33
+ <?php foreach($slides as $slide):?>
34
+ <?php echo $slide['row']?>
35
+ <?php endforeach?>
36
+ </ul>
37
+ </div>
38
+ </td>
39
+ <td>
40
+ <ul class="slides" id="slides">
41
+ <?php foreach($slides as $slide):?>
42
+ <?php echo $slide['html']?>
43
+ <?php endforeach?>
44
+ </ul>
45
+ </td>
46
+ </tr>
47
+ </table>
48
+ </div>
49
+ <?php $k = Mage::getSingleton('core/session')->getFormKey(); ?>
50
+ <script type="text/javascript">
51
+ window.urls = window.urls || {};
52
+ window.urls.saveSlider = '<?php echo $this->getSaveSliderUrl();?>';
53
+ window.urls.addSlide = '<?php echo $this->getAddSlideUrl();?>';
54
+ window.urls.thumbnailImage = '<?php echo $this->getUploadThumbUrl();?>';
55
+ var sliderConfig = <?php echo $this->getJsonSliderConfig()?>;
56
+
57
+ var editForm = new varienForm('edit_slider_form', '<?php echo $this->getValidationUrl() ?>');
58
+
59
+ </script>
60
+ <?php echo $this->getFormScripts() ?>
app/design/adminhtml/default/default/template/elogic/slider/slide.phtml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $slide = $this->getSlide()?>
2
+ <li class="slide-template" id="slide-<?php echo $this->getUniqId()?>">
3
+ <div class="entry-edit">
4
+ <div class="entry-edit-head">
5
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Slide template')?> <?php echo $this->getUniqId()?></h4>
6
+ <div class="form-buttons"></div>
7
+ </div>
8
+ <div class="fieldset">
9
+ <form method="post" class="edit_slider_form" action="" enctype="multipart/form-data">
10
+ <?php echo $this->getBlockHtml('formkey')?>
11
+
12
+ <table cellspacing="0" class="form-list">
13
+ <tbody>
14
+ <tr>
15
+ <td class="label">
16
+ <label for="name"><?php echo $this->__('Slide Title');?></label>
17
+ </td>
18
+ <td class="value">
19
+ <input type="text" name="title" value="<?php echo $slide ? $slide->getTitle() : ''?>">
20
+ </td>
21
+ </tr>
22
+ <tr>
23
+ <td class="label">
24
+ <label for="name"><?php echo $this->__('Image');?></label>
25
+ </td>
26
+ <td class="value">
27
+ <input type="file" name="image">
28
+ <br>
29
+ <div class="slide-image wrapper">
30
+ <img src="<?php echo $slide ? $slide->getImagePath() : ''?>" class="slide-image">
31
+ <div class="blocks">
32
+
33
+ </div>
34
+ </div>
35
+ </td>
36
+ </tr>
37
+ </tbody>
38
+ </table>
39
+
40
+ <input type="hidden" name="uniqid" value="<?php echo $this->getUniqId()?>">
41
+ <input type="hidden" name="position" value="">
42
+ </form>
43
+ <div>
44
+ <form class="form-blocks" action="" method="get">
45
+ <div class="block">
46
+ <input type="hidden" name="x1" value="" />
47
+ <input type="hidden" name="y1" value="" />
48
+ <input type="hidden" name="width" value="" />
49
+ <input type="hidden" name="height" value="" />
50
+ <input type="text" name="product-link" value="" placeholder="<?php echo $this->__('Link')?>" />
51
+ <input type="text" name="product-name" value="" placeholder="<?php echo $this->__('Name')?>" />
52
+ </div>
53
+ <button type="submit" name="submit"><?php echo $this->__('Add block')?></button>
54
+ </form>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ </li>
app/design/frontend/base/default/layout/elogic/slider.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Slider frontend layout
5
+ *
6
+ * @author elogic
7
+ */
8
+ -->
9
+ <layout version="0.1.0">
10
+ <cms_index_index translate="label">
11
+ <reference name="head">
12
+ <action method="addItem">
13
+ <type>skin_css</type>
14
+ <name>elogic/slider/css/flexslider.css</name>
15
+ </action>
16
+ <action method="addItem">
17
+ <type>skin_css</type>
18
+ <name>elogic/slider/css/slider.css</name>
19
+ </action>
20
+ <action method="addItem">
21
+ <type>skin_js</type>
22
+ <name>elogic/slider/js/tooltip.js</name>
23
+ </action>
24
+ <action method="addItem">
25
+ <type>skin_js</type>
26
+ <name>elogic/slider/js/jquery.flexslider-min.js</name>
27
+ </action>
28
+ </reference>
29
+ <reference name="content">
30
+ <block type="elogic_slider/slider" name="elogic_slider.slider" before="-">
31
+ <action method="setSliderId">
32
+ <sliderId helper="elogic_slider/getHomeSliderId"/>
33
+ </action>
34
+ <action method="setTemplate" ifconfig="elogic_slider/slider/active">
35
+ <template>elogic/slider.phtml</template>
36
+ </action>
37
+ </block>
38
+ </reference>
39
+ </cms_index_index>
40
+ </layout>
app/design/frontend/base/default/template/elogic/slider.phtml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $slider = $this->getSlider(); ?>
2
+ <?php $storeId = Mage::app()->getStore()->getStoreId(); ?>
3
+ <?php if ($slider): ?>
4
+ <!-- Slider content -->
5
+ <?php if ($slidesCollection = $slider->getSlides()): ?>
6
+ <?php $i = 0; ?>
7
+ <div class="slide-image">
8
+ <div class="flexslider">
9
+   
10
+ <ul class="slides">
11
+ <?php foreach ($slidesCollection as $slide): ?>
12
+ <?php $i++; ?>
13
+ <li>
14
+ <img
15
+ src="<?php echo Mage::getBaseUrl('media') . 'elogic/slider/' . $slide->getSliderId() . '/' . $slide->getId() . '/' . $slide->getImage(); ?>"
16
+ class="slide-image">
17
+ <div class="blocks">
18
+ <?php foreach ($slide->getParams() as $param) { ?>
19
+ <a class="el_beatles masterTooltip el_<?php echo $i ?>" href="<?php echo $param['url'] ?>" title="<?php echo $param['name'] ?>"
20
+ style="left: <?php echo $param['x1'] * 100 . '%' ?>; top: <?php echo $param['y1'] * 100 . '%' ?>; width: <?php echo $param['width'] * 100 . '%' ?>; height: <?php echo $param['height'] * 100 . '%' ?>">
21
+ </a>
22
+ <?php } ?>
23
+ </div>
24
+ </li>
25
+ <?php endforeach; ?>
26
+ </ul>
27
+ </div>
28
+ </div>
29
+ <?php endif ?>
30
+ <?php endif ?>
31
+ <script>
32
+ jQuery(document).ready(function ($) {
33
+ $('.flexslider').flexslider({
34
+ animation: "slide",
35
+ pauseOnAction: true,
36
+ slideshowSpeed: <?php echo $this->speedSlider(); ?>,
37
+ after: function() {
38
+ var height = $(".slides li.flex-active-slide").height();
39
+ $('.flex-viewport').height(height)
40
+ }
41
+ });
42
+ });
43
+ </script>
app/etc/modules/Elogic_Slider.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Module initial config
5
+ *
6
+ * @author elogic
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <Elogic_Slider>
12
+ <active>true</active>
13
+ <codePool>local</codePool>
14
+ </Elogic_Slider>
15
+ </modules>
16
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Elogic_Slider</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>Open Software License</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Slider functional allows to add multiple banners, select any area on the banner and add links to this area. Responsive on any mobile an desktop screen and has autoplay.</summary>
10
+ <description>Elogic Slider allows easily add and manage banners. Slider allows create separate sliders with different sets of banners, has autoplay and responsive design. Feature of this slider is the ability to create, edit and delete multiple active areas on each banner image on Back-end (Admin Panel). On Front-End selected areas displayed by mouse hover. It means that you can add severan links in any place to each banner image.</description>
11
+ <notes>First stable release</notes>
12
+ <authors><author><name>eLogic LLC</name><user>eLogic</user><email>igor@elogic.co</email></author></authors>
13
+ <date>2016-07-25</date>
14
+ <time>20:15:03</time>
15
+ <contents><target name="magelocal"><dir name="Elogic"><dir name="Slider"><dir name="Block"><dir name="Adminhtml"><dir name="Slider"><dir name="Edit"><file name="Container.php" hash="7a68eb0260204feebfc5ec82729d6262"/><file name="Form.php" hash="73e27e4efdc531bf6785f6194662dd2b"/><file name="Slide.php" hash="48fc38bf1fb156f796e2d1ee5bb79364"/></dir><file name="Grid.php" hash="bdedbf73d2b5b4ae782c59b0cf0d170a"/></dir><file name="Slider.php" hash="224672996934a8b9fc638532d777a4bd"/></dir><file name="Slider.php" hash="c4a5f0e0b314988b79e3821026e80901"/></dir><dir name="Helper"><file name="Data.php" hash="3160f258fcccc7de4d9fe0806708e2ea"/></dir><dir name="Model"><dir name="Resource"><dir name="Slider"><file name="Collection.php" hash="38dcd7adbd2266e006b2b6c4623079f4"/><dir name="Slides"><file name="Collection.php" hash="505065dd18ef714b3d840d50f82bfc35"/></dir><file name="Slides.php" hash="28af5186a5e7734cbb0c4c394fa25a38"/></dir><file name="Slider.php" hash="213978a7bfea80ad64c19802c367743f"/></dir><dir name="Slider"><file name="Slides.php" hash="07eb0b00d8cd1111ed86f857b44db0f4"/></dir><file name="Slider.php" hash="67f362fb42e166ba8a3b6d6fe6a52cad"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SliderController.php" hash="381f0f5cbe94c1e58759cad54178a6f0"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="9ba7d64ee954c91f22de383b7e12d300"/><file name="config.xml" hash="734e58e219571259c0f4cfdd2b17acf5"/><file name="system.xml" hash="56c92a44090a87ba6da95ea86895f80c"/></dir><dir name="sql"><dir name="elogic_slider_setup"><file name="mysql4-install-0.1.0.php" hash="a46fb8a75935244c1d26ef2d54326f9e"/><file name="mysql4-install-1.0.0.php" hash="a46fb8a75935244c1d26ef2d54326f9e"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="elogic"><dir name="slider"><file name="container.phtml" hash=""/><file name="slide.phtml" hash=""/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="elogic"><file name="slider.xml" hash=""/></dir></dir><dir name="template"><dir name="elogic"><file name="slider.phtml" hash=""/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Elogic_Slider.xml" hash="1befefc2b48993e4360dacf2a1ad5649"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="elogic"><dir name="slider"><file name="layout.xml" hash="8a93cf71ba728581891ea938a137e86f"/></dir></dir></dir><dir name="template"><dir name="elogic"><dir name="slider"><file name="container.phtml" hash="848897ffcbb1d0776b7bfe34abc965eb"/><file name="slide.phtml" hash="85d56df49199958fde666ea527243b29"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="elogic"><file name="slider.phtml" hash="99684ae40a0a7894af0635d81acf6674"/></dir></dir><dir name="layout"><dir name="elogic"><file name="slider.xml" hash="0172367fbf359244bb60df6431353694"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="elogic"><dir name="slider"><dir name="css"><file name="custom.css" hash="e627f87e1db8a51b7f4f3018c8f4a942"/><file name="imgareaselect-default.css" hash="e730ed6faac687a56116cd957647ba06"/></dir><dir name="images"><file name="arrow_sort_move.gif" hash="f5ac151a2b0cb1f07d6e771b8aee0ea7"/><file name="border-anim-h.gif" hash="50da31b23fdd3f5585dffd363c310456"/><file name="border-anim-v.gif" hash="a786bb7ed6d1cdc6146f086a22d0342d"/><file name="border-h.gif" hash="033ed6441775985e185e3b111e2f016e"/><file name="border-v.gif" hash="d451d8134998fa1f7f02ee9704f4cf68"/><file name="btn_gr_bg.gif" hash="6cc324b79a512150fee24fb3517d22cb"/><file name="btn_gr_on.gif" hash="820c134df02f7bc12efa5a9ac3b4d3dd"/><file name="btn_gr_over.gif" hash="d4c8b807d64c1f493d17c6c9d2bab69a"/><file name="cancel_btn_icon.gif" hash="97e0cd94ed31d6f2a1181f627e60e9a3"/></dir><dir name="js"><dir name="plugins"><file name="jquery-1.7.2.min.js" hash="2234890bbc5422fd232a1f9ee93ad61f"/><file name="jquery-2.2.1.min.js" hash="6cbb321051a268424103cd4aea8ffa66"/><file name="jquery-noconflict.js" hash="ab64c7a0b3ba7aa6e1cdc0c049c7806e"/><file name="jquery-sortable.js" hash="7ff03231b0d56802f27c5a3a8d2c89fc"/><file name="jquery.form.js" hash="08a24670beb2eae7ef79a6d5ac23874b"/><file name="jquery.imgareaselect.js" hash="5d4ed492977a1fedb3c9258a30e23d5d"/><file name="jquery.imgareaselect.min.js" hash="0030d4ba4c429d776d23c2e37775873a"/><file name="jquery.imgareaselect.pack.js" hash="670f993e96eae52834d6736e3048fc76"/></dir><file name="slider-form.js" hash="5e98dd9ad9fd31ed7080c6c5464807db"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="elogic"><dir name="slider"><dir name="css"><file name="flexslider.css" hash="4c5fc2635f9fed14a43a999ca69103ec"/><file name="slider.css" hash="e73265a7da47c7bf6506b5003feef324"/></dir><dir name="fonts"><file name="flexslider-icon.eot" hash="9c9cb7a6055043933ba68854f521af45"/><file name="flexslider-icon.svg" hash="10e8a5455c4522c48aa975eacd4f0023"/><file name="flexslider-icon.ttf" hash="b4c9e5057989b9727a5df4e0a21af33c"/><file name="flexslider-icon.woff" hash="f8b92f66539473eea649c8514eb836a0"/></dir><dir name="js"><file name="jquery.flexslider-min.js" hash="d22c7a166ed20731c48d2f36ff1334ad"/><file name="tooltip.js" hash="4f00c7fd2355da5a9fa772b4e964303b"/></dir></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.0.0</min><max>5.6.21</max></php><package><name/><channel>connect.magentocommerce.com/core</channel><min/><max/></package></required></dependencies>
18
+ </package>
skin/adminhtml/default/default/elogic/slider/css/custom.css ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .slider-container button.add-new-slide{
2
+ float: right;
3
+ background-image:url(../images/btn_gr_bg.gif);
4
+ border-color:#46745E;
5
+ }
6
+ .slider-container button.add-new-slide:hover { background:url(../images/btn_gr_over.gif) #6cac46; }
7
+ .slider-container button.add-new-slide:active { background:url(../images/btn_gr_on.gif) repeat-x 0 0 #3fa05e; }
8
+ .slider-container .form-list td.label{
9
+ width: 85px;
10
+ }
11
+ .slider-container .form-list td.label label{
12
+ width: 70px;
13
+ }
14
+
15
+ .slider-container .form-list td.value input.input-text,.slider-container .form-list td.value textarea{
16
+ width:206px;
17
+ }
18
+ .slider-container .form-list td.value select{
19
+ width:210px;
20
+ padding-right: 0;
21
+ }
22
+ .slider-container .slides-list li i.icon-move{
23
+ float: left;
24
+ background-image: url(../images/arrow_sort_move.gif);
25
+ width: 5px;
26
+ height: 11px;
27
+ margin: 5px;
28
+ }
29
+ .slider-container .slides-list li i.icon-delete{
30
+ float: right;
31
+ background-image: url(../images/cancel_btn_icon.gif);
32
+ width: 16px;
33
+ height: 16px;
34
+ font-size: 0;
35
+ cursor: pointer;
36
+ }
37
+ .slider-container .slides-list li{
38
+ cursor: pointer;
39
+ background-color: #ACFCAF;
40
+ padding: 2px 5px;
41
+ border-radius: 5px;
42
+ margin-bottom: 5px;
43
+ }
44
+ .slider-container .slides-list li.active{
45
+ background-color: #ffbbbb;
46
+ }
47
+ .slider-container .slides li{
48
+ display: none;
49
+ }
50
+ .slider-container .slides li .slide-image img{
51
+ max-width: 100%;
52
+ width: 100%;
53
+ }
54
+ .image_container {
55
+ float: left;
56
+ margin-right: 50px;
57
+ }
58
+ .slider-container .wrapper {
59
+ position: relative;
60
+ min-width: inherit;
61
+ }
62
+ .slider-container .wrapper a {
63
+ opacity: 0;
64
+ position: absolute;
65
+ display: block;
66
+ background: rgba(255,255,255,.25);
67
+ transition: .5s;
68
+ border: 3px solid rgba(255,255,255,0);
69
+ color: rgba(255,255,255,.75);
70
+ text-shadow: 0 0 3px #333;
71
+ font-weight: bold;
72
+ text-decoration: none;
73
+ font-family: sans-serif;
74
+ text-align: center;
75
+ vertical-align: bottom;
76
+ }
77
+ .slider-container .wrapper a > span {
78
+ position: absolute;
79
+ bottom: 0;
80
+ left: 50%;
81
+ transform: translateX(-50%);
82
+ }
83
+ .slider-container .wrapper:hover a {
84
+ transition: 1s;
85
+ opacity: 1;
86
+ }
87
+ .slider-container .wrapper:hover a:hover {
88
+ background: rgba(255,255,255,0);
89
+ border: 3px solid rgba(255,255,255,.5);
90
+ transition: .5s;
91
+ }
92
+ .slider-container .el_titles {
93
+ display: inline-block;
94
+ }
skin/adminhtml/default/default/elogic/slider/css/imgareaselect-default.css ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * imgAreaSelect default style
3
+ */
4
+
5
+ .imgareaselect-border1 {
6
+ background: url(../images/border-v.gif) repeat-y left top;
7
+ }
8
+
9
+ .imgareaselect-border2 {
10
+ background: url(../images/border-h.gif) repeat-x left top;
11
+ }
12
+
13
+ .imgareaselect-border3 {
14
+ background: url(../images/border-v.gif) repeat-y right top;
15
+ }
16
+
17
+ .imgareaselect-border4 {
18
+ background: url(../images/border-h.gif) repeat-x left bottom;
19
+ }
20
+
21
+ .imgareaselect-border1, .imgareaselect-border2,
22
+ .imgareaselect-border3, .imgareaselect-border4 {
23
+ filter: alpha(opacity=50);
24
+ opacity: 0.5;
25
+ }
26
+
27
+ .imgareaselect-handle {
28
+ background-color: #fff;
29
+ border: solid 1px #000;
30
+ filter: alpha(opacity=50);
31
+ opacity: 0.5;
32
+ }
33
+
34
+ .imgareaselect-outer {
35
+ background-color: #000;
36
+ filter: alpha(opacity=50);
37
+ opacity: 0.5;
38
+ }
39
+
40
+ .imgareaselect-selection {
41
+ }
skin/adminhtml/default/default/elogic/slider/images/arrow_sort_move.gif ADDED
Binary file
skin/adminhtml/default/default/elogic/slider/images/border-anim-h.gif ADDED
Binary file
skin/adminhtml/default/default/elogic/slider/images/border-anim-v.gif ADDED
Binary file
skin/adminhtml/default/default/elogic/slider/images/border-h.gif ADDED
Binary file
skin/adminhtml/default/default/elogic/slider/images/border-v.gif ADDED
Binary file
skin/adminhtml/default/default/elogic/slider/images/btn_gr_bg.gif ADDED
Binary file
skin/adminhtml/default/default/elogic/slider/images/btn_gr_on.gif ADDED
Binary file
skin/adminhtml/default/default/elogic/slider/images/btn_gr_over.gif ADDED
Binary file
skin/adminhtml/default/default/elogic/slider/images/cancel_btn_icon.gif ADDED
Binary file
skin/adminhtml/default/default/elogic/slider/js/plugins/jquery-1.7.2.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery v1.7.2 jquery.com | jquery.org/license */
2
+ ;(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
3
+ a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
4
+ .clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
skin/adminhtml/default/default/elogic/slider/js/plugins/jquery-2.2.1.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery v2.2.1 | (c) jQuery Foundation | jquery.org/license */
2
+ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!k.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=R.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c}catch(e){}O.set(a,b,c);
3
+ }else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ca(b),i="border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Fa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Ba.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+Oa(b,c,e||(i?"border":"content"),f,h)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,
4
+ e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(void 0===a||"boolean"===c)&&(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){return n.trim(a.value)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var hb=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!hb.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,hb.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var ib=a.location,jb=n.now(),kb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return(!c||c.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+b),c};var lb=/#.*$/,mb=/([?&])_=[^&]*/,nb=/^(.*?):[ \t]*([^\r\n]*)$/gm,ob=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,pb=/^(?:GET|HEAD)$/,qb=/^\/\//,rb={},sb={},tb="*/".concat("*"),ub=d.createElement("a");ub.href=ib.href;function vb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function wb(a,b,c,d){var e={},f=a===sb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function xb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function yb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function zb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ib.href,type:"GET",isLocal:ob.test(ib.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":tb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?xb(xb(a,n.ajaxSettings),b):xb(n.ajaxSettings,a)},ajaxPrefilter:vb(rb),ajaxTransport:vb(sb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=nb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||ib.href)+"").replace(lb,"").replace(qb,ib.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=ub.protocol+"//"+ub.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),wb(rb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!pb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(kb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=mb.test(f)?f.replace(mb,"$1_="+jb++):f+(kb.test(f)?"&":"?")+"_="+jb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+tb+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=wb(sb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=yb(m,x,d)),u=zb(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,(b||!y)&&(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Ab=/%20/g,Bb=/\[\]$/,Cb=/\r?\n/g,Db=/^(?:submit|button|image|reset|file)$/i,Eb=/^(?:input|select|textarea|keygen)/i;function Fb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Bb.test(a)?d(a,e):Fb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Fb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Fb(c,a[c],b,e);return d.join("&").replace(Ab,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Eb.test(this.nodeName)&&!Db.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Cb,"\r\n")}}):{name:b.name,value:c.replace(Cb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Gb={0:200,1223:204},Hb=n.ajaxSettings.xhr();l.cors=!!Hb&&"withCredentials"in Hb,l.ajax=Hb=!!Hb,n.ajaxTransport(function(b){var c,d;return l.cors||Hb&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Gb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Ib=[],Jb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Ib.pop()||n.expando+"_"+jb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Jb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Jb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Jb,"$1"+e):b.jsonp!==!1&&(b.url+=(kb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Ib.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),l.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||(l.createHTMLDocument?d.implementation.createHTMLDocument(""):d);var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Kb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Kb)return Kb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Lb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Lb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Lb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Mb=a.jQuery,Nb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Nb),b&&a.jQuery===n&&(a.jQuery=Mb),n},b||(a.jQuery=a.$=n),n});
skin/adminhtml/default/default/elogic/slider/js/plugins/jquery-noconflict.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ //Avoid PrototypeJS conflicts, assign jQuery to $j instead of $
2
+ ;var $j = jQuery.noConflict();
skin/adminhtml/default/default/elogic/slider/js/plugins/jquery-sortable.js ADDED
@@ -0,0 +1,693 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* ===================================================
2
+ * jquery-sortable.js v0.9.13
3
+ * http://johnny.github.com/jquery-sortable/
4
+ * ===================================================
5
+ * Copyright (c) 2012 Jonas von Andrian
6
+ * All rights reserved.
7
+ *
8
+ * Redistribution and use in source and binary forms, with or without
9
+ * modification, are permitted provided that the following conditions are met:
10
+ * * Redistributions of source code must retain the above copyright
11
+ * notice, this list of conditions and the following disclaimer.
12
+ * * Redistributions in binary form must reproduce the above copyright
13
+ * notice, this list of conditions and the following disclaimer in the
14
+ * documentation and/or other materials provided with the distribution.
15
+ * * The name of the author may not be used to endorse or promote products
16
+ * derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ * ========================================================== */
29
+
30
+
31
+ !function ( $, window, pluginName, undefined){
32
+ var containerDefaults = {
33
+ // If true, items can be dragged from this container
34
+ drag: true,
35
+ // If true, items can be droped onto this container
36
+ drop: true,
37
+ // Exclude items from being draggable, if the
38
+ // selector matches the item
39
+ exclude: "",
40
+ // If true, search for nested containers within an item.If you nest containers,
41
+ // either the original selector with which you call the plugin must only match the top containers,
42
+ // or you need to specify a group (see the bootstrap nav example)
43
+ nested: true,
44
+ // If true, the items are assumed to be arranged vertically
45
+ vertical: true
46
+ }, // end container defaults
47
+ groupDefaults = {
48
+ // This is executed after the placeholder has been moved.
49
+ // $closestItemOrContainer contains the closest item, the placeholder
50
+ // has been put at or the closest empty Container, the placeholder has
51
+ // been appended to.
52
+ afterMove: function ($placeholder, container, $closestItemOrContainer) {
53
+ },
54
+ // The exact css path between the container and its items, e.g. "> tbody"
55
+ containerPath: "",
56
+ // The css selector of the containers
57
+ containerSelector: "ol, ul",
58
+ // Distance the mouse has to travel to start dragging
59
+ distance: 0,
60
+ // Time in milliseconds after mousedown until dragging should start.
61
+ // This option can be used to prevent unwanted drags when clicking on an element.
62
+ delay: 0,
63
+ // The css selector of the drag handle
64
+ handle: "",
65
+ // The exact css path between the item and its subcontainers.
66
+ // It should only match the immediate items of a container.
67
+ // No item of a subcontainer should be matched. E.g. for ol>div>li the itemPath is "> div"
68
+ itemPath: "",
69
+ // The css selector of the items
70
+ itemSelector: "li",
71
+ // The class given to "body" while an item is being dragged
72
+ bodyClass: "dragging",
73
+ // The class giving to an item while being dragged
74
+ draggedClass: "dragged",
75
+ // Check if the dragged item may be inside the container.
76
+ // Use with care, since the search for a valid container entails a depth first search
77
+ // and may be quite expensive.
78
+ isValidTarget: function ($item, container) {
79
+ return true
80
+ },
81
+ // Executed before onDrop if placeholder is detached.
82
+ // This happens if pullPlaceholder is set to false and the drop occurs outside a container.
83
+ onCancel: function ($item, container, _super, event) {
84
+ },
85
+ // Executed at the beginning of a mouse move event.
86
+ // The Placeholder has not been moved yet.
87
+ onDrag: function ($item, position, _super, event) {
88
+ $item.css(position)
89
+ },
90
+ // Called after the drag has been started,
91
+ // that is the mouse button is being held down and
92
+ // the mouse is moving.
93
+ // The container is the closest initialized container.
94
+ // Therefore it might not be the container, that actually contains the item.
95
+ onDragStart: function ($item, container, _super, event) {
96
+ $item.css({
97
+ height: $item.outerHeight(),
98
+ width: $item.outerWidth()
99
+ })
100
+ $item.addClass(container.group.options.draggedClass)
101
+ $("body").addClass(container.group.options.bodyClass)
102
+ },
103
+ // Called when the mouse button is being released
104
+ onDrop: function ($item, container, _super, event) {
105
+ $item.removeClass(container.group.options.draggedClass).removeAttr("style")
106
+ $("body").removeClass(container.group.options.bodyClass)
107
+ },
108
+ // Called on mousedown. If falsy value is returned, the dragging will not start.
109
+ // Ignore if element clicked is input, select or textarea
110
+ onMousedown: function ($item, _super, event) {
111
+ if (!event.target.nodeName.match(/^(input|select|textarea)$/i)) {
112
+ event.preventDefault()
113
+ return true
114
+ }
115
+ },
116
+ // The class of the placeholder (must match placeholder option markup)
117
+ placeholderClass: "placeholder",
118
+ // Template for the placeholder. Can be any valid jQuery input
119
+ // e.g. a string, a DOM element.
120
+ // The placeholder must have the class "placeholder"
121
+ placeholder: '<li class="placeholder"></li>',
122
+ // If true, the position of the placeholder is calculated on every mousemove.
123
+ // If false, it is only calculated when the mouse is above a container.
124
+ pullPlaceholder: true,
125
+ // Specifies serialization of the container group.
126
+ // The pair $parent/$children is either container/items or item/subcontainers.
127
+ serialize: function ($parent, $children, parentIsContainer) {
128
+ var result = $.extend({}, $parent.data())
129
+
130
+ if(parentIsContainer)
131
+ return [$children]
132
+ else if ($children[0]){
133
+ result.children = $children
134
+ }
135
+
136
+ delete result.subContainers
137
+ delete result.sortable
138
+
139
+ return result
140
+ },
141
+ // Set tolerance while dragging. Positive values decrease sensitivity,
142
+ // negative values increase it.
143
+ tolerance: 0
144
+ }, // end group defaults
145
+ containerGroups = {},
146
+ groupCounter = 0,
147
+ emptyBox = {
148
+ left: 0,
149
+ top: 0,
150
+ bottom: 0,
151
+ right:0
152
+ },
153
+ eventNames = {
154
+ start: "touchstart.sortable mousedown.sortable",
155
+ drop: "touchend.sortable touchcancel.sortable mouseup.sortable",
156
+ drag: "touchmove.sortable mousemove.sortable",
157
+ scroll: "scroll.sortable"
158
+ },
159
+ subContainerKey = "subContainers"
160
+
161
+ /*
162
+ * a is Array [left, right, top, bottom]
163
+ * b is array [left, top]
164
+ */
165
+ function d(a,b) {
166
+ var x = Math.max(0, a[0] - b[0], b[0] - a[1]),
167
+ y = Math.max(0, a[2] - b[1], b[1] - a[3])
168
+ return x+y;
169
+ }
170
+
171
+ function setDimensions(array, dimensions, tolerance, useOffset) {
172
+ var i = array.length,
173
+ offsetMethod = useOffset ? "offset" : "position"
174
+ tolerance = tolerance || 0
175
+
176
+ while(i--){
177
+ var el = array[i].el ? array[i].el : $(array[i]),
178
+ // use fitting method
179
+ pos = el[offsetMethod]()
180
+ pos.left += parseInt(el.css('margin-left'), 10)
181
+ pos.top += parseInt(el.css('margin-top'),10)
182
+ dimensions[i] = [
183
+ pos.left - tolerance,
184
+ pos.left + el.outerWidth() + tolerance,
185
+ pos.top - tolerance,
186
+ pos.top + el.outerHeight() + tolerance
187
+ ]
188
+ }
189
+ }
190
+
191
+ function getRelativePosition(pointer, element) {
192
+ var offset = element.offset()
193
+ return {
194
+ left: pointer.left - offset.left,
195
+ top: pointer.top - offset.top
196
+ }
197
+ }
198
+
199
+ function sortByDistanceDesc(dimensions, pointer, lastPointer) {
200
+ pointer = [pointer.left, pointer.top]
201
+ lastPointer = lastPointer && [lastPointer.left, lastPointer.top]
202
+
203
+ var dim,
204
+ i = dimensions.length,
205
+ distances = []
206
+
207
+ while(i--){
208
+ dim = dimensions[i]
209
+ distances[i] = [i,d(dim,pointer), lastPointer && d(dim, lastPointer)]
210
+ }
211
+ distances = distances.sort(function (a,b) {
212
+ return b[1] - a[1] || b[2] - a[2] || b[0] - a[0]
213
+ })
214
+
215
+ // last entry is the closest
216
+ return distances
217
+ }
218
+
219
+ function ContainerGroup(options) {
220
+ this.options = $.extend({}, groupDefaults, options)
221
+ this.containers = []
222
+
223
+ if(!this.options.rootGroup){
224
+ this.scrollProxy = $.proxy(this.scroll, this)
225
+ this.dragProxy = $.proxy(this.drag, this)
226
+ this.dropProxy = $.proxy(this.drop, this)
227
+ this.placeholder = $(this.options.placeholder)
228
+
229
+ if(!options.isValidTarget)
230
+ this.options.isValidTarget = undefined
231
+ }
232
+ }
233
+
234
+ ContainerGroup.get = function (options) {
235
+ if(!containerGroups[options.group]) {
236
+ if(options.group === undefined)
237
+ options.group = groupCounter ++
238
+
239
+ containerGroups[options.group] = new ContainerGroup(options)
240
+ }
241
+
242
+ return containerGroups[options.group]
243
+ }
244
+
245
+ ContainerGroup.prototype = {
246
+ dragInit: function (e, itemContainer) {
247
+ this.$document = $(itemContainer.el[0].ownerDocument)
248
+
249
+ // get item to drag
250
+ var closestItem = $(e.target).closest(this.options.itemSelector);
251
+ // using the length of this item, prevents the plugin from being started if there is no handle being clicked on.
252
+ // this may also be helpful in instantiating multidrag.
253
+ if (closestItem.length) {
254
+ this.item = closestItem;
255
+ this.itemContainer = itemContainer;
256
+ if (this.item.is(this.options.exclude) || !this.options.onMousedown(this.item, groupDefaults.onMousedown, e)) {
257
+ return;
258
+ }
259
+ this.setPointer(e);
260
+ this.toggleListeners('on');
261
+ this.setupDelayTimer();
262
+ this.dragInitDone = true;
263
+ }
264
+ },
265
+ drag: function (e) {
266
+ if(!this.dragging){
267
+ if(!this.distanceMet(e) || !this.delayMet)
268
+ return
269
+
270
+ this.options.onDragStart(this.item, this.itemContainer, groupDefaults.onDragStart, e)
271
+ this.item.before(this.placeholder)
272
+ this.dragging = true
273
+ }
274
+
275
+ this.setPointer(e)
276
+ // place item under the cursor
277
+ this.options.onDrag(this.item,
278
+ getRelativePosition(this.pointer, this.item.offsetParent()),
279
+ groupDefaults.onDrag,
280
+ e)
281
+
282
+ var p = this.getPointer(e),
283
+ box = this.sameResultBox,
284
+ t = this.options.tolerance
285
+
286
+ if(!box || box.top - t > p.top || box.bottom + t < p.top || box.left - t > p.left || box.right + t < p.left)
287
+ if(!this.searchValidTarget()){
288
+ this.placeholder.detach()
289
+ this.lastAppendedItem = undefined
290
+ }
291
+ },
292
+ drop: function (e) {
293
+ this.toggleListeners('off')
294
+
295
+ this.dragInitDone = false
296
+
297
+ if(this.dragging){
298
+ // processing Drop, check if placeholder is detached
299
+ if(this.placeholder.closest("html")[0]){
300
+ this.placeholder.before(this.item).detach()
301
+ } else {
302
+ this.options.onCancel(this.item, this.itemContainer, groupDefaults.onCancel, e)
303
+ }
304
+ this.options.onDrop(this.item, this.getContainer(this.item), groupDefaults.onDrop, e)
305
+
306
+ // cleanup
307
+ this.clearDimensions()
308
+ this.clearOffsetParent()
309
+ this.lastAppendedItem = this.sameResultBox = undefined
310
+ this.dragging = false
311
+ }
312
+ },
313
+ searchValidTarget: function (pointer, lastPointer) {
314
+ if(!pointer){
315
+ pointer = this.relativePointer || this.pointer
316
+ lastPointer = this.lastRelativePointer || this.lastPointer
317
+ }
318
+
319
+ var distances = sortByDistanceDesc(this.getContainerDimensions(),
320
+ pointer,
321
+ lastPointer),
322
+ i = distances.length
323
+
324
+ while(i--){
325
+ var index = distances[i][0],
326
+ distance = distances[i][1]
327
+
328
+ if(!distance || this.options.pullPlaceholder){
329
+ var container = this.containers[index]
330
+ if(!container.disabled){
331
+ if(!this.$getOffsetParent()){
332
+ var offsetParent = container.getItemOffsetParent()
333
+ pointer = getRelativePosition(pointer, offsetParent)
334
+ lastPointer = getRelativePosition(lastPointer, offsetParent)
335
+ }
336
+ if(container.searchValidTarget(pointer, lastPointer))
337
+ return true
338
+ }
339
+ }
340
+ }
341
+ if(this.sameResultBox)
342
+ this.sameResultBox = undefined
343
+ },
344
+ movePlaceholder: function (container, item, method, sameResultBox) {
345
+ var lastAppendedItem = this.lastAppendedItem
346
+ if(!sameResultBox && lastAppendedItem && lastAppendedItem[0] === item[0])
347
+ return;
348
+
349
+ item[method](this.placeholder)
350
+ this.lastAppendedItem = item
351
+ this.sameResultBox = sameResultBox
352
+ this.options.afterMove(this.placeholder, container, item)
353
+ },
354
+ getContainerDimensions: function () {
355
+ if(!this.containerDimensions)
356
+ setDimensions(this.containers, this.containerDimensions = [], this.options.tolerance, !this.$getOffsetParent())
357
+ return this.containerDimensions
358
+ },
359
+ getContainer: function (element) {
360
+ return element.closest(this.options.containerSelector).data(pluginName)
361
+ },
362
+ $getOffsetParent: function () {
363
+ if(this.offsetParent === undefined){
364
+ var i = this.containers.length - 1,
365
+ offsetParent = this.containers[i].getItemOffsetParent()
366
+
367
+ if(!this.options.rootGroup){
368
+ while(i--){
369
+ if(offsetParent[0] != this.containers[i].getItemOffsetParent()[0]){
370
+ // If every container has the same offset parent,
371
+ // use position() which is relative to this parent,
372
+ // otherwise use offset()
373
+ // compare #setDimensions
374
+ offsetParent = false
375
+ break;
376
+ }
377
+ }
378
+ }
379
+
380
+ this.offsetParent = offsetParent
381
+ }
382
+ return this.offsetParent
383
+ },
384
+ setPointer: function (e) {
385
+ var pointer = this.getPointer(e)
386
+
387
+ if(this.$getOffsetParent()){
388
+ var relativePointer = getRelativePosition(pointer, this.$getOffsetParent())
389
+ this.lastRelativePointer = this.relativePointer
390
+ this.relativePointer = relativePointer
391
+ }
392
+
393
+ this.lastPointer = this.pointer
394
+ this.pointer = pointer
395
+ },
396
+ distanceMet: function (e) {
397
+ var currentPointer = this.getPointer(e)
398
+ return (Math.max(
399
+ Math.abs(this.pointer.left - currentPointer.left),
400
+ Math.abs(this.pointer.top - currentPointer.top)
401
+ ) >= this.options.distance)
402
+ },
403
+ getPointer: function(e) {
404
+ var o = e.originalEvent || e.originalEvent.touches && e.originalEvent.touches[0]
405
+ return {
406
+ left: e.pageX || o.pageX,
407
+ top: e.pageY || o.pageY
408
+ }
409
+ },
410
+ setupDelayTimer: function () {
411
+ var that = this
412
+ this.delayMet = !this.options.delay
413
+
414
+ // init delay timer if needed
415
+ if (!this.delayMet) {
416
+ clearTimeout(this._mouseDelayTimer);
417
+ this._mouseDelayTimer = setTimeout(function() {
418
+ that.delayMet = true
419
+ }, this.options.delay)
420
+ }
421
+ },
422
+ scroll: function (e) {
423
+ this.clearDimensions()
424
+ this.clearOffsetParent() // TODO is this needed?
425
+ },
426
+ toggleListeners: function (method) {
427
+ var that = this,
428
+ events = ['drag','drop','scroll']
429
+
430
+ $.each(events,function (i,event) {
431
+ that.$document[method](eventNames[event], that[event + 'Proxy'])
432
+ })
433
+ },
434
+ clearOffsetParent: function () {
435
+ this.offsetParent = undefined
436
+ },
437
+ // Recursively clear container and item dimensions
438
+ clearDimensions: function () {
439
+ this.traverse(function(object){
440
+ object._clearDimensions()
441
+ })
442
+ },
443
+ traverse: function(callback) {
444
+ callback(this)
445
+ var i = this.containers.length
446
+ while(i--){
447
+ this.containers[i].traverse(callback)
448
+ }
449
+ },
450
+ _clearDimensions: function(){
451
+ this.containerDimensions = undefined
452
+ },
453
+ _destroy: function () {
454
+ containerGroups[this.options.group] = undefined
455
+ }
456
+ }
457
+
458
+ function Container(element, options) {
459
+ this.el = element
460
+ this.options = $.extend( {}, containerDefaults, options)
461
+
462
+ this.group = ContainerGroup.get(this.options)
463
+ this.rootGroup = this.options.rootGroup || this.group
464
+ this.handle = this.rootGroup.options.handle || this.rootGroup.options.itemSelector
465
+
466
+ var itemPath = this.rootGroup.options.itemPath
467
+ this.target = itemPath ? this.el.find(itemPath) : this.el
468
+
469
+ this.target.on(eventNames.start, this.handle, $.proxy(this.dragInit, this))
470
+
471
+ if(this.options.drop)
472
+ this.group.containers.push(this)
473
+ }
474
+
475
+ Container.prototype = {
476
+ dragInit: function (e) {
477
+ var rootGroup = this.rootGroup
478
+
479
+ if( !this.disabled &&
480
+ !rootGroup.dragInitDone &&
481
+ this.options.drag &&
482
+ this.isValidDrag(e)) {
483
+ rootGroup.dragInit(e, this)
484
+ }
485
+ },
486
+ isValidDrag: function(e) {
487
+ return e.which == 1 ||
488
+ e.type == "touchstart" && e.originalEvent.touches.length == 1
489
+ },
490
+ searchValidTarget: function (pointer, lastPointer) {
491
+ var distances = sortByDistanceDesc(this.getItemDimensions(),
492
+ pointer,
493
+ lastPointer),
494
+ i = distances.length,
495
+ rootGroup = this.rootGroup,
496
+ validTarget = !rootGroup.options.isValidTarget ||
497
+ rootGroup.options.isValidTarget(rootGroup.item, this)
498
+
499
+ if(!i && validTarget){
500
+ rootGroup.movePlaceholder(this, this.target, "append")
501
+ return true
502
+ } else
503
+ while(i--){
504
+ var index = distances[i][0],
505
+ distance = distances[i][1]
506
+ if(!distance && this.hasChildGroup(index)){
507
+ var found = this.getContainerGroup(index).searchValidTarget(pointer, lastPointer)
508
+ if(found)
509
+ return true
510
+ }
511
+ else if(validTarget){
512
+ this.movePlaceholder(index, pointer)
513
+ return true
514
+ }
515
+ }
516
+ },
517
+ movePlaceholder: function (index, pointer) {
518
+ var item = $(this.items[index]),
519
+ dim = this.itemDimensions[index],
520
+ method = "after",
521
+ width = item.outerWidth(),
522
+ height = item.outerHeight(),
523
+ offset = item.offset(),
524
+ sameResultBox = {
525
+ left: offset.left,
526
+ right: offset.left + width,
527
+ top: offset.top,
528
+ bottom: offset.top + height
529
+ }
530
+ if(this.options.vertical){
531
+ var yCenter = (dim[2] + dim[3]) / 2,
532
+ inUpperHalf = pointer.top <= yCenter
533
+ if(inUpperHalf){
534
+ method = "before"
535
+ sameResultBox.bottom -= height / 2
536
+ } else
537
+ sameResultBox.top += height / 2
538
+ } else {
539
+ var xCenter = (dim[0] + dim[1]) / 2,
540
+ inLeftHalf = pointer.left <= xCenter
541
+ if(inLeftHalf){
542
+ method = "before"
543
+ sameResultBox.right -= width / 2
544
+ } else
545
+ sameResultBox.left += width / 2
546
+ }
547
+ if(this.hasChildGroup(index))
548
+ sameResultBox = emptyBox
549
+ this.rootGroup.movePlaceholder(this, item, method, sameResultBox)
550
+ },
551
+ getItemDimensions: function () {
552
+ if(!this.itemDimensions){
553
+ this.items = this.$getChildren(this.el, "item").filter(
554
+ ":not(." + this.group.options.placeholderClass + ", ." + this.group.options.draggedClass + ")"
555
+ ).get()
556
+ setDimensions(this.items, this.itemDimensions = [], this.options.tolerance)
557
+ }
558
+ return this.itemDimensions
559
+ },
560
+ getItemOffsetParent: function () {
561
+ var offsetParent,
562
+ el = this.el
563
+ // Since el might be empty we have to check el itself and
564
+ // can not do something like el.children().first().offsetParent()
565
+ if(el.css("position") === "relative" || el.css("position") === "absolute" || el.css("position") === "fixed")
566
+ offsetParent = el
567
+ else
568
+ offsetParent = el.offsetParent()
569
+ return offsetParent
570
+ },
571
+ hasChildGroup: function (index) {
572
+ return this.options.nested && this.getContainerGroup(index)
573
+ },
574
+ getContainerGroup: function (index) {
575
+ var childGroup = $.data(this.items[index], subContainerKey)
576
+ if( childGroup === undefined){
577
+ var childContainers = this.$getChildren(this.items[index], "container")
578
+ childGroup = false
579
+
580
+ if(childContainers[0]){
581
+ var options = $.extend({}, this.options, {
582
+ rootGroup: this.rootGroup,
583
+ group: groupCounter ++
584
+ })
585
+ childGroup = childContainers[pluginName](options).data(pluginName).group
586
+ }
587
+ $.data(this.items[index], subContainerKey, childGroup)
588
+ }
589
+ return childGroup
590
+ },
591
+ $getChildren: function (parent, type) {
592
+ var options = this.rootGroup.options,
593
+ path = options[type + "Path"],
594
+ selector = options[type + "Selector"]
595
+
596
+ parent = $(parent)
597
+ if(path)
598
+ parent = parent.find(path)
599
+
600
+ return parent.children(selector)
601
+ },
602
+ _serialize: function (parent, isContainer) {
603
+ var that = this,
604
+ childType = isContainer ? "item" : "container",
605
+
606
+ children = this.$getChildren(parent, childType).not(this.options.exclude).map(function () {
607
+ return that._serialize($(this), !isContainer)
608
+ }).get()
609
+
610
+ return this.rootGroup.options.serialize(parent, children, isContainer)
611
+ },
612
+ traverse: function(callback) {
613
+ $.each(this.items || [], function(item){
614
+ var group = $.data(this, subContainerKey)
615
+ if(group)
616
+ group.traverse(callback)
617
+ });
618
+
619
+ callback(this)
620
+ },
621
+ _clearDimensions: function () {
622
+ this.itemDimensions = undefined
623
+ },
624
+ _destroy: function() {
625
+ var that = this;
626
+
627
+ this.target.off(eventNames.start, this.handle);
628
+ this.el.removeData(pluginName)
629
+
630
+ if(this.options.drop)
631
+ this.group.containers = $.grep(this.group.containers, function(val){
632
+ return val != that
633
+ })
634
+
635
+ $.each(this.items || [], function(){
636
+ $.removeData(this, subContainerKey)
637
+ })
638
+ }
639
+ }
640
+
641
+ var API = {
642
+ enable: function() {
643
+ this.traverse(function(object){
644
+ object.disabled = false
645
+ })
646
+ },
647
+ disable: function (){
648
+ this.traverse(function(object){
649
+ object.disabled = true
650
+ })
651
+ },
652
+ serialize: function () {
653
+ return this._serialize(this.el, true)
654
+ },
655
+ refresh: function() {
656
+ this.traverse(function(object){
657
+ object._clearDimensions()
658
+ })
659
+ },
660
+ destroy: function () {
661
+ this.traverse(function(object){
662
+ object._destroy();
663
+ })
664
+ }
665
+ }
666
+
667
+ $.extend(Container.prototype, API)
668
+
669
+ /**
670
+ * jQuery API
671
+ *
672
+ * Parameters are
673
+ * either options on init
674
+ * or a method name followed by arguments to pass to the method
675
+ */
676
+ $.fn[pluginName] = function(methodOrOptions) {
677
+ var args = Array.prototype.slice.call(arguments, 1)
678
+
679
+ return this.map(function(){
680
+ var $t = $(this),
681
+ object = $t.data(pluginName)
682
+
683
+ if(object && API[methodOrOptions])
684
+ return API[methodOrOptions].apply(object, args) || this
685
+ else if(!object && (methodOrOptions === undefined ||
686
+ typeof methodOrOptions === "object"))
687
+ $t.data(pluginName, new Container($t, methodOrOptions))
688
+
689
+ return this
690
+ });
691
+ };
692
+
693
+ }(jQuery, window, 'sortable');
skin/adminhtml/default/default/elogic/slider/js/plugins/jquery.form.js ADDED
@@ -0,0 +1,1277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Form Plugin
3
+ * version: 3.51.0-2014.06.20
4
+ * Requires jQuery v1.5 or later
5
+ * Copyright (c) 2014 M. Alsup
6
+ * Examples and documentation at: http://malsup.com/jquery/form/
7
+ * Project repository: https://github.com/malsup/form
8
+ * Dual licensed under the MIT and GPL licenses.
9
+ * https://github.com/malsup/form#copyright-and-license
10
+ */
11
+ /*global ActiveXObject */
12
+
13
+ // AMD support
14
+ (function (factory) {
15
+ "use strict";
16
+ if (typeof define === 'function' && define.amd) {
17
+ // using AMD; register as anon module
18
+ define(['jquery'], factory);
19
+ } else {
20
+ // no AMD; invoke directly
21
+ factory( (typeof(jQuery) != 'undefined') ? jQuery : window.Zepto );
22
+ }
23
+ }
24
+
25
+ (function($) {
26
+ "use strict";
27
+
28
+ /*
29
+ Usage Note:
30
+ -----------
31
+ Do not use both ajaxSubmit and ajaxForm on the same form. These
32
+ functions are mutually exclusive. Use ajaxSubmit if you want
33
+ to bind your own submit handler to the form. For example,
34
+
35
+ $(document).ready(function() {
36
+ $('#myForm').on('submit', function(e) {
37
+ e.preventDefault(); // <-- important
38
+ $(this).ajaxSubmit({
39
+ target: '#output'
40
+ });
41
+ });
42
+ });
43
+
44
+ Use ajaxForm when you want the plugin to manage all the event binding
45
+ for you. For example,
46
+
47
+ $(document).ready(function() {
48
+ $('#myForm').ajaxForm({
49
+ target: '#output'
50
+ });
51
+ });
52
+
53
+ You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
54
+ form does not have to exist when you invoke ajaxForm:
55
+
56
+ $('#myForm').ajaxForm({
57
+ delegation: true,
58
+ target: '#output'
59
+ });
60
+
61
+ When using ajaxForm, the ajaxSubmit function will be invoked for you
62
+ at the appropriate time.
63
+ */
64
+
65
+ /**
66
+ * Feature detection
67
+ */
68
+ var feature = {};
69
+ feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
70
+ feature.formdata = window.FormData !== undefined;
71
+
72
+ var hasProp = !!$.fn.prop;
73
+
74
+ // attr2 uses prop when it can but checks the return type for
75
+ // an expected string. this accounts for the case where a form
76
+ // contains inputs with names like "action" or "method"; in those
77
+ // cases "prop" returns the element
78
+ $.fn.attr2 = function() {
79
+ if ( ! hasProp ) {
80
+ return this.attr.apply(this, arguments);
81
+ }
82
+ var val = this.prop.apply(this, arguments);
83
+ if ( ( val && val.jquery ) || typeof val === 'string' ) {
84
+ return val;
85
+ }
86
+ return this.attr.apply(this, arguments);
87
+ };
88
+
89
+ /**
90
+ * ajaxSubmit() provides a mechanism for immediately submitting
91
+ * an HTML form using AJAX.
92
+ */
93
+ $.fn.ajaxSubmit = function(options) {
94
+ /*jshint scripturl:true */
95
+
96
+ // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
97
+ if (!this.length) {
98
+ log('ajaxSubmit: skipping submit process - no element selected');
99
+ return this;
100
+ }
101
+
102
+ var method, action, url, $form = this;
103
+
104
+ if (typeof options == 'function') {
105
+ options = { success: options };
106
+ }
107
+ else if ( options === undefined ) {
108
+ options = {};
109
+ }
110
+
111
+ method = options.type || this.attr2('method');
112
+ action = options.url || this.attr2('action');
113
+
114
+ url = (typeof action === 'string') ? $.trim(action) : '';
115
+ url = url || window.location.href || '';
116
+ if (url) {
117
+ // clean url (don't include hash vaue)
118
+ url = (url.match(/^([^#]+)/)||[])[1];
119
+ }
120
+
121
+ options = $.extend(true, {
122
+ url: url,
123
+ success: $.ajaxSettings.success,
124
+ type: method || $.ajaxSettings.type,
125
+ iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
126
+ }, options);
127
+
128
+ // hook for manipulating the form data before it is extracted;
129
+ // convenient for use with rich editors like tinyMCE or FCKEditor
130
+ var veto = {};
131
+ this.trigger('form-pre-serialize', [this, options, veto]);
132
+ if (veto.veto) {
133
+ log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
134
+ return this;
135
+ }
136
+
137
+ // provide opportunity to alter form data before it is serialized
138
+ if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
139
+ log('ajaxSubmit: submit aborted via beforeSerialize callback');
140
+ return this;
141
+ }
142
+
143
+ var traditional = options.traditional;
144
+ if ( traditional === undefined ) {
145
+ traditional = $.ajaxSettings.traditional;
146
+ }
147
+
148
+ var elements = [];
149
+ var qx, a = this.formToArray(options.semantic, elements);
150
+ if (options.data) {
151
+ options.extraData = options.data;
152
+ qx = $.param(options.data, traditional);
153
+ }
154
+
155
+ // give pre-submit callback an opportunity to abort the submit
156
+ if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
157
+ log('ajaxSubmit: submit aborted via beforeSubmit callback');
158
+ return this;
159
+ }
160
+
161
+ // fire vetoable 'validate' event
162
+ this.trigger('form-submit-validate', [a, this, options, veto]);
163
+ if (veto.veto) {
164
+ log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
165
+ return this;
166
+ }
167
+
168
+ var q = $.param(a, traditional);
169
+ if (qx) {
170
+ q = ( q ? (q + '&' + qx) : qx );
171
+ }
172
+ if (options.type.toUpperCase() == 'GET') {
173
+ options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
174
+ options.data = null; // data is null for 'get'
175
+ }
176
+ else {
177
+ options.data = q; // data is the query string for 'post'
178
+ }
179
+
180
+ var callbacks = [];
181
+ if (options.resetForm) {
182
+ callbacks.push(function() { $form.resetForm(); });
183
+ }
184
+ if (options.clearForm) {
185
+ callbacks.push(function() { $form.clearForm(options.includeHidden); });
186
+ }
187
+
188
+ // perform a load on the target only if dataType is not provided
189
+ if (!options.dataType && options.target) {
190
+ var oldSuccess = options.success || function(){};
191
+ callbacks.push(function(data) {
192
+ var fn = options.replaceTarget ? 'replaceWith' : 'html';
193
+ $(options.target)[fn](data).each(oldSuccess, arguments);
194
+ });
195
+ }
196
+ else if (options.success) {
197
+ callbacks.push(options.success);
198
+ }
199
+
200
+ options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
201
+ var context = options.context || this ; // jQuery 1.4+ supports scope context
202
+ for (var i=0, max=callbacks.length; i < max; i++) {
203
+ callbacks[i].apply(context, [data, status, xhr || $form, $form]);
204
+ }
205
+ };
206
+
207
+ if (options.error) {
208
+ var oldError = options.error;
209
+ options.error = function(xhr, status, error) {
210
+ var context = options.context || this;
211
+ oldError.apply(context, [xhr, status, error, $form]);
212
+ };
213
+ }
214
+
215
+ if (options.complete) {
216
+ var oldComplete = options.complete;
217
+ options.complete = function(xhr, status) {
218
+ var context = options.context || this;
219
+ oldComplete.apply(context, [xhr, status, $form]);
220
+ };
221
+ }
222
+
223
+ // are there files to upload?
224
+
225
+ // [value] (issue #113), also see comment:
226
+ // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219
227
+ var fileInputs = $('input[type=file]:enabled', this).filter(function() { return $(this).val() !== ''; });
228
+
229
+ var hasFileInputs = fileInputs.length > 0;
230
+ var mp = 'multipart/form-data';
231
+ var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
232
+
233
+ var fileAPI = feature.fileapi && feature.formdata;
234
+ log("fileAPI :" + fileAPI);
235
+ var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
236
+
237
+ var jqxhr;
238
+
239
+ // options.iframe allows user to force iframe mode
240
+ // 06-NOV-09: now defaulting to iframe mode if file input is detected
241
+ if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
242
+ // hack to fix Safari hang (thanks to Tim Molendijk for this)
243
+ // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
244
+ if (options.closeKeepAlive) {
245
+ $.get(options.closeKeepAlive, function() {
246
+ jqxhr = fileUploadIframe(a);
247
+ });
248
+ }
249
+ else {
250
+ jqxhr = fileUploadIframe(a);
251
+ }
252
+ }
253
+ else if ((hasFileInputs || multipart) && fileAPI) {
254
+ jqxhr = fileUploadXhr(a);
255
+ }
256
+ else {
257
+ jqxhr = $.ajax(options);
258
+ }
259
+
260
+ $form.removeData('jqxhr').data('jqxhr', jqxhr);
261
+
262
+ // clear element array
263
+ for (var k=0; k < elements.length; k++) {
264
+ elements[k] = null;
265
+ }
266
+
267
+ // fire 'notify' event
268
+ this.trigger('form-submit-notify', [this, options]);
269
+ return this;
270
+
271
+ // utility fn for deep serialization
272
+ function deepSerialize(extraData){
273
+ var serialized = $.param(extraData, options.traditional).split('&');
274
+ var len = serialized.length;
275
+ var result = [];
276
+ var i, part;
277
+ for (i=0; i < len; i++) {
278
+ // #252; undo param space replacement
279
+ serialized[i] = serialized[i].replace(/\+/g,' ');
280
+ part = serialized[i].split('=');
281
+ // #278; use array instead of object storage, favoring array serializations
282
+ result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);
283
+ }
284
+ return result;
285
+ }
286
+
287
+ // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
288
+ function fileUploadXhr(a) {
289
+ var formdata = new FormData();
290
+
291
+ for (var i=0; i < a.length; i++) {
292
+ formdata.append(a[i].name, a[i].value);
293
+ }
294
+
295
+ if (options.extraData) {
296
+ var serializedData = deepSerialize(options.extraData);
297
+ for (i=0; i < serializedData.length; i++) {
298
+ if (serializedData[i]) {
299
+ formdata.append(serializedData[i][0], serializedData[i][1]);
300
+ }
301
+ }
302
+ }
303
+
304
+ options.data = null;
305
+
306
+ var s = $.extend(true, {}, $.ajaxSettings, options, {
307
+ contentType: false,
308
+ processData: false,
309
+ cache: false,
310
+ type: method || 'POST'
311
+ });
312
+
313
+ if (options.uploadProgress) {
314
+ // workaround because jqXHR does not expose upload property
315
+ s.xhr = function() {
316
+ var xhr = $.ajaxSettings.xhr();
317
+ if (xhr.upload) {
318
+ xhr.upload.addEventListener('progress', function(event) {
319
+ var percent = 0;
320
+ var position = event.loaded || event.position; /*event.position is deprecated*/
321
+ var total = event.total;
322
+ if (event.lengthComputable) {
323
+ percent = Math.ceil(position / total * 100);
324
+ }
325
+ options.uploadProgress(event, position, total, percent);
326
+ }, false);
327
+ }
328
+ return xhr;
329
+ };
330
+ }
331
+
332
+ s.data = null;
333
+ var beforeSend = s.beforeSend;
334
+ s.beforeSend = function(xhr, o) {
335
+ //Send FormData() provided by user
336
+ if (options.formData) {
337
+ o.data = options.formData;
338
+ }
339
+ else {
340
+ o.data = formdata;
341
+ }
342
+ if(beforeSend) {
343
+ beforeSend.call(this, xhr, o);
344
+ }
345
+ };
346
+ return $.ajax(s);
347
+ }
348
+
349
+ // private function for handling file uploads (hat tip to YAHOO!)
350
+ function fileUploadIframe(a) {
351
+ var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
352
+ var deferred = $.Deferred();
353
+
354
+ // #341
355
+ deferred.abort = function(status) {
356
+ xhr.abort(status);
357
+ };
358
+
359
+ if (a) {
360
+ // ensure that every serialized input is still enabled
361
+ for (i=0; i < elements.length; i++) {
362
+ el = $(elements[i]);
363
+ if ( hasProp ) {
364
+ el.prop('disabled', false);
365
+ }
366
+ else {
367
+ el.removeAttr('disabled');
368
+ }
369
+ }
370
+ }
371
+
372
+ s = $.extend(true, {}, $.ajaxSettings, options);
373
+ s.context = s.context || s;
374
+ id = 'jqFormIO' + (new Date().getTime());
375
+ if (s.iframeTarget) {
376
+ $io = $(s.iframeTarget);
377
+ n = $io.attr2('name');
378
+ if (!n) {
379
+ $io.attr2('name', id);
380
+ }
381
+ else {
382
+ id = n;
383
+ }
384
+ }
385
+ else {
386
+ $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
387
+ $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
388
+ }
389
+ io = $io[0];
390
+
391
+
392
+ xhr = { // mock object
393
+ aborted: 0,
394
+ responseText: null,
395
+ responseXML: null,
396
+ status: 0,
397
+ statusText: 'n/a',
398
+ getAllResponseHeaders: function() {},
399
+ getResponseHeader: function() {},
400
+ setRequestHeader: function() {},
401
+ abort: function(status) {
402
+ var e = (status === 'timeout' ? 'timeout' : 'aborted');
403
+ log('aborting upload... ' + e);
404
+ this.aborted = 1;
405
+
406
+ try { // #214, #257
407
+ if (io.contentWindow.document.execCommand) {
408
+ io.contentWindow.document.execCommand('Stop');
409
+ }
410
+ }
411
+ catch(ignore) {}
412
+
413
+ $io.attr('src', s.iframeSrc); // abort op in progress
414
+ xhr.error = e;
415
+ if (s.error) {
416
+ s.error.call(s.context, xhr, e, status);
417
+ }
418
+ if (g) {
419
+ $.event.trigger("ajaxError", [xhr, s, e]);
420
+ }
421
+ if (s.complete) {
422
+ s.complete.call(s.context, xhr, e);
423
+ }
424
+ }
425
+ };
426
+
427
+ g = s.global;
428
+ // trigger ajax global events so that activity/block indicators work like normal
429
+ if (g && 0 === $.active++) {
430
+ $.event.trigger("ajaxStart");
431
+ }
432
+ if (g) {
433
+ $.event.trigger("ajaxSend", [xhr, s]);
434
+ }
435
+
436
+ if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
437
+ if (s.global) {
438
+ $.active--;
439
+ }
440
+ deferred.reject();
441
+ return deferred;
442
+ }
443
+ if (xhr.aborted) {
444
+ deferred.reject();
445
+ return deferred;
446
+ }
447
+
448
+ // add submitting element to data if we know it
449
+ sub = form.clk;
450
+ if (sub) {
451
+ n = sub.name;
452
+ if (n && !sub.disabled) {
453
+ s.extraData = s.extraData || {};
454
+ s.extraData[n] = sub.value;
455
+ if (sub.type == "image") {
456
+ s.extraData[n+'.x'] = form.clk_x;
457
+ s.extraData[n+'.y'] = form.clk_y;
458
+ }
459
+ }
460
+ }
461
+
462
+ var CLIENT_TIMEOUT_ABORT = 1;
463
+ var SERVER_ABORT = 2;
464
+
465
+ function getDoc(frame) {
466
+ /* it looks like contentWindow or contentDocument do not
467
+ * carry the protocol property in ie8, when running under ssl
468
+ * frame.document is the only valid response document, since
469
+ * the protocol is know but not on the other two objects. strange?
470
+ * "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy
471
+ */
472
+
473
+ var doc = null;
474
+
475
+ // IE8 cascading access check
476
+ try {
477
+ if (frame.contentWindow) {
478
+ doc = frame.contentWindow.document;
479
+ }
480
+ } catch(err) {
481
+ // IE8 access denied under ssl & missing protocol
482
+ log('cannot get iframe.contentWindow document: ' + err);
483
+ }
484
+
485
+ if (doc) { // successful getting content
486
+ return doc;
487
+ }
488
+
489
+ try { // simply checking may throw in ie8 under ssl or mismatched protocol
490
+ doc = frame.contentDocument ? frame.contentDocument : frame.document;
491
+ } catch(err) {
492
+ // last attempt
493
+ log('cannot get iframe.contentDocument: ' + err);
494
+ doc = frame.document;
495
+ }
496
+ return doc;
497
+ }
498
+
499
+ // Rails CSRF hack (thanks to Yvan Barthelemy)
500
+ var csrf_token = $('meta[name=csrf-token]').attr('content');
501
+ var csrf_param = $('meta[name=csrf-param]').attr('content');
502
+ if (csrf_param && csrf_token) {
503
+ s.extraData = s.extraData || {};
504
+ s.extraData[csrf_param] = csrf_token;
505
+ }
506
+
507
+ // take a breath so that pending repaints get some cpu time before the upload starts
508
+ function doSubmit() {
509
+ // make sure form attrs are set
510
+ var t = $form.attr2('target'),
511
+ a = $form.attr2('action'),
512
+ mp = 'multipart/form-data',
513
+ et = $form.attr('enctype') || $form.attr('encoding') || mp;
514
+
515
+ // update form attrs in IE friendly way
516
+ form.setAttribute('target',id);
517
+ if (!method || /post/i.test(method) ) {
518
+ form.setAttribute('method', 'POST');
519
+ }
520
+ if (a != s.url) {
521
+ form.setAttribute('action', s.url);
522
+ }
523
+
524
+ // ie borks in some cases when setting encoding
525
+ if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
526
+ $form.attr({
527
+ encoding: 'multipart/form-data',
528
+ enctype: 'multipart/form-data'
529
+ });
530
+ }
531
+
532
+ // support timout
533
+ if (s.timeout) {
534
+ timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
535
+ }
536
+
537
+ // look for server aborts
538
+ function checkState() {
539
+ try {
540
+ var state = getDoc(io).readyState;
541
+ log('state = ' + state);
542
+ if (state && state.toLowerCase() == 'uninitialized') {
543
+ setTimeout(checkState,50);
544
+ }
545
+ }
546
+ catch(e) {
547
+ log('Server abort: ' , e, ' (', e.name, ')');
548
+ cb(SERVER_ABORT);
549
+ if (timeoutHandle) {
550
+ clearTimeout(timeoutHandle);
551
+ }
552
+ timeoutHandle = undefined;
553
+ }
554
+ }
555
+
556
+ // add "extra" data to form if provided in options
557
+ var extraInputs = [];
558
+ try {
559
+ if (s.extraData) {
560
+ for (var n in s.extraData) {
561
+ if (s.extraData.hasOwnProperty(n)) {
562
+ // if using the $.param format that allows for multiple values with the same name
563
+ if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
564
+ extraInputs.push(
565
+ $('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value)
566
+ .appendTo(form)[0]);
567
+ } else {
568
+ extraInputs.push(
569
+ $('<input type="hidden" name="'+n+'">').val(s.extraData[n])
570
+ .appendTo(form)[0]);
571
+ }
572
+ }
573
+ }
574
+ }
575
+
576
+ if (!s.iframeTarget) {
577
+ // add iframe to doc and submit the form
578
+ $io.appendTo('body');
579
+ }
580
+ if (io.attachEvent) {
581
+ io.attachEvent('onload', cb);
582
+ }
583
+ else {
584
+ io.addEventListener('load', cb, false);
585
+ }
586
+ setTimeout(checkState,15);
587
+
588
+ try {
589
+ form.submit();
590
+ } catch(err) {
591
+ // just in case form has element with name/id of 'submit'
592
+ var submitFn = document.createElement('form').submit;
593
+ submitFn.apply(form);
594
+ }
595
+ }
596
+ finally {
597
+ // reset attrs and remove "extra" input elements
598
+ form.setAttribute('action',a);
599
+ form.setAttribute('enctype', et); // #380
600
+ if(t) {
601
+ form.setAttribute('target', t);
602
+ } else {
603
+ $form.removeAttr('target');
604
+ }
605
+ $(extraInputs).remove();
606
+ }
607
+ }
608
+
609
+ if (s.forceSync) {
610
+ doSubmit();
611
+ }
612
+ else {
613
+ setTimeout(doSubmit, 10); // this lets dom updates render
614
+ }
615
+
616
+ var data, doc, domCheckCount = 50, callbackProcessed;
617
+
618
+ function cb(e) {
619
+ if (xhr.aborted || callbackProcessed) {
620
+ return;
621
+ }
622
+
623
+ doc = getDoc(io);
624
+ if(!doc) {
625
+ log('cannot access response document');
626
+ e = SERVER_ABORT;
627
+ }
628
+ if (e === CLIENT_TIMEOUT_ABORT && xhr) {
629
+ xhr.abort('timeout');
630
+ deferred.reject(xhr, 'timeout');
631
+ return;
632
+ }
633
+ else if (e == SERVER_ABORT && xhr) {
634
+ xhr.abort('server abort');
635
+ deferred.reject(xhr, 'error', 'server abort');
636
+ return;
637
+ }
638
+
639
+ if (!doc || doc.location.href == s.iframeSrc) {
640
+ // response not received yet
641
+ if (!timedOut) {
642
+ return;
643
+ }
644
+ }
645
+ if (io.detachEvent) {
646
+ io.detachEvent('onload', cb);
647
+ }
648
+ else {
649
+ io.removeEventListener('load', cb, false);
650
+ }
651
+
652
+ var status = 'success', errMsg;
653
+ try {
654
+ if (timedOut) {
655
+ throw 'timeout';
656
+ }
657
+
658
+ var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
659
+ log('isXml='+isXml);
660
+ if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
661
+ if (--domCheckCount) {
662
+ // in some browsers (Opera) the iframe DOM is not always traversable when
663
+ // the onload callback fires, so we loop a bit to accommodate
664
+ log('requeing onLoad callback, DOM not available');
665
+ setTimeout(cb, 250);
666
+ return;
667
+ }
668
+ // let this fall through because server response could be an empty document
669
+ //log('Could not access iframe DOM after mutiple tries.');
670
+ //throw 'DOMException: not available';
671
+ }
672
+
673
+ //log('response detected');
674
+ var docRoot = doc.body ? doc.body : doc.documentElement;
675
+ xhr.responseText = docRoot ? docRoot.innerHTML : null;
676
+ xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
677
+ if (isXml) {
678
+ s.dataType = 'xml';
679
+ }
680
+ xhr.getResponseHeader = function(header){
681
+ var headers = {'content-type': s.dataType};
682
+ return headers[header.toLowerCase()];
683
+ };
684
+ // support for XHR 'status' & 'statusText' emulation :
685
+ if (docRoot) {
686
+ xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
687
+ xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
688
+ }
689
+
690
+ var dt = (s.dataType || '').toLowerCase();
691
+ var scr = /(json|script|text)/.test(dt);
692
+ if (scr || s.textarea) {
693
+ // see if user embedded response in textarea
694
+ var ta = doc.getElementsByTagName('textarea')[0];
695
+ if (ta) {
696
+ xhr.responseText = ta.value;
697
+ // support for XHR 'status' & 'statusText' emulation :
698
+ xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
699
+ xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
700
+ }
701
+ else if (scr) {
702
+ // account for browsers injecting pre around json response
703
+ var pre = doc.getElementsByTagName('pre')[0];
704
+ var b = doc.getElementsByTagName('body')[0];
705
+ if (pre) {
706
+ xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
707
+ }
708
+ else if (b) {
709
+ xhr.responseText = b.textContent ? b.textContent : b.innerText;
710
+ }
711
+ }
712
+ }
713
+ else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
714
+ xhr.responseXML = toXml(xhr.responseText);
715
+ }
716
+
717
+ try {
718
+ data = httpData(xhr, dt, s);
719
+ }
720
+ catch (err) {
721
+ status = 'parsererror';
722
+ xhr.error = errMsg = (err || status);
723
+ }
724
+ }
725
+ catch (err) {
726
+ log('error caught: ',err);
727
+ status = 'error';
728
+ xhr.error = errMsg = (err || status);
729
+ }
730
+
731
+ if (xhr.aborted) {
732
+ log('upload aborted');
733
+ status = null;
734
+ }
735
+
736
+ if (xhr.status) { // we've set xhr.status
737
+ status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
738
+ }
739
+
740
+ // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
741
+ if (status === 'success') {
742
+ if (s.success) {
743
+ s.success.call(s.context, data, 'success', xhr);
744
+ }
745
+ deferred.resolve(xhr.responseText, 'success', xhr);
746
+ if (g) {
747
+ $.event.trigger("ajaxSuccess", [xhr, s]);
748
+ }
749
+ }
750
+ else if (status) {
751
+ if (errMsg === undefined) {
752
+ errMsg = xhr.statusText;
753
+ }
754
+ if (s.error) {
755
+ s.error.call(s.context, xhr, status, errMsg);
756
+ }
757
+ deferred.reject(xhr, 'error', errMsg);
758
+ if (g) {
759
+ $.event.trigger("ajaxError", [xhr, s, errMsg]);
760
+ }
761
+ }
762
+
763
+ if (g) {
764
+ $.event.trigger("ajaxComplete", [xhr, s]);
765
+ }
766
+
767
+ if (g && ! --$.active) {
768
+ $.event.trigger("ajaxStop");
769
+ }
770
+
771
+ if (s.complete) {
772
+ s.complete.call(s.context, xhr, status);
773
+ }
774
+
775
+ callbackProcessed = true;
776
+ if (s.timeout) {
777
+ clearTimeout(timeoutHandle);
778
+ }
779
+
780
+ // clean up
781
+ setTimeout(function() {
782
+ if (!s.iframeTarget) {
783
+ $io.remove();
784
+ }
785
+ else { //adding else to clean up existing iframe response.
786
+ $io.attr('src', s.iframeSrc);
787
+ }
788
+ xhr.responseXML = null;
789
+ }, 100);
790
+ }
791
+
792
+ var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
793
+ if (window.ActiveXObject) {
794
+ doc = new ActiveXObject('Microsoft.XMLDOM');
795
+ doc.async = 'false';
796
+ doc.loadXML(s);
797
+ }
798
+ else {
799
+ doc = (new DOMParser()).parseFromString(s, 'text/xml');
800
+ }
801
+ return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
802
+ };
803
+ var parseJSON = $.parseJSON || function(s) {
804
+ /*jslint evil:true */
805
+ return window['eval']('(' + s + ')');
806
+ };
807
+
808
+ var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
809
+
810
+ var ct = xhr.getResponseHeader('content-type') || '',
811
+ xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
812
+ data = xml ? xhr.responseXML : xhr.responseText;
813
+
814
+ if (xml && data.documentElement.nodeName === 'parsererror') {
815
+ if ($.error) {
816
+ $.error('parsererror');
817
+ }
818
+ }
819
+ if (s && s.dataFilter) {
820
+ data = s.dataFilter(data, type);
821
+ }
822
+ if (typeof data === 'string') {
823
+ if (type === 'json' || !type && ct.indexOf('json') >= 0) {
824
+ data = parseJSON(data);
825
+ } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
826
+ $.globalEval(data);
827
+ }
828
+ }
829
+ return data;
830
+ };
831
+
832
+ return deferred;
833
+ }
834
+ };
835
+
836
+ /**
837
+ * ajaxForm() provides a mechanism for fully automating form submission.
838
+ *
839
+ * The advantages of using this method instead of ajaxSubmit() are:
840
+ *
841
+ * 1: This method will include coordinates for <input type="image" /> elements (if the element
842
+ * is used to submit the form).
843
+ * 2. This method will include the submit element's name/value data (for the element that was
844
+ * used to submit the form).
845
+ * 3. This method binds the submit() method to the form for you.
846
+ *
847
+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
848
+ * passes the options argument along after properly binding events for submit elements and
849
+ * the form itself.
850
+ */
851
+ $.fn.ajaxForm = function(options) {
852
+ options = options || {};
853
+ options.delegation = options.delegation && $.isFunction($.fn.on);
854
+
855
+ // in jQuery 1.3+ we can fix mistakes with the ready state
856
+ if (!options.delegation && this.length === 0) {
857
+ var o = { s: this.selector, c: this.context };
858
+ if (!$.isReady && o.s) {
859
+ log('DOM not ready, queuing ajaxForm');
860
+ $(function() {
861
+ $(o.s,o.c).ajaxForm(options);
862
+ });
863
+ return this;
864
+ }
865
+ // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
866
+ log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
867
+ return this;
868
+ }
869
+
870
+ if ( options.delegation ) {
871
+ $(document)
872
+ .off('submit.form-plugin', this.selector, doAjaxSubmit)
873
+ .off('click.form-plugin', this.selector, captureSubmittingElement)
874
+ .on('submit.form-plugin', this.selector, options, doAjaxSubmit)
875
+ .on('click.form-plugin', this.selector, options, captureSubmittingElement);
876
+ return this;
877
+ }
878
+
879
+ return this.ajaxFormUnbind()
880
+ .bind('submit.form-plugin', options, doAjaxSubmit)
881
+ .bind('click.form-plugin', options, captureSubmittingElement);
882
+ };
883
+
884
+ // private event handlers
885
+ function doAjaxSubmit(e) {
886
+ /*jshint validthis:true */
887
+ var options = e.data;
888
+ if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
889
+ e.preventDefault();
890
+ $(e.target).ajaxSubmit(options); // #365
891
+ }
892
+ }
893
+
894
+ function captureSubmittingElement(e) {
895
+ /*jshint validthis:true */
896
+ var target = e.target;
897
+ var $el = $(target);
898
+ if (!($el.is("[type=submit],[type=image]"))) {
899
+ // is this a child element of the submit el? (ex: a span within a button)
900
+ var t = $el.closest('[type=submit]');
901
+ if (t.length === 0) {
902
+ return;
903
+ }
904
+ target = t[0];
905
+ }
906
+ var form = this;
907
+ form.clk = target;
908
+ if (target.type == 'image') {
909
+ if (e.offsetX !== undefined) {
910
+ form.clk_x = e.offsetX;
911
+ form.clk_y = e.offsetY;
912
+ } else if (typeof $.fn.offset == 'function') {
913
+ var offset = $el.offset();
914
+ form.clk_x = e.pageX - offset.left;
915
+ form.clk_y = e.pageY - offset.top;
916
+ } else {
917
+ form.clk_x = e.pageX - target.offsetLeft;
918
+ form.clk_y = e.pageY - target.offsetTop;
919
+ }
920
+ }
921
+ // clear form vars
922
+ setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
923
+ }
924
+
925
+
926
+ // ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
927
+ $.fn.ajaxFormUnbind = function() {
928
+ return this.unbind('submit.form-plugin click.form-plugin');
929
+ };
930
+
931
+ /**
932
+ * formToArray() gathers form element data into an array of objects that can
933
+ * be passed to any of the following ajax functions: $.get, $.post, or load.
934
+ * Each object in the array has both a 'name' and 'value' property. An example of
935
+ * an array for a simple login form might be:
936
+ *
937
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
938
+ *
939
+ * It is this array that is passed to pre-submit callback functions provided to the
940
+ * ajaxSubmit() and ajaxForm() methods.
941
+ */
942
+ $.fn.formToArray = function(semantic, elements) {
943
+ var a = [];
944
+ if (this.length === 0) {
945
+ return a;
946
+ }
947
+
948
+ var form = this[0];
949
+ var formId = this.attr('id');
950
+ var els = semantic ? form.getElementsByTagName('*') : form.elements;
951
+ var els2;
952
+
953
+ if (els && !/MSIE [678]/.test(navigator.userAgent)) { // #390
954
+ els = $(els).get(); // convert to standard array
955
+ }
956
+
957
+ // #386; account for inputs outside the form which use the 'form' attribute
958
+ if ( formId ) {
959
+ els2 = $(':input[form="' + formId + '"]').get(); // hat tip @thet
960
+ if ( els2.length ) {
961
+ els = (els || []).concat(els2);
962
+ }
963
+ }
964
+
965
+ if (!els || !els.length) {
966
+ return a;
967
+ }
968
+
969
+ var i,j,n,v,el,max,jmax;
970
+ for(i=0, max=els.length; i < max; i++) {
971
+ el = els[i];
972
+ n = el.name;
973
+ if (!n || el.disabled) {
974
+ continue;
975
+ }
976
+
977
+ if (semantic && form.clk && el.type == "image") {
978
+ // handle image inputs on the fly when semantic == true
979
+ if(form.clk == el) {
980
+ a.push({name: n, value: $(el).val(), type: el.type });
981
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
982
+ }
983
+ continue;
984
+ }
985
+
986
+ v = $.fieldValue(el, true);
987
+ if (v && v.constructor == Array) {
988
+ if (elements) {
989
+ elements.push(el);
990
+ }
991
+ for(j=0, jmax=v.length; j < jmax; j++) {
992
+ a.push({name: n, value: v[j]});
993
+ }
994
+ }
995
+ else if (feature.fileapi && el.type == 'file') {
996
+ if (elements) {
997
+ elements.push(el);
998
+ }
999
+ var files = el.files;
1000
+ if (files.length) {
1001
+ for (j=0; j < files.length; j++) {
1002
+ a.push({name: n, value: files[j], type: el.type});
1003
+ }
1004
+ }
1005
+ else {
1006
+ // #180
1007
+ a.push({ name: n, value: '', type: el.type });
1008
+ }
1009
+ }
1010
+ else if (v !== null && typeof v != 'undefined') {
1011
+ if (elements) {
1012
+ elements.push(el);
1013
+ }
1014
+ a.push({name: n, value: v, type: el.type, required: el.required});
1015
+ }
1016
+ }
1017
+
1018
+ if (!semantic && form.clk) {
1019
+ // input type=='image' are not found in elements array! handle it here
1020
+ var $input = $(form.clk), input = $input[0];
1021
+ n = input.name;
1022
+ if (n && !input.disabled && input.type == 'image') {
1023
+ a.push({name: n, value: $input.val()});
1024
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
1025
+ }
1026
+ }
1027
+ return a;
1028
+ };
1029
+
1030
+ /**
1031
+ * Serializes form data into a 'submittable' string. This method will return a string
1032
+ * in the format: name1=value1&amp;name2=value2
1033
+ */
1034
+ $.fn.formSerialize = function(semantic) {
1035
+ //hand off to jQuery.param for proper encoding
1036
+ return $.param(this.formToArray(semantic));
1037
+ };
1038
+
1039
+ /**
1040
+ * Serializes all field elements in the jQuery object into a query string.
1041
+ * This method will return a string in the format: name1=value1&amp;name2=value2
1042
+ */
1043
+ $.fn.fieldSerialize = function(successful) {
1044
+ var a = [];
1045
+ this.each(function() {
1046
+ var n = this.name;
1047
+ if (!n) {
1048
+ return;
1049
+ }
1050
+ var v = $.fieldValue(this, successful);
1051
+ if (v && v.constructor == Array) {
1052
+ for (var i=0,max=v.length; i < max; i++) {
1053
+ a.push({name: n, value: v[i]});
1054
+ }
1055
+ }
1056
+ else if (v !== null && typeof v != 'undefined') {
1057
+ a.push({name: this.name, value: v});
1058
+ }
1059
+ });
1060
+ //hand off to jQuery.param for proper encoding
1061
+ return $.param(a);
1062
+ };
1063
+
1064
+ /**
1065
+ * Returns the value(s) of the element in the matched set. For example, consider the following form:
1066
+ *
1067
+ * <form><fieldset>
1068
+ * <input name="A" type="text" />
1069
+ * <input name="A" type="text" />
1070
+ * <input name="B" type="checkbox" value="B1" />
1071
+ * <input name="B" type="checkbox" value="B2"/>
1072
+ * <input name="C" type="radio" value="C1" />
1073
+ * <input name="C" type="radio" value="C2" />
1074
+ * </fieldset></form>
1075
+ *
1076
+ * var v = $('input[type=text]').fieldValue();
1077
+ * // if no values are entered into the text inputs
1078
+ * v == ['','']
1079
+ * // if values entered into the text inputs are 'foo' and 'bar'
1080
+ * v == ['foo','bar']
1081
+ *
1082
+ * var v = $('input[type=checkbox]').fieldValue();
1083
+ * // if neither checkbox is checked
1084
+ * v === undefined
1085
+ * // if both checkboxes are checked
1086
+ * v == ['B1', 'B2']
1087
+ *
1088
+ * var v = $('input[type=radio]').fieldValue();
1089
+ * // if neither radio is checked
1090
+ * v === undefined
1091
+ * // if first radio is checked
1092
+ * v == ['C1']
1093
+ *
1094
+ * The successful argument controls whether or not the field element must be 'successful'
1095
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
1096
+ * The default value of the successful argument is true. If this value is false the value(s)
1097
+ * for each element is returned.
1098
+ *
1099
+ * Note: This method *always* returns an array. If no valid value can be determined the
1100
+ * array will be empty, otherwise it will contain one or more values.
1101
+ */
1102
+ $.fn.fieldValue = function(successful) {
1103
+ for (var val=[], i=0, max=this.length; i < max; i++) {
1104
+ var el = this[i];
1105
+ var v = $.fieldValue(el, successful);
1106
+ if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
1107
+ continue;
1108
+ }
1109
+ if (v.constructor == Array) {
1110
+ $.merge(val, v);
1111
+ }
1112
+ else {
1113
+ val.push(v);
1114
+ }
1115
+ }
1116
+ return val;
1117
+ };
1118
+
1119
+ /**
1120
+ * Returns the value of the field element.
1121
+ */
1122
+ $.fieldValue = function(el, successful) {
1123
+ var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
1124
+ if (successful === undefined) {
1125
+ successful = true;
1126
+ }
1127
+
1128
+ if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
1129
+ (t == 'checkbox' || t == 'radio') && !el.checked ||
1130
+ (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
1131
+ tag == 'select' && el.selectedIndex == -1)) {
1132
+ return null;
1133
+ }
1134
+
1135
+ if (tag == 'select') {
1136
+ var index = el.selectedIndex;
1137
+ if (index < 0) {
1138
+ return null;
1139
+ }
1140
+ var a = [], ops = el.options;
1141
+ var one = (t == 'select-one');
1142
+ var max = (one ? index+1 : ops.length);
1143
+ for(var i=(one ? index : 0); i < max; i++) {
1144
+ var op = ops[i];
1145
+ if (op.selected) {
1146
+ var v = op.value;
1147
+ if (!v) { // extra pain for IE...
1148
+ v = (op.attributes && op.attributes.value && !(op.attributes.value.specified)) ? op.text : op.value;
1149
+ }
1150
+ if (one) {
1151
+ return v;
1152
+ }
1153
+ a.push(v);
1154
+ }
1155
+ }
1156
+ return a;
1157
+ }
1158
+ return $(el).val();
1159
+ };
1160
+
1161
+ /**
1162
+ * Clears the form data. Takes the following actions on the form's input fields:
1163
+ * - input text fields will have their 'value' property set to the empty string
1164
+ * - select elements will have their 'selectedIndex' property set to -1
1165
+ * - checkbox and radio inputs will have their 'checked' property set to false
1166
+ * - inputs of type submit, button, reset, and hidden will *not* be effected
1167
+ * - button elements will *not* be effected
1168
+ */
1169
+ $.fn.clearForm = function(includeHidden) {
1170
+ return this.each(function() {
1171
+ $('input,select,textarea', this).clearFields(includeHidden);
1172
+ });
1173
+ };
1174
+
1175
+ /**
1176
+ * Clears the selected form elements.
1177
+ */
1178
+ $.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
1179
+ var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
1180
+ return this.each(function() {
1181
+ var t = this.type, tag = this.tagName.toLowerCase();
1182
+ if (re.test(t) || tag == 'textarea') {
1183
+ this.value = '';
1184
+ }
1185
+ else if (t == 'checkbox' || t == 'radio') {
1186
+ this.checked = false;
1187
+ }
1188
+ else if (tag == 'select') {
1189
+ this.selectedIndex = -1;
1190
+ }
1191
+ else if (t == "file") {
1192
+ if (/MSIE/.test(navigator.userAgent)) {
1193
+ $(this).replaceWith($(this).clone(true));
1194
+ } else {
1195
+ $(this).val('');
1196
+ }
1197
+ }
1198
+ else if (includeHidden) {
1199
+ // includeHidden can be the value true, or it can be a selector string
1200
+ // indicating a special test; for example:
1201
+ // $('#myForm').clearForm('.special:hidden')
1202
+ // the above would clean hidden inputs that have the class of 'special'
1203
+ if ( (includeHidden === true && /hidden/.test(t)) ||
1204
+ (typeof includeHidden == 'string' && $(this).is(includeHidden)) ) {
1205
+ this.value = '';
1206
+ }
1207
+ }
1208
+ });
1209
+ };
1210
+
1211
+ /**
1212
+ * Resets the form data. Causes all form elements to be reset to their original value.
1213
+ */
1214
+ $.fn.resetForm = function() {
1215
+ return this.each(function() {
1216
+ // guard against an input with the name of 'reset'
1217
+ // note that IE reports the reset function as an 'object'
1218
+ if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
1219
+ this.reset();
1220
+ }
1221
+ });
1222
+ };
1223
+
1224
+ /**
1225
+ * Enables or disables any matching elements.
1226
+ */
1227
+ $.fn.enable = function(b) {
1228
+ if (b === undefined) {
1229
+ b = true;
1230
+ }
1231
+ return this.each(function() {
1232
+ this.disabled = !b;
1233
+ });
1234
+ };
1235
+
1236
+ /**
1237
+ * Checks/unchecks any matching checkboxes or radio buttons and
1238
+ * selects/deselects and matching option elements.
1239
+ */
1240
+ $.fn.selected = function(select) {
1241
+ if (select === undefined) {
1242
+ select = true;
1243
+ }
1244
+ return this.each(function() {
1245
+ var t = this.type;
1246
+ if (t == 'checkbox' || t == 'radio') {
1247
+ this.checked = select;
1248
+ }
1249
+ else if (this.tagName.toLowerCase() == 'option') {
1250
+ var $sel = $(this).parent('select');
1251
+ if (select && $sel[0] && $sel[0].type == 'select-one') {
1252
+ // deselect all other options
1253
+ $sel.find('option').selected(false);
1254
+ }
1255
+ this.selected = select;
1256
+ }
1257
+ });
1258
+ };
1259
+
1260
+ // expose debug var
1261
+ $.fn.ajaxSubmit.debug = false;
1262
+
1263
+ // helper fn for console logging
1264
+ function log() {
1265
+ if (!$.fn.ajaxSubmit.debug) {
1266
+ return;
1267
+ }
1268
+ var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
1269
+ if (window.console && window.console.log) {
1270
+ window.console.log(msg);
1271
+ }
1272
+ else if (window.opera && window.opera.postError) {
1273
+ window.opera.postError(msg);
1274
+ }
1275
+ }
1276
+
1277
+ }));
skin/adminhtml/default/default/elogic/slider/js/plugins/jquery.imgareaselect.js ADDED
@@ -0,0 +1,730 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * imgAreaSelect jQuery plugin
3
+ * version 0.9.10
4
+ *
5
+ * Copyright (c) 2008-2013 Michal Wojciechowski (odyniec.net)
6
+ *
7
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
8
+ * and GPL (GPL-LICENSE.txt) licenses.
9
+ *
10
+ * http://odyniec.net/projects/imgareaselect/
11
+ *
12
+ */
13
+
14
+ (function($) {
15
+
16
+ var abs = Math.abs,
17
+ max = Math.max,
18
+ min = Math.min,
19
+ round = Math.round;
20
+
21
+ function div() {
22
+ return $('<div/>');
23
+ }
24
+
25
+ $.imgAreaSelect = function (img, options) {
26
+ var
27
+
28
+ $img = $(img),
29
+
30
+ imgLoaded,
31
+
32
+ $box = div(),
33
+ $area = div(),
34
+ $border = div().add(div()).add(div()).add(div()),
35
+ $outer = div().add(div()).add(div()).add(div()),
36
+ $handles = $([]),
37
+
38
+ $areaOpera,
39
+
40
+ left, top,
41
+
42
+ imgOfs = { left: 0, top: 0 },
43
+
44
+ imgWidth, imgHeight,
45
+
46
+ $parent,
47
+
48
+ parOfs = { left: 0, top: 0 },
49
+
50
+ zIndex = 0,
51
+
52
+ position = 'absolute',
53
+
54
+ startX, startY,
55
+
56
+ scaleX, scaleY,
57
+
58
+ resize,
59
+
60
+ minWidth, minHeight, maxWidth, maxHeight,
61
+
62
+ aspectRatio,
63
+
64
+ shown,
65
+
66
+ x1, y1, x2, y2,
67
+
68
+ selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 },
69
+
70
+ docElem = document.documentElement,
71
+
72
+ ua = navigator.userAgent,
73
+
74
+ $p, d, i, o, w, h, adjusted;
75
+
76
+ function viewX(x) {
77
+ return x + imgOfs.left - parOfs.left;
78
+ }
79
+
80
+ function viewY(y) {
81
+ return y + imgOfs.top - parOfs.top;
82
+ }
83
+
84
+ function selX(x) {
85
+ return x - imgOfs.left + parOfs.left;
86
+ }
87
+
88
+ function selY(y) {
89
+ return y - imgOfs.top + parOfs.top;
90
+ }
91
+
92
+ function evX(event) {
93
+ return event.pageX - parOfs.left;
94
+ }
95
+
96
+ function evY(event) {
97
+ return event.pageY - parOfs.top;
98
+ }
99
+
100
+ function getSelection(noScale) {
101
+ var sx = noScale || scaleX, sy = noScale || scaleY;
102
+
103
+ return { x1: round(selection.x1 * sx),
104
+ y1: round(selection.y1 * sy),
105
+ x2: round(selection.x2 * sx),
106
+ y2: round(selection.y2 * sy),
107
+ width: round(selection.x2 * sx) - round(selection.x1 * sx),
108
+ height: round(selection.y2 * sy) - round(selection.y1 * sy) };
109
+ }
110
+
111
+ function setSelection(x1, y1, x2, y2, noScale) {
112
+ var sx = noScale || scaleX, sy = noScale || scaleY;
113
+
114
+ selection = {
115
+ x1: round(x1 / sx || 0),
116
+ y1: round(y1 / sy || 0),
117
+ x2: round(x2 / sx || 0),
118
+ y2: round(y2 / sy || 0)
119
+ };
120
+
121
+ selection.width = selection.x2 - selection.x1;
122
+ selection.height = selection.y2 - selection.y1;
123
+ }
124
+
125
+ function adjust() {
126
+ if (!imgLoaded || !$img.width())
127
+ return;
128
+
129
+ imgOfs = { left: round($img.offset().left), top: round($img.offset().top) };
130
+
131
+ imgWidth = $img.innerWidth();
132
+ imgHeight = $img.innerHeight();
133
+
134
+ imgOfs.top += ($img.outerHeight() - imgHeight) >> 1;
135
+ imgOfs.left += ($img.outerWidth() - imgWidth) >> 1;
136
+
137
+ minWidth = round(options.minWidth / scaleX) || 0;
138
+ minHeight = round(options.minHeight / scaleY) || 0;
139
+ maxWidth = round(min(options.maxWidth / scaleX || 1<<24, imgWidth));
140
+ maxHeight = round(min(options.maxHeight / scaleY || 1<<24, imgHeight));
141
+
142
+ if ($().jquery == '1.3.2' && position == 'fixed' &&
143
+ !docElem['getBoundingClientRect'])
144
+ {
145
+ imgOfs.top += max(document.body.scrollTop, docElem.scrollTop);
146
+ imgOfs.left += max(document.body.scrollLeft, docElem.scrollLeft);
147
+ }
148
+
149
+ parOfs = /absolute|relative/.test($parent.css('position')) ?
150
+ { left: round($parent.offset().left) - $parent.scrollLeft(),
151
+ top: round($parent.offset().top) - $parent.scrollTop() } :
152
+ position == 'fixed' ?
153
+ { left: $(document).scrollLeft(), top: $(document).scrollTop() } :
154
+ { left: 0, top: 0 };
155
+
156
+ left = viewX(0);
157
+ top = viewY(0);
158
+
159
+ if (selection.x2 > imgWidth || selection.y2 > imgHeight)
160
+ doResize();
161
+ }
162
+
163
+ function update(resetKeyPress) {
164
+ if (!shown) return;
165
+
166
+ $box.css({ left: viewX(selection.x1), top: viewY(selection.y1) })
167
+ .add($area).width(w = selection.width).height(h = selection.height);
168
+
169
+ $area.add($border).add($handles).css({ left: 0, top: 0 });
170
+
171
+ $border
172
+ .width(max(w - $border.outerWidth() + $border.innerWidth(), 0))
173
+ .height(max(h - $border.outerHeight() + $border.innerHeight(), 0));
174
+
175
+ $($outer[0]).css({ left: left, top: top,
176
+ width: selection.x1, height: imgHeight });
177
+ $($outer[1]).css({ left: left + selection.x1, top: top,
178
+ width: w, height: selection.y1 });
179
+ $($outer[2]).css({ left: left + selection.x2, top: top,
180
+ width: imgWidth - selection.x2, height: imgHeight });
181
+ $($outer[3]).css({ left: left + selection.x1, top: top + selection.y2,
182
+ width: w, height: imgHeight - selection.y2 });
183
+
184
+ w -= $handles.outerWidth();
185
+ h -= $handles.outerHeight();
186
+
187
+ switch ($handles.length) {
188
+ case 8:
189
+ $($handles[4]).css({ left: w >> 1 });
190
+ $($handles[5]).css({ left: w, top: h >> 1 });
191
+ $($handles[6]).css({ left: w >> 1, top: h });
192
+ $($handles[7]).css({ top: h >> 1 });
193
+ case 4:
194
+ $handles.slice(1,3).css({ left: w });
195
+ $handles.slice(2,4).css({ top: h });
196
+ }
197
+
198
+ if (resetKeyPress !== false) {
199
+ if ($.imgAreaSelect.onKeyPress != docKeyPress)
200
+ $(document).unbind($.imgAreaSelect.keyPress,
201
+ $.imgAreaSelect.onKeyPress);
202
+
203
+ if (options.keys)
204
+ $(document)[$.imgAreaSelect.keyPress](
205
+ $.imgAreaSelect.onKeyPress = docKeyPress);
206
+ }
207
+
208
+ if (msie && $border.outerWidth() - $border.innerWidth() == 2) {
209
+ $border.css('margin', 0);
210
+ setTimeout(function () { $border.css('margin', 'auto'); }, 0);
211
+ }
212
+ }
213
+
214
+ function doUpdate(resetKeyPress) {
215
+ adjust();
216
+ update(resetKeyPress);
217
+ x1 = viewX(selection.x1); y1 = viewY(selection.y1);
218
+ x2 = viewX(selection.x2); y2 = viewY(selection.y2);
219
+ }
220
+
221
+ function hide($elem, fn) {
222
+ options.fadeSpeed ? $elem.fadeOut(options.fadeSpeed, fn) : $elem.hide();
223
+
224
+ }
225
+
226
+ function areaMouseMove(event) {
227
+ var x = selX(evX(event)) - selection.x1,
228
+ y = selY(evY(event)) - selection.y1;
229
+
230
+ if (!adjusted) {
231
+ adjust();
232
+ adjusted = true;
233
+
234
+ $box.one('mouseout', function () { adjusted = false; });
235
+ }
236
+
237
+ resize = '';
238
+
239
+ if (options.resizable) {
240
+ if (y <= options.resizeMargin)
241
+ resize = 'n';
242
+ else if (y >= selection.height - options.resizeMargin)
243
+ resize = 's';
244
+ if (x <= options.resizeMargin)
245
+ resize += 'w';
246
+ else if (x >= selection.width - options.resizeMargin)
247
+ resize += 'e';
248
+ }
249
+
250
+ $box.css('cursor', resize ? resize + '-resize' :
251
+ options.movable ? 'move' : '');
252
+ if ($areaOpera)
253
+ $areaOpera.toggle();
254
+ }
255
+
256
+ function docMouseUp(event) {
257
+ $('body').css('cursor', '');
258
+ if (options.autoHide || selection.width * selection.height == 0)
259
+ hide($box.add($outer), function () { $(this).hide(); });
260
+
261
+ $(document).unbind('mousemove', selectingMouseMove);
262
+ $box.mousemove(areaMouseMove);
263
+
264
+ options.onSelectEnd(img, getSelection());
265
+ }
266
+
267
+ function areaMouseDown(event) {
268
+ if (event.which != 1) return false;
269
+
270
+ adjust();
271
+
272
+ if (resize) {
273
+ $('body').css('cursor', resize + '-resize');
274
+
275
+ x1 = viewX(selection[/w/.test(resize) ? 'x2' : 'x1']);
276
+ y1 = viewY(selection[/n/.test(resize) ? 'y2' : 'y1']);
277
+
278
+ $(document).mousemove(selectingMouseMove)
279
+ .one('mouseup', docMouseUp);
280
+ $box.unbind('mousemove', areaMouseMove);
281
+ }
282
+ else if (options.movable) {
283
+ startX = left + selection.x1 - evX(event);
284
+ startY = top + selection.y1 - evY(event);
285
+
286
+ $box.unbind('mousemove', areaMouseMove);
287
+
288
+ $(document).mousemove(movingMouseMove)
289
+ .one('mouseup', function () {
290
+ options.onSelectEnd(img, getSelection());
291
+
292
+ $(document).unbind('mousemove', movingMouseMove);
293
+ $box.mousemove(areaMouseMove);
294
+ });
295
+ }
296
+ else
297
+ $img.mousedown(event);
298
+
299
+ return false;
300
+ }
301
+
302
+ function fixAspectRatio(xFirst) {
303
+ if (aspectRatio)
304
+ if (xFirst) {
305
+ x2 = max(left, min(left + imgWidth,
306
+ x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1)));
307
+
308
+ y2 = round(max(top, min(top + imgHeight,
309
+ y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1))));
310
+ x2 = round(x2);
311
+ }
312
+ else {
313
+ y2 = max(top, min(top + imgHeight,
314
+ y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1)));
315
+ x2 = round(max(left, min(left + imgWidth,
316
+ x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1))));
317
+ y2 = round(y2);
318
+ }
319
+ }
320
+
321
+ function doResize() {
322
+ x1 = min(x1, left + imgWidth);
323
+ y1 = min(y1, top + imgHeight);
324
+
325
+ if (abs(x2 - x1) < minWidth) {
326
+ x2 = x1 - minWidth * (x2 < x1 || -1);
327
+
328
+ if (x2 < left)
329
+ x1 = left + minWidth;
330
+ else if (x2 > left + imgWidth)
331
+ x1 = left + imgWidth - minWidth;
332
+ }
333
+
334
+ if (abs(y2 - y1) < minHeight) {
335
+ y2 = y1 - minHeight * (y2 < y1 || -1);
336
+
337
+ if (y2 < top)
338
+ y1 = top + minHeight;
339
+ else if (y2 > top + imgHeight)
340
+ y1 = top + imgHeight - minHeight;
341
+ }
342
+
343
+ x2 = max(left, min(x2, left + imgWidth));
344
+ y2 = max(top, min(y2, top + imgHeight));
345
+
346
+ fixAspectRatio(abs(x2 - x1) < abs(y2 - y1) * aspectRatio);
347
+
348
+ if (abs(x2 - x1) > maxWidth) {
349
+ x2 = x1 - maxWidth * (x2 < x1 || -1);
350
+ fixAspectRatio();
351
+ }
352
+
353
+ if (abs(y2 - y1) > maxHeight) {
354
+ y2 = y1 - maxHeight * (y2 < y1 || -1);
355
+ fixAspectRatio(true);
356
+ }
357
+
358
+ selection = { x1: selX(min(x1, x2)), x2: selX(max(x1, x2)),
359
+ y1: selY(min(y1, y2)), y2: selY(max(y1, y2)),
360
+ width: abs(x2 - x1), height: abs(y2 - y1) };
361
+
362
+ update();
363
+
364
+ options.onSelectChange(img, getSelection());
365
+ }
366
+
367
+ function selectingMouseMove(event) {
368
+ x2 = /w|e|^$/.test(resize) || aspectRatio ? evX(event) : viewX(selection.x2);
369
+ y2 = /n|s|^$/.test(resize) || aspectRatio ? evY(event) : viewY(selection.y2);
370
+
371
+ doResize();
372
+
373
+ return false;
374
+
375
+ }
376
+
377
+ function doMove(newX1, newY1) {
378
+ x2 = (x1 = newX1) + selection.width;
379
+ y2 = (y1 = newY1) + selection.height;
380
+
381
+ $.extend(selection, { x1: selX(x1), y1: selY(y1), x2: selX(x2),
382
+ y2: selY(y2) });
383
+
384
+ update();
385
+
386
+ options.onSelectChange(img, getSelection());
387
+ }
388
+
389
+ function movingMouseMove(event) {
390
+ x1 = max(left, min(startX + evX(event), left + imgWidth - selection.width));
391
+ y1 = max(top, min(startY + evY(event), top + imgHeight - selection.height));
392
+
393
+ doMove(x1, y1);
394
+
395
+ event.preventDefault();
396
+
397
+ return false;
398
+ }
399
+
400
+ function startSelection() {
401
+ $(document).unbind('mousemove', startSelection);
402
+ adjust();
403
+
404
+ x2 = x1;
405
+ y2 = y1;
406
+
407
+ doResize();
408
+
409
+ resize = '';
410
+
411
+ if (!$outer.is(':visible'))
412
+ $box.add($outer).hide().fadeIn(options.fadeSpeed||0);
413
+
414
+ shown = true;
415
+
416
+ $(document).unbind('mouseup', cancelSelection)
417
+ .mousemove(selectingMouseMove).one('mouseup', docMouseUp);
418
+ $box.unbind('mousemove', areaMouseMove);
419
+
420
+ options.onSelectStart(img, getSelection());
421
+ }
422
+
423
+ function cancelSelection() {
424
+ $(document).unbind('mousemove', startSelection)
425
+ .unbind('mouseup', cancelSelection);
426
+ hide($box.add($outer));
427
+
428
+ setSelection(selX(x1), selY(y1), selX(x1), selY(y1));
429
+
430
+ if (!(this instanceof $.imgAreaSelect)) {
431
+ options.onSelectChange(img, getSelection());
432
+ options.onSelectEnd(img, getSelection());
433
+ }
434
+ }
435
+
436
+ function imgMouseDown(event) {
437
+ if (event.which != 1 || $outer.is(':animated')) return false;
438
+
439
+ adjust();
440
+ startX = x1 = evX(event);
441
+ startY = y1 = evY(event);
442
+
443
+ $(document).mousemove(startSelection).mouseup(cancelSelection);
444
+
445
+ return false;
446
+ }
447
+
448
+ function windowResize() {
449
+ doUpdate(false);
450
+ }
451
+
452
+ function imgLoad() {
453
+ imgLoaded = true;
454
+
455
+ setOptions(options = $.extend({
456
+ classPrefix: 'imgareaselect',
457
+ movable: true,
458
+ parent: 'body',
459
+ resizable: true,
460
+ resizeMargin: 10,
461
+ onInit: function () {},
462
+ onSelectStart: function () {},
463
+ onSelectChange: function () {},
464
+ onSelectEnd: function () {}
465
+ }, options));
466
+
467
+ $box.add($outer).css({ visibility: '' });
468
+
469
+ if (options.show) {
470
+ shown = true;
471
+ adjust();
472
+ update();
473
+ $box.add($outer).hide().fadeIn(options.fadeSpeed||0);
474
+ }
475
+
476
+ setTimeout(function () { options.onInit(img, getSelection()); }, 0);
477
+ }
478
+
479
+ var docKeyPress = function(event) {
480
+ var k = options.keys, d, t, key = event.keyCode;
481
+
482
+ d = !isNaN(k.alt) && (event.altKey || event.originalEvent.altKey) ? k.alt :
483
+ !isNaN(k.ctrl) && event.ctrlKey ? k.ctrl :
484
+ !isNaN(k.shift) && event.shiftKey ? k.shift :
485
+ !isNaN(k.arrows) ? k.arrows : 10;
486
+
487
+ if (k.arrows == 'resize' || (k.shift == 'resize' && event.shiftKey) ||
488
+ (k.ctrl == 'resize' && event.ctrlKey) ||
489
+ (k.alt == 'resize' && (event.altKey || event.originalEvent.altKey)))
490
+ {
491
+ switch (key) {
492
+ case 37:
493
+ d = -d;
494
+ case 39:
495
+ t = max(x1, x2);
496
+ x1 = min(x1, x2);
497
+ x2 = max(t + d, x1);
498
+ fixAspectRatio();
499
+ break;
500
+ case 38:
501
+ d = -d;
502
+ case 40:
503
+ t = max(y1, y2);
504
+ y1 = min(y1, y2);
505
+ y2 = max(t + d, y1);
506
+ fixAspectRatio(true);
507
+ break;
508
+ default:
509
+ return;
510
+ }
511
+
512
+ doResize();
513
+ }
514
+ else {
515
+ x1 = min(x1, x2);
516
+ y1 = min(y1, y2);
517
+
518
+ switch (key) {
519
+ case 37:
520
+ doMove(max(x1 - d, left), y1);
521
+ break;
522
+ case 38:
523
+ doMove(x1, max(y1 - d, top));
524
+ break;
525
+ case 39:
526
+ doMove(x1 + min(d, imgWidth - selX(x2)), y1);
527
+ break;
528
+ case 40:
529
+ doMove(x1, y1 + min(d, imgHeight - selY(y2)));
530
+ break;
531
+ default:
532
+ return;
533
+ }
534
+ }
535
+
536
+ return false;
537
+ };
538
+
539
+ function styleOptions($elem, props) {
540
+ for (var option in props)
541
+ if (options[option] !== undefined)
542
+ $elem.css(props[option], options[option]);
543
+ }
544
+
545
+ function setOptions(newOptions) {
546
+ if (newOptions.parent)
547
+ ($parent = $(newOptions.parent)).append($box.add($outer));
548
+
549
+ $.extend(options, newOptions);
550
+
551
+ adjust();
552
+
553
+ if (newOptions.handles != null) {
554
+ $handles.remove();
555
+ $handles = $([]);
556
+
557
+ i = newOptions.handles ? newOptions.handles == 'corners' ? 4 : 8 : 0;
558
+
559
+ while (i--)
560
+ $handles = $handles.add(div());
561
+
562
+ $handles.addClass(options.classPrefix + '-handle').css({
563
+ position: 'absolute',
564
+ fontSize: 0,
565
+ zIndex: zIndex + 1 || 1
566
+ });
567
+
568
+ if (!parseInt($handles.css('width')) >= 0)
569
+ $handles.width(5).height(5);
570
+
571
+ if (o = options.borderWidth)
572
+ $handles.css({ borderWidth: o, borderStyle: 'solid' });
573
+
574
+ styleOptions($handles, { borderColor1: 'border-color',
575
+ borderColor2: 'background-color',
576
+ borderOpacity: 'opacity' });
577
+ }
578
+
579
+ scaleX = options.imageWidth / imgWidth || 1;
580
+ scaleY = options.imageHeight / imgHeight || 1;
581
+
582
+ if (newOptions.x1 != null) {
583
+ setSelection(newOptions.x1, newOptions.y1, newOptions.x2,
584
+ newOptions.y2);
585
+ newOptions.show = !newOptions.hide;
586
+ }
587
+
588
+ if (newOptions.keys)
589
+ options.keys = $.extend({ shift: 1, ctrl: 'resize' },
590
+ newOptions.keys);
591
+
592
+ $outer.addClass(options.classPrefix + '-outer');
593
+ $area.addClass(options.classPrefix + '-selection');
594
+ for (i = 0; i++ < 4;)
595
+ $($border[i-1]).addClass(options.classPrefix + '-border' + i);
596
+
597
+ styleOptions($area, { selectionColor: 'background-color',
598
+ selectionOpacity: 'opacity' });
599
+ styleOptions($border, { borderOpacity: 'opacity',
600
+ borderWidth: 'border-width' });
601
+ styleOptions($outer, { outerColor: 'background-color',
602
+ outerOpacity: 'opacity' });
603
+ if (o = options.borderColor1)
604
+ $($border[0]).css({ borderStyle: 'solid', borderColor: o });
605
+ if (o = options.borderColor2)
606
+ $($border[1]).css({ borderStyle: 'dashed', borderColor: o });
607
+
608
+ $box.append($area.add($border).add($areaOpera)).append($handles);
609
+
610
+ if (msie) {
611
+ if (o = ($outer.css('filter')||'').match(/opacity=(\d+)/))
612
+ $outer.css('opacity', o[1]/100);
613
+ if (o = ($border.css('filter')||'').match(/opacity=(\d+)/))
614
+ $border.css('opacity', o[1]/100);
615
+ }
616
+
617
+ if (newOptions.hide)
618
+ hide($box.add($outer));
619
+ else if (newOptions.show && imgLoaded) {
620
+ shown = true;
621
+ $box.add($outer).fadeIn(options.fadeSpeed||0);
622
+ doUpdate();
623
+ }
624
+
625
+ aspectRatio = (d = (options.aspectRatio || '').split(/:/))[0] / d[1];
626
+
627
+ $img.add($outer).unbind('mousedown', imgMouseDown);
628
+
629
+ if (options.disable || options.enable === false) {
630
+ $box.unbind('mousemove', areaMouseMove).unbind('mousedown', areaMouseDown);
631
+ $(window).unbind('resize', windowResize);
632
+ }
633
+ else {
634
+ if (options.enable || options.disable === false) {
635
+ if (options.resizable || options.movable)
636
+ $box.mousemove(areaMouseMove).mousedown(areaMouseDown);
637
+
638
+ $(window).resize(windowResize);
639
+ }
640
+
641
+ if (!options.persistent)
642
+ $img.add($outer).mousedown(imgMouseDown);
643
+ }
644
+
645
+ options.enable = options.disable = undefined;
646
+ }
647
+
648
+ this.remove = function () {
649
+ setOptions({ disable: true });
650
+ $box.add($outer).remove();
651
+ };
652
+
653
+ this.getOptions = function () { return options; };
654
+
655
+ this.setOptions = setOptions;
656
+
657
+ this.getSelection = getSelection;
658
+
659
+ this.setSelection = setSelection;
660
+
661
+ this.cancelSelection = cancelSelection;
662
+
663
+ this.update = doUpdate;
664
+
665
+ var msie = (/msie ([\w.]+)/i.exec(ua)||[])[1],
666
+ opera = /opera/i.test(ua),
667
+ safari = /webkit/i.test(ua) && !/chrome/i.test(ua);
668
+
669
+ $p = $img;
670
+
671
+ while ($p.length) {
672
+ zIndex = max(zIndex,
673
+ !isNaN($p.css('z-index')) ? $p.css('z-index') : zIndex);
674
+ if ($p.css('position') == 'fixed')
675
+ position = 'fixed';
676
+
677
+ $p = $p.parent(':not(body)');
678
+ }
679
+
680
+ zIndex = options.zIndex || zIndex;
681
+
682
+ if (msie)
683
+ $img.attr('unselectable', 'on');
684
+
685
+ $.imgAreaSelect.keyPress = msie || safari ? 'keydown' : 'keypress';
686
+
687
+ if (opera)
688
+
689
+ $areaOpera = div().css({ width: '100%', height: '100%',
690
+ position: 'absolute', zIndex: zIndex + 2 || 2 });
691
+
692
+ $box.add($outer).css({ visibility: 'hidden', position: position,
693
+ overflow: 'hidden', zIndex: zIndex || '0' });
694
+ $box.css({ zIndex: zIndex + 2 || 2 });
695
+ $area.add($border).css({ position: 'absolute', fontSize: 0 });
696
+
697
+ img.complete || img.readyState == 'complete' || !$img.is('img') ?
698
+ imgLoad() : $img.one('load', imgLoad);
699
+
700
+ if (!imgLoaded && msie && msie >= 7)
701
+ img.src = img.src;
702
+ };
703
+
704
+ $.fn.imgAreaSelect = function (options) {
705
+ options = options || {};
706
+
707
+ this.each(function () {
708
+ if ($(this).data('imgAreaSelect')) {
709
+ if (options.remove) {
710
+ $(this).data('imgAreaSelect').remove();
711
+ $(this).removeData('imgAreaSelect');
712
+ }
713
+ else
714
+ $(this).data('imgAreaSelect').setOptions(options);
715
+ }
716
+ else if (!options.remove) {
717
+ if (options.enable === undefined && options.disable === undefined)
718
+ options.enable = true;
719
+
720
+ $(this).data('imgAreaSelect', new $.imgAreaSelect(this, options));
721
+ }
722
+ });
723
+
724
+ if (options.instance)
725
+ return $(this).data('imgAreaSelect');
726
+
727
+ return this;
728
+ };
729
+
730
+ })(jQuery);
skin/adminhtml/default/default/elogic/slider/js/plugins/jquery.imgareaselect.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function($){var abs=Math.abs,max=Math.max,min=Math.min,round=Math.round;function div(){return $('<div/>')}$.imgAreaSelect=function(img,options){var $img=$(img),imgLoaded,$box=div(),$area=div(),$border=div().add(div()).add(div()).add(div()),$outer=div().add(div()).add(div()).add(div()),$handles=$([]),$areaOpera,left,top,imgOfs={left:0,top:0},imgWidth,imgHeight,$parent,parOfs={left:0,top:0},zIndex=0,position='absolute',startX,startY,scaleX,scaleY,resize,minWidth,minHeight,maxWidth,maxHeight,aspectRatio,shown,x1,y1,x2,y2,selection={x1:0,y1:0,x2:0,y2:0,width:0,height:0},docElem=document.documentElement,ua=navigator.userAgent,$p,d,i,o,w,h,adjusted;function viewX(x){return x+imgOfs.left-parOfs.left}function viewY(y){return y+imgOfs.top-parOfs.top}function selX(x){return x-imgOfs.left+parOfs.left}function selY(y){return y-imgOfs.top+parOfs.top}function evX(event){return event.pageX-parOfs.left}function evY(event){return event.pageY-parOfs.top}function getSelection(noScale){var sx=noScale||scaleX,sy=noScale||scaleY;return{x1:round(selection.x1*sx),y1:round(selection.y1*sy),x2:round(selection.x2*sx),y2:round(selection.y2*sy),width:round(selection.x2*sx)-round(selection.x1*sx),height:round(selection.y2*sy)-round(selection.y1*sy)}}function setSelection(x1,y1,x2,y2,noScale){var sx=noScale||scaleX,sy=noScale||scaleY;selection={x1:round(x1/sx||0),y1:round(y1/sy||0),x2:round(x2/sx||0),y2:round(y2/sy||0)};selection.width=selection.x2-selection.x1;selection.height=selection.y2-selection.y1}function adjust(){if(!imgLoaded||!$img.width())return;imgOfs={left:round($img.offset().left),top:round($img.offset().top)};imgWidth=$img.innerWidth();imgHeight=$img.innerHeight();imgOfs.top+=($img.outerHeight()-imgHeight)>>1;imgOfs.left+=($img.outerWidth()-imgWidth)>>1;minWidth=round(options.minWidth/scaleX)||0;minHeight=round(options.minHeight/scaleY)||0;maxWidth=round(min(options.maxWidth/scaleX||1<<24,imgWidth));maxHeight=round(min(options.maxHeight/scaleY||1<<24,imgHeight));if($().jquery=='1.3.2'&&position=='fixed'&&!docElem['getBoundingClientRect']){imgOfs.top+=max(document.body.scrollTop,docElem.scrollTop);imgOfs.left+=max(document.body.scrollLeft,docElem.scrollLeft)}parOfs=/absolute|relative/.test($parent.css('position'))?{left:round($parent.offset().left)-$parent.scrollLeft(),top:round($parent.offset().top)-$parent.scrollTop()}:position=='fixed'?{left:$(document).scrollLeft(),top:$(document).scrollTop()}:{left:0,top:0};left=viewX(0);top=viewY(0);if(selection.x2>imgWidth||selection.y2>imgHeight)doResize()}function update(resetKeyPress){if(!shown)return;$box.css({left:viewX(selection.x1),top:viewY(selection.y1)}).add($area).width(w=selection.width).height(h=selection.height);$area.add($border).add($handles).css({left:0,top:0});$border.width(max(w-$border.outerWidth()+$border.innerWidth(),0)).height(max(h-$border.outerHeight()+$border.innerHeight(),0));$($outer[0]).css({left:left,top:top,width:selection.x1,height:imgHeight});$($outer[1]).css({left:left+selection.x1,top:top,width:w,height:selection.y1});$($outer[2]).css({left:left+selection.x2,top:top,width:imgWidth-selection.x2,height:imgHeight});$($outer[3]).css({left:left+selection.x1,top:top+selection.y2,width:w,height:imgHeight-selection.y2});w-=$handles.outerWidth();h-=$handles.outerHeight();switch($handles.length){case 8:$($handles[4]).css({left:w>>1});$($handles[5]).css({left:w,top:h>>1});$($handles[6]).css({left:w>>1,top:h});$($handles[7]).css({top:h>>1});case 4:$handles.slice(1,3).css({left:w});$handles.slice(2,4).css({top:h})}if(resetKeyPress!==false){if($.imgAreaSelect.onKeyPress!=docKeyPress)$(document).unbind($.imgAreaSelect.keyPress,$.imgAreaSelect.onKeyPress);if(options.keys)$(document)[$.imgAreaSelect.keyPress]($.imgAreaSelect.onKeyPress=docKeyPress)}if(msie&&$border.outerWidth()-$border.innerWidth()==2){$border.css('margin',0);setTimeout(function(){$border.css('margin','auto')},0)}}function doUpdate(resetKeyPress){adjust();update(resetKeyPress);x1=viewX(selection.x1);y1=viewY(selection.y1);x2=viewX(selection.x2);y2=viewY(selection.y2)}function hide($elem,fn){options.fadeSpeed?$elem.fadeOut(options.fadeSpeed,fn):$elem.hide()}function areaMouseMove(event){var x=selX(evX(event))-selection.x1,y=selY(evY(event))-selection.y1;if(!adjusted){adjust();adjusted=true;$box.one('mouseout',function(){adjusted=false})}resize='';if(options.resizable){if(y<=options.resizeMargin)resize='n';else if(y>=selection.height-options.resizeMargin)resize='s';if(x<=options.resizeMargin)resize+='w';else if(x>=selection.width-options.resizeMargin)resize+='e'}$box.css('cursor',resize?resize+'-resize':options.movable?'move':'');if($areaOpera)$areaOpera.toggle()}function docMouseUp(event){$('body').css('cursor','');if(options.autoHide||selection.width*selection.height==0)hide($box.add($outer),function(){$(this).hide()});$(document).unbind('mousemove',selectingMouseMove);$box.mousemove(areaMouseMove);options.onSelectEnd(img,getSelection())}function areaMouseDown(event){if(event.which!=1)return false;adjust();if(resize){$('body').css('cursor',resize+'-resize');x1=viewX(selection[/w/.test(resize)?'x2':'x1']);y1=viewY(selection[/n/.test(resize)?'y2':'y1']);$(document).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove)}else if(options.movable){startX=left+selection.x1-evX(event);startY=top+selection.y1-evY(event);$box.unbind('mousemove',areaMouseMove);$(document).mousemove(movingMouseMove).one('mouseup',function(){options.onSelectEnd(img,getSelection());$(document).unbind('mousemove',movingMouseMove);$box.mousemove(areaMouseMove)})}else $img.mousedown(event);return false}function fixAspectRatio(xFirst){if(aspectRatio)if(xFirst){x2=max(left,min(left+imgWidth,x1+abs(y2-y1)*aspectRatio*(x2>x1||-1)));y2=round(max(top,min(top+imgHeight,y1+abs(x2-x1)/aspectRatio*(y2>y1||-1))));x2=round(x2)}else{y2=max(top,min(top+imgHeight,y1+abs(x2-x1)/aspectRatio*(y2>y1||-1)));x2=round(max(left,min(left+imgWidth,x1+abs(y2-y1)*aspectRatio*(x2>x1||-1))));y2=round(y2)}}function doResize(){x1=min(x1,left+imgWidth);y1=min(y1,top+imgHeight);if(abs(x2-x1)<minWidth){x2=x1-minWidth*(x2<x1||-1);if(x2<left)x1=left+minWidth;else if(x2>left+imgWidth)x1=left+imgWidth-minWidth}if(abs(y2-y1)<minHeight){y2=y1-minHeight*(y2<y1||-1);if(y2<top)y1=top+minHeight;else if(y2>top+imgHeight)y1=top+imgHeight-minHeight}x2=max(left,min(x2,left+imgWidth));y2=max(top,min(y2,top+imgHeight));fixAspectRatio(abs(x2-x1)<abs(y2-y1)*aspectRatio);if(abs(x2-x1)>maxWidth){x2=x1-maxWidth*(x2<x1||-1);fixAspectRatio()}if(abs(y2-y1)>maxHeight){y2=y1-maxHeight*(y2<y1||-1);fixAspectRatio(true)}selection={x1:selX(min(x1,x2)),x2:selX(max(x1,x2)),y1:selY(min(y1,y2)),y2:selY(max(y1,y2)),width:abs(x2-x1),height:abs(y2-y1)};update();options.onSelectChange(img,getSelection())}function selectingMouseMove(event){x2=/w|e|^$/.test(resize)||aspectRatio?evX(event):viewX(selection.x2);y2=/n|s|^$/.test(resize)||aspectRatio?evY(event):viewY(selection.y2);doResize();return false}function doMove(newX1,newY1){x2=(x1=newX1)+selection.width;y2=(y1=newY1)+selection.height;$.extend(selection,{x1:selX(x1),y1:selY(y1),x2:selX(x2),y2:selY(y2)});update();options.onSelectChange(img,getSelection())}function movingMouseMove(event){x1=max(left,min(startX+evX(event),left+imgWidth-selection.width));y1=max(top,min(startY+evY(event),top+imgHeight-selection.height));doMove(x1,y1);event.preventDefault();return false}function startSelection(){$(document).unbind('mousemove',startSelection);adjust();x2=x1;y2=y1;doResize();resize='';if(!$outer.is(':visible'))$box.add($outer).hide().fadeIn(options.fadeSpeed||0);shown=true;$(document).unbind('mouseup',cancelSelection).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove);options.onSelectStart(img,getSelection())}function cancelSelection(){$(document).unbind('mousemove',startSelection).unbind('mouseup',cancelSelection);hide($box.add($outer));setSelection(selX(x1),selY(y1),selX(x1),selY(y1));if(!(this instanceof $.imgAreaSelect)){options.onSelectChange(img,getSelection());options.onSelectEnd(img,getSelection())}}function imgMouseDown(event){if(event.which!=1||$outer.is(':animated'))return false;adjust();startX=x1=evX(event);startY=y1=evY(event);$(document).mousemove(startSelection).mouseup(cancelSelection);return false}function windowResize(){doUpdate(false)}function imgLoad(){imgLoaded=true;setOptions(options=$.extend({classPrefix:'imgareaselect',movable:true,parent:'body',resizable:true,resizeMargin:10,onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},options));$box.add($outer).css({visibility:''});if(options.show){shown=true;adjust();update();$box.add($outer).hide().fadeIn(options.fadeSpeed||0)}setTimeout(function(){options.onInit(img,getSelection())},0)}var docKeyPress=function(event){var k=options.keys,d,t,key=event.keyCode;d=!isNaN(k.alt)&&(event.altKey||event.originalEvent.altKey)?k.alt:!isNaN(k.ctrl)&&event.ctrlKey?k.ctrl:!isNaN(k.shift)&&event.shiftKey?k.shift:!isNaN(k.arrows)?k.arrows:10;if(k.arrows=='resize'||(k.shift=='resize'&&event.shiftKey)||(k.ctrl=='resize'&&event.ctrlKey)||(k.alt=='resize'&&(event.altKey||event.originalEvent.altKey))){switch(key){case 37:d=-d;case 39:t=max(x1,x2);x1=min(x1,x2);x2=max(t+d,x1);fixAspectRatio();break;case 38:d=-d;case 40:t=max(y1,y2);y1=min(y1,y2);y2=max(t+d,y1);fixAspectRatio(true);break;default:return}doResize()}else{x1=min(x1,x2);y1=min(y1,y2);switch(key){case 37:doMove(max(x1-d,left),y1);break;case 38:doMove(x1,max(y1-d,top));break;case 39:doMove(x1+min(d,imgWidth-selX(x2)),y1);break;case 40:doMove(x1,y1+min(d,imgHeight-selY(y2)));break;default:return}}return false};function styleOptions($elem,props){for(var option in props)if(options[option]!==undefined)$elem.css(props[option],options[option])}function setOptions(newOptions){if(newOptions.parent)($parent=$(newOptions.parent)).append($box.add($outer));$.extend(options,newOptions);adjust();if(newOptions.handles!=null){$handles.remove();$handles=$([]);i=newOptions.handles?newOptions.handles=='corners'?4:8:0;while(i--)$handles=$handles.add(div());$handles.addClass(options.classPrefix+'-handle').css({position:'absolute',fontSize:0,zIndex:zIndex+1||1});if(!parseInt($handles.css('width'))>=0)$handles.width(5).height(5);if(o=options.borderWidth)$handles.css({borderWidth:o,borderStyle:'solid'});styleOptions($handles,{borderColor1:'border-color',borderColor2:'background-color',borderOpacity:'opacity'})}scaleX=options.imageWidth/imgWidth||1;scaleY=options.imageHeight/imgHeight||1;if(newOptions.x1!=null){setSelection(newOptions.x1,newOptions.y1,newOptions.x2,newOptions.y2);newOptions.show=!newOptions.hide}if(newOptions.keys)options.keys=$.extend({shift:1,ctrl:'resize'},newOptions.keys);$outer.addClass(options.classPrefix+'-outer');$area.addClass(options.classPrefix+'-selection');for(i=0;i++<4;)$($border[i-1]).addClass(options.classPrefix+'-border'+i);styleOptions($area,{selectionColor:'background-color',selectionOpacity:'opacity'});styleOptions($border,{borderOpacity:'opacity',borderWidth:'border-width'});styleOptions($outer,{outerColor:'background-color',outerOpacity:'opacity'});if(o=options.borderColor1)$($border[0]).css({borderStyle:'solid',borderColor:o});if(o=options.borderColor2)$($border[1]).css({borderStyle:'dashed',borderColor:o});$box.append($area.add($border).add($areaOpera)).append($handles);if(msie){if(o=($outer.css('filter')||'').match(/opacity=(\d+)/))$outer.css('opacity',o[1]/100);if(o=($border.css('filter')||'').match(/opacity=(\d+)/))$border.css('opacity',o[1]/100)}if(newOptions.hide)hide($box.add($outer));else if(newOptions.show&&imgLoaded){shown=true;$box.add($outer).fadeIn(options.fadeSpeed||0);doUpdate()}aspectRatio=(d=(options.aspectRatio||'').split(/:/))[0]/d[1];$img.add($outer).unbind('mousedown',imgMouseDown);if(options.disable||options.enable===false){$box.unbind('mousemove',areaMouseMove).unbind('mousedown',areaMouseDown);$(window).unbind('resize',windowResize)}else{if(options.enable||options.disable===false){if(options.resizable||options.movable)$box.mousemove(areaMouseMove).mousedown(areaMouseDown);$(window).resize(windowResize)}if(!options.persistent)$img.add($outer).mousedown(imgMouseDown)}options.enable=options.disable=undefined}this.remove=function(){setOptions({disable:true});$box.add($outer).remove()};this.getOptions=function(){return options};this.setOptions=setOptions;this.getSelection=getSelection;this.setSelection=setSelection;this.cancelSelection=cancelSelection;this.update=doUpdate;var msie=(/msie ([\w.]+)/i.exec(ua)||[])[1],opera=/opera/i.test(ua),safari=/webkit/i.test(ua)&&!/chrome/i.test(ua);$p=$img;while($p.length){zIndex=max(zIndex,!isNaN($p.css('z-index'))?$p.css('z-index'):zIndex);if($p.css('position')=='fixed')position='fixed';$p=$p.parent(':not(body)')}zIndex=options.zIndex||zIndex;if(msie)$img.attr('unselectable','on');$.imgAreaSelect.keyPress=msie||safari?'keydown':'keypress';if(opera)$areaOpera=div().css({width:'100%',height:'100%',position:'absolute',zIndex:zIndex+2||2});$box.add($outer).css({visibility:'hidden',position:position,overflow:'hidden',zIndex:zIndex||'0'});$box.css({zIndex:zIndex+2||2});$area.add($border).css({position:'absolute',fontSize:0});img.complete||img.readyState=='complete'||!$img.is('img')?imgLoad():$img.one('load',imgLoad);if(!imgLoaded&&msie&&msie>=7)img.src=img.src};$.fn.imgAreaSelect=function(options){options=options||{};this.each(function(){if($(this).data('imgAreaSelect')){if(options.remove){$(this).data('imgAreaSelect').remove();$(this).removeData('imgAreaSelect')}else $(this).data('imgAreaSelect').setOptions(options)}else if(!options.remove){if(options.enable===undefined&&options.disable===undefined)options.enable=true;$(this).data('imgAreaSelect',new $.imgAreaSelect(this,options))}});if(options.instance)return $(this).data('imgAreaSelect');return this}})(jQuery);
skin/adminhtml/default/default/elogic/slider/js/plugins/jquery.imgareaselect.pack.js ADDED
@@ -0,0 +1 @@
 
1
+ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(m($){18 W=2v.4T,D=2v.4S,F=2v.4R,u=2v.4Q;m V(){C $("<4P/>")};$.N=m(T,c){18 O=$(T),1F,A=V(),1k=V(),I=V().r(V()).r(V()).r(V()),B=V().r(V()).r(V()).r(V()),E=$([]),1K,G,l,17={v:0,l:0},Q,M,1l,1g={v:0,l:0},12=0,1J="1H",2k,2j,1t,1s,S,1B,1A,2o,2n,14,1Q,a,b,j,g,f={a:0,b:0,j:0,g:0,H:0,L:0},2u=R.4O,1M=4N.4M,$p,d,i,o,w,h,2p;m 1n(x){C x+17.v-1g.v};m 1m(y){C y+17.l-1g.l};m 1b(x){C x-17.v+1g.v};m 1a(y){C y-17.l+1g.l};m 1z(3J){C 3J.4L-1g.v};m 1y(3I){C 3I.4K-1g.l};m 13(32){18 1i=32||1t,1h=32||1s;C{a:u(f.a*1i),b:u(f.b*1h),j:u(f.j*1i),g:u(f.g*1h),H:u(f.j*1i)-u(f.a*1i),L:u(f.g*1h)-u(f.b*1h)}};m 23(a,b,j,g,31){18 1i=31||1t,1h=31||1s;f={a:u(a/1i||0),b:u(b/1h||0),j:u(j/1i||0),g:u(g/1h||0)};f.H=f.j-f.a;f.L=f.g-f.b};m 1f(){9(!1F||!O.H()){C}17={v:u(O.2t().v),l:u(O.2t().l)};Q=O.2Y();M=O.3H();17.l+=(O.30()-M)>>1;17.v+=(O.2q()-Q)>>1;1B=u(c.4J/1t)||0;1A=u(c.4I/1s)||0;2o=u(F(c.4H/1t||1<<24,Q));2n=u(F(c.4G/1s||1<<24,M));9($().4F=="1.3.2"&&1J=="21"&&!2u["4E"]){17.l+=D(R.1q.2r,2u.2r);17.v+=D(R.1q.2s,2u.2s)}1g=/1H|4D/.1c(1l.q("1p"))?{v:u(1l.2t().v)-1l.2s(),l:u(1l.2t().l)-1l.2r()}:1J=="21"?{v:$(R).2s(),l:$(R).2r()}:{v:0,l:0};G=1n(0);l=1m(0);9(f.j>Q||f.g>M){1U()}};m 1V(3F){9(!1Q){C}A.q({v:1n(f.a),l:1m(f.b)}).r(1k).H(w=f.H).L(h=f.L);1k.r(I).r(E).q({v:0,l:0});I.H(D(w-I.2q()+I.2Y(),0)).L(D(h-I.30()+I.3H(),0));$(B[0]).q({v:G,l:l,H:f.a,L:M});$(B[1]).q({v:G+f.a,l:l,H:w,L:f.b});$(B[2]).q({v:G+f.j,l:l,H:Q-f.j,L:M});$(B[3]).q({v:G+f.a,l:l+f.g,H:w,L:M-f.g});w-=E.2q();h-=E.30();2O(E.3f){15 8:$(E[4]).q({v:w>>1});$(E[5]).q({v:w,l:h>>1});$(E[6]).q({v:w>>1,l:h});$(E[7]).q({l:h>>1});15 4:E.3G(1,3).q({v:w});E.3G(2,4).q({l:h})}9(3F!==Y){9($.N.2Z!=2R){$(R).U($.N.2z,$.N.2Z)}9(c.1T){$(R)[$.N.2z]($.N.2Z=2R)}}9(1j&&I.2q()-I.2Y()==2){I.q("3E",0);3x(m(){I.q("3E","4C")},0)}};m 22(3D){1f();1V(3D);a=1n(f.a);b=1m(f.b);j=1n(f.j);g=1m(f.g)};m 27(2X,2w){c.1P?2X.4B(c.1P,2w):2X.1r()};m 1d(2W){18 x=1b(1z(2W))-f.a,y=1a(1y(2W))-f.b;9(!2p){1f();2p=11;A.1G("4A",m(){2p=Y})}S="";9(c.2D){9(y<=c.1W){S="n"}X{9(y>=f.L-c.1W){S="s"}}9(x<=c.1W){S+="w"}X{9(x>=f.H-c.1W){S+="e"}}}A.q("2V",S?S+"-19":c.26?"4z":"");9(1K){1K.4y()}};m 2S(4x){$("1q").q("2V","");9(c.4w||f.H*f.L==0){27(A.r(B),m(){$(J).1r()})}$(R).U("P",2l);A.P(1d);c.2f(T,13())};m 2C(1X){9(1X.3z!=1){C Y}1f();9(S){$("1q").q("2V",S+"-19");a=1n(f[/w/.1c(S)?"j":"a"]);b=1m(f[/n/.1c(S)?"g":"b"]);$(R).P(2l).1G("1x",2S);A.U("P",1d)}X{9(c.26){2k=G+f.a-1z(1X);2j=l+f.b-1y(1X);A.U("P",1d);$(R).P(2T).1G("1x",m(){c.2f(T,13());$(R).U("P",2T);A.P(1d)})}X{O.1O(1X)}}C Y};m 1w(3C){9(14){9(3C){j=D(G,F(G+Q,a+W(g-b)*14*(j>a||-1)));g=u(D(l,F(l+M,b+W(j-a)/14*(g>b||-1))));j=u(j)}X{g=D(l,F(l+M,b+W(j-a)/14*(g>b||-1)));j=u(D(G,F(G+Q,a+W(g-b)*14*(j>a||-1))));g=u(g)}}};m 1U(){a=F(a,G+Q);b=F(b,l+M);9(W(j-a)<1B){j=a-1B*(j<a||-1);9(j<G){a=G+1B}X{9(j>G+Q){a=G+Q-1B}}}9(W(g-b)<1A){g=b-1A*(g<b||-1);9(g<l){b=l+1A}X{9(g>l+M){b=l+M-1A}}}j=D(G,F(j,G+Q));g=D(l,F(g,l+M));1w(W(j-a)<W(g-b)*14);9(W(j-a)>2o){j=a-2o*(j<a||-1);1w()}9(W(g-b)>2n){g=b-2n*(g<b||-1);1w(11)}f={a:1b(F(a,j)),j:1b(D(a,j)),b:1a(F(b,g)),g:1a(D(b,g)),H:W(j-a),L:W(g-b)};1V();c.2g(T,13())};m 2l(2U){j=/w|e|^$/.1c(S)||14?1z(2U):1n(f.j);g=/n|s|^$/.1c(S)||14?1y(2U):1m(f.g);1U();C Y};m 1v(3B,3A){j=(a=3B)+f.H;g=(b=3A)+f.L;$.2c(f,{a:1b(a),b:1a(b),j:1b(j),g:1a(g)});1V();c.2g(T,13())};m 2T(2m){a=D(G,F(2k+1z(2m),G+Q-f.H));b=D(l,F(2j+1y(2m),l+M-f.L));1v(a,b);2m.4v();C Y};m 2h(){$(R).U("P",2h);1f();j=a;g=b;1U();S="";9(!B.2y(":4u")){A.r(B).1r().2E(c.1P||0)}1Q=11;$(R).U("1x",1N).P(2l).1G("1x",2S);A.U("P",1d);c.3y(T,13())};m 1N(){$(R).U("P",2h).U("1x",1N);27(A.r(B));23(1b(a),1a(b),1b(a),1a(b));9(!(J 4t $.N)){c.2g(T,13());c.2f(T,13())}};m 2A(2i){9(2i.3z!=1||B.2y(":4s")){C Y}1f();2k=a=1z(2i);2j=b=1y(2i);$(R).P(2h).1x(1N);C Y};m 2B(){22(Y)};m 2x(){1F=11;25(c=$.2c({1S:"4r",26:11,20:"1q",2D:11,1W:10,3w:m(){},3y:m(){},2g:m(){},2f:m(){}},c));A.r(B).q({3b:""});9(c.2F){1Q=11;1f();1V();A.r(B).1r().2E(c.1P||0)}3x(m(){c.3w(T,13())},0)};18 2R=m(16){18 k=c.1T,d,t,2N=16.4q;d=!1L(k.2P)&&(16.2e||16.3t.2e)?k.2P:!1L(k.2a)&&16.3u?k.2a:!1L(k.2b)&&16.3v?k.2b:!1L(k.2Q)?k.2Q:10;9(k.2Q=="19"||(k.2b=="19"&&16.3v)||(k.2a=="19"&&16.3u)||(k.2P=="19"&&(16.2e||16.3t.2e))){2O(2N){15 37:d=-d;15 39:t=D(a,j);a=F(a,j);j=D(t+d,a);1w();1u;15 38:d=-d;15 40:t=D(b,g);b=F(b,g);g=D(t+d,b);1w(11);1u;3s:C}1U()}X{a=F(a,j);b=F(b,g);2O(2N){15 37:1v(D(a-d,G),b);1u;15 38:1v(a,D(b-d,l));1u;15 39:1v(a+F(d,Q-1b(j)),b);1u;15 40:1v(a,b+F(d,M-1a(g)));1u;3s:C}}C Y};m 1R(3r,2M){3p(18 2d 4p 2M){9(c[2d]!==1Y){3r.q(2M[2d],c[2d])}}};m 25(K){9(K.20){(1l=$(K.20)).2G(A.r(B))}$.2c(c,K);1f();9(K.2L!=3q){E.1o();E=$([]);i=K.2L?K.2L=="4o"?4:8:0;3g(i--){E=E.r(V())}E.29(c.1S+"-4n").q({1p:"1H",36:0,1I:12+1||1});9(!4m(E.q("H"))>=0){E.H(5).L(5)}9(o=c.2K){E.q({2K:o,2H:"3m"})}1R(E,{3n:"2J-28",3l:"2I-28",3o:"1e"})}1t=c.4l/Q||1;1s=c.4k/M||1;9(K.a!=3q){23(K.a,K.b,K.j,K.g);K.2F=!K.1r}9(K.1T){c.1T=$.2c({2b:1,2a:"19"},K.1T)}B.29(c.1S+"-4j");1k.29(c.1S+"-4i");3p(i=0;i++<4;){$(I[i-1]).29(c.1S+"-2J"+i)}1R(1k,{4h:"2I-28",4g:"1e"});1R(I,{3o:"1e",2K:"2J-H"});1R(B,{4f:"2I-28",4e:"1e"});9(o=c.3n){$(I[0]).q({2H:"3m",3k:o})}9(o=c.3l){$(I[1]).q({2H:"4d",3k:o})}A.2G(1k.r(I).r(1K)).2G(E);9(1j){9(o=(B.q("3j")||"").3i(/1e=(\\d+)/)){B.q("1e",o[1]/1Z)}9(o=(I.q("3j")||"").3i(/1e=(\\d+)/)){I.q("1e",o[1]/1Z)}}9(K.1r){27(A.r(B))}X{9(K.2F&&1F){1Q=11;A.r(B).2E(c.1P||0);22()}}14=(d=(c.4c||"").4b(/:/))[0]/d[1];O.r(B).U("1O",2A);9(c.1E||c.1D===Y){A.U("P",1d).U("1O",2C);$(3h).U("19",2B)}X{9(c.1D||c.1E===Y){9(c.2D||c.26){A.P(1d).1O(2C)}$(3h).19(2B)}9(!c.4a){O.r(B).1O(2A)}}c.1D=c.1E=1Y};J.1o=m(){25({1E:11});A.r(B).1o()};J.49=m(){C c};J.33=25;J.48=13;J.47=23;J.46=1N;J.45=22;18 1j=(/44 ([\\w.]+)/i.43(1M)||[])[1],3c=/42/i.1c(1M),3d=/41/i.1c(1M)&&!/3Z/i.1c(1M);$p=O;3g($p.3f){12=D(12,!1L($p.q("z-3e"))?$p.q("z-3e"):12);9($p.q("1p")=="21"){1J="21"}$p=$p.20(":3Y(1q)")}12=c.1I||12;9(1j){O.3X("3W","3V")}$.N.2z=1j||3d?"3U":"3T";9(3c){1K=V().q({H:"1Z%",L:"1Z%",1p:"1H",1I:12+2||2})}A.r(B).q({3b:"3a",1p:1J,3S:"3a",1I:12||"0"});A.q({1I:12+2||2});1k.r(I).q({1p:"1H",36:0});T.35||T.3R=="35"||!O.2y("3Q")?2x():O.1G("3P",2x);9(!1F&&1j&&1j>=7){T.34=T.34}};$.2w.N=m(Z){Z=Z||{};J.3O(m(){9($(J).1C("N")){9(Z.1o){$(J).1C("N").1o();$(J).3N("N")}X{$(J).1C("N").33(Z)}}X{9(!Z.1o){9(Z.1D===1Y&&Z.1E===1Y){Z.1D=11}$(J).1C("N",3M $.N(J,Z))}}});9(Z.3L){C $(J).1C("N")}C J}})(3K);',62,304,'|||||||||if|x1|y1|_7|||_23|y2|||x2||top|function||||css|add|||_4|left|||||_a|_d|return|_2|_e|_3|_10|width|_c|this|_55|height|_13|imgAreaSelect|_8|mousemove|_12|document|_1c|_6|unbind|_5|_1|else|false|_58||true|_16|_2c|_21|case|_50|_11|var|resize|_29|_28|test|_3a|opacity|_30|_15|sy|sx|_35|_b|_14|_27|_26|remove|position|body|hide|_1b|_1a|break|_45|_42|mouseup|evY|evX|_1e|_1d|data|enable|disable|_9|one|absolute|zIndex|_17|_f|isNaN|ua|_4a|mousedown|fadeSpeed|_22|_51|classPrefix|keys|_31|_32|resizeMargin|_40|undefined|100|parent|fixed|_36|_2e||_4f|movable|_38|color|addClass|ctrl|shift|extend|_54|altKey|onSelectEnd|onSelectChange|_49|_4c|_19|_18|_3e|_48|_20|_1f|_25|outerWidth|scrollTop|scrollLeft|offset|_24|Math|fn|_4e|is|keyPress|_4b|_4d|_3f|resizable|fadeIn|show|append|borderStyle|background|border|borderWidth|handles|_53|key|switch|alt|arrows|_34|_3c|_41|_44|cursor|_3b|_39|innerWidth|onKeyPress|outerHeight|_2f|_2d|setOptions|src|complete|fontSize||||hidden|visibility|_56|_57|index|length|while|window|match|filter|borderColor|borderColor2|solid|borderColor1|borderOpacity|for|null|_52|default|originalEvent|ctrlKey|shiftKey|onInit|setTimeout|onSelectStart|which|_47|_46|_43|_37|margin|_33|slice|innerHeight|_2b|_2a|jQuery|instance|new|removeData|each|load|img|readyState|overflow|keypress|keydown|on|unselectable|attr|not|chrome||webkit|opera|exec|msie|update|cancelSelection|setSelection|getSelection|getOptions|persistent|split|aspectRatio|dashed|outerOpacity|outerColor|selectionOpacity|selectionColor|selection|outer|imageHeight|imageWidth|parseInt|handle|corners|in|keyCode|imgareaselect|animated|instanceof|visible|preventDefault|autoHide|_3d|toggle|move|mouseout|fadeOut|auto|relative|getBoundingClientRect|jquery|maxHeight|maxWidth|minHeight|minWidth|pageY|pageX|userAgent|navigator|documentElement|div|round|min|max|abs'.split('|')))
skin/adminhtml/default/default/elogic/slider/js/slider-form.js ADDED
@@ -0,0 +1,362 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($, win) {
2
+ var adjustment;
3
+ var sliderForm = function() {
4
+ this.init();
5
+ };
6
+
7
+ sliderForm.prototype = {
8
+ constructor: sliderForm,
9
+ init: function(){
10
+ this.urls = win.urls || {};
11
+ this.maxSlides = 5;
12
+ this.slidesListContainer = $("ul#slides-list");
13
+ this.slidesContainer = $('ul#slides');
14
+ this.activeSlideId = null;
15
+ this.selection = null;
16
+
17
+ this.initEvents();
18
+ },
19
+ initEvents: function(){
20
+ var me = this;
21
+ $('body')
22
+ .on('click','.slider-container .add-new-slide',function () {
23
+ var items = $('ul.slides-list li');
24
+
25
+ if(typeof items == 'undefined' || (items.length < me.maxSlides)){
26
+ Element.show('loading-mask');
27
+ me.sendAjax(me.urls.addSlide,{},me.addForm);
28
+ }else{
29
+ alert('Maximum ' + me.maxSlides + ' slides');
30
+ }
31
+ })
32
+ .on('click','.slider-container .slides-list li',function () {
33
+ var id = $(this).attr('id');
34
+
35
+ if(me.selection) {
36
+ me.selection.cancelSelection();
37
+ }
38
+
39
+ me.activeSlideId = id;
40
+ $(this).addClass('active').siblings().removeClass('active');
41
+ $('.slider-container .slides li#slide-' + id).show().siblings().hide();
42
+ })
43
+ .on('click','.slider-container .slides-list li i.icon-delete',function () {
44
+ var parent = $(this).closest('li'),id = parent.attr('id');
45
+
46
+ parent.remove();
47
+ $('.slider-container .slides li#slide-' + id).remove();
48
+ delete sliderConfig.slides[id];
49
+ sliderConfig.slides.length = --sliderConfig.slides.length;
50
+
51
+ if(parent.hasClass('active')){
52
+ me.initFirst();
53
+ }
54
+ })
55
+ .on('change','input[name=image]',function(){
56
+ var form = $(this).closest('form');
57
+
58
+ form.ajaxSubmit({
59
+ url: me.urls.thumbnailImage,
60
+ data: {format: 'json'},
61
+ type: 'post',
62
+ dataType: 'json',
63
+ mask: true,
64
+ beforeSubmit: function () {
65
+ Element.show('loading-mask');
66
+ //var validator = form.validate();
67
+ //if (!validator.element("input[type=file]")) {
68
+ // alert('Allowed formats: jpeg, jpg, png');
69
+ // return false;
70
+ //}
71
+ },
72
+ success: function (response) {
73
+ Element.hide('loading-mask');
74
+
75
+ if (response && response.success && response.path) {
76
+ var blockImg = form.find('.slide-image'),img = blockImg.find('img');
77
+ img.attr('src', response.path);
78
+ sliderConfig.slides[me.activeSlideId]['image'] = response.path;
79
+ }
80
+ }
81
+ });
82
+
83
+ return false;
84
+ })
85
+ .on('change','input[name=title]',function(){
86
+ sliderConfig.slides[me.activeSlideId]['title'] = $(this).val();
87
+ })
88
+ .on('submit','form.form-blocks',function(){
89
+ var form = $(this),parent = form.closest('li'),id = me.activeSlideId;
90
+
91
+ if(me.selection) {
92
+ me.selection.cancelSelection();
93
+ }
94
+ var imgWidth = $('.slide-image',parent).width();
95
+ var imgHeight = $('.slide-image',parent).height();
96
+
97
+ var selectX1 = parseInt($('input[name="x1"]',parent).val());
98
+ var selectY1 = parseInt($('input[name="y1"]',parent).val());
99
+ var selectWidth = parseInt($('input[name="width"]',parent).val());
100
+ var selectHeight = parseInt($('input[name="height"]',parent).val());
101
+ var productLink = $('input[name="product-link"]',form).val();
102
+ var productName = $('input[name="product-name"]',form).val();
103
+
104
+ if (!selectX1 || !selectY1 || !selectWidth || !selectHeight || !productLink || !productName) {
105
+ console.log('You\'ve missed some data');
106
+ return false;
107
+ }
108
+
109
+ $('input',form).val('');
110
+
111
+ var X1 = (selectX1 / imgWidth);
112
+ var Y1 = (selectY1 / imgHeight);
113
+ var width = (selectWidth / imgWidth);
114
+ var height = (selectHeight / imgHeight);
115
+
116
+ function Element(x1, y1, width, height, url, name) {
117
+ this.x1 = x1,
118
+ this.y1 = y1,
119
+ this.width = width,
120
+ this.height = height,
121
+ this.url = url,
122
+ this.name = name
123
+ }
124
+
125
+ var item = new Element(X1, Y1, width, height, productLink, productName);
126
+
127
+ if(typeof sliderConfig.slides[id]['blocks'] === 'undefined' ){
128
+ sliderConfig.slides[id]['blocks'] = [];
129
+ }
130
+ sliderConfig.slides[id]['blocks'].push(item);
131
+ var blocks = sliderConfig.slides[id]['blocks'],
132
+ index = $('.el_beatles',parent).size();
133
+
134
+ $('.wrapper .blocks',parent).append('<a class="el_beatles el_'+ index +'"><span>');
135
+ $('.wrapper .blocks',parent).append('<div class="el el_' + index + '_info"><p class="el_titles el_title_' + index +'">');
136
+ $('.wrapper .el_' + index + '_info',parent).append('<button class="delete_item delete_el_' + index + '">Delete</button>');
137
+
138
+ blocks.forEach(function(item, i) {
139
+ $('.el_' + i,parent).css({
140
+ 'left' : parseInt(imgWidth * item.x1),
141
+ 'top' : parseInt(imgHeight * item.y1),
142
+ 'width' : parseInt(imgWidth * item.width),
143
+ 'height' : parseInt(imgHeight * item.height)
144
+ }).attr('href', item.url);
145
+ $('.el_' + i + ' span',parent).text(item.name);
146
+ $('.el_title_' + i,parent).text(item.name + ' [' + item.url + ']');
147
+ });
148
+ return false;
149
+ })
150
+ .on('click', '.delete_item' ,function() {
151
+ var item = $(this).parent().prev()[0].innerText,id = me.activeSlideId,
152
+ blocks = sliderConfig.slides[id]['blocks'];
153
+ $(this).parent().prev().remove();
154
+ $(this).parent().remove();
155
+
156
+ blocks.forEach(function(element, i) {
157
+ if ( element.name == item) {
158
+ blocks.splice(i, 1);
159
+ }
160
+ });
161
+ return false;
162
+ })
163
+ .on('click','.save-slider',function() {
164
+ var validator = new Validation(editForm.formId),
165
+ form = $('#' + editForm.formId);
166
+
167
+ if(validator && validator.validate()){
168
+ var data = {};
169
+ form.serializeArray().map(function(x){
170
+ data[x.name] = x.value;
171
+ });
172
+
173
+ data['slides'] = [];
174
+
175
+ for(var key in sliderConfig.slides){
176
+ if(typeof sliderConfig.slides[key] == 'object'){
177
+ var slide = [];
178
+ if(typeof sliderConfig.slides[key]['id'] != 'undefined'){
179
+ slide.push({'id':sliderConfig.slides[key]['id']})
180
+ }
181
+
182
+ if(typeof sliderConfig.slides[key]['title'] != 'undefined'){
183
+ slide.push({'title':sliderConfig.slides[key]['title']})
184
+ }
185
+
186
+ if(typeof sliderConfig.slides[key]['image'] != 'undefined'){
187
+ slide.push({'image':sliderConfig.slides[key]['image']})
188
+ }
189
+
190
+ if(typeof sliderConfig.slides[key]['position'] != 'undefined'){
191
+ slide.push({'position':sliderConfig.slides[key]['position']})
192
+ }
193
+
194
+ if(typeof sliderConfig.slides[key]['blocks'] != 'undefined'){
195
+ slide.push({'blocks':sliderConfig.slides[key]['blocks']})
196
+ }
197
+
198
+ data['slides'].push(slide);
199
+ }
200
+ }
201
+
202
+ Element.show('loading-mask');
203
+ me.sendAjax(me.urls.saveSlider,data);
204
+ }
205
+ return false;
206
+ })
207
+ .on('click','.slide-image a',function(){
208
+ return false;
209
+ })
210
+ ;
211
+ me.slidesListContainer.on('updateOrder',function(){
212
+ $('li',me.slidesListContainer).each(function(){
213
+ var id = $(this).attr('id'),pos = $(this).index();
214
+ $('.slider-container .slides li#slide-' + id).find('input[name=position]').val(pos);
215
+ sliderConfig.slides[id]['position'] = pos;
216
+ });
217
+ });
218
+
219
+ $.when(me.initParams()).done(function(){
220
+ me.initFirst();
221
+ });
222
+ },
223
+ sendAjax: function(url,data,callback,parent){
224
+ var me = this;
225
+ $.ajax({
226
+ url: url,
227
+ type:"POST",
228
+ data: data,
229
+ dataType: 'json'
230
+ }).done(function(resp) {
231
+ Element.hide('loading-mask');
232
+
233
+ if(resp.message){
234
+ alert(resp.message);
235
+ }
236
+
237
+ if(resp && resp.success){
238
+ if(typeof callback == 'function'){
239
+ callback.call(me,resp,parent);
240
+ }
241
+
242
+ if(resp.redirect){
243
+ setTimeout(function(){window.location.href = resp.redirect},500);
244
+ }
245
+ }
246
+ }) .fail(function( jqXHR, textStatus, errorThrown) {
247
+ Element.hide('loading-mask');
248
+ }).always(function() {
249
+ Element.hide('loading-mask');
250
+ });
251
+ },
252
+ initFirst: function()
253
+ {
254
+ var first = $('li:first-child',this.slidesListContainer);
255
+ if(first){
256
+ first.trigger('click');
257
+ }
258
+ },
259
+ addForm: function(resp){
260
+ this.slidesListContainer.append(resp.row);
261
+ this.slidesContainer.append(resp.html);
262
+
263
+ var newSlide = $('li:last-child',this.slidesContainer),idVal = newSlide.find('[name=uniqid]').val();
264
+
265
+ sliderConfig.slides[idVal] = [];
266
+ sliderConfig.slides.length = ++sliderConfig.slides.length;
267
+ $('li:last-child',this.slidesListContainer).trigger('click');
268
+
269
+ var slideImage = $('img.slide-image',newSlide);
270
+
271
+ this.selection = slideImage.imgAreaSelect({instance: true});
272
+
273
+ slideImage.imgAreaSelect({
274
+ handles: true,
275
+ movable: true,
276
+ onSelectEnd: function (img, selection) {
277
+ $('input[name="x1"]',newSlide).val(selection.x1);
278
+ $('input[name="y1"]',newSlide).val(selection.y1);
279
+ $('input[name="width"]',newSlide).val(selection.width);
280
+ $('input[name="height"]',newSlide).val(selection.height);
281
+ }
282
+ });
283
+ this.slidesListContainer.trigger("updateOrder");
284
+ },
285
+ initParams: function(){
286
+ var me = this;
287
+
288
+ $('.sortable').sortable({
289
+ handle: 'i.icon-move',
290
+ onDrop: function ($item, container, _super) {
291
+ var $clonedItem = $('<li/>').css({height: 10});
292
+ $item.before($clonedItem);
293
+ $clonedItem.animate({'height': $item.height()});
294
+
295
+ $item.animate($clonedItem.position(), function () {
296
+ $clonedItem.detach();
297
+ _super($item, container);
298
+ });
299
+ setTimeout(function(){$("ul#slides-list").trigger("updateOrder")},1000);
300
+ },
301
+ onDragStart: function ($item, container, _super) {
302
+ var offset = $item.offset(),
303
+ pointer = container.rootGroup.pointer;
304
+ adjustment = {
305
+ left: pointer.left - offset.left,
306
+ top: pointer.top - offset.top
307
+ };
308
+ _super($item, container);
309
+ },
310
+ onDrag: function ($item, position) {
311
+ $item.css({
312
+ left: position.left - adjustment.left,
313
+ top: position.top - adjustment.top
314
+ });
315
+ }
316
+ });
317
+
318
+ if(sliderConfig['slides']){
319
+ $.each(sliderConfig['slides'],function(index, value){
320
+ var container = me.slidesContainer.find('li#slide-' + value['id']);
321
+
322
+ container.show();
323
+
324
+ var img = container.find('.slide-image img'),
325
+ imgWidth = img.width(),imgHeight = img.height();
326
+
327
+ img.imgAreaSelect({
328
+ handles: true,
329
+ movable: true,
330
+ onSelectEnd: function (img, selection) {
331
+ $('input[name="x1"]',container).val(selection.x1);
332
+ $('input[name="y1"]',container).val(selection.y1);
333
+ $('input[name="width"]',container).val(selection.width);
334
+ $('input[name="height"]',container).val(selection.height);
335
+ }
336
+ });
337
+ container.hide();
338
+
339
+ if(value['blocks']){
340
+ $('.wrapper .blocks',container).html('');
341
+ value['blocks'].forEach(function(item, i) {
342
+ $('.wrapper .blocks',container).append('<a class="el_beatles el_'+ i +'"><span>');
343
+ $('.wrapper .blocks',container).append('<div class="el el_' + i + '_info"><p class="el_titles el_title_' + i +'">');
344
+ $('.wrapper .blocks .el_' + i + '_info',container).append('<button class="delete_item delete_el_' + i + '">Delete</button>');
345
+ $('.el_' + i,container).css({
346
+ 'left': parseInt(imgWidth * item.x1),
347
+ 'top': parseInt(imgHeight * item.y1),
348
+ 'width': parseInt(imgWidth * item.width),
349
+ 'height': parseInt(imgHeight * item.height)
350
+ }).attr('href', item.url);
351
+ $('.el_' + i + ' span',container).text(item.name);
352
+ $('.el_title_' + i,container).text(item.name + ' [' + item.url + ']');
353
+ });
354
+ }
355
+ });
356
+ }
357
+ }
358
+ };
359
+ $(function() {
360
+ window.sliderForm = new sliderForm();
361
+ })
362
+ })(jQuery, window);
skin/frontend/base/default/elogic/slider/css/flexslider.css ADDED
@@ -0,0 +1,275 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery FlexSlider v2.6.0
3
+ * http://www.woothemes.com/flexslider/
4
+ *
5
+ * Copyright 2012 WooThemes
6
+ * Free to use under the GPLv2 and later license.
7
+ * http://www.gnu.org/licenses/gpl-2.0.html
8
+ *
9
+ * Contributing author: Tyler Smith (@mbmufffin)
10
+ *
11
+ */
12
+ /* ====================================================================================================================
13
+ * FONT-FACE
14
+ * ====================================================================================================================*/
15
+ @font-face {
16
+ font-family: 'flexslider-icon';
17
+ src: url('../fonts/flexslider-icon.eot');
18
+ src: url('../fonts/flexslider-icon.eot?#iefix') format('embedded-opentype'), url('../fonts/flexslider-icon.woff') format('woff'), url('../fonts/flexslider-icon.ttf') format('truetype'), url('../fonts/flexslider-icon.svg#flexslider-icon') format('svg');
19
+ font-weight: normal;
20
+ font-style: normal;
21
+ }
22
+ /* ====================================================================================================================
23
+ * RESETS
24
+ * ====================================================================================================================*/
25
+ .flex-container a:hover,
26
+ .flex-slider a:hover {
27
+ outline: none;
28
+ }
29
+ .slides,
30
+ .slides > li,
31
+ .flex-control-nav,
32
+ .flex-direction-nav {
33
+ margin: 0;
34
+ padding: 0;
35
+ list-style: none;
36
+ }
37
+ .flex-pauseplay span {
38
+ text-transform: capitalize;
39
+ }
40
+ /* ====================================================================================================================
41
+ * BASE STYLES
42
+ * ====================================================================================================================*/
43
+ .flexslider {
44
+ margin: 0;
45
+ padding: 0;
46
+ }
47
+ .flexslider .slides > li {
48
+ display: none;
49
+ -webkit-backface-visibility: hidden;
50
+ }
51
+ .flexslider .slides img {
52
+ width: 100%;
53
+ display: block;
54
+ }
55
+ .flexslider .slides:after {
56
+ content: "\0020";
57
+ display: block;
58
+ clear: both;
59
+ visibility: hidden;
60
+ line-height: 0;
61
+ height: 0;
62
+ }
63
+ html[xmlns] .flexslider .slides {
64
+ display: block;
65
+ }
66
+ * html .flexslider .slides {
67
+ height: 1%;
68
+ }
69
+ .no-js .flexslider .slides > li:first-child {
70
+ display: block;
71
+ }
72
+ /* ====================================================================================================================
73
+ * DEFAULT THEME
74
+ * ====================================================================================================================*/
75
+ .flexslider {
76
+ margin-bottom: 60px;
77
+ background: #ffffff;
78
+ position: relative;
79
+ zoom: 1;
80
+ -webkit-border-radius: 4px;
81
+ -moz-border-radius: 4px;
82
+ border-radius: 4px;
83
+ -webkit-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
84
+ -moz-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
85
+ -o-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
86
+ box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
87
+ }
88
+ .flexslider .slides {
89
+ zoom: 1;
90
+ }
91
+ .flexslider .slides img {
92
+ height: auto;
93
+ -moz-user-select: none;
94
+ }
95
+ .flex-viewport {
96
+ max-height: 2000px;
97
+ -webkit-transition: all 1s ease;
98
+ -moz-transition: all 1s ease;
99
+ -ms-transition: all 1s ease;
100
+ -o-transition: all 1s ease;
101
+ transition: all 1s ease;
102
+ }
103
+ .loading .flex-viewport {
104
+ max-height: 300px;
105
+ }
106
+ .carousel li {
107
+ margin-right: 5px;
108
+ }
109
+ .flex-direction-nav {
110
+ *height: 0;
111
+ }
112
+ .flex-direction-nav a {
113
+ text-decoration: none;
114
+ display: block;
115
+ width: 40px;
116
+ height: 50px;
117
+ margin: -20px 0 0;
118
+ position: absolute;
119
+ top: 50%;
120
+ z-index: 10;
121
+ overflow: hidden;
122
+ opacity: 0;
123
+ cursor: pointer;
124
+ color: rgba(0, 0, 0, 0.8);
125
+ text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
126
+ -webkit-transition: all 0.3s ease-in-out;
127
+ -moz-transition: all 0.3s ease-in-out;
128
+ -ms-transition: all 0.3s ease-in-out;
129
+ -o-transition: all 0.3s ease-in-out;
130
+ transition: all 0.3s ease-in-out;
131
+ }
132
+ .flex-direction-nav a:before {
133
+ font-family: "flexslider-icon";
134
+ font-size: 40px;
135
+ display: inline-block;
136
+ content: '\f001';
137
+ color: rgb(16, 15, 15);
138
+ text-shadow: 1px 1px 0 rgb(16, 15, 15);
139
+ }
140
+ .flex-direction-nav a.flex-next:before {
141
+ content: '\f002';
142
+ }
143
+ .flex-direction-nav .flex-prev {
144
+ left: -50px;
145
+ }
146
+ .flex-direction-nav .flex-next {
147
+ right: -50px;
148
+ text-align: right;
149
+ }
150
+ .flexslider:hover .flex-direction-nav .flex-prev {
151
+ opacity: 0.7;
152
+ left: 10px;
153
+ }
154
+ .flexslider:hover .flex-direction-nav .flex-prev:hover {
155
+ opacity: 1;
156
+ }
157
+ .flexslider:hover .flex-direction-nav .flex-next {
158
+ opacity: 0.7;
159
+ right: 10px;
160
+ }
161
+ .flexslider:hover .flex-direction-nav .flex-next:hover {
162
+ opacity: 1;
163
+ }
164
+ .flex-direction-nav .flex-disabled {
165
+ opacity: 0!important;
166
+ filter: alpha(opacity=0);
167
+ cursor: default;
168
+ z-index: -1;
169
+ }
170
+ .flex-pauseplay a {
171
+ display: block;
172
+ width: 20px;
173
+ height: 20px;
174
+ position: absolute;
175
+ bottom: 5px;
176
+ left: 10px;
177
+ opacity: 0.8;
178
+ z-index: 10;
179
+ overflow: hidden;
180
+ cursor: pointer;
181
+ color: #000;
182
+ }
183
+ .flex-pauseplay a:before {
184
+ font-family: "flexslider-icon";
185
+ font-size: 20px;
186
+ display: inline-block;
187
+ content: '\f004';
188
+ }
189
+ .flex-pauseplay a:hover {
190
+ opacity: 1;
191
+ }
192
+ .flex-pauseplay a.flex-play:before {
193
+ content: '\f003';
194
+ }
195
+ .flex-control-nav {
196
+ width: 100%;
197
+ position: absolute;
198
+ bottom: -40px;
199
+ text-align: center;
200
+ }
201
+ .flex-control-nav li {
202
+ margin: 0 6px;
203
+ display: inline-block;
204
+ zoom: 1;
205
+ *display: inline;
206
+ }
207
+ .flex-control-paging li a {
208
+ width: 11px;
209
+ height: 11px;
210
+ display: block;
211
+ background: #666;
212
+ background: rgba(0, 0, 0, 0.5);
213
+ cursor: pointer;
214
+ text-indent: -9999px;
215
+ -webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
216
+ -moz-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
217
+ -o-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
218
+ box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
219
+ -webkit-border-radius: 20px;
220
+ -moz-border-radius: 20px;
221
+ border-radius: 20px;
222
+ }
223
+ .flex-control-paging li a:hover {
224
+ background: #333;
225
+ background: rgba(0, 0, 0, 0.7);
226
+ }
227
+ .flex-control-paging li a.flex-active {
228
+ background: #000;
229
+ background: rgba(0, 0, 0, 0.9);
230
+ cursor: default;
231
+ }
232
+ .flex-control-thumbs {
233
+ margin: 5px 0 0;
234
+ position: static;
235
+ overflow: hidden;
236
+ }
237
+ .flex-control-thumbs li {
238
+ width: 25%;
239
+ float: left;
240
+ margin: 0;
241
+ }
242
+ .flex-control-thumbs img {
243
+ width: 100%;
244
+ height: auto;
245
+ display: block;
246
+ opacity: .7;
247
+ cursor: pointer;
248
+ -moz-user-select: none;
249
+ -webkit-transition: all 1s ease;
250
+ -moz-transition: all 1s ease;
251
+ -ms-transition: all 1s ease;
252
+ -o-transition: all 1s ease;
253
+ transition: all 1s ease;
254
+ }
255
+ .flex-control-thumbs img:hover {
256
+ opacity: 1;
257
+ }
258
+ .flex-control-thumbs .flex-active {
259
+ opacity: 1;
260
+ cursor: default;
261
+ }
262
+
263
+ /* ====================================================================================================================
264
+ * RESPONSIVE
265
+ * ====================================================================================================================*/
266
+ @media screen and (max-width: 860px) {
267
+ .flex-direction-nav .flex-prev {
268
+ opacity: 1;
269
+ left: 10px;
270
+ }
271
+ .flex-direction-nav .flex-next {
272
+ opacity: 1;
273
+ right: 10px;
274
+ }
275
+ }
skin/frontend/base/default/elogic/slider/css/slider.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .flexslider .slides li {
2
+ position: relative;
3
+ }
4
+ .flexslider .el_beatles {
5
+ position: absolute;
6
+ border: 3px solid rgba(255,255,255,0);
7
+ }
8
+ .slide-image {
9
+ width: 100%;
10
+ overflow: hidden;
11
+ }
12
+
13
+ .tooltip {
14
+ position:absolute;
15
+ border:1px solid black;
16
+ background-color:#fff;
17
+ border-radius:3px;
18
+ padding: 4px 15px;
19
+ color:black;
20
+ font-size: 16px;
21
+ opacity: 1;
22
+ }
skin/frontend/base/default/elogic/slider/fonts/flexslider-icon.eot ADDED
Binary file
skin/frontend/base/default/elogic/slider/fonts/flexslider-icon.svg ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>
5
+ This is a custom SVG font generated by IcoMoon.
6
+ <iconset grid="14"></iconset>
7
+ </metadata>
8
+ <defs>
9
+ <font id="flexslider-icon" horiz-adv-x="448" >
10
+ <font-face units-per-em="448" ascent="384" descent="-64" />
11
+ <missing-glyph horiz-adv-x="448" />
12
+ <glyph unicode="&#xf001;" d="M 185.50-9.25l-163.00,162.75q-9.25,9.25 -9.25,22.625t 9.25,22.625l 163.00,162.75q 9.25,9.25 22.625,9.25t 22.625-9.25l 18.75-18.75q 9.25-9.25 9.25-22.625t-9.25-22.625l-121.50-121.50l 121.50-121.25q 9.25-9.50 9.25-22.75t-9.25-22.50l-18.75-18.75q-9.25-9.25 -22.625-9.25t-22.625,9.25z" horiz-adv-x="288" />
13
+ <glyph unicode="&#xf002;" d="M 274.75,176.00q0.00-13.00 -9.25-22.75l-163.00-162.75q-9.25-9.25 -22.50-9.25t-22.50,9.25l-19.00,18.75q-9.25,9.75 -9.25,22.75q0.00,13.25 9.25,22.50l 121.50,121.50l-121.50,121.25q-9.25,9.75 -9.25,22.75q0.00,13.25 9.25,22.50l 19.00,18.75q 9.00,9.50 22.50,9.50t 22.50-9.50l 163.00-162.75q 9.25-9.25 9.25-22.50z" horiz-adv-x="288" />
14
+ <glyph unicode="&#xf003;" d="M 346.00,152.25l-332.00-184.50q-5.75-3.25 -9.875-0.75t-4.125,9.00l0.00,368.00 q0.00,6.50 4.125,9.00t 9.875-0.75l 332.00-184.50q 5.75-3.25 5.75-7.75t-5.75-7.75z" horiz-adv-x="352" />
15
+ <glyph unicode="&#xf004;" d="M 384.00,336.00l0.00-352.00 q0.00-6.50 -4.75-11.25t-11.25-4.75l-128.00,0.00 q-6.50,0.00 -11.25,4.75t-4.75,11.25l0.00,352.00 q0.00,6.50 4.75,11.25t 11.25,4.75l 128.00,0.00 q 6.50,0.00 11.25-4.75t 4.75-11.25zM 160.00,336.00l0.00-352.00 q0.00-6.50 -4.75-11.25t-11.25-4.75l-128.00,0.00 q-6.50,0.00 -11.25,4.75t-4.75,11.25l0.00,352.00 q0.00,6.50 4.75,11.25t 11.25,4.75l 128.00,0.00 q 6.50,0.00 11.25-4.75t 4.75-11.25z" horiz-adv-x="384" />
16
+ <glyph unicode="&#xf005;" d="M 402.75,208.00q0.00-13.25 -9.25-22.50l-162.75-162.75q-9.50-9.50 -22.75-9.50q-13.50,0.00 -22.50,9.50l-162.75,162.75q-9.50,9.00 -9.50,22.50q0.00,13.25 9.50,22.75l 18.50,18.75q 9.75,9.25 22.75,9.25q 13.25,0.00 22.50-9.25l 121.50-121.50l 121.50,121.50q 9.25,9.25 22.50,9.25q 13.00,0.00 22.75-9.25l 18.75-18.75q 9.25-9.75 9.25-22.75z" horiz-adv-x="416" />
17
+ <glyph unicode="&#x20;" horiz-adv-x="224" />
18
+ <glyph class="hidden" unicode="&#xf000;" d="M0,384L 448 -64L0 -64 z" horiz-adv-x="0" />
19
+ </font></defs></svg>
skin/frontend/base/default/elogic/slider/fonts/flexslider-icon.ttf ADDED
Binary file
skin/frontend/base/default/elogic/slider/fonts/flexslider-icon.woff ADDED
Binary file
skin/frontend/base/default/elogic/slider/js/jquery.flexslider-min.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*
2
+ * jQuery FlexSlider v2.6.0
3
+ * Copyright 2012 WooThemes
4
+ * Contributing Author: Tyler Smith
5
+ */!function($){var e=!0;$.flexslider=function(t,a){var n=$(t);n.vars=$.extend({},$.flexslider.defaults,a);var i=n.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,r=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&n.vars.touch,o="click touchend MSPointerUp keyup",l="",c,d="vertical"===n.vars.direction,u=n.vars.reverse,v=n.vars.itemWidth>0,p="fade"===n.vars.animation,m=""!==n.vars.asNavFor,f={};$.data(t,"flexslider",n),f={init:function(){n.animating=!1,n.currentSlide=parseInt(n.vars.startAt?n.vars.startAt:0,10),isNaN(n.currentSlide)&&(n.currentSlide=0),n.animatingTo=n.currentSlide,n.atEnd=0===n.currentSlide||n.currentSlide===n.last,n.containerSelector=n.vars.selector.substr(0,n.vars.selector.search(" ")),n.slides=$(n.vars.selector,n),n.container=$(n.containerSelector,n),n.count=n.slides.length,n.syncExists=$(n.vars.sync).length>0,"slide"===n.vars.animation&&(n.vars.animation="swing"),n.prop=d?"top":"marginLeft",n.args={},n.manualPause=!1,n.stopped=!1,n.started=!1,n.startTimeout=null,n.transitions=!n.vars.video&&!p&&n.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var a in t)if(void 0!==e.style[t[a]])return n.pfx=t[a].replace("Perspective","").toLowerCase(),n.prop="-"+n.pfx+"-transform",!0;return!1}(),n.ensureAnimationEnd="",""!==n.vars.controlsContainer&&(n.controlsContainer=$(n.vars.controlsContainer).length>0&&$(n.vars.controlsContainer)),""!==n.vars.manualControls&&(n.manualControls=$(n.vars.manualControls).length>0&&$(n.vars.manualControls)),""!==n.vars.customDirectionNav&&(n.customDirectionNav=2===$(n.vars.customDirectionNav).length&&$(n.vars.customDirectionNav)),n.vars.randomize&&(n.slides.sort(function(){return Math.round(Math.random())-.5}),n.container.empty().append(n.slides)),n.doMath(),n.setup("init"),n.vars.controlNav&&f.controlNav.setup(),n.vars.directionNav&&f.directionNav.setup(),n.vars.keyboard&&(1===$(n.containerSelector).length||n.vars.multipleKeyboard)&&$(document).bind("keyup",function(e){var t=e.keyCode;if(!n.animating&&(39===t||37===t)){var a=39===t?n.getTarget("next"):37===t?n.getTarget("prev"):!1;n.flexAnimate(a,n.vars.pauseOnAction)}}),n.vars.mousewheel&&n.bind("mousewheel",function(e,t,a,i){e.preventDefault();var s=0>t?n.getTarget("next"):n.getTarget("prev");n.flexAnimate(s,n.vars.pauseOnAction)}),n.vars.pausePlay&&f.pausePlay.setup(),n.vars.slideshow&&n.vars.pauseInvisible&&f.pauseInvisible.init(),n.vars.slideshow&&(n.vars.pauseOnHover&&n.hover(function(){n.manualPlay||n.manualPause||n.pause()},function(){n.manualPause||n.manualPlay||n.stopped||n.play()}),n.vars.pauseInvisible&&f.pauseInvisible.isHidden()||(n.vars.initDelay>0?n.startTimeout=setTimeout(n.play,n.vars.initDelay):n.play())),m&&f.asNav.setup(),r&&n.vars.touch&&f.touch(),(!p||p&&n.vars.smoothHeight)&&$(window).bind("resize orientationchange focus",f.resize),n.find("img").attr("draggable","false"),setTimeout(function(){n.vars.start(n)},200)},asNav:{setup:function(){n.asNav=!0,n.animatingTo=Math.floor(n.currentSlide/n.move),n.currentItem=n.currentSlide,n.slides.removeClass(i+"active-slide").eq(n.currentItem).addClass(i+"active-slide"),s?(t._slider=n,n.slides.each(function(){var e=this;e._gesture=new MSGesture,e._gesture.target=e,e.addEventListener("MSPointerDown",function(e){e.preventDefault(),e.currentTarget._gesture&&e.currentTarget._gesture.addPointer(e.pointerId)},!1),e.addEventListener("MSGestureTap",function(e){e.preventDefault();var t=$(this),a=t.index();$(n.vars.asNavFor).data("flexslider").animating||t.hasClass("active")||(n.direction=n.currentItem<a?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction,!1,!0,!0))})})):n.slides.on(o,function(e){e.preventDefault();var t=$(this),a=t.index(),s=t.offset().left-$(n).scrollLeft();0>=s&&t.hasClass(i+"active-slide")?n.flexAnimate(n.getTarget("prev"),!0):$(n.vars.asNavFor).data("flexslider").animating||t.hasClass(i+"active-slide")||(n.direction=n.currentItem<a?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){n.manualControls?f.controlNav.setupManual():f.controlNav.setupPaging()},setupPaging:function(){var e="thumbnails"===n.vars.controlNav?"control-thumbs":"control-paging",t=1,a,s;if(n.controlNavScaffold=$('<ol class="'+i+"control-nav "+i+e+'"></ol>'),n.pagingCount>1)for(var r=0;r<n.pagingCount;r++){if(s=n.slides.eq(r),void 0===s.attr("data-thumb-alt")&&s.attr("data-thumb-alt",""),altText=""!==s.attr("data-thumb-alt")?altText=' alt="'+s.attr("data-thumb-alt")+'"':"",a="thumbnails"===n.vars.controlNav?'<img src="'+s.attr("data-thumb")+'"'+altText+"/>":'<a href="#">'+t+"</a>","thumbnails"===n.vars.controlNav&&!0===n.vars.thumbCaptions){var c=s.attr("data-thumbcaption");""!==c&&void 0!==c&&(a+='<span class="'+i+'caption">'+c+"</span>")}n.controlNavScaffold.append("<li>"+a+"</li>"),t++}n.controlsContainer?$(n.controlsContainer).append(n.controlNavScaffold):n.append(n.controlNavScaffold),f.controlNav.set(),f.controlNav.active(),n.controlNavScaffold.delegate("a, img",o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(n.direction=a>n.currentSlide?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},setupManual:function(){n.controlNav=n.manualControls,f.controlNav.active(),n.controlNav.bind(o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(a>n.currentSlide?n.direction="next":n.direction="prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},set:function(){var e="thumbnails"===n.vars.controlNav?"img":"a";n.controlNav=$("."+i+"control-nav li "+e,n.controlsContainer?n.controlsContainer:n)},active:function(){n.controlNav.removeClass(i+"active").eq(n.animatingTo).addClass(i+"active")},update:function(e,t){n.pagingCount>1&&"add"===e?n.controlNavScaffold.append($('<li><a href="#">'+n.count+"</a></li>")):1===n.pagingCount?n.controlNavScaffold.find("li").remove():n.controlNav.eq(t).closest("li").remove(),f.controlNav.set(),n.pagingCount>1&&n.pagingCount!==n.controlNav.length?n.update(t,e):f.controlNav.active()}},directionNav:{setup:function(){var e=$('<ul class="'+i+'direction-nav"><li class="'+i+'nav-prev"><a class="'+i+'prev" href="#">'+n.vars.prevText+'</a></li><li class="'+i+'nav-next"><a class="'+i+'next" href="#">'+n.vars.nextText+"</a></li></ul>");n.customDirectionNav?n.directionNav=n.customDirectionNav:n.controlsContainer?($(n.controlsContainer).append(e),n.directionNav=$("."+i+"direction-nav li a",n.controlsContainer)):(n.append(e),n.directionNav=$("."+i+"direction-nav li a",n)),f.directionNav.update(),n.directionNav.bind(o,function(e){e.preventDefault();var t;(""===l||l===e.type)&&(t=$(this).hasClass(i+"next")?n.getTarget("next"):n.getTarget("prev"),n.flexAnimate(t,n.vars.pauseOnAction)),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";1===n.pagingCount?n.directionNav.addClass(e).attr("tabindex","-1"):n.vars.animationLoop?n.directionNav.removeClass(e).removeAttr("tabindex"):0===n.animatingTo?n.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1"):n.animatingTo===n.last?n.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1"):n.directionNav.removeClass(e).removeAttr("tabindex")}},pausePlay:{setup:function(){var e=$('<div class="'+i+'pauseplay"><a href="#"></a></div>');n.controlsContainer?(n.controlsContainer.append(e),n.pausePlay=$("."+i+"pauseplay a",n.controlsContainer)):(n.append(e),n.pausePlay=$("."+i+"pauseplay a",n)),f.pausePlay.update(n.vars.slideshow?i+"pause":i+"play"),n.pausePlay.bind(o,function(e){e.preventDefault(),(""===l||l===e.type)&&($(this).hasClass(i+"pause")?(n.manualPause=!0,n.manualPlay=!1,n.pause()):(n.manualPause=!1,n.manualPlay=!0,n.play())),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(e){"play"===e?n.pausePlay.removeClass(i+"pause").addClass(i+"play").html(n.vars.playText):n.pausePlay.removeClass(i+"play").addClass(i+"pause").html(n.vars.pauseText)}},touch:function(){function e(e){e.stopPropagation(),n.animating?e.preventDefault():(n.pause(),t._gesture.addPointer(e.pointerId),T=0,c=d?n.h:n.w,f=Number(new Date),l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c)}function a(e){e.stopPropagation();var a=e.target._slider;if(a){var n=-e.translationX,i=-e.translationY;return T+=d?i:n,m=T,x=d?Math.abs(T)<Math.abs(-n):Math.abs(T)<Math.abs(-i),e.detail===e.MSGESTURE_FLAG_INERTIA?void setImmediate(function(){t._gesture.stop()}):void((!x||Number(new Date)-f>500)&&(e.preventDefault(),!p&&a.transitions&&(a.vars.animationLoop||(m=T/(0===a.currentSlide&&0>T||a.currentSlide===a.last&&T>0?Math.abs(T)/c+2:1)),a.setProps(l+m,"setTouch"))))}}function i(e){e.stopPropagation();var t=e.target._slider;if(t){if(t.animatingTo===t.currentSlide&&!x&&null!==m){var a=u?-m:m,n=a>0?t.getTarget("next"):t.getTarget("prev");t.canAdvance(n)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?t.flexAnimate(n,t.vars.pauseOnAction):p||t.flexAnimate(t.currentSlide,t.vars.pauseOnAction,!0)}r=null,o=null,m=null,l=null,T=0}}var r,o,l,c,m,f,g,h,S,x=!1,y=0,b=0,T=0;s?(t.style.msTouchAction="none",t._gesture=new MSGesture,t._gesture.target=t,t.addEventListener("MSPointerDown",e,!1),t._slider=n,t.addEventListener("MSGestureChange",a,!1),t.addEventListener("MSGestureEnd",i,!1)):(g=function(e){n.animating?e.preventDefault():(window.navigator.msPointerEnabled||1===e.touches.length)&&(n.pause(),c=d?n.h:n.w,f=Number(new Date),y=e.touches[0].pageX,b=e.touches[0].pageY,l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c,r=d?b:y,o=d?y:b,t.addEventListener("touchmove",h,!1),t.addEventListener("touchend",S,!1))},h=function(e){y=e.touches[0].pageX,b=e.touches[0].pageY,m=d?r-b:r-y,x=d?Math.abs(m)<Math.abs(y-o):Math.abs(m)<Math.abs(b-o);var t=500;(!x||Number(new Date)-f>t)&&(e.preventDefault(),!p&&n.transitions&&(n.vars.animationLoop||(m/=0===n.currentSlide&&0>m||n.currentSlide===n.last&&m>0?Math.abs(m)/c+2:1),n.setProps(l+m,"setTouch")))},S=function(e){if(t.removeEventListener("touchmove",h,!1),n.animatingTo===n.currentSlide&&!x&&null!==m){var a=u?-m:m,i=a>0?n.getTarget("next"):n.getTarget("prev");n.canAdvance(i)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?n.flexAnimate(i,n.vars.pauseOnAction):p||n.flexAnimate(n.currentSlide,n.vars.pauseOnAction,!0)}t.removeEventListener("touchend",S,!1),r=null,o=null,m=null,l=null},t.addEventListener("touchstart",g,!1))},resize:function(){!n.animating&&n.is(":visible")&&(v||n.doMath(),p?f.smoothHeight():v?(n.slides.width(n.computedW),n.update(n.pagingCount),n.setProps()):d?(n.viewport.height(n.h),n.setProps(n.h,"setTotal")):(n.vars.smoothHeight&&f.smoothHeight(),n.newSlides.width(n.computedW),n.setProps(n.computedW,"setTotal")))},smoothHeight:function(e){if(!d||p){var t=p?n:n.viewport;e?t.animate({height:n.slides.eq(n.animatingTo).height()},e):t.height(n.slides.eq(n.animatingTo).height())}},sync:function(e){var t=$(n.vars.sync).data("flexslider"),a=n.animatingTo;switch(e){case"animate":t.flexAnimate(a,n.vars.pauseOnAction,!1,!0);break;case"play":t.playing||t.asNav||t.play();break;case"pause":t.pause()}},uniqueID:function(e){return e.filter("[id]").add(e.find("[id]")).each(function(){var e=$(this);e.attr("id",e.attr("id")+"_clone")}),e},pauseInvisible:{visProp:null,init:function(){var e=f.pauseInvisible.getHiddenProp();if(e){var t=e.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(t,function(){f.pauseInvisible.isHidden()?n.startTimeout?clearTimeout(n.startTimeout):n.pause():n.started?n.play():n.vars.initDelay>0?setTimeout(n.play,n.vars.initDelay):n.play()})}},isHidden:function(){var e=f.pauseInvisible.getHiddenProp();return e?document[e]:!1},getHiddenProp:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return e[t]+"Hidden";return null}},setToClearWatchedEvent:function(){clearTimeout(c),c=setTimeout(function(){l=""},3e3)}},n.flexAnimate=function(e,t,a,s,o){if(n.vars.animationLoop||e===n.currentSlide||(n.direction=e>n.currentSlide?"next":"prev"),m&&1===n.pagingCount&&(n.direction=n.currentItem<e?"next":"prev"),!n.animating&&(n.canAdvance(e,o)||a)&&n.is(":visible")){if(m&&s){var l=$(n.vars.asNavFor).data("flexslider");if(n.atEnd=0===e||e===n.count-1,l.flexAnimate(e,!0,!1,!0,o),n.direction=n.currentItem<e?"next":"prev",l.direction=n.direction,Math.ceil((e+1)/n.visible)-1===n.currentSlide||0===e)return n.currentItem=e,n.slides.removeClass(i+"active-slide").eq(e).addClass(i+"active-slide"),!1;n.currentItem=e,n.slides.removeClass(i+"active-slide").eq(e).addClass(i+"active-slide"),e=Math.floor(e/n.visible)}if(n.animating=!0,n.animatingTo=e,t&&n.pause(),n.vars.before(n),n.syncExists&&!o&&f.sync("animate"),n.vars.controlNav&&f.controlNav.active(),v||n.slides.removeClass(i+"active-slide").eq(e).addClass(i+"active-slide"),n.atEnd=0===e||e===n.last,n.vars.directionNav&&f.directionNav.update(),e===n.last&&(n.vars.end(n),n.vars.animationLoop||n.pause()),p)r?(n.slides.eq(n.currentSlide).css({opacity:0,zIndex:1}),n.slides.eq(e).css({opacity:1,zIndex:2}),n.wrapup(c)):(n.slides.eq(n.currentSlide).css({zIndex:1}).animate({opacity:0},n.vars.animationSpeed,n.vars.easing),n.slides.eq(e).css({zIndex:2}).animate({opacity:1},n.vars.animationSpeed,n.vars.easing,n.wrapup));else{var c=d?n.slides.filter(":first").height():n.computedW,g,h,S;v?(g=n.vars.itemMargin,S=(n.itemW+g)*n.move*n.animatingTo,h=S>n.limit&&1!==n.visible?n.limit:S):h=0===n.currentSlide&&e===n.count-1&&n.vars.animationLoop&&"next"!==n.direction?u?(n.count+n.cloneOffset)*c:0:n.currentSlide===n.last&&0===e&&n.vars.animationLoop&&"prev"!==n.direction?u?0:(n.count+1)*c:u?(n.count-1-e+n.cloneOffset)*c:(e+n.cloneOffset)*c,n.setProps(h,"",n.vars.animationSpeed),n.transitions?(n.vars.animationLoop&&n.atEnd||(n.animating=!1,n.currentSlide=n.animatingTo),n.container.unbind("webkitTransitionEnd transitionend"),n.container.bind("webkitTransitionEnd transitionend",function(){clearTimeout(n.ensureAnimationEnd),n.wrapup(c)}),clearTimeout(n.ensureAnimationEnd),n.ensureAnimationEnd=setTimeout(function(){n.wrapup(c)},n.vars.animationSpeed+100)):n.container.animate(n.args,n.vars.animationSpeed,n.vars.easing,function(){n.wrapup(c)})}n.vars.smoothHeight&&f.smoothHeight(n.vars.animationSpeed)}},n.wrapup=function(e){p||v||(0===n.currentSlide&&n.animatingTo===n.last&&n.vars.animationLoop?n.setProps(e,"jumpEnd"):n.currentSlide===n.last&&0===n.animatingTo&&n.vars.animationLoop&&n.setProps(e,"jumpStart")),n.animating=!1,n.currentSlide=n.animatingTo,n.vars.after(n)},n.animateSlides=function(){!n.animating&&e&&n.flexAnimate(n.getTarget("next"))},n.pause=function(){clearInterval(n.animatedSlides),n.animatedSlides=null,n.playing=!1,n.vars.pausePlay&&f.pausePlay.update("play"),n.syncExists&&f.sync("pause")},n.play=function(){n.playing&&clearInterval(n.animatedSlides),n.animatedSlides=n.animatedSlides||setInterval(n.animateSlides,n.vars.slideshowSpeed),n.started=n.playing=!0,n.vars.pausePlay&&f.pausePlay.update("pause"),n.syncExists&&f.sync("play")},n.stop=function(){n.pause(),n.stopped=!0},n.canAdvance=function(e,t){var a=m?n.pagingCount-1:n.last;return t?!0:m&&n.currentItem===n.count-1&&0===e&&"prev"===n.direction?!0:m&&0===n.currentItem&&e===n.pagingCount-1&&"next"!==n.direction?!1:e!==n.currentSlide||m?n.vars.animationLoop?!0:n.atEnd&&0===n.currentSlide&&e===a&&"next"!==n.direction?!1:n.atEnd&&n.currentSlide===a&&0===e&&"next"===n.direction?!1:!0:!1},n.getTarget=function(e){return n.direction=e,"next"===e?n.currentSlide===n.last?0:n.currentSlide+1:0===n.currentSlide?n.last:n.currentSlide-1},n.setProps=function(e,t,a){var i=function(){var a=e?e:(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo,i=function(){if(v)return"setTouch"===t?e:u&&n.animatingTo===n.last?0:u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:n.animatingTo===n.last?n.limit:a;switch(t){case"setTotal":return u?(n.count-1-n.currentSlide+n.cloneOffset)*e:(n.currentSlide+n.cloneOffset)*e;case"setTouch":return u?e:e;case"jumpEnd":return u?e:n.count*e;case"jumpStart":return u?n.count*e:e;default:return e}}();return-1*i+"px"}();n.transitions&&(i=d?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)",a=void 0!==a?a/1e3+"s":"0s",n.container.css("-"+n.pfx+"-transition-duration",a),n.container.css("transition-duration",a)),n.args[n.prop]=i,(n.transitions||void 0===a)&&n.container.css(n.args),n.container.css("transform",i)},n.setup=function(e){if(p)n.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===e&&(r?n.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+n.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(n.currentSlide).css({opacity:1,zIndex:2}):0==n.vars.fadeFirstSlide?n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).css({opacity:1}):n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).animate({opacity:1},n.vars.animationSpeed,n.vars.easing)),n.vars.smoothHeight&&f.smoothHeight();else{var t,a;"init"===e&&(n.viewport=$('<div class="'+i+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(n).append(n.container),n.cloneCount=0,n.cloneOffset=0,u&&(a=$.makeArray(n.slides).reverse(),n.slides=$(a),n.container.empty().append(n.slides))),n.vars.animationLoop&&!v&&(n.cloneCount=2,n.cloneOffset=1,"init"!==e&&n.container.find(".clone").remove(),n.container.append(f.uniqueID(n.slides.first().clone().addClass("clone")).attr("aria-hidden","true")).prepend(f.uniqueID(n.slides.last().clone().addClass("clone")).attr("aria-hidden","true"))),n.newSlides=$(n.vars.selector,n),t=u?n.count-1-n.currentSlide+n.cloneOffset:n.currentSlide+n.cloneOffset,d&&!v?(n.container.height(200*(n.count+n.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){n.newSlides.css({display:"block"}),n.doMath(),n.viewport.height(n.h),n.setProps(t*n.h,"init")},"init"===e?100:0)):(n.container.width(200*(n.count+n.cloneCount)+"%"),n.setProps(t*n.computedW,"init"),setTimeout(function(){n.doMath(),n.newSlides.css({width:n.computedW,marginRight:n.computedM,"float":"left",display:"block"}),n.vars.smoothHeight&&f.smoothHeight()},"init"===e?100:0))}v||n.slides.removeClass(i+"active-slide").eq(n.currentSlide).addClass(i+"active-slide"),n.vars.init(n)},n.doMath=function(){var e=n.slides.first(),t=n.vars.itemMargin,a=n.vars.minItems,i=n.vars.maxItems;n.w=void 0===n.viewport?n.width():n.viewport.width(),n.h=e.height(),n.boxPadding=e.outerWidth()-e.width(),v?(n.itemT=n.vars.itemWidth+t,n.itemM=t,n.minW=a?a*n.itemT:n.w,n.maxW=i?i*n.itemT-t:n.w,n.itemW=n.minW>n.w?(n.w-t*(a-1))/a:n.maxW<n.w?(n.w-t*(i-1))/i:n.vars.itemWidth>n.w?n.w:n.vars.itemWidth,n.visible=Math.floor(n.w/n.itemW),n.move=n.vars.move>0&&n.vars.move<n.visible?n.vars.move:n.visible,n.pagingCount=Math.ceil((n.count-n.visible)/n.move+1),n.last=n.pagingCount-1,n.limit=1===n.pagingCount?0:n.vars.itemWidth>n.w?n.itemW*(n.count-1)+t*(n.count-1):(n.itemW+t)*n.count-n.w-t):(n.itemW=n.w,n.itemM=t,n.pagingCount=n.count,n.last=n.count-1),n.computedW=n.itemW-n.boxPadding,n.computedM=n.itemM},n.update=function(e,t){n.doMath(),v||(e<n.currentSlide?n.currentSlide+=1:e<=n.currentSlide&&0!==e&&(n.currentSlide-=1),n.animatingTo=n.currentSlide),n.vars.controlNav&&!n.manualControls&&("add"===t&&!v||n.pagingCount>n.controlNav.length?f.controlNav.update("add"):("remove"===t&&!v||n.pagingCount<n.controlNav.length)&&(v&&n.currentSlide>n.last&&(n.currentSlide-=1,n.animatingTo-=1),f.controlNav.update("remove",n.last))),n.vars.directionNav&&f.directionNav.update()},n.addSlide=function(e,t){var a=$(e);n.count+=1,n.last=n.count-1,d&&u?void 0!==t?n.slides.eq(n.count-t).after(a):n.container.prepend(a):void 0!==t?n.slides.eq(t).before(a):n.container.append(a),n.update(t,"add"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.added(n)},n.removeSlide=function(e){var t=isNaN(e)?n.slides.index($(e)):e;n.count-=1,n.last=n.count-1,isNaN(e)?$(e,n.slides).remove():d&&u?n.slides.eq(n.last).remove():n.slides.eq(e).remove(),n.doMath(),n.update(t,"remove"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.removed(n)},f.init()},$(window).blur(function(t){e=!1}).focus(function(t){e=!0}),$.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,fadeFirstSlide:!0,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",customDirectionNav:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){},init:function(){}},$.fn.flexslider=function(e){if(void 0===e&&(e={}),"object"==typeof e)return this.each(function(){var t=$(this),a=e.selector?e.selector:".slides > li",n=t.find(a);1===n.length&&e.allowOneSlide===!0||0===n.length?(n.fadeIn(400),e.start&&e.start(t)):void 0===t.data("flexslider")&&new $.flexslider(this,e)});var t=$(this).data("flexslider");switch(e){case"play":t.play();break;case"pause":t.pause();break;case"stop":t.stop();break;case"next":t.flexAnimate(t.getTarget("next"),!0);break;case"prev":case"previous":t.flexAnimate(t.getTarget("prev"),!0);break;default:"number"==typeof e&&t.flexAnimate(e,!0)}}}(jQuery);
skin/frontend/base/default/elogic/slider/js/tooltip.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Created by elogic
3
+ */
4
+ jQuery(document).ready(function($) {
5
+ // Tooltip only Text
6
+ $('.masterTooltip').hover(function(){
7
+ // Hover over code
8
+ var title = $(this).attr('title');
9
+ $(this).data('tipText', title).removeAttr('title');
10
+ $('<p class="tooltip"></p>')
11
+ .text(title)
12
+ .appendTo('body')
13
+ .fadeIn('slow');
14
+ }, function() {
15
+ // Hover out code
16
+ $(this).attr('title', $(this).data('tipText'));
17
+ $('.tooltip').remove();
18
+ }).mousemove(function(e) {
19
+ var mousex = e.pageX + 20; //Get X coordinates
20
+ var mousey = e.pageY + 10; //Get Y coordinates
21
+ $('.tooltip')
22
+ .css({ top: mousey, left: mousex })
23
+ });
24
+ });