JScriptz_MegaMenu2 - Version 1.8.0.0

Version Notes

This is a mega nav extension that allows you to control your top menu links and the content below them through the admin interface. It supports HTML, Video, Tabbed Jquery, and even has a nifty contact us form.

Download this release

Release Info

Developer Jason Lotzer
Extension JScriptz_MegaMenu2
Version 1.8.0.0
Comparing to
See all releases


Version 1.8.0.0

Files changed (34) hide show
  1. app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Helper/Wysiwyg.php +43 -0
  2. app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem.php +36 -0
  3. app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Abstract.php +182 -0
  4. app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Edit.php +38 -0
  5. app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Edit/Form.php +200 -0
  6. app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Edit/Tab/Form.php +126 -0
  7. app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Edit/Tab/Stores.php +47 -0
  8. app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Edit/Tabs.php +66 -0
  9. app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Tree.php +303 -0
  10. app/code/community/JScriptz/MegaMenu2/Block/Html/Topmenu.php +265 -0
  11. app/code/community/JScriptz/MegaMenu2/Controller/Adminhtml/MegaMenu2.php +59 -0
  12. app/code/community/JScriptz/MegaMenu2/Helper/Data.php +24 -0
  13. app/code/community/JScriptz/MegaMenu2/Helper/Menuitem.php +41 -0
  14. app/code/community/JScriptz/MegaMenu2/Model/Menuitem.php +307 -0
  15. app/code/community/JScriptz/MegaMenu2/Model/Resource/Menuitem.php +552 -0
  16. app/code/community/JScriptz/MegaMenu2/Model/Resource/Menuitem/Collection.php +206 -0
  17. app/code/community/JScriptz/MegaMenu2/Model/Resource/Menuitem/Tree.php +389 -0
  18. app/code/community/JScriptz/MegaMenu2/Model/Resource/Setup.php +25 -0
  19. app/code/community/JScriptz/MegaMenu2/controllers/Adminhtml/MegaMenu2/MenuitemController.php +311 -0
  20. app/code/community/JScriptz/MegaMenu2/data/jscriptz_megamenu2_setup/data-install-0.0.1.php +235 -0
  21. app/code/community/JScriptz/MegaMenu2/etc/adminhtml.xml +63 -0
  22. app/code/community/JScriptz/MegaMenu2/etc/config.xml +110 -0
  23. app/code/community/JScriptz/MegaMenu2/sql/jscriptz_megamenu2_setup/install-0.0.1.php +93 -0
  24. app/design/adminhtml/default/default/layout/jscriptz_megamenu2.xml +32 -0
  25. app/design/adminhtml/default/default/template/jscriptz_megamenu2/menuitem/edit.phtml +151 -0
  26. app/design/adminhtml/default/default/template/jscriptz_megamenu2/menuitem/edit/form.phtml +160 -0
  27. app/design/adminhtml/default/default/template/jscriptz_megamenu2/menuitem/tree.phtml +376 -0
  28. app/design/frontend/base/default/layout/jscriptz_megamenu2.xml +32 -0
  29. app/design/frontend/base/default/template/jscriptz/html/topmenu.phtml +180 -0
  30. app/etc/modules/JScriptz_MegaMenu2.xml +29 -0
  31. app/locale/en_US/JScriptz_MegaMenu2.csv +69 -0
  32. package.xml +18 -0
  33. skin/frontend/base/default/css/JScriptz/mgmenu.css +304 -0
  34. skin/frontend/base/default/js/JScriptz/mgmenu.js +16 -0
app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Helper/Wysiwyg.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * MegaMenu2 textarea attribute WYSIWYG button
19
+ * @category JScriptz
20
+ * @package JScriptz_MegaMenu2
21
+
22
+ */
23
+ class JScriptz_MegaMenu2_Block_Adminhtml_Helper_Wysiwyg extends Varien_Data_Form_Element_Textarea
24
+ {
25
+ /**
26
+ * Retrieve additional html and put it at the end of element html
27
+ * @access public
28
+ * @return string
29
+ */
30
+ public function getAfterElementHtml(){
31
+ $html = parent::getAfterElementHtml();
32
+ $disabled = ($this->getDisabled() || $this->getReadonly());
33
+ $html .= Mage::getSingleton('core/layout')
34
+ ->createBlock('adminhtml/widget_button', '', array(
35
+ 'label' => Mage::helper('catalog')->__('WYSIWYG Editor'),
36
+ 'type'=> 'button',
37
+ 'disabled' => $disabled,
38
+ 'class' => ($disabled) ? 'disabled btn-wysiwyg' : 'btn-wysiwyg',
39
+ 'onclick' => 'catalogWysiwygEditor.open(\''.Mage::helper('adminhtml')->getUrl('*/*/wysiwyg').'\', \''.$this->getHtmlId().'\')'
40
+ ))->toHtml();
41
+ return $html;
42
+ }
43
+ }
app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item admin block
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+ */
23
+ class JScriptz_MegaMenu2_Block_Adminhtml_Menuitem extends Mage_Adminhtml_Block_Widget_Grid_Container{
24
+ /**
25
+ * constructor
26
+ * @access public
27
+ * @return void
28
+ */
29
+ public function __construct(){
30
+ $this->_controller = 'adminhtml_menuitem';
31
+ $this->_blockGroup = 'megamenu2';
32
+ $this->_headerText = Mage::helper('megamenu2')->__('Menu Item');
33
+ $this->_addButtonLabel = Mage::helper('megamenu2')->__('Add Menu Item');
34
+ parent::__construct();
35
+ }
36
+ }
app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Abstract.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item admin block abstract
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+
23
+ */
24
+ class JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Abstract extends Mage_Adminhtml_Block_Template{
25
+ /**
26
+ * get current menu item
27
+ * @access public
28
+ * @return JScriptz_MegaMenu2_Model_Entity
29
+ */
30
+ public function getMenuitem(){
31
+ return Mage::registry('menuitem');
32
+ }
33
+ /**
34
+ * get current menu item id
35
+ * @access public
36
+ * @return int
37
+ */
38
+ public function getMenuitemId(){
39
+ if ($this->getMenuitem()) {
40
+ return $this->getMenuitem()->getId();
41
+ }
42
+ return null;
43
+ }
44
+ /**
45
+ * get current menu item Link Title
46
+ * @access public
47
+ * @return string
48
+ */
49
+ public function getMenuitemLinktitle(){
50
+ return $this->getMenuitem()->getLinktitle();
51
+ }
52
+ /**
53
+ * get current menu item path
54
+ * @access public
55
+ * @return string
56
+ */
57
+ public function getMenuitemPath(){
58
+ if ($this->getMenuitem()) {
59
+ return $this->getMenuitem()->getPath();
60
+ }
61
+ return Mage::helper('megamenu2/menuitem')->getRootMenuitemId();
62
+ }
63
+ /**
64
+ * check if there is a root menu item
65
+ * @access public
66
+ * @return bool
67
+ */
68
+ public function hasRootMenuitem(){
69
+ $root = $this->getRoot();
70
+ if ($root && $root->getId()) {
71
+ return true;
72
+ }
73
+ return false;
74
+ }
75
+ /**
76
+ * get the root
77
+ * @access publoc
78
+ * @param JScriptz_MegaMenu2_Model_Menuitem|null $parentNodeMenuitem
79
+ * @param int $recursionLevel
80
+ * @return Varien_Data_Tree_Node
81
+ */
82
+ public function getRoot($parentNodeMenuitem = null, $recursionLevel = 3){
83
+ if (!is_null($parentNodeMenuitem) && $parentNodeMenuitem->getId()) {
84
+ return $this->getNode($parentNodeMenuitem, $recursionLevel);
85
+ }
86
+ $root = Mage::registry('root');
87
+ if (is_null($root)) {
88
+ $rootId = Mage::helper('megamenu2/menuitem')->getRootMenuitemId();
89
+ $tree = Mage::getResourceSingleton('megamenu2/menuitem_tree')
90
+ ->load(null, $recursionLevel);
91
+ if ($this->getMenuitem()) {
92
+ $tree->loadEnsuredNodes($this->getMenuitem(), $tree->getNodeById($rootId));
93
+ }
94
+ $tree->addCollectionData($this->getMenuitemCollection());
95
+ $root = $tree->getNodeById($rootId);
96
+ if ($root && $rootId != Mage::helper('megamenu2/menuitem')->getRootMenuitemId()) {
97
+ $root->setIsVisible(true);
98
+ }
99
+ elseif($root && $root->getId() == Mage::helper('megamenu2/menuitem')->getRootMenuitemId()) {
100
+ $root->setLinktitle(Mage::helper('megamenu2')->__('Root'));
101
+ }
102
+ Mage::register('root', $root);
103
+ }
104
+ return $root;
105
+ }
106
+
107
+ /**
108
+ * Get and register menu items root by specified menu items IDs
109
+ * @accsess public
110
+ * @param array $ids
111
+ * @return Varien_Data_Tree_Node
112
+ */
113
+ public function getRootByIds($ids){
114
+ $root = Mage::registry('root');
115
+ if (null === $root) {
116
+ $menuitemTreeResource = Mage::getResourceSingleton('megamenu2/menuitem_tree');
117
+ $ids = $menuitemTreeResource->getExistingMenuitemIdsBySpecifiedIds($ids);
118
+ $tree = $menuitemTreeResource->loadByIds($ids);
119
+ $rootId = Mage::helper('megamenu2/menuitem')->getRootMenuitemId();
120
+ $root = $tree->getNodeById($rootId);
121
+ if ($root && $rootId != Mage::helper('megamenu2/menuitem')->getRootMenuitemId()) {
122
+ $root->setIsVisible(true);
123
+ }
124
+ else if($root && $root->getId() == Mage::helper('megamenu2/menuitem')->getRootMenuitemId()) {
125
+ $root->setName(Mage::helper('megamenu2')->__('Root'));
126
+ }
127
+ $tree->addCollectionData($this->getMenuitemCollection());
128
+ Mage::register('root', $root);
129
+ }
130
+ return $root;
131
+ }
132
+ /**
133
+ * get specific node
134
+ * @access public
135
+ * @param JScriptz_MegaMenu2_Model_Menuitem $parentNodeMenuitem
136
+ * @param $int $recursionLevel
137
+ * @return Varien_Data_Tree_Node
138
+ */
139
+ public function getNode($parentNodeMenuitem, $recursionLevel = 2){
140
+ $tree = Mage::getResourceModel('megamenu2/menuitem_tree');
141
+ $nodeId = $parentNodeMenuitem->getId();
142
+ $parentId = $parentNodeMenuitem->getParentId();
143
+ $node = $tree->loadNode($nodeId);
144
+ $node->loadChildren($recursionLevel);
145
+ if ($node && $nodeId != Mage::helper('megamenu2/menuitem')->getRootMenuitemId()) {
146
+ $node->setIsVisible(true);
147
+ }
148
+ elseif($node && $node->getId() == Mage::helper('megamenu2/menuitem')->getRootMenuitemId()) {
149
+ $node->setLinktitle(Mage::helper('megamenu2')->__('Root'));
150
+ }
151
+ $tree->addCollectionData($this->getMenuitemCollection());
152
+ return $node;
153
+ }
154
+ /**
155
+ * get url for saving data
156
+ * @access public
157
+ * @param array $args
158
+ * @return string
159
+ */
160
+ public function getSaveUrl(array $args = array()){
161
+ $params = array('_current'=>true);
162
+ $params = array_merge($params, $args);
163
+ return $this->getUrl('*/*/save', $params);
164
+ }
165
+ /**
166
+ * get url for edit
167
+ * @access public
168
+ * @param array $args
169
+ * @return string
170
+ */
171
+ public function getEditUrl(){
172
+ return $this->getUrl("*/MegaMenu2_menuitem/edit", array('_current'=>true, '_query'=>false, 'id'=>null, 'parent'=>null));
173
+ }
174
+ /**
175
+ * Return root ids
176
+ * @access public
177
+ * @return array
178
+ */
179
+ public function getRootIds(){
180
+ return array(Mage::helper('megamenu2/menuitem')->getRootMenuitemId());
181
+ }
182
+ }
app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Edit.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item admin edit form
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+
23
+ */
24
+ class JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Edit extends Mage_Adminhtml_Block_Widget_Form_Container{
25
+ /**
26
+ * constructor
27
+ * @access public
28
+ * @return void
29
+ */
30
+ public function __construct(){
31
+ $this->_objectId = 'entity_id';
32
+ $this->_blockGroup = 'megamenu2';
33
+ $this->_controller = 'adminhtml_menuitem';
34
+ $this->_mode = 'edit';
35
+ parent::__construct();
36
+ $this->setTemplate('jscriptz_megamenu2/menuitem/edit.phtml');
37
+ }
38
+ }
app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Edit/Form.php ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item edit form
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+
23
+ */
24
+ class JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Edit_Form extends JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Abstract
25
+ {
26
+ /**
27
+ * Additional buttons on menu item page
28
+ * @var array
29
+ */
30
+ protected $_additionalButtons = array();
31
+ /**
32
+ * constroctor
33
+ * set template
34
+ * @access public
35
+ * @return void
36
+ */
37
+ public function __construct(){
38
+ parent::__construct();
39
+ $this->setTemplate('jscriptz_megamenu2/menuitem/edit/form.phtml');
40
+ }
41
+ /**
42
+ * prepare the layout
43
+ * @access protected
44
+ * @return JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Edit_Form
45
+ */
46
+ protected function _prepareLayout(){
47
+ $menuitem = $this->getMenuitem();
48
+ $menuitemId = (int)$menuitem->getId();
49
+ $this->setChild('tabs',
50
+ $this->getLayout()->createBlock('megamenu2/adminhtml_menuitem_edit_tabs', 'tabs')
51
+ );
52
+ $this->setChild('save_button',
53
+ $this->getLayout()->createBlock('adminhtml/widget_button')
54
+ ->setData(array(
55
+ 'label' => Mage::helper('megamenu2')->__('Save Menu Item'),
56
+ 'onclick' => "menuitemSubmit('" . $this->getSaveUrl() . "', true)",
57
+ 'class' => 'save'
58
+ ))
59
+ );
60
+ // Delete button
61
+ if (!in_array($menuitemId, $this->getRootIds())) {
62
+ $this->setChild('delete_button',
63
+ $this->getLayout()->createBlock('adminhtml/widget_button')
64
+ ->setData(array(
65
+ 'label' => Mage::helper('megamenu2')->__('Delete Menu Item'),
66
+ 'onclick' => "menuitemDelete('" . $this->getUrl('*/*/delete', array('_current' => true)) . "', true, {$menuitemId})",
67
+ 'class' => 'delete'
68
+ ))
69
+ );
70
+ }
71
+
72
+ // Reset button
73
+ $resetPath = $menuitem ? '*/*/edit' : '*/*/add';
74
+ $this->setChild('reset_button',
75
+ $this->getLayout()->createBlock('adminhtml/widget_button')
76
+ ->setData(array(
77
+ 'label' => Mage::helper('megamenu2')->__('Reset'),
78
+ 'onclick' => "menuitemReset('".$this->getUrl($resetPath, array('_current'=>true))."',true)"
79
+ ))
80
+ );
81
+ return parent::_prepareLayout();
82
+ }
83
+ /**
84
+ * get html for delete button
85
+ * @access public
86
+ * @return string
87
+ */
88
+ public function getDeleteButtonHtml(){
89
+ return $this->getChildHtml('delete_button');
90
+ }
91
+ /**
92
+ * get html for save button
93
+ * @access public
94
+ * @return string
95
+ */
96
+ public function getSaveButtonHtml(){
97
+ return $this->getChildHtml('save_button');
98
+ }
99
+ /**
100
+ * get html for reset button
101
+ * @access public
102
+ * @return string
103
+ */
104
+ public function getResetButtonHtml(){
105
+ return $this->getChildHtml('reset_button');
106
+ }
107
+ /**
108
+ * Retrieve additional buttons html
109
+ * @access public
110
+ * @return string
111
+ */
112
+ public function getAdditionalButtonsHtml(){
113
+ $html = '';
114
+ foreach ($this->_additionalButtons as $childName) {
115
+ $html .= $this->getChildHtml($childName);
116
+ }
117
+ return $html;
118
+ }
119
+
120
+ /**
121
+ * Add additional button
122
+ *
123
+ * @param string $alias
124
+ * @param array $config
125
+ * @return JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Edit_Form
126
+ */
127
+ public function addAdditionalButton($alias, $config){
128
+ if (isset($config['name'])) {
129
+ $config['element_name'] = $config['name'];
130
+ }
131
+ $this->setChild($alias . '_button',
132
+ $this->getLayout()->createBlock('adminhtml/widget_button')->addData($config));
133
+ $this->_additionalButtons[$alias] = $alias . '_button';
134
+ return $this;
135
+ }
136
+ /**
137
+ * Remove additional button
138
+ * @access public
139
+ * @param string $alias
140
+ * @return JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Edit_Form
141
+ */
142
+ public function removeAdditionalButton($alias){
143
+ if (isset($this->_additionalButtons[$alias])) {
144
+ $this->unsetChild($this->_additionalButtons[$alias]);
145
+ unset($this->_additionalButtons[$alias]);
146
+ }
147
+ return $this;
148
+ }
149
+ /**
150
+ * get html for tabs
151
+ * @access public
152
+ * @return string
153
+ */
154
+ public function getTabsHtml(){
155
+ return $this->getChildHtml('tabs');
156
+ }
157
+ /**
158
+ * get the form header
159
+ * @access public
160
+ * @return string
161
+ */
162
+ public function getHeader(){
163
+ if ($this->getMenuitemId()) {
164
+ return $this->getMenuitemLinktitle();
165
+ }
166
+ else {
167
+ return Mage::helper('megamenu2')->__('New Root Menu Item');
168
+ }
169
+ }
170
+ /**
171
+ * get the delete url
172
+ * @access public
173
+ * @param array $args
174
+ * @return string
175
+ */
176
+ public function getDeleteUrl(array $args = array()){
177
+ $params = array('_current'=>true);
178
+ $params = array_merge($params, $args);
179
+ return $this->getUrl('*/*/delete', $params);
180
+ }
181
+ /**
182
+ * Return URL for refresh input element 'path' in form
183
+ * @access public
184
+ * @param array $args
185
+ * @return string
186
+ */
187
+ public function getRefreshPathUrl(array $args = array()){
188
+ $params = array('_current'=>true);
189
+ $params = array_merge($params, $args);
190
+ return $this->getUrl('*/*/refreshPath', $params);
191
+ }
192
+ /**
193
+ * check if request is ajax
194
+ * @access public
195
+ * @return bool
196
+ */
197
+ public function isAjax(){
198
+ return Mage::app()->getRequest()->isXmlHttpRequest() || Mage::app()->getRequest()->getParam('isAjax');
199
+ }
200
+ }
app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Edit/Tab/Form.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item edit form tab
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+
23
+ */
24
+ class JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form{
25
+ /**
26
+ * prepare the form
27
+ * @access protected
28
+ * @return MegaMenu2_Menuitem_Block_Adminhtml_Menuitem_Edit_Tab_Form
29
+ */
30
+ protected function _prepareForm(){
31
+ $form = new Varien_Data_Form();
32
+ $form->setHtmlIdPrefix('menuitem_');
33
+ $form->setFieldNameSuffix('menuitem');
34
+ $this->setForm($form);
35
+ $fieldset = $form->addFieldset('menuitem_form', array('legend'=>Mage::helper('megamenu2')->__('Menu Item')));
36
+ $fieldset->addType('editor', Mage::getConfig()->getBlockClassName('megamenu2/adminhtml_helper_wysiwyg'));
37
+ if (!$this->getMenuitem()->getId()) {
38
+ $parentId = $this->getRequest()->getParam('parent');
39
+ if (!$parentId) {
40
+ $parentId = Mage::helper('megamenu2/menuitem')->getRootMenuitemId();
41
+ }
42
+ $fieldset->addField('path', 'hidden', array(
43
+ 'name' => 'path',
44
+ 'value' => $parentId
45
+ ));
46
+ }
47
+ else {
48
+ $fieldset->addField('id', 'hidden', array(
49
+ 'name' => 'id',
50
+ 'value' => $this->getMenuitem()->getId()
51
+ ));
52
+ $fieldset->addField('path', 'hidden', array(
53
+ 'name' => 'path',
54
+ 'value' => $this->getMenuitem()->getPath()
55
+ ));
56
+ }
57
+
58
+ $fieldset->addField('linktitle', 'text', array(
59
+ 'label' => Mage::helper('megamenu2')->__('Link Title'),
60
+ 'name' => 'linktitle',
61
+ 'note' => $this->__('This is the title for your menu link'),
62
+ 'required' => true,
63
+ 'class' => 'required-entry',
64
+
65
+ ));
66
+
67
+ $fieldset->addField('linkpath', 'text', array(
68
+ 'label' => Mage::helper('megamenu2')->__('Link Path'),
69
+ 'name' => 'linkpath',
70
+ 'note' => $this->__('This is the url your link will follow'),
71
+
72
+ ));
73
+
74
+ $fieldset->addField('linktarget', 'text', array(
75
+ 'label' => Mage::helper('megamenu2')->__('Link Target'),
76
+ 'name' => 'linktarget',
77
+ 'note' => $this->__('Whether the link opens in a new tab -- examples (blank, self)'),
78
+
79
+ ));
80
+
81
+ $fieldset->addField('menuhtml', 'editor', array(
82
+ 'label' => Mage::helper('megamenu2')->__('Menu HTML'),
83
+ 'name' => 'menuhtml',
84
+ 'note' => $this->__('Place any HTML in this block to be displayed in the Mega Nav. Tip: Disable the WYSIWYG editor to place pure HTML code'),
85
+
86
+ ));
87
+
88
+ /*$fieldset->addField('sortorder', 'text', array(
89
+ 'label' => Mage::helper('megamenu2')->__('Link Position'),
90
+ 'name' => 'sortorder',
91
+ 'note' => $this->__('This controls the order in which your links are displayed'),
92
+
93
+ ));*/
94
+ $fieldset->addField('status', 'select', array(
95
+ 'label' => Mage::helper('megamenu2')->__('Status'),
96
+ 'name' => 'status',
97
+ 'values'=> array(
98
+ array(
99
+ 'value' => 1,
100
+ 'label' => Mage::helper('megamenu2')->__('Enabled'),
101
+ ),
102
+ array(
103
+ 'value' => 0,
104
+ 'label' => Mage::helper('megamenu2')->__('Disabled'),
105
+ ),
106
+ ),
107
+ ));
108
+ if (Mage::app()->isSingleStoreMode()){
109
+ $fieldset->addField('store_id', 'hidden', array(
110
+ 'name' => 'stores[]',
111
+ 'value' => Mage::app()->getStore(true)->getId()
112
+ ));
113
+ Mage::registry('current_menuitem')->setStoreId(Mage::app()->getStore(true)->getId());
114
+ }
115
+ $form->addValues($this->getMenuitem()->getData());
116
+ return parent::_prepareForm();
117
+ }
118
+ /**
119
+ * get the current menu item
120
+ * @access public
121
+ * @return JScriptz_MegaMenu2_Model_Menuitem
122
+ */
123
+ public function getMenuitem(){
124
+ return Mage::registry('menuitem');
125
+ }
126
+ }
app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Edit/Tab/Stores.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * store selection tab
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+
23
+ */
24
+ class JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Edit_Tab_Stores extends Mage_Adminhtml_Block_Widget_Form{
25
+ /**
26
+ * prepare the form
27
+ * @access protected
28
+ * @return JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Edit_Tab_Stores
29
+ */
30
+ protected function _prepareForm(){
31
+ $form = new Varien_Data_Form();
32
+ $form->setFieldNameSuffix('menuitem');
33
+ $this->setForm($form);
34
+ $fieldset = $form->addFieldset('menuitem_stores_form', array('legend'=>Mage::helper('megamenu2')->__('Store views')));
35
+ $field = $fieldset->addField('store_id', 'multiselect', array(
36
+ 'name' => 'stores[]',
37
+ 'label' => Mage::helper('megamenu2')->__('Store Views'),
38
+ 'title' => Mage::helper('megamenu2')->__('Store Views'),
39
+ 'required' => true,
40
+ 'values'=> Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
41
+ ));
42
+ $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
43
+ $field->setRenderer($renderer);
44
+ $form->addValues(Mage::registry('current_menuitem')->getData());
45
+ return parent::_prepareForm();
46
+ }
47
+ }
app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Edit/Tabs.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item admin edit tabs
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+
23
+ */
24
+ class JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs{
25
+ /**
26
+ * Initialize Tabs
27
+ * @access public
28
+ * @return void
29
+ */
30
+ public function __construct(){
31
+ parent::__construct();
32
+ $this->setId('menuitem_info_tabs');
33
+ $this->setDestElementId('menuitem_tab_content');
34
+ $this->setTitle(Mage::helper('megamenu2')->__('Menu Item'));
35
+ $this->setTemplate('widget/tabshoriz.phtml');
36
+ }
37
+ /**
38
+ * Retrieve menu item entity
39
+ * @access public
40
+ * @return JScriptz_MegaMenu2_Model_Menuitem
41
+
42
+ */
43
+ public function getMenuitem(){
44
+ return Mage::registry('current_menuitem');
45
+ }
46
+ /**
47
+ * Prepare Layout Content
48
+ * @access public
49
+ * @return JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Edit_Tabs
50
+ */
51
+ protected function _prepareLayout(){
52
+ $this->addTab('form_menuitem', array(
53
+ 'label' => Mage::helper('megamenu2')->__('Menu Item'),
54
+ 'title' => Mage::helper('megamenu2')->__('Menu Item'),
55
+ 'content' => $this->getLayout()->createBlock('megamenu2/adminhtml_menuitem_edit_tab_form')->toHtml(),
56
+ ));
57
+ if (!Mage::app()->isSingleStoreMode()){
58
+ $this->addTab('form_store_menuitem', array(
59
+ 'label' => Mage::helper('megamenu2')->__('Store views'),
60
+ 'title' => Mage::helper('megamenu2')->__('Store views'),
61
+ 'content' => $this->getLayout()->createBlock('megamenu2/adminhtml_menuitem_edit_tab_stores')->toHtml(),
62
+ ));
63
+ }
64
+ return parent::_prepareLayout();
65
+ }
66
+ }
app/code/community/JScriptz/MegaMenu2/Block/Adminhtml/Menuitem/Tree.php ADDED
@@ -0,0 +1,303 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item admin tree block
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+ */
23
+ class JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Tree extends JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Abstract{
24
+ /**
25
+ * constructor
26
+ * @access public
27
+ * @return void
28
+ */
29
+ public function __construct(){
30
+ parent::__construct();
31
+ $this->setTemplate('jscriptz_megamenu2/menuitem/tree.phtml');
32
+ $this->setUseAjax(true);
33
+ $this->_withProductCount = true;
34
+ }
35
+ /**
36
+ * prepare the layout
37
+ * @access protected
38
+ * @return JScriptz_MegaMenu2_Block_Adminhtml_Menuitem_Tree
39
+ */
40
+ protected function _prepareLayout(){
41
+ $addUrl = $this->getUrl("*/*/add", array(
42
+ '_current'=>true,
43
+ 'id'=>null,
44
+ '_query' => false
45
+ ));
46
+
47
+ $this->setChild('add_sub_button',
48
+ $this->getLayout()->createBlock('adminhtml/widget_button')
49
+ ->setData(array(
50
+ 'label' => Mage::helper('megamenu2')->__('Add Child Menu Item'),
51
+ 'onclick' => "addNew('".$addUrl."', false)",
52
+ 'class' => 'add',
53
+ 'id'=> 'add_child_menuitem_button',
54
+ 'style' => $this->canAddChild() ? '' : 'display: none;'
55
+ ))
56
+ );
57
+
58
+ $this->setChild('add_root_button',
59
+ $this->getLayout()->createBlock('adminhtml/widget_button')
60
+ ->setData(array(
61
+ 'label' => Mage::helper('megamenu2')->__('Add Root Menu Item'),
62
+ 'onclick' => "addNew('".$addUrl."', true)",
63
+ 'class' => 'add',
64
+ 'id'=> 'add_root_menuitem_button'
65
+ ))
66
+ );
67
+ return parent::_prepareLayout();
68
+ }
69
+ /**
70
+ * get the menu item collection
71
+ * @access public
72
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection
73
+ */
74
+ public function getMenuitemCollection(){
75
+ $collection = $this->getData('menuitem_collection');
76
+ if (is_null($collection)) {
77
+ $collection = Mage::getModel('megamenu2/menuitem')->getCollection();
78
+ $this->setData('menuitem_collection', $collection);
79
+ }
80
+ return $collection;
81
+ }
82
+ /**
83
+ * get html for add root button
84
+ * @access public
85
+ * @return string
86
+ */
87
+ public function getAddRootButtonHtml(){
88
+ return $this->getChildHtml('add_root_button');
89
+ }
90
+ /**
91
+ * get html for add child button
92
+ * @access public
93
+ * @return string
94
+ */
95
+ public function getAddSubButtonHtml(){
96
+ return $this->getChildHtml('add_sub_button');
97
+ }
98
+ /**
99
+ * get html for expand button
100
+ * @access public
101
+ * @return string
102
+ */
103
+ public function getExpandButtonHtml(){
104
+ return $this->getChildHtml('expand_button');
105
+ }
106
+ /**
107
+ * get html for add collapse button
108
+ * @access public
109
+ * @return string
110
+ */
111
+ public function getCollapseButtonHtml(){
112
+ return $this->getChildHtml('collapse_button');
113
+ }
114
+ /**
115
+ * get url for tree load
116
+ * @access public
117
+ * @param mxed $expanded
118
+ * @return string
119
+ */
120
+ public function getLoadTreeUrl($expanded=null){
121
+ $params = array('_current'=>true, 'id'=>null,'store'=>null);
122
+ if ((is_null($expanded) && Mage::getSingleton('admin/session')->getMenuitemIsTreeWasExpanded())|| $expanded == true) {
123
+ $params['expand_all'] = true;
124
+ }
125
+ return $this->getUrl('*/*/menuitemsJson', $params);
126
+ }
127
+ /**
128
+ * get url for loading nodes
129
+ * @access public
130
+ * @return string
131
+ */
132
+ public function getNodesUrl(){
133
+ return $this->getUrl('*/megamenu2_menuitems/jsonTree');
134
+ }
135
+ /**
136
+ * check if tree is expanded
137
+ * @access public
138
+ * @return string
139
+ */
140
+ public function getIsWasExpanded(){
141
+ return Mage::getSingleton('admin/session')->getMenuitemIsTreeWasExpanded();
142
+ }
143
+ /**
144
+ * get url for moving menu item
145
+ * @access public
146
+ * @return string
147
+ */
148
+ public function getMoveUrl(){
149
+ return $this->getUrl('*/megamenu2_menuitem/move');
150
+ }
151
+ /**
152
+ * get the tree as json
153
+ * @access public
154
+ * @param mixed $parentNodeMenuitem
155
+ * @return string
156
+ */
157
+ public function getTree($parentNodeMenuitem = null){
158
+ $rootArray = $this->_getNodeJson($this->getRoot($parentNodeMenuitem));
159
+ $tree = isset($rootArray['children']) ? $rootArray['children'] : array();
160
+ return $tree;
161
+ }
162
+ /**
163
+ * get the tree as json
164
+ * @access public
165
+ * @param mixed $parentNodeMenuitem
166
+ * @return string
167
+ */
168
+ public function getTreeJson($parentNodeMenuitem = null){
169
+ $rootArray = $this->_getNodeJson($this->getRoot($parentNodeMenuitem));
170
+ $json = Mage::helper('core')->jsonEncode(isset($rootArray['children']) ? $rootArray['children'] : array());
171
+ return $json;
172
+ }
173
+
174
+ /**
175
+ * Get JSON of array of menu items, that are breadcrumbs for specified menu item path
176
+ * @access public
177
+ * @param string $path
178
+ * @param string $javascriptVarName
179
+ * @return string
180
+ */
181
+ public function getBreadcrumbsJavascript($path, $javascriptVarName){
182
+ if (empty($path)) {
183
+ return '';
184
+ }
185
+
186
+ $menuitems = Mage::getResourceSingleton('megamenu2/menuitem_tree')->loadBreadcrumbsArray($path);
187
+ if (empty($menuitems)) {
188
+ return '';
189
+ }
190
+ foreach ($menuitems as $key => $menuitem) {
191
+ $menuitems[$key] = $this->_getNodeJson($menuitem);
192
+ }
193
+ return
194
+ '<script type="text/javascript">'
195
+ . $javascriptVarName . ' = ' . Mage::helper('core')->jsonEncode($menuitems) . ';'
196
+ . ($this->canAddChild() ? '$("add_child_menuitem_button").show();' : '$("add_child_menuitem_button").hide();')
197
+ . '</script>';
198
+ }
199
+
200
+ /**
201
+ * Get JSON of a tree node or an associative array
202
+ * @access protected
203
+ * @param Varien_Data_Tree_Node|array $node
204
+ * @param int $level
205
+ * @return string
206
+ */
207
+ protected function _getNodeJson($node, $level = 0){
208
+ // create a node from data array
209
+ if (is_array($node)) {
210
+ $node = new Varien_Data_Tree_Node($node, 'entity_id', new Varien_Data_Tree);
211
+ }
212
+ $item = array();
213
+ $item['text'] = $this->buildNodeName($node);
214
+ $rootForStores = in_array($node->getEntityId(), $this->getRootIds());
215
+ $item['id'] = $node->getId();
216
+ $item['path'] = $node->getData('path');
217
+ $item['cls'] = 'folder';
218
+ if ($node->getStatus()){
219
+ $item['cls'] .= ' active-category';
220
+ }
221
+ else{
222
+ $item['cls'] .= ' no-active-category';
223
+ }
224
+ $item['allowDrop'] = true;
225
+ $item['allowDrag'] = true;
226
+ if ((int)$node->getChildrenCount()>0) {
227
+ $item['children'] = array();
228
+ }
229
+ $isParent = $this->_isParentSelectedMenuitem($node);
230
+ if ($node->hasChildren()) {
231
+ $item['children'] = array();
232
+ if (!($this->getUseAjax() && $node->getLevel() > 1 && !$isParent)) {
233
+ foreach ($node->getChildren() as $child) {
234
+ $item['children'][] = $this->_getNodeJson($child, $level+1);
235
+ }
236
+ }
237
+ }
238
+ if ($isParent || $node->getLevel() < 1) {
239
+ $item['expanded'] = true;
240
+ }
241
+ return $item;
242
+ }
243
+ /**
244
+ * Get node label
245
+ * @access public
246
+ * @param Varien_Object $node
247
+ * @return string
248
+ */
249
+ public function buildNodeName($node){
250
+ $result = $this->htmlEscape($node->getLinktitle());
251
+ return $result;
252
+ }
253
+ /**
254
+ * check if entity is movable
255
+ * @access protected
256
+ * @param Varien_Object $node
257
+ * @return bool
258
+ */
259
+ protected function _isMenuitemMoveable($node){
260
+ return true;
261
+ }
262
+ /**
263
+ * check if parent is selected
264
+ * @access protected
265
+ * @param Varien_Object $node
266
+ * @return bool
267
+
268
+ */
269
+ protected function _isParentSelectedMenuitem($node){
270
+ if ($node && $this->getMenuitem()) {
271
+ $pathIds = $this->getMenuitem()->getPathIds();
272
+ if (in_array($node->getId(), $pathIds)) {
273
+ return true;
274
+ }
275
+ }
276
+ return false;
277
+ }
278
+
279
+ /**
280
+ * Check if page loaded by outside link to menu item edit
281
+ * @access public
282
+ * @return boolean
283
+ */
284
+ public function isClearEdit(){
285
+ return (bool) $this->getRequest()->getParam('clear');
286
+ }
287
+ /**
288
+ * Check availability of adding root menu item
289
+ * @access public
290
+ * @return boolean
291
+ */
292
+ public function canAddRootMenuitem(){
293
+ return true;
294
+ }
295
+ /**
296
+ * Check availability of adding child menu item
297
+ * @access public
298
+ * @return boolean
299
+ */
300
+ public function canAddChild(){
301
+ return true;
302
+ }
303
+ }
app/code/community/JScriptz/MegaMenu2/Block/Html/Topmenu.php ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Html Block Topmenu
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+ */
23
+ class JScriptz_MegaMenu2_Block_Html_Topmenu extends Mage_Core_Block_Template
24
+ {
25
+ /**
26
+ * Top menu data tree
27
+ *
28
+ * @var Varien_Data_Tree_Node
29
+ */
30
+ protected $_menu;
31
+
32
+ /**
33
+ * Current entity key
34
+ *
35
+ * @var string|int
36
+ */
37
+ protected $_currentEntityKey;
38
+
39
+ /**
40
+ * Init top menu tree structure
41
+ */
42
+ public function _construct()
43
+ {
44
+ $this->_menu = new Varien_Data_Tree_Node(array(), 'root', new Varien_Data_Tree());
45
+
46
+ $this->addData(array(
47
+ 'cache_lifetime' => false,
48
+ ));
49
+ }
50
+
51
+ public function getMenuItem($entityID){
52
+
53
+ $mytable = Mage::getModel('megamenu2/menuitem')->getCollection()->getData();
54
+ return $mytable;
55
+
56
+ }
57
+ /**
58
+ * Get top menu html
59
+ *
60
+ * @param string $outermostClass
61
+ * @param string $childrenWrapClass
62
+ * @return string
63
+ */
64
+ public function getHtml($outermostClass = '', $childrenWrapClass = '')
65
+ {
66
+ Mage::dispatchEvent('page_block_html_topmenu_gethtml_before', array(
67
+ 'menu' => $this->_menu,
68
+ 'block' => $this
69
+ ));
70
+
71
+ $this->_menu->setOutermostClass($outermostClass);
72
+ $this->_menu->setChildrenWrapClass($childrenWrapClass);
73
+
74
+ $html = $this->_getHtml($this->_menu, $childrenWrapClass);
75
+
76
+ Mage::dispatchEvent('page_block_html_topmenu_gethtml_after', array(
77
+ 'menu' => $this->_menu,
78
+ 'html' => $html
79
+ ));
80
+
81
+ return $html;
82
+ }
83
+
84
+ /**
85
+ * Recursively generates top menu html from data that is specified in $menuTree
86
+ *
87
+ * @param Varien_Data_Tree_Node $menuTree
88
+ * @param string $childrenWrapClass
89
+ * @return string
90
+ */
91
+ protected function _getHtml(Varien_Data_Tree_Node $menuTree, $childrenWrapClass)
92
+ {
93
+ $html = '';
94
+
95
+ $children = $menuTree->getChildren();
96
+ $parentLevel = $menuTree->getLevel();
97
+ $childLevel = is_null($parentLevel) ? 0 : $parentLevel + 1;
98
+
99
+ $counter = 1;
100
+ $childrenCount = $children->count();
101
+
102
+ $parentPositionClass = $menuTree->getPositionClass();
103
+ $itemPositionClassPrefix = $parentPositionClass ? $parentPositionClass . '-' : 'nav-';
104
+
105
+ foreach ($children as $child) {
106
+
107
+ $child->setLevel($childLevel);
108
+ $child->setIsFirst($counter == 1);
109
+ $child->setIsLast($counter == $childrenCount);
110
+ $child->setPositionClass($itemPositionClassPrefix . $counter);
111
+
112
+ $outermostClassCode = '';
113
+ $outermostClass = $menuTree->getOutermostClass();
114
+
115
+ if ($childLevel == 0 && $outermostClass) {
116
+ $outermostClassCode = 'dropdown_flyout_parent';
117
+ $outermostClassCode = " class='dropdown_flyout_parent'";
118
+ $child->setClass($outermostClass);
119
+ }
120
+
121
+
122
+
123
+ if ($child->hasChildren()) {
124
+ $html .= "<li class='dropdown_parent'>";
125
+ $html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'
126
+ . $this->escapeHtml($child->getName()) . '</span></a>';
127
+ /*if (!empty($childrenWrapClass)) {
128
+ $html .= '<div class="' . $childrenWrapClass . '">';
129
+ }*/
130
+ $html .= "<ul class='dropdown_flyout_level' style='display:none'>";
131
+ $html .= $this->_getHtml($child, $childrenWrapClass);
132
+ $html .= '</ul>';
133
+
134
+ /*if (!empty($childrenWrapClass)) {
135
+ $html .= '</div>';
136
+ }*/
137
+ }
138
+ else{
139
+ $html .= "<li>";
140
+ $html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'
141
+ . $this->escapeHtml($child->getName()) . '</span></a></li>';
142
+ }
143
+ $html .= '</li>';
144
+
145
+ $counter++;
146
+ }
147
+
148
+ return $html;
149
+ }
150
+
151
+
152
+
153
+ /**
154
+ * Generates string with all attributes that should be present in menu item element
155
+ *
156
+ * @param Varien_Data_Tree_Node $item
157
+ * @return string
158
+ */
159
+ protected function _getRenderedMenuItemAttributes(Varien_Data_Tree_Node $item)
160
+ {
161
+ $html = '';
162
+ $attributes = $this->_getMenuItemAttributes($item);
163
+
164
+ foreach ($attributes as $attributeName => $attributeValue) {
165
+ $html .= ' ' . $attributeName . '="' . str_replace('"', '\"', $attributeValue) . '"';
166
+ }
167
+
168
+ return $html;
169
+ }
170
+
171
+ /**
172
+ * Returns array of menu item's attributes
173
+ *
174
+ * @param Varien_Data_Tree_Node $item
175
+ * @return array
176
+ */
177
+ protected function _getMenuItemAttributes(Varien_Data_Tree_Node $item)
178
+ {
179
+ $menuItemClasses = $this->_getMenuItemClasses($item);
180
+ $attributes = array(
181
+ 'class' => implode(' ', $menuItemClasses)
182
+ );
183
+
184
+ return $attributes;
185
+ }
186
+
187
+ /**
188
+ * Returns array of menu item's classes
189
+ *
190
+ * @param Varien_Data_Tree_Node $item
191
+ * @return array
192
+ */
193
+ protected function _getMenuItemClasses(Varien_Data_Tree_Node $item)
194
+ {
195
+ $classes = array();
196
+
197
+ $classes[] = 'level' . $item->getLevel();
198
+ $classes[] = $item->getPositionClass();
199
+
200
+ if ($item->getIsFirst()) {
201
+ $classes[] = 'first';
202
+ }
203
+
204
+ if ($item->getIsActive()) {
205
+ $classes[] = 'active';
206
+ }
207
+
208
+ if ($item->getIsLast()) {
209
+ $classes[] = 'last';
210
+ }
211
+
212
+ if ($item->getClass()) {
213
+ $classes[] = $item->getClass();
214
+ }
215
+
216
+ if ($item->hasChildren()) {
217
+ $classes[] = 'parent';
218
+ }
219
+
220
+ return $classes;
221
+ }
222
+
223
+ /**
224
+ * Retrieve cache key data
225
+ *
226
+ * @return array
227
+ */
228
+ public function getCacheKeyInfo()
229
+ {
230
+ $shortCacheId = array(
231
+ 'TOPMENU',
232
+ Mage::app()->getStore()->getId(),
233
+ Mage::getDesign()->getPackageName(),
234
+ Mage::getDesign()->getTheme('template'),
235
+ Mage::getSingleton('customer/session')->getCustomerGroupId(),
236
+ 'template' => $this->getTemplate(),
237
+ 'name' => $this->getNameInLayout(),
238
+ $this->getCurrentEntityKey()
239
+ );
240
+ $cacheId = $shortCacheId;
241
+
242
+ $shortCacheId = array_values($shortCacheId);
243
+ $shortCacheId = implode('|', $shortCacheId);
244
+ $shortCacheId = md5($shortCacheId);
245
+
246
+ $cacheId['entity_key'] = $this->getCurrentEntityKey();
247
+ $cacheId['short_cache_id'] = $shortCacheId;
248
+
249
+ return $cacheId;
250
+ }
251
+
252
+ /**
253
+ * Retrieve current entity key
254
+ *
255
+ * @return int|string
256
+ */
257
+ public function getCurrentEntityKey()
258
+ {
259
+ if (null === $this->_currentEntityKey) {
260
+ $this->_currentEntityKey = Mage::registry('current_entity_key')
261
+ ? Mage::registry('current_entity_key') : Mage::app()->getStore()->getRootCategoryId();
262
+ }
263
+ return $this->_currentEntityKey;
264
+ }
265
+ }
app/code/community/JScriptz/MegaMenu2/Controller/Adminhtml/MegaMenu2.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * module base admin controller
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+
23
+ */
24
+ class JScriptz_MegaMenu2_Controller_Adminhtml_MegaMenu2 extends Mage_Adminhtml_Controller_Action{
25
+ /**
26
+ * upload file and get the uploaded name
27
+ * @access public
28
+ * @param string $input
29
+ * @param string $destinationFolder
30
+ * @param array $data
31
+ * @return string
32
+ */
33
+ protected function _uploadAndGetName($input, $destinationFolder, $data){
34
+ try{
35
+ if (isset($data[$input]['delete'])){
36
+ return '';
37
+ }
38
+ else{
39
+ $uploader = new Varien_File_Uploader($input);
40
+ $uploader->setAllowRenameFiles(true);
41
+ $uploader->setFilesDispersion(true);
42
+ $uploader->setAllowCreateFolders(true);
43
+ $result = $uploader->save($destinationFolder);
44
+ return $result['file'];
45
+ }
46
+ }
47
+ catch (Exception $e){
48
+ if ($e->getCode() != Varien_File_Uploader::TMP_NAME_EMPTY){
49
+ throw $e;
50
+ }
51
+ else{
52
+ if (isset($data[$input]['value'])){
53
+ return $data[$input]['value'];
54
+ }
55
+ }
56
+ }
57
+ return '';
58
+ }
59
+ }
app/code/community/JScriptz/MegaMenu2/Helper/Data.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * MegaMenu2 default helper
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+ */
23
+ class JScriptz_MegaMenu2_Helper_Data extends Mage_Core_Helper_Abstract{
24
+ }
app/code/community/JScriptz/MegaMenu2/Helper/Menuitem.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item helper
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+ */
23
+ class JScriptz_MegaMenu2_Helper_Menuitem extends Mage_Core_Helper_Abstract{
24
+ const MENUITEM_ROOT_ID = 1;
25
+ /**
26
+ * get the root id
27
+ * @access public
28
+ * @return int
29
+ */
30
+ public function getRootMenuitemId(){
31
+ return self::MENUITEM_ROOT_ID;
32
+ }
33
+ /**
34
+ * check if breadcrumbs can be used
35
+ * @access public
36
+ * @return bool
37
+ */
38
+ public function getUseBreadcrumbs(){
39
+ return Mage::getStoreConfigFlag('megamenu2/menuitem/breadcrumbs');
40
+ }
41
+ }
app/code/community/JScriptz/MegaMenu2/Model/Menuitem.php ADDED
@@ -0,0 +1,307 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item model
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+ */
23
+ class JScriptz_MegaMenu2_Model_Menuitem extends Mage_Core_Model_Abstract{
24
+ /**
25
+ * Entity code.
26
+ * Can be used as part of method name for entity processing
27
+ */
28
+ const ENTITY= 'megamenu2_menuitem';
29
+ const CACHE_TAG = 'megamenu2_menuitem';
30
+ /**
31
+ * Prefix of model events names
32
+ * @var string
33
+ */
34
+ protected $_eventPrefix = 'megamenu2_menuitem';
35
+
36
+ /**
37
+ * Parameter name in event
38
+ * @var string
39
+ */
40
+ protected $_eventObject = 'menuitem';
41
+ /**
42
+ * constructor
43
+ * @access public
44
+ * @return void
45
+ */
46
+ public function _construct(){
47
+ parent::_construct();
48
+ $this->_init('megamenu2/menuitem');
49
+ }
50
+ /**
51
+ * before save menu item
52
+ * @access protected
53
+ * @return JScriptz_MegaMenu2_Model_Menuitem
54
+ */
55
+ protected function _beforeSave(){
56
+ parent::_beforeSave();
57
+ $now = Mage::getSingleton('core/date')->gmtDate();
58
+ if ($this->isObjectNew()){
59
+ $this->setCreatedAt($now);
60
+ }
61
+ $this->setUpdatedAt($now);
62
+ return $this;
63
+ }
64
+ /**
65
+ * get the menuitem Menu HTML
66
+ * @access public
67
+ * @return string
68
+ */
69
+ public function getMenuhtml(){
70
+ $menuhtml = $this->getData('menuhtml');
71
+ $helper = Mage::helper('cms');
72
+ $processor = $helper->getBlockTemplateProcessor();
73
+ $html = $processor->filter($menuhtml);
74
+ return $html;
75
+ }
76
+ /**
77
+ * save menuitem relation
78
+ * @access public
79
+ * @return JScriptz_MegaMenu2_Model_Menuitem
80
+ */
81
+ protected function _afterSave() {
82
+ return parent::_afterSave();
83
+ }
84
+ /**
85
+ * get the tree model
86
+ * @access public
87
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Tree
88
+
89
+ */
90
+ public function getTreeModel(){
91
+ return Mage::getResourceModel('megamenu2/menuitem_tree');
92
+ }
93
+ /**
94
+ * get tree model instance
95
+ * @access public
96
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Tree
97
+ */
98
+ public function getTreeModelInstance(){
99
+ if (is_null($this->_treeModel)) {
100
+ $this->_treeModel = Mage::getResourceSingleton('megamenu2/menuitem_tree');
101
+ }
102
+ return $this->_treeModel;
103
+ }
104
+ /**
105
+ * Move menu item
106
+ * @access public
107
+ * @param int $parentId new parent menu item id
108
+ * @param int $afterMenuitemId menu item id after which we have put current menu item
109
+ * @return JScriptz_MegaMenu2_Model_Menuitem
110
+ */
111
+ public function move($parentId, $afterMenuitemId){
112
+ $parent = Mage::getModel('megamenu2/menuitem')->load($parentId);
113
+ if (!$parent->getId()) {
114
+ Mage::throwException(
115
+ Mage::helper('megamenu2')->__('Menu Item move operation is not possible: the new parent menu item was not found.')
116
+ );
117
+ }
118
+ if (!$this->getId()) {
119
+ Mage::throwException(
120
+ Mage::helper('megamenu2')->__('Menu Item move operation is not possible: the current menu item was not found.')
121
+ );
122
+ }
123
+ elseif ($parent->getId() == $this->getId()) {
124
+ Mage::throwException(
125
+ Mage::helper('megamenu2')->__('Menu Item move operation is not possible: parent menu item is equal to child menu item.')
126
+ );
127
+ }
128
+ $this->setMovedMenuitemId($this->getId());
129
+ $eventParams = array(
130
+ $this->_eventObject => $this,
131
+ 'parent' => $parent,
132
+ 'menuitem_id' => $this->getId(),
133
+ 'prev_parent_id' => $this->getParentId(),
134
+ 'parent_id' => $parentId
135
+ );
136
+ $moveComplete = false;
137
+ $this->_getResource()->beginTransaction();
138
+ try {
139
+ $this->getResource()->changeParent($this, $parent, $afterMenuitemId);
140
+ $this->_getResource()->commit();
141
+ $this->setAffectedMenuitemIds(array($this->getId(), $this->getParentId(), $parentId));
142
+ $moveComplete = true;
143
+ }
144
+ catch (Exception $e) {
145
+ $this->_getResource()->rollBack();
146
+ throw $e;
147
+ }
148
+ if ($moveComplete) {
149
+ Mage::app()->cleanCache(array(self::CACHE_TAG));
150
+ }
151
+ return $this;
152
+ }
153
+ /**
154
+ * Get the parent menu item
155
+ * @access public
156
+ * @return JScriptz_MegaMenu2_Model_Menuitem
157
+ */
158
+ public function getParentMenuitem(){
159
+ if (!$this->hasData('parent_menuitem')) {
160
+ $this->setData('parent_menuitem', Mage::getModel('megamenu2/menuitem')->load($this->getParentId()));
161
+ }
162
+ return $this->_getData('parent_menuitem');
163
+ }
164
+ /**
165
+ * Get the parent id
166
+ * @access public
167
+ * @return int
168
+ */
169
+ public function getParentId(){
170
+ $parentIds = $this->getParentIds();
171
+ return intval(array_pop($parentIds));
172
+ }
173
+ /**
174
+ * Get all parent menu items ids
175
+ * @access public
176
+ * @return array
177
+ */
178
+ public function getParentIds(){
179
+ return array_diff($this->getPathIds(), array($this->getId()));
180
+ }
181
+ /**
182
+ * Get all menu items children
183
+ * @access public
184
+ * @param bool $asArray
185
+ * @return mixed (array|string)
186
+ */
187
+ public function getAllChildren($asArray = false){
188
+ $children = $this->getResource()->getAllChildren($this);
189
+ if ($asArray) {
190
+ return $children;
191
+ }
192
+ else {
193
+ return implode(',', $children);
194
+ }
195
+ }
196
+ /**
197
+ * Get all menu items children
198
+ * @access public
199
+ * @return string
200
+ */
201
+ public function getChildren(){
202
+ return implode(',', $this->getResource()->getChildren($this, false));
203
+ }
204
+ /**
205
+ * check the id
206
+ * @access public
207
+ * @return bool
208
+ */
209
+ public function checkId($id){
210
+ return $this->_getResource()->checkId($id);
211
+ }
212
+ /**
213
+ * Get array menu items ids which are part of menu item path
214
+ * @access public
215
+ * @return array
216
+ */
217
+ public function getPathIds(){
218
+ $ids = $this->getData('path_ids');
219
+ if (is_null($ids)) {
220
+ $ids = explode('/', $this->getPath());
221
+ $this->setData('path_ids', $ids);
222
+ }
223
+ return $ids;
224
+ }
225
+ /**
226
+ * Retrieve level
227
+ * @access public
228
+ * @return int
229
+ */
230
+ public function getLevel(){
231
+ if (!$this->hasLevel()) {
232
+ return count(explode('/', $this->getPath())) - 1;
233
+ }
234
+ return $this->getData('level');
235
+ }
236
+ /**
237
+ * Verify menu item ids
238
+ * @access public
239
+ * @param array $ids
240
+ * @return bool
241
+ */
242
+ public function verifyIds(array $ids){
243
+ return $this->getResource()->verifyIds($ids);
244
+ }
245
+ /**
246
+ * check if menu item has children
247
+ * @access public
248
+ * @return bool
249
+ */
250
+ public function hasChildren(){
251
+ return $this->_getResource()->getChildrenAmount($this) > 0;
252
+ }
253
+ /**
254
+ * check if menu item can be deleted
255
+ * @access protected
256
+ * @return JScriptz_MegaMenu2_Model_Menuitem
257
+ */
258
+ protected function _beforeDelete(){
259
+ if ($this->getResource()->isForbiddenToDelete($this->getId())) {
260
+ Mage::throwException(Mage::helper('megamenu2')->__("Can't delete root menu item."));
261
+ }
262
+ return parent::_beforeDelete();
263
+ }
264
+ /**
265
+ * get the menu items
266
+ * @access public
267
+ * @param JScriptz_MegaMenu2_Model_Menuitem $parent
268
+ * @param int $recursionLevel
269
+ * @param bool $sorted
270
+ * @param bool $asCollection
271
+ * @param bool $toLoad
272
+
273
+ */
274
+ public function getMenuitems($parent, $recursionLevel = 0, $sorted=false, $asCollection=false, $toLoad=true){
275
+ return $this->getResource()->getMenuitems($parent, $recursionLevel, $sorted, $asCollection, $toLoad);
276
+ }
277
+ /**
278
+ * Return parent menu items of current menu item
279
+ * @access public
280
+ * @return array
281
+ */
282
+ public function getParentMenuitems(){
283
+ return $this->getResource()->getParentMenuitems($this);
284
+ }
285
+ /**
286
+ * Retuen children menu items of current menu item
287
+ * @access public
288
+ * @return array
289
+ */
290
+ public function getChildrenMenuitems(){
291
+ return $this->getResource()->getChildrenMenuitems($this);
292
+ }
293
+ /**
294
+ * check if parents are enabled
295
+ * @access public
296
+ * @return bool
297
+ */
298
+ public function getStatusPath(){
299
+ $parents = $this->getParentMenuitems();
300
+ foreach ($parents as $parent){
301
+ if (!$parent->getStatus()){
302
+ return false;
303
+ }
304
+ }
305
+ return $this->getStatus();
306
+ }
307
+ }
app/code/community/JScriptz/MegaMenu2/Model/Resource/Menuitem.php ADDED
@@ -0,0 +1,552 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item resource model
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+ */
23
+ class JScriptz_MegaMenu2_Model_Resource_Menuitem extends Mage_Core_Model_Resource_Db_Abstract{
24
+ /**
25
+ * Menu Item tree object
26
+ * @var Varien_Data_Tree_Db */
27
+ protected $_tree;
28
+ /**
29
+ * constructor
30
+ * @access public
31
+ * @return void
32
+ */
33
+ public function _construct(){
34
+ $this->_init('megamenu2/menuitem', 'entity_id');
35
+ }
36
+
37
+ /**
38
+ * Get store ids to which specified item is assigned
39
+ * @access public
40
+ * @param int $menuitemId
41
+ * @return array
42
+ */
43
+ public function lookupStoreIds($menuitemId){
44
+ $adapter = $this->_getReadAdapter();
45
+ $select = $adapter->select()
46
+ ->from($this->getTable('megamenu2/menuitem_store'), 'store_id')
47
+ ->where('menuitem_id = ?',(int)$menuitemId);
48
+ return $adapter->fetchCol($select);
49
+ }
50
+ /**
51
+ * Perform operations after object load
52
+ * @access public
53
+ * @param Mage_Core_Model_Abstract $object
54
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem
55
+ */
56
+ protected function _afterLoad(Mage_Core_Model_Abstract $object){
57
+ if ($object->getId()) {
58
+ $stores = $this->lookupStoreIds($object->getId());
59
+ $object->setData('store_id', $stores);
60
+ }
61
+ return parent::_afterLoad($object);
62
+ }
63
+
64
+ /**
65
+ * Retrieve select object for load object data
66
+ *
67
+ * @param string $field
68
+ * @param mixed $value
69
+ * @param JScriptz_MegaMenu2_Model_Menuitem $object
70
+ * @return Zend_Db_Select */
71
+ protected function _getLoadSelect($field, $value, $object){
72
+ $select = parent::_getLoadSelect($field, $value, $object);
73
+ if ($object->getStoreId()) {
74
+ $storeIds = array(Mage_Core_Model_App::ADMIN_STORE_ID, (int)$object->getStoreId());
75
+ $select->join(
76
+ array('megamenu2_menuitem_store' => $this->getTable('megamenu2/menuitem_store')),
77
+ $this->getMainTable() . '.entity_id = megamenu2_menuitem_store.menuitem_id',
78
+ array()
79
+ )
80
+ ->where('megamenu2_menuitem_store.store_id IN (?)', $storeIds)
81
+ ->order('megamenu2_menuitem_store.store_id DESC')
82
+ ->limit(1);
83
+ }
84
+ return $select;
85
+ }
86
+ /**
87
+ * Retrieve menu item tree object
88
+ * @access protected
89
+ * @return Varien_Data_Tree_Db
90
+ */
91
+ protected function _getTree(){
92
+ if (!$this->_tree) {
93
+ $this->_tree = Mage::getResourceModel('megamenu2/menuitem_tree')->load();
94
+ }
95
+ return $this->_tree;
96
+ }
97
+ /**
98
+ * Process menu item data before delete
99
+ * update children count for parent menu item
100
+ * delete child menu items
101
+ * @access protected
102
+ * @param Varien_Object $object
103
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem
104
+ */
105
+ protected function _beforeDelete(Mage_Core_Model_Abstract $object){
106
+ parent::_beforeDelete($object);
107
+ /**
108
+ * Update children count for all parent menu items
109
+ */
110
+ $parentIds = $object->getParentIds();
111
+ if ($parentIds) {
112
+ $childDecrease = $object->getChildrenCount() + 1; // +1 is itself
113
+ $data = array('children_count' => new Zend_Db_Expr('children_count - ' . $childDecrease));
114
+ $where = array('entity_id IN(?)' => $parentIds);
115
+ $this->_getWriteAdapter()->update( $this->getMainTable(), $data, $where);
116
+ }
117
+ $this->deleteChildren($object);
118
+ return $this;
119
+ }
120
+ /**
121
+ * Delete children menu items of specific menu item
122
+ * @access public
123
+ * @param Varien_Object $object
124
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem
125
+ */
126
+ public function deleteChildren(Varien_Object $object){
127
+ $adapter = $this->_getWriteAdapter();
128
+ $pathField = $adapter->quoteIdentifier('path');
129
+ $select = $adapter->select()
130
+ ->from($this->getMainTable(), array('entity_id'))
131
+ ->where($pathField . ' LIKE :c_path');
132
+ $childrenIds = $adapter->fetchCol($select, array('c_path' => $object->getPath() . '/%'));
133
+ if (!empty($childrenIds)) {
134
+ $adapter->delete(
135
+ $this->getMainTable(),
136
+ array('entity_id IN (?)' => $childrenIds)
137
+ );
138
+ }
139
+ /**
140
+ * Add deleted children ids to object
141
+ * This data can be used in after delete event
142
+ */
143
+ $object->setDeletedChildrenIds($childrenIds);
144
+ return $this;
145
+ }
146
+ /**
147
+ * Process menu item data after save menu item object
148
+ * @access protected
149
+ * @param Varien_Object $object
150
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem
151
+ */
152
+ protected function _afterSave(Mage_Core_Model_Abstract $object){
153
+ if (substr($object->getPath(), -1) == '/') {
154
+ $object->setPath($object->getPath() . $object->getId());
155
+ $this->_savePath($object);
156
+ }
157
+ $oldStores = $this->lookupStoreIds($object->getId());
158
+ $newStores = (array)$object->getStores();
159
+ if (empty($newStores)) {
160
+ $newStores = (array)$object->getStoreId();
161
+ }
162
+ $table = $this->getTable('megamenu2/menuitem_store');
163
+ $insert = array_diff($newStores, $oldStores);
164
+ $delete = array_diff($oldStores, $newStores);
165
+ if ($delete) {
166
+ $where = array(
167
+ 'menuitem_id = ?' => (int) $object->getId(),
168
+ 'store_id IN (?)' => $delete
169
+ );
170
+ $this->_getWriteAdapter()->delete($table, $where);
171
+ }
172
+ if ($insert) {
173
+ $data = array();
174
+ foreach ($insert as $storeId) {
175
+ $data[] = array(
176
+ 'menuitem_id' => (int) $object->getId(),
177
+ 'store_id' => (int) $storeId
178
+ );
179
+ }
180
+ $this->_getWriteAdapter()->insertMultiple($table, $data);
181
+ }
182
+ return parent::_afterSave($object);
183
+ }
184
+
185
+ /**
186
+ * Update path field
187
+ * @access protected
188
+ * @param JScriptz_MegaMenu2_Model_Menuitem $object
189
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem
190
+ */
191
+ protected function _savePath($object){
192
+ if ($object->getId()) {
193
+ $this->_getWriteAdapter()->update(
194
+ $this->getMainTable(),
195
+ array('path' => $object->getPath()),
196
+ array('entity_id = ?' => $object->getId())
197
+ );
198
+ }
199
+ return $this;
200
+ }
201
+
202
+ /**
203
+ * Get maximum position of child menu items by specific tree path
204
+ * @access protected
205
+ * @param string $path
206
+ * @return int
207
+ */
208
+ protected function _getMaxPosition($path){
209
+ $adapter = $this->getReadConnection();
210
+ $positionField = $adapter->quoteIdentifier('position');
211
+ $level = count(explode('/', $path));
212
+ $bind = array(
213
+ 'c_level' => $level,
214
+ 'c_path' => $path . '/%'
215
+ );
216
+ $select = $adapter->select()
217
+ ->from($this->getMainTable(), 'MAX(' . $positionField . ')')
218
+ ->where($adapter->quoteIdentifier('path') . ' LIKE :c_path')
219
+ ->where($adapter->quoteIdentifier('level') . ' = :c_level');
220
+
221
+ $position = $adapter->fetchOne($select, $bind);
222
+ if (!$position) {
223
+ $position = 0;
224
+ }
225
+ return $position;
226
+ }
227
+ /**
228
+ * Get children menu items count
229
+ * @access public
230
+ * @param int $menuitemId
231
+ * @return int
232
+ */
233
+ public function getChildrenCount($menuitemId){
234
+ $select = $this->_getReadAdapter()->select()
235
+ ->from($this->getMainTable(), 'children_count')
236
+ ->where('entity_id = :entity_id');
237
+ $bind = array('entity_id' => $menuitemId);
238
+ return $this->_getReadAdapter()->fetchOne($select, $bind);
239
+ }
240
+ /**
241
+ * Check if menu item id exist
242
+ * @access public
243
+ * @param int $entityId
244
+ * @return bool
245
+ */
246
+ public function checkId($entityId){
247
+ $select = $this->_getReadAdapter()->select()
248
+ ->from($this->getMainTable(), 'entity_id')
249
+ ->where('entity_id = :entity_id');
250
+ $bind = array('entity_id' => $entityId);
251
+ return $this->_getReadAdapter()->fetchOne($select, $bind);
252
+ }
253
+
254
+ /**
255
+ * Check array of menu items identifiers
256
+ * @access public
257
+ * @param array $ids
258
+ * @return array
259
+ */
260
+ public function verifyIds(array $ids){
261
+ if (empty($ids)) {
262
+ return array();
263
+ }
264
+ $select = $this->_getReadAdapter()->select()
265
+ ->from($this->getMainTable(), 'entity_id')
266
+ ->where('entity_id IN(?)', $ids);
267
+
268
+ return $this->_getReadAdapter()->fetchCol($select);
269
+ }
270
+ /**
271
+ * Process menu item data before saving
272
+ * prepare path and increment children count for parent menu items
273
+ * @access protected
274
+ * @param Varien_Object $object
275
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem
276
+ */
277
+ protected function _beforeSave(Mage_Core_Model_Abstract $object){
278
+ parent::_beforeSave($object);
279
+ if (!$object->getChildrenCount()) {
280
+ $object->setChildrenCount(0);
281
+ }
282
+ if ($object->getLevel() === null) {
283
+ $object->setLevel(1);
284
+ }
285
+ if (!$object->getId() && !$object->getInitialSetupFlag()) {
286
+ $object->setPosition($this->_getMaxPosition($object->getPath()) + 1);
287
+ $path = explode('/', $object->getPath());
288
+ $level = count($path);
289
+ $object->setLevel($level);
290
+ if ($level) {
291
+ $object->setParentId($path[$level - 1]);
292
+ }
293
+ $object->setPath($object->getPath() . '/');
294
+ $toUpdateChild = explode('/',$object->getPath());
295
+ $this->_getWriteAdapter()->update(
296
+ $this->getMainTable(),
297
+ array('children_count' => new Zend_Db_Expr('children_count+1')),
298
+ array('entity_id IN(?)' => $toUpdateChild)
299
+ );
300
+ }
301
+ return $this;
302
+ }
303
+ /**
304
+ * Get count of active/not active children menu items
305
+ *
306
+ * @param JScriptz_MegaMenu2_Model_Menuitem $menuitem
307
+ * @param bool $isActiveFlag
308
+ * @return int
309
+ */
310
+ public function getChildrenAmount($menuitem, $isActiveFlag = true){
311
+ $bind = array(
312
+ 'active_flag' => $isActiveFlag,
313
+ 'c_path' => $menuitem->getPath() . '/%'
314
+ );
315
+ $select = $adapter->select()
316
+ ->from(array('m' => $this->getMainTable()), array('COUNT(m.entity_id)'))
317
+ ->where('m.path LIKE :c_path')
318
+ ->where('status' . ' = :active_flag');
319
+ return $this->_getReadAdapter()->fetchOne($select, $bind);
320
+ }
321
+ /**
322
+ * Return parent menu items of menu item
323
+ * @access public
324
+ * @param JScriptz_MegaMenu2_Model_Menuitem $menuitem
325
+ * @return array
326
+ */
327
+ public function getParentMenuitems($menuitem){
328
+ $pathIds = array_reverse(explode('/', $menuitem->getPath()));
329
+ $menuitems = Mage::getResourceModel('megamenu2/menuitem_collection')
330
+ ->addFieldToFilter('entity_id', array('in' => $pathIds))
331
+ ->addFieldToFilter('status', 1)
332
+ ->load()
333
+ ->getItems();
334
+ return $menuitems;
335
+ }
336
+ /**
337
+ * Return child menu items
338
+ * @access public
339
+ * @param JScriptz_MegaMenu2_Model_Menuitem $menuitem
340
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection
341
+ */
342
+ public function getChildrenMenuitems($menuitem){
343
+ $collection = $menuitem->getCollection();
344
+ $collection
345
+ ->addFilter('status', 1)
346
+ ->addIdFilter($menuitem->getChildren())
347
+ ->setOrder('position', Varien_Db_Select::SQL_ASC)
348
+ ->load();
349
+ return $collection;
350
+ }
351
+ /**
352
+ * Return children ids of menu item
353
+ * @access public
354
+ * @param JScriptz_MegaMenu2_Model_Menuitem $menuitem
355
+ * @param boolean $recursive
356
+ * @return array
357
+ */
358
+ public function getChildren($menuitem, $recursive = true){
359
+ $bind = array(
360
+ 'c_path' => $menuitem->getPath() . '/%'
361
+ );
362
+ $select = $this->_getReadAdapter()->select()
363
+ ->from(array('m' => $this->getMainTable()), 'entity_id')
364
+ ->where('status = ?', 1)
365
+ ->where($this->_getReadAdapter()->quoteIdentifier('path') . ' LIKE :c_path');
366
+ if (!$recursive) {
367
+ $select->where($this->_getReadAdapter()->quoteIdentifier('level') . ' <= :c_level');
368
+ $bind['c_level'] = $menuitem->getLevel() + 1;
369
+ }
370
+ return $this->_getReadAdapter()->fetchCol($select, $bind);
371
+ }
372
+ /**
373
+ * Retrieve menu items
374
+ * @access public
375
+ * @param integer $parent
376
+ * @param integer $recursionLevel
377
+ * @param boolean|string $sorted
378
+ * @param boolean $asCollection
379
+ * @param boolean $toLoad
380
+ * @return Varien_Data_Tree_Node_Collection|JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection
381
+ */
382
+ public function getMenuitems($parent, $recursionLevel = 0, $sorted = false, $asCollection = false, $toLoad = true){
383
+ $tree = Mage::getResourceModel('megamenu2/menuitem_tree');
384
+ $nodes = $tree->loadNode($parent)
385
+ ->loadChildren($recursionLevel)
386
+ ->getChildren();
387
+ $tree->addCollectionData(null, $sorted, $parent, $toLoad, true);
388
+ if ($asCollection) {
389
+ return $tree->getCollection();
390
+ }
391
+ return $nodes;
392
+ }
393
+ /**
394
+ * Return all children ids of menuitem (with menuitem id)
395
+ * @access public
396
+ * @param JScriptz_MegaMenu2_Model_Menuitem $menuitem
397
+ * @return array
398
+ */
399
+ public function getAllChildren($menuitem){
400
+ $children = $this->getChildren($menuitem);
401
+ $myId = array($menuitem->getId());
402
+ $children = array_merge($myId, $children);
403
+ return $children;
404
+ }
405
+ /**
406
+ * Check menu item is forbidden to delete.
407
+ * @access public
408
+ * @param integer $menuitemId
409
+ * @return boolean
410
+ */
411
+ public function isForbiddenToDelete($menuitemId){
412
+ return ($menuitemId == Mage::helper('megamenu2/menuitem')->getRootMenuitemId());
413
+ }
414
+ /**
415
+ * Get menu item path value by its id
416
+ * @access public
417
+ * @param int $menuitemId
418
+ * @return string
419
+ */
420
+ public function getMenuitemPathById($menuitemId){
421
+ $select = $this->getReadConnection()->select()
422
+ ->from($this->getMainTable(), array('path'))
423
+ ->where('entity_id = :entity_id');
424
+ $bind = array('entity_id' => (int)$menuitemId);
425
+ return $this->getReadConnection()->fetchOne($select, $bind);
426
+ }
427
+ /**
428
+ * Move menu item to another parent node
429
+ * @access public
430
+ * @param JScriptz_MegaMenu2_Model_Menuitem $menuitem
431
+ * @param JScriptz_MegaMenu2_Model_Menuitem $newParent
432
+ * @param null|int $afterMenuitemId
433
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem
434
+ */
435
+ public function changeParent(JScriptz_MegaMenu2_Model_Menuitem $menuitem, JScriptz_MegaMenu2_Model_Menuitem $newParent, $afterMenuitemId = null){
436
+ $childrenCount = $this->getChildrenCount($menuitem->getId()) + 1;
437
+ $table = $this->getMainTable();
438
+ $adapter = $this->_getWriteAdapter();
439
+ $levelFiled = $adapter->quoteIdentifier('level');
440
+ $pathField = $adapter->quoteIdentifier('path');
441
+
442
+ /**
443
+ * Decrease children count for all old menu item parent menu items
444
+ */
445
+ $adapter->update(
446
+ $table,
447
+ array('children_count' => new Zend_Db_Expr('children_count - ' . $childrenCount)),
448
+ array('entity_id IN(?)' => $menuitem->getParentIds())
449
+ );
450
+ /**
451
+ * Increase children count for new menu item parents
452
+ */
453
+ $adapter->update(
454
+ $table,
455
+ array('children_count' => new Zend_Db_Expr('children_count + ' . $childrenCount)),
456
+ array('entity_id IN(?)' => $newParent->getPathIds())
457
+ );
458
+
459
+ $position = $this->_processPositions($menuitem, $newParent, $afterMenuitemId);
460
+
461
+ $newPath = sprintf('%s/%s', $newParent->getPath(), $menuitem->getId());
462
+ $newLevel = $newParent->getLevel() + 1;
463
+ $levelDisposition = $newLevel - $menuitem->getLevel();
464
+
465
+ /**
466
+ * Update children nodes path
467
+ */
468
+ $adapter->update(
469
+ $table,
470
+ array(
471
+ 'path' => new Zend_Db_Expr('REPLACE(' . $pathField . ','.
472
+ $adapter->quote($menuitem->getPath() . '/'). ', '.$adapter->quote($newPath . '/').')'
473
+ ),
474
+ 'level' => new Zend_Db_Expr( $levelFiled . ' + ' . $levelDisposition)
475
+ ),
476
+ array($pathField . ' LIKE ?' => $menuitem->getPath() . '/%')
477
+ );
478
+ /**
479
+ * Update moved menu item data
480
+ */
481
+ $data = array(
482
+ 'path' => $newPath,
483
+ 'level' => $newLevel,
484
+ 'position' =>$position,
485
+ 'parent_id' =>$newParent->getId()
486
+ );
487
+ $adapter->update($table, $data, array('entity_id = ?' => $menuitem->getId()));
488
+ // Update menu item object to new data
489
+ $menuitem->addData($data);
490
+ return $this;
491
+ }
492
+ /**
493
+ * Process positions of old parent menu item children and new parent menu item children.
494
+ * Get position for moved menu item
495
+ * @access protected
496
+ * @param JScriptz_MegaMenu2_Model_Menuitem $menuitem
497
+ * @param JScriptz_MegaMenu2_Model_Menuitem $newParent
498
+ * @param null|int $afterMenuitemId
499
+ * @return int
500
+ */
501
+ protected function _processPositions($menuitem, $newParent, $afterMenuitemId){
502
+ $table = $this->getMainTable();
503
+ $adapter= $this->_getWriteAdapter();
504
+ $positionField = $adapter->quoteIdentifier('position');
505
+
506
+ $bind = array(
507
+ 'position' => new Zend_Db_Expr($positionField . ' - 1')
508
+ );
509
+ $where = array(
510
+ 'parent_id = ?' => $menuitem->getParentId(),
511
+ $positionField . ' > ?' => $menuitem->getPosition()
512
+ );
513
+ $adapter->update($table, $bind, $where);
514
+
515
+ /**
516
+ * Prepare position value
517
+ */
518
+ if ($afterMenuitemId) {
519
+ $select = $adapter->select()
520
+ ->from($table,'position')
521
+ ->where('entity_id = :entity_id');
522
+ $position = $adapter->fetchOne($select, array('entity_id' => $afterMenuitemId));
523
+ $bind = array(
524
+ 'position' => new Zend_Db_Expr($positionField . ' + 1')
525
+ );
526
+ $where = array(
527
+ 'parent_id = ?' => $newParent->getId(),
528
+ $positionField . ' > ?' => $position
529
+ );
530
+ $adapter->update($table, $bind, $where);
531
+ }
532
+ elseif ($afterMenuitemId !== null) {
533
+ $position = 0;
534
+ $bind = array(
535
+ 'position' => new Zend_Db_Expr($positionField . ' + 1')
536
+ );
537
+ $where = array(
538
+ 'parent_id = ?' => $newParent->getId(),
539
+ $positionField . ' > ?' => $position
540
+ );
541
+ $adapter->update($table, $bind, $where);
542
+ }
543
+ else {
544
+ $select = $adapter->select()
545
+ ->from($table,array('position' => new Zend_Db_Expr('MIN(' . $positionField. ')')))
546
+ ->where('parent_id = :parent_id');
547
+ $position = $adapter->fetchOne($select, array('parent_id' => $newParent->getId()));
548
+ }
549
+ $position += 1;
550
+ return $position;
551
+ }
552
+ }
app/code/community/JScriptz/MegaMenu2/Model/Resource/Menuitem/Collection.php ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item collection resource model
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+ */
23
+ class JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract{
24
+ protected $_joinedFields = array();
25
+ /**
26
+ * constructor
27
+ * @access public
28
+ * @return void
29
+ */
30
+ public function _construct(){
31
+ parent::_construct();
32
+ $this->_init('megamenu2/menuitem');
33
+ $this->_map['fields']['store'] = 'store_table.store_id';
34
+ }
35
+ /**
36
+ * get menuitems as array
37
+ * @access protected
38
+ * @param string $valueField
39
+ * @param string $labelField
40
+ * @param array $additional
41
+ * @return array
42
+ */
43
+ protected function _toOptionArray($valueField='entity_id', $labelField='linktitle', $additional=array()){
44
+ return parent::_toOptionArray($valueField, $labelField, $additional);
45
+ }
46
+ /**
47
+ * get options hash
48
+ * @access protected
49
+ * @param string $valueField
50
+ * @param string $labelField
51
+ * @return array
52
+ */
53
+ protected function _toOptionHash($valueField='entity_id', $labelField='linktitle'){
54
+ return parent::_toOptionHash($valueField, $labelField);
55
+ }
56
+ /**
57
+ * Add filter by store
58
+ * @access public
59
+ * @param int|Mage_Core_Model_Store $store
60
+ * @param bool $withAdmin
61
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection
62
+ */
63
+ public function addStoreFilter($store, $withAdmin = true){
64
+ if (!isset($this->_joinedFields['store'])){
65
+ if ($store instanceof Mage_Core_Model_Store) {
66
+ $store = array($store->getId());
67
+ }
68
+ if (!is_array($store)) {
69
+ $store = array($store);
70
+ }
71
+ if ($withAdmin) {
72
+ $store[] = Mage_Core_Model_App::ADMIN_STORE_ID;
73
+ }
74
+ $this->addFilter('store', array('in' => $store), 'public');
75
+ $this->_joinedFields['store'] = true;
76
+ }
77
+ return $this;
78
+ }
79
+ /**
80
+ * Join store relation table if there is store filter
81
+ * @access protected
82
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection
83
+ */
84
+ protected function _renderFiltersBefore(){
85
+ if ($this->getFilter('store')) {
86
+ $this->getSelect()->join(
87
+ array('store_table' => $this->getTable('megamenu2/menuitem_store')),
88
+ 'main_table.entity_id = store_table.menuitem_id',
89
+ array()
90
+ )->group('main_table.entity_id');
91
+ /*
92
+ * Allow analytic functions usage because of one field grouping
93
+ */
94
+ $this->_useAnalyticFunction = true;
95
+ }
96
+ return parent::_renderFiltersBefore();
97
+ }
98
+ /**
99
+ * Get SQL for get record count.
100
+ * Extra GROUP BY strip added.
101
+ * @access public
102
+ * @return Varien_Db_Select
103
+ */
104
+ public function getSelectCountSql(){
105
+ $countSelect = parent::getSelectCountSql();
106
+ $countSelect->reset(Zend_Db_Select::GROUP);
107
+ return $countSelect;
108
+ }
109
+ /**
110
+ * Add Id filter
111
+ * @access public
112
+ * @param array $menuitemIds
113
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection
114
+ */
115
+ public function addIdFilter($menuitemIds){
116
+ if (is_array($menuitemIds)) {
117
+ if (empty($menuitemIds)) {
118
+ $condition = '';
119
+ }
120
+ else {
121
+ $condition = array('in' => $menuitemIds);
122
+ }
123
+ }
124
+ elseif (is_numeric($menuitemIds)) {
125
+ $condition = $menuitemIds;
126
+ }
127
+ elseif (is_string($menuitemIds)) {
128
+ $ids = explode(',', $menuitemIds);
129
+ if (empty($ids)) {
130
+ $condition = $menuitemIds;
131
+ }
132
+ else {
133
+ $condition = array('in' => $ids);
134
+ }
135
+ }
136
+ $this->addFieldToFilter('entity_id', $condition);
137
+ return $this;
138
+ }
139
+ /**
140
+ * Add menu item path filter
141
+ * @access public
142
+ * @param string $regexp
143
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection
144
+ */
145
+ public function addPathFilter($regexp){
146
+ $this->addFieldToFilter('path', array('regexp' => $regexp));
147
+ return $this;
148
+ }
149
+
150
+ /**
151
+ * Add menu item path filter
152
+ * @access public
153
+ * @param array|string $paths
154
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection
155
+ */
156
+ public function addPathsFilter($paths){
157
+ if (!is_array($paths)) {
158
+ $paths = array($paths);
159
+ }
160
+ $write = $this->getResource()->getWriteConnection();
161
+ $cond = array();
162
+ foreach ($paths as $path) {
163
+ $cond[] = $write->quoteInto('e.path LIKE ?', "$path%");
164
+ }
165
+ if ($cond) {
166
+ $this->getSelect()->where(join(' OR ', $cond));
167
+ }
168
+ return $this;
169
+ }
170
+ /**
171
+ * Add menu item level filter
172
+ * @access public
173
+ * @param int|string $level
174
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection
175
+ */
176
+ public function addLevelFilter($level){
177
+ $this->addFieldToFilter('level', array('lteq' => $level));
178
+ return $this;
179
+ }
180
+ /**
181
+ * Add root menu item filter
182
+ * @access public
183
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection */
184
+ public function addRootLevelFilter(){
185
+ $this->addFieldToFilter('path', array('neq' => '1'));
186
+ $this->addLevelFilter(1);
187
+ return $this;
188
+ }
189
+ /**
190
+ * Add order field
191
+ * @access public
192
+ * @param string $field
193
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection */
194
+ public function addOrderField($field){
195
+ $this->setOrder($field, self::SORT_ORDER_ASC);
196
+ return $this;
197
+ }
198
+ /**
199
+ * Add active menu item filter
200
+ * @access public
201
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection */
202
+ public function addStatusFilter(){
203
+ $this->addFieldToFilter('status', 1);
204
+ return $this;
205
+ }
206
+ }
app/code/community/JScriptz/MegaMenu2/Model/Resource/Menuitem/Tree.php ADDED
@@ -0,0 +1,389 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item tree resource model
19
+ * @category JScriptz
20
+ * @package JScriptz_MegaMenu2
21
+
22
+ */
23
+ class JScriptz_MegaMenu2_Model_Resource_Menuitem_Tree extends Varien_Data_Tree_Dbp{
24
+ const ID_FIELD = 'entity_id';
25
+ const PATH_FIELD = 'path';
26
+ const ORDER_FIELD = 'order';
27
+ const LEVEL_FIELD = 'level';
28
+ /**
29
+ * Menu Items resource collection
30
+ * @var JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection */
31
+ protected $_collection;
32
+ /**
33
+ * Inactive menu items ids
34
+ * @var array */
35
+ protected $_inactiveMenuitemIds = null;
36
+ /**
37
+ * Initialize tree
38
+ * @access public
39
+ * @return void
40
+ */
41
+ public function __construct(){
42
+ $resource = Mage::getSingleton('core/resource');
43
+ parent::__construct(
44
+ $resource->getConnection('megamenu2_write'),
45
+ $resource->getTableName('megamenu2/menuitem'),
46
+ array(
47
+ Varien_Data_Tree_Dbp::ID_FIELD => 'entity_id',
48
+ Varien_Data_Tree_Dbp::PATH_FIELD => 'path',
49
+ Varien_Data_Tree_Dbp::ORDER_FIELD=> 'position',
50
+ Varien_Data_Tree_Dbp::LEVEL_FIELD=> 'level',
51
+ )
52
+ );
53
+ }
54
+
55
+ /**
56
+ * Get menu items collection
57
+ * @access public
58
+ * @param boolean $sorted
59
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection
60
+ */
61
+ public function getCollection($sorted = false){
62
+ if (is_null($this->_collection)) {
63
+ $this->_collection = $this->_getDefaultCollection($sorted);
64
+ }
65
+ return $this->_collection;
66
+ }
67
+ /**
68
+ * set the collection
69
+ * @access public
70
+ * @param JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection $collection
71
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Tree */
72
+ public function setCollection($collection){
73
+ if (!is_null($this->_collection)) {
74
+ destruct($this->_collection);
75
+ }
76
+ $this->_collection = $collection;
77
+ return $this;
78
+ }
79
+ /**
80
+ * get the default collection
81
+ * @access protected
82
+ * @param boolean $sorted
83
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection */
84
+ protected function _getDefaultCollection($sorted = false){
85
+ $collection = Mage::getModel('megamenu2/menuitem')->getCollection();
86
+ if ($sorted) {
87
+ if (is_string($sorted)) {
88
+ $collection->setOrder($sorted);
89
+ }
90
+ else {
91
+ $collection->setOrder('name');
92
+ }
93
+ }
94
+ return $collection;
95
+ }
96
+ /**
97
+ * Executing parents move method and cleaning cache after it
98
+ * @access public
99
+ * @param unknown_type $menuitem
100
+ * @param unknown_type $newParent
101
+ * @param unknown_type $prevNode
102
+ */
103
+ public function move($menuitem, $newParent, $prevNode = null){
104
+ Mage::getResourceSingleton('megamenu2/menuitem')->move($menuitem->getId(), $newParent->getId());
105
+ parent::move($menuitem, $newParent, $prevNode);
106
+ $this->_afterMove($menuitem, $newParent, $prevNode);
107
+ }
108
+
109
+ /**
110
+ * Move tree after
111
+ * @access protected
112
+ * @param unknown_type $menuitem
113
+ * @param Varien_Data_Tree_Node $newParent
114
+ * @param Varien_Data_Tree_Node $prevNode
115
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Tree */
116
+ protected function _afterMove($menuitem, $newParent, $prevNode){
117
+ Mage::app()->cleanCache(array(JScriptz_MegaMenu2_Model_Menuitem::CACHE_TAG));
118
+ return $this;
119
+ }
120
+ /**
121
+ * Load whole menu item tree, that will include specified menu items ids.
122
+ * @access public
123
+ * @param array $ids
124
+ * @param bool $addCollectionData
125
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Tree
126
+ */
127
+ public function loadByIds($ids, $addCollectionData = true){
128
+ $levelField = $this->_conn->quoteIdentifier('level');
129
+ $pathField = $this->_conn->quoteIdentifier('path');
130
+ // load first two levels, if no ids specified
131
+ if (empty($ids)) {
132
+ $select = $this->_conn->select()
133
+ ->from($this->_table, 'entity_id')
134
+ ->where($levelField . ' <= 2');
135
+ $ids = $this->_conn->fetchCol($select);
136
+ }
137
+ if (!is_array($ids)) {
138
+ $ids = array($ids);
139
+ }
140
+ foreach ($ids as $key => $id) {
141
+ $ids[$key] = (int)$id;
142
+ }
143
+ // collect paths of specified IDs and prepare to collect all their parents and neighbours
144
+ $select = $this->_conn->select()
145
+ ->from($this->_table, array('path', 'level'))
146
+ ->where('entity_id IN (?)', $ids);
147
+ $where = array($levelField . '=0' => true);
148
+
149
+ foreach ($this->_conn->fetchAll($select) as $item) {
150
+ $pathIds = explode('/', $item['path']);
151
+ $level = (int)$item['level'];
152
+ while ($level > 0) {
153
+ $pathIds[count($pathIds) - 1] = '%';
154
+ $path = implode('/', $pathIds);
155
+ $where["$levelField=$level AND $pathField LIKE '$path'"] = true;
156
+ array_pop($pathIds);
157
+ $level--;
158
+ }
159
+ }
160
+ $where = array_keys($where);
161
+
162
+ // get all required records
163
+ if ($addCollectionData) {
164
+ $select = $this->_createCollectionDataSelect();
165
+ }
166
+ else {
167
+ $select = clone $this->_select;
168
+ $select->order($this->_orderField . ' ' . Varien_Db_Select::SQL_ASC);
169
+ }
170
+ $select->where(implode(' OR ', $where));
171
+
172
+ // get array of records and add them as nodes to the tree
173
+ $arrNodes = $this->_conn->fetchAll($select);
174
+ if (!$arrNodes) {
175
+ return false;
176
+ }
177
+ $childrenItems = array();
178
+ foreach ($arrNodes as $key => $nodeInfo) {
179
+ $pathToParent = explode('/', $nodeInfo[$this->_pathField]);
180
+ array_pop($pathToParent);
181
+ $pathToParent = implode('/', $pathToParent);
182
+ $childrenItems[$pathToParent][] = $nodeInfo;
183
+ }
184
+ $this->addChildNodes($childrenItems, '', null);
185
+ return $this;
186
+ }
187
+ /**
188
+ * Load array of menu item parents
189
+ * @access public
190
+ * @param string $path
191
+ * @param bool $addCollectionData
192
+ * @param bool $withRootNode
193
+ * @return array
194
+ */
195
+ public function loadBreadcrumbsArray($path, $addCollectionData = true, $withRootNode = false){
196
+ $pathIds = explode('/', $path);
197
+ if (!$withRootNode) {
198
+ array_shift($pathIds);
199
+ }
200
+ $result = array();
201
+ if (!empty($pathIds)) {
202
+ if ($addCollectionData) {
203
+ $select = $this->_createCollectionDataSelect(false);
204
+ }
205
+ else {
206
+ $select = clone $this->_select;
207
+ }
208
+ $select
209
+ ->where('main_table.entity_id IN(?)', $pathIds)
210
+ ->order($this->_conn->getLengthSql('main_table.path') . ' ' . Varien_Db_Select::SQL_ASC);
211
+ $result = $this->_conn->fetchAll($select);
212
+ }
213
+ return $result;
214
+ }
215
+ /**
216
+ * Obtain select for menu items
217
+ * By default everything from entity table is selected
218
+ * + name
219
+ * @access public
220
+ * @param bool $sorted
221
+ * @param array $optionalAttributes
222
+ * @return Zend_Db_Select
223
+ */
224
+ protected function _createCollectionDataSelect($sorted = true){
225
+ $select = $this->_getDefaultCollection($sorted ? $this->_orderField : false)->getSelect();
226
+ $menuitemsTable = Mage::getSingleton('core/resource')->getTableName('megamenu2/menuitem');
227
+ $subConcat = $this->_conn->getConcatSql(array('main_table.path', $this->_conn->quote('/%')));
228
+ $subSelect = $this->_conn->select()
229
+ ->from(array('see' => $menuitemsTable), null)
230
+ ->where('see.entity_id = main_table.entity_id')
231
+ ->orWhere('see.path LIKE ?', $subConcat);
232
+ return $select;
233
+ }
234
+ /**
235
+ * Get real existing menu item ids by specified ids
236
+ * @access public
237
+ * @param array $ids
238
+ * @return array
239
+ */
240
+ public function getExistingMenuitemIdsBySpecifiedIds($ids){
241
+ if (empty($ids)) {
242
+ return array();
243
+ }
244
+ if (!is_array($ids)) {
245
+ $ids = array($ids);
246
+ }
247
+ $select = $this->_conn->select()
248
+ ->from($this->_table, array('entity_id'))
249
+ ->where('entity_id IN (?)', $ids);
250
+ return $this->_conn->fetchCol($select);
251
+ }
252
+ /**
253
+ * add collection data
254
+ * @access public
255
+ * @param JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection $collection
256
+ * @param boolean $sorted
257
+ * @param array $exclude
258
+ * @param boolean $toLoad
259
+ * @param boolean $onlyActive
260
+ * @return JScriptz_MegaMenu2_Model_Resource_Category_Tree
261
+ */
262
+ public function addCollectionData($collection = null, $sorted = false, $exclude = array(), $toLoad = true, $onlyActive = false){
263
+ if (is_null($collection)) {
264
+ $collection = $this->getCollection($sorted);
265
+ } else {
266
+ $this->setCollection($collection);
267
+ }
268
+ if (!is_array($exclude)) {
269
+ $exclude = array($exclude);
270
+ }
271
+ $nodeIds = array();
272
+ foreach ($this->getNodes() as $node) {
273
+ if (!in_array($node->getId(), $exclude)) {
274
+ $nodeIds[] = $node->getId();
275
+ }
276
+ }
277
+ $collection->addIdFilter($nodeIds);
278
+ if ($onlyActive) {
279
+ $disabledIds = $this->_getDisabledIds($collection);
280
+ if ($disabledIds) {
281
+ $collection->addFieldToFilter('entity_id', array('nin' => $disabledIds));
282
+ }
283
+ $collection->addFieldToFilter('status', 1);
284
+ }
285
+ if ($toLoad) {
286
+ $collection->load();
287
+ foreach ($collection as $menuitem) {
288
+ if ($this->getNodeById($menuitem->getId())) {
289
+ $this->getNodeById($menuitem->getId())->addData($menuitem->getData());
290
+ }
291
+ }
292
+ foreach ($this->getNodes() as $node) {
293
+ if (!$collection->getItemById($node->getId()) && $node->getParent()) {
294
+ $this->removeNode($node);
295
+ }
296
+ }
297
+ }
298
+ return $this;
299
+ }
300
+ /**
301
+ * Add inactive menu items ids
302
+ * @access public
303
+ * @param unknown_type $ids
304
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Tree
305
+ */
306
+ public function addInactiveMenuitemIds($ids){
307
+ if (!is_array($this->_inactiveMenuitemIds)) {
308
+ $this->_initInactiveMenuitemIds();
309
+ }
310
+ $this->_inactiveMenuitemIds = array_merge($ids, $this->_inactiveMenuitemIds);
311
+ return $this;
312
+ }
313
+ /**
314
+ * Retrieve inactive menu items ids
315
+ * @access protected
316
+ * @return JScriptz_MegaMenu2_Model_Resource_Menuitem_Tree
317
+ */
318
+ protected function _initInactiveMenuitemIds(){
319
+ $this->_inactiveMenuitemIds = array();
320
+ return $this;
321
+ }
322
+ /**
323
+ * Retrieve inactive menu items ids
324
+ * @access public
325
+ * @return array
326
+ */
327
+ public function getInactiveMenuitemIds(){
328
+ if (!is_array($this->_inactiveMenuitemIds)) {
329
+ $this->_initInactiveMenuitemIds();
330
+ }
331
+ return $this->_inactiveMenuitemIds;
332
+ }
333
+ /**
334
+ * Return disable menu item ids
335
+ * @access protected
336
+ * @param JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection $collection
337
+ * @return array
338
+ */
339
+ protected function _getDisabledIds($collection){
340
+ $this->_inactiveItems = $this->getInactiveMenuitemIds();
341
+ $this->_inactiveItems = array_merge(
342
+ $this->_getInactiveItemIds($collection),
343
+ $this->_inactiveItems
344
+ );
345
+ $allIds = $collection->getAllIds();
346
+ $disabledIds = array();
347
+
348
+ foreach ($allIds as $id) {
349
+ $parents = $this->getNodeById($id)->getPath();
350
+ foreach ($parents as $parent) {
351
+ if (!$this->_getItemIsActive($parent->getId())){
352
+ $disabledIds[] = $id;
353
+ continue;
354
+ }
355
+ }
356
+ }
357
+ return $disabledIds;
358
+ }
359
+ /**
360
+ * Retrieve inactive menu item item ids
361
+ * @access protecte
362
+ * @param JScriptz_MegaMenu2_Model_Resource_Menuitem_Collection $collection
363
+ * @return array
364
+ */
365
+ protected function _getInactiveItemIds($collection){
366
+ $filter = $collection->getAllIdsSql();
367
+ $table = Mage::getSingleton('core/resource')->getTable('megamenu2/menuitem');
368
+ $bind = array(
369
+ 'cond' => 0,
370
+ );
371
+ $select = $this->_conn->select()
372
+ ->from(array('d'=>$table), array('d.entity_id'))
373
+ ->where('d.entity_id IN (?)', new Zend_Db_Expr($filter))
374
+ ->where('status = :cond');
375
+ return $this->_conn->fetchCol($select, $bind);
376
+ }
377
+ /**
378
+ * Check is menu item items active
379
+ * @access protecte
380
+ * @param int $id
381
+ * @return boolean
382
+ */
383
+ protected function _getItemIsActive($id){
384
+ if (!in_array($id, $this->_inactiveItems)) {
385
+ return true;
386
+ }
387
+ return false;
388
+ }
389
+ }
app/code/community/JScriptz/MegaMenu2/Model/Resource/Setup.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * MegaMenu2 setup
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+ */
23
+ class JScriptz_MegaMenu2_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup{
24
+
25
+ }
app/code/community/JScriptz/MegaMenu2/controllers/Adminhtml/MegaMenu2/MenuitemController.php ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Menu Item admin controller
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+
23
+ */
24
+ class JScriptz_MegaMenu2_Adminhtml_MegaMenu2_MenuitemController extends JScriptz_MegaMenu2_Controller_Adminhtml_MegaMenu2{
25
+ /**
26
+ * init menu item
27
+ * @access protected
28
+ * @return JScriptz_MegaMenu2_Model_Menuitem
29
+ */
30
+ protected function _initMenuitem(){
31
+ $menuitemId = (int) $this->getRequest()->getParam('id',false);
32
+ $menuitem = Mage::getModel('megamenu2/menuitem');
33
+ if ($menuitemId) {
34
+ $menuitem->load($menuitemId);
35
+ }
36
+ if ($activeTabId = (string) $this->getRequest()->getParam('active_tab_id')) {
37
+ Mage::getSingleton('admin/session')->setActiveTabId($activeTabId);
38
+ }
39
+ Mage::register('menuitem', $menuitem);
40
+ Mage::register('current_menuitem', $menuitem);
41
+ return $menuitem;
42
+ }
43
+ /**
44
+ * default action
45
+ * @access public
46
+ * @return void
47
+
48
+ */
49
+ public function indexAction(){
50
+ $this->_forward('edit');
51
+ }
52
+
53
+ /**
54
+ * Add new menu item form
55
+ * @access public
56
+ * @return void
57
+
58
+ */
59
+ public function addAction(){
60
+ Mage::getSingleton('admin/session')->unsActiveTabId();
61
+ $this->_forward('edit');
62
+ }
63
+ /**
64
+ * Edit menu item page
65
+ * @access public
66
+ * @return void
67
+
68
+ */
69
+ public function editAction(){
70
+ $params['_current'] = true;
71
+ $redirect = false;
72
+ $parentId = (int) $this->getRequest()->getParam('parent');
73
+ $menuitemId = (int) $this->getRequest()->getParam('id');
74
+ $_prevMenuitemId = Mage::getSingleton('admin/session')->getLastEditedMenuitem(true);
75
+ if ($_prevMenuitemId && !$this->getRequest()->getQuery('isAjax') && !$this->getRequest()->getParam('clear')) {
76
+ $this->getRequest()->setParam('id',$_prevMenuitemId);
77
+ }
78
+ if ($redirect) {
79
+ $this->_redirect('*/*/edit', $params);
80
+ return;
81
+ }
82
+ if (!($menuitem = $this->_initMenuitem())) {
83
+ return;
84
+ }
85
+ $this->_title($menuitemId ? $menuitem->getLinktitle() : $this->__('New Menu Item'));
86
+ $data = Mage::getSingleton('adminhtml/session')->getMenuitemData(true);
87
+ if (isset($data['menuitem'])) {
88
+ $menuitem->addData($data['menuitem']);
89
+ }
90
+ if ($this->getRequest()->getQuery('isAjax')) {
91
+ $breadcrumbsPath = $menuitem->getPath();
92
+ if (empty($breadcrumbsPath)) {
93
+ $breadcrumbsPath = Mage::getSingleton('admin/session')->getDeletedPath(true);
94
+ if (!empty($breadcrumbsPath)) {
95
+ $breadcrumbsPath = explode('/', $breadcrumbsPath);
96
+ if (count($breadcrumbsPath) <= 1) {
97
+ $breadcrumbsPath = '';
98
+ }
99
+ else {
100
+ array_pop($breadcrumbsPath);
101
+ $breadcrumbsPath = implode('/', $breadcrumbsPath);
102
+ }
103
+ }
104
+ }
105
+ Mage::getSingleton('admin/session')->setLastEditedMenuitem($menuitem->getId());
106
+ $this->loadLayout();
107
+ $eventResponse = new Varien_Object(array(
108
+ 'content' => $this->getLayout()->getBlock('menuitem.edit')->getFormHtml(). $this->getLayout()->getBlock('menuitem.tree')->getBreadcrumbsJavascript($breadcrumbsPath, 'editingMenuitemBreadcrumbs'),
109
+ 'messages' => $this->getLayout()->getMessagesBlock()->getGroupedHtml(),
110
+ ));
111
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($eventResponse->getData()));
112
+ return;
113
+ }
114
+ $this->loadLayout();
115
+ $this->_title(Mage::helper('megamenu2')->__('MegaMenu2'))
116
+ ->_title(Mage::helper('megamenu2')->__('Menu Items'));
117
+ $this->_setActiveMenu('megamenu2/menuitem');
118
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true)
119
+ ->setContainerCssClass('menuitem');
120
+
121
+ $this->_addBreadcrumb(
122
+ Mage::helper('megamenu2')->__('Manage Menu Items'),
123
+ Mage::helper('megamenu2')->__('Manage Menu Items')
124
+ );
125
+ if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
126
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
127
+ }
128
+ $this->renderLayout();
129
+ }
130
+ /**
131
+ * Get tree node (Ajax version)
132
+ * @access public
133
+ * @return void
134
+
135
+ */
136
+ public function menuitemsJsonAction(){
137
+ if ($this->getRequest()->getParam('expand_all')) {
138
+ Mage::getSingleton('admin/session')->setMenuitemIsTreeWasExpanded(true);
139
+ }
140
+ else {
141
+ Mage::getSingleton('admin/session')->setMenuitemIsTreeWasExpanded(false);
142
+ }
143
+ if ($menuitemId = (int) $this->getRequest()->getPost('id')) {
144
+ $this->getRequest()->setParam('id', $menuitemId);
145
+ if (!$menuitem = $this->_initMenuitem()) {
146
+ return;
147
+ }
148
+ $this->getResponse()->setBody(
149
+ $this->getLayout()->createBlock('megamenu2/adminhtml_menuitem_tree')->getTreeJson($menuitem)
150
+ );
151
+ }
152
+ }
153
+ /**
154
+ * Move menu item action
155
+ */
156
+ public function moveAction(){
157
+ $menuitem = $this->_initMenuitem();
158
+ if (!$menuitem) {
159
+ $this->getResponse()->setBody(Mage::helper('megamenu2')->__('Menu Item move error'));
160
+ return;
161
+ }
162
+ $parentNodeId = $this->getRequest()->getPost('pid', false);
163
+ $prevNodeId = $this->getRequest()->getPost('aid', false);
164
+ try {
165
+ $menuitem->move($parentNodeId, $prevNodeId);
166
+ $this->getResponse()->setBody("SUCCESS");
167
+ }
168
+ catch (Mage_Core_Exception $e) {
169
+ $this->getResponse()->setBody($e->getMessage());
170
+ }
171
+ catch (Exception $e){
172
+ $this->getResponse()->setBody(Mage::helper('megamenu2')->__('Menu Item move error'));
173
+ Mage::logException($e);
174
+ }
175
+ }
176
+ /**
177
+ * Tree Action
178
+ * Retrieve menu item tree
179
+ * @access public
180
+ * @return void
181
+
182
+ */
183
+ public function treeAction(){
184
+ $menuitemId = (int) $this->getRequest()->getParam('id');
185
+ $menuitem = $this->_initMenuitem();
186
+ $block = $this->getLayout()->createBlock('megamenu2/adminhtml_menuitem_tree');
187
+ $root = $block->getRoot();
188
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(
189
+ array(
190
+ 'data' => $block->getTree(),
191
+ 'parameters' => array(
192
+ 'text'=> $block->buildNodeName($root),
193
+ 'draggable' => false,
194
+ 'allowDrop' => ($root->getIsVisible()) ? true : false,
195
+ 'id' => (int) $root->getId(),
196
+ 'expanded'=> (int) $block->getIsWasExpanded(),
197
+ 'menuitem_id' => (int) $menuitem->getId(),
198
+ 'root_visible'=> (int) $root->getIsVisible()
199
+ )
200
+ )
201
+ ));
202
+ }
203
+ /**
204
+ * Build response for refresh input element 'path' in form
205
+ * @access public
206
+ * @return void
207
+
208
+ */
209
+ public function refreshPathAction(){
210
+ if ($id = (int) $this->getRequest()->getParam('id')) {
211
+ $menuitem = Mage::getModel('megamenu2/menuitem')->load($id);
212
+ $this->getResponse()->setBody(
213
+ Mage::helper('core')->jsonEncode(array(
214
+ 'id' => $id,
215
+ 'path' => $menuitem->getPath(),
216
+ ))
217
+ );
218
+ }
219
+ }
220
+ /**
221
+ * Delete menu item action
222
+ * @access public
223
+ * @return void
224
+
225
+ */
226
+ public function deleteAction(){
227
+ if ($id = (int) $this->getRequest()->getParam('id')) {
228
+ try {
229
+ $menuitem = Mage::getModel('megamenu2/menuitem')->load($id);
230
+ Mage::getSingleton('admin/session')->setDeletedPath($menuitem->getPath());
231
+
232
+ $menuitem->delete();
233
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('megamenu2')->__('The menu item has been deleted.'));
234
+ }
235
+ catch (Mage_Core_Exception $e){
236
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
237
+ $this->getResponse()->setRedirect($this->getUrl('*/*/edit', array('_current'=>true)));
238
+ return;
239
+ }
240
+ catch (Exception $e){
241
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('megamenu2')->__('An error occurred while trying to delete the menu item.'));
242
+ $this->getResponse()->setRedirect($this->getUrl('*/*/edit', array('_current'=>true)));
243
+ Mage::logException($e);
244
+ return;
245
+ }
246
+ }
247
+ $this->getResponse()->setRedirect($this->getUrl('*/*/', array('_current'=>true, 'id'=>null)));
248
+ }
249
+ /**
250
+ * Check if admin has permissions to visit related pages
251
+ * @access protected
252
+ * @return boolean
253
+
254
+ */
255
+ protected function _isAllowed(){
256
+ return Mage::getSingleton('admin/session')->isAllowed('megamenu2/menuitem');
257
+ } /**
258
+ * wyisiwyg action
259
+ * @access public
260
+ * @return void
261
+
262
+ */
263
+ public function wysiwygAction(){
264
+ $elementId = $this->getRequest()->getParam('element_id', md5(microtime()));
265
+ $storeMediaUrl = Mage::app()->getStore(0)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
266
+
267
+ $content = $this->getLayout()->createBlock('adminhtml/catalog_helper_form_wysiwyg_content', '', array(
268
+ 'editor_element_id' => $elementId,
269
+ 'store_id' => 0,
270
+ 'store_media_url' => $storeMediaUrl,
271
+ ));
272
+ $this->getResponse()->setBody($content->toHtml());
273
+ }
274
+ /**
275
+ * Menu Item save action
276
+ * @access public
277
+ * @return void
278
+
279
+ */
280
+ public function saveAction(){
281
+ if (!$menuitem = $this->_initMenuitem()) {
282
+ return;
283
+ }
284
+ $refreshTree = 'false';
285
+ if ($data = $this->getRequest()->getPost('menuitem')) {
286
+ $menuitem->addData($data);
287
+ if (!$menuitem->getId()) {
288
+ $parentId = $this->getRequest()->getParam('parent');
289
+ if (!$parentId) {
290
+ $parentId = Mage::helper('megamenu2/menuitem')->getRootMenuitemId();
291
+ }
292
+ $parentMenuitem = Mage::getModel('megamenu2/menuitem')->load($parentId);
293
+ $menuitem->setPath($parentMenuitem->getPath());
294
+ }
295
+ try {
296
+ $menuitem->save();
297
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('megamenu2')->__('The menu item has been saved.'));
298
+ $refreshTree = 'true';
299
+ }
300
+ catch (Exception $e){
301
+ $this->_getSession()->addError($e->getMessage())->setMenuitemData($data);
302
+ Mage::logException($e);
303
+ $refreshTree = 'false';
304
+ }
305
+ }
306
+ $url = $this->getUrl('*/*/edit', array('_current' => true, 'id' => $menuitem->getId()));
307
+ $this->getResponse()->setBody(
308
+ '<script type="text/javascript">parent.updateContent("' . $url . '", {}, '.$refreshTree.');</script>'
309
+ );
310
+ }
311
+ }
app/code/community/JScriptz/MegaMenu2/data/jscriptz_megamenu2_setup/data-install-0.0.1.php ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /*
18
+ * @category JScriptz
19
+ * @package JScriptz_MegaMenu2
20
+ */
21
+ Mage::getModel('megamenu2/menuitem')
22
+ ->load(1)
23
+ ->setParentId(0)
24
+ ->setPath(1)
25
+ ->setLevel(0)
26
+ ->setPosition(0)
27
+ ->setChildrenCount(0)
28
+ ->setLinktitle('ROOT')
29
+ ->setInitialSetupFlag(true)
30
+ ->save();
31
+ Mage::getModel('megamenu2/menuitem')->load(2)->setLinktitle('Products')->setParentId(1)->setPath(1)->setLevel(0)->setPosition(1)->setChildrenCount(0)->setStatus(1)->save();
32
+ Mage::getModel('megamenu2/menuitem')->load(3)->setLinktitle('jQuery Tabs')->setParentId(1)->setPath(1)->setLevel(0)->setPosition(2)->setChildrenCount(0)->setStatus(1)->setMenuhtml("<div class='dropdown_fullwidth mgmenu_tabs' style='display: none;'><!-- Begin Item Container -->
33
+
34
+
35
+ <ul class='mgmenu_tabs_nav'>
36
+
37
+ <li><a class='current' href='#section1'>Columns Grid</a></li>
38
+ <li><a href='#section2'>Gallery</a></li>
39
+ <li><a href='#section3'>About Us</a></li>
40
+ <li><a href='#section4'>Informations</a></li>
41
+
42
+ </ul>
43
+
44
+ <div class='mgmenu_tabs_panels'><!-- Begin Panels Container -->
45
+
46
+ <div id='section1'><!-- Begin Section 1 -->
47
+
48
+ <div class='col_12'>
49
+ <h4>This is a full width container</h4>
50
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris venenatis bibendum nunc dapibus posuere. Sed quis laoreet justo. Mauris eu massa turpis, at blandit elit. Mauris rutrum placerat libero, ut rhoncus leo euismod non. Aliquam urna felis, rutrum eu rhoncus at, elementum id est.</p>
51
+ </div>
52
+
53
+ <div class='col_10'>
54
+ <h4>This is a five sixths container</h4>
55
+ <p>Phasellus bibendum malesuada augue et adipiscing. Ut pretium vulputate elit quis iaculis. Nulla nisi justo, rhoncus in consectetur et, posuere sed urna. Aliquam urna felis, rutrum eu rhoncus at, elementum id est.</p>
56
+ </div>
57
+
58
+ <div class='col_2'>
59
+ <h4>1/6</h4>
60
+ <p>Fusce adipiscing consequat porta.</p>
61
+ </div>
62
+
63
+ <div class='col_8'>
64
+ <h4>This is a two thirds container</h4>
65
+ <p>Nunc scelerisque nisl id purus pretium cursus. Integer sed auctor elit. Pellentesque malesuada suscipit vehicula. Pellentesque malesuada suscipit vehicula.</p>
66
+ </div>
67
+
68
+ <div class='col_4'>
69
+ <h4>1/3 container</h4>
70
+ <p>Integer sed auctor elit. Pellentesque malesuada suscipit vehicula urna felis.</p>
71
+ </div>
72
+
73
+ <div class='col_6'>
74
+ <h4>This is a half width container</h4>
75
+ <p>Donec vel egestas lorem. Cras at purus turpis. Fusce a imperdiet mauris. Nunc lobortis neque magna, nec iaculis nisl.</p>
76
+ </div>
77
+
78
+ <div class='col_6'>
79
+ <h4>This is a half width container</h4>
80
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Cras pharetra tincidunt.</p>
81
+ </div>
82
+
83
+ <div class='col_4'>
84
+ <h4>1/3 container</h4>
85
+ <p>Nunc in lectus nec erat adipiscing ultrices. Donec ac scelerisque neque.</p>
86
+ </div>
87
+
88
+ <div class='col_4'>
89
+ <h4>1/3 container</h4>
90
+ <p>Fusce sapien ante, convallis eu sodales malesuada, porttitor in nisi.</p>
91
+ </div>
92
+
93
+ <div class='col_4'>
94
+ <h4>1/3 container</h4>
95
+ <p>Mauris faucibus lectus accumsan, placerat tortor nec, volutpat mi.</p>
96
+ </div>
97
+
98
+ <div class='col_3'>
99
+ <h4>1/4 container</h4>
100
+ <p>Phasellus eleifend, eros at pharetra consequat.</p>
101
+ </div>
102
+
103
+ <div class='col_3'>
104
+ <h4>1/4 container</h4>
105
+ <p>Vestibulum sit amet est turpis convallis eu sodales.</p>
106
+ </div>
107
+
108
+ <div class='col_3'>
109
+ <h4>1/4 container</h4>
110
+ <p>Ut id fermentum nunc, non adipiscing diam.</p>
111
+ </div>
112
+
113
+ <div class='col_3'>
114
+ <h4>1/4 container</h4>
115
+ <p>Suspendisse eros faucibus, in luctus ante porta.</p>
116
+ </div>
117
+
118
+ </div><!-- End Section 1 -->
119
+
120
+ <div class='mgmenu_tabs_hide' id='section2'><!-- Begin Section 2 -->
121
+
122
+ <div class='col_3'>
123
+ <a href='#'><img width='220' height='140' class='inline_img' alt='' src='/skin/frontend/base/default/images/jscriptz_megamenu2/product01@2x.jpg'></a>
124
+ <p class='img_description'>Image Description</p>
125
+ </div>
126
+
127
+ <div class='col_3'>
128
+ <a href='#'><img width='220' height='140' class='inline_img' alt='' src='/skin/frontend/base/default/images/jscriptz_megamenu2/product02@2x.jpg'></a>
129
+ <p class='img_description'>Image Description</p>
130
+ </div>
131
+
132
+ <div class='col_3'>
133
+ <a href='#'><img width='220' height='140' class='inline_img' alt='' src='/skin/frontend/base/default/images/jscriptz_megamenu2/product03@2x.jpg'></a>
134
+ <p class='img_description'>Image Description</p>
135
+ </div>
136
+
137
+ <div class='col_3'>
138
+ <a href='#'><img width='220' height='140' class='inline_img' alt='' src='/skin/frontend/base/default/images/jscriptz_megamenu2/product04@2x.jpg'></a>
139
+ <p class='img_description'>Image Description</p>
140
+ </div>
141
+
142
+ <div class='col_3'>
143
+ <a href='#'><img width='220' height='140' class='inline_img' alt='' src='/skin/frontend/base/default/images/jscriptz_megamenu2/product05@2x.jpg'></a>
144
+ <p class='img_description'>Image Description</p>
145
+ </div>
146
+
147
+ <div class='col_3'>
148
+ <a href='#'><img width='220' height='140' class='inline_img' alt='' src='/skin/frontend/base/default/images/jscriptz_megamenu2/product06@2x.jpg'></a>
149
+ <p class='img_description'>Image Description</p>
150
+ </div>
151
+
152
+ <div class='col_3'>
153
+ <a href='#'><img width='220' height='140' class='inline_img' alt='' src='/skin/frontend/base/default/images/jscriptz_megamenu2/product07@2x.jpg'></a>
154
+ <p class='img_description'>Image Description</p>
155
+ </div>
156
+
157
+ <div class='col_3'>
158
+ <a href='#'><img width='220' height='140' class='inline_img' alt='' src='/skin/frontend/base/default/images/jscriptz_megamenu2/product08@2x.jpg'></a>
159
+ <p class='img_description'>Image Description</p>
160
+ </div>
161
+
162
+ </div><!-- End Section 2 -->
163
+
164
+ <div class='mgmenu_tabs_hide' id='section3'><!-- Begin Section 3 -->
165
+
166
+ <div class='col_12'>
167
+
168
+ <h3>About Us</h3>
169
+
170
+ <p>Fusce adipiscing consequat porta. Proin porta molestie mauris in imperdiet. Aliquam erat volutpat. Phasellus elementum accumsan bibendum. Nulla metus massa, sagittis non aliquam quis, mollis ac arcu. Praesent adipiscing mauris ultricies nisl egestas congue molestie nunc aliquet. In faucibus euismod sapien vitae consectetur. Integer nec ligula nisi, et pretium mi. In non porttitor tortor. Donec vel egestas lorem.</p>
171
+
172
+ <blockquote>'This is a testimonial from a customer. Donec vel egestas lorem. Cras at purus turpis. Fusce a imperdiet mauris faucibus euismod sapien vitae consectetur.'</blockquote>
173
+
174
+ <p>Nunc scelerisque nisl id purus pretium cursus. Integer sed auctor elit. Pellentesque malesuada suscipit vehicula. Nunc dapibus, eros nec posuere rhoncus, elit lorem elementum libero, nec tempor purus neque nec ipsum. Mauris bibendum lectus nec orci pharetra dignissim egestas interdum nibh. Nunc adipiscing felis quis nunc malesuada ac ultrices mi luctus. Maecenas a porta libero. In ut rhoncus quam. Sed nec vestibulum mauris.</p>
175
+
176
+ <blockquote>'Phasellus elementum accumsan bibendum. Nulla metus massa, sagittis non aliquam quis, mollis ac arcu.'</blockquote>
177
+
178
+ <p>Cras at purus turpis. Fusce a imperdiet mauris. Nunc lobortis neque magna, nec iaculis nisl. Quisque at leo erat, a pretium ante. Nunc vel pretium diam. Aliquam erat volutpat.</p>
179
+
180
+ </div>
181
+
182
+ </div><!-- End Section 3 -->
183
+
184
+ <div class='mgmenu_tabs_hide' id='section4'><!-- Begin Section 4 -->
185
+
186
+ <div class='col_12'>
187
+
188
+ <h3>Additional Informations</h3>
189
+
190
+ </div>
191
+
192
+ <div class='col_6'>
193
+
194
+ <p>Phasellus bibendum malesuada augue et adipiscing. Ut pretium vulputate elit quis iaculis. Nulla nisi justo, rhoncus in consectetur et, posuere sed urna. Aliquam urna felis, rutrum eu rhoncus at, elementum id est. Ut cursus elementum nisi eu elementum. Sed lacus purus.</p>
195
+
196
+ <p>Integer nisl nunc, venenatis sagittis condimentum vel, tincidunt in est. Aenean felis sem, suscipit in posuere ultrices, placerat vel ipsum. Donec quis dolor turpis, non accumsan nisl. Ut lorem turpis, consequat eget condimentum quis, consectetur vitae enim. Proin ultricies ornare nibh eget tincidunt. Nulla id lectus est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Cras pharetra tincidunt erat sit amet sodales.</p>
197
+
198
+ </div>
199
+
200
+ <div class='col_6 col_border'>
201
+
202
+ <p>Fusce adipiscing consequat porta. Proin porta molestie mauris in imperdiet. Aliquam erat volutpat. Phasellus elementum accumsan bibendum. Nulla metus massa, sagittis non aliquam quis, mollis ac arcu. Praesent adipiscing mauris ultricies nisl egestas congue molestie nunc aliquet. In faucibus euismod sapien vitae consectetur. Integer nec ligula nisi, et pretium mi. In non porttitor tortor. Donec vel egestas lorem. Cras at purus turpis. Fusce a imperdiet mauris.</p>
203
+
204
+ <p>Nunc lobortis neque magna, nec iaculis nisl. Quisque at leo erat, a pretium ante. Ullamcorper ut aliquet ut, dictum nec odio. Donec sed odio ac lectus fermentum accumsan quis ut magna. Sed consectetur ipsum dolor, non laoreet lectus. Phasellus malesuada varius molestie.</p>
205
+
206
+ </div>
207
+
208
+ </div><!-- End Section 4 -->
209
+
210
+ </div><!-- End Panels Container -->
211
+
212
+
213
+ </div><!-- End Item Container -->
214
+
215
+
216
+ </li><!-- End Item -->")->save();
217
+
218
+
219
+ Mage::getModel('megamenu2/menuitem')->load(4)->setParentId(1)->setLinktitle('Video Example')->setPath(1)->setLevel(0)->setPosition(3)->setChildrenCount(0)->setStatus(1)->setMenuhtml("<div class='dropdown_container dropdown_5columns' style='display: none;'><!-- Begin Item Container -->
220
+
221
+
222
+ <div class='col_12'>
223
+
224
+ <h4>Awesome Video !</h4>
225
+ <p>Ut ligula nibh, tincidunt et dolor vitae, bibendum lectus, et tempus lorem lobortis consectetur neque.</p>
226
+ <div class='video_container'>
227
+ <iframe src='http://player.vimeo.com/video/32001208?portrait=0&amp;badge=0'></iframe>
228
+ </div>
229
+
230
+ </div>
231
+
232
+
233
+ </div><!-- End Item Container -->")->save();
234
+
235
+ Mage::getModel('megamenu2/menuitem')->load(5)->setParentId(1)->setLinktitle('Link Example')->setLinkpath('http://www.gobingya.com')->setLinktarget('blank')->setPath(1)->setLevel(0)->setPosition(4)->setChildrenCount(0)->setStatus(1)->save();
app/code/community/JScriptz/MegaMenu2/etc/adminhtml.xml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * JScriptz_MegaMenu2 extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category JScriptz
14
+ * @package JScriptz_MegaMenu2
15
+ * @copyright Copyright (c) 2013
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <config>
20
+ <acl>
21
+ <resources>
22
+ <admin>
23
+ <children>
24
+ <system>
25
+ <children>
26
+ <config>
27
+ <children>
28
+ <megamenu2 translate="title" module="megamenu2">
29
+ <title>MegaMenu2</title>
30
+ </megamenu2>
31
+ </children>
32
+ </config>
33
+ </children>
34
+ </system>
35
+ <megamenu2 translate="title" module="megamenu2">
36
+ <title>MegaMenu2</title>
37
+ <children>
38
+ <menuitem translate="title" module="megamenu2">
39
+ <title>Menu Items</title>
40
+ </menuitem>
41
+ </children>
42
+ </megamenu2>
43
+ </children>
44
+ </admin>
45
+ </resources>
46
+ </acl>
47
+ <menu>
48
+ <megamenu2 translate="title" module="megamenu2">
49
+ <title>MegaMenu2</title>
50
+ <sort_order>81</sort_order>
51
+ <depends>
52
+ <module>JScriptz_MegaMenu2</module>
53
+ </depends>
54
+ <children>
55
+ <menuitem translate="title" module="megamenu2">
56
+ <title>Menu Items</title>
57
+ <action>adminhtml/MegaMenu2_menuitem</action>
58
+ <sort_order>0</sort_order>
59
+ </menuitem>
60
+ </children>
61
+ </megamenu2>
62
+ </menu>
63
+ </config>
app/code/community/JScriptz/MegaMenu2/etc/config.xml ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * JScriptz_MegaMenu2 extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category JScriptz
14
+ * @package JScriptz_MegaMenu2
15
+ * @copyright Copyright (c) 2013
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <config>
20
+ <modules>
21
+ <JScriptz_MegaMenu2>
22
+ <version>1.8.0.0</version>
23
+ </JScriptz_MegaMenu2>
24
+ </modules>
25
+ <global>
26
+ <resources>
27
+ <jscriptz_megamenu2_setup>
28
+ <setup>
29
+ <module>JScriptz_MegaMenu2</module>
30
+ <class>JScriptz_MegaMenu2_Model_Resource_Setup</class>
31
+ </setup>
32
+ </jscriptz_megamenu2_setup>
33
+ </resources>
34
+ <blocks>
35
+ <megamenu2>
36
+ <class>JScriptz_MegaMenu2_Block</class>
37
+ </megamenu2>
38
+ <page>
39
+ <rewrite>
40
+ <html_topmenu>JScriptz_MegaMenu2_Block_Html_Topmenu</html_topmenu>
41
+ </rewrite>
42
+ </page>
43
+ </blocks>
44
+ <helpers>
45
+ <megamenu2>
46
+ <class>JScriptz_MegaMenu2_Helper</class>
47
+ </megamenu2>
48
+ </helpers>
49
+ <models>
50
+ <megamenu2>
51
+ <class>JScriptz_MegaMenu2_Model</class>
52
+ <resourceModel>megamenu2_resource</resourceModel>
53
+ </megamenu2>
54
+ <megamenu2_resource>
55
+ <class>JScriptz_MegaMenu2_Model_Resource</class>
56
+ <entities>
57
+ <menuitem>
58
+ <table>megamenu2_menuitem</table>
59
+ </menuitem>
60
+ <menuitem_store>
61
+ <table>megamenu2_menuitem_store</table>
62
+ </menuitem_store>
63
+ </entities>
64
+ </megamenu2_resource>
65
+ </models>
66
+
67
+ </global>
68
+ <frontend>
69
+ <layout>
70
+ <updates>
71
+ <jscriptz_megamenu2>
72
+ <file>jscriptz_megamenu2.xml</file>
73
+ </jscriptz_megamenu2>
74
+ </updates>
75
+ </layout>
76
+ </frontend>
77
+ <adminhtml>
78
+ <layout>
79
+ <updates>
80
+ <jscriptz_megamenu2>
81
+ <file>jscriptz_megamenu2.xml</file>
82
+ </jscriptz_megamenu2>
83
+ </updates>
84
+ </layout>
85
+ <translate>
86
+ <modules>
87
+ <JScriptz_MegaMenu2>
88
+ <files>
89
+ <default>JScriptz_MegaMenu2.csv</default>
90
+ </files>
91
+ </JScriptz_MegaMenu2>
92
+ </modules>
93
+ </translate>
94
+ </adminhtml>
95
+ <admin>
96
+ <routers>
97
+ <adminhtml>
98
+ <args>
99
+ <modules>
100
+ <JScriptz_MegaMenu2 before="Mage_Adminhtml">JScriptz_MegaMenu2_Adminhtml</JScriptz_MegaMenu2>
101
+ </modules>
102
+ </args>
103
+ </adminhtml>
104
+ </routers>
105
+ </admin>
106
+ <default>
107
+ <megamenu2>
108
+ </megamenu2>
109
+ </default>
110
+ </config>
app/code/community/JScriptz/MegaMenu2/sql/jscriptz_megamenu2_setup/install-0.0.1.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * MegaMenu2 module install script
19
+ *
20
+ * @category JScriptz
21
+ * @package JScriptz_MegaMenu2
22
+ */
23
+ $this->startSetup();
24
+ $table = $this->getConnection()
25
+ ->newTable($this->getTable('megamenu2/menuitem'))
26
+ ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
27
+ 'identity' => true,
28
+ 'nullable' => false,
29
+ 'primary' => true,
30
+ ), 'Menu Item ID')
31
+ ->addColumn('linktitle', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
32
+ 'nullable' => false,
33
+ ), 'Link Title')
34
+
35
+ ->addColumn('linkpath', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
36
+ ), 'Link Path')
37
+
38
+ ->addColumn('linktarget', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
39
+ ), 'Link Target')
40
+
41
+ ->addColumn('menuhtml', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array(
42
+ ), 'Menu HTML')
43
+
44
+ ->addColumn('sortorder', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
45
+ 'unsigned' => true,
46
+ ), 'Link Position')
47
+
48
+ ->addColumn('status', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
49
+ ), 'Status')
50
+
51
+ ->addColumn('parent_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
52
+ 'unsigned' => true,
53
+ ), 'Parent id')
54
+
55
+ ->addColumn('path', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
56
+ ), 'Path')
57
+
58
+ ->addColumn('position', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
59
+ 'unsigned' => true,
60
+ ), 'Position')
61
+
62
+ ->addColumn('level', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
63
+ 'unsigned' => true,
64
+ ), 'Level')
65
+
66
+ ->addColumn('children_count', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
67
+ 'unsigned' => true,
68
+ ), 'Children count')
69
+
70
+ ->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
71
+ ), 'Menu Item Creation Time')
72
+ ->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
73
+ ), 'Menu Item Modification Time')
74
+ ->setComment('Menu Item Table');
75
+ $this->getConnection()->createTable($table);
76
+
77
+ $table = $this->getConnection()
78
+ ->newTable($this->getTable('megamenu2/menuitem_store'))
79
+ ->addColumn('menuitem_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
80
+ 'nullable' => false,
81
+ 'primary' => true,
82
+ ), 'Menu Item ID')
83
+ ->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
84
+ 'unsigned' => true,
85
+ 'nullable' => false,
86
+ 'primary' => true,
87
+ ), 'Store ID')
88
+ ->addIndex($this->getIdxName('megamenu2/menuitem_store', array('store_id')), array('store_id'))
89
+ ->addForeignKey($this->getFkName('megamenu2/menuitem_store', 'menuitem_id', 'megamenu2/menuitem', 'entity_id'), 'menuitem_id', $this->getTable('megamenu2/menuitem'), 'entity_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
90
+ ->addForeignKey($this->getFkName('megamenu2/menuitem_store', 'store_id', 'core/store', 'store_id'), 'store_id', $this->getTable('core/store'), 'store_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
91
+ ->setComment('Menu Items To Store Linkage Table');
92
+ $this->getConnection()->createTable($table);
93
+ $this->endSetup();
app/design/adminhtml/default/default/layout/jscriptz_megamenu2.xml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * JScriptz_MegaMenu2 extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category JScriptz
14
+ * @package JScriptz_MegaMenu2
15
+ * @copyright Copyright (c) 2013
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <layout>
20
+ <adminhtml_megamenu2_menuitem_edit>
21
+ <update handle="editor"/>
22
+ <reference name="left">
23
+ <block name="menuitem.tree" type="megamenu2/adminhtml_menuitem_tree" />
24
+ </reference>
25
+ <reference name="content">
26
+ <block name="menuitem.edit" type="megamenu2/adminhtml_menuitem_edit" template="jscriptz_megamenu2/menuitem/edit.phtml" />
27
+ </reference>
28
+ <reference name="js">
29
+ <block type="core/template" template="catalog/wysiwyg/js.phtml" name="catalog.wysiwyg.js" />
30
+ </reference>
31
+ </adminhtml_megamenu2_menuitem_edit>
32
+ </layout>
app/design/adminhtml/default/default/template/jscriptz_megamenu2/menuitem/edit.phtml ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ ?>
18
+ <div id="menuitem-edit-container" class="category-content">
19
+ <?php echo $this->getChildHtml('form') ?>
20
+ </div>
21
+ <script type="text/javascript">
22
+ //<![CDATA[
23
+ function menuitemReset(url,useAjax){
24
+ if(useAjax){
25
+ var params = {active_tab_id:false};
26
+ updateContent(url, params);
27
+ }
28
+ else{
29
+ location.href = url;
30
+ }
31
+ }
32
+ function menuitemDelete(url, useAjax, menuitemId) {
33
+ if (confirm('<?php echo Mage::helper('megamenu2')->__('Are you sure?') ?>')){
34
+ if (useAjax){
35
+ tree.nodeForDelete = menuitemId;
36
+ updateContent(url, {}, true);
37
+ }
38
+ else {
39
+ location.href = url;
40
+ }
41
+ }
42
+ }
43
+ function updateContent(url, params, refreshTree) {
44
+ if (!params) {
45
+ params = {};
46
+ }
47
+ if (!params.form_key) {
48
+ params.form_key = FORM_KEY;
49
+ }
50
+ toolbarToggle.stop();
51
+ var menuitemContainer = $('menuitem-edit-container');
52
+ var messagesContainer = $('messages');
53
+ var thisObj = this;
54
+ new Ajax.Request(url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), {
55
+ parameters: params,
56
+ evalScripts: true,
57
+ onComplete: function () {
58
+ setTimeout(function() {
59
+ try {
60
+ if (refreshTree) {
61
+ thisObj.refreshTreeArea();
62
+ }
63
+ toolbarToggle.start();
64
+ }
65
+ catch (e) {
66
+ alert(e.message);
67
+ };
68
+ }, 25);
69
+ },
70
+ onSuccess: function(transport) {
71
+ try {
72
+ if (transport.responseText.isJSON()) {
73
+ var response = transport.responseText.evalJSON();
74
+ var needUpdate = true;
75
+ if (response.error) {
76
+ alert(response.message);
77
+ needUpdate = false;
78
+ }
79
+ if(response.ajaxExpired && response.ajaxRedirect) {
80
+ setLocation(response.ajaxRedirect);
81
+ needUpdate = false;
82
+ }
83
+ if (needUpdate){
84
+ if (response.content){
85
+ $(menuitemContainer).update(response.content);
86
+ }
87
+ if (response.messages){
88
+ $(messagesContainer).update(response.messages);
89
+ }
90
+ }
91
+ }
92
+ else {
93
+ $(menuitemContainer).update(transport.responseText);
94
+ }
95
+ }
96
+ catch (e) {
97
+ $(menuitemContainer).update(transport.responseText);
98
+ }
99
+ }
100
+ });
101
+ }
102
+ function refreshTreeArea(transport){
103
+ if (tree && window.editingMenuitemBreadcrumbs) {
104
+ if (tree.nodeForDelete) {
105
+ var node = tree.getNodeById(tree.nodeForDelete);
106
+ tree.nodeForDelete = false;
107
+ if (node) {
108
+ node.parentNode.removeChild(node);
109
+ tree.currentNodeId = false;
110
+ }
111
+ }
112
+ else if (tree.addNodeTo) {
113
+ var parent = tree.getNodeById(tree.addNodeTo);
114
+ tree.addNodeTo = false;
115
+ if (parent) {
116
+ var node = new Ext.tree.AsyncTreeNode(editingMenuitemBreadcrumbs[editingMenuitemBreadcrumbs.length - 1]);
117
+ node.loaded = true;
118
+ tree.currentNodeId = node.id;
119
+ parent.appendChild(node);
120
+ if (parent.expanded) {
121
+ tree.selectCurrentNode();
122
+ }
123
+ else {
124
+ var timer;
125
+ parent.expand();
126
+ var f = function(){
127
+ if(parent.expanded){
128
+ clearInterval(timer);
129
+ tree.selectCurrentNode();
130
+ }
131
+ };
132
+ timer = setInterval(f, 200);
133
+ }
134
+ }
135
+ }
136
+ for (var i = 0; i < editingMenuitemBreadcrumbs.length; i++) {
137
+ var node = tree.getNodeById(editingMenuitemBreadcrumbs[i].id);
138
+ if (node) {
139
+ node.setText(editingMenuitemBreadcrumbs[i].text);
140
+ }
141
+ }
142
+ }
143
+ }
144
+ function displayLoadingMask(){
145
+ var loaderArea = $$('#html-body .wrapper')[0];
146
+ Position.clone($(loaderArea), $('loading-mask'), {offsetLeft:-2});
147
+ toggleSelectsUnderBlock($('loading-mask'), false);
148
+ Element.show('loading-mask');
149
+ }
150
+ //]]>
151
+ </script>
app/design/adminhtml/default/default/template/jscriptz_megamenu2/menuitem/edit/form.phtml ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ ?>
18
+ <div class="content-header">
19
+ <h3 class="icon-head head-categories">
20
+ <?php echo $this->htmlEscape($this->getHeader()) . ($this->getMenuitemId() ? ' (' . Mage::helper('megamenu2')->__('ID: %s', $this->getMenuitemId()) . ')' : '') ?>
21
+ </h3>
22
+ <p class="content-buttons form-buttons">
23
+ <?php echo $this->getResetButtonHtml() ?>
24
+ <?php if($this->getMenuitemId()): ?>
25
+ <?php echo $this->getDeleteButtonHtml() ?>
26
+ <?php endif; ?>
27
+ <?php echo $this->getAdditionalButtonsHtml(); ?>
28
+ <?php echo $this->getSaveButtonHtml() ?>
29
+ </p>
30
+ </div>
31
+ <?php echo $this->getTabsHtml() ?>
32
+ <iframe name="iframeSave" style="display:none; width:100%;" src="<?php echo $this->getJsUrl() ?>blank.html"></iframe>
33
+ <form target="iframeSave" id="menuitem_edit_form" action="<?php echo $this->getSaveUrl() ?>" method="post" enctype="multipart/form-data">
34
+ <div class="no-display">
35
+ <input type="hidden" name="isIframe" value="1" />
36
+ <input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
37
+ <input type="hidden" name="active_tab_id" id="active_tab_id" value="" />
38
+ </div>
39
+ <div id="menuitem_tab_content"></div>
40
+ </form>
41
+ <script type="text/javascript">
42
+ //<![CDATA[
43
+ menuitemForm = new varienForm('menuitem_edit_form');
44
+ menuitemForm.submit= function (url) {
45
+ this.errorSections = $H({});
46
+ this.canShowError = true;
47
+ this.submitUrl = url;
48
+ if (this.validator && this.validator.validate()) {
49
+ if(this.validationUrl){
50
+ this._validate();
51
+ }
52
+ else{
53
+ if (this.isSubmitted) {
54
+ return false;
55
+ }
56
+ this.isSubmitted = true;
57
+ this._submit();
58
+ }
59
+ displayLoadingMask();
60
+ return true;
61
+ }
62
+ return false;
63
+ };
64
+ menuitemForm.refreshPath = function () {
65
+ menuitemId = this.getMenuitemId();
66
+ if (!menuitemId) {
67
+ return false;
68
+ }
69
+ var refreshPathSuccess = function(transport) {
70
+ if (transport.responseText.isJSON()) {
71
+ response = transport.responseText.evalJSON()
72
+ if (response.error) {
73
+ alert(response.message);
74
+ }
75
+ else {
76
+ if (menuitemForm.getMenuitemId() == response['id']) {
77
+ menuitemForm.setMenuitemPath(response['path']);
78
+ }
79
+ }
80
+ }
81
+ };
82
+ new Ajax.Request(
83
+ '<?php echo $this->getRefreshPathUrl() ?>',
84
+ {
85
+ method: 'POST',
86
+ evalScripts: true,
87
+ onSuccess: refreshPathSuccess
88
+ }
89
+ );
90
+ };
91
+
92
+ menuitemForm.getMenuitemId = function () {
93
+ collection = $(this.formId).getInputs('hidden','menuitem[id]');
94
+ if (collection.size() > 0) {
95
+ return collection.first().value;
96
+ }
97
+ return false;
98
+ };
99
+ menuitemForm.setMenuitemPath = function (path) {
100
+ collection = $(this.formId).getInputs('hidden','menuitem[path]');
101
+ if (collection.size() > 0) {
102
+ return collection.first().value = path;
103
+ }
104
+ };
105
+ function menuitemSubmit(url, useAjax) {
106
+ var activeTab = $('active_tab_id');
107
+ if (activeTab) {
108
+ if (activeTab.tabsJsObject && activeTab.tabsJsObject.activeTab) {
109
+ activeTab.value = activeTab.tabsJsObject.activeTab.id;
110
+ }
111
+ }
112
+ var params = {};
113
+ var fields = $('menuitem_edit_form').getElementsBySelector('input', 'select');
114
+ for(var i=0;i<fields.length;i++){
115
+ if (!fields[i].name) {
116
+ continue;
117
+ }
118
+ params[fields[i].name] = fields[i].getValue();
119
+ }
120
+ var menuitemId = params['menuitem[id]'] ? params['menuitem[id]'] : 0;
121
+ var isCreating = menuitemId == 0;
122
+ var path = params['menuitem[path]'].split('/');
123
+ var parentId = path.pop();
124
+ if (parentId == menuitemId) {
125
+ parentId = path.pop();
126
+ }
127
+ if (isCreating) {
128
+ if (!tree.currentNodeId) {
129
+ tree.currentNodeId = parentId;
130
+ }
131
+ tree.addNodeTo = parentId;
132
+ }
133
+ else {
134
+ var currentNode = tree.getNodeById(menuitemId);
135
+ var oldClass = 'active-category';
136
+ var newClass = 'active-category';
137
+ if (currentNode) {
138
+ if (parseInt(params['menuitem[status]'])) {
139
+ var oldClass = 'no-active-category';
140
+ var newClass = 'active-category';
141
+ }
142
+ else {
143
+ var oldClass = 'active-category';
144
+ var newClass = 'no-active-category';
145
+ }
146
+ Element.removeClassName(currentNode.ui.wrap.firstChild, oldClass);
147
+ Element.addClassName(currentNode.ui.wrap.firstChild, newClass);
148
+ }
149
+ }
150
+ menuitemForm.submit();
151
+ }
152
+ <?php if($this->isAjax() && ($block = $this->getLayout()->getBlock('tabs')) && ($_tabsJsObject=$block->getJsObjectName())): ?>
153
+ <?php echo $_tabsJsObject ?>.moveTabContentInDest();
154
+ if (<?php echo $_tabsJsObject ?>.activeTab) {
155
+ $('active_tab_id').value = <?php echo $_tabsJsObject ?>.activeTab.id;
156
+ }
157
+ $('active_tab_id').tabsJsObject = <?php echo $_tabsJsObject ?>;
158
+ <?php endif; ?>
159
+ //]]>
160
+ </script>
app/design/adminhtml/default/default/template/jscriptz_megamenu2/menuitem/tree.phtml ADDED
@@ -0,0 +1,376 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JScriptz_MegaMenu2 extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category JScriptz
13
+ * @package JScriptz_MegaMenu2
14
+ * @copyright Copyright (c) 2013
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ ?>
18
+ <div class="categories-side-col">
19
+ <div class="content-header">
20
+ <h3 class="icon-head head-menuitems">
21
+ <?php echo Mage::helper('megamenu2')->__('Menu Items') ?>
22
+ </h3>
23
+ <?php if ($this->getRoot()): ?>
24
+ <?php echo $this->getAddRootButtonHtml() ?><br />
25
+ <?php echo $this->getAddSubButtonHtml() ?>
26
+ <?php endif; ?>
27
+ </div>
28
+ <div class="tree-actions">
29
+ <?php if($this->getRoot()): ?>
30
+ <a href="#" onclick="tree.collapseTree(); return false;">
31
+ <?php echo Mage::helper('megamenu2')->__('Collapse All'); ?>
32
+ </a>
33
+ <span class="separator">|</span>
34
+ <a href="#" onclick="tree.expandTree(); return false;">
35
+ <?php echo Mage::helper('megamenu2')->__('Expand All'); ?>
36
+ </a>
37
+ <?php endif; ?>
38
+ </div>
39
+ <?php if ($this->getRoot()): ?>
40
+ <div class="tree-holder">
41
+ <div id="tree-div" style="width:100%; overflow:auto;"></div>
42
+ </div>
43
+ </div>
44
+ <script type="text/javascript">
45
+ //<![CDATA[
46
+ var tree;
47
+ /**
48
+ * Fix ext compatibility with prototype 1.6
49
+ */
50
+ Ext.lib.Event.getTarget = function(e) {
51
+ var ee = e.browserEvent || e;
52
+ return ee.target ? Event.element(ee) : null;
53
+ };
54
+ Ext.tree.TreePanel.Enhanced = function(el, config){
55
+ Ext.tree.TreePanel.Enhanced.superclass.constructor.call(this, el, config);
56
+ };
57
+ Ext.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, {
58
+ loadTree : function(config, firstLoad){
59
+ var parameters = config['parameters'];
60
+ var data = config['data'];
61
+ if ((typeof parameters['root_visible']) != 'undefined') {
62
+ this.rootVisible = parameters['root_visible']*1;
63
+ }
64
+ var root = new Ext.tree.TreeNode(parameters);
65
+ this.nodeHash = {};
66
+ this.setRootNode(root);
67
+ if (firstLoad) {
68
+ this.addListener('click', this.menuitemClick);
69
+ this.addListener('beforenodedrop', menuitemMove.createDelegate(this));
70
+ }
71
+ this.loader.buildMenuitemTree(root, data);
72
+ this.el.dom.innerHTML = '';
73
+ // render the tree
74
+ this.render();
75
+ if (parameters['expanded']) {
76
+ this.expandAll();
77
+ }
78
+ else {
79
+ root.expand();
80
+ }
81
+ var selectedNode = this.getNodeById(parameters['menuitem_id']);
82
+ if (selectedNode) {
83
+ this.currentNodeId = parameters['menuitem_id'];
84
+ }
85
+ this.selectCurrentNode();
86
+ },
87
+ request : function(url, params){
88
+ if (!params) {
89
+ if (menuitem_info_tabsJsTabs.activeTab) {
90
+ var params = {active_tab_id:menuitem_info_tabsJsTabs.activeTab.id};
91
+ }
92
+ else {
93
+ var params = {};
94
+ }
95
+ }
96
+ if (!params.form_key) {
97
+ params.form_key = FORM_KEY;
98
+ }
99
+ var result = new Ajax.Request(
100
+ url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ),
101
+ {
102
+ parameters: params,
103
+ method: 'post'
104
+ }
105
+ );
106
+ return result;
107
+ },
108
+ selectCurrentNode : function(){
109
+ if (this.currentNodeId) {
110
+ var selectedNode = this.getNodeById(this.currentNodeId);
111
+ if ((typeof selectedNode.attributes.path)!='undefined') {
112
+ var path = selectedNode.attributes.path;
113
+ path = '0/'+path;
114
+ this.selectPath(path);
115
+ }
116
+ else {
117
+ this.getSelectionModel().select(selectedNode);
118
+ }
119
+ }
120
+ },
121
+ collapseTree : function(){
122
+ this.collapseAll();
123
+ this.selectCurrentNode();
124
+ if (!this.collapsed) {
125
+ this.collapsed = true;
126
+ this.loader.dataUrl = '<?php echo $this->getLoadTreeUrl(false) ?>';
127
+ this.request(this.loader.dataUrl, false);
128
+ }
129
+ },
130
+ expandTree : function(){
131
+ this.expandAll();
132
+ if (this.collapsed) {
133
+ this.collapsed = false;
134
+ this.loader.dataUrl = '<?php echo $this->getLoadTreeUrl(true) ?>';
135
+ this.request(this.loader.dataUrl, false);
136
+ }
137
+ },
138
+ menuitemClick : function(node, e){
139
+ var baseUrl = '<?php echo $this->getEditUrl() ?>';
140
+ var urlExt = 'id/'+node.id+'/';
141
+ var url = parseSidUrl(baseUrl, urlExt);
142
+ this.currentNodeId = node.id;
143
+ if (!this.useAjax) {
144
+ setLocation(url);
145
+ return;
146
+ }
147
+ if (menuitem_info_tabsJsTabs.activeTab) {
148
+ var params = {active_tab_id:menuitem_info_tabsJsTabs.activeTab.id};
149
+ }
150
+ updateContent(url, params);
151
+ }
152
+ });
153
+ function reRenderTree(event){
154
+ if (tree && event) {
155
+ var obj = event.target;
156
+ if ($('add_root_menuitem_button')) {
157
+ $('add_root_menuitem_button').show();
158
+ }
159
+ // retain current selected menu item id
160
+ var url = tree.switchTreeUrl;
161
+ // load from cache
162
+ // load from ajax
163
+ new Ajax.Request(url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), {
164
+ parameters : {form_key: FORM_KEY},
165
+ method : 'post',
166
+ onComplete : function(transport) {
167
+ var response = eval('(' + transport.responseText + ')');
168
+ if (!response['parameters']) {
169
+ return false;
170
+ }
171
+ _renderNewTree(response);
172
+ }
173
+ });
174
+ }
175
+ // render default tree
176
+ else {
177
+ _renderNewTree();
178
+ }
179
+ }
180
+ function _renderNewTree(config){
181
+ if (!config) {
182
+ var config = defaultLoadTreeParams;
183
+ }
184
+ if (tree) {
185
+ tree.purgeListeners();
186
+ tree.el.dom.innerHTML = '';
187
+ }
188
+ tree = new Ext.tree.TreePanel.Enhanced('tree-div', newTreeParams);
189
+ tree.loadTree(config, true);
190
+ // try to select current menu item
191
+ var selectedNode = tree.getNodeById(config.parameters.menuitem_id);
192
+ if (selectedNode) {
193
+ tree.currentNodeId = config.parameters.menuitem_id;
194
+ }
195
+ tree.selectCurrentNode();
196
+ // update content area
197
+ var url = tree.editUrl;
198
+ <?php if ($this->isClearEdit()):?>
199
+ if (selectedNode) {
200
+ url = url + 'id/' + config.parameters.menuitem_id;
201
+ }
202
+ <?php endif;?>
203
+ updateContent(url);
204
+ }
205
+ Ext.onReady(function(){
206
+ menuitemLoader = new Ext.tree.TreeLoader({
207
+ dataUrl: '<?php echo $this->getLoadTreeUrl() ?>'
208
+ });
209
+ menuitemLoader.createNode = function(config) {
210
+ var node;
211
+ var _node = Object.clone(config);
212
+ if (config.children && !config.children.length) {
213
+ delete(config.children);
214
+ node = new Ext.tree.AsyncTreeNode(config);
215
+ }
216
+ else {
217
+ node = new Ext.tree.TreeNode(config);
218
+ }
219
+ return node;
220
+ };
221
+ menuitemLoader.buildMenuitemTree = function(parent, config){
222
+ if (!config) {
223
+ return null;
224
+ }
225
+ if (parent && config && config.length){
226
+ for (var i = 0; i < config.length; i++) {
227
+ var node;
228
+ var _node = Object.clone(config[i]);
229
+ if (_node.children && !_node.children.length) {
230
+ delete(_node.children);
231
+ node = new Ext.tree.AsyncTreeNode(_node);
232
+ }
233
+ else {
234
+ node = new Ext.tree.TreeNode(config[i]);
235
+ }
236
+ parent.appendChild(node);
237
+ node.loader = node.getOwnerTree().loader;
238
+ if (_node.children) {
239
+ this.buildMenuitemTree(node, _node.children);
240
+ }
241
+ }
242
+ }
243
+ };
244
+ menuitemLoader.buildHash = function(node){
245
+ var hash = {};
246
+ hash = this.toArray(node.attributes);
247
+ if (node.childNodes.length>0 || (node.loaded==false && node.loading==false)) {
248
+ hash['children'] = new Array;
249
+ for (var i = 0, len = node.childNodes.length; i < len; i++) {
250
+ if (!hash['children']) {
251
+ hash['children'] = new Array;
252
+ }
253
+ hash['children'].push(this.buildHash(node.childNodes[i]));
254
+ }
255
+ }
256
+ return hash;
257
+ };
258
+ menuitemLoader.toArray = function(attributes) {
259
+ var data = {form_key: FORM_KEY};
260
+ for (var key in attributes) {
261
+ var value = attributes[key];
262
+ data[key] = value;
263
+ }
264
+ return data;
265
+ };
266
+ menuitemLoader.on("beforeload", function(treeLoader, node) {
267
+ treeLoader.baseParams.id = node.attributes.id;
268
+ treeLoader.baseParams.form_key = FORM_KEY;
269
+ });
270
+ menuitemLoader.on("load", function(treeLoader, node, config) {
271
+ varienWindowOnload();
272
+ });
273
+ newTreeParams = {
274
+ animate : false,
275
+ loader : menuitemLoader,
276
+ enableDD: true,
277
+ containerScroll : true,
278
+ selModel: new Ext.tree.CheckNodeMultiSelectionModel(),
279
+ rootVisible : false,
280
+ useAjax : <?php echo $this->getUseAjax() ?>,
281
+ switchTreeUrl : '<?php echo $this->getSwitchTreeUrl() ?>',
282
+ editUrl : '<?php echo $this->getEditUrl() ?>',
283
+ currentNodeId : <?php echo (int) $this->getMenuitemId() ?>
284
+ };
285
+ defaultLoadTreeParams = {
286
+ parameters : {
287
+ text: '<?php echo htmlentities($this->getRoot()->getLinktitle()) ?>',
288
+ draggable : false,
289
+ allowDrop : true,
290
+ id : <?php echo (int) $this->getRoot()->getId() ?>,
291
+ expanded: <?php echo (int) $this->getIsWasExpanded() ?>,
292
+ menuitem_id : <?php echo (int) $this->getMenuitemId() ?>
293
+ },
294
+ data : <?php echo $this->getTreeJson() ?>
295
+ };
296
+ reRenderTree();
297
+ });
298
+
299
+ function addNew(url, isRoot){
300
+ if (isRoot) {
301
+ tree.currentNodeId = tree.root.id;
302
+ }
303
+ url+= 'parent/'+tree.currentNodeId;
304
+ updateContent(url);
305
+ }
306
+ function menuitemMove(obj){
307
+ var data = {id: obj.dropNode.id, form_key: FORM_KEY};
308
+ data.point = obj.point;
309
+ switch (obj.point) {
310
+ case 'above' :
311
+ data.pid = obj.target.parentNode.id;
312
+ data.paid = obj.dropNode.parentNode.id;
313
+ if (obj.target.previousSibling) {
314
+ data.aid = obj.target.previousSibling.id;
315
+ }
316
+ else {
317
+ data.aid = 0;
318
+ }
319
+ break;
320
+ case 'below' :
321
+ data.pid = obj.target.parentNode.id;
322
+ data.aid = obj.target.id;
323
+ break;
324
+ case 'append' :
325
+ data.pid = obj.target.id;
326
+ data.paid = obj.dropNode.parentNode.id;
327
+ if (obj.target.lastChild) {
328
+ data.aid = obj.target.lastChild.id;
329
+ } else {
330
+ data.aid = 0;
331
+ }
332
+ break;
333
+ default :
334
+ obj.cancel = true;
335
+ return obj;
336
+ }
337
+ var success = function(o) {
338
+ try {
339
+ if(o.responseText){
340
+ if(o.responseText==='SUCCESS'){
341
+ menuitemForm.refreshPath();
342
+ }
343
+ else {
344
+ alert(o.responseText);
345
+ location.reload();
346
+ }
347
+ }
348
+ }
349
+ catch(e) {}
350
+ };
351
+ var failure = function(o) {
352
+ try {
353
+ console.log(o.statusText);
354
+ } catch (e2) {
355
+ alert(o.statusText);
356
+ }
357
+ location.reload();
358
+ };
359
+ var pd = [];
360
+ for(var key in data) {
361
+ pd.push(encodeURIComponent(key), "=", encodeURIComponent(data[key]), "&");
362
+ }
363
+ pd.splice(pd.length-1,1);
364
+ new Ajax.Request(
365
+ '<?php echo $this->getMoveUrl() ?>',
366
+ {
367
+ method: 'POST',
368
+ parameters: pd.join(""),
369
+ onSuccess : success,
370
+ onFailure : failure
371
+ }
372
+ );
373
+ }
374
+ //]]>
375
+ </script>
376
+ <?php endif; ?>
app/design/frontend/base/default/layout/jscriptz_megamenu2.xml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * JScriptz_MegaMenu2 extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category JScriptz
14
+ * @package JScriptz_MegaMenu2
15
+ * @copyright Copyright (c) 2013
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <layout version="0.1.0">
20
+ <default translate="label" module="page">
21
+ <reference name="head">
22
+ <action method="addItem"><type>skin_js</type><name>js/JScriptz/mgmenu.js</name></action>
23
+ <action method="addItem"><type>skin_css</type><name>css/JScriptz/mgmenu.css</name><params>media="screen"</params></action>
24
+ </reference>
25
+ <reference name="catalog.topnav">
26
+ <action method="setTemplate"><template>jscriptz/html/topmenu.phtml</template></action>
27
+ </reference>
28
+ <reference name="top.menu">
29
+ <action method="setTemplate"><template>jscriptz/html/topmenu.phtml</template></action>
30
+ </reference>
31
+ </default>
32
+ </layout>
app/design/frontend/base/default/template/jscriptz/html/topmenu.phtml ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Top menu for store
30
+ *
31
+ * @see JScriptz_MegaMenu2_Block_Html_Topmenu extends Mage_Page_Block_Html_Topmenu
32
+ */
33
+ ?>
34
+ <?php $z=0;$_menu = $this->getHtml('level-top') ?>
35
+ <?php $_menuItem = $this->getMenuItem() ?>
36
+ <script>
37
+ $.noConflict();
38
+ jQuery( document ).ready(function( $ ) {
39
+ jQuery('#mgmenu1').universalMegaMenu({
40
+ menu_effect: 'hover_fade',
41
+ menu_speed_show: 300,
42
+ menu_speed_hide: 200,
43
+ menu_speed_delay: 200,
44
+ menu_click_outside: false,
45
+ menubar_trigger : false,
46
+ menubar_hide : false,
47
+ menu_responsive: true
48
+ });
49
+ megaMenuContactForm();
50
+ });
51
+ </script>
52
+
53
+ <div class="mgmenu_container" id="mgmenu1"><!-- Begin Mega Menu Container -->
54
+
55
+ <ul class="mgmenu"><!-- Begin Mega Menu -->
56
+
57
+
58
+
59
+ <!-- Begin MegaMenu Items -->
60
+
61
+ <?php if(!empty($_menuItem)): ?>
62
+ <?php foreach($_menuItem as $sort){
63
+ $sortArray[] = $sort;
64
+ }
65
+ usort ($sortArray, function($a, $b) {return strcmp($a['position'], $b['position']);});
66
+ ?>
67
+
68
+ <?php foreach($sortArray as $item): ?>
69
+
70
+ <?php if($item['linktitle'] != 'ROOT' && $item['level'] == 1): ?>
71
+ <?php if($item['linktitle'] == 'Products'): ?>
72
+ <li style=""><span><i class="mini_icon ic_grid"></i>Products</span><!-- Begin Products Item -->
73
+
74
+ <div class="dropdown_2columns dropdown_container" style="display: none;"><!-- Begin Products Item Container -->
75
+
76
+ <ul class="dropdown_flyout">
77
+
78
+ <?php if($_menu): ?>
79
+ <li class="mgmenu_button" style="display: none;"><?php echo $item["linktitle"]; ?></li><!-- Button (Mobile Devices) -->
80
+ <?php echo $_menu; ?>
81
+ <?php endif ?>
82
+ </ul>
83
+
84
+ </div><!-- End Products Item Container -->
85
+
86
+ </li><!-- End Products Item -->
87
+
88
+ <?php else: ?>
89
+ <li class="mgmenu_button" style="display: none;"><?php echo $item["linktitle"]; ?></li><!-- Button (Mobile Devices) -->
90
+
91
+ <!-- Begin Dropdown Link -->
92
+ <li>
93
+
94
+ <?php if(!empty($item["linkpath"])):?>
95
+
96
+ <?php echo "<a href='".$item["linkpath"]."'";
97
+
98
+ if(!empty($item["linktarget"])){
99
+ echo "target='_".$item['linktarget']."'>".$item["linktitle"]."</a>";
100
+ }
101
+ else{
102
+ echo ">".$item["linktitle"]."</a>";
103
+ }
104
+ ?>
105
+
106
+ <?php else: ?>
107
+
108
+ <span><?php echo $item["linktitle"]; ?></span>
109
+
110
+ <?php endif; ?>
111
+
112
+
113
+
114
+ <?php if(!empty($item["menuhtml"])): ?>
115
+
116
+ <?php echo $item["menuhtml"]; ?>
117
+
118
+ <?php endif; ?>
119
+
120
+ </li>
121
+ <!-- End Dropdown Link -->
122
+
123
+ <?php endif; ?>
124
+ <?php endif; ?>
125
+
126
+ <?php endforeach; ?>
127
+ <?php endif ?>
128
+
129
+ <li class="right_item" style=""><span><i class="mini_icon ic_chat"></i>Contact</span><!-- Begin Item -->
130
+
131
+
132
+ <div class="dropdown_container dropdown_4columns dropdown_right" style="display: none;"><!-- Begin Item Container -->
133
+
134
+
135
+ <div class="col_12">
136
+
137
+ <h4 class="contact">Contact us</h4>
138
+ <p></p>
139
+
140
+ <div id="contact_form" class="contact_form"><!-- Begin Contact Form -->
141
+
142
+ <form action="/contacts/index/post" id="mgmenu_form" method="POST">
143
+
144
+ <label for="name">Name<span class="required"> *</span></label><br>
145
+ <input type="text" id="name" name="name" class="form_element">
146
+
147
+ <label for="email">Email<span class="required"> *</span></label><br>
148
+ <input type="text" id="email" name="email" class="form_element">
149
+
150
+ <label for="telephone">Telephone</label>
151
+ <input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="form_element" type="text" />
152
+
153
+ <label for="message">Message<span class="required"> *</span></label><br>
154
+ <textarea id="comment" class="form_element" name="comment"></textarea>
155
+
156
+ <input type="text" id="hideit" name="hideit" value="" style="display:none !important">
157
+ <div class="form_buttons">
158
+ <input type="submit" value="Submit" id="submit" class="button">
159
+ <input type="reset" value="Reset" id="reset" class="button">
160
+ </div>
161
+
162
+ </form>
163
+
164
+ </div><!-- End Contact Form -->
165
+
166
+ </div>
167
+
168
+
169
+ </div><!-- End Item Container -->
170
+
171
+
172
+ </li><!-- End Item -->
173
+
174
+
175
+
176
+ </ul><!-- End Mega Menu -->
177
+
178
+
179
+
180
+ </div>
app/etc/modules/JScriptz_MegaMenu2.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * JScriptz_MegaMenu2 extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category JScriptz
14
+ * @package JScriptz_MegaMenu2
15
+ * @copyright Copyright (c) 2013
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <config>
20
+ <modules>
21
+ <JScriptz_MegaMenu2>
22
+ <active>true</active>
23
+ <codePool>community</codePool>
24
+ <depends>
25
+ <Mage_Core />
26
+ </depends>
27
+ </JScriptz_MegaMenu2>
28
+ </modules>
29
+ </config>
app/locale/en_US/JScriptz_MegaMenu2.csv ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Action","Action"
2
+ "Add Child Menu Item","Add Child Menu Item"
3
+ "Add Menu Item","Add Menu Item"
4
+ "Add Root Menu Item","Add Root Menu Item"
5
+ "An error occurred while trying to delete the menu item.","An error occurred while trying to delete the menu item."
6
+ "Are you sure?","Are you sure?"
7
+ "CSV","CSV"
8
+ "Can't delete root menu item.","Can't delete root menu item."
9
+ "Change status","Change status"
10
+ "Collapse All","Collapse All"
11
+ "Could not find menu item to delete.","Could not find menu item to delete."
12
+ "Delete Menu Item","Delete Menu Item"
13
+ "Delete","Delete"
14
+ "Disabled","Disabled"
15
+ "Display as tree","Display as tree"
16
+ "Edit Menu Item '%s'","Edit Menu Item '%s'"
17
+ "Edit","Edit"
18
+ "Enabled","Enabled"
19
+ "Excel","Excel"
20
+ "Expand All","Expand All"
21
+ "Home","Home"
22
+ "ID: %s","ID: %s"
23
+ "Id","Id"
24
+ "Levels to show (0 for all)","Levels to show (0 for all)"
25
+ "Link Path","Link Path"
26
+ "Link Position","Link Position"
27
+ "Link Target","Link Target"
28
+ "Link Title","Link Title"
29
+ "Manage Menu Items","Manage Menu Items"
30
+ "Menu HTML","Menu HTML"
31
+ "Menu Item move error","Menu Item move error"
32
+ "Menu Item move operation is not possible: parent menu item is equal to child menu item.","Menu Item move operation is not possible: parent menu item is equal to child menu item."
33
+ "Menu Item move operation is not possible: the current menu item was not found.","Menu Item move operation is not possible: the current menu item was not found."
34
+ "Menu Item move operation is not possible: the new parent menu item was not found.","Menu Item move operation is not possible: the new parent menu item was not found."
35
+ "Menu Item subtree widget","Menu Item subtree widget"
36
+ "Menu Item subtree","Menu Item subtree"
37
+ "Menu Item was successfully deleted.","Menu Item was successfully deleted."
38
+ "Menu Item was successfully saved","Menu Item was successfully saved"
39
+ "Menu Item","Menu Item"
40
+ "Menu Items","Menu Items"
41
+ "New Menu Item","New Menu Item"
42
+ "New Root Menu Item","New Root Menu Item"
43
+ "No","No"
44
+ "None","None"
45
+ "Place any HTML in this block to be displayed in the Mega Nav. Tip: Disable the WYSIWYG editor to place pure HTML code","Place any HTML in this block to be displayed in the Mega Nav. Tip: Disable the WYSIWYG editor to place pure HTML code"
46
+ "Please select menu items to delete.","Please select menu items to delete."
47
+ "Please select menu items.","Please select menu items."
48
+ "Recursion level","Recursion level"
49
+ "Root","Root"
50
+ "Save And Continue Edit","Save And Continue Edit"
51
+ "Save Menu Item","Save Menu Item"
52
+ "Select Menu Item","Select Menu Item"
53
+ "Status","Status"
54
+ "Store views","Store views"
55
+ "The menu item has been saved.","The menu item has been saved."
56
+ "There was a problem saving the menu item.","There was a problem saving the menu item."
57
+ "There was an error deleteing menu item.","There was an error deleteing menu item."
58
+ "There was an error deleteing menu items.","There was an error deleteing menu items."
59
+ "There was an error updating menu items.","There was an error updating menu items."
60
+ "This controls the order in which your links are displayed","This controls the order in which your links are displayed"
61
+ "This is the title for your menu link","This is the title for your menu link"
62
+ "This is the url your link will follow","This is the url your link will follow"
63
+ "This menu item no longer exists.","This menu item no longer exists."
64
+ "Total of %d menu items were successfully deleted.","Total of %d menu items were successfully deleted."
65
+ "Total of %d menu items were successfully updated.","Total of %d menu items were successfully updated."
66
+ "Unable to find menu item to save.","Unable to find menu item to save."
67
+ "Whether the link opens in a new tab -- examples (blank, self)","Whether the link opens in a new tab -- examples (blank, self)"
68
+ "XML","XML"
69
+ "Yes","Yes"
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>JScriptz_MegaMenu2</name>
4
+ <version>1.8.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This is a mega nav extension that allows you to control your top menu links and the content below them through the admin interface. </summary>
10
+ <description>This is a mega nav extension that allows you to control your top menu links and the content below them through the admin interface. It supports HTML, Video, Tabbed Jquery, and even has a nifty contact us form. </description>
11
+ <notes>This is a mega nav extension that allows you to control your top menu links and the content below them through the admin interface. It supports HTML, Video, Tabbed Jquery, and even has a nifty contact us form. </notes>
12
+ <authors><author><name>Jason Lotzer</name><user>jlotty22</user><email>jasonlotzer@gmail.com</email></author></authors>
13
+ <date>2013-10-07</date>
14
+ <time>16:48:32</time>
15
+ <contents><target name="magecommunity"><dir name="JScriptz"><dir name="MegaMenu2"><dir name="Block"><dir name="Adminhtml"><dir name="Helper"><file name="Wysiwyg.php" hash="b466f038662d9e42a807ae3c0dc5fcca"/></dir><dir name="Menuitem"><file name="Abstract.php" hash="edc0bae932697b8aacabbaca86fdd2fe"/><dir name="Edit"><file name="Form.php" hash="db5ce8ad95a7bcd8de8bb7f1be243265"/><dir name="Tab"><file name="Form.php" hash="18d752d8318a3574ac792b9386c38a91"/><file name="Stores.php" hash="842c7c109505f22421c5430a34726933"/></dir><file name="Tabs.php" hash="5dba4a3d0765d68749e23270be8d2933"/></dir><file name="Edit.php" hash="7d59bf88e284a468ea01f5f9e5eb0905"/><file name="Tree.php" hash="4fc390bb4d595fd7227d829c6777036e"/></dir><file name="Menuitem.php" hash="5a856d8abc0928304fbbfb3505f75d6f"/></dir><dir name="Html"><file name="Topmenu.php" hash="3c848884aaf9762a85066e7cc603ade7"/></dir></dir><dir name="Controller"><dir name="Adminhtml"><file name="MegaMenu2.php" hash="04675e81391803b2425eaf29e5f376db"/></dir></dir><dir name="Helper"><file name="Data.php" hash="ce9cce0ccb9b7355ed5f325df135b340"/><file name="Menuitem.php" hash="68688f460db50999892742bbb561346f"/></dir><dir name="Model"><file name="Menuitem.php" hash="2d570202c2373c70d1e41b2a27f1c477"/><dir name="Resource"><dir name="Menuitem"><file name="Collection.php" hash="3fd8613ce5ad89da1fabef4b07d9f4db"/><file name="Tree.php" hash="1c9ba48e1f29e929f28df8e831f4f20e"/></dir><file name="Menuitem.php" hash="beb8dc781bee28f5152fd8771d9c9f2b"/><file name="Setup.php" hash="bfc93f99f7db72c16a0500dd504f908e"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="MegaMenu2"><file name="MenuitemController.php" hash="7bd76497a989e6e00436bffc87f0287e"/></dir></dir></dir><dir name="data"><dir name="jscriptz_megamenu2_setup"><file name="data-install-0.0.1.php" hash="af94ebdf8fd07615ad5a07fc56cd85d1"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ccd9ab48ea64870214061ce78d43f005"/><file name="config.xml" hash="74b313a62cde04ea63f040b11fb2a016"/></dir><dir name="sql"><dir name="jscriptz_megamenu2_setup"><file name="install-0.0.1.php" hash="61d6edab17f53224b02f045b42cd24c8"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="JScriptz_MegaMenu2.xml" hash="35ebf14afac4c63cafb1531bd00ebdc1"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="jscriptz_megamenu2.xml" hash="347eb35e0b0f9721c6758fa1e2a1ef8f"/></dir><dir name="template"><dir name="jscriptz_megamenu2"><dir name="menuitem"><dir name="edit"><file name="form.phtml" hash="b9b8c45cc98084d33f052c104daede62"/></dir><file name="edit.phtml" hash="3de3bc7531d06fc87f1b270180bd7294"/><file name="tree.phtml" hash="61eb0c277f2e641f6fd7922a6d54c643"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="jscriptz_megamenu2.xml" hash="1015ba50190b651b7d5e3a4aca9237d8"/></dir><dir name="template"><dir name="jscriptz"><dir name="html"><file name="topmenu.phtml" hash="ab84092a5d063768966ff17bd2f4c7d7"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="JScriptz"><file name="mgmenu.css" hash="4297600d34500976c09ebe3d4cf25843"/></dir></dir><dir name="js"><dir name="JScriptz"><file name="mgmenu.js" hash="b808a4e75addeeb519f24b1349ed7824"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="JScriptz_MegaMenu2.csv" hash="ab83e9d97293163a6136649945146a5a"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
skin/frontend/base/default/css/JScriptz/mgmenu.css ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ @media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2){body{background:url(/skin/frontend/base/default/images/jscriptz_megamenu2/page_bg@2x.png) repeat}}
3
+ .page_wrapper{width:80%;margin:0 auto;max-width:960px}p{font-size:12px;line-height:21px;margin-bottom:18px}
4
+ .dummy_content{width:100%;margin:32px auto}
5
+ .dummy_content_margin{width:100%;margin:75px auto;*padding-top:60px}
6
+ .dummy_content p,.dummy_content_margin p,.dummy_content li,.dummy_content_margin li{color:#666;font-size:12px;line-height:21px;text-shadow:1px 1px 1px #fff}
7
+ .dummy_content .pusher,.dummy_content_margin .pusher{width:100%;height:50px}
8
+ .dummy_content a,.dummy_content_margin a{color:#888;text-decoration:none}
9
+ .dummy_content a:hover,.dummy_content_margin a:hover{color:#999}
10
+ .dummy_content ul,.dummy_content_margin ul{list-style:square;line-height:21px}
11
+ .dummy_content h1,.dummy_content_margin h1,.dummy_content h2,.dummy_content_margin h2,.dummy_content h3,.dummy_content_margin h3{color:#222;text-shadow:1px 1px 1px #fff}@media only screen and (max-width:980px){.dummy_content,.dummy_content_margin{width:100%}
12
+ .dummy_content_margin{margin:32px auto}}
13
+
14
+ #mgmenu1{z-index:12;width:950px;}
15
+ #mgmenu2{margin-top:12px;z-index:11}
16
+ .mgmenu_container,
17
+ .mgmenu_fixed,
18
+ .mgmenu_footer
19
+ {width:100%;height:41px;z-index:10;background:#282828;background:-webkit-linear-gradient(top,#282828 0,#1f1f1f 100%);background:-moz-linear-gradient(top,#282828 0,#1f1f1f 100%);background:-o-linear-gradient(top,#282828 0,#1f1f1f 100%);background:-ms-linear-gradient(top,#282828 0,#1f1f1f 100%);background:linear-gradient(top,#282828 0,#1f1f1f 100%)}
20
+ .mgmenu_container{position:relative;margin:0 auto}
21
+ .mgmenu_fixed,.mgmenu_footer{width:inherit;max-width:inherit;position:fixed;top:0;*width:expression(this.parentNode.currentStyle['width'])}
22
+ .mgmenu_footer{top:auto;bottom:0}
23
+ .mgmenu{font-family:Arial,Helvetica,sans-serif;font-size:13px;list-style:none;padding:0;margin:0;position:relative;line-height:1;}
24
+ .mgmenu>li{float:left;margin:0;padding-right:15px;-webkit-transition:background .3s;-moz-transition:background .3s;-o-transition:background .3s;-ms-transition:background .3s;transition:background .3s}
25
+ .mgmenu>li:hover,.mgmenu>li.active{background-color:#131313}
26
+ .mgmenu li.noactive{background:0}
27
+ .mgmenu>li>a,.mgmenu>li>span{display:block;color:#fff;text-shadow:1px 1px 1px #000;font-size:12px;outline:0;text-decoration:none;padding:15px 0 14px 15px}
28
+ .mgmenu>li>span:hover,.mgmenu>li>a:hover,.mgmenu>li>a:focus{cursor:pointer;color:#fff;outline:0}
29
+ .mgmenu>li .mgmenu_drop{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/downArrow.png");background-repeat:no-repeat;background-position:right 19px;padding-right:20px}
30
+ .mgmenu_footer .mgmenu>li .mgmenu_drop{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/upArrow.png")}
31
+ .mgmenu>li.right_item{float:right;margin-right:0}
32
+ .mgmenu_container>.mgmenu>li.mgmenu_button,
33
+ .mgmenu_fixed>.mgmenu>li.mgmenu_button,
34
+ .mgmenu_footer>.mgmenu>li.mgmenu_button{display:none;cursor:pointer;-webkit-transition:none;-moz-transition:none;-o-transition:none;-ms-transition:none;transition:none;font-weight:bold;background-color:transparent;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/toggle.png");background-repeat:no-repeat;background-position:96% 10px;line-height:12px;padding:14px 4% 14px 4%;color:#fff;text-shadow:1px 1px 1px #000}
35
+ .mgmenu_container>.mgmenu>li.mgmenu_button_active,.mgmenu_fixed>.mgmenu>li.mgmenu_button_active,.mgmenu_footer>.mgmenu>li.mgmenu_button_active{background-color:#000}
36
+ .mgmenu_trigger{position:fixed;z-index:2;margin:0 auto;right:0;margin-right:20px;width:35px;height:41px;display:block}
37
+ .mgmenu_trigger{top:0;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/button_up.png");background-position:center center;background-repeat:no-repeat;background-color:#121212}
38
+ .mgmenu_trigger.active{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/button_down.png")}
39
+ .mgmenu_footer ~ .mgmenu_trigger{top:auto;bottom:0;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/button_down.png")}
40
+ .mgmenu_footer ~ .mgmenu_trigger.active{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/button_up.png")}
41
+ .mgmenu li .dropdown_container,
42
+ .mgmenu li .dropdown_fullwidth,
43
+ .mgmenu li .mgmenu_multilevel{position:absolute;top:auto;display:none;float:left;zoom:1;z-index:10;margin:0 0 40px -1px;padding:20px 0 6px 0;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;-webkit-box-shadow:0 2px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 2px 2px rgba(0,0,0,0.05);-o-box-shadow:0 2px 2px rgba(0,0,0,0.05);box-shadow:0 2px 2px rgba(0,0,0,0.05);border:1px solid #ccc;border-top:0;background:#e5e5e5;color:#212121}
44
+ .mgmenu li .dropdown_container{left:auto}
45
+ .mgmenu li .dropdown_fullwidth{left:0}
46
+ .mgmenu li.right_item .dropdown_container{left:auto;right:-1px}
47
+ .mgmenu_footer .mgmenu>li .dropdown_container,
48
+ .mgmenu_footer .mgmenu>li .dropdown_fullwidth,
49
+ .mgmenu_footer .mgmenu>li .mgmenu_multilevel{margin:0 0 0 -1px;top:auto;bottom:0;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;-webkit-box-shadow:0 -2px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 -2px 2px rgba(0,0,0,0.05);-o-box-shadow:0 -2px 2px rgba(0,0,0,0.05);box-shadow:0 -2px 2px rgba(0,0,0,0.05);border:1px solid #ccc;border-bottom:0}
50
+ .mgmenu>li:hover .dropdown_container,.mgmenu>li:hover .dropdown_fullwidth,.mgmenu>li.right_item:hover .dropdown_container{display:block}
51
+ .mgmenu li .dropdown_1column{width:8.3334%;padding-left:2%;padding-right:2%}
52
+ .mgmenu li .dropdown_2columns{width:250px;padding-left:1.8333%;padding-right:1.8333%}
53
+ .mgmenu li .dropdown_3columns{width:25%;padding-left:1.5%;padding-right:1.5%}
54
+ .mgmenu li .dropdown_4columns{width:33.3334%;padding-left:1.333%;padding-right:1.333%}
55
+ .mgmenu li .dropdown_5columns{width:41.6667%;padding-left:1.166%;padding-right:1.166%}
56
+ .mgmenu li .dropdown_6columns{width:50%;padding-left:1%;padding-right:1%}
57
+ .mgmenu li .dropdown_7columns{width:58.3334%;padding-left:.833%;padding-right:.833%}
58
+ .mgmenu li .dropdown_8columns{width:66.6667%;padding-left:.666%;padding-right:.666%}
59
+ .mgmenu li .dropdown_9columns{width:75%;padding-left:.5%;padding-right:.5%}
60
+ .mgmenu li .dropdown_10columns{width:83.3334%;padding-left:.333%;padding-right:.333%}
61
+ .mgmenu li .dropdown_11columns{width:91.6667%;padding-left:.1666%;padding-right:.1666%}
62
+ .mgmenu li .dropdown_fullwidth{width:100%}
63
+ .mgmenu .col_1,.mgmenu .col_2,.mgmenu .col_3,.mgmenu .col_4,.mgmenu .col_5,.mgmenu .col_6,.mgmenu .col_7,.mgmenu .col_8,.mgmenu .col_9,
64
+ .mgmenu .col_10,.mgmenu .col_11,.mgmenu .col_12{float:left;display:inline;position:relative;padding-left:2%;padding-right:2%;*padding-left:1.9%;*padding-right:1.9%}
65
+ .mgmenu .col_1{width:4.33%}
66
+ .mgmenu .col_2{width:12.66%}
67
+ .mgmenu .col_3{width:21%}
68
+ .mgmenu .col_4{width:29.33%}
69
+ .mgmenu .col_5{width:37.66%}
70
+ .mgmenu .col_6{width:46%}
71
+ .mgmenu .col_7{width:54.33%}
72
+ .mgmenu .col_8{width:62.66%}
73
+ .mgmenu .col_9{width:71%}
74
+ .mgmenu .col_10{width:79.33%}
75
+ .mgmenu .col_11{width:87.66%}
76
+ .mgmenu .col_12{width:96%}
77
+ .mgmenu .clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:18px}
78
+ .mgmenu .col_border{-webkit-box-shadow:-1px 0 0 rgba(0,0,0,0.15);-moz-box-shadow:-1px 0 0 rgba(0,0,0,0.15);-o-box-shadow:-1px 0 0 rgba(0,0,0,0.15);box-shadow:-1px 0 0 rgba(0,0,0,0.15)}
79
+ .mgmenu .dropdown_flyout,.mgmenu .dropdown_flyout .dropdown_flyout_level{padding:0;margin:0;list-style:none;z-index:9;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px}
80
+ .mgmenu .dropdown_flyout .dropdown_flyout_level{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 2px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 2px 2px rgba(0,0,0,0.05);-o-box-shadow:0 2px 2px rgba(0,0,0,0.05);box-shadow:0 2px 2px rgba(0,0,0,0.05);border:1px solid #ccc;background:#e5e5e5}
81
+ .mgmenu .dropdown_flyout li{margin-top:-5px;float:left;width:100%;padding:0px 0 3px 0}
82
+ .mgmenu .dropdown_flyout ul li{width:250px;padding:3px 0px 3px 0px}
83
+ .mgmenu .dropdown_flyout li.last{margin-bottom:12px}
84
+ .mgmenu .dropdown_flyout a{display:block;width:10em}
85
+ .mgmenu .dropdown_flyout .dropdown_flyout_level{position:absolute;margin:15px 0 0 4px;padding:6px;left:98%;top:-21px;display:none;zoom:1;float:left}
86
+ .mgmenu .dropdown_flyout .dropdown_flyout_level_left{left:-102%;right:100%}
87
+ .mgmenu .dropdown_flyout .dropdown_parent{background:url("/skin/frontend/base/default/images/jscriptz_megamenu2/rightArrow.png") no-repeat 90% 9px}
88
+ .mgmenu .dropdown_flyout .dropdown_parent_left{background:url("/skin/frontend/base/default/images/jscriptz_megamenu2/leftArrow.png") no-repeat 90% 9px}
89
+ .mgmenu .dropdown_flyout li:hover>.dropdown_flyout_level,.mgmenu .dropdown_flyout li:hover>.dropdown_flyout_level_left{display:block}
90
+ .mgmenu .dropdown_flyout .flyout_heading{font-family:Georgia,Times,"Times New Roman",serif;padding-bottom:9px;margin-bottom:9px;font-size:16px;border-bottom:1px solid #ccc;-webkit-box-shadow:0 1px 1px #f4f4f4;-moz-box-shadow:0 1px 1px #f4f4f4;-o-box-shadow:0 1px 1px #f4f4f4;box-shadow:0 1px 1px #f4f4f4}
91
+ .mgmenu p,.mgmenu h1,.mgmenu h2,.mgmenu h3,.mgmenu h4,.mgmenu h5,.mgmenu h6{padding:0;margin:0;font-weight:normal;color:#222;text-shadow:1px 1px 1px #fff;margin-bottom:18px}
92
+ .mgmenu h1,.mgmenu h2,.mgmenu h3,.mgmenu h4,.mgmenu h5,.mgmenu h6{font-family:Georgia,Times,"Times New Roman",serif}
93
+ .mgmenu p{font-size:12px}
94
+ .mgmenu h1{font-size:32px}
95
+ .mgmenu h2{font-size:28px}
96
+ .mgmenu h3{font-size:24px}
97
+ .mgmenu h4{font-size:18px}
98
+ .mgmenu h5{font-size:16px}
99
+ .mgmenu h6{font-size:14px;text-transform:uppercase}
100
+ .mgmenu a{text-decoration:none;color:#222;-webkit-transition:color .3s;-moz-transition:color .3s;-o-transition:color .3s;-ms-transition:color .3s;transition:color .3s}
101
+ .mgmenu a:hover{color:#777}
102
+ .mgmenu a:focus{background:0}
103
+ .mgmenu>li ul,.mgmenu>li ol{padding:0 0 0 18px;margin:0 0 18px 0}
104
+ .mgmenu>li ul{list-style:square}
105
+ .mgmenu>li ol{list-style:decimal}
106
+ .mgmenu>li ul.no_bullets{list-style:none;padding:0}
107
+ .mgmenu>li ul.no_bullets li{line-height:24px}
108
+ .mgmenu>li ul li,.mgmenu>li ol li{font-size:12px;line-height:22px;position:relative;color:#222;text-shadow:1px 1px 1px #fff}
109
+ .mgmenu blockquote{color:#aaa;border-left:5px solid #ccc;padding-left:20px;font-family:Georgia,serif;font-style:italic;font-size:18px;line-height:27px}
110
+ .mgmenu .text_box{width:84%;background:#fff;padding:12px 8% 12px 8%;-webkit-box-shadow:0 1px 1px #bbb;-moz-box-shadow:0 1px 1px #bbb;-o-box-shadow:0 1px 1px #bbb;box-shadow:0 1px 1px #bbb}
111
+ .mgmenu .text_box_black{background:#212121}
112
+ .mgmenu .text_box_red{background:#e48a76}
113
+ .mgmenu .text_box_blue{background:#92bfd1}
114
+ .mgmenu .text_box_green{background:#b4ca91}
115
+ .mgmenu .text_box_yellow{background:#f3d067}
116
+ .mgmenu .text_box_purple{background:#c0addb}
117
+ .mgmenu .text_box_brown{background:#b2aa9f}
118
+ .mgmenu .text_box_black,.mgmenu .text_box_red,.mgmenu .text_box_blue,.mgmenu .text_box_green,.mgmenu .text_box_yellow,.mgmenu .text_box_purple,.mgmenu .text_box_brown{color:#fff;text-shadow:none;-webkit-box-shadow:none;-moz-box-shadow:none;-o-box-shadow:none;box-shadow:none}
119
+ .mgmenu .img_description{text-align:center;font-style:italic;margin-top:-6px;font-family:Georgia,Times,"Times New Roman",serif}
120
+ .mgmenu hr{width:100%;height:0;*height:2px;margin-bottom:18px;border:0;border-bottom:1px solid #f4f4f4;border-top:1px solid #ccc}
121
+ .mgmenu .video_container{position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden;margin-bottom:18px}
122
+ .mgmenu .video_container iframe,.mgmenu .video_container object,.mgmenu .video_container embed{position:absolute;top:0;left:0;width:100%;height:100%;border:0;outline:0}
123
+ .mgmenu iframe{border:0;outline:0;width:100%;font-size:100%;vertical-align:baseline;background:transparent;margin-bottom:12px}
124
+ .mgmenu img{border:0}
125
+ .mgmenu .inline_img{max-width:100%;height:auto;width:auto\9;box-sizing:border-box;-webkit-box-shadow:0 1px 1px #999;-moz-box-shadow:0 1px 1px #999;-o-box-shadow:0 1px 1px #999;box-shadow:0 1px 1px #999;margin-bottom:18px;margin-top:6px}
126
+ .mgmenu a .inline_img{opacity:.8;-webkit-transition:opacity .3s;-moz-transition:opacity .3s;-o-transition:opacity .3s;-ms-transition:opacity .3s;transition:opacity .3s}
127
+ .mgmenu a:hover .inline_img{opacity:1}
128
+ .mgmenu .inline_img_border{border:5px solid #fff}
129
+ .mgmenu .mini_icon{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/mini-icons-white.png");background-repeat:no-repeat;margin-top:-2px;padding-left:6px;float:left;width:20px;height:20px}
130
+ .mgmenu .ic_empty_document{background-position:0 0}
131
+ .mgmenu .ic_documents{background-position:-32px 0}
132
+ .mgmenu .ic_text_document{background-position:-64px 0}
133
+ .mgmenu .ic_folder{background-position:-96px 0}
134
+ .mgmenu .ic_picture{background-position:-128px 0}
135
+ .mgmenu .ic_cloud{background-position:-160px 0}
136
+ .mgmenu .ic_archive{background-position:-192px 0}
137
+ .mgmenu .ic_download{background-position:-224px 0}
138
+ .mgmenu .ic_user{background-position:-256px 0}
139
+ .mgmenu .ic_tag{background-position:-288px 0}
140
+ .mgmenu .ic_lock{background-position:0 -32px}
141
+ .mgmenu .ic_unlock{background-position:-32px -32px}
142
+ .mgmenu .ic_mail{background-position:-64px -32px}
143
+ .mgmenu .ic_brush{background-position:-96px -32px}
144
+ .mgmenu .ic_refresh{background-position:-128px -32px}
145
+ .mgmenu .ic_grid{background-position:-160px -32px}
146
+ .mgmenu .ic_list{background-position:-192px -32px}
147
+ .mgmenu .ic_delete{background-position:-224px -32px}
148
+ .mgmenu .ic_settings{background-position:-256px -32px}
149
+ .mgmenu .ic_time{background-position:-288px -32px}
150
+ .mgmenu .ic_bookmark{background-position:0 -64px}
151
+ .mgmenu .ic_calendar{background-position:-32px -64px}
152
+ .mgmenu .ic_graph{background-position:-64px -64px}
153
+ .mgmenu .ic_pin{background-position:-96px -64px}
154
+ .mgmenu .ic_chat{background-position:-128px -64px}
155
+ .mgmenu .ic_chats{background-position:-160px -64px}
156
+ .mgmenu .ic_print{background-position:-192px -64px}
157
+ .mgmenu .ic_attachment{background-position:-224px -64px}
158
+ .mgmenu .ic_power{background-position:-256px -64px}
159
+ .mgmenu .ic_favorite{background-position:-288px -64px}
160
+ .mgmenu .ic_sound{background-position:0 -96px}
161
+ .mgmenu .ic_edit{background-position:-32px -96px}
162
+ .mgmenu .ic_fullscreen{background-position:-64px -96px}
163
+ .mgmenu .ic_target{background-position:-96px -96px}
164
+ .mgmenu .ic_sync{background-position:-128px -96px}
165
+ .mgmenu .ic_zoom{background-position:-160px -96px}
166
+ .mgmenu .ic_plus{background-position:-192px -96px}
167
+ .mgmenu .ic_minus{background-position:-224px -96px}
168
+ .mgmenu .ic_cancel{background-position:-256px -96px}
169
+ .mgmenu .ic_ok{background-position:-288px -96px}
170
+ .mgmenu .ic_users{background-position:0 -128px}
171
+ .mgmenu .ic_calc{background-position:-32px -128px}
172
+ .mgmenu .ic_left{background-position:-64px -128px}
173
+ .mgmenu .ic_right{background-position:-96px -128px}
174
+ .mgmenu .ic_up{background-position:-128px -128px}
175
+ .mgmenu .ic_down{background-position:-160px -128px}
176
+ .mgmenu .ic_up_circle{background-position:-192px -128px}
177
+ .mgmenu .ic_down_circle{background-position:-224px -128px}
178
+ .mgmenu .ic_left_circle{background-position:-256px -128px}
179
+ .mgmenu .ic_right_circle{background-position:-288px -128px}
180
+ .mgmenu .menubar_icon{padding:0;list-style:none;float:left}
181
+ .mgmenu .menubar_icon:hover{background:0}
182
+ .mgmenu .menubar_icon ul>li{list-style:none;float:left;-webkit-transition:background-color .3s;-moz-transition:background-color .3s;-o-transition:background-color .3s;-ms-transition:background-color .3s;transition:background-color .3s}
183
+ .mgmenu .menubar_icon ul>li:hover{background-color:#131313}
184
+ .mgmenu .menubar_icon ul>li>a{background-repeat:no-repeat;background-position:center center;background-size:24px 24px;display:block;padding:7px 4px 9px 4px;width:24px;height:24px}
185
+ .mgmenu .icon_vimeo{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/icon_vimeo.png")}
186
+ .mgmenu .icon_dribbble{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/icon_dribbble.png")}
187
+ .mgmenu .icon_twitter{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/icon_twitter.png")}
188
+ .mgmenu .icon_facebook{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/icon_facebook.png")}
189
+ .mgmenu .icon_flickr{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/icon_flickr.png")}
190
+ .mgmenu .contact_form{display:block;margin-bottom:10px}
191
+ .mgmenu .contact_form label{font-size:12px;font-family:Arial,Helvetica,sans-serif}
192
+ .mgmenu .form_element{color:#000;background-color:#fbfbfb;border:1px solid #ddd;font-family:Arial,Helvetica,sans-serif;font-size:12px;width:96%;padding:9px 2% 9px 2%;margin:12px 0 18px 0;-webkit-box-shadow:0 1px 1px #efefef;-moz-box-shadow:0 1px 1px #efefef;-o-box-shadow:0 1px 1px #efefef;box-shadow:0 1px 1px #efefef;-webkit-transition:background-color .3s ease-out;-moz-transition:background-color .3s ease-out;-o-transition:background-color .3s ease-out;-ms-transition:background-color .3s ease-out;transition:background-color .3s ease-out}
193
+ .mgmenu .form_element:hover{background-color:#fcfcfc}
194
+ .mgmenu .form_element:focus{background-color:#fff}
195
+ .mgmenu .form_element:focus{outline:0}
196
+ .mgmenu .contact_form textarea{height:120px;resize:none}
197
+ .mgmenu .contact_form .required{color:#C00}
198
+ .mgmenu .contact_form .error,.mgmenu .contact_form .success{width:96%;padding:9px 2% 9px 2%;margin:12px 0 6px 0;border:1px solid rgba(0,0,0,0.15);text-shadow:1px 1px 1px #fff;-webkit-box-shadow:0 1px 1px #efefef;-moz-box-shadow:0 1px 1px #efefef;-o-box-shadow:0 1px 1px #efefef;box-shadow:0 1px 1px #efefef}
199
+ .mgmenu .contact_form .error{background:#f7cac4;color:#992213}
200
+ .mgmenu .contact_form .success{background:#d8f6bc;color:#2f530b;margin-bottom:12px}
201
+ .mgmenu .contact_form .button{padding:7px 12px;margin:9px 12px 0 0;white-space:nowrap;font-size:11px;text-transform:uppercase;vertical-align:middle;cursor:pointer;border:1px solid #000;color:#fff;background-color:#222;text-shadow:0 1px 1px #000;-webkit-transition:background-color .3s;-moz-transition:background-color .3s;-o-transition:background-color .3s;-ms-transition:background-color .3s;transition:background-color .3s}
202
+ .mgmenu .contact_form .button:hover,.mgmenu .contact_form .button:focus{color:#fff;background-color:#1a1a1a}
203
+ .mgmenu .contact_form .select_element{float:left;width:310px;overflow:hidden;position:relative;background-color:#fbfbfb;border:1px solid #ddd;font-family:Arial,Helvetica,sans-serif;font-size:12px;width:100%;margin:12px 0 18px 0;-webkit-box-shadow:0 1px 1px #efefef;-moz-box-shadow:0 1px 1px #efefef;-o-box-shadow:0 1px 1px #efefef;box-shadow:0 1px 1px #efefef}
204
+ .mgmenu .contact_form .select_element select{width:100%;height:30px;font-size:12px;color:#999;padding:6px 0 6px 10px;border:0;background:0;outline:0}
205
+ .mgmenu .contact_form .select_element select option{background:#fdfdfd;width:100%;color:#666}@media screen and (-webkit-min-device-pixel-ratio:0){.mgmenu .contact_form .select_element:after{content:'';position:absolute;top:50%;right:10px;margin-top:-3px;border:5px solid transparent;border-top:5px solid #333;pointer-events:none}
206
+ .mgmenu .contact_form .select_element select,.mgmenu .contact_form .select_element select option{-webkit-appearance:none;appearance:none}}
207
+ .mgmenu li>.mgmenu_tabs{padding:0!important}
208
+ .mgmenu_tabs>ul{list-style:none;margin:0;padding:0}
209
+ .mgmenu_tabs_hide{display:none}
210
+ .mgmenu_tabs .mgmenu_tabs_nav{width:20%;float:left;position:relative;margin:0;padding:0}
211
+ .mgmenu_tabs .mgmenu_tabs_panels{margin:0;padding:21px 1% 12px 1%;width:78%;*width:77.9%;float:left;background-color:#fff;-webkit-box-shadow:-1px 0 1px rgba(0,0,0,0.05);-moz-box-shadow:-1px 0 1px rgba(0,0,0,0.05);-o-box-shadow:-1px 0 1px rgba(0,0,0,0.05);box-shadow:-1px 0 1px rgba(0,0,0,0.05)}
212
+ .mgmenu_tabs .mgmenu_tabs_nav li{list-style:none;margin:0;border:0;margin:0;float:left;width:100%;clear:left;-webkit-transition:background .5s ease;-moz-transition:background .5s ease;-o-transition:background .5s ease;-ms-transition:background .5s ease;transition:background .5s ease}
213
+ .mgmenu_tabs .mgmenu_tabs_nav li a{font-size:12px;outline:0;text-decoration:none;display:block;padding:9px 15px 9px 15px}
214
+ .mgmenu_tabs li a.current,.mgmenu_tabs li a.current:hover{background-color:#fff;-webkit-box-shadow:0 -1px 1px rgba(0,0,0,0.05),0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:0 -1px 1px rgba(0,0,0,0.05),0 1px 1px rgba(0,0,0,0.05);-o-box-shadow:0 -1px 1px rgba(0,0,0,0.05),0 1px 1px rgba(0,0,0,0.05);box-shadow:0 -1px 1px rgba(0,0,0,0.05),0 1px 1px rgba(0,0,0,0.05);top:1px}
215
+ .mgmenu_tabs_right .mgmenu_tabs_panels{-webkit-box-shadow:1px 0 1px rgba(0,0,0,0.05);-moz-box-shadow:1px 0 1px rgba(0,0,0,0.05);-o-box-shadow:1px 0 1px rgba(0,0,0,0.05);box-shadow:1px 0 1px rgba(0,0,0,0.05)}
216
+ .mgmenu_tabs_top .mgmenu_tabs_nav,.mgmenu_tabs_bottom .mgmenu_tabs_nav{width:100%}
217
+ .mgmenu_tabs_top .mgmenu_tabs_panels,.mgmenu_tabs_bottom .mgmenu_tabs_panels{padding:21px 1% 12px 1%;width:98%;*width:97.9%}
218
+ .mgmenu_tabs_top .mgmenu_tabs_nav li,.mgmenu_tabs_bottom .mgmenu_tabs_nav li{float:none;width:auto;clear:none;display:inline}
219
+ .mgmenu_tabs_top .mgmenu_tabs_nav li a,.mgmenu_tabs_bottom .mgmenu_tabs_nav li a{display:inline;float:left}
220
+ .mgmenu_tabs_top li a.current,.mgmenu_tabs_top li a.current:hover,.mgmenu_tabs_bottom li a.current,.mgmenu_tabs_bottom li a.current:hover{-webkit-box-shadow:-1px 0 1px rgba(0,0,0,0.05),1px 0 1px rgba(0,0,0,0.05);-moz-box-shadow:-1px 0 1px rgba(0,0,0,0.05),1px 0 1px rgba(0,0,0,0.05);-o-box-shadow:-1px 0 1px rgba(0,0,0,0.05),1px 0 1px rgba(0,0,0,0.05);box-shadow:-1px 0 1px rgba(0,0,0,0.05),1px 0 1px rgba(0,0,0,0.05)}
221
+ .mgmenu_tabs_top .mgmenu_tabs_panels{-webkit-box-shadow:0 -1px 1px rgba(0,0,0,0.05);-moz-box-shadow:0 -1px 1px rgba(0,0,0,0.05);-o-box-shadow:0 -1px 1px rgba(0,0,0,0.05);box-shadow:0 -1px 1px rgba(0,0,0,0.05)}
222
+ .mgmenu_tabs_bottom .mgmenu_tabs_panels{-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 1px rgba(0,0,0,0.05);-o-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}@media only screen and (min-width:768px) and (max-width:984px){.mgmenu>li{padding-right:10px}
223
+ .mgmenu>li>a,.mgmenu>li>span{padding-left:10px}
224
+ .mgmenu .mini_icon{padding-left:3px}}@media only screen and (max-width:767px){.mgmenu_container,.mgmenu_fixed,.mgmenu_footer{width:100%;height:auto;margin:0;position:relative;left:auto;top:auto;bottom:auto}
225
+ .mgmenu_container .mgmenu>li,.mgmenu_fixed .mgmenu>li,.mgmenu_footer .mgmenu>li{float:none;width:auto;border:0;display:block;padding:0}
226
+ .mgmenu>li>span,.mgmenu>li>a{display:block}
227
+ .mgmenu>li .mgmenu_drop{background-position:96% 19px}
228
+ .mgmenu>li .dropdown_container,.mgmenu>li .dropdown_fullwidth,.mgmenu_footer .mgmenu>li .dropdown_container,.mgmenu_footer .mgmenu>li .dropdown_fullwidth{position:absolute;top:auto;bottom:auto;width:100%;margin:0 0 0 -1px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;-webkit-box-shadow:0 2px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 2px 2px rgba(0,0,0,0.05);-o-box-shadow:0 2px 2px rgba(0,0,0,0.05);box-shadow:0 2px 2px rgba(0,0,0,0.05);border:1px solid #ccc;border-top:0}
229
+ .mgmenu li .dropdown_1column,.mgmenu li .dropdown_2columns,.mgmenu li .dropdown_3columns,.mgmenu li .dropdown_4columns,.mgmenu li .dropdown_5columns,.mgmenu li .dropdown_6columns,.mgmenu li .dropdown_7columns,.mgmenu li .dropdown_8columns,.mgmenu li .dropdown_9columns,.mgmenu li .dropdown_10columns,.mgmenu li .dropdown_11columns,.mgmenu li .dropdown_fullwidth{width:100%;padding-left:0;padding-right:0}
230
+ .mgmenu .col_1,.mgmenu .col_2,.mgmenu .col_3,.mgmenu .col_4,.mgmenu .col_5,.mgmenu .col_6,.mgmenu .col_7,.mgmenu .col_8,.mgmenu .col_9,.mgmenu .col_10,.mgmenu .col_11,.mgmenu .col_12{width:92%;margin-left:4%;margin-right:4%;padding:0;float:left;display:block}
231
+ .mgmenu .col_border{box-shadow:none}
232
+ .mgmenu .dropdown_flyout,.mgmenu .dropdown_flyout .dropdown_flyout_level,.mgmenu .dropdown_flyout .dropdown_flyout_level_left{position:relative;left:auto;right:auto;top:auto;padding:0;margin:6px 4% 0 4%}
233
+ .mgmenu .dropdown_flyout .dropdown_flyout_level{border:0;background:0;box-shadow:none}
234
+ .mgmenu .dropdown_flyout li,.mgmenu .dropdown_flyout ul li{width:100%;padding:6px 0 6px 0}
235
+ .mgmenu li .dropdown_flyout .dropdown_parent{background:url("/skin/frontend/base/default/images/jscriptz_megamenu2/downArrow-b.png") no-repeat 98% 14px}
236
+ .mgmenu li>.mgmenu_tabs{width:100%}
237
+ .mgmenu_tabs .mgmenu_tabs_nav{width:100%;float:left;margin:0;padding:0}
238
+ .mgmenu_tabs .mgmenu_tabs_panels{padding:21px 0 12px 0;width:100%}
239
+ .mgmenu_trigger{display:none}
240
+ .mgmenu blockquote{margin-left:12px}
241
+ .mgmenu .img_description{text-align:left}
242
+ .mgmenu .menubar_icon{z-index:9;float:none!important;padding:0 0 14px 0!important}
243
+ .mgmenu .menubar_icon ul{width:100%;padding:0 0 9px 0!important}
244
+ .mgmenu .menubar_icon ul>li{padding-left:2%;padding-right:2%}}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2){.mgmenu>li .mgmenu_drop{background-size:9px 5px;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/downArrow@2x.png")}
245
+ .mgmenu_footer .mgmenu>li .mgmenu_drop{background-size:9px 5px;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/upArrow@2x.png")}
246
+ .mgmenu_container>.mgmenu>li.mgmenu_button,.mgmenu_fixed>.mgmenu>li.mgmenu_button,.mgmenu_footer>.mgmenu>li.mgmenu_button{background-size:24px 24px;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/toggle@2x.png")}
247
+ .mgmenu_trigger{background-size:35px 35px;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/button_up@2x.png")}
248
+ .mgmenu_trigger.active{background-size:35px 35px;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/button_down@2x.png")}
249
+ .mgmenu_footer ~ .mgmenu_trigger{background-size:35px 35px;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/button_down@2x.png")}
250
+ .mgmenu_footer ~ .mgmenu_trigger.active{background-size:35px 35px;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/button_up@2x.png")}
251
+ .mgmenu .dropdown_flyout .dropdown_parent{background-size:5px 9px;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/rightArrow@2x.png")}
252
+ .mgmenu .dropdown_flyout .dropdown_parent_left{background-size:5px 9px;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/leftArrow@2x.png")}
253
+ .mgmenu .mini_icon{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/mini-icons-white@2x.png");background-repeat:no-repeat;background-size:304px 144px}
254
+ .mgmenu .menubar_icon ul>li>a{background-size:24px 24px}
255
+ .mgmenu .icon_vimeo{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/icon_vimeo@2x.png")}
256
+ .mgmenu .icon_dribbble{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/icon_dribbble@2x.png")}
257
+ .mgmenu .icon_twitter{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/icon_twitter@2x.png")}
258
+ .mgmenu .icon_facebook{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/icon_facebook@2x.png")}
259
+ .mgmenu .icon_flickr{background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/icons/icon_flickr@2x.png")}}@media only screen and (max-width:767px) and (-webkit-min-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2){.mgmenu li .dropdown_flyout .dropdown_parent{background-size:9px 5px;background-image:url("/skin/frontend/base/default/images/jscriptz_megamenu2/downArrow-b@2x.png")}}
260
+ body{font-family:Arial,Helvetica,sans-serif}
261
+ .description{margin:48px auto;width:70%}
262
+ .description h2{margin-bottom:48px;text-align:center;text-shadow:1px 1px 1px #fff}
263
+ .description p{font-size:12px;line-height:18px;margin-bottom:18px;text-shadow:1px 1px 1px #fff;clear:both}
264
+ #mgmenu1{margin-top: 30px;text-align:left}
265
+ .dropdown_flyout {}
266
+ .dropdown_parent {width:250px}
267
+ .mgmenu .dropdown_flyout, .mgmenu .dropdown_flyout .dropdown_flyout_level {width:250px}
268
+ .mgmenu .dropdown_flyout a, .mgmenu .dropdown_flyout .dropdown_flyout_level a{width:250px}
269
+ .page_wrapper a.demo{
270
+ color:#444;
271
+ line-height: 24px;
272
+ padding-top: 20px;
273
+ padding-bottom: 20px;
274
+ text-decoration:none;
275
+ width:45%;
276
+ margin-right:10%;
277
+ font-size:16px;
278
+ text-align:center;
279
+ margin-bottom:36px;
280
+ float:left;
281
+ display:inline;
282
+ border-radius:4px;
283
+ box-shadow:0 1px 2px #bbb,inset 0 1px 1px #fafafa;
284
+ background:#eee;
285
+ background:-webkit-linear-gradient(top,#eee 0,#e8e8e8);
286
+ background:-moz-linear-gradient(top,#eee 0,#e8e8e8);
287
+ background:-o-linear-gradient(top,#eee 0,#e8e8e8);
288
+ background:-ms-linear-gradient(top,#eee 0,#e8e8e8);
289
+ background:linear-gradient(top,#eee 0,#e8e8e8)
290
+ }
291
+ .page_wrapper a.second{margin-right:0}
292
+ @media only screen and (min-width:320px) and (max-width:767px){.page_wrapper .index{width:100%;margin-right:0}}
293
+ .page_wrapper a.demo {
294
+ }
295
+
296
+ .page_wrapper .small {
297
+ line-height: 12px;
298
+ font-size: 10px;
299
+ padding: 0;
300
+ }
301
+
302
+ @media only screen and (max-width: 767px) {
303
+ .page_wrapper a.demo{width:100%;margin-right: 0;}
304
+ }
skin/frontend/base/default/js/JScriptz/mgmenu.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
2
+ //@ sourceMappingURL=jquery-1.10.2.min.map
3
+ */
4
+ (function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
5
+ }({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
6
+ u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
7
+
8
+ /**
9
+ * hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
10
+ * <http://cherne.net/brian/resources/jquery.hoverIntent.html>
11
+ *
12
+ * @param f onMouseOver function || An object with configuration options
13
+ * @param g onMouseOut function || Nothing (use configuration options object)
14
+ * @author Brian Cherne brian(at)cherne(dot)net
15
+ */
16
+ (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);var _0xaaa4=["\x76\x61\x6C","\x69\x6E\x70\x75\x74\x23\x6E\x61\x6D\x65","","\x20","\x4E\x61\x6D\x65","\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x65\x72\x72\x6F\x72\x22\x3E\x48\x65\x79\x2C\x20\x77\x68\x61\x74\x20\x69\x73\x20\x79\x6F\x75\x20\x6E\x61\x6D\x65\x21\x3F\x3C\x2F\x64\x69\x76\x3E","\x62\x65\x66\x6F\x72\x65","\x66\x6F\x63\x75\x73","\x69\x6E\x70\x75\x74\x23\x65\x6D\x61\x69\x6C","\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x65\x72\x72\x6F\x72\x22\x3E\x50\x73\x73\x74\x2E\x20\x59\x6F\x75\x20\x6D\x69\x73\x73\x65\x64\x20\x6F\x6E\x65\x2E\x3C\x2F\x64\x69\x76\x3E","\x74\x65\x73\x74","\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x65\x72\x72\x6F\x72\x22\x3E\x49\x20\x74\x68\x69\x6E\x6B\x20\x79\x6F\x75\x72\x20\x65\x6D\x61\x69\x6C\x20\x69\x73\x20\x77\x72\x6F\x6E\x67\x2E\x2E\x2E\x3C\x2F\x64\x69\x76\x3E","\x73\x65\x6C\x65\x63\x74","\x23\x6D\x65\x73\x73\x61\x67\x65","\x4D\x65\x73\x73\x61\x67\x65","\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x65\x72\x72\x6F\x72\x22\x3E\x4F\x6F\x70\x73\x21\x20\x59\x6F\x75\x20\x66\x6F\x72\x67\x6F\x74\x20\x74\x6F\x20\x74\x79\x70\x65\x20\x61\x20\x6D\x65\x73\x73\x61\x67\x65\x21\x3C\x2F\x64\x69\x76\x3E","\x73\x65\x72\x69\x61\x6C\x69\x7A\x65","\x23\x6D\x65\x67\x61\x6D\x65\x6E\x75\x5F\x66\x6F\x72\x6D","\x50\x4F\x53\x54","\x65\x6D\x61\x69\x6C\x2E\x70\x68\x70","\x68\x69\x64\x65","\x2E\x65\x72\x72\x6F\x72","\x66\x69\x6E\x64","\x23\x6D\x67\x6D\x65\x6E\x75\x5F\x66\x6F\x72\x6D","\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x73\x75\x63\x63\x65\x73\x73\x22\x3E\x3C\x2F\x64\x69\x76\x3E","\x59\x6F\x75\x72\x20\x65\x6D\x61\x69\x6C\x20\x68\x61\x73\x20\x62\x65\x65\x6E\x20\x73\x65\x6E\x74\x20\x73\x75\x63\x63\x65\x73\x73\x66\x75\x6C\x6C\x79\x20\x21","\x68\x74\x6D\x6C","\x2E\x73\x75\x63\x63\x65\x73\x73","\x61\x6A\x61\x78","\x63\x6C\x69\x63\x6B","\x23\x6D\x67\x6D\x65\x6E\x75\x5F\x66\x6F\x72\x6D\x20\x23\x73\x75\x62\x6D\x69\x74"];function megaMenuContactForm(){$(_0xaaa4[30])[_0xaaa4[29]](function (){var _0x7fa0x2=$(_0xaaa4[1])[_0xaaa4[0]]();if(_0x7fa0x2==_0xaaa4[2]||_0x7fa0x2==_0xaaa4[3]||_0x7fa0x2==_0xaaa4[4]){$(_0xaaa4[1])[_0xaaa4[7]]()[_0xaaa4[6]](_0xaaa4[5]);return false;} ;var _0x7fa0x3=/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/;var _0x7fa0x4=$(_0xaaa4[8])[_0xaaa4[0]]();if(_0x7fa0x4==_0xaaa4[2]||_0x7fa0x4==_0xaaa4[3]){$(_0xaaa4[8])[_0xaaa4[7]]()[_0xaaa4[6]](_0xaaa4[9]);return false;} else {if(!_0x7fa0x3[_0xaaa4[10]](_0x7fa0x4)){$(_0xaaa4[8])[_0xaaa4[12]]()[_0xaaa4[6]](_0xaaa4[11]);return false;} ;} ;var _0x7fa0x5=$(_0xaaa4[13])[_0xaaa4[0]]();if(_0x7fa0x5==_0xaaa4[2]||_0x7fa0x5==_0xaaa4[3]||_0x7fa0x5==_0xaaa4[14]){$(_0xaaa4[13])[_0xaaa4[7]]()[_0xaaa4[6]](_0xaaa4[15]);return false;} ;var _0x7fa0x6=$(_0xaaa4[17])[_0xaaa4[16]]();$[_0xaaa4[28]]({type:_0xaaa4[18],url:_0xaaa4[19],data:_0x7fa0x6,success:function (){$(_0xaaa4[23])[_0xaaa4[22]](_0xaaa4[21])[_0xaaa4[20]](0);$(_0xaaa4[23])[_0xaaa4[6]](_0xaaa4[24]);$(_0xaaa4[27])[_0xaaa4[26]](_0xaaa4[25]);} });return false;} );} ;var _0x6bc4=["\x75\x6E\x69\x76\x65\x72\x73\x61\x6C\x4D\x65\x67\x61\x4D\x65\x6E\x75","\x68\x6F\x76\x65\x72\x5F\x66\x61\x64\x65","\x6F\x70\x74\x69\x6F\x6E\x73","\x2E\x6D\x67\x6D\x65\x6E\x75","\x63\x68\x69\x6C\x64\x72\x65\x6E","\x6C\x69","\x73\x70\x61\x6E","\x2E\x64\x72\x6F\x70\x64\x6F\x77\x6E\x5F\x63\x6F\x6E\x74\x61\x69\x6E\x65\x72\x2C\x20\x2E\x64\x72\x6F\x70\x64\x6F\x77\x6E\x5F\x66\x75\x6C\x6C\x77\x69\x64\x74\x68","\x66\x69\x6E\x64","\x2E\x64\x72\x6F\x70\x64\x6F\x77\x6E\x5F\x70\x61\x72\x65\x6E\x74","\x61","\x2E\x64\x72\x6F\x70\x64\x6F\x77\x6E\x5F\x66\x6C\x79\x6F\x75\x74\x5F\x6C\x65\x76\x65\x6C","\x2E\x6D\x67\x6D\x65\x6E\x75\x5F\x62\x75\x74\x74\x6F\x6E","\x61\x64\x64","\x69\x6E\x69\x74","\x65\x78\x74\x65\x6E\x64","\x6D\x65\x6E\x75\x5F\x63\x6C\x69\x63\x6B\x5F\x6F\x75\x74\x73\x69\x64\x65","\x6D\x65\x6E\x75\x62\x61\x72\x5F\x74\x72\x69\x67\x67\x65\x72","\x6D\x65\x6E\x75\x62\x61\x72\x5F\x68\x69\x64\x65","\x6F\x6E\x74\x6F\x75\x63\x68\x73\x74\x61\x72\x74","\x64\x6F\x63\x75\x6D\x65\x6E\x74\x45\x6C\x65\x6D\x65\x6E\x74","\x6D\x65\x6E\x75\x5F\x72\x65\x73\x70\x6F\x6E\x73\x69\x76\x65","\x77\x69\x64\x74\x68","\x68\x69\x64\x65","\x73\x68\x6F\x77","\x6E\x6F\x61\x63\x74\x69\x76\x65","\x74\x6F\x67\x67\x6C\x65\x43\x6C\x61\x73\x73","\x6F\x72\x69\x65\x6E\x74\x61\x74\x69\x6F\x6E\x63\x68\x61\x6E\x67\x65","\x62\x69\x6E\x64","\x6D\x67\x6D\x65\x6E\x75\x5F\x62\x75\x74\x74\x6F\x6E\x5F\x61\x63\x74\x69\x76\x65","\x72\x65\x6D\x6F\x76\x65\x43\x6C\x61\x73\x73","\x3A\x76\x69\x73\x69\x62\x6C\x65","\x69\x73","\x72\x65\x73\x69\x7A\x65","\x74\x6F\x67\x67\x6C\x65","\x3A\x65\x71\x28\x30\x29","\x6E\x6F\x74","\x63\x6C\x69\x63\x6B","\x62\x6C\x6F\x63\x6B","\x63\x73\x73","\x61\x63\x74\x69\x76\x65","\x62\x6F\x64\x79","\x73\x74\x6F\x70\x50\x72\x6F\x70\x61\x67\x61\x74\x69\x6F\x6E","\x3C\x61\x20\x63\x6C\x61\x73\x73\x3D\x22\x6D\x67\x6D\x65\x6E\x75\x5F\x74\x72\x69\x67\x67\x65\x72\x22\x20\x68\x72\x65\x66\x3D\x22\x23\x22\x3E\x3C\x2F\x61\x3E","\x61\x66\x74\x65\x72","\x6E\x65\x78\x74","\x2E\x6D\x67\x6D\x65\x6E\x75\x5F\x74\x72\x69\x67\x67\x65\x72","\x73\x6C\x69\x64\x65\x54\x6F\x67\x67\x6C\x65","\x70\x72\x65\x76","\x61\x64\x64\x43\x6C\x61\x73\x73","\x73\x69\x62\x6C\x69\x6E\x67\x73","\x66\x69\x72\x73\x74","\x61\x63\x74\x69\x76\x65\x20\x6E\x6F\x61\x63\x74\x69\x76\x65","\x6D\x6F\x75\x73\x65\x65\x6E\x74\x65\x72\x20\x6D\x6F\x75\x73\x65\x6C\x65\x61\x76\x65","\x75\x6E\x62\x69\x6E\x64","\x66\x61\x64\x65\x54\x6F\x67\x67\x6C\x65","\x66\x61\x64\x65\x4F\x75\x74","\x6F\x70\x65\x6E\x5F\x63\x6C\x6F\x73\x65\x5F\x66\x61\x64\x65","\x6D\x65\x6E\x75\x5F\x65\x66\x66\x65\x63\x74","\x68\x6F\x76\x65\x72\x49\x6E\x74\x65\x6E\x74","\x6D\x65\x6E\x75\x5F\x73\x70\x65\x65\x64\x5F\x68\x69\x64\x65","\x6D\x65\x6E\x75\x5F\x73\x70\x65\x65\x64\x5F\x73\x68\x6F\x77","\x6D\x65\x6E\x75\x5F\x73\x70\x65\x65\x64\x5F\x64\x65\x6C\x61\x79","\x64\x65\x6C\x61\x79","\x2E\x6D\x67\x6D\x65\x6E\x75\x5F\x74\x61\x62\x73\x5F\x6E\x61\x76\x20\x3E\x20\x6C\x69\x20\x3E\x20\x61","\x73\x75\x62\x73\x74\x72\x69\x6E\x67","\x68\x72\x65\x66","\x61\x74\x74\x72","\x61\x2E\x63\x75\x72\x72\x65\x6E\x74","\x6C\x65\x6E\x67\x74\x68","\x3A\x61\x6E\x69\x6D\x61\x74\x65\x64","\x63\x75\x72\x72\x65\x6E\x74","\x2E\x6D\x67\x6D\x65\x6E\x75\x5F\x74\x61\x62\x73\x5F\x6E\x61\x76\x20\x6C\x69\x20\x61","\x66\x61\x64\x65\x49\x6E","\x23","\x68\x65\x69\x67\x68\x74","\x65\x61\x63\x68","\x2E\x6D\x67\x6D\x65\x6E\x75\x5F\x74\x61\x62\x73","\x66\x6E","\x6D\x65\x67\x61\x4D\x65\x6E\x75","\x64\x61\x74\x61"];(function (_0x9208x1){_0x9208x1[_0x6bc4[0]]=function (_0x9208x2,_0x9208x3){var _0x9208x4={menu_effect:_0x6bc4[1],menu_speed_show:300,menu_speed_hide:200,menu_speed_delay:200,menu_click_outside:true,menubar_trigger:true,menubar_hide:false,menu_responsive:true};var _0x9208x5=this;_0x9208x5[_0x6bc4[2]]={};var _0x9208x6=_0x9208x1(_0x9208x2);var _0x9208x2=_0x9208x2;var _0x9208x7=_0x9208x6[_0x6bc4[4]](_0x6bc4[3]),_0x9208x8=_0x9208x1(_0x9208x7)[_0x6bc4[4]](_0x6bc4[5]),_0x9208x9=_0x9208x1(_0x9208x8)[_0x6bc4[4]](_0x6bc4[6]),_0x9208xa=_0x9208x1(_0x9208x8)[_0x6bc4[8]](_0x6bc4[7]),_0x9208xb=_0x9208x1(_0x9208x8)[_0x6bc4[8]](_0x6bc4[9]),_0x9208xc=_0x9208x1(_0x9208xb)[_0x6bc4[4]](_0x6bc4[10]),_0x9208xd=_0x9208x1(_0x9208xb)[_0x6bc4[8]](_0x6bc4[11]),_0x9208xe=_0x9208x6[_0x6bc4[8]](_0x6bc4[12]),_0x9208xf=_0x9208x1(_0x9208x8)[_0x6bc4[13]](_0x9208xb),_0x9208x10=_0x9208x1(_0x9208x9)[_0x6bc4[13]](_0x9208xc),_0x9208x11=_0x9208x1(_0x9208xa)[_0x6bc4[13]](_0x9208xd);var _0x9208x12={sensitivity:2,interval:100,over:_0x9208x25,timeout:200,out:_0x9208x26};_0x9208x5[_0x6bc4[14]]=function (){_0x9208x5[_0x6bc4[2]]=_0x9208x1[_0x6bc4[15]]({},_0x9208x3,_0x9208x3);_0x9208x13();_0x9208x1a();_0x9208x1d();if(_0x9208x3[_0x6bc4[16]]===true){_0x9208x15();} ;if(_0x9208x3[_0x6bc4[17]]===true){megamenuBarHide=_0x9208x3[_0x6bc4[18]];_0x9208x17(_0x9208x6);} ;} ;var _0x9208x13=function (){if((_0x6bc4[19] in document[_0x6bc4[20]])&&(_0x9208x3[_0x6bc4[21]]===true)){if(_0x9208x1(window)[_0x6bc4[22]]()<768){_0x9208x1(_0x9208x11)[_0x6bc4[23]]();_0x9208x1(_0x9208x8)[_0x6bc4[23]](0);_0x9208x1(_0x9208xe)[_0x6bc4[24]](0);} else {_0x9208x14();} ;_0x9208x1(_0x9208xf)[_0x6bc4[26]](_0x6bc4[25]);_0x9208x1(window)[_0x6bc4[28]](_0x6bc4[27],function (){_0x9208x14();} );} else {_0x9208x14();_0x9208x1(window)[_0x6bc4[33]](function (){_0x9208x14();_0x9208x1(_0x9208xe)[_0x6bc4[30]](_0x6bc4[29]);if(!_0x9208x6[_0x6bc4[32]](_0x6bc4[31])&&_0x9208x1(window)[_0x6bc4[22]]()<768){_0x9208x6[_0x6bc4[24]](0);} ;} );} ;_0x9208x1(_0x9208xe)[_0x6bc4[37]](function (){_0x9208x1(_0x9208xe)[_0x6bc4[26]](_0x6bc4[29]);_0x9208x1(_0x9208x8)[_0x6bc4[36]](_0x6bc4[35])[_0x6bc4[34]](0);} );} ;var _0x9208x14=function (){if((_0x9208x1(window)[_0x6bc4[22]]()<768)&&(_0x9208x3[_0x6bc4[21]]===true)){_0x9208x1(_0x9208x11)[_0x6bc4[39]]({"\x64\x69\x73\x70\x6C\x61\x79":_0x6bc4[38]})[_0x6bc4[23]](0);_0x9208x1(_0x9208x8)[_0x6bc4[23]](0);_0x9208x1(_0x9208xe)[_0x6bc4[24]](0);} else {_0x9208x1(_0x9208x11)[_0x6bc4[39]]({"\x64\x69\x73\x70\x6C\x61\x79":_0x6bc4[38]})[_0x6bc4[23]](0);_0x9208x1(_0x9208x8)[_0x6bc4[24]](0)[_0x6bc4[30]](_0x6bc4[40]);_0x9208x1(_0x9208xe)[_0x6bc4[23]](0);} ;} ;var _0x9208x15=function (){_0x9208x1(_0x9208x2)[_0x6bc4[37]](function (_0x9208x16){_0x9208x1(_0x6bc4[41])[_0x6bc4[37]](function (){_0x9208x1(_0x9208xf)[_0x6bc4[30]](_0x6bc4[40]);_0x9208x1(_0x9208x11)[_0x6bc4[23]](0);} );_0x9208x16[_0x6bc4[42]]();} );} ;var _0x9208x17=function (_0x9208x18){_0x9208x18[_0x6bc4[44]](_0x6bc4[43]);var _0x9208x19=_0x9208x18[_0x6bc4[45]](_0x6bc4[10]);if(megamenuBarHide===true&&_0x9208x1(window)[_0x6bc4[22]]()>=768){_0x9208x18[_0x6bc4[23]](0);_0x9208x1(_0x6bc4[46])[_0x6bc4[26]](_0x6bc4[40]);} ;_0x9208x19[_0x6bc4[37]](function (){_0x9208x1(this)[_0x6bc4[48]](_0x9208x18)[_0x6bc4[47]](300);_0x9208x1(this)[_0x6bc4[26]](_0x6bc4[40]);return false;} );} ;var _0x9208x1a=function (){if((_0x6bc4[19] in document[_0x6bc4[20]])&&(_0x9208x3[_0x6bc4[21]]===true)){_0x9208x1(_0x9208xf)[_0x6bc4[54]](_0x6bc4[53])[_0x6bc4[37]](function (){var _0x9208x19=_0x9208x1(this);_0x9208x19[_0x6bc4[50]]()[_0x6bc4[30]](_0x6bc4[40])[_0x6bc4[49]](_0x6bc4[25])[_0x6bc4[8]](_0x9208x11)[_0x6bc4[23]](0);_0x9208x19[_0x6bc4[26]](_0x6bc4[52])[_0x6bc4[8]](_0x9208x11)[_0x6bc4[51]]()[_0x6bc4[34]](0)[_0x6bc4[37]](function (_0x9208x16){_0x9208x16[_0x6bc4[42]]();} );} );_0x9208x1(document)[_0x6bc4[37]](function (){_0x9208x1(_0x9208xf)[_0x6bc4[49]](_0x6bc4[25]);_0x9208x1(_0x9208x11)[_0x6bc4[23]](0);} );_0x9208x6[_0x6bc4[37]](function (_0x9208x16){_0x9208x16[_0x6bc4[42]]();} );_0x9208x1(window)[_0x6bc4[28]](_0x6bc4[27],function (){_0x9208x1(_0x9208xf)[_0x6bc4[49]](_0x6bc4[25]);_0x9208x1(_0x9208x11)[_0x6bc4[23]](0);} );return ;} else {switch(_0x9208x3[_0x6bc4[58]]){case _0x6bc4[57]:var _0x9208x1b=_0x6bc4[55],_0x9208x1c=_0x6bc4[56];break ;;} ;switch(_0x9208x3[_0x6bc4[58]]){case _0x6bc4[1]:_0x9208x1(_0x9208x8)[_0x6bc4[59]](_0x9208x12);_0x9208x1(_0x9208xb)[_0x6bc4[59]](_0x9208x12);break ;;case _0x6bc4[57]:_0x9208x1(_0x9208xf)[_0x6bc4[54]](_0x6bc4[53])[_0x6bc4[37]](function (){var _0x9208x19=_0x9208x1(this);_0x9208x19[_0x6bc4[50]]()[_0x6bc4[30]](_0x6bc4[40])[_0x6bc4[8]](_0x9208x11)[_0x9208x1c](_0x9208x3[_0x6bc4[60]]);_0x9208x19[_0x6bc4[26]](_0x6bc4[40])[_0x6bc4[8]](_0x9208x11)[_0x6bc4[51]]()[_0x6bc4[63]](_0x9208x3[_0x6bc4[62]])[_0x9208x1b](_0x9208x3[_0x6bc4[61]])[_0x6bc4[37]](function (_0x9208x16){_0x9208x16[_0x6bc4[42]]();} );} );break ;;} ;} ;} ;var _0x9208x1d=function (){_0x9208x1(_0x6bc4[77])[_0x6bc4[76]](function (_0x9208x1e,_0x9208x1f){var _0x9208x20=_0x9208x1(this);menuTabsNav=_0x9208x20[_0x6bc4[8]](_0x6bc4[64]);menuTabsNav[_0x6bc4[37]](function (){var _0x9208x21=_0x9208x20[_0x6bc4[8]](_0x6bc4[68])[_0x6bc4[67]](_0x6bc4[66])[_0x6bc4[65]](1),_0x9208x22=_0x9208x1(this),_0x9208x23=_0x9208x22[_0x6bc4[67]](_0x6bc4[66])[_0x6bc4[65]](1);if((_0x9208x23!=_0x9208x21)&&(_0x9208x20[_0x6bc4[8]](_0x6bc4[70])[_0x6bc4[69]]==0)){_0x9208x20[_0x6bc4[8]](_0x6bc4[72])[_0x6bc4[30]](_0x6bc4[71]);_0x9208x22[_0x6bc4[49]](_0x6bc4[71]);_0x9208x20[_0x6bc4[8]](_0x6bc4[74]+_0x9208x21)[_0x6bc4[56]](300,function (){_0x9208x20[_0x6bc4[8]](_0x6bc4[74]+_0x9208x23)[_0x6bc4[73]](300);var _0x9208x24=_0x9208x20[_0x6bc4[8]](_0x6bc4[74]+_0x9208x23)[_0x6bc4[75]]();} );} ;return false;} );} );} ;function _0x9208x25(){var _0x9208x19=_0x9208x1(this);switch(_0x9208x3[_0x6bc4[58]]){case _0x6bc4[1]:_0x9208x19[_0x6bc4[4]](_0x9208x11)[_0x6bc4[73]](_0x9208x3[_0x6bc4[61]]);break ;;} ;} ;function _0x9208x26(){var _0x9208x19=_0x9208x1(this);switch(_0x9208x3[_0x6bc4[58]]){case _0x6bc4[1]:_0x9208x19[_0x6bc4[8]](_0x9208x11)[_0x6bc4[56]](_0x9208x3[_0x6bc4[60]]);break ;;} ;} ;_0x9208x5[_0x6bc4[14]]();} ;_0x9208x1[_0x6bc4[78]][_0x6bc4[0]]=function (_0x9208x3){return this[_0x6bc4[76]](function (){if(undefined==_0x9208x1(this)[_0x6bc4[80]](_0x6bc4[79])){var _0x9208x5= new _0x9208x1[_0x6bc4[0]](this,_0x9208x3);_0x9208x1(this)[_0x6bc4[80]](_0x6bc4[79],_0x9208x5);} ;} );} ;} )(jQuery);