Dropfin_Newsletterpopup - Version 1.0.0

Version Notes

Dropfin Newsletter Popup

Download this release

Release Info

Developer Dropfin
Extension Dropfin_Newsletterpopup
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (59) hide show
  1. app/code/community/Dropfin/Newsletterpopup/Block/.DS_Store +0 -0
  2. app/code/community/Dropfin/Newsletterpopup/Block/Adminhtml/System/.DS_Store +0 -0
  3. app/code/community/Dropfin/Newsletterpopup/Block/Adminhtml/System/Config/.DS_Store +0 -0
  4. app/code/community/Dropfin/Newsletterpopup/Block/Adminhtml/System/Config/Color.php +42 -0
  5. app/code/community/Dropfin/Newsletterpopup/Helper/Data.php +267 -0
  6. app/code/community/Dropfin/Newsletterpopup/controllers/SubscriberController.php +99 -0
  7. app/code/community/Dropfin/Newsletterpopup/etc/adminhtml.xml +66 -0
  8. app/code/community/Dropfin/Newsletterpopup/etc/config.xml +130 -0
  9. app/code/community/Dropfin/Newsletterpopup/etc/system.xml +572 -0
  10. app/design/adminhtml/default/default/layout/dropfin/newsletterpopup.xml +36 -0
  11. app/design/frontend/base/default/layout/dropfin/newsletterpopup.xml +61 -0
  12. app/design/frontend/base/default/template/dropfin/newsletterpopup/popup.phtml +186 -0
  13. app/etc/modules/Dropfin_Newsletterpopup.xml +33 -0
  14. media/dropfin/newsletterpopup/social_icons/fb.png +0 -0
  15. media/dropfin/newsletterpopup/social_icons/flickr.png +0 -0
  16. media/dropfin/newsletterpopup/social_icons/foursquare.png +0 -0
  17. media/dropfin/newsletterpopup/social_icons/gplus.png +0 -0
  18. media/dropfin/newsletterpopup/social_icons/instagram.png +0 -0
  19. media/dropfin/newsletterpopup/social_icons/linkedin.png +0 -0
  20. media/dropfin/newsletterpopup/social_icons/pinterest.png +0 -0
  21. media/dropfin/newsletterpopup/social_icons/tumblr.png +0 -0
  22. media/dropfin/newsletterpopup/social_icons/twitter.png +0 -0
  23. media/dropfin/newsletterpopup/social_icons/vimeo.png +0 -0
  24. media/dropfin/newsletterpopup/social_icons/youtube.png +0 -0
  25. package.xml +18 -0
  26. skin/adminhtml/default/default/dropfin/newsletterpopup/js/arrow.gif +0 -0
  27. skin/adminhtml/default/default/dropfin/newsletterpopup/js/cross.gif +0 -0
  28. skin/adminhtml/default/default/dropfin/newsletterpopup/js/hs.png +0 -0
  29. skin/adminhtml/default/default/dropfin/newsletterpopup/js/hv.png +0 -0
  30. skin/adminhtml/default/default/dropfin/newsletterpopup/js/jscolor.js +1844 -0
  31. skin/adminhtml/default/default/dropfin/newsletterpopup/js/jscolor.min.js +10 -0
  32. skin/frontend/base/default/dropfin/newsletterpopup/css/jquery.fancybox-1.3.4.css +86 -0
  33. skin/frontend/base/default/dropfin/newsletterpopup/css/style.css +39 -0
  34. skin/frontend/base/default/dropfin/newsletterpopup/images/blank.gif +0 -0
  35. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_close.png +0 -0
  36. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_loading.png +0 -0
  37. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_nav_left.png +0 -0
  38. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_nav_right.png +0 -0
  39. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_e.png +0 -0
  40. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_n.png +0 -0
  41. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_ne.png +0 -0
  42. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_nw.png +0 -0
  43. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_s.png +0 -0
  44. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_se.png +0 -0
  45. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_sw.png +0 -0
  46. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_w.png +0 -0
  47. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_title_left.png +0 -0
  48. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_title_main.png +0 -0
  49. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_title_over.png +0 -0
  50. skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_title_right.png +0 -0
  51. skin/frontend/base/default/dropfin/newsletterpopup/images/fancybox-x.png +0 -0
  52. skin/frontend/base/default/dropfin/newsletterpopup/images/fancybox-y.png +0 -0
  53. skin/frontend/base/default/dropfin/newsletterpopup/images/fancybox.png +0 -0
  54. skin/frontend/base/default/dropfin/newsletterpopup/images/fancybox_loading.gif +0 -0
  55. skin/frontend/base/default/dropfin/newsletterpopup/images/fancybox_sprite.png +0 -0
  56. skin/frontend/base/default/dropfin/newsletterpopup/js/jquery-1.7.2.min.js +27 -0
  57. skin/frontend/base/default/dropfin/newsletterpopup/js/jquery.fancybox-1.3.4.js +52 -0
  58. skin/frontend/base/default/dropfin/newsletterpopup/js/jquery.validate.min.js +51 -0
  59. skin/frontend/base/default/dropfin/newsletterpopup/js/newsletterpopup.js +67 -0
app/code/community/Dropfin/Newsletterpopup/Block/.DS_Store ADDED
Binary file
app/code/community/Dropfin/Newsletterpopup/Block/Adminhtml/System/.DS_Store ADDED
Binary file
app/code/community/Dropfin/Newsletterpopup/Block/Adminhtml/System/Config/.DS_Store ADDED
Binary file
app/code/community/Dropfin/Newsletterpopup/Block/Adminhtml/System/Config/Color.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Dropfin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.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
18
+ * this extension to newer versions in the future.
19
+ *
20
+ * @category Dropfin
21
+ * @package Newsletter Popup
22
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
23
+ */
24
+
25
+ class Dropfin_Newsletterpopup_Block_Adminhtml_System_Config_Color extends Mage_Adminhtml_Block_System_Config_Form_Field {
26
+
27
+ protected function _getElementHtml( Varien_Data_Form_Element_Abstract $element ) {
28
+
29
+ $color = new Varien_Data_Form_Element_Text();
30
+ $data = array(
31
+ 'name' => $element->getName(),
32
+ 'html_id' => $element->getId(),
33
+ );
34
+ $color->setData( $data );
35
+ $color->setValue( $element->getValue(), $format );
36
+ $color->setForm( $element->getForm() );
37
+ $color->addClass( 'jscolor ' . $element->getClass() );
38
+
39
+ return $color->getElementHtml();
40
+ }
41
+
42
+ }
app/code/community/Dropfin/Newsletterpopup/Helper/Data.php ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dropfin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade
19
+ * this extension to newer versions in the future.
20
+ *
21
+ * @category Dropfin
22
+ * @package Newsletter Popup
23
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
24
+ */
25
+
26
+ class Dropfin_Newsletterpopup_Helper_Data extends Mage_Core_Helper_Abstract {
27
+
28
+ const XML_PATH_ENABLED = 'dropfin_newsletterpopup/configurations/enabled';
29
+ const XML_PATH_COOKIES_NAME = 'dropfin_newsletterpopup/configurations/cookies_name';
30
+ const XML_PATH_COOKIES_TIME_OUT = 'dropfin_newsletterpopup/configurations/cookies_timeout';
31
+ const XML_PATH_AUTO_HIDE = 'dropfin_newsletterpopup/configurations/auto_hide';
32
+ const XML_PATH_HIDE_TIMEOUT = 'dropfin_newsletterpopup/configurations/hide_timeout';
33
+
34
+ const XML_PATH_POPUP_TITLE = 'dropfin_newsletterpopup/popup_content/title';
35
+ const XML_PATH_POPUP_SUB_TITLE = 'dropfin_newsletterpopup/popup_content/sub_title';
36
+ const XML_PATH_POPUP_DESCRIPTION = 'dropfin_newsletterpopup/popup_content/description';
37
+
38
+ const XML_PATH_SHOW_SOCIAL_LINKS = 'dropfin_newsletterpopup/popup_content/show_social_links';
39
+ const XML_PATH_SHOW_SOCIAL_LINKS_TITLE = 'dropfin_newsletterpopup/popup_content/show_social_links_title';
40
+ const XML_PATH_SOCIAL_LINKS_TITLE = 'dropfin_newsletterpopup/popup_content/social_links_title';
41
+ const XML_PATH_SOCIAL_LINKS_FB = 'dropfin_newsletterpopup/popup_content/fb_link';
42
+ const XML_PATH_SOCIAL_LINKS_TWL = 'dropfin_newsletterpopup/popup_content/twitter_link';
43
+ const XML_PATH_SOCIAL_LINKS_GPL = 'dropfin_newsletterpopup/popup_content/gplus_link';
44
+ const XML_PATH_SOCIAL_LINKS_YTL = 'dropfin_newsletterpopup/popup_content/youtube_link';
45
+ const XML_PATH_SOCIAL_LINKS_PINL = 'dropfin_newsletterpopup/popup_content/pinterest_link';
46
+ const XML_PATH_SOCIAL_LINKS_LINL = 'dropfin_newsletterpopup/popup_content/linkedin_link';
47
+ const XML_PATH_SOCIAL_LINKS_FLL = 'dropfin_newsletterpopup/popup_content/flickr_link';
48
+ const XML_PATH_SOCIAL_LINKS_VIML = 'dropfin_newsletterpopup/popup_content/vimeo_link';
49
+ const XML_PATH_SOCIAL_LINKS_INSL = 'dropfin_newsletterpopup/popup_content/instagram_link';
50
+ const XML_PATH_SOCIAL_LINKS_FSL = 'dropfin_newsletterpopup/popup_content/foursquare_link';
51
+ const XML_PATH_SOCIAL_LINKS_TML = 'dropfin_newsletterpopup/popup_content/tumblr_link';
52
+
53
+ const XML_PATH_POPUP_HEADER_BG = 'dropfin_newsletterpopup/popup_design/header_bg';
54
+ const XML_PATH_POPUP_HEADER_COLOR = 'dropfin_newsletterpopup/popup_design/header_color';
55
+ const XML_PATH_POPUP_BORDER = 'dropfin_newsletterpopup/popup_design/popup_border';
56
+ const XML_PATH_POPUP_TEXT_COLOR = 'dropfin_newsletterpopup/popup_design/popup_text_color';
57
+ const XML_PATH_POPUP_BUTTON_COLOR = 'dropfin_newsletterpopup/popup_design/submit_btn_color';
58
+ const XML_PATH_POPUP_BUTTON_TEXT_COLOR = 'dropfin_newsletterpopup/popup_design/submit_btn_text_color';
59
+ const XML_PATH_POPUP_ICON_SIZE = 'dropfin_newsletterpopup/popup_design/icon_size';
60
+ const XML_PATH_SOCIAL_ICON_FB = 'dropfin_newsletterpopup/popup_design/fb_icon';
61
+ const XML_PATH_SOCIAL_ICON_TWL = 'dropfin_newsletterpopup/popup_design/twitter_icon';
62
+ const XML_PATH_SOCIAL_ICON_GPL = 'dropfin_newsletterpopup/popup_design/gplus_icon';
63
+ const XML_PATH_SOCIAL_ICON_YTL = 'dropfin_newsletterpopup/popup_design/youtube_icon';
64
+ const XML_PATH_SOCIAL_ICON_PINL = 'dropfin_newsletterpopup/popup_design/pinterest_icon';
65
+ const XML_PATH_SOCIAL_ICON_LINL = 'dropfin_newsletterpopup/popup_design/linkedin_icon';
66
+ const XML_PATH_SOCIAL_ICON_FLL = 'dropfin_newsletterpopup/popup_design/flickr_icon';
67
+ const XML_PATH_SOCIAL_ICON_VIML = 'dropfin_newsletterpopup/popup_design/vimeo_icon';
68
+ const XML_PATH_SOCIAL_ICON_INSL = 'dropfin_newsletterpopup/popup_design/instagram_icon';
69
+ const XML_PATH_SOCIAL_ICON_FSL = 'dropfin_newsletterpopup/popup_design/foursquare_icon';
70
+ const XML_PATH_SOCIAL_ICON_TML = 'dropfin_newsletterpopup/popup_design/tumblr_icon';
71
+
72
+ public function getStatus() {
73
+ return (int) Mage::getStoreConfig(self::XML_PATH_ENABLED);
74
+ }
75
+
76
+ public function getCookieName() {
77
+ return Mage::getStoreConfig(self::XML_PATH_COOKIES_NAME);
78
+ }
79
+
80
+ public function getCookieLifeTime() {
81
+ $lifeTime = (int) Mage::getStoreConfig(self::XML_PATH_COOKIES_TIME_OUT);
82
+ if($lifeTime <= 0) {
83
+ $lifeTime = 1;
84
+ }
85
+ return $lifeTime;
86
+ }
87
+
88
+ public function getTimeOut() {
89
+ if((int) Mage::getStoreConfig(self::XML_PATH_AUTO_HIDE)) {
90
+ return (int) Mage::getStoreConfig(self::XML_PATH_HIDE_TIMEOUT);
91
+ }
92
+ return false;
93
+ }
94
+
95
+ public function getPopupTitle() {
96
+ return Mage::getStoreConfig(self::XML_PATH_POPUP_TITLE);
97
+ }
98
+
99
+ public function getPopupSubTitle() {
100
+ return Mage::getStoreConfig(self::XML_PATH_POPUP_SUB_TITLE);
101
+ }
102
+
103
+ public function getPopupDescription() {
104
+ return Mage::getStoreConfig(self::XML_PATH_POPUP_DESCRIPTION);
105
+ }
106
+
107
+ public function getShowSocialLinks() {
108
+ return (int) Mage::getStoreConfig(self::XML_PATH_SHOW_SOCIAL_LINKS);
109
+ }
110
+
111
+ public function getShowSocialLinksTitle() {
112
+ return (int) Mage::getStoreConfig(self::XML_PATH_SHOW_SOCIAL_LINKS_TITLE);
113
+ }
114
+
115
+ public function getSocialLinksTitle() {
116
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_TITLE);
117
+ }
118
+
119
+ public function getFBLink() {
120
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_FB);
121
+ }
122
+
123
+ public function getTwitterLink() {
124
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_TWL);
125
+ }
126
+
127
+ public function getGplusLink() {
128
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_GPL);
129
+ }
130
+
131
+ public function getYoutubeLink() {
132
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_YTL);
133
+ }
134
+
135
+ public function getPinLink() {
136
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_PINL);
137
+ }
138
+
139
+ public function getLinkedinLink() {
140
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_LINL);
141
+ }
142
+
143
+ public function getFlickrLink() {
144
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_FLL);
145
+ }
146
+
147
+ public function getVimeoLink() {
148
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_VIML);
149
+ }
150
+
151
+ public function getInstagramLink() {
152
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_INSL);
153
+ }
154
+
155
+ public function getFoursquareLink() {
156
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_FSL);
157
+ }
158
+
159
+ public function getTumblrLink() {
160
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_LINKS_TML);
161
+ }
162
+
163
+ public function getHeaderBg() {
164
+ return Mage::getStoreConfig(self::XML_PATH_POPUP_HEADER_BG);
165
+ }
166
+
167
+ public function getHeaderColor() {
168
+ return Mage::getStoreConfig(self::XML_PATH_POPUP_HEADER_COLOR);
169
+ }
170
+
171
+ public function getBorderColor() {
172
+ return Mage::getStoreConfig(self::XML_PATH_POPUP_BORDER);
173
+ }
174
+
175
+ public function getPopupTextColor() {
176
+ return Mage::getStoreConfig(self::XML_PATH_POPUP_TEXT_COLOR);
177
+ }
178
+
179
+ public function getButtonColor() {
180
+ return Mage::getStoreConfig(self::XML_PATH_POPUP_BUTTON_COLOR);
181
+ }
182
+
183
+ public function getButtonTextColor() {
184
+ return Mage::getStoreConfig(self::XML_PATH_POPUP_BUTTON_TEXT_COLOR);
185
+ }
186
+
187
+ public function getIconSize() {
188
+ return Mage::getStoreConfig(self::XML_PATH_POPUP_ICON_SIZE);
189
+ }
190
+
191
+ public function getFBIcon() {
192
+ if(trim(Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_FB)) != '') {
193
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_FB);
194
+ }
195
+ return 'social_icons/fb.png';
196
+ }
197
+
198
+ public function getTwitterIcon() {
199
+ if(trim(Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_TWL)) != '') {
200
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_TWL);
201
+ }
202
+ return 'social_icons/twitter.png';
203
+ }
204
+
205
+ public function getGplusIcon() {
206
+ if(trim(Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_GPL)) != '') {
207
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_GPL);
208
+ }
209
+ return 'social_icons/gplus.png';
210
+ }
211
+
212
+ public function getYoutubeIcon() {
213
+ if(trim(Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_YTL)) != '') {
214
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_YTL);
215
+ }
216
+ return 'social_icons/youtube.png';
217
+ }
218
+
219
+ public function getPinIcon() {
220
+ if(trim(Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_PINL)) != '') {
221
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_PINL);
222
+ }
223
+ return 'social_icons/pinterest.png';
224
+ }
225
+
226
+ public function getLinkedinIcon() {
227
+ if(trim(Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_LINL)) != '') {
228
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_LINL);
229
+ }
230
+ return 'social_icons/linkedin.png';
231
+ }
232
+
233
+ public function getFlickrIcon() {
234
+ if(trim(Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_FLL)) != '') {
235
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_FLL);
236
+ }
237
+ return 'social_icons/flickr.png';
238
+ }
239
+
240
+ public function getVimeoIcon() {
241
+ if(trim(Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_VIML)) != '') {
242
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_VIML);
243
+ }
244
+ return 'social_icons/vimeo.png';
245
+ }
246
+
247
+ public function getInstagramIcon() {
248
+ if(trim(Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_INSL)) != '') {
249
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_INSL);
250
+ }
251
+ return 'social_icons/instagram.png';
252
+ }
253
+
254
+ public function getFoursquareIcon() {
255
+ if(trim(Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_FSL)) != '') {
256
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_FSL);
257
+ }
258
+ return 'social_icons/foursquare.png';
259
+ }
260
+
261
+ public function getTumblrIcon() {
262
+ if(trim(Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_TML)) != '') {
263
+ return Mage::getStoreConfig(self::XML_PATH_SOCIAL_ICON_TML);
264
+ }
265
+ return 'social_icons/tumblr.png';
266
+ }
267
+ }
app/code/community/Dropfin/Newsletterpopup/controllers/SubscriberController.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Dropfin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.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
18
+ * this extension to newer versions in the future.
19
+ *
20
+ * @category Dropfin
21
+ * @package Newsletter Popup
22
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
23
+ */
24
+
25
+ require_once(Mage::getModuleDir('controllers', 'Mage_Newsletter') . DS . 'SubscriberController.php');
26
+ class Dropfin_Newsletterpopup_SubscriberController extends Mage_Core_Controller_Front_Action
27
+ {
28
+ public function newAction()
29
+ {
30
+ if ($this->getRequest()->isPost() && $this->getRequest()->getPost('email')) {
31
+ $session = Mage::getSingleton('core/session');
32
+ $customerSession = Mage::getSingleton('customer/session');
33
+ $email = (string) $this->getRequest()->getPost('email');
34
+
35
+ $subscribeErr = false;
36
+ $isAajax = $this->getRequest()->getPost('is_ajax');
37
+
38
+ try {
39
+ if (!Zend_Validate::is($email, 'EmailAddress')) {
40
+ Mage::throwException($this->__('Please enter a valid email address.'));
41
+ }
42
+
43
+ if (Mage::getStoreConfig(Mage_Newsletter_Model_Subscriber::XML_PATH_ALLOW_GUEST_SUBSCRIBE_FLAG) != 1 && !$customerSession->isLoggedIn()) {
44
+ Mage::throwException($this->__('Sorry, but administrator denied subscription for guests. Please <a href="%s">register</a>.', Mage::helper('customer')->getRegisterUrl()));
45
+ $session->setMyMessage('Sorry, but administrator denied subscription for guests. Please <a href="%s">register</a>.', Mage::helper('customer')->getRegisterUrl());
46
+ $subscribeErr = true;
47
+ }
48
+
49
+ // $ownerId = Mage::getModel('customer/customer')
50
+ // ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
51
+ // ->loadByEmail($email)
52
+ // ->getId();
53
+ $subscriberModel = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
54
+ $subbed = ($subscriberModel->isSubscribed() ? true : false);
55
+
56
+ if ($subbed) {
57
+ Mage::throwException($this->__('This email address is already assigned to another user.'));
58
+ $session->setMyMessage('This email address is already assigned to another user.');
59
+ $subscribeErr = true;
60
+ }
61
+
62
+ $status = Mage::getModel('newsletter/subscriber')->subscribe($email);
63
+ if ($status == Mage_Newsletter_Model_Subscriber::STATUS_NOT_ACTIVE) {
64
+ $session->addSuccess($this->__('Confirmation request has been sent.'));
65
+ } else {
66
+ $session->addSuccess($this->__('Thank you for your subscription'));
67
+ }
68
+ } catch (Mage_Core_Exception $e) {
69
+ $session->addException($e, $this->__('There was a problem with the subscription: %s', $e->getMessage()));
70
+ $subscribeErr = true;
71
+ } catch (Exception $e) {
72
+ $session->addException($e, $this->__('There was a problem with the subscription.'));
73
+ $subscribeErr = true;
74
+ }
75
+ }
76
+
77
+ if ($isAajax == 1) {
78
+
79
+ $subscribeAjaxMessage = array();
80
+ $subscribeSuccess = ($subscribeErr == true) ? 'true' : 'false';
81
+ $subscribeMessage = array();
82
+
83
+ $successMessage = $this->__('Thank you for subscribing to our Newsletter.');
84
+
85
+ $messages = Mage::getSingleton('core/session')->getMessages(true);
86
+ foreach ($messages->getItems() as $message) {
87
+ $subscribeMessage[] = $message->getText();
88
+ }
89
+
90
+ $subscribeAjaxMessage['success'] = $subscribeSuccess;
91
+ $subscribeAjaxMessage['msg'] = implode('<br>', $subscribeMessage);
92
+
93
+ $this->getResponse()->setHeader('Content-type', 'application/json');
94
+ echo $this->getResponse()->setBody(json_encode($subscribeAjaxMessage));
95
+ exit;
96
+ }
97
+ $this->_redirectReferer();
98
+ }
99
+ }
app/code/community/Dropfin/Newsletterpopup/etc/adminhtml.xml ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Dropfin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade
19
+ * this extension to newer versions in the future.
20
+ *
21
+ * @category Dropfin
22
+ * @package Newsletter Popup
23
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
24
+ */
25
+ -->
26
+ <config>
27
+ <menu>
28
+ <system>
29
+ <children>
30
+ <dropfin>
31
+ <title>Dropfin Extensions</title>
32
+ <sort_order>10</sort_order>
33
+ <children>
34
+ <dropfin_newsletterpopup>
35
+ <title>Newsletter Popup</title>
36
+ <action>adminhtml/system_config/edit/section/dropfin_newsletterpopup</action>
37
+ <sort_order>70</sort_order>
38
+ </dropfin_newsletterpopup>
39
+ </children>
40
+ </dropfin>
41
+ </children>
42
+ </system>
43
+ </menu>
44
+ <acl>
45
+ <resources>
46
+ <all>
47
+ <title>Allow Everything</title>
48
+ </all>
49
+ <admin>
50
+ <children>
51
+ <system>
52
+ <children>
53
+ <config>
54
+ <children>
55
+ <dropfin_newsletterpopup>
56
+ <title>Dropfin - Newsletter Popup</title>
57
+ </dropfin_newsletterpopup>
58
+ </children>
59
+ </config>
60
+ </children>
61
+ </system>
62
+ </children>
63
+ </admin>
64
+ </resources>
65
+ </acl>
66
+ </config>
app/code/community/Dropfin/Newsletterpopup/etc/config.xml ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Dropfin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade
19
+ * this extension to newer versions in the future.
20
+ *
21
+ * @category Dropfin
22
+ * @package Newsletter Popup
23
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
24
+ */
25
+ -->
26
+ <config>
27
+ <modules>
28
+ <Dropfin_Newsletterpopup>
29
+ <version>1.0.0</version>
30
+ </Dropfin_Newsletterpopup>
31
+ </modules>
32
+
33
+ <default>
34
+ <dropfin_newsletterpopup>
35
+
36
+ <configurations module="newsletterpopup">
37
+ <enabled>1</enabled>
38
+ <cookies_name>dropfin_newsletter_popup</cookies_name>
39
+ <cookies_timeout>1</cookies_timeout>
40
+ <auto_hide>0</auto_hide>
41
+ <hide_timeout>5</hide_timeout>
42
+ </configurations>
43
+
44
+ <popup_content module="newsletterpopup">
45
+ <title>Join our mailing list</title>
46
+ <sub_title>Subscribe for our latest deals.</sub_title>
47
+ <description>Subscribe and get 5% discount of on your first purchase!!!</description>
48
+ <show_social_links>1</show_social_links>
49
+ <show_social_links_title>1</show_social_links_title>
50
+ <social_links_title>Follow Us:</social_links_title>
51
+ <fb_link>http://www.facebook.com/your-profile-id/</fb_link>
52
+ <twitter_link>http://www.twitter.com/your-profile-id/</twitter_link>
53
+ <gplus_link>http://www.plus.google.com.com/your-profile-id/</gplus_link>
54
+ <youtube_link>http://www.youtube.com/your-profile-id/</youtube_link>
55
+ <pinterest_link>http://www.pinterest.com/your-profile-id/</pinterest_link>
56
+ <linkedin_link>http://www.linkedin.com/your-profile-id/</linkedin_link>
57
+ <flickr_link>http://www.flickr.com/your-profile-id/</flickr_link>
58
+ <vimeo_link>http://www.vimeo.com/your-profile-id/</vimeo_link>
59
+ <instagram_link>http://www.instagram.com/your-profile-id/</instagram_link>
60
+ <foursquare_link>http://www.foursquare.com/your-profile-id/</foursquare_link>
61
+ <tumblr_link>http://www.tumblr.com/your-profile-id/</tumblr_link>
62
+ </popup_content>
63
+
64
+ <popup_design module="newsletterpopup">
65
+ <header_bg>3399cc</header_bg>
66
+ <header_color>ffffff</header_color>
67
+ <popup_border>3399cc</popup_border>
68
+ <popup_text_color>636363</popup_text_color>
69
+ <submit_btn_color>3399cc</submit_btn_color>
70
+ <submit_btn_text_color>ffffff</submit_btn_text_color>
71
+ <icon_size>34</icon_size>
72
+ <fb_icon>social_icons/fb.png</fb_icon>
73
+ <twitter_icon>social_icons/twitter.png</twitter_icon>
74
+ <gplus_icon>social_icons/gplus.png</gplus_icon>
75
+ <youtube_icon>social_icons/youtube.png</youtube_icon>
76
+ <pinterest_icon>social_icons/pinterest.png</pinterest_icon>
77
+ <linkedin_icon>social_icons/linkedin.png</linkedin_icon>
78
+ <flickr_icon>social_icons/flickr.png</flickr_icon>
79
+ <vimeo_icon>social_icons/vimeo.png</vimeo_icon>
80
+ <instagram_icon>social_icons/instagram.png</instagram_icon>
81
+ <foursquare_icon>social_icons/foursquare.png</foursquare_icon>
82
+ <tumblr_icon>social_icons/tumblr.png</tumblr_icon>
83
+ </popup_design>
84
+
85
+ </dropfin_newsletterpopup>
86
+ </default>
87
+
88
+ <adminhtml>
89
+ <layout>
90
+ <updates>
91
+ <dropfin_newsletterpopup>
92
+ <file>dropfin/newsletterpopup.xml</file>
93
+ </dropfin_newsletterpopup>
94
+ </updates>
95
+ </layout>
96
+ </adminhtml>
97
+
98
+ <frontend>
99
+ <routers>
100
+ <newsletter>
101
+ <args>
102
+ <modules>
103
+ <dropfin_newsletterpopup before="Mage_Newsletter">Dropfin_Newsletterpopup</dropfin_newsletterpopup>
104
+ </modules>
105
+ </args>
106
+ </newsletter>
107
+ </routers>
108
+ <layout>
109
+ <updates>
110
+ <dropfin_newsletterpopup>
111
+ <file>dropfin/newsletterpopup.xml</file>
112
+ </dropfin_newsletterpopup>
113
+ </updates>
114
+ </layout>
115
+ </frontend>
116
+
117
+ <global>
118
+ <helpers>
119
+ <dropfin_newsletterpopup>
120
+ <class>Dropfin_Newsletterpopup_Helper</class>
121
+ </dropfin_newsletterpopup>
122
+ </helpers>
123
+
124
+ <blocks>
125
+ <dropfin_newsletterpopup>
126
+ <class>Dropfin_Newsletterpopup_Block</class>
127
+ </dropfin_newsletterpopup>
128
+ </blocks>
129
+ </global>
130
+ </config>
app/code/community/Dropfin/Newsletterpopup/etc/system.xml ADDED
@@ -0,0 +1,572 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Dropfin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade
19
+ * this extension to newer versions in the future.
20
+ *
21
+ * @category Dropfin
22
+ * @package Newsletter Popup
23
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
24
+ */
25
+ -->
26
+ <config>
27
+ <tabs>
28
+ <dropfin translate="label">
29
+ <label>Dropfin</label>
30
+ <sort_order>150</sort_order>
31
+ </dropfin>
32
+ </tabs>
33
+ <sections>
34
+ <dropfin_newsletterpopup translate="label">
35
+ <label>Newsletter Popup</label>
36
+ <tab>dropfin</tab>
37
+ <frontend_type>text</frontend_type>
38
+ <sort_order>70</sort_order>
39
+ <show_in_default>1</show_in_default>
40
+ <show_in_website>1</show_in_website>
41
+ <show_in_store>1</show_in_store>
42
+ <groups>
43
+
44
+ <configurations translate="label">
45
+ <label>General Setting</label>
46
+ <frontend_type>text</frontend_type>
47
+ <sort_order>1</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>1</show_in_website>
50
+ <show_in_store>1</show_in_store>
51
+ <fields>
52
+
53
+ <enabled translate="label">
54
+ <label>Enable</label>
55
+ <frontend_type>select</frontend_type>
56
+ <source_model>adminhtml/system_config_source_yesno</source_model>
57
+ <sort_order>1</sort_order>
58
+ <show_in_default>1</show_in_default>
59
+ <show_in_website>1</show_in_website>
60
+ <show_in_store>1</show_in_store>
61
+ </enabled>
62
+
63
+ <cookies_name translate="label">
64
+ <label>Cookie Name</label>
65
+ <frontend_type>text</frontend_type>
66
+ <sort_order>2</sort_order>
67
+ <show_in_default>1</show_in_default>
68
+ <show_in_website>1</show_in_website>
69
+ <show_in_store>1</show_in_store>
70
+ <depends>
71
+ <enabled>1</enabled>
72
+ </depends>
73
+ </cookies_name>
74
+
75
+ <cookies_timeout translate="label">
76
+ <label>Cookie Life Time (Days)</label>
77
+ <frontend_type>text</frontend_type>
78
+ <sort_order>3</sort_order>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>1</show_in_store>
82
+ <comment>After this days popup will show again</comment>
83
+ <depends>
84
+ <enabled>1</enabled>
85
+ </depends>
86
+ </cookies_timeout>
87
+
88
+ <auto_hide translate="label">
89
+ <label>Auto Hide after Seconds</label>
90
+ <frontend_type>select</frontend_type>
91
+ <source_model>adminhtml/system_config_source_yesno</source_model>
92
+ <sort_order>4</sort_order>
93
+ <show_in_default>1</show_in_default>
94
+ <show_in_website>1</show_in_website>
95
+ <show_in_store>1</show_in_store>
96
+ <comment>Specify whether the popup hide automatically after some times</comment>
97
+ <depends>
98
+ <enabled>1</enabled>
99
+ </depends>
100
+ </auto_hide>
101
+
102
+ <hide_timeout translate="label">
103
+ <label>Time to Hide (Seconds)</label>
104
+ <frontend_type>text</frontend_type>
105
+ <sort_order>5</sort_order>
106
+ <show_in_default>1</show_in_default>
107
+ <show_in_website>1</show_in_website>
108
+ <show_in_store>1</show_in_store>
109
+ <comment>After this time popup will hide automatically</comment>
110
+ <depends>
111
+ <enabled>1</enabled>
112
+ </depends>
113
+ <depends>
114
+ <auto_hide>1</auto_hide>
115
+ </depends>
116
+ </hide_timeout>
117
+
118
+ </fields>
119
+ </configurations>
120
+
121
+ <popup_content translate="label">
122
+ <label>Popup Content Setting</label>
123
+ <frontend_type>text</frontend_type>
124
+ <sort_order>2</sort_order>
125
+ <show_in_default>1</show_in_default>
126
+ <show_in_website>1</show_in_website>
127
+ <show_in_store>1</show_in_store>
128
+ <fields>
129
+
130
+ <title translate="label">
131
+ <label>Title</label>
132
+ <frontend_type>text</frontend_type>
133
+ <sort_order>1</sort_order>
134
+ <show_in_default>1</show_in_default>
135
+ <show_in_website>1</show_in_website>
136
+ <show_in_store>1</show_in_store>
137
+ </title>
138
+
139
+ <sub_title translate="label">
140
+ <label>Sub Title</label>
141
+ <frontend_type>text</frontend_type>
142
+ <sort_order>2</sort_order>
143
+ <show_in_default>1</show_in_default>
144
+ <show_in_website>1</show_in_website>
145
+ <show_in_store>1</show_in_store>
146
+ </sub_title>
147
+
148
+ <description translate="label">
149
+ <label>Description</label>
150
+ <frontend_type>textarea</frontend_type>
151
+ <sort_order>3</sort_order>
152
+ <show_in_default>1</show_in_default>
153
+ <show_in_website>1</show_in_website>
154
+ <show_in_store>1</show_in_store>
155
+ </description>
156
+
157
+ <show_social_links translate="label">
158
+ <label>Show Social Links</label>
159
+ <frontend_type>select</frontend_type>
160
+ <source_model>adminhtml/system_config_source_yesno</source_model>
161
+ <sort_order>4</sort_order>
162
+ <show_in_default>1</show_in_default>
163
+ <show_in_website>1</show_in_website>
164
+ <show_in_store>1</show_in_store>
165
+ </show_social_links>
166
+
167
+ <show_social_links_title translate="label">
168
+ <label>Show Social Links Title</label>
169
+ <frontend_type>select</frontend_type>
170
+ <source_model>adminhtml/system_config_source_yesno</source_model>
171
+ <sort_order>5</sort_order>
172
+ <show_in_default>1</show_in_default>
173
+ <show_in_website>1</show_in_website>
174
+ <show_in_store>1</show_in_store>
175
+ <depends>
176
+ <show_social_links>1</show_social_links>
177
+ </depends>
178
+ </show_social_links_title>
179
+
180
+ <social_links_title translate="label">
181
+ <label>Social Links Title</label>
182
+ <frontend_type>text</frontend_type>
183
+ <sort_order>6</sort_order>
184
+ <show_in_default>1</show_in_default>
185
+ <show_in_website>1</show_in_website>
186
+ <show_in_store>1</show_in_store>
187
+ <depends>
188
+ <show_social_links_title>1</show_social_links_title>
189
+ <show_social_links>1</show_social_links>
190
+ </depends>
191
+ </social_links_title>
192
+
193
+ <fb_link translate="label">
194
+ <label>Facebook Page Link</label>
195
+ <frontend_type>text</frontend_type>
196
+ <sort_order>7</sort_order>
197
+ <show_in_default>1</show_in_default>
198
+ <show_in_website>1</show_in_website>
199
+ <show_in_store>1</show_in_store>
200
+ <comment>Ex: http://www.facebook.com/your-profile-id/</comment>
201
+ <depends>
202
+ <show_social_links>1</show_social_links>
203
+ </depends>
204
+ </fb_link>
205
+
206
+ <twitter_link translate="label">
207
+ <label>Twitter Page Link</label>
208
+ <frontend_type>text</frontend_type>
209
+ <sort_order>8</sort_order>
210
+ <show_in_default>1</show_in_default>
211
+ <show_in_website>1</show_in_website>
212
+ <show_in_store>1</show_in_store>
213
+ <comment>Ex: http://www.twitter.com/your-profile-id/</comment>
214
+ <depends>
215
+ <show_social_links>1</show_social_links>
216
+ </depends>
217
+ </twitter_link>
218
+
219
+ <gplus_link translate="label">
220
+ <label>Google Plus Page Link</label>
221
+ <frontend_type>text</frontend_type>
222
+ <sort_order>9</sort_order>
223
+ <show_in_default>1</show_in_default>
224
+ <show_in_website>1</show_in_website>
225
+ <show_in_store>1</show_in_store>
226
+ <comment>Ex: http://www.plus.google.com.com/your-profile-id/</comment>
227
+ <depends>
228
+ <show_social_links>1</show_social_links>
229
+ </depends>
230
+ </gplus_link>
231
+
232
+ <youtube_link translate="label">
233
+ <label>Youtube Page Link</label>
234
+ <frontend_type>text</frontend_type>
235
+ <sort_order>10</sort_order>
236
+ <show_in_default>1</show_in_default>
237
+ <show_in_website>1</show_in_website>
238
+ <show_in_store>1</show_in_store>
239
+ <comment>Ex: http://www.youtube.com/your-profile-id/</comment>
240
+ <depends>
241
+ <show_social_links>1</show_social_links>
242
+ </depends>
243
+ </youtube_link>
244
+
245
+ <pinterest_link translate="label">
246
+ <label>Pinterest Page Link</label>
247
+ <frontend_type>text</frontend_type>
248
+ <sort_order>11</sort_order>
249
+ <show_in_default>1</show_in_default>
250
+ <show_in_website>1</show_in_website>
251
+ <show_in_store>1</show_in_store>
252
+ <comment>Ex: http://www.pinterest.com/your-profile-id/</comment>
253
+ <depends>
254
+ <show_social_links>1</show_social_links>
255
+ </depends>
256
+ </pinterest_link>
257
+
258
+ <linkedin_link translate="label">
259
+ <label>LinkedIn Page Link</label>
260
+ <frontend_type>text</frontend_type>
261
+ <sort_order>12</sort_order>
262
+ <show_in_default>1</show_in_default>
263
+ <show_in_website>1</show_in_website>
264
+ <show_in_store>1</show_in_store>
265
+ <comment>Ex: http://www.linkedin.com/your-profile-id/</comment>
266
+ <depends>
267
+ <show_social_links>1</show_social_links>
268
+ </depends>
269
+ </linkedin_link>
270
+
271
+ <flickr_link translate="label">
272
+ <label>Flickr Page Link</label>
273
+ <frontend_type>text</frontend_type>
274
+ <sort_order>13</sort_order>
275
+ <show_in_default>1</show_in_default>
276
+ <show_in_website>1</show_in_website>
277
+ <show_in_store>1</show_in_store>
278
+ <comment>Ex: http://www.flickr.com/your-profile-id/</comment>
279
+ <depends>
280
+ <show_social_links>1</show_social_links>
281
+ </depends>
282
+ </flickr_link>
283
+
284
+ <vimeo_link translate="label">
285
+ <label>Vimeo Page Link</label>
286
+ <frontend_type>text</frontend_type>
287
+ <sort_order>14</sort_order>
288
+ <show_in_default>1</show_in_default>
289
+ <show_in_website>1</show_in_website>
290
+ <show_in_store>1</show_in_store>
291
+ <comment>Ex: http://www.vimeo.com/your-profile-id/</comment>
292
+ <depends>
293
+ <show_social_links>1</show_social_links>
294
+ </depends>
295
+ </vimeo_link>
296
+
297
+ <instagram_link translate="label">
298
+ <label>Instagram Page Link</label>
299
+ <frontend_type>text</frontend_type>
300
+ <sort_order>15</sort_order>
301
+ <show_in_default>1</show_in_default>
302
+ <show_in_website>1</show_in_website>
303
+ <show_in_store>1</show_in_store>
304
+ <comment>Ex: http://www.instagram.com/your-profile-id/</comment>
305
+ <depends>
306
+ <show_social_links>1</show_social_links>
307
+ </depends>
308
+ </instagram_link>
309
+
310
+ <foursquare_link translate="label">
311
+ <label>FourSquare Page Link</label>
312
+ <frontend_type>text</frontend_type>
313
+ <sort_order>16</sort_order>
314
+ <show_in_default>1</show_in_default>
315
+ <show_in_website>1</show_in_website>
316
+ <show_in_store>1</show_in_store>
317
+ <comment>Ex: http://www.foursquare.com/your-profile-id/</comment>
318
+ <depends>
319
+ <show_social_links>1</show_social_links>
320
+ </depends>
321
+ </foursquare_link>
322
+
323
+ <tumblr_link translate="label">
324
+ <label>Tumblr Page Link</label>
325
+ <frontend_type>text</frontend_type>
326
+ <sort_order>17</sort_order>
327
+ <show_in_default>1</show_in_default>
328
+ <show_in_website>1</show_in_website>
329
+ <show_in_store>1</show_in_store>
330
+ <comment>Ex: http://www.tumblr.com/your-profile-id/</comment>
331
+ <depends>
332
+ <show_social_links>1</show_social_links>
333
+ </depends>
334
+ </tumblr_link>
335
+
336
+ </fields>
337
+ </popup_content>
338
+
339
+ <popup_design translate="label">
340
+ <label>Popup Design Setting</label>
341
+ <frontend_type>text</frontend_type>
342
+ <sort_order>3</sort_order>
343
+ <show_in_default>1</show_in_default>
344
+ <show_in_website>1</show_in_website>
345
+ <show_in_store>1</show_in_store>
346
+ <fields>
347
+
348
+ <header_bg translate="label">
349
+ <label>Header Background Color</label>
350
+ <frontend_type>text</frontend_type>
351
+ <frontend_model>dropfin_newsletterpopup/adminhtml_system_config_color</frontend_model>
352
+ <validate>color</validate>
353
+ <sort_order>1</sort_order>
354
+ <show_in_default>1</show_in_default>
355
+ <show_in_website>1</show_in_website>
356
+ <show_in_store>1</show_in_store>
357
+ </header_bg>
358
+
359
+ <header_color translate="label">
360
+ <label>Header Text Color</label>
361
+ <frontend_type>text</frontend_type>
362
+ <frontend_model>dropfin_newsletterpopup/adminhtml_system_config_color</frontend_model>
363
+ <validate>color</validate>
364
+ <sort_order>2</sort_order>
365
+ <show_in_default>1</show_in_default>
366
+ <show_in_website>1</show_in_website>
367
+ <show_in_store>1</show_in_store>
368
+ </header_color>
369
+
370
+ <popup_border translate="label">
371
+ <label>Popup Border Color</label>
372
+ <frontend_type>text</frontend_type>
373
+ <frontend_model>dropfin_newsletterpopup/adminhtml_system_config_color</frontend_model>
374
+ <validate>color</validate>
375
+ <sort_order>3</sort_order>
376
+ <show_in_default>1</show_in_default>
377
+ <show_in_website>1</show_in_website>
378
+ <show_in_store>1</show_in_store>
379
+ </popup_border>
380
+
381
+ <popup_text_color translate="label">
382
+ <label>Popup Text Color</label>
383
+ <frontend_type>text</frontend_type>
384
+ <frontend_model>dropfin_newsletterpopup/adminhtml_system_config_color</frontend_model>
385
+ <validate>color</validate>
386
+ <sort_order>4</sort_order>
387
+ <show_in_default>1</show_in_default>
388
+ <show_in_website>1</show_in_website>
389
+ <show_in_store>1</show_in_store>
390
+ </popup_text_color>
391
+
392
+ <submit_btn_color translate="label">
393
+ <label>Submit Button Color</label>
394
+ <frontend_type>text</frontend_type>
395
+ <frontend_model>dropfin_newsletterpopup/adminhtml_system_config_color</frontend_model>
396
+ <validate>color</validate>
397
+ <sort_order>5</sort_order>
398
+ <show_in_default>1</show_in_default>
399
+ <show_in_website>1</show_in_website>
400
+ <show_in_store>1</show_in_store>
401
+ </submit_btn_color>
402
+
403
+ <submit_btn_text_color translate="label">
404
+ <label>Submit Button Text Color</label>
405
+ <frontend_type>text</frontend_type>
406
+ <frontend_model>dropfin_newsletterpopup/adminhtml_system_config_color</frontend_model>
407
+ <validate>color</validate>
408
+ <sort_order>6</sort_order>
409
+ <show_in_default>1</show_in_default>
410
+ <show_in_website>1</show_in_website>
411
+ <show_in_store>1</show_in_store>
412
+ </submit_btn_text_color>
413
+
414
+ <icon_size translate="label">
415
+ <label>Social Icon Size</label>
416
+ <frontend_type>text</frontend_type>
417
+ <sort_order>7</sort_order>
418
+ <show_in_default>1</show_in_default>
419
+ <show_in_website>1</show_in_website>
420
+ <show_in_store>1</show_in_store>
421
+ </icon_size>
422
+
423
+ <fb_icon translate="label">
424
+ <label>Facebook Icon</label>
425
+ <frontend_type>image</frontend_type>
426
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
427
+ <upload_dir config="system/filesystem/media" scope_info="1">dropfin/newsletterpopup</upload_dir>
428
+ <base_url type="media" scope_info="1">dropfin/newsletterpopup</base_url>
429
+ <sort_order>8</sort_order>
430
+ <show_in_default>1</show_in_default>
431
+ <show_in_website>1</show_in_website>
432
+ <show_in_store>1</show_in_store>
433
+ <validate>required-entry</validate>
434
+ </fb_icon>
435
+
436
+ <twitter_icon translate="label">
437
+ <label>Twitter Icon</label>
438
+ <frontend_type>image</frontend_type>
439
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
440
+ <upload_dir config="system/filesystem/media" scope_info="1">dropfin/newsletterpopup</upload_dir>
441
+ <base_url type="media" scope_info="1">dropfin/newsletterpopup</base_url>
442
+ <sort_order>9</sort_order>
443
+ <show_in_default>1</show_in_default>
444
+ <show_in_website>1</show_in_website>
445
+ <show_in_store>1</show_in_store>
446
+ <validate>required-entry</validate>
447
+ </twitter_icon>
448
+
449
+ <gplus_icon translate="label">
450
+ <label>Google Plus Icon</label>
451
+ <frontend_type>image</frontend_type>
452
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
453
+ <upload_dir config="system/filesystem/media" scope_info="1">dropfin/newsletterpopup</upload_dir>
454
+ <base_url type="media" scope_info="1">dropfin/newsletterpopup</base_url>
455
+ <sort_order>10</sort_order>
456
+ <show_in_default>1</show_in_default>
457
+ <show_in_website>1</show_in_website>
458
+ <show_in_store>1</show_in_store>
459
+ <validate>required-entry</validate>
460
+ </gplus_icon>
461
+
462
+ <youtube_icon translate="label">
463
+ <label>Youtube Icon</label>
464
+ <frontend_type>image</frontend_type>
465
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
466
+ <upload_dir config="system/filesystem/media" scope_info="1">dropfin/newsletterpopup</upload_dir>
467
+ <base_url type="media" scope_info="1">dropfin/newsletterpopup</base_url>
468
+ <sort_order>11</sort_order>
469
+ <show_in_default>1</show_in_default>
470
+ <show_in_website>1</show_in_website>
471
+ <show_in_store>1</show_in_store>
472
+ <validate>required-entry</validate>
473
+ </youtube_icon>
474
+
475
+ <pinterest_icon translate="label">
476
+ <label>Pinterest Icon</label>
477
+ <frontend_type>image</frontend_type>
478
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
479
+ <upload_dir config="system/filesystem/media" scope_info="1">dropfin/newsletterpopup</upload_dir>
480
+ <base_url type="media" scope_info="1">dropfin/newsletterpopup</base_url>
481
+ <sort_order>12</sort_order>
482
+ <show_in_default>1</show_in_default>
483
+ <show_in_website>1</show_in_website>
484
+ <show_in_store>1</show_in_store>
485
+ <validate>required-entry</validate>
486
+ </pinterest_icon>
487
+
488
+ <linkedin_icon translate="label">
489
+ <label>Linkedin Icon</label>
490
+ <frontend_type>image</frontend_type>
491
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
492
+ <upload_dir config="system/filesystem/media" scope_info="1">dropfin/newsletterpopup</upload_dir>
493
+ <base_url type="media" scope_info="1">dropfin/newsletterpopup</base_url>
494
+ <sort_order>13</sort_order>
495
+ <show_in_default>1</show_in_default>
496
+ <show_in_website>1</show_in_website>
497
+ <show_in_store>1</show_in_store>
498
+ <validate>required-entry</validate>
499
+ </linkedin_icon>
500
+
501
+ <flickr_icon translate="label">
502
+ <label>Flickr Icon</label>
503
+ <frontend_type>image</frontend_type>
504
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
505
+ <upload_dir config="system/filesystem/media" scope_info="1">dropfin/newsletterpopup</upload_dir>
506
+ <base_url type="media" scope_info="1">dropfin/newsletterpopup</base_url>
507
+ <sort_order>14</sort_order>
508
+ <show_in_default>1</show_in_default>
509
+ <show_in_website>1</show_in_website>
510
+ <show_in_store>1</show_in_store>
511
+ <validate>required-entry</validate>
512
+ </flickr_icon>
513
+
514
+ <vimeo_icon translate="label">
515
+ <label>Vimeo Icon</label>
516
+ <frontend_type>image</frontend_type>
517
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
518
+ <upload_dir config="system/filesystem/media" scope_info="1">dropfin/newsletterpopup</upload_dir>
519
+ <base_url type="media" scope_info="1">dropfin/newsletterpopup</base_url>
520
+ <sort_order>15</sort_order>
521
+ <show_in_default>1</show_in_default>
522
+ <show_in_website>1</show_in_website>
523
+ <show_in_store>1</show_in_store>
524
+ <validate>required-entry</validate>
525
+ </vimeo_icon>
526
+
527
+ <instagram_icon translate="label">
528
+ <label>Instagram Icon</label>
529
+ <frontend_type>image</frontend_type>
530
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
531
+ <upload_dir config="system/filesystem/media" scope_info="1">dropfin/newsletterpopup</upload_dir>
532
+ <base_url type="media" scope_info="1">dropfin/newsletterpopup</base_url>
533
+ <sort_order>16</sort_order>
534
+ <show_in_default>1</show_in_default>
535
+ <show_in_website>1</show_in_website>
536
+ <show_in_store>1</show_in_store>
537
+ <validate>required-entry</validate>
538
+ </instagram_icon>
539
+
540
+ <foursquare_icon translate="label">
541
+ <label>Foursquare Icon</label>
542
+ <frontend_type>image</frontend_type>
543
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
544
+ <upload_dir config="system/filesystem/media" scope_info="1">dropfin/newsletterpopup</upload_dir>
545
+ <base_url type="media" scope_info="1">dropfin/newsletterpopup</base_url>
546
+ <sort_order>17</sort_order>
547
+ <show_in_default>1</show_in_default>
548
+ <show_in_website>1</show_in_website>
549
+ <show_in_store>1</show_in_store>
550
+ <validate>required-entry</validate>
551
+ </foursquare_icon>
552
+
553
+ <tumblr_icon translate="label">
554
+ <label>Tumblr Icon</label>
555
+ <frontend_type>image</frontend_type>
556
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
557
+ <upload_dir config="system/filesystem/media" scope_info="1">dropfin/newsletterpopup</upload_dir>
558
+ <base_url type="media" scope_info="1">dropfin/newsletterpopup</base_url>
559
+ <sort_order>18</sort_order>
560
+ <show_in_default>1</show_in_default>
561
+ <show_in_website>1</show_in_website>
562
+ <show_in_store>1</show_in_store>
563
+ <validate>required-entry</validate>
564
+ </tumblr_icon>
565
+
566
+ </fields>
567
+ </popup_design>
568
+
569
+ </groups>
570
+ </dropfin_newsletterpopup>
571
+ </sections>
572
+ </config>
app/design/adminhtml/default/default/layout/dropfin/newsletterpopup.xml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Dropfin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade
19
+ * this extension to newer versions in the future.
20
+ *
21
+ * @category Dropfin
22
+ * @package Newsletter Popup
23
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
24
+ */
25
+ -->
26
+
27
+ <layout version="0.1.1">
28
+ <adminhtml_system_config_edit>
29
+ <reference name="head">
30
+ <action method="addItem">
31
+ <type>skin_js</type>
32
+ <name>dropfin/newsletterpopup/js/jscolor.js</name>
33
+ </action>
34
+ </reference>
35
+ </adminhtml_system_config_edit>
36
+ </layout>
app/design/frontend/base/default/layout/dropfin/newsletterpopup.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Dropfin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade
19
+ * this extension to newer versions in the future.
20
+ *
21
+ * @category Dropfin
22
+ * @package Newsletter Popup
23
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
24
+ */
25
+ -->
26
+ <layout>
27
+ <default>
28
+
29
+ <reference name="head">
30
+ <action method="addItem">
31
+ <type>skin_css</type>
32
+ <name>dropfin/newsletterpopup/css/jquery.fancybox-1.3.4.css</name>
33
+ </action>
34
+ <action method="addItem">
35
+ <type>skin_css</type>
36
+ <name>dropfin/newsletterpopup/css/style.css</name>
37
+ </action>
38
+ <action method="addItem">
39
+ <type>skin_js</type>
40
+ <name>dropfin/newsletterpopup/js/jquery-1.7.2.min.js</name>
41
+ </action>
42
+ <action method="addItem">
43
+ <type>skin_js</type>
44
+ <name>dropfin/newsletterpopup/js/jquery.fancybox-1.3.4.js</name>
45
+ </action>
46
+ <action method="addItem">
47
+ <type>skin_js</type>
48
+ <name>dropfin/newsletterpopup/js/jquery.validate.min.js</name>
49
+ </action>
50
+ <action method="addItem">
51
+ <type>skin_js</type>
52
+ <name>dropfin/newsletterpopup/js/newsletterpopup.js</name>
53
+ </action>
54
+ </reference>
55
+
56
+ <reference name="after_body_start">
57
+ <block type="newsletter/subscribe" name="dropfin_newsletterpopup" as="dropfin.newsletterpopup" template="dropfin/newsletterpopup/popup.phtml"/>
58
+ </reference>
59
+
60
+ </default>
61
+ </layout>
app/design/frontend/base/default/template/dropfin/newsletterpopup/popup.phtml ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Dropfin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.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
18
+ * this extension to newer versions in the future.
19
+ *
20
+ * @category Dropfin
21
+ * @package Newsletter Popup
22
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
23
+ */
24
+ ?>
25
+
26
+ <?php
27
+ $newsletterPopupHelper = $this->helper('dropfin_newsletterpopup');
28
+ $cookie_name = $newsletterPopupHelper->getCookieName();
29
+
30
+ if($newsletterPopupHelper->getStatus() && !isset($_COOKIE[$cookie_name])) {
31
+
32
+ $_existCookieTime = (isset($_COOKIE[$cookie_name]) ? $_COOKIE[$_COOKIE[$cookie_name]] : 0);
33
+ $_currentTime = mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"));
34
+ $_timeDiff = $_currentTime - $_existCookieTime;
35
+
36
+ $lifeTime = (int) $newsletterPopupHelper->getCookieLifeTime();
37
+ $lifeTime = $lifeTime * 24 * 60 * 60;
38
+ if ($_timeDiff > $lifeTime){
39
+
40
+ setcookie($cookie_name, $_currentTime, time() + ($lifeTime), "/");
41
+ ?>
42
+ <style type="text/css">
43
+ .popup-top h2 {background-color: #<?php echo $newsletterPopupHelper->getHeaderBg();?>; color: #<?php echo $newsletterPopupHelper->getHeaderColor();?>;}
44
+ .popup-top { border-bottom: 1px dotted #<?php echo $newsletterPopupHelper->getBorderColor();?>; color: #<?php echo $newsletterPopupHelper->getPopupTextColor();?>; }
45
+ .popup-top h4, .popup-bottom h4 { color: #<?php echo $newsletterPopupHelper->getPopupTextColor();?>; }
46
+ #fancybox-content{border: 1px solid #<?php echo $newsletterPopupHelper->getBorderColor();?> !important;}
47
+ button.newsletter-btn {background: #<?php echo $newsletterPopupHelper->getButtonColor();?>; color: #<?php echo $newsletterPopupHelper->getButtonTextColor();?>}
48
+ </style>
49
+ <div id="popup_content" class="popup-content">
50
+ <div class="popup-top">
51
+ <h2><?php echo $newsletterPopupHelper->getPopupTitle() ?></h2>
52
+ <div class="popup-top-content">
53
+ <h4><?php echo $newsletterPopupHelper->getPopupSubTitle() ?></h4>
54
+ <p><?php echo $newsletterPopupHelper->getPopupDescription() ?></p>
55
+ <div class="newsletter_form">
56
+ <form action="<?php echo $this->getFormActionUrl(); ?>" name="newsletter" id="newsletter-popup-form" method="post">
57
+ <div class="div-input">
58
+ <input type="text" name="email" id="email" value="<?php echo $this->__('Enter your email address here') ?>" class="input-text required-entry validate-email" onfocus="keyFocus(this, '<?php echo $this->__('Enter your email address here') ?>')" onblur="keyBlur(this, '<?php echo $this->__('Enter your email address here') ?>')" />
59
+ <input type="hidden" name="is_ajax" value="1" />
60
+ </div>
61
+ <button type="submit" class="newsletter-btn button" title="<?php echo $this->__('Subscribe') ?>"><span><span><?php echo $this->__('Subscribe') ?></span></span></button>
62
+ </form>
63
+ </div>
64
+ <div class="newsletter_status"></div>
65
+ </div>
66
+ </div>
67
+ <?php if($newsletterPopupHelper->getShowSocialLinks()) :?>
68
+ <div class="popup-bottom">
69
+ <?php if($newsletterPopupHelper->getShowSocialLinksTitle()) { ?>
70
+ <h4><?php echo $newsletterPopupHelper->getSocialLinksTitle() ?></h4>
71
+ <?php } ?>
72
+ <ul>
73
+ <?php $media = Mage::getBaseUrl('media').'dropfin/newsletterpopup/';?>
74
+ <?php if(trim($newsletterPopupHelper->getFBLink()) != '') { ?>
75
+ <li><a href="<?php echo $newsletterPopupHelper->getFBLink();?>" target="_blank"><img src="<?php echo $media.$newsletterPopupHelper->getFBIcon();?>" alt="<?php echo $this->__('Facebook');?>" width="<?php echo $newsletterPopupHelper->getIconSize();?>" height="<?php echo $newsletterPopupHelper->getIconSize();?>" /></a></li>
76
+ <?php } ?>
77
+
78
+ <?php if(trim($newsletterPopupHelper->getTwitterLink()) != '') { ?>
79
+ <li><a href="<?php echo $newsletterPopupHelper->getTwitterLink();?>" target="_blank"><img src="<?php echo $media.$newsletterPopupHelper->getTwitterIcon();?>" alt="<?php echo $this->__('Twitter');?>" width="<?php echo $newsletterPopupHelper->getIconSize();?>" height="<?php echo $newsletterPopupHelper->getIconSize();?>" /></a></li>
80
+ <?php } ?>
81
+
82
+ <?php if(trim($newsletterPopupHelper->getGplusLink()) != '') { ?>
83
+ <li><a href="<?php echo $newsletterPopupHelper->getGplusLink();?>" target="_blank"><img src="<?php echo $media.$newsletterPopupHelper->getGplusIcon();?>" alt="<?php echo $this->__('GPlus');?>" width="<?php echo $newsletterPopupHelper->getIconSize();?>" height="<?php echo $newsletterPopupHelper->getIconSize();?>" /></a></li>
84
+ <?php } ?>
85
+
86
+ <?php if(trim($newsletterPopupHelper->getYoutubeLink()) != '') { ?>
87
+ <li><a href="<?php echo $newsletterPopupHelper->getYoutubeLink();?>" target="_blank"><img src="<?php echo $media.$newsletterPopupHelper->getYoutubeIcon();?>" alt="<?php echo $this->__('Youtube');?>" width="<?php echo $newsletterPopupHelper->getIconSize();?>" height="<?php echo $newsletterPopupHelper->getIconSize();?>" /></a></li>
88
+ <?php } ?>
89
+
90
+ <?php if(trim($newsletterPopupHelper->getPinLink()) != '') { ?>
91
+ <li><a href="<?php echo $newsletterPopupHelper->getPinLink();?>" target="_blank"><img src="<?php echo $media.$newsletterPopupHelper->getPinIcon();?>" alt="<?php echo $this->__('Pinterest');?>" width="<?php echo $newsletterPopupHelper->getIconSize();?>" height="<?php echo $newsletterPopupHelper->getIconSize();?>" /></a></li>
92
+ <?php } ?>
93
+
94
+ <?php if(trim($newsletterPopupHelper->getLinkedinLink()) != '') { ?>
95
+ <li><a href="<?php echo $newsletterPopupHelper->getLinkedinLink();?>" target="_blank"><img src="<?php echo $media.$newsletterPopupHelper->getLinkedinIcon();?>" alt="<?php echo $this->__('Linkedin');?>" width="<?php echo $newsletterPopupHelper->getIconSize();?>" height="<?php echo $newsletterPopupHelper->getIconSize();?>" /></a></li>
96
+ <?php } ?>
97
+
98
+ <?php if(trim($newsletterPopupHelper->getFlickrLink()) != '') { ?>
99
+ <li><a href="<?php echo $newsletterPopupHelper->getFlickrLink();?>" target="_blank"><img src="<?php echo $media.$newsletterPopupHelper->getFlickrIcon();?>" alt="<?php echo $this->__('Flickr');?>" width="<?php echo $newsletterPopupHelper->getIconSize();?>" height="<?php echo $newsletterPopupHelper->getIconSize();?>" /></a></li>
100
+ <?php } ?>
101
+
102
+ <?php if(trim($newsletterPopupHelper->getVimeoLink()) != '') { ?>
103
+ <li><a href="<?php echo $newsletterPopupHelper->getVimeoLink();?>" target="_blank"><img src="<?php echo $media.$newsletterPopupHelper->getVimeoIcon();?>" alt="<?php echo $this->__('Vimeo');?>" width="<?php echo $newsletterPopupHelper->getIconSize();?>" height="<?php echo $newsletterPopupHelper->getIconSize();?>" /></a></li>
104
+ <?php } ?>
105
+
106
+ <?php if(trim($newsletterPopupHelper->getInstagramLink()) != '') { ?>
107
+ <li><a href="<?php echo $newsletterPopupHelper->getInstagramLink();?>" target="_blank"><img src="<?php echo $media.$newsletterPopupHelper->getInstagramIcon();?>" alt="<?php echo $this->__('Instagram');?>" width="<?php echo $newsletterPopupHelper->getIconSize();?>" height="<?php echo $newsletterPopupHelper->getIconSize();?>" /></a></li>
108
+ <?php } ?>
109
+
110
+ <?php if(trim($newsletterPopupHelper->getFoursquareLink()) != '') { ?>
111
+ <li><a href="<?php echo $newsletterPopupHelper->getFoursquareLink();?>" target="_blank"><img src="<?php echo $media.$newsletterPopupHelper->getFoursquareIcon();?>" alt="<?php echo $this->__('Foursquare');?>" width="<?php echo $newsletterPopupHelper->getIconSize();?>" height="<?php echo $newsletterPopupHelper->getIconSize();?>" /></a></li>
112
+ <?php } ?>
113
+
114
+ <?php if(trim($newsletterPopupHelper->getTumblrLink()) != '') { ?>
115
+ <li><a href="<?php echo $newsletterPopupHelper->getTumblrLink();?>" target="_blank"><img src="<?php echo $media.$newsletterPopupHelper->getTumblrIcon();?>" alt="<?php echo $this->__('Tumblr');?>" width="<?php echo $newsletterPopupHelper->getIconSize();?>" height="<?php echo $newsletterPopupHelper->getIconSize();?>" /></a></li>
116
+ <?php } ?>
117
+ </ul>
118
+ </div>
119
+ <?php endif; ?>
120
+ </div>
121
+
122
+ <script type="text/javascript">
123
+ jQuery.noConflict();
124
+ jQuery(document).ready(function($) {
125
+
126
+ $.fancybox($("#popup_content").html());
127
+
128
+ $(".popup-top > div > div > #newsletter-popup-form").submit(function(e) {
129
+ var postData = $(this).serializeArray();
130
+ var formURL = $(this).attr("action");
131
+
132
+ $(this).validate({
133
+ rules: {
134
+ email: {
135
+ required: true,
136
+ email: true
137
+ },
138
+ },
139
+ messages: {
140
+ email: "<?php echo $this->__('A valid email address is required');?>"
141
+ }
142
+ });
143
+
144
+ if (!$(this).valid()){ return false; }
145
+
146
+ $('.newsletter-btn').attr("disabled", true);
147
+ $('.newsletter-btn').html('<span><span><?php echo $this->__('Loading...') ?></span></span>');
148
+ $.ajax({
149
+ url : formURL,
150
+ type: "POST",
151
+ data : postData,
152
+ success:function(data, textStatus, jqXHR) {
153
+ $('.newsletter-btn').html('<span><span><?php echo $this->__('Subscribe') ?></span></span>');
154
+ $('.newsletter-btn').attr("disabled", false);
155
+ $('.newsletter_status').removeClass('success');
156
+ $('.newsletter_status').removeClass('error');
157
+ if(data.success == 'false') {
158
+ $('.newsletter_form').hide();
159
+ $('.newsletter_status').html(data.msg);
160
+ $('.newsletter_status').addClass('success');
161
+ $('.newsletter_status').fadeIn('slow');
162
+ } else {
163
+ $('.newsletter_status').html(data.msg);
164
+ $('.newsletter_status').fadeIn('slow');
165
+ $('.newsletter_status').addClass('error');
166
+ }
167
+ },
168
+ error: function(jqXHR, textStatus, errorThrown) {
169
+ $('.newsletter-btn').attr("disabled", false);
170
+ }
171
+ });
172
+ e.preventDefault();
173
+ });
174
+
175
+ <?php if($timeOut = (int) $newsletterPopupHelper->getTimeOut()) { ?>
176
+ setTimeout( function() {
177
+ $.fancybox.close('slow');
178
+ }, <?php echo ($timeOut * 1000); ?>);
179
+ <?php } ?>
180
+
181
+ });
182
+ </script>
183
+
184
+ <?php
185
+ }
186
+ }
app/etc/modules/Dropfin_Newsletterpopup.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Dropfin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade
19
+ * this extension to newer versions in the future.
20
+ *
21
+ * @category Dropfin
22
+ * @package Newsletter Popup
23
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
24
+ */
25
+ -->
26
+ <config>
27
+ <modules>
28
+ <Dropfin_Newsletterpopup>
29
+ <active>true</active>
30
+ <codePool>community</codePool>
31
+ </Dropfin_Newsletterpopup>
32
+ </modules>
33
+ </config>
media/dropfin/newsletterpopup/social_icons/fb.png ADDED
Binary file
media/dropfin/newsletterpopup/social_icons/flickr.png ADDED
Binary file
media/dropfin/newsletterpopup/social_icons/foursquare.png ADDED
Binary file
media/dropfin/newsletterpopup/social_icons/gplus.png ADDED
Binary file
media/dropfin/newsletterpopup/social_icons/instagram.png ADDED
Binary file
media/dropfin/newsletterpopup/social_icons/linkedin.png ADDED
Binary file
media/dropfin/newsletterpopup/social_icons/pinterest.png ADDED
Binary file
media/dropfin/newsletterpopup/social_icons/tumblr.png ADDED
Binary file
media/dropfin/newsletterpopup/social_icons/twitter.png ADDED
Binary file
media/dropfin/newsletterpopup/social_icons/vimeo.png ADDED
Binary file
media/dropfin/newsletterpopup/social_icons/youtube.png ADDED
Binary file
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Dropfin_Newsletterpopup</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v.3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Dropfin Newsletter Popup</summary>
10
+ <description>Dropfin Newsletter Popup</description>
11
+ <notes>Dropfin Newsletter Popup</notes>
12
+ <authors><author><name>Dropfin</name><user>Dropfin</user><email>t.balamani88@gmail.com</email></author></authors>
13
+ <date>2016-08-17</date>
14
+ <time>07:13:47</time>
15
+ <contents><target name="magecommunity"><dir name="Dropfin"><dir name="Newsletterpopup"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Color.php" hash="89aaa82c65e4309d213bdeb5e1f66bfb"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="4a4af7aaebe93c0d0cad10832921ac89"/></dir></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Helper"><file name="Data.php" hash="857f6356c161069f8ba088b746ada6b9"/></dir><dir name="controllers"><file name="SubscriberController.php" hash="69d1294f5c51432cd9b4cea17627fe6a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c8a0359b77ef400ce3ec0714bcdca24b"/><file name="config.xml" hash="7f7cf9894666886b22fbcbb925c13cc4"/><file name="system.xml" hash="2bc303ade4238976a560e08db2b2ab1f"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="dropfin"><file name="newsletterpopup.xml" hash="861444f2a015d0850ed970911d48efda"/></dir></dir><dir name="template"><dir name="dropfin"><dir name="newsletterpopup"><file name="popup.phtml" hash="875a4c033fd2d2b56461d6522542bea2"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="dropfin"><file name="newsletterpopup.xml" hash="c768214508a6d45e9161a91c0efdd2e2"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Dropfin_Newsletterpopup.xml" hash="a8a3205fae36dc96a545277007a722f1"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="dropfin"><dir name="newsletterpopup"><dir><dir name="css"><file name="jquery.fancybox-1.3.4.css" hash="8bf563bdcd33bc37ff0ce4c98f4cb9c7"/><file name="style.css" hash="2b6050439f3c0079180d04b188e312da"/></dir><dir name="images"><file name="blank.gif" hash="325472601571f31e1bf00674c368d335"/><file name="fancy_close.png" hash="6e2879a324a76e9972ebc98201aae1d8"/><file name="fancy_loading.png" hash="b1d54c240cf06e7f41e372d56919b738"/><file name="fancy_nav_left.png" hash="3f3e406102152cd8236383568a40ba35"/><file name="fancy_nav_right.png" hash="216e4bde5bddeeaa60dc3d692890a68e"/><file name="fancy_shadow_e.png" hash="fd4f491080d29fade5080877f1ba4c8b"/><file name="fancy_shadow_n.png" hash="18cde16379b2ceadef714d9b346d09ec"/><file name="fancy_shadow_ne.png" hash="63adf788acf193d4e4f3642d7d793125"/><file name="fancy_shadow_nw.png" hash="c820c878aedb7a7f9ebd7135a58e7c65"/><file name="fancy_shadow_s.png" hash="9b9e5c888028aaef40fe5b6a363f1e29"/><file name="fancy_shadow_se.png" hash="a8afd5a008884380ee712d177105268f"/><file name="fancy_shadow_sw.png" hash="f81cc0fee5581d76ad3cebe47e7e791b"/><file name="fancy_shadow_w.png" hash="59b0e63eb059e58d932cfd53da4d87e6"/><file name="fancy_title_left.png" hash="1582ac2d3bef6a6445bf02ceca2741cd"/><file name="fancy_title_main.png" hash="38dad6c1ed4bdc81c0bec721b2deb8c2"/><file name="fancy_title_over.png" hash="b886fd165d4b7ac77d41fb52d87ffc60"/><file name="fancy_title_right.png" hash="6cbe0c935511e7f9a2555ccb6a7324c4"/><file name="fancybox-x.png" hash="168696d8a694214090ef90e029cdf393"/><file name="fancybox-y.png" hash="36a58859beb9a6b19322a37466b9f78e"/><file name="fancybox.png" hash="11e57e492ee0311540967cc7a1e6e3e2"/><file name="fancybox_loading.gif" hash="1273a9523e41e24abfd059260a348b99"/><file name="fancybox_sprite.png" hash="963fe8db121864f5848ee5ea4a8120f9"/></dir><dir name="js"><file name="jquery-1.7.2.min.js" hash="c377666f60c00acf58a744a86c520574"/><file name="jquery.fancybox-1.3.4.js" hash="01d0b8b4d0914ed8de234424039120a5"/><file name="jquery.validate.min.js" hash="8516ae56773af91e47e321060daa2e6a"/><file name="newsletterpopup.js" hash="e6401ff8b076f4e363785e193d506193"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="dropfin"><dir name="newsletterpopup"><dir><dir name="js"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="43be3401d4453d8a1191681866206ba8"/><file name="jscolor.min.js" hash="044030aa1f15e5d62f7be6560e762b30"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="dropfin"><dir name="newsletterpopup"><dir><dir name="social_icons"><file name="fb.png" hash="ed75ff19e735e63fa2bb37f1b1395ac8"/><file name="flickr.png" hash="cf4782ef8c02014bb438023b2bcc9608"/><file name="foursquare.png" hash="6a7e89c007f6aa6349c7a3b225258394"/><file name="gplus.png" hash="33ab12c51d3adc770cb990ec03a36898"/><file name="instagram.png" hash="8fe901f02b7789086613b198302de229"/><file name="linkedin.png" hash="46ecd2f372d62fdc3f694f40f7f00053"/><file name="pinterest.png" hash="847451f76d35f4207eea9f14bb27929f"/><file name="tumblr.png" hash="5ecfd88be591ebf53d5ab513330076a7"/><file name="twitter.png" hash="9cbac1f86411318e5f4caf00d0b637ca"/><file name="vimeo.png" hash="0806475029d854b627e36061438b259c"/><file name="youtube.png" hash="78df6de626b5c613461bbbc8fd7e88bd"/></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
skin/adminhtml/default/default/dropfin/newsletterpopup/js/arrow.gif ADDED
Binary file
skin/adminhtml/default/default/dropfin/newsletterpopup/js/cross.gif ADDED
Binary file
skin/adminhtml/default/default/dropfin/newsletterpopup/js/hs.png ADDED
Binary file
skin/adminhtml/default/default/dropfin/newsletterpopup/js/hv.png ADDED
Binary file
skin/adminhtml/default/default/dropfin/newsletterpopup/js/jscolor.js ADDED
@@ -0,0 +1,1844 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jscolor - JavaScript Color Picker
3
+ *
4
+ * @link http://jscolor.com
5
+ * @license For open source use: GPLv3
6
+ * For commercial use: JSColor Commercial License
7
+ * @author Jan Odvarko
8
+ * @version 2.0.4
9
+ *
10
+ * See usage examples at http://jscolor.com/examples/
11
+ */
12
+
13
+
14
+ "use strict";
15
+
16
+
17
+ if (!window.jscolor) { window.jscolor = (function () {
18
+
19
+
20
+ var jsc = {
21
+
22
+
23
+ register : function () {
24
+ jsc.attachDOMReadyEvent(jsc.init);
25
+ jsc.attachEvent(document, 'mousedown', jsc.onDocumentMouseDown);
26
+ jsc.attachEvent(document, 'touchstart', jsc.onDocumentTouchStart);
27
+ jsc.attachEvent(window, 'resize', jsc.onWindowResize);
28
+ },
29
+
30
+
31
+ init : function () {
32
+ if (jsc.jscolor.lookupClass) {
33
+ jsc.jscolor.installByClassName(jsc.jscolor.lookupClass);
34
+ }
35
+ },
36
+
37
+
38
+ tryInstallOnElements : function (elms, className) {
39
+ var matchClass = new RegExp('(^|\\s)(' + className + ')(\\s*(\\{[^}]*\\})|\\s|$)', 'i');
40
+
41
+ for (var i = 0; i < elms.length; i += 1) {
42
+ if (elms[i].type !== undefined && elms[i].type.toLowerCase() == 'color') {
43
+ if (jsc.isColorAttrSupported) {
44
+ // skip inputs of type 'color' if supported by the browser
45
+ continue;
46
+ }
47
+ }
48
+ var m;
49
+ if (!elms[i].jscolor && elms[i].className && (m = elms[i].className.match(matchClass))) {
50
+ var targetElm = elms[i];
51
+ var optsStr = null;
52
+
53
+ var dataOptions = jsc.getDataAttr(targetElm, 'jscolor');
54
+ if (dataOptions !== null) {
55
+ optsStr = dataOptions;
56
+ } else if (m[4]) {
57
+ optsStr = m[4];
58
+ }
59
+
60
+ var opts = {};
61
+ if (optsStr) {
62
+ try {
63
+ opts = (new Function ('return (' + optsStr + ')'))();
64
+ } catch(eParseError) {
65
+ jsc.warn('Error parsing jscolor options: ' + eParseError + ':\n' + optsStr);
66
+ }
67
+ }
68
+ targetElm.jscolor = new jsc.jscolor(targetElm, opts);
69
+ }
70
+ }
71
+ },
72
+
73
+
74
+ isColorAttrSupported : (function () {
75
+ var elm = document.createElement('input');
76
+ if (elm.setAttribute) {
77
+ elm.setAttribute('type', 'color');
78
+ if (elm.type.toLowerCase() == 'color') {
79
+ return true;
80
+ }
81
+ }
82
+ return false;
83
+ })(),
84
+
85
+
86
+ isCanvasSupported : (function () {
87
+ var elm = document.createElement('canvas');
88
+ return !!(elm.getContext && elm.getContext('2d'));
89
+ })(),
90
+
91
+
92
+ fetchElement : function (mixed) {
93
+ return typeof mixed === 'string' ? document.getElementById(mixed) : mixed;
94
+ },
95
+
96
+
97
+ isElementType : function (elm, type) {
98
+ return elm.nodeName.toLowerCase() === type.toLowerCase();
99
+ },
100
+
101
+
102
+ getDataAttr : function (el, name) {
103
+ var attrName = 'data-' + name;
104
+ var attrValue = el.getAttribute(attrName);
105
+ if (attrValue !== null) {
106
+ return attrValue;
107
+ }
108
+ return null;
109
+ },
110
+
111
+
112
+ attachEvent : function (el, evnt, func) {
113
+ if (el.addEventListener) {
114
+ el.addEventListener(evnt, func, false);
115
+ } else if (el.attachEvent) {
116
+ el.attachEvent('on' + evnt, func);
117
+ }
118
+ },
119
+
120
+
121
+ detachEvent : function (el, evnt, func) {
122
+ if (el.removeEventListener) {
123
+ el.removeEventListener(evnt, func, false);
124
+ } else if (el.detachEvent) {
125
+ el.detachEvent('on' + evnt, func);
126
+ }
127
+ },
128
+
129
+
130
+ _attachedGroupEvents : {},
131
+
132
+
133
+ attachGroupEvent : function (groupName, el, evnt, func) {
134
+ if (!jsc._attachedGroupEvents.hasOwnProperty(groupName)) {
135
+ jsc._attachedGroupEvents[groupName] = [];
136
+ }
137
+ jsc._attachedGroupEvents[groupName].push([el, evnt, func]);
138
+ jsc.attachEvent(el, evnt, func);
139
+ },
140
+
141
+
142
+ detachGroupEvents : function (groupName) {
143
+ if (jsc._attachedGroupEvents.hasOwnProperty(groupName)) {
144
+ for (var i = 0; i < jsc._attachedGroupEvents[groupName].length; i += 1) {
145
+ var evt = jsc._attachedGroupEvents[groupName][i];
146
+ jsc.detachEvent(evt[0], evt[1], evt[2]);
147
+ }
148
+ delete jsc._attachedGroupEvents[groupName];
149
+ }
150
+ },
151
+
152
+
153
+ attachDOMReadyEvent : function (func) {
154
+ var fired = false;
155
+ var fireOnce = function () {
156
+ if (!fired) {
157
+ fired = true;
158
+ func();
159
+ }
160
+ };
161
+
162
+ if (document.readyState === 'complete') {
163
+ setTimeout(fireOnce, 1); // async
164
+ return;
165
+ }
166
+
167
+ if (document.addEventListener) {
168
+ document.addEventListener('DOMContentLoaded', fireOnce, false);
169
+
170
+ // Fallback
171
+ window.addEventListener('load', fireOnce, false);
172
+
173
+ } else if (document.attachEvent) {
174
+ // IE
175
+ document.attachEvent('onreadystatechange', function () {
176
+ if (document.readyState === 'complete') {
177
+ document.detachEvent('onreadystatechange', arguments.callee);
178
+ fireOnce();
179
+ }
180
+ })
181
+
182
+ // Fallback
183
+ window.attachEvent('onload', fireOnce);
184
+
185
+ // IE7/8
186
+ if (document.documentElement.doScroll && window == window.top) {
187
+ var tryScroll = function () {
188
+ if (!document.body) { return; }
189
+ try {
190
+ document.documentElement.doScroll('left');
191
+ fireOnce();
192
+ } catch (e) {
193
+ setTimeout(tryScroll, 1);
194
+ }
195
+ };
196
+ tryScroll();
197
+ }
198
+ }
199
+ },
200
+
201
+
202
+ warn : function (msg) {
203
+ if (window.console && window.console.warn) {
204
+ window.console.warn(msg);
205
+ }
206
+ },
207
+
208
+
209
+ preventDefault : function (e) {
210
+ if (e.preventDefault) { e.preventDefault(); }
211
+ e.returnValue = false;
212
+ },
213
+
214
+
215
+ captureTarget : function (target) {
216
+ // IE
217
+ if (target.setCapture) {
218
+ jsc._capturedTarget = target;
219
+ jsc._capturedTarget.setCapture();
220
+ }
221
+ },
222
+
223
+
224
+ releaseTarget : function () {
225
+ // IE
226
+ if (jsc._capturedTarget) {
227
+ jsc._capturedTarget.releaseCapture();
228
+ jsc._capturedTarget = null;
229
+ }
230
+ },
231
+
232
+
233
+ fireEvent : function (el, evnt) {
234
+ if (!el) {
235
+ return;
236
+ }
237
+ if (document.createEvent) {
238
+ var ev = document.createEvent('HTMLEvents');
239
+ ev.initEvent(evnt, true, true);
240
+ el.dispatchEvent(ev);
241
+ } else if (document.createEventObject) {
242
+ var ev = document.createEventObject();
243
+ el.fireEvent('on' + evnt, ev);
244
+ } else if (el['on' + evnt]) { // alternatively use the traditional event model
245
+ el['on' + evnt]();
246
+ }
247
+ },
248
+
249
+
250
+ classNameToList : function (className) {
251
+ return className.replace(/^\s+|\s+$/g, '').split(/\s+/);
252
+ },
253
+
254
+
255
+ // The className parameter (str) can only contain a single class name
256
+ hasClass : function (elm, className) {
257
+ if (!className) {
258
+ return false;
259
+ }
260
+ return -1 != (' ' + elm.className.replace(/\s+/g, ' ') + ' ').indexOf(' ' + className + ' ');
261
+ },
262
+
263
+
264
+ // The className parameter (str) can contain multiple class names separated by whitespace
265
+ setClass : function (elm, className) {
266
+ var classList = jsc.classNameToList(className);
267
+ for (var i = 0; i < classList.length; i += 1) {
268
+ if (!jsc.hasClass(elm, classList[i])) {
269
+ elm.className += (elm.className ? ' ' : '') + classList[i];
270
+ }
271
+ }
272
+ },
273
+
274
+
275
+ // The className parameter (str) can contain multiple class names separated by whitespace
276
+ unsetClass : function (elm, className) {
277
+ var classList = jsc.classNameToList(className);
278
+ for (var i = 0; i < classList.length; i += 1) {
279
+ var repl = new RegExp(
280
+ '^\\s*' + classList[i] + '\\s*|' +
281
+ '\\s*' + classList[i] + '\\s*$|' +
282
+ '\\s+' + classList[i] + '(\\s+)',
283
+ 'g'
284
+ );
285
+ elm.className = elm.className.replace(repl, '$1');
286
+ }
287
+ },
288
+
289
+
290
+ getStyle : function (elm) {
291
+ return window.getComputedStyle ? window.getComputedStyle(elm) : elm.currentStyle;
292
+ },
293
+
294
+
295
+ setStyle : (function () {
296
+ var helper = document.createElement('div');
297
+ var getSupportedProp = function (names) {
298
+ for (var i = 0; i < names.length; i += 1) {
299
+ if (names[i] in helper.style) {
300
+ return names[i];
301
+ }
302
+ }
303
+ };
304
+ var props = {
305
+ borderRadius: getSupportedProp(['borderRadius', 'MozBorderRadius', 'webkitBorderRadius']),
306
+ boxShadow: getSupportedProp(['boxShadow', 'MozBoxShadow', 'webkitBoxShadow'])
307
+ };
308
+ return function (elm, prop, value) {
309
+ switch (prop.toLowerCase()) {
310
+ case 'opacity':
311
+ var alphaOpacity = Math.round(parseFloat(value) * 100);
312
+ elm.style.opacity = value;
313
+ elm.style.filter = 'alpha(opacity=' + alphaOpacity + ')';
314
+ break;
315
+ default:
316
+ elm.style[props[prop]] = value;
317
+ break;
318
+ }
319
+ };
320
+ })(),
321
+
322
+
323
+ setBorderRadius : function (elm, value) {
324
+ jsc.setStyle(elm, 'borderRadius', value || '0');
325
+ },
326
+
327
+
328
+ setBoxShadow : function (elm, value) {
329
+ jsc.setStyle(elm, 'boxShadow', value || 'none');
330
+ },
331
+
332
+
333
+ getElementPos : function (e, relativeToViewport) {
334
+ var x=0, y=0;
335
+ var rect = e.getBoundingClientRect();
336
+ x = rect.left;
337
+ y = rect.top;
338
+ if (!relativeToViewport) {
339
+ var viewPos = jsc.getViewPos();
340
+ x += viewPos[0];
341
+ y += viewPos[1];
342
+ }
343
+ return [x, y];
344
+ },
345
+
346
+
347
+ getElementSize : function (e) {
348
+ return [e.offsetWidth, e.offsetHeight];
349
+ },
350
+
351
+
352
+ // get pointer's X/Y coordinates relative to viewport
353
+ getAbsPointerPos : function (e) {
354
+ if (!e) { e = window.event; }
355
+ var x = 0, y = 0;
356
+ if (typeof e.changedTouches !== 'undefined' && e.changedTouches.length) {
357
+ // touch devices
358
+ x = e.changedTouches[0].clientX;
359
+ y = e.changedTouches[0].clientY;
360
+ } else if (typeof e.clientX === 'number') {
361
+ x = e.clientX;
362
+ y = e.clientY;
363
+ }
364
+ return { x: x, y: y };
365
+ },
366
+
367
+
368
+ // get pointer's X/Y coordinates relative to target element
369
+ getRelPointerPos : function (e) {
370
+ if (!e) { e = window.event; }
371
+ var target = e.target || e.srcElement;
372
+ var targetRect = target.getBoundingClientRect();
373
+
374
+ var x = 0, y = 0;
375
+
376
+ var clientX = 0, clientY = 0;
377
+ if (typeof e.changedTouches !== 'undefined' && e.changedTouches.length) {
378
+ // touch devices
379
+ clientX = e.changedTouches[0].clientX;
380
+ clientY = e.changedTouches[0].clientY;
381
+ } else if (typeof e.clientX === 'number') {
382
+ clientX = e.clientX;
383
+ clientY = e.clientY;
384
+ }
385
+
386
+ x = clientX - targetRect.left;
387
+ y = clientY - targetRect.top;
388
+ return { x: x, y: y };
389
+ },
390
+
391
+
392
+ getViewPos : function () {
393
+ var doc = document.documentElement;
394
+ return [
395
+ (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0),
396
+ (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0)
397
+ ];
398
+ },
399
+
400
+
401
+ getViewSize : function () {
402
+ var doc = document.documentElement;
403
+ return [
404
+ (window.innerWidth || doc.clientWidth),
405
+ (window.innerHeight || doc.clientHeight),
406
+ ];
407
+ },
408
+
409
+
410
+ redrawPosition : function () {
411
+
412
+ if (jsc.picker && jsc.picker.owner) {
413
+ var thisObj = jsc.picker.owner;
414
+
415
+ var tp, vp;
416
+
417
+ if (thisObj.fixed) {
418
+ // Fixed elements are positioned relative to viewport,
419
+ // therefore we can ignore the scroll offset
420
+ tp = jsc.getElementPos(thisObj.targetElement, true); // target pos
421
+ vp = [0, 0]; // view pos
422
+ } else {
423
+ tp = jsc.getElementPos(thisObj.targetElement); // target pos
424
+ vp = jsc.getViewPos(); // view pos
425
+ }
426
+
427
+ var ts = jsc.getElementSize(thisObj.targetElement); // target size
428
+ var vs = jsc.getViewSize(); // view size
429
+ var ps = jsc.getPickerOuterDims(thisObj); // picker size
430
+ var a, b, c;
431
+ switch (thisObj.position.toLowerCase()) {
432
+ case 'left': a=1; b=0; c=-1; break;
433
+ case 'right':a=1; b=0; c=1; break;
434
+ case 'top': a=0; b=1; c=-1; break;
435
+ default: a=0; b=1; c=1; break;
436
+ }
437
+ var l = (ts[b]+ps[b])/2;
438
+
439
+ // compute picker position
440
+ if (!thisObj.smartPosition) {
441
+ var pp = [
442
+ tp[a],
443
+ tp[b]+ts[b]-l+l*c
444
+ ];
445
+ } else {
446
+ var pp = [
447
+ -vp[a]+tp[a]+ps[a] > vs[a] ?
448
+ (-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :
449
+ tp[a],
450
+ -vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?
451
+ (-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :
452
+ (tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)
453
+ ];
454
+ }
455
+
456
+ var x = pp[a];
457
+ var y = pp[b];
458
+ var positionValue = thisObj.fixed ? 'fixed' : 'absolute';
459
+ var contractShadow =
460
+ (pp[0] + ps[0] > tp[0] || pp[0] < tp[0] + ts[0]) &&
461
+ (pp[1] + ps[1] < tp[1] + ts[1]);
462
+
463
+ jsc._drawPosition(thisObj, x, y, positionValue, contractShadow);
464
+ }
465
+ },
466
+
467
+
468
+ _drawPosition : function (thisObj, x, y, positionValue, contractShadow) {
469
+ var vShadow = contractShadow ? 0 : thisObj.shadowBlur; // px
470
+
471
+ jsc.picker.wrap.style.position = positionValue;
472
+ jsc.picker.wrap.style.left = x + 'px';
473
+ jsc.picker.wrap.style.top = y + 'px';
474
+
475
+ jsc.setBoxShadow(
476
+ jsc.picker.boxS,
477
+ thisObj.shadow ?
478
+ new jsc.BoxShadow(0, vShadow, thisObj.shadowBlur, 0, thisObj.shadowColor) :
479
+ null);
480
+ },
481
+
482
+
483
+ getPickerDims : function (thisObj) {
484
+ var displaySlider = !!jsc.getSliderComponent(thisObj);
485
+ var dims = [
486
+ 2 * thisObj.insetWidth + 2 * thisObj.padding + thisObj.width +
487
+ (displaySlider ? 2 * thisObj.insetWidth + jsc.getPadToSliderPadding(thisObj) + thisObj.sliderSize : 0),
488
+ 2 * thisObj.insetWidth + 2 * thisObj.padding + thisObj.height +
489
+ (thisObj.closable ? 2 * thisObj.insetWidth + thisObj.padding + thisObj.buttonHeight : 0)
490
+ ];
491
+ return dims;
492
+ },
493
+
494
+
495
+ getPickerOuterDims : function (thisObj) {
496
+ var dims = jsc.getPickerDims(thisObj);
497
+ return [
498
+ dims[0] + 2 * thisObj.borderWidth,
499
+ dims[1] + 2 * thisObj.borderWidth
500
+ ];
501
+ },
502
+
503
+
504
+ getPadToSliderPadding : function (thisObj) {
505
+ return Math.max(thisObj.padding, 1.5 * (2 * thisObj.pointerBorderWidth + thisObj.pointerThickness));
506
+ },
507
+
508
+
509
+ getPadYComponent : function (thisObj) {
510
+ switch (thisObj.mode.charAt(1).toLowerCase()) {
511
+ case 'v': return 'v'; break;
512
+ }
513
+ return 's';
514
+ },
515
+
516
+
517
+ getSliderComponent : function (thisObj) {
518
+ if (thisObj.mode.length > 2) {
519
+ switch (thisObj.mode.charAt(2).toLowerCase()) {
520
+ case 's': return 's'; break;
521
+ case 'v': return 'v'; break;
522
+ }
523
+ }
524
+ return null;
525
+ },
526
+
527
+
528
+ onDocumentMouseDown : function (e) {
529
+ if (!e) { e = window.event; }
530
+ var target = e.target || e.srcElement;
531
+
532
+ if (target._jscLinkedInstance) {
533
+ if (target._jscLinkedInstance.showOnClick) {
534
+ target._jscLinkedInstance.show();
535
+ }
536
+ } else if (target._jscControlName) {
537
+ jsc.onControlPointerStart(e, target, target._jscControlName, 'mouse');
538
+ } else {
539
+ // Mouse is outside the picker controls -> hide the color picker!
540
+ if (jsc.picker && jsc.picker.owner) {
541
+ jsc.picker.owner.hide();
542
+ }
543
+ }
544
+ },
545
+
546
+
547
+ onDocumentTouchStart : function (e) {
548
+ if (!e) { e = window.event; }
549
+ var target = e.target || e.srcElement;
550
+
551
+ if (target._jscLinkedInstance) {
552
+ if (target._jscLinkedInstance.showOnClick) {
553
+ target._jscLinkedInstance.show();
554
+ }
555
+ } else if (target._jscControlName) {
556
+ jsc.onControlPointerStart(e, target, target._jscControlName, 'touch');
557
+ } else {
558
+ if (jsc.picker && jsc.picker.owner) {
559
+ jsc.picker.owner.hide();
560
+ }
561
+ }
562
+ },
563
+
564
+
565
+ onWindowResize : function (e) {
566
+ jsc.redrawPosition();
567
+ },
568
+
569
+
570
+ onParentScroll : function (e) {
571
+ // hide the picker when one of the parent elements is scrolled
572
+ if (jsc.picker && jsc.picker.owner) {
573
+ jsc.picker.owner.hide();
574
+ }
575
+ },
576
+
577
+
578
+ _pointerMoveEvent : {
579
+ mouse: 'mousemove',
580
+ touch: 'touchmove'
581
+ },
582
+ _pointerEndEvent : {
583
+ mouse: 'mouseup',
584
+ touch: 'touchend'
585
+ },
586
+
587
+
588
+ _pointerOrigin : null,
589
+ _capturedTarget : null,
590
+
591
+
592
+ onControlPointerStart : function (e, target, controlName, pointerType) {
593
+ var thisObj = target._jscInstance;
594
+
595
+ jsc.preventDefault(e);
596
+ jsc.captureTarget(target);
597
+
598
+ var registerDragEvents = function (doc, offset) {
599
+ jsc.attachGroupEvent('drag', doc, jsc._pointerMoveEvent[pointerType],
600
+ jsc.onDocumentPointerMove(e, target, controlName, pointerType, offset));
601
+ jsc.attachGroupEvent('drag', doc, jsc._pointerEndEvent[pointerType],
602
+ jsc.onDocumentPointerEnd(e, target, controlName, pointerType));
603
+ };
604
+
605
+ registerDragEvents(document, [0, 0]);
606
+
607
+ if (window.parent && window.frameElement) {
608
+ var rect = window.frameElement.getBoundingClientRect();
609
+ var ofs = [-rect.left, -rect.top];
610
+ registerDragEvents(window.parent.window.document, ofs);
611
+ }
612
+
613
+ var abs = jsc.getAbsPointerPos(e);
614
+ var rel = jsc.getRelPointerPos(e);
615
+ jsc._pointerOrigin = {
616
+ x: abs.x - rel.x,
617
+ y: abs.y - rel.y
618
+ };
619
+
620
+ switch (controlName) {
621
+ case 'pad':
622
+ // if the slider is at the bottom, move it up
623
+ switch (jsc.getSliderComponent(thisObj)) {
624
+ case 's': if (thisObj.hsv[1] === 0) { thisObj.fromHSV(null, 100, null); }; break;
625
+ case 'v': if (thisObj.hsv[2] === 0) { thisObj.fromHSV(null, null, 100); }; break;
626
+ }
627
+ jsc.setPad(thisObj, e, 0, 0);
628
+ break;
629
+
630
+ case 'sld':
631
+ jsc.setSld(thisObj, e, 0);
632
+ break;
633
+ }
634
+
635
+ jsc.dispatchFineChange(thisObj);
636
+ },
637
+
638
+
639
+ onDocumentPointerMove : function (e, target, controlName, pointerType, offset) {
640
+ return function (e) {
641
+ var thisObj = target._jscInstance;
642
+ switch (controlName) {
643
+ case 'pad':
644
+ if (!e) { e = window.event; }
645
+ jsc.setPad(thisObj, e, offset[0], offset[1]);
646
+ jsc.dispatchFineChange(thisObj);
647
+ break;
648
+
649
+ case 'sld':
650
+ if (!e) { e = window.event; }
651
+ jsc.setSld(thisObj, e, offset[1]);
652
+ jsc.dispatchFineChange(thisObj);
653
+ break;
654
+ }
655
+ }
656
+ },
657
+
658
+
659
+ onDocumentPointerEnd : function (e, target, controlName, pointerType) {
660
+ return function (e) {
661
+ var thisObj = target._jscInstance;
662
+ jsc.detachGroupEvents('drag');
663
+ jsc.releaseTarget();
664
+ // Always dispatch changes after detaching outstanding mouse handlers,
665
+ // in case some user interaction will occur in user's onchange callback
666
+ // that would intrude with current mouse events
667
+ jsc.dispatchChange(thisObj);
668
+ };
669
+ },
670
+
671
+
672
+ dispatchChange : function (thisObj) {
673
+ if (thisObj.valueElement) {
674
+ if (jsc.isElementType(thisObj.valueElement, 'input')) {
675
+ jsc.fireEvent(thisObj.valueElement, 'change');
676
+ }
677
+ }
678
+ },
679
+
680
+
681
+ dispatchFineChange : function (thisObj) {
682
+ if (thisObj.onFineChange) {
683
+ var callback;
684
+ if (typeof thisObj.onFineChange === 'string') {
685
+ callback = new Function (thisObj.onFineChange);
686
+ } else {
687
+ callback = thisObj.onFineChange;
688
+ }
689
+ callback.call(thisObj);
690
+ }
691
+ },
692
+
693
+
694
+ setPad : function (thisObj, e, ofsX, ofsY) {
695
+ var pointerAbs = jsc.getAbsPointerPos(e);
696
+ var x = ofsX + pointerAbs.x - jsc._pointerOrigin.x - thisObj.padding - thisObj.insetWidth;
697
+ var y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.insetWidth;
698
+
699
+ var xVal = x * (360 / (thisObj.width - 1));
700
+ var yVal = 100 - (y * (100 / (thisObj.height - 1)));
701
+
702
+ switch (jsc.getPadYComponent(thisObj)) {
703
+ case 's': thisObj.fromHSV(xVal, yVal, null, jsc.leaveSld); break;
704
+ case 'v': thisObj.fromHSV(xVal, null, yVal, jsc.leaveSld); break;
705
+ }
706
+ },
707
+
708
+
709
+ setSld : function (thisObj, e, ofsY) {
710
+ var pointerAbs = jsc.getAbsPointerPos(e);
711
+ var y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.insetWidth;
712
+
713
+ var yVal = 100 - (y * (100 / (thisObj.height - 1)));
714
+
715
+ switch (jsc.getSliderComponent(thisObj)) {
716
+ case 's': thisObj.fromHSV(null, yVal, null, jsc.leavePad); break;
717
+ case 'v': thisObj.fromHSV(null, null, yVal, jsc.leavePad); break;
718
+ }
719
+ },
720
+
721
+
722
+ _vmlNS : 'jsc_vml_',
723
+ _vmlCSS : 'jsc_vml_css_',
724
+ _vmlReady : false,
725
+
726
+
727
+ initVML : function () {
728
+ if (!jsc._vmlReady) {
729
+ // init VML namespace
730
+ var doc = document;
731
+ if (!doc.namespaces[jsc._vmlNS]) {
732
+ doc.namespaces.add(jsc._vmlNS, 'urn:schemas-microsoft-com:vml');
733
+ }
734
+ if (!doc.styleSheets[jsc._vmlCSS]) {
735
+ var tags = ['shape', 'shapetype', 'group', 'background', 'path', 'formulas', 'handles', 'fill', 'stroke', 'shadow', 'textbox', 'textpath', 'imagedata', 'line', 'polyline', 'curve', 'rect', 'roundrect', 'oval', 'arc', 'image'];
736
+ var ss = doc.createStyleSheet();
737
+ ss.owningElement.id = jsc._vmlCSS;
738
+ for (var i = 0; i < tags.length; i += 1) {
739
+ ss.addRule(jsc._vmlNS + '\\:' + tags[i], 'behavior:url(#default#VML);');
740
+ }
741
+ }
742
+ jsc._vmlReady = true;
743
+ }
744
+ },
745
+
746
+
747
+ createPalette : function () {
748
+
749
+ var paletteObj = {
750
+ elm: null,
751
+ draw: null
752
+ };
753
+
754
+ if (jsc.isCanvasSupported) {
755
+ // Canvas implementation for modern browsers
756
+
757
+ var canvas = document.createElement('canvas');
758
+ var ctx = canvas.getContext('2d');
759
+
760
+ var drawFunc = function (width, height, type) {
761
+ canvas.width = width;
762
+ canvas.height = height;
763
+
764
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
765
+
766
+ var hGrad = ctx.createLinearGradient(0, 0, canvas.width, 0);
767
+ hGrad.addColorStop(0 / 6, '#F00');
768
+ hGrad.addColorStop(1 / 6, '#FF0');
769
+ hGrad.addColorStop(2 / 6, '#0F0');
770
+ hGrad.addColorStop(3 / 6, '#0FF');
771
+ hGrad.addColorStop(4 / 6, '#00F');
772
+ hGrad.addColorStop(5 / 6, '#F0F');
773
+ hGrad.addColorStop(6 / 6, '#F00');
774
+
775
+ ctx.fillStyle = hGrad;
776
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
777
+
778
+ var vGrad = ctx.createLinearGradient(0, 0, 0, canvas.height);
779
+ switch (type.toLowerCase()) {
780
+ case 's':
781
+ vGrad.addColorStop(0, 'rgba(255,255,255,0)');
782
+ vGrad.addColorStop(1, 'rgba(255,255,255,1)');
783
+ break;
784
+ case 'v':
785
+ vGrad.addColorStop(0, 'rgba(0,0,0,0)');
786
+ vGrad.addColorStop(1, 'rgba(0,0,0,1)');
787
+ break;
788
+ }
789
+ ctx.fillStyle = vGrad;
790
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
791
+ };
792
+
793
+ paletteObj.elm = canvas;
794
+ paletteObj.draw = drawFunc;
795
+
796
+ } else {
797
+ // VML fallback for IE 7 and 8
798
+
799
+ jsc.initVML();
800
+
801
+ var vmlContainer = document.createElement('div');
802
+ vmlContainer.style.position = 'relative';
803
+ vmlContainer.style.overflow = 'hidden';
804
+
805
+ var hGrad = document.createElement(jsc._vmlNS + ':fill');
806
+ hGrad.type = 'gradient';
807
+ hGrad.method = 'linear';
808
+ hGrad.angle = '90';
809
+ hGrad.colors = '16.67% #F0F, 33.33% #00F, 50% #0FF, 66.67% #0F0, 83.33% #FF0'
810
+
811
+ var hRect = document.createElement(jsc._vmlNS + ':rect');
812
+ hRect.style.position = 'absolute';
813
+ hRect.style.left = -1 + 'px';
814
+ hRect.style.top = -1 + 'px';
815
+ hRect.stroked = false;
816
+ hRect.appendChild(hGrad);
817
+ vmlContainer.appendChild(hRect);
818
+
819
+ var vGrad = document.createElement(jsc._vmlNS + ':fill');
820
+ vGrad.type = 'gradient';
821
+ vGrad.method = 'linear';
822
+ vGrad.angle = '180';
823
+ vGrad.opacity = '0';
824
+
825
+ var vRect = document.createElement(jsc._vmlNS + ':rect');
826
+ vRect.style.position = 'absolute';
827
+ vRect.style.left = -1 + 'px';
828
+ vRect.style.top = -1 + 'px';
829
+ vRect.stroked = false;
830
+ vRect.appendChild(vGrad);
831
+ vmlContainer.appendChild(vRect);
832
+
833
+ var drawFunc = function (width, height, type) {
834
+ vmlContainer.style.width = width + 'px';
835
+ vmlContainer.style.height = height + 'px';
836
+
837
+ hRect.style.width =
838
+ vRect.style.width =
839
+ (width + 1) + 'px';
840
+ hRect.style.height =
841
+ vRect.style.height =
842
+ (height + 1) + 'px';
843
+
844
+ // Colors must be specified during every redraw, otherwise IE won't display
845
+ // a full gradient during a subsequential redraw
846
+ hGrad.color = '#F00';
847
+ hGrad.color2 = '#F00';
848
+
849
+ switch (type.toLowerCase()) {
850
+ case 's':
851
+ vGrad.color = vGrad.color2 = '#FFF';
852
+ break;
853
+ case 'v':
854
+ vGrad.color = vGrad.color2 = '#000';
855
+ break;
856
+ }
857
+ };
858
+
859
+ paletteObj.elm = vmlContainer;
860
+ paletteObj.draw = drawFunc;
861
+ }
862
+
863
+ return paletteObj;
864
+ },
865
+
866
+
867
+ createSliderGradient : function () {
868
+
869
+ var sliderObj = {
870
+ elm: null,
871
+ draw: null
872
+ };
873
+
874
+ if (jsc.isCanvasSupported) {
875
+ // Canvas implementation for modern browsers
876
+
877
+ var canvas = document.createElement('canvas');
878
+ var ctx = canvas.getContext('2d');
879
+
880
+ var drawFunc = function (width, height, color1, color2) {
881
+ canvas.width = width;
882
+ canvas.height = height;
883
+
884
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
885
+
886
+ var grad = ctx.createLinearGradient(0, 0, 0, canvas.height);
887
+ grad.addColorStop(0, color1);
888
+ grad.addColorStop(1, color2);
889
+
890
+ ctx.fillStyle = grad;
891
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
892
+ };
893
+
894
+ sliderObj.elm = canvas;
895
+ sliderObj.draw = drawFunc;
896
+
897
+ } else {
898
+ // VML fallback for IE 7 and 8
899
+
900
+ jsc.initVML();
901
+
902
+ var vmlContainer = document.createElement('div');
903
+ vmlContainer.style.position = 'relative';
904
+ vmlContainer.style.overflow = 'hidden';
905
+
906
+ var grad = document.createElement(jsc._vmlNS + ':fill');
907
+ grad.type = 'gradient';
908
+ grad.method = 'linear';
909
+ grad.angle = '180';
910
+
911
+ var rect = document.createElement(jsc._vmlNS + ':rect');
912
+ rect.style.position = 'absolute';
913
+ rect.style.left = -1 + 'px';
914
+ rect.style.top = -1 + 'px';
915
+ rect.stroked = false;
916
+ rect.appendChild(grad);
917
+ vmlContainer.appendChild(rect);
918
+
919
+ var drawFunc = function (width, height, color1, color2) {
920
+ vmlContainer.style.width = width + 'px';
921
+ vmlContainer.style.height = height + 'px';
922
+
923
+ rect.style.width = (width + 1) + 'px';
924
+ rect.style.height = (height + 1) + 'px';
925
+
926
+ grad.color = color1;
927
+ grad.color2 = color2;
928
+ };
929
+
930
+ sliderObj.elm = vmlContainer;
931
+ sliderObj.draw = drawFunc;
932
+ }
933
+
934
+ return sliderObj;
935
+ },
936
+
937
+
938
+ leaveValue : 1<<0,
939
+ leaveStyle : 1<<1,
940
+ leavePad : 1<<2,
941
+ leaveSld : 1<<3,
942
+
943
+
944
+ BoxShadow : (function () {
945
+ var BoxShadow = function (hShadow, vShadow, blur, spread, color, inset) {
946
+ this.hShadow = hShadow;
947
+ this.vShadow = vShadow;
948
+ this.blur = blur;
949
+ this.spread = spread;
950
+ this.color = color;
951
+ this.inset = !!inset;
952
+ };
953
+
954
+ BoxShadow.prototype.toString = function () {
955
+ var vals = [
956
+ Math.round(this.hShadow) + 'px',
957
+ Math.round(this.vShadow) + 'px',
958
+ Math.round(this.blur) + 'px',
959
+ Math.round(this.spread) + 'px',
960
+ this.color
961
+ ];
962
+ if (this.inset) {
963
+ vals.push('inset');
964
+ }
965
+ return vals.join(' ');
966
+ };
967
+
968
+ return BoxShadow;
969
+ })(),
970
+
971
+
972
+ //
973
+ // Usage:
974
+ // var myColor = new jscolor(<targetElement> [, <options>])
975
+ //
976
+
977
+ jscolor : function (targetElement, options) {
978
+
979
+ // General options
980
+ //
981
+ this.value = null; // initial HEX color. To change it later, use methods fromString(), fromHSV() and fromRGB()
982
+ this.valueElement = targetElement; // element that will be used to display and input the color code
983
+ this.styleElement = targetElement; // element that will preview the picked color using CSS backgroundColor
984
+ this.required = true; // whether the associated text <input> can be left empty
985
+ this.refine = true; // whether to refine the entered color code (e.g. uppercase it and remove whitespace)
986
+ this.hash = false; // whether to prefix the HEX color code with # symbol
987
+ this.uppercase = true; // whether to uppercase the color code
988
+ this.onFineChange = null; // called instantly every time the color changes (value can be either a function or a string with javascript code)
989
+ this.activeClass = 'jscolor-active'; // class to be set to the target element when a picker window is open on it
990
+ this.minS = 0; // min allowed saturation (0 - 100)
991
+ this.maxS = 100; // max allowed saturation (0 - 100)
992
+ this.minV = 0; // min allowed value (brightness) (0 - 100)
993
+ this.maxV = 100; // max allowed value (brightness) (0 - 100)
994
+
995
+ // Accessing the picked color
996
+ //
997
+ this.hsv = [0, 0, 100]; // read-only [0-360, 0-100, 0-100]
998
+ this.rgb = [255, 255, 255]; // read-only [0-255, 0-255, 0-255]
999
+
1000
+ // Color Picker options
1001
+ //
1002
+ this.width = 181; // width of color palette (in px)
1003
+ this.height = 101; // height of color palette (in px)
1004
+ this.showOnClick = true; // whether to display the color picker when user clicks on its target element
1005
+ this.mode = 'HSV'; // HSV | HVS | HS | HV - layout of the color picker controls
1006
+ this.position = 'bottom'; // left | right | top | bottom - position relative to the target element
1007
+ this.smartPosition = true; // automatically change picker position when there is not enough space for it
1008
+ this.sliderSize = 16; // px
1009
+ this.crossSize = 8; // px
1010
+ this.closable = false; // whether to display the Close button
1011
+ this.closeText = 'Close';
1012
+ this.buttonColor = '#000000'; // CSS color
1013
+ this.buttonHeight = 18; // px
1014
+ this.padding = 12; // px
1015
+ this.backgroundColor = '#FFFFFF'; // CSS color
1016
+ this.borderWidth = 1; // px
1017
+ this.borderColor = '#BBBBBB'; // CSS color
1018
+ this.borderRadius = 8; // px
1019
+ this.insetWidth = 1; // px
1020
+ this.insetColor = '#BBBBBB'; // CSS color
1021
+ this.shadow = true; // whether to display shadow
1022
+ this.shadowBlur = 15; // px
1023
+ this.shadowColor = 'rgba(0,0,0,0.2)'; // CSS color
1024
+ this.pointerColor = '#4C4C4C'; // px
1025
+ this.pointerBorderColor = '#FFFFFF'; // px
1026
+ this.pointerBorderWidth = 1; // px
1027
+ this.pointerThickness = 2; // px
1028
+ this.zIndex = 1000;
1029
+ this.container = null; // where to append the color picker (BODY element by default)
1030
+
1031
+
1032
+ for (var opt in options) {
1033
+ if (options.hasOwnProperty(opt)) {
1034
+ this[opt] = options[opt];
1035
+ }
1036
+ }
1037
+
1038
+
1039
+ this.hide = function () {
1040
+ if (isPickerOwner()) {
1041
+ detachPicker();
1042
+ }
1043
+ };
1044
+
1045
+
1046
+ this.show = function () {
1047
+ drawPicker();
1048
+ };
1049
+
1050
+
1051
+ this.redraw = function () {
1052
+ if (isPickerOwner()) {
1053
+ drawPicker();
1054
+ }
1055
+ };
1056
+
1057
+
1058
+ this.importColor = function () {
1059
+ if (!this.valueElement) {
1060
+ this.exportColor();
1061
+ } else {
1062
+ if (jsc.isElementType(this.valueElement, 'input')) {
1063
+ if (!this.refine) {
1064
+ if (!this.fromString(this.valueElement.value, jsc.leaveValue)) {
1065
+ if (this.styleElement) {
1066
+ this.styleElement.style.backgroundImage = this.styleElement._jscOrigStyle.backgroundImage;
1067
+ this.styleElement.style.backgroundColor = this.styleElement._jscOrigStyle.backgroundColor;
1068
+ this.styleElement.style.color = this.styleElement._jscOrigStyle.color;
1069
+ }
1070
+ this.exportColor(jsc.leaveValue | jsc.leaveStyle);
1071
+ }
1072
+ } else if (!this.required && /^\s*$/.test(this.valueElement.value)) {
1073
+ this.valueElement.value = '';
1074
+ if (this.styleElement) {
1075
+ this.styleElement.style.backgroundImage = this.styleElement._jscOrigStyle.backgroundImage;
1076
+ this.styleElement.style.backgroundColor = this.styleElement._jscOrigStyle.backgroundColor;
1077
+ this.styleElement.style.color = this.styleElement._jscOrigStyle.color;
1078
+ }
1079
+ this.exportColor(jsc.leaveValue | jsc.leaveStyle);
1080
+
1081
+ } else if (this.fromString(this.valueElement.value)) {
1082
+ // managed to import color successfully from the value -> OK, don't do anything
1083
+ } else {
1084
+ this.exportColor();
1085
+ }
1086
+ } else {
1087
+ // not an input element -> doesn't have any value
1088
+ this.exportColor();
1089
+ }
1090
+ }
1091
+ };
1092
+
1093
+
1094
+ this.exportColor = function (flags) {
1095
+ if (!(flags & jsc.leaveValue) && this.valueElement) {
1096
+ var value = this.toString();
1097
+ if (this.uppercase) { value = value.toUpperCase(); }
1098
+ if (this.hash) { value = '#' + value; }
1099
+
1100
+ if (jsc.isElementType(this.valueElement, 'input')) {
1101
+ this.valueElement.value = value;
1102
+ } else {
1103
+ this.valueElement.innerHTML = value;
1104
+ }
1105
+ }
1106
+ if (!(flags & jsc.leaveStyle)) {
1107
+ if (this.styleElement) {
1108
+ this.styleElement.style.backgroundImage = 'none';
1109
+ this.styleElement.style.backgroundColor = '#' + this.toString();
1110
+ this.styleElement.style.color = this.isLight() ? '#000' : '#FFF';
1111
+ }
1112
+ }
1113
+ if (!(flags & jsc.leavePad) && isPickerOwner()) {
1114
+ redrawPad();
1115
+ }
1116
+ if (!(flags & jsc.leaveSld) && isPickerOwner()) {
1117
+ redrawSld();
1118
+ }
1119
+ };
1120
+
1121
+
1122
+ // h: 0-360
1123
+ // s: 0-100
1124
+ // v: 0-100
1125
+ //
1126
+ this.fromHSV = function (h, s, v, flags) { // null = don't change
1127
+ if (h !== null) {
1128
+ if (isNaN(h)) { return false; }
1129
+ h = Math.max(0, Math.min(360, h));
1130
+ }
1131
+ if (s !== null) {
1132
+ if (isNaN(s)) { return false; }
1133
+ s = Math.max(0, Math.min(100, this.maxS, s), this.minS);
1134
+ }
1135
+ if (v !== null) {
1136
+ if (isNaN(v)) { return false; }
1137
+ v = Math.max(0, Math.min(100, this.maxV, v), this.minV);
1138
+ }
1139
+
1140
+ this.rgb = HSV_RGB(
1141
+ h===null ? this.hsv[0] : (this.hsv[0]=h),
1142
+ s===null ? this.hsv[1] : (this.hsv[1]=s),
1143
+ v===null ? this.hsv[2] : (this.hsv[2]=v)
1144
+ );
1145
+
1146
+ this.exportColor(flags);
1147
+ };
1148
+
1149
+
1150
+ // r: 0-255
1151
+ // g: 0-255
1152
+ // b: 0-255
1153
+ //
1154
+ this.fromRGB = function (r, g, b, flags) { // null = don't change
1155
+ if (r !== null) {
1156
+ if (isNaN(r)) { return false; }
1157
+ r = Math.max(0, Math.min(255, r));
1158
+ }
1159
+ if (g !== null) {
1160
+ if (isNaN(g)) { return false; }
1161
+ g = Math.max(0, Math.min(255, g));
1162
+ }
1163
+ if (b !== null) {
1164
+ if (isNaN(b)) { return false; }
1165
+ b = Math.max(0, Math.min(255, b));
1166
+ }
1167
+
1168
+ var hsv = RGB_HSV(
1169
+ r===null ? this.rgb[0] : r,
1170
+ g===null ? this.rgb[1] : g,
1171
+ b===null ? this.rgb[2] : b
1172
+ );
1173
+ if (hsv[0] !== null) {
1174
+ this.hsv[0] = Math.max(0, Math.min(360, hsv[0]));
1175
+ }
1176
+ if (hsv[2] !== 0) {
1177
+ this.hsv[1] = hsv[1]===null ? null : Math.max(0, this.minS, Math.min(100, this.maxS, hsv[1]));
1178
+ }
1179
+ this.hsv[2] = hsv[2]===null ? null : Math.max(0, this.minV, Math.min(100, this.maxV, hsv[2]));
1180
+
1181
+ // update RGB according to final HSV, as some values might be trimmed
1182
+ var rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]);
1183
+ this.rgb[0] = rgb[0];
1184
+ this.rgb[1] = rgb[1];
1185
+ this.rgb[2] = rgb[2];
1186
+
1187
+ this.exportColor(flags);
1188
+ };
1189
+
1190
+
1191
+ this.fromString = function (str, flags) {
1192
+ var m;
1193
+ if (m = str.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i)) {
1194
+ // HEX notation
1195
+ //
1196
+
1197
+ if (m[1].length === 6) {
1198
+ // 6-char notation
1199
+ this.fromRGB(
1200
+ parseInt(m[1].substr(0,2),16),
1201
+ parseInt(m[1].substr(2,2),16),
1202
+ parseInt(m[1].substr(4,2),16),
1203
+ flags
1204
+ );
1205
+ } else {
1206
+ // 3-char notation
1207
+ this.fromRGB(
1208
+ parseInt(m[1].charAt(0) + m[1].charAt(0),16),
1209
+ parseInt(m[1].charAt(1) + m[1].charAt(1),16),
1210
+ parseInt(m[1].charAt(2) + m[1].charAt(2),16),
1211
+ flags
1212
+ );
1213
+ }
1214
+ return true;
1215
+
1216
+ } else if (m = str.match(/^\W*rgba?\(([^)]*)\)\W*$/i)) {
1217
+ var params = m[1].split(',');
1218
+ var re = /^\s*(\d*)(\.\d+)?\s*$/;
1219
+ var mR, mG, mB;
1220
+ if (
1221
+ params.length >= 3 &&
1222
+ (mR = params[0].match(re)) &&
1223
+ (mG = params[1].match(re)) &&
1224
+ (mB = params[2].match(re))
1225
+ ) {
1226
+ var r = parseFloat((mR[1] || '0') + (mR[2] || ''));
1227
+ var g = parseFloat((mG[1] || '0') + (mG[2] || ''));
1228
+ var b = parseFloat((mB[1] || '0') + (mB[2] || ''));
1229
+ this.fromRGB(r, g, b, flags);
1230
+ return true;
1231
+ }
1232
+ }
1233
+ return false;
1234
+ };
1235
+
1236
+
1237
+ this.toString = function () {
1238
+ return (
1239
+ (0x100 | Math.round(this.rgb[0])).toString(16).substr(1) +
1240
+ (0x100 | Math.round(this.rgb[1])).toString(16).substr(1) +
1241
+ (0x100 | Math.round(this.rgb[2])).toString(16).substr(1)
1242
+ );
1243
+ };
1244
+
1245
+
1246
+ this.toHEXString = function () {
1247
+ return '#' + this.toString().toUpperCase();
1248
+ };
1249
+
1250
+
1251
+ this.toRGBString = function () {
1252
+ return ('rgb(' +
1253
+ Math.round(this.rgb[0]) + ',' +
1254
+ Math.round(this.rgb[1]) + ',' +
1255
+ Math.round(this.rgb[2]) + ')'
1256
+ );
1257
+ };
1258
+
1259
+
1260
+ this.isLight = function () {
1261
+ return (
1262
+ 0.213 * this.rgb[0] +
1263
+ 0.715 * this.rgb[1] +
1264
+ 0.072 * this.rgb[2] >
1265
+ 255 / 2
1266
+ );
1267
+ };
1268
+
1269
+
1270
+ this._processParentElementsInDOM = function () {
1271
+ if (this._linkedElementsProcessed) { return; }
1272
+ this._linkedElementsProcessed = true;
1273
+
1274
+ var elm = this.targetElement;
1275
+ do {
1276
+ // If the target element or one of its parent nodes has fixed position,
1277
+ // then use fixed positioning instead
1278
+ //
1279
+ // Note: In Firefox, getComputedStyle returns null in a hidden iframe,
1280
+ // that's why we need to check if the returned style object is non-empty
1281
+ var currStyle = jsc.getStyle(elm);
1282
+ if (currStyle && currStyle.position.toLowerCase() === 'fixed') {
1283
+ this.fixed = true;
1284
+ }
1285
+
1286
+ if (elm !== this.targetElement) {
1287
+ // Ensure to attach onParentScroll only once to each parent element
1288
+ // (multiple targetElements can share the same parent nodes)
1289
+ //
1290
+ // Note: It's not just offsetParents that can be scrollable,
1291
+ // that's why we loop through all parent nodes
1292
+ if (!elm._jscEventsAttached) {
1293
+ jsc.attachEvent(elm, 'scroll', jsc.onParentScroll);
1294
+ elm._jscEventsAttached = true;
1295
+ }
1296
+ }
1297
+ } while ((elm = elm.parentNode) && !jsc.isElementType(elm, 'body'));
1298
+ };
1299
+
1300
+
1301
+ // r: 0-255
1302
+ // g: 0-255
1303
+ // b: 0-255
1304
+ //
1305
+ // returns: [ 0-360, 0-100, 0-100 ]
1306
+ //
1307
+ function RGB_HSV (r, g, b) {
1308
+ r /= 255;
1309
+ g /= 255;
1310
+ b /= 255;
1311
+ var n = Math.min(Math.min(r,g),b);
1312
+ var v = Math.max(Math.max(r,g),b);
1313
+ var m = v - n;
1314
+ if (m === 0) { return [ null, 0, 100 * v ]; }
1315
+ var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);
1316
+ return [
1317
+ 60 * (h===6?0:h),
1318
+ 100 * (m/v),
1319
+ 100 * v
1320
+ ];
1321
+ }
1322
+
1323
+
1324
+ // h: 0-360
1325
+ // s: 0-100
1326
+ // v: 0-100
1327
+ //
1328
+ // returns: [ 0-255, 0-255, 0-255 ]
1329
+ //
1330
+ function HSV_RGB (h, s, v) {
1331
+ var u = 255 * (v / 100);
1332
+
1333
+ if (h === null) {
1334
+ return [ u, u, u ];
1335
+ }
1336
+
1337
+ h /= 60;
1338
+ s /= 100;
1339
+
1340
+ var i = Math.floor(h);
1341
+ var f = i%2 ? h-i : 1-(h-i);
1342
+ var m = u * (1 - s);
1343
+ var n = u * (1 - s * f);
1344
+ switch (i) {
1345
+ case 6:
1346
+ case 0: return [u,n,m];
1347
+ case 1: return [n,u,m];
1348
+ case 2: return [m,u,n];
1349
+ case 3: return [m,n,u];
1350
+ case 4: return [n,m,u];
1351
+ case 5: return [u,m,n];
1352
+ }
1353
+ }
1354
+
1355
+
1356
+ function detachPicker () {
1357
+ jsc.unsetClass(THIS.targetElement, THIS.activeClass);
1358
+ jsc.picker.wrap.parentNode.removeChild(jsc.picker.wrap);
1359
+ delete jsc.picker.owner;
1360
+ }
1361
+
1362
+
1363
+ function drawPicker () {
1364
+
1365
+ // At this point, when drawing the picker, we know what the parent elements are
1366
+ // and we can do all related DOM operations, such as registering events on them
1367
+ // or checking their positioning
1368
+ THIS._processParentElementsInDOM();
1369
+
1370
+ if (!jsc.picker) {
1371
+ jsc.picker = {
1372
+ owner: null,
1373
+ wrap : document.createElement('div'),
1374
+ box : document.createElement('div'),
1375
+ boxS : document.createElement('div'), // shadow area
1376
+ boxB : document.createElement('div'), // border
1377
+ pad : document.createElement('div'),
1378
+ padB : document.createElement('div'), // border
1379
+ padM : document.createElement('div'), // mouse/touch area
1380
+ padPal : jsc.createPalette(),
1381
+ cross : document.createElement('div'),
1382
+ crossBY : document.createElement('div'), // border Y
1383
+ crossBX : document.createElement('div'), // border X
1384
+ crossLY : document.createElement('div'), // line Y
1385
+ crossLX : document.createElement('div'), // line X
1386
+ sld : document.createElement('div'),
1387
+ sldB : document.createElement('div'), // border
1388
+ sldM : document.createElement('div'), // mouse/touch area
1389
+ sldGrad : jsc.createSliderGradient(),
1390
+ sldPtrS : document.createElement('div'), // slider pointer spacer
1391
+ sldPtrIB : document.createElement('div'), // slider pointer inner border
1392
+ sldPtrMB : document.createElement('div'), // slider pointer middle border
1393
+ sldPtrOB : document.createElement('div'), // slider pointer outer border
1394
+ btn : document.createElement('div'),
1395
+ btnT : document.createElement('span') // text
1396
+ };
1397
+
1398
+ jsc.picker.pad.appendChild(jsc.picker.padPal.elm);
1399
+ jsc.picker.padB.appendChild(jsc.picker.pad);
1400
+ jsc.picker.cross.appendChild(jsc.picker.crossBY);
1401
+ jsc.picker.cross.appendChild(jsc.picker.crossBX);
1402
+ jsc.picker.cross.appendChild(jsc.picker.crossLY);
1403
+ jsc.picker.cross.appendChild(jsc.picker.crossLX);
1404
+ jsc.picker.padB.appendChild(jsc.picker.cross);
1405
+ jsc.picker.box.appendChild(jsc.picker.padB);
1406
+ jsc.picker.box.appendChild(jsc.picker.padM);
1407
+
1408
+ jsc.picker.sld.appendChild(jsc.picker.sldGrad.elm);
1409
+ jsc.picker.sldB.appendChild(jsc.picker.sld);
1410
+ jsc.picker.sldB.appendChild(jsc.picker.sldPtrOB);
1411
+ jsc.picker.sldPtrOB.appendChild(jsc.picker.sldPtrMB);
1412
+ jsc.picker.sldPtrMB.appendChild(jsc.picker.sldPtrIB);
1413
+ jsc.picker.sldPtrIB.appendChild(jsc.picker.sldPtrS);
1414
+ jsc.picker.box.appendChild(jsc.picker.sldB);
1415
+ jsc.picker.box.appendChild(jsc.picker.sldM);
1416
+
1417
+ jsc.picker.btn.appendChild(jsc.picker.btnT);
1418
+ jsc.picker.box.appendChild(jsc.picker.btn);
1419
+
1420
+ jsc.picker.boxB.appendChild(jsc.picker.box);
1421
+ jsc.picker.wrap.appendChild(jsc.picker.boxS);
1422
+ jsc.picker.wrap.appendChild(jsc.picker.boxB);
1423
+ }
1424
+
1425
+ var p = jsc.picker;
1426
+
1427
+ var displaySlider = !!jsc.getSliderComponent(THIS);
1428
+ var dims = jsc.getPickerDims(THIS);
1429
+ var crossOuterSize = (2 * THIS.pointerBorderWidth + THIS.pointerThickness + 2 * THIS.crossSize);
1430
+ var padToSliderPadding = jsc.getPadToSliderPadding(THIS);
1431
+ var borderRadius = Math.min(
1432
+ THIS.borderRadius,
1433
+ Math.round(THIS.padding * Math.PI)); // px
1434
+ var padCursor = 'crosshair';
1435
+
1436
+ // wrap
1437
+ p.wrap.style.clear = 'both';
1438
+ p.wrap.style.width = (dims[0] + 2 * THIS.borderWidth) + 'px';
1439
+ p.wrap.style.height = (dims[1] + 2 * THIS.borderWidth) + 'px';
1440
+ p.wrap.style.zIndex = THIS.zIndex;
1441
+
1442
+ // picker
1443
+ p.box.style.width = dims[0] + 'px';
1444
+ p.box.style.height = dims[1] + 'px';
1445
+
1446
+ p.boxS.style.position = 'absolute';
1447
+ p.boxS.style.left = '0';
1448
+ p.boxS.style.top = '0';
1449
+ p.boxS.style.width = '100%';
1450
+ p.boxS.style.height = '100%';
1451
+ jsc.setBorderRadius(p.boxS, borderRadius + 'px');
1452
+
1453
+ // picker border
1454
+ p.boxB.style.position = 'relative';
1455
+ p.boxB.style.border = THIS.borderWidth + 'px solid';
1456
+ p.boxB.style.borderColor = THIS.borderColor;
1457
+ p.boxB.style.background = THIS.backgroundColor;
1458
+ jsc.setBorderRadius(p.boxB, borderRadius + 'px');
1459
+
1460
+ // IE hack:
1461
+ // If the element is transparent, IE will trigger the event on the elements under it,
1462
+ // e.g. on Canvas or on elements with border
1463
+ p.padM.style.background =
1464
+ p.sldM.style.background =
1465
+ '#FFF';
1466
+ jsc.setStyle(p.padM, 'opacity', '0');
1467
+ jsc.setStyle(p.sldM, 'opacity', '0');
1468
+
1469
+ // pad
1470
+ p.pad.style.position = 'relative';
1471
+ p.pad.style.width = THIS.width + 'px';
1472
+ p.pad.style.height = THIS.height + 'px';
1473
+
1474
+ // pad palettes (HSV and HVS)
1475
+ p.padPal.draw(THIS.width, THIS.height, jsc.getPadYComponent(THIS));
1476
+
1477
+ // pad border
1478
+ p.padB.style.position = 'absolute';
1479
+ p.padB.style.left = THIS.padding + 'px';
1480
+ p.padB.style.top = THIS.padding + 'px';
1481
+ p.padB.style.border = THIS.insetWidth + 'px solid';
1482
+ p.padB.style.borderColor = THIS.insetColor;
1483
+
1484
+ // pad mouse area
1485
+ p.padM._jscInstance = THIS;
1486
+ p.padM._jscControlName = 'pad';
1487
+ p.padM.style.position = 'absolute';
1488
+ p.padM.style.left = '0';
1489
+ p.padM.style.top = '0';
1490
+ p.padM.style.width = (THIS.padding + 2 * THIS.insetWidth + THIS.width + padToSliderPadding / 2) + 'px';
1491
+ p.padM.style.height = dims[1] + 'px';
1492
+ p.padM.style.cursor = padCursor;
1493
+
1494
+ // pad cross
1495
+ p.cross.style.position = 'absolute';
1496
+ p.cross.style.left =
1497
+ p.cross.style.top =
1498
+ '0';
1499
+ p.cross.style.width =
1500
+ p.cross.style.height =
1501
+ crossOuterSize + 'px';
1502
+
1503
+ // pad cross border Y and X
1504
+ p.crossBY.style.position =
1505
+ p.crossBX.style.position =
1506
+ 'absolute';
1507
+ p.crossBY.style.background =
1508
+ p.crossBX.style.background =
1509
+ THIS.pointerBorderColor;
1510
+ p.crossBY.style.width =
1511
+ p.crossBX.style.height =
1512
+ (2 * THIS.pointerBorderWidth + THIS.pointerThickness) + 'px';
1513
+ p.crossBY.style.height =
1514
+ p.crossBX.style.width =
1515
+ crossOuterSize + 'px';
1516
+ p.crossBY.style.left =
1517
+ p.crossBX.style.top =
1518
+ (Math.floor(crossOuterSize / 2) - Math.floor(THIS.pointerThickness / 2) - THIS.pointerBorderWidth) + 'px';
1519
+ p.crossBY.style.top =
1520
+ p.crossBX.style.left =
1521
+ '0';
1522
+
1523
+ // pad cross line Y and X
1524
+ p.crossLY.style.position =
1525
+ p.crossLX.style.position =
1526
+ 'absolute';
1527
+ p.crossLY.style.background =
1528
+ p.crossLX.style.background =
1529
+ THIS.pointerColor;
1530
+ p.crossLY.style.height =
1531
+ p.crossLX.style.width =
1532
+ (crossOuterSize - 2 * THIS.pointerBorderWidth) + 'px';
1533
+ p.crossLY.style.width =
1534
+ p.crossLX.style.height =
1535
+ THIS.pointerThickness + 'px';
1536
+ p.crossLY.style.left =
1537
+ p.crossLX.style.top =
1538
+ (Math.floor(crossOuterSize / 2) - Math.floor(THIS.pointerThickness / 2)) + 'px';
1539
+ p.crossLY.style.top =
1540
+ p.crossLX.style.left =
1541
+ THIS.pointerBorderWidth + 'px';
1542
+
1543
+ // slider
1544
+ p.sld.style.overflow = 'hidden';
1545
+ p.sld.style.width = THIS.sliderSize + 'px';
1546
+ p.sld.style.height = THIS.height + 'px';
1547
+
1548
+ // slider gradient
1549
+ p.sldGrad.draw(THIS.sliderSize, THIS.height, '#000', '#000');
1550
+
1551
+ // slider border
1552
+ p.sldB.style.display = displaySlider ? 'block' : 'none';
1553
+ p.sldB.style.position = 'absolute';
1554
+ p.sldB.style.right = THIS.padding + 'px';
1555
+ p.sldB.style.top = THIS.padding + 'px';
1556
+ p.sldB.style.border = THIS.insetWidth + 'px solid';
1557
+ p.sldB.style.borderColor = THIS.insetColor;
1558
+
1559
+ // slider mouse area
1560
+ p.sldM._jscInstance = THIS;
1561
+ p.sldM._jscControlName = 'sld';
1562
+ p.sldM.style.display = displaySlider ? 'block' : 'none';
1563
+ p.sldM.style.position = 'absolute';
1564
+ p.sldM.style.right = '0';
1565
+ p.sldM.style.top = '0';
1566
+ p.sldM.style.width = (THIS.sliderSize + padToSliderPadding / 2 + THIS.padding + 2 * THIS.insetWidth) + 'px';
1567
+ p.sldM.style.height = dims[1] + 'px';
1568
+ p.sldM.style.cursor = 'default';
1569
+
1570
+ // slider pointer inner and outer border
1571
+ p.sldPtrIB.style.border =
1572
+ p.sldPtrOB.style.border =
1573
+ THIS.pointerBorderWidth + 'px solid ' + THIS.pointerBorderColor;
1574
+
1575
+ // slider pointer outer border
1576
+ p.sldPtrOB.style.position = 'absolute';
1577
+ p.sldPtrOB.style.left = -(2 * THIS.pointerBorderWidth + THIS.pointerThickness) + 'px';
1578
+ p.sldPtrOB.style.top = '0';
1579
+
1580
+ // slider pointer middle border
1581
+ p.sldPtrMB.style.border = THIS.pointerThickness + 'px solid ' + THIS.pointerColor;
1582
+
1583
+ // slider pointer spacer
1584
+ p.sldPtrS.style.width = THIS.sliderSize + 'px';
1585
+ p.sldPtrS.style.height = sliderPtrSpace + 'px';
1586
+
1587
+ // the Close button
1588
+ function setBtnBorder () {
1589
+ var insetColors = THIS.insetColor.split(/\s+/);
1590
+ var outsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1];
1591
+ p.btn.style.borderColor = outsetColor;
1592
+ }
1593
+ p.btn.style.display = THIS.closable ? 'block' : 'none';
1594
+ p.btn.style.position = 'absolute';
1595
+ p.btn.style.left = THIS.padding + 'px';
1596
+ p.btn.style.bottom = THIS.padding + 'px';
1597
+ p.btn.style.padding = '0 15px';
1598
+ p.btn.style.height = THIS.buttonHeight + 'px';
1599
+ p.btn.style.border = THIS.insetWidth + 'px solid';
1600
+ setBtnBorder();
1601
+ p.btn.style.color = THIS.buttonColor;
1602
+ p.btn.style.font = '12px sans-serif';
1603
+ p.btn.style.textAlign = 'center';
1604
+ try {
1605
+ p.btn.style.cursor = 'pointer';
1606
+ } catch(eOldIE) {
1607
+ p.btn.style.cursor = 'hand';
1608
+ }
1609
+ p.btn.onmousedown = function () {
1610
+ THIS.hide();
1611
+ };
1612
+ p.btnT.style.lineHeight = THIS.buttonHeight + 'px';
1613
+ p.btnT.innerHTML = '';
1614
+ p.btnT.appendChild(document.createTextNode(THIS.closeText));
1615
+
1616
+ // place pointers
1617
+ redrawPad();
1618
+ redrawSld();
1619
+
1620
+ // If we are changing the owner without first closing the picker,
1621
+ // make sure to first deal with the old owner
1622
+ if (jsc.picker.owner && jsc.picker.owner !== THIS) {
1623
+ jsc.unsetClass(jsc.picker.owner.targetElement, THIS.activeClass);
1624
+ }
1625
+
1626
+ // Set the new picker owner
1627
+ jsc.picker.owner = THIS;
1628
+
1629
+ // The redrawPosition() method needs picker.owner to be set, that's why we call it here,
1630
+ // after setting the owner
1631
+ if (jsc.isElementType(container, 'body')) {
1632
+ jsc.redrawPosition();
1633
+ } else {
1634
+ jsc._drawPosition(THIS, 0, 0, 'relative', false);
1635
+ }
1636
+
1637
+ if (p.wrap.parentNode != container) {
1638
+ container.appendChild(p.wrap);
1639
+ }
1640
+
1641
+ jsc.setClass(THIS.targetElement, THIS.activeClass);
1642
+ }
1643
+
1644
+
1645
+ function redrawPad () {
1646
+ // redraw the pad pointer
1647
+ switch (jsc.getPadYComponent(THIS)) {
1648
+ case 's': var yComponent = 1; break;
1649
+ case 'v': var yComponent = 2; break;
1650
+ }
1651
+ var x = Math.round((THIS.hsv[0] / 360) * (THIS.width - 1));
1652
+ var y = Math.round((1 - THIS.hsv[yComponent] / 100) * (THIS.height - 1));
1653
+ var crossOuterSize = (2 * THIS.pointerBorderWidth + THIS.pointerThickness + 2 * THIS.crossSize);
1654
+ var ofs = -Math.floor(crossOuterSize / 2);
1655
+ jsc.picker.cross.style.left = (x + ofs) + 'px';
1656
+ jsc.picker.cross.style.top = (y + ofs) + 'px';
1657
+
1658
+ // redraw the slider
1659
+ switch (jsc.getSliderComponent(THIS)) {
1660
+ case 's':
1661
+ var rgb1 = HSV_RGB(THIS.hsv[0], 100, THIS.hsv[2]);
1662
+ var rgb2 = HSV_RGB(THIS.hsv[0], 0, THIS.hsv[2]);
1663
+ var color1 = 'rgb(' +
1664
+ Math.round(rgb1[0]) + ',' +
1665
+ Math.round(rgb1[1]) + ',' +
1666
+ Math.round(rgb1[2]) + ')';
1667
+ var color2 = 'rgb(' +
1668
+ Math.round(rgb2[0]) + ',' +
1669
+ Math.round(rgb2[1]) + ',' +
1670
+ Math.round(rgb2[2]) + ')';
1671
+ jsc.picker.sldGrad.draw(THIS.sliderSize, THIS.height, color1, color2);
1672
+ break;
1673
+ case 'v':
1674
+ var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 100);
1675
+ var color1 = 'rgb(' +
1676
+ Math.round(rgb[0]) + ',' +
1677
+ Math.round(rgb[1]) + ',' +
1678
+ Math.round(rgb[2]) + ')';
1679
+ var color2 = '#000';
1680
+ jsc.picker.sldGrad.draw(THIS.sliderSize, THIS.height, color1, color2);
1681
+ break;
1682
+ }
1683
+ }
1684
+
1685
+
1686
+ function redrawSld () {
1687
+ var sldComponent = jsc.getSliderComponent(THIS);
1688
+ if (sldComponent) {
1689
+ // redraw the slider pointer
1690
+ switch (sldComponent) {
1691
+ case 's': var yComponent = 1; break;
1692
+ case 'v': var yComponent = 2; break;
1693
+ }
1694
+ var y = Math.round((1 - THIS.hsv[yComponent] / 100) * (THIS.height - 1));
1695
+ jsc.picker.sldPtrOB.style.top = (y - (2 * THIS.pointerBorderWidth + THIS.pointerThickness) - Math.floor(sliderPtrSpace / 2)) + 'px';
1696
+ }
1697
+ }
1698
+
1699
+
1700
+ function isPickerOwner () {
1701
+ return jsc.picker && jsc.picker.owner === THIS;
1702
+ }
1703
+
1704
+
1705
+ function blurValue () {
1706
+ THIS.importColor();
1707
+ }
1708
+
1709
+
1710
+ // Find the target element
1711
+ if (typeof targetElement === 'string') {
1712
+ var id = targetElement;
1713
+ var elm = document.getElementById(id);
1714
+ if (elm) {
1715
+ this.targetElement = elm;
1716
+ } else {
1717
+ jsc.warn('Could not find target element with ID \'' + id + '\'');
1718
+ }
1719
+ } else if (targetElement) {
1720
+ this.targetElement = targetElement;
1721
+ } else {
1722
+ jsc.warn('Invalid target element: \'' + targetElement + '\'');
1723
+ }
1724
+
1725
+ if (this.targetElement._jscLinkedInstance) {
1726
+ jsc.warn('Cannot link jscolor twice to the same element. Skipping.');
1727
+ return;
1728
+ }
1729
+ this.targetElement._jscLinkedInstance = this;
1730
+
1731
+ // Find the value element
1732
+ this.valueElement = jsc.fetchElement(this.valueElement);
1733
+ // Find the style element
1734
+ this.styleElement = jsc.fetchElement(this.styleElement);
1735
+
1736
+ var THIS = this;
1737
+ var container =
1738
+ this.container ?
1739
+ jsc.fetchElement(this.container) :
1740
+ document.getElementsByTagName('body')[0];
1741
+ var sliderPtrSpace = 3; // px
1742
+
1743
+ // For BUTTON elements it's important to stop them from sending the form when clicked
1744
+ // (e.g. in Safari)
1745
+ if (jsc.isElementType(this.targetElement, 'button')) {
1746
+ if (this.targetElement.onclick) {
1747
+ var origCallback = this.targetElement.onclick;
1748
+ this.targetElement.onclick = function (evt) {
1749
+ origCallback.call(this, evt);
1750
+ return false;
1751
+ };
1752
+ } else {
1753
+ this.targetElement.onclick = function () { return false; };
1754
+ }
1755
+ }
1756
+
1757
+ /*
1758
+ var elm = this.targetElement;
1759
+ do {
1760
+ // If the target element or one of its offsetParents has fixed position,
1761
+ // then use fixed positioning instead
1762
+ //
1763
+ // Note: In Firefox, getComputedStyle returns null in a hidden iframe,
1764
+ // that's why we need to check if the returned style object is non-empty
1765
+ var currStyle = jsc.getStyle(elm);
1766
+ if (currStyle && currStyle.position.toLowerCase() === 'fixed') {
1767
+ this.fixed = true;
1768
+ }
1769
+
1770
+ if (elm !== this.targetElement) {
1771
+ // attach onParentScroll so that we can recompute the picker position
1772
+ // when one of the offsetParents is scrolled
1773
+ if (!elm._jscEventsAttached) {
1774
+ jsc.attachEvent(elm, 'scroll', jsc.onParentScroll);
1775
+ elm._jscEventsAttached = true;
1776
+ }
1777
+ }
1778
+ } while ((elm = elm.offsetParent) && !jsc.isElementType(elm, 'body'));
1779
+ */
1780
+
1781
+ // valueElement
1782
+ if (this.valueElement) {
1783
+ if (jsc.isElementType(this.valueElement, 'input')) {
1784
+ var updateField = function () {
1785
+ THIS.fromString(THIS.valueElement.value, jsc.leaveValue);
1786
+ jsc.dispatchFineChange(THIS);
1787
+ };
1788
+ jsc.attachEvent(this.valueElement, 'keyup', updateField);
1789
+ jsc.attachEvent(this.valueElement, 'input', updateField);
1790
+ jsc.attachEvent(this.valueElement, 'blur', blurValue);
1791
+ this.valueElement.setAttribute('autocomplete', 'off');
1792
+ }
1793
+ }
1794
+
1795
+ // styleElement
1796
+ if (this.styleElement) {
1797
+ this.styleElement._jscOrigStyle = {
1798
+ backgroundImage : this.styleElement.style.backgroundImage,
1799
+ backgroundColor : this.styleElement.style.backgroundColor,
1800
+ color : this.styleElement.style.color
1801
+ };
1802
+ }
1803
+
1804
+ if (this.value) {
1805
+ // Try to set the color from the .value option and if unsuccessful,
1806
+ // export the current color
1807
+ this.fromString(this.value) || this.exportColor();
1808
+ } else {
1809
+ this.importColor();
1810
+ }
1811
+ }
1812
+
1813
+ };
1814
+
1815
+
1816
+ //================================
1817
+ // Public properties and methods
1818
+ //================================
1819
+
1820
+
1821
+ // By default, search for all elements with class="jscolor" and install a color picker on them.
1822
+ //
1823
+ // You can change what class name will be looked for by setting the property jscolor.lookupClass
1824
+ // anywhere in your HTML document. To completely disable the automatic lookup, set it to null.
1825
+ //
1826
+ jsc.jscolor.lookupClass = 'jscolor';
1827
+
1828
+
1829
+ jsc.jscolor.installByClassName = function (className) {
1830
+ var inputElms = document.getElementsByTagName('input');
1831
+ var buttonElms = document.getElementsByTagName('button');
1832
+
1833
+ jsc.tryInstallOnElements(inputElms, className);
1834
+ jsc.tryInstallOnElements(buttonElms, className);
1835
+ };
1836
+
1837
+
1838
+ jsc.register();
1839
+
1840
+
1841
+ return jsc.jscolor;
1842
+
1843
+
1844
+ })(); }
skin/adminhtml/default/default/dropfin/newsletterpopup/js/jscolor.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jscolor - JavaScript Color Picker
3
+ *
4
+ * @link http://jscolor.com
5
+ * @license For open source use: GPLv3
6
+ * For commercial use: JSColor Commercial License
7
+ * @author Jan Odvarko
8
+ *
9
+ * See usage examples at http://jscolor.com/examples/
10
+ */"use strict";window.jscolor||(window.jscolor=function(){var e={register:function(){e.attachDOMReadyEvent(e.init),e.attachEvent(document,"mousedown",e.onDocumentMouseDown),e.attachEvent(document,"touchstart",e.onDocumentTouchStart),e.attachEvent(window,"resize",e.onWindowResize)},init:function(){e.jscolor.lookupClass&&e.jscolor.installByClassName(e.jscolor.lookupClass)},tryInstallOnElements:function(t,n){var r=new RegExp("(^|\\s)("+n+")(\\s*(\\{[^}]*\\})|\\s|$)","i");for(var i=0;i<t.length;i+=1){if(t[i].type!==undefined&&t[i].type.toLowerCase()=="color"&&e.isColorAttrSupported)continue;var s;if(!t[i].jscolor&&t[i].className&&(s=t[i].className.match(r))){var o=t[i],u=null,a=e.getDataAttr(o,"jscolor");a!==null?u=a:s[4]&&(u=s[4]);var f={};if(u)try{f=(new Function("return ("+u+")"))()}catch(l){e.warn("Error parsing jscolor options: "+l+":\n"+u)}o.jscolor=new e.jscolor(o,f)}}},isColorAttrSupported:function(){var e=document.createElement("input");if(e.setAttribute){e.setAttribute("type","color");if(e.type.toLowerCase()=="color")return!0}return!1}(),isCanvasSupported:function(){var e=document.createElement("canvas");return!!e.getContext&&!!e.getContext("2d")}(),fetchElement:function(e){return typeof e=="string"?document.getElementById(e):e},isElementType:function(e,t){return e.nodeName.toLowerCase()===t.toLowerCase()},getDataAttr:function(e,t){var n="data-"+t,r=e.getAttribute(n);return r!==null?r:null},attachEvent:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)},detachEvent:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent&&e.detachEvent("on"+t,n)},_attachedGroupEvents:{},attachGroupEvent:function(t,n,r,i){e._attachedGroupEvents.hasOwnProperty(t)||(e._attachedGroupEvents[t]=[]),e._attachedGroupEvents[t].push([n,r,i]),e.attachEvent(n,r,i)},detachGroupEvents:function(t){if(e._attachedGroupEvents.hasOwnProperty(t)){for(var n=0;n<e._attachedGroupEvents[t].length;n+=1){var r=e._attachedGroupEvents[t][n];e.detachEvent(r[0],r[1],r[2])}delete e._attachedGroupEvents[t]}},attachDOMReadyEvent:function(e){var t=!1,n=function(){t||(t=!0,e())};if(document.readyState==="complete"){setTimeout(n,1);return}if(document.addEventListener)document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){document.readyState==="complete"&&(document.detachEvent("onreadystatechange",arguments.callee),n())}),window.attachEvent("onload",n);if(document.documentElement.doScroll&&window==window.top){var r=function(){if(!document.body)return;try{document.documentElement.doScroll("left"),n()}catch(e){setTimeout(r,1)}};r()}}},warn:function(e){window.console&&window.console.warn&&window.console.warn(e)},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},captureTarget:function(t){t.setCapture&&(e._capturedTarget=t,e._capturedTarget.setCapture())},releaseTarget:function(){e._capturedTarget&&(e._capturedTarget.releaseCapture(),e._capturedTarget=null)},fireEvent:function(e,t){if(!e)return;if(document.createEvent){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}else if(document.createEventObject){var n=document.createEventObject();e.fireEvent("on"+t,n)}else e["on"+t]&&e["on"+t]()},classNameToList:function(e){return e.replace(/^\s+|\s+$/g,"").split(/\s+/)},hasClass:function(e,t){return t?-1!=(" "+e.className.replace(/\s+/g," ")+" ").indexOf(" "+t+" "):!1},setClass:function(t,n){var r=e.classNameToList(n);for(var i=0;i<r.length;i+=1)e.hasClass(t,r[i])||(t.className+=(t.className?" ":"")+r[i])},unsetClass:function(t,n){var r=e.classNameToList(n);for(var i=0;i<r.length;i+=1){var s=new RegExp("^\\s*"+r[i]+"\\s*|"+"\\s*"+r[i]+"\\s*$|"+"\\s+"+r[i]+"(\\s+)","g");t.className=t.className.replace(s,"$1")}},getStyle:function(e){return window.getComputedStyle?window.getComputedStyle(e):e.currentStyle},setStyle:function(){var e=document.createElement("div"),t=function(t){for(var n=0;n<t.length;n+=1)if(t[n]in e.style)return t[n]},n={borderRadius:t(["borderRadius","MozBorderRadius","webkitBorderRadius"]),boxShadow:t(["boxShadow","MozBoxShadow","webkitBoxShadow"])};return function(e,t,r){switch(t.toLowerCase()){case"opacity":var i=Math.round(parseFloat(r)*100);e.style.opacity=r,e.style.filter="alpha(opacity="+i+")";break;default:e.style[n[t]]=r}}}(),setBorderRadius:function(t,n){e.setStyle(t,"borderRadius",n||"0")},setBoxShadow:function(t,n){e.setStyle(t,"boxShadow",n||"none")},getElementPos:function(t,n){var r=0,i=0,s=t.getBoundingClientRect();r=s.left,i=s.top;if(!n){var o=e.getViewPos();r+=o[0],i+=o[1]}return[r,i]},getElementSize:function(e){return[e.offsetWidth,e.offsetHeight]},getAbsPointerPos:function(e){e||(e=window.event);var t=0,n=0;return typeof e.changedTouches!="undefined"&&e.changedTouches.length?(t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY):typeof e.clientX=="number"&&(t=e.clientX,n=e.clientY),{x:t,y:n}},getRelPointerPos:function(e){e||(e=window.event);var t=e.target||e.srcElement,n=t.getBoundingClientRect(),r=0,i=0,s=0,o=0;return typeof e.changedTouches!="undefined"&&e.changedTouches.length?(s=e.changedTouches[0].clientX,o=e.changedTouches[0].clientY):typeof e.clientX=="number"&&(s=e.clientX,o=e.clientY),r=s-n.left,i=o-n.top,{x:r,y:i}},getViewPos:function(){var e=document.documentElement;return[(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0),(window.pageYOffset||e.scrollTop)-(e.clientTop||0)]},getViewSize:function(){var e=document.documentElement;return[window.innerWidth||e.clientWidth,window.innerHeight||e.clientHeight]},redrawPosition:function(){if(e.picker&&e.picker.owner){var t=e.picker.owner,n,r;t.fixed?(n=e.getElementPos(t.targetElement,!0),r=[0,0]):(n=e.getElementPos(t.targetElement),r=e.getViewPos());var i=e.getElementSize(t.targetElement),s=e.getViewSize(),o=e.getPickerOuterDims(t),u,a,f;switch(t.position.toLowerCase()){case"left":u=1,a=0,f=-1;break;case"right":u=1,a=0,f=1;break;case"top":u=0,a=1,f=-1;break;default:u=0,a=1,f=1}var l=(i[a]+o[a])/2;if(!t.smartPosition)var c=[n[u],n[a]+i[a]-l+l*f];else var c=[-r[u]+n[u]+o[u]>s[u]?-r[u]+n[u]+i[u]/2>s[u]/2&&n[u]+i[u]-o[u]>=0?n[u]+i[u]-o[u]:n[u]:n[u],-r[a]+n[a]+i[a]+o[a]-l+l*f>s[a]?-r[a]+n[a]+i[a]/2>s[a]/2&&n[a]+i[a]-l-l*f>=0?n[a]+i[a]-l-l*f:n[a]+i[a]-l+l*f:n[a]+i[a]-l+l*f>=0?n[a]+i[a]-l+l*f:n[a]+i[a]-l-l*f];var h=c[u],p=c[a],d=t.fixed?"fixed":"absolute",v=(c[0]+o[0]>n[0]||c[0]<n[0]+i[0])&&c[1]+o[1]<n[1]+i[1];e._drawPosition(t,h,p,d,v)}},_drawPosition:function(t,n,r,i,s){var o=s?0:t.shadowBlur;e.picker.wrap.style.position=i,e.picker.wrap.style.left=n+"px",e.picker.wrap.style.top=r+"px",e.setBoxShadow(e.picker.boxS,t.shadow?new e.BoxShadow(0,o,t.shadowBlur,0,t.shadowColor):null)},getPickerDims:function(t){var n=!!e.getSliderComponent(t),r=[2*t.insetWidth+2*t.padding+t.width+(n?2*t.insetWidth+e.getPadToSliderPadding(t)+t.sliderSize:0),2*t.insetWidth+2*t.padding+t.height+(t.closable?2*t.insetWidth+t.padding+t.buttonHeight:0)];return r},getPickerOuterDims:function(t){var n=e.getPickerDims(t);return[n[0]+2*t.borderWidth,n[1]+2*t.borderWidth]},getPadToSliderPadding:function(e){return Math.max(e.padding,1.5*(2*e.pointerBorderWidth+e.pointerThickness))},getPadYComponent:function(e){switch(e.mode.charAt(1).toLowerCase()){case"v":return"v"}return"s"},getSliderComponent:function(e){if(e.mode.length>2)switch(e.mode.charAt(2).toLowerCase()){case"s":return"s";case"v":return"v"}return null},onDocumentMouseDown:function(t){t||(t=window.event);var n=t.target||t.srcElement;n._jscLinkedInstance?n._jscLinkedInstance.showOnClick&&n._jscLinkedInstance.show():n._jscControlName?e.onControlPointerStart(t,n,n._jscControlName,"mouse"):e.picker&&e.picker.owner&&e.picker.owner.hide()},onDocumentTouchStart:function(t){t||(t=window.event);var n=t.target||t.srcElement;n._jscLinkedInstance?n._jscLinkedInstance.showOnClick&&n._jscLinkedInstance.show():n._jscControlName?e.onControlPointerStart(t,n,n._jscControlName,"touch"):e.picker&&e.picker.owner&&e.picker.owner.hide()},onWindowResize:function(t){e.redrawPosition()},onParentScroll:function(t){e.picker&&e.picker.owner&&e.picker.owner.hide()},_pointerMoveEvent:{mouse:"mousemove",touch:"touchmove"},_pointerEndEvent:{mouse:"mouseup",touch:"touchend"},_pointerOrigin:null,_capturedTarget:null,onControlPointerStart:function(t,n,r,i){var s=n._jscInstance;e.preventDefault(t),e.captureTarget(n);var o=function(s,o){e.attachGroupEvent("drag",s,e._pointerMoveEvent[i],e.onDocumentPointerMove(t,n,r,i,o)),e.attachGroupEvent("drag",s,e._pointerEndEvent[i],e.onDocumentPointerEnd(t,n,r,i))};o(document,[0,0]);if(window.parent&&window.frameElement){var u=window.frameElement.getBoundingClientRect(),a=[-u.left,-u.top];o(window.parent.window.document,a)}var f=e.getAbsPointerPos(t),l=e.getRelPointerPos(t);e._pointerOrigin={x:f.x-l.x,y:f.y-l.y};switch(r){case"pad":switch(e.getSliderComponent(s)){case"s":s.hsv[1]===0&&s.fromHSV(null,100,null);break;case"v":s.hsv[2]===0&&s.fromHSV(null,null,100)}e.setPad(s,t,0,0);break;case"sld":e.setSld(s,t,0)}e.dispatchFineChange(s)},onDocumentPointerMove:function(t,n,r,i,s){return function(t){var i=n._jscInstance;switch(r){case"pad":t||(t=window.event),e.setPad(i,t,s[0],s[1]),e.dispatchFineChange(i);break;case"sld":t||(t=window.event),e.setSld(i,t,s[1]),e.dispatchFineChange(i)}}},onDocumentPointerEnd:function(t,n,r,i){return function(t){var r=n._jscInstance;e.detachGroupEvents("drag"),e.releaseTarget(),e.dispatchChange(r)}},dispatchChange:function(t){t.valueElement&&e.isElementType(t.valueElement,"input")&&e.fireEvent(t.valueElement,"change")},dispatchFineChange:function(e){if(e.onFineChange){var t;typeof e.onFineChange=="string"?t=new Function(e.onFineChange):t=e.onFineChange,t.call(e)}},setPad:function(t,n,r,i){var s=e.getAbsPointerPos(n),o=r+s.x-e._pointerOrigin.x-t.padding-t.insetWidth,u=i+s.y-e._pointerOrigin.y-t.padding-t.insetWidth,a=o*(360/(t.width-1)),f=100-u*(100/(t.height-1));switch(e.getPadYComponent(t)){case"s":t.fromHSV(a,f,null,e.leaveSld);break;case"v":t.fromHSV(a,null,f,e.leaveSld)}},setSld:function(t,n,r){var i=e.getAbsPointerPos(n),s=r+i.y-e._pointerOrigin.y-t.padding-t.insetWidth,o=100-s*(100/(t.height-1));switch(e.getSliderComponent(t)){case"s":t.fromHSV(null,o,null,e.leavePad);break;case"v":t.fromHSV(null,null,o,e.leavePad)}},_vmlNS:"jsc_vml_",_vmlCSS:"jsc_vml_css_",_vmlReady:!1,initVML:function(){if(!e._vmlReady){var t=document;t.namespaces[e._vmlNS]||t.namespaces.add(e._vmlNS,"urn:schemas-microsoft-com:vml");if(!t.styleSheets[e._vmlCSS]){var n=["shape","shapetype","group","background","path","formulas","handles","fill","stroke","shadow","textbox","textpath","imagedata","line","polyline","curve","rect","roundrect","oval","arc","image"],r=t.createStyleSheet();r.owningElement.id=e._vmlCSS;for(var i=0;i<n.length;i+=1)r.addRule(e._vmlNS+"\\:"+n[i],"behavior:url(#default#VML);")}e._vmlReady=!0}},createPalette:function(){var t={elm:null,draw:null};if(e.isCanvasSupported){var n=document.createElement("canvas"),r=n.getContext("2d"),i=function(e,t,i){n.width=e,n.height=t,r.clearRect(0,0,n.width,n.height);var s=r.createLinearGradient(0,0,n.width,0);s.addColorStop(0,"#F00"),s.addColorStop(1/6,"#FF0"),s.addColorStop(2/6,"#0F0"),s.addColorStop(.5,"#0FF"),s.addColorStop(4/6,"#00F"),s.addColorStop(5/6,"#F0F"),s.addColorStop(1,"#F00"),r.fillStyle=s,r.fillRect(0,0,n.width,n.height);var o=r.createLinearGradient(0,0,0,n.height);switch(i.toLowerCase()){case"s":o.addColorStop(0,"rgba(255,255,255,0)"),o.addColorStop(1,"rgba(255,255,255,1)");break;case"v":o.addColorStop(0,"rgba(0,0,0,0)"),o.addColorStop(1,"rgba(0,0,0,1)")}r.fillStyle=o,r.fillRect(0,0,n.width,n.height)};t.elm=n,t.draw=i}else{e.initVML();var s=document.createElement("div");s.style.position="relative",s.style.overflow="hidden";var o=document.createElement(e._vmlNS+":fill");o.type="gradient",o.method="linear",o.angle="90",o.colors="16.67% #F0F, 33.33% #00F, 50% #0FF, 66.67% #0F0, 83.33% #FF0";var u=document.createElement(e._vmlNS+":rect");u.style.position="absolute",u.style.left="-1px",u.style.top="-1px",u.stroked=!1,u.appendChild(o),s.appendChild(u);var a=document.createElement(e._vmlNS+":fill");a.type="gradient",a.method="linear",a.angle="180",a.opacity="0";var f=document.createElement(e._vmlNS+":rect");f.style.position="absolute",f.style.left="-1px",f.style.top="-1px",f.stroked=!1,f.appendChild(a),s.appendChild(f);var i=function(e,t,n){s.style.width=e+"px",s.style.height=t+"px",u.style.width=f.style.width=e+1+"px",u.style.height=f.style.height=t+1+"px",o.color="#F00",o.color2="#F00";switch(n.toLowerCase()){case"s":a.color=a.color2="#FFF";break;case"v":a.color=a.color2="#000"}};t.elm=s,t.draw=i}return t},createSliderGradient:function(){var t={elm:null,draw:null};if(e.isCanvasSupported){var n=document.createElement("canvas"),r=n.getContext("2d"),i=function(e,t,i,s){n.width=e,n.height=t,r.clearRect(0,0,n.width,n.height);var o=r.createLinearGradient(0,0,0,n.height);o.addColorStop(0,i),o.addColorStop(1,s),r.fillStyle=o,r.fillRect(0,0,n.width,n.height)};t.elm=n,t.draw=i}else{e.initVML();var s=document.createElement("div");s.style.position="relative",s.style.overflow="hidden";var o=document.createElement(e._vmlNS+":fill");o.type="gradient",o.method="linear",o.angle="180";var u=document.createElement(e._vmlNS+":rect");u.style.position="absolute",u.style.left="-1px",u.style.top="-1px",u.stroked=!1,u.appendChild(o),s.appendChild(u);var i=function(e,t,n,r){s.style.width=e+"px",s.style.height=t+"px",u.style.width=e+1+"px",u.style.height=t+1+"px",o.color=n,o.color2=r};t.elm=s,t.draw=i}return t},leaveValue:1,leaveStyle:2,leavePad:4,leaveSld:8,BoxShadow:function(){var e=function(e,t,n,r,i,s){this.hShadow=e,this.vShadow=t,this.blur=n,this.spread=r,this.color=i,this.inset=!!s};return e.prototype.toString=function(){var e=[Math.round(this.hShadow)+"px",Math.round(this.vShadow)+"px",Math.round(this.blur)+"px",Math.round(this.spread)+"px",this.color];return this.inset&&e.push("inset"),e.join(" ")},e}(),jscolor:function(t,n){function i(e,t,n){e/=255,t/=255,n/=255;var r=Math.min(Math.min(e,t),n),i=Math.max(Math.max(e,t),n),s=i-r;if(s===0)return[null,0,100*i];var o=e===r?3+(n-t)/s:t===r?5+(e-n)/s:1+(t-e)/s;return[60*(o===6?0:o),100*(s/i),100*i]}function s(e,t,n){var r=255*(n/100);if(e===null)return[r,r,r];e/=60,t/=100;var i=Math.floor(e),s=i%2?e-i:1-(e-i),o=r*(1-t),u=r*(1-t*s);switch(i){case 6:case 0:return[r,u,o];case 1:return[u,r,o];case 2:return[o,r,u];case 3:return[o,u,r];case 4:return[u,o,r];case 5:return[r,o,u]}}function o(){e.unsetClass(d.targetElement,d.activeClass),e.picker.wrap.parentNode.removeChild(e.picker.wrap),delete e.picker.owner}function u(){function l(){var e=d.insetColor.split(/\s+/),n=e.length<2?e[0]:e[1]+" "+e[0]+" "+e[0]+" "+e[1];t.btn.style.borderColor=n}d._processParentElementsInDOM(),e.picker||(e.picker={owner:null,wrap:document.createElement("div"),box:document.createElement("div"),boxS:document.createElement("div"),boxB:document.createElement("div"),pad:document.createElement("div"),padB:document.createElement("div"),padM:document.createElement("div"),padPal:e.createPalette(),cross:document.createElement("div"),crossBY:document.createElement("div"),crossBX:document.createElement("div"),crossLY:document.createElement("div"),crossLX:document.createElement("div"),sld:document.createElement("div"),sldB:document.createElement("div"),sldM:document.createElement("div"),sldGrad:e.createSliderGradient(),sldPtrS:document.createElement("div"),sldPtrIB:document.createElement("div"),sldPtrMB:document.createElement("div"),sldPtrOB:document.createElement("div"),btn:document.createElement("div"),btnT:document.createElement("span")},e.picker.pad.appendChild(e.picker.padPal.elm),e.picker.padB.appendChild(e.picker.pad),e.picker.cross.appendChild(e.picker.crossBY),e.picker.cross.appendChild(e.picker.crossBX),e.picker.cross.appendChild(e.picker.crossLY),e.picker.cross.appendChild(e.picker.crossLX),e.picker.padB.appendChild(e.picker.cross),e.picker.box.appendChild(e.picker.padB),e.picker.box.appendChild(e.picker.padM),e.picker.sld.appendChild(e.picker.sldGrad.elm),e.picker.sldB.appendChild(e.picker.sld),e.picker.sldB.appendChild(e.picker.sldPtrOB),e.picker.sldPtrOB.appendChild(e.picker.sldPtrMB),e.picker.sldPtrMB.appendChild(e.picker.sldPtrIB),e.picker.sldPtrIB.appendChild(e.picker.sldPtrS),e.picker.box.appendChild(e.picker.sldB),e.picker.box.appendChild(e.picker.sldM),e.picker.btn.appendChild(e.picker.btnT),e.picker.box.appendChild(e.picker.btn),e.picker.boxB.appendChild(e.picker.box),e.picker.wrap.appendChild(e.picker.boxS),e.picker.wrap.appendChild(e.picker.boxB));var t=e.picker,n=!!e.getSliderComponent(d),r=e.getPickerDims(d),i=2*d.pointerBorderWidth+d.pointerThickness+2*d.crossSize,s=e.getPadToSliderPadding(d),o=Math.min(d.borderRadius,Math.round(d.padding*Math.PI)),u="crosshair";t.wrap.style.clear="both",t.wrap.style.width=r[0]+2*d.borderWidth+"px",t.wrap.style.height=r[1]+2*d.borderWidth+"px",t.wrap.style.zIndex=d.zIndex,t.box.style.width=r[0]+"px",t.box.style.height=r[1]+"px",t.boxS.style.position="absolute",t.boxS.style.left="0",t.boxS.style.top="0",t.boxS.style.width="100%",t.boxS.style.height="100%",e.setBorderRadius(t.boxS,o+"px"),t.boxB.style.position="relative",t.boxB.style.border=d.borderWidth+"px solid",t.boxB.style.borderColor=d.borderColor,t.boxB.style.background=d.backgroundColor,e.setBorderRadius(t.boxB,o+"px"),t.padM.style.background=t.sldM.style.background="#FFF",e.setStyle(t.padM,"opacity","0"),e.setStyle(t.sldM,"opacity","0"),t.pad.style.position="relative",t.pad.style.width=d.width+"px",t.pad.style.height=d.height+"px",t.padPal.draw(d.width,d.height,e.getPadYComponent(d)),t.padB.style.position="absolute",t.padB.style.left=d.padding+"px",t.padB.style.top=d.padding+"px",t.padB.style.border=d.insetWidth+"px solid",t.padB.style.borderColor=d.insetColor,t.padM._jscInstance=d,t.padM._jscControlName="pad",t.padM.style.position="absolute",t.padM.style.left="0",t.padM.style.top="0",t.padM.style.width=d.padding+2*d.insetWidth+d.width+s/2+"px",t.padM.style.height=r[1]+"px",t.padM.style.cursor=u,t.cross.style.position="absolute",t.cross.style.left=t.cross.style.top="0",t.cross.style.width=t.cross.style.height=i+"px",t.crossBY.style.position=t.crossBX.style.position="absolute",t.crossBY.style.background=t.crossBX.style.background=d.pointerBorderColor,t.crossBY.style.width=t.crossBX.style.height=2*d.pointerBorderWidth+d.pointerThickness+"px",t.crossBY.style.height=t.crossBX.style.width=i+"px",t.crossBY.style.left=t.crossBX.style.top=Math.floor(i/2)-Math.floor(d.pointerThickness/2)-d.pointerBorderWidth+"px",t.crossBY.style.top=t.crossBX.style.left="0",t.crossLY.style.position=t.crossLX.style.position="absolute",t.crossLY.style.background=t.crossLX.style.background=d.pointerColor,t.crossLY.style.height=t.crossLX.style.width=i-2*d.pointerBorderWidth+"px",t.crossLY.style.width=t.crossLX.style.height=d.pointerThickness+"px",t.crossLY.style.left=t.crossLX.style.top=Math.floor(i/2)-Math.floor(d.pointerThickness/2)+"px",t.crossLY.style.top=t.crossLX.style.left=d.pointerBorderWidth+"px",t.sld.style.overflow="hidden",t.sld.style.width=d.sliderSize+"px",t.sld.style.height=d.height+"px",t.sldGrad.draw(d.sliderSize,d.height,"#000","#000"),t.sldB.style.display=n?"block":"none",t.sldB.style.position="absolute",t.sldB.style.right=d.padding+"px",t.sldB.style.top=d.padding+"px",t.sldB.style.border=d.insetWidth+"px solid",t.sldB.style.borderColor=d.insetColor,t.sldM._jscInstance=d,t.sldM._jscControlName="sld",t.sldM.style.display=n?"block":"none",t.sldM.style.position="absolute",t.sldM.style.right="0",t.sldM.style.top="0",t.sldM.style.width=d.sliderSize+s/2+d.padding+2*d.insetWidth+"px",t.sldM.style.height=r[1]+"px",t.sldM.style.cursor="default",t.sldPtrIB.style.border=t.sldPtrOB.style.border=d.pointerBorderWidth+"px solid "+d.pointerBorderColor,t.sldPtrOB.style.position="absolute",t.sldPtrOB.style.left=-(2*d.pointerBorderWidth+d.pointerThickness)+"px",t.sldPtrOB.style.top="0",t.sldPtrMB.style.border=d.pointerThickness+"px solid "+d.pointerColor,t.sldPtrS.style.width=d.sliderSize+"px",t.sldPtrS.style.height=m+"px",t.btn.style.display=d.closable?"block":"none",t.btn.style.position="absolute",t.btn.style.left=d.padding+"px",t.btn.style.bottom=d.padding+"px",t.btn.style.padding="0 15px",t.btn.style.height=d.buttonHeight+"px",t.btn.style.border=d.insetWidth+"px solid",l(),t.btn.style.color=d.buttonColor,t.btn.style.font="12px sans-serif",t.btn.style.textAlign="center";try{t.btn.style.cursor="pointer"}catch(c){t.btn.style.cursor="hand"}t.btn.onmousedown=function(){d.hide()},t.btnT.style.lineHeight=d.buttonHeight+"px",t.btnT.innerHTML="",t.btnT.appendChild(document.createTextNode(d.closeText)),a(),f(),e.picker.owner&&e.picker.owner!==d&&e.unsetClass(e.picker.owner.targetElement,d.activeClass),e.picker.owner=d,e.isElementType(v,"body")?e.redrawPosition():e._drawPosition(d,0,0,"relative",!1),t.wrap.parentNode!=v&&v.appendChild(t.wrap),e.setClass(d.targetElement,d.activeClass)}function a(){switch(e.getPadYComponent(d)){case"s":var t=1;break;case"v":var t=2}var n=Math.round(d.hsv[0]/360*(d.width-1)),r=Math.round((1-d.hsv[t]/100)*(d.height-1)),i=2*d.pointerBorderWidth+d.pointerThickness+2*d.crossSize,o=-Math.floor(i/2);e.picker.cross.style.left=n+o+"px",e.picker.cross.style.top=r+o+"px";switch(e.getSliderComponent(d)){case"s":var u=s(d.hsv[0],100,d.hsv[2]),a=s(d.hsv[0],0,d.hsv[2]),f="rgb("+Math.round(u[0])+","+Math.round(u[1])+","+Math.round(u[2])+")",l="rgb("+Math.round(a[0])+","+Math.round(a[1])+","+Math.round(a[2])+")";e.picker.sldGrad.draw(d.sliderSize,d.height,f,l);break;case"v":var c=s(d.hsv[0],d.hsv[1],100),f="rgb("+Math.round(c[0])+","+Math.round(c[1])+","+Math.round(c[2])+")",l="#000";e.picker.sldGrad.draw(d.sliderSize,d.height,f,l)}}function f(){var t=e.getSliderComponent(d);if(t){switch(t){case"s":var n=1;break;case"v":var n=2}var r=Math.round((1-d.hsv[n]/100)*(d.height-1));e.picker.sldPtrOB.style.top=r-(2*d.pointerBorderWidth+d.pointerThickness)-Math.floor(m/2)+"px"}}function l(){return e.picker&&e.picker.owner===d}function c(){d.importColor()}this.value=null,this.valueElement=t,this.styleElement=t,this.required=!0,this.refine=!0,this.hash=!1,this.uppercase=!0,this.onFineChange=null,this.activeClass="jscolor-active",this.minS=0,this.maxS=100,this.minV=0,this.maxV=100,this.hsv=[0,0,100],this.rgb=[255,255,255],this.width=181,this.height=101,this.showOnClick=!0,this.mode="HSV",this.position="bottom",this.smartPosition=!0,this.sliderSize=16,this.crossSize=8,this.closable=!1,this.closeText="Close",this.buttonColor="#000000",this.buttonHeight=18,this.padding=12,this.backgroundColor="#FFFFFF",this.borderWidth=1,this.borderColor="#BBBBBB",this.borderRadius=8,this.insetWidth=1,this.insetColor="#BBBBBB",this.shadow=!0,this.shadowBlur=15,this.shadowColor="rgba(0,0,0,0.2)",this.pointerColor="#4C4C4C",this.pointerBorderColor="#FFFFFF",this.pointerBorderWidth=1,this.pointerThickness=2,this.zIndex=1e3,this.container=null;for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.hide=function(){l()&&o()},this.show=function(){u()},this.redraw=function(){l()&&u()},this.importColor=function(){this.valueElement?e.isElementType(this.valueElement,"input")?this.refine?!this.required&&/^\s*$/.test(this.valueElement.value)?(this.valueElement.value="",this.styleElement&&(this.styleElement.style.backgroundImage=this.styleElement._jscOrigStyle.backgroundImage,this.styleElement.style.backgroundColor=this.styleElement._jscOrigStyle.backgroundColor,this.styleElement.style.color=this.styleElement._jscOrigStyle.color),this.exportColor(e.leaveValue|e.leaveStyle)):this.fromString(this.valueElement.value)||this.exportColor():this.fromString(this.valueElement.value,e.leaveValue)||(this.styleElement&&(this.styleElement.style.backgroundImage=this.styleElement._jscOrigStyle.backgroundImage,this.styleElement.style.backgroundColor=this.styleElement._jscOrigStyle.backgroundColor,this.styleElement.style.color=this.styleElement._jscOrigStyle.color),this.exportColor(e.leaveValue|e.leaveStyle)):this.exportColor():this.exportColor()},this.exportColor=function(t){if(!(t&e.leaveValue)&&this.valueElement){var n=this.toString();this.uppercase&&(n=n.toUpperCase()),this.hash&&(n="#"+n),e.isElementType(this.valueElement,"input")?this.valueElement.value=n:this.valueElement.innerHTML=n}t&e.leaveStyle||this.styleElement&&(this.styleElement.style.backgroundImage="none",this.styleElement.style.backgroundColor="#"+this.toString(),this.styleElement.style.color=this.isLight()?"#000":"#FFF"),!(t&e.leavePad)&&l()&&a(),!(t&e.leaveSld)&&l()&&f()},this.fromHSV=function(e,t,n,r){if(e!==null){if(isNaN(e))return!1;e=Math.max(0,Math.min(360,e))}if(t!==null){if(isNaN(t))return!1;t=Math.max(0,Math.min(100,this.maxS,t),this.minS)}if(n!==null){if(isNaN(n))return!1;n=Math.max(0,Math.min(100,this.maxV,n),this.minV)}this.rgb=s(e===null?this.hsv[0]:this.hsv[0]=e,t===null?this.hsv[1]:this.hsv[1]=t,n===null?this.hsv[2]:this.hsv[2]=n),this.exportColor(r)},this.fromRGB=function(e,t,n,r){if(e!==null){if(isNaN(e))return!1;e=Math.max(0,Math.min(255,e))}if(t!==null){if(isNaN(t))return!1;t=Math.max(0,Math.min(255,t))}if(n!==null){if(isNaN(n))return!1;n=Math.max(0,Math.min(255,n))}var o=i(e===null?this.rgb[0]:e,t===null?this.rgb[1]:t,n===null?this.rgb[2]:n);o[0]!==null&&(this.hsv[0]=Math.max(0,Math.min(360,o[0]))),o[2]!==0&&(this.hsv[1]=o[1]===null?null:Math.max(0,this.minS,Math.min(100,this.maxS,o[1]))),this.hsv[2]=o[2]===null?null:Math.max(0,this.minV,Math.min(100,this.maxV,o[2]));var u=s(this.hsv[0],this.hsv[1],this.hsv[2]);this.rgb[0]=u[0],this.rgb[1]=u[1],this.rgb[2]=u[2],this.exportColor(r)},this.fromString=function(e,t){var n;if(n=e.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i))return n[1].length===6?this.fromRGB(parseInt(n[1].substr(0,2),16),parseInt(n[1].substr(2,2),16),parseInt(n[1].substr(4,2),16),t):this.fromRGB(parseInt(n[1].charAt(0)+n[1].charAt(0),16),parseInt(n[1].charAt(1)+n[1].charAt(1),16),parseInt(n[1].charAt(2)+n[1].charAt(2),16),t),!0;if(n=e.match(/^\W*rgba?\(([^)]*)\)\W*$/i)){var r=n[1].split(","),i=/^\s*(\d*)(\.\d+)?\s*$/,s,o,u;if(r.length>=3&&(s=r[0].match(i))&&(o=r[1].match(i))&&(u=r[2].match(i))){var a=parseFloat((s[1]||"0")+(s[2]||"")),f=parseFloat((o[1]||"0")+(o[2]||"")),l=parseFloat((u[1]||"0")+(u[2]||""));return this.fromRGB(a,f,l,t),!0}}return!1},this.toString=function(){return(256|Math.round(this.rgb[0])).toString(16).substr(1)+(256|Math.round(this.rgb[1])).toString(16).substr(1)+(256|Math.round(this.rgb[2])).toString(16).substr(1)},this.toHEXString=function(){return"#"+this.toString().toUpperCase()},this.toRGBString=function(){return"rgb("+Math.round(this.rgb[0])+","+Math.round(this.rgb[1])+","+Math.round(this.rgb[2])+")"},this.isLight=function(){return.213*this.rgb[0]+.715*this.rgb[1]+.072*this.rgb[2]>127.5},this._processParentElementsInDOM=function(){if(this._linkedElementsProcessed)return;this._linkedElementsProcessed=!0;var t=this.targetElement;do{var n=e.getStyle(t);n&&n.position.toLowerCase()==="fixed"&&(this.fixed=!0),t!==this.targetElement&&(t._jscEventsAttached||(e.attachEvent(t,"scroll",e.onParentScroll),t._jscEventsAttached=!0))}while((t=t.parentNode)&&!e.isElementType(t,"body"))};if(typeof t=="string"){var h=t,p=document.getElementById(h);p?this.targetElement=p:e.warn("Could not find target element with ID '"+h+"'")}else t?this.targetElement=t:e.warn("Invalid target element: '"+t+"'");if(this.targetElement._jscLinkedInstance){e.warn("Cannot link jscolor twice to the same element. Skipping.");return}this.targetElement._jscLinkedInstance=this,this.valueElement=e.fetchElement(this.valueElement),this.styleElement=e.fetchElement(this.styleElement);var d=this,v=this.container?e.fetchElement(this.container):document.getElementsByTagName("body")[0],m=3;if(e.isElementType(this.targetElement,"button"))if(this.targetElement.onclick){var g=this.targetElement.onclick;this.targetElement.onclick=function(e){return g.call(this,e),!1}}else this.targetElement.onclick=function(){return!1};if(this.valueElement&&e.isElementType(this.valueElement,"input")){var y=function(){d.fromString(d.valueElement.value,e.leaveValue),e.dispatchFineChange(d)};e.attachEvent(this.valueElement,"keyup",y),e.attachEvent(this.valueElement,"input",y),e.attachEvent(this.valueElement,"blur",c),this.valueElement.setAttribute("autocomplete","off")}this.styleElement&&(this.styleElement._jscOrigStyle={backgroundImage:this.styleElement.style.backgroundImage,backgroundColor:this.styleElement.style.backgroundColor,color:this.styleElement.style.color}),this.value?this.fromString(this.value)||this.exportColor():this.importColor()}};return e.jscolor.lookupClass="jscolor",e.jscolor.installByClassName=function(t){var n=document.getElementsByTagName("input"),r=document.getElementsByTagName("button");e.tryInstallOnElements(n,t),e.tryInstallOnElements(r,t)},e.register(),e.jscolor}());
skin/frontend/base/default/dropfin/newsletterpopup/css/jquery.fancybox-1.3.4.css ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Dropfin
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE_AFL.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magento.com so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade
17
+ * this extension to newer versions in the future.
18
+ *
19
+ * @category Dropfin
20
+ * @package Newsletter Popup
21
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
22
+ */
23
+
24
+ #fancybox-loading {position: fixed; top: 50%; left: 50%; width: 40px; height: 40px; margin-top: -20px; margin-left: -20px; cursor: pointer; overflow: hidden; z-index: 1104; display: none; }
25
+ #fancybox-loading div {position: absolute; top: 0; left: 0; width: 40px; height: 480px; background-image: url('../images/fancybox.png'); }
26
+ #fancybox-overlay {position: fixed; top: 0; left: 0; width: 100%; z-index: 1100; display: none; }
27
+ #fancybox-tmp {padding: 0; margin: 0; border: 0; overflow: auto; display: none; }
28
+ #fancybox-wrap {position: absolute; top: 0; left: 0; padding: 10px; z-index: 1101; outline: none; display: none; }
29
+ #fancybox-outer {position: relative; width: 100%; height: 100%; background: #fff; }
30
+ #fancybox-content {width: 0; height: 0; padding: 0; outline: none; position: relative; overflow: hidden; z-index: 1102; border: 0px solid #fff; }
31
+ #fancybox-hide-sel-frame {position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; z-index: 1101; }
32
+ #fancybox-close {position: absolute; top: -15px; right: -15px; width: 30px; height: 30px; background: transparent url('../images/fancybox.png') -40px 0px; cursor: pointer; z-index: 1103; display: none; }
33
+ #fancybox-error {color: #444; font: normal 12px/20px Arial; padding: 14px; margin: 0; }
34
+ #fancybox-img {width: 100%; height: 100%; padding: 0; margin: 0; border: none; outline: none; line-height: 0; vertical-align: top; }
35
+ #fancybox-frame {width: 100%; height: 100%; border: none; display: block; }
36
+ #fancybox-left, #fancybox-right {position: absolute; bottom: 0px; height: 100%; width: 35%; cursor: pointer; outline: none; background: transparent url('../images/blank.gif'); z-index: 1102; display: none; }
37
+ #fancybox-left {left: 0px; }
38
+ #fancybox-right {right: 0px; }
39
+ #fancybox-left-ico, #fancybox-right-ico {position: absolute; top: 50%; left: -9999px; width: 30px; height: 30px; margin-top: -15px; cursor: pointer; z-index: 1102; display: block; }
40
+ #fancybox-left-ico {background-image: url('../images/fancybox.png'); background-position: -40px -30px; }
41
+ #fancybox-right-ico {background-image: url('../images/fancybox.png'); background-position: -40px -60px; }
42
+ #fancybox-left:hover, #fancybox-right:hover {visibility: visible; /* IE6 */ }
43
+ #fancybox-left:hover span {left: 20px; }
44
+ #fancybox-right:hover span {left: auto; right: 20px; }
45
+ .fancybox-bg {position: absolute; padding: 0; margin: 0; border: 0; width: 20px; height: 20px; z-index: 1001; }
46
+ #fancybox-bg-n {top: -20px; left: 0; width: 100%; background-image: url('../images/fancybox-x.png'); }
47
+ #fancybox-bg-ne {top: -20px; right: -20px; background-image: url('../images/fancybox.png'); background-position: -40px -162px; }
48
+ #fancybox-bg-e {top: 0; right: -20px; height: 100%; background-image: url('../images/fancybox-y.png'); background-position: -20px 0px; }
49
+ #fancybox-bg-se {bottom: -20px; right: -20px; background-image: url('../images/fancybox.png'); background-position: -40px -182px; }
50
+ #fancybox-bg-s {bottom: -20px; left: 0; width: 100%; background-image: url('../images/fancybox-x.png'); background-position: 0px -20px; }
51
+ #fancybox-bg-sw {bottom: -20px; left: -20px; background-image: url('../images/fancybox.png'); background-position: -40px -142px; }
52
+ #fancybox-bg-w {top: 0; left: -20px; height: 100%; background-image: url('../images/fancybox-y.png'); }
53
+ #fancybox-bg-nw {top: -20px; left: -20px; background-image: url('../images/fancybox.png'); background-position: -40px -122px; }
54
+ #fancybox-title {font-family: Helvetica; font-size: 12px; z-index: 1102; }
55
+ .fancybox-title-inside {padding-bottom: 10px; text-align: center; color: #333; background: #fff; position: relative; }
56
+ .fancybox-title-outside {padding-top: 10px; color: #fff; }
57
+ .fancybox-title-over {position: absolute; bottom: 0; left: 0; color: #FFF; text-align: left; }
58
+ #fancybox-title-over {padding: 10px; background-image: url('../images/fancy_title_over.png'); display: block; }
59
+ .fancybox-title-float {position: absolute; left: 0; bottom: -20px; height: 32px; }
60
+ #fancybox-title-float-wrap {border: none; border-collapse: collapse; width: auto; }
61
+ #fancybox-title-float-wrap td {border: none; white-space: nowrap; }
62
+ #fancybox-title-float-left {padding: 0 0 0 15px; background: url('../images/fancybox.png') -40px -90px no-repeat; }
63
+ #fancybox-title-float-main {color: #FFF; line-height: 29px; font-weight: bold; padding: 0 0 3px 0; background: url('../images/fancybox-x.png') 0px -40px; }
64
+ #fancybox-title-float-right {padding: 0 0 0 15px; background: url('../images/fancybox.png') -55px -90px no-repeat; }
65
+ /* IE6 */
66
+ .fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_close.png', sizingMethod='scale'); }
67
+ .fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_nav_left.png', sizingMethod='scale'); }
68
+ .fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_nav_right.png', sizingMethod='scale'); }
69
+ .fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
70
+ .fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_title_left.png', sizingMethod='scale'); }
71
+ .fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_title_main.png', sizingMethod='scale'); }
72
+ .fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_title_right.png', sizingMethod='scale'); }
73
+ .fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {height: expression(this.parentNode.clientHeight + "px"); }
74
+ #fancybox-loading.fancybox-ie6 {position: absolute; margin-top: 0; top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); }
75
+ #fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_loading.png', sizingMethod='scale'); }
76
+
77
+ /* IE6, IE7, IE8 */
78
+ .fancybox-ie .fancybox-bg { background: transparent !important; }
79
+ .fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_shadow_n.png', sizingMethod='scale'); }
80
+ .fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_shadow_ne.png', sizingMethod='scale'); }
81
+ .fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_shadow_e.png', sizingMethod='scale'); }
82
+ .fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_shadow_se.png', sizingMethod='scale'); }
83
+ .fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_shadow_s.png', sizingMethod='scale'); }
84
+ .fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_shadow_sw.png', sizingMethod='scale'); }
85
+ .fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_shadow_w.png', sizingMethod='scale'); }
86
+ .fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/fancy_shadow_nw.png', sizingMethod='scale'); }
skin/frontend/base/default/dropfin/newsletterpopup/css/style.css ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Dropfin
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE_AFL.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magento.com so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade
17
+ * this extension to newer versions in the future.
18
+ *
19
+ * @category Dropfin
20
+ * @package Newsletter Popup
21
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
22
+ */
23
+
24
+ #fancybox-content { border: 1px solid #2e8ab8 !important; }
25
+ #popup_content { display: none; }
26
+ .popup-top {margin-bottom: 10px; border-bottom: 1px dotted #2e8ab8; padding-bottom: 10px; overflow: hidden;}
27
+ .popup-top h2 {font-weight: bold; color: #fff; text-align: center; padding: 15px 20px; background-color: #2e8ab8; }
28
+ .popup-top .popup-top-content { padding: 20px 20px; }
29
+ .popup-top p {margin-bottom: 10px; }
30
+ .newsletter_form .div-input { overflow: hidden; float: left; width: 73%; }
31
+ .newsletter_form .div-input input { width: 100%; height: 33px; border-radius: 0px; }
32
+ .popup-bottom { clear: both; padding: 10px 20px; overflow: hidden; }
33
+ .popup-bottom ul { text-align: center; }
34
+ .popup-bottom li { display: inline-block; }
35
+ .newsletter-btn { width: 27%; }
36
+ .newsletter-btn span span{ font-weight: bold; }
37
+ .newsletter_status { text-align: center; font-size: 20px; }
38
+ .newsletter_status.success { color: green; }
39
+ .newsletter_status.error { clear: both; font-size: 13px; margin: 15px 0px;}
skin/frontend/base/default/dropfin/newsletterpopup/images/blank.gif ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_close.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_loading.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_nav_left.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_nav_right.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_e.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_n.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_ne.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_nw.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_s.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_se.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_sw.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_shadow_w.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_title_left.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_title_main.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_title_over.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancy_title_right.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancybox-x.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancybox-y.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancybox.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancybox_loading.gif ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/images/fancybox_sprite.png ADDED
Binary file
skin/frontend/base/default/dropfin/newsletterpopup/js/jquery-1.7.2.min.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Dropfin
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE_AFL.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magento.com so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade
17
+ * this extension to newer versions in the future.
18
+ *
19
+ * @category Dropfin
20
+ * @package Newsletter Popup
21
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
22
+ */
23
+
24
+ ;(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
25
+ a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
26
+ .clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
27
+ jQuery.noConflict();
skin/frontend/base/default/dropfin/newsletterpopup/js/jquery.fancybox-1.3.4.js ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Dropfin
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE_AFL.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magento.com so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade
17
+ * this extension to newer versions in the future.
18
+ *
19
+ * @category Dropfin
20
+ * @package Newsletter Popup
21
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
22
+ */
23
+
24
+ ;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
25
+ F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
26
+ c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
27
+ false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
28
+ function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
29
+ '"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
30
+ "function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
31
+ ";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
32
+ opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
33
+ d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
34
+ y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
35
+ i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
36
+ f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
37
+ 37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
38
+ s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
39
+ f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
40
+ j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
41
+ "image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
42
+ 10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
43
+ b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
44
+ 0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
45
+ 1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
46
+ true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
47
+ b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
48
+ d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
49
+ D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
50
+ b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
51
+ b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.8,overlayColor:"#000",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
52
+ easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
skin/frontend/base/default/dropfin/newsletterpopup/js/jquery.validate.min.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jQuery Validation Plugin 1.9.0
3
+ *
4
+ * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
5
+ * http://docs.jquery.com/Plugins/Validation
6
+ *
7
+ * Copyright (c) 2006 - 2011 Jörn Zaefferer
8
+ *
9
+ * Dual licensed under the MIT and GPL licenses:
10
+ * http://www.opensource.org/licenses/mit-license.php
11
+ * http://www.gnu.org/licenses/gpl.html
12
+ */
13
+ (function(c){c.extend(c.fn,{validate:function(a){if(this.length){var b=c.data(this[0],"validator");if(b)return b;this.attr("novalidate","novalidate");b=new c.validator(a,this[0]);c.data(this[0],"validator",b);if(b.settings.onsubmit){a=this.find("input, button");a.filter(".cancel").click(function(){b.cancelSubmit=true});b.settings.submitHandler&&a.filter(":submit").click(function(){b.submitButton=this});this.submit(function(d){function e(){if(b.settings.submitHandler){if(b.submitButton)var f=c("<input type='hidden'/>").attr("name",
14
+ b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm);b.settings.submitHandler.call(b,b.currentForm);b.submitButton&&f.remove();return false}return true}b.settings.debug&&d.preventDefault();if(b.cancelSubmit){b.cancelSubmit=false;return e()}if(b.form()){if(b.pendingRequest){b.formSubmitted=true;return false}return e()}else{b.focusInvalid();return false}})}return b}else a&&a.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")},valid:function(){if(c(this[0]).is("form"))return this.validate().form();
15
+ else{var a=true,b=c(this[0].form).validate();this.each(function(){a&=b.element(this)});return a}},removeAttrs:function(a){var b={},d=this;c.each(a.split(/\s/),function(e,f){b[f]=d.attr(f);d.removeAttr(f)});return b},rules:function(a,b){var d=this[0];if(a){var e=c.data(d.form,"validator").settings,f=e.rules,g=c.validator.staticRules(d);switch(a){case "add":c.extend(g,c.validator.normalizeRule(b));f[d.name]=g;if(b.messages)e.messages[d.name]=c.extend(e.messages[d.name],b.messages);break;case "remove":if(!b){delete f[d.name];
16
+ return g}var h={};c.each(b.split(/\s/),function(j,i){h[i]=g[i];delete g[i]});return h}}d=c.validator.normalizeRules(c.extend({},c.validator.metadataRules(d),c.validator.classRules(d),c.validator.attributeRules(d),c.validator.staticRules(d)),d);if(d.required){e=d.required;delete d.required;d=c.extend({required:e},d)}return d}});c.extend(c.expr[":"],{blank:function(a){return!c.trim(""+a.value)},filled:function(a){return!!c.trim(""+a.value)},unchecked:function(a){return!a.checked}});c.validator=function(a,
17
+ b){this.settings=c.extend(true,{},c.validator.defaults,a);this.currentForm=b;this.init()};c.validator.format=function(a,b){if(arguments.length==1)return function(){var d=c.makeArray(arguments);d.unshift(a);return c.validator.format.apply(this,d)};if(arguments.length>2&&b.constructor!=Array)b=c.makeArray(arguments).slice(1);if(b.constructor!=Array)b=[b];c.each(b,function(d,e){a=a.replace(RegExp("\\{"+d+"\\}","g"),e)});return a};c.extend(c.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",
18
+ validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(a){this.lastActive=a;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(a)).hide()}},onfocusout:function(a){if(!this.checkable(a)&&(a.name in this.submitted||!this.optional(a)))this.element(a)},
19
+ onkeyup:function(a){if(a.name in this.submitted||a==this.lastElement)this.element(a)},onclick:function(a){if(a.name in this.submitted)this.element(a);else a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).addClass(b).removeClass(d):c(a).addClass(b).removeClass(d)},unhighlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).removeClass(b).addClass(d):c(a).removeClass(b).addClass(d)}},setDefaults:function(a){c.extend(c.validator.defaults,
20
+ a)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:c.validator.format("Please enter no more than {0} characters."),
21
+ minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."),range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function a(e){var f=c.data(this[0].form,"validator"),g="on"+e.type.replace(/^validate/,
22
+ "");f.settings[g]&&f.settings[g].call(f,this[0],e)}this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=this.groups={};c.each(this.settings.groups,function(e,f){c.each(f.split(/\s/),function(g,h){b[h]=e})});var d=
23
+ this.settings.rules;c.each(d,function(e,f){d[e]=c.validator.normalizeRule(f)});c(this.currentForm).validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",a).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",
24
+ a);this.settings.invalidHandler&&c(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);this.valid()||c(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(a){this.lastElement=
25
+ a=this.validationTargetFor(this.clean(a));this.prepareElement(a);this.currentElements=c(a);var b=this.check(a);if(b)delete this.invalid[a.name];else this.invalid[a.name]=true;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return b},showErrors:function(a){if(a){c.extend(this.errorMap,a);this.errorList=[];for(var b in a)this.errorList.push({message:a[b],element:this.findByName(b)[0]});this.successList=c.grep(this.successList,function(d){return!(d.name in a)})}this.settings.showErrors?
26
+ this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){c.fn.resetForm&&c(this.currentForm).resetForm();this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0,d;for(d in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==
27
+ 0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var a=this.lastActive;return a&&c.grep(this.errorList,function(b){return b.element.name==a.name}).length==1&&a},elements:function(){var a=this,b={};return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&
28
+ a.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!a.objectLength(c(this).rules()))return false;return b[this.name]=true})},clean:function(a){return c(a)[0]},errors:function(){return c(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([]);this.currentElements=c([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},
29
+ prepareElement:function(a){this.reset();this.toHide=this.errorsFor(a)},check:function(a){a=this.validationTargetFor(this.clean(a));var b=c(a).rules(),d=false,e;for(e in b){var f={method:e,parameters:b[e]};try{var g=c.validator.methods[e].call(this,a.value.replace(/\r/g,""),a,f.parameters);if(g=="dependency-mismatch")d=true;else{d=false;if(g=="pending"){this.toHide=this.toHide.not(this.errorsFor(a));return}if(!g){this.formatAndAdd(a,f);return false}}}catch(h){this.settings.debug&&window.console&&console.log("exception occured when checking element "+
30
+ a.id+", check the '"+f.method+"' method",h);throw h;}}if(!d){this.objectLength(b)&&this.successList.push(a);return true}},customMetaMessage:function(a,b){if(c.metadata){var d=this.settings.meta?c(a).metadata()[this.settings.meta]:c(a).metadata();return d&&d.messages&&d.messages[b]}},customMessage:function(a,b){var d=this.settings.messages[a];return d&&(d.constructor==String?d:d[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==undefined)return arguments[a]},defaultMessage:function(a,
31
+ b){return this.findDefined(this.customMessage(a.name,b),this.customMetaMessage(a,b),!this.settings.ignoreTitle&&a.title||undefined,c.validator.messages[b],"<strong>Warning: No message defined for "+a.name+"</strong>")},formatAndAdd:function(a,b){var d=this.defaultMessage(a,b.method),e=/\$?\{(\d+)\}/g;if(typeof d=="function")d=d.call(this,b.parameters,a);else if(e.test(d))d=jQuery.format(d.replace(e,"{$1}"),b.parameters);this.errorList.push({message:d,element:a});this.errorMap[a.name]=d;this.submitted[a.name]=
32
+ d},addWrapper:function(a){if(this.settings.wrapper)a=a.add(a.parent(this.settings.wrapper));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass);this.showLabel(b.element,b.message)}if(this.errorList.length)this.toShow=this.toShow.add(this.containers);if(this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);
33
+ if(this.settings.unhighlight){a=0;for(b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass)}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return c(this.errorList).map(function(){return this.element})},showLabel:function(a,b){var d=this.errorsFor(a);if(d.length){d.removeClass(this.settings.validClass).addClass(this.settings.errorClass);
34
+ d.attr("generated")&&d.html(b)}else{d=c("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(a),generated:true}).addClass(this.settings.errorClass).html(b||"");if(this.settings.wrapper)d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,c(a)):d.insertAfter(a))}if(!b&&this.settings.success){d.text("");typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d)}this.toShow=
35
+ this.toShow.add(d)},errorsFor:function(a){var b=this.idOrName(a);return this.errors().filter(function(){return c(this).attr("for")==b})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){if(this.checkable(a))a=this.findByName(a.name).not(this.settings.ignore)[0];return a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(a){var b=this.currentForm;return c(document.getElementsByName(a)).map(function(d,
36
+ e){return e.form==b&&e.name==a&&e||null})},getLength:function(a,b){switch(b.nodeName.toLowerCase()){case "select":return c("option:selected",b).length;case "input":if(this.checkable(b))return this.findByName(b.name).filter(":checked").length}return a.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):true},dependTypes:{"boolean":function(a){return a},string:function(a,b){return!!c(a,b.form).length},"function":function(a,b){return a(b)}},optional:function(a){return!c.validator.methods.required.call(this,
37
+ c.trim(a.value),a)&&"dependency-mismatch"},startRequest:function(a){if(!this.pending[a.name]){this.pendingRequest++;this.pending[a.name]=true}},stopRequest:function(a,b){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[a.name];if(b&&this.pendingRequest==0&&this.formSubmitted&&this.form()){c(this.currentForm).submit();this.formSubmitted=false}else if(!b&&this.pendingRequest==0&&this.formSubmitted){c(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=
38
+ false}},previousValue:function(a){return c.data(a,"previousValue")||c.data(a,"previousValue",{old:null,valid:true,message:this.defaultMessage(a,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(a,b){a.constructor==String?this.classRuleSettings[a]=b:c.extend(this.classRuleSettings,
39
+ a)},classRules:function(a){var b={};(a=c(a).attr("class"))&&c.each(a.split(" "),function(){this in c.validator.classRuleSettings&&c.extend(b,c.validator.classRuleSettings[this])});return b},attributeRules:function(a){var b={};a=c(a);for(var d in c.validator.methods){var e;if(e=d==="required"&&typeof c.fn.prop==="function"?a.prop(d):a.attr(d))b[d]=e;else if(a[0].getAttribute("type")===d)b[d]=true}b.maxlength&&/-1|2147483647|524288/.test(b.maxlength)&&delete b.maxlength;return b},metadataRules:function(a){if(!c.metadata)return{};
40
+ var b=c.data(a.form,"validator").settings.meta;return b?c(a).metadata()[b]:c(a).metadata()},staticRules:function(a){var b={},d=c.data(a.form,"validator");if(d.settings.rules)b=c.validator.normalizeRule(d.settings.rules[a.name])||{};return b},normalizeRules:function(a,b){c.each(a,function(d,e){if(e===false)delete a[d];else if(e.param||e.depends){var f=true;switch(typeof e.depends){case "string":f=!!c(e.depends,b.form).length;break;case "function":f=e.depends.call(b,b)}if(f)a[d]=e.param!==undefined?
41
+ e.param:true;else delete a[d]}});c.each(a,function(d,e){a[d]=c.isFunction(e)?e(b):e});c.each(["minlength","maxlength","min","max"],function(){if(a[this])a[this]=Number(a[this])});c.each(["rangelength","range"],function(){if(a[this])a[this]=[Number(a[this][0]),Number(a[this][1])]});if(c.validator.autoCreateRanges){if(a.min&&a.max){a.range=[a.min,a.max];delete a.min;delete a.max}if(a.minlength&&a.maxlength){a.rangelength=[a.minlength,a.maxlength];delete a.minlength;delete a.maxlength}}a.messages&&delete a.messages;
42
+ return a},normalizeRule:function(a){if(typeof a=="string"){var b={};c.each(a.split(/\s/),function(){b[this]=true});a=b}return a},addMethod:function(a,b,d){c.validator.methods[a]=b;c.validator.messages[a]=d!=undefined?d:c.validator.messages[a];b.length<3&&c.validator.addClassRules(a,c.validator.normalizeRule(a))},methods:{required:function(a,b,d){if(!this.depend(d,b))return"dependency-mismatch";switch(b.nodeName.toLowerCase()){case "select":return(a=c(b).val())&&a.length>0;case "input":if(this.checkable(b))return this.getLength(a,
43
+ b)>0;default:return c.trim(a).length>0}},remote:function(a,b,d){if(this.optional(b))return"dependency-mismatch";var e=this.previousValue(b);this.settings.messages[b.name]||(this.settings.messages[b.name]={});e.originalMessage=this.settings.messages[b.name].remote;this.settings.messages[b.name].remote=e.message;d=typeof d=="string"&&{url:d}||d;if(this.pending[b.name])return"pending";if(e.old===a)return e.valid;e.old=a;var f=this;this.startRequest(b);var g={};g[b.name]=a;c.ajax(c.extend(true,{url:d,
44
+ mode:"abort",port:"validate"+b.name,dataType:"json",data:g,success:function(h){f.settings.messages[b.name].remote=e.originalMessage;var j=h===true;if(j){var i=f.formSubmitted;f.prepareElement(b);f.formSubmitted=i;f.successList.push(b);f.showErrors()}else{i={};h=h||f.defaultMessage(b,"remote");i[b.name]=e.message=c.isFunction(h)?h(a):h;f.showErrors(i)}e.valid=j;f.stopRequest(b,j)}},d));return"pending"},minlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)>=d},maxlength:function(a,
45
+ b,d){return this.optional(b)||this.getLength(c.trim(a),b)<=d},rangelength:function(a,b,d){a=this.getLength(c.trim(a),b);return this.optional(b)||a>=d[0]&&a<=d[1]},min:function(a,b,d){return this.optional(b)||a>=d},max:function(a,b,d){return this.optional(b)||a<=d},range:function(a,b,d){return this.optional(b)||a>=d[0]&&a<=d[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a)},
46
+ url:function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},
47
+ date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 -]+/.test(a))return false;var d=0,e=0,f=false;a=a.replace(/\D/g,"");for(var g=a.length-1;g>=
48
+ 0;g--){e=a.charAt(g);e=parseInt(e,10);if(f)if((e*=2)>9)e-=9;d+=e;f=!f}return d%10==0},accept:function(a,b,d){d=typeof d=="string"?d.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||a.match(RegExp(".("+d+")$","i"))},equalTo:function(a,b,d){d=c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){c(b).valid()});return a==d.val()}}});c.format=c.validator.format})(jQuery);
49
+ (function(c){var a={};if(c.ajaxPrefilter)c.ajaxPrefilter(function(d,e,f){e=d.port;if(d.mode=="abort"){a[e]&&a[e].abort();a[e]=f}});else{var b=c.ajax;c.ajax=function(d){var e=("port"in d?d:c.ajaxSettings).port;if(("mode"in d?d:c.ajaxSettings).mode=="abort"){a[e]&&a[e].abort();return a[e]=b.apply(this,arguments)}return b.apply(this,arguments)}}})(jQuery);
50
+ (function(c){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.handle.call(this,e)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)},handler:function(e){arguments[0]=c.event.fix(e);arguments[0].type=b;return c.event.handle.apply(this,arguments)}}});c.extend(c.fn,{validateDelegate:function(a,
51
+ b,d){return this.bind(b,function(e){var f=c(e.target);if(f.is(a))return d.apply(f,arguments)})}})})(jQuery);
skin/frontend/base/default/dropfin/newsletterpopup/js/newsletterpopup.js ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Dropfin
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE_AFL.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magento.com so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade
17
+ * this extension to newer versions in the future.
18
+ *
19
+ * @category Dropfin
20
+ * @package Newsletter Popup
21
+ * @copyright Copyright (c) Dropfin (http://www.dropfin.com)
22
+ */
23
+
24
+ var Cookie = {
25
+ all: function() {
26
+ var pairs = document.cookie.split(';');
27
+ var cookies = {};
28
+ pairs.each(function(item, index) {
29
+ var pair = item.strip().split('=');
30
+ cookies[unescape(pair[0])] = unescape(pair[1]);
31
+ });
32
+
33
+ return cookies;
34
+ },
35
+ read: function(cookieName) {
36
+ var cookies = this.all();
37
+ if(cookies[cookieName]) {
38
+ return cookies[cookieName];
39
+ }
40
+ return null;
41
+ },
42
+ write: function(cookieName, cookieValue, cookieLifeTime) {
43
+ var expires = '';
44
+ if (cookieLifeTime) {
45
+ var date = new Date();
46
+ date.setTime(cookieLifeTime);
47
+ expires = '; expires='+date.toGMTString();
48
+ }
49
+ var urlPath = '/';
50
+ document.cookie = escape(cookieName) + "=" + escape(cookieValue) + expires + "; path=" + urlPath;
51
+ },
52
+ clear: function(cookieName) {
53
+ this.write(cookieName, '', -1);
54
+ }
55
+ };
56
+
57
+ function keyFocus(input, cont) {
58
+ if(input.value.trim() == cont.trim()) {
59
+ input.value = '';
60
+ }
61
+ }
62
+
63
+ function keyBlur(input, cont) {
64
+ if(input.value.trim() == '') {
65
+ input.value = cont.trim();
66
+ }
67
+ }