Wmd_Musicplayer - Version 1.0.0

Version Notes

Make a downloadable product from a music album that provides each track as a link. Musicplayer is displayed instead of product image and options, using product images to display with individual tracks(same index) or default product image. Product options/links are converted to playlist. Player plays mp3 / ogg sample files from downloadable link sample url.

Download this release

Release Info

Developer Dominik Wyss
Extension Wmd_Musicplayer
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (43) hide show
  1. app/code/community/Wmd/Musicplayer/Helper/Data.php +116 -0
  2. app/code/community/Wmd/Musicplayer/etc/config.xml +36 -0
  3. app/design/frontend/default/musicplayer/layout/downloadable.xml +245 -0
  4. app/design/frontend/default/musicplayer/template/catalog/product/list.phtml +128 -0
  5. app/design/frontend/default/musicplayer/template/catalog/product/new.phtml +59 -0
  6. app/design/frontend/default/musicplayer/template/catalog/product/view.phtml +155 -0
  7. app/design/frontend/default/musicplayer/template/catalog/product/view/options.phtml +182 -0
  8. app/design/frontend/default/musicplayer/template/catalog/product/view/options/wrapper.phtml +35 -0
  9. app/design/frontend/default/musicplayer/template/downloadable/catalog/product/links.phtml +164 -0
  10. app/etc/modules/WMD_Musicplayer.xml +9 -0
  11. app/locale/en_US/Wmd_Musicplayer.csv +3 -0
  12. js/jquery/jquery-1.6.1.min.js +18 -0
  13. js/jquery/plugin/Instructions.txt +52 -0
  14. js/jquery/plugin/css/style.css +429 -0
  15. js/jquery/plugin/images/album-cover-bg.jpg +0 -0
  16. js/jquery/plugin/images/album-cover-highlight.png +0 -0
  17. js/jquery/plugin/images/buy-bg.png +0 -0
  18. js/jquery/plugin/images/dark_matter.png +0 -0
  19. js/jquery/plugin/images/description-more.png +0 -0
  20. js/jquery/plugin/images/player-bg.png +0 -0
  21. js/jquery/plugin/images/player-elapsed.png +0 -0
  22. js/jquery/plugin/images/player-next-hover.png +0 -0
  23. js/jquery/plugin/images/player-next.png +0 -0
  24. js/jquery/plugin/images/player-pause-hover.png +0 -0
  25. js/jquery/plugin/images/player-pause.png +0 -0
  26. js/jquery/plugin/images/player-play-hover.png +0 -0
  27. js/jquery/plugin/images/player-play.png +0 -0
  28. js/jquery/plugin/images/player-previous-hover.png +0 -0
  29. js/jquery/plugin/images/player-previous.png +0 -0
  30. js/jquery/plugin/images/player-progress.png +0 -0
  31. js/jquery/plugin/images/rating-bar-on.png +0 -0
  32. js/jquery/plugin/images/rating-bar.png +0 -0
  33. js/jquery/plugin/images/rating-off.png +0 -0
  34. js/jquery/plugin/images/rating-on.png +0 -0
  35. js/jquery/plugin/images/tracklist-bg.png +0 -0
  36. js/jquery/plugin/images/tracklist-item-bg.png +0 -0
  37. js/jquery/plugin/images/tracklist-more.png +0 -0
  38. js/jquery/plugin/jquery-jplayer/Jplayer.swf +0 -0
  39. js/jquery/plugin/jquery-jplayer/jquery.jplayer.js +2198 -0
  40. js/jquery/plugin/ttw-music-player-min.js +11 -0
  41. js/jquery/plugin/ttw-music-player.js +591 -0
  42. package.xml +18 -0
  43. tracks/readme.txt +5 -0
app/code/community/Wmd/Musicplayer/Helper/Data.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Wmd_Musicplayer_Helper_Data
4
+ *
5
+ * WMD Web-Manufaktur/Digiswiss
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that you find at http://wmdextensions.com/WMD-License-Community.txt
10
+ *
11
+ * @category Wmd
12
+ * @package Wmd_Musicplayer
13
+ * @author Dominik Wyss <info@wmdextensions.com>
14
+ * @copyright 2011 Dominik Wyss | Digiswiss (http://www.digiswiss.ch)
15
+ * @link http://wmdextensions.com/
16
+ * @license http://wmdextensions.com/WMD-License-Community.txt
17
+ */
18
+ class Wmd_Musicplayer_Helper_Data extends Mage_Core_Helper_Abstract
19
+ {
20
+ protected $galleryImages;
21
+ protected $imgArr;
22
+ protected $playlist;
23
+
24
+ protected function getImage($product, $i)
25
+ {
26
+ if (!$this->galleryImages)
27
+ {
28
+ $this->playlist = array();
29
+ $this->imgArr = array();
30
+ $this->galleryImages = $product->getMediaGalleryImages();
31
+ foreach ($this->galleryImages as $item)
32
+ {
33
+ $this->imgArr[] = $item->getData();
34
+ }
35
+ }
36
+ if (count($this->imgArr) > $i)
37
+ {
38
+ return $this->imgArr[$i];
39
+ }
40
+ return $this->galleryImages->getFirstItem()->getData();
41
+ }
42
+
43
+ public function addPlaylistEntry($product, $link, $price, $i)
44
+ {
45
+ $time = '--:--';
46
+ $title = $artist = $mp3 = $ogg = '';
47
+ $mime = 'na';
48
+ $cover = $this->getImage($product, $i);
49
+ $title = $link->getTitle();
50
+ if (1 < count($tArr = explode(',', $title)))
51
+ {
52
+ $title = $tArr[0];
53
+ $time = $tArr[1];
54
+ $mime = $tArr[2];
55
+ }
56
+ if ($link->getSampleFile() || $link->getSampleUrl())
57
+ {
58
+ $sample = $link->getSampleUrl();
59
+ switch(substr($sample, -3))
60
+ {
61
+ case 'mp3':
62
+ $mp3 = $sample;
63
+ case 'ogg':
64
+ $ogg = $sample;
65
+ }
66
+ }
67
+ if (1 < count($titleArr = explode(' - ', $title)))
68
+ {
69
+ $artist = $titleArr[0];
70
+ $title = $titleArr[1];
71
+ }
72
+ else
73
+ {
74
+ $artist = $title;
75
+ }
76
+ $this->playlist[] = array(
77
+ 'mp3' => $mp3,
78
+ 'oga' => $ogg,
79
+ 'title' => $title,
80
+ 'artist' => $artist,
81
+ 'rating' => 4,
82
+ 'buy' => 'javascript:buyLinkCallback(' . $link->getId() . ', ' . $i . ');',
83
+ 'price' => ' ' . $price . ' ' . $mime,
84
+ 'duration' => $time,
85
+ 'cover' => $cover['url'],
86
+ );
87
+ }
88
+
89
+ public function returnPlaylist()
90
+ {
91
+ $str = '';
92
+ $n = count($this->playlist);
93
+ for ($i = 0; $i < $n; $i++)
94
+ {
95
+ if($i < ($n/2))
96
+ {
97
+ $this->playlist[$i]['oga'] = $this->playlist[$i + ($n/2)]['oga'];
98
+ } else {
99
+ $this->playlist[$i]['mp3'] = $this->playlist[$i - ($n/2)]['mp3'];
100
+ }
101
+ $str .= '
102
+ {
103
+ mp3:\'' . $this->playlist[$i]['mp3'] . '\',
104
+ oga:\'' . $this->playlist[$i]['oga'] . '\',
105
+ title:\'' . $this->playlist[$i]['title'] . '\',
106
+ artist:\'' . $this->playlist[$i]['artist'] . '\',
107
+ rating:\'' . $this->playlist[$i]['rating'] . '\',
108
+ buy:\'' . $this->playlist[$i]['buy'] . '\',
109
+ price:\'' . $this->playlist[$i]['price'] . '\',
110
+ duration:\'' . $this->playlist[$i]['duration'] . '\',
111
+ cover:\'' . $this->playlist[$i]['cover'] . '\'
112
+ },';
113
+ }
114
+ return substr($str, 0, -1);
115
+ }
116
+ }
app/code/community/Wmd/Musicplayer/etc/config.xml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Wmd
5
+ * @package Wmd_Musicplayer
6
+ * @author Dominik Wyss <info@wmdextensions.com>
7
+ * @copyright 2011 Dominik Wyss | Digiswiss (http://www.digiswiss.ch)
8
+ * @link http://wmdextensions.com/
9
+ * @license http://wmdextensions.com/WMD-License-Community.txt
10
+ */
11
+ -->
12
+ <config>
13
+ <modules>
14
+ <Wmd_Musicplayer>
15
+ <version>1.0.0</version>
16
+ </Wmd_Musicplayer>
17
+ </modules>
18
+ <frontend>
19
+ <translate>
20
+ <modules>
21
+ <Wmd_Musicplayer>
22
+ <files>
23
+ <default>Wmd_Musicplayer.csv</default>
24
+ </files>
25
+ </Wmd_Musicplayer>
26
+ </modules>
27
+ </translate>
28
+ </frontend>
29
+ <global>
30
+ <helpers>
31
+ <musicplayer>
32
+ <class>Wmd_Musicplayer_Helper</class>
33
+ </musicplayer>
34
+ </helpers>
35
+ </global>
36
+ </config>
app/design/frontend/default/musicplayer/layout/downloadable.xml ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package base_default
24
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+
28
+ -->
29
+ <layout version="0.1.0">
30
+
31
+ <customer_account>
32
+ <reference name="customer_account_navigation">
33
+ <action method="addLink" translate="label" module="downloadable"><name>downloadable_products</name><path>downloadable/customer/products</path><label>My Downloadable Products</label></action>
34
+ </reference>
35
+ </customer_account>
36
+
37
+ <downloadable_customer_products translate="label">
38
+ <label>Customer My Account Downloadable Items</label>
39
+ <update handle="customer_account"/>
40
+ <reference name="my.account.wrapper">
41
+ <block type="downloadable/customer_products_list" name="downloadable_customer_products_list" template="downloadable/customer/products/list.phtml" />
42
+ </reference>
43
+ <reference name="root">
44
+ <action method="setHeaderTitle" translate="title" module="downloadable"><title>My Downloadable Products</title></action>
45
+ </reference>
46
+ </downloadable_customer_products>
47
+
48
+ <checkout_cart_index>
49
+ <reference name="checkout.cart">
50
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/cart/item/default.phtml</template></action>
51
+ </reference>
52
+ </checkout_cart_index>
53
+
54
+ <checkout_onepage_review>
55
+ <reference name="root">
56
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
57
+ </reference>
58
+ </checkout_onepage_review>
59
+
60
+ <checkout_onepage_success>
61
+ <reference name="checkout.success">
62
+ <block type="downloadable/checkout_success" name="downloadable.checkout.success" template="downloadable/checkout/success.phtml"/>
63
+ </reference>
64
+ </checkout_onepage_success>
65
+
66
+ <checkout_multishipping_addresses>
67
+ <reference name="checkout_addresses">
68
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/multishipping/item/downloadable.phtml</template></action>
69
+ </reference>
70
+ </checkout_multishipping_addresses>
71
+
72
+ <checkout_multishipping_shipping>
73
+ <reference name="checkout_billing_items">
74
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/multishipping/item/downloadable.phtml</template></action>
75
+ </reference>
76
+ </checkout_multishipping_shipping>
77
+
78
+ <checkout_multishipping_overview>
79
+ <reference name="checkout_overview">
80
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/multishipping/item/downloadable.phtml</template></action>
81
+ </reference>
82
+ </checkout_multishipping_overview>
83
+
84
+ <checkout_multishipping_success>
85
+ <reference name="checkout_success">
86
+ <block type="downloadable/checkout_success" name="downloadable.checkout.success" template="downloadable/checkout/success.phtml"/>
87
+ </reference>
88
+ </checkout_multishipping_success>
89
+
90
+ <paypal_express_review>
91
+ <reference name="paypal.express.review.details">
92
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
93
+ </reference>
94
+ </paypal_express_review>
95
+ <paypal_express_review_details>
96
+ <reference name="root">
97
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
98
+ </reference>
99
+ </paypal_express_review_details>
100
+
101
+ <paypaluk_express_review>
102
+ <reference name="paypal.express.review.details">
103
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
104
+ </reference>
105
+ </paypaluk_express_review>
106
+ <paypaluk_express_review_details>
107
+ <reference name="root">
108
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
109
+ </reference>
110
+ </paypaluk_express_review_details>
111
+
112
+ <sales_order_view>
113
+ <reference name="order_items">
114
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/items/renderer/downloadable.phtml</template></action>
115
+ </reference>
116
+ </sales_order_view>
117
+
118
+ <sales_order_invoice>
119
+ <reference name="invoice_items">
120
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/invoice/items/renderer/downloadable.phtml</template></action>
121
+ </reference>
122
+ </sales_order_invoice>
123
+
124
+ <sales_order_creditmemo>
125
+ <reference name="creditmemo_items">
126
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml</template></action>
127
+ </reference>
128
+ </sales_order_creditmemo>
129
+
130
+ <wishlist_index_index>
131
+ <reference name="customer.wishlist">
132
+ <action method="addOptionsRenderCfg"><type>downloadable</type><helper>downloadable/catalog_product_configuration</helper></action>
133
+ </reference>
134
+ </wishlist_index_index>
135
+
136
+ <!--
137
+ Print pages
138
+ -->
139
+
140
+ <sales_order_print>
141
+ <reference name="sales.order.print">
142
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/items/renderer/downloadable.phtml</template></action>
143
+ </reference>
144
+ </sales_order_print>
145
+
146
+ <sales_order_printinvoice>
147
+ <reference name="sales.order.print.invoice">
148
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/invoice/items/renderer/downloadable.phtml</template></action>
149
+ </reference>
150
+ </sales_order_printinvoice>
151
+
152
+ <sales_order_printcreditmemo>
153
+ <reference name="sales.order.print.creditmemo">
154
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml</template></action>
155
+ </reference>
156
+ </sales_order_printcreditmemo>
157
+
158
+ <!--
159
+ EOF Print pages
160
+ -->
161
+
162
+ <!--
163
+ For guests
164
+ -->
165
+ <sales_guest_view>
166
+ <reference name="order_items">
167
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/items/renderer/downloadable.phtml</template></action>
168
+ </reference>
169
+ </sales_guest_view>
170
+
171
+ <sales_guest_invoice>
172
+ <reference name="invoice_items">
173
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/invoice/items/renderer/downloadable.phtml</template></action>
174
+ </reference>
175
+ </sales_guest_invoice>
176
+
177
+ <sales_guest_creditmemo>
178
+ <reference name="creditmemo_items">
179
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml</template></action>
180
+ </reference>
181
+ </sales_guest_creditmemo>
182
+
183
+ <sales_guest_print>
184
+ <reference name="sales.order.print">
185
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/items/renderer/downloadable.phtml</template></action>
186
+ </reference>
187
+ </sales_guest_print>
188
+
189
+ <sales_guest_printinvoice>
190
+ <reference name="sales.order.print.invoice">
191
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/invoice/items/renderer/downloadable.phtml</template></action>
192
+ </reference>
193
+ </sales_guest_printinvoice>
194
+
195
+ <sales_guest_printcreditmemo>
196
+ <reference name="sales.order.print.creditmemo">
197
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml</template></action>
198
+ </reference>
199
+ </sales_guest_printcreditmemo>
200
+
201
+ <!--
202
+ Emails
203
+ -->
204
+
205
+ <sales_email_order_items>
206
+ <reference name="items">
207
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_email_items_order_downloadable</block><template>downloadable/email/order/items/order/downloadable.phtml</template></action>
208
+ </reference>
209
+ </sales_email_order_items>
210
+
211
+ <sales_email_order_invoice_items>
212
+ <reference name="items">
213
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_email_items_downloadable</block><template>downloadable/email/order/items/invoice/downloadable.phtml</template></action>
214
+ </reference>
215
+ </sales_email_order_invoice_items>
216
+
217
+ <sales_email_order_creditmemo_items>
218
+ <reference name="items">
219
+ <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_email_items_downloadable</block><template>downloadable/email/order/items/creditmemo/downloadable.phtml</template></action>
220
+ </reference>
221
+ </sales_email_order_creditmemo_items>
222
+
223
+ <PRODUCT_TYPE_downloadable translate="label" module="downloadable">
224
+ <label>Catalog Product View (Downloadable)</label>
225
+ <!-- Added to enable musicplayer -->
226
+ <reference name="head">
227
+ <action method="addItem"><type>js_css</type><name>jquery/plugin/css/style.css</name><params/></action>
228
+ <action method="addJs"><script>jquery/jquery-1.6.1.min.js</script></action>
229
+ <action method="addJs"><script>jquery/plugin/ttw-music-player.js</script></action>
230
+ <action method="addJs"><script>jquery/plugin/jquery-jplayer/jquery.jplayer.js</script></action>
231
+ </reference>
232
+ <!-- End: Added to enable musicplayer -->
233
+ <reference name="product.info">
234
+ <block type="downloadable/catalog_product_view_type" name="product.info.downloadable" as="product_type_data" template="downloadable/catalog/product/type.phtml">
235
+ <block type="downloadable/catalog_product_samples" name="product.info.downloadable.samples" as="samples" template="downloadable/catalog/product/samples.phtml"/>
236
+ <block type="cataloginventory/stockqty_default" name="product.info.downloadable.extra" as="product_type_data_extra" template="cataloginventory/stockqty/default.phtml"/>
237
+ </block>
238
+ </reference>
239
+ <reference name="product.info.options.wrapper">
240
+ <block type="downloadable/catalog_product_links" name="product.info.downloadable.options" as="type_downloadable_options" before="-" template="downloadable/catalog/product/links.phtml"/>
241
+ <action method="insert"><block>product.info.downloadable.options</block></action>
242
+ </reference>
243
+ </PRODUCT_TYPE_downloadable>
244
+
245
+ </layout>
app/design/frontend/default/musicplayer/template/catalog/product/list.phtml ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Product list template
30
+ *
31
+ * @see Mage_Catalog_Block_Product_List
32
+ */
33
+ ?>
34
+ <?php
35
+ $_productCollection=$this->getLoadedProductCollection();
36
+ $_helper = $this->helper('catalog/output');
37
+ ?>
38
+ <?php if(!$_productCollection->count()): ?>
39
+ <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
40
+ <?php else: ?>
41
+ <div class="category-products">
42
+ <?php echo $this->getToolbarHtml() ?>
43
+ <?php // List mode ?>
44
+ <?php if($this->getMode()!='grid'): ?>
45
+ <?php $_iterator = 0; ?>
46
+ <ol class="products-list" id="products-list">
47
+ <?php foreach ($_productCollection as $_product): ?>
48
+ <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
49
+ <?php // Product Image ?>
50
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
51
+ <?php // Product description ?>
52
+ <div class="product-shop">
53
+ <div class="f-fix">
54
+ <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
55
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
56
+ <?php if($_product->getRatingSummary()): ?>
57
+ <?php echo $this->getReviewsSummaryHtml($_product) ?>
58
+ <?php endif; ?>
59
+ <?php //echo $this->getPriceHtml($_product, true) ?>
60
+ <?php if($_product->isSaleable()): ?>
61
+ <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
62
+ <?php else: ?>
63
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
64
+ <?php endif; ?>
65
+ <div class="desc std">
66
+ <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
67
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
68
+ </div>
69
+ <ul class="add-to-links">
70
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
71
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
72
+ <?php endif; ?>
73
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
74
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
75
+ <?php endif; ?>
76
+ </ul>
77
+ </div>
78
+ </div>
79
+ </li>
80
+ <?php endforeach; ?>
81
+ </ol>
82
+ <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
83
+
84
+ <?php else: ?>
85
+
86
+ <?php // Grid Mode ?>
87
+
88
+ <?php $_collectionSize = $_productCollection->count() ?>
89
+ <?php $_columnCount = $this->getColumnCount(); ?>
90
+ <?php $i=0; foreach ($_productCollection as $_product): ?>
91
+ <?php if ($i++%$_columnCount==0): ?>
92
+ <ul class="products-grid">
93
+ <?php endif ?>
94
+ <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
95
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
96
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
97
+ <?php if($_product->getRatingSummary()): ?>
98
+ <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
99
+ <?php endif; ?>
100
+ <?php //echo $this->getPriceHtml($_product, true) ?>
101
+ <div class="actions">
102
+ <?php if($_product->isSaleable()): ?>
103
+ <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
104
+ <?php else: ?>
105
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
106
+ <?php endif; ?>
107
+ <ul class="add-to-links">
108
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
109
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
110
+ <?php endif; ?>
111
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
112
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
113
+ <?php endif; ?>
114
+ </ul>
115
+ </div>
116
+ </li>
117
+ <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
118
+ </ul>
119
+ <?php endif ?>
120
+ <?php endforeach ?>
121
+ <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
122
+ <?php endif; ?>
123
+
124
+ <div class="toolbar-bottom">
125
+ <?php echo $this->getToolbarHtml() ?>
126
+ </div>
127
+ </div>
128
+ <?php endif; ?>
app/design/frontend/default/musicplayer/template/catalog/product/new.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if (($_products = $this->getProductCollection()) && $_products->getSize()): ?>
28
+ <h2 class="subtitle"><?php //echo $this->__('New Products') ?></h2>
29
+ <?php $_columnCount = $this->getColumnCount(); ?>
30
+ <?php $i=0; foreach ($_products->getItems() as $_product): ?>
31
+ <?php if ($i++%$_columnCount==0): ?>
32
+ <ul class="products-grid">
33
+ <?php endif ?>
34
+ <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
35
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135) ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" /></a>
36
+ <h3 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></h3>
37
+ <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
38
+ <?php //echo $this->getPriceHtml($_product, true, '-new') ?>
39
+ <div class="actions">
40
+ <?php if($_product->isSaleable()): ?>
41
+ <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
42
+ <?php else: ?>
43
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
44
+ <?php endif; ?>
45
+ <ul class="add-to-links">
46
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
47
+ <li><a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
48
+ <?php endif; ?>
49
+ <?php if ($_compareUrl = $this->getAddToCompareUrl($_product)): ?>
50
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
51
+ <?php endif; ?>
52
+ </ul>
53
+ </div>
54
+ </li>
55
+ <?php if ($i%$_columnCount==0 || $i==count($_products)): ?>
56
+ </ul>
57
+ <?php endif ?>
58
+ <?php endforeach; ?>
59
+ <?php endif; ?>
app/design/frontend/default/musicplayer/template/catalog/product/view.phtml ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product view template
29
+ *
30
+ * @see Mage_Catalog_Block_Product_View
31
+ * @see Mage_Review_Block_Product_View
32
+ */
33
+ ?>
34
+ <?php $_helper = $this->helper('catalog/output'); ?>
35
+ <?php $_product = $this->getProduct(); ?>
36
+ <script type="text/javascript">
37
+ var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
38
+ </script>
39
+ <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
40
+ <div class="product-view">
41
+ <div class="product-essential">
42
+ <form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
43
+ <div class="no-display">
44
+ <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
45
+ <input type="hidden" name="related_product" id="related-products-field" value="" />
46
+ </div>
47
+
48
+ <div class="product-shop">
49
+ <div class="product-name">
50
+ <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
51
+ </div>
52
+
53
+ <?php if ($this->canEmailToFriend()): ?>
54
+ <p class="email-friend"><a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a></p>
55
+ <?php endif; ?>
56
+
57
+ <?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
58
+ <?php echo $this->getChildHtml('alert_urls') ?>
59
+ <?php echo $this->getChildHtml('product_type_data') ?>
60
+ <?php echo $this->getTierPriceHtml() ?>
61
+ <?php echo $this->getChildHtml('extrahint') ?>
62
+
63
+ <?php if (!$this->hasOptions()):?>
64
+ <div class="add-to-box">
65
+ <?php if($_product->isSaleable()): ?>
66
+ <?php echo $this->getChildHtml('addtocart') ?>
67
+ <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
68
+ <span class="or"><?php echo $this->__('OR') ?></span>
69
+ <?php endif; ?>
70
+ <?php endif; ?>
71
+ <?php echo $this->getChildHtml('addto') ?>
72
+ </div>
73
+ <?php echo $this->getChildHtml('extra_buttons') ?>
74
+ <?php elseif (!$_product->isSaleable()): ?>
75
+ <div class="add-to-box">
76
+ <?php echo $this->getChildHtml('addto') ?>
77
+ </div>
78
+ <?php endif; ?>
79
+
80
+ <div class="short-description">
81
+ <h2><?php echo Mage::helper('musicplayer')->__('Quick select all tracks') ?></h2>
82
+ <div class="std">
83
+ <a class="link-wishlist" href="javascript:selectAll('mp3')"><?php echo Mage::helper('musicplayer')->__('mp3') ?></a>
84
+ <a class="link-wishlist" href="javascript:selectAll('wav')"><?php echo Mage::helper('musicplayer')->__('wav') ?></a>
85
+ </div>
86
+ </div>
87
+
88
+ <?php echo $this->getChildHtml('other');?>
89
+
90
+ <?php if ($_product->isSaleable() && $this->hasOptions()):?>
91
+ <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
92
+ <?php endif;?>
93
+
94
+ </div>
95
+
96
+
97
+
98
+ <?php if ($_product->isSaleable() && $this->hasOptions()):?>
99
+ <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
100
+ <?php endif;?>
101
+ <div class="clearer"></div>
102
+ </form>
103
+ <script type="text/javascript">
104
+ //<![CDATA[
105
+ var productAddToCartForm = new VarienForm('product_addtocart_form');
106
+ productAddToCartForm.submit = function(button, url) {
107
+ if (this.validator.validate()) {
108
+ var form = this.form;
109
+ var oldUrl = form.action;
110
+
111
+ if (url) {
112
+ form.action = url;
113
+ }
114
+ var e = null;
115
+ try {
116
+ this.form.submit();
117
+ } catch (e) {
118
+ }
119
+ this.form.action = oldUrl;
120
+ if (e) {
121
+ throw e;
122
+ }
123
+
124
+ if (button && button != 'undefined') {
125
+ button.disabled = true;
126
+ }
127
+ }
128
+ }.bind(productAddToCartForm);
129
+
130
+ productAddToCartForm.submitLight = function(button, url){
131
+ if(this.validator) {
132
+ var nv = Validation.methods;
133
+ delete Validation.methods['required-entry'];
134
+ delete Validation.methods['validate-one-required'];
135
+ delete Validation.methods['validate-one-required-by-name'];
136
+ if (this.validator.validate()) {
137
+ if (url) {
138
+ this.form.action = url;
139
+ }
140
+ this.form.submit();
141
+ }
142
+ Object.extend(Validation.methods, nv);
143
+ }
144
+ }.bind(productAddToCartForm);
145
+
146
+ //]]>
147
+ </script>
148
+ </div>
149
+
150
+ <div class="product-collateral">
151
+
152
+ <?php echo $this->getChildHtml('upsell_products') ?>
153
+ <?php echo $this->getChildHtml('product_additional_data') ?>
154
+ </div>
155
+ </div>
app/design/frontend/default/musicplayer/template/catalog/product/view/options.phtml ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php $_options = Mage::helper('core')->decorateArray($this->getOptions()) ?>
29
+ <?php if (count($_options)):?>
30
+ <script type="text/javascript">
31
+ //<![CDATA[
32
+ var optionFileUpload = {
33
+ productForm : $('product_addtocart_form'),
34
+ formAction : '',
35
+ formElements : {},
36
+ upload : function(element){
37
+ this.formElements = this.productForm.select('input', 'select', 'textarea', 'button');
38
+ this.removeRequire(element.readAttribute('id').sub('option_', ''));
39
+
40
+ template = '<iframe id="upload_target" name="upload_target" style="width:0; height:0; border:0;"><\/iframe>';
41
+
42
+ Element.insert($('option_'+element.readAttribute('id').sub('option_', '')+'_uploaded_file'), {after: template});
43
+
44
+ this.formAction = this.productForm.action;
45
+
46
+ var baseUrl = '<?php echo $this->getUrl('*/product/upload') ?>';
47
+ var urlExt = 'option_id/'+element.readAttribute('id').sub('option_', '');
48
+
49
+ this.productForm.action = parseSidUrl(baseUrl, urlExt);
50
+ this.productForm.target = 'upload_target';
51
+ this.productForm.submit();
52
+ this.productForm.target = '';
53
+ this.productForm.action = this.formAction;
54
+ },
55
+ removeRequire : function(skipElementId){
56
+ for(var i=0; i<this.formElements.length; i++){
57
+ if (this.formElements[i].readAttribute('id') != 'option_'+skipElementId+'_file' && this.formElements[i].type != 'button') {
58
+ this.formElements[i].disabled='disabled';
59
+ }
60
+ }
61
+ },
62
+ addRequire : function(skipElementId){
63
+ for(var i=0; i<this.formElements.length; i++){
64
+ if (this.formElements[i].readAttribute('name') != 'options_'+skipElementId+'_file' && this.formElements[i].type != 'button') {
65
+ this.formElements[i].disabled='';
66
+ }
67
+ }
68
+ },
69
+ uploadCallback : function(data){
70
+ this.addRequire(data.optionId);
71
+ $('upload_target').remove();
72
+
73
+ if (data.error) {
74
+
75
+ } else {
76
+ $('option_'+data.optionId+'_uploaded_file').value = data.fileName;
77
+ $('option_'+data.optionId+'_file').value = '';
78
+ $('option_'+data.optionId+'_file').hide();
79
+ $('option_'+data.optionId+'').hide();
80
+ template = '<div id="option_'+data.optionId+'_file_box"><a href="#"><img src="var/options/'+data.fileName+'" alt=""><\/a><a href="#" onclick="optionFileUpload.removeFile('+data.optionId+')" title="Remove file" \/>Remove file<\/a>';
81
+
82
+ Element.insert($('option_'+data.optionId+'_uploaded_file'), {after: template});
83
+ }
84
+ },
85
+ removeFile : function(optionId)
86
+ {
87
+ $('option_'+optionId+'_uploaded_file').value= '';
88
+ $('option_'+optionId+'_file').show();
89
+ $('option_'+optionId+'').show();
90
+
91
+ $('option_'+optionId+'_file_box').remove();
92
+ }
93
+ }
94
+ var optionTextCounter = {
95
+ count : function(field,cntfield,maxlimit){
96
+ if (field.value.length > maxlimit){
97
+ field.value = field.value.substring(0, maxlimit);
98
+ } else {
99
+ cntfield.innerHTML = maxlimit - field.value.length;
100
+ }
101
+ }
102
+ }
103
+
104
+ Product.Options = Class.create();
105
+ Product.Options.prototype = {
106
+ initialize : function(config){
107
+ this.config = config;
108
+ this.reloadPrice();
109
+ document.observe("dom:loaded", this.reloadPrice.bind(this));
110
+ },
111
+ reloadPrice : function(){
112
+ price = new Number();
113
+ config = this.config;
114
+ skipIds = [];
115
+ $$('.product-custom-option').each(function(element){
116
+ var optionId = 0;
117
+ element.name.sub(/[0-9]+/, function(match){
118
+ optionId = match[0];
119
+ });
120
+ if (this.config[optionId]) {
121
+ if (element.type == 'checkbox' || element.type == 'radio') {
122
+ if (element.checked) {
123
+ if (config[optionId][element.getValue()]) {
124
+ price += parseFloat(config[optionId][element.getValue()]);
125
+ }
126
+ }
127
+ } else if(element.hasClassName('datetime-picker') && !skipIds.include(optionId)) {
128
+ dateSelected = true;
129
+ $$('.product-custom-option[id^="options_' + optionId + '"]').each(function(dt){
130
+ if (dt.getValue() == '') {
131
+ dateSelected = false;
132
+ }
133
+ });
134
+ if (dateSelected) {
135
+ price += parseFloat(this.config[optionId]);
136
+ skipIds[optionId] = optionId;
137
+ }
138
+ } else if(element.type == 'select-one' || element.type == 'select-multiple') {
139
+ if (element.options) {
140
+ $A(element.options).each(function(selectOption){
141
+ if (selectOption.selected) {
142
+ if (this.config[optionId][selectOption.value]) {
143
+ price += parseFloat(this.config[optionId][selectOption.value]);
144
+ }
145
+ }
146
+ });
147
+ }
148
+ } else {
149
+ if (element.getValue().strip() != '') {
150
+ price += parseFloat(this.config[optionId]);
151
+ }
152
+ }
153
+ }
154
+ });
155
+ try {
156
+ optionsPrice.changePrice('options', price);
157
+ optionsPrice.changePrice('optionsPriceInclTax', price);
158
+ optionsPrice.reload();
159
+ } catch (e) {
160
+
161
+ }
162
+ }
163
+ }
164
+ function validateOptionsCallback(elmId, result){
165
+ var container = $(elmId).up('ul.options-list');
166
+ if (result == 'failed') {
167
+ container.removeClassName('validation-passed');
168
+ container.addClassName('validation-failed');
169
+ } else {
170
+ container.removeClassName('validation-failed');
171
+ container.addClassName('validation-passed');
172
+ }
173
+ }
174
+ var opConfig = new Product.Options(<?php echo $this->getJsonConfig() ?>);
175
+ //]]>
176
+ </script>
177
+ <dl>
178
+ <?php foreach($_options as $_option): ?>
179
+ <?php echo $this->getOptionHtml($_option) ?>
180
+ <?php endforeach; ?>
181
+ </dl>
182
+ <?php endif; ?>
app/design/frontend/default/musicplayer/template/catalog/product/view/options/wrapper.phtml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="product-img-box" id="product-player-wrapper">
28
+ </div>
29
+ <div class="product-options" id="product-options-wrapper">
30
+ <?php echo $this->getChildHtml('', true, true);?>
31
+ <?php if ($this->hasRequiredOptions()):?>
32
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
33
+ <?php endif;?>
34
+ </div>
35
+ <script type="text/javascript">decorateGeneric($$('#product-options-wrapper dl'), ['last']);</script>
app/design/frontend/default/musicplayer/template/downloadable/catalog/product/links.phtml ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /* @var $this Mage_Downloadable_Block_Catalog_Product_Links */ ?>
28
+ <?php $_linksPurchasedSeparately = $this->getLinksPurchasedSeparately(); ?>
29
+ <?php if ($this->getProduct()->isSaleable() && $this->hasLinks()):?>
30
+ <dl>
31
+ <?php $_links = $this->getLinks(); ?>
32
+ <?php $_isRequired = $this->getLinkSelectionRequired(); ?>
33
+ <?php $playlist = array(); ?>
34
+ <dt><label<?php if ($_isRequired) echo ' class="required"' ?>><?php if ($_isRequired) echo '<em>*</em>' ?><?php echo $this->getLinksTitle() ?></label></dt>
35
+ <dd<?php /* if ($_option->decoratedIsLast){?> class="last"<?php } */ ?>>
36
+ <ul id="downloadable-links-list" class="options-list">
37
+ <?php $i = 0; ?>
38
+ <?php foreach ($_links as $_link): ?>
39
+ <li>
40
+ <?php if ($_linksPurchasedSeparately): ?>
41
+ <input type="checkbox" class="checkbox<?php if($_isRequired):?> validate-one-required-by-name<?php endif; ?> product-downloadable-link" onclick="dConfig.reloadPrice()" name="links[]" id="links_<?php echo $_link->getId() ?>" value="<?php echo $_link->getId(); ?>" <?php echo $this->getLinkCheckedValue($_link); ?> />
42
+ <?php endif; ?>
43
+ <span class="label">
44
+ <label for="links_<?php echo $_link->getId() ?>">
45
+ <?php echo $_link->getTitle() ?>
46
+ </label>
47
+ <?php if ($_link->getSampleFile() || $_link->getSampleUrl()): ?>
48
+ &nbsp;(<a href="<?php echo $this->getLinkSamlpeUrl($_link) ?>" <?php echo $this->getIsOpenInNewWindow()?'onclick="this.target=\'_blank\'"':''; ?>><?php echo Mage::helper('downloadable')->__('sample') ?></a>)
49
+ <?php endif; ?>
50
+ <?php if ($_linksPurchasedSeparately): ?>
51
+ <?php echo $this->getFormattedLinkPrice($_link); ?>
52
+ <?php endif; ?>
53
+ </span>
54
+ <?php if ($_isRequired): ?>
55
+ <script type="text/javascript">
56
+ //<![CDATA[
57
+ $('links_<?php echo $_link->getId() ?>').advaiceContainer = 'links-advice-container';
58
+ $('links_<?php echo $_link->getId() ?>').callbackFunction = 'validateDownloadableCallback';
59
+ //]]>
60
+ </script>
61
+ <?php endif; ?>
62
+ </li>
63
+ <?php Mage::helper('musicplayer')->addPlaylistEntry($this->getProduct(), $_link, round($_link->getPrice(), 2), $i); ?>
64
+ <?php $i++; ?>
65
+ <?php endforeach; ?>
66
+ </ul>
67
+
68
+ <?php if ($_isRequired): ?>
69
+ <span id="links-advice-container"></span>
70
+ <?php endif;?>
71
+ </dd>
72
+ </dl>
73
+ <script type="text/javascript">
74
+ //<![CDATA[
75
+ Product.Downloadable = Class.create();
76
+ Product.Downloadable.prototype = {
77
+ config : {},
78
+ initialize : function(config){
79
+ this.config = config;
80
+ this.reloadPrice();
81
+ document.observe("dom:loaded", this.reloadPrice.bind(this));
82
+ },
83
+ reloadPrice : function(){
84
+ var price = 0;
85
+ config = this.config;
86
+ $$('.product-downloadable-link').each(function(elm){
87
+ if (config[elm.value] && elm.checked) {
88
+ price += parseFloat(config[elm.value]);
89
+ }
90
+ });
91
+ try {
92
+ var _displayZeroPrice = optionsPrice.displayZeroPrice;
93
+ optionsPrice.displayZeroPrice = false;
94
+ optionsPrice.changePrice('downloadable', price);
95
+ optionsPrice.reload();
96
+ optionsPrice.displayZeroPrice = _displayZeroPrice;
97
+ } catch (e) {
98
+
99
+ }
100
+ }
101
+ };
102
+
103
+ function validateDownloadableCallback(elmId, result) {
104
+ var container = $('downloadable-links-list');
105
+ if (result == 'failed') {
106
+ container.removeClassName('validation-passed');
107
+ container.addClassName('validation-failed');
108
+ } else {
109
+ container.removeClassName('validation-failed');
110
+ container.addClassName('validation-passed');
111
+ }
112
+ }
113
+
114
+ var dConfig = new Product.Downloadable(<?php echo $this->getJsonConfig() ?>);
115
+
116
+ // musicplayer code
117
+ var myPlaylist = [<?php echo Mage::helper('musicplayer')->returnPlaylist(); ?>];
118
+ var description = '<?php echo $this->getProduct()->getDescription() ?>';
119
+ var tracksToShow = '<?php echo ($i/2); ?>';
120
+ $j('#product-player-wrapper').ttwMusicPlayer(myPlaylist, {tracksToShow:tracksToShow, description:description, buyText:'',autoPlay:false});
121
+
122
+ function buyLinkCallback(id, i)
123
+ {
124
+ var border = "";
125
+ var checkedOption = false;
126
+ if ($('links_'+id).checked) {
127
+ border = "none";
128
+ } else {
129
+ border = "1px solid #F18200";
130
+ checkedOption = true;
131
+ }
132
+ $('links_'+id).checked = !$('links_'+id).checked;
133
+ $j("li.track").eq(i).find('.buy').css("border", border);
134
+ $j("li.track").eq(i).find('.option').attr("checked", checkedOption).css("border", border);
135
+
136
+ }
137
+
138
+ function selectAll(format)
139
+ {
140
+ var n = 0;
141
+ var tracks = $j('#downloadable-links-list').children();
142
+ var nTracks = tracks.size();
143
+ var checked = false;
144
+ tracks.each(function(index) {
145
+ if ((format == 'mp3') && (n < (nTracks / 2)))
146
+ {
147
+ $j(this).find(':checkbox').prop("checked", true);
148
+ $j('.track').eq(n).find('.buy').css("border", "1px solid #F18200");
149
+ $j('.track').eq(n).find('.option').attr("checked", true);
150
+ }
151
+ if ((format == 'wav') && (n >= (nTracks / 2)))
152
+ {
153
+ $j(this).find(':checkbox').prop("checked", true);
154
+ $j('.track').eq(n).find('.buy').css("border", "1px solid #F18200");
155
+ $j('.track').eq(n).find('.option').attr("checked", true);
156
+ }
157
+ n++;
158
+ });
159
+
160
+ }
161
+
162
+ //]]>
163
+ </script>
164
+ <?php endif;?>
app/etc/modules/WMD_Musicplayer.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Wmd_Musicplayer>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Wmd_Musicplayer>
8
+ </modules>
9
+ </config>
app/locale/en_US/Wmd_Musicplayer.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "Quick select all tracks","Quick select all tracks"
2
+ "mp3","mp3"
3
+ "wav","wav"
js/jquery/jquery-1.6.1.min.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery JavaScript Library v1.6.1
3
+ * http://jquery.com/
4
+ *
5
+ * Copyright 2011, John Resig
6
+ * Dual licensed under the MIT or GPL Version 2 licenses.
7
+ * http://jquery.org/license
8
+ *
9
+ * Includes Sizzle.js
10
+ * http://sizzlejs.com/
11
+ * Copyright 2011, The Dojo Foundation
12
+ * Released under the MIT, BSD, and GPL Licenses.
13
+ *
14
+ * Date: Thu May 12 15:04:36 2011 -0400
15
+ */
16
+ (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("<!doctype><html><body></body></html>");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bF.test(a)?d(a,e):b_(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bU,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bQ),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bD(a,b,c){var d=b==="width"?bx:by,e=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return e;f.each(d,function(){c||(e-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?e+=parseFloat(f.css(a,"margin"+this))||0:e-=parseFloat(f.css(a,"border"+this+"Width"))||0});return e}function bn(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bm(a){f.nodeName(a,"input")?bl(a):a.getElementsByTagName&&f.grep(a.getElementsByTagName("input"),bl)}function bl(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bk(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bj(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bi(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bh(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function X(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(S.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(y,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.1",length:0,size:function(){return this.length},toArray:function(){return D.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?C.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(D.apply(this,arguments),"slice",D.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:C,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:E?function(a){return a==null?"":E.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?C.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(F)return F.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=D.call(arguments,2),g=function(){return a.apply(c,f.concat(D.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){G["[object "+b+"]"]=b.toLowerCase()}),x=e.uaMatch(w),x.browser&&(e.browser[x.browser]=!0,e.browser.version=x.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?z=function(){c.removeEventListener("DOMContentLoaded",z,!1),e.ready()}:c.attachEvent&&(z=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",z),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,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=/\:/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.addClass(a.call(this,b,c.attr("class")||""))});if(a&&typeof a=="string"){var b=(a||"").split(o);for(var c=0,d=this.length;c<d;c++){var e=this[c];if(e.nodeType===1)if(!e.className)e.className=a;else{var g=" "+e.className+" ",h=e.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);e.className=f.trim(h)}}}return this},removeClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"||a===b){var c=(a||"").split(o);for(var d=0,e=this.length;d<e;d++){var g=this[d];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(n," ");for(var i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){var d=f(this);d.toggleClass(a.call(this,c,d.attr("class"),b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},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}}},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=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem
17
+ )});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,O(a.origType,a.selector),f.extend({},a,{handler:N,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,O(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?F:E):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=F;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=F;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=F,this.stopPropagation()},isDefaultPrevented:E,isPropagationStopped:E,isImmediatePropagationStopped:E};var G=function(a){var b=a.relatedTarget;a.type=a.data;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&f.event.handle.apply(this,arguments)}catch(d){}},H=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?H:G,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?H:G)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&L("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&L("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var I,J=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var M={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||E,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=y.exec(h),k="",j&&(k=j[0],h=h.replace(y,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,M[h]?(a.push(M[h]+k),h=h+k):h=(M[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+O(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+O(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var P=/Until$/,Q=/^(?:parents|prevUntil|prevAll)/,R=/,/,S=/^.[^:#\[\.,]*$/,T=Array.prototype.slice,U=f.expr.match.POS,V={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(X(this,a,!1),"not",a)},filter:function(a){return this.pushStack(X(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=U.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(W(c[0])||W(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/<tbody/i,bb=/<|&#?\w+;/,bc=/<(?:script|object|embed|option|style)/i,bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bh(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bn)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bc.test(a[0])&&(f.support.checkClone||!bd.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||
18
+ b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1></$2>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bm(k[i]);else bm(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bo=/alpha\([^)]*\)/i,bp=/opacity=([^)]*)/,bq=/-([a-z])/ig,br=/([A-Z]|^ms)/g,bs=/^-?\d+(?:px)?$/i,bt=/^-?\d/,bu=/^[+\-]=/,bv=/[^+\-\.\de]+/g,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB,bC=function(a,b){return b.toUpperCase()};f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0,widows:!0,orphans:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bu.test(d)&&(d=+d.replace(bv,"")+parseFloat(f.css(a,c))),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bq,bC)}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){a.offsetWidth!==0?e=bD(a,b,d):f.swap(a,bw,function(){e=bD(a,b,d)});if(e<=0){e=bz(a,b,b),e==="0px"&&bB&&(e=bB(a,b,b));if(e!=null)return e===""||e==="auto"?"0px":e}if(e<0||e==null){e=a.style[b];return e===""||e==="auto"?"0px":e}return typeof e=="string"?e:e+"px"}},set:function(a,b){if(!bs.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bO,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bP.test(this.nodeName)||bJ.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bI.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bV,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bE,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cv(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cm.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=cn.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this),f.isFunction(d.old)&&d.old.call(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cq||cs(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!co&&(cr?(co=1,g=function(){co&&(cr(g),e.tick())},cr(g)):co=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cq||cs(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
js/jquery/plugin/Instructions.txt ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ *************************
3
+ *************************
4
+
5
+ IMPORTANT: Due to limited resources, I am unable to offer support for the free items on codebasehero.com.
6
+
7
+ However, all premium files purchased from http://codecanyon.net/user/23andwalnut/portfolio are eligible for support.
8
+
9
+ Thanks,
10
+ Saleem
11
+
12
+ *************************
13
+ *************************
14
+
15
+
16
+ 1. Include jQuery in your page.
17
+
18
+ 3. Include jPlayer in your page
19
+
20
+ 2. Include the plugin javascript and css file.
21
+
22
+ 3. Build your playlist. The playlist uses the same format s jPlayer (an array of objects. However, this plugin requires
23
+ you to add some additional parameters. A sample playlist item:
24
+
25
+ {
26
+ mp3:'mix/1.mp3',
27
+ oga:'mix/1.ogg',
28
+ rating:4.5,
29
+ title:'Some song title',
30
+ buy:'http://www.codebasehero.com',
31
+ price:'0.99',
32
+ duration:'4:28',
33
+ artist:'Artist Name',
34
+ cover:'images/cover.jpg'
35
+ }
36
+
37
+ 4. Initialize the plugin:
38
+ $('body').ttwMusicPlayer(myPlaylist, {options});
39
+
40
+ You can specify the following options in the options object:
41
+
42
+ {
43
+ currencySymbol:'$',
44
+ buyText:'BUY',
45
+ tracksToShow:5,
46
+ autoPlay:false,
47
+ ratingCallback:function(index, playlistItem, rating){
48
+ //some logic to process the rating, perhaps through an ajax call
49
+ },
50
+ jPlayer:{} //override default jPlayer options here. This accepts the same structure as the standalone jPlayer
51
+ };
52
+
js/jquery/plugin/css/style.css ADDED
@@ -0,0 +1,429 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* dark_matter.png is from http://subtlepatterns.com/?s=dark+matter&submit=Search by Atle Mo */
2
+ /* CSS downloadable product */
3
+ .product-essential {
4
+ background: url("../images/dark_matter.png") repeat scroll transparent !important;
5
+ }
6
+ .product-essential H1,
7
+ .product-essential H2 {
8
+ color:#ccc !important;
9
+ }
10
+ .product-options-bottom {
11
+ background:transparent !important;
12
+ border:none !important;
13
+ }
14
+ .product-options {
15
+ display:none;
16
+ }
17
+ .product-view .product-img-box {
18
+ float: left !important;
19
+ width: 370px !important;
20
+ }
21
+ .product-view .product-shop {
22
+ float: right;
23
+ width: 230px !important;
24
+ }
25
+ .add-to-cart label,
26
+ .add-to-cart .qty {
27
+ display: none !important;
28
+ }
29
+ .product-options-bottom .add-to-cart {
30
+ float: left !important;
31
+ margin:0 50px 10px 32px;
32
+ }
33
+ .product-options-bottom .add-to-links {
34
+ clear: none !important;
35
+ float: left !important;
36
+ margin:0 50px 10px 32px;
37
+ text-align:left !important;
38
+ }
39
+ /* End CSS downloadable product */
40
+
41
+ .ttw-music-player {
42
+ width: 370px;
43
+ margin: 0;
44
+ float:left;
45
+ font-family: 'Lato', arial, sans-serif;
46
+ text-align:left;
47
+ }
48
+
49
+ .ttw-music-player .player {
50
+ width: 100%;
51
+ }
52
+
53
+ /** Album Cover **/
54
+ .ttw-music-player .album-cover {
55
+ position: relative;
56
+ float: left;
57
+ background: #333 url(../images/album-cover-bg.jpg) no-repeat 0 0 scroll;;
58
+ box-shadow: 0px 1px 4px rgba(0, 0, 0, .75);
59
+ -moz-box-shadow: 0px 1px 4px rgba(0, 0, 0, .75);
60
+ -webkit-box-shadow: 0px 1px 4px rgba(0, 0, 0, .75);
61
+ }
62
+
63
+ .ttw-music-player .album-cover .img {
64
+ box-shadow: inset 0 0 1px rgba(255, 255, 255, .6);
65
+ -moz-box-shadow: inset 0 0 1px rgba(255, 255, 255, .6);
66
+ -webkit-box-shadow: inset 0 0 1px rgba(255, 255, 255, .6);
67
+ background-position:center center;
68
+ background-repeat:no-repeat;
69
+ background-color:transparent;
70
+ }
71
+
72
+ .ttw-music-player .album-cover .highlight {
73
+ background: transparent url(../images/album-cover-highlight.png) no-repeat 0 0 scroll;
74
+ opacity: 1;
75
+
76
+ }
77
+
78
+ .ttw-music-player .album-cover:hover .highlight {
79
+ opacity: 1;
80
+ }
81
+
82
+ .ttw-music-player .album-cover,
83
+ .ttw-music-player .album-cover .img,
84
+ .ttw-music-player .album-cover .highlight {
85
+ display: block;
86
+ height: 125px;
87
+ width: 125px;
88
+ }
89
+
90
+ .ttw-music-player .album-cover img,
91
+ .ttw-music-player .album-cover .img,
92
+ .ttw-music-player .album-cover .highlight {
93
+ position: absolute;
94
+ top: 0;
95
+ left: 0;
96
+ height:125px;
97
+ width:125px;
98
+ }
99
+
100
+ /** Track Info **/
101
+ .ttw-music-player .track-info {
102
+ width: 215px;
103
+ margin: 8px 0 0 30px;
104
+ float: left;
105
+ font-size: 12px;
106
+ }
107
+
108
+ .ttw-music-player .track-info p {
109
+ margin: 0 0 8px 0;
110
+ }
111
+
112
+ .ttw-music-player .player .title {
113
+ color: #efefef;
114
+ text-shadow: 0 1px 1px rgba(0, 0, 0, .8);
115
+ font-family: 'Lato Bold', arial, sans-serif;
116
+ font-weight: bold;
117
+ font-size: 14px;
118
+ }
119
+
120
+ .ttw-music-player .artist-outer {
121
+ color: #727272;
122
+ font-family: 'Lato Italic', arial, sans-serif;
123
+ font-style: italic;
124
+ }
125
+
126
+ .ttw-music-player .artist {
127
+ color: #999;
128
+ font-family: 'Lato', arial, sans-serif;
129
+ margin-left: 4px;
130
+ }
131
+
132
+ .ttw-music-player .rating {
133
+ width: 75px;
134
+ height: 16px;
135
+ visibility:hidden;
136
+ }
137
+
138
+ .ttw-music-player .rating-star {
139
+ width: 15px;
140
+ height: 16px;
141
+ display: block;
142
+ float: left;
143
+ background: transparent url(../images/rating-off.png) no-repeat center center scroll;
144
+ cursor: pointer;
145
+ }
146
+
147
+ .ttw-music-player .rating-star:hover,
148
+ .ttw-music-player .rating-star.on,
149
+ .ttw-music-player .rating-star.hover {
150
+ background: transparent url(../images/rating-on.png) no-repeat center center scroll;
151
+ }
152
+
153
+ /** Player **/
154
+ .ttw-music-player .player-controls {
155
+ width: 215px;
156
+ height: 30px;
157
+ border-radius: 6px;
158
+ -moz-border-radius: 6px;
159
+ -webkit-border-radius: 6px;
160
+ background: transparent url(../images/player-bg.png) repeat 0 0 scroll;
161
+ float: left;
162
+ margin: 12px 0 0 30px;
163
+ }
164
+
165
+ .ttw-music-player .player-controls .mainc {
166
+ width: 52px;
167
+ height: 12px;
168
+ margin: 9px 9px;
169
+ float: left;
170
+ }
171
+
172
+ .ttw-music-player .player-controls div {
173
+
174
+ float: left;
175
+ cursor: pointer;
176
+ }
177
+
178
+ .ttw-music-player .previous, .ttw-music-player .next {
179
+ height: 10px;
180
+ width: 15px;
181
+ margin: 1px 0;
182
+ }
183
+
184
+ .ttw-music-player .play, .ttw-music-player .pause {
185
+ width: 8px;
186
+ height: 12px;
187
+ margin: 0 7px;
188
+ }
189
+
190
+ .ttw-music-player .previous {
191
+ background: transparent url(../images/player-previous.png) no-repeat center center scroll;
192
+ }
193
+
194
+ .ttw-music-player .next {
195
+ background: transparent url(../images/player-next.png) no-repeat center center scroll;
196
+ }
197
+
198
+ .ttw-music-player .play {
199
+ background: transparent url(../images/player-play.png) no-repeat center center scroll;
200
+ }
201
+
202
+ .ttw-music-player .pause {
203
+ background: transparent url(../images/player-pause.png) no-repeat center center scroll;
204
+ }
205
+
206
+ .ttw-music-player .progress-wrapper {
207
+ height: 9px;
208
+ width: 135px;
209
+ float: left;
210
+ background: transparent url(../images/player-progress.png) repeat-x 0 0 scroll;
211
+ margin: 11px 10px 10px 0;
212
+ border-radius: 4px;
213
+ -moz-border-radius: 4px;
214
+ -webkit-border-radius: 4px;
215
+ }
216
+
217
+ .ttw-music-player .progress {
218
+ height: 9px;
219
+ width: 135px;
220
+ cursor: pointer;
221
+ }
222
+
223
+ .ttw-music-player .elapsed {
224
+ height: 6px;
225
+ border-radius: 3px;
226
+ -moz-border-radius: 3px;
227
+ -webkit-border-radius: 3px;
228
+ margin: 1px;
229
+ width: 60%;
230
+ background: transparent url(../images/player-elapsed.png) repeat-x 0 0 scroll;
231
+ }
232
+
233
+ .ttw-music-player .unused-controls {
234
+ display: none !important;
235
+ }
236
+
237
+ /** Description **/
238
+ .ttw-music-player .description {
239
+ clear: both;
240
+ margin: 30px 0 0 0;
241
+ font-size: 12px;
242
+ color: #999;
243
+ text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
244
+ }
245
+
246
+ .ttw-music-player .description.showing{
247
+ margin:30px 0;
248
+ }
249
+
250
+ /** Track List **/
251
+ .ttw-music-player .tracklist {
252
+ padding: 10px 20px;
253
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .15), 0 1px 0 rgba(255, 255, 255, .04);
254
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .15), 0 1px 0 rgba(255, 255, 255, .04);
255
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .15), 0 1px 0 rgba(255, 255, 255, .04);
256
+ border-radius: 6px;
257
+ -moz-border-radius: 6px;
258
+ -webkit-border-radius: 6px;
259
+ background: transparent url(../images/tracklist-bg.png) repeat 0 0 scroll;
260
+ color: #999;
261
+ font-size: 12px;
262
+ }
263
+
264
+ .ttw-music-player .tracklist ol {
265
+ list-style-type:decimal-leading-zero;
266
+ margin: 0;
267
+ padding: 0;
268
+ overflow:hidden;
269
+ }
270
+
271
+ .ttw-music-player .tracklist li {
272
+ text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
273
+ background: transparent url(../images/tracklist-item-bg.png) repeat-x bottom left scroll;
274
+ padding: 10px 0 10px 0;
275
+ list-style-position: inside;
276
+ position: relative;
277
+ }
278
+
279
+ .ttw-music-player .tracklist li:hover {
280
+ color: #eee;
281
+ }
282
+
283
+ .ttw-music-player li:last-child{
284
+ background: none;
285
+ }
286
+
287
+ .ttw-music-player .show-more-button li:last-child{
288
+ background: transparent url(../images/tracklist-item-bg.png) repeat-x bottom left scroll;
289
+ }
290
+
291
+
292
+
293
+ .ttw-music-player .tracklist .title {
294
+ width: 184px;
295
+ /* width: 154px; */
296
+ display: inline-block;
297
+ padding: 0;
298
+ cursor: pointer;
299
+ }
300
+
301
+ .ttw-music-player li:nth-child(1n + 10) .title{
302
+ /* padding-left:14px; */
303
+ }
304
+
305
+ .ttw-music-player li.playing {
306
+ color:#fff !important;
307
+
308
+ }
309
+
310
+ .ttw-music-player .tracklist .rating {
311
+ margin-left: 5px;
312
+ width: 30px;
313
+ display: none;
314
+ /*display: block;*/
315
+ position: absolute;
316
+ right: 82px;
317
+ top: 12.5px;
318
+ }
319
+
320
+ .ttw-music-player .rating-bar {
321
+ height: 10px;
322
+ width: 3px;
323
+ display: block;
324
+ float: left;
325
+ cursor: pointer;
326
+ background: transparent url(../images/rating-bar.png) no-repeat 0 0 scroll;
327
+ }
328
+
329
+ .ttw-music-player .rating-bar.on,
330
+ .ttw-music-player .rating-bar:hover,
331
+ .ttw-music-player .rating-bar.hover {
332
+ background: transparent url(../images/rating-bar-on.png) no-repeat 0 0 scroll;
333
+ }
334
+
335
+ .ttw-music-player .buy {
336
+ width: 62px;
337
+ height: 16px;
338
+ display: inline-block;
339
+ position: absolute;
340
+ top: 9px;
341
+ right: 14px;
342
+ border-radius: 8px 0 0 8px;
343
+ -moz-border-radius: 8px 0 0 8px;
344
+ -webkit-border-radius: 8px 0 0 8px;
345
+ background: transparent url(../images/buy-bg.png) repeat 0 0 scroll;
346
+ margin: 0 0 0 5px;
347
+ font-size: 10px;
348
+ text-align: center;
349
+ line-height: 16px;
350
+ text-shadow: none;
351
+ color: #999;
352
+ text-decoration: none;
353
+ }
354
+
355
+ .ttw-music-player .buy:hover {
356
+ color: #eee;
357
+ }
358
+
359
+ .ttw-music-player .buy.not-active{
360
+ display:none;
361
+ }
362
+
363
+ .ttw-music-player .option {
364
+ display: inline-block;
365
+ position: absolute;
366
+ top: 10px;
367
+ right: 0;
368
+ border-radius:0 8px 8px 0;
369
+ -moz-border-radius:0 8px 8px 0;
370
+ -webkit-border-radius:0 8px 8px 0;
371
+ background: transparent url(../images/buy-bg.png) repeat 0 0 scroll;
372
+ line-height: 16px;
373
+ }
374
+
375
+
376
+ .ttw-music-player .more {
377
+ display:none;
378
+ font-family: 'Lato Italic', arial, sans-serif;
379
+ font-style: italic;
380
+ font-size: 11px;
381
+ text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
382
+ padding: 10px 0;
383
+ margin: 10px 0;
384
+ cursor: pointer;
385
+ text-align: center;
386
+ border-radius: 6px;
387
+ -moz-border-radius: 6px;
388
+ -webkit-border-radius: 6px;
389
+ background: transparent url(../images/tracklist-more.png) repeat 0 0 scroll;
390
+ }
391
+
392
+ .ttw-music-player .more:hover {
393
+ color: #eee;
394
+ box-shadow: inset 0px 0px 20px rgba(0, 0, 0, .2);
395
+ -moz-box-shadow: inset 0px 0px 20px rgba(0, 0, 0, .2);
396
+ -webkit-box-shadow: inset 0px 0px 20px rgba(0, 0, 0, .2);
397
+ }
398
+
399
+ .ttw-music-player .show-more-button .more{
400
+ display:block;
401
+ color:#F18200;
402
+ }
403
+
404
+
405
+ /** Transitions **/
406
+ .ttw-music-player .more,
407
+ .ttw-music-player .album-cover .highlight,
408
+ .ttw-music-player .tracklist li,
409
+ .ttw-music-player .buy {
410
+ -webkit-transition: all 0.5s ease;
411
+ -moz-transition: all 0.5s ease;
412
+ -o-transition: all 0.5s ease;
413
+ transition: all 0.5s ease;
414
+ }
415
+
416
+ /* http://perishablepress.com/press/2009/12/06/new-clearfix-hack */
417
+ .ttw-music-player .player:after {
418
+ clear: both;
419
+ content: ' ';
420
+ display: block;
421
+ font-size: 0;
422
+ line-height: 0;
423
+ visibility: hidden;
424
+ width: 0;
425
+ height: 0;
426
+ }
427
+
428
+
429
+
js/jquery/plugin/images/album-cover-bg.jpg ADDED
Binary file
js/jquery/plugin/images/album-cover-highlight.png ADDED
Binary file
js/jquery/plugin/images/buy-bg.png ADDED
Binary file
js/jquery/plugin/images/dark_matter.png ADDED
Binary file
js/jquery/plugin/images/description-more.png ADDED
Binary file
js/jquery/plugin/images/player-bg.png ADDED
Binary file
js/jquery/plugin/images/player-elapsed.png ADDED
Binary file
js/jquery/plugin/images/player-next-hover.png ADDED
Binary file
js/jquery/plugin/images/player-next.png ADDED
Binary file
js/jquery/plugin/images/player-pause-hover.png ADDED
Binary file
js/jquery/plugin/images/player-pause.png ADDED
Binary file
js/jquery/plugin/images/player-play-hover.png ADDED
Binary file
js/jquery/plugin/images/player-play.png ADDED
Binary file
js/jquery/plugin/images/player-previous-hover.png ADDED
Binary file
js/jquery/plugin/images/player-previous.png ADDED
Binary file
js/jquery/plugin/images/player-progress.png ADDED
Binary file
js/jquery/plugin/images/rating-bar-on.png ADDED
Binary file
js/jquery/plugin/images/rating-bar.png ADDED
Binary file
js/jquery/plugin/images/rating-off.png ADDED
Binary file
js/jquery/plugin/images/rating-on.png ADDED
Binary file
js/jquery/plugin/images/tracklist-bg.png ADDED
Binary file
js/jquery/plugin/images/tracklist-item-bg.png ADDED
Binary file
js/jquery/plugin/images/tracklist-more.png ADDED
Binary file
js/jquery/plugin/jquery-jplayer/Jplayer.swf ADDED
Binary file
js/jquery/plugin/jquery-jplayer/jquery.jplayer.js ADDED
@@ -0,0 +1,2198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jPlayer Plugin for jQuery JavaScript Library
3
+ * http://www.jplayer.org
4
+ *
5
+ * Copyright (c) 2009 - 2011 Happyworm Ltd
6
+ * Dual licensed under the MIT and GPL licenses.
7
+ * - http://www.opensource.org/licenses/mit-license.php
8
+ * - http://www.gnu.org/copyleft/gpl.html
9
+ *
10
+ * Author: Mark J Panaghiston
11
+ * Version: 2.0.22
12
+ * Date: 13th July 2011
13
+ */
14
+
15
+ /* Code verified using http://www.jshint.com/ */
16
+ /*jshint asi:false, bitwise:false, boss:false, browser:true, curly:true, debug:false, eqeqeq:true, eqnull:false, evil:false, forin:false, immed:false, jquery:true, laxbreak:false, newcap:true, noarg:true, noempty:true, nonew:true, nomem:false, onevar:false, passfail:false, plusplus:false, regexp:false, undef:true, sub:false, strict:false, white:false */
17
+ /*global jQuery:false, ActiveXObject:false, alert:false */
18
+
19
+
20
+ (function($j, undefined) {
21
+
22
+ // Adapted from jquery.ui.widget.js (1.8.7): $.widget.bridge
23
+ $j.fn.jPlayer = function( options ) {
24
+ var name = "jPlayer";
25
+ var isMethodCall = typeof options === "string",
26
+ args = Array.prototype.slice.call( arguments, 1 ),
27
+ returnValue = this;
28
+
29
+ // allow multiple hashes to be passed on init
30
+ options = !isMethodCall && args.length ?
31
+ $j.extend.apply( null, [ true, options ].concat(args) ) :
32
+ options;
33
+
34
+ // prevent calls to internal methods
35
+ if ( isMethodCall && options.charAt( 0 ) === "_" ) {
36
+ return returnValue;
37
+ }
38
+
39
+ if ( isMethodCall ) {
40
+ this.each(function() {
41
+ var instance = $j.data( this, name ),
42
+ methodValue = instance && $j.isFunction( instance[options] ) ?
43
+ instance[ options ].apply( instance, args ) :
44
+ instance;
45
+ if ( methodValue !== instance && methodValue !== undefined ) {
46
+ returnValue = methodValue;
47
+ return false;
48
+ }
49
+ });
50
+ } else {
51
+ this.each(function() {
52
+ var instance = $j.data( this, name );
53
+ if ( instance ) {
54
+ // instance.option( options || {} )._init(); // Orig jquery.ui.widget.js code: Not recommend for jPlayer. ie., Applying new options to an existing instance (via the jPlayer constructor) and performing the _init(). The _init() is what concerns me. It would leave a lot of event handlers acting on jPlayer instance and the interface.
55
+ instance.option( options || {} ); // The new constructor only changes the options. Changing options only has basic support atm.
56
+ } else {
57
+ $j.data( this, name, new $j.jPlayer( options, this ) );
58
+ }
59
+ });
60
+ }
61
+
62
+ return returnValue;
63
+ };
64
+
65
+ $j.jPlayer = function( options, element ) {
66
+ // allow instantiation without initializing for simple inheritance
67
+ if ( arguments.length ) {
68
+ this.element = $j(element);
69
+ this.options = $j.extend(true, {},
70
+ this.options,
71
+ options
72
+ );
73
+ var self = this;
74
+ this.element.bind( "remove.jPlayer", function() {
75
+ self.destroy();
76
+ });
77
+ this._init();
78
+ }
79
+ };
80
+ // End of: (Adapted from jquery.ui.widget.js (1.8.7))
81
+
82
+ // Emulated HTML5 methods and properties
83
+ $j.jPlayer.emulateMethods = "load play pause";
84
+ $j.jPlayer.emulateStatus = "src readyState networkState currentTime duration paused ended playbackRate";
85
+ $j.jPlayer.emulateOptions = "muted volume";
86
+
87
+ // Reserved event names generated by jPlayer that are not part of the HTML5 Media element spec
88
+ $j.jPlayer.reservedEvent = "ready flashreset resize repeat error warning";
89
+
90
+ // Events generated by jPlayer
91
+ $j.jPlayer.event = {
92
+ ready: "jPlayer_ready",
93
+ flashreset: "jPlayer_flashreset", // Similar to the ready event if the Flash solution is set to display:none and then shown again or if it's reloaded for another reason by the browser. For example, using CSS position:fixed on Firefox for the full screen feature.
94
+ resize: "jPlayer_resize", // Occurs when the size changes through a full/restore screen operation or if the size/sizeFull options are changed.
95
+ repeat: "jPlayer_repeat", // Occurs when the repeat status changes. Usually through clicks on the repeat button of the interface.
96
+ error: "jPlayer_error", // Event error code in event.jPlayer.error.type. See $j.jPlayer.error
97
+ warning: "jPlayer_warning", // Event warning code in event.jPlayer.warning.type. See $j.jPlayer.warning
98
+
99
+ // Other events match HTML5 spec.
100
+ loadstart: "jPlayer_loadstart",
101
+ progress: "jPlayer_progress",
102
+ suspend: "jPlayer_suspend",
103
+ abort: "jPlayer_abort",
104
+ emptied: "jPlayer_emptied",
105
+ stalled: "jPlayer_stalled",
106
+ play: "jPlayer_play",
107
+ pause: "jPlayer_pause",
108
+ loadedmetadata: "jPlayer_loadedmetadata",
109
+ loadeddata: "jPlayer_loadeddata",
110
+ waiting: "jPlayer_waiting",
111
+ playing: "jPlayer_playing",
112
+ canplay: "jPlayer_canplay",
113
+ canplaythrough: "jPlayer_canplaythrough",
114
+ seeking: "jPlayer_seeking",
115
+ seeked: "jPlayer_seeked",
116
+ timeupdate: "jPlayer_timeupdate",
117
+ ended: "jPlayer_ended",
118
+ ratechange: "jPlayer_ratechange",
119
+ durationchange: "jPlayer_durationchange",
120
+ volumechange: "jPlayer_volumechange"
121
+ };
122
+
123
+ $j.jPlayer.htmlEvent = [ // These HTML events are bubbled through to the jPlayer event, without any internal action.
124
+ "loadstart",
125
+ // "progress", // jPlayer uses internally before bubbling.
126
+ // "suspend", // jPlayer uses internally before bubbling.
127
+ "abort",
128
+ // "error", // jPlayer uses internally before bubbling.
129
+ "emptied",
130
+ "stalled",
131
+ // "play", // jPlayer uses internally before bubbling.
132
+ // "pause", // jPlayer uses internally before bubbling.
133
+ "loadedmetadata",
134
+ "loadeddata",
135
+ // "waiting", // jPlayer uses internally before bubbling.
136
+ // "playing", // jPlayer uses internally before bubbling.
137
+ "canplay",
138
+ "canplaythrough",
139
+ // "seeking", // jPlayer uses internally before bubbling.
140
+ // "seeked", // jPlayer uses internally before bubbling.
141
+ // "timeupdate", // jPlayer uses internally before bubbling.
142
+ // "ended", // jPlayer uses internally before bubbling.
143
+ "ratechange"
144
+ // "durationchange" // jPlayer uses internally before bubbling.
145
+ // "volumechange" // jPlayer uses internally before bubbling.
146
+ ];
147
+
148
+ $j.jPlayer.pause = function() {
149
+ // $j.each($j.jPlayer.instances, function(i, element) {
150
+ $j.each($j.jPlayer.prototype.instances, function(i, element) {
151
+ if(element.data("jPlayer").status.srcSet) { // Check that media is set otherwise would cause error event.
152
+ element.jPlayer("pause");
153
+ }
154
+ });
155
+ };
156
+
157
+ $j.jPlayer.timeFormat = {
158
+ showHour: false,
159
+ showMin: true,
160
+ showSec: true,
161
+ padHour: false,
162
+ padMin: true,
163
+ padSec: true,
164
+ sepHour: ":",
165
+ sepMin: ":",
166
+ sepSec: ""
167
+ };
168
+
169
+ $j.jPlayer.convertTime = function(s) {
170
+ var myTime = new Date(s * 1000);
171
+ var hour = myTime.getUTCHours();
172
+ var min = myTime.getUTCMinutes();
173
+ var sec = myTime.getUTCSeconds();
174
+ var strHour = ($j.jPlayer.timeFormat.padHour && hour < 10) ? "0" + hour : hour;
175
+ var strMin = ($j.jPlayer.timeFormat.padMin && min < 10) ? "0" + min : min;
176
+ var strSec = ($j.jPlayer.timeFormat.padSec && sec < 10) ? "0" + sec : sec;
177
+ return (($j.jPlayer.timeFormat.showHour) ? strHour + $j.jPlayer.timeFormat.sepHour : "") + (($j.jPlayer.timeFormat.showMin) ? strMin + $j.jPlayer.timeFormat.sepMin : "") + (($j.jPlayer.timeFormat.showSec) ? strSec + $j.jPlayer.timeFormat.sepSec : "");
178
+ };
179
+
180
+ // Adapting jQuery 1.4.4 code for jQuery.browser. Required since jQuery 1.3.2 does not detect Chrome as webkit.
181
+ $j.jPlayer.uaBrowser = function( userAgent ) {
182
+ var ua = userAgent.toLowerCase();
183
+
184
+ // Useragent RegExp
185
+ var rwebkit = /(webkit)[ \/]([\w.]+)/;
186
+ var ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/;
187
+ var rmsie = /(msie) ([\w.]+)/;
188
+ var rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/;
189
+
190
+ var match = rwebkit.exec( ua ) ||
191
+ ropera.exec( ua ) ||
192
+ rmsie.exec( ua ) ||
193
+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
194
+ [];
195
+
196
+ return { browser: match[1] || "", version: match[2] || "0" };
197
+ };
198
+
199
+ // Platform sniffer for detecting mobile devices
200
+ $j.jPlayer.uaPlatform = function( userAgent ) {
201
+ var ua = userAgent.toLowerCase();
202
+
203
+ // Useragent RegExp
204
+ var rplatform = /(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/;
205
+ var rtablet = /(ipad|playbook)/;
206
+ var randroid = /(android)/;
207
+ var rmobile = /(mobile)/;
208
+
209
+ var platform = rplatform.exec( ua ) || [];
210
+ var tablet = rtablet.exec( ua ) ||
211
+ !rmobile.exec( ua ) && randroid.exec( ua ) ||
212
+ [];
213
+
214
+ return { platform: platform[1] || "", tablet: tablet[1] || "" };
215
+ };
216
+
217
+ $j.jPlayer.browser = {
218
+ };
219
+ $j.jPlayer.platform = {
220
+ };
221
+
222
+ var browserMatch = $j.jPlayer.uaBrowser(navigator.userAgent);
223
+ if ( browserMatch.browser ) {
224
+ $j.jPlayer.browser[ browserMatch.browser ] = true;
225
+ $j.jPlayer.browser.version = browserMatch.version;
226
+ }
227
+ var platformMatch = $j.jPlayer.uaPlatform(navigator.userAgent);
228
+ if ( platformMatch.platform ) {
229
+ $j.jPlayer.platform[ platformMatch.platform ] = true;
230
+ $j.jPlayer.platform.mobile = !platformMatch.tablet;
231
+ $j.jPlayer.platform.tablet = !!platformMatch.tablet;
232
+ }
233
+
234
+ $j.jPlayer.prototype = {
235
+ count: 0, // Static Variable: Change it via prototype.
236
+ version: { // Static Object
237
+ script: "2.0.22",
238
+ needFlash: "2.0.9",
239
+ flash: "unknown"
240
+ },
241
+ options: { // Instanced in $j.jPlayer() constructor
242
+ swfPath: "js", // Path to Jplayer.swf. Can be relative, absolute or server root relative.
243
+ solution: "html, flash", // Valid solutions: html, flash. Order defines priority. 1st is highest,
244
+ supplied: "mp3", // Defines which formats jPlayer will try and support and the priority by the order. 1st is highest,
245
+ preload: 'metadata', // HTML5 Spec values: none, metadata, auto.
246
+ volume: 0.8, // The volume. Number 0 to 1.
247
+ muted: false,
248
+ wmode: "opaque", // Valid wmode: window, transparent, opaque, direct, gpu.
249
+ backgroundColor: "#000000", // To define the jPlayer div and Flash background color.
250
+ cssSelectorAncestor: "#jp_container_1",
251
+ cssSelector: { // * denotes properties that should only be required when video media type required. _cssSelector() would require changes to enable splitting these into Audio and Video defaults.
252
+ videoPlay: ".jp-video-play", // *
253
+ play: ".jp-play",
254
+ pause: ".jp-pause",
255
+ stop: ".jp-stop",
256
+ seekBar: ".jp-seek-bar",
257
+ playBar: ".jp-play-bar",
258
+ mute: ".jp-mute",
259
+ unmute: ".jp-unmute",
260
+ volumeBar: ".jp-volume-bar",
261
+ volumeBarValue: ".jp-volume-bar-value",
262
+ volumeMax: ".jp-volume-max",
263
+ currentTime: ".jp-current-time",
264
+ duration: ".jp-duration",
265
+ fullScreen: ".jp-full-screen", // *
266
+ restoreScreen: ".jp-restore-screen", // *
267
+ repeat: ".jp-repeat",
268
+ repeatOff: ".jp-repeat-off",
269
+ gui: ".jp-gui" // The interface used with autohide feature.
270
+ },
271
+ fullScreen: false,
272
+ autohide: {
273
+ restored: false, // Controls the interface autohide feature.
274
+ full: true, // Controls the interface autohide feature.
275
+ fadeIn: 200, // Milliseconds. The period of the fadeIn anim.
276
+ fadeOut: 600, // Milliseconds. The period of the fadeOut anim.
277
+ hold: 1000 // Milliseconds. The period of the pause before autohide beings.
278
+ },
279
+ loop: false,
280
+ repeat: function(event) { // The default jPlayer repeat event handler
281
+ if(event.jPlayer.options.loop) {
282
+ $j(this).unbind(".jPlayerRepeat").bind($j.jPlayer.event.ended + ".jPlayer.jPlayerRepeat", function() {
283
+ $j(this).jPlayer("play");
284
+ });
285
+ } else {
286
+ $j(this).unbind(".jPlayerRepeat");
287
+ }
288
+ },
289
+ // globalVolume: false, // Not implemented: Set to make volume changes affect all jPlayer instances
290
+ // globalMute: false, // Not implemented: Set to make mute changes affect all jPlayer instances
291
+ idPrefix: "jp", // Prefix for the ids of html elements created by jPlayer. For flash, this must not include characters: . - + * / \
292
+ noConflict: "jQuery",
293
+ emulateHtml: false, // Emulates the HTML5 Media element on the jPlayer element.
294
+ errorAlerts: false,
295
+ warningAlerts: false
296
+ },
297
+ optionsAudio: {
298
+ size: {
299
+ width: "0px",
300
+ height: "0px",
301
+ cssClass: ""
302
+ },
303
+ sizeFull: {
304
+ width: "0px",
305
+ height: "0px",
306
+ cssClass: ""
307
+ }
308
+ },
309
+ optionsVideo: {
310
+ size: {
311
+ width: "480px",
312
+ height: "270px",
313
+ cssClass: "jp-video-270p"
314
+ },
315
+ sizeFull: {
316
+ width: "100%",
317
+ height: "100%",
318
+ cssClass: "jp-video-full"
319
+ }
320
+ },
321
+ instances: {}, // Static Object
322
+ status: { // Instanced in _init()
323
+ src: "",
324
+ media: {},
325
+ paused: true,
326
+ format: {},
327
+ formatType: "",
328
+ waitForPlay: true, // Same as waitForLoad except in case where preloading.
329
+ waitForLoad: true,
330
+ srcSet: false,
331
+ video: false, // True if playing a video
332
+ seekPercent: 0,
333
+ currentPercentRelative: 0,
334
+ currentPercentAbsolute: 0,
335
+ currentTime: 0,
336
+ duration: 0,
337
+ readyState: 0,
338
+ networkState: 0,
339
+ playbackRate: 1,
340
+ ended: 0
341
+
342
+ /* Persistant status properties created dynamically at _init():
343
+ width
344
+ height
345
+ cssClass
346
+ */
347
+ },
348
+
349
+ internal: { // Instanced in _init()
350
+ ready: false
351
+ // instance: undefined,
352
+ // domNode: undefined,
353
+ // htmlDlyCmdId: undefined
354
+ // autohideId: undefined
355
+ },
356
+ solution: { // Static Object: Defines the solutions built in jPlayer.
357
+ html: true,
358
+ flash: true
359
+ },
360
+ // 'MPEG-4 support' : canPlayType('video/mp4; codecs="mp4v.20.8"')
361
+ format: { // Static Object
362
+ mp3: {
363
+ codec: 'audio/mpeg; codecs="mp3"',
364
+ flashCanPlay: true,
365
+ media: 'audio'
366
+ },
367
+ m4a: { // AAC / MP4
368
+ codec: 'audio/mp4; codecs="mp4a.40.2"',
369
+ flashCanPlay: true,
370
+ media: 'audio'
371
+ },
372
+ oga: { // OGG
373
+ codec: 'audio/ogg; codecs="vorbis"',
374
+ flashCanPlay: false,
375
+ media: 'audio'
376
+ },
377
+ wav: { // PCM
378
+ codec: 'audio/wav; codecs="1"',
379
+ flashCanPlay: false,
380
+ media: 'audio'
381
+ },
382
+ webma: { // WEBM
383
+ codec: 'audio/webm; codecs="vorbis"',
384
+ flashCanPlay: false,
385
+ media: 'audio'
386
+ },
387
+ fla: { // FLV / F4A
388
+ codec: 'audio/x-flv',
389
+ flashCanPlay: true,
390
+ media: 'audio'
391
+ },
392
+ m4v: { // H.264 / MP4
393
+ codec: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',
394
+ flashCanPlay: true,
395
+ media: 'video'
396
+ },
397
+ ogv: { // OGG
398
+ codec: 'video/ogg; codecs="theora, vorbis"',
399
+ flashCanPlay: false,
400
+ media: 'video'
401
+ },
402
+ webmv: { // WEBM
403
+ codec: 'video/webm; codecs="vorbis, vp8"',
404
+ flashCanPlay: false,
405
+ media: 'video'
406
+ },
407
+ flv: { // FLV / F4V
408
+ codec: 'video/x-flv',
409
+ flashCanPlay: true,
410
+ media: 'video'
411
+ }
412
+ },
413
+ _init: function() {
414
+ var self = this;
415
+
416
+ this.element.empty();
417
+
418
+ this.status = $j.extend({}, this.status); // Copy static to unique instance.
419
+ this.internal = $j.extend({}, this.internal); // Copy static to unique instance.
420
+
421
+ this.internal.domNode = this.element.get(0);
422
+
423
+ this.formats = []; // Array based on supplied string option. Order defines priority.
424
+ this.solutions = []; // Array based on solution string option. Order defines priority.
425
+ this.require = {}; // Which media types are required: video, audio.
426
+
427
+ this.htmlElement = {}; // DOM elements created by jPlayer
428
+ this.html = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array.
429
+ this.html.audio = {};
430
+ this.html.video = {};
431
+ this.flash = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array.
432
+
433
+ this.css = {};
434
+ this.css.cs = {}; // Holds the css selector strings
435
+ this.css.jq = {}; // Holds jQuery selectors. ie., $j(css.cs.method)
436
+
437
+ this.ancestorJq = []; // Holds jQuery selector of cssSelectorAncestor. Init would use $j() instead of [], but it is only 1.4+
438
+
439
+ this.options.volume = this._limitValue(this.options.volume, 0, 1); // Limit volume value's bounds.
440
+
441
+ // Create the formats array, with prority based on the order of the supplied formats string
442
+ $j.each(this.options.supplied.toLowerCase().split(","), function(index1, value1) {
443
+ var format = value1.replace(/^\s+|\s+$/g, ""); //trim
444
+ if(self.format[format]) { // Check format is valid.
445
+ var dupFound = false;
446
+ $j.each(self.formats, function(index2, value2) { // Check for duplicates
447
+ if(format === value2) {
448
+ dupFound = true;
449
+ return false;
450
+ }
451
+ });
452
+ if(!dupFound) {
453
+ self.formats.push(format);
454
+ }
455
+ }
456
+ });
457
+
458
+ // Create the solutions array, with prority based on the order of the solution string
459
+ $j.each(this.options.solution.toLowerCase().split(","), function(index1, value1) {
460
+ var solution = value1.replace(/^\s+|\s+$/g, ""); //trim
461
+ if(self.solution[solution]) { // Check solution is valid.
462
+ var dupFound = false;
463
+ $j.each(self.solutions, function(index2, value2) { // Check for duplicates
464
+ if(solution === value2) {
465
+ dupFound = true;
466
+ return false;
467
+ }
468
+ });
469
+ if(!dupFound) {
470
+ self.solutions.push(solution);
471
+ }
472
+ }
473
+ });
474
+
475
+ this.internal.instance = "jp_" + this.count;
476
+ this.instances[this.internal.instance] = this.element;
477
+
478
+ // Check the jPlayer div has an id and create one if required. Important for Flash to know the unique id for comms.
479
+ if(!this.element.attr("id")) {
480
+ this.element.attr("id", this.options.idPrefix + "_jplayer_" + this.count);
481
+ }
482
+
483
+ this.internal.self = $j.extend({}, {
484
+ id: this.element.attr("id"),
485
+ jq: this.element
486
+ });
487
+ this.internal.audio = $j.extend({}, {
488
+ id: this.options.idPrefix + "_audio_" + this.count,
489
+ jq: undefined
490
+ });
491
+ this.internal.video = $j.extend({}, {
492
+ id: this.options.idPrefix + "_video_" + this.count,
493
+ jq: undefined
494
+ });
495
+ this.internal.flash = $j.extend({}, {
496
+ id: this.options.idPrefix + "_flash_" + this.count,
497
+ jq: undefined,
498
+ swf: this.options.swfPath + ((this.options.swfPath !== "" && this.options.swfPath.slice(-1) !== "/") ? "/" : "") + "Jplayer.swf"
499
+ });
500
+ this.internal.poster = $j.extend({}, {
501
+ id: this.options.idPrefix + "_poster_" + this.count,
502
+ jq: undefined
503
+ });
504
+
505
+ // Register listeners defined in the constructor
506
+ $j.each($j.jPlayer.event, function(eventName,eventType) {
507
+ if(self.options[eventName] !== undefined) {
508
+ self.element.bind(eventType + ".jPlayer", self.options[eventName]); // With .jPlayer namespace.
509
+ self.options[eventName] = undefined; // Destroy the handler pointer copy on the options. Reason, events can be added/removed in other ways so this could be obsolete and misleading.
510
+ }
511
+ });
512
+
513
+ // Determine if we require solutions for audio, video or both media types.
514
+ this.require.audio = false;
515
+ this.require.video = false;
516
+ $j.each(this.formats, function(priority, format) {
517
+ self.require[self.format[format].media] = true;
518
+ });
519
+
520
+ // Now required types are known, finish the options default settings.
521
+ if(this.require.video) {
522
+ this.options = $j.extend(true, {},
523
+ this.optionsVideo,
524
+ this.options
525
+ );
526
+ } else {
527
+ this.options = $j.extend(true, {},
528
+ this.optionsAudio,
529
+ this.options
530
+ );
531
+ }
532
+ this._setSize(); // update status and jPlayer element size
533
+
534
+ // Create the poster image.
535
+ this.htmlElement.poster = document.createElement('img');
536
+ this.htmlElement.poster.id = this.internal.poster.id;
537
+ this.htmlElement.poster.onload = function() { // Note that this did not work on Firefox 3.6: poster.addEventListener("onload", function() {}, false); Did not investigate x-browser.
538
+ if(!self.status.video || self.status.waitForPlay) {
539
+ self.internal.poster.jq.show();
540
+ }
541
+ };
542
+ this.element.append(this.htmlElement.poster);
543
+ this.internal.poster.jq = $j("#" + this.internal.poster.id);
544
+ this.internal.poster.jq.css({'width': this.status.width, 'height': this.status.height});
545
+ this.internal.poster.jq.hide();
546
+
547
+ // Generate the required media elements
548
+ this.html.audio.available = false;
549
+ if(this.require.audio) { // If a supplied format is audio
550
+ this.htmlElement.audio = document.createElement('audio');
551
+ this.htmlElement.audio.id = this.internal.audio.id;
552
+ this.html.audio.available = !!this.htmlElement.audio.canPlayType;
553
+ }
554
+ this.html.video.available = false;
555
+ if(this.require.video) { // If a supplied format is video
556
+ this.htmlElement.video = document.createElement('video');
557
+ this.htmlElement.video.id = this.internal.video.id;
558
+ this.html.video.available = !!this.htmlElement.video.canPlayType;
559
+ }
560
+
561
+ this.flash.available = this._checkForFlash(10);
562
+
563
+ this.html.canPlay = {};
564
+ this.flash.canPlay = {};
565
+ $j.each(this.formats, function(priority, format) {
566
+ self.html.canPlay[format] = self.html[self.format[format].media].available && "" !== self.htmlElement[self.format[format].media].canPlayType(self.format[format].codec);
567
+ self.flash.canPlay[format] = self.format[format].flashCanPlay && self.flash.available;
568
+ });
569
+ this.html.desired = false;
570
+ this.flash.desired = false;
571
+ $j.each(this.solutions, function(solutionPriority, solution) {
572
+ if(solutionPriority === 0) {
573
+ self[solution].desired = true;
574
+ } else {
575
+ var audioCanPlay = false;
576
+ var videoCanPlay = false;
577
+ $j.each(self.formats, function(formatPriority, format) {
578
+ if(self[self.solutions[0]].canPlay[format]) { // The other solution can play
579
+ if(self.format[format].media === 'video') {
580
+ videoCanPlay = true;
581
+ } else {
582
+ audioCanPlay = true;
583
+ }
584
+ }
585
+ });
586
+ self[solution].desired = (self.require.audio && !audioCanPlay) || (self.require.video && !videoCanPlay);
587
+ }
588
+ });
589
+ // This is what jPlayer will support, based on solution and supplied.
590
+ this.html.support = {};
591
+ this.flash.support = {};
592
+ $j.each(this.formats, function(priority, format) {
593
+ self.html.support[format] = self.html.canPlay[format] && self.html.desired;
594
+ self.flash.support[format] = self.flash.canPlay[format] && self.flash.desired;
595
+ });
596
+ // If jPlayer is supporting any format in a solution, then the solution is used.
597
+ this.html.used = false;
598
+ this.flash.used = false;
599
+ $j.each(this.solutions, function(solutionPriority, solution) {
600
+ $j.each(self.formats, function(formatPriority, format) {
601
+ if(self[solution].support[format]) {
602
+ self[solution].used = true;
603
+ return false;
604
+ }
605
+ });
606
+ });
607
+
608
+ // Init solution active state and the event gates to false.
609
+ this.html.active = false;
610
+ this.html.audio.gate = false;
611
+ this.html.video.gate = false;
612
+ this.flash.active = false;
613
+ this.flash.gate = false;
614
+
615
+ // Set up the css selectors for the control and feedback entities.
616
+ this._cssSelectorAncestor(this.options.cssSelectorAncestor);
617
+
618
+ // If neither html nor flash are being used by this browser, then media playback is not possible. Trigger an error event.
619
+ if(!(this.html.used || this.flash.used)) {
620
+ this._error( {
621
+ type: $j.jPlayer.error.NO_SOLUTION,
622
+ context: "{solution:'" + this.options.solution + "', supplied:'" + this.options.supplied + "'}",
623
+ message: $j.jPlayer.errorMsg.NO_SOLUTION,
624
+ hint: $j.jPlayer.errorHint.NO_SOLUTION
625
+ });
626
+ }
627
+
628
+ // Add the flash solution if it is being used.
629
+ if(this.flash.used) {
630
+ var htmlObj,
631
+ flashVars = 'jQuery=' + encodeURI(this.options.noConflict) + '&id=' + encodeURI(this.internal.self.id) + '&vol=' + this.options.volume + '&muted=' + this.options.muted;
632
+
633
+ // Code influenced by SWFObject 2.2: http://code.google.com/p/swfobject/
634
+ // Non IE browsers have an initial Flash size of 1 by 1 otherwise the wmode affected the Flash ready event.
635
+
636
+ if($j.browser.msie && Number($j.browser.version) <= 8) {
637
+ var objStr = '<object id="' + this.internal.flash.id + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0"></object>';
638
+
639
+ var paramStr = [
640
+ '<param name="movie" value="' + this.internal.flash.swf + '" />',
641
+ '<param name="FlashVars" value="' + flashVars + '" />',
642
+ '<param name="allowScriptAccess" value="always" />',
643
+ '<param name="bgcolor" value="' + this.options.backgroundColor + '" />',
644
+ '<param name="wmode" value="' + this.options.wmode + '" />'
645
+ ];
646
+
647
+ htmlObj = document.createElement(objStr);
648
+ for(var i=0; i < paramStr.length; i++) {
649
+ htmlObj.appendChild(document.createElement(paramStr[i]));
650
+ }
651
+ } else {
652
+ var createParam = function(el, n, v) {
653
+ var p = document.createElement("param");
654
+ p.setAttribute("name", n);
655
+ p.setAttribute("value", v);
656
+ el.appendChild(p);
657
+ };
658
+
659
+ htmlObj = document.createElement("object");
660
+ htmlObj.setAttribute("id", this.internal.flash.id);
661
+ htmlObj.setAttribute("data", this.internal.flash.swf);
662
+ htmlObj.setAttribute("type", "application/x-shockwave-flash");
663
+ htmlObj.setAttribute("width", "1"); // Non-zero
664
+ htmlObj.setAttribute("height", "1"); // Non-zero
665
+ createParam(htmlObj, "flashvars", flashVars);
666
+ createParam(htmlObj, "allowscriptaccess", "always");
667
+ createParam(htmlObj, "bgcolor", this.options.backgroundColor);
668
+ createParam(htmlObj, "wmode", this.options.wmode);
669
+ }
670
+
671
+ this.element.append(htmlObj);
672
+ this.internal.flash.jq = $j(htmlObj);
673
+ }
674
+
675
+ // Add the HTML solution if being used.
676
+ if(this.html.used) {
677
+
678
+ // The HTML Audio handlers
679
+ if(this.html.audio.available) {
680
+ this._addHtmlEventListeners(this.htmlElement.audio, this.html.audio);
681
+ this.element.append(this.htmlElement.audio);
682
+ this.internal.audio.jq = $j("#" + this.internal.audio.id);
683
+ }
684
+
685
+ // The HTML Video handlers
686
+ if(this.html.video.available) {
687
+ this._addHtmlEventListeners(this.htmlElement.video, this.html.video);
688
+ this.element.append(this.htmlElement.video);
689
+ this.internal.video.jq = $j("#" + this.internal.video.id);
690
+ this.internal.video.jq.css({'width':'0px', 'height':'0px'}); // Using size 0x0 since a .hide() causes issues in iOS
691
+ }
692
+ }
693
+
694
+ // Create the bridge that emulates the HTML Media element on the jPlayer DIV
695
+ if( this.options.emulateHtml ) {
696
+ this._emulateHtmlBridge();
697
+ }
698
+
699
+ if(this.html.used && !this.flash.used) { // If only HTML, then emulate flash ready() call after 100ms.
700
+ setTimeout( function() {
701
+ self.internal.ready = true;
702
+ self.version.flash = "n/a";
703
+ self._trigger($j.jPlayer.event.repeat); // Trigger the repeat event so its handler can initialize itself with the loop option.
704
+ self._trigger($j.jPlayer.event.ready);
705
+ }, 100);
706
+ }
707
+
708
+ // Initialize the interface components with the options.
709
+ this._updateInterface();
710
+ this._updateButtons(false);
711
+ this._updateAutohide();
712
+ this._updateVolume(this.options.volume);
713
+ this._updateMute(this.options.muted);
714
+ if(this.css.jq.videoPlay.length) {
715
+ this.css.jq.videoPlay.hide();
716
+ }
717
+
718
+ $j.jPlayer.prototype.count++; // Change static variable via prototype.
719
+ },
720
+ destroy: function() {
721
+ // MJP: The background change remains. Would need to store the original to restore it correctly.
722
+
723
+ // Reset the interface, remove seeking effect and times.
724
+ this._resetStatus();
725
+ this._updateInterface();
726
+ this._seeked();
727
+ if(this.css.jq.currentTime.length) {
728
+ this.css.jq.currentTime.text("");
729
+ }
730
+ if(this.css.jq.duration.length) {
731
+ this.css.jq.duration.text("");
732
+ }
733
+
734
+ if(this.status.srcSet) { // Or you get a bogus error event
735
+ this.pause(); // Pauses the media and clears any delayed commands used in the HTML solution.
736
+ }
737
+ $j.each(this.css.jq, function(fn, jq) { // Remove any bindings from the interface controls.
738
+ // Check selector is valid before trying to execute method.
739
+ if(jq.length) {
740
+ jq.unbind(".jPlayer");
741
+ }
742
+ });
743
+ if( this.options.emulateHtml ) {
744
+ this._destroyHtmlBridge();
745
+ }
746
+ this.element.removeData("jPlayer"); // Remove jPlayer data
747
+ this.element.unbind(".jPlayer"); // Remove all event handlers created by the jPlayer constructor
748
+ this.element.empty(); // Remove the inserted child elements
749
+
750
+ this.instances[this.internal.instance] = undefined; // Clear the instance on the static instance object
751
+ },
752
+ enable: function() { // Plan to implement
753
+ // options.disabled = false
754
+ },
755
+ disable: function () { // Plan to implement
756
+ // options.disabled = true
757
+ },
758
+ _addHtmlEventListeners: function(mediaElement, entity) {
759
+ var self = this;
760
+ mediaElement.preload = this.options.preload;
761
+ mediaElement.muted = this.options.muted;
762
+ mediaElement.volume = this.options.volume;
763
+
764
+ // Create the event listeners
765
+ // Only want the active entity to affect jPlayer and bubble events.
766
+ // Using entity.gate so that object is referenced and gate property always current
767
+
768
+ mediaElement.addEventListener("progress", function() {
769
+ if(entity.gate && !self.status.waitForLoad) {
770
+ self._getHtmlStatus(mediaElement);
771
+ self._updateInterface();
772
+ self._trigger($j.jPlayer.event.progress);
773
+ }
774
+ }, false);
775
+ mediaElement.addEventListener("timeupdate", function() {
776
+ if(entity.gate && !self.status.waitForLoad) {
777
+ self._getHtmlStatus(mediaElement);
778
+ self._updateInterface();
779
+ self._trigger($j.jPlayer.event.timeupdate);
780
+ }
781
+ }, false);
782
+ mediaElement.addEventListener("durationchange", function() {
783
+ if(entity.gate && !self.status.waitForLoad) {
784
+ self.status.duration = this.duration;
785
+ self._getHtmlStatus(mediaElement);
786
+ self._updateInterface();
787
+ self._trigger($j.jPlayer.event.durationchange);
788
+ }
789
+ }, false);
790
+ mediaElement.addEventListener("play", function() {
791
+ if(entity.gate && !self.status.waitForLoad) {
792
+ self._updateButtons(true);
793
+ self._trigger($j.jPlayer.event.play);
794
+ }
795
+ }, false);
796
+ mediaElement.addEventListener("playing", function() {
797
+ if(entity.gate && !self.status.waitForLoad) {
798
+ self._updateButtons(true);
799
+ self._seeked();
800
+ self._trigger($j.jPlayer.event.playing);
801
+ }
802
+ }, false);
803
+ mediaElement.addEventListener("pause", function() {
804
+ if(entity.gate && !self.status.waitForLoad) {
805
+ self._updateButtons(false);
806
+ self._trigger($j.jPlayer.event.pause);
807
+ }
808
+ }, false);
809
+ mediaElement.addEventListener("waiting", function() {
810
+ if(entity.gate && !self.status.waitForLoad) {
811
+ self._seeking();
812
+ self._trigger($j.jPlayer.event.waiting);
813
+ }
814
+ }, false);
815
+ mediaElement.addEventListener("seeking", function() {
816
+ if(entity.gate && !self.status.waitForLoad) {
817
+ self._seeking();
818
+ self._trigger($j.jPlayer.event.seeking);
819
+ }
820
+ }, false);
821
+ mediaElement.addEventListener("seeked", function() {
822
+ if(entity.gate && !self.status.waitForLoad) {
823
+ self._seeked();
824
+ self._trigger($j.jPlayer.event.seeked);
825
+ }
826
+ }, false);
827
+ mediaElement.addEventListener("volumechange", function() {
828
+ if(entity.gate && !self.status.waitForLoad) {
829
+ // Read the values back from the element as the Blackberry PlayBook shares the volume with the physical buttons master volume control.
830
+ // However, when tested 6th July 2011, those buttons do not generate an event. The physical play/pause button does though.
831
+ self.options.volume = mediaElement.volume;
832
+ self.options.muted = mediaElement.muted;
833
+ self._updateMute();
834
+ self._updateVolume();
835
+ self._trigger($j.jPlayer.event.volumechange);
836
+ }
837
+ }, false);
838
+ mediaElement.addEventListener("suspend", function() { // Seems to be the only way of capturing that the iOS4 browser did not actually play the media from the page code. ie., It needs a user gesture.
839
+ if(entity.gate && !self.status.waitForLoad) {
840
+ self._seeked();
841
+ self._trigger($j.jPlayer.event.suspend);
842
+ }
843
+ }, false);
844
+ mediaElement.addEventListener("ended", function() {
845
+ if(entity.gate && !self.status.waitForLoad) {
846
+ // Order of the next few commands are important. Change the time and then pause.
847
+ // Solves a bug in Firefox, where issuing pause 1st causes the media to play from the start. ie., The pause is ignored.
848
+ if(!$j.jPlayer.browser.webkit) { // Chrome crashes if you do this in conjunction with a setMedia command in an ended event handler. ie., The playlist demo.
849
+ self.htmlElement.media.currentTime = 0; // Safari does not care about this command. ie., It works with or without this line. (Both Safari and Chrome are Webkit.)
850
+ }
851
+ self.htmlElement.media.pause(); // Pause otherwise a click on the progress bar will play from that point, when it shouldn't, since it stopped playback.
852
+ self._updateButtons(false);
853
+ self._getHtmlStatus(mediaElement, true); // With override true. Otherwise Chrome leaves progress at full.
854
+ self._updateInterface();
855
+ self._trigger($j.jPlayer.event.ended);
856
+ }
857
+ }, false);
858
+ mediaElement.addEventListener("error", function() {
859
+ if(entity.gate && !self.status.waitForLoad) {
860
+ self._updateButtons(false);
861
+ self._seeked();
862
+ if(self.status.srcSet) { // Deals with case of clearMedia() causing an error event.
863
+ clearTimeout(self.internal.htmlDlyCmdId); // Clears any delayed commands used in the HTML solution.
864
+ self.status.waitForLoad = true; // Allows the load operation to try again.
865
+ self.status.waitForPlay = true; // Reset since a play was captured.
866
+ if(self.status.video) {
867
+ self.internal.video.jq.css({'width':'0px', 'height':'0px'});
868
+ }
869
+ if(self._validString(self.status.media.poster)) {
870
+ self.internal.poster.jq.show();
871
+ }
872
+ if(self.css.jq.videoPlay.length) {
873
+ self.css.jq.videoPlay.show();
874
+ }
875
+ self._error( {
876
+ type: $j.jPlayer.error.URL,
877
+ context: self.status.src, // this.src shows absolute urls. Want context to show the url given.
878
+ message: $j.jPlayer.errorMsg.URL,
879
+ hint: $j.jPlayer.errorHint.URL
880
+ });
881
+ }
882
+ }
883
+ }, false);
884
+ // Create all the other event listeners that bubble up to a jPlayer event from html, without being used by jPlayer.
885
+ $j.each($j.jPlayer.htmlEvent, function(i, eventType) {
886
+ mediaElement.addEventListener(this, function() {
887
+ if(entity.gate && !self.status.waitForLoad) {
888
+ self._trigger($j.jPlayer.event[eventType]);
889
+ }
890
+ }, false);
891
+ });
892
+ },
893
+ _getHtmlStatus: function(media, override) {
894
+ var ct = 0, d = 0, cpa = 0, sp = 0, cpr = 0;
895
+
896
+ if(media.duration) { // Fixes the duration bug in iOS, where the durationchange event occurs when media.duration is not always correct.
897
+ this.status.duration = media.duration;
898
+ }
899
+ ct = media.currentTime;
900
+ cpa = (this.status.duration > 0) ? 100 * ct / this.status.duration : 0;
901
+ if((typeof media.seekable === "object") && (media.seekable.length > 0)) {
902
+ sp = (this.status.duration > 0) ? 100 * media.seekable.end(media.seekable.length-1) / this.status.duration : 100;
903
+ cpr = 100 * media.currentTime / media.seekable.end(media.seekable.length-1);
904
+ } else {
905
+ sp = 100;
906
+ cpr = cpa;
907
+ }
908
+
909
+ if(override) {
910
+ ct = 0;
911
+ cpr = 0;
912
+ cpa = 0;
913
+ }
914
+
915
+ this.status.seekPercent = sp;
916
+ this.status.currentPercentRelative = cpr;
917
+ this.status.currentPercentAbsolute = cpa;
918
+ this.status.currentTime = ct;
919
+
920
+ this.status.readyState = media.readyState;
921
+ this.status.networkState = media.networkState;
922
+ this.status.playbackRate = media.playbackRate;
923
+ this.status.ended = media.ended;
924
+ },
925
+ _resetStatus: function() {
926
+ this.status = $j.extend({}, this.status, $j.jPlayer.prototype.status); // Maintains the status properties that persist through a reset.
927
+ },
928
+ _trigger: function(eventType, error, warning) { // eventType always valid as called using $j.jPlayer.event.eventType
929
+ var event = $j.Event(eventType);
930
+ event.jPlayer = {};
931
+ event.jPlayer.version = $j.extend({}, this.version);
932
+ event.jPlayer.options = $j.extend(true, {}, this.options); // Deep copy
933
+ event.jPlayer.status = $j.extend(true, {}, this.status); // Deep copy
934
+ event.jPlayer.html = $j.extend(true, {}, this.html); // Deep copy
935
+ event.jPlayer.flash = $j.extend(true, {}, this.flash); // Deep copy
936
+ if(error) {
937
+ event.jPlayer.error = $j.extend({}, error);
938
+ }
939
+ if(warning) {
940
+ event.jPlayer.warning = $j.extend({}, warning);
941
+ }
942
+ this.element.trigger(event);
943
+ },
944
+ jPlayerFlashEvent: function(eventType, status) { // Called from Flash
945
+ if(eventType === $j.jPlayer.event.ready) {
946
+ if(!this.internal.ready) {
947
+ this.internal.ready = true;
948
+ this.internal.flash.jq.css({'width':'0px', 'height':'0px'}); // Once Flash generates the ready event, minimise to zero as it is not affected by wmode anymore.
949
+
950
+ this.version.flash = status.version;
951
+ if(this.version.needFlash !== this.version.flash) {
952
+ this._error( {
953
+ type: $j.jPlayer.error.VERSION,
954
+ context: this.version.flash,
955
+ message: $j.jPlayer.errorMsg.VERSION + this.version.flash,
956
+ hint: $j.jPlayer.errorHint.VERSION
957
+ });
958
+ }
959
+ this._trigger($j.jPlayer.event.repeat); // Trigger the repeat event so its handler can initialize itself with the loop option.
960
+ this._trigger(eventType);
961
+ } else {
962
+ // This condition occurs if the Flash is hidden and then shown again.
963
+ // Firefox also reloads the Flash if the CSS position changes. position:fixed is used for full screen.
964
+
965
+ // Only do this if the Flash is the solution being used at the moment. Affects Media players where both solution may be being used.
966
+ if(this.flash.gate) {
967
+
968
+ // Send the current status to the Flash now that it is ready (available) again.
969
+ if(this.status.srcSet) {
970
+
971
+ // Need to read original status before issuing the setMedia command.
972
+ var currentTime = this.status.currentTime,
973
+ paused = this.status.paused;
974
+
975
+ this.setMedia(this.status.media);
976
+ if(currentTime > 0) {
977
+ if(paused) {
978
+ this.pause(currentTime);
979
+ } else {
980
+ this.play(currentTime);
981
+ }
982
+ }
983
+ }
984
+ this._trigger($j.jPlayer.event.flashreset);
985
+ }
986
+ }
987
+ }
988
+ if(this.flash.gate) {
989
+ switch(eventType) {
990
+ case $j.jPlayer.event.progress:
991
+ this._getFlashStatus(status);
992
+ this._updateInterface();
993
+ this._trigger(eventType);
994
+ break;
995
+ case $j.jPlayer.event.timeupdate:
996
+ this._getFlashStatus(status);
997
+ this._updateInterface();
998
+ this._trigger(eventType);
999
+ break;
1000
+ case $j.jPlayer.event.play:
1001
+ this._seeked();
1002
+ this._updateButtons(true);
1003
+ this._trigger(eventType);
1004
+ break;
1005
+ case $j.jPlayer.event.pause:
1006
+ this._updateButtons(false);
1007
+ this._trigger(eventType);
1008
+ break;
1009
+ case $j.jPlayer.event.ended:
1010
+ this._updateButtons(false);
1011
+ this._trigger(eventType);
1012
+ break;
1013
+ case $j.jPlayer.event.error:
1014
+ this.status.waitForLoad = true; // Allows the load operation to try again.
1015
+ this.status.waitForPlay = true; // Reset since a play was captured.
1016
+ if(this.status.video) {
1017
+ this.internal.flash.jq.css({'width':'0px', 'height':'0px'});
1018
+ }
1019
+ if(this._validString(this.status.media.poster)) {
1020
+ this.internal.poster.jq.show();
1021
+ }
1022
+ if(this.css.jq.videoPlay.length) {
1023
+ this.css.jq.videoPlay.show();
1024
+ }
1025
+ if(this.status.video) { // Set up for another try. Execute before error event.
1026
+ this._flash_setVideo(this.status.media);
1027
+ } else {
1028
+ this._flash_setAudio(this.status.media);
1029
+ }
1030
+ this._error( {
1031
+ type: $j.jPlayer.error.URL,
1032
+ context:status.src,
1033
+ message: $j.jPlayer.errorMsg.URL,
1034
+ hint: $j.jPlayer.errorHint.URL
1035
+ });
1036
+ break;
1037
+ case $j.jPlayer.event.seeking:
1038
+ this._seeking();
1039
+ this._trigger(eventType);
1040
+ break;
1041
+ case $j.jPlayer.event.seeked:
1042
+ this._seeked();
1043
+ this._trigger(eventType);
1044
+ break;
1045
+ case $j.jPlayer.event.ready:
1046
+ // The ready event is handled outside the switch statement.
1047
+ // Captured here otherwise 2 ready events would be generated if the ready event handler used setMedia.
1048
+ break;
1049
+ default:
1050
+ this._trigger(eventType);
1051
+ }
1052
+ }
1053
+ return false;
1054
+ },
1055
+ _getFlashStatus: function(status) {
1056
+ this.status.seekPercent = status.seekPercent;
1057
+ this.status.currentPercentRelative = status.currentPercentRelative;
1058
+ this.status.currentPercentAbsolute = status.currentPercentAbsolute;
1059
+ this.status.currentTime = status.currentTime;
1060
+ this.status.duration = status.duration;
1061
+
1062
+ // The Flash does not generate this information in this release
1063
+ this.status.readyState = 4; // status.readyState;
1064
+ this.status.networkState = 0; // status.networkState;
1065
+ this.status.playbackRate = 1; // status.playbackRate;
1066
+ this.status.ended = false; // status.ended;
1067
+ },
1068
+ _updateButtons: function(playing) {
1069
+ if(playing !== undefined) {
1070
+ this.status.paused = !playing;
1071
+ if(this.css.jq.play.length && this.css.jq.pause.length) {
1072
+ if(playing) {
1073
+ this.css.jq.play.hide();
1074
+ this.css.jq.pause.show();
1075
+ } else {
1076
+ this.css.jq.play.show();
1077
+ this.css.jq.pause.hide();
1078
+ }
1079
+ }
1080
+ }
1081
+ if(this.css.jq.restoreScreen.length && this.css.jq.fullScreen.length) {
1082
+ if(this.options.fullScreen) {
1083
+ this.css.jq.fullScreen.hide();
1084
+ this.css.jq.restoreScreen.show();
1085
+ } else {
1086
+ this.css.jq.fullScreen.show();
1087
+ this.css.jq.restoreScreen.hide();
1088
+ }
1089
+ }
1090
+ if(this.css.jq.repeat.length && this.css.jq.repeatOff.length) {
1091
+ if(this.options.loop) {
1092
+ this.css.jq.repeat.hide();
1093
+ this.css.jq.repeatOff.show();
1094
+ } else {
1095
+ this.css.jq.repeat.show();
1096
+ this.css.jq.repeatOff.hide();
1097
+ }
1098
+ }
1099
+ },
1100
+ _updateInterface: function() {
1101
+ if(this.css.jq.seekBar.length) {
1102
+ this.css.jq.seekBar.width(this.status.seekPercent+"%");
1103
+ }
1104
+ if(this.css.jq.playBar.length) {
1105
+ this.css.jq.playBar.width(this.status.currentPercentRelative+"%");
1106
+ }
1107
+ if(this.css.jq.currentTime.length) {
1108
+ this.css.jq.currentTime.text($j.jPlayer.convertTime(this.status.currentTime));
1109
+ }
1110
+ if(this.css.jq.duration.length) {
1111
+ this.css.jq.duration.text($j.jPlayer.convertTime(this.status.duration));
1112
+ }
1113
+ },
1114
+ _seeking: function() {
1115
+ if(this.css.jq.seekBar.length) {
1116
+ this.css.jq.seekBar.addClass("jp-seeking-bg");
1117
+ }
1118
+ },
1119
+ _seeked: function() {
1120
+ if(this.css.jq.seekBar.length) {
1121
+ this.css.jq.seekBar.removeClass("jp-seeking-bg");
1122
+ }
1123
+ },
1124
+ setMedia: function(media) {
1125
+
1126
+ /* media[format] = String: URL of format. Must contain all of the supplied option's video or audio formats.
1127
+ * media.poster = String: Video poster URL.
1128
+ * media.subtitles = String: * NOT IMPLEMENTED * URL of subtitles SRT file
1129
+ * media.chapters = String: * NOT IMPLEMENTED * URL of chapters SRT file
1130
+ * media.stream = Boolean: * NOT IMPLEMENTED * Designating actual media streams. ie., "false/undefined" for files. Plan to refresh the flash every so often.
1131
+ */
1132
+
1133
+ var self = this;
1134
+
1135
+ this._seeked();
1136
+ clearTimeout(this.internal.htmlDlyCmdId); // Clears any delayed commands used in the HTML solution.
1137
+
1138
+ // Store the current html gates, since we need for clearMedia() conditions.
1139
+ var audioGate = this.html.audio.gate;
1140
+ var videoGate = this.html.video.gate;
1141
+
1142
+ var supported = false;
1143
+ $j.each(this.formats, function(formatPriority, format) {
1144
+ var isVideo = self.format[format].media === 'video';
1145
+ $j.each(self.solutions, function(solutionPriority, solution) {
1146
+ if(self[solution].support[format] && self._validString(media[format])) { // Format supported in solution and url given for format.
1147
+ var isHtml = solution === 'html';
1148
+
1149
+ if(isVideo) {
1150
+ if(isHtml) {
1151
+ self.html.audio.gate = false;
1152
+ self.html.video.gate = true;
1153
+ self.flash.gate = false;
1154
+ } else {
1155
+ self.html.audio.gate = false;
1156
+ self.html.video.gate = false;
1157
+ self.flash.gate = true;
1158
+ }
1159
+ } else {
1160
+ if(isHtml) {
1161
+ self.html.audio.gate = true;
1162
+ self.html.video.gate = false;
1163
+ self.flash.gate = false;
1164
+ } else {
1165
+ self.html.audio.gate = false;
1166
+ self.html.video.gate = false;
1167
+ self.flash.gate = true;
1168
+ }
1169
+ }
1170
+
1171
+ // Clear media of the previous solution if:
1172
+ // - it was Flash
1173
+ // - changing from HTML to Flash
1174
+ // - the HTML solution media type (audio or video) remained the same.
1175
+ // Note that, we must be careful with clearMedia() on iPhone, otherwise clearing the video when changing to audio corrupts the built in video player.
1176
+ if(self.flash.active || (self.html.active && self.flash.gate) || (audioGate === self.html.audio.gate && videoGate === self.html.video.gate)) {
1177
+ self.clearMedia();
1178
+ } else if(audioGate !== self.html.audio.gate && videoGate !== self.html.video.gate) { // If switching between html elements
1179
+ self._html_pause();
1180
+ // Hide the video if it was being used.
1181
+ if(self.status.video) {
1182
+ self.internal.video.jq.css({'width':'0px', 'height':'0px'});
1183
+ }
1184
+ self._resetStatus(); // Since clearMedia usually does this. Execute after status.video useage.
1185
+ }
1186
+
1187
+ if(isVideo) {
1188
+ if(isHtml) {
1189
+ self._html_setVideo(media);
1190
+ self.html.active = true;
1191
+ self.flash.active = false;
1192
+ } else {
1193
+ self._flash_setVideo(media);
1194
+ self.html.active = false;
1195
+ self.flash.active = true;
1196
+ }
1197
+ if(self.css.jq.videoPlay.length) {
1198
+ self.css.jq.videoPlay.show();
1199
+ }
1200
+ self.status.video = true;
1201
+ } else {
1202
+ if(isHtml) {
1203
+ self._html_setAudio(media);
1204
+ self.html.active = true;
1205
+ self.flash.active = false;
1206
+ } else {
1207
+ self._flash_setAudio(media);
1208
+ self.html.active = false;
1209
+ self.flash.active = true;
1210
+ }
1211
+ if(self.css.jq.videoPlay.length) {
1212
+ self.css.jq.videoPlay.hide();
1213
+ }
1214
+ self.status.video = false;
1215
+ }
1216
+
1217
+ supported = true;
1218
+ return false; // Exit $j.each
1219
+ }
1220
+ });
1221
+ if(supported) {
1222
+ return false; // Exit $j.each
1223
+ }
1224
+ });
1225
+
1226
+ if(supported) {
1227
+ // Set poster after the possible clearMedia() command above. IE had issues since the IMG onload event occurred immediately when cached. ie., The clearMedia() hide the poster.
1228
+ if(this._validString(media.poster)) {
1229
+ if(this.htmlElement.poster.src !== media.poster) { // Since some browsers do not generate img onload event.
1230
+ this.htmlElement.poster.src = media.poster;
1231
+ } else {
1232
+ this.internal.poster.jq.show();
1233
+ }
1234
+ } else {
1235
+ this.internal.poster.jq.hide(); // Hide if not used, since clearMedia() does not always occur above. ie., HTML audio <-> video switching.
1236
+ }
1237
+ this.status.srcSet = true;
1238
+ this.status.media = $j.extend({}, media);
1239
+ this._updateButtons(false);
1240
+ this._updateInterface();
1241
+ } else { // jPlayer cannot support any formats provided in this browser
1242
+ // Pause here if old media could be playing. Otherwise, playing media being changed to bad media would leave the old media playing.
1243
+ if(this.status.srcSet && !this.status.waitForPlay) {
1244
+ this.pause();
1245
+ }
1246
+ // Reset all the control flags
1247
+ this.html.audio.gate = false;
1248
+ this.html.video.gate = false;
1249
+ this.flash.gate = false;
1250
+ this.html.active = false;
1251
+ this.flash.active = false;
1252
+ // Reset status and interface.
1253
+ this._resetStatus();
1254
+ this._updateInterface();
1255
+ this._updateButtons(false);
1256
+ // Hide the any old media
1257
+ this.internal.poster.jq.hide();
1258
+ if(this.html.used && this.require.video) {
1259
+ this.internal.video.jq.css({'width':'0px', 'height':'0px'});
1260
+ }
1261
+ if(this.flash.used) {
1262
+ this.internal.flash.jq.css({'width':'0px', 'height':'0px'});
1263
+ }
1264
+ // Send an error event
1265
+ this._error( {
1266
+ type: $j.jPlayer.error.NO_SUPPORT,
1267
+ context: "{supplied:'" + this.options.supplied + "'}",
1268
+ message: $j.jPlayer.errorMsg.NO_SUPPORT,
1269
+ hint: $j.jPlayer.errorHint.NO_SUPPORT
1270
+ });
1271
+ }
1272
+ },
1273
+ clearMedia: function() {
1274
+ this._resetStatus();
1275
+ this._updateButtons(false);
1276
+
1277
+ this.internal.poster.jq.hide();
1278
+
1279
+ clearTimeout(this.internal.htmlDlyCmdId);
1280
+
1281
+ if(this.html.active) {
1282
+ this._html_clearMedia();
1283
+ } else if(this.flash.active) {
1284
+ this._flash_clearMedia();
1285
+ }
1286
+ },
1287
+ load: function() {
1288
+ if(this.status.srcSet) {
1289
+ if(this.html.active) {
1290
+ this._html_load();
1291
+ } else if(this.flash.active) {
1292
+ this._flash_load();
1293
+ }
1294
+ } else {
1295
+ this._urlNotSetError("load");
1296
+ }
1297
+ },
1298
+ play: function(time) {
1299
+ time = (typeof time === "number") ? time : NaN; // Remove jQuery event from click handler
1300
+ if(this.status.srcSet) {
1301
+ if(this.html.active) {
1302
+ this._html_play(time);
1303
+ } else if(this.flash.active) {
1304
+ this._flash_play(time);
1305
+ }
1306
+ } else {
1307
+ this._urlNotSetError("play");
1308
+ }
1309
+ },
1310
+ videoPlay: function(e) { // Handles clicks on the play button over the video poster
1311
+ this.play();
1312
+ },
1313
+ pause: function(time) {
1314
+ time = (typeof time === "number") ? time : NaN; // Remove jQuery event from click handler
1315
+ if(this.status.srcSet) {
1316
+ if(this.html.active) {
1317
+ this._html_pause(time);
1318
+ } else if(this.flash.active) {
1319
+ this._flash_pause(time);
1320
+ }
1321
+ } else {
1322
+ this._urlNotSetError("pause");
1323
+ }
1324
+ },
1325
+ pauseOthers: function() {
1326
+ var self = this;
1327
+ $j.each(this.instances, function(i, element) {
1328
+ if(self.element !== element) { // Do not this instance.
1329
+ if(element.data("jPlayer").status.srcSet) { // Check that media is set otherwise would cause error event.
1330
+ element.jPlayer("pause");
1331
+ }
1332
+ }
1333
+ });
1334
+ },
1335
+ stop: function() {
1336
+ if(this.status.srcSet) {
1337
+ if(this.html.active) {
1338
+ this._html_pause(0);
1339
+ } else if(this.flash.active) {
1340
+ this._flash_pause(0);
1341
+ }
1342
+ } else {
1343
+ this._urlNotSetError("stop");
1344
+ }
1345
+ },
1346
+ playHead: function(p) {
1347
+ p = this._limitValue(p, 0, 100);
1348
+ if(this.status.srcSet) {
1349
+ if(this.html.active) {
1350
+ this._html_playHead(p);
1351
+ } else if(this.flash.active) {
1352
+ this._flash_playHead(p);
1353
+ }
1354
+ } else {
1355
+ this._urlNotSetError("playHead");
1356
+ }
1357
+ },
1358
+ _muted: function(muted) {
1359
+ this.options.muted = muted;
1360
+ if(this.html.used) {
1361
+ this._html_mute(muted);
1362
+ }
1363
+ if(this.flash.used) {
1364
+ this._flash_mute(muted);
1365
+ }
1366
+
1367
+ // The HTML solution generates this event from the media element itself.
1368
+ if(this.flash.gate) {
1369
+ this._updateMute(muted);
1370
+ this._updateVolume(this.options.volume);
1371
+ this._trigger($j.jPlayer.event.volumechange);
1372
+ }
1373
+ },
1374
+ mute: function(mute) { // mute is either: undefined (true), an event object (true) or a boolean (muted).
1375
+ mute = mute === undefined ? true : !!mute;
1376
+ this._muted(mute);
1377
+ },
1378
+ unmute: function(unmute) { // unmute is either: undefined (true), an event object (true) or a boolean (!muted).
1379
+ unmute = unmute === undefined ? true : !!unmute;
1380
+ this._muted(!unmute);
1381
+ },
1382
+ _updateMute: function(mute) {
1383
+ if(mute === undefined) {
1384
+ mute = this.options.muted;
1385
+ }
1386
+ if(this.css.jq.mute.length && this.css.jq.unmute.length) {
1387
+ if(mute) {
1388
+ this.css.jq.mute.hide();
1389
+ this.css.jq.unmute.show();
1390
+ } else {
1391
+ this.css.jq.mute.show();
1392
+ this.css.jq.unmute.hide();
1393
+ }
1394
+ }
1395
+ },
1396
+ volume: function(v) {
1397
+ v = this._limitValue(v, 0, 1);
1398
+ this.options.volume = v;
1399
+
1400
+ if(this.html.used) {
1401
+ this._html_volume(v);
1402
+ }
1403
+ if(this.flash.used) {
1404
+ this._flash_volume(v);
1405
+ }
1406
+
1407
+ // The HTML solution generates this event from the media element itself.
1408
+ if(this.flash.gate) {
1409
+ this._updateVolume(v);
1410
+ this._trigger($j.jPlayer.event.volumechange);
1411
+ }
1412
+ },
1413
+ volumeBar: function(e) { // Handles clicks on the volumeBar
1414
+ if(this.css.jq.volumeBar.length) {
1415
+ var offset = this.css.jq.volumeBar.offset();
1416
+ var x = e.pageX - offset.left;
1417
+ var w = this.css.jq.volumeBar.width();
1418
+ var v = x/w;
1419
+ this.volume(v);
1420
+ }
1421
+ if(this.options.muted) {
1422
+ this._muted(false);
1423
+ }
1424
+ },
1425
+ volumeBarValue: function(e) { // Handles clicks on the volumeBarValue
1426
+ this.volumeBar(e);
1427
+ },
1428
+ _updateVolume: function(v) {
1429
+ if(v === undefined) {
1430
+ v = this.options.volume;
1431
+ }
1432
+ v = this.options.muted ? 0 : v;
1433
+
1434
+ if(this.css.jq.volumeBarValue.length) {
1435
+ this.css.jq.volumeBarValue.width((v*100)+"%");
1436
+ }
1437
+ },
1438
+ volumeMax: function() { // Handles clicks on the volume max
1439
+ this.volume(1);
1440
+ if(this.options.muted) {
1441
+ this._muted(false);
1442
+ }
1443
+ },
1444
+ _cssSelectorAncestor: function(ancestor) {
1445
+ var self = this;
1446
+ this.options.cssSelectorAncestor = ancestor;
1447
+ this._removeUiClass();
1448
+ this.ancestorJq = ancestor ? $j(ancestor) : []; // Would use $j() instead of [], but it is only 1.4+
1449
+ if(ancestor && this.ancestorJq.length !== 1) { // So empty strings do not generate the warning.
1450
+ this._warning( {
1451
+ type: $j.jPlayer.warning.CSS_SELECTOR_COUNT,
1452
+ context: ancestor,
1453
+ message: $j.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.ancestorJq.length + " found for cssSelectorAncestor.",
1454
+ hint: $j.jPlayer.warningHint.CSS_SELECTOR_COUNT
1455
+ });
1456
+ }
1457
+ this._addUiClass();
1458
+ $j.each(this.options.cssSelector, function(fn, cssSel) {
1459
+ self._cssSelector(fn, cssSel);
1460
+ });
1461
+ },
1462
+ _cssSelector: function(fn, cssSel) {
1463
+ var self = this;
1464
+ if(typeof cssSel === 'string') {
1465
+ if($j.jPlayer.prototype.options.cssSelector[fn]) {
1466
+ if(this.css.jq[fn] && this.css.jq[fn].length) {
1467
+ this.css.jq[fn].unbind(".jPlayer");
1468
+ }
1469
+ this.options.cssSelector[fn] = cssSel;
1470
+ this.css.cs[fn] = this.options.cssSelectorAncestor + " " + cssSel;
1471
+
1472
+ if(cssSel) { // Checks for empty string
1473
+ this.css.jq[fn] = $j(this.css.cs[fn]);
1474
+ } else {
1475
+ this.css.jq[fn] = []; // To comply with the css.jq[fn].length check before its use. As of jQuery 1.4 could have used $j() for an empty set.
1476
+ }
1477
+
1478
+ if(this.css.jq[fn].length) {
1479
+ var handler = function(e) {
1480
+ self[fn](e);
1481
+ $j(this).blur();
1482
+ return false;
1483
+ };
1484
+ this.css.jq[fn].bind("click.jPlayer", handler); // Using jPlayer namespace
1485
+ }
1486
+
1487
+ if(cssSel && this.css.jq[fn].length !== 1) { // So empty strings do not generate the warning. ie., they just remove the old one.
1488
+ this._warning( {
1489
+ type: $j.jPlayer.warning.CSS_SELECTOR_COUNT,
1490
+ context: this.css.cs[fn],
1491
+ message: $j.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.css.jq[fn].length + " found for " + fn + " method.",
1492
+ hint: $j.jPlayer.warningHint.CSS_SELECTOR_COUNT
1493
+ });
1494
+ }
1495
+ } else {
1496
+ this._warning( {
1497
+ type: $j.jPlayer.warning.CSS_SELECTOR_METHOD,
1498
+ context: fn,
1499
+ message: $j.jPlayer.warningMsg.CSS_SELECTOR_METHOD,
1500
+ hint: $j.jPlayer.warningHint.CSS_SELECTOR_METHOD
1501
+ });
1502
+ }
1503
+ } else {
1504
+ this._warning( {
1505
+ type: $j.jPlayer.warning.CSS_SELECTOR_STRING,
1506
+ context: cssSel,
1507
+ message: $j.jPlayer.warningMsg.CSS_SELECTOR_STRING,
1508
+ hint: $j.jPlayer.warningHint.CSS_SELECTOR_STRING
1509
+ });
1510
+ }
1511
+ },
1512
+ seekBar: function(e) { // Handles clicks on the seekBar
1513
+ if(this.css.jq.seekBar) {
1514
+ var offset = this.css.jq.seekBar.offset();
1515
+ var x = e.pageX - offset.left;
1516
+ var w = this.css.jq.seekBar.width();
1517
+ var p = 100*x/w;
1518
+ this.playHead(p);
1519
+ }
1520
+ },
1521
+ playBar: function(e) { // Handles clicks on the playBar
1522
+ this.seekBar(e);
1523
+ },
1524
+ repeat: function() { // Handle clicks on the repeat button
1525
+ this._loop(true);
1526
+ },
1527
+ repeatOff: function() { // Handle clicks on the repeatOff button
1528
+ this._loop(false);
1529
+ },
1530
+ _loop: function(loop) {
1531
+ if(this.options.loop !== loop) {
1532
+ this.options.loop = loop;
1533
+ this._updateButtons();
1534
+ this._trigger($j.jPlayer.event.repeat);
1535
+ }
1536
+ },
1537
+
1538
+ // Plan to review the cssSelector method to cope with missing associated functions accordingly.
1539
+
1540
+ currentTime: function(e) { // Handles clicks on the text
1541
+ // Added to avoid errors using cssSelector system for the text
1542
+ },
1543
+ duration: function(e) { // Handles clicks on the text
1544
+ // Added to avoid errors using cssSelector system for the text
1545
+ },
1546
+ gui: function(e) { // Handles clicks on the gui
1547
+ // Added to avoid errors using cssSelector system for the gui
1548
+ },
1549
+
1550
+ // Options code adapted from ui.widget.js (1.8.7). Made changes so the key can use dot notation. To match previous getData solution in jPlayer 1.
1551
+ option: function(key, value) {
1552
+ var options = key;
1553
+
1554
+ // Enables use: options(). Returns a copy of options object
1555
+ if ( arguments.length === 0 ) {
1556
+ return $j.extend( true, {}, this.options );
1557
+ }
1558
+
1559
+ if(typeof key === "string") {
1560
+ var keys = key.split(".");
1561
+
1562
+ // Enables use: options("someOption") Returns a copy of the option. Supports dot notation.
1563
+ if(value === undefined) {
1564
+
1565
+ var opt = $j.extend(true, {}, this.options);
1566
+ for(var i = 0; i < keys.length; i++) {
1567
+ if(opt[keys[i]] !== undefined) {
1568
+ opt = opt[keys[i]];
1569
+ } else {
1570
+ this._warning( {
1571
+ type: $j.jPlayer.warning.OPTION_KEY,
1572
+ context: key,
1573
+ message: $j.jPlayer.warningMsg.OPTION_KEY,
1574
+ hint: $j.jPlayer.warningHint.OPTION_KEY
1575
+ });
1576
+ return undefined;
1577
+ }
1578
+ }
1579
+ return opt;
1580
+ }
1581
+
1582
+ // Enables use: options("someOptionObject", someObject}). Creates: {someOptionObject:someObject}
1583
+ // Enables use: options("someOption", someValue). Creates: {someOption:someValue}
1584
+ // Enables use: options("someOptionObject.someOption", someValue). Creates: {someOptionObject:{someOption:someValue}}
1585
+
1586
+ options = {};
1587
+ var opts = options;
1588
+
1589
+ for(var j = 0; j < keys.length; j++) {
1590
+ if(j < keys.length - 1) {
1591
+ opts[keys[j]] = {};
1592
+ opts = opts[keys[j]];
1593
+ } else {
1594
+ opts[keys[j]] = value;
1595
+ }
1596
+ }
1597
+ }
1598
+
1599
+ // Otherwise enables use: options(optionObject). Uses original object (the key)
1600
+
1601
+ this._setOptions(options);
1602
+
1603
+ return this;
1604
+ },
1605
+ _setOptions: function(options) {
1606
+ var self = this;
1607
+ $j.each(options, function(key, value) { // This supports the 2 level depth that the options of jPlayer has. Would review if we ever need more depth.
1608
+ self._setOption(key, value);
1609
+ });
1610
+
1611
+ return this;
1612
+ },
1613
+ _setOption: function(key, value) {
1614
+ var self = this;
1615
+
1616
+ // The ability to set options is limited at this time.
1617
+
1618
+ switch(key) {
1619
+ case "volume" :
1620
+ this.volume(value);
1621
+ break;
1622
+ case "muted" :
1623
+ this._muted(value);
1624
+ break;
1625
+ case "cssSelectorAncestor" :
1626
+ this._cssSelectorAncestor(value); // Set and refresh all associations for the new ancestor.
1627
+ break;
1628
+ case "cssSelector" :
1629
+ $j.each(value, function(fn, cssSel) {
1630
+ self._cssSelector(fn, cssSel); // NB: The option is set inside this function, after further validity checks.
1631
+ });
1632
+ break;
1633
+ case "fullScreen" :
1634
+ if(this.options[key] !== value) { // if changed
1635
+ this._removeUiClass();
1636
+ this.options[key] = value;
1637
+ this._refreshSize();
1638
+ }
1639
+ break;
1640
+ case "size" :
1641
+ if(!this.options.fullScreen && this.options[key].cssClass !== value.cssClass) {
1642
+ this._removeUiClass();
1643
+ }
1644
+ this.options[key] = $j.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed.
1645
+ this._refreshSize();
1646
+ break;
1647
+ case "sizeFull" :
1648
+ if(this.options.fullScreen && this.options[key].cssClass !== value.cssClass) {
1649
+ this._removeUiClass();
1650
+ }
1651
+ this.options[key] = $j.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed.
1652
+ this._refreshSize();
1653
+ break;
1654
+ case "autohide" :
1655
+ this.options[key] = $j.extend({}, this.options[key], value); // store a merged copy of it, incase not all properties changed.
1656
+ this._updateAutohide();
1657
+ break;
1658
+ case "loop" :
1659
+ this._loop(value);
1660
+ break;
1661
+ case "emulateHtml" :
1662
+ if(this.options[key] !== value) { // To avoid multiple event handlers being created, if true already.
1663
+ this.options[key] = value;
1664
+ if(value) {
1665
+ this._emulateHtmlBridge();
1666
+ } else {
1667
+ this._destroyHtmlBridge();
1668
+ }
1669
+ }
1670
+ break;
1671
+ }
1672
+
1673
+ return this;
1674
+ },
1675
+ // End of: (Options code adapted from ui.widget.js)
1676
+
1677
+ _refreshSize: function() {
1678
+ this._setSize(); // update status and jPlayer element size
1679
+ this._addUiClass(); // update the ui class
1680
+ this._updateSize(); // update internal sizes
1681
+ this._updateButtons();
1682
+ this._updateAutohide();
1683
+ this._trigger($j.jPlayer.event.resize);
1684
+ },
1685
+ _setSize: function() {
1686
+ // Determine the current size from the options
1687
+ if(this.options.fullScreen) {
1688
+ this.status.width = this.options.sizeFull.width;
1689
+ this.status.height = this.options.sizeFull.height;
1690
+ this.status.cssClass = this.options.sizeFull.cssClass;
1691
+ } else {
1692
+ this.status.width = this.options.size.width;
1693
+ this.status.height = this.options.size.height;
1694
+ this.status.cssClass = this.options.size.cssClass;
1695
+ }
1696
+
1697
+ // Set the size of the jPlayer area.
1698
+ this.element.css({'width': this.status.width, 'height': this.status.height});
1699
+ },
1700
+ _addUiClass: function() {
1701
+ if(this.ancestorJq.length) {
1702
+ this.ancestorJq.addClass(this.status.cssClass);
1703
+ }
1704
+ },
1705
+ _removeUiClass: function() {
1706
+ if(this.ancestorJq.length) {
1707
+ this.ancestorJq.removeClass(this.status.cssClass);
1708
+ }
1709
+ },
1710
+ _updateSize: function() {
1711
+ // The poster uses show/hide so can simply resize it.
1712
+ this.internal.poster.jq.css({'width': this.status.width, 'height': this.status.height});
1713
+
1714
+ // Video html or flash resized if necessary at this time.
1715
+ if(!this.status.waitForPlay) {
1716
+ if(this.html.active && this.status.video) { // Only if video media
1717
+ this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height});
1718
+ }
1719
+ else if(this.flash.active) {
1720
+ this.internal.flash.jq.css({'width': this.status.width, 'height': this.status.height});
1721
+ }
1722
+ }
1723
+ },
1724
+ _updateAutohide: function() {
1725
+ var self = this,
1726
+ event = "mousemove.jPlayer",
1727
+ namespace = ".jPlayerAutohide",
1728
+ eventType = event + namespace,
1729
+ handler = function() {
1730
+ self.css.jq.gui.fadeIn(self.options.autohide.fadeIn, function() {
1731
+ clearTimeout(self.internal.autohideId);
1732
+ self.internal.autohideId = setTimeout( function() {
1733
+ self.css.jq.gui.fadeOut(self.options.autohide.fadeOut);
1734
+ }, self.options.autohide.hold);
1735
+ });
1736
+ };
1737
+
1738
+ clearTimeout(this.internal.autohideId);
1739
+ this.element.unbind(namespace);
1740
+ if(this.css.jq.gui.length) {
1741
+ this.css.jq.gui.unbind(namespace);
1742
+ if(this.options.fullScreen && this.options.autohide.full || !this.options.fullScreen && this.options.autohide.restored) {
1743
+ this.element.bind(eventType, handler);
1744
+ this.css.jq.gui.bind(eventType, handler);
1745
+ this.css.jq.gui.hide();
1746
+ } else {
1747
+ this.css.jq.gui.stop(true, true).show(); // Need the stop() otherwise a change screen mode during the GUI fade out hides the GUI in the other mode.
1748
+ }
1749
+ }
1750
+ },
1751
+ fullScreen: function() {
1752
+ this._setOption("fullScreen", true);
1753
+ },
1754
+ restoreScreen: function() {
1755
+ this._setOption("fullScreen", false);
1756
+ },
1757
+ _html_initMedia: function() {
1758
+ if(this.status.srcSet && !this.status.waitForPlay) {
1759
+ this.htmlElement.media.pause();
1760
+ }
1761
+ if(this.options.preload !== 'none') {
1762
+ this._html_load();
1763
+ }
1764
+ this._trigger($j.jPlayer.event.timeupdate); // The flash generates this event for its solution.
1765
+ },
1766
+ _html_setAudio: function(media) {
1767
+ var self = this;
1768
+ // Always finds a format due to checks in setMedia()
1769
+ $j.each(this.formats, function(priority, format) {
1770
+ if(self.html.support[format] && media[format]) {
1771
+ self.status.src = media[format];
1772
+ self.status.format[format] = true;
1773
+ self.status.formatType = format;
1774
+ return false;
1775
+ }
1776
+ });
1777
+ this.htmlElement.media = this.htmlElement.audio;
1778
+ this._html_initMedia();
1779
+ },
1780
+ _html_setVideo: function(media) {
1781
+ var self = this;
1782
+ // Always finds a format due to checks in setMedia()
1783
+ $j.each(this.formats, function(priority, format) {
1784
+ if(self.html.support[format] && media[format]) {
1785
+ self.status.src = media[format];
1786
+ self.status.format[format] = true;
1787
+ self.status.formatType = format;
1788
+ return false;
1789
+ }
1790
+ });
1791
+ this.htmlElement.media = this.htmlElement.video;
1792
+ this._html_initMedia();
1793
+ },
1794
+ _html_clearMedia: function() {
1795
+ if(this.htmlElement.media) {
1796
+ if(this.htmlElement.media.id === this.internal.video.id) {
1797
+ this.internal.video.jq.css({'width':'0px', 'height':'0px'});
1798
+ }
1799
+ this.htmlElement.media.pause();
1800
+ this.htmlElement.media.src = "";
1801
+ this.htmlElement.media.load(); // Stops an old, "in progress" download from continuing the download. Triggers the loadstart, error and emptied events, due to the empty src. Also an abort event if a download was in progress.
1802
+ }
1803
+ },
1804
+ _html_load: function() {
1805
+ if(this.status.waitForLoad) {
1806
+ this.status.waitForLoad = false;
1807
+ this.htmlElement.media.src = this.status.src;
1808
+ this.htmlElement.media.load();
1809
+ }
1810
+ clearTimeout(this.internal.htmlDlyCmdId);
1811
+ },
1812
+ _html_play: function(time) {
1813
+ var self = this;
1814
+ this._html_load(); // Loads if required and clears any delayed commands.
1815
+
1816
+ this.htmlElement.media.play(); // Before currentTime attempt otherwise Firefox 4 Beta never loads.
1817
+
1818
+ if(!isNaN(time)) {
1819
+ try {
1820
+ this.htmlElement.media.currentTime = time;
1821
+ } catch(err) {
1822
+ this.internal.htmlDlyCmdId = setTimeout(function() {
1823
+ self.play(time);
1824
+ }, 100);
1825
+ return; // Cancel execution and wait for the delayed command.
1826
+ }
1827
+ }
1828
+ this._html_checkWaitForPlay();
1829
+ },
1830
+ _html_pause: function(time) {
1831
+ var self = this;
1832
+
1833
+ if(time > 0) { // We do not want the stop() command, which does pause(0), causing a load operation.
1834
+ this._html_load(); // Loads if required and clears any delayed commands.
1835
+ } else {
1836
+ clearTimeout(this.internal.htmlDlyCmdId);
1837
+ }
1838
+
1839
+ // Order of these commands is important for Safari (Win) and IE9. Pause then change currentTime.
1840
+ this.htmlElement.media.pause();
1841
+
1842
+ if(!isNaN(time)) {
1843
+ try {
1844
+ this.htmlElement.media.currentTime = time;
1845
+ } catch(err) {
1846
+ this.internal.htmlDlyCmdId = setTimeout(function() {
1847
+ self.pause(time);
1848
+ }, 100);
1849
+ return; // Cancel execution and wait for the delayed command.
1850
+ }
1851
+ }
1852
+ if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button.
1853
+ this._html_checkWaitForPlay();
1854
+ }
1855
+ },
1856
+ _html_playHead: function(percent) {
1857
+ var self = this;
1858
+ this._html_load(); // Loads if required and clears any delayed commands.
1859
+ try {
1860
+ if((typeof this.htmlElement.media.seekable === "object") && (this.htmlElement.media.seekable.length > 0)) {
1861
+ this.htmlElement.media.currentTime = percent * this.htmlElement.media.seekable.end(this.htmlElement.media.seekable.length-1) / 100;
1862
+ } else if(this.htmlElement.media.duration > 0 && !isNaN(this.htmlElement.media.duration)) {
1863
+ this.htmlElement.media.currentTime = percent * this.htmlElement.media.duration / 100;
1864
+ } else {
1865
+ throw "e";
1866
+ }
1867
+ } catch(err) {
1868
+ this.internal.htmlDlyCmdId = setTimeout(function() {
1869
+ self.playHead(percent);
1870
+ }, 100);
1871
+ return; // Cancel execution and wait for the delayed command.
1872
+ }
1873
+ if(!this.status.waitForLoad) {
1874
+ this._html_checkWaitForPlay();
1875
+ }
1876
+ },
1877
+ _html_checkWaitForPlay: function() {
1878
+ if(this.status.waitForPlay) {
1879
+ this.status.waitForPlay = false;
1880
+ if(this.css.jq.videoPlay.length) {
1881
+ this.css.jq.videoPlay.hide();
1882
+ }
1883
+ if(this.status.video) {
1884
+ this.internal.poster.jq.hide();
1885
+ this.internal.video.jq.css({'width': this.status.width, 'height': this.status.height});
1886
+ }
1887
+ }
1888
+ },
1889
+ _html_volume: function(v) {
1890
+ if(this.html.audio.available) {
1891
+ this.htmlElement.audio.volume = v;
1892
+ }
1893
+ if(this.html.video.available) {
1894
+ this.htmlElement.video.volume = v;
1895
+ }
1896
+ },
1897
+ _html_mute: function(m) {
1898
+ if(this.html.audio.available) {
1899
+ this.htmlElement.audio.muted = m;
1900
+ }
1901
+ if(this.html.video.available) {
1902
+ this.htmlElement.video.muted = m;
1903
+ }
1904
+ },
1905
+ _flash_setAudio: function(media) {
1906
+ var self = this;
1907
+ try {
1908
+ // Always finds a format due to checks in setMedia()
1909
+ $j.each(this.formats, function(priority, format) {
1910
+ if(self.flash.support[format] && media[format]) {
1911
+ switch (format) {
1912
+ case "m4a" :
1913
+ case "fla" :
1914
+ self._getMovie().fl_setAudio_m4a(media[format]);
1915
+ break;
1916
+ case "mp3" :
1917
+ self._getMovie().fl_setAudio_mp3(media[format]);
1918
+ break;
1919
+ }
1920
+ self.status.src = media[format];
1921
+ self.status.format[format] = true;
1922
+ self.status.formatType = format;
1923
+ return false;
1924
+ }
1925
+ });
1926
+
1927
+ if(this.options.preload === 'auto') {
1928
+ this._flash_load();
1929
+ this.status.waitForLoad = false;
1930
+ }
1931
+ } catch(err) { this._flashError(err); }
1932
+ },
1933
+ _flash_setVideo: function(media) {
1934
+ var self = this;
1935
+ try {
1936
+ // Always finds a format due to checks in setMedia()
1937
+ $j.each(this.formats, function(priority, format) {
1938
+ if(self.flash.support[format] && media[format]) {
1939
+ switch (format) {
1940
+ case "m4v" :
1941
+ case "flv" :
1942
+ self._getMovie().fl_setVideo_m4v(media[format]);
1943
+ break;
1944
+ }
1945
+ self.status.src = media[format];
1946
+ self.status.format[format] = true;
1947
+ self.status.formatType = format;
1948
+ return false;
1949
+ }
1950
+ });
1951
+
1952
+ if(this.options.preload === 'auto') {
1953
+ this._flash_load();
1954
+ this.status.waitForLoad = false;
1955
+ }
1956
+ } catch(err) { this._flashError(err); }
1957
+ },
1958
+ _flash_clearMedia: function() {
1959
+ this.internal.flash.jq.css({'width':'0px', 'height':'0px'}); // Must do via CSS as setting attr() to zero causes a jQuery error in IE.
1960
+ try {
1961
+ this._getMovie().fl_clearMedia();
1962
+ } catch(err) { this._flashError(err); }
1963
+ },
1964
+ _flash_load: function() {
1965
+ try {
1966
+ this._getMovie().fl_load();
1967
+ } catch(err) { this._flashError(err); }
1968
+ this.status.waitForLoad = false;
1969
+ },
1970
+ _flash_play: function(time) {
1971
+ try {
1972
+ this._getMovie().fl_play(time);
1973
+ } catch(err) { this._flashError(err); }
1974
+ this.status.waitForLoad = false;
1975
+ this._flash_checkWaitForPlay();
1976
+ },
1977
+ _flash_pause: function(time) {
1978
+ try {
1979
+ this._getMovie().fl_pause(time);
1980
+ } catch(err) { this._flashError(err); }
1981
+ if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button.
1982
+ this.status.waitForLoad = false;
1983
+ this._flash_checkWaitForPlay();
1984
+ }
1985
+ },
1986
+ _flash_playHead: function(p) {
1987
+ try {
1988
+ this._getMovie().fl_play_head(p);
1989
+ } catch(err) { this._flashError(err); }
1990
+ if(!this.status.waitForLoad) {
1991
+ this._flash_checkWaitForPlay();
1992
+ }
1993
+ },
1994
+ _flash_checkWaitForPlay: function() {
1995
+ if(this.status.waitForPlay) {
1996
+ this.status.waitForPlay = false;
1997
+ if(this.css.jq.videoPlay.length) {
1998
+ this.css.jq.videoPlay.hide();
1999
+ }
2000
+ if(this.status.video) {
2001
+ this.internal.poster.jq.hide();
2002
+ this.internal.flash.jq.css({'width': this.status.width, 'height': this.status.height});
2003
+ }
2004
+ }
2005
+ },
2006
+ _flash_volume: function(v) {
2007
+ try {
2008
+ this._getMovie().fl_volume(v);
2009
+ } catch(err) { this._flashError(err); }
2010
+ },
2011
+ _flash_mute: function(m) {
2012
+ try {
2013
+ this._getMovie().fl_mute(m);
2014
+ } catch(err) { this._flashError(err); }
2015
+ },
2016
+ _getMovie: function() {
2017
+ return document[this.internal.flash.id];
2018
+ },
2019
+ _checkForFlash: function (version) {
2020
+ // Function checkForFlash adapted from FlashReplace by Robert Nyman
2021
+ // http://code.google.com/p/flashreplace/
2022
+ var flashIsInstalled = false;
2023
+ var flash;
2024
+ if(window.ActiveXObject){
2025
+ try{
2026
+ flash = new ActiveXObject(("ShockwaveFlash.ShockwaveFlash." + version));
2027
+ flashIsInstalled = true;
2028
+ }
2029
+ catch(e){
2030
+ // Throws an error if the version isn't available
2031
+ }
2032
+ }
2033
+ else if(navigator.plugins && navigator.mimeTypes.length > 0){
2034
+ flash = navigator.plugins["Shockwave Flash"];
2035
+ if(flash){
2036
+ var flashVersion = navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/, "$1");
2037
+ if(flashVersion >= version){
2038
+ flashIsInstalled = true;
2039
+ }
2040
+ }
2041
+ }
2042
+ return flashIsInstalled;
2043
+ },
2044
+ _validString: function(url) {
2045
+ return (url && typeof url === "string"); // Empty strings return false
2046
+ },
2047
+ _limitValue: function(value, min, max) {
2048
+ return (value < min) ? min : ((value > max) ? max : value);
2049
+ },
2050
+ _urlNotSetError: function(context) {
2051
+ this._error( {
2052
+ type: $j.jPlayer.error.URL_NOT_SET,
2053
+ context: context,
2054
+ message: $j.jPlayer.errorMsg.URL_NOT_SET,
2055
+ hint: $j.jPlayer.errorHint.URL_NOT_SET
2056
+ });
2057
+ },
2058
+ _flashError: function(error) {
2059
+ var errorType;
2060
+ if(!this.internal.ready) {
2061
+ errorType = "FLASH";
2062
+ } else {
2063
+ errorType = "FLASH_DISABLED";
2064
+ }
2065
+ this._error( {
2066
+ type: $j.jPlayer.error[errorType],
2067
+ context: this.internal.flash.swf,
2068
+ message: $j.jPlayer.errorMsg[errorType] + error.message,
2069
+ hint: $j.jPlayer.errorHint[errorType]
2070
+ });
2071
+
2072
+ },
2073
+ _error: function(error) {
2074
+ this._trigger($j.jPlayer.event.error, error);
2075
+ if(this.options.errorAlerts) {
2076
+ this._alert("Error!" + (error.message ? "\n\n" + error.message : "") + (error.hint ? "\n\n" + error.hint : "") + "\n\nContext: " + error.context);
2077
+ }
2078
+ },
2079
+ _warning: function(warning) {
2080
+ this._trigger($j.jPlayer.event.warning, undefined, warning);
2081
+ if(this.options.warningAlerts) {
2082
+ this._alert("Warning!" + (warning.message ? "\n\n" + warning.message : "") + (warning.hint ? "\n\n" + warning.hint : "") + "\n\nContext: " + warning.context);
2083
+ }
2084
+ },
2085
+ _alert: function(message) {
2086
+ alert("jPlayer " + this.version.script + " : id='" + this.internal.self.id +"' : " + message);
2087
+ },
2088
+ _emulateHtmlBridge: function() {
2089
+ var self = this,
2090
+ methods = $j.jPlayer.emulateMethods;
2091
+
2092
+ // Emulate methods on jPlayer's DOM element.
2093
+ $j.each( $j.jPlayer.emulateMethods.split(/\s+/g), function(i, name) {
2094
+ self.internal.domNode[name] = function(arg) {
2095
+ self[name](arg);
2096
+ };
2097
+
2098
+ });
2099
+
2100
+ // Bubble jPlayer events to its DOM element.
2101
+ $j.each($j.jPlayer.event, function(eventName,eventType) {
2102
+ var nativeEvent = true;
2103
+ $j.each( $j.jPlayer.reservedEvent.split(/\s+/g), function(i, name) {
2104
+ if(name === eventName) {
2105
+ nativeEvent = false;
2106
+ return false;
2107
+ }
2108
+ });
2109
+ if(nativeEvent) {
2110
+ self.element.bind(eventType + ".jPlayer.jPlayerHtml", function() { // With .jPlayer & .jPlayerHtml namespaces.
2111
+ self._emulateHtmlUpdate();
2112
+ var domEvent = document.createEvent("Event");
2113
+ domEvent.initEvent(eventName, false, true);
2114
+ self.internal.domNode.dispatchEvent(domEvent);
2115
+ });
2116
+ }
2117
+ // The error event would require a special case
2118
+ });
2119
+
2120
+ // IE9 has a readyState property on all elements. The document should have it, but all (except media) elements inherit it in IE9. This conflicts with Popcorn, which polls the readyState.
2121
+ },
2122
+ _emulateHtmlUpdate: function() {
2123
+ var self = this;
2124
+
2125
+ $j.each( $j.jPlayer.emulateStatus.split(/\s+/g), function(i, name) {
2126
+ self.internal.domNode[name] = self.status[name];
2127
+ });
2128
+ $j.each( $j.jPlayer.emulateOptions.split(/\s+/g), function(i, name) {
2129
+ self.internal.domNode[name] = self.options[name];
2130
+ });
2131
+ },
2132
+ _destroyHtmlBridge: function() {
2133
+ var self = this;
2134
+
2135
+ // Bridge event handlers are also removed by destroy() through .jPlayer namespace.
2136
+ this.element.unbind(".jPlayerHtml"); // Remove all event handlers created by the jPlayer bridge. So you can change the emulateHtml option.
2137
+
2138
+ // Remove the methods and properties
2139
+ var emulated = $j.jPlayer.emulateMethods + " " + $j.jPlayer.emulateStatus + " " + $j.jPlayer.emulateOptions;
2140
+ $j.each( emulated.split(/\s+/g), function(i, name) {
2141
+ delete self.internal.domNode[name];
2142
+ });
2143
+ }
2144
+ };
2145
+
2146
+ $j.jPlayer.error = {
2147
+ FLASH: "e_flash",
2148
+ FLASH_DISABLED: "e_flash_disabled",
2149
+ NO_SOLUTION: "e_no_solution",
2150
+ NO_SUPPORT: "e_no_support",
2151
+ URL: "e_url",
2152
+ URL_NOT_SET: "e_url_not_set",
2153
+ VERSION: "e_version"
2154
+ };
2155
+
2156
+ $j.jPlayer.errorMsg = {
2157
+ FLASH: "jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ", // Used in: _flashError()
2158
+ FLASH_DISABLED: "jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ", // Used in: _flashError()
2159
+ NO_SOLUTION: "No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.", // Used in: _init()
2160
+ NO_SUPPORT: "It is not possible to play any media format provided in setMedia() on this browser using your current options.", // Used in: setMedia()
2161
+ URL: "Media URL could not be loaded.", // Used in: jPlayerFlashEvent() and _addHtmlEventListeners()
2162
+ URL_NOT_SET: "Attempt to issue media playback commands, while no media url is set.", // Used in: load(), play(), pause(), stop() and playHead()
2163
+ VERSION: "jPlayer " + $j.jPlayer.prototype.version.script + " needs Jplayer.swf version " + $j.jPlayer.prototype.version.needFlash + " but found " // Used in: jPlayerReady()
2164
+ };
2165
+
2166
+ $j.jPlayer.errorHint = {
2167
+ FLASH: "Check your swfPath option and that Jplayer.swf is there.",
2168
+ FLASH_DISABLED: "Check that you have not display:none; the jPlayer entity or any ancestor.",
2169
+ NO_SOLUTION: "Review the jPlayer options: support and supplied.",
2170
+ NO_SUPPORT: "Video or audio formats defined in the supplied option are missing.",
2171
+ URL: "Check media URL is valid.",
2172
+ URL_NOT_SET: "Use setMedia() to set the media URL.",
2173
+ VERSION: "Update jPlayer files."
2174
+ };
2175
+
2176
+ $j.jPlayer.warning = {
2177
+ CSS_SELECTOR_COUNT: "e_css_selector_count",
2178
+ CSS_SELECTOR_METHOD: "e_css_selector_method",
2179
+ CSS_SELECTOR_STRING: "e_css_selector_string",
2180
+ OPTION_KEY: "e_option_key"
2181
+ };
2182
+
2183
+ $j.jPlayer.warningMsg = {
2184
+ CSS_SELECTOR_COUNT: "The number of css selectors found did not equal one: ",
2185
+ CSS_SELECTOR_METHOD: "The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",
2186
+ CSS_SELECTOR_STRING: "The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",
2187
+ OPTION_KEY: "The option requested in jPlayer('option') is undefined."
2188
+ };
2189
+
2190
+ $j.jPlayer.warningHint = {
2191
+ CSS_SELECTOR_COUNT: "Check your css selector and the ancestor.",
2192
+ CSS_SELECTOR_METHOD: "Check your method name.",
2193
+ CSS_SELECTOR_STRING: "Check your css selector is a string.",
2194
+ OPTION_KEY: "Check your option name."
2195
+ };
2196
+
2197
+
2198
+ })(jQuery);
js/jquery/plugin/ttw-music-player-min.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Created by 23rd and Walnut for Codebasehero.com
3
+ * www.23andwalnut.com
4
+ * www.codebasehero.com
5
+ * User: Saleem El-Amin
6
+ * Date: 6/11/11
7
+ * Time: 6:41 AM
8
+ *
9
+ * License: You are free to use this file in personal and commercial products, however re-distribution 'as-is' without prior consent is prohibited.
10
+ */
11
+ (function(a){a.fn.ttwMusicPlayer=function(q,f){var p=this,v,e,g,s,b,h,t,q,u,m,j,l;g={jPlayer:"#jquery_jplayer",jPlayerInterface:".jp-interface",playerPrevious:".jp-interface .jp-previous",playerNext:".jp-interface .jp-next",trackList:".tracklist",tracks:".tracks",track:".track",trackRating:".rating-bar",trackInfo:".track-info",rating:".rating",ratingLevel:".rating-level",ratingLevelOn:".on",title:".title",duration:".duration",buy:".buy",buyNotActive:".not-active",playing:".playing",moreButton:".more",player:".player",artist:".artist",artistOuter:".artist-outer",albumCover:".img",description:".description",descriptionShowing:".showing"};v={ratingCallback:null,currencySymbol:"$",buyText:"BUY",tracksToShow:5,autoPlay:false,jPlayer:{}};e=a.extend(true,{},v,f);j=q;l=0;s=function(){q=new b();u=new h();u.buildInterface();q.init(e.jPlayer);p.bind("mbPlaylistLoaded",function(){p.bind("mbInterfaceBuilt",function(){m=new t()});u.init()})};b=function(){var C=false,O,I={},Q,E=0,G=0,A,H;O={listItem:'<li class="track"><span class="title"></span><span class="duration"></span><span class="rating"></span><a href="#" class="buy not-active" target="_blank"></a></li>',ratingBar:'<span class="rating-level rating-bar"></span>'};function L(T){I=a(".ttw-music-player .jPlayer-container");var S,R;S={swfPath:"jquery-jplayer",supplied:"mp3, oga",solution:"html, flash",cssSelectorAncestor:g.jPlayerInterface,errorAlerts:false,warningAlerts:false};R=a.extend(true,{},S,T);I.bind(a.jPlayer.event.ready,function(){I.bind(a.jPlayer.event.ended,function(U){z()});I.bind(a.jPlayer.event.play,function(U){I.jPlayer("pauseOthers");Q.eq(l).addClass(n(g.playing)).siblings().removeClass(n(g.playing))});I.bind(a.jPlayer.event.playing,function(U){C=true});I.bind(a.jPlayer.event.pause,function(U){C=false});a(g.playerPrevious).click(function(){y();a(this).blur();return false});a(g.playerNext).click(function(){z();a(this).blur();return false});p.bind("mbInitPlaylistAdvance",function(U){var V=this.getData("mbInitPlaylistAdvance");if(V!=l){l=V;N(l)}else{if(!I.data("jPlayer").status.srcSet){N(0)}else{D()}}});K();p.trigger("mbPlaylistLoaded");B(e.autoplay)});I.jPlayer(R)}function B(R){l=0;if(R){N(l)}else{J(l);p.trigger("mbPlaylistInit")}}function J(R){l=R;I.jPlayer("setMedia",j[l])}function N(R){J(R);if(R>=e.tracksToShow){M()}p.trigger("mbPlaylistAdvance");I.jPlayer("play")}function z(){var R=(l+1<j.length)?l+1:0;N(R)}function y(){var R=(l-1>=0)?l-1:j.length-1;N(R)}function D(){if(!C){I.jPlayer("play")}else{I.jPlayer("pause")}}function K(){var R=a();A=p.find(g.tracks);for(var T=0;T<10;T++){R=R.add(O.ratingBar)}for(var S=0;S<j.length;S++){var V=a(O.listItem);V.find(g.rating).html(R.clone());V.find(g.title).html(i(S));V.find(g.duration).html(x(S));d("track",V,S);F(V,S);V.data("index",S);A.append(V)}Q=a(g.track);Q.slice(0,e.tracksToShow).each(function(){E+=a(this).outerHeight()});Q.slice(e.tracksToShow,j.length).each(function(){G+=a(this).outerHeight()});if(G>0){var U=a(g.trackList);A.height(E);U.addClass("show-more-button");U.find(g.moreButton).click(function(){H=a(this);M()})}Q.find(".title").click(function(){N(a(this).parents("li").data("index"))})}function M(){if(c(H)){H=p.find(g.moreButton)}A.animate({height:E+G},function(){H.animate({opacity:0},function(){H.slideUp(function(){H.parents(g.trackList).removeClass("show-more-button");H.remove()})})})}function x(R){return !c(j[R].duration)?j[R].duration:"-"}function F(S,R){if(!c(j[R].buy)){S.find(g.buy).removeClass(n(g.buyNotActive)).attr("href",j[R].buy).html(P(R))}}function P(R){return(!c(j[R].price)?e.currencySymbol+j[R].price:"")+" "+e.buyText}return{init:L,playlistInit:B,playlistAdvance:N,playlistNext:z,playlistPrev:y,togglePlay:D,$myJplayer:I}};t=function(){var x=p.find(g.track);function z(){a(g.rating).find(g.ratingLevel).hover(function(){a(this).addClass("hover").prevAll().addClass("hover").end().nextAll().removeClass("hover")});a(g.rating).mouseleave(function(){a(this).find(g.ratingLevel).removeClass("hover")});a(g.ratingLevel).click(function(){var C=a(this),B=C.parent().children().index(C)+1,A;if(C.hasClass(n(g.trackRating))){B=B/2;A=C.parents("li").data("index");if(A==l){k(B)}}else{A=l;o(x.eq(A),B)}C.prevAll().add(C).addClass(n(g.ratingLevelOn)).end().end().nextAll().removeClass(n(g.ratingLevelOn));y(A,B)})}function y(A,B){j[A].rating=B;r(e.ratingCallback,A,j[A],B)}z()};h=function(){var A,E,G,y;function F(){A=a(g.player),E=A.find(g.title),G=A.find(g.artist),y=A.find(g.albumCover);C();p.bind("mbPlaylistAdvance mbPlaylistInit",function(){z();x();d("current",null,l);B()})}function D(){var H,I;H='<div class="ttw-music-player"><div class="player jp-interface"><div class="album-cover"><span class="img"></span> <span class="highlight"></span> </div> <div class="track-info"> <p class="title"></p> <p class="artist-outer">By <span class="artist"></span></p> <div class="rating"> <span class="rating-level rating-star on"></span> <span class="rating-level rating-star on"></span> <span class="rating-level rating-star on"></span> <span class="rating-level rating-star on"></span> <span class="rating-level rating-star"></span> </div> </div> <div class="player-controls"> <div class="main"> <div class="previous jp-previous"></div> <div class="play jp-play"></div> <div class="pause jp-pause"></div> <div class="next jp-next"></div><!-- These controls aren\'t used by this plugin, but jPlayer seems to require that they exist --> <span class="unused-controls"> <span class="jp-video-play"></span> <span class="jp-stop"></span> <span class="jp-mute"></span> <span class="jp-unmute"></span> <span class="jp-volume-bar"></span> <span class="jp-volume-bar-value"></span> <span class="jp-volume-max"></span> <span class="jp-current-time"></span> <span class="jp-duration"></span> <span class="jp-full-screen"></span> <span class="jp-restore-screen"></span> <span class="jp-repeat"></span> <span class="jp-repeat-off"></span> <span class="jp-gui"></span> </span> </div> <div class="progress-wrapper"> <div class="progress jp-seek-bar"> <div class="elapsed jp-play-bar"></div> </div> </div> </div> </div> <p class="description"></p> <div class="tracklist"> <ol class="tracks"> </ol> <div class="more">View More...</div> </div> <div class="jPlayer-container"></div></div>';I=a(H).css({display:"none",opacity:0}).appendTo(p).slideDown("slow",function(){I.animate({opacity:1});p.trigger("mbInterfaceBuilt")})}function z(){E.html(i(l))}function x(){if(c(j[l].artist)){G.parent(g.artistOuter).animate({opacity:0},"fast")}else{G.html(j[l].artist).parent(g.artistOuter).animate({opacity:1},"fast")}}function B(){y.animate({opacity:0},"fast",function(){if(!c(j[l].cover)){var H=l;a('<img src="'+j[l].cover+'" alt="album cover" />',this).imagesLoaded(function(){if(H==l){y.html(a(this)).animate({opacity:1})}})}})}function C(){if(!c(e.description)){p.find(g.description).html(e.description).addClass(n(g.descriptionShowing)).slideDown()}}return{buildInterface:D,init:F}};function i(x){if(!c(j[x].title)){return j[x].title}else{if(!c(j[x].mp3)){return w(j[x].mp3)}else{if(!c(j[x].oga)){return w(j[x].oga)}else{return""}}}}function w(x){x=x.split("/");return x[x.length-1]}function d(z,A,x){if(z=="track"){if(!c(j[x].rating)){o(A,j[x].rating)}}else{var y=!c(j[x].rating)?Math.ceil(j[x].rating):0;k(y)}}function k(x){p.find(g.trackInfo).find(g.ratingLevel).removeClass(n(g.ratingLevelOn)).slice(0,x).addClass(n(g.ratingLevelOn))}function o(y,x){y.find(g.ratingLevel).removeClass(n(g.ratingLevelOn)).slice(0,x*2).addClass(n(g.ratingLevelOn))}function n(x){return x.substr(1)}function r(y){var x=Array.prototype.slice.call(arguments,1);if(a.isFunction(y)){y.apply(this,x)}}function c(x){return typeof x=="undefined"}s()}})(jQuery);(function(a){a.fn.imagesLoaded=function(d){var c=this.filter("img"),b=c.length;c.bind("load",function(){if(--b<=0){d.call(c,this)}}).each(function(){if(this.complete||this.complete===undefined){var e=this.src;this.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";this.src=e}});return this}})(jQuery);
js/jquery/plugin/ttw-music-player.js ADDED
@@ -0,0 +1,591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Created by 23rd and Walnut for Codebasehero.com
3
+ * www.23andwalnut.com
4
+ * www.codebasehero.com
5
+ * User: Saleem El-Amin
6
+ * Date: 6/11/11
7
+ * Time: 6:41 AM
8
+ *
9
+ * Version: 1.01
10
+ * License: You are free to use this file in personal and commercial products, however re-distribution 'as-is' without prior consent is prohibited.
11
+ *
12
+ * Edited: Dominik Wyss, wmdextensions.com
13
+ */
14
+
15
+ var $j = jQuery.noConflict(); // added to not conflict with prototype, replaced below for same reason
16
+ (function($j) {
17
+
18
+ $j.fn.ttwMusicPlayer = function(playlist, userOptions) {
19
+ var $self = this, defaultOptions, options, cssSelector, appMgr, playlistMgr, interfaceMgr, ratingsMgr, playlist,
20
+ layout, ratings, myPlaylist, current;
21
+
22
+ cssSelector = {
23
+ jPlayer: "#jquery_jplayer",
24
+ jPlayerInterface: '.jp-interface',
25
+ playerPrevious: ".jp-interface .jp-previous",
26
+ playerNext: ".jp-interface .jp-next",
27
+ trackList:'.tracklist',
28
+ tracks:'.tracks',
29
+ track:'.track',
30
+ trackRating:'.rating-bar',
31
+ trackInfo:'.track-info',
32
+ rating:'.rating',
33
+ ratingLevel:'.rating-level',
34
+ ratingLevelOn:'.on',
35
+ title: '.title',
36
+ duration: '.duration',
37
+ buy:'.buy',
38
+ buyNotActive:'.not-active',
39
+ option:'.option',
40
+ optionNotActive:'.opt-not-active',
41
+ playing:'.playing',
42
+ moreButton:'.more',
43
+ player:'.player',
44
+ artist:'.artist',
45
+ artistOuter:'.artist-outer',
46
+ albumCover:'.img',
47
+ description:'.description',
48
+ descriptionShowing:'.showing'
49
+ };
50
+
51
+ defaultOptions = {
52
+ ratingCallback:null,
53
+ currencySymbol:'$',
54
+ buyText:'BUY',
55
+ tracksToShow:5,
56
+ autoPlay:false,
57
+ jPlayer:{}
58
+ };
59
+
60
+ options = $j.extend(true, {}, defaultOptions, userOptions);
61
+
62
+ myPlaylist = playlist;
63
+
64
+ current = 0;
65
+
66
+ appMgr = function() {
67
+ playlist = new playlistMgr();
68
+ layout = new interfaceMgr();
69
+
70
+ layout.buildInterface();
71
+ playlist.init(options.jPlayer);
72
+
73
+ //don't initialize the ratings until the playlist has been built, which wont happen until after the jPlayer ready event
74
+ $self.bind('mbPlaylistLoaded', function() {
75
+ $self.bind('mbInterfaceBuilt', function() {
76
+ ratings = new ratingsMgr();
77
+ });
78
+ layout.init();
79
+
80
+ });
81
+ };
82
+
83
+ playlistMgr = function() {
84
+
85
+ var playing = false, markup, $myJplayer = {},$tracks,showHeight = 0,remainingHeight = 0,$tracksWrapper, $more;
86
+
87
+ markup = {
88
+ listItem:'<li class="track">' +
89
+ '<span class="title"></span>' +
90
+ '<span class="duration"></span>' +
91
+ '<span class="rating"></span>' +
92
+ '<a href="#" class="buy not-active"></a>' +
93
+ '<input type="checkbox" class="option opt-not-active"/>' +
94
+ '</li>',
95
+ ratingBar:'<span class="rating-level rating-bar"></span>'
96
+ };
97
+
98
+ function init(playlistOptions) {
99
+
100
+ $myJplayer = $j('.ttw-music-player .jPlayer-container');
101
+
102
+
103
+ var jPlayerDefaults, jPlayerOptions;
104
+
105
+ jPlayerDefaults = {
106
+ swfPath: "jquery-jplayer",
107
+ supplied: "mp3, oga",
108
+ solution:'html, flash',
109
+ cssSelectorAncestor: cssSelector.jPlayerInterface,
110
+ errorAlerts: false,
111
+ warningAlerts: false
112
+ };
113
+
114
+ //apply any user defined jPlayer options
115
+ jPlayerOptions = $j.extend(true, {}, jPlayerDefaults, playlistOptions);
116
+
117
+ $myJplayer.bind($j.jPlayer.event.ready, function() {
118
+
119
+ //Bind jPlayer events. Do not want to pass in options object to prevent them from being overridden by the user
120
+ $myJplayer.bind($j.jPlayer.event.ended, function(event) {
121
+ //playlistNext();
122
+ });
123
+
124
+ $myJplayer.bind($j.jPlayer.event.play, function(event) {
125
+ $myJplayer.jPlayer("pauseOthers");
126
+ $tracks.eq(current).addClass(attr(cssSelector.playing)).siblings().removeClass(attr(cssSelector.playing));
127
+ });
128
+
129
+ $myJplayer.bind($j.jPlayer.event.playing, function(event) {
130
+ playing = true;
131
+ });
132
+
133
+ $myJplayer.bind($j.jPlayer.event.pause, function(event) {
134
+ playing = false;
135
+ });
136
+
137
+ //Bind next/prev click events
138
+ $j(cssSelector.playerPrevious).click(function() {
139
+ playlistPrev();
140
+ $j(this).blur();
141
+ return false;
142
+ });
143
+
144
+ $j(cssSelector.playerNext).click(function() {
145
+ playlistNext();
146
+ $j(this).blur();
147
+ return false;
148
+ });
149
+
150
+ $self.bind('mbInitPlaylistAdvance', function(e) {
151
+ var changeTo = this.getData('mbInitPlaylistAdvance');
152
+
153
+ if (changeTo != current) {
154
+ current = changeTo;
155
+ playlistAdvance(current);
156
+ }
157
+ else {
158
+ if (!$myJplayer.data('jPlayer').status.srcSet) {
159
+ playlistAdvance(0);
160
+ }
161
+ else {
162
+ togglePlay();
163
+ }
164
+ }
165
+ });
166
+
167
+ buildPlaylist();
168
+ //If the user doesn't want to wait for widget loads, start playlist now
169
+ $self.trigger('mbPlaylistLoaded');
170
+
171
+ playlistInit(options.autoplay);
172
+ });
173
+
174
+ //Initialize jPlayer
175
+ $myJplayer.jPlayer(jPlayerOptions);
176
+ }
177
+
178
+ function playlistInit(autoplay) {
179
+ current = 0;
180
+
181
+ if (autoplay) {
182
+ playlistAdvance(current);
183
+ }
184
+ else {
185
+ playlistConfig(current);
186
+ $self.trigger('mbPlaylistInit');
187
+ }
188
+ }
189
+
190
+ function playlistConfig(index) {
191
+ current = index;
192
+ $myJplayer.jPlayer("setMedia", myPlaylist[current]);
193
+ }
194
+
195
+ function playlistAdvance(index) {
196
+ playlistConfig(index);
197
+
198
+ if (index >= options.tracksToShow)
199
+ showMore();
200
+
201
+ $self.trigger('mbPlaylistAdvance');
202
+ $myJplayer.jPlayer("play");
203
+ }
204
+
205
+ function playlistNext() {
206
+ var index = (current + 1 < myPlaylist.length) ? current + 1 : 0;
207
+ playlistAdvance(index);
208
+ }
209
+
210
+ function playlistPrev() {
211
+ var index = (current - 1 >= 0) ? current - 1 : myPlaylist.length - 1;
212
+ playlistAdvance(index);
213
+ }
214
+
215
+ function togglePlay() {
216
+ if (!playing)
217
+ $myJplayer.jPlayer("play");
218
+ else $myJplayer.jPlayer("pause");
219
+ }
220
+
221
+ function buildPlaylist() {
222
+ var $ratings = $j();
223
+
224
+ $tracksWrapper = $self.find(cssSelector.tracks);
225
+
226
+ //set up the html for the track ratings
227
+ for (var i = 0; i < 10; i++)
228
+ $ratings = $ratings.add(markup.ratingBar);
229
+
230
+ for (var j = 0; j < myPlaylist.length; j++) {
231
+ var $track = $j(markup.listItem);
232
+
233
+ //since $ratings refers to a specific object, if we just use .html($ratings) we would be moving the $rating object from one list item to the next
234
+ $track.find(cssSelector.rating).html($ratings.clone());
235
+
236
+ $track.find(cssSelector.title).html(trackName(j));
237
+
238
+ $track.find(cssSelector.duration).html(duration(j));
239
+
240
+ setRating('track', $track, j);
241
+
242
+ setBuyLink($track, j);
243
+
244
+ $track.data('index', j);
245
+
246
+ $tracksWrapper.append($track);
247
+ }
248
+
249
+ $tracks = $j(cssSelector.track);
250
+
251
+ $tracks.slice(0, options.tracksToShow).each(function() {
252
+ showHeight += $j(this).outerHeight();
253
+ });
254
+
255
+ $tracks.slice(options.tracksToShow, myPlaylist.length).each(function() {
256
+ remainingHeight += $j(this).outerHeight();
257
+ });
258
+
259
+ if (remainingHeight > 0) {
260
+ var $trackList = $j(cssSelector.trackList);
261
+
262
+ $tracksWrapper.height(showHeight);
263
+ $trackList.addClass('show-more-button');
264
+
265
+ $trackList.find(cssSelector.moreButton).click(function() {
266
+ $more = $j(this);
267
+
268
+ showMore();
269
+ });
270
+ }
271
+
272
+ $tracks.find('.title').click(function() {
273
+ playlistAdvance($j(this).parents('li').data('index'));
274
+ });
275
+ }
276
+
277
+ function showMore() {
278
+ if (isUndefined($more))
279
+ $more = $self.find(cssSelector.moreButton);
280
+
281
+ $tracksWrapper.animate({height: showHeight + remainingHeight}, function() {
282
+ $more.animate({opacity:0}, function() {
283
+ $more.slideUp(function() {
284
+ $more.parents(cssSelector.trackList).removeClass('show-more-button');
285
+ $more.remove();
286
+
287
+ });
288
+ });
289
+ });
290
+ }
291
+
292
+ function duration(index) {
293
+ return !isUndefined(myPlaylist[index].duration) ? myPlaylist[index].duration : '-';
294
+ }
295
+
296
+ function setBuyLink($track, index) {
297
+ if (!isUndefined(myPlaylist[index].buy)) {
298
+ $track.find(cssSelector.buy).removeClass(attr(cssSelector.buyNotActive)).attr('href', myPlaylist[index].buy).html(buyText(index));
299
+ $track.find(cssSelector.option).removeClass(attr(cssSelector.optionNotActive)).attr('onclick', myPlaylist[index].buy);
300
+ }
301
+ }
302
+
303
+ function buyText(index) {
304
+ return (!isUndefined(myPlaylist[index].price) ? options.currencySymbol + myPlaylist[index].price : '') + ' ' + options.buyText;
305
+ }
306
+
307
+ return{
308
+ init:init,
309
+ playlistInit:playlistInit,
310
+ playlistAdvance:playlistAdvance,
311
+ playlistNext:playlistNext,
312
+ playlistPrev:playlistPrev,
313
+ togglePlay:togglePlay,
314
+ $myJplayer:$myJplayer
315
+ };
316
+
317
+ };
318
+
319
+ ratingsMgr = function() {
320
+
321
+ var $tracks = $self.find(cssSelector.track);
322
+
323
+ function bindEvents() {
324
+
325
+ //Handler for when user hovers over a rating
326
+ $j(cssSelector.rating).find(cssSelector.ratingLevel).hover(function() {
327
+ $j(this).addClass('hover').prevAll().addClass('hover').end().nextAll().removeClass('hover');
328
+ });
329
+
330
+ //Restores previous rating when user is finished hovering (assuming there is no new rating)
331
+ $j(cssSelector.rating).mouseleave(function() {
332
+ $j(this).find(cssSelector.ratingLevel).removeClass('hover');
333
+ });
334
+
335
+ //Set the new rating when the user clicks
336
+ $j(cssSelector.ratingLevel).click(function() {
337
+ var $this = $j(this), rating = $this.parent().children().index($this) + 1, index;
338
+
339
+ if ($this.hasClass(attr(cssSelector.trackRating))) {
340
+ rating = rating / 2;
341
+ index = $this.parents('li').data('index');
342
+
343
+ if (index == current)
344
+ applyCurrentlyPlayingRating(rating);
345
+ }
346
+ else {
347
+ index = current;
348
+ applyTrackRating($tracks.eq(index), rating);
349
+ }
350
+
351
+
352
+ $this.prevAll().add($this).addClass(attr(cssSelector.ratingLevelOn)).end().end().nextAll().removeClass(attr(cssSelector.ratingLevelOn));
353
+
354
+ processRating(index, rating);
355
+ });
356
+ }
357
+
358
+ function processRating(index, rating) {
359
+ myPlaylist[index].rating = rating;
360
+ runCallback(options.ratingCallback, index, myPlaylist[index], rating);
361
+ }
362
+
363
+ bindEvents();
364
+ };
365
+
366
+ interfaceMgr = function() {
367
+
368
+ var $player, $title, $artist, $albumCover;
369
+
370
+
371
+ function init() {
372
+ $player = $j(cssSelector.player),
373
+ $title = $player.find(cssSelector.title),
374
+ $artist = $player.find(cssSelector.artist),
375
+ $albumCover = $player.find(cssSelector.albumCover);
376
+
377
+ setDescription();
378
+
379
+ $self.bind('mbPlaylistAdvance mbPlaylistInit', function() {
380
+ setTitle();
381
+ setArtist();
382
+ setRating('current', null, current);
383
+ setCover();
384
+ });
385
+ }
386
+
387
+ function buildInterface() {
388
+ var markup, $interface;
389
+
390
+ //I would normally use the templating plugin for something like this, but I wanted to keep this plugin's footprint as small as possible
391
+ markup = '<div class="ttw-music-player">' +
392
+ '<div class="player jp-interface">' +
393
+ '<div class="album-cover">' +
394
+ '<span class="img"></span>' +
395
+ ' <span class="highlight"></span>' +
396
+ ' </div>' +
397
+ ' <div class="track-info">' +
398
+ ' <p class="title"></p>' +
399
+ ' <p class="artist-outer">By <span class="artist"></span></p>' +
400
+ ' <div class="rating">' +
401
+ ' <span class="rating-level rating-star on"></span>' +
402
+ ' <span class="rating-level rating-star on"></span>' +
403
+ ' <span class="rating-level rating-star on"></span>' +
404
+ ' <span class="rating-level rating-star on"></span>' +
405
+ ' <span class="rating-level rating-star"></span>' +
406
+ ' </div>' +
407
+ ' </div>' +
408
+ ' <div class="player-controls">' +
409
+ ' <div class="mainc">' +
410
+ ' <div class="previous jp-previous"></div>' +
411
+ ' <div class="play jp-play"></div>' +
412
+ ' <div class="pause jp-pause"></div>' +
413
+ ' <div class="next jp-next"></div>' +
414
+ '<!-- These controls aren\'t used by this plugin, but jPlayer seems to require that they exist -->' +
415
+ ' <span class="unused-controls">' +
416
+ ' <span class="jp-video-play"></span>' +
417
+ ' <span class="jp-stop"></span>' +
418
+ ' <span class="jp-mute"></span>' +
419
+ ' <span class="jp-unmute"></span>' +
420
+ ' <span class="jp-volume-bar"></span>' +
421
+ ' <span class="jp-volume-bar-value"></span>' +
422
+ ' <span class="jp-volume-max"></span>' +
423
+ ' <span class="jp-current-time"></span>' +
424
+ ' <span class="jp-duration"></span>' +
425
+ ' <span class="jp-full-screen"></span>' +
426
+ ' <span class="jp-restore-screen"></span>' +
427
+ ' <span class="jp-repeat"></span>' +
428
+ ' <span class="jp-repeat-off"></span>' +
429
+ ' <span class="jp-gui"></span>' +
430
+ ' </span>' +
431
+ ' </div>' +
432
+ ' <div class="progress-wrapper">' +
433
+ ' <div class="progress jp-seek-bar">' +
434
+ ' <div class="elapsed jp-play-bar"></div>' +
435
+ ' </div>' +
436
+ ' </div>' +
437
+ ' </div>' +
438
+ ' </div>' +
439
+ ' <p class="description"></p>' +
440
+ ' <div class="tracklist">' +
441
+ ' <ol class="tracks"> </ol>' +
442
+ ' <div class="more">View WAV Files...</div>' +
443
+ ' </div>' +
444
+ ' <div class="jPlayer-container"></div>' +
445
+ '</div>';
446
+
447
+ $interface = $j(markup).css({display:'none', opacity:0}).appendTo($self).slideDown('slow', function() {
448
+ $interface.animate({opacity:1});
449
+
450
+ $self.trigger('mbInterfaceBuilt');
451
+ });
452
+ }
453
+
454
+ function setTitle() {
455
+ $title.html(trackName(current));
456
+ }
457
+
458
+ function setArtist() {
459
+ if (isUndefined(myPlaylist[current].artist))
460
+ $artist.parent(cssSelector.artistOuter).animate({opacity:0}, 'fast');
461
+ else {
462
+ $artist.html(myPlaylist[current].artist).parent(cssSelector.artistOuter).animate({opacity:1}, 'fast');
463
+ }
464
+ }
465
+
466
+ function setCover() {
467
+ $albumCover.animate({opacity:0}, 'fast', function() {
468
+ if (!isUndefined(myPlaylist[current].cover)) {
469
+ var now = current;
470
+ $j('<img src="' + myPlaylist[current].cover + '" alt="album cover" />', this).imagesLoaded(function(){
471
+ if(now == current)
472
+ $albumCover.html($j(this)).animate({opacity:1})
473
+ });
474
+ }
475
+ });
476
+ }
477
+
478
+ function setDescription() {
479
+ if (!isUndefined(options.description))
480
+ $self.find(cssSelector.description).html(options.description).addClass(attr(cssSelector.descriptionShowing)).slideDown();
481
+ }
482
+
483
+ return{
484
+ buildInterface:buildInterface,
485
+ init:init
486
+ }
487
+
488
+ };
489
+
490
+ /** Common Functions **/
491
+ function trackName(index) {
492
+ if (!isUndefined(myPlaylist[index].title))
493
+ return myPlaylist[index].title;
494
+ else if (!isUndefined(myPlaylist[index].mp3))
495
+ return fileName(myPlaylist[index].mp3);
496
+ else if (!isUndefined(myPlaylist[index].oga))
497
+ return fileName(myPlaylist[index].oga);
498
+ else return '';
499
+ }
500
+
501
+ function fileName(path) {
502
+ path = path.split('/');
503
+ return path[path.length - 1];
504
+ }
505
+
506
+ function setRating(type, $track, index) {
507
+ if (type == 'track') {
508
+ if (!isUndefined(myPlaylist[index].rating)) {
509
+ applyTrackRating($track, myPlaylist[index].rating);
510
+ }
511
+ }
512
+ else {
513
+ //if the rating isn't set, use 0
514
+ var rating = !isUndefined(myPlaylist[index].rating) ? Math.ceil(myPlaylist[index].rating) : 0;
515
+ applyCurrentlyPlayingRating(rating);
516
+ }
517
+ }
518
+
519
+ function applyCurrentlyPlayingRating(rating) {
520
+ //reset the rating to 0, then set the rating defined above
521
+ $self.find(cssSelector.trackInfo).find(cssSelector.ratingLevel).removeClass(attr(cssSelector.ratingLevelOn)).slice(0, rating).addClass(attr(cssSelector.ratingLevelOn));
522
+
523
+ }
524
+
525
+ function applyTrackRating($track, rating) {
526
+ //multiply rating by 2 since the list ratings have 10 levels rather than 5
527
+ $track.find(cssSelector.ratingLevel).removeClass(attr(cssSelector.ratingLevelOn)).slice(0, rating * 2).addClass(attr(cssSelector.ratingLevelOn));
528
+
529
+ }
530
+
531
+
532
+ /** Utility Functions **/
533
+ function attr(selector) {
534
+ return selector.substr(1);
535
+ }
536
+
537
+ function runCallback(callback) {
538
+ var functionArgs = Array.prototype.slice.call(arguments, 1);
539
+
540
+ if ($j.isFunction(callback)) {
541
+ callback.apply(this, functionArgs);
542
+ }
543
+ }
544
+
545
+ function isUndefined(value) {
546
+ return typeof value == 'undefined';
547
+ }
548
+
549
+ appMgr();
550
+ };
551
+
552
+ })(jQuery);
553
+
554
+ (function($j) {
555
+
556
+
557
+ // $j('img.photo',this).imagesLoaded(myFunction)
558
+ // execute a callback when all images have loaded.
559
+ // needed because .load() doesn't work on cached images
560
+
561
+ // mit license. paul irish. 2010.
562
+ // webkit fix from Oren Solomianik. thx!
563
+
564
+ // callback function is passed the last image to load
565
+ // as an argument, and the collection as `this`
566
+
567
+
568
+ $j.fn.imagesLoaded = function(callback) {
569
+ var elems = this.filter('img'),
570
+ len = elems.length;
571
+
572
+ elems.bind('load',
573
+ function() {
574
+ if (--len <= 0) {
575
+ callback.call(elems, this);
576
+ }
577
+ }).each(function() {
578
+ // cached images don't fire load sometimes, so we reset src.
579
+ if (this.complete || this.complete === undefined) {
580
+ var src = this.src;
581
+ // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
582
+ // data uri bypasses webkit log warning (thx doug jones)
583
+ this.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
584
+ this.src = src;
585
+ }
586
+ });
587
+
588
+ return this;
589
+ };
590
+
591
+ })(jQuery);
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Wmd_Musicplayer</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://wmdextensions.com/WMD-License-Community.txt">EULA</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>HTML5 Musicplayer playing mp3 and ogg samples.</summary>
10
+ <description>Make a downloadable product from a music album that provides each track as a link. Musicplayer is displayed instead of product image and options, using product images to display with individual tracks(same index) or default product image. Product options/links are converted to playlist. Player plays mp3 / ogg sample files from downloadable link sample url.</description>
11
+ <notes>Make a downloadable product from a music album that provides each track as a link. Musicplayer is displayed instead of product image and options, using product images to display with individual tracks(same index) or default product image. Product options/links are converted to playlist. Player plays mp3 / ogg sample files from downloadable link sample url.</notes>
12
+ <authors><author><name>Dominik Wyss</name><user>justanother</user><email>info@digiswiss.ch</email></author></authors>
13
+ <date>2012-04-16</date>
14
+ <time>11:41:53</time>
15
+ <contents><target name="magecommunity"><dir name="Wmd"><dir name="Musicplayer"><dir name="Helper"><file name="Data.php" hash="6bf498ee62e209c82ae359ca72c5097e"/></dir><dir name="etc"><file name="config.xml" hash="c5a18442a07fbb21631ae5b8f36d377f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="WMD_Musicplayer.xml" hash="7bc0f4d4b941a043726be442720581fe"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="musicplayer"><dir name="layout"><file name="downloadable.xml" hash="90108590699b46d194a4e546cbd825eb"/></dir><dir name="template"><dir name="catalog"><dir name="product"><file name="list.phtml" hash="5d4335985aa95e662feda7c8a6597a76"/><file name="new.phtml" hash="19eb1f4bd3ced9924d8050392eba9934"/><dir name="view"><dir name="options"><file name="wrapper.phtml" hash="5181059d351a498c842aff27287866a1"/></dir><file name="options.phtml" hash="52098ac0825ce56179ff9952956894e9"/></dir><file name="view.phtml" hash="0f05c7fcdff3bcf75cb1dc65949aaffc"/></dir></dir><dir name="downloadable"><dir name="catalog"><dir name="product"><file name="links.phtml" hash="a52f6c66fadffb46b6f326cad8fdbd03"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir><dir name="js"><dir name="jquery"><file name="jquery-1.6.1.min.js" hash="a34f78c3aecd182144818eb4b7303fda"/><dir name="plugin"><file name="Instructions.txt" hash="71c0c733bc4b72679d0866c724ad0d1a"/><dir name="css"><file name="style.css" hash="15e094c3a1aab2740d2d4b3b1cb27089"/></dir><dir name="images"><file name="album-cover-bg.jpg" hash="a6399ddb2225099628fe2865426a02ce"/><file name="album-cover-highlight.png" hash="92c2f25d0a259bb910fca76fcb8e4df3"/><file name="buy-bg.png" hash="547a4bbb2241f43360d2c0c3aaa9a2a1"/><file name="dark_matter.png" hash="c4d44d7b8e26b821c22c8249a1622358"/><file name="description-more.png" hash="3de7b58a89fceb5d4111524a608d46d7"/><file name="player-bg.png" hash="0a2aed5e3de5f9361f5c054e0152591e"/><file name="player-elapsed.png" hash="ed593b850e7bc3ebca3d576489912e56"/><file name="player-next-hover.png" hash="92fbe56f0a0f2d20dbe418c4ed258c45"/><file name="player-next.png" hash="c993a614ecef0aa23dc980a6b0f2084c"/><file name="player-pause-hover.png" hash="09a9d282631f7f5cd70b73bbfc4f7c02"/><file name="player-pause.png" hash="54763f36d02271f9d04985f9d3e18533"/><file name="player-play-hover.png" hash="9a9dd1ff63345bf82dd6ecd336cad3c0"/><file name="player-play.png" hash="70092fb82711790dfda7eef5d1e7a376"/><file name="player-previous-hover.png" hash="a4c6af0edb3339f0fba464b20029b78b"/><file name="player-previous.png" hash="43e95c8ba45a5c77f3d38f84025bd148"/><file name="player-progress.png" hash="b587091052f9c3acfb6a6b4a9272896e"/><file name="rating-bar-on.png" hash="fd00a5e95897f7b9f1c03ef880e4e053"/><file name="rating-bar.png" hash="20b83e25d53e13ca7292ab23089a6813"/><file name="rating-off.png" hash="09cb14883f52a8336ea8058494fdcb2a"/><file name="rating-on.png" hash="24ec62c11287aec35c436b89a17d2839"/><file name="tracklist-bg.png" hash="0a4c7702ccf35d037d77596e246722e7"/><file name="tracklist-item-bg.png" hash="7fcde394b379c74bd41dbf53878400a5"/><file name="tracklist-more.png" hash="462ff16051835b99cfaef494e8dc04dc"/></dir><dir name="jquery-jplayer"><file name="Jplayer.swf" hash="29f093d52c759a936309f061a06889b7"/><file name="jquery.jplayer.js" hash="7d6e3b24afb43147caeba33494e07577"/></dir><file name="ttw-music-player-min.js" hash="effdc2b12f48c14bbdbfa51b7accd93f"/><file name="ttw-music-player.js" hash="56e058428535b6c92826388e3a7bcabc"/></dir></dir></dir><dir name="tracks"><file name="readme.txt" hash="91509b2549a3bf89dcc7eed38546c643"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Wmd_Musicplayer.csv" hash="d0c70e493f8f2ab85c8ed60a306db47c"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
tracks/readme.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ Put mp3 and ogg clips of your tracks in this folder
2
+ To encode ogg http://www.vorbis.com/
3
+ To encode mp3 http://www.rarewares.org/mp3-lame-bundle.php
4
+ Sample tracks are used in downloadable product link sample.
5
+