Perception_Bannerpro - Version 1.0.0

Version Notes

First Release

All in One Banner Pro – Magento Extension by Perception System

All in One Banner Pro Extension allows you to manage unlimited banners with list of sliding effects will make up your site effective and attractive in look.

Support 26 effects with jQuery

Blind X, Blind Y, Blind Z, Cover, Curtain X, Curtain Y, Fade, Fade Zoom, Grow X, Grow Y, Scroll Up, Scroll Down, Scroll Left, Scroll Right, Scroll Horizontal, Scroll Vertical, Shuffle, Toss, Turn Up, Turn Down, Turn Left, Turn Right, Uncover, Wipe, Zoom

Download this release

Release Info

Developer Magento Core Team
Extension Perception_Bannerpro
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (42) hide show
  1. app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro.php +12 -0
  2. app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro/Edit.php +45 -0
  3. app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro/Edit/Form.php +19 -0
  4. app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro/Edit/Tab/Form.php +108 -0
  5. app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro/Edit/Tabs.php +24 -0
  6. app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro/Grid.php +182 -0
  7. app/code/local/Perception/Bannerpro/Block/Adminhtml/Grid/Renderer/Image.php +14 -0
  8. app/code/local/Perception/Bannerpro/Block/Bannerpro.php +16 -0
  9. app/code/local/Perception/Bannerpro/Block/Widget/Grid/Column.php +58 -0
  10. app/code/local/Perception/Bannerpro/Block/Widget/Grid/Column/Filter/Image.php +31 -0
  11. app/code/local/Perception/Bannerpro/Block/Widget/Grid/Column/Renderer/Action.php +77 -0
  12. app/code/local/Perception/Bannerpro/Block/Widget/Grid/Column/Renderer/Image.php +84 -0
  13. app/code/local/Perception/Bannerpro/Helper/Data.php +16 -0
  14. app/code/local/Perception/Bannerpro/Helper/Image.php +345 -0
  15. app/code/local/Perception/Bannerpro/Helper/Wysiwyg/Images.php +41 -0
  16. app/code/local/Perception/Bannerpro/Model/Bannerpro.php +10 -0
  17. app/code/local/Perception/Bannerpro/Model/Entity/Attribute/Source/Boolean/Config.php +42 -0
  18. app/code/local/Perception/Bannerpro/Model/Image.php +508 -0
  19. app/code/local/Perception/Bannerpro/Model/Mysql4/Bannerpro.php +158 -0
  20. app/code/local/Perception/Bannerpro/Model/Mysql4/Bannerpro/Collection.php +123 -0
  21. app/code/local/Perception/Bannerpro/Model/Status.php +15 -0
  22. app/code/local/Perception/Bannerpro/Model/System/Backend/Links.php +40 -0
  23. app/code/local/Perception/Bannerpro/Model/System/Config/Source/Effect.php +70 -0
  24. app/code/local/Perception/Bannerpro/Model/Wysiwyg/Config.php +100 -0
  25. app/code/local/Perception/Bannerpro/Model/Wysiwyg/Images/Storage.php +37 -0
  26. app/code/local/Perception/Bannerpro/Model/Wysiwyg/Images/Storage/Collection.php +37 -0
  27. app/code/local/Perception/Bannerpro/controllers/Adminhtml/BannerproController.php +246 -0
  28. app/code/local/Perception/Bannerpro/controllers/IndexController.php +9 -0
  29. app/code/local/Perception/Bannerpro/etc/config.xml +171 -0
  30. app/code/local/Perception/Bannerpro/etc/system.xml +61 -0
  31. app/code/local/Perception/Bannerpro/sql/bannerpro_setup/mysql4-install-1.0.3.php +30 -0
  32. app/design/adminhtml/default/default/layout/bannerpro.xml +8 -0
  33. app/design/frontend/default/default/layout/bannerpro.xml +15 -0
  34. app/design/frontend/default/default/template/bannerpro/bannerpro.phtml +67 -0
  35. app/etc/modules/Perception_Bannerpro.xml +9 -0
  36. package.xml +56 -0
  37. skin/frontend/default/default/banner/banner_effects.js +1567 -0
  38. skin/frontend/default/default/banner/bannerpro.css +30 -0
  39. skin/frontend/default/default/banner/bannerpro.js +155 -0
  40. skin/frontend/default/default/banner/images/next-prev-btn.png +0 -0
  41. skin/frontend/default/default/banner/images/pause.png +0 -0
  42. skin/frontend/default/default/banner/images/play.png +0 -0
app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Perception_Bannerpro_Block_Adminhtml_Bannerpro extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_bannerpro';
7
+ $this->_blockGroup = 'bannerpro';
8
+ $this->_headerText = Mage::helper('bannerpro')->__('Banner Manager');
9
+ $this->_addButtonLabel = Mage::helper('bannerpro')->__('Add Banner');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro/Edit.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Block_Adminhtml_Bannerpro_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+
9
+ $this->_objectId = 'id';
10
+ $this->_blockGroup = 'bannerpro';
11
+ $this->_controller = 'adminhtml_bannerpro';
12
+
13
+ $this->_updateButton('save', 'label', Mage::helper('bannerpro')->__('Save Banner'));
14
+ $this->_updateButton('delete', 'label', Mage::helper('bannerpro')->__('Delete Banner'));
15
+
16
+ $this->_addButton('saveandcontinue', array(
17
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
+ 'onclick' => 'saveAndContinueEdit()',
19
+ 'class' => 'save',
20
+ ), -100);
21
+
22
+ $this->_formScripts[] = "
23
+ function toggleEditor() {
24
+ if (tinyMCE.getInstanceById('bannerpro_content') == null) {
25
+ tinyMCE.execCommand('mceAddControl', false, 'bannerpro_content');
26
+ } else {
27
+ tinyMCE.execCommand('mceRemoveControl', false, 'bannerpro_content');
28
+ }
29
+ }
30
+
31
+ function saveAndContinueEdit(){
32
+ editForm.submit($('edit_form').action+'back/edit/');
33
+ }
34
+ ";
35
+ }
36
+
37
+ public function getHeaderText()
38
+ {
39
+ if( Mage::registry('bannerpro_data') && Mage::registry('bannerpro_data')->getId() ) {
40
+ return Mage::helper('bannerpro')->__("Edit Banner '%s'", $this->htmlEscape(Mage::registry('bannerpro_data')->getTitle()));
41
+ } else {
42
+ return Mage::helper('bannerpro')->__('Add Banner');
43
+ }
44
+ }
45
+ }
app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Block_Adminhtml_Bannerpro_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro/Edit/Tab/Form.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Block_Adminhtml_Bannerpro_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+
6
+ protected function _prepareLayout()
7
+ {
8
+ parent::_prepareLayout();
9
+ if (Mage::getSingleton('bannerpro/wysiwyg_config')->isEnabled()) {
10
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
11
+ }
12
+ }
13
+
14
+ protected function _prepareForm()
15
+ {
16
+ $form = new Varien_Data_Form();
17
+ $this->setForm($form);
18
+
19
+ $fieldset = $form->addFieldset('bannerpro_form', array('legend'=>Mage::helper('bannerpro')->__('Banner Information')));
20
+
21
+ $fieldset->addField('title', 'text', array(
22
+ 'label' => Mage::helper('bannerpro')->__('Title'),
23
+ 'class' => 'required-entry',
24
+ 'required' => true,
25
+ 'name' => 'title',
26
+ ));
27
+
28
+ $fieldset->addField('filename', 'image', array(
29
+ 'label' => Mage::helper('bannerpro')->__('Banner Image'),
30
+ 'required' => false,
31
+ 'name' => 'filename',
32
+ ));
33
+
34
+ if (!Mage::app()->isSingleStoreMode()) {
35
+ $fieldset->addField('store_id', 'multiselect', array(
36
+ 'name' => 'stores[]',
37
+ 'label' => Mage::helper('cms')->__('Store View'),
38
+ 'title' => Mage::helper('cms')->__('Store View'),
39
+ 'required' => true,
40
+ 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
41
+ 'disabled' => $isElementDisabled
42
+ ));
43
+ }
44
+
45
+ else {
46
+ $fieldset->addField('store_id', 'hidden', array(
47
+ 'name' => 'stores[]',
48
+ 'value' => Mage::app()->getStore(true)->getId()
49
+ ));
50
+ $model->setStoreId(Mage::app()->getStore(true)->getId());
51
+ }
52
+
53
+ $fieldset->addField('effects', 'select', array(
54
+ 'label' => Mage::helper('bannerpro')->__('Banner Effects'),
55
+ 'name' => 'effects',
56
+ 'values' => Mage::getSingleton('bannerpro/system_config_source_effect')->toOptionArray()
57
+ ));
58
+
59
+ $fieldset->addField('status', 'select', array(
60
+ 'label' => Mage::helper('bannerpro')->__('Status'),
61
+ 'name' => 'status',
62
+ 'values' => array(
63
+ array(
64
+ 'value' => 1,
65
+ 'label' => Mage::helper('bannerpro')->__('Enabled'),
66
+ ),
67
+
68
+ array(
69
+ 'value' => 2,
70
+ 'label' => Mage::helper('bannerpro')->__('Disabled'),
71
+ ),
72
+ ),
73
+ ));
74
+
75
+ $fieldset->addField('sorting_order', 'text', array(
76
+ 'label' => Mage::helper('bannerpro')->__('Sorting Order'),
77
+ 'required' => false,
78
+ 'style' => 'width:50px;',
79
+ 'name' => 'sorting_order',
80
+ ));
81
+
82
+ $fieldset->addField('weblink', 'text', array(
83
+ 'label' => Mage::helper('bannerpro')->__('Website Url'),
84
+ 'required' => false,
85
+ 'name' => 'weblink',
86
+ 'class' => 'validate-url',
87
+ ));
88
+
89
+ $fieldset->addField('text', 'editor', array(
90
+ 'name' => 'text',
91
+ 'label' => Mage::helper('bannerpro')->__('Content'),
92
+ 'title' => Mage::helper('bannerpro')->__('Content'),
93
+ 'style' => 'width:450px; height:400px;',
94
+ 'wysiwyg' => true,
95
+ 'required' => false,
96
+ 'config' => Mage::getSingleton('bannerpro/wysiwyg_config')->getConfig()
97
+ ));
98
+
99
+ if ( Mage::getSingleton('adminhtml/session')->getBannerproData() )
100
+ {
101
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getBannerproData());
102
+ Mage::getSingleton('adminhtml/session')->setBannerproData(null);
103
+ } elseif ( Mage::registry('bannerpro_data') ) {
104
+ $form->setValues(Mage::registry('bannerpro_data')->getData());
105
+ }
106
+ return parent::_prepareForm();
107
+ }
108
+ }
app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro/Edit/Tabs.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Block_Adminhtml_Bannerpro_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('bannerpro_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('bannerpro')->__('Banner Information'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('bannerpro')->__('Banner Information'),
18
+ 'title' => Mage::helper('bannerpro')->__('Banner Information'),
19
+ 'content' => $this->getLayout()->createBlock('bannerpro/adminhtml_bannerpro_edit_tab_form')->toHtml(),
20
+ ));
21
+
22
+ return parent::_beforeToHtml();
23
+ }
24
+ }
app/code/local/Perception/Bannerpro/Block/Adminhtml/Bannerpro/Grid.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Block_Adminhtml_Bannerpro_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('bannerproGrid');
9
+ $this->setDefaultSort('bannerpro_id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('bannerpro/bannerpro')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn('bannerpro_id', array(
24
+ 'header' => Mage::helper('bannerpro')->__('ID'),
25
+ 'align' =>'right',
26
+ 'width' => '50px',
27
+ 'index' => 'bannerpro_id',
28
+ ));
29
+
30
+ $this->addColumn('filename', array(
31
+ 'header'=>Mage::helper('bannerpro')->__('Image'),
32
+ 'filter'=>false,
33
+ 'index'=>'filename',
34
+ 'align' => 'left',
35
+ 'width' => '50px',
36
+ 'renderer' => 'bannerpro/adminhtml_grid_renderer_image',
37
+ ));
38
+
39
+ $this->addColumn('title', array(
40
+ 'header' => Mage::helper('bannerpro')->__('Title'),
41
+ 'align' =>'left',
42
+ 'index' => 'title',
43
+ 'width' => '550px',
44
+ ));
45
+
46
+ $this->addColumn('text', array(
47
+ 'header' => Mage::helper('bannerpro')->__('Description'),
48
+ 'align' =>'left',
49
+ 'width' => '350px',
50
+ 'index' => 'text',
51
+ ));
52
+
53
+ $this->addColumn('effects', array(
54
+ 'header' => Mage::helper('bannerpro')->__('Effects'),
55
+ 'align' =>'center',
56
+ 'width' => '50px',
57
+ 'index' => 'effects',
58
+ ));
59
+
60
+ $this->addColumn('weblink', array(
61
+ 'header' => Mage::helper('bannerpro')->__('URL'),
62
+ 'align' =>'center',
63
+ 'width' => '50px',
64
+ 'index' => 'weblink',
65
+ ));
66
+
67
+ $this->addColumn('sorting_order', array(
68
+ 'header' => Mage::helper('bannerpro')->__('Sorting Order'),
69
+ 'align' =>'center',
70
+ 'width' => '50px',
71
+ 'index' => 'sorting_order',
72
+ ));
73
+
74
+ if (!Mage::app()->isSingleStoreMode()) {
75
+ $this->addColumn('store_id', array(
76
+ 'header' => Mage::helper('bannerpro')->__('Store View'),
77
+ 'index' => 'store_id',
78
+ 'type' => 'store',
79
+ 'store_all' => true,
80
+ 'store_view' => true,
81
+ 'sortable' => false,
82
+ 'filter_condition_callback'
83
+ => array($this, '_filterStoreCondition'),
84
+ ));
85
+ }
86
+
87
+ $this->addColumn('status', array(
88
+ 'header' => Mage::helper('bannerpro')->__('Status'),
89
+ 'align' => 'left',
90
+ 'width' => '80px',
91
+ 'index' => 'status',
92
+ 'type' => 'options',
93
+ 'options' => array(
94
+ 1 => 'Enabled',
95
+ 2 => 'Disabled',
96
+ ),
97
+ ));
98
+
99
+ $this->addColumn('action',
100
+ array(
101
+ 'header' => Mage::helper('bannerpro')->__('Action'),
102
+ 'width' => '100',
103
+ 'type' => 'action',
104
+ 'getter' => 'getId',
105
+ 'actions' => array(
106
+ array(
107
+ 'caption' => Mage::helper('bannerpro')->__('Edit'),
108
+ 'url' => array('base'=> '*/*/edit'),
109
+ 'field' => 'id'
110
+ )
111
+ ),
112
+ 'filter' => false,
113
+ 'sortable' => false,
114
+ 'index' => 'stores',
115
+ 'is_system' => true,
116
+ ));
117
+
118
+ $this->addExportType('*/*/exportCsv', Mage::helper('bannerpro')->__('CSV'));
119
+ $this->addExportType('*/*/exportXml', Mage::helper('bannerpro')->__('XML'));
120
+
121
+ return parent::_prepareColumns();
122
+ }
123
+
124
+ protected function _prepareMassaction()
125
+ {
126
+ $this->setMassactionIdField('bannerpro_id');
127
+ $this->getMassactionBlock()->setFormFieldName('bannerpro');
128
+
129
+ $this->getMassactionBlock()->addItem('delete', array(
130
+ 'label' => Mage::helper('bannerpro')->__('Delete'),
131
+ 'url' => $this->getUrl('*/*/massDelete'),
132
+ 'confirm' => Mage::helper('bannerpro')->__('Are you sure?')
133
+ ));
134
+
135
+ $statuses = Mage::getSingleton('bannerpro/status')->getOptionArray();
136
+
137
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
138
+ $this->getMassactionBlock()->addItem('status', array(
139
+ 'label'=> Mage::helper('bannerpro')->__('Change status'),
140
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
141
+ 'additional' => array(
142
+ 'visibility' => array(
143
+ 'name' => 'status',
144
+ 'type' => 'select',
145
+ 'class' => 'required-entry',
146
+ 'label' => Mage::helper('bannerpro')->__('Status'),
147
+ 'values' => $statuses
148
+ )
149
+ )
150
+ ));
151
+ return $this;
152
+ }
153
+
154
+ protected function _afterLoadCollection()
155
+ {
156
+ $this->getCollection()->walk('afterLoad');
157
+ parent::_afterLoadCollection();
158
+ }
159
+
160
+ protected function _filterStoreCondition($collection, $column)
161
+ {
162
+ if (!$value = $column->getFilter()->getValue()) {
163
+ return;
164
+ }
165
+
166
+ $this->getCollection()->addStoreFilter($value);
167
+ }
168
+
169
+ public function getRowUrl($row)
170
+ {
171
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
172
+ }
173
+
174
+ public function getThumbnailSize()
175
+ {
176
+ $size = trim(Mage::getStoreConfig('bannerpro/info/backend_thumbnail_size'),' ');
177
+ $tmp = explode('-',$size);
178
+ if(sizeof($tmp)==2)
179
+ return array('width'=>is_numeric($tmp[0])?$tmp[0]:85,'height'=>is_numeric($tmp[1])?$tmp[1]:65);
180
+ return array('width'=>85,'height'=>65);
181
+ }
182
+ }
app/code/local/Perception/Bannerpro/Block/Adminhtml/Grid/Renderer/Image.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Block_Adminhtml_Grid_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+ public function render(Varien_Object $row)
6
+ {
7
+ if($row->getFilename()==""){
8
+ return "";
9
+ }
10
+ else{
11
+ return "<img src='".Mage::getBaseUrl("media").$row->getFilename()."' width='50' height='50'/>";
12
+ }
13
+ }
14
+ }
app/code/local/Perception/Bannerpro/Block/Bannerpro.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Perception_Bannerpro_Block_Bannerpro extends Mage_Core_Block_Template
3
+ {
4
+ public function _prepareLayout()
5
+ {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getBannerpro()
10
+ {
11
+ if (!$this->hasData('bannerpro')) {
12
+ $this->setData('bannerpro', Mage::registry('bannerpro'));
13
+ }
14
+ return $this->getData('bannerpro');
15
+ }
16
+ }
app/code/local/Perception/Bannerpro/Block/Widget/Grid/Column.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Mage
16
+ * @package TBT_MassRelater
17
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ /**
22
+ * Grid column block
23
+ *
24
+ * @category Mage
25
+ * @package TBT_MassRelater
26
+ * @author Magento Core Team <core@magentocommerce.com>
27
+ */
28
+ class Perception_Bannerpro_Block_Widget_Grid_Column extends Mage_Adminhtml_Block_Widget_Grid_Column
29
+ {
30
+
31
+
32
+ protected function _getRendererByType()
33
+ {
34
+ switch (strtolower($this->getType())) {
35
+ case 'image':
36
+ $rendererClass = 'bannerpro/widget_grid_column_renderer_image';
37
+ break;
38
+ default:
39
+ $rendererClass = parent::_getRendererByType();
40
+ break;
41
+ }
42
+ return $rendererClass;
43
+ }
44
+
45
+ protected function _getFilterByType()
46
+ {
47
+ switch (strtolower($this->getType())) {
48
+ case 'image':
49
+ $filterClass = 'bannerpro/widget_grid_column_filter_image';
50
+ break;
51
+ default:
52
+ $filterClass = parent::_getFilterByType();
53
+ break;
54
+ }
55
+ return $filterClass;
56
+ }
57
+
58
+ }
app/code/local/Perception/Bannerpro/Block/Widget/Grid/Column/Filter/Image.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Mage
16
+ * @package TBT_MassRelater
17
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ /**
22
+ * Checkbox grid column filter
23
+ *
24
+ * @category Mage
25
+ * @package TBT_MassRelater
26
+ * @author Magento Core Team <core@magentocommerce.com>
27
+ */
28
+ class Perception_Bannerpro_Block_Widget_Grid_Column_Filter_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Text
29
+ {
30
+
31
+ }
app/code/local/Perception/Bannerpro/Block/Widget/Grid/Column/Renderer/Action.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Mage
16
+ * @package TBT_MassRelater
17
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ /**
22
+ * Grid column widget for rendering action grid cells
23
+ *
24
+ * @category Mage
25
+ * @package TBT_MassRelater
26
+ * @author Magento Core Team <core@magentocommerce.com>
27
+ */
28
+ class Perception_Bannerpro_Block_Widget_Grid_Column_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
29
+ {
30
+
31
+ /**
32
+ * Prepares action data for html render
33
+ *
34
+ * @param array $action
35
+ * @param string $actionCaption
36
+ * @param Varien_Object $row
37
+ * @return Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
38
+ */
39
+ protected function _transformActionData(&$action, &$actionCaption, Varien_Object $row)
40
+ {
41
+ foreach ( $action as $attibute => $value ) {
42
+ if(isset($action[$attibute]) && !is_array($action[$attibute])) {
43
+ $this->getColumn()->setFormat($action[$attibute]);
44
+ $action[$attibute] = parent::render($row);
45
+ } else {
46
+ $this->getColumn()->setFormat(null);
47
+ }
48
+
49
+ switch ($attibute) {
50
+ case 'caption':
51
+ $actionCaption = $action['caption'];
52
+ unset($action['caption']);
53
+ break;
54
+
55
+ case 'url':
56
+ if(is_array($action['url'])) {
57
+ $params = array($action['field']=>$this->_getValue($row));
58
+ if(isset($action['url']['params'])) {
59
+ $params = array_merge($action['url']['params'], $params);
60
+ }
61
+ $action['href'] = $this->getUrl($action['url']['base'], $params);
62
+ unset($action['field']);
63
+ } else {
64
+ $action['href'] = $action['url'];
65
+ }
66
+ unset($action['url']);
67
+ break;
68
+
69
+ case 'popup':
70
+ $action['onclick'] = 'popWin(this.href, \'windth=800,height=700,resizable=1,scrollbars=1\');return false;';
71
+ break;
72
+
73
+ }
74
+ }
75
+ return $this;
76
+ }
77
+ }
app/code/local/Perception/Bannerpro/Block/Widget/Grid/Column/Renderer/Image.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WDCA
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category WDCA
16
+ * @package TBT_Enhancedgrid
17
+ * @copyright Copyright (c) 2008-2010 WDCA (http://www.wdca.ca)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ /**
22
+ * Grid checkbox column renderer
23
+ *
24
+ * @category WDCA
25
+ * @package TBT_Enhancedgrid
26
+ * @author WDCA <contact@wdca.ca>
27
+ */
28
+ class Perception_Bannerpro_Block_Widget_Grid_Column_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
29
+ {
30
+ protected static $showImagesUrl = null;
31
+ protected static $showByDefault = null;
32
+ protected static $width = null;
33
+ protected static $height = null;
34
+
35
+ public function __construct() {
36
+
37
+ }
38
+
39
+ /**
40
+ * Renders grid column
41
+ *
42
+ * @param Varien_Object $row
43
+ * @return string
44
+ */
45
+ public function render(Varien_Object $row)
46
+ {
47
+
48
+ return $this->_getValue($row);
49
+ }
50
+
51
+ /*
52
+ public function renderProperty(Varien_Object $row)
53
+ {
54
+ $val = $row->getData($this->getColumn()->getIndex());
55
+ $val = Mage::helper('imagebyurl')->getImageUrl($val);
56
+ $out = parent::renderProperty(). ' onclick="showImage('.$val.')" ';
57
+ return $out;
58
+ }
59
+
60
+ */
61
+ protected function _getValue(Varien_Object $row)
62
+ {
63
+
64
+ if ($getter = $this->getColumn()->getGetter()) {
65
+ $val = $row->$getter();
66
+ }
67
+ $val = $val2 = $row->getData($this->getColumn()->getIndex());
68
+ $val = str_replace("no_selection", "", $val);
69
+ $val2 = str_replace("no_selection", "", $val2);
70
+
71
+ $url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).$val;
72
+
73
+ $filename = $val;
74
+
75
+ $out = "<img src=". $url ." width='". 100 ."' height='". 100 ."' />";
76
+
77
+ //die( $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135));
78
+
79
+
80
+ return $out;
81
+ }
82
+
83
+
84
+ }
app/code/local/Perception/Bannerpro/Helper/Data.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Perception_Bannerpro_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ public function isInStore($itemId) {
5
+ $currentStoreId = Mage::app()->getStore()->getId();
6
+ $item = Mage::getModel('bannerpro/bannerpro')->load($itemId);
7
+ $itemStores = $item->getStoreId();
8
+ $stores = explode(',', $itemStores);
9
+ if(in_array($currentStoreId, $stores) || in_array(0, $stores)) {
10
+ return true;
11
+ }
12
+ else {
13
+ return false;
14
+ }
15
+ }
16
+ }
app/code/local/Perception/Bannerpro/Helper/Image.php ADDED
@@ -0,0 +1,345 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Helper_Image extends Mage_Core_Helper_Abstract
4
+ {
5
+ protected $_model;
6
+ protected $_scheduleResize = false;
7
+ protected $_scheduleWatermark = false;
8
+ protected $_scheduleRotate = false;
9
+ protected $_angle;
10
+ protected $_watermark;
11
+ protected $_watermarkPosition;
12
+ protected $_watermarkSize;
13
+ protected $_imageFile;
14
+ protected $_placeholder;
15
+ protected $set_background_color;
16
+ protected $_view_mode;
17
+ /**
18
+ * Reset all previos data
19
+ */
20
+ protected function _reset()
21
+ {
22
+ $this->_model = null;
23
+ $this->_scheduleResize = false;
24
+ $this->_scheduleWatermark = false;
25
+ $this->_scheduleRotate = false;
26
+ $this->_angle = null;
27
+ $this->_watermark = null;
28
+ $this->_watermarkPosition = null;
29
+ $this->_watermarkSize = null;
30
+ $this->_imageFile = null;
31
+ return $this;
32
+ }
33
+
34
+ public function init($imageFile, $mode="detail")
35
+ {
36
+ $this->_reset();
37
+ $this->_view_mode = $mode;
38
+ $this->_setModel(Mage::getModel('bannerpro/image'));
39
+ $this->keepTransparency(true);
40
+ $this->_getModel()->setBackgroundColor($this->getStoreBackgroundColor());
41
+ $this->setImageFile($imageFile);
42
+ return $this;
43
+ }
44
+
45
+ /**
46
+ * Schedule resize of the image
47
+ * $width *or* $height can be null - in this case, lacking dimension will be calculated.
48
+ *
49
+ * @see Mage_Catalog_Model_Product_Image
50
+ * @param int $width
51
+ * @param int $height
52
+ * @return Perception_Bannerpro_Helper_Image
53
+ */
54
+ public function resize($width, $height = null, $background = true)
55
+ {
56
+ $this->_getModel()->setWidth($width)->setHeight($height);
57
+ $this->_scheduleResize = true;
58
+ $this->set_background_color = $background;
59
+ return $this;
60
+ }
61
+
62
+
63
+ /**
64
+ * Guarantee, that image picture width/height will not be distorted.
65
+ * Applicable before calling resize()
66
+ * It is true by default.
67
+ *
68
+ * @see Mage_Catalog_Model_Product_Image
69
+ * @param bool $flag
70
+ * @return Perception_Bannerpro_Helper_Image
71
+ */
72
+ public function keepAspectRatio($flag)
73
+ {
74
+ $this->_getModel()->setKeepAspectRatio($flag);
75
+ return $this;
76
+ }
77
+
78
+ /**
79
+ * Guarantee, that image will have dimensions, set in $width/$height
80
+ * Applicable before calling resize()
81
+ * Not applicable, if keepAspectRatio(false)
82
+ *
83
+ * $position - TODO, not used for now - picture position inside the frame.
84
+ *
85
+ * @see Mage_Catalog_Model_Product_Image
86
+ * @param bool $flag
87
+ * @param array $position
88
+ * @return Perception_Bannerpro_Helper_Image
89
+ */
90
+ public function keepFrame($flag, $position = array('center', 'middle'))
91
+ {
92
+ $this->_getModel()->setKeepFrame($flag);
93
+ return $this;
94
+ }
95
+
96
+ /**
97
+ * Guarantee, that image will not lose transparency if any.
98
+ * Applicable before calling resize()
99
+ * It is true by default.
100
+ *
101
+ * $alphaOpacity - TODO, not used for now
102
+ *
103
+ * @see Mage_Catalog_Model_Product_Image
104
+ * @param bool $flag
105
+ * @param int $alphaOpacity
106
+ * @return Perception_Bannerpro_Helper_Image
107
+ */
108
+ public function keepTransparency($flag, $alphaOpacity = null)
109
+ {
110
+ $this->_getModel()->setKeepTransparency($flag);
111
+ return $this;
112
+ }
113
+
114
+ /**
115
+ * Guarantee, that image picture will not be bigger, than it was.
116
+ * Applicable before calling resize()
117
+ * It is false by default
118
+ *
119
+ * @param bool $flag
120
+ * @return Perception_Bannerpro_Helper_Image
121
+ */
122
+ public function constrainOnly($flag)
123
+ {
124
+ $this->_getModel()->setConstrainOnly($flag);
125
+ return $this;
126
+ }
127
+
128
+ /**
129
+ * Set color to fill image frame with.
130
+ * Applicable before calling resize()
131
+ * The keepTransparency(true) overrides this (if image has transparent color)
132
+ * It is white by default.
133
+ *
134
+ * @param array $colorRGB
135
+ * @return Perception_Bannerpro_Helper_Image
136
+ */
137
+ public function backgroundColor($colorRGB)
138
+ {
139
+ // assume that 3 params were given instead of array
140
+ if (!is_array($colorRGB)) {
141
+ $colorRGB = func_get_args();
142
+ }
143
+ $this->_getModel()->setBackgroundColor($colorRGB);
144
+ return $this;
145
+ }
146
+
147
+ public function rotate($angle)
148
+ {
149
+ $this->setAngle($angle);
150
+ $this->_getModel()->setAngle($angle);
151
+ $this->_scheduleRotate = true;
152
+ return $this;
153
+ }
154
+
155
+ public function watermark($fileName, $position, $size=null)
156
+ {
157
+ $this->setWatermark($fileName)
158
+ ->setWatermarkPosition($position)
159
+ ->setWatermarkSize($size);
160
+ $this->_scheduleWatermark = true;
161
+ return $this;
162
+ }
163
+
164
+ public function placeholder($fileName)
165
+ {
166
+ $this->_placeholder = $fileName;
167
+ }
168
+
169
+ public function getPlaceholder()
170
+ {
171
+ if (!$this->_placeholder) {
172
+ $attr = $this->_getModel()->getDestinationSubdir();
173
+ $this->_placeholder = 'images/catalog/product/placeholder/'.$attr.'.jpg';
174
+ }
175
+ return $this->_placeholder;
176
+ }
177
+
178
+ public function __toString()
179
+ {
180
+ try {
181
+ if( $this->getImageFile() ) {
182
+ $this->_getModel()->setBaseFile( $this->getImageFile() );
183
+ }
184
+
185
+ if(!$this->set_background_color || $this->_view_mode=='detail'?!strlen(Mage::getStoreConfig('bannerpro/info/photo_background_color')):!strlen(Mage::getStoreConfig('bannerpro/info/simple_photo_background_color'))){
186
+ $info = getimagesize($this->_getModel()->getBaseFile());
187
+
188
+ $oldWidth = $info[0];
189
+ $oldHeight = $info[1];
190
+ $newWidth = $this->_getModel()->getWidth();
191
+ $newHeight = $this->_getModel()->getHeight();
192
+
193
+ if($oldWidth*1.0/$newWidth < $oldHeight*1.0/$newHeight) $newWidth = 1.0*$oldWidth * $newHeight/$oldHeight;
194
+ else $newHeight = 1.0*$oldHeight * $newWidth/$oldWidth;
195
+
196
+ $this->_getModel()->setWidth($newWidth);
197
+ $this->_getModel()->setHeight($newHeight);
198
+ }
199
+
200
+ if( $this->_getModel()->isCached() ) {
201
+ return $this->_getModel()->getUrl();
202
+ } else {
203
+ if( $this->_scheduleRotate ) {
204
+ $this->_getModel()->rotate( $this->getAngle() );
205
+ }
206
+
207
+ if ($this->_scheduleResize) {
208
+ $this->_getModel()->resize();
209
+ }
210
+
211
+ if( $this->_scheduleWatermark ) {
212
+ $this->_getModel()
213
+ ->setWatermarkPosition( $this->getWatermarkPosition() )
214
+ ->setWatermarkSize($this->parseSize($this->getWatermarkSize()))
215
+ ->setWatermark($this->getWatermark(), $this->getWatermarkPosition());
216
+ } else {
217
+ if( $watermark = Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_image") ) {
218
+ $this->_getModel()
219
+ ->setWatermarkPosition( $this->getWatermarkPosition() )
220
+ ->setWatermarkSize($this->parseSize($this->getWatermarkSize()))
221
+ ->setWatermark($watermark, $this->getWatermarkPosition());
222
+ }
223
+ }
224
+ $url = $this->_getModel()->saveFile()->getUrl();
225
+ }
226
+ } catch( Exception $e ) {
227
+ //Mage::log($e);
228
+ $url = Mage::getDesign()->getSkinUrl($this->getPlaceholder());
229
+ }
230
+ return $url;
231
+ }
232
+
233
+ /**
234
+ * Enter description here...
235
+ *
236
+ * @return Perception_Bannerpro_Helper_Image
237
+ */
238
+ protected function _setModel($model)
239
+ {
240
+ $this->_model = $model;
241
+ return $this;
242
+ }
243
+
244
+ /**
245
+ * Enter description here...
246
+ *
247
+ * @return Mage_Catalog_Model_Product_Image
248
+ */
249
+ protected function _getModel()
250
+ {
251
+ return $this->_model;
252
+ }
253
+
254
+ protected function setAngle($angle)
255
+ {
256
+ $this->_angle = $angle;
257
+ return $this;
258
+ }
259
+
260
+ protected function getAngle()
261
+ {
262
+ return $this->_angle;
263
+ }
264
+
265
+ protected function setWatermark($watermark)
266
+ {
267
+ $this->_watermark = $watermark;
268
+ return $this;
269
+ }
270
+
271
+ protected function getWatermark()
272
+ {
273
+ return $this->_watermark;
274
+ }
275
+
276
+ protected function setWatermarkPosition($position)
277
+ {
278
+ $this->_watermarkPosition = $position;
279
+ return $this;
280
+ }
281
+
282
+ protected function getWatermarkPosition()
283
+ {
284
+ if( $this->_watermarkPosition ) {
285
+ return $this->_watermarkPosition;
286
+ } else {
287
+ return Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_position");
288
+ }
289
+ }
290
+
291
+ public function setWatermarkSize($size)
292
+ {
293
+ $this->_watermarkSize = $size;
294
+ return $this;
295
+ }
296
+
297
+ protected function getWatermarkSize()
298
+ {
299
+ if( $this->_watermarkSize ) {
300
+ return $this->_watermarkSize;
301
+ } else {
302
+ return Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_size");
303
+ }
304
+ }
305
+
306
+ protected function setImageFile($file)
307
+ {
308
+ $this->_imageFile = $file;
309
+ return $this;
310
+ }
311
+
312
+ protected function getImageFile()
313
+ {
314
+ return $this->_imageFile;
315
+ }
316
+
317
+ /**
318
+ * Enter description here...
319
+ *
320
+ * @return array
321
+ */
322
+ protected function parseSize($string)
323
+ {
324
+ $size = explode('x', strtolower($string));
325
+ if( sizeof($size) == 2 ) {
326
+ return array(
327
+ 'width' => ($size[0] > 0) ? $size[0] : null,
328
+ 'heigth' => ($size[1] > 0) ? $size[1] : null,
329
+ );
330
+ }
331
+ return false;
332
+ }
333
+ public function getStoreBackgroundColor()
334
+ {
335
+ $color = $this->_view_mode=="detail"?explode(',',Mage::getStoreConfig('bannerpro/info/photo_background_color')):explode(',',Mage::getStoreConfig('bannerpro/info/simple_photo_background_color'));
336
+ if(sizeof($color)==3)
337
+ {
338
+ foreach($color as $item){
339
+ if(!is_numeric($item) || $item >255) return array(192, 192, 192);
340
+ }
341
+ return array((int)$color[0], (int)$color[1], (int)$color[2]);
342
+ }
343
+ return array(192, 192, 192);
344
+ }
345
+ }
app/code/local/Perception/Bannerpro/Helper/Wysiwyg/Images.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Cms
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ /**
27
+ * Wysiwyg Images Helper
28
+ */
29
+ class Perception_Bannerpro_Helper_Wysiwyg_Images extends Mage_Cms_Helper_Wysiwyg_Images
30
+ {
31
+ /**
32
+ * Retrieve Template processor for Page Content
33
+ *
34
+ * @return Varien_Filter_Template
35
+ */
36
+ public function getPageTemplateProcessor()
37
+ {
38
+ $model = (string)Mage::getConfig()->getNode('global/cms/page/tempate_filter');
39
+ return Mage::getModel($model);
40
+ }
41
+ }
app/code/local/Perception/Bannerpro/Model/Bannerpro.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Model_Bannerpro extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('bannerpro/bannerpro');
9
+ }
10
+ }
app/code/local/Perception/Bannerpro/Model/Entity/Attribute/Source/Boolean/Config.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * aheadWorks Co.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
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://ecommerce.aheadworks.com/LICENSE-M1.txt
12
+ *
13
+ * @category AW
14
+ * @package AW_Featuredproducts
15
+ * @copyright Copyright (c) 2008-2009 aheadWorks Co. (http://www.aheadworks.com)
16
+ * @license http://ecommerce.aheadworks.com/LICENSE-M1.txt
17
+ */
18
+
19
+ class Magestore_Bannerpro_Model_Entity_Attribute_Source_Boolean_Config extends Mage_Eav_Model_Entity_Attribute_Source_Boolean
20
+ {
21
+ /**
22
+ * Retrive all attribute options
23
+ *
24
+ * @return array
25
+ */
26
+ public function getAllOptions()
27
+ {
28
+ if (!$this->_options) {
29
+ $this->_options = array(
30
+ array(
31
+ 'label' => Mage::helper('bannerpro')->__('No'),
32
+ 'value' => 0
33
+ ),
34
+ array(
35
+ 'label' => Mage::helper('bannerpro')->__('Yes'),
36
+ 'value' => 1
37
+ )
38
+ );
39
+ }
40
+ return $this->_options;
41
+ }
42
+ }
app/code/local/Perception/Bannerpro/Model/Image.php ADDED
@@ -0,0 +1,508 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Perception_Bannerpro_Model_Image extends Mage_Core_Model_Abstract
3
+ {
4
+ protected $_width;
5
+ protected $_height;
6
+
7
+ protected $_keepAspectRatio = true;
8
+ protected $_keepFrame = true;
9
+ protected $_keepTransparency = true;
10
+ protected $_constrainOnly = false;
11
+ protected $_backgroundColor = array(192, 192, 192);
12
+
13
+ protected $_baseFile;
14
+ protected $_newFile;
15
+ protected $_baseDir;
16
+ protected $_processor;
17
+ protected $_destinationSubdir;
18
+ protected $_angle;
19
+ protected $_watermarkPosition;
20
+ protected $_watermarkWidth;
21
+ protected $_watermarkHeigth;
22
+
23
+ /**
24
+ * @return Perception_Bannerpro_Model_Image
25
+ */
26
+ public function setWidth($width)
27
+ {
28
+ $this->_width = $width;
29
+ return $this;
30
+ }
31
+
32
+ public function getWidth()
33
+ {
34
+ return $this->_width;
35
+ }
36
+
37
+ /**
38
+ * @return Perception_Bannerpro_Model_Image
39
+ */
40
+ public function setHeight($height)
41
+ {
42
+ $this->_height = $height;
43
+ return $this;
44
+ }
45
+
46
+ public function getHeight()
47
+ {
48
+ return $this->_height;
49
+ }
50
+
51
+ /**
52
+ * @return Perception_Bannerpro_Model_Image
53
+ */
54
+ public function setKeepAspectRatio($keep)
55
+ {
56
+ $this->_keepAspectRatio = (bool)$keep;
57
+ return $this;
58
+ }
59
+
60
+ /**
61
+ * @return Perception_Bannerpro_Model_Image
62
+ */
63
+ public function setKeepFrame($keep)
64
+ {
65
+ $this->_keepFrame = (bool)$keep;
66
+ return $this;
67
+ }
68
+
69
+ /**
70
+ * @return Perception_Bannerpro_Model_Image
71
+ */
72
+ public function setKeepTransparency($keep)
73
+ {
74
+ $this->_keepTransparency = (bool)$keep;
75
+ return $this;
76
+ }
77
+
78
+ /**
79
+ * @return Perception_Bannerpro_Model_Image
80
+ */
81
+ public function setConstrainOnly($flag)
82
+ {
83
+ $this->_constrainOnly = (bool)$flag;
84
+ return $this;
85
+ }
86
+
87
+ /**
88
+ * @return Perception_Bannerpro_Model_Image
89
+ */
90
+ public function setBackgroundColor(array $rgbArray)
91
+ {
92
+ $this->_backgroundColor = $rgbArray;
93
+ return $this;
94
+ }
95
+
96
+ /**
97
+ * @return Perception_Bannerpro_Model_Image
98
+ */
99
+ public function setSize($size)
100
+ {
101
+ // determine width and height from string
102
+ list($width, $height) = explode('x', strtolower($size), 2);
103
+ foreach (array('width', 'height') as $wh) {
104
+ $$wh = (int)$$wh;
105
+ if (empty($$wh))
106
+ $$wh = null;
107
+ }
108
+
109
+ // set sizes
110
+ $this->setWidth($width)->setHeight($height);
111
+
112
+ return $this;
113
+ }
114
+
115
+ protected function _checkMemory($file = null)
116
+ {
117
+ // print '$this->_getMemoryLimit() = '.$this->_getMemoryLimit();
118
+ // print '$this->_getMemoryUsage() = '.$this->_getMemoryUsage();
119
+ // print '$this->_getNeedMemoryForBaseFile() = '.$this->_getNeedMemoryForBaseFile();
120
+
121
+ return $this->_getMemoryLimit() > ($this->_getMemoryUsage() + $this->_getNeedMemoryForFile($file));
122
+ }
123
+
124
+ protected function _getMemoryLimit()
125
+ {
126
+ $memoryLimit = ini_get('memory_limit');
127
+
128
+ if (!isSet($memoryLimit[0])){
129
+ $memoryLimit = "128M";
130
+ }
131
+
132
+ if (substr($memoryLimit, -1) == 'M') {
133
+ return (int)$memoryLimit * 1024 * 1024;
134
+ }
135
+ return $memoryLimit;
136
+ }
137
+
138
+ protected function _getMemoryUsage()
139
+ {
140
+ if (function_exists('memory_get_usage')) {
141
+ return memory_get_usage();
142
+ }
143
+ return 0;
144
+ }
145
+
146
+ protected function _getNeedMemoryForFile($file = null)
147
+ {
148
+ $file = is_null($file) ? $this->getBaseFile() : $file;
149
+ if (!$file) {
150
+ return 0;
151
+ }
152
+
153
+ if (!file_exists($file) || !is_file($file)) {
154
+ return 0;
155
+ }
156
+
157
+ $imageInfo = getimagesize($file);
158
+
159
+ if (!isset($imageInfo['channels'])) {
160
+ // if there is no info about this parameter lets set it for maximum
161
+ $imageInfo['channels'] = 4;
162
+ }
163
+ if (!isset($imageInfo['bits'])) {
164
+ // if there is no info about this parameter lets set it for maximum
165
+ $imageInfo['bits'] = 8;
166
+ }
167
+ return round(($imageInfo[0] * $imageInfo[1] * $imageInfo['bits'] * $imageInfo['channels'] / 8 + Pow(2, 16)) * 1.65);
168
+ }
169
+
170
+ /**
171
+ * Convert array of 3 items (decimal r, g, b) to string of their hex values
172
+ *
173
+ * @param array $rgbArray
174
+ * @return string
175
+ */
176
+ private function _rgbToString($rgbArray)
177
+ {
178
+ $result = array();
179
+ foreach ($rgbArray as $value) {
180
+ if (null === $value) {
181
+ $result[] = 'null';
182
+ }
183
+ else {
184
+ $result[] = sprintf('%02s', dechex($value));
185
+ }
186
+ }
187
+ return implode($result);
188
+ }
189
+
190
+ /**
191
+ * Set filenames for base file and new file
192
+ *
193
+ * @param string $file
194
+ * @return Perception_Bannerpro_Model_Image
195
+ */
196
+ public function setBaseFile($file)
197
+ {
198
+ $subDir = '';
199
+
200
+ if ($file) {
201
+ if (0 !== strpos($file, '/', 0)) {
202
+ $file = '/' . $file;
203
+ }
204
+
205
+ $pos = strripos($file, '/');
206
+ if ($pos!==false && $pos!==0) {
207
+ $subDir = substr($file, 0, $pos);
208
+ $file = substr($file, $pos);
209
+ }
210
+ }
211
+ //$baseDir = Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath();
212
+ $baseDir = Mage::getBaseDir('media') . $subDir;
213
+ $this->_baseDir = Mage::getBaseDir('media') . DS;
214
+
215
+ if ('/no_selection' == $file) {
216
+ $file = null;
217
+ }
218
+ if ($file) {
219
+ if ((!file_exists($baseDir . $file)) || !$this->_checkMemory($baseDir . $file)) {
220
+ $file = null;
221
+ }
222
+ }
223
+
224
+ /*
225
+ if (!$file) {
226
+ // check if placeholder defined in config
227
+ $isConfigPlaceholder = Mage::getStoreConfig("catalog/placeholder/{$this->getDestinationSubdir()}_placeholder");
228
+ $configPlaceholder = '/placeholder/' . $isConfigPlaceholder;
229
+ if ($isConfigPlaceholder && file_exists($baseDir . $configPlaceholder)) {
230
+ $file = $configPlaceholder;
231
+ }
232
+ else {
233
+ // replace file with skin or default skin placeholder
234
+ $skinBaseDir = Mage::getDesign()->getSkinBaseDir();
235
+ $skinPlaceholder = "/images/catalog/product/placeholder/{$this->getDestinationSubdir()}.jpg";
236
+ $file = $skinPlaceholder;
237
+ if (file_exists($skinBaseDir . $file)) {
238
+ $baseDir = $skinBaseDir;
239
+ }
240
+ else {
241
+ $baseDir = Mage::getDesign()->getSkinBaseDir(array('_theme' => 'default'));
242
+ }
243
+ }
244
+ }
245
+ */
246
+
247
+ $baseFile = $baseDir . $file;
248
+
249
+ if ((!$file) || (!file_exists($baseFile))) {
250
+ throw new Exception(Mage::helper('catalog')->__('Image file not found'));
251
+ }
252
+ $this->_baseFile = $baseFile;
253
+
254
+ // build new filename (most important params)
255
+ $path = array(
256
+ 'bannerpro',
257
+ 'cache'
258
+ );
259
+ if((!empty($this->_width)) || (!empty($this->_height)))
260
+ $path[] = "{$this->_width}x{$this->_height}";
261
+ // add misc params as a hash
262
+ $path[] = md5(
263
+ implode('_', array(
264
+ ($this->_keepAspectRatio ? '' : 'non') . 'proportional',
265
+ ($this->_keepFrame ? '' : 'no') . 'frame',
266
+ ($this->_keepTransparency ? '' : 'no') . 'transparency',
267
+ ($this->_constrainOnly ? 'do' : 'not') . 'constrainonly',
268
+ $this->_rgbToString($this->_backgroundColor),
269
+ 'angle' . $this->_angle
270
+ ))
271
+ );
272
+ // append prepared filename
273
+ $this->_newFile = implode('/', $path) . $file; // the $file contains heading slash
274
+
275
+ return $this;
276
+ }
277
+
278
+ public function getBaseFile()
279
+ {
280
+ return $this->_baseFile;
281
+ }
282
+
283
+ public function getBaseDir()
284
+ {
285
+ return $this->_baseDir;
286
+ }
287
+
288
+ public function getNewFile()
289
+ {
290
+ return $this->_newFile;
291
+ }
292
+
293
+ /**
294
+ * @return Perception_Bannerpro_Model_Image
295
+ */
296
+ public function setImageProcessor($processor)
297
+ {
298
+ $this->_processor = $processor;
299
+ return $this;
300
+ }
301
+
302
+ /**
303
+ * @return Varien_Image
304
+ */
305
+ public function getImageProcessor()
306
+ {
307
+ if( !$this->_processor ) {
308
+ // var_dump($this->_checkMemory());
309
+ // if (!$this->_checkMemory()) {
310
+ // $this->_baseFile = null;
311
+ // }
312
+ $this->_processor = new Varien_Image($this->getBaseFile());
313
+ }
314
+ $this->_processor->keepAspectRatio($this->_keepAspectRatio);
315
+ $this->_processor->keepFrame($this->_keepFrame);
316
+ $this->_processor->keepTransparency($this->_keepTransparency);
317
+ $this->_processor->constrainOnly($this->_constrainOnly);
318
+ $this->_processor->backgroundColor($this->_backgroundColor);
319
+ return $this->_processor;
320
+ }
321
+
322
+ public function getKeepTransparency()
323
+ {
324
+ return $this->_keepTransparency;
325
+ }
326
+ /**
327
+ * @see Varien_Image_Adapter_Abstract
328
+ * @return Perception_Bannerpro_Model_Image
329
+ */
330
+ public function resize()
331
+ {
332
+ if (is_null($this->getWidth()) && is_null($this->getHeight())) {
333
+ return $this;
334
+ }
335
+ $this->getImageProcessor()->resize($this->_width, $this->_height);
336
+ return $this;
337
+ }
338
+
339
+ /**
340
+ * @return Perception_Bannerpro_Model_Image
341
+ */
342
+ public function rotate($angle)
343
+ {
344
+ $angle = intval($angle);
345
+ $this->getImageProcessor()->rotate($angle);
346
+ return $this;
347
+ }
348
+
349
+ /**
350
+ * Set angle for rotating
351
+ *
352
+ * This func actually affects only the cache filename.
353
+ *
354
+ * @param int $angle
355
+ * @return Perception_Bannerpro_Model_Image
356
+ */
357
+ public function setAngle($angle)
358
+ {
359
+ $this->_angle = $angle;
360
+ return $this;
361
+ }
362
+
363
+ /**
364
+ * @return Perception_Bannerpro_Model_Image
365
+ */
366
+ public function setWatermark($file, $position=null, $size=null, $width=null, $heigth=null)
367
+ {
368
+ $filename = false;
369
+
370
+ if( !$file ) {
371
+ return $this;
372
+ }
373
+
374
+ $baseDir = Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath();
375
+
376
+ if( file_exists($baseDir . '/watermark/stores/' . Mage::app()->getStore()->getId() . $file) ) {
377
+ $filename = $baseDir . '/watermark/stores/' . Mage::app()->getStore()->getId() . $file;
378
+ } elseif ( file_exists($baseDir . '/watermark/websites/' . Mage::app()->getWebsite()->getId() . $file) ) {
379
+ $filename = $baseDir . '/watermark/websites/' . Mage::app()->getWebsite()->getId() . $file;
380
+ } elseif ( file_exists($baseDir . '/watermark/default/' . $file) ) {
381
+ $filename = $baseDir . '/watermark/default/' . $file;
382
+ } elseif ( file_exists($baseDir . '/watermark/' . $file) ) {
383
+ $filename = $baseDir . '/watermark/' . $file;
384
+ } else {
385
+ $baseDir = Mage::getDesign()->getSkinBaseDir();
386
+ if( file_exists($baseDir . $file) ) {
387
+ $filename = $baseDir . $file;
388
+ }
389
+ }
390
+
391
+ if( $filename ) {
392
+ $this->getImageProcessor()
393
+ ->setWatermarkPosition( ($position) ? $position : $this->getWatermarkPosition() )
394
+ ->setWatermarkWidth( ($width) ? $width : $this->getWatermarkWidth() )
395
+ ->setWatermarkHeigth( ($heigth) ? $heigth : $this->getWatermarkHeigth() )
396
+ ->watermark($filename);
397
+ }
398
+
399
+ return $this;
400
+ }
401
+
402
+ /**
403
+ * @return Perception_Bannerpro_Model_Image
404
+ */
405
+ public function saveFile()
406
+ {
407
+ $this->getImageProcessor()->save($this->getBaseDir().$this->getNewFile());
408
+ return $this;
409
+ }
410
+
411
+ /**
412
+ * @return string
413
+ */
414
+ public function getUrl()
415
+ {
416
+ $baseDir = Mage::getBaseDir('media');
417
+ $path = str_replace($baseDir . DS, "", $this->_newFile);
418
+ return Mage::getBaseUrl('media') . str_replace(DS, '/', $path);
419
+ }
420
+
421
+ public function push()
422
+ {
423
+ $this->getImageProcessor()->display();
424
+ }
425
+
426
+ /**
427
+ * @return Perception_Bannerpro_Model_Image
428
+ */
429
+ public function setDestinationSubdir($dir)
430
+ {
431
+ $this->_destinationSubdir = $dir;
432
+ return $this;
433
+ }
434
+
435
+ /**
436
+ * @return string
437
+ */
438
+ public function getDestinationSubdir()
439
+ {
440
+ return $this->_destinationSubdir;
441
+ }
442
+
443
+ public function isCached()
444
+ {
445
+ return file_exists($this->getBaseDir().$this->_newFile);
446
+ }
447
+
448
+ /**
449
+ * @return Perception_Bannerpro_Model_Image
450
+ */
451
+ public function setWatermarkPosition($position)
452
+ {
453
+ $this->_watermarkPosition = $position;
454
+ return $this;
455
+ }
456
+
457
+ public function getWatermarkPosition()
458
+ {
459
+ return $this->_watermarkPosition;
460
+ }
461
+
462
+ /**
463
+ * @return Perception_Bannerpro_Model_Image
464
+ */
465
+ public function setWatermarkSize($size)
466
+ {
467
+ if( is_array($size) ) {
468
+ $this->setWatermarkWidth($size['width'])
469
+ ->setWatermarkHeigth($size['heigth']);
470
+ }
471
+ return $this;
472
+ }
473
+
474
+ /**
475
+ * @return Perception_Bannerpro_Model_Image
476
+ */
477
+ public function setWatermarkWidth($width)
478
+ {
479
+ $this->_watermarkWidth = $width;
480
+ return $this;
481
+ }
482
+
483
+ public function getWatermarkWidth()
484
+ {
485
+ return $this->_watermarkWidth;
486
+ }
487
+
488
+ /**
489
+ * @return Perception_Bannerpro_Model_Image
490
+ */
491
+ public function setWatermarkHeigth($heigth)
492
+ {
493
+ $this->_watermarkHeigth = $heigth;
494
+ return $this;
495
+ }
496
+
497
+ public function getWatermarkHeigth()
498
+ {
499
+ return $this->_watermarkHeigth;
500
+ }
501
+
502
+ public function clearCache()
503
+ {
504
+ $directory = Mage::getBaseDir('media') . DS.'bannerpro'.DS.'cache'.DS;
505
+ $io = new Varien_Io_File();
506
+ $io->rmdir($directory, true);
507
+ }
508
+ }
app/code/local/Perception/Bannerpro/Model/Mysql4/Bannerpro.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Model_Mysql4_Bannerpro extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the bannerpro_id refers to the key field in your database table.
8
+ $this->_init('bannerpro/bannerpro', 'bannerpro_id');
9
+ }
10
+
11
+ /**
12
+ * Process page data before saving
13
+ *
14
+ * @param Mage_Core_Model_Abstract $object
15
+ */
16
+ protected function _beforeSave(Mage_Core_Model_Abstract $object)
17
+ {
18
+
19
+ if (! $object->getId() && $object->getCreationTime() == "") {
20
+ $object->setCreationTime(Mage::getSingleton('core/date')->gmtDate());
21
+ }
22
+
23
+ $format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
24
+ if ($date = $object->getData('creation_time')) {
25
+ $object->setData('creation_time', Mage::app()->getLocale()->date($date, $format, null, false)
26
+ ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)
27
+ );
28
+ }
29
+ $object->setUpdateTime(Mage::getSingleton('core/date')->gmtDate());
30
+
31
+ return $this;
32
+ }
33
+
34
+ /**
35
+ *
36
+ * @param Mage_Core_Model_Abstract $object
37
+ */
38
+ protected function _afterLoad(Mage_Core_Model_Abstract $object)
39
+ {
40
+ $select = $this->_getReadAdapter()->select()
41
+ ->from($this->getTable('bannerpro_store'))
42
+ ->where('bannerpro_id = ?', $object->getId());
43
+
44
+ if ($data = $this->_getReadAdapter()->fetchAll($select)) {
45
+ $storesArray = array();
46
+ foreach ($data as $row) {
47
+ $storesArray[] = $row['store_id'];
48
+ }
49
+ $object->setData('store_id', $storesArray);
50
+ }
51
+
52
+ return parent::_afterLoad($object);
53
+ }
54
+
55
+ /**
56
+ * Assign page to store views
57
+ *
58
+ * @param Mage_Core_Model_Abstract $object
59
+ */
60
+ protected function _afterSave(Mage_Core_Model_Abstract $object)
61
+ {
62
+ $condition = $this->_getWriteAdapter()->quoteInto('bannerpro_id = ?', $object->getId());
63
+ $this->_getWriteAdapter()->delete($this->getTable('bannerpro_store'), $condition);
64
+
65
+ foreach ((array)$object->getData('stores') as $store) {
66
+ $storeArray = array();
67
+ $storeArray['bannerpro_id'] = $object->getId();
68
+ $storeArray['store_id'] = $store;
69
+ $this->_getWriteAdapter()->insert($this->getTable('bannerpro_store'), $storeArray);
70
+ }
71
+
72
+ return parent::_afterSave($object);
73
+ }
74
+
75
+ /**
76
+ * Retrieve select object for load object data
77
+ *
78
+ * @param string $field
79
+ * @param mixed $value
80
+ * @return Zend_Db_Select
81
+ */
82
+ protected function _getLoadSelect($field, $value, $object)
83
+ {
84
+ $select = parent::_getLoadSelect($field, $value, $object);
85
+
86
+ if ($object->getStoreId()) {
87
+ $select->join(
88
+ array('bannerpro' => $this->getTable('bannerpro_store')),
89
+ $this->getMainTable().'.bannerpro_id = `bannerpro`.bannerpro_id'
90
+ )
91
+ ->where('is_active=1 AND `bannerpro`.store_id in (' . Mage_Core_Model_App::ADMIN_STORE_ID . ', ?) ', $object->getStoreId())
92
+ ->order('store_id DESC')
93
+ ->limit(1);
94
+ }
95
+ return $select;
96
+ }
97
+
98
+ /**
99
+ * Check if page identifier exist for specific store
100
+ * return page id if page exists
101
+ *
102
+ * @param string $identifier
103
+ * @param int $storeId
104
+ * @return int
105
+ */
106
+ public function checkIdentifier($bannerpro_id, $storeId)
107
+ {
108
+ $select = $this->_getReadAdapter()->select()->from(array('main_table'=>$this->getMainTable()), 'bannerpro_id')
109
+ ->join(
110
+ array('bannerpro' => $this->getTable('bannerpro_store')),
111
+ 'main_table.bannerpro_id = `bannerpro`.bannerpro_id'
112
+ )
113
+ ->where('main_table.bannerpro_id=?', $bannerpro_id)
114
+ ->where('main_table.is_active=1 AND `bannerpro`.store_id in (' . Mage_Core_Model_App::ADMIN_STORE_ID . ', ?) ', $storeId)
115
+ ->order('store_id DESC');
116
+
117
+ return $this->_getReadAdapter()->fetchOne($select);
118
+ }
119
+
120
+ /**
121
+ * Get store ids to which specified item is assigned
122
+ *
123
+ * @param int $id
124
+ * @return array
125
+
126
+ */
127
+ public function lookupStoreIds($id)
128
+ {
129
+ return $this->_getReadAdapter()->fetchCol($this->_getReadAdapter()->select()
130
+ ->from($this->getTable('bannerpro_store'), 'store_id')
131
+ ->where("{$this->getIdFieldName()} = ?", $id)
132
+ );
133
+ }
134
+
135
+ /**
136
+ * Set store model
137
+ *
138
+ * @param Mage_Core_Model_Store $store
139
+ * @return Mage_Cms_Model_Mysql4_Page
140
+ */
141
+ public function setStore($store)
142
+ {
143
+ $this->_store = $store;
144
+ return $this;
145
+ }
146
+
147
+ /**
148
+ * Retrieve store model
149
+ *
150
+ * @return Mage_Core_Model_Store
151
+ */
152
+ public function getStore()
153
+ {
154
+ return Mage::app()->getStore($this->_store);
155
+ }
156
+
157
+
158
+ }
app/code/local/Perception/Bannerpro/Model/Mysql4/Bannerpro/Collection.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Model_Mysql4_Bannerpro_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ protected $_previewFlag;
6
+
7
+ public function _construct()
8
+ {
9
+ parent::_construct();
10
+ $this->_init('bannerpro/bannerpro');
11
+ $this->_map['fields']['bannerpro_id'] = 'main_table.bannerpro_id';
12
+ }
13
+
14
+ public function setFirstStoreFlag($flag = false)
15
+ {
16
+ $this->_previewFlag = $flag;
17
+ return $this;
18
+ }
19
+
20
+ protected function _afterLoad()
21
+ {
22
+ if ($this->_previewFlag) {
23
+ $items = $this->getColumnValues('bannerpro_id');
24
+
25
+ if (count($items)) {
26
+ $select = $this->getConnection()->select()
27
+ ->from($this->getTable('bannerpro_store'))
28
+ ->where($this->getTable('bannerpro_store').'.bannerpro_id IN (?)', $items);
29
+
30
+ if ($result = $this->getConnection()->fetchPairs($select)) {
31
+
32
+ foreach ($this as $item) {
33
+
34
+ if (!isset($result[$item->getData('bannerpro_id')])) {
35
+ continue;
36
+ }
37
+
38
+ if ($result[$item->getData('bannerpro_id')] == 0) {
39
+ $stores = Mage::app()->getStores(false, true);
40
+ $storeId = current($stores)->getId();
41
+ $storeCode = key($stores);
42
+ } else {
43
+ $storeId = $result[$item->getData('bannerpro_id')];
44
+ $storeCode = Mage::app()->getStore($storeId)->getCode();
45
+ }
46
+
47
+ $item->setData('_first_store_id', $storeId);
48
+ $item->setData('store_code', $storeCode);
49
+ }
50
+ }
51
+
52
+ }
53
+ }
54
+
55
+ parent::_afterLoad();
56
+ }
57
+
58
+ /**
59
+ * Add Filter by store
60
+ *
61
+ * @param int|Mage_Core_Model_Store $store
62
+ * @return Mage_Cms_Model_Mysql4_Page_Collection
63
+ */
64
+
65
+ public function addStoreFilter($store, $withAdmin = true)
66
+ {
67
+ if (!$this->getFlag('store_filter_added')) {
68
+
69
+ if ($store instanceof Mage_Core_Model_Store) {
70
+ $store = array($store->getId());
71
+ }
72
+
73
+ $this->getSelect()->join(
74
+ array('store_table' => $this->getTable('bannerpro_store')),
75
+ 'main_table.bannerpro_id = store_table.bannerpro_id',
76
+ array()
77
+ )->where('store_table.store_id in (?)', ($withAdmin ? array(0, $store) : $store))
78
+ ->group('main_table.bannerpro_id');
79
+
80
+ $this->setFlag('store_filter_added', true);
81
+ }
82
+
83
+ return $this;
84
+ }
85
+
86
+ public function prepareSummary()
87
+ {
88
+ $this->setConnection($this->getResource()->getReadConnection());
89
+ $this->getSelect()
90
+ ->from(array('main_table'=>'bannerpro'),'*')
91
+ ->where('status = ?', 1)
92
+ ->order('date','asc');
93
+ return $this;
94
+ }
95
+
96
+ public function getDetalle($bannerpro_id)
97
+ {
98
+ $this->setConnection($this->getResource()->getReadConnection());
99
+ $this->getSelect()
100
+ ->from(array('main_table'=>'bannerpro'),'*')
101
+ ->where('bannerpro_id = ?', $bannerpro_id);
102
+ return $this;
103
+ }
104
+
105
+ public function getbannerpro()
106
+ {
107
+ $this->setConnection($this->getResource()->getReadConnection());
108
+ $this->getSelect()
109
+ ->from(array('main_table'=>'bannerpro'),'*')
110
+ ->where('status = ?', 1)
111
+ ->order('date DESC')
112
+ ->limit(5);
113
+ return $this;
114
+ }
115
+
116
+ public function prepareResult($word)
117
+ {
118
+ $sql = "SELECT title,text FROM bannerpro where title like '%$word%' OR text like '%$word%'";
119
+ $data = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);
120
+ return $data;
121
+ }
122
+
123
+ }
app/code/local/Perception/Bannerpro/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_ENABLED = 1;
6
+ const STATUS_DISABLED = 2;
7
+
8
+ static public function getOptionArray()
9
+ {
10
+ return array(
11
+ self::STATUS_ENABLED => Mage::helper('bannerpro')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('bannerpro')->__('Disabled')
13
+ );
14
+ }
15
+ }
app/code/local/Perception/Bannerpro/Model/System/Backend/Links.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Contacts
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Cache cleaner backend model
29
+ *
30
+ */
31
+ class Magestore_Bannerpro_Model_System_Config_Backend_Links extends Mage_Adminhtml_Model_System_Config_Backend_Cache
32
+ {
33
+ /**
34
+ * Cache tags to clean
35
+ *
36
+ * @var array
37
+ */
38
+ protected $_cacheTags = array(Mage_Core_Model_Store::CACHE_TAG, Mage_Cms_Model_Block::CACHE_TAG);
39
+
40
+ }
app/code/local/Perception/Bannerpro/Model/System/Config/Source/Effect.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Used in creating options for Yes|No config value selection
29
+ *
30
+ */
31
+ class Perception_Bannerpro_Model_System_Config_Source_Effect
32
+ {
33
+
34
+ /**
35
+ * Options getter
36
+ *
37
+ * @return array
38
+ */
39
+ public function toOptionArray()
40
+ {
41
+ return array(
42
+ array('value' => 'none', 'label'=>Mage::helper('bannerpro')->__('None')),
43
+ array('value' => 'blindX', 'label'=>Mage::helper('bannerpro')->__('Blind X')),
44
+ array('value' => 'blindY', 'label'=>Mage::helper('bannerpro')->__('Blind Y')),
45
+ array('value' => 'blindZ', 'label'=>Mage::helper('bannerpro')->__('Blind Z')),
46
+ array('value' => 'cover', 'label'=>Mage::helper('bannerpro')->__('Cover')),
47
+ array('value' => 'curtainX', 'label'=>Mage::helper('bannerpro')->__('Curtain X')),
48
+ array('value' => 'curtainY', 'label'=>Mage::helper('bannerpro')->__('Curtain Y')),
49
+ array('value' => 'fade', 'label'=>Mage::helper('bannerpro')->__('Fade')),
50
+ array('value' => 'fadeZoom', 'label'=>Mage::helper('bannerpro')->__('Fade Zoom')),
51
+ array('value' => 'growX', 'label'=>Mage::helper('bannerpro')->__('Grow X')),
52
+ array('value' => 'growY', 'label'=>Mage::helper('bannerpro')->__('Grow Y')),
53
+ array('value' => 'scrollUp', 'label'=>Mage::helper('bannerpro')->__('Scroll Up')),
54
+ array('value' => 'scrollDown', 'label'=>Mage::helper('bannerpro')->__('Scroll Down')),
55
+ array('value' => 'scrollLeft', 'label'=>Mage::helper('bannerpro')->__('Scroll Left')),
56
+ array('value' => 'scrollRight', 'label'=>Mage::helper('bannerpro')->__('Scroll Right')),
57
+ array('value' => 'scrollHorz', 'label'=>Mage::helper('bannerpro')->__('Scroll Horizontal')),
58
+ array('value' => 'scrollVert', 'label'=>Mage::helper('bannerpro')->__('Scroll Vertical')),
59
+ array('value' => 'shuffle', 'label'=>Mage::helper('bannerpro')->__('Shuffle')),
60
+ array('value' => 'toss', 'label'=>Mage::helper('bannerpro')->__('Toss')),
61
+ array('value' => 'turnUp', 'label'=>Mage::helper('bannerpro')->__('Turn Up')),
62
+ array('value' => 'turnDown', 'label'=>Mage::helper('bannerpro')->__('Turn Down')),
63
+ array('value' => 'turnLeft', 'label'=>Mage::helper('bannerpro')->__('Turn Left')),
64
+ array('value' => 'turnRight', 'label'=>Mage::helper('bannerpro')->__('Turn Right')),
65
+ array('value' => 'uncover', 'label'=>Mage::helper('bannerpro')->__('Uncover')),
66
+ array('value' => 'wipe', 'label'=>Mage::helper('bannerpro')->__('Wipe')),
67
+ array('value' => 'zoom', 'label'=>Mage::helper('bannerpro')->__('Zoom'))
68
+ );
69
+ }
70
+ }
app/code/local/Perception/Bannerpro/Model/Wysiwyg/Config.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Perception_Bannerpro_Model_Wysiwyg_Config extends Mage_Cms_Model_Wysiwyg_Config
4
+ {
5
+ /**
6
+ * Wysiwyg behaviour
7
+ */
8
+ const WYSIWYG_ENABLED = 'enabled';
9
+ const WYSIWYG_HIDDEN = 'hidden';
10
+ const WYSIWYG_DISABLED = 'disabled';
11
+
12
+ /**
13
+ * Return Wysiwyg config as Varien_Object
14
+ *
15
+ * Config options description:
16
+ *
17
+ * enabled: Enabled Visual Editor or not
18
+ * hidden: Show Visual Editor on page load or not
19
+ * use_container: Wrap Editor contents into div or not
20
+ * no_display: Hide Editor container or not (related to use_container)
21
+ * translator: Helper to translate phrases in lib
22
+ * files_browser_*: Files Browser (media, images) settings
23
+ * encode_directives: Encode template directives with JS or not
24
+ *
25
+ * @param $data Varien_Object constructor params to override default config values
26
+ * @return Varien_Object
27
+ */
28
+ public function getConfig($data = array())
29
+ {
30
+ $config = new Varien_Object();
31
+
32
+ $config->setData(array(
33
+ 'enabled' => $this->isEnabled(),
34
+ 'hidden' => $this->isHidden(),
35
+ 'use_container' => false,
36
+ 'add_variables' => true,
37
+ 'add_widgets' => true,
38
+ 'no_display' => false,
39
+ 'translator' => Mage::helper('bannerpro'),
40
+ 'files_browser_window_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index'),
41
+ 'files_browser_window_width' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width'),
42
+ 'files_browser_window_height' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height'),
43
+ 'encode_directives' => true,
44
+ 'directives_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive'),
45
+ 'popup_css' => Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css',
46
+ 'content_css' => Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css',
47
+ 'width' => '60%',
48
+ 'plugins' => array()
49
+ ));
50
+
51
+
52
+ $config->setData('directives_url_quoted', preg_quote($config->getData('directives_url')));
53
+
54
+ if (is_array($data)) {
55
+ $config->addData($data);
56
+
57
+ // print_r($data); die();
58
+ }
59
+
60
+ Mage::dispatchEvent('cms_wysiwyg_config_prepare', array('config' => $config));
61
+
62
+ return $config;
63
+ }
64
+
65
+ /**
66
+ * Return URL for skin images placeholder
67
+ *
68
+ * @return string
69
+ */
70
+ public function getSkinImagePlaceholderUrl()
71
+ {
72
+ return Mage::getDesign()->getSkinUrl('images/wysiwyg/skin_image.png');
73
+ }
74
+
75
+ /**
76
+ * Check whether Wysiwyg is enabled or not
77
+ *
78
+ * @return bool
79
+ */
80
+ public function isEnabled()
81
+ {
82
+ $storeId = $this->getStoreId();
83
+ if (!is_null($storeId)) {
84
+ $wysiwygState = Mage::getStoreConfig('cms/wysiwyg/enabled', $storeId);
85
+ } else {
86
+ $wysiwygState = Mage::getStoreConfig('cms/wysiwyg/enabled');
87
+ }
88
+ return in_array($wysiwygState, array(self::WYSIWYG_ENABLED, self::WYSIWYG_HIDDEN));
89
+ }
90
+
91
+ /**
92
+ * Check whether Wysiwyg is loaded on demand or not
93
+ *
94
+ * @return bool
95
+ */
96
+ public function isHidden()
97
+ {
98
+ return Mage::getStoreConfig('cms/wysiwyg/enabled') == self::WYSIWYG_HIDDEN;
99
+ }
100
+ }
app/code/local/Perception/Bannerpro/Model/Wysiwyg/Images/Storage.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Cms
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Wysiwyg Images model
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Cms
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Perception_Bannerpro_Model_Wysiwyg_Images_Storage extends Mage_Cms_Model_Wysiwyg_Images_Storage
35
+ {
36
+
37
+ }
app/code/local/Perception/Bannerpro/Model/Wysiwyg/Images/Storage/Collection.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Cms
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Wysiwyg Images storage collection
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Cms
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Perception_Bannerpro_Model_Wysiwyg_Images_Storage_Collection extends Mage_Cms_Model_Wysiwyg_Images_Storage_Collection
35
+ {
36
+
37
+ }
app/code/local/Perception/Bannerpro/controllers/Adminhtml/BannerproController.php ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Perception_Bannerpro_Adminhtml_BannerproController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ protected function _initAction() {
5
+ $this->loadLayout()
6
+ ->_setActiveMenu('bannerpro/items')
7
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
8
+
9
+ return $this;
10
+ }
11
+
12
+ public function indexAction() {
13
+ $this->_initAction()
14
+ ->renderLayout();
15
+ }
16
+
17
+ public function editAction() {
18
+ $id = $this->getRequest()->getParam('id');
19
+ $model = Mage::getModel('bannerpro/bannerpro')->load($id);
20
+
21
+ if ($model->getId() || $id == 0) {
22
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
23
+ if (!empty($data)) {
24
+ $model->setData($data);
25
+ }
26
+
27
+ Mage::register('bannerpro_data', $model);
28
+
29
+ $this->loadLayout();
30
+ $this->_setActiveMenu('bannerpro/items');
31
+
32
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
33
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
34
+
35
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
36
+
37
+ if (Mage::getSingleton('bannerpro/wysiwyg_config')->isEnabled()) {
38
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
39
+ }
40
+
41
+ if (Mage::getSingleton('bannerpro/wysiwyg_config')->isEnabled()) {
42
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
43
+ }
44
+
45
+ $this->_addContent($this->getLayout()->createBlock('bannerpro/adminhtml_bannerpro_edit'))
46
+ ->_addLeft($this->getLayout()->createBlock('bannerpro/adminhtml_bannerpro_edit_tabs'));
47
+
48
+ $this->renderLayout();
49
+ } else {
50
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('bannerpro')->__('Item does not exist'));
51
+ $this->_redirect('*/*/');
52
+ }
53
+ }
54
+
55
+ public function newAction() {
56
+ $this->_forward('edit');
57
+ }
58
+
59
+ public function saveAction() {
60
+ if ($data = $this->getRequest()->getPost()) {
61
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
62
+ try {
63
+ /* Starting upload */
64
+ $uploader = new Varien_File_Uploader('filename');
65
+
66
+ // Any extention would work
67
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
68
+ $uploader->setAllowRenameFiles(false);
69
+
70
+ // Set the file upload mode
71
+ // false -> get the file directly in the specified folder
72
+ // true -> get the file in the product like folders
73
+ // (file.jpg will go in something like /media/f/i/file.jpg)
74
+ $uploader->setFilesDispersion(false);
75
+
76
+ // We set media as the upload dir
77
+ $path = Mage::getBaseDir('media') . DS . 'bannerpro' . DS ;
78
+ $uploader->save($path, $_FILES['filename']['name'] );
79
+
80
+ } catch (Exception $e) {
81
+
82
+ }
83
+ $img_name = str_replace(" ","_",$_FILES['filename']['name']);
84
+ //this way the name is saved in DB
85
+ $data['filename'] = 'bannerpro/'.$img_name; //$_FILES['filename']['name'];
86
+ $data['image_thumb'] = $img_name; //$_FILES['filename']['name'];
87
+ $data['stores'] = $this->getRequest()->getPost('stores');
88
+ //$data['image_thumb'] = "<img width='100' src='".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).$_FILES['filename']['name']."'/>";
89
+ }
90
+ else {
91
+ if(isset($data['filename']['delete']) && $data['filename']['delete'] == 1) {
92
+ $data['filename'] = '';
93
+ } else {
94
+ unset($data['filename']);
95
+ }
96
+ }
97
+
98
+ /* if($this->getRequest()->getParam('id'))
99
+ {
100
+ //if edit the video details, delete old images from media folder
101
+ if($data['filename']!= '')
102
+ {
103
+ $imageupload = Mage::getModel('bannerpro/bannerpro')->load($this->getRequest()->getParam('id'));
104
+ $imagePath = Mage::getBaseDir('media').DS. "bannerpro" . DS ;
105
+ $imageName = $imageupload->getFilename();
106
+ unlink($imagePath.$imageName);
107
+ }
108
+ }
109
+ */
110
+
111
+ $model = Mage::getModel('bannerpro/bannerpro');
112
+ $model->setData($data)
113
+ ->setId($this->getRequest()->getParam('id'));
114
+
115
+ try {
116
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
117
+ $model->setCreatedTime(now())
118
+ ->setUpdateTime(now());
119
+ } else {
120
+ $model->setUpdateTime(now());
121
+ }
122
+
123
+ // echo '<pre>';
124
+ //print_r($_POST['text']);
125
+ // die;
126
+
127
+
128
+ $model->save();
129
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('bannerpro')->__('Item was successfully saved'));
130
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
131
+
132
+ if ($this->getRequest()->getParam('back')) {
133
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
134
+ return;
135
+ }
136
+ $this->_redirect('*/*/');
137
+ return;
138
+ } catch (Exception $e) {
139
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
140
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
141
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
142
+ return;
143
+ }
144
+ }
145
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('bannerpro')->__('Unable to find item to save'));
146
+ $this->_redirect('*/*/');
147
+ }
148
+
149
+ public function deleteAction() {
150
+ if( $this->getRequest()->getParam('id') > 0 ) {
151
+ try {
152
+ $model = Mage::getModel('bannerpro/bannerpro');
153
+
154
+ $model->setId($this->getRequest()->getParam('id'))
155
+ ->delete();
156
+
157
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
158
+ $this->_redirect('*/*/');
159
+ } catch (Exception $e) {
160
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
161
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
162
+ }
163
+ }
164
+ $this->_redirect('*/*/');
165
+ }
166
+
167
+ public function massDeleteAction() {
168
+ $bannerproIds = $this->getRequest()->getParam('bannerpro');
169
+ if(!is_array($bannerproIds)) {
170
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
171
+ } else {
172
+ try {
173
+ foreach ($bannerproIds as $bannerproId) {
174
+ $bannerpro = Mage::getModel('bannerpro/bannerpro')->load($bannerproId);
175
+ $bannerpro->delete();
176
+ }
177
+ Mage::getSingleton('adminhtml/session')->addSuccess(
178
+ Mage::helper('adminhtml')->__(
179
+ 'Total of %d record(s) were successfully deleted', count($bannerproIds)
180
+ )
181
+ );
182
+ } catch (Exception $e) {
183
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
184
+ }
185
+ }
186
+ $this->_redirect('*/*/index');
187
+ }
188
+
189
+ public function massStatusAction()
190
+ {
191
+ $bannerproIds = $this->getRequest()->getParam('bannerpro');
192
+ if(!is_array($bannerproIds)) {
193
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
194
+ } else {
195
+ try {
196
+ foreach ($bannerproIds as $bannerproId) {
197
+ $bannerpro = Mage::getSingleton('bannerpro/bannerpro')
198
+ ->load($bannerproId)
199
+ ->setStatus($this->getRequest()->getParam('status'))
200
+ ->setIsMassupdate(true)
201
+ ->save();
202
+ }
203
+ $this->_getSession()->addSuccess(
204
+ $this->__('Total of %d record(s) were successfully updated', count($bannerproIds))
205
+ );
206
+ } catch (Exception $e) {
207
+ $this->_getSession()->addError($e->getMessage());
208
+ }
209
+ }
210
+ $this->_redirect('*/*/index');
211
+ }
212
+
213
+ public function exportCsvAction()
214
+ {
215
+ $fileName = 'bannerpro.csv';
216
+ $content = $this->getLayout()->createBlock('bannerpro/adminhtml_bannerpro_grid')
217
+ ->getCsv();
218
+
219
+ $this->_sendUploadResponse($fileName, $content);
220
+ }
221
+
222
+ public function exportXmlAction()
223
+ {
224
+ $fileName = 'bannerpro.xml';
225
+ $content = $this->getLayout()->createBlock('bannerpro/adminhtml_bannerpro_grid')
226
+ ->getXml();
227
+
228
+ $this->_sendUploadResponse($fileName, $content);
229
+ }
230
+
231
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
232
+ {
233
+ $response = $this->getResponse();
234
+ $response->setHeader('HTTP/1.1 200 OK','');
235
+ $response->setHeader('Pragma', 'public', true);
236
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
237
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
238
+ $response->setHeader('Last-Modified', date('r'));
239
+ $response->setHeader('Accept-Ranges', 'bytes');
240
+ $response->setHeader('Content-Length', strlen($content));
241
+ $response->setHeader('Content-type', $contentType);
242
+ $response->setBody($content);
243
+ $response->sendResponse();
244
+ die;
245
+ }
246
+ }
app/code/local/Perception/Bannerpro/controllers/IndexController.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Perception_Bannerpro_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->renderLayout();
8
+ }
9
+ }
app/code/local/Perception/Bannerpro/etc/config.xml ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Perception_Bannerpro>
5
+ <version>1.0.3</version>
6
+ </Perception_Bannerpro>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <bannerpro>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Perception_Bannerpro</module>
14
+ <frontName>bannerpro</frontName>
15
+ </args>
16
+ </bannerpro>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <bannerpro>
21
+ <file>bannerpro.xml</file>
22
+ </bannerpro>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <bannerpro>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Perception_Bannerpro</module>
32
+ <frontName>bannerpro</frontName>
33
+ </args>
34
+ </bannerpro>
35
+ </routers>
36
+ </admin>
37
+ <default>
38
+ <bannerpro>
39
+ <general>
40
+ <isenabled>1</isenabled>
41
+ </general>
42
+ <columns>
43
+ <showcolumns>id,image,title,status,action</showcolumns>
44
+ <truncatelongtextafter>60</truncatelongtextafter>
45
+ </columns>
46
+ <images>
47
+ <showurl>0</showurl>
48
+ <showbydefault>1</showbydefault>
49
+ <width>75</width>
50
+ <height>75</height>
51
+ </images>
52
+ <defaults>
53
+ <limit>20</limit>
54
+ <page>1</page>
55
+ <sort>id</sort>
56
+ <dir>desc</dir>
57
+ </defaults>
58
+ </bannerpro>
59
+ </default>
60
+ <adminhtml>
61
+ <menu>
62
+ <perception>
63
+ <title>Perception</title>
64
+ <sort_order>71</sort_order>
65
+ <children>
66
+ <bannerpro module="bannerpro">
67
+ <title>Banner Slider</title>
68
+ <sort_order>71</sort_order>
69
+ <children>
70
+ <items module="bannerpro">
71
+ <title>Manage Banners</title>
72
+ <sort_order>0</sort_order>
73
+ <action>bannerpro/adminhtml_bannerpro</action>
74
+ </items>
75
+ </children>
76
+ </bannerpro>
77
+ </children>
78
+ </perception>
79
+ </menu>
80
+ <acl>
81
+ <resources>
82
+ <all>
83
+ <title>Allow Everything</title>
84
+ </all>
85
+ <admin>
86
+ <children>
87
+ <Perception_Bannerpro>
88
+ <title>Bannerpro Module</title>
89
+ <sort_order>10</sort_order>
90
+ </Perception_Bannerpro>
91
+ <system>
92
+ <children>
93
+ <config>
94
+ <children>
95
+ <bannerpro translate="title" module="bannerpro">
96
+ <title>Banner Slider Settings</title>
97
+ <sort_order>50</sort_order>
98
+ </bannerpro>
99
+ </children>
100
+ </config>
101
+ </children>
102
+ </system>
103
+ </children>
104
+ </admin>
105
+ </resources>
106
+ </acl>
107
+ <layout>
108
+ <updates>
109
+ <bannerpro>
110
+ <file>bannerpro.xml</file>
111
+ </bannerpro>
112
+ </updates>
113
+ </layout>
114
+ </adminhtml>
115
+ <global>
116
+ <models>
117
+ <bannerpro>
118
+ <class>Perception_Bannerpro_Model</class>
119
+ <resourceModel>bannerpro_mysql4</resourceModel>
120
+ </bannerpro>
121
+ <bannerpro_mysql4>
122
+ <class>Perception_Bannerpro_Model_Mysql4</class>
123
+ <entities>
124
+ <bannerpro>
125
+ <table>bannerpro</table>
126
+ </bannerpro>
127
+ <bannerpro_store>
128
+ <table>bannerpro_store</table>
129
+ </bannerpro_store>
130
+ </entities>
131
+ </bannerpro_mysql4>
132
+ </models>
133
+ <resources>
134
+ <bannerpro_setup>
135
+ <setup>
136
+ <module>Perception_Bannerpro</module>
137
+ </setup>
138
+ <connection>
139
+ <use>core_setup</use>
140
+ </connection>
141
+ </bannerpro_setup>
142
+ <bannerpro_write>
143
+ <connection>
144
+ <use>core_write</use>
145
+ </connection>
146
+ </bannerpro_write>
147
+ <bannerpro_read>
148
+ <connection>
149
+ <use>core_read</use>
150
+ </connection>
151
+ </bannerpro_read>
152
+ </resources>
153
+ <blocks>
154
+ <bannerpro>
155
+ <class>Perception_Bannerpro_Block</class>
156
+ </bannerpro>
157
+ </blocks>
158
+ <helpers>
159
+ <bannerpro>
160
+ <class>Perception_Bannerpro_Helper</class>
161
+ </bannerpro>
162
+ </helpers>
163
+ <blocks>
164
+ <adminhtml>
165
+ <rewrite>
166
+ <widget_grid_column>Perception_Bannerpro_Block_Widget_Grid_Column</widget_grid_column>
167
+ </rewrite>
168
+ </adminhtml>
169
+ </blocks>
170
+ </global>
171
+ </config>
app/code/local/Perception/Bannerpro/etc/system.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <perception translate="label" module="bannerpro">
5
+ <label>Perception Extenstion</label>
6
+ <sort_order>196</sort_order>
7
+ </perception>
8
+ </tabs>
9
+ <sections>
10
+ <bannerpro translate="label" module="bannerpro">
11
+ <label>Banner Management</label>
12
+ <tab>perception</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>1</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <settings translate="label">
20
+ <label>Banner Management Settings</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>1</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <time_delay translate="label, comment">
28
+ <label>Time Display per Image</label>
29
+ <comment><![CDATA[in second]]></comment>
30
+ <frontend_type>text</frontend_type>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </time_delay>
36
+ <show_description translate="label, comment">
37
+ <label>Show description</label>
38
+ <comment><![CDATA[show description in front of image]]></comment>
39
+ <frontend_type>select</frontend_type>
40
+ <source_model>adminhtml/system_config_source_yesno</source_model>
41
+ <sort_order>2</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ </show_description>
46
+ <!--<effect translate="label, comment">
47
+ <label>Effect</label>
48
+ <comment><![CDATA[image effect]]></comment>
49
+ <frontend_type>select</frontend_type>
50
+ <source_model>bannerpro/system_config_source_effect</source_model>
51
+ <sort_order>15</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ </effect>-->
56
+ </fields>
57
+ </settings>
58
+ </groups>
59
+ </bannerpro>
60
+ </sections>
61
+ </config>
app/code/local/Perception/Bannerpro/sql/bannerpro_setup/mysql4-install-1.0.3.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->run("
6
+
7
+ DROP TABLE IF EXISTS {$this->getTable('bannerpro')};
8
+ CREATE TABLE {$this->getTable('bannerpro')} (
9
+ `bannerpro_id` int(11) unsigned NOT NULL auto_increment,
10
+ `title` varchar(255) NOT NULL default '',
11
+ `image_thumb` varchar(255) NOT NULL default '',
12
+ `filename` varchar(255) NOT NULL default '',
13
+ `text` text NULL,
14
+ `effects` varchar(255) NOT NULL default '',
15
+ `sorting_order` int(11) NOT NULL default '0',
16
+ `status` smallint(6) NOT NULL default '0',
17
+ `weblink` varchar(255) NULL,
18
+ `created_time` datetime NULL,
19
+ `update_time` datetime NULL,
20
+ PRIMARY KEY (`bannerpro_id`)
21
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
22
+
23
+ DROP TABLE IF EXISTS {$this->getTable('bannerpro_store')};
24
+ CREATE TABLE {$this->getTable('bannerpro_store')} (
25
+ `bannerpro_id` smallint(6) NOT NULL,
26
+ `store_id` smallint(5) unsigned NOT NULL,
27
+ PRIMARY KEY (`bannerpro_id`,`store_id`)
28
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='CMS Profiles to Stores';");
29
+
30
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/bannerpro.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <bannerpro_adminhtml_bannerpro_index>
4
+ <reference name="content">
5
+ <block type="bannerpro/adminhtml_bannerpro" name="bannerpro" />
6
+ </reference>
7
+ </bannerpro_adminhtml_bannerpro_index>
8
+ </layout>
app/design/frontend/default/default/layout/bannerpro.xml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addItem"><type>skin_js</type><name>banner/bannerpro.js</name></action>
6
+ <action method="addItem"><type>skin_js</type><name>banner/banner_effects.js</name></action>
7
+ <action method="addItem"><type>skin_css</type><name>banner/bannerpro.css</name></action>
8
+ </reference>
9
+ </default>
10
+ <bannerpro_index_index>
11
+ <reference name="content">
12
+ <block type="bannerpro/bannerpro" name="bannerpro" template="bannerpro/bannerpro.phtml" />
13
+ </reference>
14
+ </bannerpro_index_index>
15
+ </layout>
app/design/frontend/default/default/template/bannerpro/bannerpro.phtml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $bannerCollection = Mage::getModel('bannerpro/bannerpro')->getCollection()->addStoreFilter()->addFieldToFilter('status','1');
3
+ $configData = Mage::getStoreConfig('bannerpro');
4
+ $i = 1;
5
+ ?>
6
+ <div id="top_banner" style="padding: 0px; background: transparent none repeat scroll 0% 0%; position: relative;">
7
+ <div id="divSimpleSlider">
8
+ <?php foreach ($bannerCollection as $banner): $effects .= $banner['effects'].", "; ?>
9
+ <div class="banner-images"><a href="<?php echo $banner['weblink'] ?>" title="<?php echo $banner['weblink'] ?>">
10
+ <img title="<?php echo $banner['title']?>" alt="<?php echo $banner['title']?>" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . $banner['filename']?>"/></a>
11
+ <?php if ($configData['settings']['show_description'] == '1' && $banner['text'] != ""):?>
12
+ <div class="banner_content">
13
+ <?php echo $banner['text']; ?><?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('banner-content')->toHtml();?>
14
+ </div>
15
+ <?php endif; ?>
16
+ </div>
17
+ <?php
18
+ $i++;
19
+ endforeach;
20
+ ?>
21
+ </div>
22
+ <a class="learn-more" href="javascript:void(0);"></a>
23
+ <div class="control" id="control">
24
+ <a id="pause_btn" class="pause" title="Pause"></a>
25
+ <a id="play_btn" class="no-display" title="Play"></a>
26
+ </div>
27
+ <ul class="navigate">
28
+ <li class="prev"><a href="#" title="Previous"></a></li>
29
+ <li class="next"><a href="#" title="Next"></a></li>
30
+ </ul>
31
+ <div class="banner_down">
32
+ <div id="divSimpleSliderRotate"></div>
33
+ </div>
34
+
35
+ </div>
36
+ <div class="clear"></div>
37
+ <script type="text/javascript">
38
+ // <![CDATA[
39
+ $bn2(document).ready(function() {
40
+ var slider = $bn2("#divSimpleSlider").cycle({
41
+ fx: '<?php echo $effects; ?>',
42
+ speed: 1000,
43
+ timeout: 4000,
44
+ prev: '.prev',
45
+ next: '.next',
46
+ pager: '#divSimpleSliderRotate',
47
+ pagerEvent: 'click',
48
+ fastOnEvent: false,
49
+ pause: 0,
50
+ pause_btn: '#pause_btn',
51
+ play_btn: '#play_btn',
52
+ randomizeEffects: false,
53
+ });
54
+ });
55
+ $bn2('#pause_btn').click(function() {
56
+ $bn2('#divSimpleSlider').cycle('pause');
57
+ document.getElementById('pause_btn').className = 'no-display';
58
+ document.getElementById('play_btn').className = 'play';
59
+ });
60
+
61
+ $bn2('#play_btn').click(function() {
62
+ $bn2('#divSimpleSlider').cycle('resume');
63
+ document.getElementById('play_btn').className = 'no-display';
64
+ document.getElementById('pause_btn').className = 'pause';
65
+ });
66
+ // ]]>
67
+ </script>
app/etc/modules/Perception_Bannerpro.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Perception_Bannerpro>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Perception_Bannerpro>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Perception_Bannerpro</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL-3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This Extension allows to manage unlimited banners</summary>
10
+ <description>All in One Banner Pro &#x2013; Magento Extension by Perception System&#xD;
11
+ &#xD;
12
+ All in One Banner Pro Extension allows you to manage unlimited banners with list of sliding effects with attractive and effective look of site Home page.&#xD;
13
+ &#xD;
14
+ Why All in One Banner Pro &#x2013; Magento Extension?&#xD;
15
+ &#xD;
16
+ Do you want to add Advertising Banners in your website? Do you want effective look of your website with number of sliding effects? All in One Banner Pro extension can assist you more than that! This module allows you to add unlimited banners with list of valuable features noted below&#xD;
17
+ &#xD;
18
+ 1. Support Multi store, Multi lingual &#x2013; Allows to create banners for specific store view&#xD;
19
+ &#xD;
20
+ 2. Support 26 Sliding effects &#xD;
21
+ Blind X, Blind Y, Blind Z, Cover, Curtain X, Curtain Y, Fade, Fade Zoom, Grow X, Grow Y, Scroll Up, Scroll Down, Scroll Left, Scroll Right, Scroll Horizontal, Scroll Vertical, Shuffle, Toss, Turn Up, Turn Down, Turn Left, Turn Right, Uncover, Wipe, Zoom&#xD;
22
+ &#xD;
23
+ 3. Allows Dynamic Content management on Banners with Title and Banner Description.&#xD;
24
+ &#xD;
25
+ 4. Easy Banner sorting list.&#xD;
26
+ &#xD;
27
+ 5. Clickable Banners &#x2013; Support Banner URL.&#xD;
28
+ &#xD;
29
+ 6. Backend Management &#x2013; Allow managing Banners with Insert, Update, and Delete.&#xD;
30
+ &#xD;
31
+ 7. Open source 100%.&#xD;
32
+ &#xD;
33
+ 8. Easy to install and configure.&#xD;
34
+ &#xD;
35
+ 9. User friendly Interface.&#xD;
36
+ &#xD;
37
+ Follow Steps for Installation and Configuration &#xD;
38
+ Copy stuff from the source and Paste directly on your root directory of Website - System will automatically place all necessary files and directories on required place to continue with this extension,&#xD;
39
+ &#xD;
40
+ To Display this Block on CMS Page - Add this block declaration {{block type="bannerslider/bannerslider" name="bannerslider" template="bannerslider/bannerslider.phtml"}} in Any CMS page from Admin.</description>
41
+ <notes>First Release&#xD;
42
+ &#xD;
43
+ All in One Banner Pro &#x2013; Magento Extension by Perception System&#xD;
44
+ &#xD;
45
+ All in One Banner Pro Extension allows you to manage unlimited banners with list of sliding effects will make up your site effective and attractive in look.&#xD;
46
+ &#xD;
47
+ Support 26 effects with jQuery&#xD;
48
+ &#xD;
49
+ Blind X, Blind Y, Blind Z, Cover, Curtain X, Curtain Y, Fade, Fade Zoom, Grow X, Grow Y, Scroll Up, Scroll Down, Scroll Left, Scroll Right, Scroll Horizontal, Scroll Vertical, Shuffle, Toss, Turn Up, Turn Down, Turn Left, Turn Right, Uncover, Wipe, Zoom</notes>
50
+ <authors><author><name>Perception</name><user>auto-converted</user><email>tarang@perceptionsystem.com</email></author></authors>
51
+ <date>2013-01-01</date>
52
+ <time>07:40:09</time>
53
+ <contents><target name="magelocal"><dir name="Perception"><dir name="Bannerpro"><dir name="Block"><dir name="Adminhtml"><dir name="Bannerpro"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="41c9c50b6584c1d9b3971bcaaa719cdb"/></dir><file name="Form.php" hash="0cb756b54788b9c28296a9d82761cff1"/><file name="Tabs.php" hash="3ae0f322defc4e3273fb36e446377ce5"/></dir><file name="Edit.php" hash="7119b65e265c1f16216cc8b30f9b3be4"/><file name="Grid.php" hash="b2be8d07124f94799f08a1ae7f20e63f"/></dir><dir name="Grid"><dir name="Renderer"><file name="Image.php" hash="d68a90baf887ab74e62d3fd0424dae89"/></dir></dir><file name="Bannerpro.php" hash="823077939a9a69dd453153ead306a334"/></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Filter"><file name="Image.php" hash="26c1d8d6c4982fb96dc68d9e4c8e6898"/></dir><dir name="Renderer"><file name="Action.php" hash="67da9d1e599d03f09040875fae22c3be"/><file name="Image.php" hash="fc2106b8338943fb6a7a139ad4ca6983"/></dir></dir><file name="Column.php" hash="25c746da2f3ce51ee40da93316057444"/></dir></dir><file name="Bannerpro.php" hash="f899c6526ddec4ff10d252076e10366b"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannerproController.php" hash="fd5a0005a6b1a46f18dde3dbc22e2230"/></dir><file name="IndexController.php" hash="0a7aa9e63a06a6e5f5535e0000e7e4d6"/></dir><dir name="etc"><file name="config.xml" hash="bece3595164368e6560920629e7521a6"/><file name="system.xml" hash="f49069b525b401422c073bbc3bd43ec8"/></dir><dir name="Helper"><dir name="Wysiwyg"><file name="Images.php" hash="d003d07bc253202bed88cae5a3c830b6"/></dir><file name="Data.php" hash="cc2aaac213b802569b4f92352cd4a145"/><file name="Image.php" hash="c11bc7b3026cceb1408228c65cda94e8"/></dir><dir name="Model"><dir name="Entity"><dir name="Attribute"><dir name="Source"><dir name="Boolean"><file name="Config.php" hash="c3dc31bc0e8a7ba77b2326fe4617bd9b"/></dir></dir></dir></dir><dir name="Mysql4"><dir name="Bannerpro"><file name="Collection.php" hash="ea8176a20f7514b11f43d2dc4945f04c"/></dir><file name="Bannerpro.php" hash="7f3cf13e27b309285aa5ba0274535575"/></dir><dir name="System"><dir name="Backend"><file name="Links.php" hash="6cc70f3272bd7e737c7b467ccd346cd3"/></dir><dir name="Config"><dir name="Source"><file name="Effect.php" hash="835d1cf695f7546f74d490fb408274ba"/></dir></dir></dir><dir name="Wysiwyg"><dir name="Images"><dir name="Storage"><file name="Collection.php" hash="1cb2bf3190f92a93b0ddd9f9aa2751bf"/></dir><file name="Storage.php" hash="94c39b8f54357ac3e31c0aeec4572406"/></dir><file name="Config.php" hash="f029863da2aee82dd6209218beef1442"/></dir><file name="Status.php" hash="80eb332156be6e55a6f74f61d8731c0a"/><file name="Image.php" hash="d826b6cd0b46ff5932f22753aa61c58a"/><file name="Bannerpro.php" hash="662e55180c900170155b6bde157280c2"/></dir><dir name="sql"><dir name="bannerpro_setup"><file name="mysql4-install-1.0.3.php" hash="111ce9f0b3ac42f3f97eb78efb0bed8e"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="bannerpro.xml" hash="e79e904e07211ccca52519d1ebd798b8"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="bannerpro.xml" hash="147a707f9f383201d109cb5e510f0bff"/></dir><dir name="template"><dir name="bannerpro"><file name="bannerpro.phtml" hash="f21452aa434e10be5ed082755cbb028e"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Perception_Bannerpro.xml" hash="a1eea61529056f4ae7dc48fc774883b7"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="banner"><dir name="images"><file name="next-prev-btn.png" hash="f6300a1bafe436cec7c573a1fb35d71d"/><file name="pause.png" hash="40e4bdb63d600638ebf3cef86e09b35e"/><file name="play.png" hash="75c7a42ba1ecc7ce61a9952d97f86faf"/></dir><file name="banner_effects.js" hash="33483415fe699c1c7df27a2fcb95eb9a"/><file name="bannerpro.css" hash="98d9a5559367516a04e1c9c201cdbc69"/><file name="bannerpro.js" hash="b0018c7b9088375db12a272c3254f7ac"/></dir></dir></dir></dir></target></contents>
54
+ <compatible/>
55
+ <dependencies/>
56
+ </package>
skin/frontend/default/default/banner/banner_effects.js ADDED
@@ -0,0 +1,1567 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Cycle Plugin (with Transition Definitions)
3
+ * Examples and documentation at: http://jquery.malsup.com/cycle/
4
+ * Copyright (c) 2007-2010 M. Alsup
5
+ * Version: 2.86 (05-APR-2010)
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl.html
9
+ * Requires: jQuery v1.2.6 or later
10
+ */
11
+ (function($bn2) {
12
+ var ver = "2.86";
13
+ if ($bn2.support == undefined) {
14
+ $bn2.support = {
15
+ opacity : !($bn2.browser.msie)
16
+ };
17
+ }
18
+ function debug(s) {
19
+ if ($bn2.fn.cycle.debug) {
20
+ log(s);
21
+ }
22
+ }
23
+ function log() {
24
+ if (window.console && window.console.log) {
25
+ //Ashok
26
+ //window.console.log("[cycle] "
27
+ //+ Array.prototype.join.call(arguments, " "));
28
+ }
29
+ }
30
+ $bn2.fn.cycle = function(options, arg2) {
31
+ var o = {
32
+ s : this.selector,
33
+ c : this.context
34
+ };
35
+ if (this.length === 0 && options != "stop") {
36
+ if (!$bn2.isReady && o.s) {
37
+ log("DOM not ready, queuing slideshow");
38
+ $bn2(function() {
39
+ $bn2(o.s, o.c).cycle(options, arg2);
40
+ });
41
+ return this;
42
+ }
43
+ log("terminating; zero elements found by selector"
44
+ + ($bn2.isReady ? "" : " (DOM not ready)"));
45
+ return this;
46
+ }
47
+ return this.each(function() {
48
+ var opts = handleArguments(this, options, arg2);
49
+ if (opts === false) {
50
+ return;
51
+ }
52
+ opts.updateActivePagerLink = opts.updateActivePagerLink
53
+ || $bn2.fn.cycle.updateActivePagerLink;
54
+ if (this.cycleTimeout) {
55
+ clearTimeout(this.cycleTimeout);
56
+ }
57
+ this.cycleTimeout = this.cyclePause = 0;
58
+ var $bn2cont = $bn2(this);
59
+ var $bn2slides = opts.slideExpr ? $bn2(opts.slideExpr, this)
60
+ : $bn2cont.children();
61
+ var els = $bn2slides.get();
62
+ if (els.length < 2) {
63
+ log("terminating; too few slides: " + els.length);
64
+ return;
65
+ }
66
+ var opts2 = buildOptions($bn2cont, $bn2slides, els, opts, o);
67
+ if (opts2 === false) {
68
+ return;
69
+ }
70
+ var startTime = opts2.continuous ? 10 : getTimeout(opts2.currSlide,
71
+ opts2.nextSlide, opts2, !opts2.rev);
72
+ if (startTime) {
73
+ startTime += (opts2.delay || 0);
74
+ if (startTime < 10) {
75
+ startTime = 10;
76
+ }
77
+ debug("first timeout: " + startTime);
78
+ this.cycleTimeout = setTimeout(function() {
79
+ go(els, opts2, 0, !opts2.rev);
80
+ }, startTime);
81
+ }
82
+ });
83
+ };
84
+ function handleArguments(cont, options, arg2) {
85
+ if (cont.cycleStop == undefined) {
86
+ cont.cycleStop = 0;
87
+ }
88
+ if (options === undefined || options === null) {
89
+ options = {};
90
+ }
91
+ if (options.constructor == String) {
92
+ switch (options) {
93
+ case "destroy":
94
+ case "stop":
95
+ var opts = $bn2(cont).data("cycle.opts");
96
+ if (!opts) {
97
+ return false;
98
+ }
99
+ cont.cycleStop++;
100
+ if (cont.cycleTimeout) {
101
+ clearTimeout(cont.cycleTimeout);
102
+ }
103
+ cont.cycleTimeout = 0;
104
+ $bn2(cont).removeData("cycle.opts");
105
+ if (options == "destroy") {
106
+ destroy(opts);
107
+ }
108
+ return false;
109
+ case "toggle":
110
+ cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1;
111
+ checkInstantResume(cont.cyclePause, arg2, cont);
112
+ return false;
113
+ case "pause":
114
+ cont.cyclePause = 1;
115
+ return false;
116
+ case "resume":
117
+ cont.cyclePause = 0;
118
+ checkInstantResume(false, arg2, cont);
119
+ return false;
120
+ case "prev":
121
+ case "next":
122
+ var opts = $bn2(cont).data("cycle.opts");
123
+ if (!opts) {
124
+ log('options not found, "prev/next" ignored');
125
+ return false;
126
+ }
127
+ $bn2.fn.cycle[options](opts);
128
+ return false;
129
+ default:
130
+ options = {
131
+ fx : options
132
+ };
133
+ }
134
+ return options;
135
+ } else {
136
+ if (options.constructor == Number) {
137
+ var num = options;
138
+ options = $bn2(cont).data("cycle.opts");
139
+ if (!options) {
140
+ log("options not found, can not advance slide");
141
+ return false;
142
+ }
143
+ if (num < 0 || num >= options.elements.length) {
144
+ log("invalid slide index: " + num);
145
+ return false;
146
+ }
147
+ options.nextSlide = num;
148
+ if (cont.cycleTimeout) {
149
+ clearTimeout(cont.cycleTimeout);
150
+ cont.cycleTimeout = 0;
151
+ }
152
+ if (typeof arg2 == "string") {
153
+ options.oneTimeFx = arg2;
154
+ }
155
+ go(options.elements, options, 1, num >= options.currSlide);
156
+ return false;
157
+ }
158
+ }
159
+ return options;
160
+ function checkInstantResume(isPaused, arg2, cont) {
161
+ if (!isPaused && arg2 === true) {
162
+ var options = $bn2(cont).data("cycle.opts");
163
+ if (!options) {
164
+ log("options not found, can not resume");
165
+ return false;
166
+ }
167
+ if (cont.cycleTimeout) {
168
+ clearTimeout(cont.cycleTimeout);
169
+ cont.cycleTimeout = 0;
170
+ }
171
+ go(options.elements, options, 1, 1);
172
+ }
173
+ }
174
+ }
175
+ function removeFilter(el, opts) {
176
+ if (!$bn2.support.opacity && opts.cleartype && el.style.filter) {
177
+ try {
178
+ el.style.removeAttribute("filter");
179
+ } catch (smother) {
180
+ }
181
+ }
182
+ }
183
+ function destroy(opts) {
184
+ if (opts.next) {
185
+ $bn2(opts.next).unbind(opts.prevNextEvent);
186
+ }
187
+ if (opts.prev) {
188
+ $bn2(opts.prev).unbind(opts.prevNextEvent);
189
+ }
190
+ if (opts.pager || opts.pagerAnchorBuilder) {
191
+ $bn2.each(opts.pagerAnchors || [], function() {
192
+ this.unbind().remove();
193
+ });
194
+ }
195
+ opts.pagerAnchors = null;
196
+ if (opts.destroy) {
197
+ opts.destroy(opts);
198
+ }
199
+ }
200
+ function buildOptions($bn2cont, $bn2slides, els, options, o) {
201
+ var opts = $bn2.extend( {}, $bn2.fn.cycle.defaults, options || {},
202
+ $bn2.metadata ? $bn2cont.metadata() : $bn2.meta ? $bn2cont
203
+ .data() : {});
204
+ if (opts.autostop) {
205
+ opts.countdown = opts.autostopCount || els.length;
206
+ }
207
+ var cont = $bn2cont[0];
208
+ $bn2cont.data("cycle.opts", opts);
209
+ opts.$bn2cont = $bn2cont;
210
+ opts.stopCount = cont.cycleStop;
211
+ opts.elements = els;
212
+ opts.before = opts.before ? [ opts.before ] : [];
213
+ opts.after = opts.after ? [ opts.after ] : [];
214
+ opts.after.unshift(function() {
215
+ opts.busy = 0;
216
+ });
217
+ if (!$bn2.support.opacity && opts.cleartype) {
218
+ opts.after.push(function() {
219
+ removeFilter(this, opts);
220
+ });
221
+ }
222
+ if (opts.continuous) {
223
+ opts.after.push(function() {
224
+ go(els, opts, 0, !opts.rev);
225
+ });
226
+ }
227
+ saveOriginalOpts(opts);
228
+ if (!$bn2.support.opacity && opts.cleartype && !opts.cleartypeNoBg) {
229
+ clearTypeFix($bn2slides);
230
+ }
231
+ if ($bn2cont.css("position") == "static") {
232
+ $bn2cont.css("position", "relative");
233
+ }
234
+ if (opts.width) {
235
+ $bn2cont.width(opts.width);
236
+ }
237
+ if (opts.height && opts.height != "auto") {
238
+ $bn2cont.height(opts.height);
239
+ }
240
+ if (opts.startingSlide) {
241
+ opts.startingSlide = parseInt(opts.startingSlide);
242
+ }
243
+ if (opts.random) {
244
+ opts.randomMap = [];
245
+ for ( var i = 0; i < els.length; i++) {
246
+ opts.randomMap.push(i);
247
+ }
248
+ opts.randomMap.sort(function(a, b) {
249
+ return Math.random() - 0.5;
250
+ });
251
+ opts.randomIndex = 1;
252
+ opts.startingSlide = opts.randomMap[1];
253
+ } else {
254
+ if (opts.startingSlide >= els.length) {
255
+ opts.startingSlide = 0;
256
+ }
257
+ }
258
+ opts.currSlide = opts.startingSlide || 0;
259
+ var first = opts.startingSlide;
260
+ $bn2slides.css( {
261
+ position : "absolute",
262
+ top : 0,
263
+ left : 0
264
+ }).hide().each(
265
+ function(i) {
266
+ var z = first ? i >= first ? els.length - (i - first)
267
+ : first - i : els.length - i;
268
+ $bn2(this).css("z-index", z);
269
+ });
270
+ $bn2(els[first]).css("opacity", 1).show();
271
+ removeFilter(els[first], opts);
272
+ if (opts.fit && opts.width) {
273
+ $bn2slides.width(opts.width);
274
+ }
275
+ if (opts.fit && opts.height && opts.height != "auto") {
276
+ $bn2slides.height(opts.height);
277
+ }
278
+ var reshape = opts.containerResize && !$bn2cont.innerHeight();
279
+ if (reshape) {
280
+ var maxw = 0, maxh = 0;
281
+ for ( var j = 0; j < els.length; j++) {
282
+ var $bn2e = $bn2(els[j]), e = $bn2e[0], w = $bn2e.outerWidth(), h = $bn2e
283
+ .outerHeight();
284
+ if (!w) {
285
+ w = e.offsetWidth || e.width || $bn2e.attr("width");
286
+ }
287
+ if (!h) {
288
+ h = e.offsetHeight || e.height || $bn2e.attr("height");
289
+ }
290
+ maxw = w > maxw ? w : maxw;
291
+ maxh = h > maxh ? h : maxh;
292
+ }
293
+ if (maxw > 0 && maxh > 0) {
294
+ $bn2cont.css( {
295
+ width : maxw + "px",
296
+ height : maxh + "px"
297
+ });
298
+ }
299
+ }
300
+ if (opts.pause) {
301
+ $bn2cont.hover(function() {
302
+ this.cyclePause++;
303
+ }, function() {
304
+ this.cyclePause--;
305
+ });
306
+ }
307
+ if (supportMultiTransitions(opts) === false) {
308
+ return false;
309
+ }
310
+ var requeue = false;
311
+ options.requeueAttempts = options.requeueAttempts || 0;
312
+ $bn2slides
313
+ .each(function() {
314
+ var $bn2el = $bn2(this);
315
+ this.cycleH = (opts.fit && opts.height) ? opts.height
316
+ : ($bn2el.height() || this.offsetHeight
317
+ || this.height || $bn2el.attr("height") || 0);
318
+ this.cycleW = (opts.fit && opts.width) ? opts.width
319
+ : ($bn2el.width() || this.offsetWidth || this.width
320
+ || $bn2el.attr("width") || 0);
321
+ if ($bn2el.is("img")) {
322
+ var loadingIE = ($bn2.browser.msie && this.cycleW == 28
323
+ && this.cycleH == 30 && !this.complete);
324
+ var loadingFF = ($bn2.browser.mozilla
325
+ && this.cycleW == 34 && this.cycleH == 19 && !this.complete);
326
+ var loadingOp = ($bn2.browser.opera
327
+ && ((this.cycleW == 42 && this.cycleH == 19) || (this.cycleW == 37 && this.cycleH == 17)) && !this.complete);
328
+ var loadingOther = (this.cycleH == 0
329
+ && this.cycleW == 0 && !this.complete);
330
+ if (loadingIE || loadingFF || loadingOp || loadingOther) {
331
+ if (o.s && opts.requeueOnImageNotLoaded
332
+ && ++options.requeueAttempts < 100) {
333
+ log(
334
+ options.requeueAttempts,
335
+ " - img slide not loaded, requeuing slideshow: ",
336
+ this.src, this.cycleW, this.cycleH);
337
+ setTimeout(function() {
338
+ $bn2(o.s, o.c).cycle(options);
339
+ }, opts.requeueTimeout);
340
+ requeue = true;
341
+ return false;
342
+ } else {
343
+ log("could not determine size of image: "
344
+ + this.src, this.cycleW, this.cycleH);
345
+ }
346
+ }
347
+ }
348
+ return true;
349
+ });
350
+ if (requeue) {
351
+ return false;
352
+ }
353
+ opts.cssBefore = opts.cssBefore || {};
354
+ opts.animIn = opts.animIn || {};
355
+ opts.animOut = opts.animOut || {};
356
+ $bn2slides.not(":eq(" + first + ")").css(opts.cssBefore);
357
+ if (opts.cssFirst) {
358
+ $bn2($bn2slides[first]).css(opts.cssFirst);
359
+ }
360
+ if (opts.timeout) {
361
+ opts.timeout = parseInt(opts.timeout);
362
+ if (opts.speed.constructor == String) {
363
+ opts.speed = $bn2.fx.speeds[opts.speed] || parseInt(opts.speed);
364
+ }
365
+ if (!opts.sync) {
366
+ opts.speed = opts.speed / 2;
367
+ }
368
+ var buffer = opts.fx == "shuffle" ? 500 : 250;
369
+ while ((opts.timeout - opts.speed) < buffer) {
370
+ opts.timeout += opts.speed;
371
+ }
372
+ }
373
+ if (opts.easing) {
374
+ opts.easeIn = opts.easeOut = opts.easing;
375
+ }
376
+ if (!opts.speedIn) {
377
+ opts.speedIn = opts.speed;
378
+ }
379
+ if (!opts.speedOut) {
380
+ opts.speedOut = opts.speed;
381
+ }
382
+ opts.slideCount = els.length;
383
+ opts.currSlide = opts.lastSlide = first;
384
+ if (opts.random) {
385
+ if (++opts.randomIndex == els.length) {
386
+ opts.randomIndex = 0;
387
+ }
388
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
389
+ } else {
390
+ opts.nextSlide = opts.startingSlide >= (els.length - 1) ? 0
391
+ : opts.startingSlide + 1;
392
+ }
393
+ if (!opts.multiFx) {
394
+ var init = $bn2.fn.cycle.transitions[opts.fx];
395
+ if ($bn2.isFunction(init)) {
396
+ init($bn2cont, $bn2slides, opts);
397
+ } else {
398
+ if (opts.fx != "custom" && !opts.multiFx) {
399
+ log("unknown transition: " + opts.fx,
400
+ "; slideshow terminating");
401
+ return false;
402
+ }
403
+ }
404
+ }
405
+ var e0 = $bn2slides[first];
406
+ if (opts.before.length) {
407
+ opts.before[0].apply(e0, [ e0, e0, opts, true ]);
408
+ }
409
+ if (opts.after.length > 1) {
410
+ opts.after[1].apply(e0, [ e0, e0, opts, true ]);
411
+ }
412
+ if (opts.next) {
413
+ $bn2(opts.next).bind(opts.prevNextEvent, function() {
414
+ return advance(opts, opts.rev ? -1 : 1);
415
+ });
416
+ }
417
+ if (opts.prev) {
418
+ $bn2(opts.prev).bind(opts.prevNextEvent, function() {
419
+ return advance(opts, opts.rev ? 1 : -1);
420
+ });
421
+ }
422
+ if (opts.pager || opts.pagerAnchorBuilder) {
423
+ buildPager(els, opts);
424
+ }
425
+ exposeAddSlide(opts, els);
426
+ return opts;
427
+ }
428
+ function saveOriginalOpts(opts) {
429
+ opts.original = {
430
+ before : [],
431
+ after : []
432
+ };
433
+ opts.original.cssBefore = $bn2.extend( {}, opts.cssBefore);
434
+ opts.original.cssAfter = $bn2.extend( {}, opts.cssAfter);
435
+ opts.original.animIn = $bn2.extend( {}, opts.animIn);
436
+ opts.original.animOut = $bn2.extend( {}, opts.animOut);
437
+ $bn2.each(opts.before, function() {
438
+ opts.original.before.push(this);
439
+ });
440
+ $bn2.each(opts.after, function() {
441
+ opts.original.after.push(this);
442
+ });
443
+ }
444
+ function supportMultiTransitions(opts) {
445
+ var i, tx, txs = $bn2.fn.cycle.transitions;
446
+ if (opts.fx.indexOf(",") > 0) {
447
+ opts.multiFx = true;
448
+ opts.fxs = opts.fx.replace(/\s*/g, "").split(",");
449
+ for (i = 0; i < opts.fxs.length; i++) {
450
+ var fx = opts.fxs[i];
451
+ tx = txs[fx];
452
+ if (!tx || !txs.hasOwnProperty(fx) || !$bn2.isFunction(tx)) {
453
+ log("discarding unknown transition: ", fx);
454
+ opts.fxs.splice(i, 1);
455
+ i--;
456
+ }
457
+ }
458
+ if (!opts.fxs.length) {
459
+ log("No valid transitions named; slideshow terminating.");
460
+ return false;
461
+ }
462
+ } else {
463
+ if (opts.fx == "all") {
464
+ opts.multiFx = true;
465
+ opts.fxs = [];
466
+ for (p in txs) {
467
+ tx = txs[p];
468
+ if (txs.hasOwnProperty(p) && $bn2.isFunction(tx)) {
469
+ opts.fxs.push(p);
470
+ }
471
+ }
472
+ }
473
+ }
474
+ if (opts.multiFx && opts.randomizeEffects) {
475
+ var r1 = Math.floor(Math.random() * 20) + 30;
476
+ for (i = 0; i < r1; i++) {
477
+ var r2 = Math.floor(Math.random() * opts.fxs.length);
478
+ opts.fxs.push(opts.fxs.splice(r2, 1)[0]);
479
+ }
480
+ debug("randomized fx sequence: ", opts.fxs);
481
+ }
482
+ return true;
483
+ }
484
+ function exposeAddSlide(opts, els) {
485
+ opts.addSlide = function(newSlide, prepend) {
486
+ var $bn2s = $bn2(newSlide), s = $bn2s[0];
487
+ if (!opts.autostopCount) {
488
+ opts.countdown++;
489
+ }
490
+ els[prepend ? "unshift" : "push"](s);
491
+ if (opts.els) {
492
+ opts.els[prepend ? "unshift" : "push"](s);
493
+ }
494
+ opts.slideCount = els.length;
495
+ $bn2s.css("position", "absolute");
496
+ $bn2s[prepend ? "prependTo" : "appendTo"](opts.$bn2cont);
497
+ if (prepend) {
498
+ opts.currSlide++;
499
+ opts.nextSlide++;
500
+ }
501
+ if (!$bn2.support.opacity && opts.cleartype && !opts.cleartypeNoBg) {
502
+ clearTypeFix($bn2s);
503
+ }
504
+ if (opts.fit && opts.width) {
505
+ $bn2s.width(opts.width);
506
+ }
507
+ if (opts.fit && opts.height && opts.height != "auto") {
508
+ $bn2slides.height(opts.height);
509
+ }
510
+ s.cycleH = (opts.fit && opts.height) ? opts.height : $bn2s.height();
511
+ s.cycleW = (opts.fit && opts.width) ? opts.width : $bn2s.width();
512
+ $bn2s.css(opts.cssBefore);
513
+ if (opts.pager || opts.pagerAnchorBuilder) {
514
+ $bn2.fn.cycle.createPagerAnchor(els.length - 1, s,
515
+ $bn2(opts.pager), els, opts);
516
+ }
517
+ if ($bn2.isFunction(opts.onAddSlide)) {
518
+ opts.onAddSlide($bn2s);
519
+ } else {
520
+ $bn2s.hide();
521
+ }
522
+ };
523
+ }
524
+ $bn2.fn.cycle.resetState = function(opts, fx) {
525
+ fx = fx || opts.fx;
526
+ opts.before = [];
527
+ opts.after = [];
528
+ opts.cssBefore = $bn2.extend( {}, opts.original.cssBefore);
529
+ opts.cssAfter = $bn2.extend( {}, opts.original.cssAfter);
530
+ opts.animIn = $bn2.extend( {}, opts.original.animIn);
531
+ opts.animOut = $bn2.extend( {}, opts.original.animOut);
532
+ opts.fxFn = null;
533
+ $bn2.each(opts.original.before, function() {
534
+ opts.before.push(this);
535
+ });
536
+ $bn2.each(opts.original.after, function() {
537
+ opts.after.push(this);
538
+ });
539
+ var init = $bn2.fn.cycle.transitions[fx];
540
+ if ($bn2.isFunction(init)) {
541
+ init(opts.$bn2cont, $bn2(opts.elements), opts);
542
+ }
543
+ };
544
+ function go(els, opts, manual, fwd) {
545
+ if (manual && opts.busy && opts.manualTrump) {
546
+ debug("manualTrump in go(), stopping active transition");
547
+ $bn2(els).stop(true, true);
548
+ opts.busy = false;
549
+ }
550
+ if (opts.busy) {
551
+ debug("transition active, ignoring new tx request");
552
+ return;
553
+ }
554
+ var p = opts.$bn2cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];
555
+ if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual) {
556
+ return;
557
+ }
558
+ if (!manual
559
+ && !p.cyclePause
560
+ && ((opts.autostop && (--opts.countdown <= 0)) || (opts.nowrap
561
+ && !opts.random && opts.nextSlide < opts.currSlide))) {
562
+ if (opts.end) {
563
+ opts.end(opts);
564
+ }
565
+ return;
566
+ }
567
+ var changed = false;
568
+ if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) {
569
+ changed = true;
570
+ var fx = opts.fx;
571
+ curr.cycleH = curr.cycleH || $bn2(curr).height();
572
+ curr.cycleW = curr.cycleW || $bn2(curr).width();
573
+ next.cycleH = next.cycleH || $bn2(next).height();
574
+ next.cycleW = next.cycleW || $bn2(next).width();
575
+ if (opts.multiFx) {
576
+ if (opts.lastFx == undefined
577
+ || ++opts.lastFx >= opts.fxs.length) {
578
+ opts.lastFx = 0;
579
+ }
580
+ fx = opts.fxs[opts.lastFx];
581
+ opts.currFx = fx;
582
+ }
583
+ if (opts.oneTimeFx) {
584
+ fx = opts.oneTimeFx;
585
+ opts.oneTimeFx = null;
586
+ }
587
+ $bn2.fn.cycle.resetState(opts, fx);
588
+ if (opts.before.length) {
589
+ $bn2.each(opts.before, function(i, o) {
590
+ if (p.cycleStop != opts.stopCount) {
591
+ return;
592
+ }
593
+ o.apply(next, [ curr, next, opts, fwd ]);
594
+ });
595
+ }
596
+ var after = function() {
597
+ $bn2.each(opts.after, function(i, o) {
598
+ if (p.cycleStop != opts.stopCount) {
599
+ return;
600
+ }
601
+ o.apply(next, [ curr, next, opts, fwd ]);
602
+ });
603
+ };
604
+ debug("tx firing; currSlide: " + opts.currSlide + "; nextSlide: "
605
+ + opts.nextSlide);
606
+ opts.busy = 1;
607
+ if (opts.fxFn) {
608
+ opts.fxFn(curr, next, opts, after, fwd, manual
609
+ && opts.fastOnEvent);
610
+ } else {
611
+ if ($bn2.isFunction($bn2.fn.cycle[opts.fx])) {
612
+ $bn2.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual
613
+ && opts.fastOnEvent);
614
+ } else {
615
+ $bn2.fn.cycle.custom(curr, next, opts, after, fwd, manual
616
+ && opts.fastOnEvent);
617
+ }
618
+ }
619
+ }
620
+ if (changed || opts.nextSlide == opts.currSlide) {
621
+ opts.lastSlide = opts.currSlide;
622
+ if (opts.random) {
623
+ opts.currSlide = opts.nextSlide;
624
+ if (++opts.randomIndex == els.length) {
625
+ opts.randomIndex = 0;
626
+ }
627
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
628
+ if (opts.nextSlide == opts.currSlide) {
629
+ opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0
630
+ : opts.currSlide + 1;
631
+ }
632
+ } else {
633
+ var roll = (opts.nextSlide + 1) == els.length;
634
+ opts.nextSlide = roll ? 0 : opts.nextSlide + 1;
635
+ opts.currSlide = roll ? els.length - 1 : opts.nextSlide - 1;
636
+ }
637
+ }
638
+ if (changed && opts.pager) {
639
+ opts.updateActivePagerLink(opts.pager, opts.currSlide,
640
+ opts.activePagerClass);
641
+ }
642
+ var ms = 0;
643
+ if (opts.timeout && !opts.continuous) {
644
+ ms = getTimeout(curr, next, opts, fwd);
645
+ } else {
646
+ if (opts.continuous && p.cyclePause) {
647
+ ms = 10;
648
+ }
649
+ }
650
+ if (ms > 0) {
651
+ p.cycleTimeout = setTimeout(function() {
652
+ go(els, opts, 0, !opts.rev);
653
+ }, ms);
654
+ }
655
+ }
656
+ $bn2.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) {
657
+ $bn2(pager).each(
658
+ function() {
659
+ $bn2(this).children().removeClass(clsName).eq(currSlide)
660
+ .addClass(clsName);
661
+ });
662
+ };
663
+ function getTimeout(curr, next, opts, fwd) {
664
+ if (opts.timeoutFn) {
665
+ var t = opts.timeoutFn(curr, next, opts, fwd);
666
+ while ((t - opts.speed) < 250) {
667
+ t += opts.speed;
668
+ }
669
+ debug("calculated timeout: " + t + "; speed: " + opts.speed);
670
+ if (t !== false) {
671
+ return t;
672
+ }
673
+ }
674
+ return opts.timeout;
675
+ }
676
+ $bn2.fn.cycle.next = function(opts) {
677
+ advance(opts, opts.rev ? -1 : 1);
678
+ };
679
+ $bn2.fn.cycle.prev = function(opts) {
680
+ advance(opts, opts.rev ? 1 : -1);
681
+ };
682
+ function advance(opts, val) {
683
+ var els = opts.elements;
684
+ var p = opts.$bn2cont[0], timeout = p.cycleTimeout;
685
+ if (timeout) {
686
+ clearTimeout(timeout);
687
+ p.cycleTimeout = 0;
688
+ }
689
+ if (opts.random && val < 0) {
690
+ opts.randomIndex--;
691
+ if (--opts.randomIndex == -2) {
692
+ opts.randomIndex = els.length - 2;
693
+ } else {
694
+ if (opts.randomIndex == -1) {
695
+ opts.randomIndex = els.length - 1;
696
+ }
697
+ }
698
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
699
+ } else {
700
+ if (opts.random) {
701
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
702
+ } else {
703
+ opts.nextSlide = opts.currSlide + val;
704
+ if (opts.nextSlide < 0) {
705
+ if (opts.nowrap) {
706
+ return false;
707
+ }
708
+ opts.nextSlide = els.length - 1;
709
+ } else {
710
+ if (opts.nextSlide >= els.length) {
711
+ if (opts.nowrap) {
712
+ return false;
713
+ }
714
+ opts.nextSlide = 0;
715
+ }
716
+ }
717
+ }
718
+ }
719
+ var cb = opts.onPrevNextEvent || opts.prevNextClick;
720
+ if ($bn2.isFunction(cb)) {
721
+ cb(val > 0, opts.nextSlide, els[opts.nextSlide]);
722
+ }
723
+ go(els, opts, 1, val >= 0);
724
+ return false;
725
+ }
726
+ function buildPager(els, opts) {
727
+ var $bn2p = $bn2(opts.pager);
728
+ $bn2.each(els, function(i, o) {
729
+ $bn2.fn.cycle.createPagerAnchor(i, o, $bn2p, els, opts);
730
+ });
731
+ opts.updateActivePagerLink(opts.pager, opts.startingSlide,
732
+ opts.activePagerClass);
733
+ }
734
+ $bn2.fn.cycle.createPagerAnchor = function(i, el, $bn2p, els, opts) {
735
+ var a;
736
+ if ($bn2.isFunction(opts.pagerAnchorBuilder)) {
737
+ a = opts.pagerAnchorBuilder(i, el);
738
+ debug("pagerAnchorBuilder(" + i + ", el) returned: " + a);
739
+ } else {
740
+ a = '<a href="#">' + (i + 1) + "</a>";
741
+ }
742
+ if (!a) {
743
+ return;
744
+ }
745
+ var $bn2a = $bn2(a);
746
+ if ($bn2a.parents("body").length === 0) {
747
+ var arr = [];
748
+ if ($bn2p.length > 1) {
749
+ $bn2p.each(function() {
750
+ var $bn2clone = $bn2a.clone(true);
751
+ $bn2(this).append($bn2clone);
752
+ arr.push($bn2clone[0]);
753
+ });
754
+ $bn2a = $bn2(arr);
755
+ } else {
756
+ $bn2a.appendTo($bn2p);
757
+ }
758
+ }
759
+ opts.pagerAnchors = opts.pagerAnchors || [];
760
+ opts.pagerAnchors.push($bn2a);
761
+ $bn2a.bind(opts.pagerEvent, function(e) {
762
+ e.preventDefault();
763
+ opts.nextSlide = i;
764
+ var p = opts.$bn2cont[0], timeout = p.cycleTimeout;
765
+ if (timeout) {
766
+ clearTimeout(timeout);
767
+ p.cycleTimeout = 0;
768
+ }
769
+ var cb = opts.onPagerEvent || opts.pagerClick;
770
+ if ($bn2.isFunction(cb)) {
771
+ cb(opts.nextSlide, els[opts.nextSlide]);
772
+ }
773
+ go(els, opts, 1, opts.currSlide < i);
774
+ });
775
+ if (!/^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble) {
776
+ $bn2a.bind("click.cycle", function() {
777
+ return false;
778
+ });
779
+ }
780
+ if (opts.pauseOnPagerHover) {
781
+ $bn2a.hover(function() {
782
+ opts.$bn2cont[0].cyclePause++;
783
+ }, function() {
784
+ opts.$bn2cont[0].cyclePause--;
785
+ });
786
+ }
787
+ };
788
+ $bn2.fn.cycle.hopsFromLast = function(opts, fwd) {
789
+ var hops, l = opts.lastSlide, c = opts.currSlide;
790
+ if (fwd) {
791
+ hops = c > l ? c - l : opts.slideCount - l;
792
+ } else {
793
+ hops = c < l ? l - c : l + opts.slideCount - c;
794
+ }
795
+ return hops;
796
+ };
797
+ function clearTypeFix($bn2slides) {
798
+ debug("applying clearType background-color hack");
799
+ function hex(s) {
800
+ s = parseInt(s).toString(16);
801
+ return s.length < 2 ? "0" + s : s;
802
+ }
803
+ function getBg(e) {
804
+ for (; e && e.nodeName.toLowerCase() != "html"; e = e.parentNode) {
805
+ var v = $bn2.css(e, "background-color");
806
+ if (v.indexOf("rgb") >= 0) {
807
+ var rgb = v.match(/\d+/g);
808
+ return "#" + hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
809
+ }
810
+ if (v && v != "transparent") {
811
+ return v;
812
+ }
813
+ }
814
+ return "#ffffff";
815
+ }
816
+ $bn2slides.each(function() {
817
+ $bn2(this).css("background-color", getBg(this));
818
+ });
819
+ }
820
+ $bn2.fn.cycle.commonReset = function(curr, next, opts, w, h, rev) {
821
+ $bn2(opts.elements).not(curr).hide();
822
+ opts.cssBefore.opacity = 1;
823
+ opts.cssBefore.display = "block";
824
+ if (w !== false && next.cycleW > 0) {
825
+ opts.cssBefore.width = next.cycleW;
826
+ }
827
+ if (h !== false && next.cycleH > 0) {
828
+ opts.cssBefore.height = next.cycleH;
829
+ }
830
+ opts.cssAfter = opts.cssAfter || {};
831
+ opts.cssAfter.display = "none";
832
+ $bn2(curr).css("zIndex", opts.slideCount + (rev === true ? 1 : 0));
833
+ $bn2(next).css("zIndex", opts.slideCount + (rev === true ? 0 : 1));
834
+ };
835
+ $bn2.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) {
836
+ var $bn2l = $bn2(curr), $bn2n = $bn2(next);
837
+ var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut;
838
+ $bn2n.css(opts.cssBefore);
839
+ if (speedOverride) {
840
+ if (typeof speedOverride == "number") {
841
+ speedIn = speedOut = speedOverride;
842
+ } else {
843
+ speedIn = speedOut = 1;
844
+ }
845
+ easeIn = easeOut = null;
846
+ }
847
+ var fn = function() {
848
+ $bn2n.animate(opts.animIn, speedIn, easeIn, cb);
849
+ };
850
+ $bn2l.animate(opts.animOut, speedOut, easeOut, function() {
851
+ if (opts.cssAfter) {
852
+ $bn2l.css(opts.cssAfter);
853
+ }
854
+ if (!opts.sync) {
855
+ fn();
856
+ }
857
+ });
858
+ if (opts.sync) {
859
+ fn();
860
+ }
861
+ };
862
+ $bn2.fn.cycle.transitions = {
863
+ fade : function($bn2cont, $bn2slides, opts) {
864
+ $bn2slides.not(":eq(" + opts.currSlide + ")").css("opacity", 0);
865
+ opts.before.push(function(curr, next, opts) {
866
+ $bn2.fn.cycle.commonReset(curr, next, opts);
867
+ opts.cssBefore.opacity = 0;
868
+ });
869
+ opts.animIn = {
870
+ opacity : 1
871
+ };
872
+ opts.animOut = {
873
+ opacity : 0
874
+ };
875
+ opts.cssBefore = {
876
+ top : 0,
877
+ left : 0
878
+ };
879
+ }
880
+ };
881
+ $bn2.fn.cycle.ver = function() {
882
+ return ver;
883
+ };
884
+ $bn2.fn.cycle.defaults = {
885
+ fx : "fade",
886
+ timeout : 4000,
887
+ timeoutFn : null,
888
+ continuous : 0,
889
+ speed : 500,
890
+ speedIn : null,
891
+ speedOut : null,
892
+ next : null,
893
+ prev : null,
894
+ onPrevNextEvent : null,
895
+ prevNextEvent : "click.cycle",
896
+ pager : null,
897
+ onPagerEvent : null,
898
+ pagerEvent : "click.cycle",
899
+ allowPagerClickBubble : false,
900
+ pagerAnchorBuilder : null,
901
+ before : null,
902
+ after : null,
903
+ end : null,
904
+ easing : null,
905
+ easeIn : null,
906
+ easeOut : null,
907
+ shuffle : null,
908
+ animIn : null,
909
+ animOut : null,
910
+ cssBefore : null,
911
+ cssAfter : null,
912
+ fxFn : null,
913
+ height : "auto",
914
+ startingSlide : 0,
915
+ sync : 1,
916
+ random : 0,
917
+ fit : 0,
918
+ containerResize : 1,
919
+ pause : 0,
920
+ pauseOnPagerHover : 0,
921
+ autostop : 0,
922
+ autostopCount : 0,
923
+ delay : 0,
924
+ slideExpr : null,
925
+ cleartype : !$bn2.support.opacity,
926
+ cleartypeNoBg : false,
927
+ nowrap : 0,
928
+ fastOnEvent : 0,
929
+ randomizeEffects : 1,
930
+ rev : 0,
931
+ manualTrump : true,
932
+ requeueOnImageNotLoaded : true,
933
+ requeueTimeout : 250,
934
+ activePagerClass : "activeSlide",
935
+ updateActivePagerLink : null
936
+ };
937
+ })(jQuery);
938
+ /*
939
+ * jQuery Cycle Plugin Transition Definitions This script is a plugin for the
940
+ * jQuery Cycle Plugin Examples and documentation at:
941
+ * http://malsup.com/jquery/cycle/ Copyright (c) 2007-2008 M. Alsup Version:
942
+ * 2.72 Dual licensed under the MIT and GPL licenses:
943
+ * http://www.opensource.org/licenses/mit-license.php
944
+ * http://www.gnu.org/licenses/gpl.html
945
+ */
946
+ (function($bn2) {
947
+ $bn2.fn.cycle.transitions.none = function($bn2cont, $bn2slides, opts) {
948
+ opts.fxFn = function(curr, next, opts, after) {
949
+ $bn2(next).show();
950
+ $bn2(curr).hide();
951
+ after();
952
+ };
953
+ };
954
+ $bn2.fn.cycle.transitions.scrollUp = function($bn2cont, $bn2slides, opts) {
955
+ $bn2cont.css("overflow", "hidden");
956
+ opts.before.push($bn2.fn.cycle.commonReset);
957
+ var h = $bn2cont.height();
958
+ opts.cssBefore = {
959
+ top : h,
960
+ left : 0
961
+ };
962
+ opts.cssFirst = {
963
+ top : 0
964
+ };
965
+ opts.animIn = {
966
+ top : 0
967
+ };
968
+ opts.animOut = {
969
+ top : -h
970
+ };
971
+ };
972
+ $bn2.fn.cycle.transitions.scrollDown = function($bn2cont, $bn2slides, opts) {
973
+ $bn2cont.css("overflow", "hidden");
974
+ opts.before.push($bn2.fn.cycle.commonReset);
975
+ var h = $bn2cont.height();
976
+ opts.cssFirst = {
977
+ top : 0
978
+ };
979
+ opts.cssBefore = {
980
+ top : -h,
981
+ left : 0
982
+ };
983
+ opts.animIn = {
984
+ top : 0
985
+ };
986
+ opts.animOut = {
987
+ top : h
988
+ };
989
+ };
990
+ $bn2.fn.cycle.transitions.scrollLeft = function($bn2cont, $bn2slides, opts) {
991
+ $bn2cont.css("overflow", "hidden");
992
+ opts.before.push($bn2.fn.cycle.commonReset);
993
+ var w = $bn2cont.width();
994
+ opts.cssFirst = {
995
+ left : 0
996
+ };
997
+ opts.cssBefore = {
998
+ left : w,
999
+ top : 0
1000
+ };
1001
+ opts.animIn = {
1002
+ left : 0
1003
+ };
1004
+ opts.animOut = {
1005
+ left : 0 - w
1006
+ };
1007
+ };
1008
+ $bn2.fn.cycle.transitions.scrollRight = function($bn2cont, $bn2slides, opts) {
1009
+ $bn2cont.css("overflow", "hidden");
1010
+ opts.before.push($bn2.fn.cycle.commonReset);
1011
+ var w = $bn2cont.width();
1012
+ opts.cssFirst = {
1013
+ left : 0
1014
+ };
1015
+ opts.cssBefore = {
1016
+ left : -w,
1017
+ top : 0
1018
+ };
1019
+ opts.animIn = {
1020
+ left : 0
1021
+ };
1022
+ opts.animOut = {
1023
+ left : w
1024
+ };
1025
+ };
1026
+ $bn2.fn.cycle.transitions.scrollHorz = function($bn2cont, $bn2slides, opts) {
1027
+ $bn2cont.css("overflow", "hidden").width();
1028
+ opts.before.push(function(curr, next, opts, fwd) {
1029
+ $bn2.fn.cycle.commonReset(curr, next, opts);
1030
+ opts.cssBefore.left = fwd ? (next.cycleW - 1) : (1 - next.cycleW);
1031
+ opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW;
1032
+ });
1033
+ opts.cssFirst = {
1034
+ left : 0
1035
+ };
1036
+ opts.cssBefore = {
1037
+ top : 0
1038
+ };
1039
+ opts.animIn = {
1040
+ left : 0
1041
+ };
1042
+ opts.animOut = {
1043
+ top : 0
1044
+ };
1045
+ };
1046
+ $bn2.fn.cycle.transitions.scrollVert = function($bn2cont, $bn2slides, opts) {
1047
+ $bn2cont.css("overflow", "hidden");
1048
+ opts.before.push(function(curr, next, opts, fwd) {
1049
+ $bn2.fn.cycle.commonReset(curr, next, opts);
1050
+ opts.cssBefore.top = fwd ? (1 - next.cycleH) : (next.cycleH - 1);
1051
+ opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH;
1052
+ });
1053
+ opts.cssFirst = {
1054
+ top : 0
1055
+ };
1056
+ opts.cssBefore = {
1057
+ left : 0
1058
+ };
1059
+ opts.animIn = {
1060
+ top : 0
1061
+ };
1062
+ opts.animOut = {
1063
+ left : 0
1064
+ };
1065
+ };
1066
+ $bn2.fn.cycle.transitions.slideX = function($bn2cont, $bn2slides, opts) {
1067
+ opts.before.push(function(curr, next, opts) {
1068
+ $bn2(opts.elements).not(curr).hide();
1069
+ $bn2.fn.cycle.commonReset(curr, next, opts, false, true);
1070
+ opts.animIn.width = next.cycleW;
1071
+ });
1072
+ opts.cssBefore = {
1073
+ left : 0,
1074
+ top : 0,
1075
+ width : 0
1076
+ };
1077
+ opts.animIn = {
1078
+ width : "show"
1079
+ };
1080
+ opts.animOut = {
1081
+ width : 0
1082
+ };
1083
+ };
1084
+ $bn2.fn.cycle.transitions.slideY = function($bn2cont, $bn2slides, opts) {
1085
+ opts.before.push(function(curr, next, opts) {
1086
+ $bn2(opts.elements).not(curr).hide();
1087
+ $bn2.fn.cycle.commonReset(curr, next, opts, true, false);
1088
+ opts.animIn.height = next.cycleH;
1089
+ });
1090
+ opts.cssBefore = {
1091
+ left : 0,
1092
+ top : 0,
1093
+ height : 0
1094
+ };
1095
+ opts.animIn = {
1096
+ height : "show"
1097
+ };
1098
+ opts.animOut = {
1099
+ height : 0
1100
+ };
1101
+ };
1102
+ $bn2.fn.cycle.transitions.shuffle = function($bn2cont, $bn2slides, opts) {
1103
+ var i, w = $bn2cont.css("overflow", "visible").width();
1104
+ $bn2slides.css( {
1105
+ left : 0,
1106
+ top : 0
1107
+ });
1108
+ opts.before.push(function(curr, next, opts) {
1109
+ $bn2.fn.cycle.commonReset(curr, next, opts, true, true, true);
1110
+ });
1111
+ if (!opts.speedAdjusted) {
1112
+ opts.speed = opts.speed / 2;
1113
+ opts.speedAdjusted = true;
1114
+ }
1115
+ opts.random = 0;
1116
+ opts.shuffle = opts.shuffle || {
1117
+ left : -w,
1118
+ top : 15
1119
+ };
1120
+ opts.els = [];
1121
+ for (i = 0; i < $bn2slides.length; i++) {
1122
+ opts.els.push($bn2slides[i]);
1123
+ }
1124
+ for (i = 0; i < opts.currSlide; i++) {
1125
+ opts.els.push(opts.els.shift());
1126
+ }
1127
+ opts.fxFn = function(curr, next, opts, cb, fwd) {
1128
+ var $bn2el = fwd ? $bn2(curr) : $bn2(next);
1129
+ $bn2(next).css(opts.cssBefore);
1130
+ var count = opts.slideCount;
1131
+ $bn2el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() {
1132
+ var hops = $bn2.fn.cycle.hopsFromLast(opts, fwd);
1133
+ for ( var k = 0; k < hops; k++) {
1134
+ fwd ? opts.els.push(opts.els.shift()) : opts.els
1135
+ .unshift(opts.els.pop());
1136
+ }
1137
+ if (fwd) {
1138
+ for ( var i = 0, len = opts.els.length; i < len; i++) {
1139
+ $bn2(opts.els[i]).css("z-index", len - i + count);
1140
+ }
1141
+ } else {
1142
+ var z = $bn2(curr).css("z-index");
1143
+ $bn2el.css("z-index", parseInt(z) + 1 + count);
1144
+ }
1145
+ $bn2el.animate( {
1146
+ left : 0,
1147
+ top : 0
1148
+ }, opts.speedOut, opts.easeOut, function() {
1149
+ $bn2(fwd ? this : curr).hide();
1150
+ if (cb) {
1151
+ cb();
1152
+ }
1153
+ });
1154
+ });
1155
+ };
1156
+ opts.cssBefore = {
1157
+ display : "block",
1158
+ opacity : 1,
1159
+ top : 0,
1160
+ left : 0
1161
+ };
1162
+ };
1163
+ $bn2.fn.cycle.transitions.turnUp = function($bn2cont, $bn2slides, opts) {
1164
+ opts.before.push(function(curr, next, opts) {
1165
+ $bn2.fn.cycle.commonReset(curr, next, opts, true, false);
1166
+ opts.cssBefore.top = next.cycleH;
1167
+ opts.animIn.height = next.cycleH;
1168
+ });
1169
+ opts.cssFirst = {
1170
+ top : 0
1171
+ };
1172
+ opts.cssBefore = {
1173
+ left : 0,
1174
+ height : 0
1175
+ };
1176
+ opts.animIn = {
1177
+ top : 0
1178
+ };
1179
+ opts.animOut = {
1180
+ height : 0
1181
+ };
1182
+ };
1183
+ $bn2.fn.cycle.transitions.turnDown = function($bn2cont, $bn2slides, opts) {
1184
+ opts.before.push(function(curr, next, opts) {
1185
+ $bn2.fn.cycle.commonReset(curr, next, opts, true, false);
1186
+ opts.animIn.height = next.cycleH;
1187
+ opts.animOut.top = curr.cycleH;
1188
+ });
1189
+ opts.cssFirst = {
1190
+ top : 0
1191
+ };
1192
+ opts.cssBefore = {
1193
+ left : 0,
1194
+ top : 0,
1195
+ height : 0
1196
+ };
1197
+ opts.animOut = {
1198
+ height : 0
1199
+ };
1200
+ };
1201
+ $bn2.fn.cycle.transitions.turnLeft = function($bn2cont, $bn2slides, opts) {
1202
+ opts.before.push(function(curr, next, opts) {
1203
+ $bn2.fn.cycle.commonReset(curr, next, opts, false, true);
1204
+ opts.cssBefore.left = next.cycleW;
1205
+ opts.animIn.width = next.cycleW;
1206
+ });
1207
+ opts.cssBefore = {
1208
+ top : 0,
1209
+ width : 0
1210
+ };
1211
+ opts.animIn = {
1212
+ left : 0
1213
+ };
1214
+ opts.animOut = {
1215
+ width : 0
1216
+ };
1217
+ };
1218
+ $bn2.fn.cycle.transitions.turnRight = function($bn2cont, $bn2slides, opts) {
1219
+ opts.before.push(function(curr, next, opts) {
1220
+ $bn2.fn.cycle.commonReset(curr, next, opts, false, true);
1221
+ opts.animIn.width = next.cycleW;
1222
+ opts.animOut.left = curr.cycleW;
1223
+ });
1224
+ opts.cssBefore = {
1225
+ top : 0,
1226
+ left : 0,
1227
+ width : 0
1228
+ };
1229
+ opts.animIn = {
1230
+ left : 0
1231
+ };
1232
+ opts.animOut = {
1233
+ width : 0
1234
+ };
1235
+ };
1236
+ $bn2.fn.cycle.transitions.zoom = function($bn2cont, $bn2slides, opts) {
1237
+ opts.before.push(function(curr, next, opts) {
1238
+ $bn2.fn.cycle.commonReset(curr, next, opts, false, false, true);
1239
+ opts.cssBefore.top = next.cycleH / 2;
1240
+ opts.cssBefore.left = next.cycleW / 2;
1241
+ opts.animIn = {
1242
+ top : 0,
1243
+ left : 0,
1244
+ width : next.cycleW,
1245
+ height : next.cycleH
1246
+ };
1247
+ opts.animOut = {
1248
+ width : 0,
1249
+ height : 0,
1250
+ top : curr.cycleH / 2,
1251
+ left : curr.cycleW / 2
1252
+ };
1253
+ });
1254
+ opts.cssFirst = {
1255
+ top : 0,
1256
+ left : 0
1257
+ };
1258
+ opts.cssBefore = {
1259
+ width : 0,
1260
+ height : 0
1261
+ };
1262
+ };
1263
+ $bn2.fn.cycle.transitions.fadeZoom = function($bn2cont, $bn2slides, opts) {
1264
+ opts.before.push(function(curr, next, opts) {
1265
+ $bn2.fn.cycle.commonReset(curr, next, opts, false, false);
1266
+ opts.cssBefore.left = next.cycleW / 2;
1267
+ opts.cssBefore.top = next.cycleH / 2;
1268
+ opts.animIn = {
1269
+ top : 0,
1270
+ left : 0,
1271
+ width : next.cycleW,
1272
+ height : next.cycleH
1273
+ };
1274
+ });
1275
+ opts.cssBefore = {
1276
+ width : 0,
1277
+ height : 0
1278
+ };
1279
+ opts.animOut = {
1280
+ opacity : 0
1281
+ };
1282
+ };
1283
+ $bn2.fn.cycle.transitions.blindX = function($bn2cont, $bn2slides, opts) {
1284
+ var w = $bn2cont.css("overflow", "hidden").width();
1285
+ opts.before.push(function(curr, next, opts) {
1286
+ $bn2.fn.cycle.commonReset(curr, next, opts);
1287
+ opts.animIn.width = next.cycleW;
1288
+ opts.animOut.left = curr.cycleW;
1289
+ });
1290
+ opts.cssBefore = {
1291
+ left : w,
1292
+ top : 0
1293
+ };
1294
+ opts.animIn = {
1295
+ left : 0
1296
+ };
1297
+ opts.animOut = {
1298
+ left : w
1299
+ };
1300
+ };
1301
+ $bn2.fn.cycle.transitions.blindY = function($bn2cont, $bn2slides, opts) {
1302
+ var h = $bn2cont.css("overflow", "hidden").height();
1303
+ opts.before.push(function(curr, next, opts) {
1304
+ $bn2.fn.cycle.commonReset(curr, next, opts);
1305
+ opts.animIn.height = next.cycleH;
1306
+ opts.animOut.top = curr.cycleH;
1307
+ });
1308
+ opts.cssBefore = {
1309
+ top : h,
1310
+ left : 0
1311
+ };
1312
+ opts.animIn = {
1313
+ top : 0
1314
+ };
1315
+ opts.animOut = {
1316
+ top : h
1317
+ };
1318
+ };
1319
+ $bn2.fn.cycle.transitions.blindZ = function($bn2cont, $bn2slides, opts) {
1320
+ var h = $bn2cont.css("overflow", "hidden").height();
1321
+ var w = $bn2cont.width();
1322
+ opts.before.push(function(curr, next, opts) {
1323
+ $bn2.fn.cycle.commonReset(curr, next, opts);
1324
+ opts.animIn.height = next.cycleH;
1325
+ opts.animOut.top = curr.cycleH;
1326
+ });
1327
+ opts.cssBefore = {
1328
+ top : h,
1329
+ left : w
1330
+ };
1331
+ opts.animIn = {
1332
+ top : 0,
1333
+ left : 0
1334
+ };
1335
+ opts.animOut = {
1336
+ top : h,
1337
+ left : w
1338
+ };
1339
+ };
1340
+ $bn2.fn.cycle.transitions.growX = function($bn2cont, $bn2slides, opts) {
1341
+ opts.before.push(function(curr, next, opts) {
1342
+ $bn2.fn.cycle.commonReset(curr, next, opts, false, true);
1343
+ opts.cssBefore.left = this.cycleW / 2;
1344
+ opts.animIn = {
1345
+ left : 0,
1346
+ width : this.cycleW
1347
+ };
1348
+ opts.animOut = {
1349
+ left : 0
1350
+ };
1351
+ });
1352
+ opts.cssBefore = {
1353
+ width : 0,
1354
+ top : 0
1355
+ };
1356
+ };
1357
+ $bn2.fn.cycle.transitions.growY = function($bn2cont, $bn2slides, opts) {
1358
+ opts.before.push(function(curr, next, opts) {
1359
+ $bn2.fn.cycle.commonReset(curr, next, opts, true, false);
1360
+ opts.cssBefore.top = this.cycleH / 2;
1361
+ opts.animIn = {
1362
+ top : 0,
1363
+ height : this.cycleH
1364
+ };
1365
+ opts.animOut = {
1366
+ top : 0
1367
+ };
1368
+ });
1369
+ opts.cssBefore = {
1370
+ height : 0,
1371
+ left : 0
1372
+ };
1373
+ };
1374
+ $bn2.fn.cycle.transitions.curtainX = function($bn2cont, $bn2slides, opts) {
1375
+ opts.before.push(function(curr, next, opts) {
1376
+ $bn2.fn.cycle.commonReset(curr, next, opts, false, true, true);
1377
+ opts.cssBefore.left = next.cycleW / 2;
1378
+ opts.animIn = {
1379
+ left : 0,
1380
+ width : this.cycleW
1381
+ };
1382
+ opts.animOut = {
1383
+ left : curr.cycleW / 2,
1384
+ width : 0
1385
+ };
1386
+ });
1387
+ opts.cssBefore = {
1388
+ top : 0,
1389
+ width : 0
1390
+ };
1391
+ };
1392
+ $bn2.fn.cycle.transitions.curtainY = function($bn2cont, $bn2slides, opts) {
1393
+ opts.before.push(function(curr, next, opts) {
1394
+ $bn2.fn.cycle.commonReset(curr, next, opts, true, false, true);
1395
+ opts.cssBefore.top = next.cycleH / 2;
1396
+ opts.animIn = {
1397
+ top : 0,
1398
+ height : next.cycleH
1399
+ };
1400
+ opts.animOut = {
1401
+ top : curr.cycleH / 2,
1402
+ height : 0
1403
+ };
1404
+ });
1405
+ opts.cssBefore = {
1406
+ left : 0,
1407
+ height : 0
1408
+ };
1409
+ };
1410
+ $bn2.fn.cycle.transitions.cover = function($bn2cont, $bn2slides, opts) {
1411
+ var d = opts.direction || "left";
1412
+ var w = $bn2cont.css("overflow", "hidden").width();
1413
+ var h = $bn2cont.height();
1414
+ opts.before.push(function(curr, next, opts) {
1415
+ $bn2.fn.cycle.commonReset(curr, next, opts);
1416
+ if (d == "right") {
1417
+ opts.cssBefore.left = -w;
1418
+ } else {
1419
+ if (d == "up") {
1420
+ opts.cssBefore.top = h;
1421
+ } else {
1422
+ if (d == "down") {
1423
+ opts.cssBefore.top = -h;
1424
+ } else {
1425
+ opts.cssBefore.left = w;
1426
+ }
1427
+ }
1428
+ }
1429
+ });
1430
+ opts.animIn = {
1431
+ left : 0,
1432
+ top : 0
1433
+ };
1434
+ opts.animOut = {
1435
+ opacity : 1
1436
+ };
1437
+ opts.cssBefore = {
1438
+ top : 0,
1439
+ left : 0
1440
+ };
1441
+ };
1442
+ $bn2.fn.cycle.transitions.uncover = function($bn2cont, $bn2slides, opts) {
1443
+ var d = opts.direction || "left";
1444
+ var w = $bn2cont.css("overflow", "hidden").width();
1445
+ var h = $bn2cont.height();
1446
+ opts.before.push(function(curr, next, opts) {
1447
+ $bn2.fn.cycle.commonReset(curr, next, opts, true, true, true);
1448
+ if (d == "right") {
1449
+ opts.animOut.left = w;
1450
+ } else {
1451
+ if (d == "up") {
1452
+ opts.animOut.top = -h;
1453
+ } else {
1454
+ if (d == "down") {
1455
+ opts.animOut.top = h;
1456
+ } else {
1457
+ opts.animOut.left = -w;
1458
+ }
1459
+ }
1460
+ }
1461
+ });
1462
+ opts.animIn = {
1463
+ left : 0,
1464
+ top : 0
1465
+ };
1466
+ opts.animOut = {
1467
+ opacity : 1
1468
+ };
1469
+ opts.cssBefore = {
1470
+ top : 0,
1471
+ left : 0
1472
+ };
1473
+ };
1474
+ $bn2.fn.cycle.transitions.toss = function($bn2cont, $bn2slides, opts) {
1475
+ var w = $bn2cont.css("overflow", "visible").width();
1476
+ var h = $bn2cont.height();
1477
+ opts.before.push(function(curr, next, opts) {
1478
+ $bn2.fn.cycle.commonReset(curr, next, opts, true, true, true);
1479
+ if (!opts.animOut.left && !opts.animOut.top) {
1480
+ opts.animOut = {
1481
+ left : w * 2,
1482
+ top : -h / 2,
1483
+ opacity : 0
1484
+ };
1485
+ } else {
1486
+ opts.animOut.opacity = 0;
1487
+ }
1488
+ });
1489
+ opts.cssBefore = {
1490
+ left : 0,
1491
+ top : 0
1492
+ };
1493
+ opts.animIn = {
1494
+ left : 0
1495
+ };
1496
+ };
1497
+ $bn2.fn.cycle.transitions.wipe = function($bn2cont, $bn2slides, opts) {
1498
+ var w = $bn2cont.css("overflow", "hidden").width();
1499
+ var h = $bn2cont.height();
1500
+ opts.cssBefore = opts.cssBefore || {};
1501
+ var clip;
1502
+ if (opts.clip) {
1503
+ if (/l2r/.test(opts.clip)) {
1504
+ clip = "rect(0px 0px " + h + "px 0px)";
1505
+ } else {
1506
+ if (/r2l/.test(opts.clip)) {
1507
+ clip = "rect(0px " + w + "px " + h + "px " + w + "px)";
1508
+ } else {
1509
+ if (/t2b/.test(opts.clip)) {
1510
+ clip = "rect(0px " + w + "px 0px 0px)";
1511
+ } else {
1512
+ if (/b2t/.test(opts.clip)) {
1513
+ clip = "rect(" + h + "px " + w + "px " + h
1514
+ + "px 0px)";
1515
+ } else {
1516
+ if (/zoom/.test(opts.clip)) {
1517
+ var top = parseInt(h / 2);
1518
+ var left = parseInt(w / 2);
1519
+ clip = "rect(" + top + "px " + left + "px "
1520
+ + top + "px " + left + "px)";
1521
+ }
1522
+ }
1523
+ }
1524
+ }
1525
+ }
1526
+ }
1527
+ opts.cssBefore.clip = opts.cssBefore.clip || clip
1528
+ || "rect(0px 0px 0px 0px)";
1529
+ var d = opts.cssBefore.clip.match(/(\d+)/g);
1530
+ var t = parseInt(d[0]), r = parseInt(d[1]), b = parseInt(d[2]), l = parseInt(d[3]);
1531
+ opts.before.push(function(curr, next, opts) {
1532
+ if (curr == next) {
1533
+ return;
1534
+ }
1535
+ var $bn2curr = $bn2(curr), $bn2next = $bn2(next);
1536
+ $bn2.fn.cycle.commonReset(curr, next, opts, true, true, false);
1537
+ opts.cssAfter.display = "block";
1538
+ var step = 1, count = parseInt((opts.speedIn / 13)) - 1;
1539
+ (function f() {
1540
+ var tt = t ? t - parseInt(step * (t / count)) : 0;
1541
+ var ll = l ? l - parseInt(step * (l / count)) : 0;
1542
+ var bb = b < h ? b + parseInt(step * ((h - b) / count || 1))
1543
+ : h;
1544
+ var rr = r < w ? r + parseInt(step * ((w - r) / count || 1))
1545
+ : w;
1546
+ $bn2next.css( {
1547
+ clip : "rect(" + tt + "px " + rr + "px " + bb + "px " + ll
1548
+ + "px)"
1549
+ });
1550
+ (step++ <= count) ? setTimeout(f, 13) : $bn2curr.css("display",
1551
+ "none");
1552
+ })();
1553
+ });
1554
+ opts.cssBefore = {
1555
+ display : "block",
1556
+ opacity : 1,
1557
+ top : 0,
1558
+ left : 0
1559
+ };
1560
+ opts.animIn = {
1561
+ left : 0
1562
+ };
1563
+ opts.animOut = {
1564
+ left : 0
1565
+ };
1566
+ };
1567
+ })($bn2);
skin/frontend/default/default/banner/bannerpro.css ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #divSimpleSliderRotate { position:absolute; bottom:10px; right:10px; z-index:99; }
2
+ #divSimpleSliderRotate a { margin: 0 0 0 4px; padding: 3px 7px; background: #ffffff; text-decoration: none; color: #888888; font-family:Arial, Helvetica, sans-serif; font-size:12px; }
3
+ #divSimpleSliderRotate a:hover { background: #454545; text-decoration: none; color: #ffffff; }
4
+ #divSimpleSliderRotate a.activeSlide { background: #454545; text-decoration: none; color: #ffffff; }
5
+ #divSimpleSliderRotate a:focus { outline: none; }
6
+ .home_events_row { overflow: hidden; width: 100%; border-bottom:2px solid #dddddd; padding: 14px 0 9px 0; }
7
+ .home_events_row h4 { float: left; display:inline; font-size: 3.8em; color: #aaaaaa; margin-left: 12px; line-height: 1em; padding: 0; }
8
+ .home_events_content { float: right; display: inline; width: 84% }
9
+ .home_events_content h3 { font-size: 1.4em; }
10
+ .home_events_content p { margin: 1px 0 0 0; }
11
+ #divSimpleSlider { position: relative; width:470px; height:230px; }
12
+
13
+ .navigate .prev { background: url('images/next-prev-btn.png') no-repeat scroll 0 0 transparent; display: block; height: 22px; left: 10px; position: absolute; top: 110px; width: 24px; z-index: 999; cursor:pointer; }
14
+ .navigate .next { background: url('images/next-prev-btn.png') no-repeat scroll -24px 0 transparent; display: block; height: 22px; position: absolute; right: 10px; top: 110px; width: 26px; z-index: 999; cursor:pointer; }
15
+ .navigate .prev:hover { background: url('images/next-prev-btn.png') no-repeat scroll 0 -22px transparent; }
16
+ .navigate .next:hover { background: url('images/next-prev-btn.png') no-repeat scroll -24px -22px transparent; }
17
+ .navigate a { display:block; height:20px; }
18
+
19
+ .banner_content h3 { color:#C4DFEB; }
20
+ .banner-images { width:470px !important; height: 230px; position: relative; }
21
+ .banner-images img { position: absolute; top: 0px; left: 0px; display: block; z-index: 3; }
22
+ .banner_content { color:#2F2F2F; position:absolute; left:0px; top:0px; padding:5px; font-size: 18px; text-align:left; display: block; z-index: 3; }
23
+ .banner_content a { color:#2FAECE; text-decoration:underline; font-weight:bold; }
24
+ .banner_content a:hover{ color:#2FAECE; text-decoration:underline; font-weight:bold;}
25
+
26
+ .control .no-display { display:none; }
27
+ .control .pause { background: url('images/pause.png') no-repeat 0px 0px; width:24px; height:22px; position:absolute; z-index:15; top:110px; left:220px; cursor:pointer; }
28
+ .control .pause:hover { background: url('images/pause.png') no-repeat bottom;}
29
+ .control .play { background: url('images/play.png') no-repeat 0px 0px; width:24px; height:22px; position:absolute; z-index:10; top:110px; left:220px; cursor:pointer; }
30
+ .control .play:hover { background: url('images/play.png') no-repeat bottom; }
skin/frontend/default/default/banner/bannerpro.js ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery JavaScript Library v1.4.2
3
+ * http://jquery.com/
4
+ *
5
+ * Copyright 2010, John Resig
6
+ * Dual licensed under the MIT or GPL Version 2 licenses.
7
+ * http://jquery.org/license
8
+ *
9
+ * Includes Sizzle.js
10
+ * http://sizzlejs.com/
11
+ * Copyright 2010, The Dojo Foundation
12
+ * Released under the MIT, BSD, and GPL Licenses.
13
+ *
14
+ * Date: Sat Feb 13 22:33:48 2010 -0500
15
+ */
16
+ (function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
17
+ e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
18
+ j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
19
+ "&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
20
+ true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
21
+ Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
22
+ (d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
23
+ a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
24
+ "find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
25
+ function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
26
+ c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
27
+ L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
28
+ "isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
29
+ a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
30
+ d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
31
+ a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
32
+ !c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
33
+ true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
34
+ var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
35
+ parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
36
+ false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
37
+ s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
38
+ applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
39
+ else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
40
+ a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
41
+ w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
42
+ cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
43
+ i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
44
+ " ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
45
+ this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
46
+ e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
47
+ c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
48
+ a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
49
+ function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
50
+ k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
51
+ C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
52
+ null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
53
+ e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
54
+ f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
55
+ if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
56
+ fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
57
+ d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
58
+ "events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
59
+ a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
60
+ isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
61
+ {setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
62
+ if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
63
+ e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
64
+ "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
65
+ d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
66
+ !a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
67
+ toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
68
+ u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.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".split(" "),
69
+ function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
70
+ if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
71
+ e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
72
+ t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
73
+ g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
74
+ for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
75
+ 1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
76
+ CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
77
+ relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
78
+ l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
79
+ h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
80
+ CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
81
+ g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
82
+ text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
83
+ setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
84
+ h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
85
+ m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
86
+ "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
87
+ h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
88
+ !h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
89
+ h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
90
+ q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
91
+ if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
92
+ (function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
93
+ function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
94
+ gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
95
+ c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
96
+ {},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
97
+ "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
98
+ d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
99
+ a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
100
+ 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
101
+ a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
102
+ c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
103
+ wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
104
+ prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
105
+ this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
106
+ return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
107
+ ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
108
+ this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
109
+ u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
110
+ 1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
111
+ return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
112
+ ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
113
+ c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
114
+ c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
115
+ function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
116
+ Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
117
+ "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
118
+ a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
119
+ a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
120
+ "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
121
+ serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
122
+ function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
123
+ global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
124
+ e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
125
+ "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
126
+ false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
127
+ false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
128
+ c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
129
+ d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
130
+ g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
131
+ 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
132
+ "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
133
+ if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
134
+ this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
135
+ "olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
136
+ animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
137
+ j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
138
+ this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
139
+ "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
140
+ c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
141
+ this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
142
+ this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
143
+ e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
144
+ c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
145
+ function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
146
+ this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
147
+ k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
148
+ f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
149
+ a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
150
+ c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
151
+ d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
152
+ f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
153
+ "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
154
+ e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
155
+ var $bn2 = jQuery.noConflict();
skin/frontend/default/default/banner/images/next-prev-btn.png ADDED
Binary file
skin/frontend/default/default/banner/images/pause.png ADDED
Binary file
skin/frontend/default/default/banner/images/play.png ADDED
Binary file