YITH WooCommerce Zoom Magnifier - Version 2.0.0

Version Description

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Zoom Magnifier
Version 2.0.0
Comparing to
See all releases

Code changes from version 1.4.0 to 2.0.0

Files changed (52) hide show
  1. assets/css/admin.css +131 -20
  2. assets/css/frontend.css +103 -65
  3. assets/css/yith_magnifier.css +85 -70
  4. assets/icons/lightbox.svg +18 -0
  5. assets/icons/zoom.svg +18 -0
  6. assets/images/01-bg.png +0 -0
  7. assets/images/01-icon.png +0 -0
  8. assets/images/01.png +0 -0
  9. assets/images/02-bg.png +0 -0
  10. assets/images/02-icon.png +0 -0
  11. assets/images/02.png +0 -0
  12. assets/images/03-bg.png +0 -0
  13. assets/images/03-icon.png +0 -0
  14. assets/images/03.png +0 -0
  15. assets/images/slider-arrow.png +0 -0
  16. assets/images/upgrade.png +0 -0
  17. assets/images/yith-woocommerce-zoom-magnifier-video.jpg +0 -0
  18. assets/js/init.min.js +1 -0
  19. assets/js/init.prettyPhoto.js +935 -0
  20. assets/js/jquery.carouFredSel.js +3822 -4253
  21. assets/js/jquery.carouFredSel.min.js +1 -1
  22. assets/js/jquery.min.js +1 -1
  23. assets/js/yith_magnifier.js +1041 -853
  24. assets/js/yith_magnifier.min.js +1 -1
  25. assets/js/ywzm_backend.js +88 -0
  26. assets/js/ywzm_backend.min.js +1 -0
  27. assets/js/ywzm_frontend.js +285 -62
  28. assets/js/ywzm_frontend.min.js +1 -1
  29. changelog.txt +190 -190
  30. class.yith-wcmg-admin.php +0 -112
  31. class.yith-wcmg-frontend.php +0 -173
  32. functions.yith-wcmg.php +0 -78
  33. init.php +154 -157
  34. languages/yith-woocommerce-zoom-magnifier.pot +243 -151
  35. lib/class.yith-wcmg-admin.php +97 -0
  36. lib/class.yith-wcmg-frontend.php +368 -0
  37. lib/class.yith-woocommerce-zoom-magnifier.php +177 -188
  38. lib/class.yith-ywzm-custom-types.php +0 -181
  39. lib/class.yith-ywzm-plugin-fw-loader.php +266 -253
  40. lib/compatibility/class-yith-wczm-compatibility.php +113 -0
  41. lib/compatibility/class-yith-wczm-elementor-compatibility.php +102 -0
  42. lib/compatibility/elementor/class-yith-wczm-product-images-widget.php +80 -0
  43. plugin-fw/LICENSE.txt +695 -695
  44. plugin-fw/assets/css/admin.css +333 -333
  45. plugin-fw/assets/css/codemirror/codemirror.css +260 -260
  46. plugin-fw/assets/css/colorbox.css +65 -65
  47. plugin-fw/assets/css/elementor.css +35 -35
  48. plugin-fw/assets/css/metaboxes.css +751 -751
  49. plugin-fw/assets/css/yit-plugin-panel.css +1087 -1087
  50. plugin-fw/assets/css/yit-upgrade-to-pro.css +82 -82
  51. plugin-fw/assets/css/yit-upgrader.css +21 -21
  52. plugin-fw/assets/css/yith-fields.css +1648 -2258
assets/css/admin.css CHANGED
@@ -1,20 +1,131 @@
1
- .yith_woocommerce_slider {
2
- width: 300px;
3
- float: left
4
- }
5
- .yith_woocommerce_slider_value {
6
- margin-top: -5px;
7
- margin-left: 10px;
8
- width: 50px;
9
- float: left;
10
- text-align: center;
11
- font-weight: bold;
12
- }
13
-
14
- .yith_banner {
15
- margin-top: 10px;
16
- }
17
-
18
- #eg-wrap .select_fake {/* solve back-end conflict with Essential Grid */
19
- height: 24px;
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .yith_woocommerce_slider {
2
+ width: 300px;
3
+ float: left
4
+ }
5
+
6
+ .yith_woocommerce_slider_value {
7
+ margin-top: -5px;
8
+ margin-left: 10px;
9
+ width: 50px;
10
+ float: left;
11
+ text-align: center;
12
+ font-weight: bold;
13
+ }
14
+
15
+ #eg-wrap .select_fake { /* solve back-end conflict with Essential Grid */
16
+ height: 24px;
17
+ }
18
+
19
+ .yith-plugins_page_yith_woocommerce_zoom-magnifier_panel .yith-plugin-fw-dimensions__dimensions{
20
+ max-width: 250px;
21
+ }
22
+
23
+ #yith_wcmg_slider_sizes .yith-plugin-fw-dimensions__linked{
24
+ display: none;
25
+ }
26
+
27
+ #yith_wcmg_slider_radius, #ywzm_zoom_icon_size, #ywzm_lightbox_icon_size, #yith_wcmg_zoom_radius, #yith_wcmg_lightbox_radius{
28
+ max-width: 75px;
29
+ }
30
+
31
+
32
+ .ywzm-admin-wrap-content{
33
+ background: white;
34
+ padding: 20px;
35
+ }
36
+
37
+ .yith-plugin-ui .ywzm-admin-wrap-content h2 {
38
+ border: 0;
39
+ border-top-color: currentcolor;
40
+ border-top-style: none;
41
+ border-top-width: 0px;
42
+ padding: 0;
43
+ }
44
+
45
+
46
+ .ywzm-admin-no-posts {
47
+ text-align: center;
48
+ padding: 50px;
49
+ }
50
+
51
+ .ywzm-admin-no-posts-logo {
52
+ padding-bottom: 10px;
53
+ }
54
+
55
+ .ywzm-admin-no-posts-text {
56
+ font-size: 16px;
57
+ line-height: 30px;
58
+ margin-top: 20px;
59
+ }
60
+
61
+ .ywzm-admin-no-posts a.page-title-action {
62
+ padding: 5px 30px !important;
63
+ }
64
+
65
+ .ywzm-admin-no-posts-text p {
66
+ font-size: 14px;
67
+ line-height: 1em;
68
+ }
69
+
70
+ .wrap-title {
71
+ display: flex;
72
+ align-items: center;
73
+ }
74
+
75
+ .yith-plugins_page_yith_woocommerce_zoom-magnifier_panel .ui-dialog-buttonpane .ui-button {
76
+ box-shadow: none;
77
+ background: #007694;
78
+ color: #fff;
79
+ border: 0;
80
+ }
81
+
82
+
83
+ table.excluded_categories td,
84
+ table.excluded_categories th,
85
+ table.excluded_products td,
86
+ table.excluded_products th {
87
+ vertical-align: middle;
88
+ }
89
+
90
+ table.excluded_categories .column-image,
91
+ table.excluded_products .column-image {
92
+ width: 52px;
93
+ text-align: center;
94
+ white-space: nowrap;
95
+ }
96
+
97
+ table.excluded_categories .column-image img,
98
+ table.excluded_products .column-image img {
99
+ margin: 0;
100
+ width: auto;
101
+ height: auto;
102
+ max-width: 40px;
103
+ max-height: 40px;
104
+ }
105
+
106
+ table.excluded_categories .column-slug,
107
+ table.excluded_categories .column-name {
108
+ width: 25%;
109
+ }
110
+
111
+ table.excluded_categories .column-count {
112
+ width: 74px;
113
+ }
114
+
115
+ table.excluded_categories .column-actions,
116
+ table.excluded_products .column-actions {
117
+ width: 100px;
118
+ }
119
+
120
+ .wp-core-ui .yith-plugin-ui .ywzm-admin-wrap-content .button-secondary,
121
+ .wp-core-ui .yith-plugin-ui .ywzm-admin-wrap-content .button-primary {
122
+ line-height: 30px;
123
+ }
124
+ .ywzm-admin-wrap-content {
125
+ background: white;
126
+ padding: 20px;
127
+ }
128
+
129
+ .ywzm-admin-wrap-content input#add {
130
+ margin-top: 7px;
131
+ }
assets/css/frontend.css CHANGED
@@ -1,65 +1,103 @@
1
- /* gallery */
2
- .yith_magnifier_gallery {
3
- margin: 0;
4
- padding: 0;
5
- }
6
-
7
- .yith_magnifier_gallery li {
8
- position: relative;
9
- float: left;
10
- display: block;
11
- }
12
-
13
- .yith_magnifier_gallery li.last {
14
- margin-right: 0;
15
- }
16
-
17
- .yith_magnifier_gallery li a {
18
- width: 100% !important;
19
- display: block;
20
- margin-top: 10px;
21
- height: auto !important;
22
- }
23
-
24
- /* next/prev */
25
- .single-product.woocommerce .thumbnails {
26
- position: relative;
27
- }
28
-
29
- .single-product.woocommerce .thumbnails #slider-prev,
30
- .single-product.woocommerce .thumbnails #slider-next {
31
- display: none !important;
32
- cursor: pointer;
33
- width: 27px;
34
- height: 26px;
35
- background: url('../images/slider-arrow.png') no-repeat left center;
36
- position: absolute;
37
- top: 48%;
38
- margin-top: -2px;
39
- }
40
-
41
- .single-product.woocommerce .thumbnails #slider-prev {
42
- background-position: left center;
43
- left: 0px;
44
- }
45
-
46
- .single-product.woocommerce .thumbnails #slider-next {
47
- background-position: right center;
48
- right: 0px;
49
- }
50
-
51
- .single-product.woocommerce .thumbnails:hover #slider-prev,
52
- .single-product.woocommerce .thumbnails:hover #slider-next {
53
- display: block !important;
54
- }
55
-
56
- span.onsale {
57
- z-index: 10000
58
- }
59
-
60
- div.pp_woocommerce a.pp_expand {
61
- display: inline;
62
- bottom: 10px;
63
- top: initial;
64
- left: 10px;
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* gallery */
2
+ .yith_magnifier_gallery {
3
+ margin: 0;
4
+ padding: 0;
5
+ text-align: center;
6
+ }
7
+
8
+ .yith_magnifier_gallery li {
9
+ position: relative;
10
+ display: inline-block;
11
+ vertical-align: center;
12
+ top: 0;
13
+ }
14
+
15
+ /* .yith_magnifier_gallery li.last {
16
+ margin-right: 0;
17
+ } */
18
+
19
+ .yith_magnifier_gallery li a {
20
+ width: 100% !important;
21
+ display: block;
22
+ margin-top: 10px;
23
+ height: auto !important;
24
+ overflow: hidden;
25
+ }
26
+
27
+ /* next/prev */
28
+ .single-product.woocommerce .thumbnails {
29
+ position: relative;
30
+ overflow: hidden;
31
+ }
32
+
33
+ .single-product.woocommerce .thumbnails .dashicons{
34
+ display: table-cell;
35
+ text-align: center;
36
+ vertical-align: middle;
37
+ padding-bottom: 2px;
38
+ }
39
+
40
+
41
+ .single-product.woocommerce .thumbnails #slider-prev,
42
+ .single-product.woocommerce .thumbnails #slider-next {
43
+ display: none;
44
+ cursor: pointer;
45
+ width: 25px;
46
+ height: 25px;
47
+ position: absolute;
48
+ top: 50%;
49
+ transform: translateY( -50% );
50
+ }
51
+
52
+ .single-product.woocommerce .thumbnails #slider-prev {
53
+ background-position: left center;
54
+ left: 1px;
55
+ }
56
+
57
+ .single-product.woocommerce .thumbnails #slider-next {
58
+ background-position: right center;
59
+ right: 0px;
60
+ }
61
+
62
+ .single-product.woocommerce .thumbnails:hover #slider-prev,
63
+ .single-product.woocommerce .thumbnails:hover #slider-next {
64
+ display: block !important;
65
+ }
66
+
67
+ span.onsale {
68
+ z-index: 10000
69
+ }
70
+
71
+ div.pp_woocommerce a.yith_expand {
72
+ /*background: url("../icons/lightbox.svg") no-repeat center center;*/
73
+ display: inline;
74
+ cursor: pointer;
75
+ font-size: 25px;
76
+ position: absolute;
77
+ text-decoration: none;
78
+ text-indent: -10000px;
79
+ z-index: 20000;
80
+ height: 25px;
81
+ width: 25px;
82
+ line-height: 1em;
83
+ }
84
+
85
+ .expand-button-hidden svg{
86
+ display: block;
87
+ padding: 2px;
88
+ }
89
+
90
+ .zoom-button-hidden svg{
91
+ display: block;
92
+ padding: 5px;
93
+ }
94
+
95
+ .expand-button-hidden svg {
96
+ display: block;
97
+ padding: 5px;
98
+ }
99
+
100
+
101
+ .elementor-widget-wrap .yith_magnifier_zoom.woocommerce-main-image img{
102
+ width: 100%;
103
+ }
assets/css/yith_magnifier.css CHANGED
@@ -1,70 +1,85 @@
1
- .yith_magnifier_zoom_wrap {
2
- top: 0;
3
- position: relative;
4
- }
5
-
6
- .yith_magnifier_loading {
7
- color:white;
8
- background:#222;
9
- padding:3px;
10
- border:1px solid #000;
11
- position: absolute;
12
- text-align: center;
13
- top: 10%;
14
- z-index: 9999;
15
- }
16
-
17
- .yith_magnifier_zoom {
18
- position: relative;
19
- display: block;
20
- }
21
-
22
- .yith_magnifier_zoom img {
23
- display: block;
24
- }
25
-
26
- .yith_magnifier_mousetrap {
27
- z-index: 999;
28
- position: absolute;
29
- width: 0px;
30
- height :0px;
31
- left: 0;
32
- top: 0;
33
- }
34
-
35
- /* ie fix */
36
- .ie .yith_magnifier_mousetrap {
37
- background-image: url(".");
38
- }
39
-
40
- .yith_magnifier_lens {
41
- display: none;
42
- z-index:98;
43
- position:absolute;
44
- overflow: hidden;
45
-
46
- border: 1px solid #ccc;
47
- }
48
-
49
- .yith_magnifier_lens img {
50
- width: auto !important;
51
- max-width: none !important;
52
-
53
- -webkit-transition: all ease-in-out 0s !important;
54
- -moz-transition: all ease-in-out 0s !important;
55
- -o-transition: all ease-in-out 0s !important;
56
- transition: all ease-in-out 0s !important;
57
- }
58
-
59
- .yith_magnifier_zoom_magnifier {
60
- display:none;
61
- position:absolute;
62
- z-index: 99;
63
-
64
- border:4px solid #ccc;
65
- overflow:hidden;
66
- }
67
-
68
- .yith_magnifier_gallery {
69
- list-style: none;
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .yith_magnifier_zoom_wrap {
2
+ top: 0;
3
+ position: relative;
4
+ }
5
+
6
+ .yith_magnifier_loading {
7
+ color:white;
8
+ background:#222;
9
+ padding:3px;
10
+ border:1px solid #000;
11
+ position: absolute;
12
+ text-align: center;
13
+ top: 10%;
14
+ z-index: 9999;
15
+ }
16
+
17
+ .yith_magnifier_zoom {
18
+ position: relative;
19
+ display: block;
20
+ }
21
+
22
+ .yith_magnifier_zoom img {
23
+ display: block;
24
+ }
25
+
26
+ .yith_magnifier_mousetrap {
27
+ z-index: 999;
28
+ position: absolute;
29
+ width: 0px;
30
+ height :0px;
31
+ left: 0;
32
+ top: 0;
33
+ }
34
+
35
+ /* ie fix */
36
+ .ie .yith_magnifier_mousetrap {
37
+ background-image: url(".");
38
+ }
39
+
40
+ .yith_magnifier_lens {
41
+ display: none;
42
+ z-index:98;
43
+ position:absolute;
44
+ overflow: hidden;
45
+
46
+ border: 1px solid #ccc;
47
+ }
48
+
49
+ .yith_magnifier_lens img {
50
+ width: auto !important;
51
+ max-width: none !important;
52
+
53
+ -webkit-transition: all ease-in-out 0s !important;
54
+ -moz-transition: all ease-in-out 0s !important;
55
+ -o-transition: all ease-in-out 0s !important;
56
+ transition: all ease-in-out 0s !important;
57
+ }
58
+
59
+ .yith_magnifier_zoom_magnifier {
60
+ display:none;
61
+ position:absolute;
62
+ z-index: 99;
63
+
64
+ border:4px solid #ccc;
65
+ overflow:hidden;
66
+ }
67
+
68
+ .yith_magnifier_gallery {
69
+ list-style: none;
70
+ }
71
+
72
+
73
+ /* ul.yith_magnifier_gallery li {
74
+ margin-right: 10px;
75
+ text-align: center;
76
+ overflow: hidden;
77
+ }
78
+
79
+ ul.yith_magnifier_gallery li:last-child {
80
+ margin-right: 0px;
81
+ } */
82
+
83
+ .yith_magnifier_thumbnail {
84
+ margin-right: 1px;
85
+ }
assets/icons/lightbox.svg ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="19px" height="19px" viewBox="0 0 19 19" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>arrow / expand</title>
4
+ <defs>
5
+ <rect id="path-1" x="0" y="0" width="30" height="30"></rect>
6
+ </defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="Product-page---example-1" transform="translate(-940.000000, -1014.000000)">
9
+ <g id="arrow-/-expand" transform="translate(934.500000, 1008.500000)">
10
+ <mask id="mask-2" fill="white">
11
+ <use xlink:href="#path-1"></use>
12
+ </mask>
13
+ <g id="arrow-/-expand-(Background/Mask)"></g>
14
+ <path d="M21.25,8.75 L15,8.75 L15,6.25 L23.75,6.25 L23.740468,15.0000006 L21.25,15.0000006 L21.25,8.75 Z M8.75,21.25 L15,21.25 L15,23.75 L6.25,23.75 L6.25953334,14.9999988 L8.75,14.9999988 L8.75,21.25 Z" fill="#000000" mask="url(#mask-2)"></path>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </svg>
assets/icons/zoom.svg ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="22px" height="22px" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>edit / search</title>
4
+ <defs>
5
+ <rect id="path-1" x="0" y="0" width="30" height="30"></rect>
6
+ </defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="Product-page---example-1" transform="translate(-990.000000, -1013.000000)">
9
+ <g id="edit-/-search" transform="translate(986.000000, 1010.000000)">
10
+ <mask id="mask-2" fill="white">
11
+ <use xlink:href="#path-1"></use>
12
+ </mask>
13
+ <g id="edit-/-search-(Background/Mask)"></g>
14
+ <path d="M17.9704714,15.5960917 C20.0578816,12.6670864 19.7876957,8.57448101 17.1599138,5.94669908 C14.2309815,3.01776677 9.4822444,3.01776707 6.55331239,5.94669908 C3.62438008,8.87563139 3.62438008,13.6243683 6.55331239,16.5533006 C9.18109432,19.1810825 13.2736993,19.4512688 16.2027049,17.3638582 L23.3470976,24.5082521 L25.1148653,22.7404845 L17.9704714,15.5960917 C19.3620782,13.6434215 19.3620782,13.6434215 17.9704714,15.5960917 Z M15.3921473,7.71446586 C17.3447686,9.6670872 17.3447686,12.8329128 15.3921473,14.7855341 C13.4395258,16.7381556 10.273701,16.7381555 8.32107961,14.7855341 C6.36845812,12.8329127 6.36845812,9.66708735 8.32107961,7.71446586 C10.273701,5.76184452 13.4395258,5.76184437 15.3921473,7.71446586 C16.6938949,9.01621342 16.6938949,9.01621342 15.3921473,7.71446586 Z" fill="#000000" mask="url(#mask-2)"></path>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </svg>
assets/images/01-bg.png DELETED
Binary file
assets/images/01-icon.png DELETED
Binary file
assets/images/01.png DELETED
Binary file
assets/images/02-bg.png DELETED
Binary file
assets/images/02-icon.png DELETED
Binary file
assets/images/02.png DELETED
Binary file
assets/images/03-bg.png DELETED
Binary file
assets/images/03-icon.png DELETED
Binary file
assets/images/03.png DELETED
Binary file
assets/images/slider-arrow.png DELETED
Binary file
assets/images/upgrade.png DELETED
Binary file
assets/images/yith-woocommerce-zoom-magnifier-video.jpg DELETED
Binary file
assets/js/init.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(y){function k(){var t=location.href;return hashtag=-1!==t.indexOf("#prettyPhoto")&&decodeURI(t.substring(t.indexOf("#prettyPhoto")+1,t.length)),hashtag=hashtag&&hashtag.replace(/<|>/g,""),hashtag}function b(t,e){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null==e?"":e[1]}y.prettyPhoto={version:"3.1.6"},y.fn.prettyPhoto=function(e){e=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:!1,opacity:.8,show_title:!0,allow_resize:!0,allow_expand:!0,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:!1,wmode:"opaque",autoplay:!0,modal:!1,deeplinking:!0,overlay_gallery:!0,overlay_gallery_max:30,keyboard_shortcuts:!0,changepicturecallback:function(){},callback:function(){},ie6_fallback:!0,markup:'<div class="pp_pic_holder"> \t\t\t\t\t\t<div class="ppt">&nbsp;</div> \t\t\t\t\t\t<div class="pp_top"> \t\t\t\t\t\t\t<div class="pp_left"></div> \t\t\t\t\t\t\t<div class="pp_middle"></div> \t\t\t\t\t\t\t<div class="pp_right"></div> \t\t\t\t\t\t</div> \t\t\t\t\t\t<div class="pp_content_container"> \t\t\t\t\t\t\t<div class="pp_left"> \t\t\t\t\t\t\t<div class="pp_right"> \t\t\t\t\t\t\t\t<div class="pp_content"> \t\t\t\t\t\t\t\t\t<div class="pp_loaderIcon"></div> \t\t\t\t\t\t\t\t\t<div class="pp_fade"> \t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_expand" title="Expand the image">\t\t\t\t\t\t\t\t\t\t<div class="expand-button-hidden">\t<svg width="19px" height="19px" viewBox="0 0 19 19" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\t\t<defs>\t\t\t<rect id="path-1" x="0" y="0" width="30" height="30"></rect>\t\t</defs>\t\t<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\t\t\t<g id="Product-page---example-1" transform="translate(-940.000000, -1014.000000)">\t\t\t\t<g id="arrow-/-expand" transform="translate(934.500000, 1008.500000)">\t\t\t\t\t<mask id="mask-2" fill="white">\t\t\t\t\t\t<use xlink:href="#path-1"></use>\t\t\t\t\t</mask>\t\t\t\t\t<g id="arrow-/-expand-(Background/Mask)"></g>\t\t\t\t\t<path d="M21.25,8.75 L15,8.75 L15,6.25 L23.75,6.25 L23.740468,15.0000006 L21.25,15.0000006 L21.25,8.75 Z M8.75,21.25 L15,21.25 L15,23.75 L6.25,23.75 L6.25953334,14.9999988 L8.75,14.9999988 L8.75,21.25 Z" fill="#000000" mask="url(#mask-2)"></path>\t\t\t\t</g>\t\t\t</g>\t\t</g>\t</svg>\t</div></a> \t\t\t\t\t\t\t\t\t\t<div class="pp_hoverContainer"> \t\t\t\t\t\t\t\t\t\t\t<a class="pp_next" href="#">next</a> \t\t\t\t\t\t\t\t\t\t\t<a class="pp_previous" href="#">previous</a> \t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t\t<div id="pp_full_res"></div> \t\t\t\t\t\t\t\t\t\t<div class="pp_details"> \t\t\t\t\t\t\t\t\t\t\t<div class="pp_nav"> \t\t\t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_previous">Previous</a> \t\t\t\t\t\t\t\t\t\t\t\t<p class="currentTextHolder">0/0</p> \t\t\t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_next">Next</a> \t\t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t\t\t<p class="pp_description"></p> \t\t\t\t\t\t\t\t\t\t\t<div class="pp_social">{pp_social}</div> \t\t\t\t\t\t\t\t\t\t\t<a class="pp_close" href="#">Close</a> \t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</div> \t\t\t\t\t\t<div class="pp_bottom"> \t\t\t\t\t\t\t<div class="pp_left"></div> \t\t\t\t\t\t\t<div class="pp_middle"></div> \t\t\t\t\t\t\t<div class="pp_right"></div> \t\t\t\t\t\t</div> \t\t\t\t\t</div> \t\t\t\t\t<div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> \t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_previous">Previous</a> \t\t\t\t\t\t\t\t<div> \t\t\t\t\t\t\t\t\t<ul> \t\t\t\t\t\t\t\t\t\t{gallery} \t\t\t\t\t\t\t\t\t</ul> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_next">Next</a> \t\t\t\t\t\t\t</div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="https://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="https://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:"",social_tools:'<div class="twitter"><a href="//twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"><\/script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'},e);var i,t,o,p,a,s,n,l=this,r=!1,d=y(window).height(),h=y(window).width();function c(){y(".pp_loaderIcon").hide(),projectedTop=scroll_pos.scrollTop+(d/2-i.containerHeight/2),projectedTop<0&&(projectedTop=0),$ppt.fadeTo(settings.animation_speed,1),$pp_pic_holder.find(".pp_content").animate({height:i.contentHeight,width:i.contentWidth},settings.animation_speed),$pp_pic_holder.animate({top:projectedTop,left:h/2-i.containerWidth/2<0?0:h/2-i.containerWidth/2,width:i.containerWidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(i.height).width(i.width),$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed),isSet&&"image"==f(pp_images[set_position])?$pp_pic_holder.find(".pp_hoverContainer").show():$pp_pic_holder.find(".pp_hoverContainer").hide(),settings.allow_expand&&(i.resized?y("a.pp_expand,a.pp_contract").show():y("a.pp_expand").hide()),!settings.autoplay_slideshow||n||t||y.prettyPhoto.startSlideshow(),settings.changepicturecallback(),t=!0}),isSet&&settings.overlay_gallery&&"image"==f(pp_images[set_position])?(itemWidth=57,navWidth="facebook"==settings.theme||"pp_default"==settings.theme?50:30,itemsPerPage=Math.floor((i.containerWidth-100-navWidth)/itemWidth),itemsPerPage=itemsPerPage<pp_images.length?itemsPerPage:pp_images.length,totalPage=Math.ceil(pp_images.length/itemsPerPage)-1,0==totalPage?(navWidth=0,$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide()):$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show(),galleryWidth=itemsPerPage*itemWidth,fullGalleryWidth=pp_images.length*itemWidth,$pp_gallery.css("margin-left",-(galleryWidth/2+navWidth/2)).find("div:first").width(galleryWidth+5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected"),goToPage=Math.floor(set_position/itemsPerPage)<totalPage?Math.floor(set_position/itemsPerPage):totalPage,y.prettyPhoto.changeGalleryPage(goToPage),$pp_gallery_li.filter(":eq("+set_position+")").addClass("selected")):$pp_pic_holder.find(".pp_content").off("mouseenter mouseleave"),e.ajaxcallback()}function _(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden"),$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){y(".pp_loaderIcon").show(),t()})}function g(t,e){if(resized=!1,m(t,e),imageWidth=t,imageHeight=e,(h<s||d<a)&&doresize&&settings.allow_resize&&!r){for(resized=!0,fitting=!1;!fitting;)h<s?(imageWidth=h-200,imageHeight=e/t*imageWidth):d<a?(imageHeight=d-200,imageWidth=t/e*imageHeight):fitting=!0,a=imageHeight,s=imageWidth;(h<s||d<a)&&g(s,a),m(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(a),containerWidth:Math.floor(s)+2*settings.horizontal_padding,contentHeight:Math.floor(o),contentWidth:Math.floor(p),resized:resized}}function m(t,e){t=parseFloat(t),e=parseFloat(e),$pp_details=$pp_pic_holder.find(".pp_details"),$pp_details.width(t),detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom")),$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(y("body")).css({position:"absolute",top:-1e4}),detailsHeight+=$pp_details.height(),detailsHeight=detailsHeight<=34?36:detailsHeight,$pp_details.remove(),$pp_title=$pp_pic_holder.find(".ppt"),$pp_title.width(t),titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom")),$pp_title=$pp_title.clone().appendTo(y("body")).css({position:"absolute",top:-1e4}),titleHeight+=$pp_title.height(),$pp_title.remove(),o=e+detailsHeight,p=t,a=o+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height(),s=t}function f(t){return t.match(/youtube\.com\/watch/i)||t.match(/youtu\.be/i)?"youtube":t.match(/vimeo\.com/i)?"vimeo":t.match(/\b.mov\b/i)?"quicktime":t.match(/\b.swf\b/i)?"flash":t.match(/\biframe=true\b/i)?"iframe":t.match(/\bajax=true\b/i)?"ajax":t.match(/\bcustom=true\b/i)?"custom":"#"==t.substr(0,1)?"inline":"image"}function u(){if(doresize&&"undefined"!=typeof $pp_pic_holder){if(scroll_pos=v(),contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width(),projectedTop=d/2+scroll_pos.scrollTop-contentHeight/2,projectedTop<0&&(projectedTop=0),contentHeight>d)return;$pp_pic_holder.css({top:projectedTop,left:h/2+scroll_pos.scrollLeft-contentwidth/2})}}function v(){return self.pageYOffset?{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}:document.documentElement&&document.documentElement.scrollTop?{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}:document.body?{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}:void 0}function w(){if(settings.social_tools&&(facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href))),settings.markup=settings.markup.replace("{pp_social}",""),y("body").append(settings.markup),$pp_pic_holder=y(".pp_pic_holder"),$ppt=y(".ppt"),$pp_overlay=y("div.pp_overlay"),isSet&&settings.overlay_gallery){currentGalleryPage=0,toInject="";for(var t=0;t<pp_images.length;t++)img_src=pp_images[t].match(/\b(jpg|jpeg|png|gif)\b/gi)?(classname="",pp_images[t]):(classname="default",""),toInject+="<li class='"+classname+"'><a href='#'><img src='"+img_src+"' width='50' alt='' /></a></li>";toInject=settings.gallery_markup.replace(/{gallery}/g,toInject),$pp_pic_holder.find("#pp_full_res").after(toInject),$pp_gallery=y(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li"),$pp_gallery.find(".pp_arrow_next").on("click",function(){return y.prettyPhoto.changeGalleryPage("next"),y.prettyPhoto.stopSlideshow(),!1}),$pp_gallery.find(".pp_arrow_previous").on("click",function(){return y.prettyPhoto.changeGalleryPage("previous"),y.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_content").on("mouseenter",function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()}).on("mouseleave",function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()}),itemWidth=57,$pp_gallery_li.each(function(t){y(this).find("a").on("click",function(){return y.prettyPhoto.changePage(t),y.prettyPhoto.stopSlideshow(),!1})})}settings.slideshow&&($pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>'),$pp_pic_holder.find(".pp_nav .pp_play").on("click",function(){return y.prettyPhoto.startSlideshow(),!1})),$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme),$pp_overlay.css({opacity:0,height:y(document).height(),width:y(window).width()}).on("click",function(){settings.modal||y.prettyPhoto.close()}),y("a.pp_close").on("click",function(){return y.prettyPhoto.close(),!1}),settings.allow_expand&&y("a.pp_expand").on("click",function(t){return doresize=y(this).hasClass("pp_expand")?(y(this).removeClass("pp_expand").addClass("pp_contract"),!1):(y(this).removeClass("pp_contract").addClass("pp_expand"),!0),_(function(){y.prettyPhoto.open()}),!1}),$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").on("click",function(){return y.prettyPhoto.changePage("previous"),y.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").on("click",function(){return y.prettyPhoto.changePage("next"),y.prettyPhoto.stopSlideshow(),!1}),u()}return doresize=!0,scroll_pos=v(),y(window).off("resize.prettyphoto").on("resize.prettyphoto",function(){u(),d=y(window).height(),h=y(window).width(),"undefined"!=typeof $pp_overlay&&$pp_overlay.height(y(document).height()).width(h)}),e.keyboard_shortcuts&&y(document).off("keydown.prettyphoto").on("keydown.prettyphoto",function(t){if("undefined"!=typeof $pp_pic_holder&&$pp_pic_holder.is(":visible"))switch(t.keyCode){case 37:y.prettyPhoto.changePage("previous"),t.preventDefault();break;case 39:y.prettyPhoto.changePage("next"),t.preventDefault();break;case 27:settings.modal||y.prettyPhoto.close(),t.preventDefault()}}),y.prettyPhoto.initialize=function(){return settings=e,"pp_default"==settings.theme&&(settings.horizontal_padding=16),theRel=y(this).attr(settings.hook),galleryRegExp=/\[(?:.*)\]/,isSet=!!galleryRegExp.exec(theRel),pp_images=isSet?jQuery.map(l,function(t,e){if(-1!=y(t).attr(settings.hook).indexOf(theRel))return y(t).attr("href")}):y.makeArray(y(this).attr("href")),pp_titles=isSet?jQuery.map(l,function(t,e){if(-1!=y(t).attr(settings.hook).indexOf(theRel))return y(t).find("img").attr("alt")?y(t).find("img").attr("alt"):""}):y.makeArray(y(this).find("img").attr("alt")),pp_descriptions=isSet?jQuery.map(l,function(t,e){if(-1!=y(t).attr(settings.hook).indexOf(theRel))return y(t).attr("title")?y(t).attr("title"):""}):y.makeArray(y(this).attr("title")),pp_images.length>settings.overlay_gallery_max&&(settings.overlay_gallery=!1),set_position=jQuery.inArray(y(this).attr("href"),pp_images),rel_index=isSet?set_position:y("a["+settings.hook+"^='"+theRel+"']").index(y(this)),w(),settings.allow_resize&&y(window).on("scroll.prettyphoto",function(){u()}),y.prettyPhoto.open(),!1},y.prettyPhoto.open=function(t){return"undefined"==typeof settings&&(settings=e,pp_images=y.makeArray(t),pp_titles=arguments[1]?y.makeArray(arguments[1]):y.makeArray(""),pp_descriptions=arguments[2]?y.makeArray(arguments[2]):y.makeArray(""),isSet=1<pp_images.length,set_position=arguments[3]||0,w(t.target)),settings.hideflash&&y("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden"),1<y(pp_images).length?y(".pp_nav").show():y(".pp_nav").hide(),y(".pp_loaderIcon").show(),settings.deeplinking&&"undefined"!=typeof theRel&&(location.hash=theRel+"/"+rel_index+"/"),settings.social_tools&&(facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href)),$pp_pic_holder.find(".pp_social").html(facebook_like_link)),$ppt.is(":hidden")&&$ppt.css("opacity",0).show(),$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity),$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+y(pp_images).length),"undefined"!=typeof pp_descriptions[set_position]&&""!=pp_descriptions[set_position]?$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position])):$pp_pic_holder.find(".pp_description").hide(),movie_width=parseFloat(b("width",pp_images[set_position]))?b("width",pp_images[set_position]):settings.default_width.toString(),movie_height=parseFloat(b("height",pp_images[set_position]))?b("height",pp_images[set_position]):settings.default_height.toString(),r=!1,-1!=movie_height.indexOf("%")&&(movie_height=parseFloat(y(window).height()*parseFloat(movie_height)/100-150),r=!0),-1!=movie_width.indexOf("%")&&(movie_width=parseFloat(y(window).width()*parseFloat(movie_width)/100-150),r=!0),$pp_pic_holder.fadeIn(function(){switch(settings.show_title&&""!=pp_titles[set_position]&&"undefined"!=typeof pp_titles[set_position]?$ppt.html(unescape(pp_titles[set_position])):$ppt.html("&nbsp;"),imgPreloader="",skipInjection=!1,f(pp_images[set_position])){case"image":imgPreloader=new Image,nextImage=new Image,isSet&&set_position<y(pp_images).length-1&&(nextImage.src=pp_images[set_position+1]),prevImage=new Image,isSet&&pp_images[set_position-1]&&(prevImage.src=pp_images[set_position-1]),$pp_pic_holder.find("#pp_full_res")[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]),imgPreloader.onload=function(){i=g(imgPreloader.width,imgPreloader.height),c()},imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist."),y.prettyPhoto.close()},imgPreloader.src=pp_images[set_position];break;case"youtube":i=g(movie_width,movie_height),movie_id=b("v",pp_images[set_position]),""==movie_id&&(movie_id=pp_images[set_position].split("youtu.be/"),movie_id=movie_id[1],0<movie_id.indexOf("?")&&(movie_id=movie_id.substr(0,movie_id.indexOf("?"))),0<movie_id.indexOf("&")&&(movie_id=movie_id.substr(0,movie_id.indexOf("&")))),movie="//www.youtube.com/embed/"+movie_id,b("rel",pp_images[set_position])?movie+="?rel="+b("rel",pp_images[set_position]):movie+="?rel=1",settings.autoplay&&(movie+="&autoplay=1"),toInject=settings.iframe_markup.replace(/{width}/g,i.width).replace(/{height}/g,i.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":i=g(movie_width,movie_height),movie_id=pp_images[set_position];var t=movie_id.match(/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/);movie="//player.vimeo.com/video/"+t[3]+"?title=0&amp;byline=0&amp;portrait=0",settings.autoplay&&(movie+="&autoplay=1;"),vimeo_width=i.width+"/embed/?moog_width="+i.width,toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,i.height).replace(/{path}/g,movie);break;case"quicktime":(i=g(movie_width,movie_height)).height+=15,i.contentHeight+=15,i.containerHeight+=15,toInject=settings.quicktime_markup.replace(/{width}/g,i.width).replace(/{height}/g,i.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":i=g(movie_width,movie_height),flash_vars=pp_images[set_position],flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length),filename=pp_images[set_position],filename=filename.substring(0,filename.indexOf("?")),toInject=settings.flash_markup.replace(/{width}/g,i.width).replace(/{height}/g,i.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":i=g(movie_width,movie_height),frame_url=pp_images[set_position],frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1),toInject=settings.iframe_markup.replace(/{width}/g,i.width).replace(/{height}/g,i.height).replace(/{path}/g,frame_url);break;case"ajax":doresize=!1,i=g(movie_width,movie_height),doresize=!0,skipInjection=!0,y.get(pp_images[set_position],function(t){toInject=settings.inline_markup.replace(/{content}/g,t),$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,c()});break;case"custom":i=g(movie_width,movie_height),toInject=settings.custom_markup;break;case"inline":myClone=y(pp_images[set_position]).clone().append('<br clear="all" />').css({width:settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo(y("body")).show(),doresize=!1,i=g(y(myClone).width(),y(myClone).height()),doresize=!0,y(myClone).remove(),toInject=settings.inline_markup.replace(/{content}/g,y(pp_images[set_position]).html())}imgPreloader||skipInjection||($pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,c())}),!1},y.prettyPhoto.changePage=function(t){currentGalleryPage=0,"previous"==t?(set_position--,set_position<0&&(set_position=y(pp_images).length-1)):"next"==t?(set_position++,set_position>y(pp_images).length-1&&(set_position=0)):set_position=t,rel_index=set_position,doresize=doresize||!0,settings.allow_expand&&y(".pp_contract").removeClass("pp_contract").addClass("pp_expand"),_(function(){y.prettyPhoto.open()})},y.prettyPhoto.changeGalleryPage=function(t){"next"==t?(currentGalleryPage++,currentGalleryPage>totalPage&&(currentGalleryPage=0)):"previous"==t?(currentGalleryPage--,currentGalleryPage<0&&(currentGalleryPage=totalPage)):currentGalleryPage=t,slide_speed="next"==t||"previous"==t?settings.animation_speed:0,slide_to=currentGalleryPage*(itemsPerPage*itemWidth),$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)},y.prettyPhoto.startSlideshow=function(){void 0===n?($pp_pic_holder.find(".pp_play").off("click").removeClass("pp_play").addClass("pp_pause").on("click",function(){return y.prettyPhoto.stopSlideshow(),!1}),n=setInterval(y.prettyPhoto.startSlideshow,settings.slideshow)):y.prettyPhoto.changePage("next")},y.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").off("click").removeClass("pp_pause").addClass("pp_play").on("click",function(){return y.prettyPhoto.startSlideshow(),!1}),clearInterval(n),n=undefined},y.prettyPhoto.close=function(){$pp_overlay.is(":animated")||(y.prettyPhoto.stopSlideshow(),$pp_pic_holder.stop().find("object,embed").css("visibility","hidden"),y("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){y(this).remove()}),$pp_overlay.fadeOut(settings.animation_speed,function(){settings.hideflash&&y("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible"),y(this).remove(),y(window).off("scroll.prettyphoto"),-1!==location.href.indexOf("#prettyPhoto")&&(location.hash="prettyPhoto"),settings.callback(),doresize=!0,t=!1,delete settings}))},!pp_alreadyInitialized&&k()&&(pp_alreadyInitialized=!0,hashIndex=k(),hashRel=hashIndex,hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1),hashRel=hashRel.substring(0,hashRel.indexOf("/")),setTimeout(function(){y("a["+e.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)),this.off("click.prettyphoto").on("click.prettyphoto",y.prettyPhoto.initialize)}}(jQuery);var pp_alreadyInitialized=!1;
assets/js/init.prettyPhoto.js ADDED
@@ -0,0 +1,935 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* ------------------------------------------------------------------------
2
+ Class: prettyPhoto
3
+ Use: Lightbox clone for jQuery
4
+ Author: Stephane Caron (http://www.no-margin-for-errors.com)
5
+ Version: 3.1.6
6
+ ------------------------------------------------------------------------- */
7
+ (function($) {
8
+ $.prettyPhoto = {version: '3.1.6'};
9
+
10
+ $.fn.prettyPhoto = function(pp_settings) {
11
+ pp_settings = jQuery.extend({
12
+ hook: 'rel', /* the attribute tag to use for prettyPhoto hooks. default: 'rel'. For HTML5, use "data-rel" or similar. */
13
+ animation_speed: 'fast', /* fast/slow/normal */
14
+ ajaxcallback: function() {},
15
+ slideshow: 5000, /* false OR interval time in ms */
16
+ autoplay_slideshow: false, /* true/false */
17
+ opacity: 0.80, /* Value between 0 and 1 */
18
+ show_title: true, /* true/false */
19
+ allow_resize: true, /* Resize the photos bigger than viewport. true/false */
20
+ allow_expand: true, /* Allow the user to expand a resized image. true/false */
21
+ default_width: 500,
22
+ default_height: 344,
23
+ counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
24
+ theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
25
+ horizontal_padding: 20, /* The padding on each side of the picture */
26
+ hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
27
+ wmode: 'opaque', /* Set the flash wmode attribute */
28
+ autoplay: true, /* Automatically start videos: True/False */
29
+ modal: false, /* If set to true, only the close button will close the window */
30
+ deeplinking: true, /* Allow prettyPhoto to update the url to enable deeplinking. */
31
+ overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
32
+ overlay_gallery_max: 30, /* Maximum number of pictures in the overlay gallery */
33
+ keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
34
+ changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
35
+ callback: function(){}, /* Called when prettyPhoto is closed */
36
+ ie6_fallback: true,
37
+ markup: '<div class="pp_pic_holder"> \
38
+ <div class="ppt">&nbsp;</div> \
39
+ <div class="pp_top"> \
40
+ <div class="pp_left"></div> \
41
+ <div class="pp_middle"></div> \
42
+ <div class="pp_right"></div> \
43
+ </div> \
44
+ <div class="pp_content_container"> \
45
+ <div class="pp_left"> \
46
+ <div class="pp_right"> \
47
+ <div class="pp_content"> \
48
+ <div class="pp_loaderIcon"></div> \
49
+ <div class="pp_fade"> \
50
+ <a href="#" class="pp_expand" title="Expand the image">\
51
+ <div class="expand-button-hidden">\
52
+ \t<svg width="19px" height="19px" viewBox="0 0 19 19" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\
53
+ \t\t<defs>\
54
+ \t\t\t<rect id="path-1" x="0" y="0" width="30" height="30"></rect>\
55
+ \t\t</defs>\
56
+ \t\t<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\
57
+ \t\t\t<g id="Product-page---example-1" transform="translate(-940.000000, -1014.000000)">\
58
+ \t\t\t\t<g id="arrow-/-expand" transform="translate(934.500000, 1008.500000)">\
59
+ \t\t\t\t\t<mask id="mask-2" fill="white">\
60
+ \t\t\t\t\t\t<use xlink:href="#path-1"></use>\
61
+ \t\t\t\t\t</mask>\
62
+ \t\t\t\t\t<g id="arrow-/-expand-(Background/Mask)"></g>\
63
+ \t\t\t\t\t<path d="M21.25,8.75 L15,8.75 L15,6.25 L23.75,6.25 L23.740468,15.0000006 L21.25,15.0000006 L21.25,8.75 Z M8.75,21.25 L15,21.25 L15,23.75 L6.25,23.75 L6.25953334,14.9999988 L8.75,14.9999988 L8.75,21.25 Z" fill="#000000" mask="url(#mask-2)"></path>\
64
+ \t\t\t\t</g>\
65
+ \t\t\t</g>\
66
+ \t\t</g>\
67
+ \t</svg>\
68
+ \t</div></a> \
69
+ <div class="pp_hoverContainer"> \
70
+ <a class="pp_next" href="#">next</a> \
71
+ <a class="pp_previous" href="#">previous</a> \
72
+ </div> \
73
+ <div id="pp_full_res"></div> \
74
+ <div class="pp_details"> \
75
+ <div class="pp_nav"> \
76
+ <a href="#" class="pp_arrow_previous">Previous</a> \
77
+ <p class="currentTextHolder">0/0</p> \
78
+ <a href="#" class="pp_arrow_next">Next</a> \
79
+ </div> \
80
+ <p class="pp_description"></p> \
81
+ <div class="pp_social">{pp_social}</div> \
82
+ <a class="pp_close" href="#">Close</a> \
83
+ </div> \
84
+ </div> \
85
+ </div> \
86
+ </div> \
87
+ </div> \
88
+ </div> \
89
+ <div class="pp_bottom"> \
90
+ <div class="pp_left"></div> \
91
+ <div class="pp_middle"></div> \
92
+ <div class="pp_right"></div> \
93
+ </div> \
94
+ </div> \
95
+ <div class="pp_overlay"></div>',
96
+ gallery_markup: '<div class="pp_gallery"> \
97
+ <a href="#" class="pp_arrow_previous">Previous</a> \
98
+ <div> \
99
+ <ul> \
100
+ {gallery} \
101
+ </ul> \
102
+ </div> \
103
+ <a href="#" class="pp_arrow_next">Next</a> \
104
+ </div>',
105
+ image_markup: '<img id="fullResImage" src="{path}" />',
106
+ flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
107
+ quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="https://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="https://www.apple.com/quicktime/download/"></embed></object>',
108
+ iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
109
+ inline_markup: '<div class="pp_inline">{content}</div>',
110
+ custom_markup: '',
111
+ social_tools: '<div class="twitter"><a href="//twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>' /* html or false to disable */
112
+ }, pp_settings);
113
+
114
+ // Global variables accessible only by prettyPhoto
115
+ var matchedObjects = this, percentBased = false, pp_dimensions, pp_open,
116
+
117
+ // prettyPhoto container specific
118
+ pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth,
119
+
120
+ // Window size
121
+ windowHeight = $(window).height(), windowWidth = $(window).width(),
122
+
123
+ // Global elements
124
+ pp_slideshow;
125
+
126
+ doresize = true, scroll_pos = _get_scroll();
127
+
128
+ // Window/Keyboard events
129
+ $(window).off('resize.prettyphoto').on('resize.prettyphoto',function(){ _center_overlay(); _resize_overlay(); });
130
+
131
+
132
+ if(pp_settings.keyboard_shortcuts) {
133
+ $(document).off('keydown.prettyphoto').on('keydown.prettyphoto',function(e){
134
+ if(typeof $pp_pic_holder != 'undefined'){
135
+ if($pp_pic_holder.is(':visible')){
136
+ switch(e.keyCode){
137
+ case 37:
138
+ $.prettyPhoto.changePage('previous');
139
+ e.preventDefault();
140
+ break;
141
+ case 39:
142
+ $.prettyPhoto.changePage('next');
143
+ e.preventDefault();
144
+ break;
145
+ case 27:
146
+ if(!settings.modal)
147
+ $.prettyPhoto.close();
148
+ e.preventDefault();
149
+ break;
150
+ };
151
+ // return false;
152
+ };
153
+ };
154
+ });
155
+ };
156
+
157
+ /**
158
+ * Initialize prettyPhoto.
159
+ */
160
+ $.prettyPhoto.initialize = function() {
161
+
162
+ settings = pp_settings;
163
+
164
+ if(settings.theme == 'pp_default') settings.horizontal_padding = 16;
165
+
166
+ // Find out if the picture is part of a set
167
+ theRel = $(this).attr(settings.hook);
168
+ galleryRegExp = /\[(?:.*)\]/;
169
+ isSet = (galleryRegExp.exec(theRel)) ? true : false;
170
+
171
+ // Put the SRCs, TITLEs, ALTs into an array.
172
+ pp_images = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return $(n).attr('href'); }) : $.makeArray($(this).attr('href'));
173
+ pp_titles = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt') : ""; }) : $.makeArray($(this).find('img').attr('alt'));
174
+ pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return ($(n).attr('title')) ? $(n).attr('title') : ""; }) : $.makeArray($(this).attr('title'));
175
+
176
+ if(pp_images.length > settings.overlay_gallery_max) settings.overlay_gallery = false;
177
+
178
+ set_position = jQuery.inArray($(this).attr('href'), pp_images); // Define where in the array the clicked item is positionned
179
+ rel_index = (isSet) ? set_position : $("a["+settings.hook+"^='"+theRel+"']").index($(this));
180
+
181
+ _build_overlay(this); // Build the overlay {this} being the caller
182
+
183
+ if(settings.allow_resize)
184
+ $(window).on('scroll.prettyphoto',function(){ _center_overlay(); });
185
+
186
+
187
+ $.prettyPhoto.open();
188
+
189
+
190
+ return false;
191
+ }
192
+
193
+
194
+ /**
195
+ * Opens the prettyPhoto modal box.
196
+ * @param image {String,Array} Full path to the image to be open, can also be an array containing full images paths.
197
+ * @param title {String,Array} The title to be displayed with the picture, can also be an array containing all the titles.
198
+ * @param description {String,Array} The description to be displayed with the picture, can also be an array containing all the descriptions.
199
+ */
200
+ $.prettyPhoto.open = function(event) {
201
+ if(typeof settings == "undefined"){ // Means it's an API call, need to manually get the settings and set the variables
202
+ settings = pp_settings;
203
+ pp_images = $.makeArray(arguments[0]);
204
+ pp_titles = (arguments[1]) ? $.makeArray(arguments[1]) : $.makeArray("");
205
+ pp_descriptions = (arguments[2]) ? $.makeArray(arguments[2]) : $.makeArray("");
206
+ isSet = (pp_images.length > 1) ? true : false;
207
+ set_position = (arguments[3])? arguments[3]: 0;
208
+ _build_overlay(event.target); // Build the overlay {this} being the caller
209
+ }
210
+
211
+ if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden'); // Hide the flash
212
+
213
+ _checkPosition($(pp_images).length); // Hide the next/previous links if on first or last images.
214
+
215
+ $('.pp_loaderIcon').show();
216
+
217
+ if(settings.deeplinking)
218
+ setHashtag();
219
+
220
+ // Rebuild Facebook Like Button with updated href
221
+ if(settings.social_tools){
222
+ facebook_like_link = settings.social_tools.replace('{location_href}', encodeURIComponent(location.href));
223
+ $pp_pic_holder.find('.pp_social').html(facebook_like_link);
224
+ }
225
+
226
+ // Fade the content in
227
+ if($ppt.is(':hidden')) $ppt.css('opacity',0).show();
228
+ $pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);
229
+
230
+ // Display the current position
231
+ $pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).length);
232
+
233
+ // Set the description
234
+ if(typeof pp_descriptions[set_position] != 'undefined' && pp_descriptions[set_position] != ""){
235
+ $pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));
236
+ }else{
237
+ $pp_pic_holder.find('.pp_description').hide();
238
+ }
239
+
240
+ // Get the dimensions
241
+ movie_width = ( parseFloat(getParam('width',pp_images[set_position])) ) ? getParam('width',pp_images[set_position]) : settings.default_width.toString();
242
+ movie_height = ( parseFloat(getParam('height',pp_images[set_position])) ) ? getParam('height',pp_images[set_position]) : settings.default_height.toString();
243
+
244
+ // If the size is % based, calculate according to window dimensions
245
+ percentBased=false;
246
+ if(movie_height.indexOf('%') != -1) { movie_height = parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150); percentBased = true; }
247
+ if(movie_width.indexOf('%') != -1) { movie_width = parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150); percentBased = true; }
248
+
249
+ // Fade the holder
250
+ $pp_pic_holder.fadeIn(function(){
251
+ // Set the title
252
+ (settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined") ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html('&nbsp;');
253
+
254
+ imgPreloader = "";
255
+ skipInjection = false;
256
+
257
+ // Inject the proper content
258
+ switch(_getFileType(pp_images[set_position])){
259
+ case 'image':
260
+ imgPreloader = new Image();
261
+
262
+ // Preload the neighbour images
263
+ nextImage = new Image();
264
+ if(isSet && set_position < $(pp_images).length -1) nextImage.src = pp_images[set_position + 1];
265
+ prevImage = new Image();
266
+ if(isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1];
267
+
268
+ $pp_pic_holder.find('#pp_full_res')[0].innerHTML = settings.image_markup.replace(/{path}/g,pp_images[set_position]);
269
+
270
+ imgPreloader.onload = function(){
271
+ // Fit item to viewport
272
+ pp_dimensions = _fitToViewport(imgPreloader.width,imgPreloader.height);
273
+
274
+ _showContent();
275
+ };
276
+
277
+ imgPreloader.onerror = function(){
278
+ alert('Image cannot be loaded. Make sure the path is correct and image exist.');
279
+ $.prettyPhoto.close();
280
+ };
281
+
282
+ imgPreloader.src = pp_images[set_position];
283
+ break;
284
+
285
+ case 'youtube':
286
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
287
+
288
+ // Regular youtube link
289
+ movie_id = getParam('v',pp_images[set_position]);
290
+
291
+ // youtu.be link
292
+ if(movie_id == ""){
293
+ movie_id = pp_images[set_position].split('youtu.be/');
294
+ movie_id = movie_id[1];
295
+ if(movie_id.indexOf('?') > 0)
296
+ movie_id = movie_id.substr(0,movie_id.indexOf('?')); // Strip anything after the ?
297
+
298
+ if(movie_id.indexOf('&') > 0)
299
+ movie_id = movie_id.substr(0,movie_id.indexOf('&')); // Strip anything after the &
300
+ }
301
+
302
+ movie = '//www.youtube.com/embed/'+movie_id;
303
+ (getParam('rel',pp_images[set_position])) ? movie+="?rel="+getParam('rel',pp_images[set_position]) : movie+="?rel=1";
304
+
305
+ if(settings.autoplay) movie += "&autoplay=1";
306
+
307
+ toInject = settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);
308
+ break;
309
+
310
+ case 'vimeo':
311
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
312
+
313
+ movie_id = pp_images[set_position];
314
+ var regExp = /http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;
315
+ var match = movie_id.match(regExp);
316
+
317
+ movie = '//player.vimeo.com/video/'+ match[3] +'?title=0&amp;byline=0&amp;portrait=0';
318
+ if(settings.autoplay) movie += "&autoplay=1;";
319
+
320
+ vimeo_width = pp_dimensions['width'] + '/embed/?moog_width='+ pp_dimensions['width'];
321
+
322
+ toInject = settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie);
323
+ break;
324
+
325
+ case 'quicktime':
326
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
327
+ pp_dimensions['height']+=15; pp_dimensions['contentHeight']+=15; pp_dimensions['containerHeight']+=15; // Add space for the control bar
328
+
329
+ toInject = settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);
330
+ break;
331
+
332
+ case 'flash':
333
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
334
+
335
+ flash_vars = pp_images[set_position];
336
+ flash_vars = flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10,pp_images[set_position].length);
337
+
338
+ filename = pp_images[set_position];
339
+ filename = filename.substring(0,filename.indexOf('?'));
340
+
341
+ toInject = settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);
342
+ break;
343
+
344
+ case 'iframe':
345
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
346
+
347
+ frame_url = pp_images[set_position];
348
+ frame_url = frame_url.substr(0,frame_url.indexOf('iframe')-1);
349
+
350
+ toInject = settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url);
351
+ break;
352
+
353
+ case 'ajax':
354
+ doresize = false; // Make sure the dimensions are not resized.
355
+ pp_dimensions = _fitToViewport(movie_width,movie_height);
356
+ doresize = true; // Reset the dimensions
357
+
358
+ skipInjection = true;
359
+ $.get(pp_images[set_position],function(responseHTML){
360
+ toInject = settings.inline_markup.replace(/{content}/g,responseHTML);
361
+ $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject;
362
+ _showContent();
363
+ });
364
+
365
+ break;
366
+
367
+ case 'custom':
368
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
369
+
370
+ toInject = settings.custom_markup;
371
+ break;
372
+
373
+ case 'inline':
374
+ // to get the item height clone it, apply default width, wrap it in the prettyPhoto containers , then delete
375
+ myClone = $(pp_images[set_position]).clone().append('<br clear="all" />').css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo($('body')).show();
376
+ doresize = false; // Make sure the dimensions are not resized.
377
+ pp_dimensions = _fitToViewport($(myClone).width(),$(myClone).height());
378
+ doresize = true; // Reset the dimensions
379
+ $(myClone).remove();
380
+ toInject = settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());
381
+ break;
382
+ };
383
+
384
+ if(!imgPreloader && !skipInjection){
385
+ $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject;
386
+
387
+ // Show content
388
+ _showContent();
389
+
390
+
391
+ };
392
+ });
393
+
394
+ return false;
395
+ };
396
+
397
+
398
+ /**
399
+ * Change page in the prettyPhoto modal box
400
+ * @param direction {String} Direction of the paging, previous or next.
401
+ */
402
+ $.prettyPhoto.changePage = function(direction){
403
+ currentGalleryPage = 0;
404
+
405
+ if(direction == 'previous') {
406
+ set_position--;
407
+ if (set_position < 0) set_position = $(pp_images).length-1;
408
+ }else if(direction == 'next'){
409
+ set_position++;
410
+ if(set_position > $(pp_images).length-1) set_position = 0;
411
+ }else{
412
+ set_position=direction;
413
+ };
414
+
415
+ rel_index = set_position;
416
+
417
+ if(!doresize) doresize = true; // Allow the resizing of the images
418
+ if(settings.allow_expand) {
419
+ $('.pp_contract').removeClass('pp_contract').addClass('pp_expand');
420
+ }
421
+
422
+ _hideContent(function(){ $.prettyPhoto.open(); });
423
+ };
424
+
425
+
426
+ /**
427
+ * Change gallery page in the prettyPhoto modal box
428
+ * @param direction {String} Direction of the paging, previous or next.
429
+ */
430
+ $.prettyPhoto.changeGalleryPage = function(direction){
431
+ if(direction=='next'){
432
+ currentGalleryPage ++;
433
+
434
+ if(currentGalleryPage > totalPage) currentGalleryPage = 0;
435
+ }else if(direction=='previous'){
436
+ currentGalleryPage --;
437
+
438
+ if(currentGalleryPage < 0) currentGalleryPage = totalPage;
439
+ }else{
440
+ currentGalleryPage = direction;
441
+ };
442
+
443
+ slide_speed = (direction == 'next' || direction == 'previous') ? settings.animation_speed : 0;
444
+
445
+ slide_to = currentGalleryPage * (itemsPerPage * itemWidth);
446
+
447
+ $pp_gallery.find('ul').animate({left:-slide_to},slide_speed);
448
+ };
449
+
450
+
451
+ /**
452
+ * Start the slideshow...
453
+ */
454
+ $.prettyPhoto.startSlideshow = function(){
455
+ if(typeof pp_slideshow == 'undefined'){
456
+ $pp_pic_holder.find('.pp_play').off('click').removeClass('pp_play').addClass('pp_pause').on( 'click', function(){
457
+ $.prettyPhoto.stopSlideshow();
458
+ return false;
459
+ });
460
+ pp_slideshow = setInterval($.prettyPhoto.startSlideshow,settings.slideshow);
461
+ }else{
462
+ $.prettyPhoto.changePage('next');
463
+ };
464
+ }
465
+
466
+
467
+ /**
468
+ * Stop the slideshow...
469
+ */
470
+ $.prettyPhoto.stopSlideshow = function(){
471
+ $pp_pic_holder.find('.pp_pause').off('click').removeClass('pp_pause').addClass('pp_play').on( 'click', function(){
472
+ $.prettyPhoto.startSlideshow();
473
+ return false;
474
+ });
475
+ clearInterval(pp_slideshow);
476
+ pp_slideshow=undefined;
477
+ }
478
+
479
+
480
+ /**
481
+ * Closes prettyPhoto.
482
+ */
483
+ $.prettyPhoto.close = function(){
484
+ if($pp_overlay.is(":animated")) return;
485
+
486
+ $.prettyPhoto.stopSlideshow();
487
+
488
+ $pp_pic_holder.stop().find('object,embed').css('visibility','hidden');
489
+
490
+ $('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){ $(this).remove(); });
491
+
492
+ $pp_overlay.fadeOut(settings.animation_speed, function(){
493
+
494
+ if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible'); // Show the flash
495
+
496
+ $(this).remove(); // No more need for the prettyPhoto markup
497
+
498
+ $(window).off('scroll.prettyphoto');
499
+
500
+ clearHashtag();
501
+
502
+ settings.callback();
503
+
504
+ doresize = true;
505
+
506
+ pp_open = false;
507
+
508
+ delete settings;
509
+ });
510
+ };
511
+
512
+ /**
513
+ * Set the proper sizes on the containers and animate the content in.
514
+ */
515
+ function _showContent(){
516
+ $('.pp_loaderIcon').hide();
517
+
518
+ // Calculate the opened top position of the pic holder
519
+ projectedTop = scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2));
520
+ if(projectedTop < 0) projectedTop = 0;
521
+
522
+ $ppt.fadeTo(settings.animation_speed,1);
523
+
524
+ // Resize the content holder
525
+ $pp_pic_holder.find('.pp_content')
526
+ .animate({
527
+ height:pp_dimensions['contentHeight'],
528
+ width:pp_dimensions['contentWidth']
529
+ },settings.animation_speed);
530
+
531
+ // Resize picture the holder
532
+ $pp_pic_holder.animate({
533
+ 'top': projectedTop,
534
+ 'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0 : (windowWidth/2) - (pp_dimensions['containerWidth']/2),
535
+ width:pp_dimensions['containerWidth']
536
+ },settings.animation_speed,function(){
537
+ $pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);
538
+
539
+ $pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); // Fade the new content
540
+
541
+ // Show the nav
542
+ if(isSet && _getFileType(pp_images[set_position])=="image") { $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); }
543
+
544
+ if(settings.allow_expand) {
545
+ if(pp_dimensions['resized']){ // Fade the resizing link if the image is resized
546
+ $('a.pp_expand,a.pp_contract').show();
547
+ }else{
548
+ $('a.pp_expand').hide();
549
+ }
550
+ }
551
+
552
+ if(settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow();
553
+
554
+ settings.changepicturecallback(); // Callback!
555
+
556
+ pp_open = true;
557
+ });
558
+
559
+ _insert_gallery();
560
+ pp_settings.ajaxcallback();
561
+
562
+ };
563
+
564
+ /**
565
+ * Hide the content...DUH!
566
+ */
567
+ function _hideContent(callback){
568
+ // Fade out the current picture
569
+ $pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');
570
+ $pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){
571
+ $('.pp_loaderIcon').show();
572
+
573
+ callback();
574
+ });
575
+ };
576
+
577
+ /**
578
+ * Check the item position in the gallery array, hide or show the navigation links
579
+ * @param setCount {integer} The total number of items in the set
580
+ */
581
+ function _checkPosition(setCount){
582
+ (setCount > 1) ? $('.pp_nav').show() : $('.pp_nav').hide(); // Hide the bottom nav if it's not a set.
583
+ };
584
+
585
+ /**
586
+ * Resize the item dimensions if it's bigger than the viewport
587
+ * @param width {integer} Width of the item to be opened
588
+ * @param height {integer} Height of the item to be opened
589
+ * @return An array containin the "fitted" dimensions
590
+ */
591
+ function _fitToViewport(width,height){
592
+ resized = false;
593
+
594
+ _getDimensions(width,height);
595
+
596
+ // Define them in case there's no resize needed
597
+ imageWidth = width, imageHeight = height;
598
+
599
+ if( ((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) && doresize && settings.allow_resize && !percentBased) {
600
+ resized = true, fitting = false;
601
+
602
+ while (!fitting){
603
+ if((pp_containerWidth > windowWidth)){
604
+ imageWidth = (windowWidth - 200);
605
+ imageHeight = (height/width) * imageWidth;
606
+ }else if((pp_containerHeight > windowHeight)){
607
+ imageHeight = (windowHeight - 200);
608
+ imageWidth = (width/height) * imageHeight;
609
+ }else{
610
+ fitting = true;
611
+ };
612
+
613
+ pp_containerHeight = imageHeight, pp_containerWidth = imageWidth;
614
+ };
615
+
616
+
617
+
618
+ if((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)){
619
+ _fitToViewport(pp_containerWidth,pp_containerHeight)
620
+ };
621
+
622
+ _getDimensions(imageWidth,imageHeight);
623
+ };
624
+
625
+ return {
626
+ width:Math.floor(imageWidth),
627
+ height:Math.floor(imageHeight),
628
+ containerHeight:Math.floor(pp_containerHeight),
629
+ containerWidth:Math.floor(pp_containerWidth) + (settings.horizontal_padding * 2),
630
+ contentHeight:Math.floor(pp_contentHeight),
631
+ contentWidth:Math.floor(pp_contentWidth),
632
+ resized:resized
633
+ };
634
+ };
635
+
636
+ /**
637
+ * Get the containers dimensions according to the item size
638
+ * @param width {integer} Width of the item to be opened
639
+ * @param height {integer} Height of the item to be opened
640
+ */
641
+ function _getDimensions(width,height){
642
+ width = parseFloat(width);
643
+ height = parseFloat(height);
644
+
645
+ // Get the details height, to do so, I need to clone it since it's invisible
646
+ $pp_details = $pp_pic_holder.find('.pp_details');
647
+ $pp_details.width(width);
648
+ detailsHeight = parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom'));
649
+
650
+ $pp_details = $pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({
651
+ 'position':'absolute',
652
+ 'top':-10000
653
+ });
654
+ detailsHeight += $pp_details.height();
655
+ detailsHeight = (detailsHeight <= 34) ? 36 : detailsHeight; // Min-height for the details
656
+ $pp_details.remove();
657
+
658
+ // Get the titles height, to do so, I need to clone it since it's invisible
659
+ $pp_title = $pp_pic_holder.find('.ppt');
660
+ $pp_title.width(width);
661
+ titleHeight = parseFloat($pp_title.css('marginTop')) + parseFloat($pp_title.css('marginBottom'));
662
+ $pp_title = $pp_title.clone().appendTo($('body')).css({
663
+ 'position':'absolute',
664
+ 'top':-10000
665
+ });
666
+ titleHeight += $pp_title.height();
667
+ $pp_title.remove();
668
+
669
+ // Get the container size, to resize the holder to the right dimensions
670
+ pp_contentHeight = height + detailsHeight;
671
+ pp_contentWidth = width;
672
+ pp_containerHeight = pp_contentHeight + titleHeight + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height();
673
+ pp_containerWidth = width;
674
+ }
675
+
676
+ function _getFileType(itemSrc){
677
+ if (itemSrc.match(/youtube\.com\/watch/i) || itemSrc.match(/youtu\.be/i)) {
678
+ return 'youtube';
679
+ }else if (itemSrc.match(/vimeo\.com/i)) {
680
+ return 'vimeo';
681
+ }else if(itemSrc.match(/\b.mov\b/i)){
682
+ return 'quicktime';
683
+ }else if(itemSrc.match(/\b.swf\b/i)){
684
+ return 'flash';
685
+ }else if(itemSrc.match(/\biframe=true\b/i)){
686
+ return 'iframe';
687
+ }else if(itemSrc.match(/\bajax=true\b/i)){
688
+ return 'ajax';
689
+ }else if(itemSrc.match(/\bcustom=true\b/i)){
690
+ return 'custom';
691
+ }else if(itemSrc.substr(0,1) == '#'){
692
+ return 'inline';
693
+ }else{
694
+ return 'image';
695
+ };
696
+ };
697
+
698
+ function _center_overlay(){
699
+ if(doresize && typeof $pp_pic_holder != 'undefined') {
700
+ scroll_pos = _get_scroll();
701
+ contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width();
702
+
703
+ projectedTop = (windowHeight/2) + scroll_pos['scrollTop'] - (contentHeight/2);
704
+ if(projectedTop < 0) projectedTop = 0;
705
+
706
+ if(contentHeight > windowHeight)
707
+ return;
708
+
709
+ $pp_pic_holder.css({
710
+ 'top': projectedTop,
711
+ 'left': (windowWidth/2) + scroll_pos['scrollLeft'] - (contentwidth/2)
712
+ });
713
+ };
714
+ };
715
+
716
+ function _get_scroll(){
717
+ if (self.pageYOffset) {
718
+ return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};
719
+ } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
720
+ return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};
721
+ } else if (document.body) {// all other Explorers
722
+ return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};
723
+ };
724
+ };
725
+
726
+ function _resize_overlay() {
727
+ windowHeight = $(window).height(), windowWidth = $(window).width();
728
+
729
+ if(typeof $pp_overlay != "undefined") $pp_overlay.height($(document).height()).width(windowWidth);
730
+ };
731
+
732
+ function _insert_gallery(){
733
+ if(isSet && settings.overlay_gallery && _getFileType(pp_images[set_position])=="image") {
734
+ itemWidth = 52+5; // 52 beign the thumb width, 5 being the right margin.
735
+ navWidth = (settings.theme == "facebook" || settings.theme == "pp_default") ? 50 : 30; // Define the arrow width depending on the theme
736
+
737
+ itemsPerPage = Math.floor((pp_dimensions['containerWidth'] - 100 - navWidth) / itemWidth);
738
+ itemsPerPage = (itemsPerPage < pp_images.length) ? itemsPerPage : pp_images.length;
739
+ totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1;
740
+
741
+ // Hide the nav in the case there's no need for links
742
+ if(totalPage == 0){
743
+ navWidth = 0; // No nav means no width!
744
+ $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide();
745
+ }else{
746
+ $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show();
747
+ };
748
+
749
+ galleryWidth = itemsPerPage * itemWidth;
750
+ fullGalleryWidth = pp_images.length * itemWidth;
751
+
752
+ // Set the proper width to the gallery items
753
+ $pp_gallery
754
+ .css('margin-left',-((galleryWidth/2) + (navWidth/2)))
755
+ .find('div:first').width(galleryWidth+5)
756
+ .find('ul').width(fullGalleryWidth)
757
+ .find('li.selected').removeClass('selected');
758
+
759
+ goToPage = (Math.floor(set_position/itemsPerPage) < totalPage) ? Math.floor(set_position/itemsPerPage) : totalPage;
760
+
761
+ $.prettyPhoto.changeGalleryPage(goToPage);
762
+
763
+ $pp_gallery_li.filter(':eq('+set_position+')').addClass('selected');
764
+ }else{
765
+ $pp_pic_holder.find('.pp_content').off('mouseenter mouseleave');
766
+ // $pp_gallery.hide();
767
+ }
768
+ }
769
+
770
+ function _build_overlay(caller){
771
+ // Inject Social Tool markup into General markup
772
+ if(settings.social_tools)
773
+ facebook_like_link = settings.social_tools.replace('{location_href}', encodeURIComponent(location.href));
774
+
775
+ settings.markup = settings.markup.replace('{pp_social}','');
776
+
777
+ $('body').append(settings.markup); // Inject the markup
778
+
779
+ $pp_pic_holder = $('.pp_pic_holder') , $ppt = $('.ppt'), $pp_overlay = $('div.pp_overlay'); // Set my global selectors
780
+
781
+ // Inject the inline gallery!
782
+ if(isSet && settings.overlay_gallery) {
783
+ currentGalleryPage = 0;
784
+ toInject = "";
785
+ for (var i=0; i < pp_images.length; i++) {
786
+ if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){
787
+ classname = 'default';
788
+ img_src = '';
789
+ }else{
790
+ classname = '';
791
+ img_src = pp_images[i];
792
+ }
793
+ toInject += "<li class='"+classname+"'><a href='#'><img src='" + img_src + "' width='50' alt='' /></a></li>";
794
+ };
795
+
796
+ toInject = settings.gallery_markup.replace(/{gallery}/g,toInject);
797
+
798
+ $pp_pic_holder.find('#pp_full_res').after(toInject);
799
+
800
+ $pp_gallery = $('.pp_pic_holder .pp_gallery'), $pp_gallery_li = $pp_gallery.find('li'); // Set the gallery selectors
801
+
802
+ $pp_gallery.find('.pp_arrow_next').on( 'click', function(){
803
+ $.prettyPhoto.changeGalleryPage('next');
804
+ $.prettyPhoto.stopSlideshow();
805
+ return false;
806
+ });
807
+
808
+ $pp_gallery.find('.pp_arrow_previous').on( 'click', function(){
809
+ $.prettyPhoto.changeGalleryPage('previous');
810
+ $.prettyPhoto.stopSlideshow();
811
+ return false;
812
+ });
813
+
814
+ $pp_pic_holder.find('.pp_content').on( 'mouseenter',
815
+ function(){
816
+ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();
817
+ } ).on( 'mouseleave',
818
+ function(){
819
+ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();
820
+ });
821
+
822
+ itemWidth = 52+5; // 52 beign the thumb width, 5 being the right margin.
823
+ $pp_gallery_li.each(function(i){
824
+ $(this)
825
+ .find('a')
826
+ .on( 'click', function(){
827
+ $.prettyPhoto.changePage(i);
828
+ $.prettyPhoto.stopSlideshow();
829
+ return false;
830
+ });
831
+ });
832
+ };
833
+
834
+
835
+ // Inject the play/pause if it's a slideshow
836
+ if(settings.slideshow){
837
+ $pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
838
+ $pp_pic_holder.find('.pp_nav .pp_play').on( 'click', function(){
839
+ $.prettyPhoto.startSlideshow();
840
+ return false;
841
+ });
842
+ }
843
+
844
+ $pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme); // Set the proper theme
845
+
846
+ $pp_overlay
847
+ .css({
848
+ 'opacity':0,
849
+ 'height':$(document).height(),
850
+ 'width':$(window).width()
851
+ })
852
+ .on('click',function(){
853
+ if(!settings.modal) $.prettyPhoto.close();
854
+ });
855
+
856
+ $('a.pp_close').on('click',function(){ $.prettyPhoto.close(); return false; });
857
+
858
+
859
+ if(settings.allow_expand) {
860
+ $('a.pp_expand').on('click',function(e){
861
+ // Expand the image
862
+ if($(this).hasClass('pp_expand')){
863
+ $(this).removeClass('pp_expand').addClass('pp_contract');
864
+ doresize = false;
865
+ }else{
866
+ $(this).removeClass('pp_contract').addClass('pp_expand');
867
+ doresize = true;
868
+ };
869
+
870
+ _hideContent(function(){ $.prettyPhoto.open(); });
871
+
872
+ return false;
873
+ });
874
+ }
875
+
876
+ $pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').on('click',function(){
877
+ $.prettyPhoto.changePage('previous');
878
+ $.prettyPhoto.stopSlideshow();
879
+ return false;
880
+ });
881
+
882
+ $pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').on('click',function(){
883
+ $.prettyPhoto.changePage('next');
884
+ $.prettyPhoto.stopSlideshow();
885
+ return false;
886
+ });
887
+
888
+ _center_overlay(); // Center it
889
+ };
890
+
891
+ if(!pp_alreadyInitialized && getHashtag()){
892
+ pp_alreadyInitialized = true;
893
+
894
+ // Grab the rel index to trigger the click on the correct element
895
+ hashIndex = getHashtag();
896
+ hashRel = hashIndex;
897
+ hashIndex = hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1);
898
+ hashRel = hashRel.substring(0,hashRel.indexOf('/'));
899
+
900
+ // Little timeout to make sure all the prettyPhoto initialize scripts has been run.
901
+ // Useful in the event the page contain several init scripts.
902
+ setTimeout(function(){ $("a["+pp_settings.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger('click'); },50);
903
+ }
904
+
905
+ return this.off('click.prettyphoto').on('click.prettyphoto',$.prettyPhoto.initialize); // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
906
+ };
907
+
908
+ function getHashtag(){
909
+ var url = location.href;
910
+ hashtag = (url.indexOf('#prettyPhoto') !== -1) ? decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)) : false;
911
+ if(hashtag){ hashtag = hashtag.replace(/<|>/g,''); }
912
+ return hashtag;
913
+ };
914
+
915
+ function setHashtag(){
916
+ if(typeof theRel == 'undefined') return; // theRel is set on normal calls, it's impossible to deeplink using the API
917
+ location.hash = theRel + '/'+rel_index+'/';
918
+ };
919
+
920
+ function clearHashtag(){
921
+ if ( location.href.indexOf('#prettyPhoto') !== -1 ) location.hash = "prettyPhoto";
922
+ }
923
+
924
+ function getParam(name,url){
925
+ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
926
+ var regexS = "[\\?&]"+name+"=([^&#]*)";
927
+ var regex = new RegExp( regexS );
928
+ var results = regex.exec( url );
929
+ return ( results == null ) ? "" : results[1];
930
+ }
931
+
932
+
933
+ })(jQuery);
934
+
935
+ var pp_alreadyInitialized = false; // Used for the deep linking to make sure not to call the same function several times.
assets/js/jquery.carouFredSel.js CHANGED
@@ -1,4254 +1,3823 @@
1
- /*
2
- * jQuery carouFredSel 6.2.1
3
- * Demo's and documentation:
4
- * caroufredsel.dev7studios.com
5
- *
6
- * Copyright (c) 2013 Fred Heusschen
7
- * www.frebsite.nl
8
- *
9
- * Dual licensed under the MIT and GPL licenses.
10
- * http://en.wikipedia.org/wiki/MIT_License
11
- * http://en.wikipedia.org/wiki/GNU_General_Public_License
12
- */
13
-
14
-
15
- (function($) {
16
-
17
-
18
- // LOCAL
19
-
20
- if ( $.fn.carouFredSel )
21
- {
22
- return;
23
- }
24
-
25
- $.fn.caroufredsel = $.fn.carouFredSel = function(options, configs)
26
- {
27
-
28
- // no element
29
- if (this.length == 0)
30
- {
31
- debug( true, 'No element found for "' + this.selector + '".' );
32
- return this;
33
- }
34
-
35
- // multiple elements
36
- if (this.length > 1)
37
- {
38
- return this.each(function() {
39
- $(this).carouFredSel(options, configs);
40
- });
41
- }
42
-
43
-
44
- var $cfs = this,
45
- $tt0 = this[0],
46
- starting_position = false;
47
-
48
- if ($cfs.data('_cfs_isCarousel'))
49
- {
50
- starting_position = $cfs.triggerHandler('_cfs_triggerEvent', 'currentPosition');
51
- $cfs.trigger('_cfs_triggerEvent', ['destroy', true]);
52
- }
53
-
54
- var FN = {};
55
-
56
- FN._init = function(o, setOrig, start)
57
- {
58
- o = go_getObject($tt0, o);
59
-
60
- o.items = go_getItemsObject($tt0, o.items);
61
- o.scroll = go_getScrollObject($tt0, o.scroll);
62
- o.auto = go_getAutoObject($tt0, o.auto);
63
- o.prev = go_getPrevNextObject($tt0, o.prev);
64
- o.next = go_getPrevNextObject($tt0, o.next);
65
- o.pagination = go_getPaginationObject($tt0, o.pagination);
66
- o.swipe = go_getSwipeObject($tt0, o.swipe);
67
- o.mousewheel = go_getMousewheelObject($tt0, o.mousewheel);
68
-
69
- if (setOrig)
70
- {
71
- opts_orig = $.extend(true, {}, $.fn.carouFredSel.defaults, o);
72
- }
73
-
74
- opts = $.extend(true, {}, $.fn.carouFredSel.defaults, o);
75
- opts.d = cf_getDimensions(opts);
76
-
77
- crsl.direction = (opts.direction == 'up' || opts.direction == 'left') ? 'next' : 'prev';
78
-
79
- var a_itm = $cfs.children(),
80
- avail_primary = ms_getParentSize($wrp, opts, 'width');
81
-
82
- if (is_true(opts.cookie))
83
- {
84
- opts.cookie = 'caroufredsel_cookie_' + conf.serialNumber;
85
- }
86
-
87
- opts.maxDimension = ms_getMaxDimension(opts, avail_primary);
88
-
89
- // complement items and sizes
90
- opts.items = in_complementItems(opts.items, opts, a_itm, start);
91
- opts[opts.d['width']] = in_complementPrimarySize(opts[opts.d['width']], opts, a_itm);
92
- opts[opts.d['height']] = in_complementSecondarySize(opts[opts.d['height']], opts, a_itm);
93
-
94
- // primary size not set for a responsive carousel
95
- if (opts.responsive)
96
- {
97
- if (!is_percentage(opts[opts.d['width']]))
98
- {
99
- opts[opts.d['width']] = '100%';
100
- }
101
- }
102
-
103
- // primary size is percentage
104
- if (is_percentage(opts[opts.d['width']]))
105
- {
106
- crsl.upDateOnWindowResize = true;
107
- crsl.primarySizePercentage = opts[opts.d['width']];
108
- opts[opts.d['width']] = ms_getPercentage(avail_primary, crsl.primarySizePercentage);
109
- if (!opts.items.visible)
110
- {
111
- opts.items.visibleConf.variable = true;
112
- }
113
- }
114
-
115
- if (opts.responsive)
116
- {
117
- opts.usePadding = false;
118
- opts.padding = [0, 0, 0, 0];
119
- opts.align = false;
120
- opts.items.visibleConf.variable = false;
121
- }
122
- else
123
- {
124
- // visible-items not set
125
- if (!opts.items.visible)
126
- {
127
- opts = in_complementVisibleItems(opts, avail_primary);
128
- }
129
-
130
- // primary size not set -> calculate it or set to "variable"
131
- if (!opts[opts.d['width']])
132
- {
133
- if (!opts.items.visibleConf.variable && is_number(opts.items[opts.d['width']]) && opts.items.filter == '*')
134
- {
135
- opts[opts.d['width']] = opts.items.visible * opts.items[opts.d['width']];
136
- opts.align = false;
137
- }
138
- else
139
- {
140
- opts[opts.d['width']] = 'variable';
141
- }
142
- }
143
- // align not set -> set to center if primary size is number
144
- if (is_undefined(opts.align))
145
- {
146
- opts.align = (is_number(opts[opts.d['width']]))
147
- ? 'center'
148
- : false;
149
- }
150
- // set variabe visible-items
151
- if (opts.items.visibleConf.variable)
152
- {
153
- opts.items.visible = gn_getVisibleItemsNext(a_itm, opts, 0);
154
- }
155
- }
156
-
157
- // set visible items by filter
158
- if (opts.items.filter != '*' && !opts.items.visibleConf.variable)
159
- {
160
- opts.items.visibleConf.org = opts.items.visible;
161
- opts.items.visible = gn_getVisibleItemsNextFilter(a_itm, opts, 0);
162
- }
163
-
164
- opts.items.visible = cf_getItemsAdjust(opts.items.visible, opts, opts.items.visibleConf.adjust, $tt0);
165
- opts.items.visibleConf.old = opts.items.visible;
166
-
167
- if (opts.responsive)
168
- {
169
- if (!opts.items.visibleConf.min)
170
- {
171
- opts.items.visibleConf.min = opts.items.visible;
172
- }
173
- if (!opts.items.visibleConf.max)
174
- {
175
- opts.items.visibleConf.max = opts.items.visible;
176
- }
177
- opts = in_getResponsiveValues(opts, a_itm, avail_primary);
178
- }
179
- else
180
- {
181
- opts.padding = cf_getPadding(opts.padding);
182
-
183
- if (opts.align == 'top')
184
- {
185
- opts.align = 'left';
186
- }
187
- else if (opts.align == 'bottom')
188
- {
189
- opts.align = 'right';
190
- }
191
-
192
- switch (opts.align)
193
- {
194
- // align: center, left or right
195
- case 'center':
196
- case 'left':
197
- case 'right':
198
- if (opts[opts.d['width']] != 'variable')
199
- {
200
- opts = in_getAlignPadding(opts, a_itm);
201
- opts.usePadding = true;
202
- }
203
- break;
204
-
205
- // padding
206
- default:
207
- opts.align = false;
208
- opts.usePadding = (
209
- opts.padding[0] == 0 &&
210
- opts.padding[1] == 0 &&
211
- opts.padding[2] == 0 &&
212
- opts.padding[3] == 0
213
- ) ? false : true;
214
- break;
215
- }
216
- }
217
-
218
- if (!is_number(opts.scroll.duration))
219
- {
220
- opts.scroll.duration = 500;
221
- }
222
- if (is_undefined(opts.scroll.items))
223
- {
224
- opts.scroll.items = (opts.responsive || opts.items.visibleConf.variable || opts.items.filter != '*')
225
- ? 'visible'
226
- : opts.items.visible;
227
- }
228
-
229
- opts.auto = $.extend(true, {}, opts.scroll, opts.auto);
230
- opts.prev = $.extend(true, {}, opts.scroll, opts.prev);
231
- opts.next = $.extend(true, {}, opts.scroll, opts.next);
232
- opts.pagination = $.extend(true, {}, opts.scroll, opts.pagination);
233
- // swipe and mousewheel extend later on, per direction
234
-
235
- opts.auto = go_complementAutoObject($tt0, opts.auto);
236
- opts.prev = go_complementPrevNextObject($tt0, opts.prev);
237
- opts.next = go_complementPrevNextObject($tt0, opts.next);
238
- opts.pagination = go_complementPaginationObject($tt0, opts.pagination);
239
- opts.swipe = go_complementSwipeObject($tt0, opts.swipe);
240
- opts.mousewheel = go_complementMousewheelObject($tt0, opts.mousewheel);
241
-
242
- if (opts.synchronise)
243
- {
244
- opts.synchronise = cf_getSynchArr(opts.synchronise);
245
- }
246
-
247
-
248
- // DEPRECATED
249
- if (opts.auto.onPauseStart)
250
- {
251
- opts.auto.onTimeoutStart = opts.auto.onPauseStart;
252
- deprecated('auto.onPauseStart', 'auto.onTimeoutStart');
253
- }
254
- if (opts.auto.onPausePause)
255
- {
256
- opts.auto.onTimeoutPause = opts.auto.onPausePause;
257
- deprecated('auto.onPausePause', 'auto.onTimeoutPause');
258
- }
259
- if (opts.auto.onPauseEnd)
260
- {
261
- opts.auto.onTimeoutEnd = opts.auto.onPauseEnd;
262
- deprecated('auto.onPauseEnd', 'auto.onTimeoutEnd');
263
- }
264
- if (opts.auto.pauseDuration)
265
- {
266
- opts.auto.timeoutDuration = opts.auto.pauseDuration;
267
- deprecated('auto.pauseDuration', 'auto.timeoutDuration');
268
- }
269
- // /DEPRECATED
270
-
271
-
272
- }; // /init
273
-
274
-
275
- FN._build = function() {
276
- $cfs.data('_cfs_isCarousel', true);
277
-
278
- var a_itm = $cfs.children(),
279
- orgCSS = in_mapCss($cfs, ['textAlign', 'float', 'position', 'top', 'right', 'bottom', 'left', 'zIndex', 'width', 'height', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft']),
280
- newPosition = 'relative';
281
-
282
- switch (orgCSS.position)
283
- {
284
- case 'absolute':
285
- case 'fixed':
286
- newPosition = orgCSS.position;
287
- break;
288
- }
289
-
290
- if (conf.wrapper == 'parent')
291
- {
292
- sz_storeOrigCss($wrp);
293
- }
294
- else
295
- {
296
- $wrp.css(orgCSS);
297
- }
298
- $wrp.css({
299
- 'overflow' : 'hidden',
300
- 'position' : newPosition
301
- });
302
-
303
- sz_storeOrigCss($cfs);
304
- $cfs.data('_cfs_origCssZindex', orgCSS.zIndex);
305
- $cfs.css({
306
- 'textAlign' : 'left',
307
- 'float' : 'none',
308
- 'position' : 'absolute',
309
- 'top' : 0,
310
- 'right' : 'auto',
311
- 'bottom' : 'auto',
312
- 'left' : 0,
313
- 'marginTop' : 0,
314
- 'marginRight' : 0,
315
- 'marginBottom' : 0,
316
- 'marginLeft' : 0
317
- });
318
-
319
- sz_storeMargin(a_itm, opts);
320
- sz_storeOrigCss(a_itm);
321
- if (opts.responsive)
322
- {
323
- sz_setResponsiveSizes(opts, a_itm);
324
- }
325
-
326
- }; // /build
327
-
328
-
329
- FN._bind_events = function() {
330
- FN._unbind_events();
331
-
332
-
333
- // stop event
334
- $cfs.bind(cf_e('stop', conf), function(e, imm) {
335
- e.stopPropagation();
336
-
337
- // button
338
- if (!crsl.isStopped)
339
- {
340
- if (opts.auto.button)
341
- {
342
- opts.auto.button.addClass(cf_c('stopped', conf));
343
- }
344
- }
345
-
346
- // set stopped
347
- crsl.isStopped = true;
348
-
349
- if (opts.auto.play)
350
- {
351
- opts.auto.play = false;
352
- $cfs.trigger(cf_e('pause', conf), imm);
353
- }
354
- return true;
355
- });
356
-
357
-
358
- // finish event
359
- $cfs.bind(cf_e('finish', conf), function(e) {
360
- e.stopPropagation();
361
- if (crsl.isScrolling)
362
- {
363
- sc_stopScroll(scrl);
364
- }
365
- return true;
366
- });
367
-
368
-
369
- // pause event
370
- $cfs.bind(cf_e('pause', conf), function(e, imm, res) {
371
- e.stopPropagation();
372
- tmrs = sc_clearTimers(tmrs);
373
-
374
- // immediately pause
375
- if (imm && crsl.isScrolling)
376
- {
377
- scrl.isStopped = true;
378
- var nst = getTime() - scrl.startTime;
379
- scrl.duration -= nst;
380
- if (scrl.pre)
381
- {
382
- scrl.pre.duration -= nst;
383
- }
384
- if (scrl.post)
385
- {
386
- scrl.post.duration -= nst;
387
- }
388
- sc_stopScroll(scrl, false);
389
- }
390
-
391
- // update remaining pause-time
392
- if (!crsl.isPaused && !crsl.isScrolling)
393
- {
394
- if (res)
395
- {
396
- tmrs.timePassed += getTime() - tmrs.startTime;
397
- }
398
- }
399
-
400
- // button
401
- if (!crsl.isPaused)
402
- {
403
- if (opts.auto.button)
404
- {
405
- opts.auto.button.addClass(cf_c('paused', conf));
406
- }
407
- }
408
-
409
- // set paused
410
- crsl.isPaused = true;
411
-
412
- // pause pause callback
413
- if (opts.auto.onTimeoutPause)
414
- {
415
- var dur1 = opts.auto.timeoutDuration - tmrs.timePassed,
416
- perc = 100 - Math.ceil( dur1 * 100 / opts.auto.timeoutDuration );
417
-
418
- opts.auto.onTimeoutPause.call($tt0, perc, dur1);
419
- }
420
- return true;
421
- });
422
-
423
-
424
- // play event
425
- $cfs.bind(cf_e('play', conf), function(e, dir, del, res) {
426
- e.stopPropagation();
427
- tmrs = sc_clearTimers(tmrs);
428
-
429
- // sort params
430
- var v = [dir, del, res],
431
- t = ['string', 'number', 'boolean'],
432
- a = cf_sortParams(v, t);
433
-
434
- dir = a[0];
435
- del = a[1];
436
- res = a[2];
437
-
438
- if (dir != 'prev' && dir != 'next')
439
- {
440
- dir = crsl.direction;
441
- }
442
- if (!is_number(del))
443
- {
444
- del = 0;
445
- }
446
- if (!is_boolean(res))
447
- {
448
- res = false;
449
- }
450
-
451
- // stopped?
452
- if (res)
453
- {
454
- crsl.isStopped = false;
455
- opts.auto.play = true;
456
- }
457
- if (!opts.auto.play)
458
- {
459
- e.stopImmediatePropagation();
460
- return debug(conf, 'Carousel stopped: Not scrolling.');
461
- }
462
-
463
- // button
464
- if (crsl.isPaused)
465
- {
466
- if (opts.auto.button)
467
- {
468
- opts.auto.button.removeClass(cf_c('stopped', conf));
469
- opts.auto.button.removeClass(cf_c('paused', conf));
470
- }
471
- }
472
-
473
- // set playing
474
- crsl.isPaused = false;
475
- tmrs.startTime = getTime();
476
-
477
- // timeout the scrolling
478
- var dur1 = opts.auto.timeoutDuration + del;
479
- dur2 = dur1 - tmrs.timePassed;
480
- perc = 100 - Math.ceil(dur2 * 100 / dur1);
481
-
482
- if (opts.auto.progress)
483
- {
484
- tmrs.progress = setInterval(function() {
485
- var pasd = getTime() - tmrs.startTime + tmrs.timePassed,
486
- perc = Math.ceil(pasd * 100 / dur1);
487
- opts.auto.progress.updater.call(opts.auto.progress.bar[0], perc);
488
- }, opts.auto.progress.interval);
489
- }
490
-
491
- tmrs.auto = setTimeout(function() {
492
- if (opts.auto.progress)
493
- {
494
- opts.auto.progress.updater.call(opts.auto.progress.bar[0], 100);
495
- }
496
- if (opts.auto.onTimeoutEnd)
497
- {
498
- opts.auto.onTimeoutEnd.call($tt0, perc, dur2);
499
- }
500
- if (crsl.isScrolling)
501
- {
502
- $cfs.trigger(cf_e('play', conf), dir);
503
- }
504
- else
505
- {
506
- $cfs.trigger(cf_e(dir, conf), opts.auto);
507
- }
508
- }, dur2);
509
-
510
- // pause start callback
511
- if (opts.auto.onTimeoutStart)
512
- {
513
- opts.auto.onTimeoutStart.call($tt0, perc, dur2);
514
- }
515
-
516
- return true;
517
- });
518
-
519
-
520
- // resume event
521
- $cfs.bind(cf_e('resume', conf), function(e) {
522
- e.stopPropagation();
523
- if (scrl.isStopped)
524
- {
525
- scrl.isStopped = false;
526
- crsl.isPaused = false;
527
- crsl.isScrolling = true;
528
- scrl.startTime = getTime();
529
- sc_startScroll(scrl, conf);
530
- }
531
- else
532
- {
533
- $cfs.trigger(cf_e('play', conf));
534
- }
535
- return true;
536
- });
537
-
538
-
539
- // prev + next events
540
- $cfs.bind(cf_e('prev', conf)+' '+cf_e('next', conf), function(e, obj, num, clb, que) {
541
- e.stopPropagation();
542
-
543
- // stopped or hidden carousel, don't scroll, don't queue
544
- if (crsl.isStopped || $cfs.is(':hidden'))
545
- {
546
- e.stopImmediatePropagation();
547
- return debug(conf, 'Carousel stopped or hidden: Not scrolling.');
548
- }
549
-
550
- // not enough items
551
- var minimum = (is_number(opts.items.minimum)) ? opts.items.minimum : opts.items.visible + 1;
552
- if (minimum > itms.total)
553
- {
554
- e.stopImmediatePropagation();
555
- return debug(conf, 'Not enough items ('+itms.total+' total, '+minimum+' needed): Not scrolling.');
556
- }
557
-
558
- // get config
559
- var v = [obj, num, clb, que],
560
- t = ['object', 'number/string', 'function', 'boolean'],
561
- a = cf_sortParams(v, t);
562
-
563
- obj = a[0];
564
- num = a[1];
565
- clb = a[2];
566
- que = a[3];
567
-
568
- var eType = e.type.slice(conf.events.prefix.length);
569
-
570
- if (!is_object(obj))
571
- {
572
- obj = {};
573
- }
574
- if (is_function(clb))
575
- {
576
- obj.onAfter = clb;
577
- }
578
- if (is_boolean(que))
579
- {
580
- obj.queue = que;
581
- }
582
- obj = $.extend(true, {}, opts[eType], obj);
583
-
584
- // test conditions callback
585
- if (obj.conditions && !obj.conditions.call($tt0, eType))
586
- {
587
- e.stopImmediatePropagation();
588
- return debug(conf, 'Callback "conditions" returned false.');
589
- }
590
-
591
- if (!is_number(num))
592
- {
593
- if (opts.items.filter != '*')
594
- {
595
- num = 'visible';
596
- }
597
- else
598
- {
599
- var arr = [num, obj.items, opts[eType].items];
600
- for (var a = 0, l = arr.length; a < l; a++)
601
- {
602
- if (is_number(arr[a]) || arr[a] == 'page' || arr[a] == 'visible') {
603
- num = arr[a];
604
- break;
605
- }
606
- }
607
- }
608
- switch(num) {
609
- case 'page':
610
- e.stopImmediatePropagation();
611
- return $cfs.triggerHandler(cf_e(eType+'Page', conf), [obj, clb]);
612
- break;
613
-
614
- case 'visible':
615
- if (!opts.items.visibleConf.variable && opts.items.filter == '*')
616
- {
617
- num = opts.items.visible;
618
- }
619
- break;
620
- }
621
- }
622
-
623
- // resume animation, add current to queue
624
- if (scrl.isStopped)
625
- {
626
- $cfs.trigger(cf_e('resume', conf));
627
- $cfs.trigger(cf_e('queue', conf), [eType, [obj, num, clb]]);
628
- e.stopImmediatePropagation();
629
- return debug(conf, 'Carousel resumed scrolling.');
630
- }
631
-
632
- // queue if scrolling
633
- if (obj.duration > 0)
634
- {
635
- if (crsl.isScrolling)
636
- {
637
- if (obj.queue)
638
- {
639
- if (obj.queue == 'last')
640
- {
641
- queu = [];
642
- }
643
- if (obj.queue != 'first' || queu.length == 0)
644
- {
645
- $cfs.trigger(cf_e('queue', conf), [eType, [obj, num, clb]]);
646
- }
647
- }
648
- e.stopImmediatePropagation();
649
- return debug(conf, 'Carousel currently scrolling.');
650
- }
651
- }
652
-
653
- tmrs.timePassed = 0;
654
- $cfs.trigger(cf_e('slide_'+eType, conf), [obj, num]);
655
-
656
- // synchronise
657
- if (opts.synchronise)
658
- {
659
- var s = opts.synchronise,
660
- c = [obj, num];
661
-
662
- for (var j = 0, l = s.length; j < l; j++) {
663
- var d = eType;
664
- if (!s[j][2])
665
- {
666
- d = (d == 'prev') ? 'next' : 'prev';
667
- }
668
- if (!s[j][1])
669
- {
670
- c[0] = s[j][0].triggerHandler('_cfs_triggerEvent', ['configuration', d]);
671
- }
672
- c[1] = num + s[j][3];
673
- s[j][0].trigger('_cfs_triggerEvent', ['slide_'+d, c]);
674
- }
675
- }
676
- return true;
677
- });
678
-
679
-
680
- // prev event
681
- $cfs.bind(cf_e('slide_prev', conf), function(e, sO, nI) {
682
- e.stopPropagation();
683
- var a_itm = $cfs.children();
684
-
685
- // non-circular at start, scroll to end
686
- if (!opts.circular)
687
- {
688
- if (itms.first == 0)
689
- {
690
- if (opts.infinite)
691
- {
692
- $cfs.trigger(cf_e('next', conf), itms.total-1);
693
- }
694
- return e.stopImmediatePropagation();
695
- }
696
- }
697
-
698
- sz_resetMargin(a_itm, opts);
699
-
700
- // find number of items to scroll
701
- if (!is_number(nI))
702
- {
703
- if (opts.items.visibleConf.variable)
704
- {
705
- nI = gn_getVisibleItemsPrev(a_itm, opts, itms.total-1);
706
- }
707
- else if (opts.items.filter != '*')
708
- {
709
- var xI = (is_number(sO.items)) ? sO.items : gn_getVisibleOrg($cfs, opts);
710
- nI = gn_getScrollItemsPrevFilter(a_itm, opts, itms.total-1, xI);
711
- }
712
- else
713
- {
714
- nI = opts.items.visible;
715
- }
716
- nI = cf_getAdjust(nI, opts, sO.items, $tt0);
717
- }
718
-
719
- // prevent non-circular from scrolling to far
720
- if (!opts.circular)
721
- {
722
- if (itms.total - nI < itms.first)
723
- {
724
- nI = itms.total - itms.first;
725
- }
726
- }
727
-
728
- // set new number of visible items
729
- opts.items.visibleConf.old = opts.items.visible;
730
- if (opts.items.visibleConf.variable)
731
- {
732
- var vI = cf_getItemsAdjust(gn_getVisibleItemsNext(a_itm, opts, itms.total-nI), opts, opts.items.visibleConf.adjust, $tt0);
733
- if (opts.items.visible+nI <= vI && nI < itms.total)
734
- {
735
- nI++;
736
- vI = cf_getItemsAdjust(gn_getVisibleItemsNext(a_itm, opts, itms.total-nI), opts, opts.items.visibleConf.adjust, $tt0);
737
- }
738
- opts.items.visible = vI;
739
- }
740
- else if (opts.items.filter != '*')
741
- {
742
- var vI = gn_getVisibleItemsNextFilter(a_itm, opts, itms.total-nI);
743
- opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0);
744
- }
745
-
746
- sz_resetMargin(a_itm, opts, true);
747
-
748
- // scroll 0, don't scroll
749
- if (nI == 0)
750
- {
751
- e.stopImmediatePropagation();
752
- return debug(conf, '0 items to scroll: Not scrolling.');
753
- }
754
- debug(conf, 'Scrolling '+nI+' items backward.');
755
-
756
-
757
- // save new config
758
- itms.first += nI;
759
- while (itms.first >= itms.total)
760
- {
761
- itms.first -= itms.total;
762
- }
763
-
764
- // non-circular callback
765
- if (!opts.circular)
766
- {
767
- if (itms.first == 0 && sO.onEnd)
768
- {
769
- sO.onEnd.call($tt0, 'prev');
770
- }
771
- if (!opts.infinite)
772
- {
773
- nv_enableNavi(opts, itms.first, conf);
774
- }
775
- }
776
-
777
- // rearrange items
778
- $cfs.children().slice(itms.total-nI, itms.total).prependTo($cfs);
779
- if (itms.total < opts.items.visible + nI)
780
- {
781
- $cfs.children().slice(0, (opts.items.visible+nI)-itms.total).clone(true).appendTo($cfs);
782
- }
783
-
784
- // the needed items
785
- var a_itm = $cfs.children(),
786
- i_old = gi_getOldItemsPrev(a_itm, opts, nI),
787
- i_new = gi_getNewItemsPrev(a_itm, opts),
788
- i_cur_l = a_itm.eq(nI-1),
789
- i_old_l = i_old.last(),
790
- i_new_l = i_new.last();
791
-
792
- sz_resetMargin(a_itm, opts);
793
-
794
- var pL = 0,
795
- pR = 0;
796
-
797
- if (opts.align)
798
- {
799
- var p = cf_getAlignPadding(i_new, opts);
800
- pL = p[0];
801
- pR = p[1];
802
- }
803
- var oL = (pL < 0) ? opts.padding[opts.d[3]] : 0;
804
-
805
- // hide items for fx directscroll
806
- var hiddenitems = false,
807
- i_skp = $();
808
- if (opts.items.visible < nI)
809
- {
810
- i_skp = a_itm.slice(opts.items.visibleConf.old, nI);
811
- if (sO.fx == 'directscroll')
812
- {
813
- var orgW = opts.items[opts.d['width']];
814
- hiddenitems = i_skp;
815
- i_cur_l = i_new_l;
816
- sc_hideHiddenItems(hiddenitems);
817
- opts.items[opts.d['width']] = 'variable';
818
- }
819
- }
820
- // save new sizes
821
- var $cf2 = false,
822
- i_siz = ms_getTotalSize(a_itm.slice(0, nI), opts, 'width'),
823
- w_siz = cf_mapWrapperSizes(ms_getSizes(i_new, opts, true), opts, !opts.usePadding),
824
- i_siz_vis = 0,
825
- a_cfs = {},
826
- a_wsz = {},
827
- a_cur = {},
828
- a_old = {},
829
- a_new = {},
830
- a_lef = {},
831
- a_lef_vis = {},
832
- a_dur = sc_getDuration(sO, opts, nI, i_siz);
833
-
834
- switch(sO.fx)
835
- {
836
- case 'cover':
837
- case 'cover-fade':
838
- i_siz_vis = ms_getTotalSize(a_itm.slice(0, opts.items.visible), opts, 'width');
839
- break;
840
- }
841
-
842
- if (hiddenitems)
843
- {
844
- opts.items[opts.d['width']] = orgW;
845
- }
846
-
847
- sz_resetMargin(a_itm, opts, true);
848
- if (pR >= 0)
849
- {
850
- sz_resetMargin(i_old_l, opts, opts.padding[opts.d[1]]);
851
- }
852
- if (pL >= 0)
853
- {
854
- sz_resetMargin(i_cur_l, opts, opts.padding[opts.d[3]]);
855
- }
856
-
857
- if (opts.align)
858
- {
859
- opts.padding[opts.d[1]] = pR;
860
- opts.padding[opts.d[3]] = pL;
861
- }
862
-
863
- a_lef[opts.d['left']] = -(i_siz - oL);
864
- a_lef_vis[opts.d['left']] = -(i_siz_vis - oL);
865
- a_wsz[opts.d['left']] = w_siz[opts.d['width']];
866
-
867
- // scrolling functions
868
- var _s_wrapper = function() {},
869
- _a_wrapper = function() {},
870
- _s_paddingold = function() {},
871
- _a_paddingold = function() {},
872
- _s_paddingnew = function() {},
873
- _a_paddingnew = function() {},
874
- _s_paddingcur = function() {},
875
- _a_paddingcur = function() {},
876
- _onafter = function() {},
877
- _moveitems = function() {},
878
- _position = function() {};
879
-
880
- // clone carousel
881
- switch(sO.fx)
882
- {
883
- case 'crossfade':
884
- case 'cover':
885
- case 'cover-fade':
886
- case 'uncover':
887
- case 'uncover-fade':
888
- $cf2 = $cfs.clone(true).appendTo($wrp);
889
- break;
890
- }
891
- switch(sO.fx)
892
- {
893
- case 'crossfade':
894
- case 'uncover':
895
- case 'uncover-fade':
896
- $cf2.children().slice(0, nI).remove();
897
- $cf2.children().slice(opts.items.visibleConf.old).remove();
898
- break;
899
-
900
- case 'cover':
901
- case 'cover-fade':
902
- $cf2.children().slice(opts.items.visible).remove();
903
- $cf2.css(a_lef_vis);
904
- break;
905
- }
906
-
907
- $cfs.css(a_lef);
908
-
909
- // reset all scrolls
910
- scrl = sc_setScroll(a_dur, sO.easing, conf);
911
-
912
- // animate / set carousel
913
- a_cfs[opts.d['left']] = (opts.usePadding) ? opts.padding[opts.d[3]] : 0;
914
-
915
- // animate / set wrapper
916
- if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable')
917
- {
918
- _s_wrapper = function() {
919
- $wrp.css(w_siz);
920
- };
921
- _a_wrapper = function() {
922
- scrl.anims.push([$wrp, w_siz]);
923
- };
924
- }
925
-
926
- // animate / set items
927
- if (opts.usePadding)
928
- {
929
- if (i_new_l.not(i_cur_l).length)
930
- {
931
- a_cur[opts.d['marginRight']] = i_cur_l.data('_cfs_origCssMargin');
932
-
933
- if (pL < 0)
934
- {
935
- i_cur_l.css(a_cur);
936
- }
937
- else
938
- {
939
- _s_paddingcur = function() {
940
- i_cur_l.css(a_cur);
941
- };
942
- _a_paddingcur = function() {
943
- scrl.anims.push([i_cur_l, a_cur]);
944
- };
945
- }
946
- }
947
- switch(sO.fx)
948
- {
949
- case 'cover':
950
- case 'cover-fade':
951
- $cf2.children().eq(nI-1).css(a_cur);
952
- break;
953
- }
954
-
955
- if (i_new_l.not(i_old_l).length)
956
- {
957
- a_old[opts.d['marginRight']] = i_old_l.data('_cfs_origCssMargin');
958
- _s_paddingold = function() {
959
- i_old_l.css(a_old);
960
- };
961
- _a_paddingold = function() {
962
- scrl.anims.push([i_old_l, a_old]);
963
- };
964
- }
965
-
966
- if (pR >= 0)
967
- {
968
- a_new[opts.d['marginRight']] = i_new_l.data('_cfs_origCssMargin') + opts.padding[opts.d[1]];
969
- _s_paddingnew = function() {
970
- i_new_l.css(a_new);
971
- };
972
- _a_paddingnew = function() {
973
- scrl.anims.push([i_new_l, a_new]);
974
- };
975
- }
976
- }
977
-
978
- // set position
979
- _position = function() {
980
- $cfs.css(a_cfs);
981
- };
982
-
983
-
984
- var overFill = opts.items.visible+nI-itms.total;
985
-
986
- // rearrange items
987
- _moveitems = function() {
988
- if (overFill > 0)
989
- {
990
- $cfs.children().slice(itms.total).remove();
991
- i_old = $( $cfs.children().slice(itms.total-(opts.items.visible-overFill)).get().concat( $cfs.children().slice(0, overFill).get() ) );
992
- }
993
- sc_showHiddenItems(hiddenitems);
994
-
995
- if (opts.usePadding)
996
- {
997
- var l_itm = $cfs.children().eq(opts.items.visible+nI-1);
998
- l_itm.css(opts.d['marginRight'], l_itm.data('_cfs_origCssMargin'));
999
- }
1000
- };
1001
-
1002
-
1003
- var cb_arguments = sc_mapCallbackArguments(i_old, i_skp, i_new, nI, 'prev', a_dur, w_siz);
1004
-
1005
- // fire onAfter callbacks
1006
- _onafter = function() {
1007
- sc_afterScroll($cfs, $cf2, sO);
1008
- crsl.isScrolling = false;
1009
- clbk.onAfter = sc_fireCallbacks($tt0, sO, 'onAfter', cb_arguments, clbk);
1010
- queu = sc_fireQueue($cfs, queu, conf);
1011
-
1012
- if (!crsl.isPaused)
1013
- {
1014
- $cfs.trigger(cf_e('play', conf));
1015
- }
1016
- };
1017
-
1018
- // fire onBefore callback
1019
- crsl.isScrolling = true;
1020
- tmrs = sc_clearTimers(tmrs);
1021
- clbk.onBefore = sc_fireCallbacks($tt0, sO, 'onBefore', cb_arguments, clbk);
1022
-
1023
- switch(sO.fx)
1024
- {
1025
- case 'none':
1026
- $cfs.css(a_cfs);
1027
- _s_wrapper();
1028
- _s_paddingold();
1029
- _s_paddingnew();
1030
- _s_paddingcur();
1031
- _position();
1032
- _moveitems();
1033
- _onafter();
1034
- break;
1035
-
1036
- case 'fade':
1037
- scrl.anims.push([$cfs, { 'opacity': 0 }, function() {
1038
- _s_wrapper();
1039
- _s_paddingold();
1040
- _s_paddingnew();
1041
- _s_paddingcur();
1042
- _position();
1043
- _moveitems();
1044
- scrl = sc_setScroll(a_dur, sO.easing, conf);
1045
- scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]);
1046
- sc_startScroll(scrl, conf);
1047
- }]);
1048
- break;
1049
-
1050
- case 'crossfade':
1051
- $cfs.css({ 'opacity': 0 });
1052
- scrl.anims.push([$cf2, { 'opacity': 0 }]);
1053
- scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]);
1054
- _a_wrapper();
1055
- _s_paddingold();
1056
- _s_paddingnew();
1057
- _s_paddingcur();
1058
- _position();
1059
- _moveitems();
1060
- break;
1061
-
1062
- case 'cover':
1063
- scrl.anims.push([$cf2, a_cfs, function() {
1064
- _s_paddingold();
1065
- _s_paddingnew();
1066
- _s_paddingcur();
1067
- _position();
1068
- _moveitems();
1069
- _onafter();
1070
- }]);
1071
- _a_wrapper();
1072
- break;
1073
-
1074
- case 'cover-fade':
1075
- scrl.anims.push([$cfs, { 'opacity': 0 }]);
1076
- scrl.anims.push([$cf2, a_cfs, function() {
1077
- _s_paddingold();
1078
- _s_paddingnew();
1079
- _s_paddingcur();
1080
- _position();
1081
- _moveitems();
1082
- _onafter();
1083
- }]);
1084
- _a_wrapper();
1085
- break;
1086
-
1087
- case 'uncover':
1088
- scrl.anims.push([$cf2, a_wsz, _onafter]);
1089
- _a_wrapper();
1090
- _s_paddingold();
1091
- _s_paddingnew();
1092
- _s_paddingcur();
1093
- _position();
1094
- _moveitems();
1095
- break;
1096
-
1097
- case 'uncover-fade':
1098
- $cfs.css({ 'opacity': 0 });
1099
- scrl.anims.push([$cfs, { 'opacity': 1 }]);
1100
- scrl.anims.push([$cf2, a_wsz, _onafter]);
1101
- _a_wrapper();
1102
- _s_paddingold();
1103
- _s_paddingnew();
1104
- _s_paddingcur();
1105
- _position();
1106
- _moveitems();
1107
- break;
1108
-
1109
- default:
1110
- scrl.anims.push([$cfs, a_cfs, function() {
1111
- _moveitems();
1112
- _onafter();
1113
- }]);
1114
- _a_wrapper();
1115
- _a_paddingold();
1116
- _a_paddingnew();
1117
- _a_paddingcur();
1118
- break;
1119
- }
1120
-
1121
- sc_startScroll(scrl, conf);
1122
- cf_setCookie(opts.cookie, $cfs, conf);
1123
-
1124
- $cfs.trigger(cf_e('updatePageStatus', conf), [false, w_siz]);
1125
-
1126
- return true;
1127
- });
1128
-
1129
-
1130
- // next event
1131
- $cfs.bind(cf_e('slide_next', conf), function(e, sO, nI) {
1132
- e.stopPropagation();
1133
- var a_itm = $cfs.children();
1134
-
1135
- // non-circular at end, scroll to start
1136
- if (!opts.circular)
1137
- {
1138
- if (itms.first == opts.items.visible)
1139
- {
1140
- if (opts.infinite)
1141
- {
1142
- $cfs.trigger(cf_e('prev', conf), itms.total-1);
1143
- }
1144
- return e.stopImmediatePropagation();
1145
- }
1146
- }
1147
-
1148
- sz_resetMargin(a_itm, opts);
1149
-
1150
- // find number of items to scroll
1151
- if (!is_number(nI))
1152
- {
1153
- if (opts.items.filter != '*')
1154
- {
1155
- var xI = (is_number(sO.items)) ? sO.items : gn_getVisibleOrg($cfs, opts);
1156
- nI = gn_getScrollItemsNextFilter(a_itm, opts, 0, xI);
1157
- }
1158
- else
1159
- {
1160
- nI = opts.items.visible;
1161
- }
1162
- nI = cf_getAdjust(nI, opts, sO.items, $tt0);
1163
- }
1164
-
1165
- var lastItemNr = (itms.first == 0) ? itms.total : itms.first;
1166
-
1167
- // prevent non-circular from scrolling to far
1168
- if (!opts.circular)
1169
- {
1170
- if (opts.items.visibleConf.variable)
1171
- {
1172
- var vI = gn_getVisibleItemsNext(a_itm, opts, nI),
1173
- xI = gn_getVisibleItemsPrev(a_itm, opts, lastItemNr-1);
1174
- }
1175
- else
1176
- {
1177
- var vI = opts.items.visible,
1178
- xI = opts.items.visible;
1179
- }
1180
-
1181
- if (nI + vI > lastItemNr)
1182
- {
1183
- nI = lastItemNr - xI;
1184
- }
1185
- }
1186
-
1187
- // set new number of visible items
1188
- opts.items.visibleConf.old = opts.items.visible;
1189
- if (opts.items.visibleConf.variable)
1190
- {
1191
- var vI = cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(a_itm, opts, nI, lastItemNr), opts, opts.items.visibleConf.adjust, $tt0);
1192
- while (opts.items.visible-nI >= vI && nI < itms.total)
1193
- {
1194
- nI++;
1195
- vI = cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(a_itm, opts, nI, lastItemNr), opts, opts.items.visibleConf.adjust, $tt0);
1196
- }
1197
- opts.items.visible = vI;
1198
- }
1199
- else if (opts.items.filter != '*')
1200
- {
1201
- var vI = gn_getVisibleItemsNextFilter(a_itm, opts, nI);
1202
- opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0);
1203
- }
1204
-
1205
- sz_resetMargin(a_itm, opts, true);
1206
-
1207
- // scroll 0, don't scroll
1208
- if (nI == 0)
1209
- {
1210
- e.stopImmediatePropagation();
1211
- return debug(conf, '0 items to scroll: Not scrolling.');
1212
- }
1213
- debug(conf, 'Scrolling '+nI+' items forward.');
1214
-
1215
-
1216
- // save new config
1217
- itms.first -= nI;
1218
- while (itms.first < 0)
1219
- {
1220
- itms.first += itms.total;
1221
- }
1222
-
1223
- // non-circular callback
1224
- if (!opts.circular)
1225
- {
1226
- if (itms.first == opts.items.visible && sO.onEnd)
1227
- {
1228
- sO.onEnd.call($tt0, 'next');
1229
- }
1230
- if (!opts.infinite)
1231
- {
1232
- nv_enableNavi(opts, itms.first, conf);
1233
- }
1234
- }
1235
-
1236
- // rearrange items
1237
- if (itms.total < opts.items.visible+nI)
1238
- {
1239
- $cfs.children().slice(0, (opts.items.visible+nI)-itms.total).clone(true).appendTo($cfs);
1240
- }
1241
-
1242
- // the needed items
1243
- var a_itm = $cfs.children(),
1244
- i_old = gi_getOldItemsNext(a_itm, opts),
1245
- i_new = gi_getNewItemsNext(a_itm, opts, nI),
1246
- i_cur_l = a_itm.eq(nI-1),
1247
- i_old_l = i_old.last(),
1248
- i_new_l = i_new.last();
1249
-
1250
- sz_resetMargin(a_itm, opts);
1251
-
1252
- var pL = 0,
1253
- pR = 0;
1254
-
1255
- if (opts.align)
1256
- {
1257
- var p = cf_getAlignPadding(i_new, opts);
1258
- pL = p[0];
1259
- pR = p[1];
1260
- }
1261
-
1262
- // hide items for fx directscroll
1263
- var hiddenitems = false,
1264
- i_skp = $();
1265
- if (opts.items.visibleConf.old < nI)
1266
- {
1267
- i_skp = a_itm.slice(opts.items.visibleConf.old, nI);
1268
- if (sO.fx == 'directscroll')
1269
- {
1270
- var orgW = opts.items[opts.d['width']];
1271
- hiddenitems = i_skp;
1272
- i_cur_l = i_old_l;
1273
- sc_hideHiddenItems(hiddenitems);
1274
- opts.items[opts.d['width']] = 'variable';
1275
- }
1276
- }
1277
- // save new sizes
1278
- var $cf2 = false,
1279
- i_siz = ms_getTotalSize(a_itm.slice(0, nI), opts, 'width'),
1280
- w_siz = cf_mapWrapperSizes(ms_getSizes(i_new, opts, true), opts, !opts.usePadding),
1281
- i_siz_vis = 0,
1282
- a_cfs = {},
1283
- a_cfs_vis = {},
1284
- a_cur = {},
1285
- a_old = {},
1286
- a_lef = {},
1287
- a_dur = sc_getDuration(sO, opts, nI, i_siz);
1288
-
1289
- switch(sO.fx)
1290
- {
1291
- case 'uncover':
1292
- case 'uncover-fade':
1293
- i_siz_vis = ms_getTotalSize(a_itm.slice(0, opts.items.visibleConf.old), opts, 'width');
1294
- break;
1295
- }
1296
-
1297
- if (hiddenitems)
1298
- {
1299
- opts.items[opts.d['width']] = orgW;
1300
- }
1301
-
1302
- if (opts.align)
1303
- {
1304
- if (opts.padding[opts.d[1]] < 0)
1305
- {
1306
- opts.padding[opts.d[1]] = 0;
1307
- }
1308
- }
1309
- sz_resetMargin(a_itm, opts, true);
1310
- sz_resetMargin(i_old_l, opts, opts.padding[opts.d[1]]);
1311
-
1312
- if (opts.align)
1313
- {
1314
- opts.padding[opts.d[1]] = pR;
1315
- opts.padding[opts.d[3]] = pL;
1316
- }
1317
-
1318
- a_lef[opts.d['left']] = (opts.usePadding) ? opts.padding[opts.d[3]] : 0;
1319
-
1320
- // scrolling functions
1321
- var _s_wrapper = function() {},
1322
- _a_wrapper = function() {},
1323
- _s_paddingold = function() {},
1324
- _a_paddingold = function() {},
1325
- _s_paddingcur = function() {},
1326
- _a_paddingcur = function() {},
1327
- _onafter = function() {},
1328
- _moveitems = function() {},
1329
- _position = function() {};
1330
-
1331
- // clone carousel
1332
- switch(sO.fx)
1333
- {
1334
- case 'crossfade':
1335
- case 'cover':
1336
- case 'cover-fade':
1337
- case 'uncover':
1338
- case 'uncover-fade':
1339
- $cf2 = $cfs.clone(true).appendTo($wrp);
1340
- $cf2.children().slice(opts.items.visibleConf.old).remove();
1341
- break;
1342
- }
1343
- switch(sO.fx)
1344
- {
1345
- case 'crossfade':
1346
- case 'cover':
1347
- case 'cover-fade':
1348
- $cfs.css('zIndex', 1);
1349
- $cf2.css('zIndex', 0);
1350
- break;
1351
- }
1352
-
1353
- // reset all scrolls
1354
- scrl = sc_setScroll(a_dur, sO.easing, conf);
1355
-
1356
- // animate / set carousel
1357
- a_cfs[opts.d['left']] = -i_siz;
1358
- a_cfs_vis[opts.d['left']] = -i_siz_vis;
1359
-
1360
- if (pL < 0)
1361
- {
1362
- a_cfs[opts.d['left']] += pL;
1363
- }
1364
-
1365
- // animate / set wrapper
1366
- if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable')
1367
- {
1368
- _s_wrapper = function() {
1369
- $wrp.css(w_siz);
1370
- };
1371
- _a_wrapper = function() {
1372
- scrl.anims.push([$wrp, w_siz]);
1373
- };
1374
- }
1375
-
1376
- // animate / set items
1377
- if (opts.usePadding)
1378
- {
1379
- var i_new_l_m = i_new_l.data('_cfs_origCssMargin');
1380
-
1381
- if (pR >= 0)
1382
- {
1383
- i_new_l_m += opts.padding[opts.d[1]];
1384
- }
1385
- i_new_l.css(opts.d['marginRight'], i_new_l_m);
1386
-
1387
- if (i_cur_l.not(i_old_l).length)
1388
- {
1389
- a_old[opts.d['marginRight']] = i_old_l.data('_cfs_origCssMargin');
1390
- }
1391
- _s_paddingold = function() {
1392
- i_old_l.css(a_old);
1393
- };
1394
- _a_paddingold = function() {
1395
- scrl.anims.push([i_old_l, a_old]);
1396
- };
1397
-
1398
- var i_cur_l_m = i_cur_l.data('_cfs_origCssMargin');
1399
- if (pL > 0)
1400
- {
1401
- i_cur_l_m += opts.padding[opts.d[3]];
1402
- }
1403
-
1404
- a_cur[opts.d['marginRight']] = i_cur_l_m;
1405
-
1406
- _s_paddingcur = function() {
1407
- i_cur_l.css(a_cur);
1408
- };
1409
- _a_paddingcur = function() {
1410
- scrl.anims.push([i_cur_l, a_cur]);
1411
- };
1412
- }
1413
-
1414
- // set position
1415
- _position = function() {
1416
- $cfs.css(a_lef);
1417
- };
1418
-
1419
-
1420
- var overFill = opts.items.visible+nI-itms.total;
1421
-
1422
- // rearrange items
1423
- _moveitems = function() {
1424
- if (overFill > 0)
1425
- {
1426
- $cfs.children().slice(itms.total).remove();
1427
- }
1428
- var l_itm = $cfs.children().slice(0, nI).appendTo($cfs).last();
1429
- if (overFill > 0)
1430
- {
1431
- i_new = gi_getCurrentItems(a_itm, opts);
1432
- }
1433
- sc_showHiddenItems(hiddenitems);
1434
-
1435
- if (opts.usePadding)
1436
- {
1437
- if (itms.total < opts.items.visible+nI) {
1438
- var i_cur_l = $cfs.children().eq(opts.items.visible-1);
1439
- i_cur_l.css(opts.d['marginRight'], i_cur_l.data('_cfs_origCssMargin') + opts.padding[opts.d[1]]);
1440
- }
1441
- l_itm.css(opts.d['marginRight'], l_itm.data('_cfs_origCssMargin'));
1442
- }
1443
- };
1444
-
1445
-
1446
- var cb_arguments = sc_mapCallbackArguments(i_old, i_skp, i_new, nI, 'next', a_dur, w_siz);
1447
-
1448
- // fire onAfter callbacks
1449
- _onafter = function() {
1450
- $cfs.css('zIndex', $cfs.data('_cfs_origCssZindex'));
1451
- sc_afterScroll($cfs, $cf2, sO);
1452
- crsl.isScrolling = false;
1453
- clbk.onAfter = sc_fireCallbacks($tt0, sO, 'onAfter', cb_arguments, clbk);
1454
- queu = sc_fireQueue($cfs, queu, conf);
1455
-
1456
- if (!crsl.isPaused)
1457
- {
1458
- $cfs.trigger(cf_e('play', conf));
1459
- }
1460
- };
1461
-
1462
- // fire onBefore callbacks
1463
- crsl.isScrolling = true;
1464
- tmrs = sc_clearTimers(tmrs);
1465
- clbk.onBefore = sc_fireCallbacks($tt0, sO, 'onBefore', cb_arguments, clbk);
1466
-
1467
- switch(sO.fx)
1468
- {
1469
- case 'none':
1470
- $cfs.css(a_cfs);
1471
- _s_wrapper();
1472
- _s_paddingold();
1473
- _s_paddingcur();
1474
- _position();
1475
- _moveitems();
1476
- _onafter();
1477
- break;
1478
-
1479
- case 'fade':
1480
- scrl.anims.push([$cfs, { 'opacity': 0 }, function() {
1481
- _s_wrapper();
1482
- _s_paddingold();
1483
- _s_paddingcur();
1484
- _position();
1485
- _moveitems();
1486
- scrl = sc_setScroll(a_dur, sO.easing, conf);
1487
- scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]);
1488
- sc_startScroll(scrl, conf);
1489
- }]);
1490
- break;
1491
-
1492
- case 'crossfade':
1493
- $cfs.css({ 'opacity': 0 });
1494
- scrl.anims.push([$cf2, { 'opacity': 0 }]);
1495
- scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]);
1496
- _a_wrapper();
1497
- _s_paddingold();
1498
- _s_paddingcur();
1499
- _position();
1500
- _moveitems();
1501
- break;
1502
-
1503
- case 'cover':
1504
- $cfs.css(opts.d['left'], $wrp[opts.d['width']]());
1505
- scrl.anims.push([$cfs, a_lef, _onafter]);
1506
- _a_wrapper();
1507
- _s_paddingold();
1508
- _s_paddingcur();
1509
- _moveitems();
1510
- break;
1511
-
1512
- case 'cover-fade':
1513
- $cfs.css(opts.d['left'], $wrp[opts.d['width']]());
1514
- scrl.anims.push([$cf2, { 'opacity': 0 }]);
1515
- scrl.anims.push([$cfs, a_lef, _onafter]);
1516
- _a_wrapper();
1517
- _s_paddingold();
1518
- _s_paddingcur();
1519
- _moveitems();
1520
- break;
1521
-
1522
- case 'uncover':
1523
- scrl.anims.push([$cf2, a_cfs_vis, _onafter]);
1524
- _a_wrapper();
1525
- _s_paddingold();
1526
- _s_paddingcur();
1527
- _position();
1528
- _moveitems();
1529
- break;
1530
-
1531
- case 'uncover-fade':
1532
- $cfs.css({ 'opacity': 0 });
1533
- scrl.anims.push([$cfs, { 'opacity': 1 }]);
1534
- scrl.anims.push([$cf2, a_cfs_vis, _onafter]);
1535
- _a_wrapper();
1536
- _s_paddingold();
1537
- _s_paddingcur();
1538
- _position();
1539
- _moveitems();
1540
- break;
1541
-
1542
- default:
1543
- scrl.anims.push([$cfs, a_cfs, function() {
1544
- _position();
1545
- _moveitems();
1546
- _onafter();
1547
- }]);
1548
- _a_wrapper();
1549
- _a_paddingold();
1550
- _a_paddingcur();
1551
- break;
1552
- }
1553
-
1554
- sc_startScroll(scrl, conf);
1555
- cf_setCookie(opts.cookie, $cfs, conf);
1556
-
1557
- $cfs.trigger(cf_e('updatePageStatus', conf), [false, w_siz]);
1558
-
1559
- return true;
1560
- });
1561
-
1562
-
1563
- // slideTo event
1564
- $cfs.bind(cf_e('slideTo', conf), function(e, num, dev, org, obj, dir, clb) {
1565
- e.stopPropagation();
1566
-
1567
- var v = [num, dev, org, obj, dir, clb],
1568
- t = ['string/number/object', 'number', 'boolean', 'object', 'string', 'function'],
1569
- a = cf_sortParams(v, t);
1570
-
1571
- obj = a[3];
1572
- dir = a[4];
1573
- clb = a[5];
1574
-
1575
- num = gn_getItemIndex(a[0], a[1], a[2], itms, $cfs);
1576
-
1577
- if (num == 0)
1578
- {
1579
- return false;
1580
- }
1581
- if (!is_object(obj))
1582
- {
1583
- obj = false;
1584
- }
1585
-
1586
- if (dir != 'prev' && dir != 'next')
1587
- {
1588
- if (opts.circular)
1589
- {
1590
- dir = (num <= itms.total / 2) ? 'next' : 'prev';
1591
- }
1592
- else
1593
- {
1594
- dir = (itms.first == 0 || itms.first > num) ? 'next' : 'prev';
1595
- }
1596
- }
1597
-
1598
- if (dir == 'prev')
1599
- {
1600
- num = itms.total-num;
1601
- }
1602
- $cfs.trigger(cf_e(dir, conf), [obj, num, clb]);
1603
-
1604
- return true;
1605
- });
1606
-
1607
-
1608
- // prevPage event
1609
- $cfs.bind(cf_e('prevPage', conf), function(e, obj, clb) {
1610
- e.stopPropagation();
1611
- var cur = $cfs.triggerHandler(cf_e('currentPage', conf));
1612
- return $cfs.triggerHandler(cf_e('slideToPage', conf), [cur-1, obj, 'prev', clb]);
1613
- });
1614
-
1615
-
1616
- // nextPage event
1617
- $cfs.bind(cf_e('nextPage', conf), function(e, obj, clb) {
1618
- e.stopPropagation();
1619
- var cur = $cfs.triggerHandler(cf_e('currentPage', conf));
1620
- return $cfs.triggerHandler(cf_e('slideToPage', conf), [cur+1, obj, 'next', clb]);
1621
- });
1622
-
1623
-
1624
- // slideToPage event
1625
- $cfs.bind(cf_e('slideToPage', conf), function(e, pag, obj, dir, clb) {
1626
- e.stopPropagation();
1627
- if (!is_number(pag))
1628
- {
1629
- pag = $cfs.triggerHandler(cf_e('currentPage', conf));
1630
- }
1631
- var ipp = opts.pagination.items || opts.items.visible,
1632
- max = Math.ceil(itms.total / ipp)-1;
1633
-
1634
- if (pag < 0)
1635
- {
1636
- pag = max;
1637
- }
1638
- if (pag > max)
1639
- {
1640
- pag = 0;
1641
- }
1642
- return $cfs.triggerHandler(cf_e('slideTo', conf), [pag*ipp, 0, true, obj, dir, clb]);
1643
- });
1644
-
1645
- // jumpToStart event
1646
- $cfs.bind(cf_e('jumpToStart', conf), function(e, s) {
1647
- e.stopPropagation();
1648
- if (s)
1649
- {
1650
- s = gn_getItemIndex(s, 0, true, itms, $cfs);
1651
- }
1652
- else
1653
- {
1654
- s = 0;
1655
- }
1656
-
1657
- s += itms.first;
1658
- if (s != 0)
1659
- {
1660
- if (itms.total > 0)
1661
- {
1662
- while (s > itms.total)
1663
- {
1664
- s -= itms.total;
1665
- }
1666
- }
1667
- $cfs.prepend($cfs.children().slice(s, itms.total));
1668
- }
1669
- return true;
1670
- });
1671
-
1672
-
1673
- // synchronise event
1674
- $cfs.bind(cf_e('synchronise', conf), function(e, s) {
1675
- e.stopPropagation();
1676
- if (s)
1677
- {
1678
- s = cf_getSynchArr(s);
1679
- }
1680
- else if (opts.synchronise)
1681
- {
1682
- s = opts.synchronise;
1683
- }
1684
- else
1685
- {
1686
- return debug(conf, 'No carousel to synchronise.');
1687
- }
1688
-
1689
- var n = $cfs.triggerHandler(cf_e('currentPosition', conf)),
1690
- x = true;
1691
-
1692
- for (var j = 0, l = s.length; j < l; j++)
1693
- {
1694
- if (!s[j][0].triggerHandler(cf_e('slideTo', conf), [n, s[j][3], true]))
1695
- {
1696
- x = false;
1697
- }
1698
- }
1699
- return x;
1700
- });
1701
-
1702
-
1703
- // queue event
1704
- $cfs.bind(cf_e('queue', conf), function(e, dir, opt) {
1705
- e.stopPropagation();
1706
- if (is_function(dir))
1707
- {
1708
- dir.call($tt0, queu);
1709
- }
1710
- else if (is_array(dir))
1711
- {
1712
- queu = dir;
1713
- }
1714
- else if (!is_undefined(dir))
1715
- {
1716
- queu.push([dir, opt]);
1717
- }
1718
- return queu;
1719
- });
1720
-
1721
-
1722
- // insertItem event
1723
- $cfs.bind(cf_e('insertItem', conf), function(e, itm, num, org, dev) {
1724
- e.stopPropagation();
1725
-
1726
- var v = [itm, num, org, dev],
1727
- t = ['string/object', 'string/number/object', 'boolean', 'number'],
1728
- a = cf_sortParams(v, t);
1729
-
1730
- itm = a[0];
1731
- num = a[1];
1732
- org = a[2];
1733
- dev = a[3];
1734
-
1735
- if (is_object(itm) && !is_jquery(itm))
1736
- {
1737
- itm = $(itm);
1738
- }
1739
- else if (is_string(itm))
1740
- {
1741
- itm = $(itm);
1742
- }
1743
- if (!is_jquery(itm) || itm.length == 0)
1744
- {
1745
- return debug(conf, 'Not a valid object.');
1746
- }
1747
-
1748
- if (is_undefined(num))
1749
- {
1750
- num = 'end';
1751
- }
1752
-
1753
- sz_storeMargin(itm, opts);
1754
- sz_storeOrigCss(itm);
1755
-
1756
- var orgNum = num,
1757
- before = 'before';
1758
-
1759
- if (num == 'end')
1760
- {
1761
- if (org)
1762
- {
1763
- if (itms.first == 0)
1764
- {
1765
- num = itms.total-1;
1766
- before = 'after';
1767
- }
1768
- else
1769
- {
1770
- num = itms.first;
1771
- itms.first += itm.length;
1772
- }
1773
- if (num < 0)
1774
- {
1775
- num = 0;
1776
- }
1777
- }
1778
- else
1779
- {
1780
- num = itms.total-1;
1781
- before = 'after';
1782
- }
1783
- }
1784
- else
1785
- {
1786
- num = gn_getItemIndex(num, dev, org, itms, $cfs);
1787
- }
1788
-
1789
- var $cit = $cfs.children().eq(num);
1790
- if ($cit.length)
1791
- {
1792
- $cit[before](itm);
1793
- }
1794
- else
1795
- {
1796
- debug(conf, 'Correct insert-position not found! Appending item to the end.');
1797
- $cfs.append(itm);
1798
- }
1799
-
1800
- if (orgNum != 'end' && !org)
1801
- {
1802
- if (num < itms.first)
1803
- {
1804
- itms.first += itm.length;
1805
- }
1806
- }
1807
- itms.total = $cfs.children().length;
1808
- if (itms.first >= itms.total)
1809
- {
1810
- itms.first -= itms.total;
1811
- }
1812
-
1813
- $cfs.trigger(cf_e('updateSizes', conf));
1814
- $cfs.trigger(cf_e('linkAnchors', conf));
1815
-
1816
- return true;
1817
- });
1818
-
1819
-
1820
- // removeItem event
1821
- $cfs.bind(cf_e('removeItem', conf), function(e, num, org, dev) {
1822
- e.stopPropagation();
1823
-
1824
- var v = [num, org, dev],
1825
- t = ['string/number/object', 'boolean', 'number'],
1826
- a = cf_sortParams(v, t);
1827
-
1828
- num = a[0];
1829
- org = a[1];
1830
- dev = a[2];
1831
-
1832
- var removed = false;
1833
-
1834
- if (num instanceof $ && num.length > 1)
1835
- {
1836
- $removed = $();
1837
- num.each(function(i, el) {
1838
- var $rem = $cfs.trigger(cf_e('removeItem', conf), [$(this), org, dev]);
1839
- if ( $rem )
1840
- {
1841
- $removed = $removed.add($rem);
1842
- }
1843
- });
1844
- return $removed;
1845
- }
1846
-
1847
- if (is_undefined(num) || num == 'end')
1848
- {
1849
- $removed = $cfs.children().last();
1850
- }
1851
- else
1852
- {
1853
- num = gn_getItemIndex(num, dev, org, itms, $cfs);
1854
- var $removed = $cfs.children().eq(num);
1855
- if ( $removed.length )
1856
- {
1857
- if (num < itms.first)
1858
- {
1859
- itms.first -= $removed.length;
1860
- }
1861
- }
1862
- }
1863
- if ( $removed && $removed.length )
1864
- {
1865
- $removed.detach();
1866
- itms.total = $cfs.children().length;
1867
- $cfs.trigger(cf_e('updateSizes', conf));
1868
- }
1869
-
1870
- return $removed;
1871
- });
1872
-
1873
-
1874
- // onBefore and onAfter event
1875
- $cfs.bind(cf_e('onBefore', conf)+' '+cf_e('onAfter', conf), function(e, fn) {
1876
- e.stopPropagation();
1877
- var eType = e.type.slice(conf.events.prefix.length);
1878
- if (is_array(fn))
1879
- {
1880
- clbk[eType] = fn;
1881
- }
1882
- if (is_function(fn))
1883
- {
1884
- clbk[eType].push(fn);
1885
- }
1886
- return clbk[eType];
1887
- });
1888
-
1889
-
1890
- // currentPosition event
1891
- $cfs.bind(cf_e('currentPosition', conf), function(e, fn) {
1892
- e.stopPropagation();
1893
- if (itms.first == 0)
1894
- {
1895
- var val = 0;
1896
- }
1897
- else
1898
- {
1899
- var val = itms.total - itms.first;
1900
- }
1901
- if (is_function(fn))
1902
- {
1903
- fn.call($tt0, val);
1904
- }
1905
- return val;
1906
- });
1907
-
1908
-
1909
- // currentPage event
1910
- $cfs.bind(cf_e('currentPage', conf), function(e, fn) {
1911
- e.stopPropagation();
1912
- var ipp = opts.pagination.items || opts.items.visible,
1913
- max = Math.ceil(itms.total/ipp-1),
1914
- nr;
1915
- if (itms.first == 0)
1916
- {
1917
- nr = 0;
1918
- }
1919
- else if (itms.first < itms.total % ipp)
1920
- {
1921
- nr = 0;
1922
- }
1923
- else if (itms.first == ipp && !opts.circular)
1924
- {
1925
- nr = max;
1926
- }
1927
- else
1928
- {
1929
- nr = Math.round((itms.total-itms.first)/ipp);
1930
- }
1931
- if (nr < 0)
1932
- {
1933
- nr = 0;
1934
- }
1935
- if (nr > max)
1936
- {
1937
- nr = max;
1938
- }
1939
- if (is_function(fn))
1940
- {
1941
- fn.call($tt0, nr);
1942
- }
1943
- return nr;
1944
- });
1945
-
1946
-
1947
- // currentVisible event
1948
- $cfs.bind(cf_e('currentVisible', conf), function(e, fn) {
1949
- e.stopPropagation();
1950
- var $i = gi_getCurrentItems($cfs.children(), opts);
1951
- if (is_function(fn))
1952
- {
1953
- fn.call($tt0, $i);
1954
- }
1955
- return $i;
1956
- });
1957
-
1958
-
1959
- // slice event
1960
- $cfs.bind(cf_e('slice', conf), function(e, f, l, fn) {
1961
- e.stopPropagation();
1962
-
1963
- if (itms.total == 0)
1964
- {
1965
- return false;
1966
- }
1967
-
1968
- var v = [f, l, fn],
1969
- t = ['number', 'number', 'function'],
1970
- a = cf_sortParams(v, t);
1971
-
1972
- f = (is_number(a[0])) ? a[0] : 0;
1973
- l = (is_number(a[1])) ? a[1] : itms.total;
1974
- fn = a[2];
1975
-
1976
- f += itms.first;
1977
- l += itms.first;
1978
-
1979
- if (items.total > 0)
1980
- {
1981
- while (f > itms.total)
1982
- {
1983
- f -= itms.total;
1984
- }
1985
- while (l > itms.total)
1986
- {
1987
- l -= itms.total;
1988
- }
1989
- while (f < 0)
1990
- {
1991
- f += itms.total;
1992
- }
1993
- while (l < 0)
1994
- {
1995
- l += itms.total;
1996
- }
1997
- }
1998
- var $iA = $cfs.children(),
1999
- $i;
2000
-
2001
- if (l > f)
2002
- {
2003
- $i = $iA.slice(f, l);
2004
- }
2005
- else
2006
- {
2007
- $i = $( $iA.slice(f, itms.total).get().concat( $iA.slice(0, l).get() ) );
2008
- }
2009
-
2010
- if (is_function(fn))
2011
- {
2012
- fn.call($tt0, $i);
2013
- }
2014
- return $i;
2015
- });
2016
-
2017
-
2018
- // isPaused, isStopped and isScrolling events
2019
- $cfs.bind(cf_e('isPaused', conf)+' '+cf_e('isStopped', conf)+' '+cf_e('isScrolling', conf), function(e, fn) {
2020
- e.stopPropagation();
2021
- var eType = e.type.slice(conf.events.prefix.length),
2022
- value = crsl[eType];
2023
- if (is_function(fn))
2024
- {
2025
- fn.call($tt0, value);
2026
- }
2027
- return value;
2028
- });
2029
-
2030
-
2031
- // configuration event
2032
- $cfs.bind(cf_e('configuration', conf), function(e, a, b, c) {
2033
- e.stopPropagation();
2034
- var reInit = false;
2035
-
2036
- // return entire configuration-object
2037
- if (is_function(a))
2038
- {
2039
- a.call($tt0, opts);
2040
- }
2041
- // set multiple options via object
2042
- else if (is_object(a))
2043
- {
2044
- opts_orig = $.extend(true, {}, opts_orig, a);
2045
- if (b !== false) reInit = true;
2046
- else opts = $.extend(true, {}, opts, a);
2047
-
2048
- }
2049
- else if (!is_undefined(a))
2050
- {
2051
-
2052
- // callback function for specific option
2053
- if (is_function(b))
2054
- {
2055
- var val = eval('opts.'+a);
2056
- if (is_undefined(val))
2057
- {
2058
- val = '';
2059
- }
2060
- b.call($tt0, val);
2061
- }
2062
- // set individual option
2063
- else if (!is_undefined(b))
2064
- {
2065
- if (typeof c !== 'boolean') c = true;
2066
- eval('opts_orig.'+a+' = b');
2067
- if (c !== false) reInit = true;
2068
- else eval('opts.'+a+' = b');
2069
- }
2070
- // return value for specific option
2071
- else
2072
- {
2073
- return eval('opts.'+a);
2074
- }
2075
- }
2076
- if (reInit)
2077
- {
2078
- sz_resetMargin($cfs.children(), opts);
2079
- FN._init(opts_orig);
2080
- FN._bind_buttons();
2081
- var sz = sz_setSizes($cfs, opts);
2082
- $cfs.trigger(cf_e('updatePageStatus', conf), [true, sz]);
2083
- }
2084
- return opts;
2085
- });
2086
-
2087
-
2088
- // linkAnchors event
2089
- $cfs.bind(cf_e('linkAnchors', conf), function(e, $con, sel) {
2090
- e.stopPropagation();
2091
-
2092
- if (is_undefined($con))
2093
- {
2094
- $con = $('body');
2095
- }
2096
- else if (is_string($con))
2097
- {
2098
- $con = $($con);
2099
- }
2100
- if (!is_jquery($con) || $con.length == 0)
2101
- {
2102
- return debug(conf, 'Not a valid object.');
2103
- }
2104
- if (!is_string(sel))
2105
- {
2106
- sel = 'a.caroufredsel';
2107
- }
2108
-
2109
- $con.find(sel).each(function() {
2110
- var h = this.hash || '';
2111
- if (h.length > 0 && $cfs.children().index($(h)) != -1)
2112
- {
2113
- $(this).unbind('click').click(function(e) {
2114
- e.preventDefault();
2115
- $cfs.trigger(cf_e('slideTo', conf), h);
2116
- });
2117
- }
2118
- });
2119
- return true;
2120
- });
2121
-
2122
-
2123
- // updatePageStatus event
2124
- $cfs.bind(cf_e('updatePageStatus', conf), function(e, build, sizes) {
2125
- e.stopPropagation();
2126
- if (!opts.pagination.container)
2127
- {
2128
- return;
2129
- }
2130
-
2131
- var ipp = opts.pagination.items || opts.items.visible,
2132
- pgs = Math.ceil(itms.total/ipp);
2133
-
2134
- if (build)
2135
- {
2136
- if (opts.pagination.anchorBuilder)
2137
- {
2138
- opts.pagination.container.children().remove();
2139
- opts.pagination.container.each(function() {
2140
- for (var a = 0; a < pgs; a++)
2141
- {
2142
- var i = $cfs.children().eq( gn_getItemIndex(a*ipp, 0, true, itms, $cfs) );
2143
- $(this).append(opts.pagination.anchorBuilder.call(i[0], a+1));
2144
- }
2145
- });
2146
- }
2147
- opts.pagination.container.each(function() {
2148
- $(this).children().unbind(opts.pagination.event).each(function(a) {
2149
- $(this).bind(opts.pagination.event, function(e) {
2150
- e.preventDefault();
2151
- $cfs.trigger(cf_e('slideTo', conf), [a*ipp, -opts.pagination.deviation, true, opts.pagination]);
2152
- });
2153
- });
2154
- });
2155
- }
2156
-
2157
- var selected = $cfs.triggerHandler(cf_e('currentPage', conf)) + opts.pagination.deviation;
2158
- if (selected >= pgs)
2159
- {
2160
- selected = 0;
2161
- }
2162
- if (selected < 0)
2163
- {
2164
- selected = pgs-1;
2165
- }
2166
- opts.pagination.container.each(function() {
2167
- $(this).children().removeClass(cf_c('selected', conf)).eq(selected).addClass(cf_c('selected', conf));
2168
- });
2169
- return true;
2170
- });
2171
-
2172
-
2173
- // updateSizes event
2174
- $cfs.bind(cf_e('updateSizes', conf), function(e) {
2175
- var vI = opts.items.visible,
2176
- a_itm = $cfs.children(),
2177
- avail_primary = ms_getParentSize($wrp, opts, 'width');
2178
-
2179
- itms.total = a_itm.length;
2180
-
2181
- if (crsl.primarySizePercentage)
2182
- {
2183
- opts.maxDimension = avail_primary;
2184
- opts[opts.d['width']] = ms_getPercentage(avail_primary, crsl.primarySizePercentage);
2185
- }
2186
- else
2187
- {
2188
- opts.maxDimension = ms_getMaxDimension(opts, avail_primary);
2189
- }
2190
-
2191
- if (opts.responsive)
2192
- {
2193
- opts.items.width = opts.items.sizesConf.width;
2194
- opts.items.height = opts.items.sizesConf.height;
2195
- opts = in_getResponsiveValues(opts, a_itm, avail_primary);
2196
- vI = opts.items.visible;
2197
- sz_setResponsiveSizes(opts, a_itm);
2198
- }
2199
- else if (opts.items.visibleConf.variable)
2200
- {
2201
- vI = gn_getVisibleItemsNext(a_itm, opts, 0);
2202
- }
2203
- else if (opts.items.filter != '*')
2204
- {
2205
- vI = gn_getVisibleItemsNextFilter(a_itm, opts, 0);
2206
- }
2207
-
2208
- if (!opts.circular && itms.first != 0 && vI > itms.first) {
2209
- if (opts.items.visibleConf.variable)
2210
- {
2211
- var nI = gn_getVisibleItemsPrev(a_itm, opts, itms.first) - itms.first;
2212
- }
2213
- else if (opts.items.filter != '*')
2214
- {
2215
- var nI = gn_getVisibleItemsPrevFilter(a_itm, opts, itms.first) - itms.first;
2216
- }
2217
- else
2218
- {
2219
- var nI = opts.items.visible - itms.first;
2220
- }
2221
- debug(conf, 'Preventing non-circular: sliding '+nI+' items backward.');
2222
- $cfs.trigger(cf_e('prev', conf), nI);
2223
- }
2224
-
2225
- opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0);
2226
- opts.items.visibleConf.old = opts.items.visible;
2227
- opts = in_getAlignPadding(opts, a_itm);
2228
-
2229
- var sz = sz_setSizes($cfs, opts);
2230
- $cfs.trigger(cf_e('updatePageStatus', conf), [true, sz]);
2231
- nv_showNavi(opts, itms.total, conf);
2232
- nv_enableNavi(opts, itms.first, conf);
2233
-
2234
- return sz;
2235
- });
2236
-
2237
-
2238
- // destroy event
2239
- $cfs.bind(cf_e('destroy', conf), function(e, orgOrder) {
2240
- e.stopPropagation();
2241
- tmrs = sc_clearTimers(tmrs);
2242
-
2243
- $cfs.data('_cfs_isCarousel', false);
2244
- $cfs.trigger(cf_e('finish', conf));
2245
- if (orgOrder)
2246
- {
2247
- $cfs.trigger(cf_e('jumpToStart', conf));
2248
- }
2249
- sz_restoreOrigCss($cfs.children());
2250
- sz_restoreOrigCss($cfs);
2251
- FN._unbind_events();
2252
- FN._unbind_buttons();
2253
- if (conf.wrapper == 'parent')
2254
- {
2255
- sz_restoreOrigCss($wrp);
2256
- }
2257
- else
2258
- {
2259
- $wrp.replaceWith($cfs);
2260
- }
2261
-
2262
- return true;
2263
- });
2264
-
2265
-
2266
- // debug event
2267
- $cfs.bind(cf_e('debug', conf), function(e) {
2268
- debug(conf, 'Carousel width: ' + opts.width);
2269
- debug(conf, 'Carousel height: ' + opts.height);
2270
- debug(conf, 'Item widths: ' + opts.items.width);
2271
- debug(conf, 'Item heights: ' + opts.items.height);
2272
- debug(conf, 'Number of items visible: ' + opts.items.visible);
2273
- if (opts.auto.play)
2274
- {
2275
- debug(conf, 'Number of items scrolled automatically: ' + opts.auto.items);
2276
- }
2277
- if (opts.prev.button)
2278
- {
2279
- debug(conf, 'Number of items scrolled backward: ' + opts.prev.items);
2280
- }
2281
- if (opts.next.button)
2282
- {
2283
- debug(conf, 'Number of items scrolled forward: ' + opts.next.items);
2284
- }
2285
- return conf.debug;
2286
- });
2287
-
2288
-
2289
- // triggerEvent, making prefixed and namespaced events accessible from outside
2290
- $cfs.bind('_cfs_triggerEvent', function(e, n, o) {
2291
- e.stopPropagation();
2292
- return $cfs.triggerHandler(cf_e(n, conf), o);
2293
- });
2294
- }; // /bind_events
2295
-
2296
-
2297
- FN._unbind_events = function() {
2298
- $cfs.unbind(cf_e('', conf));
2299
- $cfs.unbind(cf_e('', conf, false));
2300
- $cfs.unbind('_cfs_triggerEvent');
2301
- }; // /unbind_events
2302
-
2303
-
2304
- FN._bind_buttons = function() {
2305
- FN._unbind_buttons();
2306
- nv_showNavi(opts, itms.total, conf);
2307
- nv_enableNavi(opts, itms.first, conf);
2308
-
2309
- if (opts.auto.pauseOnHover)
2310
- {
2311
- var pC = bt_pauseOnHoverConfig(opts.auto.pauseOnHover);
2312
- $wrp.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); })
2313
- .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); });
2314
- }
2315
-
2316
- // play button
2317
- if (opts.auto.button)
2318
- {
2319
- opts.auto.button.bind(cf_e(opts.auto.event, conf, false), function(e) {
2320
- e.preventDefault();
2321
- var ev = false,
2322
- pC = null;
2323
-
2324
- if (crsl.isPaused)
2325
- {
2326
- ev = 'play';
2327
- }
2328
- else if (opts.auto.pauseOnEvent)
2329
- {
2330
- ev = 'pause';
2331
- pC = bt_pauseOnHoverConfig(opts.auto.pauseOnEvent);
2332
- }
2333
- if (ev)
2334
- {
2335
- $cfs.trigger(cf_e(ev, conf), pC);
2336
- }
2337
- });
2338
- }
2339
-
2340
- // prev button
2341
- if (opts.prev.button)
2342
- {
2343
- opts.prev.button.bind(cf_e(opts.prev.event, conf, false), function(e) {
2344
- e.preventDefault();
2345
- $cfs.trigger(cf_e('prev', conf));
2346
- });
2347
- if (opts.prev.pauseOnHover)
2348
- {
2349
- var pC = bt_pauseOnHoverConfig(opts.prev.pauseOnHover);
2350
- opts.prev.button.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); })
2351
- .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); });
2352
- }
2353
- }
2354
-
2355
- // next butotn
2356
- if (opts.next.button)
2357
- {
2358
- opts.next.button.bind(cf_e(opts.next.event, conf, false), function(e) {
2359
- e.preventDefault();
2360
- $cfs.trigger(cf_e('next', conf));
2361
- });
2362
- if (opts.next.pauseOnHover)
2363
- {
2364
- var pC = bt_pauseOnHoverConfig(opts.next.pauseOnHover);
2365
- opts.next.button.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); })
2366
- .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); });
2367
- }
2368
- }
2369
-
2370
- // pagination
2371
- if (opts.pagination.container)
2372
- {
2373
- if (opts.pagination.pauseOnHover)
2374
- {
2375
- var pC = bt_pauseOnHoverConfig(opts.pagination.pauseOnHover);
2376
- opts.pagination.container.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); })
2377
- .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); });
2378
- }
2379
- }
2380
-
2381
- // prev/next keys
2382
- if (opts.prev.key || opts.next.key)
2383
- {
2384
- $(document).bind(cf_e('keyup', conf, false, true, true), function(e) {
2385
- var k = e.keyCode;
2386
- if (k == opts.next.key)
2387
- {
2388
- e.preventDefault();
2389
- $cfs.trigger(cf_e('next', conf));
2390
- }
2391
- if (k == opts.prev.key)
2392
- {
2393
- e.preventDefault();
2394
- $cfs.trigger(cf_e('prev', conf));
2395
- }
2396
- });
2397
- }
2398
-
2399
- // pagination keys
2400
- if (opts.pagination.keys)
2401
- {
2402
- $(document).bind(cf_e('keyup', conf, false, true, true), function(e) {
2403
- var k = e.keyCode;
2404
- if (k >= 49 && k < 58)
2405
- {
2406
- k = (k-49) * opts.items.visible;
2407
- if (k <= itms.total)
2408
- {
2409
- e.preventDefault();
2410
- $cfs.trigger(cf_e('slideTo', conf), [k, 0, true, opts.pagination]);
2411
- }
2412
- }
2413
- });
2414
- }
2415
-
2416
- // swipe
2417
- if ($.fn.swipe)
2418
- {
2419
- var isTouch = 'ontouchstart' in window;
2420
- if ((isTouch && opts.swipe.onTouch) || (!isTouch && opts.swipe.onMouse))
2421
- {
2422
- var scP = $.extend(true, {}, opts.prev, opts.swipe),
2423
- scN = $.extend(true, {}, opts.next, opts.swipe),
2424
- swP = function() { $cfs.trigger(cf_e('prev', conf), [scP]) },
2425
- swN = function() { $cfs.trigger(cf_e('next', conf), [scN]) };
2426
-
2427
- switch (opts.direction)
2428
- {
2429
- case 'up':
2430
- case 'down':
2431
- opts.swipe.options.swipeUp = swN;
2432
- opts.swipe.options.swipeDown = swP;
2433
- break;
2434
- default:
2435
- opts.swipe.options.swipeLeft = swN;
2436
- opts.swipe.options.swipeRight = swP;
2437
- }
2438
- if (crsl.swipe)
2439
- {
2440
- $cfs.swipe('destroy');
2441
- }
2442
- $wrp.swipe(opts.swipe.options);
2443
- $wrp.css('cursor', 'move');
2444
- crsl.swipe = true;
2445
- }
2446
- }
2447
-
2448
- // mousewheel
2449
- if ($.fn.mousewheel)
2450
- {
2451
-
2452
- if (opts.mousewheel)
2453
- {
2454
- var mcP = $.extend(true, {}, opts.prev, opts.mousewheel),
2455
- mcN = $.extend(true, {}, opts.next, opts.mousewheel);
2456
-
2457
- if (crsl.mousewheel)
2458
- {
2459
- $wrp.unbind(cf_e('mousewheel', conf, false));
2460
- }
2461
- $wrp.bind(cf_e('mousewheel', conf, false), function(e, delta) {
2462
- e.preventDefault();
2463
- if (delta > 0)
2464
- {
2465
- $cfs.trigger(cf_e('prev', conf), [mcP]);
2466
- }
2467
- else
2468
- {
2469
- $cfs.trigger(cf_e('next', conf), [mcN]);
2470
- }
2471
- });
2472
- crsl.mousewheel = true;
2473
- }
2474
- }
2475
-
2476
- if (opts.auto.play)
2477
- {
2478
- $cfs.trigger(cf_e('play', conf), opts.auto.delay);
2479
- }
2480
-
2481
- if (crsl.upDateOnWindowResize)
2482
- {
2483
- var resizeFn = function(e) {
2484
- $cfs.trigger(cf_e('finish', conf));
2485
- if (opts.auto.pauseOnResize && !crsl.isPaused)
2486
- {
2487
- $cfs.trigger(cf_e('play', conf));
2488
- }
2489
- sz_resetMargin($cfs.children(), opts);
2490
- $cfs.trigger(cf_e('updateSizes', conf));
2491
- };
2492
-
2493
- var $w = $(window),
2494
- onResize = null;
2495
-
2496
- if ($.debounce && conf.onWindowResize == 'debounce')
2497
- {
2498
- onResize = $.debounce(200, resizeFn);
2499
- }
2500
- else if ($.throttle && conf.onWindowResize == 'throttle')
2501
- {
2502
- onResize = $.throttle(300, resizeFn);
2503
- }
2504
- else
2505
- {
2506
- var _windowWidth = 0,
2507
- _windowHeight = 0;
2508
-
2509
- onResize = function() {
2510
- var nw = $w.width(),
2511
- nh = $w.height();
2512
-
2513
- if (nw != _windowWidth || nh != _windowHeight)
2514
- {
2515
- resizeFn();
2516
- _windowWidth = nw;
2517
- _windowHeight = nh;
2518
- }
2519
- };
2520
- }
2521
- $w.bind(cf_e('resize', conf, false, true, true), onResize);
2522
- }
2523
- }; // /bind_buttons
2524
-
2525
-
2526
- FN._unbind_buttons = function() {
2527
- var ns1 = cf_e('', conf),
2528
- ns2 = cf_e('', conf, false);
2529
- ns3 = cf_e('', conf, false, true, true);
2530
-
2531
- $(document).unbind(ns3);
2532
- $(window).unbind(ns3);
2533
- $wrp.unbind(ns2);
2534
-
2535
- if (opts.auto.button)
2536
- {
2537
- opts.auto.button.unbind(ns2);
2538
- }
2539
- if (opts.prev.button)
2540
- {
2541
- opts.prev.button.unbind(ns2);
2542
- }
2543
- if (opts.next.button)
2544
- {
2545
- opts.next.button.unbind(ns2);
2546
- }
2547
- if (opts.pagination.container)
2548
- {
2549
- opts.pagination.container.unbind(ns2);
2550
- if (opts.pagination.anchorBuilder)
2551
- {
2552
- opts.pagination.container.children().remove();
2553
- }
2554
- }
2555
- if (crsl.swipe)
2556
- {
2557
- $cfs.swipe('destroy');
2558
- $wrp.css('cursor', 'default');
2559
- crsl.swipe = false;
2560
- }
2561
- if (crsl.mousewheel)
2562
- {
2563
- crsl.mousewheel = false;
2564
- }
2565
-
2566
- nv_showNavi(opts, 'hide', conf);
2567
- nv_enableNavi(opts, 'removeClass', conf);
2568
-
2569
- }; // /unbind_buttons
2570
-
2571
-
2572
-
2573
- // START
2574
-
2575
- if (is_boolean(configs))
2576
- {
2577
- configs = {
2578
- 'debug': configs
2579
- };
2580
- }
2581
-
2582
- // set vars
2583
- var crsl = {
2584
- 'direction' : 'next',
2585
- 'isPaused' : true,
2586
- 'isScrolling' : false,
2587
- 'isStopped' : false,
2588
- 'mousewheel' : false,
2589
- 'swipe' : false
2590
- },
2591
- itms = {
2592
- 'total' : $cfs.children().length,
2593
- 'first' : 0
2594
- },
2595
- tmrs = {
2596
- 'auto' : null,
2597
- 'progress' : null,
2598
- 'startTime' : getTime(),
2599
- 'timePassed' : 0
2600
- },
2601
- scrl = {
2602
- 'isStopped' : false,
2603
- 'duration' : 0,
2604
- 'startTime' : 0,
2605
- 'easing' : '',
2606
- 'anims' : []
2607
- },
2608
- clbk = {
2609
- 'onBefore' : [],
2610
- 'onAfter' : []
2611
- },
2612
- queu = [],
2613
- conf = $.extend(true, {}, $.fn.carouFredSel.configs, configs),
2614
- opts = {},
2615
- opts_orig = $.extend(true, {}, options),
2616
- $wrp = (conf.wrapper == 'parent')
2617
- ? $cfs.parent()
2618
- : $cfs.wrap('<'+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />').parent();
2619
-
2620
-
2621
- conf.selector = $cfs.selector;
2622
- conf.serialNumber = $.fn.carouFredSel.serialNumber++;
2623
-
2624
- conf.transition = (conf.transition && $.fn.transition) ? 'transition' : 'animate';
2625
-
2626
- // create carousel
2627
- FN._init(opts_orig, true, starting_position);
2628
- FN._build();
2629
- FN._bind_events();
2630
- FN._bind_buttons();
2631
-
2632
- // find item to start
2633
- if (is_array(opts.items.start))
2634
- {
2635
- var start_arr = opts.items.start;
2636
- }
2637
- else
2638
- {
2639
- var start_arr = [];
2640
- if (opts.items.start != 0)
2641
- {
2642
- start_arr.push(opts.items.start);
2643
- }
2644
- }
2645
- if (opts.cookie)
2646
- {
2647
- start_arr.unshift(parseInt(cf_getCookie(opts.cookie), 10));
2648
- }
2649
-
2650
- if (start_arr.length > 0)
2651
- {
2652
- for (var a = 0, l = start_arr.length; a < l; a++)
2653
- {
2654
- var s = start_arr[a];
2655
- if (s == 0)
2656
- {
2657
- continue;
2658
- }
2659
- if (s === true)
2660
- {
2661
- s = window.location.hash;
2662
- if (s.length < 1)
2663
- {
2664
- continue;
2665
- }
2666
- }
2667
- else if (s === 'random')
2668
- {
2669
- s = Math.floor(Math.random()*itms.total);
2670
- }
2671
- if ($cfs.triggerHandler(cf_e('slideTo', conf), [s, 0, true, { fx: 'none' }]))
2672
- {
2673
- break;
2674
- }
2675
- }
2676
- }
2677
- var siz = sz_setSizes($cfs, opts),
2678
- itm = gi_getCurrentItems($cfs.children(), opts);
2679
-
2680
- if (opts.onCreate)
2681
- {
2682
- opts.onCreate.call($tt0, {
2683
- 'width': siz.width,
2684
- 'height': siz.height,
2685
- 'items': itm
2686
- });
2687
- }
2688
-
2689
- $cfs.trigger(cf_e('updatePageStatus', conf), [true, siz]);
2690
- $cfs.trigger(cf_e('linkAnchors', conf));
2691
-
2692
- if (conf.debug)
2693
- {
2694
- $cfs.trigger(cf_e('debug', conf));
2695
- }
2696
-
2697
- return $cfs;
2698
- };
2699
-
2700
-
2701
-
2702
- // GLOBAL PUBLIC
2703
-
2704
- $.fn.carouFredSel.serialNumber = 1;
2705
- $.fn.carouFredSel.defaults = {
2706
- 'synchronise' : false,
2707
- 'infinite' : true,
2708
- 'circular' : true,
2709
- 'responsive' : false,
2710
- 'direction' : 'left',
2711
- 'items' : {
2712
- 'start' : 0
2713
- },
2714
- 'scroll' : {
2715
- 'easing' : 'swing',
2716
- 'duration' : 500,
2717
- 'pauseOnHover' : false,
2718
- 'event' : 'click',
2719
- 'queue' : false
2720
- }
2721
- };
2722
- $.fn.carouFredSel.configs = {
2723
- 'debug' : false,
2724
- 'transition' : false,
2725
- 'onWindowResize': 'throttle',
2726
- 'events' : {
2727
- 'prefix' : '',
2728
- 'namespace' : 'cfs'
2729
- },
2730
- 'wrapper' : {
2731
- 'element' : 'div',
2732
- 'classname' : 'caroufredsel_wrapper'
2733
- },
2734
- 'classnames' : {}
2735
- };
2736
- $.fn.carouFredSel.pageAnchorBuilder = function(nr) {
2737
- return '<a href="#"><span>'+nr+'</span></a>';
2738
- };
2739
- $.fn.carouFredSel.progressbarUpdater = function(perc) {
2740
- $(this).css('width', perc+'%');
2741
- };
2742
-
2743
- $.fn.carouFredSel.cookie = {
2744
- get: function(n) {
2745
- n += '=';
2746
- var ca = document.cookie.split(';');
2747
- for (var a = 0, l = ca.length; a < l; a++)
2748
- {
2749
- var c = ca[a];
2750
- while (c.charAt(0) == ' ')
2751
- {
2752
- c = c.slice(1);
2753
- }
2754
- if (c.indexOf(n) == 0)
2755
- {
2756
- return c.slice(n.length);
2757
- }
2758
- }
2759
- return 0;
2760
- },
2761
- set: function(n, v, d) {
2762
- var e = "";
2763
- if (d)
2764
- {
2765
- var date = new Date();
2766
- date.setTime(date.getTime() + (d * 24 * 60 * 60 * 1000));
2767
- e = "; expires=" + date.toGMTString();
2768
- }
2769
- document.cookie = n + '=' + v + e + '; path=/';
2770
- },
2771
- remove: function(n) {
2772
- $.fn.carouFredSel.cookie.set(n, "", -1);
2773
- }
2774
- };
2775
-
2776
-
2777
- // GLOBAL PRIVATE
2778
-
2779
- // scrolling functions
2780
- function sc_setScroll(d, e, c) {
2781
- if (c.transition == 'transition')
2782
- {
2783
- if (e == 'swing')
2784
- {
2785
- e = 'ease';
2786
- }
2787
- }
2788
- return {
2789
- anims: [],
2790
- duration: d,
2791
- orgDuration: d,
2792
- easing: e,
2793
- startTime: getTime()
2794
- };
2795
- }
2796
- function sc_startScroll(s, c) {
2797
- for (var a = 0, l = s.anims.length; a < l; a++)
2798
- {
2799
- var b = s.anims[a];
2800
- if (!b)
2801
- {
2802
- continue;
2803
- }
2804
- b[0][c.transition](b[1], s.duration, s.easing, b[2]);
2805
- }
2806
- }
2807
- function sc_stopScroll(s, finish) {
2808
- if (!is_boolean(finish))
2809
- {
2810
- finish = true;
2811
- }
2812
- if (is_object(s.pre))
2813
- {
2814
- sc_stopScroll(s.pre, finish);
2815
- }
2816
- for (var a = 0, l = s.anims.length; a < l; a++)
2817
- {
2818
- var b = s.anims[a];
2819
- b[0].stop(true);
2820
- if (finish)
2821
- {
2822
- b[0].css(b[1]);
2823
- if (is_function(b[2]))
2824
- {
2825
- b[2]();
2826
- }
2827
- }
2828
- }
2829
- if (is_object(s.post))
2830
- {
2831
- sc_stopScroll(s.post, finish);
2832
- }
2833
- }
2834
- function sc_afterScroll( $c, $c2, o ) {
2835
- if ($c2)
2836
- {
2837
- $c2.remove();
2838
- }
2839
-
2840
- switch(o.fx) {
2841
- case 'fade':
2842
- case 'crossfade':
2843
- case 'cover-fade':
2844
- case 'uncover-fade':
2845
- $c.css('opacity', 1);
2846
- $c.css('filter', '');
2847
- break;
2848
- }
2849
- }
2850
- function sc_fireCallbacks($t, o, b, a, c) {
2851
- if (o[b])
2852
- {
2853
- o[b].call($t, a);
2854
- }
2855
- if (c[b].length)
2856
- {
2857
- for (var i = 0, l = c[b].length; i < l; i++)
2858
- {
2859
- c[b][i].call($t, a);
2860
- }
2861
- }
2862
- return [];
2863
- }
2864
- function sc_fireQueue($c, q, c) {
2865
-
2866
- if (q.length)
2867
- {
2868
- $c.trigger(cf_e(q[0][0], c), q[0][1]);
2869
- q.shift();
2870
- }
2871
- return q;
2872
- }
2873
- function sc_hideHiddenItems(hiddenitems) {
2874
- hiddenitems.each(function() {
2875
- var hi = $(this);
2876
- hi.data('_cfs_isHidden', hi.is(':hidden')).hide();
2877
- });
2878
- }
2879
- function sc_showHiddenItems(hiddenitems) {
2880
- if (hiddenitems)
2881
- {
2882
- hiddenitems.each(function() {
2883
- var hi = $(this);
2884
- if (!hi.data('_cfs_isHidden'))
2885
- {
2886
- hi.show();
2887
- }
2888
- });
2889
- }
2890
- }
2891
- function sc_clearTimers(t) {
2892
- if (t.auto)
2893
- {
2894
- clearTimeout(t.auto);
2895
- }
2896
- if (t.progress)
2897
- {
2898
- clearInterval(t.progress);
2899
- }
2900
- return t;
2901
- }
2902
- function sc_mapCallbackArguments(i_old, i_skp, i_new, s_itm, s_dir, s_dur, w_siz) {
2903
- return {
2904
- 'width': w_siz.width,
2905
- 'height': w_siz.height,
2906
- 'items': {
2907
- 'old': i_old,
2908
- 'skipped': i_skp,
2909
- 'visible': i_new
2910
- },
2911
- 'scroll': {
2912
- 'items': s_itm,
2913
- 'direction': s_dir,
2914
- 'duration': s_dur
2915
- }
2916
- };
2917
- }
2918
- function sc_getDuration( sO, o, nI, siz ) {
2919
- var dur = sO.duration;
2920
- if (sO.fx == 'none')
2921
- {
2922
- return 0;
2923
- }
2924
- if (dur == 'auto')
2925
- {
2926
- dur = o.scroll.duration / o.scroll.items * nI;
2927
- }
2928
- else if (dur < 10)
2929
- {
2930
- dur = siz / dur;
2931
- }
2932
- if (dur < 1)
2933
- {
2934
- return 0;
2935
- }
2936
- if (sO.fx == 'fade')
2937
- {
2938
- dur = dur / 2;
2939
- }
2940
- return Math.round(dur);
2941
- }
2942
-
2943
- // navigation functions
2944
- function nv_showNavi(o, t, c) {
2945
- var minimum = (is_number(o.items.minimum)) ? o.items.minimum : o.items.visible + 1;
2946
- if (t == 'show' || t == 'hide')
2947
- {
2948
- var f = t;
2949
- }
2950
- else if (minimum > t)
2951
- {
2952
- debug(c, 'Not enough items ('+t+' total, '+minimum+' needed): Hiding navigation.');
2953
- var f = 'hide';
2954
- }
2955
- else
2956
- {
2957
- var f = 'show';
2958
- }
2959
- var s = (f == 'show') ? 'removeClass' : 'addClass',
2960
- h = cf_c('hidden', c);
2961
-
2962
- if (o.auto.button)
2963
- {
2964
- o.auto.button[f]()[s](h);
2965
- }
2966
- if (o.prev.button)
2967
- {
2968
- o.prev.button[f]()[s](h);
2969
- }
2970
- if (o.next.button)
2971
- {
2972
- o.next.button[f]()[s](h);
2973
- }
2974
- if (o.pagination.container)
2975
- {
2976
- o.pagination.container[f]()[s](h);
2977
- }
2978
- }
2979
- function nv_enableNavi(o, f, c) {
2980
- if (o.circular || o.infinite) return;
2981
- var fx = (f == 'removeClass' || f == 'addClass') ? f : false,
2982
- di = cf_c('disabled', c);
2983
-
2984
- if (o.auto.button && fx)
2985
- {
2986
- o.auto.button[fx](di);
2987
- }
2988
- if (o.prev.button)
2989
- {
2990
- var fn = fx || (f == 0) ? 'addClass' : 'removeClass';
2991
- o.prev.button[fn](di);
2992
- }
2993
- if (o.next.button)
2994
- {
2995
- var fn = fx || (f == o.items.visible) ? 'addClass' : 'removeClass';
2996
- o.next.button[fn](di);
2997
- }
2998
- }
2999
-
3000
- // get object functions
3001
- function go_getObject($tt, obj) {
3002
- if (is_function(obj))
3003
- {
3004
- obj = obj.call($tt);
3005
- }
3006
- else if (is_undefined(obj))
3007
- {
3008
- obj = {};
3009
- }
3010
- return obj;
3011
- }
3012
- function go_getItemsObject($tt, obj) {
3013
- obj = go_getObject($tt, obj);
3014
- if (is_number(obj))
3015
- {
3016
- obj = {
3017
- 'visible': obj
3018
- };
3019
- }
3020
- else if (obj == 'variable')
3021
- {
3022
- obj = {
3023
- 'visible': obj,
3024
- 'width': obj,
3025
- 'height': obj
3026
- };
3027
- }
3028
- else if (!is_object(obj))
3029
- {
3030
- obj = {};
3031
- }
3032
- return obj;
3033
- }
3034
- function go_getScrollObject($tt, obj) {
3035
- obj = go_getObject($tt, obj);
3036
- if (is_number(obj))
3037
- {
3038
- if (obj <= 50)
3039
- {
3040
- obj = {
3041
- 'items': obj
3042
- };
3043
- }
3044
- else
3045
- {
3046
- obj = {
3047
- 'duration': obj
3048
- };
3049
- }
3050
- }
3051
- else if (is_string(obj))
3052
- {
3053
- obj = {
3054
- 'easing': obj
3055
- };
3056
- }
3057
- else if (!is_object(obj))
3058
- {
3059
- obj = {};
3060
- }
3061
- return obj;
3062
- }
3063
- function go_getNaviObject($tt, obj) {
3064
- obj = go_getObject($tt, obj);
3065
- if (is_string(obj))
3066
- {
3067
- var temp = cf_getKeyCode(obj);
3068
- if (temp == -1)
3069
- {
3070
- obj = $(obj);
3071
- }
3072
- else
3073
- {
3074
- obj = temp;
3075
- }
3076
- }
3077
- return obj;
3078
- }
3079
-
3080
- function go_getAutoObject($tt, obj) {
3081
- obj = go_getNaviObject($tt, obj);
3082
- if (is_jquery(obj))
3083
- {
3084
- obj = {
3085
- 'button': obj
3086
- };
3087
- }
3088
- else if (is_boolean(obj))
3089
- {
3090
- obj = {
3091
- 'play': obj
3092
- };
3093
- }
3094
- else if (is_number(obj))
3095
- {
3096
- obj = {
3097
- 'timeoutDuration': obj
3098
- };
3099
- }
3100
- if (obj.progress)
3101
- {
3102
- if (is_string(obj.progress) || is_jquery(obj.progress))
3103
- {
3104
- obj.progress = {
3105
- 'bar': obj.progress
3106
- };
3107
- }
3108
- }
3109
- return obj;
3110
- }
3111
- function go_complementAutoObject($tt, obj) {
3112
- if (is_function(obj.button))
3113
- {
3114
- obj.button = obj.button.call($tt);
3115
- }
3116
- if (is_string(obj.button))
3117
- {
3118
- obj.button = $(obj.button);
3119
- }
3120
- if (!is_boolean(obj.play))
3121
- {
3122
- obj.play = true;
3123
- }
3124
- if (!is_number(obj.delay))
3125
- {
3126
- obj.delay = 0;
3127
- }
3128
- if (is_undefined(obj.pauseOnEvent))
3129
- {
3130
- obj.pauseOnEvent = true;
3131
- }
3132
- if (!is_boolean(obj.pauseOnResize))
3133
- {
3134
- obj.pauseOnResize = true;
3135
- }
3136
- if (!is_number(obj.timeoutDuration))
3137
- {
3138
- obj.timeoutDuration = (obj.duration < 10)
3139
- ? 2500
3140
- : obj.duration * 5;
3141
- }
3142
- if (obj.progress)
3143
- {
3144
- if (is_function(obj.progress.bar))
3145
- {
3146
- obj.progress.bar = obj.progress.bar.call($tt);
3147
- }
3148
- if (is_string(obj.progress.bar))
3149
- {
3150
- obj.progress.bar = $(obj.progress.bar);
3151
- }
3152
- if (obj.progress.bar)
3153
- {
3154
- if (!is_function(obj.progress.updater))
3155
- {
3156
- obj.progress.updater = $.fn.carouFredSel.progressbarUpdater;
3157
- }
3158
- if (!is_number(obj.progress.interval))
3159
- {
3160
- obj.progress.interval = 50;
3161
- }
3162
- }
3163
- else
3164
- {
3165
- obj.progress = false;
3166
- }
3167
- }
3168
- return obj;
3169
- }
3170
-
3171
- function go_getPrevNextObject($tt, obj) {
3172
- obj = go_getNaviObject($tt, obj);
3173
- if (is_jquery(obj))
3174
- {
3175
- obj = {
3176
- 'button': obj
3177
- };
3178
- }
3179
- else if (is_number(obj))
3180
- {
3181
- obj = {
3182
- 'key': obj
3183
- };
3184
- }
3185
- return obj;
3186
- }
3187
- function go_complementPrevNextObject($tt, obj) {
3188
- if (is_function(obj.button))
3189
- {
3190
- obj.button = obj.button.call($tt);
3191
- }
3192
- if (is_string(obj.button))
3193
- {
3194
- obj.button = $(obj.button);
3195
- }
3196
- if (is_string(obj.key))
3197
- {
3198
- obj.key = cf_getKeyCode(obj.key);
3199
- }
3200
- return obj;
3201
- }
3202
-
3203
- function go_getPaginationObject($tt, obj) {
3204
- obj = go_getNaviObject($tt, obj);
3205
- if (is_jquery(obj))
3206
- {
3207
- obj = {
3208
- 'container': obj
3209
- };
3210
- }
3211
- else if (is_boolean(obj))
3212
- {
3213
- obj = {
3214
- 'keys': obj
3215
- };
3216
- }
3217
- return obj;
3218
- }
3219
- function go_complementPaginationObject($tt, obj) {
3220
- if (is_function(obj.container))
3221
- {
3222
- obj.container = obj.container.call($tt);
3223
- }
3224
- if (is_string(obj.container))
3225
- {
3226
- obj.container = $(obj.container);
3227
- }
3228
- if (!is_number(obj.items))
3229
- {
3230
- obj.items = false;
3231
- }
3232
- if (!is_boolean(obj.keys))
3233
- {
3234
- obj.keys = false;
3235
- }
3236
- if (!is_function(obj.anchorBuilder) && !is_false(obj.anchorBuilder))
3237
- {
3238
- obj.anchorBuilder = $.fn.carouFredSel.pageAnchorBuilder;
3239
- }
3240
- if (!is_number(obj.deviation))
3241
- {
3242
- obj.deviation = 0;
3243
- }
3244
- return obj;
3245
- }
3246
-
3247
- function go_getSwipeObject($tt, obj) {
3248
- if (is_function(obj))
3249
- {
3250
- obj = obj.call($tt);
3251
- }
3252
- if (is_undefined(obj))
3253
- {
3254
- obj = {
3255
- 'onTouch': false
3256
- };
3257
- }
3258
- if (is_true(obj))
3259
- {
3260
- obj = {
3261
- 'onTouch': obj
3262
- };
3263
- }
3264
- else if (is_number(obj))
3265
- {
3266
- obj = {
3267
- 'items': obj
3268
- };
3269
- }
3270
- return obj;
3271
- }
3272
- function go_complementSwipeObject($tt, obj) {
3273
- if (!is_boolean(obj.onTouch))
3274
- {
3275
- obj.onTouch = true;
3276
- }
3277
- if (!is_boolean(obj.onMouse))
3278
- {
3279
- obj.onMouse = false;
3280
- }
3281
- if (!is_object(obj.options))
3282
- {
3283
- obj.options = {};
3284
- }
3285
- if (!is_boolean(obj.options.triggerOnTouchEnd))
3286
- {
3287
- obj.options.triggerOnTouchEnd = false;
3288
- }
3289
- return obj;
3290
- }
3291
- function go_getMousewheelObject($tt, obj) {
3292
- if (is_function(obj))
3293
- {
3294
- obj = obj.call($tt);
3295
- }
3296
- if (is_true(obj))
3297
- {
3298
- obj = {};
3299
- }
3300
- else if (is_number(obj))
3301
- {
3302
- obj = {
3303
- 'items': obj
3304
- };
3305
- }
3306
- else if (is_undefined(obj))
3307
- {
3308
- obj = false;
3309
- }
3310
- return obj;
3311
- }
3312
- function go_complementMousewheelObject($tt, obj) {
3313
- return obj;
3314
- }
3315
-
3316
- // get number functions
3317
- function gn_getItemIndex(num, dev, org, items, $cfs) {
3318
- if (is_string(num))
3319
- {
3320
- num = $(num, $cfs);
3321
- }
3322
-
3323
- if (is_object(num))
3324
- {
3325
- num = $(num, $cfs);
3326
- }
3327
- if (is_jquery(num))
3328
- {
3329
- num = $cfs.children().index(num);
3330
- if (!is_boolean(org))
3331
- {
3332
- org = false;
3333
- }
3334
- }
3335
- else
3336
- {
3337
- if (!is_boolean(org))
3338
- {
3339
- org = true;
3340
- }
3341
- }
3342
- if (!is_number(num))
3343
- {
3344
- num = 0;
3345
- }
3346
- if (!is_number(dev))
3347
- {
3348
- dev = 0;
3349
- }
3350
-
3351
- if (org)
3352
- {
3353
- num += items.first;
3354
- }
3355
- num += dev;
3356
- if (items.total > 0)
3357
- {
3358
- while (num >= items.total)
3359
- {
3360
- num -= items.total;
3361
- }
3362
- while (num < 0)
3363
- {
3364
- num += items.total;
3365
- }
3366
- }
3367
- return num;
3368
- }
3369
-
3370
- // items prev
3371
- function gn_getVisibleItemsPrev(i, o, s) {
3372
- var t = 0,
3373
- x = 0;
3374
-
3375
- for (var a = s; a >= 0; a--)
3376
- {
3377
- var j = i.eq(a);
3378
- t += (j.is(':visible')) ? j[o.d['outerWidth']](true) : 0;
3379
- if (t > o.maxDimension)
3380
- {
3381
- return x;
3382
- }
3383
- if (a == 0)
3384
- {
3385
- a = i.length;
3386
- }
3387
- x++;
3388
- }
3389
- }
3390
- function gn_getVisibleItemsPrevFilter(i, o, s) {
3391
- return gn_getItemsPrevFilter(i, o.items.filter, o.items.visibleConf.org, s);
3392
- }
3393
- function gn_getScrollItemsPrevFilter(i, o, s, m) {
3394
- return gn_getItemsPrevFilter(i, o.items.filter, m, s);
3395
- }
3396
- function gn_getItemsPrevFilter(i, f, m, s) {
3397
- var t = 0,
3398
- x = 0;
3399
-
3400
- for (var a = s, l = i.length; a >= 0; a--)
3401
- {
3402
- x++;
3403
- if (x == l)
3404
- {
3405
- return x;
3406
- }
3407
-
3408
- var j = i.eq(a);
3409
- if (j.is(f))
3410
- {
3411
- t++;
3412
- if (t == m)
3413
- {
3414
- return x;
3415
- }
3416
- }
3417
- if (a == 0)
3418
- {
3419
- a = l;
3420
- }
3421
- }
3422
- }
3423
-
3424
- function gn_getVisibleOrg($c, o) {
3425
- return o.items.visibleConf.org || $c.children().slice(0, o.items.visible).filter(o.items.filter).length;
3426
- }
3427
-
3428
- // items next
3429
- function gn_getVisibleItemsNext(i, o, s) {
3430
- var t = 0,
3431
- x = 0;
3432
-
3433
- for (var a = s, l = i.length-1; a <= l; a++)
3434
- {
3435
- var j = i.eq(a);
3436
-
3437
- t += (j.is(':visible')) ? j[o.d['outerWidth']](true) : 0;
3438
- if (t > o.maxDimension)
3439
- {
3440
- return x;
3441
- }
3442
-
3443
- x++;
3444
- if (x == l+1)
3445
- {
3446
- return x;
3447
- }
3448
- if (a == l)
3449
- {
3450
- a = -1;
3451
- }
3452
- }
3453
- }
3454
- function gn_getVisibleItemsNextTestCircular(i, o, s, l) {
3455
- var v = gn_getVisibleItemsNext(i, o, s);
3456
- if (!o.circular)
3457
- {
3458
- if (s + v > l)
3459
- {
3460
- v = l - s;
3461
- }
3462
- }
3463
- return v;
3464
- }
3465
- function gn_getVisibleItemsNextFilter(i, o, s) {
3466
- return gn_getItemsNextFilter(i, o.items.filter, o.items.visibleConf.org, s, o.circular);
3467
- }
3468
- function gn_getScrollItemsNextFilter(i, o, s, m) {
3469
- return gn_getItemsNextFilter(i, o.items.filter, m+1, s, o.circular) - 1;
3470
- }
3471
- function gn_getItemsNextFilter(i, f, m, s, c) {
3472
- var t = 0,
3473
- x = 0;
3474
-
3475
- for (var a = s, l = i.length-1; a <= l; a++)
3476
- {
3477
- x++;
3478
- if (x >= l)
3479
- {
3480
- return x;
3481
- }
3482
-
3483
- var j = i.eq(a);
3484
- if (j.is(f))
3485
- {
3486
- t++;
3487
- if (t == m)
3488
- {
3489
- return x;
3490
- }
3491
- }
3492
- if (a == l)
3493
- {
3494
- a = -1;
3495
- }
3496
- }
3497
- }
3498
-
3499
- // get items functions
3500
- function gi_getCurrentItems(i, o) {
3501
- return i.slice(0, o.items.visible);
3502
- }
3503
- function gi_getOldItemsPrev(i, o, n) {
3504
- return i.slice(n, o.items.visibleConf.old+n);
3505
- }
3506
- function gi_getNewItemsPrev(i, o) {
3507
- return i.slice(0, o.items.visible);
3508
- }
3509
- function gi_getOldItemsNext(i, o) {
3510
- return i.slice(0, o.items.visibleConf.old);
3511
- }
3512
- function gi_getNewItemsNext(i, o, n) {
3513
- return i.slice(n, o.items.visible+n);
3514
- }
3515
-
3516
- // sizes functions
3517
- function sz_storeMargin(i, o, d) {
3518
- if (o.usePadding)
3519
- {
3520
- if (!is_string(d))
3521
- {
3522
- d = '_cfs_origCssMargin';
3523
- }
3524
- i.each(function() {
3525
- var j = $(this),
3526
- m = parseInt(j.css(o.d['marginRight']), 10);
3527
- if (!is_number(m))
3528
- {
3529
- m = 0;
3530
- }
3531
- j.data(d, m);
3532
- });
3533
- }
3534
- }
3535
- function sz_resetMargin(i, o, m) {
3536
- if (o.usePadding)
3537
- {
3538
- var x = (is_boolean(m)) ? m : false;
3539
- if (!is_number(m))
3540
- {
3541
- m = 0;
3542
- }
3543
- sz_storeMargin(i, o, '_cfs_tempCssMargin');
3544
- i.each(function() {
3545
- var j = $(this);
3546
- j.css(o.d['marginRight'], ((x) ? j.data('_cfs_tempCssMargin') : m + j.data('_cfs_origCssMargin')));
3547
- });
3548
- }
3549
- }
3550
- function sz_storeOrigCss(i) {
3551
- i.each(function() {
3552
- var j = $(this);
3553
- j.data('_cfs_origCss', j.attr('style') || '');
3554
- });
3555
- }
3556
- function sz_restoreOrigCss(i) {
3557
- i.each(function() {
3558
- var j = $(this);
3559
- j.attr('style', j.data('_cfs_origCss') || '');
3560
- });
3561
- }
3562
- function sz_setResponsiveSizes(o, all) {
3563
- var visb = o.items.visible,
3564
- newS = o.items[o.d['width']],
3565
- seco = o[o.d['height']],
3566
- secp = is_percentage(seco);
3567
-
3568
- all.each(function() {
3569
- var $t = $(this),
3570
- nw = newS - ms_getPaddingBorderMargin($t, o, 'Width');
3571
-
3572
- $t[o.d['width']](nw);
3573
- if (secp)
3574
- {
3575
- $t[o.d['height']](ms_getPercentage(nw, seco));
3576
- }
3577
- });
3578
- }
3579
- function sz_setSizes($c, o) {
3580
- var $w = $c.parent(),
3581
- $i = $c.children(),
3582
- $v = gi_getCurrentItems($i, o),
3583
- sz = cf_mapWrapperSizes(ms_getSizes($v, o, true), o, false);
3584
-
3585
- $w.css(sz);
3586
-
3587
- if (o.usePadding)
3588
- {
3589
- var p = o.padding,
3590
- r = p[o.d[1]];
3591
-
3592
- if (o.align && r < 0)
3593
- {
3594
- r = 0;
3595
- }
3596
- var $l = $v.last();
3597
- $l.css(o.d['marginRight'], $l.data('_cfs_origCssMargin') + r);
3598
- $c.css(o.d['top'], p[o.d[0]]);
3599
- $c.css(o.d['left'], p[o.d[3]]);
3600
- }
3601
-
3602
- $c.css(o.d['width'], sz[o.d['width']]+(ms_getTotalSize($i, o, 'width')*2));
3603
- $c.css(o.d['height'], ms_getLargestSize($i, o, 'height'));
3604
- return sz;
3605
- }
3606
-
3607
- // measuring functions
3608
- function ms_getSizes(i, o, wrapper) {
3609
- return [ms_getTotalSize(i, o, 'width', wrapper), ms_getLargestSize(i, o, 'height', wrapper)];
3610
- }
3611
- function ms_getLargestSize(i, o, dim, wrapper) {
3612
- if (!is_boolean(wrapper))
3613
- {
3614
- wrapper = false;
3615
- }
3616
- if (is_number(o[o.d[dim]]) && wrapper)
3617
- {
3618
- return o[o.d[dim]];
3619
- }
3620
- if (is_number(o.items[o.d[dim]]))
3621
- {
3622
- return o.items[o.d[dim]];
3623
- }
3624
- dim = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight';
3625
- return ms_getTrueLargestSize(i, o, dim);
3626
- }
3627
- function ms_getTrueLargestSize(i, o, dim) {
3628
- var s = 0;
3629
-
3630
- for (var a = 0, l = i.length; a < l; a++)
3631
- {
3632
- var j = i.eq(a);
3633
-
3634
- var m = (j.is(':visible')) ? j[o.d[dim]](true) : 0;
3635
- if (s < m)
3636
- {
3637
- s = m;
3638
- }
3639
- }
3640
- return s;
3641
- }
3642
-
3643
- function ms_getTotalSize(i, o, dim, wrapper) {
3644
- if (!is_boolean(wrapper))
3645
- {
3646
- wrapper = false;
3647
- }
3648
- if (is_number(o[o.d[dim]]) && wrapper)
3649
- {
3650
- return o[o.d[dim]];
3651
- }
3652
- if (is_number(o.items[o.d[dim]]))
3653
- {
3654
- return o.items[o.d[dim]] * i.length;
3655
- }
3656
-
3657
- var d = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight',
3658
- s = 0;
3659
-
3660
- for (var a = 0, l = i.length; a < l; a++)
3661
- {
3662
- var j = i.eq(a);
3663
- s += (j.is(':visible')) ? j[o.d[d]](true) : 0;
3664
- }
3665
- return s;
3666
- }
3667
- function ms_getParentSize($w, o, d) {
3668
- var isVisible = $w.is(':visible');
3669
- if (isVisible)
3670
- {
3671
- $w.hide();
3672
- }
3673
- var s = $w.parent()[o.d[d]]();
3674
- if (isVisible)
3675
- {
3676
- $w.show();
3677
- }
3678
- return s;
3679
- }
3680
- function ms_getMaxDimension(o, a) {
3681
- return (is_number(o[o.d['width']])) ? o[o.d['width']] : a;
3682
- }
3683
- function ms_hasVariableSizes(i, o, dim) {
3684
- var s = false,
3685
- v = false;
3686
-
3687
- for (var a = 0, l = i.length; a < l; a++)
3688
- {
3689
- var j = i.eq(a);
3690
-
3691
- var c = (j.is(':visible')) ? j[o.d[dim]](true) : 0;
3692
- if (s === false)
3693
- {
3694
- s = c;
3695
- }
3696
- else if (s != c)
3697
- {
3698
- v = true;
3699
- }
3700
- if (s == 0)
3701
- {
3702
- v = true;
3703
- }
3704
- }
3705
- return v;
3706
- }
3707
- function ms_getPaddingBorderMargin(i, o, d) {
3708
- return i[o.d['outer'+d]](true) - i[o.d[d.toLowerCase()]]();
3709
- }
3710
- function ms_getPercentage(s, o) {
3711
- if (is_percentage(o))
3712
- {
3713
- o = parseInt( o.slice(0, -1), 10 );
3714
- if (!is_number(o))
3715
- {
3716
- return s;
3717
- }
3718
- s *= o/100;
3719
- }
3720
- return s;
3721
- }
3722
-
3723
- // config functions
3724
- function cf_e(n, c, pf, ns, rd) {
3725
- if (!is_boolean(pf))
3726
- {
3727
- pf = true;
3728
- }
3729
- if (!is_boolean(ns))
3730
- {
3731
- ns = true;
3732
- }
3733
- if (!is_boolean(rd))
3734
- {
3735
- rd = false;
3736
- }
3737
-
3738
- if (pf)
3739
- {
3740
- n = c.events.prefix + n;
3741
- }
3742
- if (ns)
3743
- {
3744
- n = n +'.'+ c.events.namespace;
3745
- }
3746
- if (ns && rd)
3747
- {
3748
- n += c.serialNumber;
3749
- }
3750
-
3751
- return n;
3752
- }
3753
- function cf_c(n, c) {
3754
- return (is_string(c.classnames[n])) ? c.classnames[n] : n;
3755
- }
3756
- function cf_mapWrapperSizes(ws, o, p) {
3757
-
3758
- if (!is_boolean(p))
3759
- {
3760
- p = true;
3761
- }
3762
- var pad = (o.usePadding && p) ? o.padding : [0, 0, 0, 0];
3763
- var wra = {};
3764
-
3765
- wra[o.d['width']] = ws[0] + pad[1] + pad[3];
3766
- wra[o.d['height']] = ws[1] + pad[0] + pad[2];
3767
-
3768
- return wra;
3769
- }
3770
- function cf_sortParams(vals, typs) {
3771
- var arr = [];
3772
- for (var a = 0, l1 = vals.length; a < l1; a++)
3773
- {
3774
- for (var b = 0, l2 = typs.length; b < l2; b++)
3775
- {
3776
- if (typs[b].indexOf(typeof vals[a]) > -1 && is_undefined(arr[b]))
3777
- {
3778
- arr[b] = vals[a];
3779
- break;
3780
- }
3781
- }
3782
- }
3783
- return arr;
3784
- }
3785
- function cf_getPadding(p) {
3786
- if (is_undefined(p))
3787
- {
3788
- return [0, 0, 0, 0];
3789
- }
3790
- if (is_number(p))
3791
- {
3792
- return [p, p, p, p];
3793
- }
3794
- if (is_string(p))
3795
- {
3796
- p = p.split('px').join('').split('em').join('').split(' ');
3797
- }
3798
-
3799
- if (!is_array(p))
3800
- {
3801
- return [0, 0, 0, 0];
3802
- }
3803
- for (var i = 0; i < 4; i++)
3804
- {
3805
- p[i] = parseInt(p[i], 10);
3806
- }
3807
- switch (p.length)
3808
- {
3809
- case 0:
3810
- return [0, 0, 0, 0];
3811
- case 1:
3812
- return [p[0], p[0], p[0], p[0]];
3813
- case 2:
3814
- return [p[0], p[1], p[0], p[1]];
3815
- case 3:
3816
- return [p[0], p[1], p[2], p[1]];
3817
- default:
3818
- return [p[0], p[1], p[2], p[3]];
3819
- }
3820
- }
3821
- function cf_getAlignPadding(itm, o) {
3822
- var x = (is_number(o[o.d['width']])) ? Math.ceil(o[o.d['width']] - ms_getTotalSize(itm, o, 'width')) : 0;
3823
- switch (o.align)
3824
- {
3825
- case 'left':
3826
- return [0, x];
3827
- case 'right':
3828
- return [x, 0];
3829
- case 'center':
3830
- default:
3831
- return [Math.ceil(x/2), Math.floor(x/2)];
3832
- }
3833
- }
3834
- function cf_getDimensions(o) {
3835
- var dm = [
3836
- ['width' , 'innerWidth' , 'outerWidth' , 'height' , 'innerHeight' , 'outerHeight' , 'left', 'top' , 'marginRight' , 0, 1, 2, 3],
3837
- ['height' , 'innerHeight' , 'outerHeight' , 'width' , 'innerWidth' , 'outerWidth' , 'top' , 'left', 'marginBottom', 3, 2, 1, 0]
3838
- ];
3839
-
3840
- var dl = dm[0].length,
3841
- dx = (o.direction == 'right' || o.direction == 'left') ? 0 : 1;
3842
-
3843
- var dimensions = {};
3844
- for (var d = 0; d < dl; d++)
3845
- {
3846
- dimensions[dm[0][d]] = dm[dx][d];
3847
- }
3848
- return dimensions;
3849
- }
3850
- function cf_getAdjust(x, o, a, $t) {
3851
- var v = x;
3852
- if (is_function(a))
3853
- {
3854
- v = a.call($t, v);
3855
-
3856
- }
3857
- else if (is_string(a))
3858
- {
3859
- var p = a.split('+'),
3860
- m = a.split('-');
3861
-
3862
- if (m.length > p.length)
3863
- {
3864
- var neg = true,
3865
- sta = m[0],
3866
- adj = m[1];
3867
- }
3868
- else
3869
- {
3870
- var neg = false,
3871
- sta = p[0],
3872
- adj = p[1];
3873
- }
3874
-
3875
- switch(sta)
3876
- {
3877
- case 'even':
3878
- v = (x % 2 == 1) ? x-1 : x;
3879
- break;
3880
- case 'odd':
3881
- v = (x % 2 == 0) ? x-1 : x;
3882
- break;
3883
- default:
3884
- v = x;
3885
- break;
3886
- }
3887
- adj = parseInt(adj, 10);
3888
- if (is_number(adj))
3889
- {
3890
- if (neg)
3891
- {
3892
- adj = -adj;
3893
- }
3894
- v += adj;
3895
- }
3896
- }
3897
- if (!is_number(v) || v < 1)
3898
- {
3899
- v = 1;
3900
- }
3901
- return v;
3902
- }
3903
- function cf_getItemsAdjust(x, o, a, $t) {
3904
- return cf_getItemAdjustMinMax(cf_getAdjust(x, o, a, $t), o.items.visibleConf);
3905
- }
3906
- function cf_getItemAdjustMinMax(v, i) {
3907
- if (is_number(i.min) && v < i.min)
3908
- {
3909
- v = i.min;
3910
- }
3911
- if (is_number(i.max) && v > i.max)
3912
- {
3913
- v = i.max;
3914
- }
3915
- if (v < 1)
3916
- {
3917
- v = 1;
3918
- }
3919
- return v;
3920
- }
3921
- function cf_getSynchArr(s) {
3922
- if (!is_array(s))
3923
- {
3924
- s = [[s]];
3925
- }
3926
- if (!is_array(s[0]))
3927
- {
3928
- s = [s];
3929
- }
3930
- for (var j = 0, l = s.length; j < l; j++)
3931
- {
3932
- if (is_string(s[j][0]))
3933
- {
3934
- s[j][0] = $(s[j][0]);
3935
- }
3936
- if (!is_boolean(s[j][1]))
3937
- {
3938
- s[j][1] = true;
3939
- }
3940
- if (!is_boolean(s[j][2]))
3941
- {
3942
- s[j][2] = true;
3943
- }
3944
- if (!is_number(s[j][3]))
3945
- {
3946
- s[j][3] = 0;
3947
- }
3948
- }
3949
- return s;
3950
- }
3951
- function cf_getKeyCode(k) {
3952
- if (k == 'right')
3953
- {
3954
- return 39;
3955
- }
3956
- if (k == 'left')
3957
- {
3958
- return 37;
3959
- }
3960
- if (k == 'up')
3961
- {
3962
- return 38;
3963
- }
3964
- if (k == 'down')
3965
- {
3966
- return 40;
3967
- }
3968
- return -1;
3969
- }
3970
- function cf_setCookie(n, $c, c) {
3971
- if (n)
3972
- {
3973
- var v = $c.triggerHandler(cf_e('currentPosition', c));
3974
- $.fn.carouFredSel.cookie.set(n, v);
3975
- }
3976
- }
3977
- function cf_getCookie(n) {
3978
- var c = $.fn.carouFredSel.cookie.get(n);
3979
- return (c == '') ? 0 : c;
3980
- }
3981
-
3982
- // init function
3983
- function in_mapCss($elem, props) {
3984
- var css = {};
3985
- for (var p = 0, l = props.length; p < l; p++)
3986
- {
3987
- css[props[p]] = $elem.css(props[p]);
3988
- }
3989
- return css;
3990
- }
3991
- function in_complementItems(obj, opt, itm, sta) {
3992
- if (!is_object(obj.visibleConf))
3993
- {
3994
- obj.visibleConf = {};
3995
- }
3996
- if (!is_object(obj.sizesConf))
3997
- {
3998
- obj.sizesConf = {};
3999
- }
4000
-
4001
- if (obj.start == 0 && is_number(sta))
4002
- {
4003
- obj.start = sta;
4004
- }
4005
-
4006
- // visible items
4007
- if (is_object(obj.visible))
4008
- {
4009
- obj.visibleConf.min = obj.visible.min;
4010
- obj.visibleConf.max = obj.visible.max;
4011
- obj.visible = false;
4012
- }
4013
- else if (is_string(obj.visible))
4014
- {
4015
- // variable visible items
4016
- if (obj.visible == 'variable')
4017
- {
4018
- obj.visibleConf.variable = true;
4019
- }
4020
- // adjust string visible items
4021
- else
4022
- {
4023
- obj.visibleConf.adjust = obj.visible;
4024
- }
4025
- obj.visible = false;
4026
- }
4027
- else if (is_function(obj.visible))
4028
- {
4029
- obj.visibleConf.adjust = obj.visible;
4030
- obj.visible = false;
4031
- }
4032
-
4033
- // set items filter
4034
- if (!is_string(obj.filter))
4035
- {
4036
- obj.filter = (itm.filter(':hidden').length > 0) ? ':visible' : '*';
4037
- }
4038
-
4039
- // primary item-size not set
4040
- if (!obj[opt.d['width']])
4041
- {
4042
- // responsive carousel -> set to largest
4043
- if (opt.responsive)
4044
- {
4045
- debug(true, 'Set a '+opt.d['width']+' for the items!');
4046
- obj[opt.d['width']] = ms_getTrueLargestSize(itm, opt, 'outerWidth');
4047
- }
4048
- // non-responsive -> measure it or set to "variable"
4049
- else
4050
- {
4051
- obj[opt.d['width']] = (ms_hasVariableSizes(itm, opt, 'outerWidth'))
4052
- ? 'variable'
4053
- : itm[opt.d['outerWidth']](true);
4054
- }
4055
- }
4056
-
4057
- // secondary item-size not set -> measure it or set to "variable"
4058
- if (!obj[opt.d['height']])
4059
- {
4060
- obj[opt.d['height']] = (ms_hasVariableSizes(itm, opt, 'outerHeight'))
4061
- ? 'variable'
4062
- : itm[opt.d['outerHeight']](true);
4063
- }
4064
-
4065
- obj.sizesConf.width = obj.width;
4066
- obj.sizesConf.height = obj.height;
4067
- return obj;
4068
- }
4069
- function in_complementVisibleItems(opt, avl) {
4070
- // primary item-size variable -> set visible items variable
4071
- if (opt.items[opt.d['width']] == 'variable')
4072
- {
4073
- opt.items.visibleConf.variable = true;
4074
- }
4075
- if (!opt.items.visibleConf.variable) {
4076
- // primary size is number -> calculate visible-items
4077
- if (is_number(opt[opt.d['width']]))
4078
- {
4079
- opt.items.visible = Math.floor(opt[opt.d['width']] / opt.items[opt.d['width']]);
4080
- }
4081
- // measure and calculate primary size and visible-items
4082
- else
4083
- {
4084
- opt.items.visible = Math.floor(avl / opt.items[opt.d['width']]);
4085
- opt[opt.d['width']] = opt.items.visible * opt.items[opt.d['width']];
4086
- if (!opt.items.visibleConf.adjust)
4087
- {
4088
- opt.align = false;
4089
- }
4090
- }
4091
- if (opt.items.visible == 'Infinity' || opt.items.visible < 1)
4092
- {
4093
- debug(true, 'Not a valid number of visible items: Set to "variable".');
4094
- opt.items.visibleConf.variable = true;
4095
- }
4096
- }
4097
- return opt;
4098
- }
4099
- function in_complementPrimarySize(obj, opt, all) {
4100
- // primary size set to auto -> measure largest item-size and set it
4101
- if (obj == 'auto')
4102
- {
4103
- obj = ms_getTrueLargestSize(all, opt, 'outerWidth');
4104
- }
4105
- return obj;
4106
- }
4107
- function in_complementSecondarySize(obj, opt, all) {
4108
- // secondary size set to auto -> measure largest item-size and set it
4109
- if (obj == 'auto')
4110
- {
4111
- obj = ms_getTrueLargestSize(all, opt, 'outerHeight');
4112
- }
4113
- // secondary size not set -> set to secondary item-size
4114
- if (!obj)
4115
- {
4116
- obj = opt.items[opt.d['height']];
4117
- }
4118
- return obj;
4119
- }
4120
- function in_getAlignPadding(o, all) {
4121
- var p = cf_getAlignPadding(gi_getCurrentItems(all, o), o);
4122
- o.padding[o.d[1]] = p[1];
4123
- o.padding[o.d[3]] = p[0];
4124
- return o;
4125
- }
4126
- function in_getResponsiveValues(o, all, avl) {
4127
-
4128
- var visb = cf_getItemAdjustMinMax(Math.ceil(o[o.d['width']] / o.items[o.d['width']]), o.items.visibleConf);
4129
- if (visb > all.length)
4130
- {
4131
- visb = all.length;
4132
- }
4133
-
4134
- var newS = Math.floor(o[o.d['width']]/visb);
4135
-
4136
- o.items.visible = visb;
4137
- o.items[o.d['width']] = newS;
4138
- o[o.d['width']] = visb * newS;
4139
- return o;
4140
- }
4141
-
4142
-
4143
- // buttons functions
4144
- function bt_pauseOnHoverConfig(p) {
4145
- if (is_string(p))
4146
- {
4147
- var i = (p.indexOf('immediate') > -1) ? true : false,
4148
- r = (p.indexOf('resume') > -1) ? true : false;
4149
- }
4150
- else
4151
- {
4152
- var i = r = false;
4153
- }
4154
- return [i, r];
4155
- }
4156
- function bt_mousesheelNumber(mw) {
4157
- return (is_number(mw)) ? mw : null
4158
- }
4159
-
4160
- // helper functions
4161
- function is_null(a) {
4162
- return (a === null);
4163
- }
4164
- function is_undefined(a) {
4165
- return (is_null(a) || typeof a == 'undefined' || a === '' || a === 'undefined');
4166
- }
4167
- function is_array(a) {
4168
- return (a instanceof Array);
4169
- }
4170
- function is_jquery(a) {
4171
- return (a instanceof jQuery);
4172
- }
4173
- function is_object(a) {
4174
- return ((a instanceof Object || typeof a == 'object') && !is_null(a) && !is_jquery(a) && !is_array(a) && !is_function(a));
4175
- }
4176
- function is_number(a) {
4177
- return ((a instanceof Number || typeof a == 'number') && !isNaN(a));
4178
- }
4179
- function is_string(a) {
4180
- return ((a instanceof String || typeof a == 'string') && !is_undefined(a) && !is_true(a) && !is_false(a));
4181
- }
4182
- function is_function(a) {
4183
- return (a instanceof Function || typeof a == 'function');
4184
- }
4185
- function is_boolean(a) {
4186
- return (a instanceof Boolean || typeof a == 'boolean' || is_true(a) || is_false(a));
4187
- }
4188
- function is_true(a) {
4189
- return (a === true || a === 'true');
4190
- }
4191
- function is_false(a) {
4192
- return (a === false || a === 'false');
4193
- }
4194
- function is_percentage(x) {
4195
- return (is_string(x) && x.slice(-1) == '%');
4196
- }
4197
-
4198
-
4199
- function getTime() {
4200
- return new Date().getTime();
4201
- }
4202
-
4203
- function deprecated( o, n ) {
4204
- debug(true, o+' is DEPRECATED, support for it will be removed. Use '+n+' instead.');
4205
- }
4206
- function debug(d, m) {
4207
- if (!is_undefined(window.console) && !is_undefined(window.console.log))
4208
- {
4209
- if (is_object(d))
4210
- {
4211
- var s = ' ('+d.selector+')';
4212
- d = d.debug;
4213
- }
4214
- else
4215
- {
4216
- var s = '';
4217
- }
4218
- if (!d)
4219
- {
4220
- return false;
4221
- }
4222
-
4223
- if (is_string(m))
4224
- {
4225
- m = 'carouFredSel'+s+': ' + m;
4226
- }
4227
- else
4228
- {
4229
- m = ['carouFredSel'+s+':', m];
4230
- }
4231
- window.console.log(m);
4232
- }
4233
- return false;
4234
- }
4235
-
4236
-
4237
-
4238
- // EASING FUNCTIONS
4239
- $.extend($.easing, {
4240
- 'quadratic': function(t) {
4241
- var t2 = t * t;
4242
- return t * (-t2 * t + 4 * t2 - 6 * t + 4);
4243
- },
4244
- 'cubic': function(t) {
4245
- return t * (4 * t * t - 9 * t + 6);
4246
- },
4247
- 'elastic': function(t) {
4248
- var t2 = t * t;
4249
- return t * (33 * t2 * t2 - 106 * t2 * t + 126 * t2 - 67 * t + 15);
4250
- }
4251
- });
4252
-
4253
-
4254
  })(jQuery);
1
+ /*
2
+ * jQuery carouFredSel 6.2.1
3
+ * Demo's and documentation:
4
+ * caroufredsel.dev7studios.com
5
+ *
6
+ * Copyright (c) 2013 Fred Heusschen
7
+ * www.frebsite.nl
8
+ *
9
+ * Dual licensed under the MIT and GPL licenses.
10
+ * http://en.wikipedia.org/wiki/MIT_License
11
+ * http://en.wikipedia.org/wiki/GNU_General_Public_License
12
+ */
13
+
14
+
15
+ (function ($) {
16
+
17
+
18
+ // LOCAL
19
+
20
+ if ($.fn.carouFredSel) {
21
+ return;
22
+ }
23
+
24
+ $.fn.caroufredsel = $.fn.carouFredSel = function (options, configs) {
25
+
26
+ // no element
27
+ if (this.length == 0) {
28
+ debug(true, 'No element found for "' + this.selector + '".');
29
+ return this;
30
+ }
31
+
32
+ // multiple elements
33
+ if (this.length > 1) {
34
+ return this.each(function () {
35
+ $(this).carouFredSel(options, configs);
36
+ });
37
+ }
38
+
39
+
40
+ var $cfs = this,
41
+ $tt0 = this[0],
42
+ starting_position = false;
43
+
44
+ if ($cfs.data('_cfs_isCarousel')) {
45
+ starting_position = $cfs.triggerHandler('_cfs_triggerEvent', 'currentPosition');
46
+ $cfs.trigger('_cfs_triggerEvent', ['destroy', true]);
47
+ }
48
+
49
+ var FN = {};
50
+
51
+ FN._init = function (o, setOrig, start) {
52
+ o = go_getObject($tt0, o);
53
+
54
+ o.items = go_getItemsObject($tt0, o.items);
55
+ o.scroll = go_getScrollObject($tt0, o.scroll);
56
+ o.auto = go_getAutoObject($tt0, o.auto);
57
+ o.prev = go_getPrevNextObject($tt0, o.prev);
58
+ o.next = go_getPrevNextObject($tt0, o.next);
59
+ o.pagination = go_getPaginationObject($tt0, o.pagination);
60
+ o.swipe = go_getSwipeObject($tt0, o.swipe);
61
+ o.mousewheel = go_getMousewheelObject($tt0, o.mousewheel);
62
+
63
+ if (setOrig) {
64
+ opts_orig = $.extend(true, {}, $.fn.carouFredSel.defaults, o);
65
+ }
66
+
67
+ opts = $.extend(true, {}, $.fn.carouFredSel.defaults, o);
68
+ opts.d = cf_getDimensions(opts);
69
+
70
+ crsl.direction = (opts.direction == 'up' || opts.direction == 'left') ? 'next' : 'prev';
71
+
72
+ var a_itm = $cfs.children(),
73
+ avail_primary = ms_getParentSize($wrp, opts, 'width');
74
+
75
+ if (is_true(opts.cookie)) {
76
+ opts.cookie = 'caroufredsel_cookie_' + conf.serialNumber;
77
+ }
78
+
79
+ opts.maxDimension = ms_getMaxDimension(opts, avail_primary);
80
+
81
+ // complement items and sizes
82
+ opts.items = in_complementItems(opts.items, opts, a_itm, start);
83
+ opts[opts.d['width']] = in_complementPrimarySize(opts[opts.d['width']], opts, a_itm);
84
+ opts[opts.d['height']] = in_complementSecondarySize(opts[opts.d['height']], opts, a_itm);
85
+
86
+ // primary size not set for a responsive carousel
87
+ if (opts.responsive) {
88
+ if (!is_percentage(opts[opts.d['width']])) {
89
+ opts[opts.d['width']] = '100%';
90
+ }
91
+ }
92
+
93
+ // primary size is percentage
94
+ if (is_percentage(opts[opts.d['width']])) {
95
+ crsl.upDateOnWindowResize = true;
96
+ crsl.primarySizePercentage = opts[opts.d['width']];
97
+ opts[opts.d['width']] = ms_getPercentage(avail_primary, crsl.primarySizePercentage);
98
+ if (!opts.items.visible) {
99
+ opts.items.visibleConf.variable = true;
100
+ }
101
+ }
102
+
103
+ if (opts.responsive) {
104
+ opts.usePadding = true;
105
+ opts.padding = [5, 5, 5, 5];
106
+ opts.align = false;
107
+ opts.items.visibleConf.variable = false;
108
+ }
109
+ else {
110
+ // visible-items not set
111
+ if (!opts.items.visible) {
112
+ opts = in_complementVisibleItems(opts, avail_primary);
113
+ }
114
+
115
+ // primary size not set -> calculate it or set to "variable"
116
+ if (!opts[opts.d['width']]) {
117
+ if (!opts.items.visibleConf.variable && is_number(opts.items[opts.d['width']]) && opts.items.filter == '*') {
118
+ opts[opts.d['width']] = opts.items.visible * opts.items[opts.d['width']];
119
+ opts.align = false;
120
+ }
121
+ else {
122
+ opts[opts.d['width']] = 'variable';
123
+ }
124
+ }
125
+ // align not set -> set to center if primary size is number
126
+ if (is_undefined(opts.align)) {
127
+ opts.align = (is_number(opts[opts.d['width']]))
128
+ ? 'center'
129
+ : false;
130
+ }
131
+ // set variabe visible-items
132
+ if (opts.items.visibleConf.variable) {
133
+ opts.items.visible = gn_getVisibleItemsNext(a_itm, opts, 0);
134
+ }
135
+ }
136
+
137
+ // set visible items by filter
138
+ if (opts.items.filter != '*' && !opts.items.visibleConf.variable) {
139
+ opts.items.visibleConf.org = opts.items.visible;
140
+ opts.items.visible = gn_getVisibleItemsNextFilter(a_itm, opts, 0);
141
+ }
142
+
143
+ opts.items.visible = cf_getItemsAdjust(opts.items.visible, opts, opts.items.visibleConf.adjust, $tt0);
144
+ opts.items.visibleConf.old = opts.items.visible;
145
+
146
+ if (opts.responsive) {
147
+ if (!opts.items.visibleConf.min) {
148
+ opts.items.visibleConf.min = opts.items.visible;
149
+ }
150
+ if (!opts.items.visibleConf.max) {
151
+ opts.items.visibleConf.max = opts.items.visible;
152
+ }
153
+ opts = in_getResponsiveValues(opts, a_itm, avail_primary);
154
+ }
155
+ else {
156
+ opts.padding = cf_getPadding(opts.padding);
157
+
158
+ if (opts.align == 'top') {
159
+ opts.align = 'left';
160
+ }
161
+ else if (opts.align == 'bottom') {
162
+ opts.align = 'right';
163
+ }
164
+
165
+ switch (opts.align) {
166
+ // align: center, left or right
167
+ case 'center':
168
+ case 'left':
169
+ case 'right':
170
+ if (opts[opts.d['width']] != 'variable') {
171
+ opts = in_getAlignPadding(opts, a_itm);
172
+ opts.usePadding = true;
173
+ }
174
+ break;
175
+
176
+ // padding
177
+ default:
178
+ opts.align = false;
179
+ opts.usePadding = (
180
+ opts.padding[0] == 0 &&
181
+ opts.padding[1] == 0 &&
182
+ opts.padding[2] == 0 &&
183
+ opts.padding[3] == 0
184
+ ) ? false : true;
185
+ break;
186
+ }
187
+ }
188
+
189
+ if (!is_number(opts.scroll.duration)) {
190
+ opts.scroll.duration = 500;
191
+ }
192
+ if (is_undefined(opts.scroll.items)) {
193
+ opts.scroll.items = (opts.responsive || opts.items.visibleConf.variable || opts.items.filter != '*')
194
+ ? 'visible'
195
+ : opts.items.visible;
196
+ }
197
+
198
+ opts.auto = $.extend(true, {}, opts.scroll, opts.auto);
199
+ opts.prev = $.extend(true, {}, opts.scroll, opts.prev);
200
+ opts.next = $.extend(true, {}, opts.scroll, opts.next);
201
+ opts.pagination = $.extend(true, {}, opts.scroll, opts.pagination);
202
+ // swipe and mousewheel extend later on, per direction
203
+
204
+ opts.auto = go_complementAutoObject($tt0, opts.auto);
205
+ opts.prev = go_complementPrevNextObject($tt0, opts.prev);
206
+ opts.next = go_complementPrevNextObject($tt0, opts.next);
207
+ opts.pagination = go_complementPaginationObject($tt0, opts.pagination);
208
+ opts.swipe = go_complementSwipeObject($tt0, opts.swipe);
209
+ opts.mousewheel = go_complementMousewheelObject($tt0, opts.mousewheel);
210
+
211
+ if (opts.synchronise) {
212
+ opts.synchronise = cf_getSynchArr(opts.synchronise);
213
+ }
214
+
215
+
216
+ // DEPRECATED
217
+ if (opts.auto.onPauseStart) {
218
+ opts.auto.onTimeoutStart = opts.auto.onPauseStart;
219
+ deprecated('auto.onPauseStart', 'auto.onTimeoutStart');
220
+ }
221
+ if (opts.auto.onPausePause) {
222
+ opts.auto.onTimeoutPause = opts.auto.onPausePause;
223
+ deprecated('auto.onPausePause', 'auto.onTimeoutPause');
224
+ }
225
+ if (opts.auto.onPauseEnd) {
226
+ opts.auto.onTimeoutEnd = opts.auto.onPauseEnd;
227
+ deprecated('auto.onPauseEnd', 'auto.onTimeoutEnd');
228
+ }
229
+ if (opts.auto.pauseDuration) {
230
+ opts.auto.timeoutDuration = opts.auto.pauseDuration;
231
+ deprecated('auto.pauseDuration', 'auto.timeoutDuration');
232
+ }
233
+ // /DEPRECATED
234
+
235
+
236
+ }; // /init
237
+
238
+
239
+ FN._build = function () {
240
+ $cfs.data('_cfs_isCarousel', true);
241
+
242
+ var a_itm = $cfs.children(),
243
+ orgCSS = in_mapCss($cfs, ['textAlign', 'float', 'position', 'top', 'right', 'bottom', 'left', 'zIndex', 'width', 'height', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft']),
244
+ newPosition = 'relative';
245
+
246
+ switch (orgCSS.position) {
247
+ case 'absolute':
248
+ case 'fixed':
249
+ newPosition = orgCSS.position;
250
+ break;
251
+ }
252
+
253
+ if (conf.wrapper == 'parent') {
254
+ sz_storeOrigCss($wrp);
255
+ }
256
+ else {
257
+ $wrp.css(orgCSS);
258
+ }
259
+ $wrp.css({
260
+ 'overflow': 'hidden',
261
+ 'position': newPosition
262
+ });
263
+
264
+ sz_storeOrigCss($cfs);
265
+ $cfs.data('_cfs_origCssZindex', orgCSS.zIndex);
266
+ $cfs.css({
267
+ 'textAlign': 'left',
268
+ 'float': 'none',
269
+ 'position': 'absolute',
270
+ 'top': 0,
271
+ 'right': 'auto',
272
+ 'bottom': 'auto',
273
+ 'left': 0,
274
+ 'marginTop': 0,
275
+ 'marginRight': 0,
276
+ 'marginBottom': 0,
277
+ 'marginLeft': 0
278
+ });
279
+
280
+ sz_storeMargin(a_itm, opts);
281
+ sz_storeOrigCss(a_itm);
282
+ if (opts.responsive) {
283
+ sz_setResponsiveSizes(opts, a_itm);
284
+ }
285
+
286
+ }; // /build
287
+
288
+
289
+ FN._bind_events = function () {
290
+ FN._unbind_events();
291
+
292
+
293
+ // stop event
294
+ $cfs.bind(cf_e('stop', conf), function (e, imm) {
295
+ e.stopPropagation();
296
+
297
+ // button
298
+ if (!crsl.isStopped) {
299
+ if (opts.auto.button) {
300
+ opts.auto.button.addClass(cf_c('stopped', conf));
301
+ }
302
+ }
303
+
304
+ // set stopped
305
+ crsl.isStopped = true;
306
+
307
+ if (opts.auto.play) {
308
+ opts.auto.play = false;
309
+ $cfs.trigger(cf_e('pause', conf), imm);
310
+ }
311
+ return true;
312
+ });
313
+
314
+
315
+ // finish event
316
+ $cfs.bind(cf_e('finish', conf), function (e) {
317
+ e.stopPropagation();
318
+ if (crsl.isScrolling) {
319
+ sc_stopScroll(scrl);
320
+ }
321
+ return true;
322
+ });
323
+
324
+
325
+ // pause event
326
+ $cfs.bind(cf_e('pause', conf), function (e, imm, res) {
327
+ e.stopPropagation();
328
+ tmrs = sc_clearTimers(tmrs);
329
+
330
+ // immediately pause
331
+ if (imm && crsl.isScrolling) {
332
+ scrl.isStopped = true;
333
+ var nst = getTime() - scrl.startTime;
334
+ scrl.duration -= nst;
335
+ if (scrl.pre) {
336
+ scrl.pre.duration -= nst;
337
+ }
338
+ if (scrl.post) {
339
+ scrl.post.duration -= nst;
340
+ }
341
+ sc_stopScroll(scrl, false);
342
+ }
343
+
344
+ // update remaining pause-time
345
+ if (!crsl.isPaused && !crsl.isScrolling) {
346
+ if (res) {
347
+ tmrs.timePassed += getTime() - tmrs.startTime;
348
+ }
349
+ }
350
+
351
+ // button
352
+ if (!crsl.isPaused) {
353
+ if (opts.auto.button) {
354
+ opts.auto.button.addClass(cf_c('paused', conf));
355
+ }
356
+ }
357
+
358
+ // set paused
359
+ crsl.isPaused = true;
360
+
361
+ // pause pause callback
362
+ if (opts.auto.onTimeoutPause) {
363
+ var dur1 = opts.auto.timeoutDuration - tmrs.timePassed,
364
+ perc = 100 - Math.ceil(dur1 * 100 / opts.auto.timeoutDuration);
365
+
366
+ opts.auto.onTimeoutPause.call($tt0, perc, dur1);
367
+ }
368
+ return true;
369
+ });
370
+
371
+
372
+ // play event
373
+ $cfs.bind(cf_e('play', conf), function (e, dir, del, res) {
374
+ e.stopPropagation();
375
+ tmrs = sc_clearTimers(tmrs);
376
+
377
+ // sort params
378
+ var v = [dir, del, res],
379
+ t = ['string', 'number', 'boolean'],
380
+ a = cf_sortParams(v, t);
381
+
382
+ dir = a[0];
383
+ del = a[1];
384
+ res = a[2];
385
+
386
+ if (dir != 'prev' && dir != 'next') {
387
+ dir = crsl.direction;
388
+ }
389
+ if (!is_number(del)) {
390
+ del = 0;
391
+ }
392
+ if (!is_boolean(res)) {
393
+ res = false;
394
+ }
395
+
396
+ // stopped?
397
+ if (res) {
398
+ crsl.isStopped = false;
399
+ opts.auto.play = true;
400
+ }
401
+ if (!opts.auto.play) {
402
+ e.stopImmediatePropagation();
403
+ return debug(conf, 'Carousel stopped: Not scrolling.');
404
+ }
405
+
406
+ // button
407
+ if (crsl.isPaused) {
408
+ if (opts.auto.button) {
409
+ opts.auto.button.removeClass(cf_c('stopped', conf));
410
+ opts.auto.button.removeClass(cf_c('paused', conf));
411
+ }
412
+ }
413
+
414
+ // set playing
415
+ crsl.isPaused = false;
416
+ tmrs.startTime = getTime();
417
+
418
+ // timeout the scrolling
419
+ var dur1 = opts.auto.timeoutDuration + del;
420
+ dur2 = dur1 - tmrs.timePassed;
421
+ perc = 100 - Math.ceil(dur2 * 100 / dur1);
422
+
423
+ if (opts.auto.progress) {
424
+ tmrs.progress = setInterval(function () {
425
+ var pasd = getTime() - tmrs.startTime + tmrs.timePassed,
426
+ perc = Math.ceil(pasd * 100 / dur1);
427
+ opts.auto.progress.updater.call(opts.auto.progress.bar[0], perc);
428
+ }, opts.auto.progress.interval);
429
+ }
430
+
431
+ tmrs.auto = setTimeout(function () {
432
+ if (opts.auto.progress) {
433
+ opts.auto.progress.updater.call(opts.auto.progress.bar[0], 100);
434
+ }
435
+ if (opts.auto.onTimeoutEnd) {
436
+ opts.auto.onTimeoutEnd.call($tt0, perc, dur2);
437
+ }
438
+ if (crsl.isScrolling) {
439
+ $cfs.trigger(cf_e('play', conf), dir);
440
+ }
441
+ else {
442
+ $cfs.trigger(cf_e(dir, conf), opts.auto);
443
+ }
444
+ }, dur2);
445
+
446
+ // pause start callback
447
+ if (opts.auto.onTimeoutStart) {
448
+ opts.auto.onTimeoutStart.call($tt0, perc, dur2);
449
+ }
450
+
451
+ return true;
452
+ });
453
+
454
+
455
+ // resume event
456
+ $cfs.bind(cf_e('resume', conf), function (e) {
457
+ e.stopPropagation();
458
+ if (scrl.isStopped) {
459
+ scrl.isStopped = false;
460
+ crsl.isPaused = false;
461
+ crsl.isScrolling = true;
462
+ scrl.startTime = getTime();
463
+ sc_startScroll(scrl, conf);
464
+ }
465
+ else {
466
+ $cfs.trigger(cf_e('play', conf));
467
+ }
468
+ return true;
469
+ });
470
+
471
+
472
+ // prev + next events
473
+ $cfs.bind(cf_e('prev', conf) + ' ' + cf_e('next', conf), function (e, obj, num, clb, que) {
474
+ e.stopPropagation();
475
+
476
+ // stopped or hidden carousel, don't scroll, don't queue
477
+ if (crsl.isStopped || $cfs.is(':hidden')) {
478
+ e.stopImmediatePropagation();
479
+ return debug(conf, 'Carousel stopped or hidden: Not scrolling.');
480
+ }
481
+
482
+ // not enough items
483
+ var minimum = (is_number(opts.items.minimum)) ? opts.items.minimum : opts.items.visible + 1;
484
+ if (minimum > itms.total) {
485
+ e.stopImmediatePropagation();
486
+ return debug(conf, 'Not enough items (' + itms.total + ' total, ' + minimum + ' needed): Not scrolling.');
487
+ }
488
+
489
+ // get config
490
+ var v = [obj, num, clb, que],
491
+ t = ['object', 'number/string', 'function', 'boolean'],
492
+ a = cf_sortParams(v, t);
493
+
494
+ obj = a[0];
495
+ num = a[1];
496
+ clb = a[2];
497
+ que = a[3];
498
+
499
+ var eType = e.type.slice(conf.events.prefix.length);
500
+
501
+ if (!is_object(obj)) {
502
+ obj = {};
503
+ }
504
+ if (is_function(clb)) {
505
+ obj.onAfter = clb;
506
+ }
507
+ if (is_boolean(que)) {
508
+ obj.queue = que;
509
+ }
510
+ obj = $.extend(true, {}, opts[eType], obj);
511
+
512
+ // test conditions callback
513
+ if (obj.conditions && !obj.conditions.call($tt0, eType)) {
514
+ e.stopImmediatePropagation();
515
+ return debug(conf, 'Callback "conditions" returned false.');
516
+ }
517
+
518
+ if (!is_number(num)) {
519
+ if (opts.items.filter != '*') {
520
+ num = 'visible';
521
+ }
522
+ else {
523
+ var arr = [num, obj.items, opts[eType].items];
524
+ for (var a = 0, l = arr.length; a < l; a++) {
525
+ if (is_number(arr[a]) || arr[a] == 'page' || arr[a] == 'visible') {
526
+ num = arr[a];
527
+ break;
528
+ }
529
+ }
530
+ }
531
+ switch (num) {
532
+ case 'page':
533
+ e.stopImmediatePropagation();
534
+ return $cfs.triggerHandler(cf_e(eType + 'Page', conf), [obj, clb]);
535
+ break;
536
+
537
+ case 'visible':
538
+ if (!opts.items.visibleConf.variable && opts.items.filter == '*') {
539
+ num = opts.items.visible;
540
+ }
541
+ break;
542
+ }
543
+ }
544
+
545
+ // resume animation, add current to queue
546
+ if (scrl.isStopped) {
547
+ $cfs.trigger(cf_e('resume', conf));
548
+ $cfs.trigger(cf_e('queue', conf), [eType, [obj, num, clb]]);
549
+ e.stopImmediatePropagation();
550
+ return debug(conf, 'Carousel resumed scrolling.');
551
+ }
552
+
553
+ // queue if scrolling
554
+ if (obj.duration > 0) {
555
+ if (crsl.isScrolling) {
556
+ if (obj.queue) {
557
+ if (obj.queue == 'last') {
558
+ queu = [];
559
+ }
560
+ if (obj.queue != 'first' || queu.length == 0) {
561
+ $cfs.trigger(cf_e('queue', conf), [eType, [obj, num, clb]]);
562
+ }
563
+ }
564
+ e.stopImmediatePropagation();
565
+ return debug(conf, 'Carousel currently scrolling.');
566
+ }
567
+ }
568
+
569
+ tmrs.timePassed = 0;
570
+ $cfs.trigger(cf_e('slide_' + eType, conf), [obj, num]);
571
+
572
+ // synchronise
573
+ if (opts.synchronise) {
574
+ var s = opts.synchronise,
575
+ c = [obj, num];
576
+
577
+ for (var j = 0, l = s.length; j < l; j++) {
578
+ var d = eType;
579
+ if (!s[j][2]) {
580
+ d = (d == 'prev') ? 'next' : 'prev';
581
+ }
582
+ if (!s[j][1]) {
583
+ c[0] = s[j][0].triggerHandler('_cfs_triggerEvent', ['configuration', d]);
584
+ }
585
+ c[1] = num + s[j][3];
586
+ s[j][0].trigger('_cfs_triggerEvent', ['slide_' + d, c]);
587
+ }
588
+ }
589
+ return true;
590
+ });
591
+
592
+
593
+ // prev event
594
+ $cfs.bind(cf_e('slide_prev', conf), function (e, sO, nI) {
595
+ e.stopPropagation();
596
+ var a_itm = $cfs.children();
597
+
598
+ // non-circular at start, scroll to end
599
+ if (!opts.circular) {
600
+ if (itms.first == 0) {
601
+ if (opts.infinite) {
602
+ $cfs.trigger(cf_e('next', conf), itms.total - 1);
603
+ }
604
+ return e.stopImmediatePropagation();
605
+ }
606
+ }
607
+
608
+ sz_resetMargin(a_itm, opts);
609
+
610
+ // find number of items to scroll
611
+ if (!is_number(nI)) {
612
+ if (opts.items.visibleConf.variable) {
613
+ nI = gn_getVisibleItemsPrev(a_itm, opts, itms.total - 1);
614
+ }
615
+ else if (opts.items.filter != '*') {
616
+ var xI = (is_number(sO.items)) ? sO.items : gn_getVisibleOrg($cfs, opts);
617
+ nI = gn_getScrollItemsPrevFilter(a_itm, opts, itms.total - 1, xI);
618
+ }
619
+ else {
620
+ nI = opts.items.visible;
621
+ }
622
+ nI = cf_getAdjust(nI, opts, sO.items, $tt0);
623
+ }
624
+
625
+ // prevent non-circular from scrolling to far
626
+ if (!opts.circular) {
627
+ if (itms.total - nI < itms.first) {
628
+ nI = itms.total - itms.first;
629
+ }
630
+ }
631
+
632
+ // set new number of visible items
633
+ opts.items.visibleConf.old = opts.items.visible;
634
+ if (opts.items.visibleConf.variable) {
635
+ var vI = cf_getItemsAdjust(gn_getVisibleItemsNext(a_itm, opts, itms.total - nI), opts, opts.items.visibleConf.adjust, $tt0);
636
+ if (opts.items.visible + nI <= vI && nI < itms.total) {
637
+ nI++;
638
+ vI = cf_getItemsAdjust(gn_getVisibleItemsNext(a_itm, opts, itms.total - nI), opts, opts.items.visibleConf.adjust, $tt0);
639
+ }
640
+ opts.items.visible = vI;
641
+ }
642
+ else if (opts.items.filter != '*') {
643
+ var vI = gn_getVisibleItemsNextFilter(a_itm, opts, itms.total - nI);
644
+ opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0);
645
+ }
646
+
647
+ sz_resetMargin(a_itm, opts, true);
648
+
649
+ // scroll 0, don't scroll
650
+ if (nI == 0) {
651
+ e.stopImmediatePropagation();
652
+ return debug(conf, '0 items to scroll: Not scrolling.');
653
+ }
654
+ debug(conf, 'Scrolling ' + nI + ' items backward.');
655
+
656
+
657
+ // save new config
658
+ itms.first += nI;
659
+ while (itms.first >= itms.total) {
660
+ itms.first -= itms.total;
661
+ }
662
+
663
+ // non-circular callback
664
+ if (!opts.circular) {
665
+ if (itms.first == 0 && sO.onEnd) {
666
+ sO.onEnd.call($tt0, 'prev');
667
+ }
668
+ if (!opts.infinite) {
669
+ nv_enableNavi(opts, itms.first, conf);
670
+ }
671
+ }
672
+
673
+ // rearrange items
674
+ $cfs.children().slice(itms.total - nI, itms.total).prependTo($cfs);
675
+ if (itms.total < opts.items.visible + nI) {
676
+ $cfs.children().slice(0, (opts.items.visible + nI) - itms.total).clone(true).appendTo($cfs);
677
+ }
678
+
679
+ // the needed items
680
+ var a_itm = $cfs.children(),
681
+ i_old = gi_getOldItemsPrev(a_itm, opts, nI),
682
+ i_new = gi_getNewItemsPrev(a_itm, opts),
683
+ i_cur_l = a_itm.eq(nI - 1),
684
+ i_old_l = i_old.last(),
685
+ i_new_l = i_new.last();
686
+
687
+ sz_resetMargin(a_itm, opts);
688
+
689
+ var pL = 0,
690
+ pR = 0;
691
+
692
+ if (opts.align) {
693
+ var p = cf_getAlignPadding(i_new, opts);
694
+ pL = p[0];
695
+ pR = p[1];
696
+ }
697
+ var oL = (pL < 0) ? opts.padding[opts.d[3]] : 0;
698
+
699
+ // hide items for fx directscroll
700
+ var hiddenitems = false,
701
+ i_skp = $();
702
+ if (opts.items.visible < nI) {
703
+ i_skp = a_itm.slice(opts.items.visibleConf.old, nI);
704
+ if (sO.fx == 'directscroll') {
705
+ var orgW = opts.items[opts.d['width']];
706
+ hiddenitems = i_skp;
707
+ i_cur_l = i_new_l;
708
+ sc_hideHiddenItems(hiddenitems);
709
+ opts.items[opts.d['width']] = 'variable';
710
+ }
711
+ }
712
+ // save new sizes
713
+ var $cf2 = false,
714
+ i_siz = ms_getTotalSize(a_itm.slice(0, nI), opts, 'width'),
715
+ w_siz = cf_mapWrapperSizes(ms_getSizes(i_new, opts, true), opts, !opts.usePadding),
716
+ i_siz_vis = 0,
717
+ a_cfs = {},
718
+ a_wsz = {},
719
+ a_cur = {},
720
+ a_old = {},
721
+ a_new = {},
722
+ a_lef = {},
723
+ a_lef_vis = {},
724
+ a_dur = sc_getDuration(sO, opts, nI, i_siz);
725
+
726
+ switch (sO.fx) {
727
+ case 'cover':
728
+ case 'cover-fade':
729
+ i_siz_vis = ms_getTotalSize(a_itm.slice(0, opts.items.visible), opts, 'width');
730
+ break;
731
+ }
732
+
733
+ if (hiddenitems) {
734
+ opts.items[opts.d['width']] = orgW;
735
+ }
736
+
737
+ sz_resetMargin(a_itm, opts, true);
738
+ if (pR >= 0) {
739
+ sz_resetMargin(i_old_l, opts, opts.padding[opts.d[1]]);
740
+ }
741
+ if (pL >= 0) {
742
+ sz_resetMargin(i_cur_l, opts, opts.padding[opts.d[3]]);
743
+ }
744
+
745
+ if (opts.align) {
746
+ opts.padding[opts.d[1]] = pR;
747
+ opts.padding[opts.d[3]] = pL;
748
+ }
749
+
750
+ a_lef[opts.d['left']] = -(i_siz - oL);
751
+ a_lef_vis[opts.d['left']] = -(i_siz_vis - oL);
752
+ a_wsz[opts.d['left']] = w_siz[opts.d['width']];
753
+
754
+ // scrolling functions
755
+ var _s_wrapper = function () {
756
+ },
757
+ _a_wrapper = function () {
758
+ },
759
+ _s_paddingold = function () {
760
+ },
761
+ _a_paddingold = function () {
762
+ },
763
+ _s_paddingnew = function () {
764
+ },
765
+ _a_paddingnew = function () {
766
+ },
767
+ _s_paddingcur = function () {
768
+ },
769
+ _a_paddingcur = function () {
770
+ },
771
+ _onafter = function () {
772
+ },
773
+ _moveitems = function () {
774
+ },
775
+ _position = function () {
776
+ };
777
+
778
+ // clone carousel
779
+ switch (sO.fx) {
780
+ case 'crossfade':
781
+ case 'cover':
782
+ case 'cover-fade':
783
+ case 'uncover':
784
+ case 'uncover-fade':
785
+ $cf2 = $cfs.clone(true).appendTo($wrp);
786
+ break;
787
+ }
788
+ switch (sO.fx) {
789
+ case 'crossfade':
790
+ case 'uncover':
791
+ case 'uncover-fade':
792
+ $cf2.children().slice(0, nI).remove();
793
+ $cf2.children().slice(opts.items.visibleConf.old).remove();
794
+ break;
795
+
796
+ case 'cover':
797
+ case 'cover-fade':
798
+ $cf2.children().slice(opts.items.visible).remove();
799
+ $cf2.css(a_lef_vis);
800
+ break;
801
+ }
802
+
803
+ $cfs.css(a_lef);
804
+
805
+ // reset all scrolls
806
+ scrl = sc_setScroll(a_dur, sO.easing, conf);
807
+
808
+ // animate / set carousel
809
+ a_cfs[opts.d['left']] = (opts.usePadding) ? opts.padding[opts.d[3]] : 0;
810
+
811
+ // animate / set wrapper
812
+ if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable') {
813
+ _s_wrapper = function () {
814
+ $wrp.css(w_siz);
815
+ };
816
+ _a_wrapper = function () {
817
+ scrl.anims.push([$wrp, w_siz]);
818
+ };
819
+ }
820
+
821
+ // animate / set items
822
+ if (opts.usePadding) {
823
+ if (i_new_l.not(i_cur_l).length) {
824
+ a_cur[opts.d['marginRight']] = i_cur_l.data('_cfs_origCssMargin');
825
+
826
+ if (pL < 0) {
827
+ i_cur_l.css(a_cur);
828
+ }
829
+ else {
830
+ _s_paddingcur = function () {
831
+ i_cur_l.css(a_cur);
832
+ };
833
+ _a_paddingcur = function () {
834
+ scrl.anims.push([i_cur_l, a_cur]);
835
+ };
836
+ }
837
+ }
838
+ switch (sO.fx) {
839
+ case 'cover':
840
+ case 'cover-fade':
841
+ $cf2.children().eq(nI - 1).css(a_cur);
842
+ break;
843
+ }
844
+
845
+ if (i_new_l.not(i_old_l).length) {
846
+ a_old[opts.d['marginRight']] = i_old_l.data('_cfs_origCssMargin');
847
+ _s_paddingold = function () {
848
+ i_old_l.css(a_old);
849
+ };
850
+ _a_paddingold = function () {
851
+ scrl.anims.push([i_old_l, a_old]);
852
+ };
853
+ }
854
+
855
+ if (pR >= 0) {
856
+ a_new[opts.d['marginRight']] = i_new_l.data('_cfs_origCssMargin') + opts.padding[opts.d[1]];
857
+ _s_paddingnew = function () {
858
+ i_new_l.css(a_new);
859
+ };
860
+ _a_paddingnew = function () {
861
+ scrl.anims.push([i_new_l, a_new]);
862
+ };
863
+ }
864
+ }
865
+
866
+ // set position
867
+ _position = function () {
868
+ $cfs.css(a_cfs);
869
+ };
870
+
871
+
872
+ var overFill = opts.items.visible + nI - itms.total;
873
+
874
+ // rearrange items
875
+ _moveitems = function () {
876
+ if (overFill > 0) {
877
+ $cfs.children().slice(itms.total).remove();
878
+ i_old = $($cfs.children().slice(itms.total - (opts.items.visible - overFill)).get().concat($cfs.children().slice(0, overFill).get()));
879
+ }
880
+ sc_showHiddenItems(hiddenitems);
881
+
882
+ if (opts.usePadding) {
883
+ var l_itm = $cfs.children().eq(opts.items.visible + nI - 1);
884
+ l_itm.css(opts.d['marginRight'], l_itm.data('_cfs_origCssMargin'));
885
+ }
886
+ };
887
+
888
+
889
+ var cb_arguments = sc_mapCallbackArguments(i_old, i_skp, i_new, nI, 'prev', a_dur, w_siz);
890
+
891
+ // fire onAfter callbacks
892
+ _onafter = function () {
893
+ sc_afterScroll($cfs, $cf2, sO);
894
+ crsl.isScrolling = false;
895
+ clbk.onAfter = sc_fireCallbacks($tt0, sO, 'onAfter', cb_arguments, clbk);
896
+ queu = sc_fireQueue($cfs, queu, conf);
897
+
898
+ if (!crsl.isPaused) {
899
+ $cfs.trigger(cf_e('play', conf));
900
+ }
901
+ };
902
+
903
+ // fire onBefore callback
904
+ crsl.isScrolling = true;
905
+ tmrs = sc_clearTimers(tmrs);
906
+ clbk.onBefore = sc_fireCallbacks($tt0, sO, 'onBefore', cb_arguments, clbk);
907
+
908
+ switch (sO.fx) {
909
+ case 'none':
910
+ $cfs.css(a_cfs);
911
+ _s_wrapper();
912
+ _s_paddingold();
913
+ _s_paddingnew();
914
+ _s_paddingcur();
915
+ _position();
916
+ _moveitems();
917
+ _onafter();
918
+ break;
919
+
920
+ case 'fade':
921
+ scrl.anims.push([$cfs, {'opacity': 0}, function () {
922
+ _s_wrapper();
923
+ _s_paddingold();
924
+ _s_paddingnew();
925
+ _s_paddingcur();
926
+ _position();
927
+ _moveitems();
928
+ scrl = sc_setScroll(a_dur, sO.easing, conf);
929
+ scrl.anims.push([$cfs, {'opacity': 1}, _onafter]);
930
+ sc_startScroll(scrl, conf);
931
+ }]);
932
+ break;
933
+
934
+ case 'crossfade':
935
+ $cfs.css({'opacity': 0});
936
+ scrl.anims.push([$cf2, {'opacity': 0}]);
937
+ scrl.anims.push([$cfs, {'opacity': 1}, _onafter]);
938
+ _a_wrapper();
939
+ _s_paddingold();
940
+ _s_paddingnew();
941
+ _s_paddingcur();
942
+ _position();
943
+ _moveitems();
944
+ break;
945
+
946
+ case 'cover':
947
+ scrl.anims.push([$cf2, a_cfs, function () {
948
+ _s_paddingold();
949
+ _s_paddingnew();
950
+ _s_paddingcur();
951
+ _position();
952
+ _moveitems();
953
+ _onafter();
954
+ }]);
955
+ _a_wrapper();
956
+ break;
957
+
958
+ case 'cover-fade':
959
+ scrl.anims.push([$cfs, {'opacity': 0}]);
960
+ scrl.anims.push([$cf2, a_cfs, function () {
961
+ _s_paddingold();
962
+ _s_paddingnew();
963
+ _s_paddingcur();
964
+ _position();
965
+ _moveitems();
966
+ _onafter();
967
+ }]);
968
+ _a_wrapper();
969
+ break;
970
+
971
+ case 'uncover':
972
+ scrl.anims.push([$cf2, a_wsz, _onafter]);
973
+ _a_wrapper();
974
+ _s_paddingold();
975
+ _s_paddingnew();
976
+ _s_paddingcur();
977
+ _position();
978
+ _moveitems();
979
+ break;
980
+
981
+ case 'uncover-fade':
982
+ $cfs.css({'opacity': 0});
983
+ scrl.anims.push([$cfs, {'opacity': 1}]);
984
+ scrl.anims.push([$cf2, a_wsz, _onafter]);
985
+ _a_wrapper();
986
+ _s_paddingold();
987
+ _s_paddingnew();
988
+ _s_paddingcur();
989
+ _position();
990
+ _moveitems();
991
+ break;
992
+
993
+ default:
994
+ scrl.anims.push([$cfs, a_cfs, function () {
995
+ _moveitems();
996
+ _onafter();
997
+ }]);
998
+ _a_wrapper();
999
+ _a_paddingold();
1000
+ _a_paddingnew();
1001
+ _a_paddingcur();
1002
+ break;
1003
+ }
1004
+
1005
+ sc_startScroll(scrl, conf);
1006
+ cf_setCookie(opts.cookie, $cfs, conf);
1007
+
1008
+ $cfs.trigger(cf_e('updatePageStatus', conf), [false, w_siz]);
1009
+
1010
+ return true;
1011
+ });
1012
+
1013
+
1014
+ // next event
1015
+ $cfs.bind(cf_e('slide_next', conf), function (e, sO, nI) {
1016
+ e.stopPropagation();
1017
+ var a_itm = $cfs.children();
1018
+
1019
+ // non-circular at end, scroll to start
1020
+ if (!opts.circular) {
1021
+ if (itms.first == opts.items.visible) {
1022
+ if (opts.infinite) {
1023
+ $cfs.trigger(cf_e('prev', conf), itms.total - 1);
1024
+ }
1025
+ return e.stopImmediatePropagation();
1026
+ }
1027
+ }
1028
+
1029
+ sz_resetMargin(a_itm, opts);
1030
+
1031
+ // find number of items to scroll
1032
+ if (!is_number(nI)) {
1033
+ if (opts.items.filter != '*') {
1034
+ var xI = (is_number(sO.items)) ? sO.items : gn_getVisibleOrg($cfs, opts);
1035
+ nI = gn_getScrollItemsNextFilter(a_itm, opts, 0, xI);
1036
+ }
1037
+ else {
1038
+ nI = opts.items.visible;
1039
+ }
1040
+ nI = cf_getAdjust(nI, opts, sO.items, $tt0);
1041
+ }
1042
+
1043
+ var lastItemNr = (itms.first == 0) ? itms.total : itms.first;
1044
+
1045
+ // prevent non-circular from scrolling to far
1046
+ if (!opts.circular) {
1047
+ if (opts.items.visibleConf.variable) {
1048
+ var vI = gn_getVisibleItemsNext(a_itm, opts, nI),
1049
+ xI = gn_getVisibleItemsPrev(a_itm, opts, lastItemNr - 1);
1050
+ }
1051
+ else {
1052
+ var vI = opts.items.visible,
1053
+ xI = opts.items.visible;
1054
+ }
1055
+
1056
+ if (nI + vI > lastItemNr) {
1057
+ nI = lastItemNr - xI;
1058
+ }
1059
+ }
1060
+
1061
+ // set new number of visible items
1062
+ opts.items.visibleConf.old = opts.items.visible;
1063
+ if (opts.items.visibleConf.variable) {
1064
+ var vI = cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(a_itm, opts, nI, lastItemNr), opts, opts.items.visibleConf.adjust, $tt0);
1065
+ while (opts.items.visible - nI >= vI && nI < itms.total) {
1066
+ nI++;
1067
+ vI = cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(a_itm, opts, nI, lastItemNr), opts, opts.items.visibleConf.adjust, $tt0);
1068
+ }
1069
+ opts.items.visible = vI;
1070
+ }
1071
+ else if (opts.items.filter != '*') {
1072
+ var vI = gn_getVisibleItemsNextFilter(a_itm, opts, nI);
1073
+ opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0);
1074
+ }
1075
+
1076
+ sz_resetMargin(a_itm, opts, true);
1077
+
1078
+ // scroll 0, don't scroll
1079
+ if (nI == 0) {
1080
+ e.stopImmediatePropagation();
1081
+ return debug(conf, '0 items to scroll: Not scrolling.');
1082
+ }
1083
+ debug(conf, 'Scrolling ' + nI + ' items forward.');
1084
+
1085
+
1086
+ // save new config
1087
+ itms.first -= nI;
1088
+ while (itms.first < 0) {
1089
+ itms.first += itms.total;
1090
+ }
1091
+
1092
+ // non-circular callback
1093
+ if (!opts.circular) {
1094
+ if (itms.first == opts.items.visible && sO.onEnd) {
1095
+ sO.onEnd.call($tt0, 'next');
1096
+ }
1097
+ if (!opts.infinite) {
1098
+ nv_enableNavi(opts, itms.first, conf);
1099
+ }
1100
+ }
1101
+
1102
+ // rearrange items
1103
+ if (itms.total < opts.items.visible + nI) {
1104
+ $cfs.children().slice(0, (opts.items.visible + nI) - itms.total).clone(true).appendTo($cfs);
1105
+ }
1106
+
1107
+ // the needed items
1108
+ var a_itm = $cfs.children(),
1109
+ i_old = gi_getOldItemsNext(a_itm, opts),
1110
+ i_new = gi_getNewItemsNext(a_itm, opts, nI),
1111
+ i_cur_l = a_itm.eq(nI - 1),
1112
+ i_old_l = i_old.last(),
1113
+ i_new_l = i_new.last();
1114
+
1115
+ sz_resetMargin(a_itm, opts);
1116
+
1117
+ var pL = 0,
1118
+ pR = 0;
1119
+
1120
+ if (opts.align) {
1121
+ var p = cf_getAlignPadding(i_new, opts);
1122
+ pL = p[0];
1123
+ pR = p[1];
1124
+ }
1125
+
1126
+ // hide items for fx directscroll
1127
+ var hiddenitems = false,
1128
+ i_skp = $();
1129
+ if (opts.items.visibleConf.old < nI) {
1130
+ i_skp = a_itm.slice(opts.items.visibleConf.old, nI);
1131
+ if (sO.fx == 'directscroll') {
1132
+ var orgW = opts.items[opts.d['width']];
1133
+ hiddenitems = i_skp;
1134
+ i_cur_l = i_old_l;
1135
+ sc_hideHiddenItems(hiddenitems);
1136
+ opts.items[opts.d['width']] = 'variable';
1137
+ }
1138
+ }
1139
+ // save new sizes
1140
+ var $cf2 = false,
1141
+ i_siz = ms_getTotalSize(a_itm.slice(0, nI), opts, 'width'),
1142
+ w_siz = cf_mapWrapperSizes(ms_getSizes(i_new, opts, true), opts, !opts.usePadding),
1143
+ i_siz_vis = 0,
1144
+ a_cfs = {},
1145
+ a_cfs_vis = {},
1146
+ a_cur = {},
1147
+ a_old = {},
1148
+ a_lef = {},
1149
+ a_dur = sc_getDuration(sO, opts, nI, i_siz);
1150
+
1151
+ switch (sO.fx) {
1152
+ case 'uncover':
1153
+ case 'uncover-fade':
1154
+ i_siz_vis = ms_getTotalSize(a_itm.slice(0, opts.items.visibleConf.old), opts, 'width');
1155
+ break;
1156
+ }
1157
+
1158
+ if (hiddenitems) {
1159
+ opts.items[opts.d['width']] = orgW;
1160
+ }
1161
+
1162
+ if (opts.align) {
1163
+ if (opts.padding[opts.d[1]] < 0) {
1164
+ opts.padding[opts.d[1]] = 0;
1165
+ }
1166
+ }
1167
+ sz_resetMargin(a_itm, opts, true);
1168
+ sz_resetMargin(i_old_l, opts, opts.padding[opts.d[1]]);
1169
+
1170
+ if (opts.align) {
1171
+ opts.padding[opts.d[1]] = pR;
1172
+ opts.padding[opts.d[3]] = pL;
1173
+ }
1174
+
1175
+ a_lef[opts.d['left']] = (opts.usePadding) ? opts.padding[opts.d[3]] : 0;
1176
+
1177
+ // scrolling functions
1178
+ var _s_wrapper = function () {
1179
+ },
1180
+ _a_wrapper = function () {
1181
+ },
1182
+ _s_paddingold = function () {
1183
+ },
1184
+ _a_paddingold = function () {
1185
+ },
1186
+ _s_paddingcur = function () {
1187
+ },
1188
+ _a_paddingcur = function () {
1189
+ },
1190
+ _onafter = function () {
1191
+ },
1192
+ _moveitems = function () {
1193
+ },
1194
+ _position = function () {
1195
+ };
1196
+
1197
+ // clone carousel
1198
+ switch (sO.fx) {
1199
+ case 'crossfade':
1200
+ case 'cover':
1201
+ case 'cover-fade':
1202
+ case 'uncover':
1203
+ case 'uncover-fade':
1204
+ $cf2 = $cfs.clone(true).appendTo($wrp);
1205
+ $cf2.children().slice(opts.items.visibleConf.old).remove();
1206
+ break;
1207
+ }
1208
+ switch (sO.fx) {
1209
+ case 'crossfade':
1210
+ case 'cover':
1211
+ case 'cover-fade':
1212
+ $cfs.css('zIndex', 1);
1213
+ $cf2.css('zIndex', 0);
1214
+ break;
1215
+ }
1216
+
1217
+ // reset all scrolls
1218
+ scrl = sc_setScroll(a_dur, sO.easing, conf);
1219
+
1220
+ // animate / set carousel
1221
+ a_cfs[opts.d['left']] = -i_siz;
1222
+ a_cfs_vis[opts.d['left']] = -i_siz_vis;
1223
+
1224
+ if (pL < 0) {
1225
+ a_cfs[opts.d['left']] += pL;
1226
+ }
1227
+
1228
+ // animate / set wrapper
1229
+ if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable') {
1230
+ _s_wrapper = function () {
1231
+ $wrp.css(w_siz);
1232
+ };
1233
+ _a_wrapper = function () {
1234
+ scrl.anims.push([$wrp, w_siz]);
1235
+ };
1236
+ }
1237
+
1238
+ // animate / set items
1239
+ if (opts.usePadding) {
1240
+ var i_new_l_m = i_new_l.data('_cfs_origCssMargin');
1241
+
1242
+ if (pR >= 0) {
1243
+ i_new_l_m += opts.padding[opts.d[1]];
1244
+ }
1245
+ i_new_l.css(opts.d['marginRight'], i_new_l_m);
1246
+
1247
+ if (i_cur_l.not(i_old_l).length) {
1248
+ a_old[opts.d['marginRight']] = i_old_l.data('_cfs_origCssMargin');
1249
+ }
1250
+ _s_paddingold = function () {
1251
+ i_old_l.css(a_old);
1252
+ };
1253
+ _a_paddingold = function () {
1254
+ scrl.anims.push([i_old_l, a_old]);
1255
+ };
1256
+
1257
+ var i_cur_l_m = i_cur_l.data('_cfs_origCssMargin');
1258
+ if (pL > 0) {
1259
+ i_cur_l_m += opts.padding[opts.d[3]];
1260
+ }
1261
+
1262
+ a_cur[opts.d['marginRight']] = i_cur_l_m;
1263
+
1264
+ _s_paddingcur = function () {
1265
+ i_cur_l.css(a_cur);
1266
+ };
1267
+ _a_paddingcur = function () {
1268
+ scrl.anims.push([i_cur_l, a_cur]);
1269
+ };
1270
+ }
1271
+
1272
+ // set position
1273
+ _position = function () {
1274
+ $cfs.css(a_lef);
1275
+ };
1276
+
1277
+
1278
+ var overFill = opts.items.visible + nI - itms.total;
1279
+
1280
+ // rearrange items
1281
+ _moveitems = function () {
1282
+ if (overFill > 0) {
1283
+ $cfs.children().slice(itms.total).remove();
1284
+ }
1285
+ var l_itm = $cfs.children().slice(0, nI).appendTo($cfs).last();
1286
+ if (overFill > 0) {
1287
+ i_new = gi_getCurrentItems(a_itm, opts);
1288
+ }
1289
+ sc_showHiddenItems(hiddenitems);
1290
+
1291
+ if (opts.usePadding) {
1292
+ if (itms.total < opts.items.visible + nI) {
1293
+ var i_cur_l = $cfs.children().eq(opts.items.visible - 1);
1294
+ i_cur_l.css(opts.d['marginRight'], i_cur_l.data('_cfs_origCssMargin') + opts.padding[opts.d[1]]);
1295
+ }
1296
+ l_itm.css(opts.d['marginRight'], l_itm.data('_cfs_origCssMargin'));
1297
+ }
1298
+ };
1299
+
1300
+
1301
+ var cb_arguments = sc_mapCallbackArguments(i_old, i_skp, i_new, nI, 'next', a_dur, w_siz);
1302
+
1303
+ // fire onAfter callbacks
1304
+ _onafter = function () {
1305
+ $cfs.css('zIndex', $cfs.data('_cfs_origCssZindex'));
1306
+ sc_afterScroll($cfs, $cf2, sO);
1307
+ crsl.isScrolling = false;
1308
+ clbk.onAfter = sc_fireCallbacks($tt0, sO, 'onAfter', cb_arguments, clbk);
1309
+ queu = sc_fireQueue($cfs, queu, conf);
1310
+
1311
+ if (!crsl.isPaused) {
1312
+ $cfs.trigger(cf_e('play', conf));
1313
+ }
1314
+ };
1315
+
1316
+ // fire onBefore callbacks
1317
+ crsl.isScrolling = true;
1318
+ tmrs = sc_clearTimers(tmrs);
1319
+ clbk.onBefore = sc_fireCallbacks($tt0, sO, 'onBefore', cb_arguments, clbk);
1320
+
1321
+ switch (sO.fx) {
1322
+ case 'none':
1323
+ $cfs.css(a_cfs);
1324
+ _s_wrapper();
1325
+ _s_paddingold();
1326
+ _s_paddingcur();
1327
+ _position();
1328
+ _moveitems();
1329
+ _onafter();
1330
+ break;
1331
+
1332
+ case 'fade':
1333
+ scrl.anims.push([$cfs, {'opacity': 0}, function () {
1334
+ _s_wrapper();
1335
+ _s_paddingold();
1336
+ _s_paddingcur();
1337
+ _position();
1338
+ _moveitems();
1339
+ scrl = sc_setScroll(a_dur, sO.easing, conf);
1340
+ scrl.anims.push([$cfs, {'opacity': 1}, _onafter]);
1341
+ sc_startScroll(scrl, conf);
1342
+ }]);
1343
+ break;
1344
+
1345
+ case 'crossfade':
1346
+ $cfs.css({'opacity': 0});
1347
+ scrl.anims.push([$cf2, {'opacity': 0}]);
1348
+ scrl.anims.push([$cfs, {'opacity': 1}, _onafter]);
1349
+ _a_wrapper();
1350
+ _s_paddingold();
1351
+ _s_paddingcur();
1352
+ _position();
1353
+ _moveitems();
1354
+ break;
1355
+
1356
+ case 'cover':
1357
+ $cfs.css(opts.d['left'], $wrp[opts.d['width']]());
1358
+ scrl.anims.push([$cfs, a_lef, _onafter]);
1359
+ _a_wrapper();
1360
+ _s_paddingold();
1361
+ _s_paddingcur();
1362
+ _moveitems();
1363
+ break;
1364
+
1365
+ case 'cover-fade':
1366
+ $cfs.css(opts.d['left'], $wrp[opts.d['width']]());
1367
+ scrl.anims.push([$cf2, {'opacity': 0}]);
1368
+ scrl.anims.push([$cfs, a_lef, _onafter]);
1369
+ _a_wrapper();
1370
+ _s_paddingold();
1371
+ _s_paddingcur();
1372
+ _moveitems();
1373
+ break;
1374
+
1375
+ case 'uncover':
1376
+ scrl.anims.push([$cf2, a_cfs_vis, _onafter]);
1377
+ _a_wrapper();
1378
+ _s_paddingold();
1379
+ _s_paddingcur();
1380
+ _position();
1381
+ _moveitems();
1382
+ break;
1383
+
1384
+ case 'uncover-fade':
1385
+ $cfs.css({'opacity': 0});
1386
+ scrl.anims.push([$cfs, {'opacity': 1}]);
1387
+ scrl.anims.push([$cf2, a_cfs_vis, _onafter]);
1388
+ _a_wrapper();
1389
+ _s_paddingold();
1390
+ _s_paddingcur();
1391
+ _position();
1392
+ _moveitems();
1393
+ break;
1394
+
1395
+ default:
1396
+ scrl.anims.push([$cfs, a_cfs, function () {
1397
+ _position();
1398
+ _moveitems();
1399
+ _onafter();
1400
+ }]);
1401
+ _a_wrapper();
1402
+ _a_paddingold();
1403
+ _a_paddingcur();
1404
+ break;
1405
+ }
1406
+
1407
+ sc_startScroll(scrl, conf);
1408
+ cf_setCookie(opts.cookie, $cfs, conf);
1409
+
1410
+ $cfs.trigger(cf_e('updatePageStatus', conf), [false, w_siz]);
1411
+
1412
+ return true;
1413
+ });
1414
+
1415
+
1416
+ // slideTo event
1417
+ $cfs.bind(cf_e('slideTo', conf), function (e, num, dev, org, obj, dir, clb) {
1418
+ e.stopPropagation();
1419
+
1420
+ var v = [num, dev, org, obj, dir, clb],
1421
+ t = ['string/number/object', 'number', 'boolean', 'object', 'string', 'function'],
1422
+ a = cf_sortParams(v, t);
1423
+
1424
+ obj = a[3];
1425
+ dir = a[4];
1426
+ clb = a[5];
1427
+
1428
+ num = gn_getItemIndex(a[0], a[1], a[2], itms, $cfs);
1429
+
1430
+ if (num == 0) {
1431
+ return false;
1432
+ }
1433
+ if (!is_object(obj)) {
1434
+ obj = false;
1435
+ }
1436
+
1437
+ if (dir != 'prev' && dir != 'next') {
1438
+ if (opts.circular) {
1439
+ dir = (num <= itms.total / 2) ? 'next' : 'prev';
1440
+ }
1441
+ else {
1442
+ dir = (itms.first == 0 || itms.first > num) ? 'next' : 'prev';
1443
+ }
1444
+ }
1445
+
1446
+ if (dir == 'prev') {
1447
+ num = itms.total - num;
1448
+ }
1449
+ $cfs.trigger(cf_e(dir, conf), [obj, num, clb]);
1450
+
1451
+ return true;
1452
+ });
1453
+
1454
+
1455
+ // prevPage event
1456
+ $cfs.bind(cf_e('prevPage', conf), function (e, obj, clb) {
1457
+ e.stopPropagation();
1458
+ var cur = $cfs.triggerHandler(cf_e('currentPage', conf));
1459
+ return $cfs.triggerHandler(cf_e('slideToPage', conf), [cur - 1, obj, 'prev', clb]);
1460
+ });
1461
+
1462
+
1463
+ // nextPage event
1464
+ $cfs.bind(cf_e('nextPage', conf), function (e, obj, clb) {
1465
+ e.stopPropagation();
1466
+ var cur = $cfs.triggerHandler(cf_e('currentPage', conf));
1467
+ return $cfs.triggerHandler(cf_e('slideToPage', conf), [cur + 1, obj, 'next', clb]);
1468
+ });
1469
+
1470
+
1471
+ // slideToPage event
1472
+ $cfs.bind(cf_e('slideToPage', conf), function (e, pag, obj, dir, clb) {
1473
+ e.stopPropagation();
1474
+ if (!is_number(pag)) {
1475
+ pag = $cfs.triggerHandler(cf_e('currentPage', conf));
1476
+ }
1477
+ var ipp = opts.pagination.items || opts.items.visible,
1478
+ max = Math.ceil(itms.total / ipp) - 1;
1479
+
1480
+ if (pag < 0) {
1481
+ pag = max;
1482
+ }
1483
+ if (pag > max) {
1484
+ pag = 0;
1485
+ }
1486
+ return $cfs.triggerHandler(cf_e('slideTo', conf), [pag * ipp, 0, true, obj, dir, clb]);
1487
+ });
1488
+
1489
+ // jumpToStart event
1490
+ $cfs.bind(cf_e('jumpToStart', conf), function (e, s) {
1491
+ e.stopPropagation();
1492
+ if (s) {
1493
+ s = gn_getItemIndex(s, 0, true, itms, $cfs);
1494
+ }
1495
+ else {
1496
+ s = 0;
1497
+ }
1498
+
1499
+ s += itms.first;
1500
+ if (s != 0) {
1501
+ if (itms.total > 0) {
1502
+ while (s > itms.total) {
1503
+ s -= itms.total;
1504
+ }
1505
+ }
1506
+ $cfs.prepend($cfs.children().slice(s, itms.total));
1507
+ }
1508
+ return true;
1509
+ });
1510
+
1511
+
1512
+ // synchronise event
1513
+ $cfs.bind(cf_e('synchronise', conf), function (e, s) {
1514
+ e.stopPropagation();
1515
+ if (s) {
1516
+ s = cf_getSynchArr(s);
1517
+ }
1518
+ else if (opts.synchronise) {
1519
+ s = opts.synchronise;
1520
+ }
1521
+ else {
1522
+ return debug(conf, 'No carousel to synchronise.');
1523
+ }
1524
+
1525
+ var n = $cfs.triggerHandler(cf_e('currentPosition', conf)),
1526
+ x = true;
1527
+
1528
+ for (var j = 0, l = s.length; j < l; j++) {
1529
+ if (!s[j][0].triggerHandler(cf_e('slideTo', conf), [n, s[j][3], true])) {
1530
+ x = false;
1531
+ }
1532
+ }
1533
+ return x;
1534
+ });
1535
+
1536
+
1537
+ // queue event
1538
+ $cfs.bind(cf_e('queue', conf), function (e, dir, opt) {
1539
+ e.stopPropagation();
1540
+ if (is_function(dir)) {
1541
+ dir.call($tt0, queu);
1542
+ }
1543
+ else if (is_array(dir)) {
1544
+ queu = dir;
1545
+ }
1546
+ else if (!is_undefined(dir)) {
1547
+ queu.push([dir, opt]);
1548
+ }
1549
+ return queu;
1550
+ });
1551
+
1552
+
1553
+ // insertItem event
1554
+ $cfs.bind(cf_e('insertItem', conf), function (e, itm, num, org, dev) {
1555
+ e.stopPropagation();
1556
+
1557
+ var v = [itm, num, org, dev],
1558
+ t = ['string/object', 'string/number/object', 'boolean', 'number'],
1559
+ a = cf_sortParams(v, t);
1560
+
1561
+ itm = a[0];
1562
+ num = a[1];
1563
+ org = a[2];
1564
+ dev = a[3];
1565
+
1566
+ if (is_object(itm) && !is_jquery(itm)) {
1567
+ itm = $(itm);
1568
+ }
1569
+ else if (is_string(itm)) {
1570
+ itm = $(itm);
1571
+ }
1572
+ if (!is_jquery(itm) || itm.length == 0) {
1573
+ return debug(conf, 'Not a valid object.');
1574
+ }
1575
+
1576
+ if (is_undefined(num)) {
1577
+ num = 'end';
1578
+ }
1579
+
1580
+ sz_storeMargin(itm, opts);
1581
+ sz_storeOrigCss(itm);
1582
+
1583
+ var orgNum = num,
1584
+ before = 'before';
1585
+
1586
+ if (num == 'end') {
1587
+ if (org) {
1588
+ if (itms.first == 0) {
1589
+ num = itms.total - 1;
1590
+ before = 'after';
1591
+ }
1592
+ else {
1593
+ num = itms.first;
1594
+ itms.first += itm.length;
1595
+ }
1596
+ if (num < 0) {
1597
+ num = 0;
1598
+ }
1599
+ }
1600
+ else {
1601
+ num = itms.total - 1;
1602
+ before = 'after';
1603
+ }
1604
+ }
1605
+ else {
1606
+ num = gn_getItemIndex(num, dev, org, itms, $cfs);
1607
+ }
1608
+
1609
+ var $cit = $cfs.children().eq(num);
1610
+ if ($cit.length) {
1611
+ $cit[before](itm);
1612
+ }
1613
+ else {
1614
+ debug(conf, 'Correct insert-position not found! Appending item to the end.');
1615
+ $cfs.append(itm);
1616
+ }
1617
+
1618
+ if (orgNum != 'end' && !org) {
1619
+ if (num < itms.first) {
1620
+ itms.first += itm.length;
1621
+ }
1622
+ }
1623
+ itms.total = $cfs.children().length;
1624
+ if (itms.first >= itms.total) {
1625
+ itms.first -= itms.total;
1626
+ }
1627
+
1628
+ $cfs.trigger(cf_e('updateSizes', conf));
1629
+ $cfs.trigger(cf_e('linkAnchors', conf));
1630
+
1631
+ return true;
1632
+ });
1633
+
1634
+
1635
+ // removeItem event
1636
+ $cfs.bind(cf_e('removeItem', conf), function (e, num, org, dev) {
1637
+ e.stopPropagation();
1638
+
1639
+ var v = [num, org, dev],
1640
+ t = ['string/number/object', 'boolean', 'number'],
1641
+ a = cf_sortParams(v, t);
1642
+
1643
+ num = a[0];
1644
+ org = a[1];
1645
+ dev = a[2];
1646
+
1647
+ var removed = false;
1648
+
1649
+ if (num instanceof $ && num.length > 1) {
1650
+ $removed = $();
1651
+ num.each(function (i, el) {
1652
+ var $rem = $cfs.trigger(cf_e('removeItem', conf), [$(this), org, dev]);
1653
+ if ($rem) {
1654
+ $removed = $removed.add($rem);
1655
+ }
1656
+ });
1657
+ return $removed;
1658
+ }
1659
+
1660
+ if (is_undefined(num) || num == 'end') {
1661
+ $removed = $cfs.children().last();
1662
+ }
1663
+ else {
1664
+ num = gn_getItemIndex(num, dev, org, itms, $cfs);
1665
+ var $removed = $cfs.children().eq(num);
1666
+ if ($removed.length) {
1667
+ if (num < itms.first) {
1668
+ itms.first -= $removed.length;
1669
+ }
1670
+ }
1671
+ }
1672
+ if ($removed && $removed.length) {
1673
+ $removed.detach();
1674
+ itms.total = $cfs.children().length;
1675
+ $cfs.trigger(cf_e('updateSizes', conf));
1676
+ }
1677
+
1678
+ return $removed;
1679
+ });
1680
+
1681
+
1682
+ // onBefore and onAfter event
1683
+ $cfs.bind(cf_e('onBefore', conf) + ' ' + cf_e('onAfter', conf), function (e, fn) {
1684
+ e.stopPropagation();
1685
+ var eType = e.type.slice(conf.events.prefix.length);
1686
+ if (is_array(fn)) {
1687
+ clbk[eType] = fn;
1688
+ }
1689
+ if (is_function(fn)) {
1690
+ clbk[eType].push(fn);
1691
+ }
1692
+ return clbk[eType];
1693
+ });
1694
+
1695
+
1696
+ // currentPosition event
1697
+ $cfs.bind(cf_e('currentPosition', conf), function (e, fn) {
1698
+ e.stopPropagation();
1699
+ if (itms.first == 0) {
1700
+ var val = 0;
1701
+ }
1702
+ else {
1703
+ var val = itms.total - itms.first;
1704
+ }
1705
+ if (is_function(fn)) {
1706
+ fn.call($tt0, val);
1707
+ }
1708
+ return val;
1709
+ });
1710
+
1711
+
1712
+ // currentPage event
1713
+ $cfs.bind(cf_e('currentPage', conf), function (e, fn) {
1714
+ e.stopPropagation();
1715
+ var ipp = opts.pagination.items || opts.items.visible,
1716
+ max = Math.ceil(itms.total / ipp - 1),
1717
+ nr;
1718
+ if (itms.first == 0) {
1719
+ nr = 0;
1720
+ }
1721
+ else if (itms.first < itms.total % ipp) {
1722
+ nr = 0;
1723
+ }
1724
+ else if (itms.first == ipp && !opts.circular) {
1725
+ nr = max;
1726
+ }
1727
+ else {
1728
+ nr = Math.round((itms.total - itms.first) / ipp);
1729
+ }
1730
+ if (nr < 0) {
1731
+ nr = 0;
1732
+ }
1733
+ if (nr > max) {
1734
+ nr = max;
1735
+ }
1736
+ if (is_function(fn)) {
1737
+ fn.call($tt0, nr);
1738
+ }
1739
+ return nr;
1740
+ });
1741
+
1742
+
1743
+ // currentVisible event
1744
+ $cfs.bind(cf_e('currentVisible', conf), function (e, fn) {
1745
+ e.stopPropagation();
1746
+ var $i = gi_getCurrentItems($cfs.children(), opts);
1747
+ if (is_function(fn)) {
1748
+ fn.call($tt0, $i);
1749
+ }
1750
+ return $i;
1751
+ });
1752
+
1753
+
1754
+ // slice event
1755
+ $cfs.bind(cf_e('slice', conf), function (e, f, l, fn) {
1756
+ e.stopPropagation();
1757
+
1758
+ if (itms.total == 0) {
1759
+ return false;
1760
+ }
1761
+
1762
+ var v = [f, l, fn],
1763
+ t = ['number', 'number', 'function'],
1764
+ a = cf_sortParams(v, t);
1765
+
1766
+ f = (is_number(a[0])) ? a[0] : 0;
1767
+ l = (is_number(a[1])) ? a[1] : itms.total;
1768
+ fn = a[2];
1769
+
1770
+ f += itms.first;
1771
+ l += itms.first;
1772
+
1773
+ if (items.total > 0) {
1774
+ while (f > itms.total) {
1775
+ f -= itms.total;
1776
+ }
1777
+ while (l > itms.total) {
1778
+ l -= itms.total;
1779
+ }
1780
+ while (f < 0) {
1781
+ f += itms.total;
1782
+ }
1783
+ while (l < 0) {
1784
+ l += itms.total;
1785
+ }
1786
+ }
1787
+ var $iA = $cfs.children(),
1788
+ $i;
1789
+
1790
+ if (l > f) {
1791
+ $i = $iA.slice(f, l);
1792
+ }
1793
+ else {
1794
+ $i = $($iA.slice(f, itms.total).get().concat($iA.slice(0, l).get()));
1795
+ }
1796
+
1797
+ if (is_function(fn)) {
1798
+ fn.call($tt0, $i);
1799
+ }
1800
+ return $i;
1801
+ });
1802
+
1803
+
1804
+ // isPaused, isStopped and isScrolling events
1805
+ $cfs.bind(cf_e('isPaused', conf) + ' ' + cf_e('isStopped', conf) + ' ' + cf_e('isScrolling', conf), function (e, fn) {
1806
+ e.stopPropagation();
1807
+ var eType = e.type.slice(conf.events.prefix.length),
1808
+ value = crsl[eType];
1809
+ if (is_function(fn)) {
1810
+ fn.call($tt0, value);
1811
+ }
1812
+ return value;
1813
+ });
1814
+
1815
+
1816
+ // configuration event
1817
+ $cfs.bind(cf_e('configuration', conf), function (e, a, b, c) {
1818
+ e.stopPropagation();
1819
+ var reInit = false;
1820
+
1821
+ // return entire configuration-object
1822
+ if (is_function(a)) {
1823
+ a.call($tt0, opts);
1824
+ }
1825
+ // set multiple options via object
1826
+ else if (is_object(a)) {
1827
+ opts_orig = $.extend(true, {}, opts_orig, a);
1828
+ if (b !== false) reInit = true;
1829
+ else opts = $.extend(true, {}, opts, a);
1830
+
1831
+ }
1832
+ else if (!is_undefined(a)) {
1833
+
1834
+ // callback function for specific option
1835
+ if (is_function(b)) {
1836
+ var val = eval('opts.' + a);
1837
+ if (is_undefined(val)) {
1838
+ val = '';
1839
+ }
1840
+ b.call($tt0, val);
1841
+ }
1842
+ // set individual option
1843
+ else if (!is_undefined(b)) {
1844
+ if (typeof c !== 'boolean') c = true;
1845
+ eval('opts_orig.' + a + ' = b');
1846
+ if (c !== false) reInit = true;
1847
+ else eval('opts.' + a + ' = b');
1848
+ }
1849
+ // return value for specific option
1850
+ else {
1851
+ return eval('opts.' + a);
1852
+ }
1853
+ }
1854
+ if (reInit) {
1855
+ sz_resetMargin($cfs.children(), opts);
1856
+ FN._init(opts_orig);
1857
+ FN._bind_buttons();
1858
+ var sz = sz_setSizes($cfs, opts);
1859
+ $cfs.trigger(cf_e('updatePageStatus', conf), [true, sz]);
1860
+ }
1861
+ return opts;
1862
+ });
1863
+
1864
+
1865
+ // linkAnchors event
1866
+ $cfs.bind(cf_e('linkAnchors', conf), function (e, $con, sel) {
1867
+ e.stopPropagation();
1868
+
1869
+ if (is_undefined($con)) {
1870
+ $con = $('body');
1871
+ }
1872
+ else if (is_string($con)) {
1873
+ $con = $($con);
1874
+ }
1875
+ if (!is_jquery($con) || $con.length == 0) {
1876
+ return debug(conf, 'Not a valid object.');
1877
+ }
1878
+ if (!is_string(sel)) {
1879
+ sel = 'a.caroufredsel';
1880
+ }
1881
+
1882
+ $con.find(sel).each(function () {
1883
+ var h = this.hash || '';
1884
+ if (h.length > 0 && $cfs.children().index($(h)) != -1) {
1885
+ $(this).unbind('click').click(function (e) {
1886
+ e.preventDefault();
1887
+ $cfs.trigger(cf_e('slideTo', conf), h);
1888
+ });
1889
+ }
1890
+ });
1891
+ return true;
1892
+ });
1893
+
1894
+
1895
+ // updatePageStatus event
1896
+ $cfs.bind(cf_e('updatePageStatus', conf), function (e, build, sizes) {
1897
+ e.stopPropagation();
1898
+ if (!opts.pagination.container) {
1899
+ return;
1900
+ }
1901
+
1902
+ var ipp = opts.pagination.items || opts.items.visible,
1903
+ pgs = Math.ceil(itms.total / ipp);
1904
+
1905
+ if (build) {
1906
+ if (opts.pagination.anchorBuilder) {
1907
+ opts.pagination.container.children().remove();
1908
+ opts.pagination.container.each(function () {
1909
+ for (var a = 0; a < pgs; a++) {
1910
+ var i = $cfs.children().eq(gn_getItemIndex(a * ipp, 0, true, itms, $cfs));
1911
+ $(this).append(opts.pagination.anchorBuilder.call(i[0], a + 1));
1912
+ }
1913
+ });
1914
+ }
1915
+ opts.pagination.container.each(function () {
1916
+ $(this).children().unbind(opts.pagination.event).each(function (a) {
1917
+ $(this).bind(opts.pagination.event, function (e) {
1918
+ e.preventDefault();
1919
+ $cfs.trigger(cf_e('slideTo', conf), [a * ipp, -opts.pagination.deviation, true, opts.pagination]);
1920
+ });
1921
+ });
1922
+ });
1923
+ }
1924
+
1925
+ var selected = $cfs.triggerHandler(cf_e('currentPage', conf)) + opts.pagination.deviation;
1926
+ if (selected >= pgs) {
1927
+ selected = 0;
1928
+ }
1929
+ if (selected < 0) {
1930
+ selected = pgs - 1;
1931
+ }
1932
+ opts.pagination.container.each(function () {
1933
+ $(this).children().removeClass(cf_c('selected', conf)).eq(selected).addClass(cf_c('selected', conf));
1934
+ });
1935
+ return true;
1936
+ });
1937
+
1938
+
1939
+ // updateSizes event
1940
+ $cfs.bind(cf_e('updateSizes', conf), function (e) {
1941
+ var vI = opts.items.visible,
1942
+ a_itm = $cfs.children(),
1943
+ avail_primary = ms_getParentSize($wrp, opts, 'width');
1944
+
1945
+ itms.total = a_itm.length;
1946
+
1947
+ if (crsl.primarySizePercentage) {
1948
+ opts.maxDimension = avail_primary;
1949
+ opts[opts.d['width']] = ms_getPercentage(avail_primary, crsl.primarySizePercentage);
1950
+ }
1951
+ else {
1952
+ opts.maxDimension = ms_getMaxDimension(opts, avail_primary);
1953
+ }
1954
+
1955
+ if (opts.responsive) {
1956
+ opts.items.width = opts.items.sizesConf.width;
1957
+ opts.items.height = opts.items.sizesConf.height;
1958
+ opts = in_getResponsiveValues(opts, a_itm, avail_primary);
1959
+ vI = opts.items.visible;
1960
+ sz_setResponsiveSizes(opts, a_itm);
1961
+ }
1962
+ else if (opts.items.visibleConf.variable) {
1963
+ vI = gn_getVisibleItemsNext(a_itm, opts, 0);
1964
+ }
1965
+ else if (opts.items.filter != '*') {
1966
+ vI = gn_getVisibleItemsNextFilter(a_itm, opts, 0);
1967
+ }
1968
+
1969
+ if (!opts.circular && itms.first != 0 && vI > itms.first) {
1970
+ if (opts.items.visibleConf.variable) {
1971
+ var nI = gn_getVisibleItemsPrev(a_itm, opts, itms.first) - itms.first;
1972
+ }
1973
+ else if (opts.items.filter != '*') {
1974
+ var nI = gn_getVisibleItemsPrevFilter(a_itm, opts, itms.first) - itms.first;
1975
+ }
1976
+ else {
1977
+ var nI = opts.items.visible - itms.first;
1978
+ }
1979
+ debug(conf, 'Preventing non-circular: sliding ' + nI + ' items backward.');
1980
+ $cfs.trigger(cf_e('prev', conf), nI);
1981
+ }
1982
+
1983
+ opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0);
1984
+ opts.items.visibleConf.old = opts.items.visible;
1985
+ opts = in_getAlignPadding(opts, a_itm);
1986
+
1987
+ var sz = sz_setSizes($cfs, opts);
1988
+ $cfs.trigger(cf_e('updatePageStatus', conf), [true, sz]);
1989
+ nv_showNavi(opts, itms.total, conf);
1990
+ nv_enableNavi(opts, itms.first, conf);
1991
+
1992
+ return sz;
1993
+ });
1994
+
1995
+
1996
+ // destroy event
1997
+ $cfs.bind(cf_e('destroy', conf), function (e, orgOrder) {
1998
+ e.stopPropagation();
1999
+ tmrs = sc_clearTimers(tmrs);
2000
+
2001
+ $cfs.data('_cfs_isCarousel', false);
2002
+ $cfs.trigger(cf_e('finish', conf));
2003
+ if (orgOrder) {
2004
+ $cfs.trigger(cf_e('jumpToStart', conf));
2005
+ }
2006
+ sz_restoreOrigCss($cfs.children());
2007
+ sz_restoreOrigCss($cfs);
2008
+ FN._unbind_events();
2009
+ FN._unbind_buttons();
2010
+ if (conf.wrapper == 'parent') {
2011
+ sz_restoreOrigCss($wrp);
2012
+ }
2013
+ else {
2014
+ $wrp.replaceWith($cfs);
2015
+ }
2016
+
2017
+ return true;
2018
+ });
2019
+
2020
+
2021
+ // debug event
2022
+ $cfs.bind(cf_e('debug', conf), function (e) {
2023
+ debug(conf, 'Carousel width: ' + opts.width);
2024
+ debug(conf, 'Carousel height: ' + opts.height);
2025
+ debug(conf, 'Item widths: ' + opts.items.width);
2026
+ debug(conf, 'Item heights: ' + opts.items.height);
2027
+ debug(conf, 'Number of items visible: ' + opts.items.visible);
2028
+ if (opts.auto.play) {
2029
+ debug(conf, 'Number of items scrolled automatically: ' + opts.auto.items);
2030
+ }
2031
+ if (opts.prev.button) {
2032
+ debug(conf, 'Number of items scrolled backward: ' + opts.prev.items);
2033
+ }
2034
+ if (opts.next.button) {
2035
+ debug(conf, 'Number of items scrolled forward: ' + opts.next.items);
2036
+ }
2037
+ return conf.debug;
2038
+ });
2039
+
2040
+
2041
+ // triggerEvent, making prefixed and namespaced events accessible from outside
2042
+ $cfs.bind('_cfs_triggerEvent', function (e, n, o) {
2043
+ e.stopPropagation();
2044
+ return $cfs.triggerHandler(cf_e(n, conf), o);
2045
+ });
2046
+ }; // /bind_events
2047
+
2048
+
2049
+ FN._unbind_events = function () {
2050
+ $cfs.unbind(cf_e('', conf));
2051
+ $cfs.unbind(cf_e('', conf, false));
2052
+ $cfs.unbind('_cfs_triggerEvent');
2053
+ }; // /unbind_events
2054
+
2055
+
2056
+ FN._bind_buttons = function () {
2057
+ FN._unbind_buttons();
2058
+ nv_showNavi(opts, itms.total, conf);
2059
+ nv_enableNavi(opts, itms.first, conf);
2060
+
2061
+ if (opts.auto.pauseOnHover) {
2062
+ var pC = bt_pauseOnHoverConfig(opts.auto.pauseOnHover);
2063
+ $wrp.bind(cf_e('mouseenter', conf, false), function () {
2064
+ $cfs.trigger(cf_e('pause', conf), pC);
2065
+ })
2066
+ .bind(cf_e('mouseleave', conf, false), function () {
2067
+ $cfs.trigger(cf_e('resume', conf));
2068
+ });
2069
+ }
2070
+
2071
+ // play button
2072
+ if (opts.auto.button) {
2073
+ opts.auto.button.bind(cf_e(opts.auto.event, conf, false), function (e) {
2074
+ e.preventDefault();
2075
+ var ev = false,
2076
+ pC = null;
2077
+
2078
+ if (crsl.isPaused) {
2079
+ ev = 'play';
2080
+ }
2081
+ else if (opts.auto.pauseOnEvent) {
2082
+ ev = 'pause';
2083
+ pC = bt_pauseOnHoverConfig(opts.auto.pauseOnEvent);
2084
+ }
2085
+ if (ev) {
2086
+ $cfs.trigger(cf_e(ev, conf), pC);
2087
+ }
2088
+ });
2089
+ }
2090
+
2091
+ // prev button
2092
+ if (opts.prev.button) {
2093
+ opts.prev.button.bind(cf_e(opts.prev.event, conf, false), function (e) {
2094
+ e.preventDefault();
2095
+ $cfs.trigger(cf_e('prev', conf));
2096
+ });
2097
+ if (opts.prev.pauseOnHover) {
2098
+ var pC = bt_pauseOnHoverConfig(opts.prev.pauseOnHover);
2099
+ opts.prev.button.bind(cf_e('mouseenter', conf, false), function () {
2100
+ $cfs.trigger(cf_e('pause', conf), pC);
2101
+ })
2102
+ .bind(cf_e('mouseleave', conf, false), function () {
2103
+ $cfs.trigger(cf_e('resume', conf));
2104
+ });
2105
+ }
2106
+ }
2107
+
2108
+ // next butotn
2109
+ if (opts.next.button) {
2110
+ opts.next.button.bind(cf_e(opts.next.event, conf, false), function (e) {
2111
+ e.preventDefault();
2112
+ $cfs.trigger(cf_e('next', conf));
2113
+ });
2114
+ if (opts.next.pauseOnHover) {
2115
+ var pC = bt_pauseOnHoverConfig(opts.next.pauseOnHover);
2116
+ opts.next.button.bind(cf_e('mouseenter', conf, false), function () {
2117
+ $cfs.trigger(cf_e('pause', conf), pC);
2118
+ })
2119
+ .bind(cf_e('mouseleave', conf, false), function () {
2120
+ $cfs.trigger(cf_e('resume', conf));
2121
+ });
2122
+ }
2123
+ }
2124
+
2125
+ // pagination
2126
+ if (opts.pagination.container) {
2127
+ if (opts.pagination.pauseOnHover) {
2128
+ var pC = bt_pauseOnHoverConfig(opts.pagination.pauseOnHover);
2129
+ opts.pagination.container.bind(cf_e('mouseenter', conf, false), function () {
2130
+ $cfs.trigger(cf_e('pause', conf), pC);
2131
+ })
2132
+ .bind(cf_e('mouseleave', conf, false), function () {
2133
+ $cfs.trigger(cf_e('resume', conf));
2134
+ });
2135
+ }
2136
+ }
2137
+
2138
+ // prev/next keys
2139
+ if (opts.prev.key || opts.next.key) {
2140
+ $(document).bind(cf_e('keyup', conf, false, true, true), function (e) {
2141
+ var k = e.keyCode;
2142
+ if (k == opts.next.key) {
2143
+ e.preventDefault();
2144
+ $cfs.trigger(cf_e('next', conf));
2145
+ }
2146
+ if (k == opts.prev.key) {
2147
+ e.preventDefault();
2148
+ $cfs.trigger(cf_e('prev', conf));
2149
+ }
2150
+ });
2151
+ }
2152
+
2153
+ // pagination keys
2154
+ if (opts.pagination.keys) {
2155
+ $(document).bind(cf_e('keyup', conf, false, true, true), function (e) {
2156
+ var k = e.keyCode;
2157
+ if (k >= 49 && k < 58) {
2158
+ k = (k - 49) * opts.items.visible;
2159
+ if (k <= itms.total) {
2160
+ e.preventDefault();
2161
+ $cfs.trigger(cf_e('slideTo', conf), [k, 0, true, opts.pagination]);
2162
+ }
2163
+ }
2164
+ });
2165
+ }
2166
+
2167
+ // swipe
2168
+ if ($.fn.swipe) {
2169
+ var isTouch = 'ontouchstart' in window;
2170
+ if ((isTouch && opts.swipe.onTouch) || (!isTouch && opts.swipe.onMouse)) {
2171
+ var scP = $.extend(true, {}, opts.prev, opts.swipe),
2172
+ scN = $.extend(true, {}, opts.next, opts.swipe),
2173
+ swP = function () {
2174
+ $cfs.trigger(cf_e('prev', conf), [scP])
2175
+ },
2176
+ swN = function () {
2177
+ $cfs.trigger(cf_e('next', conf), [scN])
2178
+ };
2179
+
2180
+ switch (opts.direction) {
2181
+ case 'up':
2182
+ case 'down':
2183
+ opts.swipe.options.swipeUp = swN;
2184
+ opts.swipe.options.swipeDown = swP;
2185
+ break;
2186
+ default:
2187
+ opts.swipe.options.swipeLeft = swN;
2188
+ opts.swipe.options.swipeRight = swP;
2189
+ }
2190
+ if (crsl.swipe) {
2191
+ $cfs.swipe('destroy');
2192
+ }
2193
+ $wrp.swipe(opts.swipe.options);
2194
+ $wrp.css('cursor', 'move');
2195
+ crsl.swipe = true;
2196
+ }
2197
+ }
2198
+
2199
+ // mousewheel
2200
+ if ($.fn.mousewheel) {
2201
+
2202
+ if (opts.mousewheel) {
2203
+ var mcP = $.extend(true, {}, opts.prev, opts.mousewheel),
2204
+ mcN = $.extend(true, {}, opts.next, opts.mousewheel);
2205
+
2206
+ if (crsl.mousewheel) {
2207
+ $wrp.unbind(cf_e('mousewheel', conf, false));
2208
+ }
2209
+ $wrp.bind(cf_e('mousewheel', conf, false), function (e, delta) {
2210
+ e.preventDefault();
2211
+ if (delta > 0) {
2212
+ $cfs.trigger(cf_e('prev', conf), [mcP]);
2213
+ }
2214
+ else {
2215
+ $cfs.trigger(cf_e('next', conf), [mcN]);
2216
+ }
2217
+ });
2218
+ crsl.mousewheel = true;
2219
+ }
2220
+ }
2221
+
2222
+ if (opts.auto.play) {
2223
+ $cfs.trigger(cf_e('play', conf), opts.auto.delay);
2224
+ }
2225
+
2226
+ if (crsl.upDateOnWindowResize) {
2227
+ var resizeFn = function (e) {
2228
+ $cfs.trigger(cf_e('finish', conf));
2229
+ if (opts.auto.pauseOnResize && !crsl.isPaused) {
2230
+ $cfs.trigger(cf_e('play', conf));
2231
+ }
2232
+ sz_resetMargin($cfs.children(), opts);
2233
+ $cfs.trigger(cf_e('updateSizes', conf));
2234
+ };
2235
+
2236
+ var $w = $(window),
2237
+ onResize = null;
2238
+
2239
+ if ($.debounce && conf.onWindowResize == 'debounce') {
2240
+ onResize = $.debounce(200, resizeFn);
2241
+ }
2242
+ else if ($.throttle && conf.onWindowResize == 'throttle') {
2243
+ onResize = $.throttle(300, resizeFn);
2244
+ }
2245
+ else {
2246
+ var _windowWidth = 0,
2247
+ _windowHeight = 0;
2248
+
2249
+ onResize = function () {
2250
+ var nw = $w.width(),
2251
+ nh = $w.height();
2252
+
2253
+ if (nw != _windowWidth || nh != _windowHeight) {
2254
+ resizeFn();
2255
+ _windowWidth = nw;
2256
+ _windowHeight = nh;
2257
+ }
2258
+ };
2259
+ }
2260
+ $w.bind(cf_e('resize', conf, false, true, true), onResize);
2261
+ }
2262
+ }; // /bind_buttons
2263
+
2264
+
2265
+ FN._unbind_buttons = function () {
2266
+ var ns1 = cf_e('', conf),
2267
+ ns2 = cf_e('', conf, false);
2268
+ ns3 = cf_e('', conf, false, true, true);
2269
+
2270
+ $(document).unbind(ns3);
2271
+ $(window).unbind(ns3);
2272
+ $wrp.unbind(ns2);
2273
+
2274
+ if (opts.auto.button) {
2275
+ opts.auto.button.unbind(ns2);
2276
+ }
2277
+ if (opts.prev.button) {
2278
+ opts.prev.button.unbind(ns2);
2279
+ }
2280
+ if (opts.next.button) {
2281
+ opts.next.button.unbind(ns2);
2282
+ }
2283
+ if (opts.pagination.container) {
2284
+ opts.pagination.container.unbind(ns2);
2285
+ if (opts.pagination.anchorBuilder) {
2286
+ opts.pagination.container.children().remove();
2287
+ }
2288
+ }
2289
+ if (crsl.swipe) {
2290
+ $cfs.swipe('destroy');
2291
+ $wrp.css('cursor', 'default');
2292
+ crsl.swipe = false;
2293
+ }
2294
+ if (crsl.mousewheel) {
2295
+ crsl.mousewheel = false;
2296
+ }
2297
+
2298
+ nv_showNavi(opts, 'hide', conf);
2299
+ nv_enableNavi(opts, 'removeClass', conf);
2300
+
2301
+ }; // /unbind_buttons
2302
+
2303
+
2304
+ // START
2305
+
2306
+ if (is_boolean(configs)) {
2307
+ configs = {
2308
+ 'debug': configs
2309
+ };
2310
+ }
2311
+
2312
+ // set vars
2313
+ var crsl = {
2314
+ 'direction': 'next',
2315
+ 'isPaused': true,
2316
+ 'isScrolling': false,
2317
+ 'isStopped': false,
2318
+ 'mousewheel': false,
2319
+ 'swipe': false
2320
+ },
2321
+ itms = {
2322
+ 'total': $cfs.children().length,
2323
+ 'first': 0
2324
+ },
2325
+ tmrs = {
2326
+ 'auto': null,
2327
+ 'progress': null,
2328
+ 'startTime': getTime(),
2329
+ 'timePassed': 0
2330
+ },
2331
+ scrl = {
2332
+ 'isStopped': false,
2333
+ 'duration': 0,
2334
+ 'startTime': 0,
2335
+ 'easing': '',
2336
+ 'anims': []
2337
+ },
2338
+ clbk = {
2339
+ 'onBefore': [],
2340
+ 'onAfter': []
2341
+ },
2342
+ queu = [],
2343
+ conf = $.extend(true, {}, $.fn.carouFredSel.configs, configs),
2344
+ opts = {},
2345
+ opts_orig = $.extend(true, {}, options),
2346
+ $wrp = (conf.wrapper == 'parent')
2347
+ ? $cfs.parent()
2348
+ : $cfs.wrap('<' + conf.wrapper.element + ' class="' + conf.wrapper.classname + '" />').parent();
2349
+
2350
+
2351
+ conf.selector = $cfs.selector;
2352
+ conf.serialNumber = $.fn.carouFredSel.serialNumber++;
2353
+
2354
+ conf.transition = (conf.transition && $.fn.transition) ? 'transition' : 'animate';
2355
+
2356
+ // create carousel
2357
+ FN._init(opts_orig, true, starting_position);
2358
+ FN._build();
2359
+ FN._bind_events();
2360
+ FN._bind_buttons();
2361
+
2362
+ // find item to start
2363
+ if (is_array(opts.items.start)) {
2364
+ var start_arr = opts.items.start;
2365
+ }
2366
+ else {
2367
+ var start_arr = [];
2368
+ if (opts.items.start != 0) {
2369
+ start_arr.push(opts.items.start);
2370
+ }
2371
+ }
2372
+ if (opts.cookie) {
2373
+ start_arr.unshift(parseInt(cf_getCookie(opts.cookie), 10));
2374
+ }
2375
+
2376
+ if (start_arr.length > 0) {
2377
+ for (var a = 0, l = start_arr.length; a < l; a++) {
2378
+ var s = start_arr[a];
2379
+ if (s == 0) {
2380
+ continue;
2381
+ }
2382
+ if (s === true) {
2383
+ s = window.location.hash;
2384
+ if (s.length < 1) {
2385
+ continue;
2386
+ }
2387
+ }
2388
+ else if (s === 'random') {
2389
+ s = Math.floor(Math.random() * itms.total);
2390
+ }
2391
+ if ($cfs.triggerHandler(cf_e('slideTo', conf), [s, 0, true, {fx: 'none'}])) {
2392
+ break;
2393
+ }
2394
+ }
2395
+ }
2396
+ var siz = sz_setSizes($cfs, opts),
2397
+ itm = gi_getCurrentItems($cfs.children(), opts);
2398
+
2399
+ if (opts.onCreate) {
2400
+ opts.onCreate.call($tt0, {
2401
+ 'width': siz.width,
2402
+ 'height': siz.height,
2403
+ 'items': itm
2404
+ });
2405
+ }
2406
+
2407
+ $cfs.trigger(cf_e('updatePageStatus', conf), [true, siz]);
2408
+ $cfs.trigger(cf_e('linkAnchors', conf));
2409
+
2410
+ if (conf.debug) {
2411
+ $cfs.trigger(cf_e('debug', conf));
2412
+ }
2413
+
2414
+ return $cfs;
2415
+ };
2416
+
2417
+
2418
+ // GLOBAL PUBLIC
2419
+
2420
+ $.fn.carouFredSel.serialNumber = 1;
2421
+ $.fn.carouFredSel.defaults = {
2422
+ 'synchronise': false,
2423
+ 'infinite': true,
2424
+ 'circular': true,
2425
+ 'responsive': true,
2426
+ 'direction': 'left',
2427
+ 'items': {
2428
+ 'start': 0
2429
+ },
2430
+ 'scroll': {
2431
+ 'easing': 'swing',
2432
+ 'duration': 500,
2433
+ 'pauseOnHover': false,
2434
+ 'event': 'click',
2435
+ 'queue': false
2436
+ }
2437
+ };
2438
+ $.fn.carouFredSel.configs = {
2439
+ 'padding': '5px',
2440
+
2441
+ 'debug': false,
2442
+ 'transition': false,
2443
+ 'onWindowResize': 'throttle',
2444
+ 'events': {
2445
+ 'prefix': '',
2446
+ 'namespace': 'cfs'
2447
+ },
2448
+ 'wrapper': {
2449
+ 'element': 'div',
2450
+ 'classname': 'caroufredsel_wrapper'
2451
+ },
2452
+ 'classnames': {}
2453
+ };
2454
+ $.fn.carouFredSel.pageAnchorBuilder = function (nr) {
2455
+ return '<a href="#"><span>' + nr + '</span></a>';
2456
+ };
2457
+ $.fn.carouFredSel.progressbarUpdater = function (perc) {
2458
+ $(this).css('width', perc + '%');
2459
+ };
2460
+
2461
+ $.fn.carouFredSel.cookie = {
2462
+ get: function (n) {
2463
+ n += '=';
2464
+ var ca = document.cookie.split(';');
2465
+ for (var a = 0, l = ca.length; a < l; a++) {
2466
+ var c = ca[a];
2467
+ while (c.charAt(0) == ' ') {
2468
+ c = c.slice(1);
2469
+ }
2470
+ if (c.indexOf(n) == 0) {
2471
+ return c.slice(n.length);
2472
+ }
2473
+ }
2474
+ return 0;
2475
+ },
2476
+ set: function (n, v, d) {
2477
+ var e = "";
2478
+ if (d) {
2479
+ var date = new Date();
2480
+ date.setTime(date.getTime() + (d * 24 * 60 * 60 * 1000));
2481
+ e = "; expires=" + date.toGMTString();
2482
+ }
2483
+ document.cookie = n + '=' + v + e + '; path=/';
2484
+ },
2485
+ remove: function (n) {
2486
+ $.fn.carouFredSel.cookie.set(n, "", -1);
2487
+ }
2488
+ };
2489
+
2490
+
2491
+ // GLOBAL PRIVATE
2492
+
2493
+ // scrolling functions
2494
+ function sc_setScroll(d, e, c) {
2495
+ if (c.transition == 'transition') {
2496
+ if (e == 'swing') {
2497
+ e = 'ease';
2498
+ }
2499
+ }
2500
+ return {
2501
+ anims: [],
2502
+ duration: d,
2503
+ orgDuration: d,
2504
+ easing: e,
2505
+ startTime: getTime()
2506
+ };
2507
+ }
2508
+
2509
+ function sc_startScroll(s, c) {
2510
+ for (var a = 0, l = s.anims.length; a < l; a++) {
2511
+ var b = s.anims[a];
2512
+ if (!b) {
2513
+ continue;
2514
+ }
2515
+ b[0][c.transition](b[1], s.duration, s.easing, b[2]);
2516
+ }
2517
+ }
2518
+
2519
+ function sc_stopScroll(s, finish) {
2520
+ if (!is_boolean(finish)) {
2521
+ finish = true;
2522
+ }
2523
+ if (is_object(s.pre)) {
2524
+ sc_stopScroll(s.pre, finish);
2525
+ }
2526
+ for (var a = 0, l = s.anims.length; a < l; a++) {
2527
+ var b = s.anims[a];
2528
+ b[0].stop(true);
2529
+ if (finish) {
2530
+ b[0].css(b[1]);
2531
+ if (is_function(b[2])) {
2532
+ b[2]();
2533
+ }
2534
+ }
2535
+ }
2536
+ if (is_object(s.post)) {
2537
+ sc_stopScroll(s.post, finish);
2538
+ }
2539
+ }
2540
+
2541
+ function sc_afterScroll($c, $c2, o) {
2542
+ if ($c2) {
2543
+ $c2.remove();
2544
+ }
2545
+
2546
+ switch (o.fx) {
2547
+ case 'fade':
2548
+ case 'crossfade':
2549
+ case 'cover-fade':
2550
+ case 'uncover-fade':
2551
+ $c.css('opacity', 1);
2552
+ $c.css('filter', '');
2553
+ break;
2554
+ }
2555
+ }
2556
+
2557
+ function sc_fireCallbacks($t, o, b, a, c) {
2558
+ if (o[b]) {
2559
+ o[b].call($t, a);
2560
+ }
2561
+ if (c[b].length) {
2562
+ for (var i = 0, l = c[b].length; i < l; i++) {
2563
+ c[b][i].call($t, a);
2564
+ }
2565
+ }
2566
+ return [];
2567
+ }
2568
+
2569
+ function sc_fireQueue($c, q, c) {
2570
+
2571
+ if (q.length) {
2572
+ $c.trigger(cf_e(q[0][0], c), q[0][1]);
2573
+ q.shift();
2574
+ }
2575
+ return q;
2576
+ }
2577
+
2578
+ function sc_hideHiddenItems(hiddenitems) {
2579
+ hiddenitems.each(function () {
2580
+ var hi = $(this);
2581
+ hi.data('_cfs_isHidden', hi.is(':hidden')).hide();
2582
+ });
2583
+ }
2584
+
2585
+ function sc_showHiddenItems(hiddenitems) {
2586
+ if (hiddenitems) {
2587
+ hiddenitems.each(function () {
2588
+ var hi = $(this);
2589
+ if (!hi.data('_cfs_isHidden')) {
2590
+ hi.show();
2591
+ }
2592
+ });
2593
+ }
2594
+ }
2595
+
2596
+ function sc_clearTimers(t) {
2597
+ if (t.auto) {
2598
+ clearTimeout(t.auto);
2599
+ }
2600
+ if (t.progress) {
2601
+ clearInterval(t.progress);
2602
+ }
2603
+ return t;
2604
+ }
2605
+
2606
+ function sc_mapCallbackArguments(i_old, i_skp, i_new, s_itm, s_dir, s_dur, w_siz) {
2607
+ return {
2608
+ 'width': w_siz.width,
2609
+ 'height': w_siz.height,
2610
+ 'items': {
2611
+ 'old': i_old,
2612
+ 'skipped': i_skp,
2613
+ 'visible': i_new
2614
+ },
2615
+ 'scroll': {
2616
+ 'items': s_itm,
2617
+ 'direction': s_dir,
2618
+ 'duration': s_dur
2619
+ }
2620
+ };
2621
+ }
2622
+
2623
+ function sc_getDuration(sO, o, nI, siz) {
2624
+ var dur = sO.duration;
2625
+ if (sO.fx == 'none') {
2626
+ return 0;
2627
+ }
2628
+ if (dur == 'auto') {
2629
+ dur = o.scroll.duration / o.scroll.items * nI;
2630
+ }
2631
+ else if (dur < 10) {
2632
+ dur = siz / dur;
2633
+ }
2634
+ if (dur < 1) {
2635
+ return 0;
2636
+ }
2637
+ if (sO.fx == 'fade') {
2638
+ dur = dur / 2;
2639
+ }
2640
+ return Math.round(dur);
2641
+ }
2642
+
2643
+ // navigation functions
2644
+ function nv_showNavi(o, t, c) {
2645
+ var minimum = (is_number(o.items.minimum)) ? o.items.minimum : o.items.visible + 1;
2646
+ if (t == 'show' || t == 'hide') {
2647
+ var f = t;
2648
+ }
2649
+ else if (minimum > t) {
2650
+ debug(c, 'Not enough items (' + t + ' total, ' + minimum + ' needed): Hiding navigation.');
2651
+ var f = 'hide';
2652
+ }
2653
+ else {
2654
+ var f = 'show';
2655
+ }
2656
+ var s = (f == 'show') ? 'removeClass' : 'addClass',
2657
+ h = cf_c('hidden', c);
2658
+
2659
+ if (o.auto.button) {
2660
+ o.auto.button[f]()[s](h);
2661
+ }
2662
+ if (o.prev.button) {
2663
+ o.prev.button[f]()[s](h);
2664
+ }
2665
+ if (o.next.button) {
2666
+ o.next.button[f]()[s](h);
2667
+ }
2668
+ if (o.pagination.container) {
2669
+ o.pagination.container[f]()[s](h);
2670
+ }
2671
+ }
2672
+
2673
+ function nv_enableNavi(o, f, c) {
2674
+ if (o.circular || o.infinite) return;
2675
+ var fx = (f == 'removeClass' || f == 'addClass') ? f : false,
2676
+ di = cf_c('disabled', c);
2677
+
2678
+ if (o.auto.button && fx) {
2679
+ o.auto.button[fx](di);
2680
+ }
2681
+ if (o.prev.button) {
2682
+ var fn = fx || (f == 0) ? 'addClass' : 'removeClass';
2683
+ o.prev.button[fn](di);
2684
+ }
2685
+ if (o.next.button) {
2686
+ var fn = fx || (f == o.items.visible) ? 'addClass' : 'removeClass';
2687
+ o.next.button[fn](di);
2688
+ }
2689
+ }
2690
+
2691
+ // get object functions
2692
+ function go_getObject($tt, obj) {
2693
+ if (is_function(obj)) {
2694
+ obj = obj.call($tt);
2695
+ }
2696
+ else if (is_undefined(obj)) {
2697
+ obj = {};
2698
+ }
2699
+ return obj;
2700
+ }
2701
+
2702
+ function go_getItemsObject($tt, obj) {
2703
+ obj = go_getObject($tt, obj);
2704
+ if (is_number(obj)) {
2705
+ obj = {
2706
+ 'visible': obj
2707
+ };
2708
+ }
2709
+ else if (obj == 'variable') {
2710
+ obj = {
2711
+ 'visible': obj,
2712
+ 'width': obj,
2713
+ 'height': obj
2714
+ };
2715
+ }
2716
+ else if (!is_object(obj)) {
2717
+ obj = {};
2718
+ }
2719
+ return obj;
2720
+ }
2721
+
2722
+ function go_getScrollObject($tt, obj) {
2723
+ obj = go_getObject($tt, obj);
2724
+ if (is_number(obj)) {
2725
+ if (obj <= 50) {
2726
+ obj = {
2727
+ 'items': obj
2728
+ };
2729
+ }
2730
+ else {
2731
+ obj = {
2732
+ 'duration': obj
2733
+ };
2734
+ }
2735
+ }
2736
+ else if (is_string(obj)) {
2737
+ obj = {
2738
+ 'easing': obj
2739
+ };
2740
+ }
2741
+ else if (!is_object(obj)) {
2742
+ obj = {};
2743
+ }
2744
+ return obj;
2745
+ }
2746
+
2747
+ function go_getNaviObject($tt, obj) {
2748
+ obj = go_getObject($tt, obj);
2749
+ if (is_string(obj)) {
2750
+ var temp = cf_getKeyCode(obj);
2751
+ if (temp == -1) {
2752
+ obj = $(obj);
2753
+ }
2754
+ else {
2755
+ obj = temp;
2756
+ }
2757
+ }
2758
+ return obj;
2759
+ }
2760
+
2761
+ function go_getAutoObject($tt, obj) {
2762
+ obj = go_getNaviObject($tt, obj);
2763
+ if (is_jquery(obj)) {
2764
+ obj = {
2765
+ 'button': obj
2766
+ };
2767
+ }
2768
+ else if (is_boolean(obj)) {
2769
+ obj = {
2770
+ 'play': obj
2771
+ };
2772
+ }
2773
+ else if (is_number(obj)) {
2774
+ obj = {
2775
+ 'timeoutDuration': obj
2776
+ };
2777
+ }
2778
+ if (obj.progress) {
2779
+ if (is_string(obj.progress) || is_jquery(obj.progress)) {
2780
+ obj.progress = {
2781
+ 'bar': obj.progress
2782
+ };
2783
+ }
2784
+ }
2785
+ return obj;
2786
+ }
2787
+
2788
+ function go_complementAutoObject($tt, obj) {
2789
+ if (is_function(obj.button)) {
2790
+ obj.button = obj.button.call($tt);
2791
+ }
2792
+ if (is_string(obj.button)) {
2793
+ obj.button = $(obj.button);
2794
+ }
2795
+ if (!is_boolean(obj.play)) {
2796
+ obj.play = true;
2797
+ }
2798
+ if (!is_number(obj.delay)) {
2799
+ obj.delay = 0;
2800
+ }
2801
+ if (is_undefined(obj.pauseOnEvent)) {
2802
+ obj.pauseOnEvent = true;
2803
+ }
2804
+ if (!is_boolean(obj.pauseOnResize)) {
2805
+ obj.pauseOnResize = true;
2806
+ }
2807
+ if (!is_number(obj.timeoutDuration)) {
2808
+ obj.timeoutDuration = (obj.duration < 10)
2809
+ ? 2500
2810
+ : obj.duration * 5;
2811
+ }
2812
+ if (obj.progress) {
2813
+ if (is_function(obj.progress.bar)) {
2814
+ obj.progress.bar = obj.progress.bar.call($tt);
2815
+ }
2816
+ if (is_string(obj.progress.bar)) {
2817
+ obj.progress.bar = $(obj.progress.bar);
2818
+ }
2819
+ if (obj.progress.bar) {
2820
+ if (!is_function(obj.progress.updater)) {
2821
+ obj.progress.updater = $.fn.carouFredSel.progressbarUpdater;
2822
+ }
2823
+ if (!is_number(obj.progress.interval)) {
2824
+ obj.progress.interval = 50;
2825
+ }
2826
+ }
2827
+ else {
2828
+ obj.progress = false;
2829
+ }
2830
+ }
2831
+ return obj;
2832
+ }
2833
+
2834
+ function go_getPrevNextObject($tt, obj) {
2835
+ obj = go_getNaviObject($tt, obj);
2836
+ if (is_jquery(obj)) {
2837
+ obj = {
2838
+ 'button': obj
2839
+ };
2840
+ }
2841
+ else if (is_number(obj)) {
2842
+ obj = {
2843
+ 'key': obj
2844
+ };
2845
+ }
2846
+ return obj;
2847
+ }
2848
+
2849
+ function go_complementPrevNextObject($tt, obj) {
2850
+ if (is_function(obj.button)) {
2851
+ obj.button = obj.button.call($tt);
2852
+ }
2853
+ if (is_string(obj.button)) {
2854
+ obj.button = $(obj.button);
2855
+ }
2856
+ if (is_string(obj.key)) {
2857
+ obj.key = cf_getKeyCode(obj.key);
2858
+ }
2859
+ return obj;
2860
+ }
2861
+
2862
+ function go_getPaginationObject($tt, obj) {
2863
+ obj = go_getNaviObject($tt, obj);
2864
+ if (is_jquery(obj)) {
2865
+ obj = {
2866
+ 'container': obj
2867
+ };
2868
+ }
2869
+ else if (is_boolean(obj)) {
2870
+ obj = {
2871
+ 'keys': obj
2872
+ };
2873
+ }
2874
+ return obj;
2875
+ }
2876
+
2877
+ function go_complementPaginationObject($tt, obj) {
2878
+ if (is_function(obj.container)) {
2879
+ obj.container = obj.container.call($tt);
2880
+ }
2881
+ if (is_string(obj.container)) {
2882
+ obj.container = $(obj.container);
2883
+ }
2884
+ if (!is_number(obj.items)) {
2885
+ obj.items = false;
2886
+ }
2887
+ if (!is_boolean(obj.keys)) {
2888
+ obj.keys = false;
2889
+ }
2890
+ if (!is_function(obj.anchorBuilder) && !is_false(obj.anchorBuilder)) {
2891
+ obj.anchorBuilder = $.fn.carouFredSel.pageAnchorBuilder;
2892
+ }
2893
+ if (!is_number(obj.deviation)) {
2894
+ obj.deviation = 0;
2895
+ }
2896
+ return obj;
2897
+ }
2898
+
2899
+ function go_getSwipeObject($tt, obj) {
2900
+ if (is_function(obj)) {
2901
+ obj = obj.call($tt);
2902
+ }
2903
+ if (is_undefined(obj)) {
2904
+ obj = {
2905
+ 'onTouch': false
2906
+ };
2907
+ }
2908
+ if (is_true(obj)) {
2909
+ obj = {
2910
+ 'onTouch': obj
2911
+ };
2912
+ }
2913
+ else if (is_number(obj)) {
2914
+ obj = {
2915
+ 'items': obj
2916
+ };
2917
+ }
2918
+ return obj;
2919
+ }
2920
+
2921
+ function go_complementSwipeObject($tt, obj) {
2922
+ if (!is_boolean(obj.onTouch)) {
2923
+ obj.onTouch = true;
2924
+ }
2925
+ if (!is_boolean(obj.onMouse)) {
2926
+ obj.onMouse = false;
2927
+ }
2928
+ if (!is_object(obj.options)) {
2929
+ obj.options = {};
2930
+ }
2931
+ if (!is_boolean(obj.options.triggerOnTouchEnd)) {
2932
+ obj.options.triggerOnTouchEnd = false;
2933
+ }
2934
+ return obj;
2935
+ }
2936
+
2937
+ function go_getMousewheelObject($tt, obj) {
2938
+ if (is_function(obj)) {
2939
+ obj = obj.call($tt);
2940
+ }
2941
+ if (is_true(obj)) {
2942
+ obj = {};
2943
+ }
2944
+ else if (is_number(obj)) {
2945
+ obj = {
2946
+ 'items': obj
2947
+ };
2948
+ }
2949
+ else if (is_undefined(obj)) {
2950
+ obj = false;
2951
+ }
2952
+ return obj;
2953
+ }
2954
+
2955
+ function go_complementMousewheelObject($tt, obj) {
2956
+ return obj;
2957
+ }
2958
+
2959
+ // get number functions
2960
+ function gn_getItemIndex(num, dev, org, items, $cfs) {
2961
+ if (is_string(num)) {
2962
+ num = $(num, $cfs);
2963
+ }
2964
+
2965
+ if (is_object(num)) {
2966
+ num = $(num, $cfs);
2967
+ }
2968
+ if (is_jquery(num)) {
2969
+ num = $cfs.children().index(num);
2970
+ if (!is_boolean(org)) {
2971
+ org = false;
2972
+ }
2973
+ }
2974
+ else {
2975
+ if (!is_boolean(org)) {
2976
+ org = true;
2977
+ }
2978
+ }
2979
+ if (!is_number(num)) {
2980
+ num = 0;
2981
+ }
2982
+ if (!is_number(dev)) {
2983
+ dev = 0;
2984
+ }
2985
+
2986
+ if (org) {
2987
+ num += items.first;
2988
+ }
2989
+ num += dev;
2990
+ if (items.total > 0) {
2991
+ while (num >= items.total) {
2992
+ num -= items.total;
2993
+ }
2994
+ while (num < 0) {
2995
+ num += items.total;
2996
+ }
2997
+ }
2998
+ return num;
2999
+ }
3000
+
3001
+ // items prev
3002
+ function gn_getVisibleItemsPrev(i, o, s) {
3003
+ var t = 0,
3004
+ x = 0;
3005
+
3006
+ for (var a = s; a >= 0; a--) {
3007
+ var j = i.eq(a);
3008
+ t += (j.is(':visible')) ? j[o.d['outerWidth']](true) : 0;
3009
+ if (t > o.maxDimension) {
3010
+ return x;
3011
+ }
3012
+ if (a == 0) {
3013
+ a = i.length;
3014
+ }
3015
+ x++;
3016
+ }
3017
+ }
3018
+
3019
+ function gn_getVisibleItemsPrevFilter(i, o, s) {
3020
+ return gn_getItemsPrevFilter(i, o.items.filter, o.items.visibleConf.org, s);
3021
+ }
3022
+
3023
+ function gn_getScrollItemsPrevFilter(i, o, s, m) {
3024
+ return gn_getItemsPrevFilter(i, o.items.filter, m, s);
3025
+ }
3026
+
3027
+ function gn_getItemsPrevFilter(i, f, m, s) {
3028
+ var t = 0,
3029
+ x = 0;
3030
+
3031
+ for (var a = s, l = i.length; a >= 0; a--) {
3032
+ x++;
3033
+ if (x == l) {
3034
+ return x;
3035
+ }
3036
+
3037
+ var j = i.eq(a);
3038
+ if (j.is(f)) {
3039
+ t++;
3040
+ if (t == m) {
3041
+ return x;
3042
+ }
3043
+ }
3044
+ if (a == 0) {
3045
+ a = l;
3046
+ }
3047
+ }
3048
+ }
3049
+
3050
+ function gn_getVisibleOrg($c, o) {
3051
+ return o.items.visibleConf.org || $c.children().slice(0, o.items.visible).filter(o.items.filter).length;
3052
+ }
3053
+
3054
+ // items next
3055
+ function gn_getVisibleItemsNext(i, o, s) {
3056
+ var t = 0,
3057
+ x = 0;
3058
+
3059
+ for (var a = s, l = i.length - 1; a <= l; a++) {
3060
+ var j = i.eq(a);
3061
+
3062
+ t += (j.is(':visible')) ? j[o.d['outerWidth']](true) : 0;
3063
+ if (t > o.maxDimension) {
3064
+ return x;
3065
+ }
3066
+
3067
+ x++;
3068
+ if (x == l + 1) {
3069
+ return x;
3070
+ }
3071
+ if (a == l) {
3072
+ a = -1;
3073
+ }
3074
+ }
3075
+ }
3076
+
3077
+ function gn_getVisibleItemsNextTestCircular(i, o, s, l) {
3078
+ var v = gn_getVisibleItemsNext(i, o, s);
3079
+ if (!o.circular) {
3080
+ if (s + v > l) {
3081
+ v = l - s;
3082
+ }
3083
+ }
3084
+ return v;
3085
+ }
3086
+
3087
+ function gn_getVisibleItemsNextFilter(i, o, s) {
3088
+ return gn_getItemsNextFilter(i, o.items.filter, o.items.visibleConf.org, s, o.circular);
3089
+ }
3090
+
3091
+ function gn_getScrollItemsNextFilter(i, o, s, m) {
3092
+ return gn_getItemsNextFilter(i, o.items.filter, m + 1, s, o.circular) - 1;
3093
+ }
3094
+
3095
+ function gn_getItemsNextFilter(i, f, m, s, c) {
3096
+ var t = 0,
3097
+ x = 0;
3098
+
3099
+ for (var a = s, l = i.length - 1; a <= l; a++) {
3100
+ x++;
3101
+ if (x >= l) {
3102
+ return x;
3103
+ }
3104
+
3105
+ var j = i.eq(a);
3106
+ if (j.is(f)) {
3107
+ t++;
3108
+ if (t == m) {
3109
+ return x;
3110
+ }
3111
+ }
3112
+ if (a == l) {
3113
+ a = -1;
3114
+ }
3115
+ }
3116
+ }
3117
+
3118
+ // get items functions
3119
+ function gi_getCurrentItems(i, o) {
3120
+ return i.slice(0, o.items.visible);
3121
+ }
3122
+
3123
+ function gi_getOldItemsPrev(i, o, n) {
3124
+ return i.slice(n, o.items.visibleConf.old + n);
3125
+ }
3126
+
3127
+ function gi_getNewItemsPrev(i, o) {
3128
+ return i.slice(0, o.items.visible);
3129
+ }
3130
+
3131
+ function gi_getOldItemsNext(i, o) {
3132
+ return i.slice(0, o.items.visibleConf.old);
3133
+ }
3134
+
3135
+ function gi_getNewItemsNext(i, o, n) {
3136
+ return i.slice(n, o.items.visible + n);
3137
+ }
3138
+
3139
+ // sizes functions
3140
+ function sz_storeMargin(i, o, d) {
3141
+ if (o.usePadding) {
3142
+ if (!is_string(d)) {
3143
+ d = '_cfs_origCssMargin';
3144
+ }
3145
+ i.each(function () {
3146
+ var j = $(this),
3147
+ m = parseInt(j.css(o.d['marginRight']), 10);
3148
+ if (!is_number(m)) {
3149
+ m = 0;
3150
+ }
3151
+ j.data(d, m);
3152
+ });
3153
+ }
3154
+ }
3155
+
3156
+ function sz_resetMargin(i, o, m) {
3157
+ if (o.usePadding) {
3158
+ var x = (is_boolean(m)) ? m : false;
3159
+ if (!is_number(m)) {
3160
+ m = 0;
3161
+ }
3162
+ sz_storeMargin(i, o, '_cfs_tempCssMargin');
3163
+ i.each(function () {
3164
+ var j = $(this);
3165
+ j.css(o.d['marginRight'], ((x) ? j.data('_cfs_tempCssMargin') : m + j.data('_cfs_origCssMargin')));
3166
+ });
3167
+ }
3168
+ }
3169
+
3170
+ function sz_storeOrigCss(i) {
3171
+ i.each(function () {
3172
+ var j = $(this);
3173
+ j.data('_cfs_origCss', j.attr('style') || '');
3174
+ });
3175
+ }
3176
+
3177
+ function sz_restoreOrigCss(i) {
3178
+ i.each(function () {
3179
+ var j = $(this);
3180
+ j.attr('style', j.data('_cfs_origCss') || '');
3181
+ });
3182
+ }
3183
+
3184
+ function sz_setResponsiveSizes(o, all) {
3185
+ var visb = o.items.visible,
3186
+ newS = o.items[o.d['width']],
3187
+ seco = o[o.d['height']],
3188
+ secp = is_percentage(seco);
3189
+
3190
+ all.each(function () {
3191
+ var $t = $(this),
3192
+ nw = newS - ms_getPaddingBorderMargin($t, o, 'Width');
3193
+
3194
+ $t[o.d['width']](nw);
3195
+ if (secp) {
3196
+ $t[o.d['height']](ms_getPercentage(nw, seco));
3197
+ }
3198
+ });
3199
+ }
3200
+
3201
+ function sz_setSizes($c, o) {
3202
+ var $w = $c.parent(),
3203
+ $i = $c.children(),
3204
+ $v = gi_getCurrentItems($i, o),
3205
+ sz = cf_mapWrapperSizes(ms_getSizes($v, o, true), o, false);
3206
+
3207
+ $w.css(sz);
3208
+
3209
+ if (o.usePadding) {
3210
+ var p = o.padding,
3211
+ r = p[o.d[1]];
3212
+
3213
+ if (o.align && r < 0) {
3214
+ r = 0;
3215
+ }
3216
+ var $l = $v.last();
3217
+ $l.css(o.d['marginRight'], $l.data('_cfs_origCssMargin') + r);
3218
+ $c.css(o.d['top'], p[o.d[0]]);
3219
+ $c.css(o.d['left'], p[o.d[3]]);
3220
+ }
3221
+
3222
+ $c.css(o.d['width'], sz[o.d['width']] + (ms_getTotalSize($i, o, 'width') * 2));
3223
+ $c.css(o.d['height'], ms_getLargestSize($i, o, 'height'));
3224
+ return sz;
3225
+ }
3226
+
3227
+ // measuring functions
3228
+ function ms_getSizes(i, o, wrapper) {
3229
+ return [ms_getTotalSize(i, o, 'width', wrapper), ms_getLargestSize(i, o, 'height', wrapper)];
3230
+ }
3231
+
3232
+ function ms_getLargestSize(i, o, dim, wrapper) {
3233
+ if (!is_boolean(wrapper)) {
3234
+ wrapper = false;
3235
+ }
3236
+ if (is_number(o[o.d[dim]]) && wrapper) {
3237
+ return o[o.d[dim]];
3238
+ }
3239
+ if (is_number(o.items[o.d[dim]])) {
3240
+ return o.items[o.d[dim]];
3241
+ }
3242
+ dim = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight';
3243
+ return ms_getTrueLargestSize(i, o, dim);
3244
+ }
3245
+
3246
+ function ms_getTrueLargestSize(i, o, dim) {
3247
+ var s = 0;
3248
+
3249
+ for (var a = 0, l = i.length; a < l; a++) {
3250
+ var j = i.eq(a);
3251
+
3252
+ var m = (j.is(':visible')) ? j[o.d[dim]](true) : 0;
3253
+ if (s < m) {
3254
+ s = m;
3255
+ }
3256
+ }
3257
+ return s;
3258
+ }
3259
+
3260
+ function ms_getTotalSize(i, o, dim, wrapper) {
3261
+ if (!is_boolean(wrapper)) {
3262
+ wrapper = false;
3263
+ }
3264
+ if (is_number(o[o.d[dim]]) && wrapper) {
3265
+ return o[o.d[dim]];
3266
+ }
3267
+ if (is_number(o.items[o.d[dim]])) {
3268
+ return o.items[o.d[dim]] * i.length;
3269
+ }
3270
+
3271
+ var d = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight',
3272
+ s = 0;
3273
+
3274
+ for (var a = 0, l = i.length; a < l; a++) {
3275
+ var j = i.eq(a);
3276
+ s += (j.is(':visible')) ? j[o.d[d]](true) : 0;
3277
+ }
3278
+ return s;
3279
+ }
3280
+
3281
+ function ms_getParentSize($w, o, d) {
3282
+ var isVisible = $w.is(':visible');
3283
+ if (isVisible) {
3284
+ $w.hide();
3285
+ }
3286
+ var s = $w.parent()[o.d[d]]();
3287
+ if (isVisible) {
3288
+ $w.show();
3289
+ }
3290
+ return s;
3291
+ }
3292
+
3293
+ function ms_getMaxDimension(o, a) {
3294
+ return (is_number(o[o.d['width']])) ? o[o.d['width']] : a;
3295
+ }
3296
+
3297
+ function ms_hasVariableSizes(i, o, dim) {
3298
+ var s = false,
3299
+ v = false;
3300
+
3301
+ for (var a = 0, l = i.length; a < l; a++) {
3302
+ var j = i.eq(a);
3303
+
3304
+ var c = (j.is(':visible')) ? j[o.d[dim]](true) : 0;
3305
+ if (s === false) {
3306
+ s = c;
3307
+ }
3308
+ else if (s != c) {
3309
+ v = true;
3310
+ }
3311
+ if (s == 0) {
3312
+ v = true;
3313
+ }
3314
+ }
3315
+ return v;
3316
+ }
3317
+
3318
+ function ms_getPaddingBorderMargin(i, o, d) {
3319
+ return i[o.d['outer' + d]](true) - i[o.d[d.toLowerCase()]]();
3320
+ }
3321
+
3322
+ function ms_getPercentage(s, o) {
3323
+ if (is_percentage(o)) {
3324
+ o = parseInt(o.slice(0, -1), 10);
3325
+ if (!is_number(o)) {
3326
+ return s;
3327
+ }
3328
+ s *= o / 100;
3329
+ }
3330
+ return s;
3331
+ }
3332
+
3333
+ // config functions
3334
+ function cf_e(n, c, pf, ns, rd) {
3335
+ if (!is_boolean(pf)) {
3336
+ pf = true;
3337
+ }
3338
+ if (!is_boolean(ns)) {
3339
+ ns = true;
3340
+ }
3341
+ if (!is_boolean(rd)) {
3342
+ rd = false;
3343
+ }
3344
+
3345
+ if (pf) {
3346
+ n = c.events.prefix + n;
3347
+ }
3348
+ if (ns) {
3349
+ n = n + '.' + c.events.namespace;
3350
+ }
3351
+ if (ns && rd) {
3352
+ n += c.serialNumber;
3353
+ }
3354
+
3355
+ return n;
3356
+ }
3357
+
3358
+ function cf_c(n, c) {
3359
+ return (is_string(c.classnames[n])) ? c.classnames[n] : n;
3360
+ }
3361
+
3362
+ function cf_mapWrapperSizes(ws, o, p) {
3363
+
3364
+ if (!is_boolean(p)) {
3365
+ p = true;
3366
+ }
3367
+ var pad = (o.usePadding && p) ? o.padding : [0, 0, 0, 0];
3368
+ var wra = {};
3369
+
3370
+ wra[o.d['width']] = ws[0] + pad[1] + pad[3];
3371
+ wra[o.d['height']] = ws[1] + pad[0] + pad[2];
3372
+
3373
+ return wra;
3374
+ }
3375
+
3376
+ function cf_sortParams(vals, typs) {
3377
+ var arr = [];
3378
+ for (var a = 0, l1 = vals.length; a < l1; a++) {
3379
+ for (var b = 0, l2 = typs.length; b < l2; b++) {
3380
+ if (typs[b].indexOf(typeof vals[a]) > -1 && is_undefined(arr[b])) {
3381
+ arr[b] = vals[a];
3382
+ break;
3383
+ }
3384
+ }
3385
+ }
3386
+ return arr;
3387
+ }
3388
+
3389
+ function cf_getPadding(p) {
3390
+ if (is_undefined(p)) {
3391
+ return [0, 0, 0, 0];
3392
+ }
3393
+ if (is_number(p)) {
3394
+ return [p, p, p, p];
3395
+ }
3396
+ if (is_string(p)) {
3397
+ p = p.split('px').join('').split('em').join('').split(' ');
3398
+ }
3399
+
3400
+ if (!is_array(p)) {
3401
+ return [0, 0, 0, 0];
3402
+ }
3403
+ for (var i = 0; i < 4; i++) {
3404
+ p[i] = parseInt(p[i], 10);
3405
+ }
3406
+ switch (p.length) {
3407
+ case 0:
3408
+ return [0, 0, 0, 0];
3409
+ case 1:
3410
+ return [p[0], p[0], p[0], p[0]];
3411
+ case 2:
3412
+ return [p[0], p[1], p[0], p[1]];
3413
+ case 3:
3414
+ return [p[0], p[1], p[2], p[1]];
3415
+ default:
3416
+ return [p[0], p[1], p[2], p[3]];
3417
+ }
3418
+ }
3419
+
3420
+ function cf_getAlignPadding(itm, o) {
3421
+ var x = (is_number(o[o.d['width']])) ? Math.ceil(o[o.d['width']] - ms_getTotalSize(itm, o, 'width')) : 0;
3422
+ switch (o.align) {
3423
+ case 'left':
3424
+ return [0, x];
3425
+ case 'right':
3426
+ return [x, 0];
3427
+ case 'center':
3428
+ default:
3429
+ return [Math.ceil(x / 2), Math.floor(x / 2)];
3430
+ }
3431
+ }
3432
+
3433
+ function cf_getDimensions(o) {
3434
+ var dm = [
3435
+ ['width', 'innerWidth', 'outerWidth', 'height', 'innerHeight', 'outerHeight', 'left', 'top', 'marginRight', 0, 1, 2, 3],
3436
+ ['height', 'innerHeight', 'outerHeight', 'width', 'innerWidth', 'outerWidth', 'top', 'left', 'marginBottom', 3, 2, 1, 0]
3437
+ ];
3438
+
3439
+ var dl = dm[0].length,
3440
+ dx = (o.direction == 'right' || o.direction == 'left') ? 0 : 1;
3441
+
3442
+ var dimensions = {};
3443
+ for (var d = 0; d < dl; d++) {
3444
+ dimensions[dm[0][d]] = dm[dx][d];
3445
+ }
3446
+ return dimensions;
3447
+ }
3448
+
3449
+ function cf_getAdjust(x, o, a, $t) {
3450
+ var v = x;
3451
+ if (is_function(a)) {
3452
+ v = a.call($t, v);
3453
+
3454
+ }
3455
+ else if (is_string(a)) {
3456
+ var p = a.split('+'),
3457
+ m = a.split('-');
3458
+
3459
+ if (m.length > p.length) {
3460
+ var neg = true,
3461
+ sta = m[0],
3462
+ adj = m[1];
3463
+ }
3464
+ else {
3465
+ var neg = false,
3466
+ sta = p[0],
3467
+ adj = p[1];
3468
+ }
3469
+
3470
+ switch (sta) {
3471
+ case 'even':
3472
+ v = (x % 2 == 1) ? x - 1 : x;
3473
+ break;
3474
+ case 'odd':
3475
+ v = (x % 2 == 0) ? x - 1 : x;
3476
+ break;
3477
+ default:
3478
+ v = x;
3479
+ break;
3480
+ }
3481
+ adj = parseInt(adj, 10);
3482
+ if (is_number(adj)) {
3483
+ if (neg) {
3484
+ adj = -adj;
3485
+ }
3486
+ v += adj;
3487
+ }
3488
+ }
3489
+ if (!is_number(v) || v < 1) {
3490
+ v = 1;
3491
+ }
3492
+ return v;
3493
+ }
3494
+
3495
+ function cf_getItemsAdjust(x, o, a, $t) {
3496
+ return cf_getItemAdjustMinMax(cf_getAdjust(x, o, a, $t), o.items.visibleConf);
3497
+ }
3498
+
3499
+ function cf_getItemAdjustMinMax(v, i) {
3500
+ if (is_number(i.min) && v < i.min) {
3501
+ v = i.min;
3502
+ }
3503
+ if (is_number(i.max) && v > i.max) {
3504
+ v = i.max;
3505
+ }
3506
+ if (v < 1) {
3507
+ v = 1;
3508
+ }
3509
+ return v;
3510
+ }
3511
+
3512
+ function cf_getSynchArr(s) {
3513
+ if (!is_array(s)) {
3514
+ s = [[s]];
3515
+ }
3516
+ if (!is_array(s[0])) {
3517
+ s = [s];
3518
+ }
3519
+ for (var j = 0, l = s.length; j < l; j++) {
3520
+ if (is_string(s[j][0])) {
3521
+ s[j][0] = $(s[j][0]);
3522
+ }
3523
+ if (!is_boolean(s[j][1])) {
3524
+ s[j][1] = true;
3525
+ }
3526
+ if (!is_boolean(s[j][2])) {
3527
+ s[j][2] = true;
3528
+ }
3529
+ if (!is_number(s[j][3])) {
3530
+ s[j][3] = 0;
3531
+ }
3532
+ }
3533
+ return s;
3534
+ }
3535
+
3536
+ function cf_getKeyCode(k) {
3537
+ if (k == 'right') {
3538
+ return 39;
3539
+ }
3540
+ if (k == 'left') {
3541
+ return 37;
3542
+ }
3543
+ if (k == 'up') {
3544
+ return 38;
3545
+ }
3546
+ if (k == 'down') {
3547
+ return 40;
3548
+ }
3549
+ return -1;
3550
+ }
3551
+
3552
+ function cf_setCookie(n, $c, c) {
3553
+ if (n) {
3554
+ var v = $c.triggerHandler(cf_e('currentPosition', c));
3555
+ $.fn.carouFredSel.cookie.set(n, v);
3556
+ }
3557
+ }
3558
+
3559
+ function cf_getCookie(n) {
3560
+ var c = $.fn.carouFredSel.cookie.get(n);
3561
+ return (c == '') ? 0 : c;
3562
+ }
3563
+
3564
+ // init function
3565
+ function in_mapCss($elem, props) {
3566
+ var css = {};
3567
+ for (var p = 0, l = props.length; p < l; p++) {
3568
+ css[props[p]] = $elem.css(props[p]);
3569
+ }
3570
+ return css;
3571
+ }
3572
+
3573
+ function in_complementItems(obj, opt, itm, sta) {
3574
+ if (!is_object(obj.visibleConf)) {
3575
+ obj.visibleConf = {};
3576
+ }
3577
+ if (!is_object(obj.sizesConf)) {
3578
+ obj.sizesConf = {};
3579
+ }
3580
+
3581
+ if (obj.start == 0 && is_number(sta)) {
3582
+ obj.start = sta;
3583
+ }
3584
+
3585
+ // visible items
3586
+ if (is_object(obj.visible)) {
3587
+ obj.visibleConf.min = obj.visible.min;
3588
+ obj.visibleConf.max = obj.visible.max;
3589
+ obj.visible = false;
3590
+ }
3591
+ else if (is_string(obj.visible)) {
3592
+ // variable visible items
3593
+ if (obj.visible == 'variable') {
3594
+ obj.visibleConf.variable = true;
3595
+ }
3596
+ // adjust string visible items
3597
+ else {
3598
+ obj.visibleConf.adjust = obj.visible;
3599
+ }
3600
+ obj.visible = false;
3601
+ }
3602
+ else if (is_function(obj.visible)) {
3603
+ obj.visibleConf.adjust = obj.visible;
3604
+ obj.visible = false;
3605
+ }
3606
+
3607
+ // set items filter
3608
+ if (!is_string(obj.filter)) {
3609
+ obj.filter = (itm.filter(':hidden').length > 0) ? ':visible' : '*';
3610
+ }
3611
+
3612
+ // primary item-size not set
3613
+ if (!obj[opt.d['width']]) {
3614
+ // responsive carousel -> set to largest
3615
+ if (opt.responsive) {
3616
+ debug(true, 'Set a ' + opt.d['width'] + ' for the items!');
3617
+ obj[opt.d['width']] = ms_getTrueLargestSize(itm, opt, 'outerWidth');
3618
+ }
3619
+ // non-responsive -> measure it or set to "variable"
3620
+ else {
3621
+ obj[opt.d['width']] = (ms_hasVariableSizes(itm, opt, 'outerWidth'))
3622
+ ? 'variable'
3623
+ : itm[opt.d['outerWidth']](true);
3624
+ }
3625
+ }
3626
+
3627
+ // secondary item-size not set -> measure it or set to "variable"
3628
+ if (!obj[opt.d['height']]) {
3629
+ obj[opt.d['height']] = (ms_hasVariableSizes(itm, opt, 'outerHeight'))
3630
+ ? 'variable'
3631
+ : itm[opt.d['outerHeight']](true);
3632
+ }
3633
+
3634
+ obj.sizesConf.width = obj.width;
3635
+ obj.sizesConf.height = obj.height;
3636
+ return obj;
3637
+ }
3638
+
3639
+ function in_complementVisibleItems(opt, avl) {
3640
+ // primary item-size variable -> set visible items variable
3641
+ if (opt.items[opt.d['width']] == 'variable') {
3642
+ opt.items.visibleConf.variable = true;
3643
+ }
3644
+ if (!opt.items.visibleConf.variable) {
3645
+ // primary size is number -> calculate visible-items
3646
+ if (is_number(opt[opt.d['width']])) {
3647
+ opt.items.visible = Math.floor(opt[opt.d['width']] / opt.items[opt.d['width']]);
3648
+ }
3649
+ // measure and calculate primary size and visible-items
3650
+ else {
3651
+ opt.items.visible = Math.floor(avl / opt.items[opt.d['width']]);
3652
+ opt[opt.d['width']] = opt.items.visible * opt.items[opt.d['width']];
3653
+ if (!opt.items.visibleConf.adjust) {
3654
+ opt.align = false;
3655
+ }
3656
+ }
3657
+ if (opt.items.visible == 'Infinity' || opt.items.visible < 1) {
3658
+ debug(true, 'Not a valid number of visible items: Set to "variable".');
3659
+ opt.items.visibleConf.variable = true;
3660
+ }
3661
+ }
3662
+ return opt;
3663
+ }
3664
+
3665
+ function in_complementPrimarySize(obj, opt, all) {
3666
+ // primary size set to auto -> measure largest item-size and set it
3667
+ if (obj == 'auto') {
3668
+ obj = ms_getTrueLargestSize(all, opt, 'outerWidth');
3669
+ }
3670
+ return obj;
3671
+ }
3672
+
3673
+ function in_complementSecondarySize(obj, opt, all) {
3674
+ // secondary size set to auto -> measure largest item-size and set it
3675
+ if (obj == 'auto') {
3676
+ obj = ms_getTrueLargestSize(all, opt, 'outerHeight');
3677
+ }
3678
+ // secondary size not set -> set to secondary item-size
3679
+ if (!obj) {
3680
+ obj = opt.items[opt.d['height']];
3681
+ }
3682
+ return obj;
3683
+ }
3684
+
3685
+ function in_getAlignPadding(o, all) {
3686
+ var p = cf_getAlignPadding(gi_getCurrentItems(all, o), o);
3687
+ o.padding[o.d[1]] = p[1];
3688
+ o.padding[o.d[3]] = p[0];
3689
+ return o;
3690
+ }
3691
+
3692
+ function in_getResponsiveValues(o, all, avl) {
3693
+
3694
+ var visb = cf_getItemAdjustMinMax(Math.ceil(o[o.d['width']] / o.items[o.d['width']]), o.items.visibleConf);
3695
+ if (visb > all.length) {
3696
+ visb = all.length;
3697
+ }
3698
+
3699
+ var newS = Math.floor(o[o.d['width']] / visb);
3700
+
3701
+ o.items.visible = visb;
3702
+ o.items[o.d['width']] = newS;
3703
+ o[o.d['width']] = visb * newS;
3704
+ return o;
3705
+ }
3706
+
3707
+
3708
+ // buttons functions
3709
+ function bt_pauseOnHoverConfig(p) {
3710
+ if (is_string(p)) {
3711
+ var i = (p.indexOf('immediate') > -1) ? true : false,
3712
+ r = (p.indexOf('resume') > -1) ? true : false;
3713
+ }
3714
+ else {
3715
+ var i = r = false;
3716
+ }
3717
+ return [i, r];
3718
+ }
3719
+
3720
+ function bt_mousesheelNumber(mw) {
3721
+ return (is_number(mw)) ? mw : null
3722
+ }
3723
+
3724
+ // helper functions
3725
+ function is_null(a) {
3726
+ return (a === null);
3727
+ }
3728
+
3729
+ function is_undefined(a) {
3730
+ return (is_null(a) || typeof a == 'undefined' || a === '' || a === 'undefined');
3731
+ }
3732
+
3733
+ function is_array(a) {
3734
+ return (a instanceof Array);
3735
+ }
3736
+
3737
+ function is_jquery(a) {
3738
+ return (a instanceof jQuery);
3739
+ }
3740
+
3741
+ function is_object(a) {
3742
+ return ((a instanceof Object || typeof a == 'object') && !is_null(a) && !is_jquery(a) && !is_array(a) && !is_function(a));
3743
+ }
3744
+
3745
+ function is_number(a) {
3746
+ return ((a instanceof Number || typeof a == 'number') && !isNaN(a));
3747
+ }
3748
+
3749
+ function is_string(a) {
3750
+ return ((a instanceof String || typeof a == 'string') && !is_undefined(a) && !is_true(a) && !is_false(a));
3751
+ }
3752
+
3753
+ function is_function(a) {
3754
+ return (a instanceof Function || typeof a == 'function');
3755
+ }
3756
+
3757
+ function is_boolean(a) {
3758
+ return (a instanceof Boolean || typeof a == 'boolean' || is_true(a) || is_false(a));
3759
+ }
3760
+
3761
+ function is_true(a) {
3762
+ return (a === true || a === 'true');
3763
+ }
3764
+
3765
+ function is_false(a) {
3766
+ return (a === false || a === 'false');
3767
+ }
3768
+
3769
+ function is_percentage(x) {
3770
+ return (is_string(x) && x.slice(-1) == '%');
3771
+ }
3772
+
3773
+
3774
+ function getTime() {
3775
+ return new Date().getTime();
3776
+ }
3777
+
3778
+ function deprecated(o, n) {
3779
+ debug(true, o + ' is DEPRECATED, support for it will be removed. Use ' + n + ' instead.');
3780
+ }
3781
+
3782
+ function debug(d, m) {
3783
+ if (!is_undefined(window.console) && !is_undefined(window.console.log)) {
3784
+ if (is_object(d)) {
3785
+ var s = ' (' + d.selector + ')';
3786
+ d = d.debug;
3787
+ }
3788
+ else {
3789
+ var s = '';
3790
+ }
3791
+ if (!d) {
3792
+ return false;
3793
+ }
3794
+
3795
+ if (is_string(m)) {
3796
+ m = 'carouFredSel' + s + ': ' + m;
3797
+ }
3798
+ else {
3799
+ m = ['carouFredSel' + s + ':', m];
3800
+ }
3801
+ window.console.log(m);
3802
+ }
3803
+ return false;
3804
+ }
3805
+
3806
+
3807
+ // EASING FUNCTIONS
3808
+ $.extend($.easing, {
3809
+ 'quadratic': function (t) {
3810
+ var t2 = t * t;
3811
+ return t * (-t2 * t + 4 * t2 - 6 * t + 4);
3812
+ },
3813
+ 'cubic': function (t) {
3814
+ return t * (4 * t * t - 9 * t + 6);
3815
+ },
3816
+ 'elastic': function (t) {
3817
+ var t2 = t * t;
3818
+ return t * (33 * t2 * t2 - 106 * t2 * t + 126 * t2 - 67 * t + 15);
3819
+ }
3820
+ });
3821
+
3822
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3823
  })(jQuery);
assets/js/jquery.carouFredSel.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function($){function sc_setScroll(t,e,s){return"transition"==s.transition&&"swing"==e&&(e="ease"),{anims:[],duration:t,orgDuration:t,easing:e,startTime:getTime()}}function sc_startScroll(t,e){for(var s=0,i=t.anims.length;i>s;s++){var o=t.anims[s];o&&o[0][e.transition](o[1],t.duration,t.easing,o[2])}}function sc_stopScroll(t,e){is_boolean(e)||(e=!0),is_object(t.pre)&&sc_stopScroll(t.pre,e);for(var s=0,i=t.anims.length;i>s;s++){var o=t.anims[s];o[0].stop(!0),e&&(o[0].css(o[1]),is_function(o[2])&&o[2]())}is_object(t.post)&&sc_stopScroll(t.post,e)}function sc_afterScroll(t,e,s){switch(e&&e.remove(),s.fx){case"fade":case"crossfade":case"cover-fade":case"uncover-fade":t.css("opacity",1),t.css("filter","")}}function sc_fireCallbacks(t,e,s,i,o){if(e[s]&&e[s].call(t,i),o[s].length)for(var n=0,r=o[s].length;r>n;n++)o[s][n].call(t,i);return[]}function sc_fireQueue(t,e,s){return e.length&&(t.trigger(cf_e(e[0][0],s),e[0][1]),e.shift()),e}function sc_hideHiddenItems(t){t.each(function(){var t=$(this);t.data("_cfs_isHidden",t.is(":hidden")).hide()})}function sc_showHiddenItems(t){t&&t.each(function(){var t=$(this);t.data("_cfs_isHidden")||t.show()})}function sc_clearTimers(t){return t.auto&&clearTimeout(t.auto),t.progress&&clearInterval(t.progress),t}function sc_mapCallbackArguments(t,e,s,i,o,n,r){return{width:r.width,height:r.height,items:{old:t,skipped:e,visible:s},scroll:{items:i,direction:o,duration:n}}}function sc_getDuration(t,e,s,i){var o=t.duration;return"none"==t.fx?0:("auto"==o?o=e.scroll.duration/e.scroll.items*s:10>o&&(o=i/o),1>o?0:("fade"==t.fx&&(o/=2),Math.round(o)))}function nv_showNavi(t,e,s){var i=is_number(t.items.minimum)?t.items.minimum:t.items.visible+1;if("show"==e||"hide"==e)var o=e;else if(i>e){debug(s,"Not enough items ("+e+" total, "+i+" needed): Hiding navigation.");var o="hide"}else var o="show";var n="show"==o?"removeClass":"addClass",r=cf_c("hidden",s);t.auto.button&&t.auto.button[o]()[n](r),t.prev.button&&t.prev.button[o]()[n](r),t.next.button&&t.next.button[o]()[n](r),t.pagination.container&&t.pagination.container[o]()[n](r)}function nv_enableNavi(t,e,s){if(!t.circular&&!t.infinite){var i="removeClass"==e||"addClass"==e?e:!1,o=cf_c("disabled",s);if(t.auto.button&&i&&t.auto.button[i](o),t.prev.button){var n=i||0==e?"addClass":"removeClass";t.prev.button[n](o)}if(t.next.button){var n=i||e==t.items.visible?"addClass":"removeClass";t.next.button[n](o)}}}function go_getObject(t,e){return is_function(e)?e=e.call(t):is_undefined(e)&&(e={}),e}function go_getItemsObject(t,e){return e=go_getObject(t,e),is_number(e)?e={visible:e}:"variable"==e?e={visible:e,width:e,height:e}:is_object(e)||(e={}),e}function go_getScrollObject(t,e){return e=go_getObject(t,e),is_number(e)?e=50>=e?{items:e}:{duration:e}:is_string(e)?e={easing:e}:is_object(e)||(e={}),e}function go_getNaviObject(t,e){if(e=go_getObject(t,e),is_string(e)){var s=cf_getKeyCode(e);e=-1==s?$(e):s}return e}function go_getAutoObject(t,e){return e=go_getNaviObject(t,e),is_jquery(e)?e={button:e}:is_boolean(e)?e={play:e}:is_number(e)&&(e={timeoutDuration:e}),e.progress&&(is_string(e.progress)||is_jquery(e.progress))&&(e.progress={bar:e.progress}),e}function go_complementAutoObject(t,e){return is_function(e.button)&&(e.button=e.button.call(t)),is_string(e.button)&&(e.button=$(e.button)),is_boolean(e.play)||(e.play=!0),is_number(e.delay)||(e.delay=0),is_undefined(e.pauseOnEvent)&&(e.pauseOnEvent=!0),is_boolean(e.pauseOnResize)||(e.pauseOnResize=!0),is_number(e.timeoutDuration)||(e.timeoutDuration=e.duration<10?2500:5*e.duration),e.progress&&(is_function(e.progress.bar)&&(e.progress.bar=e.progress.bar.call(t)),is_string(e.progress.bar)&&(e.progress.bar=$(e.progress.bar)),e.progress.bar?(is_function(e.progress.updater)||(e.progress.updater=$.fn.carouFredSel.progressbarUpdater),is_number(e.progress.interval)||(e.progress.interval=50)):e.progress=!1),e}function go_getPrevNextObject(t,e){return e=go_getNaviObject(t,e),is_jquery(e)?e={button:e}:is_number(e)&&(e={key:e}),e}function go_complementPrevNextObject(t,e){return is_function(e.button)&&(e.button=e.button.call(t)),is_string(e.button)&&(e.button=$(e.button)),is_string(e.key)&&(e.key=cf_getKeyCode(e.key)),e}function go_getPaginationObject(t,e){return e=go_getNaviObject(t,e),is_jquery(e)?e={container:e}:is_boolean(e)&&(e={keys:e}),e}function go_complementPaginationObject(t,e){return is_function(e.container)&&(e.container=e.container.call(t)),is_string(e.container)&&(e.container=$(e.container)),is_number(e.items)||(e.items=!1),is_boolean(e.keys)||(e.keys=!1),is_function(e.anchorBuilder)||is_false(e.anchorBuilder)||(e.anchorBuilder=$.fn.carouFredSel.pageAnchorBuilder),is_number(e.deviation)||(e.deviation=0),e}function go_getSwipeObject(t,e){return is_function(e)&&(e=e.call(t)),is_undefined(e)&&(e={onTouch:!1}),is_true(e)?e={onTouch:e}:is_number(e)&&(e={items:e}),e}function go_complementSwipeObject(t,e){return is_boolean(e.onTouch)||(e.onTouch=!0),is_boolean(e.onMouse)||(e.onMouse=!1),is_object(e.options)||(e.options={}),is_boolean(e.options.triggerOnTouchEnd)||(e.options.triggerOnTouchEnd=!1),e}function go_getMousewheelObject(t,e){return is_function(e)&&(e=e.call(t)),is_true(e)?e={}:is_number(e)?e={items:e}:is_undefined(e)&&(e=!1),e}function go_complementMousewheelObject(t,e){return e}function gn_getItemIndex(t,e,s,i,o){if(is_string(t)&&(t=$(t,o)),is_object(t)&&(t=$(t,o)),is_jquery(t)?(t=o.children().index(t),is_boolean(s)||(s=!1)):is_boolean(s)||(s=!0),is_number(t)||(t=0),is_number(e)||(e=0),s&&(t+=i.first),t+=e,i.total>0){for(;t>=i.total;)t-=i.total;for(;0>t;)t+=i.total}return t}function gn_getVisibleItemsPrev(t,e,s){for(var i=0,o=0,n=s;n>=0;n--){var r=t.eq(n);if(i+=r.is(":visible")?r[e.d.outerWidth](!0):0,i>e.maxDimension)return o;0==n&&(n=t.length),o++}}function gn_getVisibleItemsPrevFilter(t,e,s){return gn_getItemsPrevFilter(t,e.items.filter,e.items.visibleConf.org,s)}function gn_getScrollItemsPrevFilter(t,e,s,i){return gn_getItemsPrevFilter(t,e.items.filter,i,s)}function gn_getItemsPrevFilter(t,e,s,i){for(var o=0,n=0,r=i,c=t.length;r>=0;r--){if(n++,n==c)return n;var a=t.eq(r);if(a.is(e)&&(o++,o==s))return n;0==r&&(r=c)}}function gn_getVisibleOrg(t,e){return e.items.visibleConf.org||t.children().slice(0,e.items.visible).filter(e.items.filter).length}function gn_getVisibleItemsNext(t,e,s){for(var i=0,o=0,n=s,r=t.length-1;r>=n;n++){var c=t.eq(n);if(i+=c.is(":visible")?c[e.d.outerWidth](!0):0,i>e.maxDimension)return o;if(o++,o==r+1)return o;n==r&&(n=-1)}}function gn_getVisibleItemsNextTestCircular(t,e,s,i){var o=gn_getVisibleItemsNext(t,e,s);return e.circular||s+o>i&&(o=i-s),o}function gn_getVisibleItemsNextFilter(t,e,s){return gn_getItemsNextFilter(t,e.items.filter,e.items.visibleConf.org,s,e.circular)}function gn_getScrollItemsNextFilter(t,e,s,i){return gn_getItemsNextFilter(t,e.items.filter,i+1,s,e.circular)-1}function gn_getItemsNextFilter(t,e,s,i){for(var o=0,n=0,r=i,c=t.length-1;c>=r;r++){if(n++,n>=c)return n;var a=t.eq(r);if(a.is(e)&&(o++,o==s))return n;r==c&&(r=-1)}}function gi_getCurrentItems(t,e){return t.slice(0,e.items.visible)}function gi_getOldItemsPrev(t,e,s){return t.slice(s,e.items.visibleConf.old+s)}function gi_getNewItemsPrev(t,e){return t.slice(0,e.items.visible)}function gi_getOldItemsNext(t,e){return t.slice(0,e.items.visibleConf.old)}function gi_getNewItemsNext(t,e,s){return t.slice(s,e.items.visible+s)}function sz_storeMargin(t,e,s){e.usePadding&&(is_string(s)||(s="_cfs_origCssMargin"),t.each(function(){var t=$(this),i=parseInt(t.css(e.d.marginRight),10);is_number(i)||(i=0),t.data(s,i)}))}function sz_resetMargin(t,e,s){if(e.usePadding){var i=is_boolean(s)?s:!1;is_number(s)||(s=0),sz_storeMargin(t,e,"_cfs_tempCssMargin"),t.each(function(){var t=$(this);t.css(e.d.marginRight,i?t.data("_cfs_tempCssMargin"):s+t.data("_cfs_origCssMargin"))})}}function sz_storeOrigCss(t){t.each(function(){var t=$(this);t.data("_cfs_origCss",t.attr("style")||"")})}function sz_restoreOrigCss(t){t.each(function(){var t=$(this);t.attr("style",t.data("_cfs_origCss")||"")})}function sz_setResponsiveSizes(t,e){var s=(t.items.visible,t.items[t.d.width]),i=t[t.d.height],o=is_percentage(i);e.each(function(){var e=$(this),n=s-ms_getPaddingBorderMargin(e,t,"Width");e[t.d.width](n),o&&e[t.d.height](ms_getPercentage(n,i))})}function sz_setSizes(t,e){var s=t.parent(),i=t.children(),o=gi_getCurrentItems(i,e),n=cf_mapWrapperSizes(ms_getSizes(o,e,!0),e,!1);if(s.css(n),e.usePadding){var r=e.padding,c=r[e.d[1]];e.align&&0>c&&(c=0);var a=o.last();a.css(e.d.marginRight,a.data("_cfs_origCssMargin")+c),t.css(e.d.top,r[e.d[0]]),t.css(e.d.left,r[e.d[3]])}return t.css(e.d.width,n[e.d.width]+2*ms_getTotalSize(i,e,"width")),t.css(e.d.height,ms_getLargestSize(i,e,"height")),n}function ms_getSizes(t,e,s){return[ms_getTotalSize(t,e,"width",s),ms_getLargestSize(t,e,"height",s)]}function ms_getLargestSize(t,e,s,i){return is_boolean(i)||(i=!1),is_number(e[e.d[s]])&&i?e[e.d[s]]:is_number(e.items[e.d[s]])?e.items[e.d[s]]:(s=s.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",ms_getTrueLargestSize(t,e,s))}function ms_getTrueLargestSize(t,e,s){for(var i=0,o=0,n=t.length;n>o;o++){var r=t.eq(o),c=r.is(":visible")?r[e.d[s]](!0):0;c>i&&(i=c)}return i}function ms_getTotalSize(t,e,s,i){if(is_boolean(i)||(i=!1),is_number(e[e.d[s]])&&i)return e[e.d[s]];if(is_number(e.items[e.d[s]]))return e.items[e.d[s]]*t.length;for(var o=s.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",n=0,r=0,c=t.length;c>r;r++){var a=t.eq(r);n+=a.is(":visible")?a[e.d[o]](!0):0}return n}function ms_getParentSize(t,e,s){var i=t.is(":visible");i&&t.hide();var o=t.parent()[e.d[s]]();return i&&t.show(),o}function ms_getMaxDimension(t,e){return is_number(t[t.d.width])?t[t.d.width]:e}function ms_hasVariableSizes(t,e,s){for(var i=!1,o=!1,n=0,r=t.length;r>n;n++){var c=t.eq(n),a=c.is(":visible")?c[e.d[s]](!0):0;i===!1?i=a:i!=a&&(o=!0),0==i&&(o=!0)}return o}function ms_getPaddingBorderMargin(t,e,s){return t[e.d["outer"+s]](!0)-t[e.d[s.toLowerCase()]]()}function ms_getPercentage(t,e){if(is_percentage(e)){if(e=parseInt(e.slice(0,-1),10),!is_number(e))return t;t*=e/100}return t}function cf_e(t,e,s,i,o){return is_boolean(s)||(s=!0),is_boolean(i)||(i=!0),is_boolean(o)||(o=!1),s&&(t=e.events.prefix+t),i&&(t=t+"."+e.events.namespace),i&&o&&(t+=e.serialNumber),t}function cf_c(t,e){return is_string(e.classnames[t])?e.classnames[t]:t}function cf_mapWrapperSizes(t,e,s){is_boolean(s)||(s=!0);var i=e.usePadding&&s?e.padding:[0,0,0,0],o={};return o[e.d.width]=t[0]+i[1]+i[3],o[e.d.height]=t[1]+i[0]+i[2],o}function cf_sortParams(t,e){for(var s=[],i=0,o=t.length;o>i;i++)for(var n=0,r=e.length;r>n;n++)if(e[n].indexOf(typeof t[i])>-1&&is_undefined(s[n])){s[n]=t[i];break}return s}function cf_getPadding(t){if(is_undefined(t))return[0,0,0,0];if(is_number(t))return[t,t,t,t];if(is_string(t)&&(t=t.split("px").join("").split("em").join("").split(" ")),!is_array(t))return[0,0,0,0];for(var e=0;4>e;e++)t[e]=parseInt(t[e],10);switch(t.length){case 0:return[0,0,0,0];case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];default:return[t[0],t[1],t[2],t[3]]}}function cf_getAlignPadding(t,e){var s=is_number(e[e.d.width])?Math.ceil(e[e.d.width]-ms_getTotalSize(t,e,"width")):0;switch(e.align){case"left":return[0,s];case"right":return[s,0];case"center":default:return[Math.ceil(s/2),Math.floor(s/2)]}}function cf_getDimensions(t){for(var e=[["width","innerWidth","outerWidth","height","innerHeight","outerHeight","left","top","marginRight",0,1,2,3],["height","innerHeight","outerHeight","width","innerWidth","outerWidth","top","left","marginBottom",3,2,1,0]],s=e[0].length,i="right"==t.direction||"left"==t.direction?0:1,o={},n=0;s>n;n++)o[e[0][n]]=e[i][n];return o}function cf_getAdjust(t,e,s,i){var o=t;if(is_function(s))o=s.call(i,o);else if(is_string(s)){var n=s.split("+"),r=s.split("-");if(r.length>n.length)var c=!0,a=r[0],f=r[1];else var c=!1,a=n[0],f=n[1];switch(a){case"even":o=t%2==1?t-1:t;break;case"odd":o=t%2==0?t-1:t;break;default:o=t}f=parseInt(f,10),is_number(f)&&(c&&(f=-f),o+=f)}return(!is_number(o)||1>o)&&(o=1),o}function cf_getItemsAdjust(t,e,s,i){return cf_getItemAdjustMinMax(cf_getAdjust(t,e,s,i),e.items.visibleConf)}function cf_getItemAdjustMinMax(t,e){return is_number(e.min)&&t<e.min&&(t=e.min),is_number(e.max)&&t>e.max&&(t=e.max),1>t&&(t=1),t}function cf_getSynchArr(t){is_array(t)||(t=[[t]]),is_array(t[0])||(t=[t]);for(var e=0,s=t.length;s>e;e++)is_string(t[e][0])&&(t[e][0]=$(t[e][0])),is_boolean(t[e][1])||(t[e][1]=!0),is_boolean(t[e][2])||(t[e][2]=!0),is_number(t[e][3])||(t[e][3]=0);return t}function cf_getKeyCode(t){return"right"==t?39:"left"==t?37:"up"==t?38:"down"==t?40:-1}function cf_setCookie(t,e,s){if(t){var i=e.triggerHandler(cf_e("currentPosition",s));$.fn.carouFredSel.cookie.set(t,i)}}function cf_getCookie(t){var e=$.fn.carouFredSel.cookie.get(t);return""==e?0:e}function in_mapCss(t,e){for(var s={},i=0,o=e.length;o>i;i++)s[e[i]]=t.css(e[i]);return s}function in_complementItems(t,e,s,i){return is_object(t.visibleConf)||(t.visibleConf={}),is_object(t.sizesConf)||(t.sizesConf={}),0==t.start&&is_number(i)&&(t.start=i),is_object(t.visible)?(t.visibleConf.min=t.visible.min,t.visibleConf.max=t.visible.max,t.visible=!1):is_string(t.visible)?("variable"==t.visible?t.visibleConf.variable=!0:t.visibleConf.adjust=t.visible,t.visible=!1):is_function(t.visible)&&(t.visibleConf.adjust=t.visible,t.visible=!1),is_string(t.filter)||(t.filter=s.filter(":hidden").length>0?":visible":"*"),t[e.d.width]||(e.responsive?(debug(!0,"Set a "+e.d.width+" for the items!"),t[e.d.width]=ms_getTrueLargestSize(s,e,"outerWidth")):t[e.d.width]=ms_hasVariableSizes(s,e,"outerWidth")?"variable":s[e.d.outerWidth](!0)),t[e.d.height]||(t[e.d.height]=ms_hasVariableSizes(s,e,"outerHeight")?"variable":s[e.d.outerHeight](!0)),t.sizesConf.width=t.width,t.sizesConf.height=t.height,t}function in_complementVisibleItems(t,e){return"variable"==t.items[t.d.width]&&(t.items.visibleConf.variable=!0),t.items.visibleConf.variable||(is_number(t[t.d.width])?t.items.visible=Math.floor(t[t.d.width]/t.items[t.d.width]):(t.items.visible=Math.floor(e/t.items[t.d.width]),t[t.d.width]=t.items.visible*t.items[t.d.width],t.items.visibleConf.adjust||(t.align=!1)),("Infinity"==t.items.visible||t.items.visible<1)&&(debug(!0,'Not a valid number of visible items: Set to "variable".'),t.items.visibleConf.variable=!0)),t}function in_complementPrimarySize(t,e,s){return"auto"==t&&(t=ms_getTrueLargestSize(s,e,"outerWidth")),t}function in_complementSecondarySize(t,e,s){return"auto"==t&&(t=ms_getTrueLargestSize(s,e,"outerHeight")),t||(t=e.items[e.d.height]),t}function in_getAlignPadding(t,e){var s=cf_getAlignPadding(gi_getCurrentItems(e,t),t);return t.padding[t.d[1]]=s[1],t.padding[t.d[3]]=s[0],t}function in_getResponsiveValues(t,e){var s=cf_getItemAdjustMinMax(Math.ceil(t[t.d.width]/t.items[t.d.width]),t.items.visibleConf);s>e.length&&(s=e.length);var i=Math.floor(t[t.d.width]/s);return t.items.visible=s,t.items[t.d.width]=i,t[t.d.width]=s*i,t}function bt_pauseOnHoverConfig(t){if(is_string(t))var e=t.indexOf("immediate")>-1?!0:!1,s=t.indexOf("resume")>-1?!0:!1;else var e=s=!1;return[e,s]}function bt_mousesheelNumber(t){return is_number(t)?t:null}function is_null(t){return null===t}function is_undefined(t){return is_null(t)||"undefined"==typeof t||""===t||"undefined"===t}function is_array(t){return t instanceof Array}function is_jquery(t){return t instanceof jQuery}function is_object(t){return(t instanceof Object||"object"==typeof t)&&!is_null(t)&&!is_jquery(t)&&!is_array(t)&&!is_function(t)}function is_number(t){return(t instanceof Number||"number"==typeof t)&&!isNaN(t)}function is_string(t){return(t instanceof String||"string"==typeof t)&&!is_undefined(t)&&!is_true(t)&&!is_false(t)}function is_function(t){return t instanceof Function||"function"==typeof t}function is_boolean(t){return t instanceof Boolean||"boolean"==typeof t||is_true(t)||is_false(t)}function is_true(t){return t===!0||"true"===t}function is_false(t){return t===!1||"false"===t}function is_percentage(t){return is_string(t)&&"%"==t.slice(-1)}function getTime(){return(new Date).getTime()}function deprecated(t,e){debug(!0,t+" is DEPRECATED, support for it will be removed. Use "+e+" instead.")}function debug(t,e){if(!is_undefined(window.console)&&!is_undefined(window.console.log)){if(is_object(t)){var s=" ("+t.selector+")";t=t.debug}else var s="";if(!t)return!1;e=is_string(e)?"carouFredSel"+s+": "+e:["carouFredSel"+s+":",e],window.console.log(e)}return!1}$.fn.carouFredSel||($.fn.caroufredsel=$.fn.carouFredSel=function(options,configs){if(0==this.length)return debug(!0,'No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){$(this).carouFredSel(options,configs)});var $cfs=this,$tt0=this[0],starting_position=!1;$cfs.data("_cfs_isCarousel")&&(starting_position=$cfs.triggerHandler("_cfs_triggerEvent","currentPosition"),$cfs.trigger("_cfs_triggerEvent",["destroy",!0]));var FN={};FN._init=function(t,e,s){t=go_getObject($tt0,t),t.items=go_getItemsObject($tt0,t.items),t.scroll=go_getScrollObject($tt0,t.scroll),t.auto=go_getAutoObject($tt0,t.auto),t.prev=go_getPrevNextObject($tt0,t.prev),t.next=go_getPrevNextObject($tt0,t.next),t.pagination=go_getPaginationObject($tt0,t.pagination),t.swipe=go_getSwipeObject($tt0,t.swipe),t.mousewheel=go_getMousewheelObject($tt0,t.mousewheel),e&&(opts_orig=$.extend(!0,{},$.fn.carouFredSel.defaults,t)),opts=$.extend(!0,{},$.fn.carouFredSel.defaults,t),opts.d=cf_getDimensions(opts),crsl.direction="up"==opts.direction||"left"==opts.direction?"next":"prev";var i=$cfs.children(),o=ms_getParentSize($wrp,opts,"width");if(is_true(opts.cookie)&&(opts.cookie="caroufredsel_cookie_"+conf.serialNumber),opts.maxDimension=ms_getMaxDimension(opts,o),opts.items=in_complementItems(opts.items,opts,i,s),opts[opts.d.width]=in_complementPrimarySize(opts[opts.d.width],opts,i),opts[opts.d.height]=in_complementSecondarySize(opts[opts.d.height],opts,i),opts.responsive&&(is_percentage(opts[opts.d.width])||(opts[opts.d.width]="100%")),is_percentage(opts[opts.d.width])&&(crsl.upDateOnWindowResize=!0,crsl.primarySizePercentage=opts[opts.d.width],opts[opts.d.width]=ms_getPercentage(o,crsl.primarySizePercentage),opts.items.visible||(opts.items.visibleConf.variable=!0)),opts.responsive?(opts.usePadding=!1,opts.padding=[0,0,0,0],opts.align=!1,opts.items.visibleConf.variable=!1):(opts.items.visible||(opts=in_complementVisibleItems(opts,o)),opts[opts.d.width]||(!opts.items.visibleConf.variable&&is_number(opts.items[opts.d.width])&&"*"==opts.items.filter?(opts[opts.d.width]=opts.items.visible*opts.items[opts.d.width],opts.align=!1):opts[opts.d.width]="variable"),is_undefined(opts.align)&&(opts.align=is_number(opts[opts.d.width])?"center":!1),opts.items.visibleConf.variable&&(opts.items.visible=gn_getVisibleItemsNext(i,opts,0))),"*"==opts.items.filter||opts.items.visibleConf.variable||(opts.items.visibleConf.org=opts.items.visible,opts.items.visible=gn_getVisibleItemsNextFilter(i,opts,0)),opts.items.visible=cf_getItemsAdjust(opts.items.visible,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts.responsive)opts.items.visibleConf.min||(opts.items.visibleConf.min=opts.items.visible),opts.items.visibleConf.max||(opts.items.visibleConf.max=opts.items.visible),opts=in_getResponsiveValues(opts,i,o);else switch(opts.padding=cf_getPadding(opts.padding),"top"==opts.align?opts.align="left":"bottom"==opts.align&&(opts.align="right"),opts.align){case"center":case"left":case"right":"variable"!=opts[opts.d.width]&&(opts=in_getAlignPadding(opts,i),opts.usePadding=!0);break;default:opts.align=!1,opts.usePadding=0==opts.padding[0]&&0==opts.padding[1]&&0==opts.padding[2]&&0==opts.padding[3]?!1:!0}is_number(opts.scroll.duration)||(opts.scroll.duration=500),is_undefined(opts.scroll.items)&&(opts.scroll.items=opts.responsive||opts.items.visibleConf.variable||"*"!=opts.items.filter?"visible":opts.items.visible),opts.auto=$.extend(!0,{},opts.scroll,opts.auto),opts.prev=$.extend(!0,{},opts.scroll,opts.prev),opts.next=$.extend(!0,{},opts.scroll,opts.next),opts.pagination=$.extend(!0,{},opts.scroll,opts.pagination),opts.auto=go_complementAutoObject($tt0,opts.auto),opts.prev=go_complementPrevNextObject($tt0,opts.prev),opts.next=go_complementPrevNextObject($tt0,opts.next),opts.pagination=go_complementPaginationObject($tt0,opts.pagination),opts.swipe=go_complementSwipeObject($tt0,opts.swipe),opts.mousewheel=go_complementMousewheelObject($tt0,opts.mousewheel),opts.synchronise&&(opts.synchronise=cf_getSynchArr(opts.synchronise)),opts.auto.onPauseStart&&(opts.auto.onTimeoutStart=opts.auto.onPauseStart,deprecated("auto.onPauseStart","auto.onTimeoutStart")),opts.auto.onPausePause&&(opts.auto.onTimeoutPause=opts.auto.onPausePause,deprecated("auto.onPausePause","auto.onTimeoutPause")),opts.auto.onPauseEnd&&(opts.auto.onTimeoutEnd=opts.auto.onPauseEnd,deprecated("auto.onPauseEnd","auto.onTimeoutEnd")),opts.auto.pauseDuration&&(opts.auto.timeoutDuration=opts.auto.pauseDuration,deprecated("auto.pauseDuration","auto.timeoutDuration"))},FN._build=function(){$cfs.data("_cfs_isCarousel",!0);var t=$cfs.children(),e=in_mapCss($cfs,["textAlign","float","position","top","right","bottom","left","zIndex","width","height","marginTop","marginRight","marginBottom","marginLeft"]),s="relative";switch(e.position){case"absolute":case"fixed":s=e.position}"parent"==conf.wrapper?sz_storeOrigCss($wrp):$wrp.css(e),$wrp.css({overflow:"hidden",position:s}),sz_storeOrigCss($cfs),$cfs.data("_cfs_origCssZindex",e.zIndex),$cfs.css({textAlign:"left","float":"none",position:"absolute",top:0,right:"auto",bottom:"auto",left:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),sz_storeMargin(t,opts),sz_storeOrigCss(t),opts.responsive&&sz_setResponsiveSizes(opts,t)},FN._bind_events=function(){FN._unbind_events(),$cfs.bind(cf_e("stop",conf),function(t,e){return t.stopPropagation(),crsl.isStopped||opts.auto.button&&opts.auto.button.addClass(cf_c("stopped",conf)),crsl.isStopped=!0,opts.auto.play&&(opts.auto.play=!1,$cfs.trigger(cf_e("pause",conf),e)),!0}),$cfs.bind(cf_e("finish",conf),function(t){return t.stopPropagation(),crsl.isScrolling&&sc_stopScroll(scrl),!0}),$cfs.bind(cf_e("pause",conf),function(t,e,s){if(t.stopPropagation(),tmrs=sc_clearTimers(tmrs),e&&crsl.isScrolling){scrl.isStopped=!0;var i=getTime()-scrl.startTime;scrl.duration-=i,scrl.pre&&(scrl.pre.duration-=i),scrl.post&&(scrl.post.duration-=i),sc_stopScroll(scrl,!1)}if(crsl.isPaused||crsl.isScrolling||s&&(tmrs.timePassed+=getTime()-tmrs.startTime),crsl.isPaused||opts.auto.button&&opts.auto.button.addClass(cf_c("paused",conf)),crsl.isPaused=!0,opts.auto.onTimeoutPause){var o=opts.auto.timeoutDuration-tmrs.timePassed,n=100-Math.ceil(100*o/opts.auto.timeoutDuration);opts.auto.onTimeoutPause.call($tt0,n,o)}return!0}),$cfs.bind(cf_e("play",conf),function(t,e,s,i){t.stopPropagation(),tmrs=sc_clearTimers(tmrs);var o=[e,s,i],n=["string","number","boolean"],r=cf_sortParams(o,n);if(e=r[0],s=r[1],i=r[2],"prev"!=e&&"next"!=e&&(e=crsl.direction),is_number(s)||(s=0),is_boolean(i)||(i=!1),i&&(crsl.isStopped=!1,opts.auto.play=!0),!opts.auto.play)return t.stopImmediatePropagation(),debug(conf,"Carousel stopped: Not scrolling.");crsl.isPaused&&opts.auto.button&&(opts.auto.button.removeClass(cf_c("stopped",conf)),opts.auto.button.removeClass(cf_c("paused",conf))),crsl.isPaused=!1,tmrs.startTime=getTime();var c=opts.auto.timeoutDuration+s;return dur2=c-tmrs.timePassed,perc=100-Math.ceil(100*dur2/c),opts.auto.progress&&(tmrs.progress=setInterval(function(){var t=getTime()-tmrs.startTime+tmrs.timePassed,e=Math.ceil(100*t/c);opts.auto.progress.updater.call(opts.auto.progress.bar[0],e)},opts.auto.progress.interval)),tmrs.auto=setTimeout(function(){opts.auto.progress&&opts.auto.progress.updater.call(opts.auto.progress.bar[0],100),opts.auto.onTimeoutEnd&&opts.auto.onTimeoutEnd.call($tt0,perc,dur2),crsl.isScrolling?$cfs.trigger(cf_e("play",conf),e):$cfs.trigger(cf_e(e,conf),opts.auto)},dur2),opts.auto.onTimeoutStart&&opts.auto.onTimeoutStart.call($tt0,perc,dur2),!0}),$cfs.bind(cf_e("resume",conf),function(t){return t.stopPropagation(),scrl.isStopped?(scrl.isStopped=!1,crsl.isPaused=!1,crsl.isScrolling=!0,scrl.startTime=getTime(),sc_startScroll(scrl,conf)):$cfs.trigger(cf_e("play",conf)),!0}),$cfs.bind(cf_e("prev",conf)+" "+cf_e("next",conf),function(t,e,s,i,o){if(t.stopPropagation(),crsl.isStopped||$cfs.is(":hidden"))return t.stopImmediatePropagation(),debug(conf,"Carousel stopped or hidden: Not scrolling.");var n=is_number(opts.items.minimum)?opts.items.minimum:opts.items.visible+1;if(n>itms.total)return t.stopImmediatePropagation(),debug(conf,"Not enough items ("+itms.total+" total, "+n+" needed): Not scrolling.");var r=[e,s,i,o],c=["object","number/string","function","boolean"],a=cf_sortParams(r,c);e=a[0],s=a[1],i=a[2],o=a[3];var f=t.type.slice(conf.events.prefix.length);if(is_object(e)||(e={}),is_function(i)&&(e.onAfter=i),is_boolean(o)&&(e.queue=o),e=$.extend(!0,{},opts[f],e),e.conditions&&!e.conditions.call($tt0,f))return t.stopImmediatePropagation(),debug(conf,'Callback "conditions" returned false.');if(!is_number(s)){if("*"!=opts.items.filter)s="visible";else for(var l=[s,e.items,opts[f].items],a=0,u=l.length;u>a;a++)if(is_number(l[a])||"page"==l[a]||"visible"==l[a]){s=l[a];break}switch(s){case"page":return t.stopImmediatePropagation(),$cfs.triggerHandler(cf_e(f+"Page",conf),[e,i]);case"visible":opts.items.visibleConf.variable||"*"!=opts.items.filter||(s=opts.items.visible)}}if(scrl.isStopped)return $cfs.trigger(cf_e("resume",conf)),$cfs.trigger(cf_e("queue",conf),[f,[e,s,i]]),t.stopImmediatePropagation(),debug(conf,"Carousel resumed scrolling.");if(e.duration>0&&crsl.isScrolling)return e.queue&&("last"==e.queue&&(queu=[]),("first"!=e.queue||0==queu.length)&&$cfs.trigger(cf_e("queue",conf),[f,[e,s,i]])),t.stopImmediatePropagation(),debug(conf,"Carousel currently scrolling.");if(tmrs.timePassed=0,$cfs.trigger(cf_e("slide_"+f,conf),[e,s]),opts.synchronise)for(var p=opts.synchronise,d=[e,s],g=0,u=p.length;u>g;g++){var m=f;p[g][2]||(m="prev"==m?"next":"prev"),p[g][1]||(d[0]=p[g][0].triggerHandler("_cfs_triggerEvent",["configuration",m])),d[1]=s+p[g][3],p[g][0].trigger("_cfs_triggerEvent",["slide_"+m,d])}return!0}),$cfs.bind(cf_e("slide_prev",conf),function(t,e,s){t.stopPropagation();var i=$cfs.children();if(!opts.circular&&0==itms.first)return opts.infinite&&$cfs.trigger(cf_e("next",conf),itms.total-1),t.stopImmediatePropagation();if(sz_resetMargin(i,opts),!is_number(s)){if(opts.items.visibleConf.variable)s=gn_getVisibleItemsPrev(i,opts,itms.total-1);else if("*"!=opts.items.filter){var o=is_number(e.items)?e.items:gn_getVisibleOrg($cfs,opts);s=gn_getScrollItemsPrevFilter(i,opts,itms.total-1,o)}else s=opts.items.visible;s=cf_getAdjust(s,opts,e.items,$tt0)}if(opts.circular||itms.total-s<itms.first&&(s=itms.total-itms.first),opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){var n=cf_getItemsAdjust(gn_getVisibleItemsNext(i,opts,itms.total-s),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible+s<=n&&s<itms.total&&(s++,n=cf_getItemsAdjust(gn_getVisibleItemsNext(i,opts,itms.total-s),opts,opts.items.visibleConf.adjust,$tt0)),opts.items.visible=n}else if("*"!=opts.items.filter){var n=gn_getVisibleItemsNextFilter(i,opts,itms.total-s);opts.items.visible=cf_getItemsAdjust(n,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(i,opts,!0),0==s)return t.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+s+" items backward."),itms.first+=s;itms.first>=itms.total;)itms.first-=itms.total;opts.circular||(0==itms.first&&e.onEnd&&e.onEnd.call($tt0,"prev"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),$cfs.children().slice(itms.total-s,itms.total).prependTo($cfs),itms.total<opts.items.visible+s&&$cfs.children().slice(0,opts.items.visible+s-itms.total).clone(!0).appendTo($cfs);var i=$cfs.children(),r=gi_getOldItemsPrev(i,opts,s),c=gi_getNewItemsPrev(i,opts),a=i.eq(s-1),f=r.last(),l=c.last();sz_resetMargin(i,opts);var u=0,p=0;if(opts.align){var d=cf_getAlignPadding(c,opts);u=d[0],p=d[1]}var g=0>u?opts.padding[opts.d[3]]:0,m=!1,_=$();if(opts.items.visible<s&&(_=i.slice(opts.items.visibleConf.old,s),"directscroll"==e.fx)){var b=opts.items[opts.d.width];m=_,a=l,sc_hideHiddenItems(m),opts.items[opts.d.width]="variable"}var v=!1,h=ms_getTotalSize(i.slice(0,s),opts,"width"),w=cf_mapWrapperSizes(ms_getSizes(c,opts,!0),opts,!opts.usePadding),P=0,C={},x={},S={},y={},I={},z={},j={},N=sc_getDuration(e,opts,s,h);switch(e.fx){case"cover":case"cover-fade":P=ms_getTotalSize(i.slice(0,opts.items.visible),opts,"width")}m&&(opts.items[opts.d.width]=b),sz_resetMargin(i,opts,!0),p>=0&&sz_resetMargin(f,opts,opts.padding[opts.d[1]]),u>=0&&sz_resetMargin(a,opts,opts.padding[opts.d[3]]),opts.align&&(opts.padding[opts.d[1]]=p,opts.padding[opts.d[3]]=u),z[opts.d.left]=-(h-g),j[opts.d.left]=-(P-g),x[opts.d.left]=w[opts.d.width];var k=function(){},O=function(){},T=function(){},M=function(){},F=function(){},A=function(){},H=function(){},q=function(){},D=function(){},V=function(){},R=function(){};switch(e.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":v=$cfs.clone(!0).appendTo($wrp)}switch(e.fx){case"crossfade":case"uncover":case"uncover-fade":v.children().slice(0,s).remove(),v.children().slice(opts.items.visibleConf.old).remove();break;case"cover":case"cover-fade":v.children().slice(opts.items.visible).remove(),v.css(j)}if($cfs.css(z),scrl=sc_setScroll(N,e.easing,conf),C[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0,("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(k=function(){$wrp.css(w)},O=function(){scrl.anims.push([$wrp,w])}),opts.usePadding){switch(l.not(a).length&&(S[opts.d.marginRight]=a.data("_cfs_origCssMargin"),0>u?a.css(S):(H=function(){a.css(S)},q=function(){scrl.anims.push([a,S])})),e.fx){case"cover":case"cover-fade":v.children().eq(s-1).css(S)}l.not(f).length&&(y[opts.d.marginRight]=f.data("_cfs_origCssMargin"),T=function(){f.css(y)},M=function(){scrl.anims.push([f,y])}),p>=0&&(I[opts.d.marginRight]=l.data("_cfs_origCssMargin")+opts.padding[opts.d[1]],F=function(){l.css(I)},A=function(){scrl.anims.push([l,I])})}R=function(){$cfs.css(C)};var E=opts.items.visible+s-itms.total;V=function(){if(E>0&&($cfs.children().slice(itms.total).remove(),r=$($cfs.children().slice(itms.total-(opts.items.visible-E)).get().concat($cfs.children().slice(0,E).get()))),sc_showHiddenItems(m),opts.usePadding){var t=$cfs.children().eq(opts.items.visible+s-1);t.css(opts.d.marginRight,t.data("_cfs_origCssMargin"))}};var W=sc_mapCallbackArguments(r,_,c,s,"prev",N,w);switch(D=function(){sc_afterScroll($cfs,v,e),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,e,"onAfter",W,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,e,"onBefore",W,clbk),e.fx){case"none":$cfs.css(C),k(),T(),F(),H(),R(),V(),D();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){k(),T(),F(),H(),R(),V(),scrl=sc_setScroll(N,e.easing,conf),scrl.anims.push([$cfs,{opacity:1},D]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([v,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},D]),O(),T(),F(),H(),R(),V();break;case"cover":scrl.anims.push([v,C,function(){T(),F(),H(),R(),V(),D()}]),O();break;case"cover-fade":scrl.anims.push([$cfs,{opacity:0}]),scrl.anims.push([v,C,function(){T(),F(),H(),R(),V(),D()}]),O();break;case"uncover":scrl.anims.push([v,x,D]),O(),T(),F(),H(),R(),V();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([v,x,D]),O(),T(),F(),H(),R(),V();break;default:scrl.anims.push([$cfs,C,function(){V(),D()}]),O(),M(),A(),q()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,w]),!0
2
  }),$cfs.bind(cf_e("slide_next",conf),function(t,e,s){t.stopPropagation();var i=$cfs.children();if(!opts.circular&&itms.first==opts.items.visible)return opts.infinite&&$cfs.trigger(cf_e("prev",conf),itms.total-1),t.stopImmediatePropagation();if(sz_resetMargin(i,opts),!is_number(s)){if("*"!=opts.items.filter){var o=is_number(e.items)?e.items:gn_getVisibleOrg($cfs,opts);s=gn_getScrollItemsNextFilter(i,opts,0,o)}else s=opts.items.visible;s=cf_getAdjust(s,opts,e.items,$tt0)}var n=0==itms.first?itms.total:itms.first;if(!opts.circular){if(opts.items.visibleConf.variable)var r=gn_getVisibleItemsNext(i,opts,s),o=gn_getVisibleItemsPrev(i,opts,n-1);else var r=opts.items.visible,o=opts.items.visible;s+r>n&&(s=n-o)}if(opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){for(var r=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(i,opts,s,n),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible-s>=r&&s<itms.total;)s++,r=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(i,opts,s,n),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible=r}else if("*"!=opts.items.filter){var r=gn_getVisibleItemsNextFilter(i,opts,s);opts.items.visible=cf_getItemsAdjust(r,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(i,opts,!0),0==s)return t.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+s+" items forward."),itms.first-=s;itms.first<0;)itms.first+=itms.total;opts.circular||(itms.first==opts.items.visible&&e.onEnd&&e.onEnd.call($tt0,"next"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),itms.total<opts.items.visible+s&&$cfs.children().slice(0,opts.items.visible+s-itms.total).clone(!0).appendTo($cfs);var i=$cfs.children(),c=gi_getOldItemsNext(i,opts),a=gi_getNewItemsNext(i,opts,s),f=i.eq(s-1),l=c.last(),u=a.last();sz_resetMargin(i,opts);var p=0,d=0;if(opts.align){var g=cf_getAlignPadding(a,opts);p=g[0],d=g[1]}var m=!1,_=$();if(opts.items.visibleConf.old<s&&(_=i.slice(opts.items.visibleConf.old,s),"directscroll"==e.fx)){var b=opts.items[opts.d.width];m=_,f=l,sc_hideHiddenItems(m),opts.items[opts.d.width]="variable"}var v=!1,h=ms_getTotalSize(i.slice(0,s),opts,"width"),w=cf_mapWrapperSizes(ms_getSizes(a,opts,!0),opts,!opts.usePadding),P=0,C={},x={},S={},y={},I={},z=sc_getDuration(e,opts,s,h);switch(e.fx){case"uncover":case"uncover-fade":P=ms_getTotalSize(i.slice(0,opts.items.visibleConf.old),opts,"width")}m&&(opts.items[opts.d.width]=b),opts.align&&opts.padding[opts.d[1]]<0&&(opts.padding[opts.d[1]]=0),sz_resetMargin(i,opts,!0),sz_resetMargin(l,opts,opts.padding[opts.d[1]]),opts.align&&(opts.padding[opts.d[1]]=d,opts.padding[opts.d[3]]=p),I[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0;var j=function(){},N=function(){},k=function(){},O=function(){},T=function(){},M=function(){},F=function(){},A=function(){},H=function(){};switch(e.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":v=$cfs.clone(!0).appendTo($wrp),v.children().slice(opts.items.visibleConf.old).remove()}switch(e.fx){case"crossfade":case"cover":case"cover-fade":$cfs.css("zIndex",1),v.css("zIndex",0)}if(scrl=sc_setScroll(z,e.easing,conf),C[opts.d.left]=-h,x[opts.d.left]=-P,0>p&&(C[opts.d.left]+=p),("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(j=function(){$wrp.css(w)},N=function(){scrl.anims.push([$wrp,w])}),opts.usePadding){var q=u.data("_cfs_origCssMargin");d>=0&&(q+=opts.padding[opts.d[1]]),u.css(opts.d.marginRight,q),f.not(l).length&&(y[opts.d.marginRight]=l.data("_cfs_origCssMargin")),k=function(){l.css(y)},O=function(){scrl.anims.push([l,y])};var D=f.data("_cfs_origCssMargin");p>0&&(D+=opts.padding[opts.d[3]]),S[opts.d.marginRight]=D,T=function(){f.css(S)},M=function(){scrl.anims.push([f,S])}}H=function(){$cfs.css(I)};var V=opts.items.visible+s-itms.total;A=function(){V>0&&$cfs.children().slice(itms.total).remove();var t=$cfs.children().slice(0,s).appendTo($cfs).last();if(V>0&&(a=gi_getCurrentItems(i,opts)),sc_showHiddenItems(m),opts.usePadding){if(itms.total<opts.items.visible+s){var e=$cfs.children().eq(opts.items.visible-1);e.css(opts.d.marginRight,e.data("_cfs_origCssMargin")+opts.padding[opts.d[1]])}t.css(opts.d.marginRight,t.data("_cfs_origCssMargin"))}};var R=sc_mapCallbackArguments(c,_,a,s,"next",z,w);switch(F=function(){$cfs.css("zIndex",$cfs.data("_cfs_origCssZindex")),sc_afterScroll($cfs,v,e),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,e,"onAfter",R,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,e,"onBefore",R,clbk),e.fx){case"none":$cfs.css(C),j(),k(),T(),H(),A(),F();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){j(),k(),T(),H(),A(),scrl=sc_setScroll(z,e.easing,conf),scrl.anims.push([$cfs,{opacity:1},F]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([v,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},F]),N(),k(),T(),H(),A();break;case"cover":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([$cfs,I,F]),N(),k(),T(),A();break;case"cover-fade":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([v,{opacity:0}]),scrl.anims.push([$cfs,I,F]),N(),k(),T(),A();break;case"uncover":scrl.anims.push([v,x,F]),N(),k(),T(),H(),A();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([v,x,F]),N(),k(),T(),H(),A();break;default:scrl.anims.push([$cfs,C,function(){H(),A(),F()}]),N(),O(),M()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,w]),!0}),$cfs.bind(cf_e("slideTo",conf),function(t,e,s,i,o,n,r){t.stopPropagation();var c=[e,s,i,o,n,r],a=["string/number/object","number","boolean","object","string","function"],f=cf_sortParams(c,a);return o=f[3],n=f[4],r=f[5],e=gn_getItemIndex(f[0],f[1],f[2],itms,$cfs),0==e?!1:(is_object(o)||(o=!1),"prev"!=n&&"next"!=n&&(n=opts.circular?e<=itms.total/2?"next":"prev":0==itms.first||itms.first>e?"next":"prev"),"prev"==n&&(e=itms.total-e),$cfs.trigger(cf_e(n,conf),[o,e,r]),!0)}),$cfs.bind(cf_e("prevPage",conf),function(t,e,s){t.stopPropagation();var i=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[i-1,e,"prev",s])}),$cfs.bind(cf_e("nextPage",conf),function(t,e,s){t.stopPropagation();var i=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[i+1,e,"next",s])}),$cfs.bind(cf_e("slideToPage",conf),function(t,e,s,i,o){t.stopPropagation(),is_number(e)||(e=$cfs.triggerHandler(cf_e("currentPage",conf)));var n=opts.pagination.items||opts.items.visible,r=Math.ceil(itms.total/n)-1;return 0>e&&(e=r),e>r&&(e=0),$cfs.triggerHandler(cf_e("slideTo",conf),[e*n,0,!0,s,i,o])}),$cfs.bind(cf_e("jumpToStart",conf),function(t,e){if(t.stopPropagation(),e=e?gn_getItemIndex(e,0,!0,itms,$cfs):0,e+=itms.first,0!=e){if(itms.total>0)for(;e>itms.total;)e-=itms.total;$cfs.prepend($cfs.children().slice(e,itms.total))}return!0}),$cfs.bind(cf_e("synchronise",conf),function(t,e){if(t.stopPropagation(),e)e=cf_getSynchArr(e);else{if(!opts.synchronise)return debug(conf,"No carousel to synchronise.");e=opts.synchronise}for(var s=$cfs.triggerHandler(cf_e("currentPosition",conf)),i=!0,o=0,n=e.length;n>o;o++)e[o][0].triggerHandler(cf_e("slideTo",conf),[s,e[o][3],!0])||(i=!1);return i}),$cfs.bind(cf_e("queue",conf),function(t,e,s){return t.stopPropagation(),is_function(e)?e.call($tt0,queu):is_array(e)?queu=e:is_undefined(e)||queu.push([e,s]),queu}),$cfs.bind(cf_e("insertItem",conf),function(t,e,s,i,o){t.stopPropagation();var n=[e,s,i,o],r=["string/object","string/number/object","boolean","number"],c=cf_sortParams(n,r);if(e=c[0],s=c[1],i=c[2],o=c[3],is_object(e)&&!is_jquery(e)?e=$(e):is_string(e)&&(e=$(e)),!is_jquery(e)||0==e.length)return debug(conf,"Not a valid object.");is_undefined(s)&&(s="end"),sz_storeMargin(e,opts),sz_storeOrigCss(e);var a=s,f="before";"end"==s?i?(0==itms.first?(s=itms.total-1,f="after"):(s=itms.first,itms.first+=e.length),0>s&&(s=0)):(s=itms.total-1,f="after"):s=gn_getItemIndex(s,o,i,itms,$cfs);var l=$cfs.children().eq(s);return l.length?l[f](e):(debug(conf,"Correct insert-position not found! Appending item to the end."),$cfs.append(e)),"end"==a||i||s<itms.first&&(itms.first+=e.length),itms.total=$cfs.children().length,itms.first>=itms.total&&(itms.first-=itms.total),$cfs.trigger(cf_e("updateSizes",conf)),$cfs.trigger(cf_e("linkAnchors",conf)),!0}),$cfs.bind(cf_e("removeItem",conf),function(t,e,s,i){t.stopPropagation();var o=[e,s,i],n=["string/number/object","boolean","number"],r=cf_sortParams(o,n);e=r[0],s=r[1],i=r[2];if(e instanceof $&&e.length>1)return c=$(),e.each(function(){var t=$cfs.trigger(cf_e("removeItem",conf),[$(this),s,i]);t&&(c=c.add(t))}),c;if(is_undefined(e)||"end"==e)c=$cfs.children().last();else{e=gn_getItemIndex(e,i,s,itms,$cfs);var c=$cfs.children().eq(e);c.length&&e<itms.first&&(itms.first-=c.length)}return c&&c.length&&(c.detach(),itms.total=$cfs.children().length,$cfs.trigger(cf_e("updateSizes",conf))),c}),$cfs.bind(cf_e("onBefore",conf)+" "+cf_e("onAfter",conf),function(t,e){t.stopPropagation();var s=t.type.slice(conf.events.prefix.length);return is_array(e)&&(clbk[s]=e),is_function(e)&&clbk[s].push(e),clbk[s]}),$cfs.bind(cf_e("currentPosition",conf),function(t,e){if(t.stopPropagation(),0==itms.first)var s=0;else var s=itms.total-itms.first;return is_function(e)&&e.call($tt0,s),s}),$cfs.bind(cf_e("currentPage",conf),function(t,e){t.stopPropagation();var s,i=opts.pagination.items||opts.items.visible,o=Math.ceil(itms.total/i-1);return s=0==itms.first?0:itms.first<itms.total%i?0:itms.first!=i||opts.circular?Math.round((itms.total-itms.first)/i):o,0>s&&(s=0),s>o&&(s=o),is_function(e)&&e.call($tt0,s),s}),$cfs.bind(cf_e("currentVisible",conf),function(t,e){t.stopPropagation();var s=gi_getCurrentItems($cfs.children(),opts);return is_function(e)&&e.call($tt0,s),s}),$cfs.bind(cf_e("slice",conf),function(t,e,s,i){if(t.stopPropagation(),0==itms.total)return!1;var o=[e,s,i],n=["number","number","function"],r=cf_sortParams(o,n);if(e=is_number(r[0])?r[0]:0,s=is_number(r[1])?r[1]:itms.total,i=r[2],e+=itms.first,s+=itms.first,items.total>0){for(;e>itms.total;)e-=itms.total;for(;s>itms.total;)s-=itms.total;for(;0>e;)e+=itms.total;for(;0>s;)s+=itms.total}var c,a=$cfs.children();return c=s>e?a.slice(e,s):$(a.slice(e,itms.total).get().concat(a.slice(0,s).get())),is_function(i)&&i.call($tt0,c),c}),$cfs.bind(cf_e("isPaused",conf)+" "+cf_e("isStopped",conf)+" "+cf_e("isScrolling",conf),function(t,e){t.stopPropagation();var s=t.type.slice(conf.events.prefix.length),i=crsl[s];return is_function(e)&&e.call($tt0,i),i}),$cfs.bind(cf_e("configuration",conf),function(e,a,b,c){e.stopPropagation();var reInit=!1;if(is_function(a))a.call($tt0,opts);else if(is_object(a))opts_orig=$.extend(!0,{},opts_orig,a),b!==!1?reInit=!0:opts=$.extend(!0,{},opts,a);else if(!is_undefined(a))if(is_function(b)){var val=eval("opts."+a);is_undefined(val)&&(val=""),b.call($tt0,val)}else{if(is_undefined(b))return eval("opts."+a);"boolean"!=typeof c&&(c=!0),eval("opts_orig."+a+" = b"),c!==!1?reInit=!0:eval("opts."+a+" = b")}if(reInit){sz_resetMargin($cfs.children(),opts),FN._init(opts_orig),FN._bind_buttons();var sz=sz_setSizes($cfs,opts);$cfs.trigger(cf_e("updatePageStatus",conf),[!0,sz])}return opts}),$cfs.bind(cf_e("linkAnchors",conf),function(t,e,s){return t.stopPropagation(),is_undefined(e)?e=$("body"):is_string(e)&&(e=$(e)),is_jquery(e)&&0!=e.length?(is_string(s)||(s="a.caroufredsel"),e.find(s).each(function(){var t=this.hash||"";t.length>0&&-1!=$cfs.children().index($(t))&&$(this).unbind("click").click(function(e){e.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),t)})}),!0):debug(conf,"Not a valid object.")}),$cfs.bind(cf_e("updatePageStatus",conf),function(t,e){if(t.stopPropagation(),opts.pagination.container){var s=opts.pagination.items||opts.items.visible,i=Math.ceil(itms.total/s);e&&(opts.pagination.anchorBuilder&&(opts.pagination.container.children().remove(),opts.pagination.container.each(function(){for(var t=0;i>t;t++){var e=$cfs.children().eq(gn_getItemIndex(t*s,0,!0,itms,$cfs));$(this).append(opts.pagination.anchorBuilder.call(e[0],t+1))}})),opts.pagination.container.each(function(){$(this).children().unbind(opts.pagination.event).each(function(t){$(this).bind(opts.pagination.event,function(e){e.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[t*s,-opts.pagination.deviation,!0,opts.pagination])})})}));var o=$cfs.triggerHandler(cf_e("currentPage",conf))+opts.pagination.deviation;return o>=i&&(o=0),0>o&&(o=i-1),opts.pagination.container.each(function(){$(this).children().removeClass(cf_c("selected",conf)).eq(o).addClass(cf_c("selected",conf))}),!0}}),$cfs.bind(cf_e("updateSizes",conf),function(){var t=opts.items.visible,e=$cfs.children(),s=ms_getParentSize($wrp,opts,"width");if(itms.total=e.length,crsl.primarySizePercentage?(opts.maxDimension=s,opts[opts.d.width]=ms_getPercentage(s,crsl.primarySizePercentage)):opts.maxDimension=ms_getMaxDimension(opts,s),opts.responsive?(opts.items.width=opts.items.sizesConf.width,opts.items.height=opts.items.sizesConf.height,opts=in_getResponsiveValues(opts,e,s),t=opts.items.visible,sz_setResponsiveSizes(opts,e)):opts.items.visibleConf.variable?t=gn_getVisibleItemsNext(e,opts,0):"*"!=opts.items.filter&&(t=gn_getVisibleItemsNextFilter(e,opts,0)),!opts.circular&&0!=itms.first&&t>itms.first){if(opts.items.visibleConf.variable)var i=gn_getVisibleItemsPrev(e,opts,itms.first)-itms.first;else if("*"!=opts.items.filter)var i=gn_getVisibleItemsPrevFilter(e,opts,itms.first)-itms.first;else var i=opts.items.visible-itms.first;debug(conf,"Preventing non-circular: sliding "+i+" items backward."),$cfs.trigger(cf_e("prev",conf),i)}opts.items.visible=cf_getItemsAdjust(t,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts=in_getAlignPadding(opts,e);var o=sz_setSizes($cfs,opts);return $cfs.trigger(cf_e("updatePageStatus",conf),[!0,o]),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),o}),$cfs.bind(cf_e("destroy",conf),function(t,e){return t.stopPropagation(),tmrs=sc_clearTimers(tmrs),$cfs.data("_cfs_isCarousel",!1),$cfs.trigger(cf_e("finish",conf)),e&&$cfs.trigger(cf_e("jumpToStart",conf)),sz_restoreOrigCss($cfs.children()),sz_restoreOrigCss($cfs),FN._unbind_events(),FN._unbind_buttons(),"parent"==conf.wrapper?sz_restoreOrigCss($wrp):$wrp.replaceWith($cfs),!0}),$cfs.bind(cf_e("debug",conf),function(){return debug(conf,"Carousel width: "+opts.width),debug(conf,"Carousel height: "+opts.height),debug(conf,"Item widths: "+opts.items.width),debug(conf,"Item heights: "+opts.items.height),debug(conf,"Number of items visible: "+opts.items.visible),opts.auto.play&&debug(conf,"Number of items scrolled automatically: "+opts.auto.items),opts.prev.button&&debug(conf,"Number of items scrolled backward: "+opts.prev.items),opts.next.button&&debug(conf,"Number of items scrolled forward: "+opts.next.items),conf.debug}),$cfs.bind("_cfs_triggerEvent",function(t,e,s){return t.stopPropagation(),$cfs.triggerHandler(cf_e(e,conf),s)})},FN._unbind_events=function(){$cfs.unbind(cf_e("",conf)),$cfs.unbind(cf_e("",conf,!1)),$cfs.unbind("_cfs_triggerEvent")},FN._bind_buttons=function(){if(FN._unbind_buttons(),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),opts.auto.pauseOnHover){var t=bt_pauseOnHoverConfig(opts.auto.pauseOnHover);$wrp.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.auto.button&&opts.auto.button.bind(cf_e(opts.auto.event,conf,!1),function(t){t.preventDefault();var e=!1,s=null;crsl.isPaused?e="play":opts.auto.pauseOnEvent&&(e="pause",s=bt_pauseOnHoverConfig(opts.auto.pauseOnEvent)),e&&$cfs.trigger(cf_e(e,conf),s)}),opts.prev.button&&(opts.prev.button.bind(cf_e(opts.prev.event,conf,!1),function(t){t.preventDefault(),$cfs.trigger(cf_e("prev",conf))}),opts.prev.pauseOnHover)){var t=bt_pauseOnHoverConfig(opts.prev.pauseOnHover);opts.prev.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.next.button&&(opts.next.button.bind(cf_e(opts.next.event,conf,!1),function(t){t.preventDefault(),$cfs.trigger(cf_e("next",conf))}),opts.next.pauseOnHover)){var t=bt_pauseOnHoverConfig(opts.next.pauseOnHover);opts.next.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.pagination.container&&opts.pagination.pauseOnHover){var t=bt_pauseOnHoverConfig(opts.pagination.pauseOnHover);opts.pagination.container.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if((opts.prev.key||opts.next.key)&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(t){var e=t.keyCode;e==opts.next.key&&(t.preventDefault(),$cfs.trigger(cf_e("next",conf))),e==opts.prev.key&&(t.preventDefault(),$cfs.trigger(cf_e("prev",conf)))}),opts.pagination.keys&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(t){var e=t.keyCode;e>=49&&58>e&&(e=(e-49)*opts.items.visible,e<=itms.total&&(t.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[e,0,!0,opts.pagination])))}),$.fn.swipe){var e="ontouchstart"in window;if(e&&opts.swipe.onTouch||!e&&opts.swipe.onMouse){var s=$.extend(!0,{},opts.prev,opts.swipe),i=$.extend(!0,{},opts.next,opts.swipe),o=function(){$cfs.trigger(cf_e("prev",conf),[s])},n=function(){$cfs.trigger(cf_e("next",conf),[i])};switch(opts.direction){case"up":case"down":opts.swipe.options.swipeUp=n,opts.swipe.options.swipeDown=o;break;default:opts.swipe.options.swipeLeft=n,opts.swipe.options.swipeRight=o}crsl.swipe&&$cfs.swipe("destroy"),$wrp.swipe(opts.swipe.options),$wrp.css("cursor","move"),crsl.swipe=!0}}if($.fn.mousewheel&&opts.mousewheel){var r=$.extend(!0,{},opts.prev,opts.mousewheel),c=$.extend(!0,{},opts.next,opts.mousewheel);crsl.mousewheel&&$wrp.unbind(cf_e("mousewheel",conf,!1)),$wrp.bind(cf_e("mousewheel",conf,!1),function(t,e){t.preventDefault(),e>0?$cfs.trigger(cf_e("prev",conf),[r]):$cfs.trigger(cf_e("next",conf),[c])}),crsl.mousewheel=!0}if(opts.auto.play&&$cfs.trigger(cf_e("play",conf),opts.auto.delay),crsl.upDateOnWindowResize){var a=function(){$cfs.trigger(cf_e("finish",conf)),opts.auto.pauseOnResize&&!crsl.isPaused&&$cfs.trigger(cf_e("play",conf)),sz_resetMargin($cfs.children(),opts),$cfs.trigger(cf_e("updateSizes",conf))},f=$(window),l=null;if($.debounce&&"debounce"==conf.onWindowResize)l=$.debounce(200,a);else if($.throttle&&"throttle"==conf.onWindowResize)l=$.throttle(300,a);else{var u=0,p=0;l=function(){var t=f.width(),e=f.height();(t!=u||e!=p)&&(a(),u=t,p=e)}}f.bind(cf_e("resize",conf,!1,!0,!0),l)}},FN._unbind_buttons=function(){var t=(cf_e("",conf),cf_e("",conf,!1));ns3=cf_e("",conf,!1,!0,!0),$(document).unbind(ns3),$(window).unbind(ns3),$wrp.unbind(t),opts.auto.button&&opts.auto.button.unbind(t),opts.prev.button&&opts.prev.button.unbind(t),opts.next.button&&opts.next.button.unbind(t),opts.pagination.container&&(opts.pagination.container.unbind(t),opts.pagination.anchorBuilder&&opts.pagination.container.children().remove()),crsl.swipe&&($cfs.swipe("destroy"),$wrp.css("cursor","default"),crsl.swipe=!1),crsl.mousewheel&&(crsl.mousewheel=!1),nv_showNavi(opts,"hide",conf),nv_enableNavi(opts,"removeClass",conf)},is_boolean(configs)&&(configs={debug:configs});var crsl={direction:"next",isPaused:!0,isScrolling:!1,isStopped:!1,mousewheel:!1,swipe:!1},itms={total:$cfs.children().length,first:0},tmrs={auto:null,progress:null,startTime:getTime(),timePassed:0},scrl={isStopped:!1,duration:0,startTime:0,easing:"",anims:[]},clbk={onBefore:[],onAfter:[]},queu=[],conf=$.extend(!0,{},$.fn.carouFredSel.configs,configs),opts={},opts_orig=$.extend(!0,{},options),$wrp="parent"==conf.wrapper?$cfs.parent():$cfs.wrap("<"+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />').parent();if(conf.selector=$cfs.selector,conf.serialNumber=$.fn.carouFredSel.serialNumber++,conf.transition=conf.transition&&$.fn.transition?"transition":"animate",FN._init(opts_orig,!0,starting_position),FN._build(),FN._bind_events(),FN._bind_buttons(),is_array(opts.items.start))var start_arr=opts.items.start;else{var start_arr=[];0!=opts.items.start&&start_arr.push(opts.items.start)}if(opts.cookie&&start_arr.unshift(parseInt(cf_getCookie(opts.cookie),10)),start_arr.length>0)for(var a=0,l=start_arr.length;l>a;a++){var s=start_arr[a];if(0!=s){if(s===!0){if(s=window.location.hash,s.length<1)continue}else"random"===s&&(s=Math.floor(Math.random()*itms.total));if($cfs.triggerHandler(cf_e("slideTo",conf),[s,0,!0,{fx:"none"}]))break}}var siz=sz_setSizes($cfs,opts),itm=gi_getCurrentItems($cfs.children(),opts);return opts.onCreate&&opts.onCreate.call($tt0,{width:siz.width,height:siz.height,items:itm}),$cfs.trigger(cf_e("updatePageStatus",conf),[!0,siz]),$cfs.trigger(cf_e("linkAnchors",conf)),conf.debug&&$cfs.trigger(cf_e("debug",conf)),$cfs},$.fn.carouFredSel.serialNumber=1,$.fn.carouFredSel.defaults={synchronise:!1,infinite:!0,circular:!0,responsive:!1,direction:"left",items:{start:0},scroll:{easing:"swing",duration:500,pauseOnHover:!1,event:"click",queue:!1}},$.fn.carouFredSel.configs={debug:!1,transition:!1,onWindowResize:"throttle",events:{prefix:"",namespace:"cfs"},wrapper:{element:"div",classname:"caroufredsel_wrapper"},classnames:{}},$.fn.carouFredSel.pageAnchorBuilder=function(t){return'<a href="#"><span>'+t+"</span></a>"},$.fn.carouFredSel.progressbarUpdater=function(t){$(this).css("width",t+"%")},$.fn.carouFredSel.cookie={get:function(t){t+="=";for(var e=document.cookie.split(";"),s=0,i=e.length;i>s;s++){for(var o=e[s];" "==o.charAt(0);)o=o.slice(1);if(0==o.indexOf(t))return o.slice(t.length)}return 0},set:function(t,e,s){var i="";if(s){var o=new Date;o.setTime(o.getTime()+24*s*60*60*1e3),i="; expires="+o.toGMTString()}document.cookie=t+"="+e+i+"; path=/"},remove:function(t){$.fn.carouFredSel.cookie.set(t,"",-1)}},$.extend($.easing,{quadratic:function(t){var e=t*t;return t*(-e*t+4*e-6*t+4)},cubic:function(t){return t*(4*t*t-9*t+6)},elastic:function(t){var e=t*t;return t*(33*e*e-106*e*t+126*e-67*t+15)}}))}(jQuery);
1
+ !function($){function sc_setScroll(t,e,s){return"transition"==s.transition&&"swing"==e&&(e="ease"),{anims:[],duration:t,orgDuration:t,easing:e,startTime:getTime()}}function sc_startScroll(t,e){for(var s=0,i=t.anims.length;i>s;s++){var o=t.anims[s];o&&o[0][e.transition](o[1],t.duration,t.easing,o[2])}}function sc_stopScroll(t,e){is_boolean(e)||(e=!0),is_object(t.pre)&&sc_stopScroll(t.pre,e);for(var s=0,i=t.anims.length;i>s;s++){var o=t.anims[s];o[0].stop(!0),e&&(o[0].css(o[1]),is_function(o[2])&&o[2]())}is_object(t.post)&&sc_stopScroll(t.post,e)}function sc_afterScroll(t,e,s){switch(e&&e.remove(),s.fx){case"fade":case"crossfade":case"cover-fade":case"uncover-fade":t.css("opacity",1),t.css("filter","")}}function sc_fireCallbacks(t,e,s,i,o){if(e[s]&&e[s].call(t,i),o[s].length)for(var n=0,r=o[s].length;r>n;n++)o[s][n].call(t,i);return[]}function sc_fireQueue(t,e,s){return e.length&&(t.trigger(cf_e(e[0][0],s),e[0][1]),e.shift()),e}function sc_hideHiddenItems(t){t.each(function(){var t=$(this);t.data("_cfs_isHidden",t.is(":hidden")).hide()})}function sc_showHiddenItems(t){t&&t.each(function(){var t=$(this);t.data("_cfs_isHidden")||t.show()})}function sc_clearTimers(t){return t.auto&&clearTimeout(t.auto),t.progress&&clearInterval(t.progress),t}function sc_mapCallbackArguments(t,e,s,i,o,n,r){return{width:r.width,height:r.height,items:{old:t,skipped:e,visible:s},scroll:{items:i,direction:o,duration:n}}}function sc_getDuration(t,e,s,i){var o=t.duration;return"none"==t.fx?0:("auto"==o?o=e.scroll.duration/e.scroll.items*s:10>o&&(o=i/o),1>o?0:("fade"==t.fx&&(o/=2),Math.round(o)))}function nv_showNavi(t,e,s){var i=is_number(t.items.minimum)?t.items.minimum:t.items.visible+1;if("show"==e||"hide"==e)var o=e;else if(i>e){debug(s,"Not enough items ("+e+" total, "+i+" needed): Hiding navigation.");var o="hide"}else var o="show";var n="show"==o?"removeClass":"addClass",r=cf_c("hidden",s);t.auto.button&&t.auto.button[o]()[n](r),t.prev.button&&t.prev.button[o]()[n](r),t.next.button&&t.next.button[o]()[n](r),t.pagination.container&&t.pagination.container[o]()[n](r)}function nv_enableNavi(t,e,s){if(!t.circular&&!t.infinite){var i="removeClass"==e||"addClass"==e?e:!1,o=cf_c("disabled",s);if(t.auto.button&&i&&t.auto.button[i](o),t.prev.button){var n=i||0==e?"addClass":"removeClass";t.prev.button[n](o)}if(t.next.button){var n=i||e==t.items.visible?"addClass":"removeClass";t.next.button[n](o)}}}function go_getObject(t,e){return is_function(e)?e=e.call(t):is_undefined(e)&&(e={}),e}function go_getItemsObject(t,e){return e=go_getObject(t,e),is_number(e)?e={visible:e}:"variable"==e?e={visible:e,width:e,height:e}:is_object(e)||(e={}),e}function go_getScrollObject(t,e){return e=go_getObject(t,e),is_number(e)?e=50>=e?{items:e}:{duration:e}:is_string(e)?e={easing:e}:is_object(e)||(e={}),e}function go_getNaviObject(t,e){if(e=go_getObject(t,e),is_string(e)){var s=cf_getKeyCode(e);e=-1==s?$(e):s}return e}function go_getAutoObject(t,e){return e=go_getNaviObject(t,e),is_jquery(e)?e={button:e}:is_boolean(e)?e={play:e}:is_number(e)&&(e={timeoutDuration:e}),e.progress&&(is_string(e.progress)||is_jquery(e.progress))&&(e.progress={bar:e.progress}),e}function go_complementAutoObject(t,e){return is_function(e.button)&&(e.button=e.button.call(t)),is_string(e.button)&&(e.button=$(e.button)),is_boolean(e.play)||(e.play=!0),is_number(e.delay)||(e.delay=0),is_undefined(e.pauseOnEvent)&&(e.pauseOnEvent=!0),is_boolean(e.pauseOnResize)||(e.pauseOnResize=!0),is_number(e.timeoutDuration)||(e.timeoutDuration=e.duration<10?2500:5*e.duration),e.progress&&(is_function(e.progress.bar)&&(e.progress.bar=e.progress.bar.call(t)),is_string(e.progress.bar)&&(e.progress.bar=$(e.progress.bar)),e.progress.bar?(is_function(e.progress.updater)||(e.progress.updater=$.fn.carouFredSel.progressbarUpdater),is_number(e.progress.interval)||(e.progress.interval=50)):e.progress=!1),e}function go_getPrevNextObject(t,e){return e=go_getNaviObject(t,e),is_jquery(e)?e={button:e}:is_number(e)&&(e={key:e}),e}function go_complementPrevNextObject(t,e){return is_function(e.button)&&(e.button=e.button.call(t)),is_string(e.button)&&(e.button=$(e.button)),is_string(e.key)&&(e.key=cf_getKeyCode(e.key)),e}function go_getPaginationObject(t,e){return e=go_getNaviObject(t,e),is_jquery(e)?e={container:e}:is_boolean(e)&&(e={keys:e}),e}function go_complementPaginationObject(t,e){return is_function(e.container)&&(e.container=e.container.call(t)),is_string(e.container)&&(e.container=$(e.container)),is_number(e.items)||(e.items=!1),is_boolean(e.keys)||(e.keys=!1),is_function(e.anchorBuilder)||is_false(e.anchorBuilder)||(e.anchorBuilder=$.fn.carouFredSel.pageAnchorBuilder),is_number(e.deviation)||(e.deviation=0),e}function go_getSwipeObject(t,e){return is_function(e)&&(e=e.call(t)),is_undefined(e)&&(e={onTouch:!1}),is_true(e)?e={onTouch:e}:is_number(e)&&(e={items:e}),e}function go_complementSwipeObject(t,e){return is_boolean(e.onTouch)||(e.onTouch=!0),is_boolean(e.onMouse)||(e.onMouse=!1),is_object(e.options)||(e.options={}),is_boolean(e.options.triggerOnTouchEnd)||(e.options.triggerOnTouchEnd=!1),e}function go_getMousewheelObject(t,e){return is_function(e)&&(e=e.call(t)),is_true(e)?e={}:is_number(e)?e={items:e}:is_undefined(e)&&(e=!1),e}function go_complementMousewheelObject(t,e){return e}function gn_getItemIndex(t,e,s,i,o){if(is_string(t)&&(t=$(t,o)),is_object(t)&&(t=$(t,o)),is_jquery(t)?(t=o.children().index(t),is_boolean(s)||(s=!1)):is_boolean(s)||(s=!0),is_number(t)||(t=0),is_number(e)||(e=0),s&&(t+=i.first),t+=e,i.total>0){for(;t>=i.total;)t-=i.total;for(;0>t;)t+=i.total}return t}function gn_getVisibleItemsPrev(t,e,s){for(var i=0,o=0,n=s;n>=0;n--){var r=t.eq(n);if(i+=r.is(":visible")?r[e.d.outerWidth](!0):0,i>e.maxDimension)return o;0==n&&(n=t.length),o++}}function gn_getVisibleItemsPrevFilter(t,e,s){return gn_getItemsPrevFilter(t,e.items.filter,e.items.visibleConf.org,s)}function gn_getScrollItemsPrevFilter(t,e,s,i){return gn_getItemsPrevFilter(t,e.items.filter,i,s)}function gn_getItemsPrevFilter(t,e,s,i){for(var o=0,n=0,r=i,c=t.length;r>=0;r--){if(n++,n==c)return n;var a=t.eq(r);if(a.is(e)&&(o++,o==s))return n;0==r&&(r=c)}}function gn_getVisibleOrg(t,e){return e.items.visibleConf.org||t.children().slice(0,e.items.visible).filter(e.items.filter).length}function gn_getVisibleItemsNext(t,e,s){for(var i=0,o=0,n=s,r=t.length-1;r>=n;n++){var c=t.eq(n);if(i+=c.is(":visible")?c[e.d.outerWidth](!0):0,i>e.maxDimension)return o;if(o++,o==r+1)return o;n==r&&(n=-1)}}function gn_getVisibleItemsNextTestCircular(t,e,s,i){var o=gn_getVisibleItemsNext(t,e,s);return e.circular||s+o>i&&(o=i-s),o}function gn_getVisibleItemsNextFilter(t,e,s){return gn_getItemsNextFilter(t,e.items.filter,e.items.visibleConf.org,s,e.circular)}function gn_getScrollItemsNextFilter(t,e,s,i){return gn_getItemsNextFilter(t,e.items.filter,i+1,s,e.circular)-1}function gn_getItemsNextFilter(t,e,s,i){for(var o=0,n=0,r=i,c=t.length-1;c>=r;r++){if(n++,n>=c)return n;var a=t.eq(r);if(a.is(e)&&(o++,o==s))return n;r==c&&(r=-1)}}function gi_getCurrentItems(t,e){return t.slice(0,e.items.visible)}function gi_getOldItemsPrev(t,e,s){return t.slice(s,e.items.visibleConf.old+s)}function gi_getNewItemsPrev(t,e){return t.slice(0,e.items.visible)}function gi_getOldItemsNext(t,e){return t.slice(0,e.items.visibleConf.old)}function gi_getNewItemsNext(t,e,s){return t.slice(s,e.items.visible+s)}function sz_storeMargin(t,e,s){e.usePadding&&(is_string(s)||(s="_cfs_origCssMargin"),t.each(function(){var t=$(this),i=parseInt(t.css(e.d.marginRight),10);is_number(i)||(i=0),t.data(s,i)}))}function sz_resetMargin(t,e,s){if(e.usePadding){var i=is_boolean(s)?s:!1;is_number(s)||(s=0),sz_storeMargin(t,e,"_cfs_tempCssMargin"),t.each(function(){var t=$(this);t.css(e.d.marginRight,i?t.data("_cfs_tempCssMargin"):s+t.data("_cfs_origCssMargin"))})}}function sz_storeOrigCss(t){t.each(function(){var t=$(this);t.data("_cfs_origCss",t.attr("style")||"")})}function sz_restoreOrigCss(t){t.each(function(){var t=$(this);t.attr("style",t.data("_cfs_origCss")||"")})}function sz_setResponsiveSizes(t,e){var s=(t.items.visible,t.items[t.d.width]),i=t[t.d.height],o=is_percentage(i);e.each(function(){var e=$(this),n=s-ms_getPaddingBorderMargin(e,t,"Width");e[t.d.width](n),o&&e[t.d.height](ms_getPercentage(n,i))})}function sz_setSizes(t,e){var s=t.parent(),i=t.children(),o=gi_getCurrentItems(i,e),n=cf_mapWrapperSizes(ms_getSizes(o,e,!0),e,!1);if(s.css(n),e.usePadding){var r=e.padding,c=r[e.d[1]];e.align&&0>c&&(c=0);var a=o.last();a.css(e.d.marginRight,a.data("_cfs_origCssMargin")+c),t.css(e.d.top,r[e.d[0]]),t.css(e.d.left,r[e.d[3]])}return t.css(e.d.width,n[e.d.width]+2*ms_getTotalSize(i,e,"width")),t.css(e.d.height,ms_getLargestSize(i,e,"height")),n}function ms_getSizes(t,e,s){return[ms_getTotalSize(t,e,"width",s),ms_getLargestSize(t,e,"height",s)]}function ms_getLargestSize(t,e,s,i){return is_boolean(i)||(i=!1),is_number(e[e.d[s]])&&i?e[e.d[s]]:is_number(e.items[e.d[s]])?e.items[e.d[s]]:(s=s.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",ms_getTrueLargestSize(t,e,s))}function ms_getTrueLargestSize(t,e,s){for(var i=0,o=0,n=t.length;n>o;o++){var r=t.eq(o),c=r.is(":visible")?r[e.d[s]](!0):0;c>i&&(i=c)}return i}function ms_getTotalSize(t,e,s,i){if(is_boolean(i)||(i=!1),is_number(e[e.d[s]])&&i)return e[e.d[s]];if(is_number(e.items[e.d[s]]))return e.items[e.d[s]]*t.length;for(var o=s.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",n=0,r=0,c=t.length;c>r;r++){var a=t.eq(r);n+=a.is(":visible")?a[e.d[o]](!0):0}return n}function ms_getParentSize(t,e,s){var i=t.is(":visible");i&&t.hide();var o=t.parent()[e.d[s]]();return i&&t.show(),o}function ms_getMaxDimension(t,e){return is_number(t[t.d.width])?t[t.d.width]:e}function ms_hasVariableSizes(t,e,s){for(var i=!1,o=!1,n=0,r=t.length;r>n;n++){var c=t.eq(n),a=c.is(":visible")?c[e.d[s]](!0):0;i===!1?i=a:i!=a&&(o=!0),0==i&&(o=!0)}return o}function ms_getPaddingBorderMargin(t,e,s){return t[e.d["outer"+s]](!0)-t[e.d[s.toLowerCase()]]()}function ms_getPercentage(t,e){if(is_percentage(e)){if(e=parseInt(e.slice(0,-1),10),!is_number(e))return t;t*=e/100}return t}function cf_e(t,e,s,i,o){return is_boolean(s)||(s=!0),is_boolean(i)||(i=!0),is_boolean(o)||(o=!1),s&&(t=e.events.prefix+t),i&&(t=t+"."+e.events.namespace),i&&o&&(t+=e.serialNumber),t}function cf_c(t,e){return is_string(e.classnames[t])?e.classnames[t]:t}function cf_mapWrapperSizes(t,e,s){is_boolean(s)||(s=!0);var i=e.usePadding&&s?e.padding:[0,0,0,0],o={};return o[e.d.width]=t[0]+i[1]+i[3],o[e.d.height]=t[1]+i[0]+i[2],o}function cf_sortParams(t,e){for(var s=[],i=0,o=t.length;o>i;i++)for(var n=0,r=e.length;r>n;n++)if(e[n].indexOf(typeof t[i])>-1&&is_undefined(s[n])){s[n]=t[i];break}return s}function cf_getPadding(t){if(is_undefined(t))return[0,0,0,0];if(is_number(t))return[t,t,t,t];if(is_string(t)&&(t=t.split("px").join("").split("em").join("").split(" ")),!is_array(t))return[0,0,0,0];for(var e=0;4>e;e++)t[e]=parseInt(t[e],10);switch(t.length){case 0:return[0,0,0,0];case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];default:return[t[0],t[1],t[2],t[3]]}}function cf_getAlignPadding(t,e){var s=is_number(e[e.d.width])?Math.ceil(e[e.d.width]-ms_getTotalSize(t,e,"width")):0;switch(e.align){case"left":return[0,s];case"right":return[s,0];case"center":default:return[Math.ceil(s/2),Math.floor(s/2)]}}function cf_getDimensions(t){for(var e=[["width","innerWidth","outerWidth","height","innerHeight","outerHeight","left","top","marginRight",0,1,2,3],["height","innerHeight","outerHeight","width","innerWidth","outerWidth","top","left","marginBottom",3,2,1,0]],s=e[0].length,i="right"==t.direction||"left"==t.direction?0:1,o={},n=0;s>n;n++)o[e[0][n]]=e[i][n];return o}function cf_getAdjust(t,e,s,i){var o=t;if(is_function(s))o=s.call(i,o);else if(is_string(s)){var n=s.split("+"),r=s.split("-");if(r.length>n.length)var c=!0,a=r[0],f=r[1];else var c=!1,a=n[0],f=n[1];switch(a){case"even":o=t%2==1?t-1:t;break;case"odd":o=t%2==0?t-1:t;break;default:o=t}f=parseInt(f,10),is_number(f)&&(c&&(f=-f),o+=f)}return(!is_number(o)||1>o)&&(o=1),o}function cf_getItemsAdjust(t,e,s,i){return cf_getItemAdjustMinMax(cf_getAdjust(t,e,s,i),e.items.visibleConf)}function cf_getItemAdjustMinMax(t,e){return is_number(e.min)&&t<e.min&&(t=e.min),is_number(e.max)&&t>e.max&&(t=e.max),1>t&&(t=1),t}function cf_getSynchArr(t){is_array(t)||(t=[[t]]),is_array(t[0])||(t=[t]);for(var e=0,s=t.length;s>e;e++)is_string(t[e][0])&&(t[e][0]=$(t[e][0])),is_boolean(t[e][1])||(t[e][1]=!0),is_boolean(t[e][2])||(t[e][2]=!0),is_number(t[e][3])||(t[e][3]=0);return t}function cf_getKeyCode(t){return"right"==t?39:"left"==t?37:"up"==t?38:"down"==t?40:-1}function cf_setCookie(t,e,s){if(t){var i=e.triggerHandler(cf_e("currentPosition",s));$.fn.carouFredSel.cookie.set(t,i)}}function cf_getCookie(t){var e=$.fn.carouFredSel.cookie.get(t);return""==e?0:e}function in_mapCss(t,e){for(var s={},i=0,o=e.length;o>i;i++)s[e[i]]=t.css(e[i]);return s}function in_complementItems(t,e,s,i){return is_object(t.visibleConf)||(t.visibleConf={}),is_object(t.sizesConf)||(t.sizesConf={}),0==t.start&&is_number(i)&&(t.start=i),is_object(t.visible)?(t.visibleConf.min=t.visible.min,t.visibleConf.max=t.visible.max,t.visible=!1):is_string(t.visible)?("variable"==t.visible?t.visibleConf.variable=!0:t.visibleConf.adjust=t.visible,t.visible=!1):is_function(t.visible)&&(t.visibleConf.adjust=t.visible,t.visible=!1),is_string(t.filter)||(t.filter=s.filter(":hidden").length>0?":visible":"*"),t[e.d.width]||(e.responsive?(debug(!0,"Set a "+e.d.width+" for the items!"),t[e.d.width]=ms_getTrueLargestSize(s,e,"outerWidth")):t[e.d.width]=ms_hasVariableSizes(s,e,"outerWidth")?"variable":s[e.d.outerWidth](!0)),t[e.d.height]||(t[e.d.height]=ms_hasVariableSizes(s,e,"outerHeight")?"variable":s[e.d.outerHeight](!0)),t.sizesConf.width=t.width,t.sizesConf.height=t.height,t}function in_complementVisibleItems(t,e){return"variable"==t.items[t.d.width]&&(t.items.visibleConf.variable=!0),t.items.visibleConf.variable||(is_number(t[t.d.width])?t.items.visible=Math.floor(t[t.d.width]/t.items[t.d.width]):(t.items.visible=Math.floor(e/t.items[t.d.width]),t[t.d.width]=t.items.visible*t.items[t.d.width],t.items.visibleConf.adjust||(t.align=!1)),("Infinity"==t.items.visible||t.items.visible<1)&&(debug(!0,'Not a valid number of visible items: Set to "variable".'),t.items.visibleConf.variable=!0)),t}function in_complementPrimarySize(t,e,s){return"auto"==t&&(t=ms_getTrueLargestSize(s,e,"outerWidth")),t}function in_complementSecondarySize(t,e,s){return"auto"==t&&(t=ms_getTrueLargestSize(s,e,"outerHeight")),t||(t=e.items[e.d.height]),t}function in_getAlignPadding(t,e){var s=cf_getAlignPadding(gi_getCurrentItems(e,t),t);return t.padding[t.d[1]]=s[1],t.padding[t.d[3]]=s[0],t}function in_getResponsiveValues(t,e){var s=cf_getItemAdjustMinMax(Math.ceil(t[t.d.width]/t.items[t.d.width]),t.items.visibleConf);s>e.length&&(s=e.length);var i=Math.floor(t[t.d.width]/s);return t.items.visible=s,t.items[t.d.width]=i,t[t.d.width]=s*i,t}function bt_pauseOnHoverConfig(t){if(is_string(t))var e=t.indexOf("immediate")>-1?!0:!1,s=t.indexOf("resume")>-1?!0:!1;else var e=s=!1;return[e,s]}function bt_mousesheelNumber(t){return is_number(t)?t:null}function is_null(t){return null===t}function is_undefined(t){return is_null(t)||"undefined"==typeof t||""===t||"undefined"===t}function is_array(t){return t instanceof Array}function is_jquery(t){return t instanceof jQuery}function is_object(t){return(t instanceof Object||"object"==typeof t)&&!is_null(t)&&!is_jquery(t)&&!is_array(t)&&!is_function(t)}function is_number(t){return(t instanceof Number||"number"==typeof t)&&!isNaN(t)}function is_string(t){return(t instanceof String||"string"==typeof t)&&!is_undefined(t)&&!is_true(t)&&!is_false(t)}function is_function(t){return t instanceof Function||"function"==typeof t}function is_boolean(t){return t instanceof Boolean||"boolean"==typeof t||is_true(t)||is_false(t)}function is_true(t){return t===!0||"true"===t}function is_false(t){return t===!1||"false"===t}function is_percentage(t){return is_string(t)&&"%"==t.slice(-1)}function getTime(){return(new Date).getTime()}function deprecated(t,e){debug(!0,t+" is DEPRECATED, support for it will be removed. Use "+e+" instead.")}function debug(t,e){if(!is_undefined(window.console)&&!is_undefined(window.console.log)){if(is_object(t)){var s=" ("+t.selector+")";t=t.debug}else var s="";if(!t)return!1;e=is_string(e)?"carouFredSel"+s+": "+e:["carouFredSel"+s+":",e],window.console.log(e)}return!1}$.fn.carouFredSel||($.fn.caroufredsel=$.fn.carouFredSel=function(options,configs){if(0==this.length)return debug(!0,'No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){$(this).carouFredSel(options,configs)});var $cfs=this,$tt0=this[0],starting_position=!1;$cfs.data("_cfs_isCarousel")&&(starting_position=$cfs.triggerHandler("_cfs_triggerEvent","currentPosition"),$cfs.trigger("_cfs_triggerEvent",["destroy",!0]));var FN={};FN._init=function(t,e,s){t=go_getObject($tt0,t),t.items=go_getItemsObject($tt0,t.items),t.scroll=go_getScrollObject($tt0,t.scroll),t.auto=go_getAutoObject($tt0,t.auto),t.prev=go_getPrevNextObject($tt0,t.prev),t.next=go_getPrevNextObject($tt0,t.next),t.pagination=go_getPaginationObject($tt0,t.pagination),t.swipe=go_getSwipeObject($tt0,t.swipe),t.mousewheel=go_getMousewheelObject($tt0,t.mousewheel),e&&(opts_orig=$.extend(!0,{},$.fn.carouFredSel.defaults,t)),opts=$.extend(!0,{},$.fn.carouFredSel.defaults,t),opts.d=cf_getDimensions(opts),crsl.direction="up"==opts.direction||"left"==opts.direction?"next":"prev";var i=$cfs.children(),o=ms_getParentSize($wrp,opts,"width");if(is_true(opts.cookie)&&(opts.cookie="caroufredsel_cookie_"+conf.serialNumber),opts.maxDimension=ms_getMaxDimension(opts,o),opts.items=in_complementItems(opts.items,opts,i,s),opts[opts.d.width]=in_complementPrimarySize(opts[opts.d.width],opts,i),opts[opts.d.height]=in_complementSecondarySize(opts[opts.d.height],opts,i),opts.responsive&&(is_percentage(opts[opts.d.width])||(opts[opts.d.width]="100%")),is_percentage(opts[opts.d.width])&&(crsl.upDateOnWindowResize=!0,crsl.primarySizePercentage=opts[opts.d.width],opts[opts.d.width]=ms_getPercentage(o,crsl.primarySizePercentage),opts.items.visible||(opts.items.visibleConf.variable=!0)),opts.responsive?(opts.usePadding=!1,opts.padding=[0,0,0,0],opts.align=!1,opts.items.visibleConf.variable=!1):(opts.items.visible||(opts=in_complementVisibleItems(opts,o)),opts[opts.d.width]||(!opts.items.visibleConf.variable&&is_number(opts.items[opts.d.width])&&"*"==opts.items.filter?(opts[opts.d.width]=opts.items.visible*opts.items[opts.d.width],opts.align=!1):opts[opts.d.width]="variable"),is_undefined(opts.align)&&(opts.align=is_number(opts[opts.d.width])?"center":!1),opts.items.visibleConf.variable&&(opts.items.visible=gn_getVisibleItemsNext(i,opts,0))),"*"==opts.items.filter||opts.items.visibleConf.variable||(opts.items.visibleConf.org=opts.items.visible,opts.items.visible=gn_getVisibleItemsNextFilter(i,opts,0)),opts.items.visible=cf_getItemsAdjust(opts.items.visible,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts.responsive)opts.items.visibleConf.min||(opts.items.visibleConf.min=opts.items.visible),opts.items.visibleConf.max||(opts.items.visibleConf.max=opts.items.visible),opts=in_getResponsiveValues(opts,i,o);else switch(opts.padding=cf_getPadding(opts.padding),"top"==opts.align?opts.align="left":"bottom"==opts.align&&(opts.align="right"),opts.align){case"center":case"left":case"right":"variable"!=opts[opts.d.width]&&(opts=in_getAlignPadding(opts,i),opts.usePadding=!0);break;default:opts.align=!1,opts.usePadding=0==opts.padding[0]&&0==opts.padding[1]&&0==opts.padding[2]&&0==opts.padding[3]?!1:!0}is_number(opts.scroll.duration)||(opts.scroll.duration=500),is_undefined(opts.scroll.items)&&(opts.scroll.items=opts.responsive||opts.items.visibleConf.variable||"*"!=opts.items.filter?"visible":opts.items.visible),opts.auto=$.extend(!0,{},opts.scroll,opts.auto),opts.prev=$.extend(!0,{},opts.scroll,opts.prev),opts.next=$.extend(!0,{},opts.scroll,opts.next),opts.pagination=$.extend(!0,{},opts.scroll,opts.pagination),opts.auto=go_complementAutoObject($tt0,opts.auto),opts.prev=go_complementPrevNextObject($tt0,opts.prev),opts.next=go_complementPrevNextObject($tt0,opts.next),opts.pagination=go_complementPaginationObject($tt0,opts.pagination),opts.swipe=go_complementSwipeObject($tt0,opts.swipe),opts.mousewheel=go_complementMousewheelObject($tt0,opts.mousewheel),opts.synchronise&&(opts.synchronise=cf_getSynchArr(opts.synchronise)),opts.auto.onPauseStart&&(opts.auto.onTimeoutStart=opts.auto.onPauseStart,deprecated("auto.onPauseStart","auto.onTimeoutStart")),opts.auto.onPausePause&&(opts.auto.onTimeoutPause=opts.auto.onPausePause,deprecated("auto.onPausePause","auto.onTimeoutPause")),opts.auto.onPauseEnd&&(opts.auto.onTimeoutEnd=opts.auto.onPauseEnd,deprecated("auto.onPauseEnd","auto.onTimeoutEnd")),opts.auto.pauseDuration&&(opts.auto.timeoutDuration=opts.auto.pauseDuration,deprecated("auto.pauseDuration","auto.timeoutDuration"))},FN._build=function(){$cfs.data("_cfs_isCarousel",!0);var t=$cfs.children(),e=in_mapCss($cfs,["textAlign","float","position","top","right","bottom","left","zIndex","width","height","marginTop","marginRight","marginBottom","marginLeft"]),s="relative";switch(e.position){case"absolute":case"fixed":s=e.position}"parent"==conf.wrapper?sz_storeOrigCss($wrp):$wrp.css(e),$wrp.css({overflow:"hidden",position:s}),sz_storeOrigCss($cfs),$cfs.data("_cfs_origCssZindex",e.zIndex),$cfs.css({textAlign:"left","float":"none",position:"absolute",top:0,right:"auto",bottom:"auto",left:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),sz_storeMargin(t,opts),sz_storeOrigCss(t),opts.responsive&&sz_setResponsiveSizes(opts,t)},FN._bind_events=function(){FN._unbind_events(),$cfs.bind(cf_e("stop",conf),function(t,e){return t.stopPropagation(),crsl.isStopped||opts.auto.button&&opts.auto.button.addClass(cf_c("stopped",conf)),crsl.isStopped=!0,opts.auto.play&&(opts.auto.play=!1,$cfs.trigger(cf_e("pause",conf),e)),!0}),$cfs.bind(cf_e("finish",conf),function(t){return t.stopPropagation(),crsl.isScrolling&&sc_stopScroll(scrl),!0}),$cfs.bind(cf_e("pause",conf),function(t,e,s){if(t.stopPropagation(),tmrs=sc_clearTimers(tmrs),e&&crsl.isScrolling){scrl.isStopped=!0;var i=getTime()-scrl.startTime;scrl.duration-=i,scrl.pre&&(scrl.pre.duration-=i),scrl.post&&(scrl.post.duration-=i),sc_stopScroll(scrl,!1)}if(crsl.isPaused||crsl.isScrolling||s&&(tmrs.timePassed+=getTime()-tmrs.startTime),crsl.isPaused||opts.auto.button&&opts.auto.button.addClass(cf_c("paused",conf)),crsl.isPaused=!0,opts.auto.onTimeoutPause){var o=opts.auto.timeoutDuration-tmrs.timePassed,n=100-Math.ceil(100*o/opts.auto.timeoutDuration);opts.auto.onTimeoutPause.call($tt0,n,o)}return!0}),$cfs.bind(cf_e("play",conf),function(t,e,s,i){t.stopPropagation(),tmrs=sc_clearTimers(tmrs);var o=[e,s,i],n=["string","number","boolean"],r=cf_sortParams(o,n);if(e=r[0],s=r[1],i=r[2],"prev"!=e&&"next"!=e&&(e=crsl.direction),is_number(s)||(s=0),is_boolean(i)||(i=!1),i&&(crsl.isStopped=!1,opts.auto.play=!0),!opts.auto.play)return t.stopImmediatePropagation(),debug(conf,"Carousel stopped: Not scrolling.");crsl.isPaused&&opts.auto.button&&(opts.auto.button.removeClass(cf_c("stopped",conf)),opts.auto.button.removeClass(cf_c("paused",conf))),crsl.isPaused=!1,tmrs.startTime=getTime();var c=opts.auto.timeoutDuration+s;return dur2=c-tmrs.timePassed,perc=100-Math.ceil(100*dur2/c),opts.auto.progress&&(tmrs.progress=setInterval(function(){var t=getTime()-tmrs.startTime+tmrs.timePassed,e=Math.ceil(100*t/c);opts.auto.progress.updater.call(opts.auto.progress.bar[0],e)},opts.auto.progress.interval)),tmrs.auto=setTimeout(function(){opts.auto.progress&&opts.auto.progress.updater.call(opts.auto.progress.bar[0],100),opts.auto.onTimeoutEnd&&opts.auto.onTimeoutEnd.call($tt0,perc,dur2),crsl.isScrolling?$cfs.trigger(cf_e("play",conf),e):$cfs.trigger(cf_e(e,conf),opts.auto)},dur2),opts.auto.onTimeoutStart&&opts.auto.onTimeoutStart.call($tt0,perc,dur2),!0}),$cfs.bind(cf_e("resume",conf),function(t){return t.stopPropagation(),scrl.isStopped?(scrl.isStopped=!1,crsl.isPaused=!1,crsl.isScrolling=!0,scrl.startTime=getTime(),sc_startScroll(scrl,conf)):$cfs.trigger(cf_e("play",conf)),!0}),$cfs.bind(cf_e("prev",conf)+" "+cf_e("next",conf),function(t,e,s,i,o){if(t.stopPropagation(),crsl.isStopped||$cfs.is(":hidden"))return t.stopImmediatePropagation(),debug(conf,"Carousel stopped or hidden: Not scrolling.");var n=is_number(opts.items.minimum)?opts.items.minimum:opts.items.visible+1;if(n>itms.total)return t.stopImmediatePropagation(),debug(conf,"Not enough items ("+itms.total+" total, "+n+" needed): Not scrolling.");var r=[e,s,i,o],c=["object","number/string","function","boolean"],a=cf_sortParams(r,c);e=a[0],s=a[1],i=a[2],o=a[3];var f=t.type.slice(conf.events.prefix.length);if(is_object(e)||(e={}),is_function(i)&&(e.onAfter=i),is_boolean(o)&&(e.queue=o),e=$.extend(!0,{},opts[f],e),e.conditions&&!e.conditions.call($tt0,f))return t.stopImmediatePropagation(),debug(conf,'Callback "conditions" returned false.');if(!is_number(s)){if("*"!=opts.items.filter)s="visible";else for(var l=[s,e.items,opts[f].items],a=0,u=l.length;u>a;a++)if(is_number(l[a])||"page"==l[a]||"visible"==l[a]){s=l[a];break}switch(s){case"page":return t.stopImmediatePropagation(),$cfs.triggerHandler(cf_e(f+"Page",conf),[e,i]);case"visible":opts.items.visibleConf.variable||"*"!=opts.items.filter||(s=opts.items.visible)}}if(scrl.isStopped)return $cfs.trigger(cf_e("resume",conf)),$cfs.trigger(cf_e("queue",conf),[f,[e,s,i]]),t.stopImmediatePropagation(),debug(conf,"Carousel resumed scrolling.");if(e.duration>0&&crsl.isScrolling)return e.queue&&("last"==e.queue&&(queu=[]),("first"!=e.queue||0==queu.length)&&$cfs.trigger(cf_e("queue",conf),[f,[e,s,i]])),t.stopImmediatePropagation(),debug(conf,"Carousel currently scrolling.");if(tmrs.timePassed=0,$cfs.trigger(cf_e("slide_"+f,conf),[e,s]),opts.synchronise)for(var p=opts.synchronise,d=[e,s],g=0,u=p.length;u>g;g++){var m=f;p[g][2]||(m="prev"==m?"next":"prev"),p[g][1]||(d[0]=p[g][0].triggerHandler("_cfs_triggerEvent",["configuration",m])),d[1]=s+p[g][3],p[g][0].trigger("_cfs_triggerEvent",["slide_"+m,d])}return!0}),$cfs.bind(cf_e("slide_prev",conf),function(t,e,s){t.stopPropagation();var i=$cfs.children();if(!opts.circular&&0==itms.first)return opts.infinite&&$cfs.trigger(cf_e("next",conf),itms.total-1),t.stopImmediatePropagation();if(sz_resetMargin(i,opts),!is_number(s)){if(opts.items.visibleConf.variable)s=gn_getVisibleItemsPrev(i,opts,itms.total-1);else if("*"!=opts.items.filter){var o=is_number(e.items)?e.items:gn_getVisibleOrg($cfs,opts);s=gn_getScrollItemsPrevFilter(i,opts,itms.total-1,o)}else s=opts.items.visible;s=cf_getAdjust(s,opts,e.items,$tt0)}if(opts.circular||itms.total-s<itms.first&&(s=itms.total-itms.first),opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){var n=cf_getItemsAdjust(gn_getVisibleItemsNext(i,opts,itms.total-s),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible+s<=n&&s<itms.total&&(s++,n=cf_getItemsAdjust(gn_getVisibleItemsNext(i,opts,itms.total-s),opts,opts.items.visibleConf.adjust,$tt0)),opts.items.visible=n}else if("*"!=opts.items.filter){var n=gn_getVisibleItemsNextFilter(i,opts,itms.total-s);opts.items.visible=cf_getItemsAdjust(n,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(i,opts,!0),0==s)return t.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+s+" items backward."),itms.first+=s;itms.first>=itms.total;)itms.first-=itms.total;opts.circular||(0==itms.first&&e.onEnd&&e.onEnd.call($tt0,"prev"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),$cfs.children().slice(itms.total-s,itms.total).prependTo($cfs),itms.total<opts.items.visible+s&&$cfs.children().slice(0,opts.items.visible+s-itms.total).clone(!0).appendTo($cfs);var i=$cfs.children(),r=gi_getOldItemsPrev(i,opts,s),c=gi_getNewItemsPrev(i,opts),a=i.eq(s-1),f=r.last(),l=c.last();sz_resetMargin(i,opts);var u=0,p=0;if(opts.align){var d=cf_getAlignPadding(c,opts);u=d[0],p=d[1]}var g=0>u?opts.padding[opts.d[3]]:0,m=!1,_=$();if(opts.items.visible<s&&(_=i.slice(opts.items.visibleConf.old,s),"directscroll"==e.fx)){var b=opts.items[opts.d.width];m=_,a=l,sc_hideHiddenItems(m),opts.items[opts.d.width]="variable"}var v=!1,h=ms_getTotalSize(i.slice(0,s),opts,"width"),w=cf_mapWrapperSizes(ms_getSizes(c,opts,!0),opts,!opts.usePadding),P=0,C={},x={},S={},y={},I={},z={},j={},N=sc_getDuration(e,opts,s,h);switch(e.fx){case"cover":case"cover-fade":P=ms_getTotalSize(i.slice(0,opts.items.visible),opts,"width")}m&&(opts.items[opts.d.width]=b),sz_resetMargin(i,opts,!0),p>=0&&sz_resetMargin(f,opts,opts.padding[opts.d[1]]),u>=0&&sz_resetMargin(a,opts,opts.padding[opts.d[3]]),opts.align&&(opts.padding[opts.d[1]]=p,opts.padding[opts.d[3]]=u),z[opts.d.left]=-(h-g),j[opts.d.left]=-(P-g),x[opts.d.left]=w[opts.d.width];var k=function(){},O=function(){},T=function(){},M=function(){},F=function(){},A=function(){},H=function(){},q=function(){},D=function(){},V=function(){},R=function(){};switch(e.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":v=$cfs.clone(!0).appendTo($wrp)}switch(e.fx){case"crossfade":case"uncover":case"uncover-fade":v.children().slice(0,s).remove(),v.children().slice(opts.items.visibleConf.old).remove();break;case"cover":case"cover-fade":v.children().slice(opts.items.visible).remove(),v.css(j)}if($cfs.css(z),scrl=sc_setScroll(N,e.easing,conf),C[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0,("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(k=function(){$wrp.css(w)},O=function(){scrl.anims.push([$wrp,w])}),opts.usePadding){switch(l.not(a).length&&(S[opts.d.marginRight]=a.data("_cfs_origCssMargin"),0>u?a.css(S):(H=function(){a.css(S)},q=function(){scrl.anims.push([a,S])})),e.fx){case"cover":case"cover-fade":v.children().eq(s-1).css(S)}l.not(f).length&&(y[opts.d.marginRight]=f.data("_cfs_origCssMargin"),T=function(){f.css(y)},M=function(){scrl.anims.push([f,y])}),p>=0&&(I[opts.d.marginRight]=l.data("_cfs_origCssMargin")+opts.padding[opts.d[1]],F=function(){l.css(I)},A=function(){scrl.anims.push([l,I])})}R=function(){$cfs.css(C)};var E=opts.items.visible+s-itms.total;V=function(){if(E>0&&($cfs.children().slice(itms.total).remove(),r=$($cfs.children().slice(itms.total-(opts.items.visible-E)).get().concat($cfs.children().slice(0,E).get()))),sc_showHiddenItems(m),opts.usePadding){var t=$cfs.children().eq(opts.items.visible+s-1);t.css(opts.d.marginRight,t.data("_cfs_origCssMargin"))}};var W=sc_mapCallbackArguments(r,_,c,s,"prev",N,w);switch(D=function(){sc_afterScroll($cfs,v,e),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,e,"onAfter",W,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,e,"onBefore",W,clbk),e.fx){case"none":$cfs.css(C),k(),T(),F(),H(),R(),V(),D();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){k(),T(),F(),H(),R(),V(),scrl=sc_setScroll(N,e.easing,conf),scrl.anims.push([$cfs,{opacity:1},D]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([v,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},D]),O(),T(),F(),H(),R(),V();break;case"cover":scrl.anims.push([v,C,function(){T(),F(),H(),R(),V(),D()}]),O();break;case"cover-fade":scrl.anims.push([$cfs,{opacity:0}]),scrl.anims.push([v,C,function(){T(),F(),H(),R(),V(),D()}]),O();break;case"uncover":scrl.anims.push([v,x,D]),O(),T(),F(),H(),R(),V();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([v,x,D]),O(),T(),F(),H(),R(),V();break;default:scrl.anims.push([$cfs,C,function(){V(),D()}]),O(),M(),A(),q()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,w]),!0
2
  }),$cfs.bind(cf_e("slide_next",conf),function(t,e,s){t.stopPropagation();var i=$cfs.children();if(!opts.circular&&itms.first==opts.items.visible)return opts.infinite&&$cfs.trigger(cf_e("prev",conf),itms.total-1),t.stopImmediatePropagation();if(sz_resetMargin(i,opts),!is_number(s)){if("*"!=opts.items.filter){var o=is_number(e.items)?e.items:gn_getVisibleOrg($cfs,opts);s=gn_getScrollItemsNextFilter(i,opts,0,o)}else s=opts.items.visible;s=cf_getAdjust(s,opts,e.items,$tt0)}var n=0==itms.first?itms.total:itms.first;if(!opts.circular){if(opts.items.visibleConf.variable)var r=gn_getVisibleItemsNext(i,opts,s),o=gn_getVisibleItemsPrev(i,opts,n-1);else var r=opts.items.visible,o=opts.items.visible;s+r>n&&(s=n-o)}if(opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){for(var r=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(i,opts,s,n),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible-s>=r&&s<itms.total;)s++,r=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(i,opts,s,n),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible=r}else if("*"!=opts.items.filter){var r=gn_getVisibleItemsNextFilter(i,opts,s);opts.items.visible=cf_getItemsAdjust(r,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(i,opts,!0),0==s)return t.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+s+" items forward."),itms.first-=s;itms.first<0;)itms.first+=itms.total;opts.circular||(itms.first==opts.items.visible&&e.onEnd&&e.onEnd.call($tt0,"next"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),itms.total<opts.items.visible+s&&$cfs.children().slice(0,opts.items.visible+s-itms.total).clone(!0).appendTo($cfs);var i=$cfs.children(),c=gi_getOldItemsNext(i,opts),a=gi_getNewItemsNext(i,opts,s),f=i.eq(s-1),l=c.last(),u=a.last();sz_resetMargin(i,opts);var p=0,d=0;if(opts.align){var g=cf_getAlignPadding(a,opts);p=g[0],d=g[1]}var m=!1,_=$();if(opts.items.visibleConf.old<s&&(_=i.slice(opts.items.visibleConf.old,s),"directscroll"==e.fx)){var b=opts.items[opts.d.width];m=_,f=l,sc_hideHiddenItems(m),opts.items[opts.d.width]="variable"}var v=!1,h=ms_getTotalSize(i.slice(0,s),opts,"width"),w=cf_mapWrapperSizes(ms_getSizes(a,opts,!0),opts,!opts.usePadding),P=0,C={},x={},S={},y={},I={},z=sc_getDuration(e,opts,s,h);switch(e.fx){case"uncover":case"uncover-fade":P=ms_getTotalSize(i.slice(0,opts.items.visibleConf.old),opts,"width")}m&&(opts.items[opts.d.width]=b),opts.align&&opts.padding[opts.d[1]]<0&&(opts.padding[opts.d[1]]=0),sz_resetMargin(i,opts,!0),sz_resetMargin(l,opts,opts.padding[opts.d[1]]),opts.align&&(opts.padding[opts.d[1]]=d,opts.padding[opts.d[3]]=p),I[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0;var j=function(){},N=function(){},k=function(){},O=function(){},T=function(){},M=function(){},F=function(){},A=function(){},H=function(){};switch(e.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":v=$cfs.clone(!0).appendTo($wrp),v.children().slice(opts.items.visibleConf.old).remove()}switch(e.fx){case"crossfade":case"cover":case"cover-fade":$cfs.css("zIndex",1),v.css("zIndex",0)}if(scrl=sc_setScroll(z,e.easing,conf),C[opts.d.left]=-h,x[opts.d.left]=-P,0>p&&(C[opts.d.left]+=p),("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(j=function(){$wrp.css(w)},N=function(){scrl.anims.push([$wrp,w])}),opts.usePadding){var q=u.data("_cfs_origCssMargin");d>=0&&(q+=opts.padding[opts.d[1]]),u.css(opts.d.marginRight,q),f.not(l).length&&(y[opts.d.marginRight]=l.data("_cfs_origCssMargin")),k=function(){l.css(y)},O=function(){scrl.anims.push([l,y])};var D=f.data("_cfs_origCssMargin");p>0&&(D+=opts.padding[opts.d[3]]),S[opts.d.marginRight]=D,T=function(){f.css(S)},M=function(){scrl.anims.push([f,S])}}H=function(){$cfs.css(I)};var V=opts.items.visible+s-itms.total;A=function(){V>0&&$cfs.children().slice(itms.total).remove();var t=$cfs.children().slice(0,s).appendTo($cfs).last();if(V>0&&(a=gi_getCurrentItems(i,opts)),sc_showHiddenItems(m),opts.usePadding){if(itms.total<opts.items.visible+s){var e=$cfs.children().eq(opts.items.visible-1);e.css(opts.d.marginRight,e.data("_cfs_origCssMargin")+opts.padding[opts.d[1]])}t.css(opts.d.marginRight,t.data("_cfs_origCssMargin"))}};var R=sc_mapCallbackArguments(c,_,a,s,"next",z,w);switch(F=function(){$cfs.css("zIndex",$cfs.data("_cfs_origCssZindex")),sc_afterScroll($cfs,v,e),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,e,"onAfter",R,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,e,"onBefore",R,clbk),e.fx){case"none":$cfs.css(C),j(),k(),T(),H(),A(),F();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){j(),k(),T(),H(),A(),scrl=sc_setScroll(z,e.easing,conf),scrl.anims.push([$cfs,{opacity:1},F]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([v,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},F]),N(),k(),T(),H(),A();break;case"cover":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([$cfs,I,F]),N(),k(),T(),A();break;case"cover-fade":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([v,{opacity:0}]),scrl.anims.push([$cfs,I,F]),N(),k(),T(),A();break;case"uncover":scrl.anims.push([v,x,F]),N(),k(),T(),H(),A();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([v,x,F]),N(),k(),T(),H(),A();break;default:scrl.anims.push([$cfs,C,function(){H(),A(),F()}]),N(),O(),M()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,w]),!0}),$cfs.bind(cf_e("slideTo",conf),function(t,e,s,i,o,n,r){t.stopPropagation();var c=[e,s,i,o,n,r],a=["string/number/object","number","boolean","object","string","function"],f=cf_sortParams(c,a);return o=f[3],n=f[4],r=f[5],e=gn_getItemIndex(f[0],f[1],f[2],itms,$cfs),0==e?!1:(is_object(o)||(o=!1),"prev"!=n&&"next"!=n&&(n=opts.circular?e<=itms.total/2?"next":"prev":0==itms.first||itms.first>e?"next":"prev"),"prev"==n&&(e=itms.total-e),$cfs.trigger(cf_e(n,conf),[o,e,r]),!0)}),$cfs.bind(cf_e("prevPage",conf),function(t,e,s){t.stopPropagation();var i=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[i-1,e,"prev",s])}),$cfs.bind(cf_e("nextPage",conf),function(t,e,s){t.stopPropagation();var i=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[i+1,e,"next",s])}),$cfs.bind(cf_e("slideToPage",conf),function(t,e,s,i,o){t.stopPropagation(),is_number(e)||(e=$cfs.triggerHandler(cf_e("currentPage",conf)));var n=opts.pagination.items||opts.items.visible,r=Math.ceil(itms.total/n)-1;return 0>e&&(e=r),e>r&&(e=0),$cfs.triggerHandler(cf_e("slideTo",conf),[e*n,0,!0,s,i,o])}),$cfs.bind(cf_e("jumpToStart",conf),function(t,e){if(t.stopPropagation(),e=e?gn_getItemIndex(e,0,!0,itms,$cfs):0,e+=itms.first,0!=e){if(itms.total>0)for(;e>itms.total;)e-=itms.total;$cfs.prepend($cfs.children().slice(e,itms.total))}return!0}),$cfs.bind(cf_e("synchronise",conf),function(t,e){if(t.stopPropagation(),e)e=cf_getSynchArr(e);else{if(!opts.synchronise)return debug(conf,"No carousel to synchronise.");e=opts.synchronise}for(var s=$cfs.triggerHandler(cf_e("currentPosition",conf)),i=!0,o=0,n=e.length;n>o;o++)e[o][0].triggerHandler(cf_e("slideTo",conf),[s,e[o][3],!0])||(i=!1);return i}),$cfs.bind(cf_e("queue",conf),function(t,e,s){return t.stopPropagation(),is_function(e)?e.call($tt0,queu):is_array(e)?queu=e:is_undefined(e)||queu.push([e,s]),queu}),$cfs.bind(cf_e("insertItem",conf),function(t,e,s,i,o){t.stopPropagation();var n=[e,s,i,o],r=["string/object","string/number/object","boolean","number"],c=cf_sortParams(n,r);if(e=c[0],s=c[1],i=c[2],o=c[3],is_object(e)&&!is_jquery(e)?e=$(e):is_string(e)&&(e=$(e)),!is_jquery(e)||0==e.length)return debug(conf,"Not a valid object.");is_undefined(s)&&(s="end"),sz_storeMargin(e,opts),sz_storeOrigCss(e);var a=s,f="before";"end"==s?i?(0==itms.first?(s=itms.total-1,f="after"):(s=itms.first,itms.first+=e.length),0>s&&(s=0)):(s=itms.total-1,f="after"):s=gn_getItemIndex(s,o,i,itms,$cfs);var l=$cfs.children().eq(s);return l.length?l[f](e):(debug(conf,"Correct insert-position not found! Appending item to the end."),$cfs.append(e)),"end"==a||i||s<itms.first&&(itms.first+=e.length),itms.total=$cfs.children().length,itms.first>=itms.total&&(itms.first-=itms.total),$cfs.trigger(cf_e("updateSizes",conf)),$cfs.trigger(cf_e("linkAnchors",conf)),!0}),$cfs.bind(cf_e("removeItem",conf),function(t,e,s,i){t.stopPropagation();var o=[e,s,i],n=["string/number/object","boolean","number"],r=cf_sortParams(o,n);e=r[0],s=r[1],i=r[2];if(e instanceof $&&e.length>1)return c=$(),e.each(function(){var t=$cfs.trigger(cf_e("removeItem",conf),[$(this),s,i]);t&&(c=c.add(t))}),c;if(is_undefined(e)||"end"==e)c=$cfs.children().last();else{e=gn_getItemIndex(e,i,s,itms,$cfs);var c=$cfs.children().eq(e);c.length&&e<itms.first&&(itms.first-=c.length)}return c&&c.length&&(c.detach(),itms.total=$cfs.children().length,$cfs.trigger(cf_e("updateSizes",conf))),c}),$cfs.bind(cf_e("onBefore",conf)+" "+cf_e("onAfter",conf),function(t,e){t.stopPropagation();var s=t.type.slice(conf.events.prefix.length);return is_array(e)&&(clbk[s]=e),is_function(e)&&clbk[s].push(e),clbk[s]}),$cfs.bind(cf_e("currentPosition",conf),function(t,e){if(t.stopPropagation(),0==itms.first)var s=0;else var s=itms.total-itms.first;return is_function(e)&&e.call($tt0,s),s}),$cfs.bind(cf_e("currentPage",conf),function(t,e){t.stopPropagation();var s,i=opts.pagination.items||opts.items.visible,o=Math.ceil(itms.total/i-1);return s=0==itms.first?0:itms.first<itms.total%i?0:itms.first!=i||opts.circular?Math.round((itms.total-itms.first)/i):o,0>s&&(s=0),s>o&&(s=o),is_function(e)&&e.call($tt0,s),s}),$cfs.bind(cf_e("currentVisible",conf),function(t,e){t.stopPropagation();var s=gi_getCurrentItems($cfs.children(),opts);return is_function(e)&&e.call($tt0,s),s}),$cfs.bind(cf_e("slice",conf),function(t,e,s,i){if(t.stopPropagation(),0==itms.total)return!1;var o=[e,s,i],n=["number","number","function"],r=cf_sortParams(o,n);if(e=is_number(r[0])?r[0]:0,s=is_number(r[1])?r[1]:itms.total,i=r[2],e+=itms.first,s+=itms.first,items.total>0){for(;e>itms.total;)e-=itms.total;for(;s>itms.total;)s-=itms.total;for(;0>e;)e+=itms.total;for(;0>s;)s+=itms.total}var c,a=$cfs.children();return c=s>e?a.slice(e,s):$(a.slice(e,itms.total).get().concat(a.slice(0,s).get())),is_function(i)&&i.call($tt0,c),c}),$cfs.bind(cf_e("isPaused",conf)+" "+cf_e("isStopped",conf)+" "+cf_e("isScrolling",conf),function(t,e){t.stopPropagation();var s=t.type.slice(conf.events.prefix.length),i=crsl[s];return is_function(e)&&e.call($tt0,i),i}),$cfs.bind(cf_e("configuration",conf),function(e,a,b,c){e.stopPropagation();var reInit=!1;if(is_function(a))a.call($tt0,opts);else if(is_object(a))opts_orig=$.extend(!0,{},opts_orig,a),b!==!1?reInit=!0:opts=$.extend(!0,{},opts,a);else if(!is_undefined(a))if(is_function(b)){var val=eval("opts."+a);is_undefined(val)&&(val=""),b.call($tt0,val)}else{if(is_undefined(b))return eval("opts."+a);"boolean"!=typeof c&&(c=!0),eval("opts_orig."+a+" = b"),c!==!1?reInit=!0:eval("opts."+a+" = b")}if(reInit){sz_resetMargin($cfs.children(),opts),FN._init(opts_orig),FN._bind_buttons();var sz=sz_setSizes($cfs,opts);$cfs.trigger(cf_e("updatePageStatus",conf),[!0,sz])}return opts}),$cfs.bind(cf_e("linkAnchors",conf),function(t,e,s){return t.stopPropagation(),is_undefined(e)?e=$("body"):is_string(e)&&(e=$(e)),is_jquery(e)&&0!=e.length?(is_string(s)||(s="a.caroufredsel"),e.find(s).each(function(){var t=this.hash||"";t.length>0&&-1!=$cfs.children().index($(t))&&$(this).unbind("click").click(function(e){e.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),t)})}),!0):debug(conf,"Not a valid object.")}),$cfs.bind(cf_e("updatePageStatus",conf),function(t,e){if(t.stopPropagation(),opts.pagination.container){var s=opts.pagination.items||opts.items.visible,i=Math.ceil(itms.total/s);e&&(opts.pagination.anchorBuilder&&(opts.pagination.container.children().remove(),opts.pagination.container.each(function(){for(var t=0;i>t;t++){var e=$cfs.children().eq(gn_getItemIndex(t*s,0,!0,itms,$cfs));$(this).append(opts.pagination.anchorBuilder.call(e[0],t+1))}})),opts.pagination.container.each(function(){$(this).children().unbind(opts.pagination.event).each(function(t){$(this).bind(opts.pagination.event,function(e){e.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[t*s,-opts.pagination.deviation,!0,opts.pagination])})})}));var o=$cfs.triggerHandler(cf_e("currentPage",conf))+opts.pagination.deviation;return o>=i&&(o=0),0>o&&(o=i-1),opts.pagination.container.each(function(){$(this).children().removeClass(cf_c("selected",conf)).eq(o).addClass(cf_c("selected",conf))}),!0}}),$cfs.bind(cf_e("updateSizes",conf),function(){var t=opts.items.visible,e=$cfs.children(),s=ms_getParentSize($wrp,opts,"width");if(itms.total=e.length,crsl.primarySizePercentage?(opts.maxDimension=s,opts[opts.d.width]=ms_getPercentage(s,crsl.primarySizePercentage)):opts.maxDimension=ms_getMaxDimension(opts,s),opts.responsive?(opts.items.width=opts.items.sizesConf.width,opts.items.height=opts.items.sizesConf.height,opts=in_getResponsiveValues(opts,e,s),t=opts.items.visible,sz_setResponsiveSizes(opts,e)):opts.items.visibleConf.variable?t=gn_getVisibleItemsNext(e,opts,0):"*"!=opts.items.filter&&(t=gn_getVisibleItemsNextFilter(e,opts,0)),!opts.circular&&0!=itms.first&&t>itms.first){if(opts.items.visibleConf.variable)var i=gn_getVisibleItemsPrev(e,opts,itms.first)-itms.first;else if("*"!=opts.items.filter)var i=gn_getVisibleItemsPrevFilter(e,opts,itms.first)-itms.first;else var i=opts.items.visible-itms.first;debug(conf,"Preventing non-circular: sliding "+i+" items backward."),$cfs.trigger(cf_e("prev",conf),i)}opts.items.visible=cf_getItemsAdjust(t,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts=in_getAlignPadding(opts,e);var o=sz_setSizes($cfs,opts);return $cfs.trigger(cf_e("updatePageStatus",conf),[!0,o]),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),o}),$cfs.bind(cf_e("destroy",conf),function(t,e){return t.stopPropagation(),tmrs=sc_clearTimers(tmrs),$cfs.data("_cfs_isCarousel",!1),$cfs.trigger(cf_e("finish",conf)),e&&$cfs.trigger(cf_e("jumpToStart",conf)),sz_restoreOrigCss($cfs.children()),sz_restoreOrigCss($cfs),FN._unbind_events(),FN._unbind_buttons(),"parent"==conf.wrapper?sz_restoreOrigCss($wrp):$wrp.replaceWith($cfs),!0}),$cfs.bind(cf_e("debug",conf),function(){return debug(conf,"Carousel width: "+opts.width),debug(conf,"Carousel height: "+opts.height),debug(conf,"Item widths: "+opts.items.width),debug(conf,"Item heights: "+opts.items.height),debug(conf,"Number of items visible: "+opts.items.visible),opts.auto.play&&debug(conf,"Number of items scrolled automatically: "+opts.auto.items),opts.prev.button&&debug(conf,"Number of items scrolled backward: "+opts.prev.items),opts.next.button&&debug(conf,"Number of items scrolled forward: "+opts.next.items),conf.debug}),$cfs.bind("_cfs_triggerEvent",function(t,e,s){return t.stopPropagation(),$cfs.triggerHandler(cf_e(e,conf),s)})},FN._unbind_events=function(){$cfs.unbind(cf_e("",conf)),$cfs.unbind(cf_e("",conf,!1)),$cfs.unbind("_cfs_triggerEvent")},FN._bind_buttons=function(){if(FN._unbind_buttons(),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),opts.auto.pauseOnHover){var t=bt_pauseOnHoverConfig(opts.auto.pauseOnHover);$wrp.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.auto.button&&opts.auto.button.bind(cf_e(opts.auto.event,conf,!1),function(t){t.preventDefault();var e=!1,s=null;crsl.isPaused?e="play":opts.auto.pauseOnEvent&&(e="pause",s=bt_pauseOnHoverConfig(opts.auto.pauseOnEvent)),e&&$cfs.trigger(cf_e(e,conf),s)}),opts.prev.button&&(opts.prev.button.bind(cf_e(opts.prev.event,conf,!1),function(t){t.preventDefault(),$cfs.trigger(cf_e("prev",conf))}),opts.prev.pauseOnHover)){var t=bt_pauseOnHoverConfig(opts.prev.pauseOnHover);opts.prev.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.next.button&&(opts.next.button.bind(cf_e(opts.next.event,conf,!1),function(t){t.preventDefault(),$cfs.trigger(cf_e("next",conf))}),opts.next.pauseOnHover)){var t=bt_pauseOnHoverConfig(opts.next.pauseOnHover);opts.next.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.pagination.container&&opts.pagination.pauseOnHover){var t=bt_pauseOnHoverConfig(opts.pagination.pauseOnHover);opts.pagination.container.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if((opts.prev.key||opts.next.key)&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(t){var e=t.keyCode;e==opts.next.key&&(t.preventDefault(),$cfs.trigger(cf_e("next",conf))),e==opts.prev.key&&(t.preventDefault(),$cfs.trigger(cf_e("prev",conf)))}),opts.pagination.keys&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(t){var e=t.keyCode;e>=49&&58>e&&(e=(e-49)*opts.items.visible,e<=itms.total&&(t.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[e,0,!0,opts.pagination])))}),$.fn.swipe){var e="ontouchstart"in window;if(e&&opts.swipe.onTouch||!e&&opts.swipe.onMouse){var s=$.extend(!0,{},opts.prev,opts.swipe),i=$.extend(!0,{},opts.next,opts.swipe),o=function(){$cfs.trigger(cf_e("prev",conf),[s])},n=function(){$cfs.trigger(cf_e("next",conf),[i])};switch(opts.direction){case"up":case"down":opts.swipe.options.swipeUp=n,opts.swipe.options.swipeDown=o;break;default:opts.swipe.options.swipeLeft=n,opts.swipe.options.swipeRight=o}crsl.swipe&&$cfs.swipe("destroy"),$wrp.swipe(opts.swipe.options),$wrp.css("cursor","move"),crsl.swipe=!0}}if($.fn.mousewheel&&opts.mousewheel){var r=$.extend(!0,{},opts.prev,opts.mousewheel),c=$.extend(!0,{},opts.next,opts.mousewheel);crsl.mousewheel&&$wrp.unbind(cf_e("mousewheel",conf,!1)),$wrp.bind(cf_e("mousewheel",conf,!1),function(t,e){t.preventDefault(),e>0?$cfs.trigger(cf_e("prev",conf),[r]):$cfs.trigger(cf_e("next",conf),[c])}),crsl.mousewheel=!0}if(opts.auto.play&&$cfs.trigger(cf_e("play",conf),opts.auto.delay),crsl.upDateOnWindowResize){var a=function(){$cfs.trigger(cf_e("finish",conf)),opts.auto.pauseOnResize&&!crsl.isPaused&&$cfs.trigger(cf_e("play",conf)),sz_resetMargin($cfs.children(),opts),$cfs.trigger(cf_e("updateSizes",conf))},f=$(window),l=null;if($.debounce&&"debounce"==conf.onWindowResize)l=$.debounce(200,a);else if($.throttle&&"throttle"==conf.onWindowResize)l=$.throttle(300,a);else{var u=0,p=0;l=function(){var t=f.width(),e=f.height();(t!=u||e!=p)&&(a(),u=t,p=e)}}f.bind(cf_e("resize",conf,!1,!0,!0),l)}},FN._unbind_buttons=function(){var t=(cf_e("",conf),cf_e("",conf,!1));ns3=cf_e("",conf,!1,!0,!0),$(document).unbind(ns3),$(window).unbind(ns3),$wrp.unbind(t),opts.auto.button&&opts.auto.button.unbind(t),opts.prev.button&&opts.prev.button.unbind(t),opts.next.button&&opts.next.button.unbind(t),opts.pagination.container&&(opts.pagination.container.unbind(t),opts.pagination.anchorBuilder&&opts.pagination.container.children().remove()),crsl.swipe&&($cfs.swipe("destroy"),$wrp.css("cursor","default"),crsl.swipe=!1),crsl.mousewheel&&(crsl.mousewheel=!1),nv_showNavi(opts,"hide",conf),nv_enableNavi(opts,"removeClass",conf)},is_boolean(configs)&&(configs={debug:configs});var crsl={direction:"next",isPaused:!0,isScrolling:!1,isStopped:!1,mousewheel:!1,swipe:!1},itms={total:$cfs.children().length,first:0},tmrs={auto:null,progress:null,startTime:getTime(),timePassed:0},scrl={isStopped:!1,duration:0,startTime:0,easing:"",anims:[]},clbk={onBefore:[],onAfter:[]},queu=[],conf=$.extend(!0,{},$.fn.carouFredSel.configs,configs),opts={},opts_orig=$.extend(!0,{},options),$wrp="parent"==conf.wrapper?$cfs.parent():$cfs.wrap("<"+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />').parent();if(conf.selector=$cfs.selector,conf.serialNumber=$.fn.carouFredSel.serialNumber++,conf.transition=conf.transition&&$.fn.transition?"transition":"animate",FN._init(opts_orig,!0,starting_position),FN._build(),FN._bind_events(),FN._bind_buttons(),is_array(opts.items.start))var start_arr=opts.items.start;else{var start_arr=[];0!=opts.items.start&&start_arr.push(opts.items.start)}if(opts.cookie&&start_arr.unshift(parseInt(cf_getCookie(opts.cookie),10)),start_arr.length>0)for(var a=0,l=start_arr.length;l>a;a++){var s=start_arr[a];if(0!=s){if(s===!0){if(s=window.location.hash,s.length<1)continue}else"random"===s&&(s=Math.floor(Math.random()*itms.total));if($cfs.triggerHandler(cf_e("slideTo",conf),[s,0,!0,{fx:"none"}]))break}}var siz=sz_setSizes($cfs,opts),itm=gi_getCurrentItems($cfs.children(),opts);return opts.onCreate&&opts.onCreate.call($tt0,{width:siz.width,height:siz.height,items:itm}),$cfs.trigger(cf_e("updatePageStatus",conf),[!0,siz]),$cfs.trigger(cf_e("linkAnchors",conf)),conf.debug&&$cfs.trigger(cf_e("debug",conf)),$cfs},$.fn.carouFredSel.serialNumber=1,$.fn.carouFredSel.defaults={synchronise:!1,infinite:!0,circular:!0,responsive:!1,direction:"left",items:{start:0},scroll:{easing:"swing",duration:500,pauseOnHover:!1,event:"click",queue:!1}},$.fn.carouFredSel.configs={debug:!1,transition:!1,onWindowResize:"throttle",events:{prefix:"",namespace:"cfs"},wrapper:{element:"div",classname:"caroufredsel_wrapper"},classnames:{}},$.fn.carouFredSel.pageAnchorBuilder=function(t){return'<a href="#"><span>'+t+"</span></a>"},$.fn.carouFredSel.progressbarUpdater=function(t){$(this).css("width",t+"%")},$.fn.carouFredSel.cookie={get:function(t){t+="=";for(var e=document.cookie.split(";"),s=0,i=e.length;i>s;s++){for(var o=e[s];" "==o.charAt(0);)o=o.slice(1);if(0==o.indexOf(t))return o.slice(t.length)}return 0},set:function(t,e,s){var i="";if(s){var o=new Date;o.setTime(o.getTime()+24*s*60*60*1e3),i="; expires="+o.toGMTString()}document.cookie=t+"="+e+i+"; path=/"},remove:function(t){$.fn.carouFredSel.cookie.set(t,"",-1)}},$.extend($.easing,{quadratic:function(t){var e=t*t;return t*(-e*t+4*e-6*t+4)},cubic:function(t){return t*(4*t*t-9*t+6)},elastic:function(t){var e=t*t;return t*(33*e*e-106*e*t+126*e-67*t+15)}}))}(jQuery);
assets/js/jquery.min.js CHANGED
@@ -1 +1 @@
1
- !function($){function sc_setScroll(t,e,s){return{anims:[],duration:t,orgDuration:t,easing:e="transition"==s.transition&&"swing"==e?"ease":e,startTime:getTime()}}function sc_startScroll(t,e){for(var s=0,i=t.anims.length;s<i;s++){var o=t.anims[s];o&&o[0][e.transition](o[1],t.duration,t.easing,o[2])}}function sc_stopScroll(t,e){is_boolean(e)||(e=!0),is_object(t.pre)&&sc_stopScroll(t.pre,e);for(var s=0,i=t.anims.length;s<i;s++){var o=t.anims[s];o[0].stop(!0),e&&(o[0].css(o[1]),is_function(o[2])&&o[2]())}is_object(t.post)&&sc_stopScroll(t.post,e)}function sc_afterScroll(t,e,s){switch(e&&e.remove(),s.fx){case"fade":case"crossfade":case"cover-fade":case"uncover-fade":t.css("opacity",1),t.css("filter","")}}function sc_fireCallbacks(t,e,s,i,o){if(e[s]&&e[s].call(t,i),o[s].length)for(var n=0,r=o[s].length;n<r;n++)o[s][n].call(t,i);return[]}function sc_fireQueue(t,e,s){return e.length&&(t.trigger(cf_e(e[0][0],s),e[0][1]),e.shift()),e}function sc_hideHiddenItems(t){t.each(function(){var t=$(this);t.data("_cfs_isHidden",t.is(":hidden")).hide()})}function sc_showHiddenItems(t){t&&t.each(function(){var t=$(this);t.data("_cfs_isHidden")||t.show()})}function sc_clearTimers(t){return t.auto&&clearTimeout(t.auto),t.progress&&clearInterval(t.progress),t}function sc_mapCallbackArguments(t,e,s,i,o,n,r){return{width:r.width,height:r.height,items:{old:t,skipped:e,visible:s},scroll:{items:i,direction:o,duration:n}}}function sc_getDuration(t,e,s,i){var o=t.duration;return"none"==t.fx?0:("auto"==o?o=e.scroll.duration/e.scroll.items*s:o<10&&(o=i/o),o<1?0:("fade"==t.fx&&(o/=2),Math.round(o)))}function nv_showNavi(t,e,s){var i=is_number(t.items.minimum)?t.items.minimum:t.items.visible+1,i="show"==(e="show"==e||"hide"==e?e:e<i?(debug(s,"Not enough items ("+e+" total, "+i+" needed): Hiding navigation."),"hide"):"show")?"removeClass":"addClass",s=cf_c("hidden",s);t.auto.button&&t.auto.button[e]()[i](s),t.prev.button&&t.prev.button[e]()[i](s),t.next.button&&t.next.button[e]()[i](s),t.pagination.container&&t.pagination.container[e]()[i](s)}function nv_enableNavi(t,e,s){var i,o;t.circular||t.infinite||(i=("removeClass"==e||"addClass"==e)&&e,s=cf_c("disabled",s),t.auto.button&&i&&t.auto.button[i](s),t.prev.button&&t.prev.button[o=i||0==e?"addClass":"removeClass"](s),t.next.button&&(o=i||e==t.items.visible?"addClass":"removeClass",t.next.button[o](s)))}function go_getObject(t,e){return is_function(e)?e=e.call(t):is_undefined(e)&&(e={}),e}function go_getItemsObject(t,e){return is_number(e=go_getObject(t,e))?e={visible:e}:"variable"==e?e={visible:e,width:e,height:e}:is_object(e)||(e={}),e}function go_getScrollObject(t,e){return is_number(e=go_getObject(t,e))?e=e<=50?{items:e}:{duration:e}:is_string(e)?e={easing:e}:is_object(e)||(e={}),e}function go_getNaviObject(t,e){return e=is_string(e=go_getObject(t,e))?-1==(t=cf_getKeyCode(e))?$(e):t:e}function go_getAutoObject(t,e){return is_jquery(e=go_getNaviObject(t,e))?e={button:e}:is_boolean(e)?e={play:e}:is_number(e)&&(e={timeoutDuration:e}),e.progress&&(is_string(e.progress)||is_jquery(e.progress))&&(e.progress={bar:e.progress}),e}function go_complementAutoObject(t,e){return is_function(e.button)&&(e.button=e.button.call(t)),is_string(e.button)&&(e.button=$(e.button)),is_boolean(e.play)||(e.play=!0),is_number(e.delay)||(e.delay=0),is_undefined(e.pauseOnEvent)&&(e.pauseOnEvent=!0),is_boolean(e.pauseOnResize)||(e.pauseOnResize=!0),is_number(e.timeoutDuration)||(e.timeoutDuration=e.duration<10?2500:5*e.duration),e.progress&&(is_function(e.progress.bar)&&(e.progress.bar=e.progress.bar.call(t)),is_string(e.progress.bar)&&(e.progress.bar=$(e.progress.bar)),e.progress.bar?(is_function(e.progress.updater)||(e.progress.updater=$.fn.carouFredSel.progressbarUpdater),is_number(e.progress.interval)||(e.progress.interval=50)):e.progress=!1),e}function go_getPrevNextObject(t,e){return is_jquery(e=go_getNaviObject(t,e))?e={button:e}:is_number(e)&&(e={key:e}),e}function go_complementPrevNextObject(t,e){return is_function(e.button)&&(e.button=e.button.call(t)),is_string(e.button)&&(e.button=$(e.button)),is_string(e.key)&&(e.key=cf_getKeyCode(e.key)),e}function go_getPaginationObject(t,e){return is_jquery(e=go_getNaviObject(t,e))?e={container:e}:is_boolean(e)&&(e={keys:e}),e}function go_complementPaginationObject(t,e){return is_function(e.container)&&(e.container=e.container.call(t)),is_string(e.container)&&(e.container=$(e.container)),is_number(e.items)||(e.items=!1),is_boolean(e.keys)||(e.keys=!1),is_function(e.anchorBuilder)||is_false(e.anchorBuilder)||(e.anchorBuilder=$.fn.carouFredSel.pageAnchorBuilder),is_number(e.deviation)||(e.deviation=0),e}function go_getSwipeObject(t,e){return is_true(e=is_undefined(e=is_function(e)?e.call(t):e)?{onTouch:!1}:e)?e={onTouch:e}:is_number(e)&&(e={items:e}),e}function go_complementSwipeObject(t,e){return is_boolean(e.onTouch)||(e.onTouch=!0),is_boolean(e.onMouse)||(e.onMouse=!1),is_object(e.options)||(e.options={}),is_boolean(e.options.triggerOnTouchEnd)||(e.options.triggerOnTouchEnd=!1),e}function go_getMousewheelObject(t,e){return is_true(e=is_function(e)?e.call(t):e)?e={}:is_number(e)?e={items:e}:is_undefined(e)&&(e=!1),e}function go_complementMousewheelObject(t,e){return e}function gn_getItemIndex(t,e,s,i,o){if(is_jquery(t=is_object(t=is_string(t)?$(t,o):t)?$(t,o):t)?(t=o.children().index(t),is_boolean(s)||(s=!1)):is_boolean(s)||(s=!0),is_number(t)||(t=0),is_number(e)||(e=0),s&&(t+=i.first),t+=e,0<i.total){for(;t>=i.total;)t-=i.total;for(;t<0;)t+=i.total}return t}function gn_getVisibleItemsPrev(t,e,s){for(var i=0,o=0,n=s;0<=n;n--){var r=t.eq(n);if((i+=r.is(":visible")?r[e.d.outerWidth](!0):0)>e.maxDimension)return o;0==n&&(n=t.length),o++}}function gn_getVisibleItemsPrevFilter(t,e,s){return gn_getItemsPrevFilter(t,e.items.filter,e.items.visibleConf.org,s)}function gn_getScrollItemsPrevFilter(t,e,s,i){return gn_getItemsPrevFilter(t,e.items.filter,i,s)}function gn_getItemsPrevFilter(t,e,s,i){for(var o=0,n=0,r=i,c=t.length;0<=r;r--){if(++n==c)return n;var a=t.eq(r);if(a.is(e)&&++o==s)return n;0==r&&(r=c)}}function gn_getVisibleOrg(t,e){return e.items.visibleConf.org||t.children().slice(0,e.items.visible).filter(e.items.filter).length}function gn_getVisibleItemsNext(t,e,s){for(var i=0,o=0,n=s,r=t.length-1;n<=r;n++){var c=t.eq(n);if((i+=c.is(":visible")?c[e.d.outerWidth](!0):0)>e.maxDimension)return o;if(++o==1+r)return o;n==r&&(n=-1)}}function gn_getVisibleItemsNextTestCircular(t,e,s,i){t=gn_getVisibleItemsNext(t,e,s);return e.circular||i<s+t&&(t=i-s),t}function gn_getVisibleItemsNextFilter(t,e,s){return gn_getItemsNextFilter(t,e.items.filter,e.items.visibleConf.org,s,e.circular)}function gn_getScrollItemsNextFilter(t,e,s,i){return gn_getItemsNextFilter(t,e.items.filter,i+1,s,e.circular)-1}function gn_getItemsNextFilter(t,e,s,i,o){for(var n=0,r=0,c=i,a=t.length-1;c<=a;c++){if(a<=++r)return r;var f=t.eq(c);if(f.is(e)&&++n==s)return r;c==a&&(c=-1)}}function gi_getCurrentItems(t,e){return t.slice(0,e.items.visible)}function gi_getOldItemsPrev(t,e,s){return t.slice(s,e.items.visibleConf.old+s)}function gi_getNewItemsPrev(t,e){return t.slice(0,e.items.visible)}function gi_getOldItemsNext(t,e){return t.slice(0,e.items.visibleConf.old)}function gi_getNewItemsNext(t,e,s){return t.slice(s,e.items.visible+s)}function sz_storeMargin(t,s,i){s.usePadding&&(is_string(i)||(i="_cfs_origCssMargin"),t.each(function(){var t=$(this),e=parseInt(t.css(s.d.marginRight),10);is_number(e)||(e=0),t.data(i,e)}))}function sz_resetMargin(t,e,s){var i;e.usePadding&&(i=!!is_boolean(s)&&s,is_number(s)||(s=0),sz_storeMargin(t,e,"_cfs_tempCssMargin"),t.each(function(){var t=$(this);t.css(e.d.marginRight,i?t.data("_cfs_tempCssMargin"):s+t.data("_cfs_origCssMargin"))}))}function sz_storeOrigCss(t){t.each(function(){var t=$(this);t.data("_cfs_origCss",t.attr("style")||"")})}function sz_restoreOrigCss(t){t.each(function(){var t=$(this);t.attr("style",t.data("_cfs_origCss")||"")})}function sz_setResponsiveSizes(s,t){s.items.visible;var i=s.items[s.d.width],o=s[s.d.height],n=is_percentage(o);t.each(function(){var t=$(this),e=i-ms_getPaddingBorderMargin(t,s,"Width");t[s.d.width](e),n&&t[s.d.height](ms_getPercentage(e,o))})}function sz_setSizes(t,e){var s,i=t.parent(),o=t.children(),n=gi_getCurrentItems(o,e),r=cf_mapWrapperSizes(ms_getSizes(n,e,!0),e,!1);return i.css(r),e.usePadding&&(i=(s=e.padding)[e.d[1]],e.align&&i<0&&(i=0),(n=n.last()).css(e.d.marginRight,n.data("_cfs_origCssMargin")+i),t.css(e.d.top,s[e.d[0]]),t.css(e.d.left,s[e.d[3]])),t.css(e.d.width,r[e.d.width]+2*ms_getTotalSize(o,e,"width")),t.css(e.d.height,ms_getLargestSize(o,e,"height")),r}function ms_getSizes(t,e,s){return[ms_getTotalSize(t,e,"width",s),ms_getLargestSize(t,e,"height",s)]}function ms_getLargestSize(t,e,s,i){return is_boolean(i)||(i=!1),is_number(e[e.d[s]])&&i?e[e.d[s]]:is_number(e.items[e.d[s]])?e.items[e.d[s]]:ms_getTrueLargestSize(t,e,s=-1<s.toLowerCase().indexOf("width")?"outerWidth":"outerHeight")}function ms_getTrueLargestSize(t,e,s){for(var i=0,o=0,n=t.length;o<n;o++){var r=t.eq(o),r=r.is(":visible")?r[e.d[s]](!0):0;i<r&&(i=r)}return i}function ms_getTotalSize(t,e,s,i){if(is_boolean(i)||(i=!1),is_number(e[e.d[s]])&&i)return e[e.d[s]];if(is_number(e.items[e.d[s]]))return e.items[e.d[s]]*t.length;for(var o=-1<s.toLowerCase().indexOf("width")?"outerWidth":"outerHeight",n=0,r=0,c=t.length;r<c;r++){var a=t.eq(r);n+=a.is(":visible")?a[e.d[o]](!0):0}return n}function ms_getParentSize(t,e,s){var i=t.is(":visible");i&&t.hide();s=t.parent()[e.d[s]]();return i&&t.show(),s}function ms_getMaxDimension(t,e){return is_number(t[t.d.width])?t[t.d.width]:e}function ms_hasVariableSizes(t,e,s){for(var i=!1,o=!1,n=0,r=t.length;n<r;n++){var c=t.eq(n),c=c.is(":visible")?c[e.d[s]](!0):0;!1===i?i=c:i!=c&&(o=!0),0==i&&(o=!0)}return o}function ms_getPaddingBorderMargin(t,e,s){return t[e.d["outer"+s]](!0)-t[e.d[s.toLowerCase()]]()}function ms_getPercentage(t,e){if(is_percentage(e)){if(!is_number(e=parseInt(e.slice(0,-1),10)))return t;t*=e/100}return t}function cf_e(t,e,s,i,o){return is_boolean(s)||(s=!0),is_boolean(i)||(i=!0),is_boolean(o)||(o=!1),s&&(t=e.events.prefix+t),i&&(t=t+"."+e.events.namespace),i&&o&&(t+=e.serialNumber),t}function cf_c(t,e){return is_string(e.classnames[t])?e.classnames[t]:t}function cf_mapWrapperSizes(t,e,s){is_boolean(s)||(s=!0);var i=e.usePadding&&s?e.padding:[0,0,0,0],s={};return s[e.d.width]=t[0]+i[1]+i[3],s[e.d.height]=t[1]+i[0]+i[2],s}function cf_sortParams(t,e){for(var s=[],i=0,o=t.length;i<o;i++)for(var n=0,r=e.length;n<r;n++)if(-1<e[n].indexOf(typeof t[i])&&is_undefined(s[n])){s[n]=t[i];break}return s}function cf_getPadding(t){if(is_undefined(t))return[0,0,0,0];if(is_number(t))return[t,t,t,t];if(!is_array(t=is_string(t)?t.split("px").join("").split("em").join("").split(" "):t))return[0,0,0,0];for(var e=0;e<4;e++)t[e]=parseInt(t[e],10);switch(t.length){case 0:return[0,0,0,0];case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];default:return[t[0],t[1],t[2],t[3]]}}function cf_getAlignPadding(t,e){var s=is_number(e[e.d.width])?Math.ceil(e[e.d.width]-ms_getTotalSize(t,e,"width")):0;switch(e.align){case"left":return[0,s];case"right":return[s,0];case"center":default:return[Math.ceil(s/2),Math.floor(s/2)]}}function cf_getDimensions(t){for(var e=[["width","innerWidth","outerWidth","height","innerHeight","outerHeight","left","top","marginRight",0,1,2,3],["height","innerHeight","outerHeight","width","innerWidth","outerWidth","top","left","marginBottom",3,2,1,0]],s=e[0].length,i="right"==t.direction||"left"==t.direction?0:1,o={},n=0;n<s;n++)o[e[0][n]]=e[i][n];return o}function cf_getAdjust(t,e,s,i){var o=t;if(is_function(s))o=s.call(i,o);else if(is_string(s)){var n,r,i=s.split("+"),s=s.split("-");switch(i=s.length>i.length?(n=!0,r=s[0],s[1]):(n=!1,r=i[0],i[1]),r){case"even":o=t%2==1?t-1:t;break;case"odd":o=t%2==0?t-1:t;break;default:o=t}is_number(i=parseInt(i,10))&&(o+=i=n?-i:i)}return o=!is_number(o)||o<1?1:o}function cf_getItemsAdjust(t,e,s,i){return cf_getItemAdjustMinMax(cf_getAdjust(t,e,s,i),e.items.visibleConf)}function cf_getItemAdjustMinMax(t,e){return is_number(e.min)&&t<e.min&&(t=e.min),t=(t=is_number(e.max)&&t>e.max?e.max:t)<1?1:t}function cf_getSynchArr(t){is_array(t)||(t=[[t]]);for(var e=0,s=(t=!is_array(t[0])?[t]:t).length;e<s;e++)is_string(t[e][0])&&(t[e][0]=$(t[e][0])),is_boolean(t[e][1])||(t[e][1]=!0),is_boolean(t[e][2])||(t[e][2]=!0),is_number(t[e][3])||(t[e][3]=0);return t}function cf_getKeyCode(t){return"right"==t?39:"left"==t?37:"up"==t?38:"down"==t?40:-1}function cf_setCookie(t,e,s){t&&(s=e.triggerHandler(cf_e("currentPosition",s)),$.fn.carouFredSel.cookie.set(t,s))}function cf_getCookie(t){t=$.fn.carouFredSel.cookie.get(t);return""==t?0:t}function in_mapCss(t,e){for(var s={},i=0,o=e.length;i<o;i++)s[e[i]]=t.css(e[i]);return s}function in_complementItems(t,e,s,i){return is_object(t.visibleConf)||(t.visibleConf={}),is_object(t.sizesConf)||(t.sizesConf={}),0==t.start&&is_number(i)&&(t.start=i),is_object(t.visible)?(t.visibleConf.min=t.visible.min,t.visibleConf.max=t.visible.max,t.visible=!1):is_string(t.visible)?("variable"==t.visible?t.visibleConf.variable=!0:t.visibleConf.adjust=t.visible,t.visible=!1):is_function(t.visible)&&(t.visibleConf.adjust=t.visible,t.visible=!1),is_string(t.filter)||(t.filter=0<s.filter(":hidden").length?":visible":"*"),t[e.d.width]||(e.responsive?(debug(!0,"Set a "+e.d.width+" for the items!"),t[e.d.width]=ms_getTrueLargestSize(s,e,"outerWidth")):t[e.d.width]=ms_hasVariableSizes(s,e,"outerWidth")?"variable":s[e.d.outerWidth](!0)),t[e.d.height]||(t[e.d.height]=ms_hasVariableSizes(s,e,"outerHeight")?"variable":s[e.d.outerHeight](!0)),t.sizesConf.width=t.width,t.sizesConf.height=t.height,t}function in_complementVisibleItems(t,e){return"variable"==t.items[t.d.width]&&(t.items.visibleConf.variable=!0),t.items.visibleConf.variable||(is_number(t[t.d.width])?t.items.visible=Math.floor(t[t.d.width]/t.items[t.d.width]):(t.items.visible=Math.floor(e/t.items[t.d.width]),t[t.d.width]=t.items.visible*t.items[t.d.width],t.items.visibleConf.adjust||(t.align=!1)),("Infinity"==t.items.visible||t.items.visible<1)&&(debug(!0,'Not a valid number of visible items: Set to "variable".'),t.items.visibleConf.variable=!0)),t}function in_complementPrimarySize(t,e,s){return t="auto"==t?ms_getTrueLargestSize(s,e,"outerWidth"):t}function in_complementSecondarySize(t,e,s){return t=(t="auto"==t?ms_getTrueLargestSize(s,e,"outerHeight"):t)||e.items[e.d.height]}function in_getAlignPadding(t,e){e=cf_getAlignPadding(gi_getCurrentItems(e,t),t);return t.padding[t.d[1]]=e[1],t.padding[t.d[3]]=e[0],t}function in_getResponsiveValues(t,e,s){var i=cf_getItemAdjustMinMax(Math.ceil(t[t.d.width]/t.items[t.d.width]),t.items.visibleConf);i>e.length&&(i=e.length);e=Math.floor(t[t.d.width]/i);return t.items.visible=i,t.items[t.d.width]=e,t[t.d.width]=i*e,t}function bt_pauseOnHoverConfig(t){var e,s;return is_string(t)?(s=-1<t.indexOf("immediate"),e=-1<t.indexOf("resume")):s=e=!1,[s,e]}function bt_mousesheelNumber(t){return is_number(t)&&t}function is_null(t){return null===t}function is_undefined(t){return is_null(t)||void 0===t||""===t||"undefined"===t}function is_array(t){return t instanceof Array}function is_jquery(t){return t instanceof jQuery}function is_object(t){return(t instanceof Object||"object"==typeof t)&&!is_null(t)&&!is_jquery(t)&&!is_array(t)&&!is_function(t)}function is_number(t){return(t instanceof Number||"number"==typeof t)&&!isNaN(t)}function is_string(t){return(t instanceof String||"string"==typeof t)&&!is_undefined(t)&&!is_true(t)&&!is_false(t)}function is_function(t){return t instanceof Function||"function"==typeof t}function is_boolean(t){return t instanceof Boolean||"boolean"==typeof t||is_true(t)||is_false(t)}function is_true(t){return!0===t||"true"===t}function is_false(t){return!1===t||"false"===t}function is_percentage(t){return is_string(t)&&"%"==t.slice(-1)}function getTime(){return(new Date).getTime()}function deprecated(t,e){debug(!0,t+" is DEPRECATED, support for it will be removed. Use "+e+" instead.")}function debug(t,e){if(!is_undefined(window.console)&&!is_undefined(window.console.log)){var s;if(is_object(t)?(s=" ("+t.selector+")",t=t.debug):s="",!t)return!1;e=is_string(e)?"carouFredSel"+s+": "+e:["carouFredSel"+s+":",e],window.console.log(e)}return!1}$.fn.carouFredSel||($.fn.caroufredsel=$.fn.carouFredSel=function(options,configs){if(0==this.length)return debug(!0,'No element found for "'+this.selector+'".'),this;if(1<this.length)return this.each(function(){$(this).carouFredSel(options,configs)});var $cfs=this,$tt0=this[0],starting_position=!1;$cfs.data("_cfs_isCarousel")&&(starting_position=$cfs.triggerHandler("_cfs_triggerEvent","currentPosition"),$cfs.trigger("_cfs_triggerEvent",["destroy",!0]));var FN={_init:function(t,e,s){(t=go_getObject($tt0,t)).items=go_getItemsObject($tt0,t.items),t.scroll=go_getScrollObject($tt0,t.scroll),t.auto=go_getAutoObject($tt0,t.auto),t.prev=go_getPrevNextObject($tt0,t.prev),t.next=go_getPrevNextObject($tt0,t.next),t.pagination=go_getPaginationObject($tt0,t.pagination),t.swipe=go_getSwipeObject($tt0,t.swipe),t.mousewheel=go_getMousewheelObject($tt0,t.mousewheel),e&&(opts_orig=$.extend(!0,{},$.fn.carouFredSel.defaults,t)),(opts=$.extend(!0,{},$.fn.carouFredSel.defaults,t)).d=cf_getDimensions(opts),crsl.direction="up"==opts.direction||"left"==opts.direction?"next":"prev";var i=$cfs.children(),t=ms_getParentSize($wrp,opts,"width");if(is_true(opts.cookie)&&(opts.cookie="caroufredsel_cookie_"+conf.serialNumber),opts.maxDimension=ms_getMaxDimension(opts,t),opts.items=in_complementItems(opts.items,opts,i,s),opts[opts.d.width]=in_complementPrimarySize(opts[opts.d.width],opts,i),opts[opts.d.height]=in_complementSecondarySize(opts[opts.d.height],opts,i),opts.responsive&&(is_percentage(opts[opts.d.width])||(opts[opts.d.width]="100%")),is_percentage(opts[opts.d.width])&&(crsl.upDateOnWindowResize=!0,crsl.primarySizePercentage=opts[opts.d.width],opts[opts.d.width]=ms_getPercentage(t,crsl.primarySizePercentage),opts.items.visible||(opts.items.visibleConf.variable=!0)),opts.responsive?(opts.usePadding=!1,opts.padding=[0,0,0,0],opts.align=!1,opts.items.visibleConf.variable=!1):((opts=!opts.items.visible?in_complementVisibleItems(opts,t):opts)[opts.d.width]||(!opts.items.visibleConf.variable&&is_number(opts.items[opts.d.width])&&"*"==opts.items.filter?(opts[opts.d.width]=opts.items.visible*opts.items[opts.d.width],opts.align=!1):opts[opts.d.width]="variable"),is_undefined(opts.align)&&(opts.align=!!is_number(opts[opts.d.width])&&"center"),opts.items.visibleConf.variable&&(opts.items.visible=gn_getVisibleItemsNext(i,opts,0))),"*"==opts.items.filter||opts.items.visibleConf.variable||(opts.items.visibleConf.org=opts.items.visible,opts.items.visible=gn_getVisibleItemsNextFilter(i,opts,0)),opts.items.visible=cf_getItemsAdjust(opts.items.visible,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts.responsive)opts.items.visibleConf.min||(opts.items.visibleConf.min=opts.items.visible),opts.items.visibleConf.max||(opts.items.visibleConf.max=opts.items.visible),opts=in_getResponsiveValues(opts,i,t);else switch(opts.padding=cf_getPadding(opts.padding),"top"==opts.align?opts.align="left":"bottom"==opts.align&&(opts.align="right"),opts.align){case"center":case"left":case"right":"variable"!=opts[opts.d.width]&&((opts=in_getAlignPadding(opts,i)).usePadding=!0);break;default:opts.align=!1,opts.usePadding=0!=opts.padding[0]||0!=opts.padding[1]||0!=opts.padding[2]||0!=opts.padding[3]}is_number(opts.scroll.duration)||(opts.scroll.duration=500),is_undefined(opts.scroll.items)&&(opts.scroll.items=opts.responsive||opts.items.visibleConf.variable||"*"!=opts.items.filter?"visible":opts.items.visible),opts.auto=$.extend(!0,{},opts.scroll,opts.auto),opts.prev=$.extend(!0,{},opts.scroll,opts.prev),opts.next=$.extend(!0,{},opts.scroll,opts.next),opts.pagination=$.extend(!0,{},opts.scroll,opts.pagination),opts.auto=go_complementAutoObject($tt0,opts.auto),opts.prev=go_complementPrevNextObject($tt0,opts.prev),opts.next=go_complementPrevNextObject($tt0,opts.next),opts.pagination=go_complementPaginationObject($tt0,opts.pagination),opts.swipe=go_complementSwipeObject($tt0,opts.swipe),opts.mousewheel=go_complementMousewheelObject($tt0,opts.mousewheel),opts.synchronise&&(opts.synchronise=cf_getSynchArr(opts.synchronise)),opts.auto.onPauseStart&&(opts.auto.onTimeoutStart=opts.auto.onPauseStart,deprecated("auto.onPauseStart","auto.onTimeoutStart")),opts.auto.onPausePause&&(opts.auto.onTimeoutPause=opts.auto.onPausePause,deprecated("auto.onPausePause","auto.onTimeoutPause")),opts.auto.onPauseEnd&&(opts.auto.onTimeoutEnd=opts.auto.onPauseEnd,deprecated("auto.onPauseEnd","auto.onTimeoutEnd")),opts.auto.pauseDuration&&(opts.auto.timeoutDuration=opts.auto.pauseDuration,deprecated("auto.pauseDuration","auto.timeoutDuration"))},_build:function(){$cfs.data("_cfs_isCarousel",!0);var t=$cfs.children(),e=in_mapCss($cfs,["textAlign","float","position","top","right","bottom","left","zIndex","width","height","marginTop","marginRight","marginBottom","marginLeft"]),s="relative";switch(e.position){case"absolute":case"fixed":s=e.position}"parent"==conf.wrapper?sz_storeOrigCss($wrp):$wrp.css(e),$wrp.css({overflow:"hidden",position:s}),sz_storeOrigCss($cfs),$cfs.data("_cfs_origCssZindex",e.zIndex),$cfs.css({textAlign:"left","float":"none",position:"absolute",top:0,right:"auto",bottom:"auto",left:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),sz_storeMargin(t,opts),sz_storeOrigCss(t),opts.responsive&&sz_setResponsiveSizes(opts,t)},_bind_events:function(){FN._unbind_events(),$cfs.bind(cf_e("stop",conf),function(t,e){return t.stopPropagation(),crsl.isStopped||opts.auto.button&&opts.auto.button.addClass(cf_c("stopped",conf)),crsl.isStopped=!0,opts.auto.play&&(opts.auto.play=!1,$cfs.trigger(cf_e("pause",conf),e)),!0}),$cfs.bind(cf_e("finish",conf),function(t){return t.stopPropagation(),crsl.isScrolling&&sc_stopScroll(scrl),!0}),$cfs.bind(cf_e("pause",conf),function(t,e,s){var i;return t.stopPropagation(),tmrs=sc_clearTimers(tmrs),e&&crsl.isScrolling&&(scrl.isStopped=!0,i=getTime()-scrl.startTime,scrl.duration-=i,scrl.pre&&(scrl.pre.duration-=i),scrl.post&&(scrl.post.duration-=i),sc_stopScroll(scrl,!1)),crsl.isPaused||crsl.isScrolling||s&&(tmrs.timePassed+=getTime()-tmrs.startTime),crsl.isPaused||opts.auto.button&&opts.auto.button.addClass(cf_c("paused",conf)),crsl.isPaused=!0,opts.auto.onTimeoutPause&&(i=opts.auto.timeoutDuration-tmrs.timePassed,s=100-Math.ceil(100*i/opts.auto.timeoutDuration),opts.auto.onTimeoutPause.call($tt0,s,i)),!0}),$cfs.bind(cf_e("play",conf),function(t,e,s,i){t.stopPropagation(),tmrs=sc_clearTimers(tmrs);var o=cf_sortParams([e,s,i],["string","number","boolean"]);if(e=o[0],s=o[1],i=o[2],"prev"!=e&&"next"!=e&&(e=crsl.direction),is_number(s)||(s=0),(i=!is_boolean(i)?!1:i)&&(crsl.isStopped=!1,opts.auto.play=!0),!opts.auto.play)return t.stopImmediatePropagation(),debug(conf,"Carousel stopped: Not scrolling.");crsl.isPaused&&opts.auto.button&&(opts.auto.button.removeClass(cf_c("stopped",conf)),opts.auto.button.removeClass(cf_c("paused",conf))),crsl.isPaused=!1,tmrs.startTime=getTime();var n=opts.auto.timeoutDuration+s;return dur2=n-tmrs.timePassed,perc=100-Math.ceil(100*dur2/n),opts.auto.progress&&(tmrs.progress=setInterval(function(){var t=getTime()-tmrs.startTime+tmrs.timePassed,t=Math.ceil(100*t/n);opts.auto.progress.updater.call(opts.auto.progress.bar[0],t)},opts.auto.progress.interval)),tmrs.auto=setTimeout(function(){opts.auto.progress&&opts.auto.progress.updater.call(opts.auto.progress.bar[0],100),opts.auto.onTimeoutEnd&&opts.auto.onTimeoutEnd.call($tt0,perc,dur2),crsl.isScrolling?$cfs.trigger(cf_e("play",conf),e):$cfs.trigger(cf_e(e,conf),opts.auto)},dur2),opts.auto.onTimeoutStart&&opts.auto.onTimeoutStart.call($tt0,perc,dur2),!0}),$cfs.bind(cf_e("resume",conf),function(t){return t.stopPropagation(),scrl.isStopped?(scrl.isStopped=!1,crsl.isPaused=!1,crsl.isScrolling=!0,scrl.startTime=getTime(),sc_startScroll(scrl,conf)):$cfs.trigger(cf_e("play",conf)),!0}),$cfs.bind(cf_e("prev",conf)+" "+cf_e("next",conf),function(t,e,s,i,o){if(t.stopPropagation(),crsl.isStopped||$cfs.is(":hidden"))return t.stopImmediatePropagation(),debug(conf,"Carousel stopped or hidden: Not scrolling.");var n=is_number(opts.items.minimum)?opts.items.minimum:opts.items.visible+1;if(n>itms.total)return t.stopImmediatePropagation(),debug(conf,"Not enough items ("+itms.total+" total, "+n+" needed): Not scrolling.");e=(a=cf_sortParams([e,s,i,o],["object","number/string","function","boolean"]))[0],s=a[1],i=a[2],o=a[3];var r=t.type.slice(conf.events.prefix.length);if(is_object(e)||(e={}),is_function(i)&&(e.onAfter=i),is_boolean(o)&&(e.queue=o),(e=$.extend(!0,{},opts[r],e)).conditions&&!e.conditions.call($tt0,r))return t.stopImmediatePropagation(),debug(conf,'Callback "conditions" returned false.');if(!is_number(s)){if("*"!=opts.items.filter)s="visible";else for(var c=[s,e.items,opts[r].items],a=0,f=c.length;a<f;a++)if(is_number(c[a])||"page"==c[a]||"visible"==c[a]){s=c[a];break}switch(s){case"page":return t.stopImmediatePropagation(),$cfs.triggerHandler(cf_e(r+"Page",conf),[e,i]);case"visible":opts.items.visibleConf.variable||"*"!=opts.items.filter||(s=opts.items.visible)}}if(scrl.isStopped)return $cfs.trigger(cf_e("resume",conf)),$cfs.trigger(cf_e("queue",conf),[r,[e,s,i]]),t.stopImmediatePropagation(),debug(conf,"Carousel resumed scrolling.");if(0<e.duration&&crsl.isScrolling)return e.queue&&("last"==e.queue&&(queu=[]),"first"==e.queue&&0!=queu.length||$cfs.trigger(cf_e("queue",conf),[r,[e,s,i]])),t.stopImmediatePropagation(),debug(conf,"Carousel currently scrolling.");if(tmrs.timePassed=0,$cfs.trigger(cf_e("slide_"+r,conf),[e,s]),opts.synchronise)for(var l=opts.synchronise,u=[e,s],p=0,f=l.length;p<f;p++){var d=r;l[p][2]||(d="prev"==d?"next":"prev"),l[p][1]||(u[0]=l[p][0].triggerHandler("_cfs_triggerEvent",["configuration",d])),u[1]=s+l[p][3],l[p][0].trigger("_cfs_triggerEvent",["slide_"+d,u])}return!0}),$cfs.bind(cf_e("slide_prev",conf),function(t,e,s){t.stopPropagation();var i=$cfs.children();if(!opts.circular&&0==itms.first)return opts.infinite&&$cfs.trigger(cf_e("next",conf),itms.total-1),t.stopImmediatePropagation();if(sz_resetMargin(i,opts),is_number(s)||(s=cf_getAdjust(s=opts.items.visibleConf.variable?gn_getVisibleItemsPrev(i,opts,itms.total-1):"*"!=opts.items.filter?(p=is_number(e.items)?e.items:gn_getVisibleOrg($cfs,opts),gn_getScrollItemsPrevFilter(i,opts,itms.total-1,p)):opts.items.visible,opts,e.items,$tt0)),opts.circular||itms.total-s<itms.first&&(s=itms.total-itms.first),opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable?(g=cf_getItemsAdjust(gn_getVisibleItemsNext(i,opts,itms.total-s),opts,opts.items.visibleConf.adjust,$tt0),opts.items.visible+s<=g&&s<itms.total&&(s++,g=cf_getItemsAdjust(gn_getVisibleItemsNext(i,opts,itms.total-s),opts,opts.items.visibleConf.adjust,$tt0)),opts.items.visible=g):"*"!=opts.items.filter&&(g=gn_getVisibleItemsNextFilter(i,opts,itms.total-s),opts.items.visible=cf_getItemsAdjust(g,opts,opts.items.visibleConf.adjust,$tt0)),sz_resetMargin(i,opts,!0),0==s)return t.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+s+" items backward."),itms.first+=s;itms.first>=itms.total;)itms.first-=itms.total;opts.circular||(0==itms.first&&e.onEnd&&e.onEnd.call($tt0,"prev"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),$cfs.children().slice(itms.total-s,itms.total).prependTo($cfs),itms.total<opts.items.visible+s&&$cfs.children().slice(0,opts.items.visible+s-itms.total).clone(!0).appendTo($cfs);var o=gi_getOldItemsPrev(i=$cfs.children(),opts,s),n=gi_getNewItemsPrev(i,opts),r=i.eq(s-1),c=o.last(),a=n.last();sz_resetMargin(i,opts);var f=0,l=0;opts.align&&(f=(x=cf_getAlignPadding(n,opts))[0],l=x[1]);var u,p=f<0?opts.padding[opts.d[3]]:0,d=!1,g=$();opts.items.visible<s&&(g=i.slice(opts.items.visibleConf.old,s),"directscroll"==e.fx&&(u=opts.items[opts.d.width],r=a,sc_hideHiddenItems(d=g),opts.items[opts.d.width]="variable"));var m=!1,t=ms_getTotalSize(i.slice(0,s),opts,"width"),_=cf_mapWrapperSizes(ms_getSizes(n,opts,!0),opts,!opts.usePadding),b=0,v={},h={},w={},P={},C={},x={},S={},y=sc_getDuration(e,opts,s,t);switch(e.fx){case"cover":case"cover-fade":b=ms_getTotalSize(i.slice(0,opts.items.visible),opts,"width")}d&&(opts.items[opts.d.width]=u),sz_resetMargin(i,opts,!0),0<=l&&sz_resetMargin(c,opts,opts.padding[opts.d[1]]),0<=f&&sz_resetMargin(r,opts,opts.padding[opts.d[3]]),opts.align&&(opts.padding[opts.d[1]]=l,opts.padding[opts.d[3]]=f),x[opts.d.left]=-(t-p),S[opts.d.left]=-(b-p),h[opts.d.left]=_[opts.d.width];var I=function(){},z=function(){},j=function(){},k=function(){},N=function(){},O=function(){},T=function(){},M=function(){};switch(e.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":m=$cfs.clone(!0).appendTo($wrp)}switch(e.fx){case"crossfade":case"uncover":case"uncover-fade":m.children().slice(0,s).remove(),m.children().slice(opts.items.visibleConf.old).remove();break;case"cover":case"cover-fade":m.children().slice(opts.items.visible).remove(),m.css(S)}if($cfs.css(x),scrl=sc_setScroll(y,e.easing,conf),v[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0,"variable"!=opts[opts.d.width]&&"variable"!=opts[opts.d.height]||(I=function(){$wrp.css(_)},z=function(){scrl.anims.push([$wrp,_])}),opts.usePadding){switch(a.not(r).length&&(w[opts.d.marginRight]=r.data("_cfs_origCssMargin"),f<0?r.css(w):(T=function(){r.css(w)},M=function(){scrl.anims.push([r,w])})),e.fx){case"cover":case"cover-fade":m.children().eq(s-1).css(w)}a.not(c).length&&(P[opts.d.marginRight]=c.data("_cfs_origCssMargin"),j=function(){c.css(P)},k=function(){scrl.anims.push([c,P])}),0<=l&&(C[opts.d.marginRight]=a.data("_cfs_origCssMargin")+opts.padding[opts.d[1]],N=function(){a.css(C)},O=function(){scrl.anims.push([a,C])})}var A=function(){$cfs.css(v)},F=opts.items.visible+s-itms.total,H=function(){var t;0<F&&($cfs.children().slice(itms.total).remove(),o=$($cfs.children().slice(itms.total-(opts.items.visible-F)).get().concat($cfs.children().slice(0,F).get()))),sc_showHiddenItems(d),opts.usePadding&&(t=$cfs.children().eq(opts.items.visible+s-1)).css(opts.d.marginRight,t.data("_cfs_origCssMargin"))},q=sc_mapCallbackArguments(o,g,n,s,"prev",y,_),D=function(){sc_afterScroll($cfs,m,e),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,e,"onAfter",q,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))};switch(crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,e,"onBefore",q,clbk),e.fx){case"none":$cfs.css(v),I(),j(),N(),T(),A(),H(),D();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){I(),j(),N(),T(),A(),H(),(scrl=sc_setScroll(y,e.easing,conf)).anims.push([$cfs,{opacity:1},D]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([m,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},D]),z(),j(),N(),T(),A(),H();break;case"cover":scrl.anims.push([m,v,function(){j(),N(),T(),A(),H(),D()}]),z();break;case"cover-fade":scrl.anims.push([$cfs,{opacity:0}]),scrl.anims.push([m,v,function(){j(),N(),T(),A(),H(),D()}]),z();break;case"uncover":scrl.anims.push([m,h,D]),z(),j(),N(),T(),A(),H();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([m,h,D]),z(),j(),N(),T(),A(),H();break;default:scrl.anims.push([$cfs,v,function(){H(),D()}]),z(),k(),O(),M()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,_]),!0}),$cfs.bind(cf_e("slide_next",conf),function(t,e,s){t.stopPropagation();var i=$cfs.children();if(!opts.circular&&itms.first==opts.items.visible)return opts.infinite&&$cfs.trigger(cf_e("prev",conf),itms.total-1),t.stopImmediatePropagation();sz_resetMargin(i,opts),is_number(s)||(s=cf_getAdjust(s="*"!=opts.items.filter?(p=is_number(e.items)?e.items:gn_getVisibleOrg($cfs,opts),gn_getScrollItemsNextFilter(i,opts,0,p)):opts.items.visible,opts,e.items,$tt0));var o=0==itms.first?itms.total:itms.first;if(opts.circular||(p=opts.items.visibleConf.variable?(n=gn_getVisibleItemsNext(i,opts,s),gn_getVisibleItemsPrev(i,opts,o-1)):(n=opts.items.visible,opts.items.visible),o<s+n&&(s=o-p)),opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){for(var n=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(i,opts,s,o),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible-s>=n&&s<itms.total;)n=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(i,opts,++s,o),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible=n}else"*"!=opts.items.filter&&(n=gn_getVisibleItemsNextFilter(i,opts,s),opts.items.visible=cf_getItemsAdjust(n,opts,opts.items.visibleConf.adjust,$tt0));if(sz_resetMargin(i,opts,!0),0==s)return t.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+s+" items forward."),itms.first-=s;itms.first<0;)itms.first+=itms.total;opts.circular||(itms.first==opts.items.visible&&e.onEnd&&e.onEnd.call($tt0,"next"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),itms.total<opts.items.visible+s&&$cfs.children().slice(0,opts.items.visible+s-itms.total).clone(!0).appendTo($cfs);var r=gi_getOldItemsNext(i=$cfs.children(),opts),c=gi_getNewItemsNext(i,opts,s),a=i.eq(s-1),f=r.last(),l=c.last();sz_resetMargin(i,opts);var u=0,p=0;opts.align&&(u=(_=cf_getAlignPadding(c,opts))[0],p=_[1]);var d,g=!1,t=$();opts.items.visibleConf.old<s&&(t=i.slice(opts.items.visibleConf.old,s),"directscroll"==e.fx&&(d=opts.items[opts.d.width],a=f,sc_hideHiddenItems(g=t),opts.items[opts.d.width]="variable"));var m=!1,_=ms_getTotalSize(i.slice(0,s),opts,"width"),b=cf_mapWrapperSizes(ms_getSizes(c,opts,!0),opts,!opts.usePadding),v=0,h={},w={},P={},C={},x={},S=sc_getDuration(e,opts,s,_);switch(e.fx){case"uncover":case"uncover-fade":v=ms_getTotalSize(i.slice(0,opts.items.visibleConf.old),opts,"width")}g&&(opts.items[opts.d.width]=d),opts.align&&opts.padding[opts.d[1]]<0&&(opts.padding[opts.d[1]]=0),sz_resetMargin(i,opts,!0),sz_resetMargin(f,opts,opts.padding[opts.d[1]]),opts.align&&(opts.padding[opts.d[1]]=p,opts.padding[opts.d[3]]=u),x[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0;var y=function(){},I=function(){},z=function(){},j=function(){},k=function(){},N=function(){};switch(e.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":(m=$cfs.clone(!0).appendTo($wrp)).children().slice(opts.items.visibleConf.old).remove()}switch(e.fx){case"crossfade":case"cover":case"cover-fade":$cfs.css("zIndex",1),m.css("zIndex",0)}scrl=sc_setScroll(S,e.easing,conf),h[opts.d.left]=-_,w[opts.d.left]=-v,u<0&&(h[opts.d.left]+=u),"variable"!=opts[opts.d.width]&&"variable"!=opts[opts.d.height]||(y=function(){$wrp.css(b)},I=function(){scrl.anims.push([$wrp,b])}),opts.usePadding&&(_=l.data("_cfs_origCssMargin"),0<=p&&(_+=opts.padding[opts.d[1]]),l.css(opts.d.marginRight,_),a.not(f).length&&(C[opts.d.marginRight]=f.data("_cfs_origCssMargin")),z=function(){f.css(C)},j=function(){scrl.anims.push([f,C])},_=a.data("_cfs_origCssMargin"),0<u&&(_+=opts.padding[opts.d[3]]),P[opts.d.marginRight]=_,k=function(){a.css(P)},N=function(){scrl.anims.push([a,P])});var O=function(){$cfs.css(x)},T=opts.items.visible+s-itms.total,M=function(){0<T&&$cfs.children().slice(itms.total).remove();var t,e=$cfs.children().slice(0,s).appendTo($cfs).last();0<T&&(c=gi_getCurrentItems(i,opts)),sc_showHiddenItems(g),opts.usePadding&&(itms.total<opts.items.visible+s&&(t=$cfs.children().eq(opts.items.visible-1)).css(opts.d.marginRight,t.data("_cfs_origCssMargin")+opts.padding[opts.d[1]]),e.css(opts.d.marginRight,e.data("_cfs_origCssMargin")))},A=sc_mapCallbackArguments(r,t,c,s,"next",S,b),F=function(){$cfs.css("zIndex",$cfs.data("_cfs_origCssZindex")),sc_afterScroll($cfs,m,e),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,e,"onAfter",A,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))};switch(crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,e,"onBefore",A,clbk),e.fx){case"none":$cfs.css(h),y(),z(),k(),O(),M(),F();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){y(),z(),k(),O(),M(),(scrl=sc_setScroll(S,e.easing,conf)).anims.push([$cfs,{opacity:1},F]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([m,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},F]),I(),z(),k(),O(),M();break;case"cover":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([$cfs,x,F]),I(),z(),k(),M();break;case"cover-fade":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([m,{opacity:0}]),scrl.anims.push([$cfs,x,F]),I(),z(),k(),M();break;case"uncover":scrl.anims.push([m,w,F]),I(),z(),k(),O(),M();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([m,w,F]),I(),z(),k(),O(),M();break;default:scrl.anims.push([$cfs,h,function(){O(),M(),F()}]),I(),j(),N()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,b]),!0}),$cfs.bind(cf_e("slideTo",conf),function(t,e,s,i,o,n,r){t.stopPropagation();i=cf_sortParams([e,s,i,o,n,r],["string/number/object","number","boolean","object","string","function"]);return o=i[3],n=i[4],r=i[5],0!=(e=gn_getItemIndex(i[0],i[1],i[2],itms,$cfs))&&(is_object(o)||(o=!1),"prev"==(n="prev"!=n&&"next"!=n?opts.circular?e<=itms.total/2?"next":"prev":0==itms.first||itms.first>e?"next":"prev":n)&&(e=itms.total-e),$cfs.trigger(cf_e(n,conf),[o,e,r]),!0)}),$cfs.bind(cf_e("prevPage",conf),function(t,e,s){t.stopPropagation();t=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[t-1,e,"prev",s])}),$cfs.bind(cf_e("nextPage",conf),function(t,e,s){t.stopPropagation();t=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[t+1,e,"next",s])}),$cfs.bind(cf_e("slideToPage",conf),function(t,e,s,i,o){t.stopPropagation(),is_number(e)||(e=$cfs.triggerHandler(cf_e("currentPage",conf)));var n=opts.pagination.items||opts.items.visible,t=Math.ceil(itms.total/n)-1;return t<(e=e<0?t:e)&&(e=0),$cfs.triggerHandler(cf_e("slideTo",conf),[e*n,0,!0,s,i,o])}),$cfs.bind(cf_e("jumpToStart",conf),function(t,e){if(t.stopPropagation(),e=e?gn_getItemIndex(e,0,!0,itms,$cfs):0,0!=(e+=itms.first)){if(0<itms.total)for(;e>itms.total;)e-=itms.total;$cfs.prepend($cfs.children().slice(e,itms.total))}return!0}),$cfs.bind(cf_e("synchronise",conf),function(t,e){if(t.stopPropagation(),e)e=cf_getSynchArr(e);else{if(!opts.synchronise)return debug(conf,"No carousel to synchronise.");e=opts.synchronise}for(var s=$cfs.triggerHandler(cf_e("currentPosition",conf)),i=!0,o=0,n=e.length;o<n;o++)e[o][0].triggerHandler(cf_e("slideTo",conf),[s,e[o][3],!0])||(i=!1);return i}),$cfs.bind(cf_e("queue",conf),function(t,e,s){return t.stopPropagation(),is_function(e)?e.call($tt0,queu):is_array(e)?queu=e:is_undefined(e)||queu.push([e,s]),queu}),$cfs.bind(cf_e("insertItem",conf),function(t,e,s,i,o){t.stopPropagation();var n=cf_sortParams([e,s,i,o],["string/object","string/number/object","boolean","number"]);if(e=n[0],s=n[1],i=n[2],o=n[3],(is_object(e)&&!is_jquery(e)||is_string(e))&&(e=$(e)),!is_jquery(e)||0==e.length)return debug(conf,"Not a valid object.");is_undefined(s)&&(s="end"),sz_storeMargin(e,opts),sz_storeOrigCss(e);t=s,n="before";"end"==s?i?(0==itms.first?(s=itms.total-1,n="after"):(s=itms.first,itms.first+=e.length),s<0&&(s=0)):(s=itms.total-1,n="after"):s=gn_getItemIndex(s,o,i,itms,$cfs);o=$cfs.children().eq(s);return o.length?o[n](e):(debug(conf,"Correct insert-position not found! Appending item to the end."),$cfs.append(e)),"end"==t||i||s<itms.first&&(itms.first+=e.length),itms.total=$cfs.children().length,itms.first>=itms.total&&(itms.first-=itms.total),$cfs.trigger(cf_e("updateSizes",conf)),$cfs.trigger(cf_e("linkAnchors",conf)),!0}),$cfs.bind(cf_e("removeItem",conf),function(t,e,i,o){t.stopPropagation();t=cf_sortParams([e,i,o],["string/number/object","boolean","number"]);e=t[0],i=t[1],o=t[2];var n;return e instanceof $&&1<e.length?(n=$(),e.each(function(t,e){var s=$cfs.trigger(cf_e("removeItem",conf),[$(this),i,o]);s&&(n=n.add(s))})):(is_undefined(e)||"end"==e?n=$cfs.children().last():(e=gn_getItemIndex(e,o,i,itms,$cfs),(n=$cfs.children().eq(e)).length&&e<itms.first&&(itms.first-=n.length)),n&&n.length&&(n.detach(),itms.total=$cfs.children().length,$cfs.trigger(cf_e("updateSizes",conf)))),n}),$cfs.bind(cf_e("onBefore",conf)+" "+cf_e("onAfter",conf),function(t,e){t.stopPropagation();t=t.type.slice(conf.events.prefix.length);return is_array(e)&&(clbk[t]=e),is_function(e)&&clbk[t].push(e),clbk[t]}),$cfs.bind(cf_e("currentPosition",conf),function(t,e){return t.stopPropagation(),t=0==itms.first?0:itms.total-itms.first,is_function(e)&&e.call($tt0,t),t}),$cfs.bind(cf_e("currentPage",conf),function(t,e){t.stopPropagation();var s=opts.pagination.items||opts.items.visible,t=Math.ceil(itms.total/s-1),s=0==itms.first||itms.first<itms.total%s?0:itms.first!=s||opts.circular?Math.round((itms.total-itms.first)/s):t;return t<(s=s<0?0:s)&&(s=t),is_function(e)&&e.call($tt0,s),s}),$cfs.bind(cf_e("currentVisible",conf),function(t,e){t.stopPropagation();t=gi_getCurrentItems($cfs.children(),opts);return is_function(e)&&e.call($tt0,t),t}),$cfs.bind(cf_e("slice",conf),function(t,e,s,i){if(t.stopPropagation(),0==itms.total)return!1;t=cf_sortParams([e,s,i],["number","number","function"]);if(e=is_number(t[0])?t[0]:0,s=is_number(t[1])?t[1]:itms.total,i=t[2],e+=itms.first,s+=itms.first,0<items.total){for(;e>itms.total;)e-=itms.total;for(;s>itms.total;)s-=itms.total;for(;e<0;)e+=itms.total;for(;s<0;)s+=itms.total}t=$cfs.children(),t=e<s?t.slice(e,s):$(t.slice(e,itms.total).get().concat(t.slice(0,s).get()));return is_function(i)&&i.call($tt0,t),t}),$cfs.bind(cf_e("isPaused",conf)+" "+cf_e("isStopped",conf)+" "+cf_e("isScrolling",conf),function(t,e){t.stopPropagation();t=t.type.slice(conf.events.prefix.length),t=crsl[t];return is_function(e)&&e.call($tt0,t),t}),$cfs.bind(cf_e("configuration",conf),function(e,a,b,c){e.stopPropagation();var reInit=!1,sz;if(is_function(a))a.call($tt0,opts);else if(is_object(a))opts_orig=$.extend(!0,{},opts_orig,a),!1!==b?reInit=!0:opts=$.extend(!0,{},opts,a);else if(!is_undefined(a))if(is_function(b)){var val=eval("opts."+a);is_undefined(val)&&(val=""),b.call($tt0,val)}else{if(is_undefined(b))return eval("opts."+a);"boolean"!=typeof c&&(c=!0),eval("opts_orig."+a+" = b"),!1!==c?reInit=!0:eval("opts."+a+" = b")}return reInit&&(sz_resetMargin($cfs.children(),opts),FN._init(opts_orig),FN._bind_buttons(),sz=sz_setSizes($cfs,opts),$cfs.trigger(cf_e("updatePageStatus",conf),[!0,sz])),opts}),$cfs.bind(cf_e("linkAnchors",conf),function(t,e,s){return t.stopPropagation(),is_undefined(e)?e=$("body"):is_string(e)&&(e=$(e)),is_jquery(e)&&0!=e.length?(is_string(s)||(s="a.caroufredsel"),e.find(s).each(function(){var e=this.hash||"";0<e.length&&-1!=$cfs.children().index($(e))&&$(this).unbind("click").click(function(t){t.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),e)})}),!0):debug(conf,"Not a valid object.")}),$cfs.bind(cf_e("updatePageStatus",conf),function(t,e,s){if(t.stopPropagation(),opts.pagination.container){var i=opts.pagination.items||opts.items.visible,o=Math.ceil(itms.total/i);e&&(opts.pagination.anchorBuilder&&(opts.pagination.container.children().remove(),opts.pagination.container.each(function(){for(var t=0;t<o;t++){var e=$cfs.children().eq(gn_getItemIndex(t*i,0,!0,itms,$cfs));$(this).append(opts.pagination.anchorBuilder.call(e[0],t+1))}})),opts.pagination.container.each(function(){$(this).children().unbind(opts.pagination.event).each(function(e){$(this).bind(opts.pagination.event,function(t){t.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[e*i,-opts.pagination.deviation,!0,opts.pagination])})})}));var n=$cfs.triggerHandler(cf_e("currentPage",conf))+opts.pagination.deviation;return(n=o<=n?0:n)<0&&(n=o-1),opts.pagination.container.each(function(){$(this).children().removeClass(cf_c("selected",conf)).eq(n).addClass(cf_c("selected",conf))}),!0}}),$cfs.bind(cf_e("updateSizes",conf),function(t){var e=opts.items.visible,s=$cfs.children(),i=ms_getParentSize($wrp,opts,"width");itms.total=s.length,crsl.primarySizePercentage?(opts.maxDimension=i,opts[opts.d.width]=ms_getPercentage(i,crsl.primarySizePercentage)):opts.maxDimension=ms_getMaxDimension(opts,i),opts.responsive?(opts.items.width=opts.items.sizesConf.width,opts.items.height=opts.items.sizesConf.height,e=(opts=in_getResponsiveValues(opts,s,i)).items.visible,sz_setResponsiveSizes(opts,s)):opts.items.visibleConf.variable?e=gn_getVisibleItemsNext(s,opts,0):"*"!=opts.items.filter&&(e=gn_getVisibleItemsNextFilter(s,opts,0)),!opts.circular&&0!=itms.first&&e>itms.first&&(i=opts.items.visibleConf.variable?gn_getVisibleItemsPrev(s,opts,itms.first)-itms.first:"*"!=opts.items.filter?gn_getVisibleItemsPrevFilter(s,opts,itms.first)-itms.first:opts.items.visible-itms.first,debug(conf,"Preventing non-circular: sliding "+i+" items backward."),$cfs.trigger(cf_e("prev",conf),i)),opts.items.visible=cf_getItemsAdjust(e,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts=in_getAlignPadding(opts,s);s=sz_setSizes($cfs,opts);return $cfs.trigger(cf_e("updatePageStatus",conf),[!0,s]),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),s}),$cfs.bind(cf_e("destroy",conf),function(t,e){return t.stopPropagation(),tmrs=sc_clearTimers(tmrs),$cfs.data("_cfs_isCarousel",!1),$cfs.trigger(cf_e("finish",conf)),e&&$cfs.trigger(cf_e("jumpToStart",conf)),sz_restoreOrigCss($cfs.children()),sz_restoreOrigCss($cfs),FN._unbind_events(),FN._unbind_buttons(),"parent"==conf.wrapper?sz_restoreOrigCss($wrp):$wrp.replaceWith($cfs),!0}),$cfs.bind(cf_e("debug",conf),function(t){return debug(conf,"Carousel width: "+opts.width),debug(conf,"Carousel height: "+opts.height),debug(conf,"Item widths: "+opts.items.width),debug(conf,"Item heights: "+opts.items.height),debug(conf,"Number of items visible: "+opts.items.visible),opts.auto.play&&debug(conf,"Number of items scrolled automatically: "+opts.auto.items),opts.prev.button&&debug(conf,"Number of items scrolled backward: "+opts.prev.items),opts.next.button&&debug(conf,"Number of items scrolled forward: "+opts.next.items),conf.debug}),$cfs.bind("_cfs_triggerEvent",function(t,e,s){return t.stopPropagation(),$cfs.triggerHandler(cf_e(e,conf),s)})},_unbind_events:function(){$cfs.unbind(cf_e("",conf)),$cfs.unbind(cf_e("",conf,!1)),$cfs.unbind("_cfs_triggerEvent")},_bind_buttons:function(){var t,s,i,o,n,r,c;if(FN._unbind_buttons(),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),opts.auto.pauseOnHover&&(t=bt_pauseOnHoverConfig(opts.auto.pauseOnHover),$wrp.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})),opts.auto.button&&opts.auto.button.bind(cf_e(opts.auto.event,conf,!1),function(t){t.preventDefault();var e=!1,t=null;crsl.isPaused?e="play":opts.auto.pauseOnEvent&&(e="pause",t=bt_pauseOnHoverConfig(opts.auto.pauseOnEvent)),e&&$cfs.trigger(cf_e(e,conf),t)}),opts.prev.button&&(opts.prev.button.bind(cf_e(opts.prev.event,conf,!1),function(t){t.preventDefault(),$cfs.trigger(cf_e("prev",conf))}),opts.prev.pauseOnHover&&(t=bt_pauseOnHoverConfig(opts.prev.pauseOnHover),opts.prev.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))}))),opts.next.button&&(opts.next.button.bind(cf_e(opts.next.event,conf,!1),function(t){t.preventDefault(),$cfs.trigger(cf_e("next",conf))}),opts.next.pauseOnHover&&(t=bt_pauseOnHoverConfig(opts.next.pauseOnHover),opts.next.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))}))),opts.pagination.container&&opts.pagination.pauseOnHover&&(t=bt_pauseOnHoverConfig(opts.pagination.pauseOnHover),opts.pagination.container.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})),(opts.prev.key||opts.next.key)&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(t){var e=t.keyCode;e==opts.next.key&&(t.preventDefault(),$cfs.trigger(cf_e("next",conf))),e==opts.prev.key&&(t.preventDefault(),$cfs.trigger(cf_e("prev",conf)))}),opts.pagination.keys&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(t){var e=t.keyCode;49<=e&&e<58&&(e=(e-49)*opts.items.visible)<=itms.total&&(t.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[e,0,!0,opts.pagination]))}),$.fn.swipe){var e="ontouchstart"in window;if(e&&opts.swipe.onTouch||!e&&opts.swipe.onMouse){var a=$.extend(!0,{},opts.prev,opts.swipe),f=$.extend(!0,{},opts.next,opts.swipe),l=function(){$cfs.trigger(cf_e("prev",conf),[a])},u=function(){$cfs.trigger(cf_e("next",conf),[f])};switch(opts.direction){case"up":case"down":opts.swipe.options.swipeUp=u,opts.swipe.options.swipeDown=l;break;default:opts.swipe.options.swipeLeft=u,opts.swipe.options.swipeRight=l}crsl.swipe&&$cfs.swipe("destroy"),$wrp.swipe(opts.swipe.options),$wrp.css("cursor","move"),crsl.swipe=!0}}$.fn.mousewheel&&opts.mousewheel&&(s=$.extend(!0,{},opts.prev,opts.mousewheel),i=$.extend(!0,{},opts.next,opts.mousewheel),crsl.mousewheel&&$wrp.unbind(cf_e("mousewheel",conf,!1)),$wrp.bind(cf_e("mousewheel",conf,!1),function(t,e){t.preventDefault(),0<e?$cfs.trigger(cf_e("prev",conf),[s]):$cfs.trigger(cf_e("next",conf),[i])}),crsl.mousewheel=!0),opts.auto.play&&$cfs.trigger(cf_e("play",conf),opts.auto.delay),crsl.upDateOnWindowResize&&(o=function(t){$cfs.trigger(cf_e("finish",conf)),opts.auto.pauseOnResize&&!crsl.isPaused&&$cfs.trigger(cf_e("play",conf)),sz_resetMargin($cfs.children(),opts),$cfs.trigger(cf_e("updateSizes",conf))},n=$(window),e=null,e=$.debounce&&"debounce"==conf.onWindowResize?$.debounce(200,o):$.throttle&&"throttle"==conf.onWindowResize?$.throttle(300,o):(c=r=0,function(){var t=n.width(),e=n.height();t==r&&e==c||(o(),r=t,c=e)}),n.bind(cf_e("resize",conf,!1,!0,!0),e))},_unbind_buttons:function(){cf_e("",conf);var t=cf_e("",conf,!1);ns3=cf_e("",conf,!1,!0,!0),$(document).unbind(ns3),$(window).unbind(ns3),$wrp.unbind(t),opts.auto.button&&opts.auto.button.unbind(t),opts.prev.button&&opts.prev.button.unbind(t),opts.next.button&&opts.next.button.unbind(t),opts.pagination.container&&(opts.pagination.container.unbind(t),opts.pagination.anchorBuilder&&opts.pagination.container.children().remove()),crsl.swipe&&($cfs.swipe("destroy"),$wrp.css("cursor","default"),crsl.swipe=!1),crsl.mousewheel&&(crsl.mousewheel=!1),nv_showNavi(opts,"hide",conf),nv_enableNavi(opts,"removeClass",conf)}};is_boolean(configs)&&(configs={debug:configs});var crsl={direction:"next",isPaused:!0,isScrolling:!1,isStopped:!1,mousewheel:!1,swipe:!1},itms={total:$cfs.children().length,first:0},tmrs={auto:null,progress:null,startTime:getTime(),timePassed:0},scrl={isStopped:!1,duration:0,startTime:0,easing:"",anims:[]},clbk={onBefore:[],onAfter:[]},queu=[],conf=$.extend(!0,{},$.fn.carouFredSel.configs,configs),opts={},opts_orig=$.extend(!0,{},options),$wrp=("parent"==conf.wrapper?$cfs:$cfs.wrap("<"+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />')).parent(),start_arr,start_arr;if(conf.selector=$cfs.selector,conf.serialNumber=$.fn.carouFredSel.serialNumber++,conf.transition=conf.transition&&$.fn.transition?"transition":"animate",FN._init(opts_orig,!0,starting_position),FN._build(),FN._bind_events(),FN._bind_buttons(),is_array(opts.items.start)?start_arr=opts.items.start:(start_arr=[],0!=opts.items.start&&start_arr.push(opts.items.start)),opts.cookie&&start_arr.unshift(parseInt(cf_getCookie(opts.cookie),10)),0<start_arr.length)for(var a=0,l=start_arr.length;a<l;a++){var s=start_arr[a];if(0!=s){if(!0===s){if(s=window.location.hash,s.length<1)continue}else"random"===s&&(s=Math.floor(Math.random()*itms.total));if($cfs.triggerHandler(cf_e("slideTo",conf),[s,0,!0,{fx:"none"}]))break}}var siz=sz_setSizes($cfs,opts),itm=gi_getCurrentItems($cfs.children(),opts);return opts.onCreate&&opts.onCreate.call($tt0,{width:siz.width,height:siz.height,items:itm}),$cfs.trigger(cf_e("updatePageStatus",conf),[!0,siz]),$cfs.trigger(cf_e("linkAnchors",conf)),conf.debug&&$cfs.trigger(cf_e("debug",conf)),$cfs},$.fn.carouFredSel.serialNumber=1,$.fn.carouFredSel.defaults={synchronise:!1,infinite:!0,circular:!0,responsive:!1,direction:"left",items:{start:0},scroll:{easing:"swing",duration:500,pauseOnHover:!1,event:"click",queue:!1}},$.fn.carouFredSel.configs={debug:!1,transition:!1,onWindowResize:"throttle",events:{prefix:"",namespace:"cfs"},wrapper:{element:"div",classname:"caroufredsel_wrapper"},classnames:{}},$.fn.carouFredSel.pageAnchorBuilder=function(t){return'<a href="#"><span>'+t+"</span></a>"},$.fn.carouFredSel.progressbarUpdater=function(t){$(this).css("width",t+"%")},$.fn.carouFredSel.cookie={get:function(t){t+="=";for(var e=document.cookie.split(";"),s=0,i=e.length;s<i;s++){for(var o=e[s];" "==o.charAt(0);)o=o.slice(1);if(0==o.indexOf(t))return o.slice(t.length)}return 0},set:function(t,e,s){var i,o="";s&&((i=new Date).setTime(i.getTime()+24*s*60*60*1e3),o="; expires="+i.toGMTString()),document.cookie=t+"="+e+o+"; path=/"},remove:function(t){$.fn.carouFredSel.cookie.set(t,"",-1)}},$.extend($.easing,{quadratic:function(t){var e=t*t;return t*(-e*t+4*e-6*t+4)},cubic:function(t){return t*(4*t*t-9*t+6)},elastic:function(t){var e=t*t;return t*(33*e*e-106*e*t+126*e-67*t+15)}}))}(jQuery);
1
+ !function($){function sc_setScroll(t,e,s){return{anims:[],duration:t,orgDuration:t,easing:e="transition"==s.transition&&"swing"==e?"ease":e,startTime:getTime()}}function sc_startScroll(t,e){for(var s=0,i=t.anims.length;s<i;s++){var o=t.anims[s];o&&o[0][e.transition](o[1],t.duration,t.easing,o[2])}}function sc_stopScroll(t,e){is_boolean(e)||(e=!0),is_object(t.pre)&&sc_stopScroll(t.pre,e);for(var s=0,i=t.anims.length;s<i;s++){var o=t.anims[s];o[0].stop(!0),e&&(o[0].css(o[1]),is_function(o[2])&&o[2]())}is_object(t.post)&&sc_stopScroll(t.post,e)}function sc_afterScroll(t,e,s){switch(e&&e.remove(),s.fx){case"fade":case"crossfade":case"cover-fade":case"uncover-fade":t.css("opacity",1),t.css("filter","")}}function sc_fireCallbacks(t,e,s,i,o){if(e[s]&&e[s].call(t,i),o[s].length)for(var n=0,r=o[s].length;n<r;n++)o[s][n].call(t,i);return[]}function sc_fireQueue(t,e,s){return e.length&&(t.trigger(cf_e(e[0][0],s),e[0][1]),e.shift()),e}function sc_hideHiddenItems(t){t.each(function(){var t=$(this);t.data("_cfs_isHidden",t.is(":hidden")).hide()})}function sc_showHiddenItems(t){t&&t.each(function(){var t=$(this);t.data("_cfs_isHidden")||t.show()})}function sc_clearTimers(t){return t.auto&&clearTimeout(t.auto),t.progress&&clearInterval(t.progress),t}function sc_mapCallbackArguments(t,e,s,i,o,n,r){return{width:r.width,height:r.height,items:{old:t,skipped:e,visible:s},scroll:{items:i,direction:o,duration:n}}}function sc_getDuration(t,e,s,i){var o=t.duration;return"none"==t.fx?0:("auto"==o?o=e.scroll.duration/e.scroll.items*s:o<10&&(o=i/o),o<1?0:("fade"==t.fx&&(o/=2),Math.round(o)))}function nv_showNavi(t,e,s){var i=is_number(t.items.minimum)?t.items.minimum:t.items.visible+1,i="show"==(e="show"==e||"hide"==e?e:e<i?(debug(s,"Not enough items ("+e+" total, "+i+" needed): Hiding navigation."),"hide"):"show")?"removeClass":"addClass",s=cf_c("hidden",s);t.auto.button&&t.auto.button[e]()[i](s),t.prev.button&&t.prev.button[e]()[i](s),t.next.button&&t.next.button[e]()[i](s),t.pagination.container&&t.pagination.container[e]()[i](s)}function nv_enableNavi(t,e,s){var i,o;t.circular||t.infinite||(i=("removeClass"==e||"addClass"==e)&&e,s=cf_c("disabled",s),t.auto.button&&i&&t.auto.button[i](s),t.prev.button&&t.prev.button[o=i||0==e?"addClass":"removeClass"](s),t.next.button&&(o=i||e==t.items.visible?"addClass":"removeClass",t.next.button[o](s)))}function go_getObject(t,e){return is_function(e)?e=e.call(t):is_undefined(e)&&(e={}),e}function go_getItemsObject(t,e){return is_number(e=go_getObject(t,e))?e={visible:e}:"variable"==e?e={visible:e,width:e,height:e}:is_object(e)||(e={}),e}function go_getScrollObject(t,e){return is_number(e=go_getObject(t,e))?e=e<=50?{items:e}:{duration:e}:is_string(e)?e={easing:e}:is_object(e)||(e={}),e}function go_getNaviObject(t,e){return e=is_string(e=go_getObject(t,e))?-1==(t=cf_getKeyCode(e))?$(e):t:e}function go_getAutoObject(t,e){return is_jquery(e=go_getNaviObject(t,e))?e={button:e}:is_boolean(e)?e={play:e}:is_number(e)&&(e={timeoutDuration:e}),e.progress&&(is_string(e.progress)||is_jquery(e.progress))&&(e.progress={bar:e.progress}),e}function go_complementAutoObject(t,e){return is_function(e.button)&&(e.button=e.button.call(t)),is_string(e.button)&&(e.button=$(e.button)),is_boolean(e.play)||(e.play=!0),is_number(e.delay)||(e.delay=0),is_undefined(e.pauseOnEvent)&&(e.pauseOnEvent=!0),is_boolean(e.pauseOnResize)||(e.pauseOnResize=!0),is_number(e.timeoutDuration)||(e.timeoutDuration=e.duration<10?2500:5*e.duration),e.progress&&(is_function(e.progress.bar)&&(e.progress.bar=e.progress.bar.call(t)),is_string(e.progress.bar)&&(e.progress.bar=$(e.progress.bar)),e.progress.bar?(is_function(e.progress.updater)||(e.progress.updater=$.fn.carouFredSel.progressbarUpdater),is_number(e.progress.interval)||(e.progress.interval=50)):e.progress=!1),e}function go_getPrevNextObject(t,e){return is_jquery(e=go_getNaviObject(t,e))?e={button:e}:is_number(e)&&(e={key:e}),e}function go_complementPrevNextObject(t,e){return is_function(e.button)&&(e.button=e.button.call(t)),is_string(e.button)&&(e.button=$(e.button)),is_string(e.key)&&(e.key=cf_getKeyCode(e.key)),e}function go_getPaginationObject(t,e){return is_jquery(e=go_getNaviObject(t,e))?e={container:e}:is_boolean(e)&&(e={keys:e}),e}function go_complementPaginationObject(t,e){return is_function(e.container)&&(e.container=e.container.call(t)),is_string(e.container)&&(e.container=$(e.container)),is_number(e.items)||(e.items=!1),is_boolean(e.keys)||(e.keys=!1),is_function(e.anchorBuilder)||is_false(e.anchorBuilder)||(e.anchorBuilder=$.fn.carouFredSel.pageAnchorBuilder),is_number(e.deviation)||(e.deviation=0),e}function go_getSwipeObject(t,e){return is_true(e=is_undefined(e=is_function(e)?e.call(t):e)?{onTouch:!1}:e)?e={onTouch:e}:is_number(e)&&(e={items:e}),e}function go_complementSwipeObject(t,e){return is_boolean(e.onTouch)||(e.onTouch=!0),is_boolean(e.onMouse)||(e.onMouse=!1),is_object(e.options)||(e.options={}),is_boolean(e.options.triggerOnTouchEnd)||(e.options.triggerOnTouchEnd=!1),e}function go_getMousewheelObject(t,e){return is_true(e=is_function(e)?e.call(t):e)?e={}:is_number(e)?e={items:e}:is_undefined(e)&&(e=!1),e}function go_complementMousewheelObject(t,e){return e}function gn_getItemIndex(t,e,s,i,o){if(is_jquery(t=is_object(t=is_string(t)?$(t,o):t)?$(t,o):t)?(t=o.children().index(t),is_boolean(s)||(s=!1)):is_boolean(s)||(s=!0),is_number(t)||(t=0),is_number(e)||(e=0),s&&(t+=i.first),t+=e,0<i.total){for(;t>=i.total;)t-=i.total;for(;t<0;)t+=i.total}return t}function gn_getVisibleItemsPrev(t,e,s){for(var i=0,o=0,n=s;0<=n;n--){var r=t.eq(n);if((i+=r.is(":visible")?r[e.d.outerWidth](!0):0)>e.maxDimension)return o;0==n&&(n=t.length),o++}}function gn_getVisibleItemsPrevFilter(t,e,s){return gn_getItemsPrevFilter(t,e.items.filter,e.items.visibleConf.org,s)}function gn_getScrollItemsPrevFilter(t,e,s,i){return gn_getItemsPrevFilter(t,e.items.filter,i,s)}function gn_getItemsPrevFilter(t,e,s,i){for(var o=0,n=0,r=i,c=t.length;0<=r;r--){if(++n==c)return n;var a=t.eq(r);if(a.is(e)&&++o==s)return n;0==r&&(r=c)}}function gn_getVisibleOrg(t,e){return e.items.visibleConf.org||t.children().slice(0,e.items.visible).filter(e.items.filter).length}function gn_getVisibleItemsNext(t,e,s){for(var i=0,o=0,n=s,r=t.length-1;n<=r;n++){var c=t.eq(n);if((i+=c.is(":visible")?c[e.d.outerWidth](!0):0)>e.maxDimension)return o;if(++o==1+r)return o;n==r&&(n=-1)}}function gn_getVisibleItemsNextTestCircular(t,e,s,i){t=gn_getVisibleItemsNext(t,e,s);return e.circular||i<s+t&&(t=i-s),t}function gn_getVisibleItemsNextFilter(t,e,s){return gn_getItemsNextFilter(t,e.items.filter,e.items.visibleConf.org,s,e.circular)}function gn_getScrollItemsNextFilter(t,e,s,i){return gn_getItemsNextFilter(t,e.items.filter,i+1,s,e.circular)-1}function gn_getItemsNextFilter(t,e,s,i,o){for(var n=0,r=0,c=i,a=t.length-1;c<=a;c++){if(a<=++r)return r;var f=t.eq(c);if(f.is(e)&&++n==s)return r;c==a&&(c=-1)}}function gi_getCurrentItems(t,e){return t.slice(0,e.items.visible)}function gi_getOldItemsPrev(t,e,s){return t.slice(s,e.items.visibleConf.old+s)}function gi_getNewItemsPrev(t,e){return t.slice(0,e.items.visible)}function gi_getOldItemsNext(t,e){return t.slice(0,e.items.visibleConf.old)}function gi_getNewItemsNext(t,e,s){return t.slice(s,e.items.visible+s)}function sz_storeMargin(t,s,i){s.usePadding&&(is_string(i)||(i="_cfs_origCssMargin"),t.each(function(){var t=$(this),e=parseInt(t.css(s.d.marginRight),10);is_number(e)||(e=0),t.data(i,e)}))}function sz_resetMargin(t,e,s){var i;e.usePadding&&(i=!!is_boolean(s)&&s,is_number(s)||(s=0),sz_storeMargin(t,e,"_cfs_tempCssMargin"),t.each(function(){var t=$(this);t.css(e.d.marginRight,i?t.data("_cfs_tempCssMargin"):s+t.data("_cfs_origCssMargin"))}))}function sz_storeOrigCss(t){t.each(function(){var t=$(this);t.data("_cfs_origCss",t.attr("style")||"")})}function sz_restoreOrigCss(t){t.each(function(){var t=$(this);t.attr("style",t.data("_cfs_origCss")||"")})}function sz_setResponsiveSizes(s,t){s.items.visible;var i=s.items[s.d.width],o=s[s.d.height],n=is_percentage(o);t.each(function(){var t=$(this),e=i-ms_getPaddingBorderMargin(t,s,"Width");t[s.d.width](e),n&&t[s.d.height](ms_getPercentage(e,o))})}function sz_setSizes(t,e){var s,i=t.parent(),o=t.children(),n=gi_getCurrentItems(o,e),r=cf_mapWrapperSizes(ms_getSizes(n,e,!0),e,!1);return i.css(r),e.usePadding&&(i=(s=e.padding)[e.d[1]],e.align&&i<0&&(i=0),(n=n.last()).css(e.d.marginRight,n.data("_cfs_origCssMargin")+i),t.css(e.d.top,s[e.d[0]]),t.css(e.d.left,s[e.d[3]])),t.css(e.d.width,r[e.d.width]+2*ms_getTotalSize(o,e,"width")),t.css(e.d.height,ms_getLargestSize(o,e,"height")),r}function ms_getSizes(t,e,s){return[ms_getTotalSize(t,e,"width",s),ms_getLargestSize(t,e,"height",s)]}function ms_getLargestSize(t,e,s,i){return is_boolean(i)||(i=!1),is_number(e[e.d[s]])&&i?e[e.d[s]]:is_number(e.items[e.d[s]])?e.items[e.d[s]]:ms_getTrueLargestSize(t,e,s=-1<s.toLowerCase().indexOf("width")?"outerWidth":"outerHeight")}function ms_getTrueLargestSize(t,e,s){for(var i=0,o=0,n=t.length;o<n;o++){var r=t.eq(o),r=r.is(":visible")?r[e.d[s]](!0):0;i<r&&(i=r)}return i}function ms_getTotalSize(t,e,s,i){if(is_boolean(i)||(i=!1),is_number(e[e.d[s]])&&i)return e[e.d[s]];if(is_number(e.items[e.d[s]]))return e.items[e.d[s]]*t.length;for(var o=-1<s.toLowerCase().indexOf("width")?"outerWidth":"outerHeight",n=0,r=0,c=t.length;r<c;r++){var a=t.eq(r);n+=a.is(":visible")?a[e.d[o]](!0):0}return n}function ms_getParentSize(t,e,s){var i=t.is(":visible");i&&t.hide();s=t.parent()[e.d[s]]();return i&&t.show(),s}function ms_getMaxDimension(t,e){return is_number(t[t.d.width])?t[t.d.width]:e}function ms_hasVariableSizes(t,e,s){for(var i=!1,o=!1,n=0,r=t.length;n<r;n++){var c=t.eq(n),c=c.is(":visible")?c[e.d[s]](!0):0;!1===i?i=c:i!=c&&(o=!0),0==i&&(o=!0)}return o}function ms_getPaddingBorderMargin(t,e,s){return t[e.d["outer"+s]](!0)-t[e.d[s.toLowerCase()]]()}function ms_getPercentage(t,e){if(is_percentage(e)){if(!is_number(e=parseInt(e.slice(0,-1),10)))return t;t*=e/100}return t}function cf_e(t,e,s,i,o){return is_boolean(s)||(s=!0),is_boolean(i)||(i=!0),is_boolean(o)||(o=!1),s&&(t=e.events.prefix+t),i&&(t=t+"."+e.events.namespace),i&&o&&(t+=e.serialNumber),t}function cf_c(t,e){return is_string(e.classnames[t])?e.classnames[t]:t}function cf_mapWrapperSizes(t,e,s){is_boolean(s)||(s=!0);var i=e.usePadding&&s?e.padding:[0,0,0,0],s={};return s[e.d.width]=t[0]+i[1]+i[3],s[e.d.height]=t[1]+i[0]+i[2],s}function cf_sortParams(t,e){for(var s=[],i=0,o=t.length;i<o;i++)for(var n=0,r=e.length;n<r;n++)if(-1<e[n].indexOf(typeof t[i])&&is_undefined(s[n])){s[n]=t[i];break}return s}function cf_getPadding(t){if(is_undefined(t))return[0,0,0,0];if(is_number(t))return[t,t,t,t];if(!is_array(t=is_string(t)?t.split("px").join("").split("em").join("").split(" "):t))return[0,0,0,0];for(var e=0;e<4;e++)t[e]=parseInt(t[e],10);switch(t.length){case 0:return[0,0,0,0];case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];default:return[t[0],t[1],t[2],t[3]]}}function cf_getAlignPadding(t,e){var s=is_number(e[e.d.width])?Math.ceil(e[e.d.width]-ms_getTotalSize(t,e,"width")):0;switch(e.align){case"left":return[0,s];case"right":return[s,0];case"center":default:return[Math.ceil(s/2),Math.floor(s/2)]}}function cf_getDimensions(t){for(var e=[["width","innerWidth","outerWidth","height","innerHeight","outerHeight","left","top","marginRight",0,1,2,3],["height","innerHeight","outerHeight","width","innerWidth","outerWidth","top","left","marginBottom",3,2,1,0]],s=e[0].length,i="right"==t.direction||"left"==t.direction?0:1,o={},n=0;n<s;n++)o[e[0][n]]=e[i][n];return o}function cf_getAdjust(t,e,s,i){var o=t;if(is_function(s))o=s.call(i,o);else if(is_string(s)){var n,r,i=s.split("+"),s=s.split("-");switch(i=s.length>i.length?(n=!0,r=s[0],s[1]):(n=!1,r=i[0],i[1]),r){case"even":o=t%2==1?t-1:t;break;case"odd":o=t%2==0?t-1:t;break;default:o=t}is_number(i=parseInt(i,10))&&(o+=i=n?-i:i)}return o=!is_number(o)||o<1?1:o}function cf_getItemsAdjust(t,e,s,i){return cf_getItemAdjustMinMax(cf_getAdjust(t,e,s,i),e.items.visibleConf)}function cf_getItemAdjustMinMax(t,e){return is_number(e.min)&&t<e.min&&(t=e.min),t=(t=is_number(e.max)&&t>e.max?e.max:t)<1?1:t}function cf_getSynchArr(t){is_array(t)||(t=[[t]]);for(var e=0,s=(t=!is_array(t[0])?[t]:t).length;e<s;e++)is_string(t[e][0])&&(t[e][0]=$(t[e][0])),is_boolean(t[e][1])||(t[e][1]=!0),is_boolean(t[e][2])||(t[e][2]=!0),is_number(t[e][3])||(t[e][3]=0);return t}function cf_getKeyCode(t){return"right"==t?39:"left"==t?37:"up"==t?38:"down"==t?40:-1}function cf_setCookie(t,e,s){t&&(s=e.triggerHandler(cf_e("currentPosition",s)),$.fn.carouFredSel.cookie.set(t,s))}function cf_getCookie(t){t=$.fn.carouFredSel.cookie.get(t);return""==t?0:t}function in_mapCss(t,e){for(var s={},i=0,o=e.length;i<o;i++)s[e[i]]=t.css(e[i]);return s}function in_complementItems(t,e,s,i){return is_object(t.visibleConf)||(t.visibleConf={}),is_object(t.sizesConf)||(t.sizesConf={}),0==t.start&&is_number(i)&&(t.start=i),is_object(t.visible)?(t.visibleConf.min=t.visible.min,t.visibleConf.max=t.visible.max,t.visible=!1):is_string(t.visible)?("variable"==t.visible?t.visibleConf.variable=!0:t.visibleConf.adjust=t.visible,t.visible=!1):is_function(t.visible)&&(t.visibleConf.adjust=t.visible,t.visible=!1),is_string(t.filter)||(t.filter=0<s.filter(":hidden").length?":visible":"*"),t[e.d.width]||(e.responsive?(debug(!0,"Set a "+e.d.width+" for the items!"),t[e.d.width]=ms_getTrueLargestSize(s,e,"outerWidth")):t[e.d.width]=ms_hasVariableSizes(s,e,"outerWidth")?"variable":s[e.d.outerWidth](!0)),t[e.d.height]||(t[e.d.height]=ms_hasVariableSizes(s,e,"outerHeight")?"variable":s[e.d.outerHeight](!0)),t.sizesConf.width=t.width,t.sizesConf.height=t.height,t}function in_complementVisibleItems(t,e){return"variable"==t.items[t.d.width]&&(t.items.visibleConf.variable=!0),t.items.visibleConf.variable||(is_number(t[t.d.width])?t.items.visible=Math.floor(t[t.d.width]/t.items[t.d.width]):(t.items.visible=Math.floor(e/t.items[t.d.width]),t[t.d.width]=t.items.visible*t.items[t.d.width],t.items.visibleConf.adjust||(t.align=!1)),("Infinity"==t.items.visible||t.items.visible<1)&&(debug(!0,'Not a valid number of visible items: Set to "variable".'),t.items.visibleConf.variable=!0)),t}function in_complementPrimarySize(t,e,s){return t="auto"==t?ms_getTrueLargestSize(s,e,"outerWidth"):t}function in_complementSecondarySize(t,e,s){return t=(t="auto"==t?ms_getTrueLargestSize(s,e,"outerHeight"):t)||e.items[e.d.height]}function in_getAlignPadding(t,e){e=cf_getAlignPadding(gi_getCurrentItems(e,t),t);return t.padding[t.d[1]]=e[1],t.padding[t.d[3]]=e[0],t}function in_getResponsiveValues(t,e,s){var i=cf_getItemAdjustMinMax(Math.ceil(t[t.d.width]/t.items[t.d.width]),t.items.visibleConf);i>e.length&&(i=e.length);e=Math.floor(t[t.d.width]/i);return t.items.visible=i,t.items[t.d.width]=e,t[t.d.width]=i*e,t}function bt_pauseOnHoverConfig(t){var e,s;return is_string(t)?(s=-1<t.indexOf("immediate"),e=-1<t.indexOf("resume")):s=e=!1,[s,e]}function bt_mousesheelNumber(t){return is_number(t)&&t}function is_null(t){return null===t}function is_undefined(t){return is_null(t)||void 0===t||""===t||"undefined"===t}function is_array(t){return t instanceof Array}function is_jquery(t){return t instanceof jQuery}function is_object(t){return(t instanceof Object||"object"==typeof t)&&!is_null(t)&&!is_jquery(t)&&!is_array(t)&&!is_function(t)}function is_number(t){return(t instanceof Number||"number"==typeof t)&&!isNaN(t)}function is_string(t){return(t instanceof String||"string"==typeof t)&&!is_undefined(t)&&!is_true(t)&&!is_false(t)}function is_function(t){return t instanceof Function||"function"==typeof t}function is_boolean(t){return t instanceof Boolean||"boolean"==typeof t||is_true(t)||is_false(t)}function is_true(t){return!0===t||"true"===t}function is_false(t){return!1===t||"false"===t}function is_percentage(t){return is_string(t)&&"%"==t.slice(-1)}function getTime(){return(new Date).getTime()}function deprecated(t,e){debug(!0,t+" is DEPRECATED, support for it will be removed. Use "+e+" instead.")}function debug(t,e){if(!is_undefined(window.console)&&!is_undefined(window.console.log)){var s;if(is_object(t)?(s=" ("+t.selector+")",t=t.debug):s="",!t)return!1;e=is_string(e)?"carouFredSel"+s+": "+e:["carouFredSel"+s+":",e],window.console.log(e)}return!1}$.fn.carouFredSel||($.fn.caroufredsel=$.fn.carouFredSel=function(options,configs){if(0==this.length)return debug(!0,'No element found for "'+this.selector+'".'),this;if(1<this.length)return this.each(function(){$(this).carouFredSel(options,configs)});var $cfs=this,$tt0=this[0],starting_position=!1;$cfs.data("_cfs_isCarousel")&&(starting_position=$cfs.triggerHandler("_cfs_triggerEvent","currentPosition"),$cfs.trigger("_cfs_triggerEvent",["destroy",!0]));var FN={_init:function(t,e,s){(t=go_getObject($tt0,t)).items=go_getItemsObject($tt0,t.items),t.scroll=go_getScrollObject($tt0,t.scroll),t.auto=go_getAutoObject($tt0,t.auto),t.prev=go_getPrevNextObject($tt0,t.prev),t.next=go_getPrevNextObject($tt0,t.next),t.pagination=go_getPaginationObject($tt0,t.pagination),t.swipe=go_getSwipeObject($tt0,t.swipe),t.mousewheel=go_getMousewheelObject($tt0,t.mousewheel),e&&(opts_orig=$.extend(!0,{},$.fn.carouFredSel.defaults,t)),(opts=$.extend(!0,{},$.fn.carouFredSel.defaults,t)).d=cf_getDimensions(opts),crsl.direction="up"==opts.direction||"left"==opts.direction?"next":"prev";var i=$cfs.children(),t=ms_getParentSize($wrp,opts,"width");if(is_true(opts.cookie)&&(opts.cookie="caroufredsel_cookie_"+conf.serialNumber),opts.maxDimension=ms_getMaxDimension(opts,t),opts.items=in_complementItems(opts.items,opts,i,s),opts[opts.d.width]=in_complementPrimarySize(opts[opts.d.width],opts,i),opts[opts.d.height]=in_complementSecondarySize(opts[opts.d.height],opts,i),opts.responsive&&(is_percentage(opts[opts.d.width])||(opts[opts.d.width]="100%")),is_percentage(opts[opts.d.width])&&(crsl.upDateOnWindowResize=!0,crsl.primarySizePercentage=opts[opts.d.width],opts[opts.d.width]=ms_getPercentage(t,crsl.primarySizePercentage),opts.items.visible||(opts.items.visibleConf.variable=!0)),opts.responsive?(opts.usePadding=!0,opts.padding=[5,5,5,5],opts.align=!1,opts.items.visibleConf.variable=!1):((opts=!opts.items.visible?in_complementVisibleItems(opts,t):opts)[opts.d.width]||(!opts.items.visibleConf.variable&&is_number(opts.items[opts.d.width])&&"*"==opts.items.filter?(opts[opts.d.width]=opts.items.visible*opts.items[opts.d.width],opts.align=!1):opts[opts.d.width]="variable"),is_undefined(opts.align)&&(opts.align=!!is_number(opts[opts.d.width])&&"center"),opts.items.visibleConf.variable&&(opts.items.visible=gn_getVisibleItemsNext(i,opts,0))),"*"==opts.items.filter||opts.items.visibleConf.variable||(opts.items.visibleConf.org=opts.items.visible,opts.items.visible=gn_getVisibleItemsNextFilter(i,opts,0)),opts.items.visible=cf_getItemsAdjust(opts.items.visible,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts.responsive)opts.items.visibleConf.min||(opts.items.visibleConf.min=opts.items.visible),opts.items.visibleConf.max||(opts.items.visibleConf.max=opts.items.visible),opts=in_getResponsiveValues(opts,i,t);else switch(opts.padding=cf_getPadding(opts.padding),"top"==opts.align?opts.align="left":"bottom"==opts.align&&(opts.align="right"),opts.align){case"center":case"left":case"right":"variable"!=opts[opts.d.width]&&((opts=in_getAlignPadding(opts,i)).usePadding=!0);break;default:opts.align=!1,opts.usePadding=0!=opts.padding[0]||0!=opts.padding[1]||0!=opts.padding[2]||0!=opts.padding[3]}is_number(opts.scroll.duration)||(opts.scroll.duration=500),is_undefined(opts.scroll.items)&&(opts.scroll.items=opts.responsive||opts.items.visibleConf.variable||"*"!=opts.items.filter?"visible":opts.items.visible),opts.auto=$.extend(!0,{},opts.scroll,opts.auto),opts.prev=$.extend(!0,{},opts.scroll,opts.prev),opts.next=$.extend(!0,{},opts.scroll,opts.next),opts.pagination=$.extend(!0,{},opts.scroll,opts.pagination),opts.auto=go_complementAutoObject($tt0,opts.auto),opts.prev=go_complementPrevNextObject($tt0,opts.prev),opts.next=go_complementPrevNextObject($tt0,opts.next),opts.pagination=go_complementPaginationObject($tt0,opts.pagination),opts.swipe=go_complementSwipeObject($tt0,opts.swipe),opts.mousewheel=go_complementMousewheelObject($tt0,opts.mousewheel),opts.synchronise&&(opts.synchronise=cf_getSynchArr(opts.synchronise)),opts.auto.onPauseStart&&(opts.auto.onTimeoutStart=opts.auto.onPauseStart,deprecated("auto.onPauseStart","auto.onTimeoutStart")),opts.auto.onPausePause&&(opts.auto.onTimeoutPause=opts.auto.onPausePause,deprecated("auto.onPausePause","auto.onTimeoutPause")),opts.auto.onPauseEnd&&(opts.auto.onTimeoutEnd=opts.auto.onPauseEnd,deprecated("auto.onPauseEnd","auto.onTimeoutEnd")),opts.auto.pauseDuration&&(opts.auto.timeoutDuration=opts.auto.pauseDuration,deprecated("auto.pauseDuration","auto.timeoutDuration"))},_build:function(){$cfs.data("_cfs_isCarousel",!0);var t=$cfs.children(),e=in_mapCss($cfs,["textAlign","float","position","top","right","bottom","left","zIndex","width","height","marginTop","marginRight","marginBottom","marginLeft"]),s="relative";switch(e.position){case"absolute":case"fixed":s=e.position}"parent"==conf.wrapper?sz_storeOrigCss($wrp):$wrp.css(e),$wrp.css({overflow:"hidden",position:s}),sz_storeOrigCss($cfs),$cfs.data("_cfs_origCssZindex",e.zIndex),$cfs.css({textAlign:"left","float":"none",position:"absolute",top:0,right:"auto",bottom:"auto",left:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),sz_storeMargin(t,opts),sz_storeOrigCss(t),opts.responsive&&sz_setResponsiveSizes(opts,t)},_bind_events:function(){FN._unbind_events(),$cfs.bind(cf_e("stop",conf),function(t,e){return t.stopPropagation(),crsl.isStopped||opts.auto.button&&opts.auto.button.addClass(cf_c("stopped",conf)),crsl.isStopped=!0,opts.auto.play&&(opts.auto.play=!1,$cfs.trigger(cf_e("pause",conf),e)),!0}),$cfs.bind(cf_e("finish",conf),function(t){return t.stopPropagation(),crsl.isScrolling&&sc_stopScroll(scrl),!0}),$cfs.bind(cf_e("pause",conf),function(t,e,s){var i;return t.stopPropagation(),tmrs=sc_clearTimers(tmrs),e&&crsl.isScrolling&&(scrl.isStopped=!0,i=getTime()-scrl.startTime,scrl.duration-=i,scrl.pre&&(scrl.pre.duration-=i),scrl.post&&(scrl.post.duration-=i),sc_stopScroll(scrl,!1)),crsl.isPaused||crsl.isScrolling||s&&(tmrs.timePassed+=getTime()-tmrs.startTime),crsl.isPaused||opts.auto.button&&opts.auto.button.addClass(cf_c("paused",conf)),crsl.isPaused=!0,opts.auto.onTimeoutPause&&(i=opts.auto.timeoutDuration-tmrs.timePassed,s=100-Math.ceil(100*i/opts.auto.timeoutDuration),opts.auto.onTimeoutPause.call($tt0,s,i)),!0}),$cfs.bind(cf_e("play",conf),function(t,e,s,i){t.stopPropagation(),tmrs=sc_clearTimers(tmrs);var o=cf_sortParams([e,s,i],["string","number","boolean"]);if(e=o[0],s=o[1],i=o[2],"prev"!=e&&"next"!=e&&(e=crsl.direction),is_number(s)||(s=0),(i=!is_boolean(i)?!1:i)&&(crsl.isStopped=!1,opts.auto.play=!0),!opts.auto.play)return t.stopImmediatePropagation(),debug(conf,"Carousel stopped: Not scrolling.");crsl.isPaused&&opts.auto.button&&(opts.auto.button.removeClass(cf_c("stopped",conf)),opts.auto.button.removeClass(cf_c("paused",conf))),crsl.isPaused=!1,tmrs.startTime=getTime();var n=opts.auto.timeoutDuration+s;return dur2=n-tmrs.timePassed,perc=100-Math.ceil(100*dur2/n),opts.auto.progress&&(tmrs.progress=setInterval(function(){var t=getTime()-tmrs.startTime+tmrs.timePassed,t=Math.ceil(100*t/n);opts.auto.progress.updater.call(opts.auto.progress.bar[0],t)},opts.auto.progress.interval)),tmrs.auto=setTimeout(function(){opts.auto.progress&&opts.auto.progress.updater.call(opts.auto.progress.bar[0],100),opts.auto.onTimeoutEnd&&opts.auto.onTimeoutEnd.call($tt0,perc,dur2),crsl.isScrolling?$cfs.trigger(cf_e("play",conf),e):$cfs.trigger(cf_e(e,conf),opts.auto)},dur2),opts.auto.onTimeoutStart&&opts.auto.onTimeoutStart.call($tt0,perc,dur2),!0}),$cfs.bind(cf_e("resume",conf),function(t){return t.stopPropagation(),scrl.isStopped?(scrl.isStopped=!1,crsl.isPaused=!1,crsl.isScrolling=!0,scrl.startTime=getTime(),sc_startScroll(scrl,conf)):$cfs.trigger(cf_e("play",conf)),!0}),$cfs.bind(cf_e("prev",conf)+" "+cf_e("next",conf),function(t,e,s,i,o){if(t.stopPropagation(),crsl.isStopped||$cfs.is(":hidden"))return t.stopImmediatePropagation(),debug(conf,"Carousel stopped or hidden: Not scrolling.");var n=is_number(opts.items.minimum)?opts.items.minimum:opts.items.visible+1;if(n>itms.total)return t.stopImmediatePropagation(),debug(conf,"Not enough items ("+itms.total+" total, "+n+" needed): Not scrolling.");e=(a=cf_sortParams([e,s,i,o],["object","number/string","function","boolean"]))[0],s=a[1],i=a[2],o=a[3];var r=t.type.slice(conf.events.prefix.length);if(is_object(e)||(e={}),is_function(i)&&(e.onAfter=i),is_boolean(o)&&(e.queue=o),(e=$.extend(!0,{},opts[r],e)).conditions&&!e.conditions.call($tt0,r))return t.stopImmediatePropagation(),debug(conf,'Callback "conditions" returned false.');if(!is_number(s)){if("*"!=opts.items.filter)s="visible";else for(var c=[s,e.items,opts[r].items],a=0,f=c.length;a<f;a++)if(is_number(c[a])||"page"==c[a]||"visible"==c[a]){s=c[a];break}switch(s){case"page":return t.stopImmediatePropagation(),$cfs.triggerHandler(cf_e(r+"Page",conf),[e,i]);case"visible":opts.items.visibleConf.variable||"*"!=opts.items.filter||(s=opts.items.visible)}}if(scrl.isStopped)return $cfs.trigger(cf_e("resume",conf)),$cfs.trigger(cf_e("queue",conf),[r,[e,s,i]]),t.stopImmediatePropagation(),debug(conf,"Carousel resumed scrolling.");if(0<e.duration&&crsl.isScrolling)return e.queue&&("last"==e.queue&&(queu=[]),"first"==e.queue&&0!=queu.length||$cfs.trigger(cf_e("queue",conf),[r,[e,s,i]])),t.stopImmediatePropagation(),debug(conf,"Carousel currently scrolling.");if(tmrs.timePassed=0,$cfs.trigger(cf_e("slide_"+r,conf),[e,s]),opts.synchronise)for(var l=opts.synchronise,u=[e,s],p=0,f=l.length;p<f;p++){var d=r;l[p][2]||(d="prev"==d?"next":"prev"),l[p][1]||(u[0]=l[p][0].triggerHandler("_cfs_triggerEvent",["configuration",d])),u[1]=s+l[p][3],l[p][0].trigger("_cfs_triggerEvent",["slide_"+d,u])}return!0}),$cfs.bind(cf_e("slide_prev",conf),function(t,e,s){t.stopPropagation();var i=$cfs.children();if(!opts.circular&&0==itms.first)return opts.infinite&&$cfs.trigger(cf_e("next",conf),itms.total-1),t.stopImmediatePropagation();if(sz_resetMargin(i,opts),is_number(s)||(s=cf_getAdjust(s=opts.items.visibleConf.variable?gn_getVisibleItemsPrev(i,opts,itms.total-1):"*"!=opts.items.filter?(p=is_number(e.items)?e.items:gn_getVisibleOrg($cfs,opts),gn_getScrollItemsPrevFilter(i,opts,itms.total-1,p)):opts.items.visible,opts,e.items,$tt0)),opts.circular||itms.total-s<itms.first&&(s=itms.total-itms.first),opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable?(g=cf_getItemsAdjust(gn_getVisibleItemsNext(i,opts,itms.total-s),opts,opts.items.visibleConf.adjust,$tt0),opts.items.visible+s<=g&&s<itms.total&&(g=cf_getItemsAdjust(gn_getVisibleItemsNext(i,opts,itms.total-++s),opts,opts.items.visibleConf.adjust,$tt0)),opts.items.visible=g):"*"!=opts.items.filter&&(g=gn_getVisibleItemsNextFilter(i,opts,itms.total-s),opts.items.visible=cf_getItemsAdjust(g,opts,opts.items.visibleConf.adjust,$tt0)),sz_resetMargin(i,opts,!0),0==s)return t.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+s+" items backward."),itms.first+=s;itms.first>=itms.total;)itms.first-=itms.total;opts.circular||(0==itms.first&&e.onEnd&&e.onEnd.call($tt0,"prev"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),$cfs.children().slice(itms.total-s,itms.total).prependTo($cfs),itms.total<opts.items.visible+s&&$cfs.children().slice(0,opts.items.visible+s-itms.total).clone(!0).appendTo($cfs);var o=gi_getOldItemsPrev(i=$cfs.children(),opts,s),n=gi_getNewItemsPrev(i,opts),r=i.eq(s-1),c=o.last(),a=n.last();sz_resetMargin(i,opts);var f=0,l=0;opts.align&&(f=(x=cf_getAlignPadding(n,opts))[0],l=x[1]);var u,p=f<0?opts.padding[opts.d[3]]:0,d=!1,g=$();opts.items.visible<s&&(g=i.slice(opts.items.visibleConf.old,s),"directscroll"==e.fx&&(u=opts.items[opts.d.width],r=a,sc_hideHiddenItems(d=g),opts.items[opts.d.width]="variable"));var m=!1,t=ms_getTotalSize(i.slice(0,s),opts,"width"),_=cf_mapWrapperSizes(ms_getSizes(n,opts,!0),opts,!opts.usePadding),b=0,v={},h={},w={},P={},C={},x={},S={},y=sc_getDuration(e,opts,s,t);switch(e.fx){case"cover":case"cover-fade":b=ms_getTotalSize(i.slice(0,opts.items.visible),opts,"width")}d&&(opts.items[opts.d.width]=u),sz_resetMargin(i,opts,!0),0<=l&&sz_resetMargin(c,opts,opts.padding[opts.d[1]]),0<=f&&sz_resetMargin(r,opts,opts.padding[opts.d[3]]),opts.align&&(opts.padding[opts.d[1]]=l,opts.padding[opts.d[3]]=f),x[opts.d.left]=-(t-p),S[opts.d.left]=-(b-p),h[opts.d.left]=_[opts.d.width];var I=function(){},z=function(){},j=function(){},k=function(){},N=function(){},O=function(){},T=function(){},M=function(){};switch(e.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":m=$cfs.clone(!0).appendTo($wrp)}switch(e.fx){case"crossfade":case"uncover":case"uncover-fade":m.children().slice(0,s).remove(),m.children().slice(opts.items.visibleConf.old).remove();break;case"cover":case"cover-fade":m.children().slice(opts.items.visible).remove(),m.css(S)}if($cfs.css(x),scrl=sc_setScroll(y,e.easing,conf),v[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0,"variable"!=opts[opts.d.width]&&"variable"!=opts[opts.d.height]||(I=function(){$wrp.css(_)},z=function(){scrl.anims.push([$wrp,_])}),opts.usePadding){switch(a.not(r).length&&(w[opts.d.marginRight]=r.data("_cfs_origCssMargin"),f<0?r.css(w):(T=function(){r.css(w)},M=function(){scrl.anims.push([r,w])})),e.fx){case"cover":case"cover-fade":m.children().eq(s-1).css(w)}a.not(c).length&&(P[opts.d.marginRight]=c.data("_cfs_origCssMargin"),j=function(){c.css(P)},k=function(){scrl.anims.push([c,P])}),0<=l&&(C[opts.d.marginRight]=a.data("_cfs_origCssMargin")+opts.padding[opts.d[1]],N=function(){a.css(C)},O=function(){scrl.anims.push([a,C])})}var A=function(){$cfs.css(v)},F=opts.items.visible+s-itms.total,H=function(){var t;0<F&&($cfs.children().slice(itms.total).remove(),o=$($cfs.children().slice(itms.total-(opts.items.visible-F)).get().concat($cfs.children().slice(0,F).get()))),sc_showHiddenItems(d),opts.usePadding&&(t=$cfs.children().eq(opts.items.visible+s-1)).css(opts.d.marginRight,t.data("_cfs_origCssMargin"))},q=sc_mapCallbackArguments(o,g,n,s,"prev",y,_),D=function(){sc_afterScroll($cfs,m,e),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,e,"onAfter",q,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))};switch(crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,e,"onBefore",q,clbk),e.fx){case"none":$cfs.css(v),I(),j(),N(),T(),A(),H(),D();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){I(),j(),N(),T(),A(),H(),(scrl=sc_setScroll(y,e.easing,conf)).anims.push([$cfs,{opacity:1},D]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([m,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},D]),z(),j(),N(),T(),A(),H();break;case"cover":scrl.anims.push([m,v,function(){j(),N(),T(),A(),H(),D()}]),z();break;case"cover-fade":scrl.anims.push([$cfs,{opacity:0}]),scrl.anims.push([m,v,function(){j(),N(),T(),A(),H(),D()}]),z();break;case"uncover":scrl.anims.push([m,h,D]),z(),j(),N(),T(),A(),H();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([m,h,D]),z(),j(),N(),T(),A(),H();break;default:scrl.anims.push([$cfs,v,function(){H(),D()}]),z(),k(),O(),M()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,_]),!0}),$cfs.bind(cf_e("slide_next",conf),function(t,e,s){t.stopPropagation();var i=$cfs.children();if(!opts.circular&&itms.first==opts.items.visible)return opts.infinite&&$cfs.trigger(cf_e("prev",conf),itms.total-1),t.stopImmediatePropagation();sz_resetMargin(i,opts),is_number(s)||(s=cf_getAdjust(s="*"!=opts.items.filter?(p=is_number(e.items)?e.items:gn_getVisibleOrg($cfs,opts),gn_getScrollItemsNextFilter(i,opts,0,p)):opts.items.visible,opts,e.items,$tt0));var o=0==itms.first?itms.total:itms.first;if(opts.circular||(p=opts.items.visibleConf.variable?(n=gn_getVisibleItemsNext(i,opts,s),gn_getVisibleItemsPrev(i,opts,o-1)):(n=opts.items.visible,opts.items.visible),o<s+n&&(s=o-p)),opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){for(var n=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(i,opts,s,o),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible-s>=n&&s<itms.total;)n=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(i,opts,++s,o),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible=n}else"*"!=opts.items.filter&&(n=gn_getVisibleItemsNextFilter(i,opts,s),opts.items.visible=cf_getItemsAdjust(n,opts,opts.items.visibleConf.adjust,$tt0));if(sz_resetMargin(i,opts,!0),0==s)return t.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+s+" items forward."),itms.first-=s;itms.first<0;)itms.first+=itms.total;opts.circular||(itms.first==opts.items.visible&&e.onEnd&&e.onEnd.call($tt0,"next"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),itms.total<opts.items.visible+s&&$cfs.children().slice(0,opts.items.visible+s-itms.total).clone(!0).appendTo($cfs);var r=gi_getOldItemsNext(i=$cfs.children(),opts),c=gi_getNewItemsNext(i,opts,s),a=i.eq(s-1),f=r.last(),l=c.last();sz_resetMargin(i,opts);var u=0,p=0;opts.align&&(u=(_=cf_getAlignPadding(c,opts))[0],p=_[1]);var d,g=!1,t=$();opts.items.visibleConf.old<s&&(t=i.slice(opts.items.visibleConf.old,s),"directscroll"==e.fx&&(d=opts.items[opts.d.width],a=f,sc_hideHiddenItems(g=t),opts.items[opts.d.width]="variable"));var m=!1,_=ms_getTotalSize(i.slice(0,s),opts,"width"),b=cf_mapWrapperSizes(ms_getSizes(c,opts,!0),opts,!opts.usePadding),v=0,h={},w={},P={},C={},x={},S=sc_getDuration(e,opts,s,_);switch(e.fx){case"uncover":case"uncover-fade":v=ms_getTotalSize(i.slice(0,opts.items.visibleConf.old),opts,"width")}g&&(opts.items[opts.d.width]=d),opts.align&&opts.padding[opts.d[1]]<0&&(opts.padding[opts.d[1]]=0),sz_resetMargin(i,opts,!0),sz_resetMargin(f,opts,opts.padding[opts.d[1]]),opts.align&&(opts.padding[opts.d[1]]=p,opts.padding[opts.d[3]]=u),x[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0;var y=function(){},I=function(){},z=function(){},j=function(){},k=function(){},N=function(){};switch(e.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":(m=$cfs.clone(!0).appendTo($wrp)).children().slice(opts.items.visibleConf.old).remove()}switch(e.fx){case"crossfade":case"cover":case"cover-fade":$cfs.css("zIndex",1),m.css("zIndex",0)}scrl=sc_setScroll(S,e.easing,conf),h[opts.d.left]=-_,w[opts.d.left]=-v,u<0&&(h[opts.d.left]+=u),"variable"!=opts[opts.d.width]&&"variable"!=opts[opts.d.height]||(y=function(){$wrp.css(b)},I=function(){scrl.anims.push([$wrp,b])}),opts.usePadding&&(_=l.data("_cfs_origCssMargin"),0<=p&&(_+=opts.padding[opts.d[1]]),l.css(opts.d.marginRight,_),a.not(f).length&&(C[opts.d.marginRight]=f.data("_cfs_origCssMargin")),z=function(){f.css(C)},j=function(){scrl.anims.push([f,C])},_=a.data("_cfs_origCssMargin"),0<u&&(_+=opts.padding[opts.d[3]]),P[opts.d.marginRight]=_,k=function(){a.css(P)},N=function(){scrl.anims.push([a,P])});var O=function(){$cfs.css(x)},T=opts.items.visible+s-itms.total,M=function(){0<T&&$cfs.children().slice(itms.total).remove();var t,e=$cfs.children().slice(0,s).appendTo($cfs).last();0<T&&(c=gi_getCurrentItems(i,opts)),sc_showHiddenItems(g),opts.usePadding&&(itms.total<opts.items.visible+s&&(t=$cfs.children().eq(opts.items.visible-1)).css(opts.d.marginRight,t.data("_cfs_origCssMargin")+opts.padding[opts.d[1]]),e.css(opts.d.marginRight,e.data("_cfs_origCssMargin")))},A=sc_mapCallbackArguments(r,t,c,s,"next",S,b),F=function(){$cfs.css("zIndex",$cfs.data("_cfs_origCssZindex")),sc_afterScroll($cfs,m,e),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,e,"onAfter",A,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))};switch(crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,e,"onBefore",A,clbk),e.fx){case"none":$cfs.css(h),y(),z(),k(),O(),M(),F();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){y(),z(),k(),O(),M(),(scrl=sc_setScroll(S,e.easing,conf)).anims.push([$cfs,{opacity:1},F]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([m,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},F]),I(),z(),k(),O(),M();break;case"cover":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([$cfs,x,F]),I(),z(),k(),M();break;case"cover-fade":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([m,{opacity:0}]),scrl.anims.push([$cfs,x,F]),I(),z(),k(),M();break;case"uncover":scrl.anims.push([m,w,F]),I(),z(),k(),O(),M();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([m,w,F]),I(),z(),k(),O(),M();break;default:scrl.anims.push([$cfs,h,function(){O(),M(),F()}]),I(),j(),N()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,b]),!0}),$cfs.bind(cf_e("slideTo",conf),function(t,e,s,i,o,n,r){t.stopPropagation();i=cf_sortParams([e,s,i,o,n,r],["string/number/object","number","boolean","object","string","function"]);return o=i[3],n=i[4],r=i[5],0!=(e=gn_getItemIndex(i[0],i[1],i[2],itms,$cfs))&&(is_object(o)||(o=!1),"prev"==(n="prev"!=n&&"next"!=n?opts.circular?e<=itms.total/2?"next":"prev":0==itms.first||itms.first>e?"next":"prev":n)&&(e=itms.total-e),$cfs.trigger(cf_e(n,conf),[o,e,r]),!0)}),$cfs.bind(cf_e("prevPage",conf),function(t,e,s){t.stopPropagation();t=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[t-1,e,"prev",s])}),$cfs.bind(cf_e("nextPage",conf),function(t,e,s){t.stopPropagation();t=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[t+1,e,"next",s])}),$cfs.bind(cf_e("slideToPage",conf),function(t,e,s,i,o){t.stopPropagation(),is_number(e)||(e=$cfs.triggerHandler(cf_e("currentPage",conf)));var n=opts.pagination.items||opts.items.visible,t=Math.ceil(itms.total/n)-1;return t<(e=e<0?t:e)&&(e=0),$cfs.triggerHandler(cf_e("slideTo",conf),[e*n,0,!0,s,i,o])}),$cfs.bind(cf_e("jumpToStart",conf),function(t,e){if(t.stopPropagation(),e=e?gn_getItemIndex(e,0,!0,itms,$cfs):0,0!=(e+=itms.first)){if(0<itms.total)for(;e>itms.total;)e-=itms.total;$cfs.prepend($cfs.children().slice(e,itms.total))}return!0}),$cfs.bind(cf_e("synchronise",conf),function(t,e){if(t.stopPropagation(),e)e=cf_getSynchArr(e);else{if(!opts.synchronise)return debug(conf,"No carousel to synchronise.");e=opts.synchronise}for(var s=$cfs.triggerHandler(cf_e("currentPosition",conf)),i=!0,o=0,n=e.length;o<n;o++)e[o][0].triggerHandler(cf_e("slideTo",conf),[s,e[o][3],!0])||(i=!1);return i}),$cfs.bind(cf_e("queue",conf),function(t,e,s){return t.stopPropagation(),is_function(e)?e.call($tt0,queu):is_array(e)?queu=e:is_undefined(e)||queu.push([e,s]),queu}),$cfs.bind(cf_e("insertItem",conf),function(t,e,s,i,o){t.stopPropagation();var n=cf_sortParams([e,s,i,o],["string/object","string/number/object","boolean","number"]);if(e=n[0],s=n[1],i=n[2],o=n[3],(is_object(e)&&!is_jquery(e)||is_string(e))&&(e=$(e)),!is_jquery(e)||0==e.length)return debug(conf,"Not a valid object.");is_undefined(s)&&(s="end"),sz_storeMargin(e,opts),sz_storeOrigCss(e);t=s,n="before";"end"==s?i?(0==itms.first?(s=itms.total-1,n="after"):(s=itms.first,itms.first+=e.length),s<0&&(s=0)):(s=itms.total-1,n="after"):s=gn_getItemIndex(s,o,i,itms,$cfs);o=$cfs.children().eq(s);return o.length?o[n](e):(debug(conf,"Correct insert-position not found! Appending item to the end."),$cfs.append(e)),"end"==t||i||s<itms.first&&(itms.first+=e.length),itms.total=$cfs.children().length,itms.first>=itms.total&&(itms.first-=itms.total),$cfs.trigger(cf_e("updateSizes",conf)),$cfs.trigger(cf_e("linkAnchors",conf)),!0}),$cfs.bind(cf_e("removeItem",conf),function(t,e,i,o){t.stopPropagation();t=cf_sortParams([e,i,o],["string/number/object","boolean","number"]);e=t[0],i=t[1],o=t[2];var n;return e instanceof $&&1<e.length?(n=$(),e.each(function(t,e){var s=$cfs.trigger(cf_e("removeItem",conf),[$(this),i,o]);s&&(n=n.add(s))})):(is_undefined(e)||"end"==e?n=$cfs.children().last():(e=gn_getItemIndex(e,o,i,itms,$cfs),(n=$cfs.children().eq(e)).length&&e<itms.first&&(itms.first-=n.length)),n&&n.length&&(n.detach(),itms.total=$cfs.children().length,$cfs.trigger(cf_e("updateSizes",conf)))),n}),$cfs.bind(cf_e("onBefore",conf)+" "+cf_e("onAfter",conf),function(t,e){t.stopPropagation();t=t.type.slice(conf.events.prefix.length);return is_array(e)&&(clbk[t]=e),is_function(e)&&clbk[t].push(e),clbk[t]}),$cfs.bind(cf_e("currentPosition",conf),function(t,e){return t.stopPropagation(),t=0==itms.first?0:itms.total-itms.first,is_function(e)&&e.call($tt0,t),t}),$cfs.bind(cf_e("currentPage",conf),function(t,e){t.stopPropagation();var s=opts.pagination.items||opts.items.visible,t=Math.ceil(itms.total/s-1),s=0==itms.first||itms.first<itms.total%s?0:itms.first!=s||opts.circular?Math.round((itms.total-itms.first)/s):t;return t<(s=s<0?0:s)&&(s=t),is_function(e)&&e.call($tt0,s),s}),$cfs.bind(cf_e("currentVisible",conf),function(t,e){t.stopPropagation();t=gi_getCurrentItems($cfs.children(),opts);return is_function(e)&&e.call($tt0,t),t}),$cfs.bind(cf_e("slice",conf),function(t,e,s,i){if(t.stopPropagation(),0==itms.total)return!1;t=cf_sortParams([e,s,i],["number","number","function"]);if(e=is_number(t[0])?t[0]:0,s=is_number(t[1])?t[1]:itms.total,i=t[2],e+=itms.first,s+=itms.first,0<items.total){for(;e>itms.total;)e-=itms.total;for(;s>itms.total;)s-=itms.total;for(;e<0;)e+=itms.total;for(;s<0;)s+=itms.total}t=$cfs.children(),t=e<s?t.slice(e,s):$(t.slice(e,itms.total).get().concat(t.slice(0,s).get()));return is_function(i)&&i.call($tt0,t),t}),$cfs.bind(cf_e("isPaused",conf)+" "+cf_e("isStopped",conf)+" "+cf_e("isScrolling",conf),function(t,e){t.stopPropagation();t=t.type.slice(conf.events.prefix.length),t=crsl[t];return is_function(e)&&e.call($tt0,t),t}),$cfs.bind(cf_e("configuration",conf),function(e,a,b,c){e.stopPropagation();var reInit=!1,sz;if(is_function(a))a.call($tt0,opts);else if(is_object(a))opts_orig=$.extend(!0,{},opts_orig,a),!1!==b?reInit=!0:opts=$.extend(!0,{},opts,a);else if(!is_undefined(a))if(is_function(b)){var val=eval("opts."+a);is_undefined(val)&&(val=""),b.call($tt0,val)}else{if(is_undefined(b))return eval("opts."+a);"boolean"!=typeof c&&(c=!0),eval("opts_orig."+a+" = b"),!1!==c?reInit=!0:eval("opts."+a+" = b")}return reInit&&(sz_resetMargin($cfs.children(),opts),FN._init(opts_orig),FN._bind_buttons(),sz=sz_setSizes($cfs,opts),$cfs.trigger(cf_e("updatePageStatus",conf),[!0,sz])),opts}),$cfs.bind(cf_e("linkAnchors",conf),function(t,e,s){return t.stopPropagation(),is_undefined(e)?e=$("body"):is_string(e)&&(e=$(e)),is_jquery(e)&&0!=e.length?(is_string(s)||(s="a.caroufredsel"),e.find(s).each(function(){var e=this.hash||"";0<e.length&&-1!=$cfs.children().index($(e))&&$(this).unbind("click").click(function(t){t.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),e)})}),!0):debug(conf,"Not a valid object.")}),$cfs.bind(cf_e("updatePageStatus",conf),function(t,e,s){if(t.stopPropagation(),opts.pagination.container){var i=opts.pagination.items||opts.items.visible,o=Math.ceil(itms.total/i);e&&(opts.pagination.anchorBuilder&&(opts.pagination.container.children().remove(),opts.pagination.container.each(function(){for(var t=0;t<o;t++){var e=$cfs.children().eq(gn_getItemIndex(t*i,0,!0,itms,$cfs));$(this).append(opts.pagination.anchorBuilder.call(e[0],t+1))}})),opts.pagination.container.each(function(){$(this).children().unbind(opts.pagination.event).each(function(e){$(this).bind(opts.pagination.event,function(t){t.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[e*i,-opts.pagination.deviation,!0,opts.pagination])})})}));var n=$cfs.triggerHandler(cf_e("currentPage",conf))+opts.pagination.deviation;return(n=o<=n?0:n)<0&&(n=o-1),opts.pagination.container.each(function(){$(this).children().removeClass(cf_c("selected",conf)).eq(n).addClass(cf_c("selected",conf))}),!0}}),$cfs.bind(cf_e("updateSizes",conf),function(t){var e=opts.items.visible,s=$cfs.children(),i=ms_getParentSize($wrp,opts,"width");itms.total=s.length,crsl.primarySizePercentage?(opts.maxDimension=i,opts[opts.d.width]=ms_getPercentage(i,crsl.primarySizePercentage)):opts.maxDimension=ms_getMaxDimension(opts,i),opts.responsive?(opts.items.width=opts.items.sizesConf.width,opts.items.height=opts.items.sizesConf.height,e=(opts=in_getResponsiveValues(opts,s,i)).items.visible,sz_setResponsiveSizes(opts,s)):opts.items.visibleConf.variable?e=gn_getVisibleItemsNext(s,opts,0):"*"!=opts.items.filter&&(e=gn_getVisibleItemsNextFilter(s,opts,0)),!opts.circular&&0!=itms.first&&e>itms.first&&(i=opts.items.visibleConf.variable?gn_getVisibleItemsPrev(s,opts,itms.first)-itms.first:"*"!=opts.items.filter?gn_getVisibleItemsPrevFilter(s,opts,itms.first)-itms.first:opts.items.visible-itms.first,debug(conf,"Preventing non-circular: sliding "+i+" items backward."),$cfs.trigger(cf_e("prev",conf),i)),opts.items.visible=cf_getItemsAdjust(e,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts=in_getAlignPadding(opts,s);s=sz_setSizes($cfs,opts);return $cfs.trigger(cf_e("updatePageStatus",conf),[!0,s]),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),s}),$cfs.bind(cf_e("destroy",conf),function(t,e){return t.stopPropagation(),tmrs=sc_clearTimers(tmrs),$cfs.data("_cfs_isCarousel",!1),$cfs.trigger(cf_e("finish",conf)),e&&$cfs.trigger(cf_e("jumpToStart",conf)),sz_restoreOrigCss($cfs.children()),sz_restoreOrigCss($cfs),FN._unbind_events(),FN._unbind_buttons(),"parent"==conf.wrapper?sz_restoreOrigCss($wrp):$wrp.replaceWith($cfs),!0}),$cfs.bind(cf_e("debug",conf),function(t){return debug(conf,"Carousel width: "+opts.width),debug(conf,"Carousel height: "+opts.height),debug(conf,"Item widths: "+opts.items.width),debug(conf,"Item heights: "+opts.items.height),debug(conf,"Number of items visible: "+opts.items.visible),opts.auto.play&&debug(conf,"Number of items scrolled automatically: "+opts.auto.items),opts.prev.button&&debug(conf,"Number of items scrolled backward: "+opts.prev.items),opts.next.button&&debug(conf,"Number of items scrolled forward: "+opts.next.items),conf.debug}),$cfs.bind("_cfs_triggerEvent",function(t,e,s){return t.stopPropagation(),$cfs.triggerHandler(cf_e(e,conf),s)})},_unbind_events:function(){$cfs.unbind(cf_e("",conf)),$cfs.unbind(cf_e("",conf,!1)),$cfs.unbind("_cfs_triggerEvent")},_bind_buttons:function(){var t,s,i,o,n,r,c;if(FN._unbind_buttons(),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),opts.auto.pauseOnHover&&(t=bt_pauseOnHoverConfig(opts.auto.pauseOnHover),$wrp.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})),opts.auto.button&&opts.auto.button.bind(cf_e(opts.auto.event,conf,!1),function(t){t.preventDefault();var e=!1,t=null;crsl.isPaused?e="play":opts.auto.pauseOnEvent&&(e="pause",t=bt_pauseOnHoverConfig(opts.auto.pauseOnEvent)),e&&$cfs.trigger(cf_e(e,conf),t)}),opts.prev.button&&(opts.prev.button.bind(cf_e(opts.prev.event,conf,!1),function(t){t.preventDefault(),$cfs.trigger(cf_e("prev",conf))}),opts.prev.pauseOnHover&&(t=bt_pauseOnHoverConfig(opts.prev.pauseOnHover),opts.prev.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))}))),opts.next.button&&(opts.next.button.bind(cf_e(opts.next.event,conf,!1),function(t){t.preventDefault(),$cfs.trigger(cf_e("next",conf))}),opts.next.pauseOnHover&&(t=bt_pauseOnHoverConfig(opts.next.pauseOnHover),opts.next.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))}))),opts.pagination.container&&opts.pagination.pauseOnHover&&(t=bt_pauseOnHoverConfig(opts.pagination.pauseOnHover),opts.pagination.container.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),t)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})),(opts.prev.key||opts.next.key)&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(t){var e=t.keyCode;e==opts.next.key&&(t.preventDefault(),$cfs.trigger(cf_e("next",conf))),e==opts.prev.key&&(t.preventDefault(),$cfs.trigger(cf_e("prev",conf)))}),opts.pagination.keys&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(t){var e=t.keyCode;49<=e&&e<58&&(e=(e-49)*opts.items.visible)<=itms.total&&(t.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[e,0,!0,opts.pagination]))}),$.fn.swipe){var e="ontouchstart"in window;if(e&&opts.swipe.onTouch||!e&&opts.swipe.onMouse){var a=$.extend(!0,{},opts.prev,opts.swipe),f=$.extend(!0,{},opts.next,opts.swipe),l=function(){$cfs.trigger(cf_e("prev",conf),[a])},u=function(){$cfs.trigger(cf_e("next",conf),[f])};switch(opts.direction){case"up":case"down":opts.swipe.options.swipeUp=u,opts.swipe.options.swipeDown=l;break;default:opts.swipe.options.swipeLeft=u,opts.swipe.options.swipeRight=l}crsl.swipe&&$cfs.swipe("destroy"),$wrp.swipe(opts.swipe.options),$wrp.css("cursor","move"),crsl.swipe=!0}}$.fn.mousewheel&&opts.mousewheel&&(s=$.extend(!0,{},opts.prev,opts.mousewheel),i=$.extend(!0,{},opts.next,opts.mousewheel),crsl.mousewheel&&$wrp.unbind(cf_e("mousewheel",conf,!1)),$wrp.bind(cf_e("mousewheel",conf,!1),function(t,e){t.preventDefault(),0<e?$cfs.trigger(cf_e("prev",conf),[s]):$cfs.trigger(cf_e("next",conf),[i])}),crsl.mousewheel=!0),opts.auto.play&&$cfs.trigger(cf_e("play",conf),opts.auto.delay),crsl.upDateOnWindowResize&&(o=function(t){$cfs.trigger(cf_e("finish",conf)),opts.auto.pauseOnResize&&!crsl.isPaused&&$cfs.trigger(cf_e("play",conf)),sz_resetMargin($cfs.children(),opts),$cfs.trigger(cf_e("updateSizes",conf))},n=$(window),e=null,e=$.debounce&&"debounce"==conf.onWindowResize?$.debounce(200,o):$.throttle&&"throttle"==conf.onWindowResize?$.throttle(300,o):(c=r=0,function(){var t=n.width(),e=n.height();t==r&&e==c||(o(),r=t,c=e)}),n.bind(cf_e("resize",conf,!1,!0,!0),e))},_unbind_buttons:function(){cf_e("",conf);var t=cf_e("",conf,!1);ns3=cf_e("",conf,!1,!0,!0),$(document).unbind(ns3),$(window).unbind(ns3),$wrp.unbind(t),opts.auto.button&&opts.auto.button.unbind(t),opts.prev.button&&opts.prev.button.unbind(t),opts.next.button&&opts.next.button.unbind(t),opts.pagination.container&&(opts.pagination.container.unbind(t),opts.pagination.anchorBuilder&&opts.pagination.container.children().remove()),crsl.swipe&&($cfs.swipe("destroy"),$wrp.css("cursor","default"),crsl.swipe=!1),crsl.mousewheel&&(crsl.mousewheel=!1),nv_showNavi(opts,"hide",conf),nv_enableNavi(opts,"removeClass",conf)}};is_boolean(configs)&&(configs={debug:configs});var crsl={direction:"next",isPaused:!0,isScrolling:!1,isStopped:!1,mousewheel:!1,swipe:!1},itms={total:$cfs.children().length,first:0},tmrs={auto:null,progress:null,startTime:getTime(),timePassed:0},scrl={isStopped:!1,duration:0,startTime:0,easing:"",anims:[]},clbk={onBefore:[],onAfter:[]},queu=[],conf=$.extend(!0,{},$.fn.carouFredSel.configs,configs),opts={},opts_orig=$.extend(!0,{},options),$wrp=("parent"==conf.wrapper?$cfs:$cfs.wrap("<"+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />')).parent(),start_arr,start_arr;if(conf.selector=$cfs.selector,conf.serialNumber=$.fn.carouFredSel.serialNumber++,conf.transition=conf.transition&&$.fn.transition?"transition":"animate",FN._init(opts_orig,!0,starting_position),FN._build(),FN._bind_events(),FN._bind_buttons(),is_array(opts.items.start)?start_arr=opts.items.start:(start_arr=[],0!=opts.items.start&&start_arr.push(opts.items.start)),opts.cookie&&start_arr.unshift(parseInt(cf_getCookie(opts.cookie),10)),0<start_arr.length)for(var a=0,l=start_arr.length;a<l;a++){var s=start_arr[a];if(0!=s){if(!0===s){if(s=window.location.hash,s.length<1)continue}else"random"===s&&(s=Math.floor(Math.random()*itms.total));if($cfs.triggerHandler(cf_e("slideTo",conf),[s,0,!0,{fx:"none"}]))break}}var siz=sz_setSizes($cfs,opts),itm=gi_getCurrentItems($cfs.children(),opts);return opts.onCreate&&opts.onCreate.call($tt0,{width:siz.width,height:siz.height,items:itm}),$cfs.trigger(cf_e("updatePageStatus",conf),[!0,siz]),$cfs.trigger(cf_e("linkAnchors",conf)),conf.debug&&$cfs.trigger(cf_e("debug",conf)),$cfs},$.fn.carouFredSel.serialNumber=1,$.fn.carouFredSel.defaults={synchronise:!1,infinite:!0,circular:!0,responsive:!0,direction:"left",items:{start:0},scroll:{easing:"swing",duration:500,pauseOnHover:!1,event:"click",queue:!1}},$.fn.carouFredSel.configs={padding:"5px",debug:!1,transition:!1,onWindowResize:"throttle",events:{prefix:"",namespace:"cfs"},wrapper:{element:"div",classname:"caroufredsel_wrapper"},classnames:{}},$.fn.carouFredSel.pageAnchorBuilder=function(t){return'<a href="#"><span>'+t+"</span></a>"},$.fn.carouFredSel.progressbarUpdater=function(t){$(this).css("width",t+"%")},$.fn.carouFredSel.cookie={get:function(t){t+="=";for(var e=document.cookie.split(";"),s=0,i=e.length;s<i;s++){for(var o=e[s];" "==o.charAt(0);)o=o.slice(1);if(0==o.indexOf(t))return o.slice(t.length)}return 0},set:function(t,e,s){var i,o="";s&&((i=new Date).setTime(i.getTime()+24*s*60*60*1e3),o="; expires="+i.toGMTString()),document.cookie=t+"="+e+o+"; path=/"},remove:function(t){$.fn.carouFredSel.cookie.set(t,"",-1)}},$.extend($.easing,{quadratic:function(t){var e=t*t;return t*(-e*t+4*e-6*t+4)},cubic:function(t){return t*(4*t*t-9*t+6)},elastic:function(t){var e=t*t;return t*(33*e*e-106*e*t+126*e-67*t+15)}}))}(jQuery);
assets/js/yith_magnifier.js CHANGED
@@ -1,853 +1,1041 @@
1
- /**
2
- * YITH Magnifier
3
- *
4
- * @version 0.1
5
- * @author Your Inspiration Themes Team <info@yithemes.com>
6
- *
7
- * MIT License.
8
- */
9
-
10
- ;
11
- (function (window, $, undefined) {
12
- 'use strict';
13
-
14
- //include imagesLoaded plugin
15
- if ($.fn.imagesLoaded === undefined) {
16
- /*!
17
- * jQuery imagesLoaded plugin v2.1.1
18
- * http://github.com/desandro/imagesloaded
19
- *
20
- * MIT License. by Paul Irish et al.
21
- */
22
-
23
- /*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
24
- /*global jQuery: false */
25
-
26
- ;
27
- (function ($, undefined) {
28
- 'use strict';
29
-
30
- // blank image data-uri bypasses webkit log warning (thx doug jones)
31
- var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
32
-
33
- $.fn.imagesLoaded = function (callback) {
34
- var $this = this,
35
- deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
36
- hasNotify = $.isFunction(deferred.notify),
37
- $images = $this.find('img').add($this.filter('img')),
38
- loaded = [],
39
- proper = [],
40
- broken = [];
41
-
42
- // Register deferred callbacks
43
- if ($.isPlainObject(callback)) {
44
- $.each(callback, function (key, value) {
45
- if (key === 'callback') {
46
- callback = value;
47
- } else if (deferred) {
48
- deferred[key](value);
49
- }
50
- });
51
- }
52
-
53
- function doneLoading() {
54
- var $proper = $(proper),
55
- $broken = $(broken);
56
-
57
- if (deferred) {
58
- if (broken.length) {
59
- deferred.reject($images, $proper, $broken);
60
- } else {
61
- deferred.resolve($images);
62
- }
63
- }
64
-
65
- if ($.isFunction(callback)) {
66
- callback.call($this, $images, $proper, $broken);
67
- }
68
- }
69
-
70
- function imgLoadedHandler(event) {
71
- imgLoaded(event.target, event.type === 'error');
72
- }
73
-
74
- function imgLoaded(img, isBroken) {
75
- // don't proceed if BLANK image, or image is already loaded
76
- if (img.src === BLANK || $.inArray(img, loaded) !== -1) {
77
- return;
78
- }
79
-
80
- // store element in loaded images array
81
- loaded.push(img);
82
-
83
- // keep track of broken and properly loaded images
84
- if (isBroken) {
85
- broken.push(img);
86
- } else {
87
- proper.push(img);
88
- }
89
-
90
- // cache image and its state for future calls
91
- $.data(img, 'imagesLoaded', {isBroken: isBroken, src: img.src});
92
-
93
- // trigger deferred progress method if present
94
- if (hasNotify) {
95
- deferred.notifyWith($(img), [isBroken, $images, $(proper), $(broken)]);
96
- }
97
-
98
- // call doneLoading and clean listeners if all images are loaded
99
- if ($images.length === loaded.length) {
100
- setTimeout(doneLoading);
101
- $images.unbind('.imagesLoaded', imgLoadedHandler);
102
- }
103
- }
104
-
105
- // if no images, trigger immediately
106
- if (!$images.length) {
107
- doneLoading();
108
- } else {
109
- $images.bind('load.imagesLoaded error.imagesLoaded', imgLoadedHandler)
110
- .each(function (i, el) {
111
- var src = el.src;
112
-
113
- // find out if this image has been already checked for status
114
- // if it was, and src has not changed, call imgLoaded on it
115
- var cached = $.data(el, 'imagesLoaded');
116
- if (cached && cached.src === src) {
117
- imgLoaded(el, cached.isBroken);
118
- return;
119
- }
120
-
121
- // if complete is true and browser supports natural sizes, try
122
- // to check for image status manually
123
- if (el.complete && el.naturalWidth !== undefined) {
124
- imgLoaded(el, el.naturalWidth === 0 || el.naturalHeight === 0);
125
- return;
126
- }
127
-
128
- // cached images don't fire load sometimes, so we reset src, but only when
129
- // dealing with IE, or image is complete (loaded) and failed manual check
130
- // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
131
- if (el.readyState || el.complete) {
132
- el.src = BLANK;
133
- el.src = src;
134
- }
135
- });
136
- }
137
-
138
- return deferred ? deferred.promise($this) : $this;
139
- };
140
-
141
- })(jQuery);
142
- }
143
-
144
- $.yith_magnifier = function (options, element) {
145
- this.t = element;
146
- this.element = $(element);
147
- this._init(options);
148
- };
149
-
150
- $.yith_magnifier.defaults = {
151
- zoomWidth: 'auto',
152
- zoomHeight: 'auto',
153
- position: 'right',
154
- tint: false,
155
- tintOpacity: 0.5,
156
- lensOpacity: 0.5,
157
- softFocus: false,
158
- smoothMove: 3,
159
- showTitle: true,
160
- titleOpacity: 0.5,
161
- adjustX: 0,
162
- adjustY: 0,
163
-
164
- phoneBehavior: 'inside', //allowed values: inside, disable, default
165
- loadingLabel: 'Loading...',
166
-
167
- enableSlider: true,
168
- slider: 'carouFredSel',
169
- sliderOptions: {},
170
-
171
- from_gallery : 'no',
172
-
173
- onLoad: function () {
174
- return false;
175
- },
176
- onEnter: function () {
177
- return false
178
- },
179
- onLeave: function () {
180
- return false
181
- },
182
- onMove: function () {
183
- return false
184
- },
185
- onClick: function () {
186
- return false;
187
- },
188
-
189
- elements: {
190
- zoom: $('.yith_magnifier_zoom'),
191
- zoomImage: $('.yith_magnifier_zoom img').first(),
192
- gallery: $('.yith_magnifier_gallery li a')
193
- }
194
- };
195
-
196
- $.yith_magnifier.prototype = {
197
- /**
198
- * Let's start the magnifier
199
- *
200
- * @param {Object} options
201
- *
202
- * @private
203
- */
204
- _init: function (options) {
205
- var self = this;
206
-
207
- $(document).trigger('yith_magnifier_before_init');
208
-
209
- $.each($.yith_magnifier.defaults.elements, function (i, v) {
210
- var el = $.yith_magnifier.defaults.elements;
211
- el[i] = $(v, self);
212
- });
213
- self.options = $.extend(true, {}, $.yith_magnifier.defaults, options);
214
- self.isPhone = self._isPhone();
215
-
216
- self._loading();
217
-
218
- self.element.imagesLoaded(function () {
219
- self.options.onLoad();
220
- self._initZoom();
221
- self._initGallery();
222
- });
223
-
224
- $(document).trigger('yith_magnifier_after_init');
225
- },
226
-
227
-
228
- /**
229
- * Init gallery handlers
230
- *
231
- * @private
232
- *
233
- */
234
- _initGallery: function () {
235
- var self = this;
236
- var elements = self.options.elements;
237
-
238
- var gallery = elements.gallery;
239
- var zoom = elements.zoom;
240
- var zoomImage = elements.zoomImage;
241
-
242
- if (gallery.length > 0) {
243
- gallery.on('click', function (e) {
244
- e.preventDefault();
245
-
246
- self.options.from_gallery = 'yes';
247
-
248
- var t = $(this);
249
- self.destroy();
250
-
251
- zoom.attr('href', this.href);
252
- zoomImage.attr('src', t.data('small'))
253
- .attr('srcset', t.data('small'))
254
- .attr('src-orig', t.data('small'))
255
- .attr('title', '')
256
- .attr('title', t.attr('title'));
257
-
258
- $.data(self.t, 'yith_magnifier', new $.yith_magnifier(self.options, self.element));
259
- });
260
-
261
- //gallery.filter(':first').trigger('click');
262
-
263
- if (self.options.enableSlider) {
264
- gallery.closest('ul').trigger('yith_magnifier_slider_destroy');
265
- gallery.closest('ul')[self.options.slider](self.options.sliderOptions);
266
- }
267
-
268
- } else {
269
- gallery.on('click', function (e) {
270
- e.preventDefault();
271
- return false;
272
- })
273
- }
274
- },
275
-
276
- /**
277
- * Show a loading icon while image isn't properly loaded
278
- *
279
- * @private
280
- */
281
- _loading: function () {
282
- if (this.options.disableRightClick) {
283
- $(document).on('contextmenu', function (e) {
284
- return false;
285
- });
286
- }
287
-
288
- if (this.mouseTrap === undefined) {
289
- var w = this.options.elements.zoom.width();
290
-
291
- if (this.options.loadingLabel) {
292
- $('<div class="yith_magnifier_loading">' + this.options.loadingLabel + '</div>').css({
293
- 'width': w,
294
- 'text-align': 'center',
295
- opacity: .5
296
- }).appendTo(this.options.elements.zoom.parent());
297
- }
298
- }
299
- },
300
-
301
- /**
302
- * Initialize the zoom images
303
- *
304
- * @private
305
- */
306
- _initZoom: function () {
307
- var self = this;
308
-
309
- self.zoom = self.options.elements.zoom;
310
- self.zoomImage = self.options.elements.zoomImage;
311
-
312
- //wrap the zoom image with a div
313
- var zoom_wrap_css_class = "yith_magnifier_zoom_wrap";
314
-
315
-
316
- if (self.options.zoom_wrap_additional_css) {
317
- if ( !$('.' + zoom_wrap_css_class).length ) {
318
-
319
- zoom_wrap_css_class += " " + self.options.zoom_wrap_additional_css;
320
- }
321
- }
322
-
323
- self.zoom.wrap('<div class="' + zoom_wrap_css_class + '"></div>');
324
-
325
- self.IMG_zoomImage = new Image();
326
-
327
- var product_id = $( '.woocommerce-variation-add-to-cart .variation_id' ).val();
328
- if ( $.isNumeric( product_id ) && product_id != 0 && self.options.from_gallery == 'no' ){
329
-
330
- var data = {
331
- action : 'yith_wc_zoom_magnifier_get_main_image',
332
- product_id : product_id,
333
- context : 'frontend'
334
- }
335
-
336
- $.ajax({
337
- data : data,
338
- url : yith_wc_zoom_magnifier_storage_object.ajax_url,
339
- type : 'post',
340
- error : function ( response ) {
341
- console.log( 'ERROR - Yith_WC_Zoom_Magnifier' );
342
- console.log( response );
343
- },
344
- success : function ( response ) {
345
- self.IMG_zoomImage.src = response.url;
346
-
347
- self.IMG_smallImage = new Image();
348
- self.IMG_smallImage.src = self.zoomImage.attr('src');
349
-
350
- // set new gallery
351
- if( response.gallery ) {
352
-
353
- if ($('.yith_magnifier_gallery').length)
354
- $('.yith_magnifier_gallery').closest('.thumbnails').replaceWith( response.gallery );
355
- else
356
- $( '.images').append( response.gallery );
357
-
358
- self.options.elements.gallery = $('.yith_magnifier_gallery li a' );
359
- }
360
-
361
- if ($.browser && $.browser.msie && $.browser.version == 8) {
362
- $(self.IMG_zoomImage).load(function () {
363
- self._initGallery();
364
- self._initTrap();
365
- });
366
- } else {
367
-
368
- $([self.IMG_zoomImage, self.IMG_smallImage]).imagesLoaded(function () {
369
- self._initGallery();
370
- self._initTrap();
371
- });
372
- }
373
-
374
- $(document).trigger('yith_magnifier_after_init_zoom');
375
-
376
- }
377
- });
378
-
379
- }
380
- else{
381
- self.IMG_zoomImage.src = self.zoom.attr('href');
382
-
383
- self.IMG_smallImage = new Image();
384
- self.IMG_smallImage.src = self.zoomImage.attr('src');
385
-
386
- if ($.browser && $.browser.msie && $.browser.version == 8) {
387
- $(self.IMG_zoomImage).load(function () {
388
-
389
- self._initTrap();
390
- });
391
- } else {
392
-
393
- $([self.IMG_zoomImage, self.IMG_smallImage]).imagesLoaded(function () {
394
-
395
- self._initTrap();
396
- });
397
- }
398
-
399
- $(document).trigger('yith_magnifier_after_init_zoom')
400
-
401
- }
402
-
403
- },
404
-
405
- /**
406
- * Create the mouse trap
407
- *
408
- * @private
409
- */
410
- _initTrap: function () {
411
- var self = this;
412
- var zoomImg = self.IMG_zoomImage,
413
- thumbImg = self.IMG_smallImage;
414
-
415
- self.mx = 0;
416
- self.my = 0;
417
- self.controlTimer = 0;
418
- self.lens = null;
419
- self.tint = null;
420
- self.softFocus = null;
421
- self.zoomDiv = null;
422
- self.cw = 0;
423
- self.ch = 0;
424
- self.zw = 0;
425
- self.destU = 0;
426
- self.destV = 0;
427
- self.currU = 0;
428
- self.currV = 0;
429
- self.mouseTrap = null;
430
-
431
- var zoom = self.options.elements.zoom;
432
- var zoomImage = self.options.elements.zoomImage;
433
-
434
- //remove loading div
435
- //this.zoom.parent().siblings('.yith_magnifier_loading').remove();
436
- $('.yith_magnifier_loading').remove();
437
-
438
- if (this.element.find('.yith_magnifier_mousetrap')) {
439
- this.element.find('.yith_magnifier_mousetrap').remove();
440
- }
441
-
442
- this.mouseTrap = $('<div class="yith_magnifier_mousetrap" />').css({
443
- width: '100%', //zoomImage.outerWidth(),
444
- height: '100%', //zoomImage.outerHeight(),
445
- top: 0,
446
- left: 0
447
- }).appendTo(zoom.parent());
448
-
449
- // Detect device type, normal mouse or touchy(ipad android) by albanx
450
- var touchy = ("ontouchstart" in document.documentElement) ? true : false;
451
- var event_move = 'touchmove mousemove';
452
- var event_end = 'touchend mouseleave';
453
- var event_ent = 'touchstart mouseenter';
454
- var event_click = 'touchstart click';
455
-
456
- this.mouseTrap.on(event_move, this, function (e) {
457
- self.options.onMove();
458
-
459
- self.mx = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
460
- self.my = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
461
-
462
- }).on(event_end, this, function (e) {
463
-
464
- clearTimeout(self.controlTimer);
465
- //event.data.removeBits();
466
- if (self.lens) {
467
- self.lens.fadeOut(299);
468
- }
469
- if (self.tint) {
470
- self.tint.fadeOut(299);
471
- }
472
- if (self.softFocus) {
473
- self.softFocus.fadeOut(299);
474
- }
475
- self.zoomDiv.fadeOut(300, function () {
476
- self._onLeave();
477
- });
478
-
479
- return false;
480
-
481
- }).on(event_click, this, function (e) {
482
- self.options.onClick();
483
- }).on(event_ent, this, function (e) {
484
- self.options.onEnter();
485
-
486
- if (touchy) {
487
- e.preventDefault();
488
- }
489
-
490
- self.mx = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
491
- self.my = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
492
-
493
- self.zw = e.data;
494
- if (self.zoomDiv) {
495
- self.zoomDiv.stop(true, false);
496
- self.zoomDiv.remove();
497
- }
498
-
499
- var xPos = self.options.adjustX,
500
- yPos = self.options.adjustY;
501
-
502
- var siw = zoomImage.outerWidth();
503
- var sih = zoomImage.outerHeight();
504
-
505
- var w = self.options.zoomWidth;
506
- var h = self.options.zoomHeight;
507
-
508
- if (self.options.zoomWidth == 'auto') {
509
- w = siw;
510
- }
511
-
512
- if (self.options.zoomHeight == 'auto') {
513
- h = sih;
514
- }
515
-
516
- var appendTo = zoom.parent();
517
- switch (self.options.position) {
518
- case 'top':
519
- yPos -= h;
520
- break;
521
- case 'right':
522
- xPos += siw;
523
- break;
524
- case 'bottom':
525
- yPos += sih;
526
- break;
527
- case 'left':
528
- xPos -= w;
529
- break;
530
- case 'inside':
531
- w = siw;
532
- h = sih;
533
- break;
534
-
535
- // All other values, try and find an id in the dom to attach to.
536
- default:
537
- appendTo = $('#' + self.options.position);
538
- // If dom element doesn't exit, just use 'right' position as default.
539
- if (!appendTo.length) {
540
- appendTo = zoom;
541
- xPos += siw; //+ opts.adjustX;
542
- yPos += sih; // + opts.adjustY;
543
- } else {
544
- w = appendTo.innerWidth();
545
- h = appendTo.innerHeight();
546
- }
547
- }
548
-
549
- if (self.isPhone && self.options.phoneBehavior == 'inside') {
550
- w = siw;
551
- h = sih;
552
- xPos = 0;
553
- yPos = 0;
554
- }
555
-
556
- self.zoomDiv = $('<div class="yith_magnifier_zoom_magnifier" />').css({
557
- left: xPos,
558
- top: yPos,
559
- width: w,
560
- height: h,
561
- 'background-repeat': 'no-repeat',
562
- backgroundImage: 'url(' + zoomImg.src + ')'
563
- }).appendTo(appendTo);
564
-
565
- // Add the title from title tag.
566
- if (zoomImage.attr('title') && self.options.showTitle) {
567
- $('<div class="yith_magnifier_title">' + zoomImage.attr('title') + '</div>').appendTo(self.zoomDiv);
568
- }
569
-
570
- if (self.isPhone) {
571
- if (self.options.phoneBehavior != 'disable') {
572
- self.zoomDiv.fadeIn(500);
573
- } else {
574
- self.lens.fadeOut(299);
575
- }
576
- } else {
577
- self.zoomDiv.fadeIn(500);
578
- }
579
-
580
- if (self.lens) {
581
- self.lens.remove();
582
- self.lens = null;
583
- }
584
-
585
- if (zoomImg.width <= 1) {
586
- self.cw = (zoomImage.outerWidth() / zoomImg.naturalWidth) * self.zoomDiv.width();
587
- } else {
588
- self.cw = (zoomImage.outerWidth() / zoomImg.width) * self.zoomDiv.width();
589
- }
590
-
591
- if (zoomImg.height <= 1) {
592
- self.ch = (zoomImage.outerHeight() / zoomImg.naturalHeight) * self.zoomDiv.height();
593
- } else {
594
- self.ch = (zoomImage.outerHeight() / zoomImg.height) * self.zoomDiv.height();
595
- }
596
-
597
- // Attach mouse, initially invisible to prevent first frame glitch
598
- self.lens = $('<div class="yith_magnifier_lens" />').css({
599
- width: self.cw,
600
- height: self.ch
601
- }).appendTo(zoom);
602
-
603
- self.mouseTrap.css('cursor', self.lens.css('cursor'));
604
-
605
- var noTrans = false;
606
-
607
-
608
- // Init tint layer if needed. (Not relevant if using inside mode)
609
- if (self.options.tint) {
610
- //self.lens.css('background', 'url("' + zoomImage.attr('src') + '")');
611
- self.tint = $('<div />').css({
612
- display: 'none',
613
- position: 'absolute',
614
- left: 0,
615
- top: 0,
616
- width: zoomImage.outerWidth(),
617
- height: zoomImage.outerHeight(),
618
- backgroundColor: self.options.tint,
619
- opacity: self.options.tintOpacity
620
- }).appendTo(zoom);
621
-
622
-
623
- self.lens.append($('<img />', {
624
- src: zoomImage.attr('src')
625
- }));
626
-
627
- noTrans = true;
628
- self.tint.fadeIn(500);
629
- }
630
-
631
- if (self.options.softFocus) {
632
- //self.lens.css('background', 'url("' + zoomImage.attr('src') + '")');
633
- self.softFocus = $('<div />').css({
634
- position: 'absolute',
635
- display: 'none',
636
- top: '1px',
637
- left: '1px',
638
- width: zoomImage.outerWidth(),
639
- height: zoomImage.outerHeight(),
640
- //background: 'url("' + zoomImage.attr('src') + '")',
641
- //backgroundSize: '100%',
642
- opacity: .5
643
- }).appendTo(zoom);
644
-
645
- self.softFocus.append($('<img />', {
646
- src: zoomImage.attr('src')
647
- }));
648
-
649
- if (self.lens.find('img').length == 0) {
650
- self.lens.append($('<img />', {
651
- src: zoomImage.attr('src')
652
- }));
653
- }
654
-
655
- noTrans = true;
656
- self.softFocus.fadeIn(500);
657
- }
658
-
659
-
660
- if (!noTrans) {
661
- self.lens.css('opacity', self.options.lensOpacity);
662
- }
663
- if (self.options.position !== 'inside') {
664
- self.lens.fadeIn(500);
665
- }
666
-
667
- // Start processing.
668
- self.zw._controlLoop();
669
-
670
- return; // Don't return false here otherwise opera will not detect change of the mouse pointer type.
671
- });
672
- },
673
-
674
- /**
675
- *
676
- *
677
- * @private
678
- */
679
- _controlLoop: function () {
680
- var self = this;
681
-
682
- if (this.lens) {
683
- var x = (this.mx - this.zoomImage.offset().left - (this.cw * 0.5)) >> 0;
684
- var y = (this.my - this.zoomImage.offset().top - (this.ch * 0.5)) >> 0;
685
-
686
- if (x < 0) {
687
- x = 0;
688
- } else if (x > (this.zoomImage.outerWidth() - this.cw)) {
689
- x = (this.zoomImage.outerWidth() - this.cw);
690
- }
691
-
692
- if (y < 0) {
693
- y = 0;
694
- } else if (y > (this.zoomImage.outerHeight() - this.ch)) {
695
- y = (this.zoomImage.outerHeight() - this.ch);
696
- }
697
-
698
- this.lens.css({
699
- left: x - 2,
700
- top: y - 1
701
- });
702
-
703
- //this.lens.css('background-position', (-x) + 'px ' + (-y) + 'px');
704
-
705
-
706
- this.lens.find('img').css({
707
- width: this.zoomImage.outerWidth(),
708
- height: this.zoomImage.outerHeight(),
709
- marginLeft: (-x) + 'px ',
710
- marginTop: (-y) + 'px'
711
- });
712
-
713
-
714
- if (this.IMG_zoomImage.width <= 1) {
715
- this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.naturalWidth) >> 0;
716
- } else {
717
- this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.width) >> 0;
718
- }
719
-
720
- if (this.IMG_zoomImage.height <= 1) {
721
- this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.naturalHeight) >> 0;
722
- } else {
723
- this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.height) >> 0;
724
- }
725
-
726
-
727
- this.currU += (this.destU - this.currU) / this.options.smoothMove;
728
- this.currV += (this.destV - this.currV) / this.options.smoothMove;
729
-
730
- this.zoomDiv.css('background-position', (-(this.currU >> 0) + 'px ') + (-(this.currV >> 0) + 'px'));
731
- }
732
-
733
- this.controlTimer = setTimeout(function () {
734
- self._controlLoop();
735
- }, 30);
736
- },
737
-
738
- /**
739
- * This method is called when the mouse leave the image
740
- *
741
- * @private
742
- */
743
- _onLeave: function () {
744
- this.options.onLeave();
745
-
746
- if (this.zoomDiv) {
747
- this.zoomDiv.remove();
748
- this.zoomDiv = null;
749
- }
750
-
751
- this._removeElements();
752
- },
753
-
754
- /**
755
- * Remove lens, tint and softfocus
756
- *
757
- * @private
758
- */
759
- _removeElements: function () {
760
- if (this.lens) {
761
- this.lens.remove();
762
- this.lens = null;
763
- }
764
-
765
- if (this.tint) {
766
- this.tint.remove();
767
- this.tint = null;
768
- }
769
-
770
- if (this.softFocus) {
771
- this.softFocus.remove();
772
- this.softFocus = null;
773
- }
774
-
775
- if (this.element.find('.yith_magnifier_loading').length > 0) {
776
- this.element.find('.yith_magnifier_loading').remove();
777
- }
778
- },
779
-
780
- /**
781
- * Detect if user is using a phone device (eg iPhone)
782
- *
783
- * @private
784
- */
785
- _isPhone: function () {
786
- var userAgent = navigator.userAgent.toLowerCase();
787
-
788
- return ( userAgent.match(/iphone/i) || userAgent.match(/ipod/i) || userAgent.match(/android/i) );
789
- },
790
-
791
- /**
792
- * Destroy the instance
793
- *
794
- */
795
- destroy: function () {
796
- if (this.zoom) {
797
- this.zoom.unwrap();
798
- }
799
-
800
- if (this.mouseTrap) {
801
- this.mouseTrap.unbind();
802
- this.mouseTrap.remove();
803
- this.mouseTrap = null;
804
- }
805
-
806
- if (this.zoomDiv) {
807
- this.zoomDiv.remove();
808
- this.zoomDiv = null;
809
- }
810
-
811
- if (this.options.disableRightClick) {
812
- $(document).unbind();
813
- }
814
-
815
- this._removeElements();
816
- this.options.elements.gallery.unbind();
817
- this.element.removeData('yith_magnifier');
818
- }
819
- };
820
-
821
- $.fn.yith_magnifier = function (options) {
822
-
823
- if (typeof options === 'string') {
824
- var args = Array.prototype.slice.call(arguments, 1);
825
-
826
- this.each(function () {
827
- var instance = $.data(this, 'yith_magnifier');
828
- if (!instance) {
829
- $.error("cannot call methods on yith_magnifier prior to initialization; " +
830
- "attempted to call method '" + options + "'");
831
- return;
832
- }
833
- if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
834
- $.error("no such method '" + options + "' for yith_magnifier instance");
835
- return;
836
- }
837
- instance[options].apply(instance, args);
838
- });
839
- } else {
840
- this.each(function () {
841
- var instance = $.data(this, 'yith_magnifier');
842
- if (!instance) {
843
- $.data(this, 'yith_magnifier', new $.yith_magnifier(options, this));
844
- } else {
845
- $.error('yith_magnifier already istantiated.');
846
- }
847
- });
848
- }
849
- return this;
850
- };
851
-
852
-
853
- })(window, jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * YITH Magnifier
3
+ *
4
+ * @version 0.1
5
+ * @author YITH
6
+ * @package YITH\ZoomMagnifier\Assets\JS
7
+ *
8
+ * MIT License.
9
+ */
10
+
11
+ (function (window, $, undefined) {
12
+ 'use strict';
13
+
14
+ // include imagesLoaded plugin.
15
+ if ($.fn.imagesLoaded === undefined) {
16
+ /*!
17
+ * jQuery imagesLoaded plugin v2.1.1
18
+ * http://github.com/desandro/imagesloaded
19
+ *
20
+ * MIT License. by Paul Irish et al.
21
+ */
22
+
23
+ /*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
24
+ /*global jQuery: false */
25
+
26
+ ;
27
+ (function ($, undefined) {
28
+ 'use strict';
29
+
30
+ // blank image data-uri bypasses webkit log warning (thx doug jones).
31
+ var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
32
+
33
+ $.fn.imagesLoaded = function (callback) {
34
+ var $this = this,
35
+ deferred = $.isFunction( $.Deferred ) ? $.Deferred() : 0,
36
+ hasNotify = $.isFunction( deferred.notify ),
37
+ $images = $this.find( 'img' ).add( $this.filter( 'img' ) ),
38
+ loaded = [],
39
+ proper = [],
40
+ broken = [];
41
+
42
+ // Register deferred callbacks.
43
+ if ($.isPlainObject( callback )) {
44
+ $.each(
45
+ callback,
46
+ function (key, value) {
47
+ if (key === 'callback') {
48
+ callback = value;
49
+ } else if (deferred) {
50
+ deferred[key]( value );
51
+ }
52
+ }
53
+ );
54
+ }
55
+
56
+ function doneLoading() {
57
+ var $proper = $( proper ),
58
+ $broken = $( broken );
59
+
60
+ if (deferred) {
61
+ if (broken.length) {
62
+ deferred.reject( $images, $proper, $broken );
63
+ } else {
64
+ deferred.resolve( $images );
65
+ }
66
+ }
67
+
68
+ if ($.isFunction( callback )) {
69
+ callback.call( $this, $images, $proper, $broken );
70
+ }
71
+ }
72
+
73
+ function imgLoadedHandler(event) {
74
+ imgLoaded( event.target, event.type === 'error' );
75
+ }
76
+
77
+ function imgLoaded(img, isBroken) {
78
+ // don't proceed if BLANK image, or image is already loaded.
79
+ if (img.src === BLANK || $.inArray( img, loaded ) !== -1) {
80
+ return;
81
+ }
82
+
83
+ // store element in loaded images array.
84
+ loaded.push( img );
85
+
86
+ // keep track of broken and properly loaded images.
87
+ if (isBroken) {
88
+ broken.push( img );
89
+ } else {
90
+ proper.push( img );
91
+ }
92
+
93
+ // cache image and its state for future calls.
94
+ $.data( img, 'imagesLoaded', {isBroken: isBroken, src: img.src} );
95
+
96
+ // trigger deferred progress method if present.
97
+ if (hasNotify) {
98
+ deferred.notifyWith( $( img ), [isBroken, $images, $( proper ), $( broken )] );
99
+ }
100
+
101
+ // call doneLoading and clean listeners if all images are loaded.
102
+ if ($images.length === loaded.length) {
103
+ setTimeout( doneLoading );
104
+ $images.unbind( '.imagesLoaded', imgLoadedHandler );
105
+ }
106
+ }
107
+
108
+ // if no images, trigger immediately.
109
+ if ( ! $images.length) {
110
+ doneLoading();
111
+ } else {
112
+ $images.bind( 'load.imagesLoaded error.imagesLoaded', imgLoadedHandler )
113
+ .each(
114
+ function (i, el) {
115
+ var src = el.src;
116
+
117
+ // find out if this image has been already checked for status
118
+ // if it was, and src has not changed, call imgLoaded on it.
119
+ var cached = $.data( el, 'imagesLoaded' );
120
+ if (cached && cached.src === src) {
121
+ imgLoaded( el, cached.isBroken );
122
+ return;
123
+ }
124
+
125
+ // if complete is true and browser supports natural sizes, try
126
+ // to check for image status manually.
127
+ if (el.complete && el.naturalWidth !== undefined) {
128
+ imgLoaded( el, el.naturalWidth === 0 || el.naturalHeight === 0 );
129
+ return;
130
+ }
131
+
132
+ // cached images don't fire load sometimes, so we reset src, but only when
133
+ // dealing with IE, or image is complete (loaded) and failed manual check
134
+ // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f.
135
+ if (el.readyState || el.complete) {
136
+ el.src = BLANK;
137
+ el.src = src;
138
+ }
139
+ }
140
+ );
141
+ }
142
+
143
+ return deferred ? deferred.promise( $this ) : $this;
144
+ };
145
+
146
+ })( jQuery );
147
+ }
148
+
149
+ $.yith_magnifier = function (options, element) {
150
+ this.t = element;
151
+ this.element = $( element );
152
+ this._init( options );
153
+ };
154
+
155
+ $.yith_magnifier.defaults = {
156
+ zoomWidth : 'auto',
157
+ zoomHeight : 'auto',
158
+ position : 'right',
159
+ tint : false,
160
+ tintOpacity : 0.5,
161
+ lensOpacity : 0.5,
162
+ softFocus : false,
163
+ smoothMove : 3,
164
+ showTitle : true,
165
+ titleOpacity: 0.5,
166
+ adjustX : 0,
167
+ adjustY : 0,
168
+
169
+ phoneBehavior: 'inside', // allowed values: inside, disable, default.
170
+ loadingLabel : 'Loading...',
171
+
172
+ enableSlider : true,
173
+ slider : 'carouFredSel',
174
+ sliderOptions: {},
175
+
176
+ from_gallery : 'no',
177
+
178
+ onLoad : function () {
179
+ return false;
180
+ },
181
+ onEnter: function () {
182
+ return false
183
+ },
184
+ onLeave: function () {
185
+ return false
186
+ },
187
+ onMove : function () {
188
+ return false
189
+ },
190
+ onClick: function () {
191
+ return false;
192
+ },
193
+
194
+ elements: {
195
+ zoom : $( '.yith_magnifier_zoom' ),
196
+ zoomImage: $( '.yith_magnifier_zoom img' ).first(),
197
+ gallery : $( '.yith_magnifier_gallery li a' )
198
+ }
199
+ };
200
+
201
+ $.yith_magnifier.prototype = {
202
+
203
+ /**
204
+ * Let's start the magnifier
205
+ *
206
+ * @param {Object} options
207
+ *
208
+ * @private
209
+ */
210
+ _init: function (options) {
211
+ var self = this;
212
+ $( document ).trigger( 'yith_magnifier_before_init' );
213
+
214
+ $.each(
215
+ $.yith_magnifier.defaults.elements,
216
+ function (i, v) {
217
+ var el = $.yith_magnifier.defaults.elements;
218
+ el[i] = $( v, self );
219
+ }
220
+ );
221
+ self.options = $.extend( true, {}, $.yith_magnifier.defaults, options );
222
+ self.isPhone = self._isPhone();
223
+
224
+ self._loading();
225
+
226
+ self.options.onLoad();
227
+ self._initZoom();
228
+ self._initGallery();
229
+
230
+ $( document ).trigger( 'yith_magnifier_after_init' );
231
+ },
232
+
233
+ /**
234
+ * Init gallery handlers
235
+ *
236
+ * @private
237
+ */
238
+ _initGallery: function () {
239
+
240
+ var self = this;
241
+ var elements = self.options.elements;
242
+
243
+ var gallery = elements.gallery;
244
+ var zoom = elements.zoom;
245
+ var zoomImage = elements.zoomImage;
246
+
247
+ if ( gallery.length > 0 ) {
248
+ gallery.on(
249
+ 'click',
250
+ function (e) {
251
+ e.preventDefault();
252
+ e.stopImmediatePropagation();
253
+
254
+ if ( $( '#yith_wczm_traffic_light' ).val() == 'free' ) {
255
+
256
+
257
+ $( '.yith_magnifier_gallery .yith_magnifier_thumbnail.active-thumbnail' ).removeClass( 'active-thumbnail' );
258
+ $( '.yith_magnifier_gallery .yith_magnifier_thumbnail.active-thumbnail' ).addClass( 'inactive-thumbnail' );
259
+ $( this ).removeClass( 'inactive-thumbnail' );
260
+ $( this ).addClass( 'active-thumbnail' );
261
+ $( this ).parent().removeClass( 'inactive-thumbnail' );
262
+ $( this ).parent().addClass( 'active-thumbnail' );
263
+
264
+ self.options.from_gallery = 'yes';
265
+
266
+ var t = $( this );
267
+ self.destroy();
268
+
269
+ zoom.attr( 'href', this.href );
270
+
271
+ zoomImage.attr( 'src', t.data( 'small' ) )
272
+ .attr( 'srcset', t.data( 'small' ) )
273
+ .attr( 'src-orig', t.data( 'small' ) )
274
+ .attr( 'title', '' )
275
+ .attr( 'title', t.attr( 'title' ) );
276
+ $.data( self.t, 'yith_magnifier', new $.yith_magnifier( self.options, self.element ) );
277
+
278
+ }
279
+
280
+ }
281
+ );
282
+
283
+ /* gallery.filter(':first').trigger('click'); */
284
+
285
+ if (self.options.enableSlider) {
286
+ gallery.closest( 'ul' ).trigger( 'yith_magnifier_slider_destroy' );
287
+ /* gallery.closest('ul')[self.options.slider](self.options.sliderOptions); */
288
+ }
289
+
290
+ } else {
291
+ gallery.on(
292
+ 'click',
293
+ function (e) {
294
+ e.preventDefault();
295
+ return false;
296
+ }
297
+ )
298
+ }
299
+ },
300
+
301
+ /**
302
+ * Show a loading icon while image isn't properly loaded
303
+ *
304
+ * @private
305
+ */
306
+ _loading: function () {
307
+ if (this.options.disableRightClick) {
308
+ $( document ).on(
309
+ 'contextmenu',
310
+ function (e) {
311
+ return false;
312
+ }
313
+ );
314
+ }
315
+
316
+ if (this.mouseTrap === undefined) {
317
+ var w = this.options.elements.zoom.width();
318
+
319
+ if (this.options.loadingLabel) {
320
+ $( '<div class="yith_magnifier_loading">' + this.options.loadingLabel + '</div>' ).css(
321
+ {
322
+ 'width' : w,
323
+ 'text-align': 'center',
324
+ opacity : .5
325
+ }
326
+ ).appendTo( this.options.elements.zoom.parent() );
327
+ }
328
+ }
329
+ },
330
+
331
+ /**
332
+ * Initialize the zoom images
333
+ *
334
+ * @private
335
+ */
336
+ _initZoom: function () {
337
+
338
+ if ( $( '#yith_wczm_traffic_light' ).val() == 'free' ) {
339
+
340
+ $( '#yith_wczm_traffic_light' ).val( 'blocked' );
341
+
342
+ var self = this;
343
+ self.zoom = self.options.elements.zoom;
344
+ self.zoomImage = self.options.elements.zoomImage;
345
+
346
+ var zoom_wrap_css_class = "yith_magnifier_zoom_wrap";
347
+
348
+ if (self.options.zoom_wrap_additional_css) {
349
+ if ( ! $( '.' + zoom_wrap_css_class ).length) {
350
+
351
+ zoom_wrap_css_class += " " + self.options.zoom_wrap_additional_css;
352
+ } else {
353
+ return;
354
+ }
355
+ }
356
+ self.zoom.wrap( '<div class="' + zoom_wrap_css_class + '"></div>' );
357
+
358
+ self.IMG_zoomImage = new Image();
359
+
360
+ var product_id = $( '.woocommerce-variation-add-to-cart .variation_id' ).val();
361
+
362
+ if ( $.isNumeric( product_id ) && product_id != 0 && self.options.from_gallery == 'no' ) {
363
+
364
+ var data = {
365
+ action : 'yith_wc_zoom_magnifier_get_main_image',
366
+ product_id : product_id,
367
+ context : 'frontend'
368
+ }
369
+
370
+ $.ajax(
371
+ {
372
+ data : data,
373
+ url : yith_wc_zoom_magnifier_storage_object.ajax_url,
374
+ type : 'post',
375
+ error : function ( response ) {
376
+ console.log( 'ERROR - Yith_WC_Zoom_Magnifier' );
377
+ console.log( response );
378
+ $( '#yith_wczm_traffic_light' ).val( 'free' );
379
+ },
380
+ success : function ( response ) {
381
+
382
+ self.zoom.attr( 'href', response.url );
383
+
384
+ self.IMG_zoomImage.src = response.url;
385
+
386
+ self.IMG_smallImage = new Image();
387
+ self.IMG_smallImage.src = self.zoomImage.attr( 'src' );
388
+
389
+ // set new gallery.
390
+ if ( response.gallery ) {
391
+
392
+ if ($( '.yith_magnifier_gallery' ).length) {
393
+ $( '.yith_magnifier_gallery' ).closest( '.thumbnails' ).replaceWith( response.gallery );
394
+ } else {
395
+ $( '.images' ).append( response.gallery );
396
+ }
397
+
398
+ self.options.elements.gallery = $( '.yith_magnifier_gallery li a' );
399
+ }
400
+
401
+ if ($.browser && $.browser.msie && $.browser.version == 8) {
402
+ $( self.IMG_zoomImage ).load(
403
+ function () {
404
+
405
+ self._initGallery();
406
+ self._initTrap();
407
+ }
408
+ );
409
+ } else {
410
+
411
+ $( [self.IMG_zoomImage, self.IMG_smallImage] ).imagesLoaded(
412
+ function () {
413
+
414
+ self._initGallery();
415
+ self._initTrap();
416
+ }
417
+ );
418
+ }
419
+
420
+ $( document ).on(
421
+ 'click',
422
+ 'a.yith_expand',
423
+ function (e) {
424
+
425
+ e.preventDefault();
426
+
427
+ $().prettyPhoto(
428
+ {
429
+ social_tools : false,
430
+ theme : 'pp_woocommerce',
431
+ horizontal_padding: 20,
432
+ opacity : 0.8,
433
+ deeplinking : false,
434
+ callback : function () {
435
+ $( ".yith_expand" ).css( 'display', 'inline' );
436
+ }
437
+ }
438
+ );
439
+
440
+ $.prettyPhoto.open( self.zoom[0].href, '', '' );
441
+ $( ".yith_expand" ).css( 'display', 'none' );
442
+ $( ".pp_woocommerce .ppt" ).css(
443
+ {
444
+ 'height' : 0,
445
+ 'marginBottom': 0
446
+ }
447
+ );
448
+
449
+ }
450
+ );
451
+ $( document ).trigger( 'yith_magnifier_after_init_zoom' )
452
+ $( '#yith_wczm_traffic_light' ).val( 'free' );
453
+ }
454
+ }
455
+ );
456
+
457
+ } else {
458
+
459
+ self.IMG_zoomImage.src = self.zoom.attr( 'href' );
460
+
461
+ self.IMG_smallImage = new Image();
462
+ self.IMG_smallImage.src = self.zoomImage.attr( 'src' );
463
+
464
+ if ($.browser && $.browser.msie && $.browser.version == 8) {
465
+ $( self.IMG_zoomImage ).load(
466
+ function () {
467
+
468
+ self._initTrap();
469
+ }
470
+ );
471
+ } else {
472
+
473
+ $( [self.IMG_zoomImage, self.IMG_smallImage] ).imagesLoaded(
474
+ function () {
475
+
476
+ self._initTrap();
477
+ }
478
+ );
479
+ }
480
+
481
+ $( document ).on(
482
+ 'click',
483
+ 'a.yith_expand',
484
+ function (e) {
485
+
486
+ e.preventDefault();
487
+
488
+ $().prettyPhoto(
489
+ {
490
+ social_tools : false,
491
+ theme : 'pp_woocommerce',
492
+ horizontal_padding: 20,
493
+ opacity : 0.8,
494
+ deeplinking : false,
495
+ callback : function () {
496
+ $( ".yith_expand" ).css( 'display', 'inline' );
497
+ }
498
+ }
499
+ );
500
+
501
+ $.prettyPhoto.open( self.zoom[0].href, '', '' );
502
+ $( ".yith_expand" ).css( 'display', 'none' );
503
+ $( ".pp_woocommerce .ppt" ).css(
504
+ {
505
+ 'height' : 0,
506
+ 'marginBottom': 0
507
+ }
508
+ );
509
+
510
+ }
511
+ );
512
+ $( document ).trigger( 'yith_magnifier_after_init_zoom' );
513
+
514
+ $( '#yith_wczm_traffic_light' ).val( 'free' );
515
+
516
+ }
517
+
518
+ }
519
+
520
+ },
521
+
522
+ /**
523
+ * Create the mouse trap
524
+ *
525
+ * @private
526
+ */
527
+ _initTrap: function () {
528
+
529
+ var self = this;
530
+ var zoomImg = self.IMG_zoomImage,
531
+ thumbImg = self.IMG_smallImage;
532
+
533
+ self.mx = 0;
534
+ self.my = 0;
535
+ self.controlTimer = 0;
536
+ self.lens = null;
537
+ self.tint = null;
538
+ self.softFocus = null;
539
+ self.zoomDiv = null;
540
+ self.cw = 0;
541
+ self.ch = 0;
542
+ self.zw = 0;
543
+ self.destU = 0;
544
+ self.destV = 0;
545
+ self.currU = 0;
546
+ self.currV = 0;
547
+ self.mouseTrap = null;
548
+
549
+ var zoom = self.options.elements.zoom;
550
+ var zoomImage = self.options.elements.zoomImage;
551
+
552
+ // remove loading div.
553
+ /* this.zoom.parent().siblings('.yith_magnifier_loading').remove(); */
554
+ $( '.yith_magnifier_loading' ).remove();
555
+
556
+ if (this.element.find( '.yith_magnifier_mousetrap' )) {
557
+ this.element.find( '.yith_magnifier_mousetrap' ).remove();
558
+ }
559
+
560
+ this.mouseTrap = $( '<div class="yith_magnifier_mousetrap pp_woocommerce" />' ).css(
561
+ {
562
+ width : yith_wc_zoom_magnifier_storage_object.mouse_trap_width, //zoomImage.outerWidth(),
563
+ height: yith_wc_zoom_magnifier_storage_object.mouse_trap_height, //zoomImage.outerHeight(),
564
+ top : 0,
565
+ left : 0
566
+ }
567
+ ).appendTo( zoom.parent() );
568
+
569
+ if ( typeof ywzm_data != 'undefined' ) {
570
+
571
+ $( '<a href="#" class="yith_expand" style="display: inline;"></a>' ).appendTo( this.mouseTrap );
572
+ $( '.expand-button-hidden' ).clone().appendTo( $( '.yith_expand') );
573
+ $( '.yith_magnifier_mousetrap .yith_expand .expand-button-hidden' ).show();
574
+
575
+
576
+ }
577
+
578
+ if (self.isPhone && self.options.phoneBehavior == 'disable') {
579
+ return;
580
+ }
581
+
582
+ // Detect device type, normal mouse or touchy(ipad android) by albanx.
583
+ var touchy = ("ontouchstart" in document.documentElement) ? true : false;
584
+ var event_move = 'touchmove mousemove';
585
+ var event_end = 'touchend mouseleave';
586
+ var event_ent = 'touchstart mouseenter';
587
+ var event_click = 'touchstart click';
588
+
589
+ this.mouseTrap.on(
590
+ event_move,
591
+ this,
592
+ function (e) {
593
+
594
+ self.options.onMove();
595
+
596
+ self.mx = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
597
+ self.my = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
598
+
599
+ }
600
+ ).on(
601
+ event_end,
602
+ this,
603
+ function (e) {
604
+
605
+ clearTimeout( self.controlTimer );
606
+ /* event.data.removeBits(); */
607
+ if (self.lens) {
608
+ self.lens.fadeOut( 299 );
609
+ }
610
+ if (self.tint) {
611
+ self.tint.fadeOut( 299 );
612
+ }
613
+ if (self.softFocus) {
614
+ self.softFocus.fadeOut( 299 );
615
+ }
616
+ self.zoomDiv.fadeOut(
617
+ 300,
618
+ function () {
619
+ self._onLeave();
620
+ }
621
+ );
622
+
623
+ return false;
624
+
625
+ }
626
+ ).on(
627
+ event_click,
628
+ this,
629
+ function (e) {
630
+ self.options.onClick();
631
+ }
632
+ ).on(
633
+ event_ent,
634
+ this,
635
+ function (e) {
636
+
637
+ if ( $( '#yith_wczm_traffic_light' ).val() == 'free' ) {
638
+
639
+ self.options.onEnter();
640
+
641
+ if (touchy) {
642
+ e.preventDefault();
643
+ }
644
+
645
+ self.mx = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
646
+ self.my = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
647
+
648
+ self.zw = e.data;
649
+ if (self.zoomDiv) {
650
+ self.zoomDiv.stop( true, false );
651
+ self.zoomDiv.remove();
652
+ }
653
+
654
+ var xPos = self.options.adjustX,
655
+ yPos = self.options.adjustY;
656
+
657
+ var siw = zoomImage.outerWidth();
658
+ var sih = zoomImage.outerHeight();
659
+
660
+ var w = self.options.zoomWidth;
661
+ var h = self.options.zoomHeight;
662
+
663
+ if (self.options.zoomWidth == 'auto') {
664
+ w = siw;
665
+ }
666
+
667
+ if (self.options.zoomHeight == 'auto') {
668
+ h = sih;
669
+ }
670
+
671
+ var appendTo = zoom.parent();
672
+ switch (self.options.position) {
673
+ case 'top':
674
+ yPos -= h;
675
+ break;
676
+ case 'right':
677
+ xPos += siw;
678
+ break;
679
+ case 'bottom':
680
+ yPos += sih;
681
+ break;
682
+ case 'left':
683
+ xPos -= w;
684
+ break;
685
+ case 'inside':
686
+ w = siw;
687
+ h = sih;
688
+ break;
689
+
690
+ // All other values, try and find an id in the dom to attach to.
691
+ default:
692
+ appendTo = $( '#' + self.options.position );
693
+ // If dom element doesn't exit, just use 'right' position as default.
694
+ if ( ! appendTo.length) {
695
+ appendTo = zoom;
696
+ xPos += siw; // + opts.adjustX;
697
+ yPos += sih; // + opts.adjustY;
698
+ } else {
699
+ w = appendTo.innerWidth();
700
+ h = appendTo.innerHeight();
701
+ }
702
+ }
703
+
704
+ if (self.isPhone && self.options.phoneBehavior == 'inside') {
705
+ w = siw;
706
+ h = sih;
707
+ xPos = 0;
708
+ yPos = 0;
709
+ }
710
+
711
+ self.zoomDiv = $( '<div class="yith_magnifier_zoom_magnifier" />' ).css(
712
+ {
713
+ left : xPos,
714
+ top : yPos,
715
+ width : w,
716
+ height : h,
717
+ 'background-repeat': 'no-repeat',
718
+ backgroundImage : 'url(' + zoomImg.src + ')'
719
+ }
720
+ ).appendTo( appendTo );
721
+
722
+ // Add the title from title tag.
723
+ if (zoomImage.attr( 'title' ) && self.options.showTitle) {
724
+ $( '<div class="yith_magnifier_title">' + zoomImage.attr( 'title' ) + '</div>' ).appendTo( self.zoomDiv );
725
+ }
726
+
727
+ if (self.isPhone) {
728
+ if (self.options.phoneBehavior != 'disable') {
729
+ self.zoomDiv.fadeIn( 500 );
730
+ } else {
731
+ self.lens.fadeOut( 299 );
732
+ }
733
+ } else {
734
+ self.zoomDiv.fadeIn( 500 );
735
+ }
736
+
737
+ if (self.lens) {
738
+ self.lens.remove();
739
+ self.lens = null;
740
+ }
741
+
742
+ if (zoomImg.width <= 1) {
743
+ self.cw = (zoomImage.outerWidth() / zoomImg.naturalWidth) * self.zoomDiv.width();
744
+ } else {
745
+ self.cw = (zoomImage.outerWidth() / zoomImg.width) * self.zoomDiv.width();
746
+ }
747
+
748
+ if (zoomImg.height <= 1) {
749
+ self.ch = (zoomImage.outerHeight() / zoomImg.naturalHeight) * self.zoomDiv.height();
750
+ } else {
751
+ self.ch = (zoomImage.outerHeight() / zoomImg.height) * self.zoomDiv.height();
752
+ }
753
+
754
+ // Attach mouse, initially invisible to prevent first frame glitch.
755
+ self.lens = $( '<div class="yith_magnifier_lens" />' ).css(
756
+ {
757
+ width : self.cw,
758
+ height: self.ch
759
+ }
760
+ ).appendTo( zoom );
761
+
762
+ // self.mouseTrap.css( 'cursor', self.lens.css( 'cursor' ) );
763
+
764
+ var noTrans = false;
765
+
766
+ // Init tint layer if needed. (Not relevant if using inside mode).
767
+ if (self.options.tint) {
768
+ /* self.lens.css('background', 'url("' + zoomImage.attr('src') + '")'); */
769
+ self.tint = $( '<div />' ).css(
770
+ {
771
+ display : 'none',
772
+ position : 'absolute',
773
+ left : 0,
774
+ top : 0,
775
+ width : zoomImage.outerWidth(),
776
+ height : zoomImage.outerHeight(),
777
+ backgroundColor: self.options.tint,
778
+ opacity : self.options.tintOpacity
779
+ }
780
+ ).appendTo( zoom );
781
+
782
+ self.lens.append(
783
+ $(
784
+ '<img />',
785
+ {
786
+ src: zoomImage.attr( 'src' )
787
+ }
788
+ )
789
+ );
790
+
791
+ noTrans = true;
792
+ self.tint.fadeIn( 500 );
793
+ }
794
+
795
+ if (self.options.softFocus) {
796
+ /* self.lens.css('background', 'url("' + zoomImage.attr('src') + '")'); */
797
+ self.softFocus = $( '<div />' ).css(
798
+ {
799
+ position: 'absolute',
800
+ display : 'none',
801
+ top : '1px',
802
+ left : '1px',
803
+ width : zoomImage.outerWidth(),
804
+ height : zoomImage.outerHeight(),
805
+ //background: 'url("' + zoomImage.attr( 'src' ) + '")',
806
+ //backgroundSize: '100%',
807
+ opacity : .5
808
+ }
809
+ ).appendTo( zoom );
810
+
811
+ self.softFocus.append(
812
+ $(
813
+ '<img />',
814
+ {
815
+ src: zoomImage.attr( 'src' )
816
+ }
817
+ )
818
+ );
819
+
820
+ if (self.lens.find( 'img' ).length == 0) {
821
+ self.lens.append(
822
+ $(
823
+ '<img />',
824
+ {
825
+ src: zoomImage.attr( 'src' )
826
+ }
827
+ )
828
+ );
829
+ }
830
+
831
+ noTrans = true;
832
+ self.softFocus.fadeIn( 500 );
833
+ }
834
+
835
+ if ( ! noTrans) {
836
+ self.lens.css( 'opacity', self.options.lensOpacity );
837
+ }
838
+ if (self.options.position !== 'inside') {
839
+ self.lens.fadeIn( 500 );
840
+ }
841
+
842
+ // Start processing.
843
+ self.zw._controlLoop();
844
+
845
+ return; // Don't return false here otherwise opera will not detect change of the mouse pointer type.
846
+
847
+ }
848
+
849
+ }
850
+ );
851
+
852
+ },
853
+
854
+ /**
855
+ * Control loop
856
+ *
857
+ * @private
858
+ */
859
+ _controlLoop: function () {
860
+ var self = this;
861
+
862
+ if (this.lens) {
863
+ var x = (this.mx - this.zoomImage.offset().left - (this.cw * 0.5)) >> 0;
864
+ var y = (this.my - this.zoomImage.offset().top - (this.ch * 0.5)) >> 0;
865
+
866
+ if (x < 0) {
867
+ x = 0;
868
+ } else if (x > (this.zoomImage.outerWidth() - this.cw)) {
869
+ x = (this.zoomImage.outerWidth() - this.cw);
870
+ }
871
+
872
+ if (y < 0) {
873
+ y = 0;
874
+ } else if (y > (this.zoomImage.outerHeight() - this.ch)) {
875
+ y = (this.zoomImage.outerHeight() - this.ch);
876
+ }
877
+
878
+ this.lens.css(
879
+ {
880
+ left: x - 2,
881
+ top : y - 1
882
+ }
883
+ );
884
+
885
+ /* this.lens.css('background-position', (-x) + 'px ' + (-y) + 'px'); */
886
+
887
+ this.lens.find( 'img' ).css(
888
+ {
889
+ width : this.zoomImage.outerWidth(),
890
+ height : this.zoomImage.outerHeight(),
891
+ marginLeft: (-x) + 'px ',
892
+ marginTop : (-y) + 'px'
893
+ }
894
+ );
895
+
896
+ if (this.IMG_zoomImage.width <= 1) {
897
+ this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.naturalWidth) >> 0;
898
+ } else {
899
+ this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.width) >> 0;
900
+ }
901
+
902
+ if (this.IMG_zoomImage.height <= 1) {
903
+ this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.naturalHeight) >> 0;
904
+ } else {
905
+ this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.height) >> 0;
906
+ }
907
+
908
+ this.currU += (this.destU - this.currU) / this.options.smoothMove;
909
+ this.currV += (this.destV - this.currV) / this.options.smoothMove;
910
+
911
+ this.zoomDiv.css( 'background-position', (-(this.currU >> 0) + 'px ') + (-(this.currV >> 0) + 'px') );
912
+ }
913
+
914
+ this.controlTimer = setTimeout(
915
+ function () {
916
+ self._controlLoop();
917
+ },
918
+ 30
919
+ );
920
+ },
921
+
922
+ /**
923
+ * This method is called when the mouse leave the image
924
+ *
925
+ * @private
926
+ */
927
+ _onLeave: function () {
928
+ this.options.onLeave();
929
+
930
+ if (this.zoomDiv) {
931
+ this.zoomDiv.remove();
932
+ this.zoomDiv = null;
933
+ }
934
+
935
+ this._removeElements();
936
+ },
937
+
938
+ /**
939
+ * Remove lens, tint and softfocus
940
+ *
941
+ * @private
942
+ */
943
+ _removeElements: function () {
944
+ if (this.lens) {
945
+ this.lens.remove();
946
+ this.lens = null;
947
+ }
948
+
949
+ if (this.tint) {
950
+ this.tint.remove();
951
+ this.tint = null;
952
+ }
953
+
954
+ if (this.softFocus) {
955
+ this.softFocus.remove();
956
+ this.softFocus = null;
957
+ }
958
+
959
+ if (this.element.find( '.yith_magnifier_loading' ).length > 0) {
960
+ this.element.find( '.yith_magnifier_loading' ).remove();
961
+ }
962
+ },
963
+
964
+ /**
965
+ * Detect if user is using a phone device (eg iPhone)
966
+ *
967
+ * @private
968
+ */
969
+ _isPhone: function () {
970
+ var userAgent = navigator.userAgent.toLowerCase();
971
+
972
+ return ( userAgent.match( /iphone/i ) || userAgent.match( /ipod/i ) || userAgent.match( /android/i ) );
973
+ },
974
+
975
+ /**
976
+ * Destroy the instance
977
+ */
978
+ destroy: function () {
979
+ if (this.zoom) {
980
+ this.zoom.unwrap();
981
+ }
982
+
983
+ if (this.mouseTrap) {
984
+ this.mouseTrap.unbind();
985
+ this.mouseTrap.remove();
986
+ this.mouseTrap = null;
987
+ }
988
+
989
+ if (this.zoomDiv) {
990
+ this.zoomDiv.remove();
991
+ this.zoomDiv = null;
992
+ }
993
+
994
+ if (this.options.disableRightClick) {
995
+ $( document ).unbind();
996
+ }
997
+
998
+ this._removeElements();
999
+ this.options.elements.gallery.unbind();
1000
+ this.element.removeData( 'yith_magnifier' );
1001
+ }
1002
+ };
1003
+
1004
+ $.fn.yith_magnifier = function (options) {
1005
+
1006
+ if (typeof options === 'string') {
1007
+ var args = Array.prototype.slice.call( arguments, 1 );
1008
+
1009
+ this.each(
1010
+ function () {
1011
+ var instance = $.data( this, 'yith_magnifier' );
1012
+ if ( ! instance) {
1013
+ $.error(
1014
+ "cannot call methods on yith_magnifier prior to initialization; " +
1015
+ "attempted to call method '" + options + "'"
1016
+ );
1017
+ return;
1018
+ }
1019
+ if ( ! $.isFunction( instance[options] ) || options.charAt( 0 ) === "_") {
1020
+ $.error( "no such method '" + options + "' for yith_magnifier instance" );
1021
+ return;
1022
+ }
1023
+ instance[options].apply( instance, args );
1024
+ }
1025
+ );
1026
+ } else {
1027
+ this.each(
1028
+ function () {
1029
+ var instance = $.data( this, 'yith_magnifier' );
1030
+ if ( ! instance) {
1031
+ $.data( this, 'yith_magnifier', new $.yith_magnifier( options, this ) );
1032
+ } else {
1033
+ $.error( 'yith_magnifier already istantiated.' );
1034
+ }
1035
+ }
1036
+ );
1037
+ }
1038
+ return this;
1039
+ };
1040
+
1041
+ })( window, jQuery );
assets/js/yith_magnifier.min.js CHANGED
@@ -1 +1 @@
1
- !function(u,i){"use strict";var d,p;u.fn.imagesLoaded===i&&(d=jQuery,p="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",d.fn.imagesLoaded=function(o){var e=this,n=d.isFunction(d.Deferred)?d.Deferred():0,s=d.isFunction(n.notify),a=e.find("img").add(e.filter("img")),r=[],m=[],h=[];function l(){var t=d(m),i=d(h);n&&(h.length?n.reject(a,t,i):n.resolve(a)),d.isFunction(o)&&o.call(e,a,t,i)}function c(t){g(t.target,"error"===t.type)}function g(t,i){t.src!==p&&-1===d.inArray(t,r)&&(r.push(t),(i?h:m).push(t),d.data(t,"imagesLoaded",{isBroken:i,src:t.src}),s&&n.notifyWith(d(t),[i,a,d(m),d(h)]),a.length===r.length&&(setTimeout(l),a.unbind(".imagesLoaded",c)))}return d.isPlainObject(o)&&d.each(o,function(t,i){"callback"===t?o=i:n&&n[t](i)}),a.length?a.bind("load.imagesLoaded error.imagesLoaded",c).each(function(t,i){var o=i.src,e=d.data(i,"imagesLoaded");e&&e.src===o?g(i,e.isBroken):i.complete&&void 0!==i.naturalWidth?g(i,0===i.naturalWidth||0===i.naturalHeight):(i.readyState||i.complete)&&(i.src=p,i.src=o)}):l(),n?n.promise(e):e}),u.yith_magnifier=function(t,i){this.t=i,this.element=u(i),this._init(t)},u.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:.5,lensOpacity:.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,slider:"carouFredSel",sliderOptions:{},from_gallery:"no",onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},onMove:function(){return!1},onClick:function(){return!1},elements:{zoom:u(".yith_magnifier_zoom"),zoomImage:u(".yith_magnifier_zoom img").first(),gallery:u(".yith_magnifier_gallery li a")}},u.yith_magnifier.prototype={_init:function(t){var o=this;u(document).trigger("yith_magnifier_before_init"),u.each(u.yith_magnifier.defaults.elements,function(t,i){u.yith_magnifier.defaults.elements[t]=u(i,o)}),o.options=u.extend(!0,{},u.yith_magnifier.defaults,t),o.isPhone=o._isPhone(),o._loading(),o.element.imagesLoaded(function(){o.options.onLoad(),o._initZoom(),o._initGallery()}),u(document).trigger("yith_magnifier_after_init")},_initGallery:function(){var i=this,t=i.options.elements,o=t.gallery,e=t.zoom,n=t.zoomImage;0<o.length?(o.on("click",function(t){t.preventDefault(),i.options.from_gallery="yes";t=u(this);i.destroy(),e.attr("href",this.href),n.attr("src",t.data("small")).attr("srcset",t.data("small")).attr("src-orig",t.data("small")).attr("title","").attr("title",t.attr("title")),u.data(i.t,"yith_magnifier",new u.yith_magnifier(i.options,i.element))}),i.options.enableSlider&&(o.closest("ul").trigger("yith_magnifier_slider_destroy"),o.closest("ul")[i.options.slider](i.options.sliderOptions))):o.on("click",function(t){return t.preventDefault(),!1})},_loading:function(){var t;this.options.disableRightClick&&u(document).on("contextmenu",function(t){return!1}),this.mouseTrap===i&&(t=this.options.elements.zoom.width(),this.options.loadingLabel&&u('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:t,"text-align":"center",opacity:.5}).appendTo(this.options.elements.zoom.parent()))},_initZoom:function(){var i=this;i.zoom=i.options.elements.zoom,i.zoomImage=i.options.elements.zoomImage;var t="yith_magnifier_zoom_wrap";i.options.zoom_wrap_additional_css&&(u("."+t).length||(t+=" "+i.options.zoom_wrap_additional_css)),i.zoom.wrap('<div class="'+t+'"></div>'),i.IMG_zoomImage=new Image;t=u(".woocommerce-variation-add-to-cart .variation_id").val();u.isNumeric(t)&&0!=t&&"no"==i.options.from_gallery?u.ajax({data:{action:"yith_wc_zoom_magnifier_get_main_image",product_id:t,context:"frontend"},url:yith_wc_zoom_magnifier_storage_object.ajax_url,type:"post",error:function(t){console.log("ERROR - Yith_WC_Zoom_Magnifier"),console.log(t)},success:function(t){i.IMG_zoomImage.src=t.url,i.IMG_smallImage=new Image,i.IMG_smallImage.src=i.zoomImage.attr("src"),t.gallery&&(u(".yith_magnifier_gallery").length?u(".yith_magnifier_gallery").closest(".thumbnails").replaceWith(t.gallery):u(".images").append(t.gallery),i.options.elements.gallery=u(".yith_magnifier_gallery li a")),u.browser&&u.browser.msie&&8==u.browser.version?u(i.IMG_zoomImage).load(function(){i._initGallery(),i._initTrap()}):u([i.IMG_zoomImage,i.IMG_smallImage]).imagesLoaded(function(){i._initGallery(),i._initTrap()}),u(document).trigger("yith_magnifier_after_init_zoom")}}):(i.IMG_zoomImage.src=i.zoom.attr("href"),i.IMG_smallImage=new Image,i.IMG_smallImage.src=i.zoomImage.attr("src"),u.browser&&u.browser.msie&&8==u.browser.version?u(i.IMG_zoomImage).load(function(){i._initTrap()}):u([i.IMG_zoomImage,i.IMG_smallImage]).imagesLoaded(function(){i._initTrap()}),u(document).trigger("yith_magnifier_after_init_zoom"))},_initTrap:function(){var m=this,h=m.IMG_zoomImage;m.IMG_smallImage;m.mx=0,m.my=0,m.controlTimer=0,m.lens=null,m.tint=null,m.softFocus=null,m.zoomDiv=null,m.cw=0,m.ch=0,m.zw=0,m.destU=0,m.destV=0,m.currU=0,m.currV=0,m.mouseTrap=null;var l=m.options.elements.zoom,c=m.options.elements.zoomImage;u(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=u('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(l.parent());var g="ontouchstart"in document.documentElement;this.mouseTrap.on("touchmove mousemove",this,function(t){m.options.onMove(),m.mx=("undefined"!=typeof t.originalEvent.touches?t.originalEvent.touches[0]:t).pageX,m.my=("undefined"!=typeof t.originalEvent.touches?t.originalEvent.touches[0]:t).pageY}).on("touchend mouseleave",this,function(t){return clearTimeout(m.controlTimer),m.lens&&m.lens.fadeOut(299),m.tint&&m.tint.fadeOut(299),m.softFocus&&m.softFocus.fadeOut(299),m.zoomDiv.fadeOut(300,function(){m._onLeave()}),!1}).on("touchstart click",this,function(t){m.options.onClick()}).on("touchstart mouseenter",this,function(t){m.options.onEnter(),g&&t.preventDefault(),m.mx=("undefined"!=typeof t.originalEvent.touches?t.originalEvent.touches[0]:t).pageX,m.my=("undefined"!=typeof t.originalEvent.touches?t.originalEvent.touches[0]:t).pageY,m.zw=t.data,m.zoomDiv&&(m.zoomDiv.stop(!0,!1),m.zoomDiv.remove());var i=m.options.adjustX,o=m.options.adjustY,e=c.outerWidth(),n=c.outerHeight(),s=m.options.zoomWidth,a=m.options.zoomHeight;"auto"==m.options.zoomWidth&&(s=e),"auto"==m.options.zoomHeight&&(a=n);var r=l.parent();switch(m.options.position){case"top":o-=a;break;case"right":i+=e;break;case"bottom":o+=n;break;case"left":i-=s;break;case"inside":s=e,a=n;break;default:(r=u("#"+m.options.position)).length?(s=r.innerWidth(),a=r.innerHeight()):(r=l,i+=e,o+=n)}m.isPhone&&"inside"==m.options.phoneBehavior&&(s=e,a=n,o=i=0),m.zoomDiv=u('<div class="yith_magnifier_zoom_magnifier" />').css({left:i,top:o,width:s,height:a,"background-repeat":"no-repeat",backgroundImage:"url("+h.src+")"}).appendTo(r),c.attr("title")&&m.options.showTitle&&u('<div class="yith_magnifier_title">'+c.attr("title")+"</div>").appendTo(m.zoomDiv),!m.isPhone||"disable"!=m.options.phoneBehavior?m.zoomDiv.fadeIn(500):m.lens.fadeOut(299),m.lens&&(m.lens.remove(),m.lens=null),h.width<=1?m.cw=c.outerWidth()/h.naturalWidth*m.zoomDiv.width():m.cw=c.outerWidth()/h.width*m.zoomDiv.width(),h.height<=1?m.ch=c.outerHeight()/h.naturalHeight*m.zoomDiv.height():m.ch=c.outerHeight()/h.height*m.zoomDiv.height(),m.lens=u('<div class="yith_magnifier_lens" />').css({width:m.cw,height:m.ch}).appendTo(l),m.mouseTrap.css("cursor",m.lens.css("cursor"));t=!1;m.options.tint&&(m.tint=u("<div />").css({display:"none",position:"absolute",left:0,top:0,width:c.outerWidth(),height:c.outerHeight(),backgroundColor:m.options.tint,opacity:m.options.tintOpacity}).appendTo(l),m.lens.append(u("<img />",{src:c.attr("src")})),t=!0,m.tint.fadeIn(500)),m.options.softFocus&&(m.softFocus=u("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:c.outerWidth(),height:c.outerHeight(),opacity:.5}).appendTo(l),m.softFocus.append(u("<img />",{src:c.attr("src")})),0==m.lens.find("img").length&&m.lens.append(u("<img />",{src:c.attr("src")})),t=!0,m.softFocus.fadeIn(500)),t||m.lens.css("opacity",m.options.lensOpacity),"inside"!==m.options.position&&m.lens.fadeIn(500),m.zw._controlLoop()})},_controlLoop:function(){var t,i,o=this;this.lens&&(t=this.mx-this.zoomImage.offset().left-.5*this.cw>>0,i=this.my-this.zoomImage.offset().top-.5*this.ch>>0,t<0?t=0:t>this.zoomImage.outerWidth()-this.cw&&(t=this.zoomImage.outerWidth()-this.cw),i<0?i=0:i>this.zoomImage.outerHeight()-this.ch&&(i=this.zoomImage.outerHeight()-this.ch),this.lens.css({left:t-2,top:i-1}),this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-t+"px ",marginTop:-i+"px"}),this.IMG_zoomImage.width<=1?this.destU=t/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:this.destU=t/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.IMG_zoomImage.height<=1?this.destV=i/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:this.destV=i/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0,this.currU+=(this.destU-this.currU)/this.options.smoothMove,this.currV+=(this.destV-this.currV)/this.options.smoothMove,this.zoomDiv.css("background-position",-(this.currU>>0)+"px "+-(this.currV>>0)+"px")),this.controlTimer=setTimeout(function(){o._controlLoop()},30)},_onLeave:function(){this.options.onLeave(),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this._removeElements()},_removeElements:function(){this.lens&&(this.lens.remove(),this.lens=null),this.tint&&(this.tint.remove(),this.tint=null),this.softFocus&&(this.softFocus.remove(),this.softFocus=null),0<this.element.find(".yith_magnifier_loading").length&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var t=navigator.userAgent.toLowerCase();return t.match(/iphone/i)||t.match(/ipod/i)||t.match(/android/i)},destroy:function(){this.zoom&&this.zoom.unwrap(),this.mouseTrap&&(this.mouseTrap.unbind(),this.mouseTrap.remove(),this.mouseTrap=null),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this.options.disableRightClick&&u(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},u.fn.yith_magnifier=function(i){var o;return"string"==typeof i?(o=Array.prototype.slice.call(arguments,1),this.each(function(){var t=u.data(this,"yith_magnifier");t?u.isFunction(t[i])&&"_"!==i.charAt(0)?t[i].apply(t,o):u.error("no such method '"+i+"' for yith_magnifier instance"):u.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+i+"'")})):this.each(function(){u.data(this,"yith_magnifier")?u.error("yith_magnifier already istantiated."):u.data(this,"yith_magnifier",new u.yith_magnifier(i,this))}),this}}((window,jQuery));
1
+ !function(g,i){"use strict";var u,p;g.fn.imagesLoaded===i&&(u=jQuery,p="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",u.fn.imagesLoaded=function(e){var o=this,n=u.isFunction(u.Deferred)?u.Deferred():0,a=u.isFunction(n.notify),s=o.find("img").add(o.filter("img")),r=[],h=[],m=[];function l(){var t=u(h),i=u(m);n&&(m.length?n.reject(s,t,i):n.resolve(s)),u.isFunction(e)&&e.call(o,s,t,i)}function c(t){d(t.target,"error"===t.type)}function d(t,i){t.src!==p&&-1===u.inArray(t,r)&&(r.push(t),(i?m:h).push(t),u.data(t,"imagesLoaded",{isBroken:i,src:t.src}),a&&n.notifyWith(u(t),[i,s,u(h),u(m)]),s.length===r.length&&(setTimeout(l),s.unbind(".imagesLoaded",c)))}return u.isPlainObject(e)&&u.each(e,function(t,i){"callback"===t?e=i:n&&n[t](i)}),s.length?s.bind("load.imagesLoaded error.imagesLoaded",c).each(function(t,i){var e=i.src,o=u.data(i,"imagesLoaded");o&&o.src===e?d(i,o.isBroken):i.complete&&void 0!==i.naturalWidth?d(i,0===i.naturalWidth||0===i.naturalHeight):(i.readyState||i.complete)&&(i.src=p,i.src=e)}):l(),n?n.promise(o):o}),g.yith_magnifier=function(t,i){this.t=i,this.element=g(i),this._init(t)},g.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:.5,lensOpacity:.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,slider:"carouFredSel",sliderOptions:{},from_gallery:"no",onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},onMove:function(){return!1},onClick:function(){return!1},elements:{zoom:g(".yith_magnifier_zoom"),zoomImage:g(".yith_magnifier_zoom img").first(),gallery:g(".yith_magnifier_gallery li a")}},g.yith_magnifier.prototype={_init:function(t){var e=this;g(document).trigger("yith_magnifier_before_init"),g.each(g.yith_magnifier.defaults.elements,function(t,i){g.yith_magnifier.defaults.elements[t]=g(i,e)}),e.options=g.extend(!0,{},g.yith_magnifier.defaults,t),e.isPhone=e._isPhone(),e._loading(),e.options.onLoad(),e._initZoom(),e._initGallery(),g(document).trigger("yith_magnifier_after_init")},_initGallery:function(){var i=this,t=i.options.elements,e=t.gallery,o=t.zoom,n=t.zoomImage;0<e.length?(e.on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),"free"==g("#yith_wczm_traffic_light").val()&&(g(".yith_magnifier_gallery .yith_magnifier_thumbnail.active-thumbnail").removeClass("active-thumbnail"),g(".yith_magnifier_gallery .yith_magnifier_thumbnail.active-thumbnail").addClass("inactive-thumbnail"),g(this).removeClass("inactive-thumbnail"),g(this).addClass("active-thumbnail"),g(this).parent().removeClass("inactive-thumbnail"),g(this).parent().addClass("active-thumbnail"),i.options.from_gallery="yes",t=g(this),i.destroy(),o.attr("href",this.href),n.attr("src",t.data("small")).attr("srcset",t.data("small")).attr("src-orig",t.data("small")).attr("title","").attr("title",t.attr("title")),g.data(i.t,"yith_magnifier",new g.yith_magnifier(i.options,i.element)))}),i.options.enableSlider&&e.closest("ul").trigger("yith_magnifier_slider_destroy")):e.on("click",function(t){return t.preventDefault(),!1})},_loading:function(){var t;this.options.disableRightClick&&g(document).on("contextmenu",function(t){return!1}),this.mouseTrap===i&&(t=this.options.elements.zoom.width(),this.options.loadingLabel&&g('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:t,"text-align":"center",opacity:.5}).appendTo(this.options.elements.zoom.parent()))},_initZoom:function(){if("free"==g("#yith_wczm_traffic_light").val()){g("#yith_wczm_traffic_light").val("blocked");var i=this;i.zoom=i.options.elements.zoom,i.zoomImage=i.options.elements.zoomImage;var t="yith_magnifier_zoom_wrap";if(i.options.zoom_wrap_additional_css){if(g("."+t).length)return;t+=" "+i.options.zoom_wrap_additional_css}i.zoom.wrap('<div class="'+t+'"></div>'),i.IMG_zoomImage=new Image;t=g(".woocommerce-variation-add-to-cart .variation_id").val();g.isNumeric(t)&&0!=t&&"no"==i.options.from_gallery?g.ajax({data:{action:"yith_wc_zoom_magnifier_get_main_image",product_id:t,context:"frontend"},url:yith_wc_zoom_magnifier_storage_object.ajax_url,type:"post",error:function(t){console.log("ERROR - Yith_WC_Zoom_Magnifier"),console.log(t),g("#yith_wczm_traffic_light").val("free")},success:function(t){i.zoom.attr("href",t.url),i.IMG_zoomImage.src=t.url,i.IMG_smallImage=new Image,i.IMG_smallImage.src=i.zoomImage.attr("src"),t.gallery&&(g(".yith_magnifier_gallery").length?g(".yith_magnifier_gallery").closest(".thumbnails").replaceWith(t.gallery):g(".images").append(t.gallery),i.options.elements.gallery=g(".yith_magnifier_gallery li a")),g.browser&&g.browser.msie&&8==g.browser.version?g(i.IMG_zoomImage).load(function(){i._initGallery(),i._initTrap()}):g([i.IMG_zoomImage,i.IMG_smallImage]).imagesLoaded(function(){i._initGallery(),i._initTrap()}),g(document).on("click","a.yith_expand",function(t){t.preventDefault(),g().prettyPhoto({social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1,callback:function(){g(".yith_expand").css("display","inline")}}),g.prettyPhoto.open(i.zoom[0].href,"",""),g(".yith_expand").css("display","none"),g(".pp_woocommerce .ppt").css({height:0,marginBottom:0})}),g(document).trigger("yith_magnifier_after_init_zoom"),g("#yith_wczm_traffic_light").val("free")}}):(i.IMG_zoomImage.src=i.zoom.attr("href"),i.IMG_smallImage=new Image,i.IMG_smallImage.src=i.zoomImage.attr("src"),g.browser&&g.browser.msie&&8==g.browser.version?g(i.IMG_zoomImage).load(function(){i._initTrap()}):g([i.IMG_zoomImage,i.IMG_smallImage]).imagesLoaded(function(){i._initTrap()}),g(document).on("click","a.yith_expand",function(t){t.preventDefault(),g().prettyPhoto({social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1,callback:function(){g(".yith_expand").css("display","inline")}}),g.prettyPhoto.open(i.zoom[0].href,"",""),g(".yith_expand").css("display","none"),g(".pp_woocommerce .ppt").css({height:0,marginBottom:0})}),g(document).trigger("yith_magnifier_after_init_zoom"),g("#yith_wczm_traffic_light").val("free"))}},_initTrap:function(){var h=this,m=h.IMG_zoomImage;h.IMG_smallImage;h.mx=0,h.my=0,h.controlTimer=0,h.lens=null,h.tint=null,h.softFocus=null,h.zoomDiv=null,h.cw=0,h.ch=0,h.zw=0,h.destU=0,h.destV=0,h.currU=0,h.currV=0,h.mouseTrap=null;var l,c=h.options.elements.zoom,d=h.options.elements.zoomImage;g(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=g('<div class="yith_magnifier_mousetrap pp_woocommerce" />').css({width:yith_wc_zoom_magnifier_storage_object.mouse_trap_width,height:yith_wc_zoom_magnifier_storage_object.mouse_trap_height,top:0,left:0}).appendTo(c.parent()),"undefined"!=typeof ywzm_data&&(g('<a href="#" class="yith_expand" style="display: inline;"></a>').appendTo(this.mouseTrap),g(".expand-button-hidden").clone().appendTo(g(".yith_expand")),g(".yith_magnifier_mousetrap .yith_expand .expand-button-hidden").show()),h.isPhone&&"disable"==h.options.phoneBehavior||(l="ontouchstart"in document.documentElement,this.mouseTrap.on("touchmove mousemove",this,function(t){h.options.onMove(),h.mx=("undefined"!=typeof t.originalEvent.touches?t.originalEvent.touches[0]:t).pageX,h.my=("undefined"!=typeof t.originalEvent.touches?t.originalEvent.touches[0]:t).pageY}).on("touchend mouseleave",this,function(t){return clearTimeout(h.controlTimer),h.lens&&h.lens.fadeOut(299),h.tint&&h.tint.fadeOut(299),h.softFocus&&h.softFocus.fadeOut(299),h.zoomDiv.fadeOut(300,function(){h._onLeave()}),!1}).on("touchstart click",this,function(t){h.options.onClick()}).on("touchstart mouseenter",this,function(t){if("free"==g("#yith_wczm_traffic_light").val()){h.options.onEnter(),l&&t.preventDefault(),h.mx=("undefined"!=typeof t.originalEvent.touches?t.originalEvent.touches[0]:t).pageX,h.my=("undefined"!=typeof t.originalEvent.touches?t.originalEvent.touches[0]:t).pageY,h.zw=t.data,h.zoomDiv&&(h.zoomDiv.stop(!0,!1),h.zoomDiv.remove());var i=h.options.adjustX,e=h.options.adjustY,o=d.outerWidth(),n=d.outerHeight(),a=h.options.zoomWidth,s=h.options.zoomHeight;"auto"==h.options.zoomWidth&&(a=o),"auto"==h.options.zoomHeight&&(s=n);var r=c.parent();switch(h.options.position){case"top":e-=s;break;case"right":i+=o;break;case"bottom":e+=n;break;case"left":i-=a;break;case"inside":a=o,s=n;break;default:(r=g("#"+h.options.position)).length?(a=r.innerWidth(),s=r.innerHeight()):(r=c,i+=o,e+=n)}h.isPhone&&"inside"==h.options.phoneBehavior&&(a=o,s=n,e=i=0),h.zoomDiv=g('<div class="yith_magnifier_zoom_magnifier" />').css({left:i,top:e,width:a,height:s,"background-repeat":"no-repeat",backgroundImage:"url("+m.src+")"}).appendTo(r),d.attr("title")&&h.options.showTitle&&g('<div class="yith_magnifier_title">'+d.attr("title")+"</div>").appendTo(h.zoomDiv),!h.isPhone||"disable"!=h.options.phoneBehavior?h.zoomDiv.fadeIn(500):h.lens.fadeOut(299),h.lens&&(h.lens.remove(),h.lens=null),m.width<=1?h.cw=d.outerWidth()/m.naturalWidth*h.zoomDiv.width():h.cw=d.outerWidth()/m.width*h.zoomDiv.width(),m.height<=1?h.ch=d.outerHeight()/m.naturalHeight*h.zoomDiv.height():h.ch=d.outerHeight()/m.height*h.zoomDiv.height(),h.lens=g('<div class="yith_magnifier_lens" />').css({width:h.cw,height:h.ch}).appendTo(c);t=!1;h.options.tint&&(h.tint=g("<div />").css({display:"none",position:"absolute",left:0,top:0,width:d.outerWidth(),height:d.outerHeight(),backgroundColor:h.options.tint,opacity:h.options.tintOpacity}).appendTo(c),h.lens.append(g("<img />",{src:d.attr("src")})),t=!0,h.tint.fadeIn(500)),h.options.softFocus&&(h.softFocus=g("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:d.outerWidth(),height:d.outerHeight(),opacity:.5}).appendTo(c),h.softFocus.append(g("<img />",{src:d.attr("src")})),0==h.lens.find("img").length&&h.lens.append(g("<img />",{src:d.attr("src")})),t=!0,h.softFocus.fadeIn(500)),t||h.lens.css("opacity",h.options.lensOpacity),"inside"!==h.options.position&&h.lens.fadeIn(500),h.zw._controlLoop()}}))},_controlLoop:function(){var t,i,e=this;this.lens&&(t=this.mx-this.zoomImage.offset().left-.5*this.cw>>0,i=this.my-this.zoomImage.offset().top-.5*this.ch>>0,t<0?t=0:t>this.zoomImage.outerWidth()-this.cw&&(t=this.zoomImage.outerWidth()-this.cw),i<0?i=0:i>this.zoomImage.outerHeight()-this.ch&&(i=this.zoomImage.outerHeight()-this.ch),this.lens.css({left:t-2,top:i-1}),this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-t+"px ",marginTop:-i+"px"}),this.IMG_zoomImage.width<=1?this.destU=t/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:this.destU=t/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.IMG_zoomImage.height<=1?this.destV=i/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:this.destV=i/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0,this.currU+=(this.destU-this.currU)/this.options.smoothMove,this.currV+=(this.destV-this.currV)/this.options.smoothMove,this.zoomDiv.css("background-position",-(this.currU>>0)+"px "+-(this.currV>>0)+"px")),this.controlTimer=setTimeout(function(){e._controlLoop()},30)},_onLeave:function(){this.options.onLeave(),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this._removeElements()},_removeElements:function(){this.lens&&(this.lens.remove(),this.lens=null),this.tint&&(this.tint.remove(),this.tint=null),this.softFocus&&(this.softFocus.remove(),this.softFocus=null),0<this.element.find(".yith_magnifier_loading").length&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var t=navigator.userAgent.toLowerCase();return t.match(/iphone/i)||t.match(/ipod/i)||t.match(/android/i)},destroy:function(){this.zoom&&this.zoom.unwrap(),this.mouseTrap&&(this.mouseTrap.unbind(),this.mouseTrap.remove(),this.mouseTrap=null),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this.options.disableRightClick&&g(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},g.fn.yith_magnifier=function(i){var e;return"string"==typeof i?(e=Array.prototype.slice.call(arguments,1),this.each(function(){var t=g.data(this,"yith_magnifier");t?g.isFunction(t[i])&&"_"!==i.charAt(0)?t[i].apply(t,e):g.error("no such method '"+i+"' for yith_magnifier instance"):g.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+i+"'")})):this.each(function(){g.data(this,"yith_magnifier")?g.error("yith_magnifier already istantiated."):g.data(this,"yith_magnifier",new g.yith_magnifier(i,this))}),this}}((window,jQuery));
assets/js/ywzm_backend.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Backend JS
3
+ *
4
+ * @author YITH
5
+ * @package YITH\ZoomMagnifier\Assets\JS
6
+ */
7
+
8
+ jQuery(function ($) {
9
+
10
+ //Settings dependencies
11
+ /**
12
+ * Hide Slider options if the Thumbnails are hidden
13
+ * */
14
+ $(function() {
15
+ if ($('input#ywzm_hide_thumbnails').prop('checked')) {
16
+
17
+ $('[data-dep-target="yith_wcmg_slider_items"]').hide();
18
+ $('[data-dep-target="yith_wcmg_slider_style_colors"]').hide();
19
+ $('[data-dep-target="yith_wcmg_slider_style_colors_hover"]').hide();
20
+ $('[data-dep-target="yith_wcmg_slider_sizes"]').hide();
21
+ $('[data-dep-target="yith_wcmg_slider_radius"]').hide();
22
+ $('[data-dep-target="ywzm_slider_arrows_display"]').hide();
23
+ $('[data-dep-target="yith_wcmg_slider_infinite"]').hide();
24
+ $('[data-dep-target="yith_wcmg_slider_infinite_type"]').hide();
25
+ $('[data-dep-target="ywzm_auto_carousel"]').hide();
26
+
27
+ }});
28
+
29
+
30
+ $('input#ywzm_hide_thumbnails').change(function() {
31
+
32
+ if ( ! $( this ).hasClass( 'onoffchecked') && $('input#yith_wcmg_enableslider').prop('checked') ){
33
+
34
+ $('[data-dep-target="yith_wcmg_slider_items"]').show();
35
+ $('[data-dep-target="yith_wcmg_slider_style_colors"]').show();
36
+ $('[data-dep-target="yith_wcmg_slider_style_colors_hover"]').show();
37
+ $('[data-dep-target="yith_wcmg_slider_sizes"]').show();
38
+ $('[data-dep-target="yith_wcmg_slider_radius"]').show();
39
+ $('[data-dep-target="ywzm_slider_arrows_display"]').show();
40
+ $('[data-dep-target="yith_wcmg_slider_infinite"]').show();
41
+ $('[data-dep-target="yith_wcmg_slider_infinite_type"]').show();
42
+ $('[data-dep-target="ywzm_auto_carousel"]').show();
43
+
44
+ }
45
+ else{
46
+
47
+ $('[data-dep-target="yith_wcmg_slider_items"]').hide();
48
+ $('[data-dep-target="yith_wcmg_slider_style_colors"]').hide();
49
+ $('[data-dep-target="yith_wcmg_slider_style_colors_hover"]').hide();
50
+ $('[data-dep-target="yith_wcmg_slider_sizes"]').hide();
51
+ $('[data-dep-target="yith_wcmg_slider_radius"]').hide();
52
+ $('[data-dep-target="ywzm_slider_arrows_display"]').hide();
53
+ $('[data-dep-target="yith_wcmg_slider_infinite"]').hide();
54
+ $('[data-dep-target="yith_wcmg_slider_infinite_type"]').hide();
55
+ $('[data-dep-target="ywzm_auto_carousel"]').hide();
56
+
57
+ }
58
+ });
59
+
60
+
61
+ /**
62
+ * Hide Slider type is the slider is not infinite
63
+ * */
64
+ $(function() {
65
+ if ( ! $('input#yith_wcmg_slider_infinite').prop('checked')) {
66
+
67
+ $('[data-dep-target="yith_wcmg_slider_infinite_type"]').hide();
68
+ $('[data-dep-target="ywzm_auto_carousel"]').hide();
69
+
70
+ }});
71
+
72
+ $('input#yith_wcmg_slider_infinite').change(function() {
73
+
74
+ if ( ! $( this ).hasClass( 'onoffchecked') && $('input#yith_wcmg_enableslider').prop('checked') ){
75
+
76
+ $('[data-dep-target="yith_wcmg_slider_infinite_type"]').hide();
77
+ $('[data-dep-target="ywzm_auto_carousel"]').hide();
78
+ }
79
+ else{
80
+ $('[data-dep-target="yith_wcmg_slider_infinite_type"]').show();
81
+ $('[data-dep-target="ywzm_auto_carousel"]').show();
82
+
83
+ }
84
+ });
85
+
86
+
87
+
88
+ });
assets/js/ywzm_backend.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(function(e){e(function(){e("input#ywzm_hide_thumbnails").prop("checked")&&(e('[data-dep-target="yith_wcmg_slider_items"]').hide(),e('[data-dep-target="yith_wcmg_slider_style_colors"]').hide(),e('[data-dep-target="yith_wcmg_slider_style_colors_hover"]').hide(),e('[data-dep-target="yith_wcmg_slider_sizes"]').hide(),e('[data-dep-target="yith_wcmg_slider_radius"]').hide(),e('[data-dep-target="ywzm_slider_arrows_display"]').hide(),e('[data-dep-target="yith_wcmg_slider_infinite"]').hide(),e('[data-dep-target="yith_wcmg_slider_infinite_type"]').hide(),e('[data-dep-target="ywzm_auto_carousel"]').hide())}),e("input#ywzm_hide_thumbnails").change(function(){!e(this).hasClass("onoffchecked")&&e("input#yith_wcmg_enableslider").prop("checked")?(e('[data-dep-target="yith_wcmg_slider_items"]').show(),e('[data-dep-target="yith_wcmg_slider_style_colors"]').show(),e('[data-dep-target="yith_wcmg_slider_style_colors_hover"]').show(),e('[data-dep-target="yith_wcmg_slider_sizes"]').show(),e('[data-dep-target="yith_wcmg_slider_radius"]').show(),e('[data-dep-target="ywzm_slider_arrows_display"]').show(),e('[data-dep-target="yith_wcmg_slider_infinite"]').show(),e('[data-dep-target="yith_wcmg_slider_infinite_type"]').show(),e('[data-dep-target="ywzm_auto_carousel"]').show()):(e('[data-dep-target="yith_wcmg_slider_items"]').hide(),e('[data-dep-target="yith_wcmg_slider_style_colors"]').hide(),e('[data-dep-target="yith_wcmg_slider_style_colors_hover"]').hide(),e('[data-dep-target="yith_wcmg_slider_sizes"]').hide(),e('[data-dep-target="yith_wcmg_slider_radius"]').hide(),e('[data-dep-target="ywzm_slider_arrows_display"]').hide(),e('[data-dep-target="yith_wcmg_slider_infinite"]').hide(),e('[data-dep-target="yith_wcmg_slider_infinite_type"]').hide(),e('[data-dep-target="ywzm_auto_carousel"]').hide())}),e(function(){e("input#yith_wcmg_slider_infinite").prop("checked")||(e('[data-dep-target="yith_wcmg_slider_infinite_type"]').hide(),e('[data-dep-target="ywzm_auto_carousel"]').hide())}),e("input#yith_wcmg_slider_infinite").change(function(){!e(this).hasClass("onoffchecked")&&e("input#yith_wcmg_enableslider").prop("checked")?(e('[data-dep-target="yith_wcmg_slider_infinite_type"]').hide(),e('[data-dep-target="ywzm_auto_carousel"]').hide()):(e('[data-dep-target="yith_wcmg_slider_infinite_type"]').show(),e('[data-dep-target="ywzm_auto_carousel"]').show())})});
assets/js/ywzm_frontend.js CHANGED
@@ -1,62 +1,285 @@
1
- /**
2
- * frontend.js
3
- *
4
- * @author Your Inspiration Themes
5
- * @package YITH WooCommerce Zoom Magnifier
6
- */
7
- jQuery(function ($) {
8
-
9
- var yith_wcmg = $('.images'),
10
- yith_wcmg_zoom = $('.yith_magnifier_zoom'),
11
- yith_wcmg_image = $('.yith_magnifier_zoom img').first(),
12
- yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href'),
13
- yith_wcmg_default_image = yith_wcmg.find('.yith_magnifier_zoom img').attr('src');
14
- yith_wcmg_default_gallery = yith_wcmg.find('.thumbnails');
15
-
16
- if (typeof yith_magnifier_options == 'undefined') {
17
- return false;
18
- }
19
-
20
- yith_wcmg.yith_magnifier(yith_magnifier_options);
21
-
22
- $(document).on('found_variation', 'form.variations_form', function (event, variation) {
23
-
24
- var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
25
-
26
- var image_src = yith_wcmg_default_image;
27
- if (ywzm_data.wc_before_3_0) {
28
- if (variation.image_src) {
29
- image_src = variation.image_src;
30
- }
31
- }
32
- else if (variation.image.src) {
33
- image_src = variation.image.src;
34
- }
35
-
36
- yith_wcmg_zoom.attr('href', image_magnifier);
37
- yith_wcmg_image.attr('src', image_src);
38
- yith_wcmg_image.attr('srcset', image_src);
39
- yith_wcmg_image.attr('src-orig', image_src);
40
-
41
- if (yith_wcmg.data('yith_magnifier')) {
42
- yith_wcmg.yith_magnifier('destroy');
43
- }
44
-
45
- yith_wcmg.yith_magnifier(yith_magnifier_options);
46
- }).on('reset_image', function (event) {
47
- yith_wcmg_zoom.attr('href', yith_wcmg_default_zoom);
48
- yith_wcmg_image.attr('src', yith_wcmg_default_image);
49
- yith_wcmg_image.attr('srcset', yith_wcmg_default_image);
50
- yith_wcmg_image.attr('src-orig', yith_wcmg_default_image);
51
-
52
- yith_wcmg.find('.thumbnails').replaceWith( yith_wcmg_default_gallery );
53
-
54
- if (yith_wcmg.data('yith_magnifier')) {
55
- yith_wcmg.yith_magnifier('destroy');
56
- }
57
-
58
- yith_wcmg.yith_magnifier(yith_magnifier_options);
59
- });
60
-
61
- $('form.variations_form .variations select').trigger('change');
62
- });