YITH WooCommerce Zoom Magnifier - Version 2.2.0

Version Description

Download this release

Release Info

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

Code changes from version 2.1.1 to 2.2.0

Files changed (33) hide show
  1. assets/css/admin.css +131 -131
  2. assets/css/frontend.css +117 -117
  3. assets/css/yith_magnifier.css +90 -90
  4. assets/js/init.prettyPhoto.js +935 -935
  5. assets/js/jquery.carouFredSel.js +3822 -3822
  6. assets/js/jquery.carouFredSel.min.js +1 -1
  7. assets/js/jquery.min.js +1 -1
  8. assets/js/yith_magnifier.js +1041 -1041
  9. assets/js/ywzm_backend.js +88 -88
  10. assets/js/ywzm_frontend.js +294 -294
  11. changelog.txt +190 -190
  12. init.php +155 -155
  13. languages/yith-woocommerce-zoom-magnifier-es_ES.po +1 -1
  14. languages/yith-woocommerce-zoom-magnifier-it_IT.po +1 -1
  15. languages/yith-woocommerce-zoom-magnifier.pot +2 -2
  16. lib/class.yith-wcmg-admin.php +97 -97
  17. lib/class.yith-wcmg-frontend.php +391 -391
  18. lib/class.yith-woocommerce-zoom-magnifier.php +177 -177
  19. lib/class.yith-ywzm-plugin-fw-loader.php +266 -266
  20. lib/compatibility/class-yith-wczm-compatibility.php +113 -113
  21. lib/compatibility/class-yith-wczm-elementor-compatibility.php +102 -102
  22. lib/compatibility/elementor/class-yith-wczm-product-images-widget.php +80 -80
  23. lib/functions.yith-ywzm.php +39 -39
  24. plugin-fw/LICENSE.txt +695 -695
  25. plugin-fw/assets/css/admin.css +338 -338
  26. plugin-fw/assets/css/codemirror/codemirror.css +260 -260
  27. plugin-fw/assets/css/colorbox.css +65 -65
  28. plugin-fw/assets/css/elementor.css +35 -35
  29. plugin-fw/assets/css/metaboxes.css +751 -751
  30. plugin-fw/assets/css/yit-plugin-panel.css +1087 -1087
  31. plugin-fw/assets/css/yit-upgrade-to-pro.css +82 -82
  32. plugin-fw/assets/css/yit-upgrader.css +21 -21
  33. plugin-fw/assets/css/yith-fields.css +937 -2280
assets/css/admin.css CHANGED
@@ -1,131 +1,131 @@
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
- }
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,117 +1,117 @@
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
- .yith_slider_arrow span{
34
- display: table-cell;
35
- text-align: center;
36
- vertical-align: middle;
37
- }
38
-
39
-
40
- .single-product.woocommerce .thumbnails #slider-prev,
41
- .single-product.woocommerce .thumbnails #slider-next {
42
- display: none;
43
- cursor: pointer;
44
- width: 25px;
45
- height: 25px;
46
- position: absolute;
47
- top: 50%;
48
- transform: translateY( -50% );
49
- }
50
-
51
- .single-product.woocommerce .thumbnails #slider-prev {
52
- background-position: left center;
53
- left: 1px;
54
- }
55
-
56
- .single-product.woocommerce .thumbnails #slider-next {
57
- background-position: right center;
58
- right: 0px;
59
- }
60
-
61
- .single-product.woocommerce .thumbnails:hover #slider-prev,
62
- .single-product.woocommerce .thumbnails:hover #slider-next {
63
- display: block !important;
64
- }
65
-
66
- span.onsale {
67
- z-index: 10000
68
- }
69
-
70
- div.pp_woocommerce a.yith_expand {
71
- /*background: url("../icons/lightbox.svg") no-repeat center center;*/
72
- display: inline;
73
- cursor: pointer;
74
- font-size: 25px;
75
- position: absolute;
76
- text-decoration: none;
77
- text-indent: -10000px;
78
- z-index: 20000;
79
- height: 25px;
80
- width: 25px;
81
- line-height: 1em;
82
- }
83
-
84
- .expand-button-hidden svg{
85
- display: block;
86
- padding: 2px;
87
- }
88
-
89
-
90
- div.pp_woocommerce span.yith_zoom_icon {
91
- /*background: url("../icons/zoom.svg") no-repeat center center;*/
92
- display: inline;
93
- cursor: default;
94
- font-size: 25px;
95
- position: absolute;
96
- text-decoration: none;
97
- text-indent: -10000px;
98
- z-index: 20000;
99
- height: 25px;
100
- width: 25px;
101
- line-height: 1em;
102
- }
103
-
104
- .zoom-button-hidden svg{
105
- display: block;
106
- padding: 5px;
107
- }
108
-
109
- .expand-button-hidden svg {
110
- display: block;
111
- padding: 5px;
112
- }
113
-
114
-
115
- .elementor-widget-wrap .yith_magnifier_zoom.woocommerce-main-image img{
116
- width: 100%;
117
- }
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
+ .yith_slider_arrow span{
34
+ display: table-cell;
35
+ text-align: center;
36
+ vertical-align: middle;
37
+ }
38
+
39
+
40
+ .single-product.woocommerce .thumbnails #slider-prev,
41
+ .single-product.woocommerce .thumbnails #slider-next {
42
+ display: none;
43
+ cursor: pointer;
44
+ width: 25px;
45
+ height: 25px;
46
+ position: absolute;
47
+ top: 50%;
48
+ transform: translateY( -50% );
49
+ }
50
+
51
+ .single-product.woocommerce .thumbnails #slider-prev {
52
+ background-position: left center;
53
+ left: 1px;
54
+ }
55
+
56
+ .single-product.woocommerce .thumbnails #slider-next {
57
+ background-position: right center;
58
+ right: 0px;
59
+ }
60
+
61
+ .single-product.woocommerce .thumbnails:hover #slider-prev,
62
+ .single-product.woocommerce .thumbnails:hover #slider-next {
63
+ display: block !important;
64
+ }
65
+
66
+ span.onsale {
67
+ z-index: 10000
68
+ }
69
+
70
+ div.pp_woocommerce a.yith_expand {
71
+ /*background: url("../icons/lightbox.svg") no-repeat center center;*/
72
+ display: inline;
73
+ cursor: pointer;
74
+ font-size: 25px;
75
+ position: absolute;
76
+ text-decoration: none;
77
+ text-indent: -10000px;
78
+ z-index: 20000;
79
+ height: 25px;
80
+ width: 25px;
81
+ line-height: 1em;
82
+ }
83
+
84
+ .expand-button-hidden svg{
85
+ display: block;
86
+ padding: 2px;
87
+ }
88
+
89
+
90
+ div.pp_woocommerce span.yith_zoom_icon {
91
+ /*background: url("../icons/zoom.svg") no-repeat center center;*/
92
+ display: inline;
93
+ cursor: default;
94
+ font-size: 25px;
95
+ position: absolute;
96
+ text-decoration: none;
97
+ text-indent: -10000px;
98
+ z-index: 20000;
99
+ height: 25px;
100
+ width: 25px;
101
+ line-height: 1em;
102
+ }
103
+
104
+ .zoom-button-hidden svg{
105
+ display: block;
106
+ padding: 5px;
107
+ }
108
+
109
+ .expand-button-hidden svg {
110
+ display: block;
111
+ padding: 5px;
112
+ }
113
+
114
+
115
+ .elementor-widget-wrap .yith_magnifier_zoom.woocommerce-main-image img{
116
+ width: 100%;
117
+ }
assets/css/yith_magnifier.css CHANGED
@@ -1,90 +1,90 @@
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
- }
86
-
87
- /* Fix the blocked zoom box */
88
- .woocommerce-product-gallery__image > .yith_magnifier_zoom_magnifier{
89
- display: none !important;
90
- }
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
+ }
86
+
87
+ /* Fix the blocked zoom box */
88
+ .woocommerce-product-gallery__image > .yith_magnifier_zoom_magnifier{
89
+ display: none !important;
90
+ }
assets/js/init.prettyPhoto.js CHANGED
@@ -1,935 +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.
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,3823 +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
- 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);
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=!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);
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();e=t.parent()[e.d[s]]();return i&&t.show(),e}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];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&&(e=e.triggerHandler(cf_e("currentPosition",s)),$.fn.carouFredSel.cookie.set(t,e))}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&&(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])},l=a.data("_cfs_origCssMargin"),0<u&&(l+=opts.padding[opts.d[3]]),P[opts.d.marginRight]=l,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,1041 +1,1041 @@
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 );
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/ywzm_backend.js CHANGED
@@ -1,88 +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
- });
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_frontend.js CHANGED
@@ -1,294 +1,294 @@
1
- /**
2
- * Frontend JS
3
- *
4
- * @author YITH
5
- * @package YITH\ZoomMagnifier\Assets\JS
6
- */
7
-
8
- jQuery(
9
- function ($) {
10
-
11
- var yith_wcmg = $( '.images' );
12
- var yith_wcmg_zoom = $( '.yith_magnifier_zoom' );
13
- var yith_wcmg_image = $( '.yith_magnifier_zoom img' ).first();
14
-
15
- var yith_wcmg_default_zoom = yith_wcmg.find( '.yith_magnifier_zoom' ).attr( 'href' );
16
- var yith_wcmg_default_image = yith_wcmg.find( '.yith_magnifier_zoom img' ).attr( 'src' );
17
-
18
- var yith_wcmg_default_gallery = yith_wcmg.find( '.thumbnails' );
19
-
20
- if (typeof yith_magnifier_options == 'undefined') {
21
- return false;
22
- }
23
-
24
- yith_wcmg.yith_magnifier( yith_magnifier_options );
25
-
26
- $( document ).on(
27
- 'found_variation',
28
- 'form.variations_form',
29
- function (event, variation) {
30
- var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
31
-
32
- var image_src = yith_wcmg_default_image;
33
-
34
- if (variation.image.src) {
35
- image_src = variation.image.src;
36
- }
37
-
38
- yith_wcmg_zoom.attr( 'href', image_magnifier );
39
- yith_wcmg_image.attr( 'src', image_src );
40
- yith_wcmg_image.attr( 'srcset', image_src );
41
- yith_wcmg_image.attr( 'src-orig', image_src );
42
-
43
- if (yith_wcmg.data( 'yith_magnifier' )) {
44
- yith_wcmg.yith_magnifier( 'destroy' );
45
- }
46
-
47
- yith_wcmg.yith_magnifier( yith_magnifier_options );
48
- }
49
- ).on(
50
- 'reset_image',
51
- function (event) {
52
-
53
- yith_wcmg_zoom.attr( 'href', yith_wcmg_default_zoom );
54
- yith_wcmg_image.attr( 'src', yith_wcmg_default_image );
55
- yith_wcmg_image.attr( 'srcset', yith_wcmg_default_image );
56
- yith_wcmg_image.attr( 'src-orig', yith_wcmg_default_image );
57
-
58
- yith_wcmg.find( '.thumbnails' ).replaceWith( yith_wcmg_default_gallery );
59
-
60
- if (yith_wcmg.data( 'yith_magnifier' )) {
61
- yith_wcmg.yith_magnifier( 'destroy' );
62
- }
63
-
64
- yith_wcmg.yith_magnifier( yith_magnifier_options );
65
- }
66
- );
67
-
68
- if ( $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).length ) {
69
-
70
- $( 'form.variations_form .variations select' ).trigger( 'change' );
71
-
72
- function yith_wc_zm_carousel(){
73
-
74
- $( ".single-product.woocommerce div.product div.images div.thumbnails" ).css( 'width', $( ".single-product.woocommerce div.product div.images div.thumbnails" ).width() );
75
-
76
- var yith_wc_zm_circular = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'circular' );
77
- var yith_wc_zm_columns = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'columns' );
78
-
79
- var slider_infinite = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'slider_infinite' );
80
-
81
- // We retrieve the value of the width of a li and the margin to later on multiple it for the numeber of li's and set the width of the ul parent .
82
- var li_width = $( ".single-product.woocommerce div.product div.images .yith_magnifier_gallery li" ).width();
83
- var li_margin_left = $( ".single-product.woocommerce div.product div.images .yith_magnifier_gallery li" ).css( 'margin-left' );
84
-
85
- if ( typeof li_margin_left == 'undefined') {
86
- var li_margin_left_num = 0;
87
- } else {
88
- var li_margin_left_num = li_margin_left.split( "px" ).shift();
89
- }
90
-
91
- // We create an array with all the possible positions and adjust all the li's with a width width px because they were created by % via PHP
92
- // and we are goint to set the width of the ul which contains the li's.
93
- var yith_margins_array = [];
94
- var yith_margins_option = 0;
95
- yith_margins_array.push( yith_margins_option );
96
-
97
- var loop = 1;
98
- $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery li' ).each(
99
- function() {
100
-
101
- $( this ).css( 'width', li_width + 'px' );
102
- $( this ).css( 'margin-left', li_margin_left );
103
- $( this ).css( 'margin-right', li_margin_left );
104
- $( this ).show();
105
-
106
- yith_margins_option = yith_margins_option + ( ( li_margin_left_num * 2 ) + li_width );
107
-
108
- yith_margins_array.push( yith_margins_option );
109
-
110
- loop++;
111
-
112
- }
113
- );
114
-
115
- // set the width of the ul parent.
116
- var ul_w = yith_margins_option;
117
- $( ".single-product.woocommerce div.product div.images .yith_magnifier_gallery" ).css( 'width', ul_w + 'px' );
118
-
119
- $( "#slider-next" ).css( 'top', '50%' );
120
- $( "#slider-next" ).css( 'transform', 'translateY( -50% )' );
121
-
122
- $( "#slider-prev" ).css( 'top', '50%' );
123
- $( "#slider-prev" ).css( 'transform', 'translateY( -50% )' );
124
-
125
- var index_yith_margins_array = 0;
126
-
127
- $( "body" ).on(
128
- "click",
129
- "#slider-next",
130
- function () {
131
-
132
- if ( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next().is( 'li' ) ) {
133
-
134
- index_yith_margins_array++;
135
- $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
136
- {
137
- marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
138
- }
139
- );
140
-
141
- var next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).next();
142
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
143
- next.addClass( 'first' );
144
-
145
- next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next();
146
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
147
- next.addClass( 'last' );
148
-
149
- } else if ( ( yith_wc_zm_circular == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is( ':animated' ) ) {
150
-
151
- index_yith_margins_array--;
152
- $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).css( 'margin-left', '-' + yith_margins_array[ index_yith_margins_array ] + 'px' );
153
-
154
- var last = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li' ).first();
155
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).after( last );
156
-
157
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
158
- last.addClass( 'last' );
159
-
160
- var first = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).next();
161
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
162
- first.addClass( 'first' );
163
-
164
- index_yith_margins_array++;
165
- $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
166
- {
167
- marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
168
- }
169
- );
170
-
171
- } else if ( ( slider_infinite == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is( ':animated' ) ) {
172
-
173
- while ( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev().is( 'li' ) ) {
174
-
175
- var prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev();
176
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
177
- prev.addClass( 'first' );
178
-
179
- prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).prev();
180
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
181
- prev.addClass( 'last' );
182
-
183
- }
184
-
185
- index_yith_margins_array = 0;
186
- $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
187
- {
188
- marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
189
- }
190
- );
191
- }
192
-
193
- }
194
- );
195
-
196
- $( "body" ).on(
197
- "click",
198
- "#slider-prev",
199
- function () {
200
-
201
- if ( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev().is( 'li' ) ) {
202
-
203
- index_yith_margins_array--;
204
- $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
205
- {
206
- marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
207
- }
208
- );
209
-
210
- var prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev();
211
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
212
- prev.addClass( 'first' );
213
-
214
- prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).prev();
215
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
216
- prev.addClass( 'last' );
217
-
218
- } else if ( ( yith_wc_zm_circular == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is( ':animated' ) ) {
219
-
220
- index_yith_margins_array++;
221
- $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).css( 'margin-left', '-' + yith_margins_array[index_yith_margins_array] + 'px' );
222
-
223
- var first = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li' ).last();
224
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).before( first );
225
-
226
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
227
- first.addClass( 'first' );
228
-
229
- var last = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).prev();
230
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
231
- last.addClass( 'last' );
232
-
233
- index_yith_margins_array--;
234
- $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
235
- {
236
- marginLeft: '-' + yith_margins_array[index_yith_margins_array] + 'px',
237
- }
238
- );
239
-
240
- } else if ( ( slider_infinite == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is( ':animated' ) ) {
241
-
242
- while ( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next().is( 'li' ) ) {
243
-
244
- var next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).next();
245
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
246
- next.addClass( 'first' );
247
-
248
- next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next();
249
- $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
250
- next.addClass( 'last' );
251
-
252
- }
253
-
254
- index_yith_margins_array = yith_margins_array.length - 1 - yith_wc_zm_columns;
255
- $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
256
- {
257
- marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
258
- }
259
- );
260
- }
261
-
262
- }
263
- );
264
-
265
- }
266
-
267
- function yith_wc_zm_auto_carousel(){
268
-
269
- $( '#slider-next' ).click();
270
-
271
- setTimeout( yith_wc_zm_auto_carousel, 3000 );
272
-
273
- }
274
-
275
- yith_wc_zm_carousel();
276
-
277
- var auto_carousel = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'auto_carousel' );
278
-
279
- if ( auto_carousel == 'yes' ) {
280
- setTimeout( yith_wc_zm_auto_carousel, 3000 );
281
- }
282
-
283
- $(document).on('mouseover', '.yith_slider_arrow', function (e) {
284
- $( this ).find('path').css( 'fill', ywzm_data.slider_colors_hover_array['arrow'] );
285
- });
286
-
287
- $(document).on('mouseout', '.yith_slider_arrow', function (e) {
288
- $( this ).find( 'path').css( 'fill', ywzm_data.slider_colors_array['arrow'] );
289
- });
290
-
291
- }
292
-
293
- }
294
- );
1
+ /**
2
+ * Frontend JS
3
+ *
4
+ * @author YITH
5
+ * @package YITH\ZoomMagnifier\Assets\JS
6
+ */
7
+
8
+ jQuery(
9
+ function ($) {
10
+
11
+ var yith_wcmg = $( '.images' );
12
+ var yith_wcmg_zoom = $( '.yith_magnifier_zoom' );
13
+ var yith_wcmg_image = $( '.yith_magnifier_zoom img' ).first();
14
+
15
+ var yith_wcmg_default_zoom = yith_wcmg.find( '.yith_magnifier_zoom' ).attr( 'href' );
16
+ var yith_wcmg_default_image = yith_wcmg.find( '.yith_magnifier_zoom img' ).attr( 'src' );
17
+
18
+ var yith_wcmg_default_gallery = yith_wcmg.find( '.thumbnails' );
19
+
20
+ if (typeof yith_magnifier_options == 'undefined') {
21
+ return false;
22
+ }
23
+
24
+ yith_wcmg.yith_magnifier( yith_magnifier_options );
25
+
26
+ $( document ).on(
27
+ 'found_variation',
28
+ 'form.variations_form',
29
+ function (event, variation) {
30
+ var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
31
+
32
+ var image_src = yith_wcmg_default_image;
33
+
34
+ if (variation.image.src) {
35
+ image_src = variation.image.src;
36
+ }
37
+
38
+ yith_wcmg_zoom.attr( 'href', image_magnifier );
39
+ yith_wcmg_image.attr( 'src', image_src );
40
+ yith_wcmg_image.attr( 'srcset', image_src );
41
+ yith_wcmg_image.attr( 'src-orig', image_src );
42
+
43
+ if (yith_wcmg.data( 'yith_magnifier' )) {
44
+ yith_wcmg.yith_magnifier( 'destroy' );
45
+ }
46
+
47
+ yith_wcmg.yith_magnifier( yith_magnifier_options );
48
+ }
49
+ ).on(
50
+ 'reset_image',
51
+ function (event) {
52
+
53
+ yith_wcmg_zoom.attr( 'href', yith_wcmg_default_zoom );
54
+ yith_wcmg_image.attr( 'src', yith_wcmg_default_image );
55
+ yith_wcmg_image.attr( 'srcset', yith_wcmg_default_image );
56
+ yith_wcmg_image.attr( 'src-orig', yith_wcmg_default_image );
57
+
58
+ yith_wcmg.find( '.thumbnails' ).replaceWith( yith_wcmg_default_gallery );
59
+
60
+ if (yith_wcmg.data( 'yith_magnifier' )) {
61
+ yith_wcmg.yith_magnifier( 'destroy' );
62
+ }
63
+
64
+ yith_wcmg.yith_magnifier( yith_magnifier_options );
65
+ }
66
+ );
67
+
68
+ if ( $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).length ) {
69
+
70
+ $( 'form.variations_form .variations select' ).trigger( 'change' );
71
+
72
+ function yith_wc_zm_carousel(){
73
+
74
+ $( ".single-product.woocommerce div.product div.images div.thumbnails" ).css( 'width', $( ".single-product.woocommerce div.product div.images div.thumbnails" ).width() );
75
+
76
+ var yith_wc_zm_circular = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'circular' );
77
+ var yith_wc_zm_columns = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'columns' );
78
+
79
+ var slider_infinite = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'slider_infinite' );
80
+
81
+ // We retrieve the value of the width of a li and the margin to later on multiple it for the numeber of li's and set the width of the ul parent .
82
+ var li_width = $( ".single-product.woocommerce div.product div.images .yith_magnifier_gallery li" ).width();
83
+ var li_margin_left = $( ".single-product.woocommerce div.product div.images .yith_magnifier_gallery li" ).css( 'margin-left' );
84
+
85
+ if ( typeof li_margin_left == 'undefined') {
86
+ var li_margin_left_num = 0;
87
+ } else {
88
+ var li_margin_left_num = li_margin_left.split( "px" ).shift();
89
+ }
90
+
91
+ // We create an array with all the possible positions and adjust all the li's with a width width px because they were created by % via PHP
92
+ // and we are goint to set the width of the ul which contains the li's.
93
+ var yith_margins_array = [];
94
+ var yith_margins_option = 0;
95
+ yith_margins_array.push( yith_margins_option );
96
+
97
+ var loop = 1;
98
+ $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery li' ).each(
99
+ function() {
100
+
101
+ $( this ).css( 'width', li_width + 'px' );
102
+ $( this ).css( 'margin-left', li_margin_left );
103
+ $( this ).css( 'margin-right', li_margin_left );
104
+ $( this ).show();
105
+
106
+ yith_margins_option = yith_margins_option + ( ( li_margin_left_num * 2 ) + li_width );
107
+
108
+ yith_margins_array.push( yith_margins_option );
109
+
110
+ loop++;
111
+
112
+ }
113
+ );
114
+
115
+ // set the width of the ul parent.
116
+ var ul_w = yith_margins_option;
117
+ $( ".single-product.woocommerce div.product div.images .yith_magnifier_gallery" ).css( 'width', ul_w + 'px' );
118
+
119
+ $( "#slider-next" ).css( 'top', '50%' );
120
+ $( "#slider-next" ).css( 'transform', 'translateY( -50% )' );
121
+
122
+ $( "#slider-prev" ).css( 'top', '50%' );
123
+ $( "#slider-prev" ).css( 'transform', 'translateY( -50% )' );
124
+
125
+ var index_yith_margins_array = 0;
126
+
127
+ $( "body" ).on(
128
+ "click",
129
+ "#slider-next",
130
+ function () {
131
+
132
+ if ( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next().is( 'li' ) ) {
133
+
134
+ index_yith_margins_array++;
135
+ $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
136
+ {
137
+ marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
138
+ }
139
+ );
140
+
141
+ var next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).next();
142
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
143
+ next.addClass( 'first' );
144
+
145
+ next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next();
146
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
147
+ next.addClass( 'last' );
148
+
149
+ } else if ( ( yith_wc_zm_circular == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is( ':animated' ) ) {
150
+
151
+ index_yith_margins_array--;
152
+ $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).css( 'margin-left', '-' + yith_margins_array[ index_yith_margins_array ] + 'px' );
153
+
154
+ var last = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li' ).first();
155
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).after( last );
156
+
157
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
158
+ last.addClass( 'last' );
159
+
160
+ var first = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).next();
161
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
162
+ first.addClass( 'first' );
163
+
164
+ index_yith_margins_array++;
165
+ $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
166
+ {
167
+ marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
168
+ }
169
+ );
170
+
171
+ } else if ( ( slider_infinite == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is( ':animated' ) ) {
172
+
173
+ while ( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev().is( 'li' ) ) {
174
+
175
+ var prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev();
176
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
177
+ prev.addClass( 'first' );
178
+
179
+ prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).prev();
180
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
181
+ prev.addClass( 'last' );
182
+
183
+ }
184
+
185
+ index_yith_margins_array = 0;
186
+ $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
187
+ {
188
+ marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
189
+ }
190
+ );
191
+ }
192
+
193
+ }
194
+ );
195
+
196
+ $( "body" ).on(
197
+ "click",
198
+ "#slider-prev",
199
+ function () {
200
+
201
+ if ( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev().is( 'li' ) ) {
202
+
203
+ index_yith_margins_array--;
204
+ $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
205
+ {
206
+ marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
207
+ }
208
+ );
209
+
210
+ var prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev();
211
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
212
+ prev.addClass( 'first' );
213
+
214
+ prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).prev();
215
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
216
+ prev.addClass( 'last' );
217
+
218
+ } else if ( ( yith_wc_zm_circular == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is( ':animated' ) ) {
219
+
220
+ index_yith_margins_array++;
221
+ $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).css( 'margin-left', '-' + yith_margins_array[index_yith_margins_array] + 'px' );
222
+
223
+ var first = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li' ).last();
224
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).before( first );
225
+
226
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
227
+ first.addClass( 'first' );
228
+
229
+ var last = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).prev();
230
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
231
+ last.addClass( 'last' );
232
+
233
+ index_yith_margins_array--;
234
+ $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
235
+ {
236
+ marginLeft: '-' + yith_margins_array[index_yith_margins_array] + 'px',
237
+ }
238
+ );
239
+
240
+ } else if ( ( slider_infinite == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is( ':animated' ) ) {
241
+
242
+ while ( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next().is( 'li' ) ) {
243
+
244
+ var next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).next();
245
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
246
+ next.addClass( 'first' );
247
+
248
+ next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next();
249
+ $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
250
+ next.addClass( 'last' );
251
+
252
+ }
253
+
254
+ index_yith_margins_array = yith_margins_array.length - 1 - yith_wc_zm_columns;
255
+ $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate(
256
+ {
257
+ marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
258
+ }
259
+ );
260
+ }
261
+
262
+ }
263
+ );
264
+
265
+ }
266
+
267
+ function yith_wc_zm_auto_carousel(){
268
+
269
+ $( '#slider-next' ).click();
270
+
271
+ setTimeout( yith_wc_zm_auto_carousel, 3000 );
272
+
273
+ }
274
+
275
+ yith_wc_zm_carousel();
276
+
277
+ var auto_carousel = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'auto_carousel' );
278
+
279
+ if ( auto_carousel == 'yes' ) {
280
+ setTimeout( yith_wc_zm_auto_carousel, 3000 );
281
+ }
282
+
283
+ $(document).on('mouseover', '.yith_slider_arrow', function (e) {
284
+ $( this ).find('path').css( 'fill', ywzm_data.slider_colors_hover_array['arrow'] );
285
+ });
286
+
287
+ $(document).on('mouseout', '.yith_slider_arrow', function (e) {
288
+ $( this ).find( 'path').css( 'fill', ywzm_data.slider_colors_array['arrow'] );
289
+ });
290
+
291
+ }
292
+
293
+ }
294
+ );
changelog.txt CHANGED
@@ -1,191 +1,191 @@
1
- === YITH WooCommerce Zoom Magnifier ===
2
-
3
- == Changelog History ==
4
-
5
- = Version 1.2.18 - Released: May 02, 2016 =
6
-
7
- * Updated: plugin compatible with WordPress 4.5
8
- * Updated: plugin author name
9
- * Updated: YITH Plugin Framework
10
-
11
- = Version 1.2.17 - Released: Feb 24, 2016 =
12
-
13
- * Updated: YITH Plugin FW
14
- * Fixed: removed trailing comma in JS script that break the page rendering on old IE browser
15
-
16
- = Version 1.2.16 - Released: Jan 18, 2016 =
17
-
18
- * Updated: YITH Plugin FW loading remove unused YIT constant
19
- * Added: filter yith_ywzm_zoom_wrap_additional_css for customizing CSS class for the wrapping div
20
- * Updated: plugin ready for WooCommerce 2.5
21
-
22
- = Version 1.2.15 - Released: Jan 04, 2016 =
23
-
24
- * Fixed: Cannot redeclare yith_ywzm_install_woocommerce_admin_notice() when the plugin is loaded from YITH Essential Kit
25
-
26
- = Version 1.2.14 - Released: Dec 29, 2015 =
27
-
28
- * Added: Compatibility with YIT WooCommerce Featured Audio & Video Content
29
-
30
- = Version 1.2.13 - Released: Dec 21, 2015 =
31
-
32
- * Fixed: multiple wrap of zoom element with the div with class yith_magnifier_zoom_wrap
33
- * Updated: jquery-ui.css is no more linked as external resource but shipped within the plugin, as wordpress.org asked
34
-
35
- = Version 1.2.12 - Released: Oct 29, 2015 =
36
-
37
- * Updated: YITH plugin framework
38
-
39
- = Version 1.2.11 - Released: Oct 23, 2015 =
40
-
41
- * Updated: compatibility with YITH WooCommerce Quick View.
42
-
43
- = Version 1.2.10 - Released: Sep 24, 2015 =
44
-
45
- * Updated: changed text domain as translate.wordpress.org requisite.
46
-
47
- = Version 1.2.9 - Released: Sep 04, 2015 =
48
-
49
- * Updated: Languages file
50
- * Fixed: Changed plugin text domain from yit to ywmz
51
- * Fixed: featured image shown one time on slider.
52
- * Fixed: div not shown if loading text is empty.
53
-
54
- = Version 1.2.8 - Released: Sep 01, 2015 =
55
-
56
- * Fixed: removed deprecated woocommerce_update_option_X hook.
57
-
58
- = Version 1.2.7 - Released: Aug 27, 2015 =
59
-
60
- * Fixed: resolved XSS vulnerability.
61
-
62
- = Version 1.2.6 - Released: Aug 12, 2015 =
63
-
64
- * Tweak: update YITH Plugin framework.
65
-
66
- = Version 1.2.5 - Released: Jul 23, 2015 =
67
-
68
- * Added: italian language.
69
-
70
- = Version 1.2.4 - Released: Jun 26, 2015 =
71
-
72
- * Added: support to srcset and src-orig attributes.
73
-
74
- = Version 1.2.3 - Released: May 29, 2015 =
75
-
76
- * Added: included jquery-migrate as prerequisite.
77
-
78
- = Version 1.2.2 - Released: May 22, 2015 =
79
-
80
- * Fixed: CSS fix for EssentialGrid conflicts.
81
-
82
- = Version 1.2.1 - Released: May 04, 2015 =
83
-
84
- * Fixed: removed z-index that made the zoom area hiding other elements in certain themes.
85
-
86
- = Version 1.2.0 - Released: Apr 22, 2015 =
87
-
88
- * Fix : security issue (https://make.wordpress.org/plugins/2015/04/20/fixing-add_query_arg-and-remove_query_arg-usage/)
89
- * Tweak : support up to Wordpress 4.2
90
-
91
- = 1.1.8 =
92
-
93
- * Fixed: compatibility with some YITHEMES themes.
94
-
95
- = 1.1.7 =
96
-
97
- * Fixed: Unwanted expand link on product image.
98
-
99
- = 1.1.6 =
100
-
101
- * Added: the plugin can be disabled on mobile devices.
102
-
103
- = 1.1.5 =
104
-
105
- * Fixed: multiple wrap
106
-
107
- = 1.1.4 =
108
-
109
- * Tweak: WooCommerce 2.2. support
110
- * Fixed: Placeholder in product without featured image
111
- * Fixed: Slider items number options doesn't work
112
-
113
- = 1.1.3 =
114
-
115
- * Added: Support to WC 2.2.2
116
- * Updated: Plugin Core Framework
117
-
118
- = 1.1.2 =
119
-
120
- * Restored: Image size options on WC 2.1.x
121
- * Fixed: Items number option on thumb slider
122
- * Fixed: Hard crop issue on WC 2.1.x
123
-
124
- = 1.1.1 =
125
-
126
- * Fixed: Thumbnails slider direction on single product page
127
-
128
- = 1.1.0 =
129
-
130
- * Added: Support to WooCommerce 2.1.x
131
-
132
- = 1.0.8 =
133
-
134
- * Added: ability to change the slider programmatically
135
-
136
- = 1.0.7 =
137
-
138
- * Fixed: zoomed image did not change when select a variation
139
-
140
- = 1.0.6 =
141
-
142
- * Removed white space from frontend.php
143
-
144
- = 1.0.5 =
145
-
146
- * Fixed: magnifier override the plugin for featured video
147
-
148
- = 1.0.4 =
149
-
150
- * Minor bugs fixes
151
-
152
- = 1.0.3 =
153
-
154
- * Added ability to load the plugin even when WooCommerce is installed in a different folder
155
-
156
- = 1.0.2 =
157
-
158
- * Fixed fatal error to yit_debug with yit themes
159
-
160
- = 1.0.1 =
161
-
162
- * Optimized images
163
- * Updated internal framework
164
-
165
- = 1.0.0 =
166
-
167
- * Initial release
168
-
169
- == Suggestions ==
170
-
171
- If you have suggestions about how to improve YITH WooCommerce Zoom Magnifier, you can [write us](mailto:plugins@yithemes.com "Your Inspiration Themes") so we can bundle them into YITH Zoom WooCommerce Magnifier.
172
-
173
- == Translators ==
174
-
175
- = Available Languages =
176
- * English (Default)
177
- * Italian
178
- * Spanish
179
-
180
- If you have created your own language pack, or have an update for an existing one, you can send [gettext PO and MO file](http://codex.wordpress.org/Translating_WordPress "Translating WordPress")
181
- [use](http://yithemes.com/contact/ "Your Inspiration Themes") so we can bundle it into YITH WooCommerce Zoom Magnfier Languages.
182
-
183
- == Documentation ==
184
-
185
- Full documentation is available [here](http://yithemes.com/docs-plugins/yith_woocommerce_magnifier/).
186
-
187
- == Upgrade notice ==
188
-
189
- = 1.0.0 =
190
-
191
  Initial release
1
+ === YITH WooCommerce Zoom Magnifier ===
2
+
3
+ == Changelog History ==
4
+
5
+ = Version 1.2.18 - Released: May 02, 2016 =
6
+
7
+ * Updated: plugin compatible with WordPress 4.5
8
+ * Updated: plugin author name
9
+ * Updated: YITH Plugin Framework
10
+
11
+ = Version 1.2.17 - Released: Feb 24, 2016 =
12
+
13
+ * Updated: YITH Plugin FW
14
+ * Fixed: removed trailing comma in JS script that break the page rendering on old IE browser
15
+
16
+ = Version 1.2.16 - Released: Jan 18, 2016 =
17
+
18
+ * Updated: YITH Plugin FW loading remove unused YIT constant
19
+ * Added: filter yith_ywzm_zoom_wrap_additional_css for customizing CSS class for the wrapping div
20
+ * Updated: plugin ready for WooCommerce 2.5
21
+
22
+ = Version 1.2.15 - Released: Jan 04, 2016 =
23
+
24
+ * Fixed: Cannot redeclare yith_ywzm_install_woocommerce_admin_notice() when the plugin is loaded from YITH Essential Kit
25
+
26
+ = Version 1.2.14 - Released: Dec 29, 2015 =
27
+
28
+ * Added: Compatibility with YIT WooCommerce Featured Audio & Video Content
29
+
30
+ = Version 1.2.13 - Released: Dec 21, 2015 =
31
+
32
+ * Fixed: multiple wrap of zoom element with the div with class yith_magnifier_zoom_wrap
33
+ * Updated: jquery-ui.css is no more linked as external resource but shipped within the plugin, as wordpress.org asked
34
+
35
+ = Version 1.2.12 - Released: Oct 29, 2015 =
36
+
37
+ * Updated: YITH plugin framework
38
+
39
+ = Version 1.2.11 - Released: Oct 23, 2015 =
40
+
41
+ * Updated: compatibility with YITH WooCommerce Quick View.
42
+
43
+ = Version 1.2.10 - Released: Sep 24, 2015 =
44
+
45
+ * Updated: changed text domain as translate.wordpress.org requisite.
46
+
47
+ = Version 1.2.9 - Released: Sep 04, 2015 =
48
+
49
+ * Updated: Languages file
50
+ * Fixed: Changed plugin text domain from yit to ywmz
51
+ * Fixed: featured image shown one time on slider.
52
+ * Fixed: div not shown if loading text is empty.
53
+
54
+ = Version 1.2.8 - Released: Sep 01, 2015 =
55
+
56
+ * Fixed: removed deprecated woocommerce_update_option_X hook.
57
+
58
+ = Version 1.2.7 - Released: Aug 27, 2015 =
59
+
60
+ * Fixed: resolved XSS vulnerability.
61
+
62
+ = Version 1.2.6 - Released: Aug 12, 2015 =
63
+
64
+ * Tweak: update YITH Plugin framework.
65
+
66
+ = Version 1.2.5 - Released: Jul 23, 2015 =
67
+
68
+ * Added: italian language.
69
+
70
+ = Version 1.2.4 - Released: Jun 26, 2015 =
71
+
72
+ * Added: support to srcset and src-orig attributes.
73
+
74
+ = Version 1.2.3 - Released: May 29, 2015 =
75
+
76
+ * Added: included jquery-migrate as prerequisite.
77
+
78
+ = Version 1.2.2 - Released: May 22, 2015 =
79
+
80
+ * Fixed: CSS fix for EssentialGrid conflicts.
81
+
82
+ = Version 1.2.1 - Released: May 04, 2015 =
83
+
84
+ * Fixed: removed z-index that made the zoom area hiding other elements in certain themes.
85
+
86
+ = Version 1.2.0 - Released: Apr 22, 2015 =
87
+
88
+ * Fix : security issue (https://make.wordpress.org/plugins/2015/04/20/fixing-add_query_arg-and-remove_query_arg-usage/)
89
+ * Tweak : support up to Wordpress 4.2
90
+
91
+ = 1.1.8 =
92
+
93
+ * Fixed: compatibility with some YITHEMES themes.
94
+
95
+ = 1.1.7 =
96
+
97
+ * Fixed: Unwanted expand link on product image.
98
+
99
+ = 1.1.6 =
100
+
101
+ * Added: the plugin can be disabled on mobile devices.
102
+
103
+ = 1.1.5 =
104
+
105
+ * Fixed: multiple wrap
106
+
107
+ = 1.1.4 =
108
+
109
+ * Tweak: WooCommerce 2.2. support
110
+ * Fixed: Placeholder in product without featured image
111
+ * Fixed: Slider items number options doesn't work
112
+
113
+ = 1.1.3 =
114
+
115
+ * Added: Support to WC 2.2.2
116
+ * Updated: Plugin Core Framework
117
+
118
+ = 1.1.2 =
119
+
120
+ * Restored: Image size options on WC 2.1.x
121
+ * Fixed: Items number option on thumb slider
122
+ * Fixed: Hard crop issue on WC 2.1.x
123
+
124
+ = 1.1.1 =
125
+
126
+ * Fixed: Thumbnails slider direction on single product page
127
+
128
+ = 1.1.0 =
129
+
130
+ * Added: Support to WooCommerce 2.1.x
131
+
132
+ = 1.0.8 =
133
+
134
+ * Added: ability to change the slider programmatically
135
+
136
+ = 1.0.7 =
137
+
138
+ * Fixed: zoomed image did not change when select a variation
139
+
140
+ = 1.0.6 =
141
+
142
+ * Removed white space from frontend.php
143
+
144
+ = 1.0.5 =
145
+
146
+ * Fixed: magnifier override the plugin for featured video
147
+
148
+ = 1.0.4 =
149
+
150
+ * Minor bugs fixes
151
+
152
+ = 1.0.3 =
153
+
154
+ * Added ability to load the plugin even when WooCommerce is installed in a different folder
155
+
156
+ = 1.0.2 =
157
+
158
+ * Fixed fatal error to yit_debug with yit themes
159
+
160
+ = 1.0.1 =
161
+
162
+ * Optimized images
163
+ * Updated internal framework
164
+
165
+ = 1.0.0 =
166
+
167
+ * Initial release
168
+
169
+ == Suggestions ==
170
+
171
+ If you have suggestions about how to improve YITH WooCommerce Zoom Magnifier, you can [write us](mailto:plugins@yithemes.com "Your Inspiration Themes") so we can bundle them into YITH Zoom WooCommerce Magnifier.
172
+
173
+ == Translators ==
174
+
175
+ = Available Languages =
176
+ * English (Default)
177
+ * Italian
178
+ * Spanish
179
+
180
+ If you have created your own language pack, or have an update for an existing one, you can send [gettext PO and MO file](http://codex.wordpress.org/Translating_WordPress "Translating WordPress")
181
+ [use](http://yithemes.com/contact/ "Your Inspiration Themes") so we can bundle it into YITH WooCommerce Zoom Magnfier Languages.
182
+
183
+ == Documentation ==
184
+
185
+ Full documentation is available [here](http://yithemes.com/docs-plugins/yith_woocommerce_magnifier/).
186
+
187
+ == Upgrade notice ==
188
+
189
+ = 1.0.0 =
190
+
191
  Initial release
init.php CHANGED
@@ -1,155 +1,155 @@
1
- <?php
2
- /**
3
- * Plugin Name: YITH WooCommerce Product Gallery & Image Zoom
4
- * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
- * Description: <code><strong>YITH WooCommerce Product Gallery & Image Zoom</strong></code> allows you to add a zoom effect to product images and a thumbnail slider for the product image gallery. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
- * Version: 2.1.1
7
- * Author: YITH
8
- * Author URI: https://yithemes.com/
9
- * Text Domain: yith-woocommerce-zoom-magnifier
10
- * Domain Path: /languages/
11
- * WC requires at least: 5.3
12
- * WC tested up to: 5.8
13
- **/
14
-
15
- /* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
16
-
17
- This program is free software; you can redistribute it and/or modify
18
- it under the terms of the GNU General Public License, version 2, as
19
- published by the Free Software Foundation.
20
-
21
- This program is distributed in the hope that it will be useful,
22
- but WITHOUT ANY WARRANTY; without even the implied warranty of
23
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
- GNU General Public License for more details.
25
-
26
- You should have received a copy of the GNU General Public License
27
- along with this program; if not, write to the Free Software
28
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
- */
30
-
31
- if ( ! defined ( 'ABSPATH' ) ) {
32
- exit;
33
- } // Exit if accessed directly
34
-
35
- if ( ! function_exists( 'is_plugin_active' ) ) {
36
- if ( ! function_exists( 'get_plugin_data' ) ) {
37
- require_once(ABSPATH . 'wp-admin/includes/plugin.php');
38
- }
39
- }
40
-
41
- if ( ! function_exists ( 'yith_ywzm_install_woocommerce_admin_notice' ) ) {
42
- /**
43
- * WooCommerce is not enabled, the plugin will not be effective
44
- *
45
- * @author Lorenzo Giuffrida
46
- * @since 1.0.0
47
- */
48
- function yith_ywzm_install_woocommerce_admin_notice () {
49
- ?>
50
- <div class="error">
51
- <p><?php _e ( 'YITH WooCommerce Product Gallery & Image Zoom is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-zoom-magnifier' ); ?></p>
52
- </div>
53
- <?php
54
- }
55
- }
56
-
57
- if ( ! function_exists ( 'yith_ywzm_install_free_admin_notice' ) ) {
58
- /**
59
- * Unable to activate the free version while the premium version is active
60
- *
61
- * @author Lorenzo Giuffrida
62
- * @since 1.0.0
63
- */
64
- function yith_ywzm_install_free_admin_notice () {
65
- ?>
66
- <div class="error">
67
- <p><?php _e ( 'You can\'t activate the free version of YITH WooCommerce Product Gallery & Image Zoom while you are using the premium one.', 'yith-woocommerce-zoom-magnifier' ); ?></p>
68
- </div>
69
- <?php
70
- }
71
- }
72
-
73
- if ( ! function_exists ( 'yith_plugin_registration_hook' ) ) {
74
- require_once 'plugin-fw/yit-plugin-registration-hook.php';
75
- }
76
-
77
- register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
78
-
79
- defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
80
- defined ( 'YITH_YWZM_SLUG' ) || define ( 'YITH_YWZM_SLUG', 'yith-woocommerce-zoom-magnifier' );
81
- defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '2.1.1' );
82
- defined ( 'YITH_YWZM_SCRIPT_VERSION' ) || define ( 'YITH_YWZM_SCRIPT_VERSION', '2.1.1' );
83
-
84
- defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
85
- defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
86
- defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
87
- defined ( 'YITH_YWZM_ASSETS_URL' ) || define ( 'YITH_YWZM_ASSETS_URL', YITH_YWZM_URL . 'assets' );
88
- defined ( 'YITH_YWZM_TEMPLATE_DIR' ) || define ( 'YITH_YWZM_TEMPLATE_DIR', YITH_YWZM_DIR . 'templates' );
89
- defined ( 'YITH_YWZM_ASSETS_IMAGES_URL' ) || define ( 'YITH_YWZM_ASSETS_IMAGES_URL', YITH_YWZM_ASSETS_URL . '/images/' );
90
- defined ( 'YITH_YWZM_LIB_DIR' ) || define ( 'YITH_YWZM_LIB_DIR', YITH_YWZM_DIR . 'lib/' );
91
-
92
- /* Plugin Framework Version Check */
93
- if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) && file_exists ( YITH_YWZM_DIR . 'plugin-fw/init.php' ) ) {
94
- require_once ( YITH_YWZM_DIR . 'plugin-fw/init.php' );
95
- }
96
- yit_maybe_plugin_fw_loader ( YITH_YWZM_DIR );
97
-
98
- if ( ! function_exists ( 'yith_ywzm_init' ) ) {
99
- /**
100
- * Init the plugin
101
- *
102
- * @author Lorenzo Giuffrida
103
- * @since 1.0.0
104
- */
105
- function yith_ywzm_init () {
106
-
107
- /**
108
- * Load text domain and start plugin
109
- */
110
- load_plugin_textdomain ( 'yith-woocommerce-zoom-magnifier', false, dirname ( plugin_basename ( __FILE__ ) ) . '/languages/' );
111
-
112
- add_option ( 'yith_wcmg_slider_direction', apply_filters ( 'yith_wcmg_slider_direction', 'left' ) );
113
-
114
- define ( 'YITH_WCMG', true );
115
- define ( 'YITH_WCMG_URL', plugin_dir_url ( __FILE__ ) );
116
-
117
- // Load required classes and functions
118
- require_once ( YITH_YWZM_LIB_DIR . 'class.yith-wcmg-admin.php' );
119
- require_once ( YITH_YWZM_LIB_DIR . 'class.yith-wcmg-frontend.php' );
120
- require_once ( YITH_YWZM_LIB_DIR . 'class.yith-woocommerce-zoom-magnifier.php' );
121
- require_once ( YITH_YWZM_LIB_DIR . 'class.yith-ywzm-plugin-fw-loader.php' );
122
- require_once ( YITH_YWZM_LIB_DIR . 'functions.yith-ywzm.php' );
123
-
124
- YITH_YWZM_Plugin_FW_Loader::get_instance ();
125
-
126
- // Let's start the game!
127
- global $yith_wcmg;
128
-
129
- $yith_wcmg = new YITH_WooCommerce_Zoom_Magnifier();
130
- }
131
- }
132
- add_action ( 'yith_ywzm_init', 'yith_ywzm_init' );
133
-
134
- if ( ! function_exists ( 'yith_ywzm_install' ) ) {
135
- /**
136
- * install the plugin
137
- *
138
- * @author Lorenzo Giuffrida
139
- * @since 1.0.0
140
- */
141
- function yith_ywzm_install () {
142
-
143
- if ( ! function_exists ( 'WC' ) ) {
144
- add_action ( 'admin_notices', 'yith_ywzm_install_woocommerce_admin_notice' );
145
- } elseif ( defined ( 'YITH_YWZM_PREMIUM' ) ) {
146
- add_action ( 'admin_notices', 'yith_ywzm_install_free_admin_notice' );
147
- deactivate_plugins ( plugin_basename ( __FILE__ ) );
148
- } else {
149
- do_action ( 'yith_ywzm_init' );
150
- }
151
-
152
- }
153
- }
154
-
155
- add_action ( 'plugins_loaded', 'yith_ywzm_install', 11 );
1
+ <?php
2
+ /**
3
+ * Plugin Name: YITH WooCommerce Product Gallery & Image Zoom
4
+ * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
+ * Description: <code><strong>YITH WooCommerce Product Gallery & Image Zoom</strong></code> allows you to add a zoom effect to product images and a thumbnail slider for the product image gallery. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
+ * Version: 2.2.0
7
+ * Author: YITH
8
+ * Author URI: https://yithemes.com/
9
+ * Text Domain: yith-woocommerce-zoom-magnifier
10
+ * Domain Path: /languages/
11
+ * WC requires at least: 5.6
12
+ * WC tested up to: 5.9
13
+ **/
14
+
15
+ /* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
16
+
17
+ This program is free software; you can redistribute it and/or modify
18
+ it under the terms of the GNU General Public License, version 2, as
19
+ published by the Free Software Foundation.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program; if not, write to the Free Software
28
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
+ */
30
+
31
+ if ( ! defined ( 'ABSPATH' ) ) {
32
+ exit;
33
+ } // Exit if accessed directly
34
+
35
+ if ( ! function_exists( 'is_plugin_active' ) ) {
36
+ if ( ! function_exists( 'get_plugin_data' ) ) {
37
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
38
+ }
39
+ }
40
+
41
+ if ( ! function_exists ( 'yith_ywzm_install_woocommerce_admin_notice' ) ) {
42
+ /**
43
+ * WooCommerce is not enabled, the plugin will not be effective
44
+ *
45
+ * @author Lorenzo Giuffrida
46
+ * @since 1.0.0
47
+ */
48
+ function yith_ywzm_install_woocommerce_admin_notice () {
49
+ ?>
50
+ <div class="error">
51
+ <p><?php _e ( 'YITH WooCommerce Product Gallery & Image Zoom is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-zoom-magnifier' ); ?></p>
52
+ </div>
53
+ <?php
54
+ }
55
+ }
56
+
57
+ if ( ! function_exists ( 'yith_ywzm_install_free_admin_notice' ) ) {
58
+ /**
59
+ * Unable to activate the free version while the premium version is active
60
+ *
61
+ * @author Lorenzo Giuffrida
62
+ * @since 1.0.0
63
+ */
64
+ function yith_ywzm_install_free_admin_notice () {
65
+ ?>
66
+ <div class="error">
67
+ <p><?php _e ( 'You can\'t activate the free version of YITH WooCommerce Product Gallery & Image Zoom while you are using the premium one.', 'yith-woocommerce-zoom-magnifier' ); ?></p>
68
+ </div>
69
+ <?php
70
+ }
71
+ }
72
+
73
+ if ( ! function_exists ( 'yith_plugin_registration_hook' ) ) {
74
+ require_once 'plugin-fw/yit-plugin-registration-hook.php';
75
+ }
76
+
77
+ register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
78
+
79
+ defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
80
+ defined ( 'YITH_YWZM_SLUG' ) || define ( 'YITH_YWZM_SLUG', 'yith-woocommerce-zoom-magnifier' );
81
+ defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '2.2.0' );
82
+ defined ( 'YITH_YWZM_SCRIPT_VERSION' ) || define ( 'YITH_YWZM_SCRIPT_VERSION', '2.1.1' );
83
+
84
+ defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
85
+ defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
86
+ defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
87
+ defined ( 'YITH_YWZM_ASSETS_URL' ) || define ( 'YITH_YWZM_ASSETS_URL', YITH_YWZM_URL . 'assets' );
88
+ defined ( 'YITH_YWZM_TEMPLATE_DIR' ) || define ( 'YITH_YWZM_TEMPLATE_DIR', YITH_YWZM_DIR . 'templates' );
89
+ defined ( 'YITH_YWZM_ASSETS_IMAGES_URL' ) || define ( 'YITH_YWZM_ASSETS_IMAGES_URL', YITH_YWZM_ASSETS_URL . '/images/' );
90
+ defined ( 'YITH_YWZM_LIB_DIR' ) || define ( 'YITH_YWZM_LIB_DIR', YITH_YWZM_DIR . 'lib/' );
91
+
92
+ /* Plugin Framework Version Check */
93
+ if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) && file_exists ( YITH_YWZM_DIR . 'plugin-fw/init.php' ) ) {
94
+ require_once ( YITH_YWZM_DIR . 'plugin-fw/init.php' );
95
+ }
96
+ yit_maybe_plugin_fw_loader ( YITH_YWZM_DIR );
97
+
98
+ if ( ! function_exists ( 'yith_ywzm_init' ) ) {
99
+ /**
100
+ * Init the plugin
101
+ *
102
+ * @author Lorenzo Giuffrida
103
+ * @since 1.0.0
104
+ */
105
+ function yith_ywzm_init () {
106
+
107
+ /**
108
+ * Load text domain and start plugin
109
+ */
110
+ load_plugin_textdomain ( 'yith-woocommerce-zoom-magnifier', false, dirname ( plugin_basename ( __FILE__ ) ) . '/languages/' );
111
+
112
+ add_option ( 'yith_wcmg_slider_direction', apply_filters ( 'yith_wcmg_slider_direction', 'left' ) );
113
+
114
+ define ( 'YITH_WCMG', true );
115
+ define ( 'YITH_WCMG_URL', plugin_dir_url ( __FILE__ ) );
116
+
117
+ // Load required classes and functions
118
+ require_once ( YITH_YWZM_LIB_DIR . 'class.yith-wcmg-admin.php' );
119
+ require_once ( YITH_YWZM_LIB_DIR . 'class.yith-wcmg-frontend.php' );
120
+ require_once ( YITH_YWZM_LIB_DIR . 'class.yith-woocommerce-zoom-magnifier.php' );
121
+ require_once ( YITH_YWZM_LIB_DIR . 'class.yith-ywzm-plugin-fw-loader.php' );
122
+ require_once ( YITH_YWZM_LIB_DIR . 'functions.yith-ywzm.php' );
123
+
124
+ YITH_YWZM_Plugin_FW_Loader::get_instance ();
125
+
126
+ // Let's start the game!
127
+ global $yith_wcmg;
128
+
129
+ $yith_wcmg = new YITH_WooCommerce_Zoom_Magnifier();
130
+ }
131
+ }
132
+ add_action ( 'yith_ywzm_init', 'yith_ywzm_init' );
133
+
134
+ if ( ! function_exists ( 'yith_ywzm_install' ) ) {
135
+ /**
136
+ * install the plugin
137
+ *
138
+ * @author Lorenzo Giuffrida
139
+ * @since 1.0.0
140
+ */
141
+ function yith_ywzm_install () {
142
+
143
+ if ( ! function_exists ( 'WC' ) ) {
144
+ add_action ( 'admin_notices', 'yith_ywzm_install_woocommerce_admin_notice' );
145
+ } elseif ( defined ( 'YITH_YWZM_PREMIUM' ) ) {
146
+ add_action ( 'admin_notices', 'yith_ywzm_install_free_admin_notice' );
147
+ deactivate_plugins ( plugin_basename ( __FILE__ ) );
148
+ } else {
149
+ do_action ( 'yith_ywzm_init' );
150
+ }
151
+
152
+ }
153
+ }
154
+
155
+ add_action ( 'plugins_loaded', 'yith_ywzm_install', 11 );
languages/yith-woocommerce-zoom-magnifier-es_ES.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Order Tracking\n"
4
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
5
- "POT-Creation-Date: 2021-10-07 15:43:27+00:00\n"
6
  "PO-Revision-Date: 2016-06-13 16:57+0200\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Order Tracking\n"
4
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
5
+ "POT-Creation-Date: 2021-11-04 13:15:36+00:00\n"
6
  "PO-Revision-Date: 2016-06-13 16:57+0200\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
languages/yith-woocommerce-zoom-magnifier-it_IT.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Zoom Magnifier\n"
4
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
5
- "POT-Creation-Date: 2021-10-07 15:43:27+00:00\n"
6
  "PO-Revision-Date: 2015-10-07 15:48+0200\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Zoom Magnifier\n"
4
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
5
+ "POT-Creation-Date: 2021-11-04 13:15:36+00:00\n"
6
  "PO-Revision-Date: 2015-10-07 15:48+0200\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
languages/yith-woocommerce-zoom-magnifier.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the YITH WooCommerce Product Gallery & Image Zoom package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: YITH WooCommerce Product Gallery & Image Zoom 2.1.1\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
- "POT-Creation-Date: 2021-10-11 07:36:47+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
2
  # This file is distributed under the same license as the YITH WooCommerce Product Gallery & Image Zoom package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: YITH WooCommerce Product Gallery & Image Zoom 2.2.0\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
+ "POT-Creation-Date: 2021-11-04 13:15:36+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
lib/class.yith-wcmg-admin.php CHANGED
@@ -1,97 +1,97 @@
1
- <?php // phpcs:ignore WordPress.Files.FileName
2
- /**
3
- * Admin class
4
- *
5
- * @author YITH
6
- * @package YITH\ZoomMagnifier\Classes
7
- * @version 1.1.2
8
- */
9
-
10
- if ( ! defined( 'YITH_WCMG' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
15
- /**
16
- * Admin class.
17
- * The class manage all the admin behaviors.
18
- *
19
- * @since 1.0.0
20
- */
21
- class YITH_WCMG_Admin {
22
- /**
23
- * Plugin options
24
- *
25
- * @var array
26
- * @access public
27
- * @since 1.0.0
28
- */
29
- public $options = array();
30
-
31
- /**
32
- * Docs URL.
33
- *
34
- * @var string
35
- * @access public
36
- * @since 1.0.0
37
- */
38
- public $doc_url = 'https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/';
39
-
40
- /**
41
- * Constructor
42
- *
43
- * @access public
44
- * @since 1.0.0
45
- */
46
- public function __construct() {
47
-
48
- // Actions.
49
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
50
-
51
- // YITH WCMG Loaded.
52
- do_action( 'yith_wcmg_loaded' );
53
- }
54
-
55
- /**
56
- * Enqueue admin styles and scripts
57
- *
58
- * @access public
59
- * @return void
60
- * @since 1.0.0
61
- */
62
- public function enqueue_styles_scripts() {
63
-
64
- wp_enqueue_script( 'jquery-ui' );
65
- wp_enqueue_script( 'jquery-ui-core' );
66
- wp_enqueue_script( 'jquery-ui-mouse' );
67
- wp_enqueue_script( 'jquery-ui-slider' );
68
-
69
- wp_enqueue_style( 'yith_wcmg_admin', YITH_WCMG_URL . 'assets/css/admin.css', array(), YITH_YWZM_SCRIPT_VERSION );
70
-
71
- if ( isset( $_REQUEST[ 'page' ] ) && $_REQUEST[ 'page' ] === 'yith_woocommerce_zoom-magnifier_panel' ){
72
-
73
- wp_register_script(
74
- 'ywzm_backend',
75
- YITH_YWZM_ASSETS_URL . '/js/ywzm_backend.js',
76
- array(
77
- 'jquery',
78
- ),
79
- YITH_YWZM_SCRIPT_VERSION,
80
- true
81
- );
82
-
83
- wp_localize_script(
84
- 'ywzm_backend',
85
- 'ywzm_data',
86
- array()
87
- );
88
-
89
- wp_enqueue_script( 'ywzm_backend' );
90
-
91
- }
92
-
93
-
94
-
95
- }
96
- }
97
- }
1
+ <?php // phpcs:ignore WordPress.Files.FileName
2
+ /**
3
+ * Admin class
4
+ *
5
+ * @author YITH
6
+ * @package YITH\ZoomMagnifier\Classes
7
+ * @version 1.1.2
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCMG' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
15
+ /**
16
+ * Admin class.
17
+ * The class manage all the admin behaviors.
18
+ *
19
+ * @since 1.0.0
20
+ */
21
+ class YITH_WCMG_Admin {
22
+ /**
23
+ * Plugin options
24
+ *
25
+ * @var array
26
+ * @access public
27
+ * @since 1.0.0
28
+ */
29
+ public $options = array();
30
+
31
+ /**
32
+ * Docs URL.
33
+ *
34
+ * @var string
35
+ * @access public
36
+ * @since 1.0.0
37
+ */
38
+ public $doc_url = 'https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/';
39
+
40
+ /**
41
+ * Constructor
42
+ *
43
+ * @access public
44
+ * @since 1.0.0
45
+ */
46
+ public function __construct() {
47
+
48
+ // Actions.
49
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
50
+
51
+ // YITH WCMG Loaded.
52
+ do_action( 'yith_wcmg_loaded' );
53
+ }
54
+
55
+ /**
56
+ * Enqueue admin styles and scripts
57
+ *
58
+ * @access public
59
+ * @return void
60
+ * @since 1.0.0
61
+ */
62
+ public function enqueue_styles_scripts() {
63
+
64
+ wp_enqueue_script( 'jquery-ui' );
65
+ wp_enqueue_script( 'jquery-ui-core' );
66
+ wp_enqueue_script( 'jquery-ui-mouse' );
67
+ wp_enqueue_script( 'jquery-ui-slider' );
68
+
69
+ wp_enqueue_style( 'yith_wcmg_admin', YITH_WCMG_URL . 'assets/css/admin.css', array(), YITH_YWZM_SCRIPT_VERSION );
70
+
71
+ if ( isset( $_REQUEST[ 'page' ] ) && $_REQUEST[ 'page' ] === 'yith_woocommerce_zoom-magnifier_panel' ){
72
+
73
+ wp_register_script(
74
+ 'ywzm_backend',
75
+ YITH_YWZM_ASSETS_URL . '/js/ywzm_backend.js',
76
+ array(
77
+ 'jquery',
78
+ ),
79
+ YITH_YWZM_SCRIPT_VERSION,
80
+ true
81
+ );
82
+
83
+ wp_localize_script(
84
+ 'ywzm_backend',
85
+ 'ywzm_data',
86
+ array()
87
+ );
88
+
89
+ wp_enqueue_script( 'ywzm_backend' );
90
+
91
+ }
92
+
93
+
94
+
95
+ }
96
+ }
97
+ }
lib/class.yith-wcmg-frontend.php CHANGED
@@ -1,391 +1,391 @@
1
- <?php // phpcs:ignore WordPress.Files.FileName
2
- /**
3
- * Frontend class
4
- *
5
- * @author YITH
6
- * @package YITH\ZoomMagnifier\Classes
7
- * @version 1.1.2
8
- */
9
-
10
- if ( ! defined( 'YITH_WCMG' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCMG_Frontend' ) ) {
15
- /**
16
- * Admin class.
17
- * The class manage all the Frontend behaviors.
18
- *
19
- * @since 1.0.0
20
- */
21
- class YITH_WCMG_Frontend {
22
-
23
-
24
- /**
25
- * Constructor
26
- *
27
- * @access public
28
- * @since 1.0.0
29
- */
30
- public function __construct() {
31
-
32
- // add the action only when the loop is initializate.
33
- add_action( 'template_redirect', array( $this, 'render' ) );
34
- }
35
-
36
- /**
37
- * Render zoom.
38
- */
39
- public function render() {
40
- if ( ! apply_filters( 'yith_wczm_featured_video_enabled', false ) ) {
41
-
42
-
43
- //Zoom template
44
- remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
45
- add_action( 'woocommerce_before_single_product_summary', array( $this, 'show_product_images' ), 20 );
46
-
47
- //Slider template
48
- remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
49
-
50
- if ( get_option( 'ywzm_hide_thumbnails', 'no' ) !== 'yes' )
51
- add_action( 'woocommerce_product_thumbnails', array( $this, 'show_product_thumbnails' ), 20 );
52
-
53
-
54
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
55
-
56
- // add attributes to product variations.
57
- add_filter( 'woocommerce_available_variation', array( $this, 'available_variation' ), 10, 3 );
58
- }
59
- }
60
-
61
-
62
- /**
63
- * Change product-single.php template
64
- *
65
- * @access public
66
- * @return void
67
- * @since 1.0.0
68
- */
69
- public function show_product_images() {
70
- wc_get_template( 'single-product/product-image-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/' );
71
- }
72
-
73
-
74
- /**
75
- * Change product-thumbnails.php template
76
- *
77
- * @access public
78
- * @return void
79
- * @since 1.0.0
80
- */
81
- public function show_product_thumbnails() {
82
-
83
- wc_get_template( 'single-product/product-thumbnails-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/' );
84
- }
85
-
86
-
87
- /**
88
- * Enqueue styles and scripts
89
- *
90
- * @access public
91
- * @return void
92
- * @since 1.0.0
93
- */
94
- public function enqueue_styles_scripts() {
95
- global $post;
96
-
97
- if ( is_product() || ( ! empty( $post->post_content ) && strpos($post->post_content, 'product_page') !== false ) ) {
98
-
99
- wp_register_script(
100
- 'ywzm-magnifier',
101
- apply_filters( 'ywzm_magnifier_script_register_path', YITH_WCMG_URL . 'assets/js/' . yit_load_js_file( 'yith_magnifier.js' ) ),
102
- array( 'jquery' ),
103
- YITH_YWZM_SCRIPT_VERSION,
104
- true
105
- );
106
-
107
- wp_localize_script(
108
- 'ywzm-magnifier',
109
- 'yith_wc_zoom_magnifier_storage_object',
110
- apply_filters(
111
- 'yith_wc_zoom_magnifier_front_magnifier_localize',
112
- array(
113
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
114
- 'mouse_trap_width' => apply_filters( 'yith_wczm_mouse_trap_with', '100%' ),
115
- 'mouse_trap_height' => apply_filters( 'yith_wczm_mouse_trap_height', '100%' ),
116
- )
117
- )
118
- );
119
-
120
- wp_register_script(
121
- 'ywzm_frontend',
122
- YITH_WCMG_URL . 'assets/js/' . yit_load_js_file( 'ywzm_frontend.js' ),
123
- array(
124
- 'jquery',
125
- 'ywzm-magnifier',
126
- ),
127
- YITH_YWZM_SCRIPT_VERSION,
128
- true
129
- );
130
-
131
- wp_register_style( 'ywzm-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css', array(), YITH_YWZM_SCRIPT_VERSION );
132
-
133
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
134
-
135
- $slider_colors_default = Array(
136
- 'background' => 'white',
137
- 'border' => 'black',
138
- 'arrow' => 'black',
139
- );
140
-
141
- $slider_colors_array = get_option( 'yith_wcmg_slider_style_colors', $slider_colors_default );
142
- $slider_colors_hover_array = get_option( 'yith_wcmg_slider_style_colors_hover', $slider_colors_default );
143
-
144
- wp_localize_script(
145
- 'ywzm_frontend',
146
- 'ywzm_data',
147
- array(
148
- 'slider_colors_array' => $slider_colors_array,
149
- 'slider_colors_hover_array' => $slider_colors_hover_array,
150
- )
151
- );
152
-
153
- // Enqueue PrettyPhoto style and script.
154
- $wc_assets_path = str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/';
155
-
156
- // Enqueue scripts.
157
- wp_enqueue_script( 'prettyPhoto', $wc_assets_path . 'js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js', array( 'jquery' ), WC()->version, true );
158
- wp_enqueue_script( 'ywzm-magnifier' );
159
- wp_enqueue_script( 'ywzm_frontend' );
160
-
161
- /**
162
- * Add custom init PrettyPhoto
163
- */
164
-
165
- wp_localize_script(
166
- 'ywzm_frontend',
167
- 'ywzm_prettyphoto_data',
168
- array(
169
- )
170
- );
171
-
172
- wp_enqueue_script( //phpcs:ignore
173
- 'yith-ywzm-prettyPhoto-init',
174
- apply_filters( 'ywzm_src_prettyphoto_script', YITH_WCMG_URL . 'assets/js/init.prettyPhoto.js' ),
175
- array(
176
- 'jquery',
177
- 'prettyPhoto',
178
- ),
179
- false,
180
- true
181
- );
182
-
183
- // Enqueue Style.
184
- $css = file_exists( get_stylesheet_directory() . '/woocommerce/yith_magnifier.css' ) ? get_stylesheet_directory_uri() . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
185
- wp_enqueue_style( 'ywzm-prettyPhoto', $wc_assets_path . 'css/prettyPhoto.css', array(), YITH_YWZM_SCRIPT_VERSION );
186
- wp_enqueue_style( 'ywzm-magnifier' );
187
- wp_enqueue_style( 'ywzm_frontend', $css, array(), YITH_YWZM_SCRIPT_VERSION );
188
-
189
- wp_add_inline_style( 'ywzm_frontend', $this->get_custom_css() );
190
- wp_add_inline_style( 'ywzm-prettyPhoto', $this->get_custom_css_prettyphoto() );
191
-
192
- }
193
- }
194
-
195
- public function get_custom_css(){
196
-
197
- $custom_css = '';
198
-
199
- $slider_colors_default = Array(
200
- 'background' => 'white',
201
- 'border' => 'black',
202
- 'arrow' => 'black',
203
- );
204
-
205
- $sizes_default = Array(
206
- 'dimensions' => array(
207
- 'slider' => '25',
208
- 'arrow' => '22',
209
- 'border' => '2',
210
- ));
211
-
212
- $colors_default = Array(
213
- 'background' => 'white',
214
- 'icon' => 'black',
215
- );
216
-
217
- $slider_colors_array = get_option( 'yith_wcmg_slider_style_colors', $slider_colors_default );
218
- $slider_colors_hover_array = get_option( 'yith_wcmg_slider_style_colors_hover', $slider_colors_default );
219
- $sizes = get_option( 'yith_wcmg_slider_sizes', $sizes_default );
220
-
221
- if ( is_array($slider_colors_array) ) {
222
-
223
- $custom_css .= "
224
- #slider-prev, #slider-next {
225
- background-color: {$slider_colors_array['background']};
226
- border: {$sizes['dimensions']['border']}px solid {$slider_colors_array['border']};
227
- width:{$sizes['dimensions']['slider']}px !important;
228
- height:{$sizes['dimensions']['slider']}px !important;
229
- }
230
-
231
- .yith_slider_arrow span{
232
- width:{$sizes['dimensions']['slider']}px !important;
233
- height:{$sizes['dimensions']['slider']}px !important;
234
- }
235
- ";
236
-
237
- $custom_css .= "
238
- #slider-prev:hover, #slider-next:hover {
239
- background-color: {$slider_colors_hover_array['background']};
240
- border: {$sizes['dimensions']['border']}px solid {$slider_colors_hover_array['border']};
241
- }
242
- ";
243
-
244
- $custom_css .= "
245
- .thumbnails.slider path:hover {
246
- fill:{$slider_colors_hover_array['arrow']};
247
- }
248
- ";
249
-
250
- $custom_css .= "
251
- .thumbnails.slider path {
252
- fill:{$slider_colors_array['arrow']};
253
- width:{$sizes['dimensions']['slider']}px !important;
254
- height:{$sizes['dimensions']['slider']}px !important;
255
- }
256
-
257
- .thumbnails.slider svg {
258
- width: {$sizes['dimensions']['arrow']}px;
259
- height: {$sizes['dimensions']['arrow']}px;
260
- }
261
-
262
- ";
263
-
264
- }
265
-
266
- //Lighbox expand icon
267
- $lighbox_colors_array = get_option( 'ywzm_lightbox_icon_colors', $colors_default );
268
- $lighbox_icon_size = get_option( 'ywzm_lightbox_icon_size', '25' );
269
- $lighbox_radius = get_option( 'yith_wcmg_lightbox_radius', '0' );
270
- $lighbox_icon_position = get_option( 'ywzm_lightbox_icon_position', 'top-right' );
271
-
272
-
273
-
274
- $arr = explode("-", $lighbox_icon_position, 2);
275
- $position = $arr[0];
276
-
277
- if ( $position == 'top' ){
278
- $top = '10px';
279
- $bottom = 'initial';
280
- }
281
- else{
282
- $top = 'initial';
283
- $bottom = '10px';
284
- }
285
-
286
- if ( $lighbox_icon_position === 'top-right' || $lighbox_icon_position === 'bottom-right' ){
287
- $left = 'initial';
288
- $right = '10px';
289
- }
290
- else{
291
- $left = '10px';
292
- $right = 'initial';
293
- }
294
-
295
- $custom_css .= "
296
- div.pp_woocommerce a.yith_expand {
297
- background-color: {$lighbox_colors_array['background']};
298
- width: {$lighbox_icon_size}px;
299
- height: {$lighbox_icon_size}px;
300
- top: {$top};
301
- bottom: {$bottom};
302
- left: {$left};
303
- right: {$right};
304
- border-radius: {$lighbox_radius}%;
305
- }
306
-
307
- .expand-button-hidden svg{
308
- width: {$lighbox_icon_size}px;
309
- height: {$lighbox_icon_size}px;
310
- }
311
-
312
- .expand-button-hidden path{
313
- fill: {$lighbox_colors_array['icon']};
314
- }
315
- ";
316
-
317
-
318
-
319
- return apply_filters( 'yith_ywzm_custom_css', $custom_css );
320
- }
321
-
322
- public function get_custom_css_prettyphoto (){
323
-
324
- $colors_default = Array(
325
- 'background' => 'white',
326
- 'icon' => 'black',
327
- );
328
-
329
- $lighbox_colors_array = get_option( 'ywzm_lightbox_icon_colors', $colors_default );
330
- $lighbox_icon_size = get_option( 'ywzm_lightbox_icon_size', '25' );
331
-
332
- $custom_css = '';
333
-
334
- $custom_css .= "
335
- div.pp_woocommerce a.pp_contract, div.pp_woocommerce a.pp_expand{
336
- content: unset !important;
337
- background-color: {$lighbox_colors_array['background']};
338
- width: {$lighbox_icon_size}px;
339
- height: {$lighbox_icon_size}px;
340
- margin-top: 5px;
341
- margin-left: 5px;
342
- }
343
-
344
- div.pp_woocommerce a.pp_contract, div.pp_woocommerce a.pp_expand:hover{
345
- background-color: {$lighbox_colors_array['background']};
346
- }
347
- div.pp_woocommerce a.pp_contract, div.pp_woocommerce a.pp_contract:hover{
348
- background-color: {$lighbox_colors_array['background']};
349
- }
350
-
351
- a.pp_expand:before, a.pp_contract:before{
352
- content: unset !important;
353
- }
354
-
355
- a.pp_expand .expand-button-hidden svg, a.pp_contract .expand-button-hidden svg{
356
- width: {$lighbox_icon_size}px;
357
- height: {$lighbox_icon_size}px;
358
- padding: 5px;
359
- }
360
-
361
- .expand-button-hidden path{
362
- fill: {$lighbox_colors_array['icon']};
363
- }
364
-
365
- ";
366