Sourcefuse_Sfcaptcha - Version 0.1.0

Version Notes

It is an easy-to-use, simple and intuitive captcha system. It needs human action instead of to read a hard text. Admin can easily enable / disable slider captcha for various magento frontend forms like contact us, product review form, customer sign-in / sign-up.

Download this release

Release Info

Developer Sourcefuse Technologies
Extension Sourcefuse_Sfcaptcha
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

Files changed (37) hide show
  1. app/code/community/Sourcefuse/Sfcaptcha/Helper/Data.php +146 -0
  2. app/code/community/Sourcefuse/Sfcaptcha/controllers/IndexController.php +33 -0
  3. app/code/community/Sourcefuse/Sfcaptcha/etc/adminhtml.xml +23 -0
  4. app/code/community/Sourcefuse/Sfcaptcha/etc/config.xml +44 -0
  5. app/code/community/Sourcefuse/Sfcaptcha/etc/system.xml +84 -0
  6. app/design/frontend/base/default/layout/sfcaptcha.xml +159 -0
  7. app/design/frontend/base/default/template/sfcaptcha/contactus.phtml +88 -0
  8. app/design/frontend/base/default/template/sfcaptcha/login.phtml +77 -0
  9. app/design/frontend/base/default/template/sfcaptcha/register.phtml +172 -0
  10. app/design/frontend/base/default/template/sfcaptcha/review.phtml +120 -0
  11. app/design/frontend/rwd/default/layout/sfcaptcha.xml +163 -0
  12. app/design/frontend/rwd/default/template/sfcaptcha/contactus.phtml +82 -0
  13. app/design/frontend/rwd/default/template/sfcaptcha/login.phtml +84 -0
  14. app/design/frontend/rwd/default/template/sfcaptcha/register.phtml +168 -0
  15. app/design/frontend/rwd/default/template/sfcaptcha/review.phtml +154 -0
  16. app/etc/modules/Sourcefuse_Sfcaptcha.xml +9 -0
  17. package.xml +18 -0
  18. skin/frontend/base/default/css/sfcaptcha/QapTcha.jquery.css +57 -0
  19. skin/frontend/base/default/css/sfcaptcha/images/bg_draggable_qaptcha.jpg +0 -0
  20. skin/frontend/base/default/js/sfcaptcha/QapTcha.jquery.js +91 -0
  21. skin/frontend/base/default/js/sfcaptcha/QapTcha.jquery.min.js +11 -0
  22. skin/frontend/base/default/js/sfcaptcha/app.js +1281 -0
  23. skin/frontend/base/default/js/sfcaptcha/browser.js +63 -0
  24. skin/frontend/base/default/js/sfcaptcha/jquery-ui.js +25 -0
  25. skin/frontend/base/default/js/sfcaptcha/jquery.js +2 -0
  26. skin/frontend/base/default/js/sfcaptcha/jquery.ui.touch.js +224 -0
  27. skin/frontend/rwd/default/css/sfcaptcha/QapTcha.jquery.css +106 -0
  28. skin/frontend/rwd/default/css/sfcaptcha/images/bg_draggable_qaptcha.jpg +0 -0
  29. skin/frontend/rwd/default/js/sfcaptcha/QapTcha.jquery.js +91 -0
  30. skin/frontend/rwd/default/js/sfcaptcha/QapTcha.jquery.min.js +11 -0
  31. skin/frontend/rwd/default/js/sfcaptcha/app.js +1281 -0
  32. skin/frontend/rwd/default/js/sfcaptcha/browser.js +63 -0
  33. skin/frontend/rwd/default/js/sfcaptcha/jquery-ui.js +25 -0
  34. skin/frontend/rwd/default/js/sfcaptcha/jquery.js +2 -0
  35. skin/frontend/rwd/default/js/sfcaptcha/jquery.ui.touch.js +224 -0
  36. skin/frontend/rwd/default/js/sfcaptcha/noconflict.js +27 -0
  37. skin/frontend/rwd/default/js/sfcaptcha/slideshow.js +44 -0
app/code/community/Sourcefuse/Sfcaptcha/Helper/Data.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sourcefuse_Sfcaptcha_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ /* functions started for contact us */
7
+
8
+ public function getJqueryContactUs(){
9
+ if(Mage::getSingleton('core/design_package')->getPackageName() != 'rwd')
10
+ return 'js/sfcaptcha/jquery.js';
11
+ }
12
+
13
+ public function getCssContactus(){
14
+
15
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')) return 'css/sfcaptcha/QapTcha.jquery.css';
16
+ }
17
+
18
+ public function getBrowserJsContactus(){
19
+
20
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')) return 'js/sfcaptcha/browser.js';
21
+ }
22
+
23
+ public function getJqueryUiContactus(){
24
+
25
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')) return 'js/sfcaptcha/jquery-ui.js';
26
+ }
27
+
28
+ public function getJqueryUiTouchContactus(){
29
+
30
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')) return 'js/sfcaptcha/jquery.ui.touch.js';
31
+ }
32
+
33
+ public function getQapTchaJsContactus(){
34
+
35
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')) return 'js/sfcaptcha/QapTcha.jquery.js';
36
+ }
37
+
38
+
39
+ /* functions ends here */
40
+
41
+
42
+ /* functions started for customer login */
43
+
44
+ public function getJqueryCustomerLogin(){
45
+
46
+ if(Mage::getSingleton('core/design_package')->getPackageName() != 'rwd')
47
+ return 'js/sfcaptcha/jquery.js';
48
+ }
49
+
50
+ public function getCssCustomerLogin(){
51
+
52
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signin')) return 'css/sfcaptcha/QapTcha.jquery.css';
53
+ }
54
+
55
+ public function getBrowserJsCustomerLogin(){
56
+
57
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signin')) return 'js/sfcaptcha/browser.js';
58
+ }
59
+
60
+ public function getJqueryUiCustomerLogin(){
61
+
62
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signin')) return 'js/sfcaptcha/jquery-ui.js';
63
+ }
64
+
65
+ public function getJqueryUiTouchCustomerLogin(){
66
+
67
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signin')) return 'js/sfcaptcha/jquery.ui.touch.js';
68
+ }
69
+
70
+ public function getQapTchaJsCustomerLogin(){
71
+
72
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signin')) return 'js/sfcaptcha/QapTcha.jquery.js';
73
+ }
74
+
75
+ /* functions ends here */
76
+
77
+ /* functions started for customer signup */
78
+
79
+ public function getJqueryCustomerSignup(){
80
+
81
+ if(Mage::getSingleton('core/design_package')->getPackageName() != 'rwd')
82
+ return 'js/sfcaptcha/jquery.js';
83
+ }
84
+
85
+ public function getCssCustomerSignup(){
86
+
87
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signup')) return 'css/sfcaptcha/QapTcha.jquery.css';
88
+ }
89
+
90
+ public function getBrowserJsCustomerSignup(){
91
+
92
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signup')) return 'js/sfcaptcha/browser.js';
93
+ }
94
+
95
+ public function getJqueryUiCustomerSignup(){
96
+
97
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signup')) return 'js/sfcaptcha/jquery-ui.js';
98
+ }
99
+
100
+ public function getJqueryUiTouchCustomerSignup(){
101
+
102
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signup')) return 'js/sfcaptcha/jquery.ui.touch.js';
103
+ }
104
+
105
+ public function getQapTchaJsCustomerSignup(){
106
+
107
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signup')) return 'js/sfcaptcha/QapTcha.jquery.js';
108
+ }
109
+
110
+ /* functions ends here */
111
+
112
+ /* functions started for product review */
113
+
114
+ public function getJqueryProductReview(){
115
+
116
+ if(Mage::getSingleton('core/design_package')->getPackageName() != 'rwd')
117
+ return 'js/sfcaptcha/jquery.js';
118
+ }
119
+
120
+ public function getCssProductReview(){
121
+
122
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/review')) return 'css/sfcaptcha/QapTcha.jquery.css';
123
+ }
124
+
125
+ public function getBrowserJsProductReview(){
126
+
127
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/review')) return 'js/sfcaptcha/browser.js';
128
+ }
129
+
130
+ public function getJqueryUiProductReview(){
131
+
132
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/review')) return 'js/sfcaptcha/jquery-ui.js';
133
+ }
134
+
135
+ public function getJqueryUiTouchProductReview(){
136
+
137
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/review')) return 'js/sfcaptcha/jquery.ui.touch.js';
138
+ }
139
+
140
+ public function getQapTchaJsProductReview(){
141
+
142
+ if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/review')) return 'js/sfcaptcha/QapTcha.jquery.js';
143
+ }
144
+
145
+ /* functions ends here */
146
+ }
app/code/community/Sourcefuse/Sfcaptcha/controllers/IndexController.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Sourcefuse_Sfcaptcha_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ session_start();
7
+ $aResponse['error'] = false;
8
+
9
+ if(isset($_POST['action']) && isset($_POST['qaptcha_key']))
10
+ {
11
+ $_SESSION['qaptcha_key'] = false;
12
+
13
+ if(htmlentities($_POST['action'], ENT_QUOTES, 'UTF-8') == 'qaptcha')
14
+ {
15
+ $_SESSION['qaptcha_key'] = $_POST['qaptcha_key'];
16
+ echo json_encode($aResponse);
17
+ }
18
+ else
19
+ {
20
+ $aResponse['error'] = true;
21
+ echo json_encode($aResponse);
22
+ }
23
+ }
24
+ else
25
+ {
26
+ $aResponse['error'] = true;
27
+ echo json_encode($aResponse);
28
+ }
29
+
30
+ //$this->loadLayout();
31
+ //$this->renderLayout();
32
+ }
33
+ }
app/code/community/Sourcefuse/Sfcaptcha/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <sourcefuse_section translate="title" module="sfcaptcha">
12
+ <title>My Custom Section</title>
13
+ <sort_order>100</sort_order>
14
+ </sourcefuse_section>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/Sourcefuse/Sfcaptcha/etc/config.xml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Sourcefuse_Sfcaptcha>
5
+ <version>0.1.0</version>
6
+ </Sourcefuse_Sfcaptcha>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <sfcaptcha>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Sourcefuse_Sfcaptcha</module>
14
+ <frontName>sfcaptcha</frontName>
15
+ </args>
16
+ </sfcaptcha>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <sfcaptcha>
21
+ <file>sfcaptcha.xml</file>
22
+ </sfcaptcha>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <global>
27
+ <helpers>
28
+ <sfcaptcha>
29
+ <class>Sourcefuse_Sfcaptcha_Helper</class>
30
+ </sfcaptcha>
31
+ </helpers>
32
+ </global>
33
+ <default>
34
+ <sourcefuse_section>
35
+ <sourcefuse_group>
36
+ <enabled>1</enabled>
37
+ <contactus>1</contactus>
38
+ <signin>1</signin>
39
+ <signup>1</signup>
40
+ <review>1</review>
41
+ </sourcefuse_group>
42
+ </sourcefuse_section>
43
+ </default>
44
+ </config>
app/code/community/Sourcefuse/Sfcaptcha/etc/system.xml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+ <config>
3
+ <tabs>
4
+ <sourcefuse_tab module="sfcaptcha" translate="label">
5
+ <label>Sourcefuse Extensions</label>
6
+ <sort_order>100</sort_order>
7
+ </sourcefuse_tab>
8
+ </tabs>
9
+ <sections>
10
+ <sourcefuse_section module="sfcaptcha" translate="label">
11
+ <label>Slider Captcha</label>
12
+ <sort_order>200</sort_order>
13
+ <show_in_default>1</show_in_default>
14
+ <show_in_website>1</show_in_website>
15
+ <show_in_store>1</show_in_store>
16
+ <tab>sourcefuse_tab</tab>
17
+ <groups>
18
+ <sourcefuse_group translate="label">
19
+ <label>General</label>
20
+ <sort_order>10</sort_order>
21
+ <show_in_default>1</show_in_default>
22
+ <show_in_website>1</show_in_website>
23
+ <show_in_store>1</show_in_store>
24
+ <fields>
25
+ <enabled translate="label" module="sfcaptcha">
26
+ <label>Enabled</label>
27
+ <frontend_type>select</frontend_type>
28
+ <source_model>adminhtml/system_config_source_yesno</source_model>
29
+ <comment>Enable / Disable extension</comment>
30
+ <sort_order>9</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>0</show_in_store>
34
+ </enabled>
35
+
36
+ <contactus translate="label" module="sfcaptcha">
37
+ <label>Contact Us</label>
38
+ <frontend_type>select</frontend_type>
39
+ <source_model>adminhtml/system_config_source_yesno</source_model>
40
+ <comment>Enable / Disable slider captcha for contact us</comment>
41
+ <sort_order>29</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>0</show_in_store>
45
+ </contactus>
46
+
47
+ <signin translate="label" module="sfcaptcha">
48
+ <label>Customer Signin</label>
49
+ <frontend_type>select</frontend_type>
50
+ <source_model>adminhtml/system_config_source_yesno</source_model>
51
+ <comment>Enable / Disable slider captcha for customer signin</comment>
52
+ <sort_order>39</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>0</show_in_store>
56
+ </signin>
57
+
58
+ <signup translate="label" module="sfcaptcha">
59
+ <label>Customer Signup</label>
60
+ <frontend_type>select</frontend_type>
61
+ <source_model>adminhtml/system_config_source_yesno</source_model>
62
+ <comment>Enable / Disable slider captcha for customer signup</comment>
63
+ <sort_order>49</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>1</show_in_website>
66
+ <show_in_store>0</show_in_store>
67
+ </signup>
68
+
69
+ <review translate="label" module="sfcaptcha">
70
+ <label>Product Review</label>
71
+ <frontend_type>select</frontend_type>
72
+ <source_model>adminhtml/system_config_source_yesno</source_model>
73
+ <comment>Enable / Disable slider captcha for product review</comment>
74
+ <sort_order>59</sort_order>
75
+ <show_in_default>1</show_in_default>
76
+ <show_in_website>1</show_in_website>
77
+ <show_in_store>0</show_in_store>
78
+ </review>
79
+ </fields>
80
+ </sourcefuse_group>
81
+ </groups>
82
+ </sourcefuse_section>
83
+ </sections>
84
+ </config>
app/design/frontend/base/default/layout/sfcaptcha.xml ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ </default>
5
+ <!--<sfcaptcha_index_index>
6
+ <reference name="content">
7
+ <block type="sfcaptcha/sfcaptcha" name="sfcaptcha" template="sfcaptcha/sfcaptcha.phtml" />
8
+ </reference>
9
+ </sfcaptcha_index_index>-->
10
+ <contacts_index_index>
11
+ <reference name="head">
12
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><type>skin_js</type><name helper="sfcaptcha/data/getJqueryContactUs"/><params/><if/></action>
13
+
14
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
15
+ <type>skin_css</type>
16
+ <name helper="sfcaptcha/data/getCssContactus"/><params/><if/>
17
+ </action>
18
+
19
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
20
+ <type>skin_js</type>
21
+ <name helper="sfcaptcha/data/getBrowserJsContactus"/><params/><if/>
22
+ </action>
23
+
24
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
25
+ <type>skin_js</type>
26
+ <name helper="sfcaptcha/data/getJqueryUiContactus"/><params/><if/>
27
+ </action>
28
+
29
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
30
+ <type>skin_js</type>
31
+ <name helper="sfcaptcha/data/getJqueryUiTouchContactus"/><params/><if/>
32
+ </action>
33
+
34
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
35
+ <type>skin_js</type>
36
+ <name helper="sfcaptcha/data/getQapTchaJsContactus"/><params/><if/>
37
+ </action>
38
+ </reference>
39
+
40
+ <reference name="content">
41
+ <reference name="contactForm">
42
+ <action method="setTemplate" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><template>sfcaptcha/contactus.phtml</template></action>
43
+ </reference>
44
+ </reference>
45
+ </contacts_index_index>
46
+
47
+ <customer_account_login>
48
+ <reference name="head">
49
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><type>skin_js</type><name helper="sfcaptcha/data/getJqueryCustomerLogin"/><params/><if/></action>
50
+
51
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
52
+ <type>skin_css</type>
53
+ <name helper="sfcaptcha/data/getCssCustomerLogin"/><params/><if/>
54
+ </action>
55
+
56
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
57
+ <type>skin_js</type>
58
+ <name helper="sfcaptcha/data/getBrowserJsCustomerLogin"/><params/><if/>
59
+ </action>
60
+
61
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
62
+ <type>skin_js</type>
63
+ <name helper="sfcaptcha/data/getJqueryUiCustomerLogin"/><params/><if/>
64
+ </action>
65
+
66
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
67
+ <type>skin_js</type>
68
+ <name helper="sfcaptcha/data/getJqueryUiTouchCustomerLogin"/><params/><if/>
69
+ </action>
70
+
71
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
72
+ <type>skin_js</type>
73
+ <name helper="sfcaptcha/data/getQapTchaJsCustomerLogin"/><params/><if/>
74
+ </action>
75
+ </reference>
76
+
77
+ <reference name="content">
78
+ <reference name="customer_form_login">
79
+ <action method="setTemplate" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><template>sfcaptcha/login.phtml</template></action>
80
+ </reference>
81
+ </reference>
82
+ </customer_account_login>
83
+
84
+ <customer_account_create>
85
+ <reference name="head">
86
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><type>skin_js</type><name helper="sfcaptcha/data/getJqueryCustomerSignup"/><params/><if/></action>
87
+
88
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
89
+ <type>skin_css</type>
90
+ <name helper="sfcaptcha/data/getCssCustomerSignup"/><params/><if/>
91
+ </action>
92
+
93
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
94
+ <type>skin_js</type>
95
+ <name helper="sfcaptcha/data/getBrowserJsCustomerSignup"/><params/><if/>
96
+ </action>
97
+
98
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
99
+ <type>skin_js</type>
100
+ <name helper="sfcaptcha/data/getJqueryUiCustomerSignup"/><params/><if/>
101
+ </action>
102
+
103
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
104
+ <type>skin_js</type>
105
+ <name helper="sfcaptcha/data/getJqueryUiTouchCustomerSignup"/><params/><if/>
106
+ </action>
107
+
108
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
109
+ <type>skin_js</type>
110
+ <name helper="sfcaptcha/data/getQapTchaJsCustomerSignup"/><params/><if/>
111
+ </action>
112
+ </reference>
113
+
114
+ <reference name="content">
115
+ <reference name="customer_form_register">
116
+ <action method="setTemplate" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><template>sfcaptcha/register.phtml</template></action>
117
+ </reference>
118
+ </reference>
119
+ </customer_account_create>
120
+
121
+ <review_product_list>
122
+ <reference name="head">
123
+ <action method="removeItem"><type>skin_js</type><name>js/app.js</name></action>
124
+ <action method="addItem"><type>skin_js</type><name>js/sfcaptcha/app.js</name></action>
125
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><type>skin_js</type><name helper="sfcaptcha/data/getJqueryProductReview"/><params/><if/></action>
126
+
127
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
128
+ <type>skin_css</type>
129
+ <name helper="sfcaptcha/data/getCssProductReview"/><params/><if/>
130
+ </action>
131
+
132
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
133
+ <type>skin_js</type>
134
+ <name helper="sfcaptcha/data/getBrowserJsProductReview"/><params/><if/>
135
+ </action>
136
+
137
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
138
+ <type>skin_js</type>
139
+ <name helper="sfcaptcha/data/getJqueryUiProductReview"/><params/><if/>
140
+ </action>
141
+
142
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
143
+ <type>skin_js</type>
144
+ <name helper="sfcaptcha/data/getJqueryUiTouchProductReview"/><params/><if/>
145
+ </action>
146
+
147
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
148
+ <type>skin_js</type>
149
+ <name helper="sfcaptcha/data/getQapTchaJsProductReview"/><params/><if/>
150
+ </action>
151
+ </reference>
152
+
153
+ <reference name="content">
154
+ <reference name="product.review.form">
155
+ <action method="setTemplate" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><template>sfcaptcha/review.phtml</template></action>
156
+ </reference>
157
+ </reference>
158
+ </review_product_list>
159
+ </layout>
app/design/frontend/base/default/template/sfcaptcha/contactus.phtml ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@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 Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div id="messages_product_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
28
+ <div class="page-title">
29
+ <h1><?php echo Mage::helper('contacts')->__('Contact Us') ?></h1>
30
+ </div>
31
+ <form action="<?php echo $this->getFormAction(); ?>" id="contactForm" method="post">
32
+ <div class="fieldset">
33
+ <h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2>
34
+ <ul class="form-list">
35
+ <li class="fields">
36
+ <div class="field">
37
+ <label for="name" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Name') ?></label>
38
+ <div class="input-box">
39
+ <input name="name" id="name" title="<?php echo Mage::helper('contacts')->__('Name') ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserName()) ?>" class="input-text required-entry" type="text" />
40
+ </div>
41
+ </div>
42
+ <div class="field">
43
+ <label for="email" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Email') ?></label>
44
+ <div class="input-box">
45
+ <input name="email" id="email" title="<?php echo Mage::helper('contacts')->__('Email') ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserEmail()) ?>" class="input-text required-entry validate-email" type="text" />
46
+ </div>
47
+ </div>
48
+ </li>
49
+ <li>
50
+ <label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label>
51
+ <div class="input-box">
52
+ <input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="input-text" type="text" />
53
+ </div>
54
+ </li>
55
+ <li class="wide">
56
+ <label for="comment" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Comment') ?></label>
57
+ <div class="input-box">
58
+ <textarea name="comment" id="comment" title="<?php echo Mage::helper('contacts')->__('Comment') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
59
+ </div>
60
+ </li>
61
+ </ul>
62
+ </div>
63
+
64
+ <div class="buttons-set">
65
+
66
+ <p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
67
+ <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
68
+ <button type="submit" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>
69
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')){?>
70
+ <div class="QapTcha"></div>
71
+ <?php }?>
72
+ </div>
73
+ </form>
74
+ <script type="text/javascript">
75
+ //<![CDATA[
76
+ var contactForm = new VarienForm('contactForm', true);
77
+ //]]>
78
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')){?>
79
+ jQuery(document).ready(function(){
80
+ // More complex call
81
+ jQuery('.QapTcha').QapTcha({
82
+ disabledSubmit:true,
83
+ txtLock:'Locked: Please slide it to right to enable submit button.',
84
+ PHPfile : '<?php echo Mage::getBaseUrl() ?>sfcaptcha'
85
+ });
86
+ });
87
+ <?php }?>
88
+ </script>
app/design/frontend/base/default/template/sfcaptcha/login.phtml ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="account-login">
2
+ <div class="page-title">
3
+ <h1><?php echo $this->__('Login or Create an Account') ?></h1>
4
+ </div>
5
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
6
+ <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
7
+ <?php echo $this->getBlockHtml('formkey'); ?>
8
+ <div class="col2-set">
9
+ <div class="col-1 new-users">
10
+ <div class="content">
11
+ <h2><?php echo $this->__('New Customers') ?></h2>
12
+ <p><?php echo $this->__('By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.') ?></p>
13
+ </div>
14
+ </div>
15
+ <div class="col-2 registered-users">
16
+ <div class="content">
17
+ <h2><?php echo $this->__('Registered Customers') ?></h2>
18
+ <p><?php echo $this->__('If you have an account with us, please log in.') ?></p>
19
+ <ul class="form-list">
20
+ <li>
21
+ <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
22
+ <div class="input-box">
23
+ <input type="text" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
24
+ </div>
25
+ </li>
26
+ <li>
27
+ <label for="pass" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
28
+ <div class="input-box">
29
+ <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
30
+ </div>
31
+ </li>
32
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
33
+ <?php echo $this->getChildHtml('persistent.remember.me'); ?>
34
+ </ul>
35
+ <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
36
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
37
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')){?>
38
+ <div class="QapTcha"></div>
39
+ <?php }?>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ <div class="col2-set">
44
+ <div class="col-1 new-users">
45
+ <div class="buttons-set">
46
+ <button type="button" title="<?php echo $this->__('Create an Account') ?>" class="button" onclick="window.location='<?php echo Mage::helper('persistent')->getCreateAccountUrl($this->getCreateAccountUrl()) ?>';"><span><span><?php echo $this->__('Create an Account') ?></span></span></button>
47
+ </div>
48
+ </div>
49
+ <div class="col-2 registered-users">
50
+ <div class="buttons-set">
51
+ <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?></a>
52
+
53
+ <button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
54
+
55
+ </div>
56
+ </div>
57
+ </div>
58
+ <?php if (Mage::helper('checkout')->isContextCheckout()): ?>
59
+ <input name="context" type="hidden" value="checkout" />
60
+ <?php endif; ?>
61
+ </form>
62
+ <script type="text/javascript">
63
+ //<![CDATA[
64
+ var dataForm = new VarienForm('login-form', true);
65
+ //]]>
66
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')){?>
67
+ jQuery(document).ready(function(){
68
+ // More complex call
69
+ jQuery('.QapTcha').QapTcha({
70
+ disabledSubmit:true,
71
+ txtLock:'Locked: Please slide it to right to enable submit button.',
72
+ PHPfile : '<?php echo Mage::getBaseUrl() ?>sfcaptcha'
73
+ });
74
+ });
75
+ <?php }?>
76
+ </script>
77
+ </div>
app/design/frontend/base/default/template/sfcaptcha/register.phtml ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="account-create">
2
+ <div class="page-title">
3
+ <h1><?php echo $this->__('Create an Account') ?></h1>
4
+ </div>
5
+ <?php echo $this->getChildHtml('form_fields_before')?>
6
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
7
+ <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">
8
+ <div class="fieldset">
9
+ <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
10
+ <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
11
+ <h2 class="legend"><?php echo $this->__('Personal Information') ?></h2>
12
+ <ul class="form-list">
13
+ <li class="fields">
14
+ <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?>
15
+ </li>
16
+ <li>
17
+ <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
18
+ <div class="input-box">
19
+ <input type="text" name="email" id="email_address" value="<?php echo $this->escapeHtml($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
20
+ </div>
21
+ </li>
22
+ <?php if ($this->isNewsletterEnabled()): ?>
23
+ <li class="control">
24
+ <div class="input-box">
25
+ <input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />
26
+ </div>
27
+ <label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
28
+ </li>
29
+ <?php endif ?>
30
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
31
+ <?php if ($_dob->isEnabled()): ?>
32
+ <li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
33
+ <?php endif ?>
34
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
35
+ <?php if ($_taxvat->isEnabled()): ?>
36
+ <li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
37
+ <?php endif ?>
38
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
39
+ <?php if ($_gender->isEnabled()): ?>
40
+ <li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
41
+ <?php endif ?>
42
+ </ul>
43
+ </div>
44
+ <?php if($this->getShowAddressFields()): ?>
45
+ <div class="fieldset">
46
+ <input type="hidden" name="create_address" value="1" />
47
+ <h2 class="legend"><?php echo $this->__('Address Information') ?></h2>
48
+ <ul class="form-list">
49
+ <li class="fields">
50
+ <div class="field">
51
+ <label for="company"><?php echo $this->__('Company') ?></label>
52
+ <div class="input-box">
53
+ <input type="text" name="company" id="company" value="<?php echo $this->escapeHtml($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
54
+ </div>
55
+ </div>
56
+ <div class="field">
57
+ <label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
58
+ <div class="input-box">
59
+ <input type="text" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" />
60
+ </div>
61
+ </div>
62
+ </li>
63
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
64
+ <li class="wide">
65
+ <label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
66
+ <div class="input-box">
67
+ <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" />
68
+ </div>
69
+ </li>
70
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
71
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
72
+ <li class="wide">
73
+ <div class="input-box">
74
+ <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" />
75
+ </div>
76
+ </li>
77
+ <?php endfor; ?>
78
+ <li class="fields">
79
+ <div class="field">
80
+ <label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
81
+ <div class="input-box">
82
+ <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="city" />
83
+ </div>
84
+ </div>
85
+ <div class="field">
86
+ <label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
87
+ <div class="input-box">
88
+ <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
89
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
90
+ </select>
91
+ <script type="text/javascript">
92
+ //<![CDATA[
93
+ $('region_id').setAttribute('defaultValue', "<?php echo $this->getFormData()->getRegionId() ?>");
94
+ //]]>
95
+ </script>
96
+ <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
97
+ </div>
98
+ </div>
99
+ </li>
100
+ <li class="fields">
101
+ <div class="field">
102
+ <label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
103
+ <div class="input-box">
104
+ <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
105
+ </div>
106
+ </div>
107
+ <div class="field">
108
+ <label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
109
+ <div class="input-box">
110
+ <?php echo $this->getCountryHtmlSelect() ?>
111
+ </div>
112
+ </div>
113
+ </li>
114
+ </ul>
115
+ <input type="hidden" name="default_billing" value="1" />
116
+ <input type="hidden" name="default_shipping" value="1" />
117
+ </div>
118
+ <?php endif; ?>
119
+ <div class="fieldset">
120
+ <h2 class="legend"><?php echo $this->__('Login Information') ?></h2>
121
+ <ul class="form-list">
122
+ <li class="fields">
123
+ <div class="field">
124
+ <label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
125
+ <div class="input-box">
126
+ <input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
127
+ </div>
128
+ </div>
129
+ <div class="field">
130
+ <label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
131
+ <div class="input-box">
132
+ <input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
133
+ </div>
134
+ </div>
135
+ </li>
136
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
137
+ <?php echo $this->getChildHtml('persistent.remember.me'); ?>
138
+ </ul>
139
+ <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
140
+ </div>
141
+ <div class="buttons-set">
142
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
143
+ <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
144
+
145
+ <button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
146
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')){?>
147
+ <div class="QapTcha"></div>
148
+ <?php }?>
149
+ </div>
150
+ <?php if (Mage::helper('checkout')->isContextCheckout()): ?>
151
+ <input name="context" type="hidden" value="checkout" />
152
+ <?php endif; ?>
153
+ </form>
154
+ <script type="text/javascript">
155
+ //<![CDATA[
156
+ var dataForm = new VarienForm('form-validate', true);
157
+ <?php if($this->getShowAddressFields()): ?>
158
+ new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
159
+ <?php endif; ?>
160
+ //]]>
161
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')){?>
162
+ jQuery(document).ready(function(){
163
+ // More complex call
164
+ jQuery('.QapTcha').QapTcha({
165
+ disabledSubmit:true,
166
+ txtLock:'Locked: Please slide it to right to enable submit button.',
167
+ PHPfile : '<?php echo Mage::getBaseUrl() ?>sfcaptcha'
168
+ });
169
+ });
170
+ <?php }?>
171
+ </script>
172
+ </div>
app/design/frontend/base/default/template/sfcaptcha/review.phtml ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="form-add">
2
+ <h2><?php echo $this->__('Write Your Own Review') ?></h2>
3
+ <?php if ($this->getAllowWriteReviewFlag()): ?>
4
+ <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
5
+ <?php echo $this->getBlockHtml('formkey'); ?>
6
+ <fieldset>
7
+ <?php echo $this->getChildHtml('form_fields_before')?>
8
+ <h3><?php echo $this->__("You're reviewing:"); ?> <span><?php echo $this->escapeHtml($this->getProductInfo()->getName()) ?></span></h3>
9
+ <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
10
+ <h4><?php echo $this->__('How do you rate this product?') ?> <em class="required">*</em></h4>
11
+ <span id="input-message-box"></span>
12
+ <table class="data-table" id="product-review-table">
13
+ <col />
14
+ <col width="1" />
15
+ <col width="1" />
16
+ <col width="1" />
17
+ <col width="1" />
18
+ <col width="1" />
19
+ <thead>
20
+ <tr>
21
+ <th>&nbsp;</th>
22
+ <th><span class="nobr"><?php echo $this->__('1 star') ?></span></th>
23
+ <th><span class="nobr"><?php echo $this->__('2 stars') ?></span></th>
24
+ <th><span class="nobr"><?php echo $this->__('3 stars') ?></span></th>
25
+ <th><span class="nobr"><?php echo $this->__('4 stars') ?></span></th>
26
+ <th><span class="nobr"><?php echo $this->__('5 stars') ?></span></th>
27
+ </tr>
28
+ </thead>
29
+ <tbody>
30
+ <?php foreach ($this->getRatings() as $_rating): ?>
31
+ <tr>
32
+ <th><?php echo $this->escapeHtml($_rating->getRatingCode()) ?></th>
33
+ <?php foreach ($_rating->getOptions() as $_option): ?>
34
+ <td class="value"><input type="radio" name="ratings[<?php echo $_rating->getId() ?>]" id="<?php echo $this->escapeHtml($_rating->getRatingCode()) ?>_<?php echo $_option->getValue() ?>" value="<?php echo $_option->getId() ?>" class="radio" /></td>
35
+ <?php endforeach; ?>
36
+ </tr>
37
+ <?php endforeach; ?>
38
+ </tbody>
39
+ </table>
40
+ <input type="hidden" name="validate_rating" class="validate-rating" value="" />
41
+ <script type="text/javascript">decorateTable('product-review-table')</script>
42
+ <?php endif; ?>
43
+ <ul class="form-list">
44
+ <li>
45
+ <label for="nickname_field" class="required"><em>*</em><?php echo $this->__('Nickname') ?></label>
46
+ <div class="input-box">
47
+ <input type="text" name="nickname" id="nickname_field" class="input-text required-entry" value="<?php echo $this->escapeHtml($data->getNickname()) ?>" />
48
+ </div>
49
+ </li>
50
+ <li>
51
+ <label for="summary_field" class="required"><em>*</em><?php echo $this->__('Summary of Your Review') ?></label>
52
+ <div class="input-box">
53
+ <input type="text" name="title" id="summary_field" class="input-text required-entry" value="<?php echo $this->escapeHtml($data->getTitle()) ?>" />
54
+ </div>
55
+ </li>
56
+ <li>
57
+ <label for="review_field" class="required"><em>*</em><?php echo $this->__('Review') ?></label>
58
+ <div class="input-box">
59
+ <textarea name="detail" id="review_field" cols="5" rows="3" class="required-entry"><?php echo $this->escapeHtml($data->getDetail()) ?></textarea>
60
+ </div>
61
+ </li>
62
+ </ul>
63
+ </fieldset>
64
+ <div class="buttons-set">
65
+ <button type="submit" title="<?php echo $this->__('Submit Review') ?>" class="button"><span><span><?php echo $this->__('Submit Review') ?></span></span></button>
66
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')){?>
67
+ <div class="QapTcha"></div>
68
+ <?php }?>
69
+ </div>
70
+ </form>
71
+ <script type="text/javascript">
72
+ //<![CDATA[
73
+ var dataForm = new VarienForm('review-form');
74
+ Validation.addAllThese(
75
+ [
76
+ ['validate-rating', '<?php echo $this->__('Please select one of each of the ratings above') ?>', function(v) {
77
+ var trs = $('product-review-table').select('tr');
78
+ var inputs;
79
+ var error = 1;
80
+
81
+ for( var j=0; j < trs.length; j++ ) {
82
+ var tr = trs[j];
83
+ if( j > 0 ) {
84
+ inputs = tr.select('input');
85
+
86
+ for( i in inputs ) {
87
+ if( inputs[i].checked == true ) {
88
+ error = 0;
89
+ }
90
+ }
91
+
92
+ if( error == 1 ) {
93
+ return false;
94
+ } else {
95
+ error = 1;
96
+ }
97
+ }
98
+ }
99
+ return true;
100
+ }]
101
+ ]
102
+ );
103
+ //]]>
104
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')){?>
105
+ jQuery(document).ready(function(){
106
+ // More complex call
107
+ jQuery('.QapTcha').QapTcha({
108
+ disabledSubmit:true,
109
+ txtLock:'Locked: Please slide it to right to enable submit button.',
110
+ PHPfile : '<?php echo Mage::getBaseUrl() ?>sfcaptcha'
111
+ });
112
+ });
113
+ <?php }?>
114
+ </script>
115
+ <?php else: ?>
116
+ <p class="review-nologged" id="review-form">
117
+ <?php echo $this->__('Only registered users can write reviews. Please, <a href="%s">log in</a> or <a href="%s">register</a>', $this->getLoginLink(), Mage::helper('customer')->getRegisterUrl()) ?>
118
+ </p>
119
+ <?php endif ?>
120
+ </div>
app/design/frontend/rwd/default/layout/sfcaptcha.xml ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ </default>
5
+ <!--<sfcaptcha_index_index>
6
+ <reference name="content">
7
+ <block type="sfcaptcha/sfcaptcha" name="sfcaptcha" template="sfcaptcha/sfcaptcha.phtml" />
8
+ </reference>
9
+ </sfcaptcha_index_index>-->
10
+ <contacts_index_index>
11
+ <reference name="head">
12
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><type>skin_js</type><name helper="sfcaptcha/data/getJqueryContactUs"/><params/><if/></action>
13
+
14
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
15
+ <type>skin_css</type>
16
+ <name helper="sfcaptcha/data/getCssContactus"/><params/><if/>
17
+ </action>
18
+
19
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
20
+ <type>skin_js</type>
21
+ <name helper="sfcaptcha/data/getBrowserJsContactus"/><params/><if/>
22
+ </action>
23
+
24
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
25
+ <type>skin_js</type>
26
+ <name helper="sfcaptcha/data/getJqueryUiContactus"/><params/><if/>
27
+ </action>
28
+
29
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
30
+ <type>skin_js</type>
31
+ <name helper="sfcaptcha/data/getJqueryUiTouchContactus"/><params/><if/>
32
+ </action>
33
+
34
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
35
+ <type>skin_js</type>
36
+ <name helper="sfcaptcha/data/getQapTchaJsContactus"/><params/><if/>
37
+ </action>
38
+ </reference>
39
+
40
+ <reference name="content">
41
+ <reference name="contactForm">
42
+ <action method="setTemplate" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><template>sfcaptcha/contactus.phtml</template></action>
43
+ </reference>
44
+ </reference>
45
+ </contacts_index_index>
46
+
47
+ <customer_account_login>
48
+ <reference name="head">
49
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><type>skin_js</type><name helper="sfcaptcha/data/getJqueryCustomerLogin"/><params/><if/></action>
50
+
51
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
52
+ <type>skin_css</type>
53
+ <name helper="sfcaptcha/data/getCssCustomerLogin"/><params/><if/>
54
+ </action>
55
+
56
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
57
+ <type>skin_js</type>
58
+ <name helper="sfcaptcha/data/getBrowserJsCustomerLogin"/><params/><if/>
59
+ </action>
60
+
61
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
62
+ <type>skin_js</type>
63
+ <name helper="sfcaptcha/data/getJqueryUiCustomerLogin"/><params/><if/>
64
+ </action>
65
+
66
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
67
+ <type>skin_js</type>
68
+ <name helper="sfcaptcha/data/getJqueryUiTouchCustomerLogin"/><params/><if/>
69
+ </action>
70
+
71
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
72
+ <type>skin_js</type>
73
+ <name helper="sfcaptcha/data/getQapTchaJsCustomerLogin"/><params/><if/>
74
+ </action>
75
+ </reference>
76
+
77
+ <reference name="content">
78
+ <reference name="customer_form_login">
79
+ <action method="setTemplate" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><template>sfcaptcha/login.phtml</template></action>
80
+ </reference>
81
+ </reference>
82
+ </customer_account_login>
83
+
84
+ <customer_account_create>
85
+ <reference name="head">
86
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><type>skin_js</type><name helper="sfcaptcha/data/getJqueryCustomerSignup"/><params/><if/></action>
87
+
88
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
89
+ <type>skin_css</type>
90
+ <name helper="sfcaptcha/data/getCssCustomerSignup"/><params/><if/>
91
+ </action>
92
+
93
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
94
+ <type>skin_js</type>
95
+ <name helper="sfcaptcha/data/getBrowserJsCustomerSignup"/><params/><if/>
96
+ </action>
97
+
98
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
99
+ <type>skin_js</type>
100
+ <name helper="sfcaptcha/data/getJqueryUiCustomerSignup"/><params/><if/>
101
+ </action>
102
+
103
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
104
+ <type>skin_js</type>
105
+ <name helper="sfcaptcha/data/getJqueryUiTouchCustomerSignup"/><params/><if/>
106
+ </action>
107
+
108
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
109
+ <type>skin_js</type>
110
+ <name helper="sfcaptcha/data/getQapTchaJsCustomerSignup"/><params/><if/>
111
+ </action>
112
+ </reference>
113
+
114
+ <reference name="content">
115
+ <reference name="customer_form_register">
116
+ <action method="setTemplate" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><template>sfcaptcha/register.phtml</template></action>
117
+ </reference>
118
+ </reference>
119
+ </customer_account_create>
120
+
121
+ <review_product_list>
122
+ <reference name="head">
123
+ <action method="removeItem"><type>skin_js</type><name>js/app.js</name></action>
124
+ <action method="removeItem"><type>skin_js</type><name>js/slideshow.js</name></action>
125
+ <action method="addItem"><type>skin_js</type><name>js/sfcaptcha/noconflict.js</name></action>
126
+ <action method="addItem"><type>skin_js</type><name>js/sfcaptcha/app.js</name></action>
127
+ <action method="addItem"><type>skin_js</type><name>js/sfcaptcha/slideshow.js</name></action>
128
+
129
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><type>skin_js</type><name helper="sfcaptcha/data/getJqueryProductReview"/><params/><if/></action>
130
+
131
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
132
+ <type>skin_css</type>
133
+ <name helper="sfcaptcha/data/getCssProductReview"/><params/><if/>
134
+ </action>
135
+
136
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
137
+ <type>skin_js</type>
138
+ <name helper="sfcaptcha/data/getBrowserJsProductReview"/><params/><if/>
139
+ </action>
140
+
141
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
142
+ <type>skin_js</type>
143
+ <name helper="sfcaptcha/data/getJqueryUiProductReview"/><params/><if/>
144
+ </action>
145
+
146
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
147
+ <type>skin_js</type>
148
+ <name helper="sfcaptcha/data/getJqueryUiTouchProductReview"/><params/><if/>
149
+ </action>
150
+
151
+ <action method="addItem" ifconfig="sourcefuse_section/sourcefuse_group/enabled">
152
+ <type>skin_js</type>
153
+ <name helper="sfcaptcha/data/getQapTchaJsProductReview"/><params/><if/>
154
+ </action>
155
+ </reference>
156
+
157
+ <reference name="content">
158
+ <reference name="product.review.form">
159
+ <action method="setTemplate" ifconfig="sourcefuse_section/sourcefuse_group/enabled"><template>sfcaptcha/review.phtml</template></action>
160
+ </reference>
161
+ </reference>
162
+ </review_product_list>
163
+ </layout>
app/design/frontend/rwd/default/template/sfcaptcha/contactus.phtml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $contactForm = Mage::getSingleton('core/session')->getData('contactForm'); ?>
2
+ <?php $contactForm = $contactForm ? $contactForm : new Varien_Object(); ?>
3
+ <?php $contactForm->setName( (strlen($contactForm->getName()) > 0 ? $contactForm->getName() : $this->helper('contacts')->getUserName()) ); ?>
4
+ <?php $contactForm->setEmail( (strlen($contactForm->getEmail()) > 0 ? $contactForm->getEmail() : $this->helper('contacts')->getUserEmail()) ); ?>
5
+
6
+ <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
7
+ <div class="page-title">
8
+ <h1><?php echo Mage::helper('contacts')->__('Contact Us') ?></h1>
9
+ </div>
10
+ <script type="text/javascript">
11
+ //<![CDATA[
12
+ var RecaptchaOptions = {
13
+ theme : '<?php echo $this->getCaptchaTheme(); ?>',
14
+ lang : '<?php echo $this->getCaptchaLang(); ?>',
15
+ };
16
+ //]]>
17
+ </script>
18
+ <form action="<?php echo $this->getFormAction(); ?>" id="contactForm" method="post">
19
+ <div class="fieldset">
20
+ <h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2>
21
+ <ul class="form-list">
22
+ <li class="fields">
23
+ <div class="field">
24
+ <label for="name" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Name') ?></label>
25
+ <div class="input-box">
26
+ <input name="name" id="name" title="<?php echo Mage::helper('contacts')->__('Name') ?>" value="<?php echo $this->htmlEscape($contactForm->getName()) ?>" class="input-text required-entry" type="text" />
27
+ </div>
28
+ </div>
29
+ <div class="field">
30
+ <label for="email" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Email') ?></label>
31
+ <div class="input-box">
32
+ <input name="email" id="email" title="<?php echo Mage::helper('contacts')->__('Email') ?>" value="<?php echo $this->htmlEscape($contactForm->getEmail()) ?>" class="input-text required-entry validate-email" type="text" />
33
+ </div>
34
+ </div>
35
+ </li>
36
+ <li>
37
+ <label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label>
38
+ <div class="input-box">
39
+ <input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="<?php echo $this->htmlEscape($contactForm->getTelephone()) ?>" class="input-text" type="text" />
40
+ </div>
41
+ </li>
42
+ <li class="wide">
43
+ <label for="comment" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Comment') ?></label>
44
+ <div class="input-box">
45
+ <textarea name="comment" id="comment" title="<?php echo Mage::helper('contacts')->__('Comment') ?>" class="required-entry input-text" cols="5" rows="3"><?php echo $this->htmlEscape($contactForm->getComment()) ?></textarea>
46
+ </div>
47
+ </li>
48
+ <li class="wide">
49
+ <div class="input-box">
50
+ <?php echo $this->getCaptchaCode(); ?>
51
+ </div>
52
+ </li>
53
+ </ul>
54
+ <p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
55
+ </div>
56
+
57
+ <div class="buttons-set captcha">
58
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')){?>
59
+ <div class="QapTcha"></div>
60
+ <?php }?>
61
+ <div class="submit-block">
62
+
63
+ <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
64
+ <button type="submit" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>
65
+ </div>
66
+ </div>
67
+ </form>
68
+ <script type="text/javascript">
69
+ //<![CDATA[
70
+ var contactForm = new VarienForm('contactForm', false);
71
+ //]]>
72
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/contactus')){?>
73
+ jQuery(document).ready(function(){
74
+ // More complex call
75
+ jQuery('.QapTcha').QapTcha({
76
+ disabledSubmit:true,
77
+ txtLock:'Locked: Please slide it to right to enable submit button.',
78
+ PHPfile : '<?php echo Mage::getBaseUrl() ?>sfcaptcha'
79
+ });
80
+ });
81
+ <?php }?>
82
+ </script>
app/design/frontend/rwd/default/template/sfcaptcha/login.phtml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="account-login<?php if (!$this->helper('customer')->isRegistrationAllowed()) echo ' login-only' ?>">
2
+ <div class="page-title">
3
+ <h1><?php if ($this->helper('customer')->isRegistrationAllowed()): ?>
4
+ <?php echo $this->__('Login or Create an Account') ?>
5
+ <?php else: ?>
6
+ <?php echo $this->__('Login'); ?>
7
+ <?php endif; ?></h1>
8
+ </div>
9
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
10
+ <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form" class="scaffold-form">
11
+ <?php echo $this->getBlockHtml('formkey'); ?>
12
+ <div class="col2-set">
13
+ <?php if ($this->helper('customer')->isRegistrationAllowed()): ?>
14
+ <div class="col-1 new-users">
15
+ <div class="content">
16
+ <h2><?php echo $this->__('New Here?') ?></h2>
17
+ <p class="form-instructions"><?php echo $this->__('Registration is free and easy!') ?></p>
18
+ <ul class="benefits">
19
+ <li><?php echo $this->__('Faster checkout') ?></li>
20
+ <li><?php echo $this->__('Save multiple shipping addresses') ?></li>
21
+ <li><?php echo $this->__('View and track orders and more') ?></li>
22
+ </ul>
23
+ </div>
24
+ <div class="buttons-set">
25
+ <a title="<?php echo $this->__('Create an Account') ?>" class="button" href="<?php echo Mage::helper('persistent')->getCreateAccountUrl($this->getCreateAccountUrl()) ?>"><span><span><?php echo $this->__('Create an Account') ?></span></span></a>
26
+ </div>
27
+ </div>
28
+ <?php endif; ?>
29
+ <?php // This column should be col-1 if the registration column is not displayed ?>
30
+ <div class="<?php if ($this->helper('customer')->isRegistrationAllowed()): ?>col-2<?php else: ?>col-1<?php endif; ?> registered-users">
31
+ <div class="content fieldset">
32
+ <h2><?php echo $this->__('Already registered?') ?></h2>
33
+ <p class="form-instructions"><?php echo $this->__('If you have an account with us, please log in.') ?></p>
34
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
35
+ <ul class="form-list">
36
+ <li>
37
+ <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
38
+ <div class="input-box">
39
+ <input type="email" autocapitalize="off" autocorrect="off" spellcheck="false" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
40
+ </div>
41
+ </li>
42
+ <li>
43
+ <label for="pass" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
44
+ <div class="input-box">
45
+ <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
46
+ </div>
47
+ </li>
48
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
49
+ <li>
50
+ <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?></a>
51
+ </li>
52
+ <?php echo $this->getChildHtml('persistent.remember.me'); ?>
53
+ </ul>
54
+ <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
55
+ </div>
56
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signin')){?>
57
+ <div class="QapTcha"></div>
58
+ <?php }?>
59
+ <div class="buttons-set login-button">
60
+ <button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ <?php if (Mage::helper('checkout')->isContextCheckout()): ?>
65
+ <input name="context" type="hidden" value="checkout" />
66
+ <?php endif; ?>
67
+ </form>
68
+ <script type="text/javascript">
69
+ //<![CDATA[
70
+ var dataForm = new VarienForm('login-form', true);
71
+ //]]>
72
+
73
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signin')){?>
74
+ jQuery(document).ready(function(){
75
+ // More complex call
76
+ jQuery('.QapTcha').QapTcha({
77
+ disabledSubmit:true,
78
+ txtLock:'Locked: Please slide it to right to enable submit button.',
79
+ PHPfile : '<?php echo Mage::getBaseUrl() ?>sfcaptcha'
80
+ });
81
+ });
82
+ <?php }?>
83
+ </script>
84
+ </div>
app/design/frontend/rwd/default/template/sfcaptcha/register.phtml ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="account-create">
2
+ <div class="page-title">
3
+ <h1><?php echo $this->__('Create an Account') ?></h1>
4
+ </div>
5
+ <?php echo $this->getChildHtml('form_fields_before')?>
6
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
7
+ <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate" class="scaffold-form" enctype="multipart/form-data">
8
+ <div class="fieldset">
9
+ <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
10
+ <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
11
+ <p class="form-instructions"><?php echo $this->__('Please enter the following information to create your account.') ?></p>
12
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
13
+ <ul class="form-list">
14
+ <li class="fields">
15
+ <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?>
16
+ </li>
17
+ <li>
18
+ <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
19
+ <div class="input-box">
20
+ <input type="email" autocapitalize="off" autocorrect="off" spellcheck="false" name="email" id="email_address" value="<?php echo $this->escapeHtml($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
21
+ </div>
22
+ </li>
23
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
24
+ <?php if ($_dob->isEnabled()): ?>
25
+ <li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
26
+ <?php endif ?>
27
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
28
+ <?php if ($_taxvat->isEnabled()): ?>
29
+ <li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
30
+ <?php endif ?>
31
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
32
+ <?php if ($_gender->isEnabled()): ?>
33
+ <li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
34
+ <?php endif ?>
35
+
36
+ <?php if($this->getShowAddressFields()): ?>
37
+ <li class="hidden">
38
+ <input type="hidden" name="create_address" value="1" />
39
+ </li>
40
+ <li class="fields">
41
+ <div class="field">
42
+ <label for="company"><?php echo $this->__('Company') ?></label>
43
+ <div class="input-box">
44
+ <input type="text" name="company" id="company" value="<?php echo $this->escapeHtml($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
45
+ </div>
46
+ </div>
47
+ <div class="field">
48
+ <label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
49
+ <div class="input-box">
50
+ <input type="tel" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" />
51
+ </div>
52
+ </div>
53
+ </li>
54
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
55
+ <li class="wide">
56
+ <label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
57
+ <div class="input-box">
58
+ <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet(0)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" />
59
+ </div>
60
+ </li>
61
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
62
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
63
+ <li class="wide">
64
+ <label for="billing:street<?php echo $_i ?>"><?php echo $this->__('Street Address %s', $_i) ?></label>
65
+ <div class="input-box">
66
+ <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet($_i - 1)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" />
67
+ </div>
68
+ </li>
69
+ <?php endfor; ?>
70
+ <li class="fields">
71
+ <div class="field">
72
+ <label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
73
+ <div class="input-box">
74
+ <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="city" />
75
+ </div>
76
+ </div>
77
+ <div class="field">
78
+ <label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
79
+ <div class="input-box">
80
+ <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
81
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
82
+ </select>
83
+ <script type="text/javascript">
84
+ //<![CDATA[
85
+ $('region_id').setAttribute('defaultValue', "<?php echo $this->getFormData()->getRegionId() ?>");
86
+ //]]>
87
+ </script>
88
+ <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
89
+ </div>
90
+ </div>
91
+ </li>
92
+ <li class="fields">
93
+ <div class="field">
94
+ <label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
95
+ <div class="input-box">
96
+ <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
97
+ </div>
98
+ </div>
99
+ <div class="field">
100
+ <label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
101
+ <div class="input-box">
102
+ <?php echo $this->getCountryHtmlSelect() ?>
103
+ </div>
104
+ </div>
105
+ </li>
106
+ <li class="hidden">
107
+ <input type="hidden" name="default_billing" value="1" />
108
+ <input type="hidden" name="default_shipping" value="1" />
109
+ </li>
110
+ <?php endif; ?>
111
+ <li class="fields">
112
+ <div class="field">
113
+ <label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
114
+ <div class="input-box">
115
+ <input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
116
+ </div>
117
+ </div>
118
+ <div class="field">
119
+ <label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
120
+ <div class="input-box">
121
+ <input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
122
+ </div>
123
+ </div>
124
+ </li>
125
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
126
+ <?php if ($this->isNewsletterEnabled()): ?>
127
+ <li class="control">
128
+ <div class="input-box">
129
+ <input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />
130
+ </div>
131
+ <label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
132
+ </li>
133
+ <?php endif ?>
134
+ <?php echo $this->getChildHtml('persistent.remember.me'); ?>
135
+ </ul>
136
+ <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
137
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signup')){?>
138
+ <div class="QapTcha"></div>
139
+ <?php }?>
140
+ </div>
141
+ <div class="buttons-set">
142
+ <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
143
+ <button type="submit" title="<?php echo $this->__('Register') ?>" class="button"><span><span><?php echo $this->__('Register') ?></span></span></button>
144
+ </div>
145
+ <?php if (Mage::helper('checkout')->isContextCheckout()): ?>
146
+ <input name="context" type="hidden" value="checkout" />
147
+ <?php endif; ?>
148
+ </form>
149
+ <script type="text/javascript">
150
+ //<![CDATA[
151
+ var dataForm = new VarienForm('form-validate', true);
152
+ <?php if($this->getShowAddressFields()): ?>
153
+ new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
154
+ <?php endif; ?>
155
+ //]]>
156
+
157
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/signup')){?>
158
+ jQuery(document).ready(function(){
159
+ // More complex call
160
+ jQuery('.QapTcha').QapTcha({
161
+ disabledSubmit:true,
162
+ txtLock:'Locked: Please slide it to right to enable submit button.',
163
+ PHPfile : '<?php echo Mage::getBaseUrl() ?>sfcaptcha'
164
+ });
165
+ });
166
+ <?php }?>
167
+ </script>
168
+ </div>
app/design/frontend/rwd/default/template/sfcaptcha/review.phtml ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="form-add">
2
+ <h2><?php echo $this->__('Write Your Own Review') ?></h2>
3
+ <?php if ($this->getAllowWriteReviewFlag()): ?>
4
+ <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
5
+ <?php echo $this->getBlockHtml('formkey'); ?>
6
+ <?php echo $this->getChildHtml('form_fields_before')?>
7
+ <h3><?php echo $this->__("You're reviewing:"); ?>
8
+ <span><?php echo $this->escapeHtml($this->getProductInfo()->getName()) ?></span>
9
+ </h3>
10
+
11
+ <div class="fieldset">
12
+ <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
13
+ <h4><?php echo $this->__('How do you rate this product?') ?> <em class="required">*</em></h4>
14
+ <span id="input-message-box"></span>
15
+ <table class="data-table review-summary-table ratings" id="product-review-table">
16
+ <col width="1" />
17
+ <col />
18
+ <col />
19
+ <col />
20
+ <col />
21
+ <col />
22
+ <thead>
23
+ <tr>
24
+ <th>&nbsp;</th>
25
+ <th>
26
+ <div class="rating-box">
27
+ <span class="rating-number">1</span>
28
+ <span class="rating nobr" style="width:20%;"><?php echo $this->__('1 star') ?></span>
29
+ </div>
30
+ </th>
31
+ <th>
32
+ <div class="rating-box">
33
+ <span class="rating-number">2</span>
34
+ <span class="rating nobr" style="width:40%;"><?php echo $this->__('2 star') ?></span>
35
+ </div>
36
+ </th>
37
+ <th>
38
+ <div class="rating-box">
39
+ <span class="rating-number">3</span>
40
+ <span class="rating nobr" style="width:60%;"><?php echo $this->__('3 star') ?></span>
41
+ </div>
42
+ </th>
43
+ <th>
44
+ <div class="rating-box">
45
+ <span class="rating-number">4</span>
46
+ <span class="rating nobr" style="width:80%;"><?php echo $this->__('4 star') ?></span>
47
+ </div>
48
+ </th>
49
+ <th>
50
+ <div class="rating-box">
51
+ <span class="rating-number">5</span>
52
+ <span class="rating nobr" style="width:100%;"><?php echo $this->__('5 star') ?></span>
53
+ </div>
54
+ </th>
55
+ </tr>
56
+ </thead>
57
+ <tbody>
58
+ <?php foreach ($this->getRatings() as $_rating): ?>
59
+ <tr>
60
+ <th><?php echo $this->escapeHtml($_rating->getRatingCode()) ?></th>
61
+ <?php foreach ($_rating->getOptions() as $_option): ?>
62
+ <td class="value"><label for="<?php echo $this->escapeHtml($_rating->getRatingCode()) ?>_<?php echo $_option->getValue() ?>"><input type="radio" name="ratings[<?php echo $_rating->getId() ?>]" id="<?php echo $this->escapeHtml($_rating->getRatingCode()) ?>_<?php echo $_option->getValue() ?>" value="<?php echo $_option->getId() ?>" class="radio" /></label></td>
63
+ <?php endforeach; ?>
64
+ </tr>
65
+ <?php endforeach; ?>
66
+ </tbody>
67
+ </table>
68
+ <input type="hidden" name="validate_rating" class="validate-rating" value="" />
69
+ <script type="text/javascript">decorateTable('product-review-table')</script>
70
+ <?php endif; ?>
71
+
72
+ <ul class="form-list">
73
+ <li>
74
+ <label for="review_field" class="required"><em>*</em><?php echo $this->__('Let us know your thoughts') ?></label>
75
+ <div class="input-box">
76
+ <textarea name="detail" id="review_field" cols="5" rows="3" class="required-entry"><?php echo $this->escapeHtml($data->getDetail()) ?></textarea>
77
+ </div>
78
+ </li>
79
+
80
+ <li class="inline-label">
81
+ <label for="summary_field" class="required"><em>*</em><?php echo $this->__('Summary of Your Review') ?></label>
82
+ <div class="input-box">
83
+ <input type="text" name="title" id="summary_field" class="input-text required-entry" value="<?php echo $this->escapeHtml($data->getTitle()) ?>" />
84
+ </div>
85
+ </li>
86
+
87
+ <li class="inline-label">
88
+ <label for="nickname_field" class="required"><em>*</em><?php echo $this->__("What's your nickname?") ?></label>
89
+ <div class="input-box">
90
+ <input type="text" name="nickname" id="nickname_field" class="input-text required-entry" value="<?php echo $this->escapeHtml($data->getNickname()) ?>" />
91
+ </div>
92
+ </li>
93
+
94
+ </ul>
95
+ </div>
96
+
97
+ <div class="buttons-set">
98
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/review')){?>
99
+ <div class="QapTcha"></div>
100
+ <?php }?>
101
+ <button type="submit" title="<?php echo $this->__('Submit Review') ?>" class="button submit-review"><span><span><?php echo $this->__('Submit Review') ?></span></span></button>
102
+ </div>
103
+ </form>
104
+ <script type="text/javascript">
105
+ //<![CDATA[
106
+ var dataForm = new VarienForm('review-form');
107
+ Validation.addAllThese(
108
+ [
109
+ ['validate-rating', '<?php echo $this->__('Please select one of each of the ratings above') ?>', function(v) {
110
+ var trs = $('product-review-table').select('tr');
111
+ var inputs;
112
+ var error = 1;
113
+
114
+ for( var j=0; j < trs.length; j++ ) {
115
+ var tr = trs[j];
116
+ if( j > 0 ) {
117
+ inputs = tr.select('input');
118
+
119
+ for( i in inputs ) {
120
+ if( inputs[i].checked == true ) {
121
+ error = 0;
122
+ }
123
+ }
124
+
125
+ if( error == 1 ) {
126
+ return false;
127
+ } else {
128
+ error = 1;
129
+ }
130
+ }
131
+ }
132
+ return true;
133
+ }]
134
+ ]
135
+ );
136
+ //]]>
137
+ <?php if(Mage::getStoreConfig('sourcefuse_section/sourcefuse_group/review')){?>
138
+ jQuery.noConflict();
139
+ jQuery(document).ready(function(){
140
+ // More complex call
141
+ jQuery('.QapTcha').QapTcha({
142
+ disabledSubmit:true,
143
+ txtLock:'Locked: Please slide it to right to enable submit button.',
144
+ PHPfile : '<?php echo Mage::getBaseUrl() ?>sfcaptcha'
145
+ });
146
+ });
147
+ <?php }?>
148
+ </script>
149
+ <?php else: ?>
150
+ <p class="review-nologged" id="review-form">
151
+ <?php echo $this->__('Only registered users can write reviews. Please, <a href="%s">log in</a> or <a href="%s">register</a>', $this->getLoginLink(), Mage::helper('customer')->getRegisterUrl()) ?>
152
+ </p>
153
+ <?php endif ?>
154
+ </div>
app/etc/modules/Sourcefuse_Sfcaptcha.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Sourcefuse_Sfcaptcha>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Sourcefuse_Sfcaptcha>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Sourcefuse_Sfcaptcha</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>It is an easy-to-use, simple and intuitive captcha system. It needs human action instead of to read a hard text.</summary>
10
+ <description>It is an easy-to-use, simple and intuitive captcha system. It needs human action instead of to read a hard text. Admin can easily enable / disable slider captcha for various magento frontend forms like contact us, product review form, customer sign-in / sign-up.</description>
11
+ <notes>It is an easy-to-use, simple and intuitive captcha system. It needs human action instead of to read a hard text. Admin can easily enable / disable slider captcha for various magento frontend forms like contact us, product review form, customer sign-in / sign-up.</notes>
12
+ <authors><author><name>Sourcefuse Technologies</name><user>sourcefuse</user><email>support@sourcefuse.com</email></author></authors>
13
+ <date>2015-12-01</date>
14
+ <time>10:40:17</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Sourcefuse_Sfcaptcha.xml" hash="691f106c25011ba2b2f73313af6318a6"/></dir></target><target name="magecommunity"><dir name="Sourcefuse"><dir name="Sfcaptcha"><dir name="Helper"><file name="Data.php" hash="0cba77d7fe1dc6f0d110ab5186ae3911"/></dir><dir name="controllers"><file name="IndexController.php" hash="95252ad0d78db471da204dd8e4be6e12"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e5e94ed9923068b6efbdc98061d944bf"/><file name="config.xml" hash="c75a2f28eb10ffd630da9706b0c893ca"/><file name="system.xml" hash="e9fc637c3452986972618166902bdb15"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="sfcaptcha.xml" hash="30f62ca242087ec039dc55a76153e35b"/></dir><dir name="template"><dir name="sfcaptcha"><file name="contactus.phtml" hash="f1c377cfca5191520add8838cde9fd24"/><file name="login.phtml" hash="fd9589bbb1839cfad22afd8ab48ca716"/><file name="register.phtml" hash="a05a0ca28694611a9f7681e1b4ef06c0"/><file name="review.phtml" hash="fd09a35584e362b46b6c0460a7192f98"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="sfcaptcha.xml" hash="db150e01677fef58ebfa83ea6d1daf76"/></dir><dir name="template"><dir name="sfcaptcha"><file name="contactus.phtml" hash="d894abac713ee43202d490b57a970b3d"/><file name="login.phtml" hash="7bc9faf5902bea4fadeed62e3077cf50"/><file name="register.phtml" hash="9697e0497a3e34f7bd7f79ec6fabf017"/><file name="review.phtml" hash="63c8e6fd2f919c6b3a5eb8312d51969e"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="sfcaptcha"><file name="QapTcha.jquery.css" hash="a2d4a7525fcc5806f2528343a691291c"/><dir name="images"><file name="bg_draggable_qaptcha.jpg" hash="9584c0ea39b0ae525f941ff7543e1c4b"/></dir></dir></dir><dir name="js"><dir name="sfcaptcha"><file name="QapTcha.jquery.js" hash="6d8bac0abb91c5aba139ffc152458e56"/><file name="QapTcha.jquery.min.js" hash="cb93be5f45d1e9c19310debb80a3859c"/><file name="app.js" hash="7f532333bb0c7a98ef1938a3701dff64"/><file name="browser.js" hash="9c3c5a517a44161b3d7701e86e9c656b"/><file name="jquery-ui.js" hash="56d6fe324a4f59b0fc191bb23e882600"/><file name="jquery.js" hash="c2105a30f5892dd9d5c6d253b2c8c91f"/><file name="jquery.ui.touch.js" hash="97445120dc6156626ab38a58f04c0cf3"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="css"><dir name="sfcaptcha"><file name="QapTcha.jquery.css" hash="e9f4a2f2c1116de63680f85b82b7a910"/><dir name="images"><file name="bg_draggable_qaptcha.jpg" hash="9584c0ea39b0ae525f941ff7543e1c4b"/></dir></dir></dir><dir name="js"><dir name="sfcaptcha"><file name="QapTcha.jquery.js" hash="59ad04ef56791434d51322906fcce070"/><file name="QapTcha.jquery.min.js" hash="cb93be5f45d1e9c19310debb80a3859c"/><file name="app.js" hash="7f532333bb0c7a98ef1938a3701dff64"/><file name="browser.js" hash="9c3c5a517a44161b3d7701e86e9c656b"/><file name="jquery-ui.js" hash="56d6fe324a4f59b0fc191bb23e882600"/><file name="jquery.js" hash="61551013be89774882ceee7d71cd8bdb"/><file name="jquery.ui.touch.js" hash="97445120dc6156626ab38a58f04c0cf3"/><file name="noconflict.js" hash="2de1eabae306cff4f08b9f5eb1c934df"/><file name="slideshow.js" hash="4279a94ced8fa1a72cee9a43a6ed0a2a"/></dir></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/frontend/base/default/css/sfcaptcha/QapTcha.jquery.css ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************/
2
+ /** QapTcha CSS **/
3
+ /*****************/
4
+ .QapTcha {float:right;width:170px;margin-right: 10px;}
5
+ .QapTcha .clr{clear:both}
6
+ .QapTcha .bgSlider {
7
+ width: 100%;
8
+ height: 19px;
9
+ float: left;
10
+ border: 1px solid #de5400;
11
+ background-color: #f18200;
12
+ }
13
+ .QapTcha .Slider {
14
+ width: 30px;
15
+ height: 19px;
16
+ background: transparent url('../sfcaptcha/images/bg_draggable_qaptcha.jpg') no-repeat;
17
+ cursor: e-resize;
18
+ position: relative;
19
+ top: 0;
20
+ left: 0;
21
+ background-size: 27px auto;
22
+ }
23
+ .QapTcha .TxtStatus {width:170px;margin-top:7px;text-align:left;color:#bb2828;font-family:Verdana;font-size:10px;clear:both}
24
+ .QapTcha .dropSuccess {
25
+ color:#4e8b37;
26
+ font-size: 11px;
27
+ line-height: normal;
28
+ font-family: inherit;
29
+ }
30
+ .QapTcha .dropError {
31
+ color: #eb340a;
32
+ font-size: 11px;
33
+ line-height: normal;
34
+ font-family: inherit;
35
+ }
36
+ .account-login .content{
37
+ position: relative;
38
+ }
39
+ .registered-users .QapTcha {
40
+ margin: 0;
41
+ width: 190px;
42
+ position: absolute;
43
+ right: 15px;
44
+ bottom: 10px;
45
+ }
46
+ .registered-users .QapTcha .TxtStatus {
47
+ width: 100%;
48
+ }
49
+ .customer-account-create .QapTcha {
50
+ width: 170px;
51
+ float: right;
52
+ margin-right: 35px;
53
+ }
54
+ .button:disabled{
55
+ cursor : not-allowed;
56
+ }
57
+ .button:disabled span{background-color: #ec9938;}
skin/frontend/base/default/css/sfcaptcha/images/bg_draggable_qaptcha.jpg ADDED
Binary file
skin/frontend/base/default/js/sfcaptcha/QapTcha.jquery.js ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /************************************************************************
2
+ *************************************************************************
3
+ @Name : QapTcha - jQuery Plugin
4
+ @Revison : 4.2
5
+ @Date : 06/09/2012 - dd/mm/YYYY
6
+ @Author: ALPIXEL Agency - (www.myjqueryplugins.com - www.alpixel.fr)
7
+ @License : Open Source - MIT License : http://www.opensource.org/licenses/mit-license.php
8
+
9
+ **************************************************************************
10
+ *************************************************************************/
11
+ jQuery.QapTcha = {
12
+ build : function(options)
13
+ {
14
+ var defaults = {
15
+ txtLock : 'Locked : form can\'t be submited',
16
+ txtUnlock : 'Unlocked : form can be submited',
17
+ disabledSubmit : true,
18
+ autoRevert : true,
19
+ PHPfile : 'php/Qaptcha.jquery.php',
20
+ autoSubmit : false
21
+ };
22
+
23
+ if(this.length>0)
24
+ return jQuery(this).each(function(i) {
25
+ /** Vars **/
26
+ var
27
+ opts = jQuery.extend(defaults, options),
28
+ $this = jQuery(this),
29
+ form = jQuery('form').has($this),
30
+ Clr = jQuery('<div>',{'class':'clr'}),
31
+ bgSlider = jQuery('<div>',{'class':'bgSlider'}),
32
+ Slider = jQuery('<div>',{'class':'Slider'}),
33
+ TxtStatus = jQuery('<div>',{'class':' TxtStatus dropError',text:opts.txtLock}),
34
+ inputQapTcha = jQuery('<input>',{name:generatePass(32),value:generatePass(7),type:'hidden'});
35
+
36
+ /** Disabled submit button **/
37
+ if(opts.disabledSubmit) form.find('button[type=\'submit\']').attr('disabled','disabled');
38
+
39
+ /** Construct DOM **/
40
+ bgSlider.appendTo($this);
41
+ Clr.insertAfter(bgSlider);
42
+ TxtStatus.insertAfter(Clr);
43
+ inputQapTcha.appendTo($this);
44
+ Slider.appendTo(bgSlider);
45
+ $this.show();
46
+
47
+ Slider.draggable({
48
+ revert: function(){
49
+ if(opts.autoRevert)
50
+ {
51
+ if(parseInt(Slider.css("left")) > (bgSlider.width()-Slider.width()-10)) return false;
52
+ else return true;
53
+ }
54
+ },
55
+ containment: bgSlider,
56
+ axis:'x',
57
+ stop: function(event,ui){
58
+ if(ui.position.left > (bgSlider.width()-Slider.width()-10))
59
+ {
60
+ // set the SESSION iQaptcha in PHP file
61
+ jQuery.post(opts.PHPfile,{
62
+ action : 'qaptcha',
63
+ qaptcha_key : inputQapTcha.attr('name')
64
+ },
65
+ function(data) {
66
+ if(!data.error)
67
+ {
68
+ Slider.draggable('disable').css('cursor','default');
69
+ inputQapTcha.val('');
70
+ TxtStatus.text(opts.txtUnlock).addClass('dropSuccess').removeClass('dropError');
71
+ form.find('button[type=\'submit\']').removeAttr('disabled');
72
+ if(opts.autoSubmit) form.find('button[type=\'submit\']').trigger('click');
73
+ }
74
+ },'json');
75
+ }
76
+ }
77
+ });
78
+
79
+ function generatePass(nb) {
80
+ var chars = 'azertyupqsdfghjkmwxcvbn23456789AZERTYUPQSDFGHJKMWXCVBN_-#@';
81
+ var pass = '';
82
+ for(i=0;i<nb;i++){
83
+ var wpos = Math.round(Math.random()*chars.length);
84
+ pass += chars.substring(wpos,wpos+1);
85
+ }
86
+ return pass;
87
+ }
88
+
89
+ });
90
+ }
91
+ }; jQuery.fn.QapTcha = jQuery.QapTcha.build;
skin/frontend/base/default/js/sfcaptcha/QapTcha.jquery.min.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /************************************************************************
2
+ *************************************************************************
3
+ @Name : QapTcha - jQuery Plugin
4
+ @Revison : 4.2
5
+ @Date : 06/09/2012 - dd/mm/YYYY
6
+ @Author: ALPIXEL - (www.myjqueryplugins.com - www.alpixel.fr)
7
+ @License : Open Source - MIT License : http://www.opensource.org/licenses/mit-license.php
8
+
9
+ **************************************************************************
10
+ *************************************************************************/
11
+ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2.p={X:a(V){b A={R:\'1j : 6 y\\\'t E D\',z:\'1y : 6 y E D\',W:n,L:n,J:\'I/12.15.I\',H:M};9(5.G>0)j 2(5).1w(a(i){b 8=$.1A(A,V),$5=$(5),6=$(\'6\').1B($5),r=2(\'<g>\',{\'f\':\'1d\'}),3=2(\'<g>\',{\'f\':\'3\'}),4=2(\'<g>\',{\'f\':\'4\'}),h=2(\'<g>\',{\'f\':\' h B\',C:8.R}),d=2(\'<c>\',{F:o(16),17:o(7),k:\'1F\'});9(8.W)6.q(\'c[k=\\\'l\\\']\').K(\'s\',\'s\');3.u($5);r.N(3);h.N(r);d.u($5);4.u(3);$5.11();4.O({13:a(){9(8.L){9(14(4.P("Q"))>(3.e()-4.e()-10))j M;18 j n}},19:3,1a:\'x\',1b:a(1c,S){9(S.1e.Q>(3.e()-4.e()-10)){$.1f(8.J,{1g:\'1h\',1i:d.K(\'F\')},a(T){9(!T.1k){4.O(\'1l\').P(\'1m\',\'1n\');d.1o(\'\');h.C(8.z).1p(\'1q\').1r(\'B\');6.q(\'c[k=\\\'l\\\']\').1s(\'s\');9(8.H)6.q(\'c[k=\\\'l\\\']\').1t(\'1u\')}},\'1v\')}}});a o(U){b v=\'1x-#@\';b w=\'\';1z(i=0;i<U;i++){b m=Y.1C(Y.1D()*v.G);w+=v.1E(m,m+1)}j w}})}};2.Z.p=2.p.X;',62,104,'||jQuery|bgSlider|Slider|this|form||opts|if|function|var|input|inputQapTcha|width|class|div|TxtStatus||return|type|submit|wpos|true|generatePass|QapTcha|find|Clr|disabled||appendTo|chars|pass||can|txtUnlock|defaults|dropError|text|submited|be|name|length|autoSubmit|php|PHPfile|attr|autoRevert|false|insertAfter|draggable|css|left|txtLock|ui|data|nb|options|disabledSubmit|build|Math|fn||show|Qaptcha|revert|parseInt|jquery|32|value|else|containment|axis|stop|event|clr|position|post|action|qaptcha|qaptcha_key|Locked|error|disable|cursor|default|val|addClass|dropSuccess|removeClass|removeAttr|trigger|click|json|each|azertyupqsdfghjkmwxcvbn23456789AZERTYUPQSDFGHJKMWXCVBN_|Unlocked|for|extend|has|round|random|substring|hidden'.split('|'),0,{}))
skin/frontend/base/default/js/sfcaptcha/app.js ADDED
@@ -0,0 +1,1281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magento
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 Magento to newer
17
+ * versions in the future. If you wish to customize Magento for your
18
+ * needs please refer to http://www.magento.com for more information.
19
+ *
20
+ * @category design
21
+ * @package rwd_default
22
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+
26
+ // =============================================
27
+ // Primary Break Points
28
+ // =============================================
29
+
30
+ // These should be used with the bp (max-width, xx) mixin
31
+ // where a min-width is used, remember to +1 to break correctly
32
+ // If these are changed, they must also be updated in _var.scss
33
+
34
+ var bp = {
35
+ xsmall: 479,
36
+ small: 599,
37
+ medium: 770,
38
+ large: 979,
39
+ xlarge: 1199
40
+ }
41
+
42
+ // ==============================================
43
+ // Search
44
+ // ==============================================
45
+
46
+ /**
47
+ * Implements a custom validation style for the search form. When the form is invalidly submitted, the validation-failed
48
+ * class gets added to the input, but the "This is a required field." text does not display
49
+ */
50
+ Varien.searchForm.prototype.initialize = function (form, field, emptyText) {
51
+ this.form = $(form);
52
+ this.field = $(field);
53
+ this.emptyText = emptyText;
54
+
55
+ Event.observe(this.form, 'submit', this.submit.bind(this));
56
+ Event.observe(this.field, 'change', this.change.bind(this));
57
+ Event.observe(this.field, 'focus', this.focus.bind(this));
58
+ Event.observe(this.field, 'blur', this.blur.bind(this));
59
+ this.blur();
60
+ }
61
+
62
+ Varien.searchForm.prototype.submit = function (event) {
63
+ if (this.field.value == this.emptyText || this.field.value == ''){
64
+ Event.stop(event);
65
+ this.field.addClassName('validation-failed');
66
+ this.field.focus();
67
+ return false;
68
+ }
69
+ return true;
70
+ }
71
+
72
+ Varien.searchForm.prototype.change = function (event) {
73
+ if (
74
+ this.field.value != this.emptyText
75
+ && this.field.value != ''
76
+ && this.field.hasClassName('validation-failed')
77
+ ) {
78
+ this.field.removeClassName('validation-failed');
79
+ }
80
+ }
81
+
82
+ Varien.searchForm.prototype.blur = function (event) {
83
+ if (this.field.hasClassName('validation-failed')) {
84
+ this.field.removeClassName('validation-failed');
85
+ }
86
+ }
87
+
88
+ // ==============================================
89
+ // Pointer abstraction
90
+ // ==============================================
91
+
92
+ /**
93
+ * This class provides an easy and abstracted mechanism to determine the
94
+ * best pointer behavior to use -- that is, is the user currently interacting
95
+ * with their device in a touch manner, or using a mouse.
96
+ *
97
+ * Since devices may use either touch or mouse or both, there is no way to
98
+ * know the user's preferred pointer type until they interact with the site.
99
+ *
100
+ * To accommodate this, this class provides a method and two events
101
+ * to determine the user's preferred pointer type.
102
+ *
103
+ * - getPointer() returns the last used pointer type, or, if the user has
104
+ * not yet interacted with the site, falls back to a Modernizr test.
105
+ *
106
+ * - The mouse-detected event is triggered on the window object when the user
107
+ * is using a mouse pointer input, or has switched from touch to mouse input.
108
+ * It can be observed in this manner: $j(window).on('mouse-detected', function(event) { // custom code });
109
+ *
110
+ * - The touch-detected event is triggered on the window object when the user
111
+ * is using touch pointer input, or has switched from mouse to touch input.
112
+ * It can be observed in this manner: $j(window).on('touch-detected', function(event) { // custom code });
113
+ */
114
+ var PointerManager = {
115
+ MOUSE_POINTER_TYPE: 'mouse',
116
+ TOUCH_POINTER_TYPE: 'touch',
117
+ POINTER_EVENT_TIMEOUT_MS: 500,
118
+ standardTouch: false,
119
+ touchDetectionEvent: null,
120
+ lastTouchType: null,
121
+ pointerTimeout: null,
122
+ pointerEventLock: false,
123
+
124
+ getPointerEventsSupported: function() {
125
+ return this.standardTouch;
126
+ },
127
+
128
+ getPointerEventsInputTypes: function() {
129
+ if (window.navigator.pointerEnabled) { //IE 11+
130
+ //return string values from http://msdn.microsoft.com/en-us/library/windows/apps/hh466130.aspx
131
+ return {
132
+ MOUSE: 'mouse',
133
+ TOUCH: 'touch',
134
+ PEN: 'pen'
135
+ };
136
+ } else if (window.navigator.msPointerEnabled) { //IE 10
137
+ //return numeric values from http://msdn.microsoft.com/en-us/library/windows/apps/hh466130.aspx
138
+ return {
139
+ MOUSE: 0x00000004,
140
+ TOUCH: 0x00000002,
141
+ PEN: 0x00000003
142
+ };
143
+ } else { //other browsers don't support pointer events
144
+ return {}; //return empty object
145
+ }
146
+ },
147
+
148
+ /**
149
+ * If called before init(), get best guess of input pointer type
150
+ * using Modernizr test.
151
+ * If called after init(), get current pointer in use.
152
+ */
153
+ getPointer: function() {
154
+ // On iOS devices, always default to touch, as this.lastTouchType will intermittently return 'mouse' if
155
+ // multiple touches are triggered in rapid succession in Safari on iOS
156
+ if(Modernizr.ios) {
157
+ return this.TOUCH_POINTER_TYPE;
158
+ }
159
+
160
+ if(this.lastTouchType) {
161
+ return this.lastTouchType;
162
+ }
163
+
164
+ return Modernizr.touch ? this.TOUCH_POINTER_TYPE : this.MOUSE_POINTER_TYPE;
165
+ },
166
+
167
+ setPointerEventLock: function() {
168
+ this.pointerEventLock = true;
169
+ },
170
+ clearPointerEventLock: function() {
171
+ this.pointerEventLock = false;
172
+ },
173
+ setPointerEventLockTimeout: function() {
174
+ var that = this;
175
+
176
+ if(this.pointerTimeout) {
177
+ clearTimeout(this.pointerTimeout);
178
+ }
179
+
180
+ this.setPointerEventLock();
181
+ this.pointerTimeout = setTimeout(function() { that.clearPointerEventLock(); }, this.POINTER_EVENT_TIMEOUT_MS);
182
+ },
183
+
184
+ triggerMouseEvent: function(originalEvent) {
185
+ if(this.lastTouchType == this.MOUSE_POINTER_TYPE) {
186
+ return; //prevent duplicate events
187
+ }
188
+
189
+ this.lastTouchType = this.MOUSE_POINTER_TYPE;
190
+ $j(window).trigger('mouse-detected', originalEvent);
191
+ },
192
+ triggerTouchEvent: function(originalEvent) {
193
+ if(this.lastTouchType == this.TOUCH_POINTER_TYPE) {
194
+ return; //prevent duplicate events
195
+ }
196
+
197
+ this.lastTouchType = this.TOUCH_POINTER_TYPE;
198
+ $j(window).trigger('touch-detected', originalEvent);
199
+ },
200
+
201
+ initEnv: function() {
202
+ if (window.navigator.pointerEnabled) {
203
+ this.standardTouch = true;
204
+ this.touchDetectionEvent = 'pointermove';
205
+ } else if (window.navigator.msPointerEnabled) {
206
+ this.standardTouch = true;
207
+ this.touchDetectionEvent = 'MSPointerMove';
208
+ } else {
209
+ this.touchDetectionEvent = 'touchstart';
210
+ }
211
+ },
212
+
213
+ wirePointerDetection: function() {
214
+ var that = this;
215
+
216
+ if(this.standardTouch) { //standard-based touch events. Wire only one event.
217
+ //detect pointer event
218
+ $j(window).on(this.touchDetectionEvent, function(e) {
219
+ switch(e.originalEvent.pointerType) {
220
+ case that.getPointerEventsInputTypes().MOUSE:
221
+ that.triggerMouseEvent(e);
222
+ break;
223
+ case that.getPointerEventsInputTypes().TOUCH:
224
+ case that.getPointerEventsInputTypes().PEN:
225
+ // intentionally group pen and touch together
226
+ that.triggerTouchEvent(e);
227
+ break;
228
+ }
229
+ });
230
+ } else { //non-standard touch events. Wire touch and mouse competing events.
231
+ //detect first touch
232
+ $j(window).on(this.touchDetectionEvent, function(e) {
233
+ if(that.pointerEventLock) {
234
+ return;
235
+ }
236
+
237
+ that.setPointerEventLockTimeout();
238
+ that.triggerTouchEvent(e);
239
+ });
240
+
241
+ //detect mouse usage
242
+ $j(document).on('mouseover', function(e) {
243
+ if(that.pointerEventLock) {
244
+ return;
245
+ }
246
+
247
+ that.setPointerEventLockTimeout();
248
+ that.triggerMouseEvent(e);
249
+ });
250
+ }
251
+ },
252
+
253
+ init: function() {
254
+ this.initEnv();
255
+ this.wirePointerDetection();
256
+ }
257
+ };
258
+
259
+ /**
260
+ * This class manages the main navigation and supports infinite nested
261
+ * menus which support touch, mouse click, and hover correctly.
262
+ *
263
+ * The following is the expected behavior:
264
+ *
265
+ * - Hover with an actual mouse should expand the menu (at any level of nesting)
266
+ * - Click with an actual mouse will follow the link, regardless of any children
267
+ * - Touch will follow links without children, and toggle submenus of links with children
268
+ *
269
+ * Caveats:
270
+ * - According to Mozilla's documentation (https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Touch_events),
271
+ * Firefox has disabled Apple-style touch events on desktop, so desktop devices using Firefox will not support
272
+ * the desired touch behavior.
273
+ */
274
+ var MenuManager = {
275
+ // These variables are used to detect incorrect touch / mouse event order
276
+ mouseEnterEventObserved: false,
277
+ touchEventOrderIncorrect: false,
278
+ cancelNextTouch: false,
279
+
280
+ /**
281
+ * This class manages touch scroll detection
282
+ */
283
+ TouchScroll: {
284
+ /**
285
+ * Touch which moves the screen vertically more than
286
+ * this many pixels will be considered a scroll.
287
+ */
288
+ TOUCH_SCROLL_THRESHOLD: 20,
289
+
290
+ touchStartPosition: null,
291
+
292
+ /**
293
+ * Note scroll position so that scroll action can be detected later.
294
+ * Should probably be called on touchstart (or similar) event.
295
+ */
296
+ reset: function() {
297
+ this.touchStartPosition = $j(window).scrollTop();
298
+ },
299
+
300
+ /**
301
+ * Determines if touch was actually a scroll. Should probably be checked
302
+ * on touchend (or similar) event.
303
+ * @returns {boolean}
304
+ */
305
+ shouldCancelTouch: function() {
306
+ if(this.touchStartPosition == null) {
307
+ return false;
308
+ }
309
+
310
+ var scroll = $j(window).scrollTop() - this.touchStartPosition;
311
+ return Math.abs(scroll) > this.TOUCH_SCROLL_THRESHOLD;
312
+ }
313
+ },
314
+
315
+ /**
316
+ * Determines if small screen behavior should be used.
317
+ *
318
+ * @returns {boolean}
319
+ */
320
+ useSmallScreenBehavior: function() {
321
+ return Modernizr.mq("screen and (max-width:" + bp.medium + "px)");
322
+ },
323
+
324
+ /**
325
+ * Toggles a given menu item's visibility.
326
+ * On large screens, also closes sibling and children of sibling menus.
327
+ *
328
+ * @param target
329
+ */
330
+ toggleMenuVisibility: function(target) {
331
+ var link = $j(target);
332
+ var li = link.closest('li');
333
+
334
+ if(!this.useSmallScreenBehavior()) {
335
+ // remove menu-active from siblings and children of siblings
336
+ li.siblings()
337
+ .removeClass('menu-active')
338
+ .find('li')
339
+ .removeClass('menu-active');
340
+ //remove menu-active from children
341
+ li.find('li.menu-active').removeClass('menu-active');
342
+ }
343
+
344
+ //toggle current item's active state
345
+ li.toggleClass('menu-active');
346
+ },
347
+
348
+ // --------------------------------------------
349
+ // Initialization methods
350
+ //
351
+
352
+ /**
353
+ * Initialize MenuManager and wire all required events.
354
+ * Should only be called once.
355
+ *
356
+ */
357
+ init: function() {
358
+ this.wirePointerEvents();
359
+ },
360
+
361
+ /**
362
+ * This method observes an absurd number of events
363
+ * depending on the capabilities of the current browser
364
+ * to implement expected header navigation functionality.
365
+ *
366
+ * The goal is to separate interactions into four buckets:
367
+ * - pointer enter using an actual mouse
368
+ * - pointer leave using an actual mouse
369
+ * - pointer down using an actual mouse
370
+ * - pointer down using touch
371
+ *
372
+ * Browsers supporting PointerEvent events will use these
373
+ * to differentiate pointer types.
374
+ *
375
+ * Browsers supporting Apple-style will use those events
376
+ * along with mouseenter / mouseleave to emulate pointer events.
377
+ */
378
+ wirePointerEvents: function() {
379
+ var that = this;
380
+ var pointerTarget = $j('#nav a.has-children');
381
+ var hoverTarget = $j('#nav li');
382
+
383
+ if(PointerManager.getPointerEventsSupported()) {
384
+ // pointer events supported, so observe those type of events
385
+
386
+ var enterEvent = window.navigator.pointerEnabled ? 'pointerenter' : 'mouseenter';
387
+ var leaveEvent = window.navigator.pointerEnabled ? 'pointerleave' : 'mouseleave';
388
+ var fullPointerSupport = window.navigator.pointerEnabled;
389
+
390
+ hoverTarget.on(enterEvent, function(e) {
391
+ if(e.originalEvent.pointerType === undefined // Browsers with partial PointerEvent support don't provide pointer type
392
+ || e.originalEvent.pointerType == PointerManager.getPointerEventsInputTypes().MOUSE) {
393
+
394
+ if(fullPointerSupport) {
395
+ that.mouseEnterAction(e, this);
396
+ } else {
397
+ that.PartialPointerEventsSupport.mouseEnterAction(e, this);
398
+ }
399
+ }
400
+ }).on(leaveEvent, function(e) {
401
+ if(e.originalEvent.pointerType === undefined // Browsers with partial PointerEvent support don't provide pointer type
402
+ || e.originalEvent.pointerType == PointerManager.getPointerEventsInputTypes().MOUSE) {
403
+
404
+ if(fullPointerSupport) {
405
+ that.mouseLeaveAction(e, this);
406
+ } else {
407
+ that.PartialPointerEventsSupport.mouseLeaveAction(e, this);
408
+ }
409
+ }
410
+ });
411
+
412
+ if(!fullPointerSupport) {
413
+ //click event doesn't have pointer type on it.
414
+ //observe MSPointerDown to set pointer type for click to find later
415
+
416
+ pointerTarget.on('MSPointerDown', function(e) {
417
+ $j(this).data('pointer-type', e.originalEvent.pointerType);
418
+ });
419
+ }
420
+
421
+ pointerTarget.on('click', function(e) {
422
+ var pointerType = fullPointerSupport ? e.originalEvent.pointerType : $j(this).data('pointer-type');
423
+
424
+ if(pointerType === undefined || pointerType == PointerManager.getPointerEventsInputTypes().MOUSE) {
425
+ that.mouseClickAction(e, this);
426
+ } else {
427
+ if(fullPointerSupport) {
428
+ that.touchAction(e, this);
429
+ } else {
430
+ that.PartialPointerEventsSupport.touchAction(e, this);
431
+ }
432
+ }
433
+
434
+ $j(this).removeData('pointer-type'); // clear pointer type hint from target, if any
435
+ });
436
+ } else {
437
+ //pointer events not supported, use Apple-style events to simulate
438
+
439
+ hoverTarget.on('mouseenter', function(e) {
440
+ // Touch events should cancel this event if a touch pointer is used.
441
+ // Record that this method has fired so that erroneous following
442
+ // touch events (if any) can respond accordingly.
443
+ that.mouseEnterEventObserved = true;
444
+ that.cancelNextTouch = true;
445
+
446
+ that.mouseEnterAction(e, this);
447
+ }).on('mouseleave', function(e) {
448
+ that.mouseLeaveAction(e, this);
449
+ });
450
+
451
+ $j(window).on('touchstart', function(e) {
452
+ if(that.mouseEnterEventObserved) {
453
+ // If mouse enter observed before touch, then device touch
454
+ // event order is incorrect.
455
+ that.touchEventOrderIncorrect = true;
456
+ that.mouseEnterEventObserved = false; // Reset test
457
+ }
458
+
459
+ // Reset TouchScroll in order to detect scroll later.
460
+ that.TouchScroll.reset();
461
+ });
462
+
463
+ pointerTarget.on('touchend', function(e) {
464
+ $j(this).data('was-touch', true); // Note that element was invoked by touch pointer
465
+
466
+ e.preventDefault(); // Prevent mouse compatibility events from firing where possible
467
+
468
+ if(that.TouchScroll.shouldCancelTouch()) {
469
+ return; // Touch was a scroll -- don't do anything else
470
+ }
471
+
472
+ if(that.touchEventOrderIncorrect) {
473
+ that.PartialTouchEventsSupport.touchAction(e, this);
474
+ } else {
475
+ that.touchAction(e, this);
476
+ }
477
+ }).on('click', function(e) {
478
+ if($j(this).data('was-touch')) { // Event invoked after touch
479
+ e.preventDefault(); // Prevent following link
480
+ return; // Prevent other behavior
481
+ }
482
+
483
+ that.mouseClickAction(e, this);
484
+ });
485
+ }
486
+ },
487
+
488
+ // --------------------------------------------
489
+ // Behavior "buckets"
490
+ //
491
+
492
+ /**
493
+ * Browsers with incomplete PointerEvent support (such as IE 10)
494
+ * require special event management. This collection of methods
495
+ * accommodate such browsers.
496
+ */
497
+ PartialPointerEventsSupport: {
498
+ /**
499
+ * Without proper pointerenter / pointerleave / click pointerType support,
500
+ * we have to use mouseenter events. These end up triggering
501
+ * lots of mouseleave events that can be misleading.
502
+ *
503
+ * Each touch mouseenter and click event that ends up triggering
504
+ * an undesired mouseleave increments this lock variable.
505
+ *
506
+ * Mouseleave events are cancelled if this variable is > 0,
507
+ * and then the variable is decremented regardless.
508
+ */
509
+ mouseleaveLock: 0,
510
+
511
+ /**
512
+ * Handles mouse enter behavior, but if using touch,
513
+ * toggle menus in the absence of full PointerEvent support.
514
+ *
515
+ * @param event
516
+ * @param target
517
+ */
518
+ mouseEnterAction: function(event, target) {
519
+ if(MenuManager.useSmallScreenBehavior()) {
520
+ // fall back to normal method behavior
521
+ MenuManager.mouseEnterAction(event, target);
522
+ return;
523
+ }
524
+
525
+ event.stopPropagation();
526
+
527
+ var jtarget = $j(target);
528
+ if(!jtarget.hasClass('level0')) {
529
+ this.mouseleaveLock = jtarget.parents('li').length + 1;
530
+ }
531
+
532
+ MenuManager.toggleMenuVisibility(target);
533
+ },
534
+
535
+ /**
536
+ * Handles mouse leave behaivor, but obeys the mouseleaveLock
537
+ * to allow undesired mouseleave events to be cancelled.
538
+ *
539
+ * @param event
540
+ * @param target
541
+ */
542
+ mouseLeaveAction: function(event, target) {
543
+ if(MenuManager.useSmallScreenBehavior()) {
544
+ // fall back to normal method behavior
545
+ MenuManager.mouseLeaveAction(event, target);
546
+ return;
547
+ }
548
+
549
+ if(this.mouseleaveLock > 0) {
550
+ this.mouseleaveLock--;
551
+ return; // suppress duplicate mouseleave event after touch
552
+ }
553
+
554
+ $j(target).removeClass('menu-active'); //hide all menus
555
+ },
556
+
557
+ /**
558
+ * Does no work on its own, but increments mouseleaveLock
559
+ * to prevent following undesireable mouseleave events.
560
+ *
561
+ * @param event
562
+ * @param target
563
+ */
564
+ touchAction: function(event, target) {
565
+ if(MenuManager.useSmallScreenBehavior()) {
566
+ // fall back to normal method behavior
567
+ MenuManager.touchAction(event, target);
568
+ return;
569
+ }
570
+ event.preventDefault(); // prevent following link
571
+ this.mouseleaveLock++;
572
+ }
573
+ },
574
+
575
+ /**
576
+ * Browsers with incomplete Apple-style touch event support
577
+ * (such as the legacy Android browser) sometimes fire
578
+ * touch events out of order. In particular, mouseenter may
579
+ * fire before the touch events. This collection of methods
580
+ * accommodate such browsers.
581
+ */
582
+ PartialTouchEventsSupport: {
583
+ /**
584
+ * Toggles visibility of menu, unless suppressed by previous
585
+ * out of order mouseenter event.
586
+ *
587
+ * @param event
588
+ * @param target
589
+ */
590
+ touchAction: function(event, target) {
591
+ if(MenuManager.cancelNextTouch) {
592
+ // Mouseenter has already manipulated the menu.
593
+ // Suppress this undesired touch event.
594
+ MenuManager.cancelNextTouch = false;
595
+ return;
596
+ }
597
+
598
+ MenuManager.toggleMenuVisibility(target);
599
+ }
600
+ },
601
+
602
+ /**
603
+ * On large screens, show menu.
604
+ * On small screens, do nothing.
605
+ *
606
+ * @param event
607
+ * @param target
608
+ */
609
+ mouseEnterAction: function(event, target) {
610
+ if(this.useSmallScreenBehavior()) {
611
+ return; // don't do mouse enter functionality on smaller screens
612
+ }
613
+
614
+ $j(target).addClass('menu-active'); //show current menu
615
+ },
616
+
617
+ /**
618
+ * On large screens, hide menu.
619
+ * On small screens, do nothing.
620
+ *
621
+ * @param event
622
+ * @param target
623
+ */
624
+ mouseLeaveAction: function(event, target) {
625
+ if(this.useSmallScreenBehavior()) {
626
+ return; // don't do mouse leave functionality on smaller screens
627
+ }
628
+
629
+ $j(target).removeClass('menu-active'); //hide all menus
630
+ },
631
+
632
+ /**
633
+ * On large screens, don't interfere so that browser will follow link.
634
+ * On small screens, toggle menu visibility.
635
+ *
636
+ * @param event
637
+ * @param target
638
+ */
639
+ mouseClickAction: function(event, target) {
640
+ if(this.useSmallScreenBehavior()) {
641
+ event.preventDefault(); //don't follow link
642
+ this.toggleMenuVisibility(target); //instead, toggle visibility
643
+ }
644
+ },
645
+
646
+ /**
647
+ * Toggle menu visibility, and prevent event default to avoid
648
+ * undesired, duplicate, synthetic mouse events.
649
+ *
650
+ * @param event
651
+ * @param target
652
+ */
653
+ touchAction: function(event, target) {
654
+ this.toggleMenuVisibility(target);
655
+
656
+ event.preventDefault();
657
+ }
658
+ };
659
+
660
+ // ==============================================
661
+ // jQuery Init
662
+ // ==============================================
663
+
664
+ // Use $j(document).ready() because Magento executes Prototype inline
665
+ $j(document).ready(function () {
666
+
667
+ // ==============================================
668
+ // Shared Vars
669
+ // ==============================================
670
+
671
+ // Document
672
+ var w = $j(window);
673
+ var d = $j(document);
674
+ var body = $j('body');
675
+
676
+ Modernizr.addTest('ios', function () {
677
+ return navigator.userAgent.match(/(iPad|iPhone|iPod)/g);
678
+ });
679
+
680
+ //initialize pointer abstraction manager
681
+ PointerManager.init();
682
+
683
+ /* Wishlist Toggle Class */
684
+
685
+ $j(".change").click(function (e) {
686
+ $j( this ).toggleClass('active');
687
+ e.stopPropagation()
688
+ });
689
+
690
+ $j(document).click(function (e) {
691
+ if (! $j(e.target).hasClass('.change')) $j(".change").removeClass('active');
692
+ });
693
+
694
+
695
+ // =============================================
696
+ // Skip Links
697
+ // =============================================
698
+
699
+ var skipContents = $j('.skip-content');
700
+ var skipLinks = $j('.skip-link');
701
+
702
+ skipLinks.on('click', function (e) {
703
+ e.preventDefault();
704
+
705
+ var self = $j(this);
706
+ // Use the data-target-element attribute, if it exists. Fall back to href.
707
+ var target = self.attr('data-target-element') ? self.attr('data-target-element') : self.attr('href');
708
+
709
+ // Get target element
710
+ var elem = $j(target);
711
+
712
+ // Check if stub is open
713
+ var isSkipContentOpen = elem.hasClass('skip-active') ? 1 : 0;
714
+
715
+ // Hide all stubs
716
+ skipLinks.removeClass('skip-active');
717
+ skipContents.removeClass('skip-active');
718
+
719
+ // Toggle stubs
720
+ if (isSkipContentOpen) {
721
+ self.removeClass('skip-active');
722
+ } else {
723
+ self.addClass('skip-active');
724
+ elem.addClass('skip-active');
725
+ }
726
+ });
727
+
728
+ $j('#header-cart').on('click', '.skip-link-close', function(e) {
729
+ var parent = $j(this).parents('.skip-content');
730
+ var link = parent.siblings('.skip-link');
731
+
732
+ parent.removeClass('skip-active');
733
+ link.removeClass('skip-active');
734
+
735
+ e.preventDefault();
736
+ });
737
+
738
+
739
+ // ==============================================
740
+ // Header Menus
741
+ // ==============================================
742
+
743
+ // initialize menu
744
+ MenuManager.init();
745
+
746
+ // Prevent sub menus from spilling out of the window.
747
+ function preventMenuSpill() {
748
+ var windowWidth = $j(window).width();
749
+ $j('ul.level0').each(function(){
750
+ var ul = $j(this);
751
+ //Show it long enough to get info, then hide it.
752
+ ul.addClass('position-test');
753
+ ul.removeClass('spill');
754
+ var width = ul.outerWidth();
755
+ var offset = ul.offset().left;
756
+ ul.removeClass('position-test');
757
+ //Add the spill class if it will spill off the page.
758
+ if ((offset + width) > windowWidth) {
759
+ ul.addClass('spill');
760
+ }
761
+ });
762
+ }
763
+ preventMenuSpill();
764
+ $j(window).on('delayed-resize', preventMenuSpill);
765
+
766
+
767
+ // ==============================================
768
+ // Language Switcher
769
+ // ==============================================
770
+
771
+ // In order to display the language switcher next to the logo, we are moving the content at different viewports,
772
+ // rather than having duplicate markup or changing the design
773
+ enquire.register('(max-width: ' + bp.medium + 'px)', {
774
+ match: function () {
775
+ $j('.page-header-container .store-language-container').prepend($j('.form-language'));
776
+ },
777
+ unmatch: function () {
778
+ $j('.header-language-container .store-language-container').prepend($j('.form-language'));
779
+ }
780
+ });
781
+
782
+ // ==============================================
783
+ // Enquire JS
784
+ // ==============================================
785
+
786
+ enquire.register('screen and (min-width: ' + (bp.medium + 1) + 'px)', {
787
+ match: function () {
788
+ $j('.menu-active').removeClass('menu-active');
789
+ $j('.sub-menu-active').removeClass('sub-menu-active');
790
+ $j('.skip-active').removeClass('skip-active');
791
+ },
792
+ unmatch: function () {
793
+ $j('.menu-active').removeClass('menu-active');
794
+ $j('.sub-menu-active').removeClass('sub-menu-active');
795
+ $j('.skip-active').removeClass('skip-active');
796
+ }
797
+ });
798
+
799
+ // ==============================================
800
+ // UI Pattern - Media Switcher
801
+ // ==============================================
802
+
803
+ // Used to swap primary product photo from thumbnails.
804
+
805
+ var mediaListLinks = $j('.media-list').find('a');
806
+ var mediaPrimaryImage = $j('.primary-image').find('img');
807
+
808
+ if (mediaListLinks.length) {
809
+ mediaListLinks.on('click', function (e) {
810
+ e.preventDefault();
811
+
812
+ var self = $j(this);
813
+
814
+ mediaPrimaryImage.attr('src', self.attr('href'));
815
+ });
816
+ }
817
+
818
+ // ==============================================
819
+ // UI Pattern - ToggleSingle
820
+ // ==============================================
821
+
822
+ // Use this plugin to toggle the visibility of content based on a toggle link/element.
823
+ // This pattern differs from the accordion functionality in the Toggle pattern in that each toggle group acts
824
+ // independently of the others. It is named so as not to be confused with the Toggle pattern below
825
+ //
826
+ // This plugin requires a specific markup structure. The plugin expects a set of elements that it
827
+ // will use as the toggle link. It then hides all immediately following siblings and toggles the sibling's
828
+ // visibility when the toggle link is clicked.
829
+ //
830
+ // Example markup:
831
+ // <div class="block">
832
+ // <div class="block-title">Trigger</div>
833
+ // <div class="block-content">Content that should show when </div>
834
+ // </div>
835
+ //
836
+ // JS: jQuery('.block-title').toggleSingle();
837
+ //
838
+ // Options:
839
+ // destruct: defaults to false, but if true, the plugin will remove itself, display content, and remove event handlers
840
+
841
+
842
+ jQuery.fn.toggleSingle = function (options) {
843
+
844
+ // passing destruct: true allows
845
+ var settings = $j.extend({
846
+ destruct: false
847
+ }, options);
848
+
849
+ return this.each(function () {
850
+ if (!settings.destruct) {
851
+ $j(this).on('click', function () {
852
+ $j(this)
853
+ .toggleClass('active')
854
+ .next()
855
+ .toggleClass('no-display');
856
+ });
857
+ // Hide the content
858
+ $j(this).next().addClass('no-display');
859
+ } else {
860
+ // Remove event handler so that the toggle link can no longer be used
861
+ $j(this).off('click');
862
+ // Remove all classes that were added by this plugin
863
+ $j(this)
864
+ .removeClass('active')
865
+ .next()
866
+ .removeClass('no-display');
867
+ }
868
+
869
+ });
870
+ }
871
+
872
+ // ==============================================
873
+ // UI Pattern - Toggle Content (tabs and accordions in one setup)
874
+ // ==============================================
875
+
876
+ $j('.toggle-content').each(function () {
877
+ var wrapper = jQuery(this);
878
+
879
+ var hasTabs = wrapper.hasClass('tabs');
880
+ var hasAccordion = wrapper.hasClass('accordion');
881
+ var startOpen = wrapper.hasClass('open');
882
+
883
+ var dl = wrapper.children('dl:first');
884
+ var dts = dl.children('dt');
885
+ var panes = dl.children('dd');
886
+ var groups = new Array(dts, panes);
887
+
888
+ //Create a ul for tabs if necessary.
889
+ if (hasTabs) {
890
+ var ul = jQuery('<ul class="toggle-tabs"></ul>');
891
+ dts.each(function () {
892
+ var dt = jQuery(this);
893
+ var li = jQuery('<li></li>');
894
+ li.html(dt.html());
895
+ ul.append(li);
896
+ });
897
+ ul.insertBefore(dl);
898
+ var lis = ul.children();
899
+ groups.push(lis);
900
+ }
901
+
902
+ //Add "last" classes.
903
+ var i;
904
+ for (i = 0; i < groups.length; i++) {
905
+ groups[i].filter(':last').addClass('last');
906
+ }
907
+
908
+ function toggleClasses(clickedItem, group) {
909
+ var index = group.index(clickedItem);
910
+ var i;
911
+ for (i = 0; i < groups.length; i++) {
912
+ groups[i].removeClass('current');
913
+ groups[i].eq(index).addClass('current');
914
+ }
915
+ }
916
+
917
+ //Toggle on tab (dt) click.
918
+ dts.on('click', function (e) {
919
+ //They clicked the current dt to close it. Restore the wrapper to unclicked state.
920
+ if (jQuery(this).hasClass('current') && wrapper.hasClass('accordion-open')) {
921
+ wrapper.removeClass('accordion-open');
922
+ } else {
923
+ //They're clicking something new. Reflect the explicit user interaction.
924
+ wrapper.addClass('accordion-open');
925
+ }
926
+ toggleClasses(jQuery(this), dts);
927
+ });
928
+
929
+ //Toggle on tab (li) click.
930
+ if (hasTabs) {
931
+ lis.on('click', function (e) {
932
+ toggleClasses(jQuery(this), lis);
933
+ });
934
+ //Open the first tab.
935
+ lis.eq(0).trigger('click');
936
+ }
937
+
938
+ //Open the first accordion if desired.
939
+ if (startOpen) {
940
+ dts.eq(0).trigger('click');
941
+ }
942
+
943
+ });
944
+
945
+
946
+ // ==============================================
947
+ // Layered Navigation Block
948
+ // ==============================================
949
+
950
+ // On product list pages, we want to show the layered nav/category menu immediately above the product list.
951
+ // While it would make more sense to just move the .block-layered-nav block rather than .col-left-first
952
+ // (since other blocks can be inserted into left_first), it creates simpler code to move the entire
953
+ // .col-left-first block, so that is the approach we're taking
954
+ if ($j('.col-left-first > .block').length && $j('.category-products').length) {
955
+ enquire.register('screen and (max-width: ' + bp.medium + 'px)', {
956
+ match: function () {
957
+ $j('.col-left-first').insertBefore($j('.category-products'))
958
+ },
959
+ unmatch: function () {
960
+ // Move layered nav back to left column
961
+ $j('.col-left-first').insertBefore($j('.col-main'))
962
+ }
963
+ });
964
+ }
965
+
966
+ // ==============================================
967
+ // 3 column layout
968
+ // ==============================================
969
+
970
+ // On viewports smaller than 1000px, move the right column into the left column
971
+ if ($j('.main-container.col3-layout').length > 0) {
972
+ enquire.register('screen and (max-width: 1000px)', {
973
+ match: function () {
974
+ var rightColumn = $j('.col-right');
975
+ var colWrapper = $j('.col-wrapper');
976
+
977
+ rightColumn.appendTo(colWrapper);
978
+ },
979
+ unmatch: function () {
980
+ var rightColumn = $j('.col-right');
981
+ var main = $j('.main');
982
+
983
+ rightColumn.appendTo(main);
984
+ }
985
+ });
986
+ }
987
+
988
+
989
+ // ==============================================
990
+ // Block collapsing (on smaller viewports)
991
+ // ==============================================
992
+
993
+ enquire.register('(max-width: ' + bp.medium + 'px)', {
994
+ setup: function () {
995
+ this.toggleElements = $j(
996
+ // This selects the menu on the My Account and CMS pages
997
+ '.col-left-first .block:not(.block-layered-nav) .block-title, ' +
998
+ '.col-left-first .block-layered-nav .block-subtitle--filter, ' +
999
+ '.sidebar:not(.col-left-first) .block .block-title'
1000
+ );
1001
+ },
1002
+ match: function () {
1003
+ this.toggleElements.toggleSingle();
1004
+ },
1005
+ unmatch: function () {
1006
+ this.toggleElements.toggleSingle({destruct: true});
1007
+ }
1008
+ });
1009
+
1010
+
1011
+ // ==============================================
1012
+ // OPC - Progress Block
1013
+ // ==============================================
1014
+
1015
+ if ($j('body.checkout-onepage-index').length) {
1016
+ enquire.register('(max-width: ' + bp.large + 'px)', {
1017
+ match: function () {
1018
+ $j('#checkout-step-review').prepend($j('#checkout-progress-wrapper'));
1019
+ },
1020
+ unmatch: function () {
1021
+ $j('.col-right').prepend($j('#checkout-progress-wrapper'));
1022
+ }
1023
+ });
1024
+ }
1025
+
1026
+
1027
+ // ==============================================
1028
+ // Checkout Cart - events
1029
+ // ==============================================
1030
+
1031
+ if ($j('body.checkout-cart-index').length) {
1032
+ $j('input[name^="cart"]').focus(function () {
1033
+ $j(this).siblings('button').fadeIn();
1034
+ });
1035
+ }
1036
+
1037
+
1038
+ // ==============================================
1039
+ // Gift Registry Styles
1040
+ // ==============================================
1041
+
1042
+ if ($j('.a-left').length) {
1043
+ enquire.register('(max-width: ' + bp.large + 'px)', {
1044
+ match: function () {
1045
+ $j('.gift-info').each(function() {
1046
+ $j(this).next('td').children('textarea').appendTo(this).children();
1047
+ })
1048
+ },
1049
+ unmatch: function () {
1050
+ $j('.left-note').each(function() {
1051
+ $j(this).prev('td').children('textarea').appendTo(this).children();
1052
+ })
1053
+ }
1054
+ });
1055
+ }
1056
+
1057
+
1058
+ // ==============================================
1059
+ // Product Listing - Align action buttons/links
1060
+ // ==============================================
1061
+
1062
+ // Since the number of columns per grid will vary based on the viewport size, the only way to align the action
1063
+ // buttons/links is via JS
1064
+
1065
+ if ($j('.products-grid').length) {
1066
+
1067
+ var alignProductGridActions = function () {
1068
+ // Loop through each product grid on the page
1069
+ $j('.products-grid').each(function(){
1070
+ var gridRows = []; // This will store an array per row
1071
+ var tempRow = [];
1072
+ productGridElements = $j(this).children('li');
1073
+ productGridElements.each(function (index) {
1074
+ // The JS ought to be agnostic of the specific CSS breakpoints, so we are dynamically checking to find
1075
+ // each row by grouping all cells (eg, li elements) up until we find an element that is cleared.
1076
+ // We are ignoring the first cell since it will always be cleared.
1077
+ if ($j(this).css('clear') != 'none' && index != 0) {
1078
+ gridRows.push(tempRow); // Add the previous set of rows to the main array
1079
+ tempRow = []; // Reset the array since we're on a new row
1080
+ }
1081
+ tempRow.push(this);
1082
+
1083
+ // The last row will not contain any cells that clear that row, so we check to see if this is the last cell
1084
+ // in the grid, and if so, we add its row to the array
1085
+ if (productGridElements.length == index + 1) {
1086
+ gridRows.push(tempRow);
1087
+ }
1088
+ });
1089
+
1090
+ $j.each(gridRows, function () {
1091
+ var tallestProductInfo = 0;
1092
+ $j.each(this, function () {
1093
+ // Since this function is called every time the page is resized, we need to remove the min-height
1094
+ // and bottom-padding so each cell can return to its natural size before being measured.
1095
+ $j(this).find('.product-info').css({
1096
+ 'min-height': '',
1097
+ 'padding-bottom': ''
1098
+ });
1099
+
1100
+ // We are checking the height of .product-info (rather than the entire li), because the images
1101
+ // will not be loaded when this JS is run.
1102
+ var productInfoHeight = $j(this).find('.product-info').height();
1103
+ // Space above .actions element
1104
+ var actionSpacing = 10;
1105
+ // The height of the absolutely positioned .actions element
1106
+ var actionHeight = $j(this).find('.product-info .actions').height();
1107
+
1108
+ // Add height of two elements. This is necessary since .actions is absolutely positioned and won't
1109
+ // be included in the height of .product-info
1110
+ var totalHeight = productInfoHeight + actionSpacing + actionHeight;
1111
+ if (totalHeight > tallestProductInfo) {
1112
+ tallestProductInfo = totalHeight;
1113
+ }
1114
+
1115
+ // Set the bottom-padding to accommodate the height of the .actions element. Note: if .actions
1116
+ // elements are of varying heights, they will not be aligned.
1117
+ $j(this).find('.product-info').css('padding-bottom', actionHeight + 'px');
1118
+ });
1119
+ // Set the height of all .product-info elements in a row to the tallest height
1120
+ $j.each(this, function () {
1121
+ $j(this).find('.product-info').css('min-height', tallestProductInfo);
1122
+ });
1123
+ });
1124
+ });
1125
+ }
1126
+ alignProductGridActions();
1127
+
1128
+ // Since the height of each cell and the number of columns per page may change when the page is resized, we are
1129
+ // going to run the alignment function each time the page is resized.
1130
+ $j(window).on('delayed-resize', function (e, resizeEvent) {
1131
+ alignProductGridActions();
1132
+ });
1133
+ }
1134
+
1135
+ // ==============================================
1136
+ // Generic, efficient window resize handler
1137
+ // ==============================================
1138
+
1139
+ // Using setTimeout since Web-Kit and some other browsers call the resize function constantly upon window resizing.
1140
+ var resizeTimer;
1141
+ $j(window).resize(function (e) {
1142
+ clearTimeout(resizeTimer);
1143
+ resizeTimer = setTimeout(function () {
1144
+ $j(window).trigger('delayed-resize', e);
1145
+ }, 250);
1146
+ });
1147
+ });
1148
+
1149
+ // ==============================================
1150
+ // PDP - image zoom - needs to be available outside document.ready scope
1151
+ // ==============================================
1152
+
1153
+ var ProductMediaManager = {
1154
+ IMAGE_ZOOM_THRESHOLD: 20,
1155
+ imageWrapper: null,
1156
+
1157
+ destroyZoom: function() {
1158
+ $j('.zoomContainer').remove();
1159
+ $j('.product-image-gallery .gallery-image').removeData('elevateZoom');
1160
+ },
1161
+
1162
+ createZoom: function(image) {
1163
+ // Destroy since zoom shouldn't be enabled under certain conditions
1164
+ ProductMediaManager.destroyZoom();
1165
+
1166
+ if(
1167
+ // Don't use zoom on devices where touch has been used
1168
+ PointerManager.getPointer() == PointerManager.TOUCH_POINTER_TYPE
1169
+ // Don't use zoom when screen is small, or else zoom window shows outside body
1170
+ || Modernizr.mq("screen and (max-width:" + bp.medium + "px)")
1171
+ ) {
1172
+ return; // zoom not enabled
1173
+ }
1174
+
1175
+ if(image.length <= 0) { //no image found
1176
+ return;
1177
+ }
1178
+
1179
+ if(image[0].naturalWidth && image[0].naturalHeight) {
1180
+ var widthDiff = image[0].naturalWidth - image.width() - ProductMediaManager.IMAGE_ZOOM_THRESHOLD;
1181
+ var heightDiff = image[0].naturalHeight - image.height() - ProductMediaManager.IMAGE_ZOOM_THRESHOLD;
1182
+
1183
+ if(widthDiff < 0 && heightDiff < 0) {
1184
+ //image not big enough
1185
+
1186
+ image.parents('.product-image').removeClass('zoom-available');
1187
+
1188
+ return;
1189
+ } else {
1190
+ image.parents('.product-image').addClass('zoom-available');
1191
+ }
1192
+ }
1193
+
1194
+ //image.elevateZoom();
1195
+ if (jQuery('.review-product-list').length == 0) {
1196
+ image.elevateZoom();
1197
+ }
1198
+ },
1199
+
1200
+ swapImage: function(targetImage) {
1201
+ targetImage = $j(targetImage);
1202
+ targetImage.addClass('gallery-image');
1203
+
1204
+ ProductMediaManager.destroyZoom();
1205
+
1206
+ var imageGallery = $j('.product-image-gallery');
1207
+
1208
+ if(targetImage[0].complete) { //image already loaded -- swap immediately
1209
+
1210
+ imageGallery.find('.gallery-image').removeClass('visible');
1211
+
1212
+ //move target image to correct place, in case it's necessary
1213
+ imageGallery.append(targetImage);
1214
+
1215
+ //reveal new image
1216
+ targetImage.addClass('visible');
1217
+
1218
+ //wire zoom on new image
1219
+ ProductMediaManager.createZoom(targetImage);
1220
+
1221
+ } else { //need to wait for image to load
1222
+
1223
+ //add spinner
1224
+ imageGallery.addClass('loading');
1225
+
1226
+ //move target image to correct place, in case it's necessary
1227
+ imageGallery.append(targetImage);
1228
+
1229
+ //wait until image is loaded
1230
+ imagesLoaded(targetImage, function() {
1231
+ //remove spinner
1232
+ imageGallery.removeClass('loading');
1233
+
1234
+ //hide old image
1235
+ imageGallery.find('.gallery-image').removeClass('visible');
1236
+
1237
+ //reveal new image
1238
+ targetImage.addClass('visible');
1239
+
1240
+ //wire zoom on new image
1241
+ ProductMediaManager.createZoom(targetImage);
1242
+ });
1243
+
1244
+ }
1245
+ },
1246
+
1247
+ wireThumbnails: function() {
1248
+ //trigger image change event on thumbnail click
1249
+ $j('.product-image-thumbs .thumb-link').click(function(e) {
1250
+ e.preventDefault();
1251
+ var jlink = $j(this);
1252
+ var target = $j('#image-' + jlink.data('image-index'));
1253
+
1254
+ ProductMediaManager.swapImage(target);
1255
+ });
1256
+ },
1257
+
1258
+ initZoom: function() {
1259
+ ProductMediaManager.createZoom($j(".gallery-image.visible")); //set zoom on first image
1260
+ },
1261
+
1262
+ init: function() {
1263
+ ProductMediaManager.imageWrapper = $j('.product-img-box');
1264
+
1265
+ // Re-initialize zoom on viewport size change since resizing causes problems with zoom and since smaller
1266
+ // viewport sizes shouldn't have zoom
1267
+ $j(window).on('delayed-resize', function(e, resizeEvent) {
1268
+ ProductMediaManager.initZoom();
1269
+ });
1270
+
1271
+ ProductMediaManager.initZoom();
1272
+
1273
+ ProductMediaManager.wireThumbnails();
1274
+
1275
+ $j(document).trigger('product-media-loaded', ProductMediaManager);
1276
+ }
1277
+ };
1278
+
1279
+ $j(document).ready(function() {
1280
+ ProductMediaManager.init();
1281
+ });
skin/frontend/base/default/js/sfcaptcha/browser.js ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Limit scope pollution from any deprecated API
2
+ (function() {
3
+
4
+ var matched, browser;
5
+
6
+ // Use of jQuery.browser is frowned upon.
7
+ // More details: http://api.jquery.com/jQuery.browser
8
+ // jQuery.uaMatch maintained for back-compat
9
+ jQuery.uaMatch = function( ua ) {
10
+ ua = ua.toLowerCase();
11
+
12
+ var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
13
+ /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
14
+ /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
15
+ /(msie) ([\w.]+)/.exec( ua ) ||
16
+ ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
17
+ [];
18
+
19
+ return {
20
+ browser: match[ 1 ] || "",
21
+ version: match[ 2 ] || "0"
22
+ };
23
+ };
24
+
25
+ matched = jQuery.uaMatch( navigator.userAgent );
26
+ browser = {};
27
+
28
+ if ( matched.browser ) {
29
+ browser[ matched.browser ] = true;
30
+ browser.version = matched.version;
31
+ }
32
+
33
+ // Chrome is Webkit, but Webkit is also Safari.
34
+ if ( browser.chrome ) {
35
+ browser.webkit = true;
36
+ } else if ( browser.webkit ) {
37
+ browser.safari = true;
38
+ }
39
+
40
+ jQuery.browser = browser;
41
+
42
+ jQuery.sub = function() {
43
+ function jQuerySub( selector, context ) {
44
+ return new jQuerySub.fn.init( selector, context );
45
+ }
46
+ jQuery.extend( true, jQuerySub, this );
47
+ jQuerySub.superclass = this;
48
+ jQuerySub.fn = jQuerySub.prototype = this();
49
+ jQuerySub.fn.constructor = jQuerySub;
50
+ jQuerySub.sub = this.sub;
51
+ jQuerySub.fn.init = function init( selector, context ) {
52
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
53
+ context = jQuerySub( context );
54
+ }
55
+
56
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
57
+ };
58
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
59
+ var rootjQuerySub = jQuerySub(document);
60
+ return jQuerySub;
61
+ };
62
+
63
+ })();
skin/frontend/base/default/js/sfcaptcha/jquery-ui.js ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.8.23 - 2012-08-15
2
+ * https://github.com/jquery/jquery-ui
3
+ * Includes: jquery.ui.core.js
4
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
5
+ (function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.23",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a("<a>").outerWidth(1).jquery||a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.curCSS||(a.curCSS=a.css),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;return b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
6
+ * https://github.com/jquery/jquery-ui
7
+ * Includes: jquery.ui.widget.js
8
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
9
+ (function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
10
+ * https://github.com/jquery/jquery-ui
11
+ * Includes: jquery.ui.mouse.js
12
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
13
+ (function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(b){if(c)return;this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted)return b.preventDefault(),!0}return!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0,!0},_mouseMove:function(b){return!a.browser.msie||document.documentMode>=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
14
+ * https://github.com/jquery/jquery-ui
15
+ * Includes: jquery.ui.position.js
16
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
17
+ (function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),a.curCSS||(a.curCSS=a.css),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
18
+ * https://github.com/jquery/jquery-ui
19
+ * Includes: jquery.ui.draggable.js
20
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
21
+ (function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(b),this.handle?(c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);var d=this.element[0],e=!1;while(d&&(d=d.parentNode))d==document&&(e=!0);if(!e&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",b)!==!1&&f._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;return a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){return d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.23"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!e.length)return;var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
22
+ * https://github.com/jquery/jquery-ui
23
+ * Includes: jquery.ui.droppable.js
24
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
25
+ (function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);return this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable"),this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance))return e=!0,!1}),e?!1:this.accept.call(this.element[0],d.currentItem||d.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d)),this.element):!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.23"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();g:for(var h=0;h<d.length;h++){if(d[h].options.disabled||b&&!d[h].accept.call(d[h].element[0],b.currentItem||b.element))continue;for(var i=0;i<f.length;i++)if(f[i]==d[h].element[0]){d[h].proportions.height=0;continue g}d[h].visible=d[h].element.css("display")!="none";if(!d[h].visible)continue;e=="mousedown"&&d[h]._activate.call(d[h],c),d[h].offset=d[h].element.offset(),d[h].proportions={width:d[h].element[0].offsetWidth,height:d[h].element[0].offsetHeight}}},drop:function(b,c){var d=!1;return a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c))}),d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);;
skin/frontend/base/default/js/sfcaptcha/jquery.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! jQuery v1.8.2 jquery.com | jquery.org/license */
2
+ (function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bY(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bW.length;while(e--){b=bW[e]+c;if(b in a)return b}return d}function bZ(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function b$(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bZ(c)&&(e[f]=p._data(c,"olddisplay",cc(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b_(a,b,c){var d=bP.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function ca(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bV[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bV[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bV[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bV[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bV[e]+"Width"))||0));return f}function cb(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0||d==null){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bQ.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+ca(a,b,c||(f?"border":"content"),e)+"px"}function cc(a){if(bS[a])return bS[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cA(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cv;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cA(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cA(a,c,d,e,"*",g)),h}function cB(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cC(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cD(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cL(){try{return new a.XMLHttpRequest}catch(b){}}function cM(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cU(){return setTimeout(function(){cN=b},0),cN=p.now()}function cV(a,b){p.each(b,function(b,c){var d=(cT[b]||[]).concat(cT["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cW(a,b,c){var d,e=0,f=0,g=cS.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cN||cU(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cX(k,j.opts.specialEasing);for(;e<g;e++){d=cS[e].call(j,a,k,j.opts);if(d)return d}return cV(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cX(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cY(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bZ(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cc(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cP.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cZ(a,b,c,d,e){return new cZ.prototype.init(a,b,c,d,e)}function c$(a,b){var c,d={height:a},e=0;b=b?1:0;for(;e<4;e+=2-b)c=bV[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function da(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,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(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.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):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o&&!o.call(" ")?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":(a+"").replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.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=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete")setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){var e=p.type(c);e==="function"&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&e!=="string"&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")||(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",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){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)d=p._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);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{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._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)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.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,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.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,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.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):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.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;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=b+""}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&p.expr.match.needsContext.test(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=k.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click"))for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){h={},j=[];for(d=0;d<q;d++)l=o[d],m=l.selector,h[m]===b&&(h[m]=l.needsContext?p(m,this).index(f)>=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){i=u[d],c.currentTarget=i.elem;for(e=0;e<i.matches.length&&!c.isImmediatePropagationStopped();e++){l=i.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,g=((p.event.special[l.origType]||{}).handle||l.handler).apply(i.elem,r),g!==b&&(c.result=g,g===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),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){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(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(){return p.event.remove(this,"._change"),!V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);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=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.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){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.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){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),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(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),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)}}),p.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){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(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 bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h<i;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),j&&b.push(h);return g}function bl(a,b,c,d,e,f){return d&&!d[o]&&(d=bl(d)),e&&!e[o]&&(e=bl(e,f)),z(function(f,g,h,i){if(f&&e)return;var j,k,l,m=[],n=[],o=g.length,p=f||bo(b||"*",h.nodeType?[h]:h,[],f),q=a&&(f||!b)?bk(p,m,a,h,i):p,r=c?e||(f?a:o||d)?[]:g:q;c&&c(q,r,h,i);if(d){l=bk(r,n),d(l,[],h,i),j=l.length;while(j--)if(k=l[j])r[n[j]]=!(q[n[j]]=k)}if(f){j=a&&r.length;while(j--)if(k=r[j])f[m[j]]=!(g[m[j]]=k)}else r=bk(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):w.apply(g,r)})}function bm(a){var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],i=g?1:0,j=bi(function(a){return a===b},h,!0),k=bi(function(a){return y.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i<f;i++)if(c=e.relative[a[i].type])m=[bi(bj(m),c)];else{c=e.filter[a[i].type].apply(null,a[i].matches);if(c[o]){d=++i;for(;d<f;d++)if(e.relative[a[d].type])break;return bl(i>1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i<d&&bm(a.slice(i,d)),d<f&&bm(a=a.slice(d)),d<f&&a.join(""))}m.push(c)}return bj(m)}function bn(a,b){var d=b.length>0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)bc(a,b[e],c,d);return c}function bp(a,b,c,d,f){var g,h,j,k,l,m=bh(a),n=m.length;if(!d&&m.length===1){h=m[0]=m[0].slice(0);if(h.length>2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++)if(this[b]===a)return b;return-1},z=function(a,b){return a[o]=b==null||b,a},A=function(){var a={},b=[];return z(function(c,d){return b.push(c)>e.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="<a name='"+o+"'></a><div name='"+o+"'></div>",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d<b;d+=2)a.push(d);return a}),odd:bf(function(a,b,c){for(var d=1;d<b;d+=2)a.push(d);return a}),lt:bf(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},j=s.compareDocumentPosition?function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return bg(a,b);if(!g)return-1;if(!h)return 1;while(i)e.unshift(i),i=i.parentNode;i=h;while(i)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;j<c&&j<d;j++)if(e[j]!==f[j])return bg(e[j],f[j]);return j===c?bg(a,f[j],-1):bg(e[j],b,1)},[0,0].sort(j),m=!k,bc.uniqueSort=function(a){var b,c=1;k=m,a.sort(j);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a},bc.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},i=bc.compile=function(a,b){var c,d=[],e=[],f=D[o][a];if(!f){b||(b=bh(a)),c=b.length;while(c--)f=bm(b[c]),f[o]?d.push(f):e.push(f);f=D(a,bn(e,d))}return f},r.querySelectorAll&&function(){var a,b=bp,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[":focus"],f=[":active",":focus"],h=s.matchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||s.msMatchesSelector;X(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'/>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={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,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(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){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[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","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cT[c]=cT[c]||[],cT[c].unshift(b)},prefilter:function(a,b){b?cS.unshift(a):cS.push(a)}}),p.Tween=cZ,cZ.prototype={constructor:cZ,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cZ.propHooks[this.prop];return a&&a.get?a.get(this):cZ.propHooks._default.get(this)},run:function(a){var b,c=cZ.propHooks[this.prop];return this.options.duration?this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cZ.propHooks._default.set(this),this}},cZ.prototype.init.prototype=cZ.prototype,cZ.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cZ.propHooks.scrollTop=cZ.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(c$(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bZ).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cW(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cR.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:c$("show"),slideUp:c$("hide"),slideToggle:c$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cZ.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cO&&(cO=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cO),cO=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c_=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j={top:0,left:0},k=this[0],l=k&&k.ownerDocument;if(!l)return;return(d=l.body)===k?p.offset.bodyOffset(k):(c=l.documentElement,p.contains(c,k)?(typeof k.getBoundingClientRect!="undefined"&&(j=k.getBoundingClientRect()),e=da(l),f=c.clientTop||d.clientTop||0,g=c.clientLeft||d.clientLeft||0,h=e.pageYOffset||c.scrollTop,i=e.pageXOffset||c.scrollLeft,{top:j.top+h-f,left:j.left+i-g}):j)},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window);jQuery.noConflict();
skin/frontend/base/default/js/sfcaptcha/jquery.ui.touch.js ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jQuery.UI.iPad plugin
3
+ * Copyright (c) 2010 Stephen von Takach
4
+ * licensed under MIT.
5
+ * Date: 27/8/2010
6
+ *
7
+ * Project Home:
8
+ * http://code.google.com/p/jquery-ui-for-ipad-and-iphone/
9
+ */
10
+
11
+ $(function() {
12
+ //
13
+ // Extend jQuery feature detection
14
+ //
15
+ $.extend($.support, {
16
+ touch: "ontouchend" in document
17
+ });
18
+
19
+ //
20
+ // Hook up touch events
21
+ //
22
+ if ($.support.touch) {
23
+ var obj = document.getElementsByClassName('QapTcha');
24
+ for(i=0; i<obj.length;i++){
25
+ obj[i].addEventListener("touchstart", iPadTouchHandler, false);
26
+ obj[i].addEventListener("touchmove", iPadTouchHandler, false);
27
+ obj[i].addEventListener("touchend", iPadTouchHandler, false);
28
+ obj[i].addEventListener("touchcancel", iPadTouchHandler, false);
29
+ }}
30
+ });
31
+
32
+
33
+ var lastTap = null; // Holds last tapped element (so we can compare for double tap)
34
+ var tapValid = false; // Are we still in the .6 second window where a double tap can occur
35
+ var tapTimeout = null; // The timeout reference
36
+
37
+ function cancelTap() {
38
+ tapValid = false;
39
+ }
40
+
41
+
42
+ var rightClickPending = false; // Is a right click still feasible
43
+ var rightClickEvent = null; // the original event
44
+ var holdTimeout = null; // timeout reference
45
+ var cancelMouseUp = false; // prevents a click from occuring as we want the context menu
46
+
47
+
48
+ function cancelHold() {
49
+ if (rightClickPending) {
50
+ window.clearTimeout(holdTimeout);
51
+ rightClickPending = false;
52
+ rightClickEvent = null;
53
+ }
54
+ }
55
+
56
+ function startHold(event) {
57
+ if (rightClickPending)
58
+ return;
59
+
60
+ rightClickPending = true; // We could be performing a right click
61
+ rightClickEvent = (event.changedTouches)[0];
62
+ holdTimeout = window.setTimeout("doRightClick();", 800);
63
+ }
64
+
65
+
66
+ function doRightClick() {
67
+ rightClickPending = false;
68
+
69
+ //
70
+ // We need to mouse up (as we were down)
71
+ //
72
+ var first = rightClickEvent,
73
+ simulatedEvent = document.createEvent("MouseEvent");
74
+ simulatedEvent.initMouseEvent("mouseup", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
75
+ false, false, false, false, 0, null);
76
+ first.target.dispatchEvent(simulatedEvent);
77
+
78
+ //
79
+ // emulate a right click
80
+ //
81
+ simulatedEvent = document.createEvent("MouseEvent");
82
+ simulatedEvent.initMouseEvent("mousedown", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
83
+ false, false, false, false, 2, null);
84
+ first.target.dispatchEvent(simulatedEvent);
85
+
86
+ //
87
+ // Show a context menu
88
+ //
89
+ simulatedEvent = document.createEvent("MouseEvent");
90
+ simulatedEvent.initMouseEvent("contextmenu", true, true, window, 1, first.screenX + 50, first.screenY + 5, first.clientX + 50, first.clientY + 5,
91
+ false, false, false, false, 2, null);
92
+ first.target.dispatchEvent(simulatedEvent);
93
+
94
+
95
+ //
96
+ // Note:: I don't mouse up the right click here however feel free to add if required
97
+ //
98
+
99
+
100
+ cancelMouseUp = true;
101
+ rightClickEvent = null; // Release memory
102
+ }
103
+
104
+
105
+ //
106
+ // mouse over event then mouse down
107
+ //
108
+ function iPadTouchStart(event) {
109
+ var touches = event.changedTouches,
110
+ first = touches[0],
111
+ type = "mouseover",
112
+ simulatedEvent = document.createEvent("MouseEvent");
113
+ //
114
+ // Mouse over first - I have live events attached on mouse over
115
+ //
116
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
117
+ false, false, false, false, 0, null);
118
+ first.target.dispatchEvent(simulatedEvent);
119
+
120
+ type = "mousedown";
121
+ simulatedEvent = document.createEvent("MouseEvent");
122
+
123
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
124
+ false, false, false, false, 0, null);
125
+ first.target.dispatchEvent(simulatedEvent);
126
+
127
+
128
+ if (!tapValid) {
129
+ lastTap = first.target;
130
+ tapValid = true;
131
+ tapTimeout = window.setTimeout("cancelTap();", 600);
132
+ startHold(event);
133
+ }
134
+ else {
135
+ window.clearTimeout(tapTimeout);
136
+
137
+ //
138
+ // If a double tap is still a possibility and the elements are the same
139
+ // Then perform a double click
140
+ //
141
+ if (first.target == lastTap) {
142
+ lastTap = null;
143
+ tapValid = false;
144
+
145
+ type = "click";
146
+ simulatedEvent = document.createEvent("MouseEvent");
147
+
148
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
149
+ false, false, false, false, 0/*left*/, null);
150
+ first.target.dispatchEvent(simulatedEvent);
151
+
152
+ type = "dblclick";
153
+ simulatedEvent = document.createEvent("MouseEvent");
154
+
155
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
156
+ false, false, false, false, 0/*left*/, null);
157
+ first.target.dispatchEvent(simulatedEvent);
158
+ }
159
+ else {
160
+ lastTap = first.target;
161
+ tapValid = true;
162
+ tapTimeout = window.setTimeout("cancelTap();", 600);
163
+ startHold(event);
164
+ }
165
+ }
166
+ }
167
+
168
+ function iPadTouchHandler(event) {
169
+ var type = "",
170
+ button = 0; /*left*/
171
+
172
+ if (event.touches.length > 1)
173
+ return;
174
+
175
+ switch (event.type) {
176
+ case "touchstart":
177
+ if ($(event.changedTouches[0].target).is("select")) {
178
+ return;
179
+ }
180
+ iPadTouchStart(event); /*We need to trigger two events here to support one touch drag and drop*/
181
+ event.preventDefault();
182
+ return false;
183
+ break;
184
+
185
+ case "touchmove":
186
+ cancelHold();
187
+ type = "mousemove";
188
+ event.preventDefault();
189
+ break;
190
+
191
+ case "touchend":
192
+ if (cancelMouseUp) {
193
+ cancelMouseUp = false;
194
+ event.preventDefault();
195
+ return false;
196
+ }
197
+ cancelHold();
198
+ type = "mouseup";
199
+ break;
200
+
201
+ default:
202
+ return;
203
+ }
204
+
205
+ var touches = event.changedTouches,
206
+ first = touches[0],
207
+ simulatedEvent = document.createEvent("MouseEvent");
208
+
209
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
210
+ false, false, false, false, button, null);
211
+
212
+ first.target.dispatchEvent(simulatedEvent);
213
+
214
+ if (type == "mouseup" && tapValid && first.target == lastTap) { // This actually emulates the ipads default behaviour (which we prevented)
215
+ simulatedEvent = document.createEvent("MouseEvent"); // This check avoids click being emulated on a double tap
216
+
217
+ simulatedEvent.initMouseEvent("click", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
218
+ false, false, false, false, button, null);
219
+
220
+ first.target.dispatchEvent(simulatedEvent);
221
+ }
222
+ }
223
+
224
+
skin/frontend/rwd/default/css/sfcaptcha/QapTcha.jquery.css ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************/
2
+ /** QapTcha CSS **/
3
+ /*****************/
4
+ .QapTcha {float:left;width:210px;margin-right: 10px;}
5
+ .QapTcha .clr{clear:both}
6
+ .QapTcha .bgSlider {
7
+ width: 100%;
8
+ height: 33px;
9
+ float: left;
10
+ background-color: #3399cc;
11
+ padding: 1px;
12
+ }
13
+ .QapTcha .Slider {
14
+ width: 45px;
15
+ height: 31px;
16
+ background: transparent url('../sfcaptcha/images/bg_draggable_qaptcha.jpg') no-repeat;
17
+ cursor: e-resize;
18
+ position: relative;
19
+ top: 0;
20
+ left: 0;
21
+ background-size: 43px auto;
22
+ }
23
+ .QapTcha .TxtStatus {width:170px;margin-top:7px;text-align:left;color:#bb2828;font-family:Verdana;font-size:10px;clear:both}
24
+ .QapTcha .dropSuccess {
25
+ color:#4e8b37;
26
+ font-size: 11px;
27
+ line-height: normal;
28
+ font-family: inherit;
29
+ }
30
+ .QapTcha .dropError {
31
+ color: #eb340a;
32
+ font-size: 11px;
33
+ line-height: normal;
34
+ font-family: inherit;
35
+ }
36
+ .account-login .content{
37
+ position: relative;
38
+ }
39
+ .registered-users .QapTcha {
40
+ float: left;
41
+ width: 50%;
42
+ }
43
+ .registered-users .QapTcha .TxtStatus {
44
+ width: 100%;
45
+ }
46
+ .customer-account-create .QapTcha {
47
+ margin: 15px 0;
48
+ width: 210px;
49
+ }
50
+ .contacts-index-index .QapTcha {
51
+ float: left;
52
+ }
53
+ .submit-block{
54
+ float: right;
55
+ }
56
+ .contacts-index-index .fieldset p.required {
57
+ float: none;
58
+ }
59
+ .contacts-index-index .buttons-set.captcha {
60
+ margin-left: 0;
61
+ }
62
+ @media only screen and (max-width: 900px){
63
+ .registered-users .QapTcha{
64
+ width: 100%;
65
+ }
66
+ .registered-users .QapTcha {
67
+ margin: 15px 0;
68
+ width: 100%;
69
+ }
70
+ .customer-account-login .col2-set .buttons-set.login-button button{
71
+ width: 100%;
72
+ }
73
+ .customer-account-create .QapTcha, .customer-account-create .QapTcha .TxtStatus {
74
+ margin: 5px 0;
75
+ width: 250px;
76
+ }
77
+ }
78
+ @media only screen and (max-width: 600px){
79
+ .contacts-index-index .QapTcha {
80
+ float: left;
81
+ margin: 0;
82
+ width: 140px;
83
+ }
84
+ .contacts-index-index .buttons-set.captcha {
85
+ min-width: 100%;
86
+ width: 100%;
87
+ }
88
+ .buttons-set .button.submit-review {
89
+ margin: 20px 0;
90
+ width: 100%;
91
+ }
92
+ .QapTcha, .QapTcha .TxtStatus {
93
+ margin: 5px 0;
94
+ width: 100%;
95
+ }
96
+ .customer-account-create .QapTcha, .customer-account-create .QapTcha .TxtStatus {
97
+ margin: 5px 0;
98
+ width: 250px;
99
+ }
100
+ }
101
+ @media only screen and (max-width: 480px){
102
+ .customer-account-create .QapTcha, .customer-account-create .QapTcha .TxtStatus {
103
+ margin: 5px 0;
104
+ width: 100%;
105
+ }
106
+ }
skin/frontend/rwd/default/css/sfcaptcha/images/bg_draggable_qaptcha.jpg ADDED
Binary file
skin/frontend/rwd/default/js/sfcaptcha/QapTcha.jquery.js ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /************************************************************************
2
+ *************************************************************************
3
+ @Name : QapTcha - jQuery Plugin
4
+ @Revison : 4.2
5
+ @Date : 06/09/2012 - dd/mm/YYYY
6
+ @Author: ALPIXEL Agency - (www.myjqueryplugins.com - www.alpixel.fr)
7
+ @License : Open Source - MIT License : http://www.opensource.org/licenses/mit-license.php
8
+
9
+ **************************************************************************
10
+ *************************************************************************/
11
+ jQuery.QapTcha = {
12
+ build : function(options)
13
+ {
14
+ var defaults = {
15
+ txtLock : 'Locked : form can\'t be submited',
16
+ txtUnlock : 'Unlocked : form can be submited',
17
+ disabledSubmit : true,
18
+ autoRevert : true,
19
+ PHPfile : 'php/Qaptcha.jquery.php',
20
+ autoSubmit : false
21
+ };
22
+
23
+ if(this.length>0)
24
+ return jQuery(this).each(function(i) {
25
+ /** Vars **/
26
+ var
27
+ opts = jQuery.extend(defaults, options),
28
+ $this = jQuery(this),
29
+ form = jQuery('form').has($this),
30
+ Clr = jQuery('<div>',{'class':'clr'}),
31
+ bgSlider = jQuery('<div>',{'class':'bgSlider'}),
32
+ Slider = jQuery('<div>',{'class':'Slider'}),
33
+ TxtStatus = jQuery('<div>',{'class':' TxtStatus dropError',text:opts.txtLock}),
34
+ inputQapTcha = jQuery('<input>',{name:generatePass(32),value:generatePass(7),type:'hidden'});
35
+
36
+ /** Disabled submit button **/
37
+ if(opts.disabledSubmit) form.find('button[type=\'submit\']').attr('disabled','disabled');
38
+
39
+ /** Construct DOM **/
40
+ bgSlider.appendTo($this);
41
+ Clr.insertAfter(bgSlider);
42
+ TxtStatus.insertAfter(Clr);
43
+ inputQapTcha.appendTo($this);
44
+ Slider.appendTo(bgSlider);
45
+ $this.show();
46
+
47
+ Slider.draggable({
48
+ revert: function(){
49
+ if(opts.autoRevert)
50
+ {
51
+ if(parseInt(Slider.css("left")) > (bgSlider.width()-Slider.width()-30)) return false;
52
+ else return true;
53
+ }
54
+ },
55
+ containment: bgSlider,
56
+ axis:'x',
57
+ stop: function(event,ui){
58
+ if(ui.position.left > (bgSlider.width()-Slider.width()-10))
59
+ {
60
+ // set the SESSION iQaptcha in PHP file
61
+ jQuery.post(opts.PHPfile,{
62
+ action : 'qaptcha',
63
+ qaptcha_key : inputQapTcha.attr('name')
64
+ },
65
+ function(data) {
66
+ if(!data.error)
67
+ {
68
+ Slider.draggable('disable').css('cursor','default');
69
+ inputQapTcha.val('');
70
+ TxtStatus.text(opts.txtUnlock).addClass('dropSuccess').removeClass('dropError');
71
+ form.find('button[type=\'submit\']').removeAttr('disabled');
72
+ if(opts.autoSubmit) form.find('button[type=\'submit\']').trigger('click');
73
+ }
74
+ },'json');
75
+ }
76
+ }
77
+ });
78
+
79
+ function generatePass(nb) {
80
+ var chars = 'azertyupqsdfghjkmwxcvbn23456789AZERTYUPQSDFGHJKMWXCVBN_-#@';
81
+ var pass = '';
82
+ for(i=0;i<nb;i++){
83
+ var wpos = Math.round(Math.random()*chars.length);
84
+ pass += chars.substring(wpos,wpos+1);
85
+ }
86
+ return pass;
87
+ }
88
+
89
+ });
90
+ }
91
+ }; jQuery.fn.QapTcha = jQuery.QapTcha.build;
skin/frontend/rwd/default/js/sfcaptcha/QapTcha.jquery.min.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /************************************************************************
2
+ *************************************************************************
3
+ @Name : QapTcha - jQuery Plugin
4
+ @Revison : 4.2
5
+ @Date : 06/09/2012 - dd/mm/YYYY
6
+ @Author: ALPIXEL - (www.myjqueryplugins.com - www.alpixel.fr)
7
+ @License : Open Source - MIT License : http://www.opensource.org/licenses/mit-license.php
8
+
9
+ **************************************************************************
10
+ *************************************************************************/
11
+ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2.p={X:a(V){b A={R:\'1j : 6 y\\\'t E D\',z:\'1y : 6 y E D\',W:n,L:n,J:\'I/12.15.I\',H:M};9(5.G>0)j 2(5).1w(a(i){b 8=$.1A(A,V),$5=$(5),6=$(\'6\').1B($5),r=2(\'<g>\',{\'f\':\'1d\'}),3=2(\'<g>\',{\'f\':\'3\'}),4=2(\'<g>\',{\'f\':\'4\'}),h=2(\'<g>\',{\'f\':\' h B\',C:8.R}),d=2(\'<c>\',{F:o(16),17:o(7),k:\'1F\'});9(8.W)6.q(\'c[k=\\\'l\\\']\').K(\'s\',\'s\');3.u($5);r.N(3);h.N(r);d.u($5);4.u(3);$5.11();4.O({13:a(){9(8.L){9(14(4.P("Q"))>(3.e()-4.e()-10))j M;18 j n}},19:3,1a:\'x\',1b:a(1c,S){9(S.1e.Q>(3.e()-4.e()-10)){$.1f(8.J,{1g:\'1h\',1i:d.K(\'F\')},a(T){9(!T.1k){4.O(\'1l\').P(\'1m\',\'1n\');d.1o(\'\');h.C(8.z).1p(\'1q\').1r(\'B\');6.q(\'c[k=\\\'l\\\']\').1s(\'s\');9(8.H)6.q(\'c[k=\\\'l\\\']\').1t(\'1u\')}},\'1v\')}}});a o(U){b v=\'1x-#@\';b w=\'\';1z(i=0;i<U;i++){b m=Y.1C(Y.1D()*v.G);w+=v.1E(m,m+1)}j w}})}};2.Z.p=2.p.X;',62,104,'||jQuery|bgSlider|Slider|this|form||opts|if|function|var|input|inputQapTcha|width|class|div|TxtStatus||return|type|submit|wpos|true|generatePass|QapTcha|find|Clr|disabled||appendTo|chars|pass||can|txtUnlock|defaults|dropError|text|submited|be|name|length|autoSubmit|php|PHPfile|attr|autoRevert|false|insertAfter|draggable|css|left|txtLock|ui|data|nb|options|disabledSubmit|build|Math|fn||show|Qaptcha|revert|parseInt|jquery|32|value|else|containment|axis|stop|event|clr|position|post|action|qaptcha|qaptcha_key|Locked|error|disable|cursor|default|val|addClass|dropSuccess|removeClass|removeAttr|trigger|click|json|each|azertyupqsdfghjkmwxcvbn23456789AZERTYUPQSDFGHJKMWXCVBN_|Unlocked|for|extend|has|round|random|substring|hidden'.split('|'),0,{}))
skin/frontend/rwd/default/js/sfcaptcha/app.js ADDED
@@ -0,0 +1,1281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magento
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 Magento to newer
17
+ * versions in the future. If you wish to customize Magento for your
18
+ * needs please refer to http://www.magento.com for more information.
19
+ *
20
+ * @category design
21
+ * @package rwd_default
22
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+
26
+ // =============================================
27
+ // Primary Break Points
28
+ // =============================================
29
+
30
+ // These should be used with the bp (max-width, xx) mixin
31
+ // where a min-width is used, remember to +1 to break correctly
32
+ // If these are changed, they must also be updated in _var.scss
33
+
34
+ var bp = {
35
+ xsmall: 479,
36
+ small: 599,
37
+ medium: 770,
38
+ large: 979,
39
+ xlarge: 1199
40
+ }
41
+
42
+ // ==============================================
43
+ // Search
44
+ // ==============================================
45
+
46
+ /**
47
+ * Implements a custom validation style for the search form. When the form is invalidly submitted, the validation-failed
48
+ * class gets added to the input, but the "This is a required field." text does not display
49
+ */
50
+ Varien.searchForm.prototype.initialize = function (form, field, emptyText) {
51
+ this.form = $(form);
52
+ this.field = $(field);
53
+ this.emptyText = emptyText;
54
+
55
+ Event.observe(this.form, 'submit', this.submit.bind(this));
56
+ Event.observe(this.field, 'change', this.change.bind(this));
57
+ Event.observe(this.field, 'focus', this.focus.bind(this));
58
+ Event.observe(this.field, 'blur', this.blur.bind(this));
59
+ this.blur();
60
+ }
61
+
62
+ Varien.searchForm.prototype.submit = function (event) {
63
+ if (this.field.value == this.emptyText || this.field.value == ''){
64
+ Event.stop(event);
65
+ this.field.addClassName('validation-failed');
66
+ this.field.focus();
67
+ return false;
68
+ }
69
+ return true;
70
+ }
71
+
72
+ Varien.searchForm.prototype.change = function (event) {
73
+ if (
74
+ this.field.value != this.emptyText
75
+ && this.field.value != ''
76
+ && this.field.hasClassName('validation-failed')
77
+ ) {
78
+ this.field.removeClassName('validation-failed');
79
+ }
80
+ }
81
+
82
+ Varien.searchForm.prototype.blur = function (event) {
83
+ if (this.field.hasClassName('validation-failed')) {
84
+ this.field.removeClassName('validation-failed');
85
+ }
86
+ }
87
+
88
+ // ==============================================
89
+ // Pointer abstraction
90
+ // ==============================================
91
+
92
+ /**
93
+ * This class provides an easy and abstracted mechanism to determine the
94
+ * best pointer behavior to use -- that is, is the user currently interacting
95
+ * with their device in a touch manner, or using a mouse.
96
+ *
97
+ * Since devices may use either touch or mouse or both, there is no way to
98
+ * know the user's preferred pointer type until they interact with the site.
99
+ *
100
+ * To accommodate this, this class provides a method and two events
101
+ * to determine the user's preferred pointer type.
102
+ *
103
+ * - getPointer() returns the last used pointer type, or, if the user has
104
+ * not yet interacted with the site, falls back to a Modernizr test.
105
+ *
106
+ * - The mouse-detected event is triggered on the window object when the user
107
+ * is using a mouse pointer input, or has switched from touch to mouse input.
108
+ * It can be observed in this manner: $j(window).on('mouse-detected', function(event) { // custom code });
109
+ *
110
+ * - The touch-detected event is triggered on the window object when the user
111
+ * is using touch pointer input, or has switched from mouse to touch input.
112
+ * It can be observed in this manner: $j(window).on('touch-detected', function(event) { // custom code });
113
+ */
114
+ var PointerManager = {
115
+ MOUSE_POINTER_TYPE: 'mouse',
116
+ TOUCH_POINTER_TYPE: 'touch',
117
+ POINTER_EVENT_TIMEOUT_MS: 500,
118
+ standardTouch: false,
119
+ touchDetectionEvent: null,
120
+ lastTouchType: null,
121
+ pointerTimeout: null,
122
+ pointerEventLock: false,
123
+
124
+ getPointerEventsSupported: function() {
125
+ return this.standardTouch;
126
+ },
127
+
128
+ getPointerEventsInputTypes: function() {
129
+ if (window.navigator.pointerEnabled) { //IE 11+
130
+ //return string values from http://msdn.microsoft.com/en-us/library/windows/apps/hh466130.aspx
131
+ return {
132
+ MOUSE: 'mouse',
133
+ TOUCH: 'touch',
134
+ PEN: 'pen'
135
+ };
136
+ } else if (window.navigator.msPointerEnabled) { //IE 10
137
+ //return numeric values from http://msdn.microsoft.com/en-us/library/windows/apps/hh466130.aspx
138
+ return {
139
+ MOUSE: 0x00000004,
140
+ TOUCH: 0x00000002,
141
+ PEN: 0x00000003
142
+ };
143
+ } else { //other browsers don't support pointer events
144
+ return {}; //return empty object
145
+ }
146
+ },
147
+
148
+ /**
149
+ * If called before init(), get best guess of input pointer type
150
+ * using Modernizr test.
151
+ * If called after init(), get current pointer in use.
152
+ */
153
+ getPointer: function() {
154
+ // On iOS devices, always default to touch, as this.lastTouchType will intermittently return 'mouse' if
155
+ // multiple touches are triggered in rapid succession in Safari on iOS
156
+ if(Modernizr.ios) {
157
+ return this.TOUCH_POINTER_TYPE;
158
+ }
159
+
160
+ if(this.lastTouchType) {
161
+ return this.lastTouchType;
162
+ }
163
+
164
+ return Modernizr.touch ? this.TOUCH_POINTER_TYPE : this.MOUSE_POINTER_TYPE;
165
+ },
166
+
167
+ setPointerEventLock: function() {
168
+ this.pointerEventLock = true;
169
+ },
170
+ clearPointerEventLock: function() {
171
+ this.pointerEventLock = false;
172
+ },
173
+ setPointerEventLockTimeout: function() {
174
+ var that = this;
175
+
176
+ if(this.pointerTimeout) {
177
+ clearTimeout(this.pointerTimeout);
178
+ }
179
+
180
+ this.setPointerEventLock();
181
+ this.pointerTimeout = setTimeout(function() { that.clearPointerEventLock(); }, this.POINTER_EVENT_TIMEOUT_MS);
182
+ },
183
+
184
+ triggerMouseEvent: function(originalEvent) {
185
+ if(this.lastTouchType == this.MOUSE_POINTER_TYPE) {
186
+ return; //prevent duplicate events
187
+ }
188
+
189
+ this.lastTouchType = this.MOUSE_POINTER_TYPE;
190
+ $j(window).trigger('mouse-detected', originalEvent);
191
+ },
192
+ triggerTouchEvent: function(originalEvent) {
193
+ if(this.lastTouchType == this.TOUCH_POINTER_TYPE) {
194
+ return; //prevent duplicate events
195
+ }
196
+
197
+ this.lastTouchType = this.TOUCH_POINTER_TYPE;
198
+ $j(window).trigger('touch-detected', originalEvent);
199
+ },
200
+
201
+ initEnv: function() {
202
+ if (window.navigator.pointerEnabled) {
203
+ this.standardTouch = true;
204
+ this.touchDetectionEvent = 'pointermove';
205
+ } else if (window.navigator.msPointerEnabled) {
206
+ this.standardTouch = true;
207
+ this.touchDetectionEvent = 'MSPointerMove';
208
+ } else {
209
+ this.touchDetectionEvent = 'touchstart';
210
+ }
211
+ },
212
+
213
+ wirePointerDetection: function() {
214
+ var that = this;
215
+
216
+ if(this.standardTouch) { //standard-based touch events. Wire only one event.
217
+ //detect pointer event
218
+ $j(window).on(this.touchDetectionEvent, function(e) {
219
+ switch(e.originalEvent.pointerType) {
220
+ case that.getPointerEventsInputTypes().MOUSE:
221
+ that.triggerMouseEvent(e);
222
+ break;
223
+ case that.getPointerEventsInputTypes().TOUCH:
224
+ case that.getPointerEventsInputTypes().PEN:
225
+ // intentionally group pen and touch together
226
+ that.triggerTouchEvent(e);
227
+ break;
228
+ }
229
+ });
230
+ } else { //non-standard touch events. Wire touch and mouse competing events.
231
+ //detect first touch
232
+ $j(window).on(this.touchDetectionEvent, function(e) {
233
+ if(that.pointerEventLock) {
234
+ return;
235
+ }
236
+
237
+ that.setPointerEventLockTimeout();
238
+ that.triggerTouchEvent(e);
239
+ });
240
+
241
+ //detect mouse usage
242
+ $j(document).on('mouseover', function(e) {
243
+ if(that.pointerEventLock) {
244
+ return;
245
+ }
246
+
247
+ that.setPointerEventLockTimeout();
248
+ that.triggerMouseEvent(e);
249
+ });
250
+ }
251
+ },
252
+
253
+ init: function() {
254
+ this.initEnv();
255
+ this.wirePointerDetection();
256
+ }
257
+ };
258
+
259
+ /**
260
+ * This class manages the main navigation and supports infinite nested
261
+ * menus which support touch, mouse click, and hover correctly.
262
+ *
263
+ * The following is the expected behavior:
264
+ *
265
+ * - Hover with an actual mouse should expand the menu (at any level of nesting)
266
+ * - Click with an actual mouse will follow the link, regardless of any children
267
+ * - Touch will follow links without children, and toggle submenus of links with children
268
+ *
269
+ * Caveats:
270
+ * - According to Mozilla's documentation (https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Touch_events),
271
+ * Firefox has disabled Apple-style touch events on desktop, so desktop devices using Firefox will not support
272
+ * the desired touch behavior.
273
+ */
274
+ var MenuManager = {
275
+ // These variables are used to detect incorrect touch / mouse event order
276
+ mouseEnterEventObserved: false,
277
+ touchEventOrderIncorrect: false,
278
+ cancelNextTouch: false,
279
+
280
+ /**
281
+ * This class manages touch scroll detection
282
+ */
283
+ TouchScroll: {
284
+ /**
285
+ * Touch which moves the screen vertically more than
286
+ * this many pixels will be considered a scroll.
287
+ */
288
+ TOUCH_SCROLL_THRESHOLD: 20,
289
+
290
+ touchStartPosition: null,
291
+
292
+ /**
293
+ * Note scroll position so that scroll action can be detected later.
294
+ * Should probably be called on touchstart (or similar) event.
295
+ */
296
+ reset: function() {
297
+ this.touchStartPosition = $j(window).scrollTop();
298
+ },
299
+
300
+ /**
301
+ * Determines if touch was actually a scroll. Should probably be checked
302
+ * on touchend (or similar) event.
303
+ * @returns {boolean}
304
+ */
305
+ shouldCancelTouch: function() {
306
+ if(this.touchStartPosition == null) {
307
+ return false;
308
+ }
309
+
310
+ var scroll = $j(window).scrollTop() - this.touchStartPosition;
311
+ return Math.abs(scroll) > this.TOUCH_SCROLL_THRESHOLD;
312
+ }
313
+ },
314
+
315
+ /**
316
+ * Determines if small screen behavior should be used.
317
+ *
318
+ * @returns {boolean}
319
+ */
320
+ useSmallScreenBehavior: function() {
321
+ return Modernizr.mq("screen and (max-width:" + bp.medium + "px)");
322
+ },
323
+
324
+ /**
325
+ * Toggles a given menu item's visibility.
326
+ * On large screens, also closes sibling and children of sibling menus.
327
+ *
328
+ * @param target
329
+ */
330
+ toggleMenuVisibility: function(target) {
331
+ var link = $j(target);
332
+ var li = link.closest('li');
333
+
334
+ if(!this.useSmallScreenBehavior()) {
335
+ // remove menu-active from siblings and children of siblings
336
+ li.siblings()
337
+ .removeClass('menu-active')
338
+ .find('li')
339
+ .removeClass('menu-active');
340
+ //remove menu-active from children
341
+ li.find('li.menu-active').removeClass('menu-active');
342
+ }
343
+
344
+ //toggle current item's active state
345
+ li.toggleClass('menu-active');
346
+ },
347
+
348
+ // --------------------------------------------
349
+ // Initialization methods
350
+ //
351
+
352
+ /**
353
+ * Initialize MenuManager and wire all required events.
354
+ * Should only be called once.
355
+ *
356
+ */
357
+ init: function() {
358
+ this.wirePointerEvents();
359
+ },
360
+
361
+ /**
362
+ * This method observes an absurd number of events
363
+ * depending on the capabilities of the current browser
364
+ * to implement expected header navigation functionality.
365
+ *
366
+ * The goal is to separate interactions into four buckets:
367
+ * - pointer enter using an actual mouse
368
+ * - pointer leave using an actual mouse
369
+ * - pointer down using an actual mouse
370
+ * - pointer down using touch
371
+ *
372
+ * Browsers supporting PointerEvent events will use these
373
+ * to differentiate pointer types.
374
+ *
375
+ * Browsers supporting Apple-style will use those events
376
+ * along with mouseenter / mouseleave to emulate pointer events.
377
+ */
378
+ wirePointerEvents: function() {
379
+ var that = this;
380
+ var pointerTarget = $j('#nav a.has-children');
381
+ var hoverTarget = $j('#nav li');
382
+
383
+ if(PointerManager.getPointerEventsSupported()) {
384
+ // pointer events supported, so observe those type of events
385
+
386
+ var enterEvent = window.navigator.pointerEnabled ? 'pointerenter' : 'mouseenter';
387
+ var leaveEvent = window.navigator.pointerEnabled ? 'pointerleave' : 'mouseleave';
388
+ var fullPointerSupport = window.navigator.pointerEnabled;
389
+
390
+ hoverTarget.on(enterEvent, function(e) {
391
+ if(e.originalEvent.pointerType === undefined // Browsers with partial PointerEvent support don't provide pointer type
392
+ || e.originalEvent.pointerType == PointerManager.getPointerEventsInputTypes().MOUSE) {
393
+
394
+ if(fullPointerSupport) {
395
+ that.mouseEnterAction(e, this);
396
+ } else {
397
+ that.PartialPointerEventsSupport.mouseEnterAction(e, this);
398
+ }
399
+ }
400
+ }).on(leaveEvent, function(e) {
401
+ if(e.originalEvent.pointerType === undefined // Browsers with partial PointerEvent support don't provide pointer type
402
+ || e.originalEvent.pointerType == PointerManager.getPointerEventsInputTypes().MOUSE) {
403
+
404
+ if(fullPointerSupport) {
405
+ that.mouseLeaveAction(e, this);
406
+ } else {
407
+ that.PartialPointerEventsSupport.mouseLeaveAction(e, this);
408
+ }
409
+ }
410
+ });
411
+
412
+ if(!fullPointerSupport) {
413
+ //click event doesn't have pointer type on it.
414
+ //observe MSPointerDown to set pointer type for click to find later
415
+
416
+ pointerTarget.on('MSPointerDown', function(e) {
417
+ $j(this).data('pointer-type', e.originalEvent.pointerType);
418
+ });
419
+ }
420
+
421
+ pointerTarget.on('click', function(e) {
422
+ var pointerType = fullPointerSupport ? e.originalEvent.pointerType : $j(this).data('pointer-type');
423
+
424
+ if(pointerType === undefined || pointerType == PointerManager.getPointerEventsInputTypes().MOUSE) {
425
+ that.mouseClickAction(e, this);
426
+ } else {
427
+ if(fullPointerSupport) {
428
+ that.touchAction(e, this);
429
+ } else {
430
+ that.PartialPointerEventsSupport.touchAction(e, this);
431
+ }
432
+ }
433
+
434
+ $j(this).removeData('pointer-type'); // clear pointer type hint from target, if any
435
+ });
436
+ } else {
437
+ //pointer events not supported, use Apple-style events to simulate
438
+
439
+ hoverTarget.on('mouseenter', function(e) {
440
+ // Touch events should cancel this event if a touch pointer is used.
441
+ // Record that this method has fired so that erroneous following
442
+ // touch events (if any) can respond accordingly.
443
+ that.mouseEnterEventObserved = true;
444
+ that.cancelNextTouch = true;
445
+
446
+ that.mouseEnterAction(e, this);
447
+ }).on('mouseleave', function(e) {
448
+ that.mouseLeaveAction(e, this);
449
+ });
450
+
451
+ $j(window).on('touchstart', function(e) {
452
+ if(that.mouseEnterEventObserved) {
453
+ // If mouse enter observed before touch, then device touch
454
+ // event order is incorrect.
455
+ that.touchEventOrderIncorrect = true;
456
+ that.mouseEnterEventObserved = false; // Reset test
457
+ }
458
+
459
+ // Reset TouchScroll in order to detect scroll later.
460
+ that.TouchScroll.reset();
461
+ });
462
+
463
+ pointerTarget.on('touchend', function(e) {
464
+ $j(this).data('was-touch', true); // Note that element was invoked by touch pointer
465
+
466
+ e.preventDefault(); // Prevent mouse compatibility events from firing where possible
467
+
468
+ if(that.TouchScroll.shouldCancelTouch()) {
469
+ return; // Touch was a scroll -- don't do anything else
470
+ }
471
+
472
+ if(that.touchEventOrderIncorrect) {
473
+ that.PartialTouchEventsSupport.touchAction(e, this);
474
+ } else {
475
+ that.touchAction(e, this);
476
+ }
477
+ }).on('click', function(e) {
478
+ if($j(this).data('was-touch')) { // Event invoked after touch
479
+ e.preventDefault(); // Prevent following link
480
+ return; // Prevent other behavior
481
+ }
482
+
483
+ that.mouseClickAction(e, this);
484
+ });
485
+ }
486
+ },
487
+
488
+ // --------------------------------------------
489
+ // Behavior "buckets"
490
+ //
491
+
492
+ /**
493
+ * Browsers with incomplete PointerEvent support (such as IE 10)
494
+ * require special event management. This collection of methods
495
+ * accommodate such browsers.
496
+ */
497
+ PartialPointerEventsSupport: {
498
+ /**
499
+ * Without proper pointerenter / pointerleave / click pointerType support,
500
+ * we have to use mouseenter events. These end up triggering
501
+ * lots of mouseleave events that can be misleading.
502
+ *
503
+ * Each touch mouseenter and click event that ends up triggering
504
+ * an undesired mouseleave increments this lock variable.
505
+ *
506
+ * Mouseleave events are cancelled if this variable is > 0,
507
+ * and then the variable is decremented regardless.
508
+ */
509
+ mouseleaveLock: 0,
510
+
511
+ /**
512
+ * Handles mouse enter behavior, but if using touch,
513
+ * toggle menus in the absence of full PointerEvent support.
514
+ *
515
+ * @param event
516
+ * @param target
517
+ */
518
+ mouseEnterAction: function(event, target) {
519
+ if(MenuManager.useSmallScreenBehavior()) {
520
+ // fall back to normal method behavior
521
+ MenuManager.mouseEnterAction(event, target);
522
+ return;
523
+ }
524
+
525
+ event.stopPropagation();
526
+
527
+ var jtarget = $j(target);
528
+ if(!jtarget.hasClass('level0')) {
529
+ this.mouseleaveLock = jtarget.parents('li').length + 1;
530
+ }
531
+
532
+ MenuManager.toggleMenuVisibility(target);
533
+ },
534
+
535
+ /**
536
+ * Handles mouse leave behaivor, but obeys the mouseleaveLock
537
+ * to allow undesired mouseleave events to be cancelled.
538
+ *
539
+ * @param event
540
+ * @param target
541
+ */
542
+ mouseLeaveAction: function(event, target) {
543
+ if(MenuManager.useSmallScreenBehavior()) {
544
+ // fall back to normal method behavior
545
+ MenuManager.mouseLeaveAction(event, target);
546
+ return;
547
+ }
548
+
549
+ if(this.mouseleaveLock > 0) {
550
+ this.mouseleaveLock--;
551
+ return; // suppress duplicate mouseleave event after touch
552
+ }
553
+
554
+ $j(target).removeClass('menu-active'); //hide all menus
555
+ },
556
+
557
+ /**
558
+ * Does no work on its own, but increments mouseleaveLock
559
+ * to prevent following undesireable mouseleave events.
560
+ *
561
+ * @param event
562
+ * @param target
563
+ */
564
+ touchAction: function(event, target) {
565
+ if(MenuManager.useSmallScreenBehavior()) {
566
+ // fall back to normal method behavior
567
+ MenuManager.touchAction(event, target);
568
+ return;
569
+ }
570
+ event.preventDefault(); // prevent following link
571
+ this.mouseleaveLock++;
572
+ }
573
+ },
574
+
575
+ /**
576
+ * Browsers with incomplete Apple-style touch event support
577
+ * (such as the legacy Android browser) sometimes fire
578
+ * touch events out of order. In particular, mouseenter may
579
+ * fire before the touch events. This collection of methods
580
+ * accommodate such browsers.
581
+ */
582
+ PartialTouchEventsSupport: {
583
+ /**
584
+ * Toggles visibility of menu, unless suppressed by previous
585
+ * out of order mouseenter event.
586
+ *
587
+ * @param event
588
+ * @param target
589
+ */
590
+ touchAction: function(event, target) {
591
+ if(MenuManager.cancelNextTouch) {
592
+ // Mouseenter has already manipulated the menu.
593
+ // Suppress this undesired touch event.
594
+ MenuManager.cancelNextTouch = false;
595
+ return;
596
+ }
597
+
598
+ MenuManager.toggleMenuVisibility(target);
599
+ }
600
+ },
601
+
602
+ /**
603
+ * On large screens, show menu.
604
+ * On small screens, do nothing.
605
+ *
606
+ * @param event
607
+ * @param target
608
+ */
609
+ mouseEnterAction: function(event, target) {
610
+ if(this.useSmallScreenBehavior()) {
611
+ return; // don't do mouse enter functionality on smaller screens
612
+ }
613
+
614
+ $j(target).addClass('menu-active'); //show current menu
615
+ },
616
+
617
+ /**
618
+ * On large screens, hide menu.
619
+ * On small screens, do nothing.
620
+ *
621
+ * @param event
622
+ * @param target
623
+ */
624
+ mouseLeaveAction: function(event, target) {
625
+ if(this.useSmallScreenBehavior()) {
626
+ return; // don't do mouse leave functionality on smaller screens
627
+ }
628
+
629
+ $j(target).removeClass('menu-active'); //hide all menus
630
+ },
631
+
632
+ /**
633
+ * On large screens, don't interfere so that browser will follow link.
634
+ * On small screens, toggle menu visibility.
635
+ *
636
+ * @param event
637
+ * @param target
638
+ */
639
+ mouseClickAction: function(event, target) {
640
+ if(this.useSmallScreenBehavior()) {
641
+ event.preventDefault(); //don't follow link
642
+ this.toggleMenuVisibility(target); //instead, toggle visibility
643
+ }
644
+ },
645
+
646
+ /**
647
+ * Toggle menu visibility, and prevent event default to avoid
648
+ * undesired, duplicate, synthetic mouse events.
649
+ *
650
+ * @param event
651
+ * @param target
652
+ */
653
+ touchAction: function(event, target) {
654
+ this.toggleMenuVisibility(target);
655
+
656
+ event.preventDefault();
657
+ }
658
+ };
659
+
660
+ // ==============================================
661
+ // jQuery Init
662
+ // ==============================================
663
+
664
+ // Use $j(document).ready() because Magento executes Prototype inline
665
+ $j(document).ready(function () {
666
+
667
+ // ==============================================
668
+ // Shared Vars
669
+ // ==============================================
670
+
671
+ // Document
672
+ var w = $j(window);
673
+ var d = $j(document);
674
+ var body = $j('body');
675
+
676
+ Modernizr.addTest('ios', function () {
677
+ return navigator.userAgent.match(/(iPad|iPhone|iPod)/g);
678
+ });
679
+
680
+ //initialize pointer abstraction manager
681
+ PointerManager.init();
682
+
683
+ /* Wishlist Toggle Class */
684
+
685
+ $j(".change").click(function (e) {
686
+ $j( this ).toggleClass('active');
687
+ e.stopPropagation()
688
+ });
689
+
690
+ $j(document).click(function (e) {
691
+ if (! $j(e.target).hasClass('.change')) $j(".change").removeClass('active');
692
+ });
693
+
694
+
695
+ // =============================================
696
+ // Skip Links
697
+ // =============================================
698
+
699
+ var skipContents = $j('.skip-content');
700
+ var skipLinks = $j('.skip-link');
701
+
702
+ skipLinks.on('click', function (e) {
703
+ e.preventDefault();
704
+
705
+ var self = $j(this);
706
+ // Use the data-target-element attribute, if it exists. Fall back to href.
707
+ var target = self.attr('data-target-element') ? self.attr('data-target-element') : self.attr('href');
708
+
709
+ // Get target element
710
+ var elem = $j(target);
711
+
712
+ // Check if stub is open
713
+ var isSkipContentOpen = elem.hasClass('skip-active') ? 1 : 0;
714
+
715
+ // Hide all stubs
716
+ skipLinks.removeClass('skip-active');
717
+ skipContents.removeClass('skip-active');
718
+
719
+ // Toggle stubs
720
+ if (isSkipContentOpen) {
721
+ self.removeClass('skip-active');
722
+ } else {
723
+ self.addClass('skip-active');
724
+ elem.addClass('skip-active');
725
+ }
726
+ });
727
+
728
+ $j('#header-cart').on('click', '.skip-link-close', function(e) {
729
+ var parent = $j(this).parents('.skip-content');
730
+ var link = parent.siblings('.skip-link');
731
+
732
+ parent.removeClass('skip-active');
733
+ link.removeClass('skip-active');
734
+
735
+ e.preventDefault();
736
+ });
737
+
738
+
739
+ // ==============================================
740
+ // Header Menus
741
+ // ==============================================
742
+
743
+ // initialize menu
744
+ MenuManager.init();
745
+
746
+ // Prevent sub menus from spilling out of the window.
747
+ function preventMenuSpill() {
748
+ var windowWidth = $j(window).width();
749
+ $j('ul.level0').each(function(){
750
+ var ul = $j(this);
751
+ //Show it long enough to get info, then hide it.
752
+ ul.addClass('position-test');
753
+ ul.removeClass('spill');
754
+ var width = ul.outerWidth();
755
+ var offset = ul.offset().left;
756
+ ul.removeClass('position-test');
757
+ //Add the spill class if it will spill off the page.
758
+ if ((offset + width) > windowWidth) {
759
+ ul.addClass('spill');
760
+ }
761
+ });
762
+ }
763
+ preventMenuSpill();
764
+ $j(window).on('delayed-resize', preventMenuSpill);
765
+
766
+
767
+ // ==============================================
768
+ // Language Switcher
769
+ // ==============================================
770
+
771
+ // In order to display the language switcher next to the logo, we are moving the content at different viewports,
772
+ // rather than having duplicate markup or changing the design
773
+ enquire.register('(max-width: ' + bp.medium + 'px)', {
774
+ match: function () {
775
+ $j('.page-header-container .store-language-container').prepend($j('.form-language'));
776
+ },
777
+ unmatch: function () {
778
+ $j('.header-language-container .store-language-container').prepend($j('.form-language'));
779
+ }
780
+ });
781
+
782
+ // ==============================================
783
+ // Enquire JS
784
+ // ==============================================
785
+
786
+ enquire.register('screen and (min-width: ' + (bp.medium + 1) + 'px)', {
787
+ match: function () {
788
+ $j('.menu-active').removeClass('menu-active');
789
+ $j('.sub-menu-active').removeClass('sub-menu-active');
790
+ $j('.skip-active').removeClass('skip-active');
791
+ },
792
+ unmatch: function () {
793
+ $j('.menu-active').removeClass('menu-active');
794
+ $j('.sub-menu-active').removeClass('sub-menu-active');
795
+ $j('.skip-active').removeClass('skip-active');
796
+ }
797
+ });
798
+
799
+ // ==============================================
800
+ // UI Pattern - Media Switcher
801
+ // ==============================================
802
+
803
+ // Used to swap primary product photo from thumbnails.
804
+
805
+ var mediaListLinks = $j('.media-list').find('a');
806
+ var mediaPrimaryImage = $j('.primary-image').find('img');
807
+
808
+ if (mediaListLinks.length) {
809
+ mediaListLinks.on('click', function (e) {
810
+ e.preventDefault();
811
+
812
+ var self = $j(this);
813
+
814
+ mediaPrimaryImage.attr('src', self.attr('href'));
815
+ });
816
+ }
817
+
818
+ // ==============================================
819
+ // UI Pattern - ToggleSingle
820
+ // ==============================================
821
+
822
+ // Use this plugin to toggle the visibility of content based on a toggle link/element.
823
+ // This pattern differs from the accordion functionality in the Toggle pattern in that each toggle group acts
824
+ // independently of the others. It is named so as not to be confused with the Toggle pattern below
825
+ //
826
+ // This plugin requires a specific markup structure. The plugin expects a set of elements that it
827
+ // will use as the toggle link. It then hides all immediately following siblings and toggles the sibling's
828
+ // visibility when the toggle link is clicked.
829
+ //
830
+ // Example markup:
831
+ // <div class="block">
832
+ // <div class="block-title">Trigger</div>
833
+ // <div class="block-content">Content that should show when </div>
834
+ // </div>
835
+ //
836
+ // JS: jQuery('.block-title').toggleSingle();
837
+ //
838
+ // Options:
839
+ // destruct: defaults to false, but if true, the plugin will remove itself, display content, and remove event handlers
840
+
841
+
842
+ jQuery.fn.toggleSingle = function (options) {
843
+
844
+ // passing destruct: true allows
845
+ var settings = $j.extend({
846
+ destruct: false
847
+ }, options);
848
+
849
+ return this.each(function () {
850
+ if (!settings.destruct) {
851
+ $j(this).on('click', function () {
852
+ $j(this)
853
+ .toggleClass('active')
854
+ .next()
855
+ .toggleClass('no-display');
856
+ });
857
+ // Hide the content
858
+ $j(this).next().addClass('no-display');
859
+ } else {
860
+ // Remove event handler so that the toggle link can no longer be used
861
+ $j(this).off('click');
862
+ // Remove all classes that were added by this plugin
863
+ $j(this)
864
+ .removeClass('active')
865
+ .next()
866
+ .removeClass('no-display');
867
+ }
868
+
869
+ });
870
+ }
871
+
872
+ // ==============================================
873
+ // UI Pattern - Toggle Content (tabs and accordions in one setup)
874
+ // ==============================================
875
+
876
+ $j('.toggle-content').each(function () {
877
+ var wrapper = jQuery(this);
878
+
879
+ var hasTabs = wrapper.hasClass('tabs');
880
+ var hasAccordion = wrapper.hasClass('accordion');
881
+ var startOpen = wrapper.hasClass('open');
882
+
883
+ var dl = wrapper.children('dl:first');
884
+ var dts = dl.children('dt');
885
+ var panes = dl.children('dd');
886
+ var groups = new Array(dts, panes);
887
+
888
+ //Create a ul for tabs if necessary.
889
+ if (hasTabs) {
890
+ var ul = jQuery('<ul class="toggle-tabs"></ul>');
891
+ dts.each(function () {
892
+ var dt = jQuery(this);
893
+ var li = jQuery('<li></li>');
894
+ li.html(dt.html());
895
+ ul.append(li);
896
+ });
897
+ ul.insertBefore(dl);
898
+ var lis = ul.children();
899
+ groups.push(lis);
900
+ }
901
+
902
+ //Add "last" classes.
903
+ var i;
904
+ for (i = 0; i < groups.length; i++) {
905
+ groups[i].filter(':last').addClass('last');
906
+ }
907
+
908
+ function toggleClasses(clickedItem, group) {
909
+ var index = group.index(clickedItem);
910
+ var i;
911
+ for (i = 0; i < groups.length; i++) {
912
+ groups[i].removeClass('current');
913
+ groups[i].eq(index).addClass('current');
914
+ }
915
+ }
916
+
917
+ //Toggle on tab (dt) click.
918
+ dts.on('click', function (e) {
919
+ //They clicked the current dt to close it. Restore the wrapper to unclicked state.
920
+ if (jQuery(this).hasClass('current') && wrapper.hasClass('accordion-open')) {
921
+ wrapper.removeClass('accordion-open');
922
+ } else {
923
+ //They're clicking something new. Reflect the explicit user interaction.
924
+ wrapper.addClass('accordion-open');
925
+ }
926
+ toggleClasses(jQuery(this), dts);
927
+ });
928
+
929
+ //Toggle on tab (li) click.
930
+ if (hasTabs) {
931
+ lis.on('click', function (e) {
932
+ toggleClasses(jQuery(this), lis);
933
+ });
934
+ //Open the first tab.
935
+ lis.eq(0).trigger('click');
936
+ }
937
+
938
+ //Open the first accordion if desired.
939
+ if (startOpen) {
940
+ dts.eq(0).trigger('click');
941
+ }
942
+
943
+ });
944
+
945
+
946
+ // ==============================================
947
+ // Layered Navigation Block
948
+ // ==============================================
949
+
950
+ // On product list pages, we want to show the layered nav/category menu immediately above the product list.
951
+ // While it would make more sense to just move the .block-layered-nav block rather than .col-left-first
952
+ // (since other blocks can be inserted into left_first), it creates simpler code to move the entire
953
+ // .col-left-first block, so that is the approach we're taking
954
+ if ($j('.col-left-first > .block').length && $j('.category-products').length) {
955
+ enquire.register('screen and (max-width: ' + bp.medium + 'px)', {
956
+ match: function () {
957
+ $j('.col-left-first').insertBefore($j('.category-products'))
958
+ },
959
+ unmatch: function () {
960
+ // Move layered nav back to left column
961
+ $j('.col-left-first').insertBefore($j('.col-main'))
962
+ }
963
+ });
964
+ }
965
+
966
+ // ==============================================
967
+ // 3 column layout
968
+ // ==============================================
969
+
970
+ // On viewports smaller than 1000px, move the right column into the left column
971
+ if ($j('.main-container.col3-layout').length > 0) {
972
+ enquire.register('screen and (max-width: 1000px)', {
973
+ match: function () {
974
+ var rightColumn = $j('.col-right');
975
+ var colWrapper = $j('.col-wrapper');
976
+
977
+ rightColumn.appendTo(colWrapper);
978
+ },
979
+ unmatch: function () {
980
+ var rightColumn = $j('.col-right');
981
+ var main = $j('.main');
982
+
983
+ rightColumn.appendTo(main);
984
+ }
985
+ });
986
+ }
987
+
988
+
989
+ // ==============================================
990
+ // Block collapsing (on smaller viewports)
991
+ // ==============================================
992
+
993
+ enquire.register('(max-width: ' + bp.medium + 'px)', {
994
+ setup: function () {
995
+ this.toggleElements = $j(
996
+ // This selects the menu on the My Account and CMS pages
997
+ '.col-left-first .block:not(.block-layered-nav) .block-title, ' +
998
+ '.col-left-first .block-layered-nav .block-subtitle--filter, ' +
999
+ '.sidebar:not(.col-left-first) .block .block-title'
1000
+ );
1001
+ },
1002
+ match: function () {
1003
+ this.toggleElements.toggleSingle();
1004
+ },
1005
+ unmatch: function () {
1006
+ this.toggleElements.toggleSingle({destruct: true});
1007
+ }
1008
+ });
1009
+
1010
+
1011
+ // ==============================================
1012
+ // OPC - Progress Block
1013
+ // ==============================================
1014
+
1015
+ if ($j('body.checkout-onepage-index').length) {
1016
+ enquire.register('(max-width: ' + bp.large + 'px)', {
1017
+ match: function () {
1018
+ $j('#checkout-step-review').prepend($j('#checkout-progress-wrapper'));
1019
+ },
1020
+ unmatch: function () {
1021
+ $j('.col-right').prepend($j('#checkout-progress-wrapper'));
1022
+ }
1023
+ });
1024
+ }
1025
+
1026
+
1027
+ // ==============================================
1028
+ // Checkout Cart - events
1029
+ // ==============================================
1030
+
1031
+ if ($j('body.checkout-cart-index').length) {
1032
+ $j('input[name^="cart"]').focus(function () {
1033
+ $j(this).siblings('button').fadeIn();
1034
+ });
1035
+ }
1036
+
1037
+
1038
+ // ==============================================
1039
+ // Gift Registry Styles
1040
+ // ==============================================
1041
+
1042
+ if ($j('.a-left').length) {
1043
+ enquire.register('(max-width: ' + bp.large + 'px)', {
1044
+ match: function () {
1045
+ $j('.gift-info').each(function() {
1046
+ $j(this).next('td').children('textarea').appendTo(this).children();
1047
+ })
1048
+ },
1049
+ unmatch: function () {
1050
+ $j('.left-note').each(function() {
1051
+ $j(this).prev('td').children('textarea').appendTo(this).children();
1052
+ })
1053
+ }
1054
+ });
1055
+ }
1056
+
1057
+
1058
+ // ==============================================
1059
+ // Product Listing - Align action buttons/links
1060
+ // ==============================================
1061
+
1062
+ // Since the number of columns per grid will vary based on the viewport size, the only way to align the action
1063
+ // buttons/links is via JS
1064
+
1065
+ if ($j('.products-grid').length) {
1066
+
1067
+ var alignProductGridActions = function () {
1068
+ // Loop through each product grid on the page
1069
+ $j('.products-grid').each(function(){
1070
+ var gridRows = []; // This will store an array per row
1071
+ var tempRow = [];
1072
+ productGridElements = $j(this).children('li');
1073
+ productGridElements.each(function (index) {
1074
+ // The JS ought to be agnostic of the specific CSS breakpoints, so we are dynamically checking to find
1075
+ // each row by grouping all cells (eg, li elements) up until we find an element that is cleared.
1076
+ // We are ignoring the first cell since it will always be cleared.
1077
+ if ($j(this).css('clear') != 'none' && index != 0) {
1078
+ gridRows.push(tempRow); // Add the previous set of rows to the main array
1079
+ tempRow = []; // Reset the array since we're on a new row
1080
+ }
1081
+ tempRow.push(this);
1082
+
1083
+ // The last row will not contain any cells that clear that row, so we check to see if this is the last cell
1084
+ // in the grid, and if so, we add its row to the array
1085
+ if (productGridElements.length == index + 1) {
1086
+ gridRows.push(tempRow);
1087
+ }
1088
+ });
1089
+
1090
+ $j.each(gridRows, function () {
1091
+ var tallestProductInfo = 0;
1092
+ $j.each(this, function () {
1093
+ // Since this function is called every time the page is resized, we need to remove the min-height
1094
+ // and bottom-padding so each cell can return to its natural size before being measured.
1095
+ $j(this).find('.product-info').css({
1096
+ 'min-height': '',
1097
+ 'padding-bottom': ''
1098
+ });
1099
+
1100
+ // We are checking the height of .product-info (rather than the entire li), because the images
1101
+ // will not be loaded when this JS is run.
1102
+ var productInfoHeight = $j(this).find('.product-info').height();
1103
+ // Space above .actions element
1104
+ var actionSpacing = 10;
1105
+ // The height of the absolutely positioned .actions element
1106
+ var actionHeight = $j(this).find('.product-info .actions').height();
1107
+
1108
+ // Add height of two elements. This is necessary since .actions is absolutely positioned and won't
1109
+ // be included in the height of .product-info
1110
+ var totalHeight = productInfoHeight + actionSpacing + actionHeight;
1111
+ if (totalHeight > tallestProductInfo) {
1112
+ tallestProductInfo = totalHeight;
1113
+ }
1114
+
1115
+ // Set the bottom-padding to accommodate the height of the .actions element. Note: if .actions
1116
+ // elements are of varying heights, they will not be aligned.
1117
+ $j(this).find('.product-info').css('padding-bottom', actionHeight + 'px');
1118
+ });
1119
+ // Set the height of all .product-info elements in a row to the tallest height
1120
+ $j.each(this, function () {
1121
+ $j(this).find('.product-info').css('min-height', tallestProductInfo);
1122
+ });
1123
+ });
1124
+ });
1125
+ }
1126
+ alignProductGridActions();
1127
+
1128
+ // Since the height of each cell and the number of columns per page may change when the page is resized, we are
1129
+ // going to run the alignment function each time the page is resized.
1130
+ $j(window).on('delayed-resize', function (e, resizeEvent) {
1131
+ alignProductGridActions();
1132
+ });
1133
+ }
1134
+
1135
+ // ==============================================
1136
+ // Generic, efficient window resize handler
1137
+ // ==============================================
1138
+
1139
+ // Using setTimeout since Web-Kit and some other browsers call the resize function constantly upon window resizing.
1140
+ var resizeTimer;
1141
+ $j(window).resize(function (e) {
1142
+ clearTimeout(resizeTimer);
1143
+ resizeTimer = setTimeout(function () {
1144
+ $j(window).trigger('delayed-resize', e);
1145
+ }, 250);
1146
+ });
1147
+ });
1148
+
1149
+ // ==============================================
1150
+ // PDP - image zoom - needs to be available outside document.ready scope
1151
+ // ==============================================
1152
+
1153
+ var ProductMediaManager = {
1154
+ IMAGE_ZOOM_THRESHOLD: 20,
1155
+ imageWrapper: null,
1156
+
1157
+ destroyZoom: function() {
1158
+ $j('.zoomContainer').remove();
1159
+ $j('.product-image-gallery .gallery-image').removeData('elevateZoom');
1160
+ },
1161
+
1162
+ createZoom: function(image) {
1163
+ // Destroy since zoom shouldn't be enabled under certain conditions
1164
+ ProductMediaManager.destroyZoom();
1165
+
1166
+ if(
1167
+ // Don't use zoom on devices where touch has been used
1168
+ PointerManager.getPointer() == PointerManager.TOUCH_POINTER_TYPE
1169
+ // Don't use zoom when screen is small, or else zoom window shows outside body
1170
+ || Modernizr.mq("screen and (max-width:" + bp.medium + "px)")
1171
+ ) {
1172
+ return; // zoom not enabled
1173
+ }
1174
+
1175
+ if(image.length <= 0) { //no image found
1176
+ return;
1177
+ }
1178
+
1179
+ if(image[0].naturalWidth && image[0].naturalHeight) {
1180
+ var widthDiff = image[0].naturalWidth - image.width() - ProductMediaManager.IMAGE_ZOOM_THRESHOLD;
1181
+ var heightDiff = image[0].naturalHeight - image.height() - ProductMediaManager.IMAGE_ZOOM_THRESHOLD;
1182
+
1183
+ if(widthDiff < 0 && heightDiff < 0) {
1184
+ //image not big enough
1185
+
1186
+ image.parents('.product-image').removeClass('zoom-available');
1187
+
1188
+ return;
1189
+ } else {
1190
+ image.parents('.product-image').addClass('zoom-available');
1191
+ }
1192
+ }
1193
+
1194
+ //image.elevateZoom();
1195
+ if (jQuery('.review-product-list').length == 0) {
1196
+ image.elevateZoom();
1197
+ }
1198
+ },
1199
+
1200
+ swapImage: function(targetImage) {
1201
+ targetImage = $j(targetImage);
1202
+ targetImage.addClass('gallery-image');
1203
+
1204
+ ProductMediaManager.destroyZoom();
1205
+
1206
+ var imageGallery = $j('.product-image-gallery');
1207
+
1208
+ if(targetImage[0].complete) { //image already loaded -- swap immediately
1209
+
1210
+ imageGallery.find('.gallery-image').removeClass('visible');
1211
+
1212
+ //move target image to correct place, in case it's necessary
1213
+ imageGallery.append(targetImage);
1214
+
1215
+ //reveal new image
1216
+ targetImage.addClass('visible');
1217
+
1218
+ //wire zoom on new image
1219
+ ProductMediaManager.createZoom(targetImage);
1220
+
1221
+ } else { //need to wait for image to load
1222
+
1223
+ //add spinner
1224
+ imageGallery.addClass('loading');
1225
+
1226
+ //move target image to correct place, in case it's necessary
1227
+ imageGallery.append(targetImage);
1228
+
1229
+ //wait until image is loaded
1230
+ imagesLoaded(targetImage, function() {
1231
+ //remove spinner
1232
+ imageGallery.removeClass('loading');
1233
+
1234
+ //hide old image
1235
+ imageGallery.find('.gallery-image').removeClass('visible');
1236
+
1237
+ //reveal new image
1238
+ targetImage.addClass('visible');
1239
+
1240
+ //wire zoom on new image
1241
+ ProductMediaManager.createZoom(targetImage);
1242
+ });
1243
+
1244
+ }
1245
+ },
1246
+
1247
+ wireThumbnails: function() {
1248
+ //trigger image change event on thumbnail click
1249
+ $j('.product-image-thumbs .thumb-link').click(function(e) {
1250
+ e.preventDefault();
1251
+ var jlink = $j(this);
1252
+ var target = $j('#image-' + jlink.data('image-index'));
1253
+
1254
+ ProductMediaManager.swapImage(target);
1255
+ });
1256
+ },
1257
+
1258
+ initZoom: function() {
1259
+ ProductMediaManager.createZoom($j(".gallery-image.visible")); //set zoom on first image
1260
+ },
1261
+
1262
+ init: function() {
1263
+ ProductMediaManager.imageWrapper = $j('.product-img-box');
1264
+
1265
+ // Re-initialize zoom on viewport size change since resizing causes problems with zoom and since smaller
1266
+ // viewport sizes shouldn't have zoom
1267
+ $j(window).on('delayed-resize', function(e, resizeEvent) {
1268
+ ProductMediaManager.initZoom();
1269
+ });
1270
+
1271
+ ProductMediaManager.initZoom();
1272
+
1273
+ ProductMediaManager.wireThumbnails();
1274
+
1275
+ $j(document).trigger('product-media-loaded', ProductMediaManager);
1276
+ }
1277
+ };
1278
+
1279
+ $j(document).ready(function() {
1280
+ ProductMediaManager.init();
1281
+ });
skin/frontend/rwd/default/js/sfcaptcha/browser.js ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Limit scope pollution from any deprecated API
2
+ (function() {
3
+
4
+ var matched, browser;
5
+
6
+ // Use of jQuery.browser is frowned upon.
7
+ // More details: http://api.jquery.com/jQuery.browser
8
+ // jQuery.uaMatch maintained for back-compat
9
+ jQuery.uaMatch = function( ua ) {
10
+ ua = ua.toLowerCase();
11
+
12
+ var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
13
+ /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
14
+ /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
15
+ /(msie) ([\w.]+)/.exec( ua ) ||
16
+ ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
17
+ [];
18
+
19
+ return {
20
+ browser: match[ 1 ] || "",
21
+ version: match[ 2 ] || "0"
22
+ };
23
+ };
24
+
25
+ matched = jQuery.uaMatch( navigator.userAgent );
26
+ browser = {};
27
+
28
+ if ( matched.browser ) {
29
+ browser[ matched.browser ] = true;
30
+ browser.version = matched.version;
31
+ }
32
+
33
+ // Chrome is Webkit, but Webkit is also Safari.
34
+ if ( browser.chrome ) {
35
+ browser.webkit = true;
36
+ } else if ( browser.webkit ) {
37
+ browser.safari = true;
38
+ }
39
+
40
+ jQuery.browser = browser;
41
+
42
+ jQuery.sub = function() {
43
+ function jQuerySub( selector, context ) {
44
+ return new jQuerySub.fn.init( selector, context );
45
+ }
46
+ jQuery.extend( true, jQuerySub, this );
47
+ jQuerySub.superclass = this;
48
+ jQuerySub.fn = jQuerySub.prototype = this();
49
+ jQuerySub.fn.constructor = jQuerySub;
50
+ jQuerySub.sub = this.sub;
51
+ jQuerySub.fn.init = function init( selector, context ) {
52
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
53
+ context = jQuerySub( context );
54
+ }
55
+
56
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
57
+ };
58
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
59
+ var rootjQuerySub = jQuerySub(document);
60
+ return jQuerySub;
61
+ };
62
+
63
+ })();
skin/frontend/rwd/default/js/sfcaptcha/jquery-ui.js ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.8.23 - 2012-08-15
2
+ * https://github.com/jquery/jquery-ui
3
+ * Includes: jquery.ui.core.js
4
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
5
+ (function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.23",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a("<a>").outerWidth(1).jquery||a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.curCSS||(a.curCSS=a.css),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;return b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
6
+ * https://github.com/jquery/jquery-ui
7
+ * Includes: jquery.ui.widget.js
8
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
9
+ (function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
10
+ * https://github.com/jquery/jquery-ui
11
+ * Includes: jquery.ui.mouse.js
12
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
13
+ (function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(b){if(c)return;this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted)return b.preventDefault(),!0}return!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0,!0},_mouseMove:function(b){return!a.browser.msie||document.documentMode>=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
14
+ * https://github.com/jquery/jquery-ui
15
+ * Includes: jquery.ui.position.js
16
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
17
+ (function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),a.curCSS||(a.curCSS=a.css),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
18
+ * https://github.com/jquery/jquery-ui
19
+ * Includes: jquery.ui.draggable.js
20
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
21
+ (function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(b),this.handle?(c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);var d=this.element[0],e=!1;while(d&&(d=d.parentNode))d==document&&(e=!0);if(!e&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",b)!==!1&&f._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;return a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){return d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.23"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!e.length)return;var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
22
+ * https://github.com/jquery/jquery-ui
23
+ * Includes: jquery.ui.droppable.js
24
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
25
+ (function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);return this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable"),this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance))return e=!0,!1}),e?!1:this.accept.call(this.element[0],d.currentItem||d.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d)),this.element):!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.23"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();g:for(var h=0;h<d.length;h++){if(d[h].options.disabled||b&&!d[h].accept.call(d[h].element[0],b.currentItem||b.element))continue;for(var i=0;i<f.length;i++)if(f[i]==d[h].element[0]){d[h].proportions.height=0;continue g}d[h].visible=d[h].element.css("display")!="none";if(!d[h].visible)continue;e=="mousedown"&&d[h]._activate.call(d[h],c),d[h].offset=d[h].element.offset(),d[h].proportions={width:d[h].element[0].offsetWidth,height:d[h].element[0].offsetHeight}}},drop:function(b,c){var d=!1;return a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c))}),d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);;
skin/frontend/rwd/default/js/sfcaptcha/jquery.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! jQuery v1.8.2 jquery.com | jquery.org/license */
2
+ (function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bY(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bW.length;while(e--){b=bW[e]+c;if(b in a)return b}return d}function bZ(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function b$(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bZ(c)&&(e[f]=p._data(c,"olddisplay",cc(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b_(a,b,c){var d=bP.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function ca(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bV[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bV[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bV[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bV[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bV[e]+"Width"))||0));return f}function cb(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0||d==null){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bQ.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+ca(a,b,c||(f?"border":"content"),e)+"px"}function cc(a){if(bS[a])return bS[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cA(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cv;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cA(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cA(a,c,d,e,"*",g)),h}function cB(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cC(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cD(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cL(){try{return new a.XMLHttpRequest}catch(b){}}function cM(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cU(){return setTimeout(function(){cN=b},0),cN=p.now()}function cV(a,b){p.each(b,function(b,c){var d=(cT[b]||[]).concat(cT["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cW(a,b,c){var d,e=0,f=0,g=cS.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cN||cU(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cX(k,j.opts.specialEasing);for(;e<g;e++){d=cS[e].call(j,a,k,j.opts);if(d)return d}return cV(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cX(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cY(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bZ(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cc(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cP.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cZ(a,b,c,d,e){return new cZ.prototype.init(a,b,c,d,e)}function c$(a,b){var c,d={height:a},e=0;b=b?1:0;for(;e<4;e+=2-b)c=bV[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function da(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,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(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.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):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o&&!o.call(" ")?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":(a+"").replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.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=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete")setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){var e=p.type(c);e==="function"&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&e!=="string"&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")||(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",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){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)d=p._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);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{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._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)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.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,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.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,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.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):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.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;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=b+""}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&p.expr.match.needsContext.test(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=k.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click"))for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){h={},j=[];for(d=0;d<q;d++)l=o[d],m=l.selector,h[m]===b&&(h[m]=l.needsContext?p(m,this).index(f)>=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){i=u[d],c.currentTarget=i.elem;for(e=0;e<i.matches.length&&!c.isImmediatePropagationStopped();e++){l=i.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,g=((p.event.special[l.origType]||{}).handle||l.handler).apply(i.elem,r),g!==b&&(c.result=g,g===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),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){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(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(){return p.event.remove(this,"._change"),!V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);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=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.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){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.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){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),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(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),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)}}),p.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){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(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 bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h<i;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),j&&b.push(h);return g}function bl(a,b,c,d,e,f){return d&&!d[o]&&(d=bl(d)),e&&!e[o]&&(e=bl(e,f)),z(function(f,g,h,i){if(f&&e)return;var j,k,l,m=[],n=[],o=g.length,p=f||bo(b||"*",h.nodeType?[h]:h,[],f),q=a&&(f||!b)?bk(p,m,a,h,i):p,r=c?e||(f?a:o||d)?[]:g:q;c&&c(q,r,h,i);if(d){l=bk(r,n),d(l,[],h,i),j=l.length;while(j--)if(k=l[j])r[n[j]]=!(q[n[j]]=k)}if(f){j=a&&r.length;while(j--)if(k=r[j])f[m[j]]=!(g[m[j]]=k)}else r=bk(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):w.apply(g,r)})}function bm(a){var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],i=g?1:0,j=bi(function(a){return a===b},h,!0),k=bi(function(a){return y.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i<f;i++)if(c=e.relative[a[i].type])m=[bi(bj(m),c)];else{c=e.filter[a[i].type].apply(null,a[i].matches);if(c[o]){d=++i;for(;d<f;d++)if(e.relative[a[d].type])break;return bl(i>1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i<d&&bm(a.slice(i,d)),d<f&&bm(a=a.slice(d)),d<f&&a.join(""))}m.push(c)}return bj(m)}function bn(a,b){var d=b.length>0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)bc(a,b[e],c,d);return c}function bp(a,b,c,d,f){var g,h,j,k,l,m=bh(a),n=m.length;if(!d&&m.length===1){h=m[0]=m[0].slice(0);if(h.length>2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++)if(this[b]===a)return b;return-1},z=function(a,b){return a[o]=b==null||b,a},A=function(){var a={},b=[];return z(function(c,d){return b.push(c)>e.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="<a name='"+o+"'></a><div name='"+o+"'></div>",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d<b;d+=2)a.push(d);return a}),odd:bf(function(a,b,c){for(var d=1;d<b;d+=2)a.push(d);return a}),lt:bf(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},j=s.compareDocumentPosition?function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return bg(a,b);if(!g)return-1;if(!h)return 1;while(i)e.unshift(i),i=i.parentNode;i=h;while(i)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;j<c&&j<d;j++)if(e[j]!==f[j])return bg(e[j],f[j]);return j===c?bg(a,f[j],-1):bg(e[j],b,1)},[0,0].sort(j),m=!k,bc.uniqueSort=function(a){var b,c=1;k=m,a.sort(j);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a},bc.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},i=bc.compile=function(a,b){var c,d=[],e=[],f=D[o][a];if(!f){b||(b=bh(a)),c=b.length;while(c--)f=bm(b[c]),f[o]?d.push(f):e.push(f);f=D(a,bn(e,d))}return f},r.querySelectorAll&&function(){var a,b=bp,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[":focus"],f=[":active",":focus"],h=s.matchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||s.msMatchesSelector;X(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'/>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={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,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(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){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[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","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cT[c]=cT[c]||[],cT[c].unshift(b)},prefilter:function(a,b){b?cS.unshift(a):cS.push(a)}}),p.Tween=cZ,cZ.prototype={constructor:cZ,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cZ.propHooks[this.prop];return a&&a.get?a.get(this):cZ.propHooks._default.get(this)},run:function(a){var b,c=cZ.propHooks[this.prop];return this.options.duration?this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cZ.propHooks._default.set(this),this}},cZ.prototype.init.prototype=cZ.prototype,cZ.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cZ.propHooks.scrollTop=cZ.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(c$(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bZ).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cW(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cR.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:c$("show"),slideUp:c$("hide"),slideToggle:c$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cZ.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cO&&(cO=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cO),cO=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c_=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j={top:0,left:0},k=this[0],l=k&&k.ownerDocument;if(!l)return;return(d=l.body)===k?p.offset.bodyOffset(k):(c=l.documentElement,p.contains(c,k)?(typeof k.getBoundingClientRect!="undefined"&&(j=k.getBoundingClientRect()),e=da(l),f=c.clientTop||d.clientTop||0,g=c.clientLeft||d.clientLeft||0,h=e.pageYOffset||c.scrollTop,i=e.pageXOffset||c.scrollLeft,{top:j.top+h-f,left:j.left+i-g}):j)},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window);
skin/frontend/rwd/default/js/sfcaptcha/jquery.ui.touch.js ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jQuery.UI.iPad plugin
3
+ * Copyright (c) 2010 Stephen von Takach
4
+ * licensed under MIT.
5
+ * Date: 27/8/2010
6
+ *
7
+ * Project Home:
8
+ * http://code.google.com/p/jquery-ui-for-ipad-and-iphone/
9
+ */
10
+
11
+ $(function() {
12
+ //
13
+ // Extend jQuery feature detection
14
+ //
15
+ $.extend($.support, {
16
+ touch: "ontouchend" in document
17
+ });
18
+
19
+ //
20
+ // Hook up touch events
21
+ //
22
+ if ($.support.touch) {
23
+ var obj = document.getElementsByClassName('QapTcha');
24
+ for(i=0; i<obj.length;i++){
25
+ obj[i].addEventListener("touchstart", iPadTouchHandler, false);
26
+ obj[i].addEventListener("touchmove", iPadTouchHandler, false);
27
+ obj[i].addEventListener("touchend", iPadTouchHandler, false);
28
+ obj[i].addEventListener("touchcancel", iPadTouchHandler, false);
29
+ }}
30
+ });
31
+
32
+
33
+ var lastTap = null; // Holds last tapped element (so we can compare for double tap)
34
+ var tapValid = false; // Are we still in the .6 second window where a double tap can occur
35
+ var tapTimeout = null; // The timeout reference
36
+
37
+ function cancelTap() {
38
+ tapValid = false;
39
+ }
40
+
41
+
42
+ var rightClickPending = false; // Is a right click still feasible
43
+ var rightClickEvent = null; // the original event
44
+ var holdTimeout = null; // timeout reference
45
+ var cancelMouseUp = false; // prevents a click from occuring as we want the context menu
46
+
47
+
48
+ function cancelHold() {
49
+ if (rightClickPending) {
50
+ window.clearTimeout(holdTimeout);
51
+ rightClickPending = false;
52
+ rightClickEvent = null;
53
+ }
54
+ }
55
+
56
+ function startHold(event) {
57
+ if (rightClickPending)
58
+ return;
59
+
60
+ rightClickPending = true; // We could be performing a right click
61
+ rightClickEvent = (event.changedTouches)[0];
62
+ holdTimeout = window.setTimeout("doRightClick();", 800);
63
+ }
64
+
65
+
66
+ function doRightClick() {
67
+ rightClickPending = false;
68
+
69
+ //
70
+ // We need to mouse up (as we were down)
71
+ //
72
+ var first = rightClickEvent,
73
+ simulatedEvent = document.createEvent("MouseEvent");
74
+ simulatedEvent.initMouseEvent("mouseup", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
75
+ false, false, false, false, 0, null);
76
+ first.target.dispatchEvent(simulatedEvent);
77
+
78
+ //
79
+ // emulate a right click
80
+ //
81
+ simulatedEvent = document.createEvent("MouseEvent");
82
+ simulatedEvent.initMouseEvent("mousedown", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
83
+ false, false, false, false, 2, null);
84
+ first.target.dispatchEvent(simulatedEvent);
85
+
86
+ //
87
+ // Show a context menu
88
+ //
89
+ simulatedEvent = document.createEvent("MouseEvent");
90
+ simulatedEvent.initMouseEvent("contextmenu", true, true, window, 1, first.screenX + 50, first.screenY + 5, first.clientX + 50, first.clientY + 5,
91
+ false, false, false, false, 2, null);
92
+ first.target.dispatchEvent(simulatedEvent);
93
+
94
+
95
+ //
96
+ // Note:: I don't mouse up the right click here however feel free to add if required
97
+ //
98
+
99
+
100
+ cancelMouseUp = true;
101
+ rightClickEvent = null; // Release memory
102
+ }
103
+
104
+
105
+ //
106
+ // mouse over event then mouse down
107
+ //
108
+ function iPadTouchStart(event) {
109
+ var touches = event.changedTouches,
110
+ first = touches[0],
111
+ type = "mouseover",
112
+ simulatedEvent = document.createEvent("MouseEvent");
113
+ //
114
+ // Mouse over first - I have live events attached on mouse over
115
+ //
116
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
117
+ false, false, false, false, 0, null);
118
+ first.target.dispatchEvent(simulatedEvent);
119
+
120
+ type = "mousedown";
121
+ simulatedEvent = document.createEvent("MouseEvent");
122
+
123
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
124
+ false, false, false, false, 0, null);
125
+ first.target.dispatchEvent(simulatedEvent);
126
+
127
+
128
+ if (!tapValid) {
129
+ lastTap = first.target;
130
+ tapValid = true;
131
+ tapTimeout = window.setTimeout("cancelTap();", 600);
132
+ startHold(event);
133
+ }
134
+ else {
135
+ window.clearTimeout(tapTimeout);
136
+
137
+ //
138
+ // If a double tap is still a possibility and the elements are the same
139
+ // Then perform a double click
140
+ //
141
+ if (first.target == lastTap) {
142
+ lastTap = null;
143
+ tapValid = false;
144
+
145
+ type = "click";
146
+ simulatedEvent = document.createEvent("MouseEvent");
147
+
148
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
149
+ false, false, false, false, 0/*left*/, null);
150
+ first.target.dispatchEvent(simulatedEvent);
151
+
152
+ type = "dblclick";
153
+ simulatedEvent = document.createEvent("MouseEvent");
154
+
155
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
156
+ false, false, false, false, 0/*left*/, null);
157
+ first.target.dispatchEvent(simulatedEvent);
158
+ }
159
+ else {
160
+ lastTap = first.target;
161
+ tapValid = true;
162
+ tapTimeout = window.setTimeout("cancelTap();", 600);
163
+ startHold(event);
164
+ }
165
+ }
166
+ }
167
+
168
+ function iPadTouchHandler(event) {
169
+ var type = "",
170
+ button = 0; /*left*/
171
+
172
+ if (event.touches.length > 1)
173
+ return;
174
+
175
+ switch (event.type) {
176
+ case "touchstart":
177
+ if ($(event.changedTouches[0].target).is("select")) {
178
+ return;
179
+ }
180
+ iPadTouchStart(event); /*We need to trigger two events here to support one touch drag and drop*/
181
+ event.preventDefault();
182
+ return false;
183
+ break;
184
+
185
+ case "touchmove":
186
+ cancelHold();
187
+ type = "mousemove";
188
+ event.preventDefault();
189
+ break;
190
+
191
+ case "touchend":
192
+ if (cancelMouseUp) {
193
+ cancelMouseUp = false;
194
+ event.preventDefault();
195
+ return false;
196
+ }
197
+ cancelHold();
198
+ type = "mouseup";
199
+ break;
200
+
201
+ default:
202
+ return;
203
+ }
204
+
205
+ var touches = event.changedTouches,
206
+ first = touches[0],
207
+ simulatedEvent = document.createEvent("MouseEvent");
208
+
209
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
210
+ false, false, false, false, button, null);
211
+
212
+ first.target.dispatchEvent(simulatedEvent);
213
+
214
+ if (type == "mouseup" && tapValid && first.target == lastTap) { // This actually emulates the ipads default behaviour (which we prevented)
215
+ simulatedEvent = document.createEvent("MouseEvent"); // This check avoids click being emulated on a double tap
216
+
217
+ simulatedEvent.initMouseEvent("click", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
218
+ false, false, false, false, button, null);
219
+
220
+ first.target.dispatchEvent(simulatedEvent);
221
+ }
222
+ }
223
+
224
+
skin/frontend/rwd/default/js/sfcaptcha/noconflict.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magento
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@magentocommerce.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 Magento to newer
17
+ * versions in the future. If you wish to customize Magento for your
18
+ * needs please refer to http://www.magentocommerce.com for more information.
19
+ *
20
+ * @category design
21
+ * @package rwd_default
22
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+
26
+ // Avoid PrototypeJS conflicts, assign jQuery to $j instead of $
27
+ var $j = jQuery.noConflict();
skin/frontend/rwd/default/js/sfcaptcha/slideshow.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magento
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 Magento to newer
17
+ * versions in the future. If you wish to customize Magento for your
18
+ * needs please refer to http://www.magento.com for more information.
19
+ *
20
+ * @category design
21
+ * @package rwd_default
22
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+
26
+ $j(document).ready(function () {
27
+
28
+ // ==============================================
29
+ // UI Pattern - Slideshow
30
+ // ==============================================
31
+
32
+ $j('.slideshow-container .slideshow')
33
+ .cycle({
34
+ slides: '> li',
35
+ pager: '.slideshow-pager',
36
+ pagerTemplate: '<span class="pager-box"></span>',
37
+ speed: 600,
38
+ pauseOnHover: true,
39
+ swipe: true,
40
+ prev: '.slideshow-prev',
41
+ next: '.slideshow-next',
42
+ fx: 'scrollHorz'
43
+ });
44
+ });