PageSourceSearch

https://robertjhmorrison.com/wp-content/plugins/slider-wd/js/wds_frontend.js?ver=2.2.17

js robertjhmorrison.com collected 2026-10-02 18:02:15 UTC 137,724 bytes, 3,113 lines download raw bytes

1var wds_carousel = [];
2var wds_currentlyMoving = [];
3var wds_currentCenterNum = [];
4var wds;
5var textLayerPosition = [];
6
7jQuery(window).resize(function () {
8  wds_resize();
9});
10
11jQuery(document).ready(function () {
12  wds_slider_ready();
13  jQuery(".wds_slider_cont").each(function () {
14    wds = jQuery(this).attr("data-wds");
15    if (wds_params[wds].carousel == 1) {
16      wds_currentlyMoving[wds] = false;
17      wds_currentCenterNum[wds] = wds_params[wds].start_slide_num_car;
18      wds_params[wds].wds_currentCenterNum = wds_currentCenterNum[wds];
19      jQuery(".wds_left-ico_" + wds).click(function () {
20        wds_carousel[jQuery(this).closest('div[class^="wds_slider_cont"]').attr("data-wds")].prev();
21      });
22      jQuery(".wds_right-ico_" + wds).click(function () {
23        wds_carousel[jQuery(this).closest('div[class^="wds_slider_cont"]').attr("data-wds")].next();
24      });
25    }
26  });
27});
28
29jQuery(window).on('load', function () {
30  jQuery(".wds_slider_cont").each(function () {
31    wds = jQuery(this).attr("data-wds");
32    if (!wds_object.is_free && wds_params[wds].carousel == 1) {
33      wds_carousel_params(wds);
34      wds_display_hotspot();
35      wds_hotspot_position();
36    }
37  })
38});
39
40function wds_resize() {
41  jQuery(".wds_slider_cont").each(function () {
42    wds = jQuery(this).attr("data-wds");
43    wds_resize_slider(wds);
44    jQuery.each( wds_params[wds].callback_items, function( index, value ) {
45      if ( index === 'onSliderR' && value !== '' ) {
46        var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderR );
47        wds_callback_f();
48      }
49    });
50  });
51  if ( !wds_object.is_free ) {
52    jQuery(".wds_slider_cont").each(function () {
53      wds = jQuery(this).attr("data-wds");
54      if (wds_params[wds].carousel == 1) {
55        wds_carousel_params(wds);
56        wds_carousel[wds].pause();
57        if (!jQuery(".wds_ctrl_btn_" + wds).hasClass("fa-play")) {
58          wds_carousel[wds].start();
59        }
60      }
61    });
62  }
63}
64
65/* ready slider. */
66function wds_slider_ready() {
67	jQuery(".wds_slider_cont").each(function () {
68    var wds = jQuery(this).attr("data-wds");
69    if (wds_params[wds].current_image_url != '') {
70      jQuery('<img />').attr("src", wds_params[wds].current_image_url).on('load', function () {
71        jQuery(this).remove();
72        wds_ready_func(wds);
73      });
74    }
75    else {
76      wds_ready_func(wds);
77    }
78    if (wds_params[wds].fixed_bg == 1) {
79      jQuery(window).scroll(function () {
80        wds_window_fixed_pos(wds);
81      });
82    }
83    wds_params[wds].wds_play_pause_state = 0;
84    if (wds_params[wds].carousel == 1) {
85      wds_carousel_params(wds);
86    }
87    document.addEventListener("visibilitychange", function() {
88      if(document.visibilityState != 'visible') {
89        window.clearInterval(wds_params[wds].wds_playInterval);
90        wds_event_stack_wds = [];
91        if (typeof jQuery().stop !== 'undefined') {
92          if (jQuery.isFunction(jQuery().stop)) {
93            if (wds_params[wds].timer_bar_type == 'top' || wds_params[wds].timer_bar_type == 'bottom') {
94              jQuery(".wds_line_timer_" + wds).stop();
95              if (wds_params[wds].carousel) {
96                wds_carousel[wds].pause();
97              }
98            }
99            else if (wds_params[wds].timer_bar_type != 'none') {
100              wds_params[wds].circle_timer_animate.stop();
101              if (wds_params[wds].carousel) {
102                wds_carousel[wds].pause();
103              }
104            }
105          }
106        }
107      } else {
108        wds_restart_slideshow_autoplay( wds );
109      }
110    });
111  });
112}
113
114/* restart slideshow. */
115function wds_restart_slideshow_autoplay( wds ) {
116  if (!jQuery(".wds_ctrl_btn_" + wds).hasClass("fa-play")) {
117    if (wds_params[wds].enable_slideshow_autoplay) {
118      play_wds(wds);
119      if (wds_params[wds].carousel == 1) {
120        wds_carousel[wds].start();
121      }
122      if (wds_params[wds].timer_bar_type != 'none') {
123        if (wds_params[wds].timer_bar_type != 'top') {
124          if (wds_params[wds].timer_bar_type != 'bottom') {
125            if (typeof wds_params[wds].circle_timer_animate !== 'undefined') {
126              wds_params[wds].circle_timer_animate.stop();
127            }
128            wds_circle_timer(wds, wds_params[wds].curent_time_deggree);
129          }
130        }
131      }
132    }
133  }
134  if (wds_params[wds].carousel != 1) {
135    var i_wds = 0;
136    jQuery(".wds_slider_" + wds).children("span").each(function () {
137      if (jQuery(this).css('opacity') == 1) {
138        jQuery("#wds_current_image_key_" + wds).val(i_wds);
139      }
140      i_wds++;
141    });
142  }
143}
144
145function wds_carousel_params(wds) {
146  var width, height;
147  var slide_orig_width = wds_params[wds].image_width;
148  var slide_orig_height = wds_params[wds].image_height;
149  var slide_width = wds_get_overall_parent(jQuery("#wds_container1_" + wds));
150  var par = 1, par1 = 1;
151  var ratio = slide_width / slide_orig_width;
152  if (jQuery(window).width() <= parseInt(wds_params[wds].full_width_for_mobile) || (wds_params[wds].full_width == '1')) {
153    var full_width = '1';
154  }
155  else {
156    var full_width = '0';
157  }
158  if (full_width == '1') {
159    ratio = jQuery(window).width() / slide_orig_width;
160    slide_orig_width = jQuery(window).width() - (2 * wds_params[wds].wds_glb_margin);
161    slide_orig_height = wds_params[wds].image_height * slide_orig_width / wds_params[wds].image_width;
162    slide_width = jQuery(window).width() - (2 * wds_params[wds].wds_glb_margin);
163    wds_full_width(wds);
164  }
165  else if (parseInt(wds_params[wds].full_width_for_mobile)) {
166    jQuery(".wds_slideshow_image_wrap_" + wds).removeAttr("style");
167  }
168  var slide_height = slide_orig_height;
169  if (slide_orig_width > slide_width) {
170    slide_height = Math.floor(slide_width * slide_orig_height / slide_orig_width);
171  }
172  width = slide_width;
173  height = slide_height;
174  var larg_width, img_height, parF = 1;
175  if (width < wds_params[wds].carousel_width) {
176    par = width / wds_params[wds].carousel_width;
177  }
178  par1 = wds_params[wds].image_height * par / height;
179  if (width < wds_params[wds].carousel_width) {
180    jQuery(".wds_slideshow_image_wrap_" + wds + ", #wds_container2_" + wds).height(height * par1 + ((wds_params[wds].filmstrip_direction == 'horizontal') ? wds_params[wds].filmstrip_he
180ight : 0));
181    jQuery(".wds_slideshow_image_container_" + wds).height(height * par1);
182    jQuery(".wds_btn_cont wds_contTableCell" + wds).height(height * par1);
183    jQuery(".wds_slide_container_" + wds).height(height * par1);
184  }
185  if (full_width == '1') {
186    var parF = parseFloat(wds_params[wds].carousel_image_parameters);
187    parF = isNaN(parF) ? 1 : parF;
188    parF *= wds_params[wds].image_width;
189    jQuery(".wds_slideshow_image_wrap_" + wds + ", #wds_container2_" + wds).height(height * par1 + ((wds_params[wds].filmstrip_direction == 'horizontal') ? wds_params[wds].filmstrip_height : 0));
190    jQuery(".wds_slideshow_image_container_" + wds).height(height * par1);
191    jQuery(".wds_btn_cont wds_contTableCell" + wds).height(height * par1);
192    jQuery(".wds_slide_container_" + wds).height(height * par1);
193  }
194  if (wds_params[wds].carousel_image_counts > wds_params[wds].slides_count) {
195    wds_params[wds].carousel_image_counts = wds_params[wds].slides_count;
196  }
197  if (wds_params[wds].carousel_image_parameters > 1) {
198    wds_params[wds].carousel_image_parameters = 1;
199  }
200  var interval = 0;
201  if (wds_params[wds].enable_slideshow_autoplay) {
202    interval = wds_params[wds].slideshow_interval;
203  }
204  var slideshow_filmstrip_container_width = wds_params[wds].filmstrip_direction == 'horizontal' ? 0 : jQuery(".wds_slideshow_filmstrip_container_" + wds).width();
205  jQuery(".wds_slideshow_dots_container_" + wds).css({
206    width: (wds_params[wds].image_width * par),
207    left: (width - wds_params[wds].image_width * par - slideshow_filmstrip_container_width) / 2
208  });
209  var orig_width = wds_params[wds].image_width;
210  var img_width = Math.min(larg_width, orig_width);
211  wds_carousel[wds] = jQuery(".wds_slide_container_" + wds).featureCarouselslider({
212    containerWidth: width,
213    containerHeight: height,
214    largeFeatureWidth: wds_params[wds].image_width * par,
215    largeFeatureHeight: wds_params[wds].image_height * par,
216    fit_containerWidth: wds_params[wds].carousel_fit_containerWidth,
217    smallFeaturePar: wds_params[wds].carousel_image_parameters,
218    featuresArray: [],
219    timeoutVar: null,
220    rotationsRemaining: 0,
221    parametr: par,
222    parf: parF,
223    data: wds_params[wds].wds_data,
224    autoPlay: wds_params[wds].interval * 1000,
225    interval: wds_params[wds].slideshow_interval * 1000,
226    imagecount: wds_params[wds].carousel_image_counts,
227    wds_number: wds_params[wds].wds,
228    startingFeature: wds_currentCenterNum[wds],
229    carouselSpeed: wds_params[wds].wds_transition_duration,
230    carousel_degree: wds_params[wds].carousel_degree,
231    carousel_grayscale: wds_params[wds].carousel_grayscale,
232    carousel_transparency: wds_params[wds].carousel_transparency,
233    borderWidth: 0
234  });
235}
236
237function wds_show_thumb(key, wds) {
238  var data = wds_params[wds].wds_data[key];
239  var full_width = wds_params[wds].wds_data[key]["full_width"];
240  var bull_position = wds_params[wds].wds_data[key]["bull_position"];
241  var image_url = data["image_url"];
242  var dot_conteiner_width = jQuery('.wds_slideshow_dots_container_' + wds).width() / 2;
243  var dot_conteiner_height = jQuery('.wds_slideshow_dots_container_' + wds).height();
244  var wds_bulframe_width = jQuery('.wds_bulframe_' + wds).width() / 2;
245  var dot_position = jQuery('#wds_dots_' + key + '_' + wds).position();
246  var dot_width = jQuery('#wds_dots_' + key + '_' + wds).width() / 2;
247  dot_position = dot_position.left;
248  var childPos = jQuery('#wds_dots_' + key + '_' + wds).offset();
249  var parentPos = jQuery('.wds_slideshow_dots_thumbnails_' + wds).parent().offset();
250  var childOffset = childPos.left - parentPos.left;
251  var right_offset = 0;
252  var rt = (dot_conteiner_width * 2) - childOffset;
253  if (wds_bulframe_width >= rt && rt > 0) {
254    right_offset = wds_bulframe_width - rt;
255    dot_width = 0;
256  }
257  if (full_width == '1') {
258    if (wds_bulframe_width >= childOffset) {
259      wds_bulframe_width = childOffset - parentPos.left;
260      dot_width = 0;
261    }
262  }
263  else {
264    if (wds_bulframe_width >= childOffset) {
265      wds_bulframe_width = childOffset;
266      dot_width = 0;
267    }
268  }
269  dot_position = childOffset - wds_bulframe_width + dot_width - right_offset;
270  jQuery('.wds_bulframe_' + wds).css({
271    'position': 'absolute',
272    'z-index': '9999',
273    'left': dot_position,
274    'background-image': 'url("' + image_url + '")',
275    'background-size': 'contain',
276    'background-repeat': 'no-repeat',
277    'background-position': 'center center'
278  });
279  jQuery('.wds_bulframe_' + wds).css(bull_position, dot_conteiner_height);
280  jQuery('.wds_bulframe_' + wds).fadeIn();
281}
282
283function wds_hide_thumb(wds) {
284  jQuery('.wds_bulframe_' + wds).css({'background-image':''});
285  jQuery('.wds_bulframe_' + wds).fadeOut();
286}
287
288function wds_get_overall_parent(obj) {
289  if (obj.parent().width()) {
290    obj.width(obj.parent().width());
291    return obj.parent().width();
292  }
293  else {
294    return wds_get_overall_parent(obj.parent());
295  }
296}
297
298function wds_set_text_dots_cont(wds) {
299  var wds_bull_width = 0;
300  jQuery(".wds_slideshow_dots_" + wds).each(function(){
301    wds_bull_width += jQuery(this).outerWidth() + 2 * parseInt(j
301Query(this).css("margin-left"));
302  });
303  jQuery(".wds_slideshow_dots_thumbnails_" + wds).css({width: wds_bull_width});
304}
305
306/* Generate background position for Zoom Fade effect.*/
307function wds_genBgPos(current_key, wds, slideshow_interval) {
308  var bgSizeArray = [0, 70];
309  var bgSize = bgSizeArray[Math.floor(Math.random() * bgSizeArray.length)];
310  var bgPosXArray = ['left', 'right'];
311  var bgPosYArray = ['top', 'bottom'];
312  var bgPosX = bgPosXArray[Math.floor(Math.random() * bgPosXArray.length)];
313  var bgPosY = bgPosYArray[Math.floor(Math.random() * bgPosYArray.length)];
314  jQuery(current_key + " .wds_slideshow_image_" + wds).css({
315    backgroundPosition: bgPosX + " " + bgPosY,
316    backgroundSize: (100 + bgSize) + "% " + (100 + bgSize) + "%",
317    webkitAnimation: ' wdszoom' + bgSize + ' ' + Math.floor(1.1 * slideshow_interval) + 's linear 0s alternate infinite',
318    mozAnimation: ' wdszoom' + bgSize + ' ' + Math.floor(1.1 * slideshow_interval) + 's linear 0s alternate infinite',
319    animation: ' wdszoom' + bgSize + ' ' + Math.floor(1.1 * slideshow_interval) + 's linear 0s alternate infinite'
320  });
321}
322
323/* For browsers that does not support transitions.*/
324function wds_fallback(wds, current_image_class, next_image_class, direction, wds, wds_transition_duration) {
325  wds_fade(current_image_class, next_image_class, direction);
326}
327
328function wds_fade(wds, current_image_class, next_image_class, direction) {
329  var container = {};
330  /* Set active thumbnail.*/
331  wds_set_filmstrip_class(wds);
332  wds_set_dots_class(wds);
333  if (wds_testBrowser_cssTransitions()) {
334    jQuery(next_image_class).css('transition', 'opacity ' + wds_params[wds].wds_transition_duration + 'ms linear');
335    jQuery(current_image_class).css({'opacity': 0, 'z-index': 1});
336    jQuery(next_image_class).css({'opacity': 1, 'z-index': 2});
337  }
338  else {
339    jQuery(current_image_class).animate({'opacity': 0, 'z-index': 1}, wds_params[wds].wds_transition_duration);
340    jQuery(next_image_class).animate({
341      'opacity': 1,
342      'z-index': 2
343    }, {
344      duration: wds_params[wds].wds_transition_duration,
345      complete: function () {
346      }
347    });
348    /* For IE.*/
349    jQuery(current_image_class).fadeTo(wds_params[wds].wds_transition_duration, 0);
350    jQuery(next_image_class).fadeTo(wds_params[wds].wds_transition_duration, 1);
351  }
352
353  jQuery.each( wds_params[wds].callback_items, function( index, value ) {
354    if ( index === 'onSliderCE' && value !== '' ) {
355      var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderCE );
356      wds_callback_f();
357    }
358  });
359}
360
361/* For browsers that support transitions, but not 3d transforms (only used if primary transition makes use of 3d-transforms).*/
362function wds_fallback3d(wds, urrent_image_class, next_image_class, direction) {
363  wds_sliceV(wds, current_image_class, next_image_class, direction);
364}
365
366function wds_sliceV(wds, current_image_class, next_image_class, direction) {
367  if (direction == 'right') {
368    var translateY = 'min-auto';
369  }
370  else if (direction == 'left') {
371    var translateY = 'auto';
372  }
373  wds_grid(wds, 10, 1, 0, 0, translateY, 1, 0, current_image_class, next_image_class, direction, 0, 0, 'ease-in-out');
374}
375
376function wds_grid(wds, cols, rows, ro, tx, ty, sc, op, current_image_class, next_image_class, direction, random, roy, easing) {
377  /* If browser does not support CSS transitions.*/
378  if (!wds_testBrowser_cssTransitions()) {
379    return wds_fallback(current_image_class, next_image_class, direction);
380  }
381  wds_params[wds].wds_trans_in_progress = true;
382  /* Set active thumbnail.*/
383  wds_set_filmstrip_class(wds);
384  wds_set_dots_class(wds);
385  /* The time (in ms) added to/subtracted from the delay total for each new gridlet.*/
386  var count = (wds_params[wds].wds_transition_duration) / (cols + rows);
387
388  /* Gridlet creator (divisions of the image grid, positioned with background-images to replicate the look of an entire slide image when assembled)*/
389  function wds_gridlet(wds, width, height, top, img_top, left, img_left, src, imgWidth, imgHeight, c, r) {
390    var delay = random ? Math.floor((cols + rows) * count * Math.random()) : (c + r) * count;
391    /* Return a gridlet elem with styles for specific transition.*/
392    var grid_div = jQuery('<span class="wds_gridlet_' + wds + '" />').css({
393      display: "block",
394      width: imgWidth, /*"100%"*/
395      height: jQuery(".wds_slideshow_image_spun_" + wds).height() + "px",
396      top: -top,
397      left: -left,
398      backgroundImage: src,
399      backgroundSize: jQuery(".wds_slideshow_image_" + wds).css("background-size"),
400      backgroundPosition: jQuery(".wds_slideshow_image_" + wds).css("background-position"),
401      backgroundRepeat: 'no-repeat'
402    });
403    return jQuery('<span class="wds_gridlet_' + wds + '" />').css({
404      display: "block",
405      width: width, /*"100%"*/
406      height: height,
407      top: top,
408      left: left,
409      backgroundSize: imgWidth + 'px ' + imgHeight + 'px',
410      backgroundPosition: img_left + 'px ' + img_top + 'px',
411      backgroundRepeat: 'no-repeat',
412      overflow: "hidden",
413      transition: 'all ' + wds_params[wds].wds_transition_duration + 'ms ' + easing + ' ' + delay + 'ms',
414      transform: 'none'
415    }).append(grid_div);
416  }
417
418  /* Get the current slide's image.*/
419  var cur_img = jQuery(current_image_class).find('span[data-img-id^="wds_slideshow_image"]');
420  /* Create a grid to hold the gridlets.*/
421  var grid = jQuery('<span style="display: block;" />').addClass('wds_grid_' + wds);
422  /* Prepend the grid to the next slide (i.e. so it's above the slide image).*/
423  jQuery(current_image_class).prepend(grid);
424  /* vars to calculate positioning/size of gridlets*/
425  var cont = jQuery(".wds_slide_bg_" + wds);
426  var imgWidth = cur_img.width();
427  var imgHeight = cur_img.height();
428  var contWidth = cont.width(),
429    contHeight = cont.height(),
430    imgSrc = cur_img.css('background-image'), /*.replace('/thumb', ''),*/
431    colWidth = Math.floor(contWidth / cols),
432    rowHeight = Math.floor(contHeight / rows),
433    colRemainder = contWidth - (cols * colWidth),
434    colAdd = Math.ceil(colRemainder / cols),
435    rowRemainder = contHeight - (rows * rowHeight),
436    rowAdd = Math.ceil(rowRemainder / rows),
437    leftDist = 0,
438    img_leftDist = (jQuery(".wds_slide_bg_" + wds).width() - cur_img.width()) / 2;
439  /* tx/ty args can be passed as 'auto'/'min-auto' (meaning use slide width/height or negative slide width/height).*/
440  tx = tx === 'auto' ? contWidth : tx;
441  tx = tx === 'min-auto' ? -contWidth : tx;
442  ty = ty === 'auto' ? contHeight : ty;
443  ty = ty === 'min-auto' ? -contHeight : ty;
444  /* Loop through cols*/
445  for (var i = 0; i < cols; i++) {
446    var topDist = 0,
447      img_topDst = (jQuery(".wds_slide_bg_" + wds).height() - cur_img.height()) / 2,
448      newColWidth = colWidth;
449    /* If imgWidth (px) does not divide cleanly into the specified number of cols, adjust individual col widths to create correct total.*/
450    if (colRemainder > 0) {
451      var add = colRemainder >= colAdd ? colAdd : colRemainder;
452      newColWidth += add;
453      colRemainder -= add;
454    }
455    /* Nested loop to create row gridlets for each col.*/
456    for (var j = 0; j < rows; j++) {
457      var newRowHeight = rowHeight,
458        newRowRemainder = rowRemainder;
459      /* If contHeight (px) does not divide cleanly into the specified number of rows, adju
459st individual row heights to create correct total.*/
460      if (newRowRemainder > 0) {
461        add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder;
462        newRowHeight += add;
463        newRowRemainder -= add;
464      }
465      /* Create & append gridlet to grid.*/
466      grid.append(wds_gridlet(wds, newColWidth, newRowHeight, topDist, img_topDst, leftDist, img_leftDist, imgSrc, imgWidth, imgHeight, i, j));
467      topDist += newRowHeight;
468      img_topDst -= newRowHeight;
469    }
470    img_leftDist -= newColWidth;
471    leftDist += newColWidth;
472  }
473  /* Show grid & hide the image it replaces.*/
474  grid.show();
475  cur_img.css('opacity', 0);
476  /* Add identifying classes to corner gridlets (useful if applying border radius).*/
477  grid.children().first().addClass('rs-top-left');
478  grid.children().last().addClass('rs-bottom-right');
479  grid.children().eq(rows - 1).addClass('rs-bottom-left');
480  grid.children().eq(-rows).addClass('rs-top-right');
481  /* Execution steps.*/
482  setTimeout(function () {
483    grid.children().css({
484      opacity: op,
485      transform: 'rotate(' + ro + 'deg) rotateY(' + roy + 'deg) translateX(' + tx + 'px) translateY(' + ty + 'px) scale(' + sc + ')'
486    });
487  }, 1);
488  jQuery(next_image_class).css('opacity', 1);
489  /* After transition.*/
490  var cccount = 0;
491  var obshicccount = cols * rows;
492  grid.children().one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(wds_after_trans_each));
493
494  function wds_after_trans_each(wds) {
495    if (++cccount == obshicccount) {
496      wds_after_trans(wds);
497    }
498  }
499
500  function wds_after_trans() {
501    jQuery(current_image_class).css({'opacity': 0, 'z-index': 1});
502    jQuery(next_image_class).css({'opacity': 1, 'z-index': 2});
503    cur_img.css('opacity', 1);
504    grid.remove();
505    wds_params[wds].wds_trans_in_progress = false;
506    if (typeof wds_params[wds].wds_event_stack !== 'undefined') {
507      if (wds_params[wds].wds_event_stack.length > 0) {
508        key = wds_params[wds].wds_event_stack[0].split("-");
509        wds_params[wds].wds_event_stack.shift();
510        wds_change_image(wds, key[0], key[1], wds_params[wds].wds_data, true, direction);
511      }
512    }
513    jQuery.each( wds_params[wds].callback_items, function( index, value ) {
514      if ( index === 'onSliderCE' && value !== '' ) {
515        var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderCE );
516        wds_callback_f();
517      }
518    });
519  }
520}
521
522function wds_change_image(wds, current_key, key, wds_data, from_effect, btn) {
523  if (typeof btn == "undefined") {
524    var btn = "";
525  }
526  if (!(wds_params[wds].carousel != 0 || wds_data[key]["is_video"] != 'image')) {
527    jQuery('<img />').attr("src", wds_data[key]["image_url"])
528                     .on('load', function () {
529                       jQuery(this).remove();
530                       wds_change_image_when_loaded(wds, current_key, key, wds_data, from_effect, btn);
531                     })
532                     .on('error', function () {
533                       jQuery(this).remove();
534                       wds_change_image_when_loaded(wds, current_key, key, wds_data, from_effect, btn);
535                     });
536  }
537  else {
538    wds_change_image_when_loaded(wds, current_key, key, wds_data, from_effect, btn);
539  }
540}
541
542function wds_play_wds(wds) {
543  wds_params[wds].wds_play_pause_state = 0;
544  /* Play.*/
545  jQuery(".wds_slideshow_play_pause_" + wds).attr("title", wds_object.pause);
546  jQuery(".wds_slideshow_play_pause_" + wds).attr("class", "wds_ctrl_btn_" + wds + " wds_slideshow_play_pause_" + wds + " fa fa-pause");
547  /* Finish current animation and begin the other.*/
548  if (wds_params[wds].enable_slideshow_autoplay) {
549    if (wds_params[wds].timer_bar_type != 'top') {
550      if (wds_params[wds].timer_bar_type != 'bottom') {
551        if (typeof wds_params[wds].circle_timer_animate !== 'undefined') {
552          wds_params[wds].circle_timer_animate.stop();
553          if (wds_params[wds].carousel) {
554            wds_params[wds].wds_carousel_wds.pause();
555          }
556        }
557          wds_circle_timer(wds_params[wds].curent_time_deggree);
558      }
559    }
560  }
561  play_wds(wds);
562  if (wds_params[wds].enable_slideshow_music) {
563    if (wds_params[wds].slideshow_music_url != '') {
564      document.getElementById("wds_audio_" + wds).play();
565    }
566  }
567  if (wds_params[wds].carousel) {
568    wds_params[wds].wds_carousel_wds.start();
569  }
570}
571
572function play_wds(wds) {
573  if (wds_params[wds].timer_bar_type != 'none') {
574    if (wds_params[wds].enable_slideshow_autoplay || jQuery('.wds_ctrl_btn_' + wds).hasClass('fa-pause')) {
575      jQuery(".wds_line_timer_" + wds).animate({
576        width: "100%"
577      }, {
578        duration: wds_params[wds].slideshow_interval * 1000,
579        specialEasing: {width: "linear"}
580      });
581    }
582  }
583  window.clearInterval(wds_params[wds].wds_playInterval);
584  /* Play.*/
585  wds_params[wds].wds_playInterval = setInterval(function () {
586    var curr_img_index = parseInt(jQuery('#wds_current_image_key_' + wds).val());
587    if (wds_params[wds].slider_loop == 0) {
588      if (wds_params[wds].twoway_slideshow) {
589        if (wds_params[wds].wds_global_btn_wds == "left") {
590          if (curr_img_index == 0) {
591            return false;
592          }
593        }
594        else {
595          if (curr_img_index == wds_params[wds].slides_count - 1) {
596            return false;
597          }
598        }
599      }
600      else {
601        if (curr_img_index == wds_params[wds].slides_count - 1) {
602          return false;
603        }
604      }
605    }
606    var curr_img_id = wds_params[wds].wds_data[parseInt(jQuery('#wds_current_image_key_' + wds).val())]["id"];
607      wds_params[wds].video_is_playing = false;
608    jQuery("#wds_image_id_" + wds + "_" + curr_img_id).find("video").each(function () {
609      if (!this.paused) {
610          wds_params[wds].video_is_playing = true;
611      }
612    });
613    jQuery("#wds_image_id_" + wds + "_" + curr_img_id).find("iframe[data-type='youtube']").each(function () {
614      player = wds_params[wds].youtube_iframes_ids.indexOf(this.id);
615      if (typeof wds_params[wds].youtube_iframes[player] != "undefined") {
616        if (typeof wds_params[wds].youtube_iframes[player].getPlayerState == "function") {
617          if (wds_params[wds].youtube_iframes[player].getPlayerState() == 1) {
618              wds_params[wds].video_is_playing = true;
619          }
620        }
621      }
622    });
623    iframe_message_sent_wds = 0;
624    wds_params[wds].iframe_message_received = 0;
625    jQuery("#wds_image_id_" + wds + "_" + curr_img_id).find("iframe[data-type='vimeo']").each(function () {
626      jQuery(this)[0].contentWindow.postMessage('{ "method": "paused" }', "*");
627      iframe_message_sent_wds = iframe_message_sent_wds + 1;
628    });
629
630    function wds_call_change() {
631      if (!wds_params[wds].video_is_playing) {
632        var iterator = 1;
633        var img_index = (parseInt(jQuery('#wds_current_image_key_' + wds).val()) + iterator) % wds_params[wds].wds_data.length;
634        if (wds_params[wds].enable_slideshow_shuffle) {
635          iterator = Math.floor((wds_params[wds].wds_data.length - 1) * Math.random() + 1);
636        }
637        else if (wds_params[wds].twoway_slideshow) {
638          if (wds_params[wds].wds_global_btn_wds == "left") {
639            iterator = -1;
640          }
641        }
642        img_index = (parseInt(jQuery('#wds_current_image_key_' + wds).val()) + iterator) >= 0 ? (parseInt(jQuery('#wds_current_image_key_' + wds).val()) + iterator) % wds_params[wds].wds_data.length : wds_params[wds].wds_data.length - 1;
643        wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_' + wds).val()), img_index, wds_params[wds].wds_data);
644        if (wds_params[wds].carousel == 1) {
645            wds_carousel[wds].next();
646        }
647      }
648    }
649
650    function wds_check_message_received() {
651      return iframe_message_sent_wds == wds_params[wds].iframe_message_received ? true : false;
652    }
653
654    function wds_call(wds_condition, wds_callback) {
655      if (wds_condition()) {
656        wds_callback();
657      }
658      else {
659        setTimeout(function () {
660          wds_call(wds_condition, wds_callback);
661        }, 10);
662      }
663    }
664
665    wds_call(wds_check_message_received, wds_call_change);
666  }, parseInt(wds_params[wds].slideshow_interval * 1000) + wds_params[wds].wds_duration_for_change);
667}
668
669function wds_change_image_when_loaded(wds, current_key, key, wds_data, from_effect, btn) {
670  if (wds_params[wds].carousel == 1) {
671    if (wds_currentlyMoving[wds] == true) {
672      return;
673    }
674  }
675  /* Pause videos.*/
676  jQuery("#wds_slideshow_image_container_" + wds).find("iframe").each(function () {
677    if (typeof jQuery(this)[0].contentWindow != "undefined") {
678      if (jQuery(this).data('type') == 'youtube') {
679        player = wds_params[wds].youtube_iframes_ids.indexOf(this.id);
680        if (typeof wds_params[wds].youtube_iframes[player] != "undefined" && wds_done) {
681          wds_params[wds].youtube_iframes[player].stopVideo();
682        }
683      }
684      else if (jQuery(this).data('type') == 'vimeo') {
685        jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
686      }
687      else {
688        jQuery(this)[0].contentWindow.postMessage('stop', '*');
689      }
690    }
691  });
692  jQuery("#wds_slideshow_image_container_" + wds).find("video").each(function () {
693    jQuery(this).trigger('pause');
694    jQuery('.wds_bigplay_' + wds).show();
695  });
696  /* Pause layer videos.*/
697  jQuery(".wds_video_layer_frame_" + wds).each(function () {
698    if (typeof jQuery(this)[0].contentWindow != "undefined") {
699      if (jQuery(this).data('type') == 'youtube') {
700        player = wds_params[wds].youtube_iframes_ids.indexOf(this.id);
701        if (typeof wds_params[wds].youtube_iframes[player] != "undefined") {
702          wds_params[wds].youtube_iframes[player].stopVideo();
703        }
704      }
705      else if (jQuery(this).data('type') == 'vimeo') {
706        jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
707      }
708      else {
709        jQuery(this)[0].contentWindow.postMessage('stop', '*');
710      }
711    }
712  });
713
714  if (wds_data[key]) {
715
716    if (jQuery('.wds_ctrl_btn_' + wds).hasClass('fa-pause') || wds_params[wds].autoplay) {
717      play_wds(wds);
718    }
719    if (!from_effect) {
720      /* Change image key.*/
721      jQuery("#wds_current_image_key_" + wds).val(key);
722      if (current_key == '-1') { /* Filmstrip.*/
723        current_key = jQuery(".wds_slideshow_thumb_active_" + wds).children("img").attr("data-image-key");
724      }
725      else if (current_key == '-2') { /* Dots.*/
726        currId = jQuery(".wds_slideshow_dots_active_" + wds).attr("id");
727        current_key = currId.replace('wds_dots_', '').replace('_' + wds, '');
728      }
729    }
730    if (wds_params[wds].wds_trans_in_progress) {
731      wds_params[wds].wds_event_stack.push(current_key + '-' + key);
732      return;
733    }
734    if (btn == "") {
735      var direction = "right";
736      var int_curr_key = parseInt(wds_params[wds].wds_current_key);
737      var int_key = parseInt(key);
738      var last_pos = wds_data.length - 1;
739      if (int_curr_key > int_key) {
740        direction = 'left';
741      }
742      else if (int_curr_key == int_key) {
743        return;
744      }
745      /* From last slide to first.*/
746      if (int_key == 0) {
747        if (int_curr_key == last_pos) {
748          direction = 'right';
749        }
750      }
751      /* From first slide to last if there are more than two slides in the slider.*/
752      if (int_key == last_pos) {
753        if (int_curr_key == 0) {
754          if (last_pos > 1) {
755            direction = 'left';
756          }
757        }
758      }
759    }
760    else {
761      direction = btn;
762    }
763    if (wds_params[wds].enable_slideshow_autoplay) {
764      if (wds_params[wds].twoway_slideshow) {
765        wds_params[wds].wds_global_btn_wds = direction;
766      }
767    }
768    /* Set active thumbnail position.*/
769    if (wds_params[wds].width_or_height == 'width') {
770      wds_params[wds].wds_current_filmstrip_pos = key * (jQuery(".wds_slideshow_filmstrip_thumbnail_" + wds).width() + 2 + 2 * 0);
771    }
772    else {
773      wds_params[wds].wds_current_filmstrip_pos = key * (jQuery(".wds_slideshow_filmstrip_thumbnail_" + wds).height() + 2 + 2 * 0);
774    }
775    wds_params[wds].wds_current_key = key;
776    /* Change image id.*/
777    jQuery("div[data-img-id=wds_slideshow_image_" + wds + "]").attr('data-image-id', wds_data[key]["id"]);
778    var current_image_class = "#wds_image_id_" + wds + "_" + wds_data[current_key]["id"];
779    var next_image_class = "#wds_image_id_" + wds + "_" + wds_data[key]["id"];
780    var next_image_type = wds_data[key]["is_video"];
781    if (next_image_type == 'video' || next_image_type.indexOf('EMBED') >= 0) {
782      jQuery('.wds_pp_btn_cont').hide();
783    }
784    else {
785      jQuery('.wds_pp_btn_cont').show();
786    }
787    if (wds_data[key]["target_attr_slide"] == 1) {
788      wds_embed_slide_autoplay(next_image_class, wds);
789    }
790    if (wds_params[wds].preload_images && !wds_params[wds].carousel) {
791      if (wds_data[key]["is_video"] == 'image') {
792        jQuery(next_image_class).find(".wds_slideshow_image_" + wds).css("background-image", 'url("' + wds_data[key]["image_url"] + '")');
793      }
794      else if (wds_data[key]["is_video"] == 'EMBED_OEMBED_INSTAGRAM_IMAGE') {
795        jQuery(next_image_class).find(".wds_slideshow_image_" + wds).css("background-image", 'url("//instagram.com/p/' + wds_data[key]["image_url"] + '/media/?size=l")');
796      }
797    }
798    wds_video_dimenstion(wds, key);
799    var current_slide_layers_count = wds_data[current_key]["slide_layers_count"];
800    var next_slide_layers_count = wds_data[key]["slide_layers_count"];
801
802    /* Clear layers before image change.*/
803    function set_layer_effect_out_before_change(wds, m) {
804      wds_params[wds].wds_clear_layers_effects_out_before_change[current_key][m] = setTimeout(function () {
805        if (wds_data[current_key]["layer_" + m + "_type"] != 'social') {
806          if (jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"]).prev().attr('id') != 'wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"] + '_round_effect') {
807            jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"]).css('-webkit-animation-duration', 0.6 + 's').css('animation-duration', 0.6 + 's');
808            jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"]).removeClass().addClass(wds_data[current_key]["layer_" + m + "_layer_effect_out"] + ' wds_animated');
809            jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"]).addClass(jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"]).data("class"));
810          }
811          else {
812            jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"] + "_div").css('-webkit-animation-duration', 0.6 + 's').css('animation-duration', 0.6 + 's');
813            jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"] + "_div").removeClass().addClass(wds_data[current_key]["layer_" + m + "_layer_effect_out"] + ' wds_animated');
814          }
815        }
816        else {
817          jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"]).css('-webkit-animation-duration', 0.6 + 's').css('animation-duration', 0.6 + 's');
818          jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"]).removeClass().addClass(wds_data[current_key]["layer_" + m + "_layer_effect_out"] + ' fa fa-' + wds_data[current_key]["layer_" + m + "_social_button"] + ' wds_animated');
819        }
820
821      }, 10);
822    }
823
824    if (wds_params[wds].layer_out_next) {
825      for (var m = 0; m < current_slide_layers_count; m++) {
826        if (jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"]).prev().attr('id') != 'wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + i + "_id"] + '_round_effect') {
827          if (jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"]).css('opacity') != 0) {
828            set_layer_effect_out_before_change(wds, m);
829          }
830        }
831        else {
832          if (jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + m + "_id"] + "_div").css('opacity') != 0) {
833            set_layer_effect_out_before_change(wds, m);
834          }
835        }
836      }
837    }
838
839    /* Loop through current slide layers for clear effects.*/
840    setTimeout(function () {
841      for (var k = 0; k < current_slide_layers_count; k++) {
842        clearTimeout(wds_params[wds].wds_clear_layers_effects_in[current_key][k]);
843        clearTimeout(wds_params[wds].wds_clear_layers_effects_out[current_key][k]);
844        if (wds_data[current_key]["layer_" + k + "_type"] != 'social') {
845          jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + k + "_id"]).removeClass().addClass('wds_layer_' + wds_data[current_key]["layer_" + k + "_id"]);
846        }
847        else {
848          jQuery('#wds_' + wds + '_slide' + wds_data[current_key]["id"] + '_layer' + wds_data[current_key]["layer_" + k + "_id"]).removeClass().addClass('fa fa-' + wds_data[current_key]["layer_" + k + "_social_button"] + ' wds_layer_' + wds_data[current_key]["layer_" + k + "_id"]);
849        }
850      }
851    }, wds_params[wds].wds_duration_for_clear_effects);
852
853    /* Loop through layers in.*/
854    for (var j = 0; j < next_slide_layers_count; j++) {
855      wds_set_layer_effect_in_wds(wds, j, key);
856    }
857
858    /* Loop through layers out if pause button not pressed.*/
859    for (var i = 0; i < next_slide_layers_count; i++) {
860      wds_set_layer_effect_out_wds(wds, i, key);
861    }
862
863    setTimeout(function () {
864      if (typeof jQuery().finish !== 'undefined') {
865        if (jQuery.isFunction(jQuery().finish)) {
866          jQuery(".wds_line_timer_" + wds).finish();
867        }
868      }
869      jQuery(".wds_line_timer_" + wds).css({width: 0});
870      if (!wds_params[wds].carousel) {
871        if (typeof window[wds_params[wds].wds_slideshow_effect] == 'function') {
872          window[wds_params[wds].wds_slideshow_effect](wds, current_image_class, next_image_class, direction);
873        }
874        else {
875          wds_none(wds, current_image_class, next_image_class, direction);
876        }
877      }
878      if (wds_params[wds].timer_bar_type != 'none') {
879
880        if (wds_params[wds].enable_slideshow_autoplay || jQuery('.wds_ctrl_btn_' + wds).hasClass('fa-pause')) {
881          if (wds_params[wds].timer_bar_type == 'top' || wds_params[wds].timer_bar_type == 'bottom') {
882            if (!jQuery(".wds_ctrl_btn_" + wds).hasClass("fa-play")) {
883              jQuery(".wds_line_timer_" + wds).animate({
884                width: "100%"
885              }, {
886                duration: wds_params[wds].slideshow_interval * 1000,
887                specialEasing: {width: "linear"}
888              });
889            }
890          }
891          else if (wds_params[wds].timer_bar_type != 'none') {
892            if (typeof wds_params[wds].circle_timer_animate !== 'undefined') {
893              wds_params[wds].circle_timer_animate.stop();
894            }
895            jQuery('#top_right_' + wds).css({
896              '-moz-transform': 'rotate(0deg)',
897              '-webkit-transform': 'rotate(0deg)',
898              '-o-transform': 'rotate(0deg)',
899              '-ms-transform': 'rotate(0deg)',
900              'transform': 'rotate(0deg)',
901              '-webkit-transform-origin': 'left bottom',
902              '-ms-transform-origin': 'left bottom',
903              '-moz-transform-origin': 'left bottom',
904              'transform-origin': 'left bottom'
905            });
906            jQuery('#bottom_right_' + wds).css({
907              '-moz-transform': 'rotate(0deg)',
908              '-webkit-transform': 'rotate(0deg)',
909              '-o-transform': 'rotate(0deg)',
910              '-ms-transform': 'rotate(0deg)',
911              'transform': 'rotate(0deg)',
912              '-webkit-transform-origin': 'left top',
913              '-ms-transform-origin': 'left top',
914              '-moz-transform-origin': 'left top',
915              'transform-origin': 'left top'
916            });
917            jQuery('#bottom_left_' + wds).css({
918              '-moz-transform': 'rotate(0deg)',
919              '-webkit-transform': 'rotate(0deg)',
920              '-o-transform': 'rotate(0deg)',
921              '-ms-transform': 'rotate(0deg)',
922              'transform': 'rotate(0deg)',
923              '-webkit-transform-origin': 'right top',
924              '-ms-transform-origin': 'right top',
925              '-moz-transform-origin': 'right top',
926              'transform-origin': 'right top'
927            });
928            jQuery('#top_left_' + wds).css({
929              '-moz-transform': 'rotate(0deg)',
930              '-webkit-transform': 'rotate(0deg)',
931              '-o-transform': 'rotate(0deg)',
932              '-ms-transform': 'rotate(0deg)',
933              'transform': 'rotate(0deg)',
934              '-webkit-transform-origin': 'right bottom',
935              '-ms-transform-origin': 'right bottom',
936              '-moz-transform-origin': 'right bottom',
937              'transform-origin': 'right bottom'
938            });
939            if (!jQuery(".wds_ctrl_btn_" + wds).hasClass("fa-play")) {
940              /* Begin circle timer on next.*/
941              wds_circle_timer(0);
942            }
943            else {
944              wds_params[wds].curent_time_deggree = 0;
945            }
946          }
947        }
948      }
949      if (wds_params[wds].filmstrip_position != 'none' && wds_params[wds].slides_count > 1) {
950        wds_move_filmstrip(wds);
951      }
952
953      if (wds_params[wds].bull_position != 'none' && wds_params[wds].slides_count > 1) {
954        wds_move_dots(wds);
955      }
956      if (wds_params[wds].wds_data[key]["is_video"] != 'image') {
957        jQuery("#wds_slideshow_play_pause_" + wds).css({display: 'none'});
958      }
959      else {
960        jQuery("#wds_slideshow_play_pause_" + wds).css({display: ''});
961      }
962    }, wds_params[wds].wds_duration_for_change);
963  }
964  if (wds_params[wds].parallax_effect == 1) {
965    wds_parallax(wds);
966  }
967
968  if (wds_params[wds].slider_effect == 'zoomFade') {
969    wds_genBgPos(next_image_class, wds, wds_params[wds].slideshow_interval);
970  }
971  wds_window_fixed_size(wds, next_image_class);
972
973  jQuery.each( wds_params[wds].callback_items, function( index, value ) {
974    if ( index === 'onSliderCS' && value !== '' ) {
975      var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderCS );
976      wds_callback_f();
977    }
978  });
979}
980
981function wds_blindR(wds, current_image_class, next_image_class, direction) {
982  wds_grid(wds, 8, 1, 0, 0, 0, 1, 1, current_image_class, next_image_class, direction, 1, 90, 'ease-in-out');
983}
984
985function wds_parallelSlideH(wds, current_image_class, next_image_class, direction) {
986  var width = jQuery(current_image_class).width();
987  var height = jQuery(current_image_class).height();
988  if (direction == 'right') {
989    wds_parallelSlide(wds, width, 0, -width, 0, current_image_class, next_image_class, direction, 'ease-in-out');
990  }
991  else if (direction == 'left') {
992    wds_parallelSlide(wds, -width, 0, width, 0, current_image_class, next_image_class, direction, 'ease-in-out');
993  }
994}
995
996function wds_parallelSlideV(wds, current_image_class, next_image_class, direction) {
997  var width = jQuery(current_image_class).width();
998  var height = jQuery(current_image_class).height();
999  if (direction == 'right') {
1000    wds_parallelSlide(wds, 0, height, 0, -height, current_image_class, next_image_class, direction, 'ease-in-out');
1001  }
1002  else if (direction == 'left') {
1003    wds_parallelSlide(wds, 0, -height, 0, height, current_image_class, next_image_class, direction, 'ease-in-out');
1004  }
1005}
1006
1007function wds_slic3DH(wds, current_image_class, next_image_class, direction) {
1008  var dimension = jQuery(current_image_class).width() / 2;
1009  if (direction == 'right') {
1010    wds_grid3d(wds, 1, 5, dimension, 0, -90, 0, dimension, 90, 0, current_image_class, next_image_class, direction, 0, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1011  }
1012  else if (direction == 'left') {
1013    wds_grid3d(wds, 1, 5, dimension, 0, 90, 0, -dimension, -90, 0, current_image_class, next_image_class, direction, 0, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1014  }
1015}
1016
1017function wds_slic3DV(wds, current_image_class, next_image_class, direction) {
1018  var dimension = jQuery(current_image_class).height() / 2;
1019  if (direction == 'right') {
1020    wds_grid3d(wds, 10, 1, dimension, -90, 0, -dimension, 0, 0, 90, current_image_class, next_image_class, direction, 0, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1021  }
1022  else if (direction == 'left') {
1023    wds_grid3d(wds, 10, 1, dimension, 90, 0, dimension, 0, 0, -90, current_image_class, next_image_class, direction, 0, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1024  }
1025}
1026
1027function wds_slicR3DH(wds, current_image_class, next_image_class, direction) {
1028  var dimension = jQuery(current_image_class).width() / 2;
1029  if (direction == 'right') {
1030    wds_grid3d(wds, 1, 5, dimension, 0, -90, 0, dimension, 90, 0, current_image_class, next_image_class, direction, 1, 'ease-in-out');
1031  }
1032  else if (direction == 'left') {
1033    wds_grid3d(wds, 1, 5, dimension, 0, 90, 0, -dimension, -90, 0, current_image_class, next_image_class, direction, 1, 'ease-in-out');
1034  }
1035}
1036
1037function wds_slicR3DV(wds, current_image_class, next_image_class, direction) {
1038  var dimension = jQuery(current_image_class).height() / 2;
1039  if (direction == 'right') {
1040    wds_grid3d(wds, 10, 1, dimension, -90, 0, -dimension, 0, 0, 90, current_image_class, next_image_class, direction, 1, 'ease-in-out');
1041  }
1042  else if (direction == 'left') {
1043    wds_grid3d(wds, 10, 1, dimension, 90, 0, dimension, 0, 0, -90, current_image_class, next_image_class, direction, 1, 'ease-in-out');
1044  }
1045}
1046
1047function wds_tilesR(wds, current_image_class, next_image_class, direction) {
1048  wds_grid(wds, 8, 8, 0, 0, 0, 1, 1, current_image_class, next_image_class, direction, 1, 90, 'ease-in-out');
1049}
1050
1051function wds_blockScaleR(wds, current_image_class, next_image_class, direction) {
1052  wds_grid(wds, 8, 6, 0, 0, 0, 0.6, 0, current_image_class, next_image_class, direction, 1, 0, 'ease-in-out');
1053}
1054
1055function wds_cubeH(wds, current_image_class, next_image_class, direction) {
1056  /* Set to half of image width.*/
1057  var dimension = jQuery(current_image_class).width() / 2;
1058  if (direction == 'right') {
1059    wds_cube(wds, dimension, dimension, 0, 0, 90, 0, -90, current_image_class, next_image_class, direction, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1060  }
1061  else if (direction == 'left') {
1062    wds_cube(wds, dimension, -dimension, 0, 0, -90, 0, 90, current_image_class, next_image_class, direction, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1063  }
1064}
1065
1066function wds_cubeV(wds, current_image_class, next_image_class, direction) {
1067  /* Set to half of image height.*/
1068  var dimension = jQuery(current_image_class).height() / 2;
1069  /* If next slide.*/
1070  if (direction == 'right') {
1071    wds_cube(wds, dimension, 0, -dimension, 90, 0, -90, 0, current_image_class, next_image_class, direction, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1072  }
1073  else if (direction == 'left') {
1074    wds_cube(wds, dimension, 0, dimension, -90, 0, 90, 0, current_image_class, next_image_class, direction, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1075  }
1076}
1077
1078function wds_cube(wds, tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_image_class, direction, easing) {
1079  /* If browser does not support 3d transforms/CSS transitions.*/
1080  if (!wds_testBrowser_cssTransitions()) {
1081    return wds_fallback(wds, current_image_class, next_image_class, direction);
1082  }
1083  if (!wds_testBrowser_cssTransforms3d()) {
1084    return wds_fallback3d(wds, current_image_class, next_image_class, direction);
1085  }
1086  wds_params[wds].wds_trans_in_progress = true;
1087  /* Set active thumbnail.*/
1088  wds_set_filmstrip_class(wds);
1089  wds_set_dots_class(wds);
1090  jQuery(".wds_slide_container_" + wds).css('overflow', 'visible');
1091  jQuery(".wds_slideshow_image_spun2_" + wds).css('overflow', 'visible');
1092  jQuery(".wds_slideshow_image_wrap_" + wds).css('overflow', 'visible');
1093  var filmstrip_position = wds_params[wds].filmstrip_position;
1094  if (filmstrip_position == 'none') {
1095    jQuery(".wds_slideshow_image_" + wds).css('border-radius', jQuery(".wds_slideshow_image_wrap_" + wds).css('border-radius'));
1096  }
1097  else {
1098    jQuery(".wds_slideshow_image_" + wds).css('border-radius', wds_params[wds].glb_border_radius);
1099    jQuery(".wds_slideshow_filmstrip_container_" + wds).css('border-radius', wds_params[wds].glb_border_radius);
1100    if (filmstrip_position == 'top') {
1101      jQuery(".wds_slideshow_image_" + wds).css('border-top-left-radius', 0);
1102      jQuery(".wds_slideshow_image_" + wds).css('border-top-right-radius', 0);
1103      jQuery(".wds_slideshow_filmstrip_container_" + wds).css('border-bottom-left-radius', 0);
1104      jQuery(".wds_slideshow_filmstrip_container_" + wds).css('border-bottom-right-radius', 0);
1105    }
1106    else if (filmstrip_position == 'bottom') {
1107      jQuery(".wds_slideshow_image_" + wds).css('border-bottom-left-radius', 0);
1108      jQuery(".wds_slideshow_image_" + wds).css('border-bottom-right-radius', 0);
1109      jQuery(".wds_slideshow_filmstrip_container_" + wds).css('border-top-left-radius', 0);
1110      jQuery(".wds_slideshow_filmstrip_container_" + wds).css('border-top-right-radius', 0);
1111    }
1112    else if (filmstrip_position == 'right') {
1113      jQuery(".wds_slideshow_image_" + wds).css('border-bottom-right-radius', 0);
1114      jQuery(".wds_slideshow_image_" + wds).css('border-top-right-radius', 0);
1115      jQuery(".wds_slideshow_filmstrip_container_" + wds).css('border-bottom-left-radius', 0);
1116      jQuery(".wds_slideshow_filmstrip_container_" + wds).css('border-top-left-radius', 0);
1117    }
1118    else if (filmstrip_position == 'left') {
1119      jQuery(".wds_slideshow_image_" + wds).css('border-bottom-left-radius', 0);
1120      jQuery(".wds_slideshow_image_" + wds).css('border-top-left-radius', 0);
1121      jQuery(".wds_slideshow_filmstrip_container_" + wds).css('border-bottom-right-radius', 0);
1122      jQuery(".wds_slideshow_filmstrip_container_" + wds).css('border-top-right-radius', 0);
1123    }
1124  }
1125  jQuery(".wds_slide_bg_" + wds).css('perspective', 1000);
1126  jQuery(current_image_class).css({
1127    transform: 'translateZ(' + tz + 'px)',
1128    backfaceVisibility: 'hidden'
1129  });
1130  jQuery(next_image_class).css({
1131    opacity: 1,
1132    filter: 'Alpha(opacity=100)',
1133    zIndex: 2,
1134    backfaceVisibility: 'hidden',
1135    transform: 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY(' + nry + 'deg) rotateX(' + nrx + 'deg)'
1136  });
1137  jQuery(".wds_slider_" + wds).css({
1138    transform: 'translateZ(-' + tz + 'px)',
1139    transformStyle: 'preserve-3d',
1140    position: 'absolute'
1141  });
1142  /* Execution steps.*/
1143  setTimeout(function () {
1144    jQuery(".wds_slider_" + wds).css({
1145      transition: 'all ' + wds_params[wds].wds_transition_duration + 'ms ' + easing,
1146      transform: 'translateZ(-' + tz + 'px) rotateX(' + wrx + 'deg) rotateY(' + wry + 'deg)'
1147    });
1148  }, 20);
1149  /* After transition.*/
1150  jQuery(".wds_slider_" + wds).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(wds_after_trans));
1151
1152  function wds_after_trans() {
1153    jQuery(current_image_class).removeAttr('style');
1154    jQuery(next_image_class).removeAttr('style');
1155    jQuery(".wds_slider_" + wds).removeAttr('style');
1156    jQuery(current_image_class).css({'opacity': 0, filter: 'Alpha(opacity=0)', 'z-index': 1});
1157    jQuery(next_image_class).css({'opacity': 1, filter: 'Alpha(opacity=100)', 'z-index': 2});
1158    wds_params[wds].wds_trans_in_progress = false;
1159    if (typeof wds_params[wds].wds_event_stack !== 'undefined') {
1160      if (wds_params[wds].wds_event_stack.length > 0) {
1161        key = wds_params[wds].wds_event_stack[0].split("-");
1162        wds_params[wds].wds_event_stack.shift();
1163        wds_change_image(wds, key[0], key[1], wds_params[wds].wds_data, true, direction);
1164      }
1165    }
1166    jQuery(".wds_slide_container_" + wds).css('overflow', 'hidden');
1167    jQuery(".wds_slideshow_image_spun2_" + wds).css('overflow', 'hidden');
1168    jQuery(".wds_slideshow_image_wrap_" + wds).css('overflow', 'hidden');
1169    jQuery(".wds_slide_bg_" + wds).css('perspective', 'none');
1170    jQuery.each( wds_params[wds].callback_items, function( index, value ) {
1171      if ( index === 'onSliderCE' && value !== '' ) {
1172        var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderCE );
1173        wds_callback_f();
1174      }
1175    });
1176  }
1177}
1178
1179function wds_cubeR(wds, current_image_class, next_image_class, direction) {
1180  var random_direction = Math.floor(Math.random() * 2);
1181  var dimension = random_direction ? jQuery(current_image_class).height() / 2 : jQuery(current_image_class).width() / 2;
1182  if (direction == 'right') {
1183    if (random_direction) {
1184      wds_cube(wds, dimension, 0, -dimension, 90, 0, -90, 0, current_image_class, next_image_class, direction, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1185    }
1186    else {
1187      wds_cube(wds, dimension, dimension, 0, 0, 90, 0, -90, current_image_class, next_image_class, direction, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1188    }
1189  }
1190  else if (direction == 'left') {
1191    if (random_direction) {
1192      wds_cube(wds, dimension, 0, dimension, -90, 0, 90, 0, current_image_class, next_image_class, direction, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1193    }
1194    else {
1195      wds_cube(wds, dimension, -dimension, 0, 0, -90, 0, 90, current_image_class, next_image_class, direction, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1196    }
1197  }
1198}
1199
1200function wds_sliceH(wds, current_image_class, next_image_class, direction) {
1201  if (direction == 'right') {
1202    var translateX = 'min-auto';
1203  }
1204  else if (direction == 'left') {
1205    var translateX = 'auto';
1206  }
1207  wds_grid(wds, 1, 8, 0, translateX, 0, 1, 0, current_image_class, next_image_class, direction, 0, 0, 'ease-in-out');
1208}
1209
1210function wds_slideV(wds, current_image_class, next_image_class, direction) {
1211  if (direction == 'right') {
1212    var translateY = 'auto';
1213  }
1214  else if (direction == 'left') {
1215    var translateY = 'min-auto';
1216  }
1217  wds_grid(wds, 1, 1, 0, 0, translateY, 1, 1, current_image_class, next_image_class, direction, 0, 0, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1218}
1219
1220function wds_slideH(wds, current_image_class, next_image_class, direction) {
1221  if (direction == 'right') {
1222    var translateX = 'min-auto';
1223  }
1224  else if (direction == 'left') {
1225    var translateX = 'auto';
1226  }
1227  wds_grid(wds, 1, 1, 0, translateX, 0, 1, 1, current_image_class, next_image_class, direction, 0, 0, 'cubic-bezier(0.785, 0.135, 0.150, 0.860)');
1228}
1229
1230function wds_scaleOut(wds, current_image_class, next_image_class, direction) {
1231  wds_grid(wds, 1, 1, 0, 0, 0, 1.5, 0, current_image_class, next_image_class, direction, 0, 0, 'ease-in-out');
1232}
1233
1234function wds_scaleIn(wds, current_image_class, next_image_class, direction) {
1235  wds_grid(wds, 1, 1, 0, 0, 0, 0.5, 0, current_image_class, next_image_class, direction, 0, 0, 'ease-in-out');
1236}
1237
1238function wds_blockScale(wds, current_image_class, next_image_class, direction) {
1239  wds_grid(wds, 8, 6, 0, 0, 0, 0.6, 0, current_image_class, next_image_class, direction, 0, 0, 'ease-in-out');
1240}
1241
1242function wds_kaleidoscope(wds, current_image_class, next_image_class, direction) {
1243  wds_grid(wds, 10, 8, 0, 0, 0, 1, 0, current_image_class, next_image_class, direction, 0, 0, 'ease-in-out');
1244}
1245
1246function wds_fan(wds, current_image_class, next_image_class, direction) {
1247  if (direction == 'right') {
1248    var rotate = 45;
1249    var translateX = 100;
1250  }
1251  else if (direction == 'left') {
1252    var rotate = -45;
1253    var translateX = -100;
1254  }
1255  wds_grid(wds, 1, 10, rotate, translateX, 0, 1, 0, current_image_class, next_image_class, direction, 0, 0, 'ease-in-out');
1256}
1257
1258function wds_blindV(wds, current_image_class, next_image_class, direction) {
1259  wds_grid(wds, 1, 8, 0, 0, 0, .7, 0, current_image_class, next_image_class, direction, 0, 0, 'ease-in-out');
1260}
1261
1262function wds_blindH(wds, current_image_class, next_image_class, direction) {
1263  wds_grid(wds, 10, 1, 0, 0, 0, .7, 0, current_image_class, next_image_class, direction, 0, 0, 'ease-in-out');
1264}
1265
1266function wds_random(wds, current_image_class, next_image_class, direction) {
1267  var anims = ['sliceH', 'sliceV', 'slideH', 'slideV', 'scaleOut', 'scaleIn', 'blockScale', 'kaleidoscope', 'fan', 'blindH', 'blindV', 'parallelSlideH', 'parallelSlideV'];
1268  /* Pick a random transition from the anims array.*/
1269  window["wds_" + anims[Math.floor(Math.random() * anims.length)]](wds, current_image_class, next_image_class, direction);
1270}
1271
1272function wds_3Drandom(wds, current_image_class, next_image_class, direction) {
1273  var wds = wds_params[wds].wds;
1274  var anims = ['cubeH', 'cubeV', 'cubeR', 'slic3DH', 'slic3DV', 'slicR3DH', 'slicR3DV'];
1275  /* Pick a random transition from the anims array.*/
1276  window["wds_" + anims[Math.floor(Math.random() * anims.length)]](wds, current_image_class, next_image_class, direction);
1277}
1278
1279function wds_grid3d(wds, cols, rows, tz, wrx, wry, nty, ntx, nry, nrx, current_image_class, next_image_class, direction, random, easing) {
1280  /* If browser does not support CSS transitions.*/
1281  if (!wds_testBrowser_cssTransitions()) {
1282    return wds_fallback(wds, current_image_class, next_image_class, direction);
1283  }
1284  wds_params[wds].wds_trans_in_progress = true;
1285  /* Set active thumbnail.*/
1286  wds_set_filmstrip_class(wds);
1287  wds_set_dots_class(wds);
1288  /* The time (in ms) added to/subtracted from the delay total for each new gridlet.*/
1289  var count = (wds_params[wds].wds_transition_duration) / (cols + rows);
1290
1291  /* Gridlet creator (divisions of the image grid, positioned with background-images to replicate the look of an entire slide image when assembled)*/
1292  function wds_gridlet(width, height, top, img_top, left, img_left, src, src2, imgWidth, imgHeight, c, r) {
1293    var delay = random ? Math.floor((cols + rows) * count * Math.random()) : (c + r) * count;
1294    /* Return a gridlet elem with styles for specific transition.*/
1295    var grid_div = jQuery('<span class="wds_gridlet_' + wds + '" />').css({
1296      display: "block",
1297      width: "100%",
1298      height: "100%",
1299      transform: 'translateZ(' + tz + 'px)',
1300      backfaceVisibility: 'hidden',
1301      overflow: 'hidden'
1302    }).append(jQuery('<span class="wds_gridlet_' + wds + '" />').css({
1303      display: "block",
1304      width: jQuery(".wds_slideshow_image_spun_" + wds).width() + "px",
1305      height: jQuery(".wds_slideshow_image_spun_" + wds).height() + "px",
1306      top: -top,
1307      left: -left,
1308      backgroundImage: src,
1309      backgroundSize: jQuery(".wds_slideshow_image_" + wds).css("background-size"),
1310      backgroundPosition: jQuery(".wds_slideshow_image_" + wds).css("background-position"),
1311      backgroundRepeat: 'no-repeat',
1312    }));
1313    var grid_div2 = jQuery('<span class="wds_gridlet_' + wds + '" />').css({
1314      display: "block",
1315      width: "100%",
1316      height: "100%",
1317      backfaceVisibility: 'hidden',
1318      transform: 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY(' + nry + 'deg) rotateX(' + nrx + 'deg)',
1319      overflow: 'hidden'
1320    }).append(jQuery('<span class="wds_gridlet_' + wds + '" />').css({
1321      display: "block",
1322      width: jQuery(".wds_slideshow_image_spun_" + wds).width() + "px",
1323      height: jQuery(".wds_slideshow_image_spun_" + wds).height() + "px",
1324      top: -top,
1325      left: -left,
1326      backgroundImage: src2,
1327      backgroundSize: jQuery(".wds_slideshow_image_" + wds).css("background-size"),
1328      backgroundPosition: jQuery(".wds_slideshow_image_" + wds).css("background-position"),
1329      backgroundRepeat: 'no-repeat',
1330    }));
1331    return jQuery('<span class="wds_gridlet_' + wds + '" />').css({
1332      display: "block",
1333      width: width,
1334      height: height,
1335      top: top,
1336      left: left,
1337      transition: 'all ' + wds_params[wds].wds_transition_duration + 'ms ' + easing + ' ' + delay + 'ms',
1338      transform: 'translateZ(-' + tz + 'px)',
1339      transformStyle: 'preserve-3d',
1340    }).append(grid_div).append(grid_div2);
1341  }
1342
1343  /* Get the current slide's image.*/
1344  var cur_img = jQuery(current_image_class).find('span[data-img-id^="wds_slideshow_image"]');
1345  var next_img = jQuery(next_image_class).find('span[data-img-id^="wds_slideshow_image"]');
1346  /* Create a grid to hold the gridlets.*/
1347  var grid = jQuery('<span style="display: block;" />').addClass('wds_grid_' + wds).css('perspective', 1000);
1348  /* Prepend the grid to the next slide (i.e. so it's above the slide image).*/
1349  jQuery(current_image_class).prepend(grid);
1350  /* vars to calculate positioning/size of gridlets*/
1351  var cont = jQuery(".wds_slide_bg_" + wds);
1352  var imgWidth = cur_img.width();
1353  var imgHeight = cur_img.height();
1354  var contWidth = cont.width(),
1355    contHeight = cont.height(),
1356    imgSrc = cur_img.css('background-image'),
1357    imgSrcNext = next_img.css('background-image'),
1358    colWidth = Math.floor(contWidth / cols),
1359    rowHeight = Math.floor(contHeight / rows),
1360    colRemainder = contWidth - (cols * colWidth),
1361    colAdd = Math.ceil(colRemainder / cols),
1362    rowRemainder = contHeight - (rows * rowHeight),
1363    rowAdd = Math.ceil(rowRemainder / rows),
1364    leftDist = 0,
1365    img_leftDist = (jQuery(".wds_slide_bg_" + wds).width() - cur_img.width()) / 2;
1366  /* Loop through cols*/
1367  for (var i = 0; i < cols; i++) {
1368    var topDist = 0,
1369      img_topDst = (jQuery(".wds_slide_bg_" + wds).height() - cur_img.height()) / 2,
1370      newColWidth = colWidth;
1371    /* If imgWidth (px) does not divide cleanly into the specified number of cols, adjust individual col widths to create correct total.*/
1372    if (colRemainder > 0) {
1373      var add = colRemainder >= colAdd ? colAdd : colRemainder;
1374      newColWidth += add;
1375      colRemainder -= add;
1376    }
1377    /* Nested loop to create row gridlets for each col.*/
1378    for (var j = 0; j < rows; j++) {
1379      var newRowHeight = rowHeight,
1380        newRowRemainder = rowRemainder;
1381      /* If contHeight (px) does not divide cleanly into the specified number of rows, adju
1381st individual row heights to create correct total.*/
1382      if (newRowRemainder > 0) {
1383        add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder;
1384        newRowHeight += add;
1385        newRowRemainder -= add;
1386      }
1387      /* Create & append gridlet to grid.*/
1388      grid.append(wds_gridlet(newColWidth, newRowHeight, topDist, img_topDst, leftDist, img_leftDist, imgSrc, imgSrcNext, imgWidth, imgHeight, i, j));
1389      topDist += newRowHeight;
1390      img_topDst -= newRowHeight;
1391    }
1392    img_leftDist -= newColWidth;
1393    leftDist += newColWidth;
1394  }
1395  /* Show grid & hide the image it replaces.*/
1396  grid.show();
1397  cur_img.css('opacity', 0);
1398  /* Execution steps.*/
1399  setTimeout(function () {
1400    grid.children().css({
1401      transform: 'translateZ(-' + tz + 'px) rotateX(' + wrx + 'deg) rotateY(' + wry + 'deg)'
1402    });
1403  }, 1);
1404  /* After transition.*/
1405  var cccount = 0;
1406  var obshicccount = cols * rows;
1407  grid.children().one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(wds_after_trans_each));
1408
1409  function wds_after_trans_each(wds) {
1410    if (++cccount == obshicccount) {
1411      wds_after_trans(wds);
1412    }
1413  }
1414
1415  function wds_after_trans() {
1416    jQuery(current_image_class).css({'opacity': 0, 'z-index': 1});
1417    jQuery(next_image_class).css({'opacity': 1, 'z-index': 2});
1418    cur_img.css('opacity', 1);
1419    grid.remove();
1420    wds_params[wds].wds_trans_in_progress = false;
1421    if (typeof wds_params[wds].wds_event_stack !== 'undefined') {
1422      if (wds_params[wds].wds_event_stack.length > 0) {
1423        key = wds_params[wds].wds_event_stack[0].split("-");
1424        wds_params[wds].wds_event_stack.shift();
1425        wds_change_image(wds, key[0], key[1], wds_params[wds].wds_data, true, direction);
1426      }
1427    }
1428    jQuery.each( wds_params[wds].callback_items, function( index, value ) {
1429      if ( index === 'onSliderCE' && value !== '' ) {
1430        var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderCE );
1431        wds_callback_f();
1432      }
1433    });
1434  }
1435}
1436
1437function wds_window_fixed_size(wds, id) {
1438
1439  if (wds_params[wds].fixed_bg != 1 || wds_params[wds].wds_data[parseInt(j
1439Query('#wds_current_image_key_' + wds).val())]["is_video"] != 'image') {
1440    return;
1441  }
1442  var image = new Image();
1443  image.src = jQuery(id + " .wds_slideshow_image_" + wds).css('background-image').replace(/url\(|\)$|"/ig, '');
1444  var slide_bg_width = image.width;
1445  var slide_bg_height = image.height;
1446  if (typeof image.remove != 'undefined') {
1447    image.remove();
1448  }
1449  var window_height = jQuery(window).height();
1450  var window_width = jQuery(window).width();
1451  var width, height;
1452  var scale = Math.max(window_width / slide_bg_width, window_height / slide_bg_height);
1453  width = slide_bg_width * scale;
1454  height = slide_bg_height * scale;
1455  /* TOOD remove this
1456   if ('<?php echo $slider->bg_fit; ?>' == 'cover' || '<?php echo $slider->bg_fit; ?>' == 'contain') {
1457   var scale = Math.max(window_width / slide_bg_width, window_height / slide_bg_height);
1458   width = slide_bg_width * scale;
1459   height = slide_bg_height * scale;
1460   }
1461   else {
1462   width = window_width;
1463   height = window_height;
1464   }
1465   */
1466  jQuery(id + " .wds_slideshow_image_"+wds).css({"background-size": width + "px " + height + "px"});
1467  wds_window_fixed_pos(wds, id);
1468}
1469
1470function wds_window_fixed_pos(wds, id) {
1471  var cont = (typeof id == "undefined") ? "" : id + " ";
1472  var offset = jQuery(cont + ".wds_slideshow_image_" + wds).offset().top;
1473  var scrtop = jQuery(document).scrollTop();
1474  var sliderheight = jQuery(cont + ".wds_slideshow_image_" + wds).height();
1475  var window_height = jQuery(window).height();
1476  var fixed_pos;
1477  if (wds_params[wds].smart_crop == '1') {
1478    if (wds_params[wds].crop_image_position == 'right bottom'
1479      || wds_params[wds].crop_image_position == 'center bottom'
1480      || wds_params[wds].crop_image_position == 'left bottom') {
1481      pos_retion_height = "100%";
1482    }
1483    else if (wds_params[wds].crop_image_position == 'left center'
1484      || wds_params[wds].crop_image_position == 'center center'
1485      || wds_params[wds].crop_image_position == 'right center') {
1486      pos_retion_height = "50%";
1487    }
1488    else if (wds_params[wds].crop_image_position == 'left top'
1489      || wds_params[wds].crop_image_position == 'center top'
1490      || wds_params[wds].crop_image_position == 'right top') {
1491      pos_retion_height = "0%";
1492    }
1493  }
1494  fixed_pos = offset - scrtop - window_height / 2 + sliderheight / 2;
1495  jQuery(cont + ".wds_slideshow_image_" + wds).css({"background-position": "50% " + "calc(50% - " + fixed_pos + "px)"});
1496  if (scrtop < offset + sliderheight) {
1497    if (wds_params[wds].smart_crop == '1') {
1498      jQuery(cont + ".wds_slideshow_image_" + wds).css({"background-position": "" + pos_retion_height + " " + "calc(50% - " + fixed_pos + "px)"});
1499    }
1500  }
1501}
1502
1503/* Effects out part.*/
1504function wds_set_layer_effect_out_wds(wds, i, key) {
1505  var cout;
1506  wds_params[wds].wds_clear_layers_effects_out[key][i] = setTimeout(function () {
1507    cout = jQuery('#wds_' + wds + '_slide' + wds_params[wds].wds_data[key]["id"] + '_layer' + wds_params[wds].wds_data[key]["layer_" + i + "_id"]);
1508    if (wds_params[wds].wds_data[key]["layer_" + i + "_layer_effect_out"] != 'none') {
1509      if (wds_params[wds].wds_data[key]["layer_" + i + "_type"] != 'social') {
1510        if (jQuery('#wds_' + wds + '_slide' + wds_params[wds].wds_data[key]["id"] + '_layer' + wds_params[wds].wds_data[key]["layer_" + i + "_id"]).prev().attr('id') != 'wds_' + wds + '_slide' + wds_params[wds].wds_data[key]["id"] + '_layer' + wds_params[wds].wds_data[key]["layer_" + i + "_id"] + '_round_effect') {
1511          cout.css('-webkit-animation-duration', wds_params[wds].wds_data[key]["layer_" + i + "_duration_eff_out"] / 1000 + 's').css('animation-duration', wds_params[wds].wds_data[key]["layer_" + i + "_duration_eff_out"] / 1000 + 's');
1512          cout.removeClass().addClass(wds_params[wds].wds_data[key]["layer_" + i + "_layer_effect_out"] + ' wds_animated');
1513        }
1514        else {
1515          cout = jQuery('#wds_' + wds + '_slide' + wds_params[wds].wds_data[key]["id"] + '_layer' + wds_params[wds].wds_data[key]["layer_" + i + "_id"] + '_div');
1516          cout.css('-webkit-animation-duration', wds_params[wds].wds_data[key]["layer_" + i + "_duration_eff_out"] / 1000 + 's').css('animation-duration', wds_params[wds].wds_data[key]["layer_" + i + "_duration_eff_out"] / 1000 + 's');
1517          cout.removeClass().addClass(wds_params[wds].wds_data[key]["layer_" + i + "_layer_effect_out"] + ' wds_animated');
1518        }
1519
1520        setTimeout(function () {
1521          if(wds_params[wds].wds_data[key]["layer_" + i + "_type"] == 'upvideo') {
1522            var curr_iframe = jQuery('#wds_' + wds + '_slide' + wds_params[wds].wds_data[key]["id"] + '_layer' + wds_params[wds].wds_data[key]["layer_" + i + "_id"]+" video");
1523            jQuery("#wds_slideshow_image_container_" + wds).find("video").each(function () {
1524              if(jQuery(this).attr('id') == curr_iframe.attr('id')) {
1525                jQuery(this).trigger('pause');
1526                jQuery('.wds_bigplay_' + wds).show();
1527              }
1528            });
1529          }
1530
1531          if(wds_params[wds].wds_data[key]["layer_" + i + "_type"] == 'video') {
1532            var curr_iframe = jQuery('#wds_' + wds + '_slide' + wds_params[wds].wds_data[key]["id"] + '_layer' + wds_params[wds].wds_data[key]["layer_" + i + "_id"]+" .wds_video_layer_frame_" + wds);
1533            /* Pause layer videos. */
1534            jQuery(".wds_video_layer_frame_" + wds).each(function () {
1535              if(jQuery(this).attr('id') == curr_iframe.attr('id')) {
1536                if (typeof jQuery(this)[0].contentWindow != "undefined") {
1537                  if (jQuery(this).data('type') == 'youtube') {
1538                    player = wds_params[wds].youtube_iframes_ids.indexOf(this.id);
1539
1540                    if (typeof wds_params[wds].youtube_iframes[player] != "undefined" && wds_done) {
1541                      wds_params[wds].youtube_iframes[player].stopVideo();
1542                    }
1543                  }
1544                  else if (jQuery(this).data('type') == 'vimeo') {
1545                    jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
1546                  }
1547                  else {
1548                    jQuery(this)[0].contentWindow.postMessage('stop', '*');
1549                  }
1550                }
1551              }
1552            });
1553          }
1554        },wds_params[wds].wds_data[key]["layer_" + i + "_duration_eff_out"]);
1555      }
1556      else {
1557        cout.css('-webkit-animation-duration', wds_params[wds].wds_data[key]["layer_" + i + "_duration_eff_out"] / 1000 + 's').css('animation-duration', wds_params[wds].wds_data[key]["layer_" + i + "_duration_eff_out"] / 1000 + 's');
1558        cout.removeClass().addClass(wds_params[wds].wds_data[key]["layer_" + i + "_layer_effect_out"] + ' fa fa-' + wds_params[wds].wds_data[key]["layer_" + i + "_social_button"] + ' wds_animated');
1559      }
1560      var iteration_count = wds_params[wds].wds_data[key]["layer_" + i + "_infinite_out"] == 0 ? 'infinite' : wds_params[wds].wds_data[key]["layer_" + i + "_infinite_out"];
1561      cout.css(
1562        '-webkit-animation-iteration-count', iteration_count
1563      ).css(
1564        'animation-iteration-count', iteration_count
1565      );
1566    }
1567  }, wds_params[wds].wds_data[key]["layer_" + i + "_end"]);
1568}
1569
1570/* Effects in part.*/
1571function wds_set_layer_effect_in_wds(wds, j, key) {
1572  var cout;
1573  wds_params[wds].wds_clear_layers_effects_in[key][j] = setTimeout(function () {
1574    cout = jQuery('#wds_' + wds + '_slide' + wds_params[wds].wds_data[key]["id"] + '_layer' + wds_params[wds].wds_data[key]["layer_" + j + "_id"]);
1575    if (wds_params[wds].wds_data[key]["layer_" + j + "_type"] != 'social') {
1576      if (cout.prev().attr('id') != 'wds_' + wds + '_slide' + wds_params[wds].wds_data[key]["id"] + '_layer' + wds_params[wds].wds_data[key]["layer_" + j + "_id"] + '_round_effect') {
1577        cout.css('-webkit-animation-duration', wds_params[wds].wds_data[key]["layer_" + j + "_duration_eff_in"] / 1000 + 's').css('animation-duration', wds_params[wds].wds_data[key]["layer_" + j + "_duration_eff_in"] / 1000 + 's');
1578        cout.attr("class", "");
1579        cout.addClass(wds_params[wds].wds_data[key]["layer_" + j + "_layer_effect_in"] + ' wds_animated');
1580        cout.addClass(jQuery('#wds_' + wds + '_slide' + wds_params[wds].wds_data[key]["id"] + '_layer' + wds_params[wds].wds_data[key]["layer_" + j + "_id"]).data("class"));
1581      }
1582      else {
1583        cout = jQuery('#wds_' + wds + '_slide' + wds_params[wds].wds_data[key]["id"] + '_layer' + wds_params[wds].wds_data[key]["layer_" + j + "_id"] + '_div');
1584        cout.css('-webkit-animation-duration', wds_params[wds].wds_data[key]["layer_" + j + "_duration_eff_in"] / 1000 + 's').css('animation-duration', wds_params[wds].wds_data[key]["layer_" + j + "_duration_eff_in"] / 1000 + 's');
1585        cout.removeClass().addClass('hotspot_container ' + wds_params[wds].wds_data[key]["layer_" + j + "_layer_effect_in"] + ' wds_animated');
1586      }
1587    }
1588    else {
1589      cout.css('-webkit-animation-duration', wds_params[wds].wds_data[key]["layer_" + j + "_duration_eff_in"] / 1000 + 's').css('animation-duration', wds_params[wds].wds_data[key]["layer_" + j + "_duration_eff_in"] / 1000 + 's');
1590      cout.removeClass().addClass(wds_params[wds].wds_data[key]["layer_" + j + "_layer_effect_in"] + ' fa fa-' + wds_params[wds].wds_data[key]["layer_" + j + "_social_button"] + ' wds_animated');
1591    }
1592    /* Play video on layer in.*/
1593
1594    if (wds_params[wds].wds_data[key]["layer_" + j + "_type"] == "video") {
1595      if (wds_params[wds].wds_data[key]["layer_" + j + "_video_autoplay"] == "on") {
1596        cout.find("iframe").each(function () {
1597          if (jQuery(this).data('type') == 'youtube') {
1598            player = wds_params[wds].youtube_iframes_ids.indexOf(this.id);
1599            if (typeof wds_params[wds].youtube_iframes[player] != "undefined") {
1600              wds_playVideo(wds_params[wds].youtube_iframes[player]);
1601            }
1602          }
1603          else if (jQuery(this).data('type') == 'vimeo') {
1604            jQuery(this)[0].contentWindow.postMessage('{ "method": "play" }', "*");
1605          }
1606          else {
1607            jQuery(this)[0].contentWindow.postMessage('play', '*');
1608          }
1609        });
1610      }
1611    }
1612    wds_upvideo_layer_dimenstion(wds, key, j);
1613    var iteration_count = wds_params[wds].wds_data[key]["layer_" + j + "_infinite_in"] == 0 ? 'infinite' : wds_params[wds].wds_data[key]["layer_" + j + "_infinite_in"];
1614    cout.css(
1615      '-webkit-animation-iteration-count', iteration_count
1616    ).css(
1617      'animation-iteration-count', iteration_count
1618    );
1619  }, wds_params[wds].wds_data[key]["layer_" + j + "_start"]);
1620}
1621
1622function wds_none(wds, current_image_class, next_image_class, direction) {
1623  jQuery(current_image_class).css({'opacity': 0, 'z-index': 1});
1624  jQuery(next_image_class).css({'opacity': 1, 'z-index': 2});
1625  /* Set active thumbnail.*/
1626  wds_set_filmstrip_class(wds);
1627  wds_set_dots_class(wds);
1628}
1629
1630function wds_parallelSlide(wds, ni_left, ni_top, tx, ty, current_image_class, next_image_class, direction, easing) {
1631  /* If browser does not support 3d transforms/CSS transitions.*/
1632  if (!wds_testBrowser_cssTransitions()) {
1633    return wds_fallback(wds, current_image_class, next_image_class, direction);
1634  }
1635  if (!wds_testBrowser_cssTransforms3d(wds)) {
1636    return wds_fallback3d(wds, current_image_class, next_image_class, direction);
1637  }
1638  wds_params[wds].wds_trans_in_progress = true;
1639  /* Set active thumbnail.*/
1640  wds_set_filmstrip_class(wds);
1641  wds_set_dots_class(wds);
1642  jQuery(current_image_class).css({
1643    position: 'absolute',
1644    top: '0px',
1645    left: '0px',
1646    position: 'absolute',
1647  });
1648  jQuery(next_image_class).css({
1649    position: 'absolute',
1650    top: ni_top + 'px',
1651    left: ni_left + 'px',
1652    'opacity': 1,
1653    filter: 'Alpha(opacity=100)',
1654    position: 'absolute',
1655  });
1656  jQuery(".wds_slider_" + wds_params[wds].wds).css({
1657    position: 'relative',
1658    'backface-visibility': 'hidden'
1659  });
1660  jQuery(".wds_slide_bg_" + wds_params[wds].wds).css({
1661    overflow: 'hidden',
1662  });
1663  /* Execution steps.*/
1664  setTimeout(function () {
1665    jQuery('.wds_slider_' + wds_params[wds].wds).css({
1666      transition: 'all ' + wds_params[wds].wds_transition_duration + 'ms ' + easing,
1667      transform: 'translateX(' + tx + 'px) translateY(' + ty + 'px)',
1668    });
1669  }, 1);
1670  /* After transition.*/
1671  jQuery('.wds_slider_' + wds_params[wds].wds).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(wds_after_trans));
1672
1673  function wds_after_trans() {
1674    jQuery(current_image_class).removeAttr('style');
1675    jQuery(next_image_class).removeAttr('style');
1676    jQuery(".wds_slider_" + wds_params[wds].wds).removeAttr('style');
1677    jQuery(".wds_slide_bg_" + wds_params[wds].wds).removeAttr('style');
1678    jQuery(current_image_class).css({'opacity': 0, filter: 'Alpha(opacity=0)', 'z-index': 1});
1679    jQuery(next_image_class).css({'opacity': 1, filter: 'Alpha(opacity=100)', 'z-index': 2});
1680    wds_params[wds].wds_trans_in_progress = false;
1681    if (typeof wds_params[wds].wds_event_stack !== 'undefined') {
1682      if (wds_params[wds].wds_event_stack.length > 0) {
1683        key = wds_params[wds].wds_event_stack[0].split("-");
1684        wds_params[wds].wds_event_stack.shift();
1685        wds_change_image(wds, key[0], key[1], wds_params[wds].wds_data, true, direction);
1686      }
1687    }
1688    jQuery.each( wds_params[wds].callback_items, function( index, value ) {
1689      if ( index === 'onSliderCE' && value !== '' ) {
1690        var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderCE );
1691        wds_callback_f();
1692      }
1693    });
1694  }
1695}
1696
1697function wds_callbackItems(wds, callbackList, slide_id) {
1698  var key = jQuery(".wds_slideshow_image_" + wds + "[data-image-id='" + slide_id + "']").attr('data-image-key');
1699  switch (callbackList) {
1700    case 'SlidePlay':
1701      wds_play_pause(wds, 'play');
1702      break;
1703    case 'SlidePause':
1704      wds_play_pause(wds, 'pause');
1705      break;
1706    case 'SlidePlayPause':
1707      wds_play_pause(wds);
1708      break;
1709    case 'SlideNext':
1710      wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_' + wds).val()), (parseInt(jQuery('#wds_current_image_key_' + wds).val()) + wds_iterator_wds(wds)) % wds_params[wds].wds_data.length, wds_params[wds].wds_data, false, "right");
1711      if (wds_params[wds].carousel == 1) {
1712          wds_carousel[wds].next();
1713      }
1714      return false;
1715      break;
1716    case 'SlidePrevious':
1717      wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_' + wds).val()), (parseInt(jQuery('#wds_current_image_key_' + wds).val()) - wds_iterator_wds(wds)) >= 0 ? (parseInt(jQuery('#wds_current_image_key_' + wds_params[wds].wds).val()) - wds_iterator_wds(wds)) % wds_params[wds].wds_data.length : wds_params[wds].wds_data.length - 1, wds_params[wds].wds_data, false, "left");
1718      if (wds_params[wds].carousel == 1) {
1719          wds_carousel[wds].prev();
1720      }
1721      return false;
1722      break;
1723    case 'SlideLink':
1724      wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_' + wds).val()), parseInt(key), wds_params[wds].wds_data);
1725      if (wds_params[wds].carousel == 1) {
1726          wds_carousel[wds].shift(jQuery('.wds_slider_car_image' + wds + '[data-image-id=' + slide_id + ']'));
1727      }
1728      return false;
1729      break;
1730    case 'PlayMusic':
1731      document.getElementById("wds_audio_" + wds).play();
1732      break;
1733  }
1734}
1735
1736function wds_iterator_wds(wds) {
1737  var iterator = 1;
1738  if (wds_params[wds].enable_slideshow_shuffle) {
1739    iterator = Math.floor((wds_params[wds].wds_data.length - 1) * Math.random() + 1);
1740  }
1741  else if (wds_params[wds].twoway_slideshow) {
1742    if (wds_params[wds].wds_global_btn_wds == "left") {
1743      iterator = -1;
1744    }
1745    if (wds_params[wds].slider_loop == 0) {
1746      if (parseInt(jQuery('#wds_current_image_key_' + wds).val()) == 0) {
1747        iterator = 1;
1748      }
1749    }
1750  }
1751  return iterator;
1752}
1753
1754/* Set filmstrip initial position.*/
1755function wds_set_filmstrip_pos(wds, filmStripWidth) {
1756  if ( wds_params[wds].width_or_height == 'width' ) {
1757    var selectedImagePos = -(wds_params[wds].wds_current_key * jQuery(".wds_slideshow_filmstrip_thumbnails_"+wds).width() / wds_params[wds].slides_count) - jQuery(".wds_slideshow_filmstrip_thumbnail_"+wds).width() / 2;
1758    var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".wds_slideshow_filmstrip_thumbnails_"+wds).width(), selectedImagePos + filmStripWidth / 2));
1759  } else if( wds_params[wds].width_or_height == 'height' ) {
1760    var selectedImagePos = -(wds_params[wds].wds_current_key * jQuery(".wds_slideshow_filmstrip_thumbnails_"+wds).height() / wds_params[wds].slides_count) - jQuery(".wds_slideshow_filmstrip_thumbnail_"+wds).height() / 2;
1761    var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".wds_slideshow_filmstrip_thumbnails_"+wds).height(), selectedImagePos + filmStripWidth / 2));
1762  }
1763  if(wds_params[wds].left_or_top == 'top') {
1764    jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({
1765      top: imagesContainerLeft
1766    }, {
1767      duration: 500,
1768      complete: function () {
1769        wds_filmstrip_arrows(wds);
1770      }
1771    });
1772  } else {
1773    jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({
1774      left: imagesContainerLeft
1775    }, {
1776      duration: 500,
1777      complete: function () {
1778        wds_filmstrip_arrows(wds);
1779      }
1780    });
1781  }
1782}
1783
1784function wds_move_filmstrip(wds) {
1785  if ( wds_params[wds].outerWidth_or_outerHeight == 'outerWidth' ) {
1786    var wds_filmstrip_width = jQuery(".wds_slideshow_filmstrip_container_" + wds).outerWidth(true);
1787    var wds_filmstrip_thumbnails_width = jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).outerWidth(true);
1788  }
1789  else {
1790    var wds_filmstrip_width = jQuery(".wds_slideshow_filmstrip_container_" + wds).outerHeight(true);
1791    var wds_filmstrip_thumbnails_width = jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).outerHeight(true);
1792  }
1793  if ( wds_params[wds].left_or_top == 'left' ) {
1794    var image_left = jQuery(".wds_slideshow_thumb_active_" + wds).position().left;
1795    var long_filmstrip_cont_left = jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().left;
1796    var long_filmstrip_cont_right = Math.abs(jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().left) + wds_filmstrip_width;
1797    if ( wds_params[wds].outerWidth_or_outerHeight == 'outerWidth' ) {
1798      var image_right = jQuery(".wds_slideshow_thumb_active_" + wds).position().left + jQuery(".wds_slideshow_thumb_active_" + wds).outerWidth(true);
1799    }
1800    else {
1801      var image_right = jQuery(".wds_slideshow_thumb_active_" + wds).position().left + jQuery(".wds_slideshow_thumb_active_" + wds).outerHeight(true);
1802    }
1803  }
1804  if ( wds_params[wds].left_or_top == 'top' ) {
1805    var image_left = jQuery(".wds_slideshow_thumb_active_" + wds).position().top;
1806    var long_filmstrip_cont_left = jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().top;
1807    var long_filmstrip_cont_right = Math.abs(jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().top) + wds_filmstrip_width;
1808    if ( wds_params[wds].outerWidth_or_outerHeight == 'outerWidth' ) {
1809      var image_right = jQuery(".wds_slideshow_thumb_active_" + wds).position().top + jQuery(".wds_slideshow_thumb_active_" + wds).outerWidth(true);
1810    }
1811    else {
1812      var image_right = jQuery(".wds_slideshow_thumb_active_" + wds).position().top + jQuery(".wds_slideshow_thumb_active_" + wds).outerHeight(true);
1813    }
1814  }
1815  if ( wds_filmstrip_width > wds_filmstrip_thumbnails_width ) {
1816    return;
1817  }
1818  var left_or_top = wds_params[wds].left_or_top;
1819  if ( image_left < Math.abs(long_filmstrip_cont_left) ) {
1820    if(left_or_top == 'top') {
1821      jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({
1822        top: -image_left
1823      }, {
1824        duration: 500,
1825        complete: function () {
1826          wds_filmstrip_arrows(wds);
1827        }
1828      });
1829    } else {
1830      jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({
1831        left: -image_left
1832      }, {
1833        duration: 500,
1834        complete: function () {
1835          wds_filmstrip_arrows(wds);
1836        }
1837      });
1838    }
1839  }
1840  else if ( image_right > long_filmstrip_cont_right ) {
1841    if(left_or_top == 'top') {
1842      jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({
1843        top: -(image_right - wds_filmstrip_width)
1844      }, {
1845        duration: 500,
1846        complete: function () {
1847          wds_filmstrip_arrows(wds);
1848        }
1849      });
1850    }
1851    else {
1852      jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({
1853        left: -(image_right - wds_filmstrip_width)
1854      }, {
1855        duration: 500,
1856        complete: function () {
1857          wds_filmstrip_arrows(wds);
1858        }
1859      });
1860    }
1861  }
1862}
1863
1864function wds_move_dots(wds) {
1865  var image_left = jQuery(".wds_slideshow_dots_active_" + wds).position().left;
1866  var image_right = jQuery(".wds_slideshow_dots_active_" + wds).position().left + jQuery(".wds_slideshow_dots_active_" + wds).outerWidth(true);
1867  var wds_dots_width = jQuery(".wds_slideshow_dots_container_" + wds).outerWidth(true);
1868  var wds_dots_thumbnails_width = jQuery(".wds_slideshow_dots_thumbnails_" + wds).outerWidth(true);
1869  var long_filmstrip_cont_left = jQuery(".wds_slideshow_dots_thumbnails_" + wds).position().left;
1870  var long_filmstrip_cont_right = Math.abs(jQuery(".wds_slideshow_dots_thumbnails_" + wds).position().left) + wds_dots_width;
1871  if (!wds_params[wds].carousel) {
1872    if (wds_dots_width > wds_dots_thumbnails_width) {
1873      return;
1874    }
1875  }
1876  if (image_left < Math.abs(long_filmstrip_cont_left)) {
1877    jQuery(".wds_slideshow_dots_thumbnails_" + wds).animate({
1878      left: -image_left
1879    }, {
1880      duration: 500
1881    });
1882  }
1883  else if (image_right > long_filmstrip_cont_right) {
1884    jQuery(".wds_slideshow_dots_thumbnails_" + wds).animate({
1885      left: -(image_right - wds_dots_width)
1886    }, {
1887      duration: 500
1888    });
1889  }
1890}
1891
1892/* Show/hide filmstrip arrows.*/
1893function wds_filmstrip_arrows(wds) {
1894  if (wds_params[wds].width_or_height == 'width') {
1895    var cond1 = jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).width();
1896    var cond2 = jQuery(".wds_slideshow_filmstrip_" + wds).width();
1897  }
1898  else if (wds_params[wds].width_or_height == 'height') {
1899    var cond1 = jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).height();
1900    var cond2 = jQuery(".wds_slideshow_filmstrip_" + wds).height();
1901  }
1902  if (cond1 < cond2) {
1903    jQuery(".wds_slideshow_filmstrip_left_" + wds).hide();
1904    jQuery(".wds_slideshow_filmstrip_right_" + wds).hide();
1905  }
1906  else {
1907    jQuery(".wds_slideshow_filmstrip_left_" + wds).show();
1908    jQuery(".wds_slideshow_filmstrip_right_" + wds).show();
1909  }
1910}
1911
1912function wds_testBrowser_cssTransitions() {
1913  return wds_testDom('Transition');
1914}
1915
1916function wds_testBrowser_cssTransforms3d() {
1917  return wds_testDom('Perspective');
1918}
1919
1920function wds_testDom(prop) {
1921  /* Browser vendor DOM prefixes.*/
1922  var domPrefixes = ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'];
1923  var i = domPrefixes.length;
1924  while (i--) {
1925    if (typeof document.body.style[domPrefixes[i] + prop] !== 'undefined') {
1926      return true;
1927    }
1928  }
1929  return false;
1930}
1931
1932function wds_set_dots_class(wds) {
1933  jQuery(".wds_slideshow_dots_" + wds).removeClass("wds_slideshow_dots_active_" + wds).addClass("wds_slideshow_dots_deactive_" + wds);
1934  jQuery("#wds_dots_" + wds_params[wds].wds_current_key + "_" + wds).removeClass("wds_slideshow_dots_deactive_" + wds).addClass("wds_slideshow_dots_active_" + wds);
1935  if (wds_params[wds].bull_butt_img_or_not == 'style') {
1936    jQuery(".wds_slideshow_dots_" + wds).removeClass(wds_params[wds].bull_style_active).addClass(wds_params[wds].bull_style_deactive);
1937    jQuery("#wds_dots_" + wds_params[wds].wds_current_key + "_" + wds).removeClass(wds_params[wds].bull_style_deactive).addClass(wds_params[wds].bull_style_active);
1938  }
1939}
1940
1941function wds_set_filmstrip_class(wds) {
1942  jQuery('.wds_slideshow_filmstrip_thumbnail_' + wds).removeClass('wds_slideshow_thumb_active_' + wds).addClass('wds_slideshow_thumb_deactive_' + wds);
1943  jQuery('#wds_filmstrip_thumbnail_' + wds_params[wds].wds_current_key + '_' + wds).removeClass('wds_slideshow_thumb_deactive_' + wds).addClass('wds_slideshow_thumb_active_' + wds);
1944}
1945
1946var wds_done = false;
1947var wds_ready = false;
1948
1949function wds_resize_instagram_post( wds ) {
1950  if (jQuery('.inner_instagram_iframe_wds_video_frame_'+wds).length) {
1951    var post_width = jQuery('.wds_slideshow_video_'+wds).width();
1952    var post_height = jQuery('.wds_slideshow_video_'+wds).height();
1953    var parent_height = post_height;
1954    jQuery('.inner_instagram_iframe_wds_video_frame_'+wds).each(function() {
1955      var parent_container = jQuery(this).parent();
1956      if (post_height < post_width + 88) {
1957        post_width = post_height - 88;
1958      }
1959      else {
1960        post_height = post_width + 88;
1961      }
1962      parent_container.height(post_height);
1963      parent_container.width(post_width);
1964      parent_container.css({top: 0.5 * (parent_height - post_height)});
1965    });
1966  }
1967}
1968
1969function wds_resize_slider( wds ) {
1970  if( jQuery(window).width() <= parseInt(wds_params[wds].full_width_for_mobile) ||
1971  (wds_params[wds].full_width == '1') ){
1972    var full_width = '1';
1973  } else {
1974    var full_width = wds_params[wds].full_width;
1975  }
1976  wds_params[wds].wds_glb_margin = parseInt(wds_params[wds].glb_margin);
1977  if (wds_params[wds].bull_butt_img_or_not == 'text') {
1978    wds_set_text_dots_cont( wds );
1979  }
1980  var slide_orig_width = wds_params[wds].image_width + (wds_params[wds].filmstrip_direction == 'horizontal' ? 0 : wds_params[wds].filmstrip_width);
1981  var slide_orig_height = wds_params[wds].image_height + (wds_params[wds].filmstrip_direction == 'horizontal' ? wds_params[wds].filmstrip_height : 0);
1982  var slide_width = wds_get_overall_parent(jQuery("#wds_container1_"+wds));
1983  var ratio;
1984  if (wds_params[wds].carousel != 1) {
1985    if (slide_width > slide_orig_width) {
1986      slide_width = slide_orig_width;
1987    }
1988    ratio = slide_width / (slide_orig_width + 2 * wds_params[wds].wds_glb_margin);
1989  } 
1990  if (full_width == '1') {
1991    ratio = jQuery(window).width() / slide_orig_width;
1992    slide_orig_width = jQuery(window).width();
1993    if (wds_params[wds].auto_height) {
1994      slide_orig_height = jQuery(window).height();
1995    }
1996    else { 
1997      /* slide_orig_height = wds_params[wds].image_height + wds_params[wds].filmstrip_he
1997ight * slide_orig_width / wds_params[wds].image_width; */
1998      slide_orig_height = (wds_params[wds].filmstrip_height + wds_params[wds].image_height) * ratio;
1999    }
2000    slide_width = jQuery(window).width();
2001    wds_full_width( wds );
2002  }
2003  else if ( full_width == "2" ) {
2004    if ( wds_params[wds].carousel != 1 ) {
2005      slide_orig_width = wds_get_overall_parent(jQuery("#wds_container1_" + wds));
2006      ratio = slide_orig_width / wds_params[wds].image_width;
2007      /* slide_orig_height = wds_params[wds].image_height + wds_params[wds].filmstrip_height * slide_orig_width / wds_params[wds].image_width; */
2008      slide_orig_height = (wds_params[wds].filmstrip_height + wds_params[wds].image_height) * ratio - (2 * wds_params[wds].wds_glb_margin);
2009    }
2010  }
2011  else if ( parseInt(wds_params[wds].full_width_for_mobile) ) {
2012    jQuery(".wds_slideshow_image_wrap_"+wds).removeAttr("style");
2013  }
2014  if ( wds_params[wds].carousel == 1) {
2015    ratio = 1;
2016    if ( slide_width < wds_params[wds].carousel_width ) {
2017      ratio = slide_width / wds_params[wds].carousel_width;
2018    }
2019  }
2020  wds_params[wds].wds_glb_margin = parseInt(wds_params[wds].glb_margin);
2021  wds_params[wds].wds_glb_margin *= ratio;
2022  if (full_width == '0') {
2023    slide_orig_height -= wds_params[wds].wds_glb_margin;
2024  }
2025  jQuery("#wds_container2_"+wds).css("margin", wds_params[wds].wds_glb_margin + "px " + (full_width=='1' ? 0 : '') + "");
2026  var slide_height = slide_orig_height;
2027
2028  if (slide_orig_width > slide_width && full_width != '2') {
2029    slide_height = Math.floor(slide_width * slide_orig_height / slide_orig_width);
2030  }
2031  jQuery(".wds_slideshow_image_wrap_"+wds+", #wds_container2_"+wds).height(slide_height);
2032  jQuery(".wds_slideshow_image_"+wds+" img").each(function () {
2033    var wds_theImage = new Image();
2034    wds_theImage.src = jQuery(this).attr("src");
2035    var wds_origWidth = wds_theImage.width;
2036    var wds_origHeight = wds_theImage.height;
2037    if (typeof wds_theImage.remove != 'undefined') {
2038      wds_theImage.remove();
2039    }
2040    var wds_imageWidth = jQuery(this).attr("data-wds-image-width");
2041    var wds_imageHeight = jQuery(this).attr("data-wds-image-height");
2042    var wds_imageTop = jQuery(this).attr("data-wds-image-top");
2043    var wds_width = wds_imageWidth;
2044    if (wds_imageWidth > wds_origWidth) {
2045      wds_width = wds_origWidth;
2046    }
2047    var wds_height = wds_imageHeight;
2048    if (wds_imageHeight > wds_origHeight) {
2049      wds_height = wds_origHeight;
2050    }
2051    var top_px = parseFloat(wds_imageTop) * wds_params[wds].image_height / 100;
2052    jQuery(this).css({
2053      maxWidth: (parseFloat(wds_imageWidth) * ratio) + "px",
2054      maxHeight: (parseFloat(wds_imageHeight) * ratio) + "px",
2055      top: ((top_px * (slide_height - ratio * wds_imageHeight) / (wds_params[wds].image_height - wds_imageHeight)) * 100 / slide_height) + "%",
2056    });
2057    if (jQuery(this).attr("data-wds-scale") != "on") {
2058      jQuery(this).css({
2059        width: (parseFloat(wds_imageWidth) * ratio) + "px",
2060        height: (parseFloat(wds_imageHeight) * ratio) + "px",
2061      });
2062    }
2063    else if (wds_imageWidth >= wds_origWidth || wds_imageHeight >= wds_origHeight) {
2064      if (wds_origWidth / wds_imageWidth > wds_origHeight / wds_imageHeight) {
2065        jQuery(this).css({
2066          width: (parseFloat(wds_imageWidth) * ratio) + "px"
2067        });
2068      }
2069      else {
2070        jQuery(this).css({
2071          height: (parseFloat(wds_imageHeight) * ratio) + "px"
2072        });
2073      }
2074    }
2075  });
2076
2077  jQuery(".wds_slideshow_image_"+wds+" [data-type='hotspot']").each(function () {
2078    jQuery(this).children().each(function () {
2079      var width = jQuery(this).attr("data-width");
2080      if (jQuery(this).attr("data-type") == "hotspot_text") {
2081        var height = jQuery(this).attr("data-height");
2082        if (width != 0) {
2083          jQuery(this).width(ratio * width);
2084        }
2085        if (height != 0) {
2086          jQuery(this).height(ratio * height);
2087        }
2088        var min_font_size;
2089        var font_size;
2090        min_font_size = jQuery(this).attr("data-fmin-size");
2091        font_size = ratio * jQuery(this).attr("data-fsize");
2092        if (min_font_size > font_size) {
2093          font_size = min_font_size;
2094        }
2095        jQuery(this).css({fontSize: font_size + "px"});
2096      }
2097      else {
2098        if (width != 0) {
2099          jQuery(this).width(ratio * width);
2100          jQuery(this).height(ratio * width);
2101          jQuery(this).parent().width(ratio * width);
2102          jQuery(this).parent().height(ratio * width);
2103        }
2104        jQuery(this).css({
2105          borderWidth: ratio * jQuery(this).attr("data-border-width")
2106        });
2107      }
2108    });
2109  });
2110
2111    jQuery(".wds_slideshow_image_"+wds+" span, .wds_slideshow_image_"+wds+" i").each(function () {
2112    var font_size;
2113    var ratio_new;
2114    var font_size_new;
2115    var min_font_size;
2116    font_size = parseFloat(jQuery(this).attr("data-wds-fsize")) * ratio;
2117    font_size_new = font_size;
2118    ratio_new = ratio;
2119    if (jQuery(this).attr('data-type') == 'wds_text_parent') {
2120      min_font_size = jQuery(this).attr("data-wds-fmin-size");
2121      if (min_font_size > font_size) {
2122        font_size_new = min_font_size;
2123        ratio_new = ratio * font_size_new / font_size;
2124      }
2125    }
2126    jQuery(this).css({
2127      fontSize: (font_size_new) + "px",
2128      lineHeight: "1.25em",
2129      paddingLeft: (parseFloat(jQuery(this).attr("data-wds-fpaddingl")) * ratio_new) + "px",
2130      paddingRight: (parseFloat(jQuery(this).attr("data-wds-fpaddingr")) * ratio_new) + "px",
2131      paddingTop: (parseFloat(jQuery(this).attr("data-wds-fpaddingt")) * ratio_new) + "px",
2132      paddingBottom: (parseFloat(jQuery(this).attr("data-wds-fpaddingb")) * ratio_new) + "px",
2133    });
2134  });
2135
2136  if ( !wds_object.is_free ) {
2137    wds_display_hotspot();
2138    wds_hotspot_position("", ratio);
2139  }
2140  if (wds_params[wds].parallax_effect == 1) {
2141    wds_parallax( wds );
2142  }
2143  jQuery(".wds_slideshow_image_"+wds+" [data-type='wds_text_parent']").each(function () {
2144    var id = jQuery(this).attr("id");
2145    if (wds_params[wds].wds_data[jQuery("#" + id).data("row-key")]["layer_"+ jQuery("#" + id).data("layer-key") +"_align_layer"] == 1) {
2146      var left;
2147      var slider_width = jQuery(".wds_slider_"+ wds).outerWidth();
2148      var start_left_percent = jQuery(this).attr("data-left-percent");
2149
2150      /* Fix layer position only one time */
2151      if( typeof textLayerPosition[wds] == 'undefined') {
2152        if (start_left_percent == 0) {
2153          textLayerPosition[wds] = 'left';
2154        } /* layer width < slider_with/2 */
2155        else if ( Math.ceil((jQuery("#" +  id).offset().left) - (jQuery(".wds_slideshow_image_"+wds).offset().left)+jQuery(this).outerWidth()) >= slider_width ) {
2156          textLayerPosition[wds] = 'right';
2157        }
2158        else {
2159          textLayerPosition[wds] = 'center';
2160        }
2161      }
2162      if( textLayerPosition[wds] == 'left' ) {
2163          left = 0;
2164      } else if( textLayerPosition[wds] == 'center') {
2165          left = slider_width / 2 - jQuery(this).outerWidth() / 2;
2166      } else {
2167          left = slider_width - jQuery(this).outerWidth();
2168      }
2169
2170      var left_percent = (slider_width != 0) ? 100 * left / slider_width : 0;
2171      jQuery("#" +  id).css({left:left_percent + "%"});
2172    }
2173  });
2174  wds_resize_instagram_post( wds );
2175  wds_window_fixed_size( wds, "#wds_image_id_"+wds+"_" + wds_params[wds].wds_data[parseInt(j
2175Query('#wds_current_image_key_'+wds).val())]["id"]);
2176}
2177
2178function wds_full_width( wds ) {
2179  var left = jQuery("#wds_container1_"+wds).offset().left;
2180  jQuery(".wds_slideshow_image_wrap_"+wds).css({
2181    left: (-left) + "px",
2182    width: (jQuery(window).width()) + "px",
2183    maxWidth: "none"
2184  });
2185}
2186
2187function wds_ready_func( wds ) {
2188  jQuery.each( wds_params[wds].callback_items, function( index, value ) {
2189    if ( index === 'onSliderI' && value !== '' ) {
2190      var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderI );
2191      wds_callback_f();
2192    }
2193  });
2194  if (wds_params[wds].enable_slideshow_autoplay && wds_params[wds].stop_animation) {
2195    jQuery("#wds_container1_"+wds).mouseover(function(e) {
2196      wds_stop_animation( wds );
2197    });
2198    jQuery("#wds_container1_"+wds).mouseout(function(e) {
2199      if (!e) {
2200        var e = window.event;
2201      }
2202      var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
2203      if (typeof reltg != "undefined") {
2204        if (reltg != null) {
2205          if (typeof reltg.tagName != "undefined") {
2206            while (reltg.tagName != 'BODY') {
2207              if (reltg.id == this.id){
2208                return;
2209              }
2210              reltg = reltg.parentNode;
2211            }
2212          }
2213        }
2214      }
2215      wds_play_animation(wds);
2216    });
2217  }
2218
2219  if (wds_params[wds].bull_butt_img_or_not == 'text') {
2220    wds_set_text_dots_cont(wds);
2221  }
2222  jQuery(".wds_slideshow_image_"+wds+" span, .wds_slideshow_image_"+wds+" i").each(function () {
2223    jQuery(this).attr("data-wds-fpaddingl", jQuery(this).css("paddingLeft"));
2224    jQuery(this).attr("data-wds-fpaddingr", jQuery(this).css("paddingRight"));
2225    jQuery(this).attr("data-wds-fpaddingt", jQuery(this).css("paddingTop"));
2226    jQuery(this).attr("data-wds-fpaddingb", jQuery(this).css("paddingBottom"));
2227  });
2228
2229  if (wds_params[wds].navigation) {
2230    jQuery("#wds_container2_"+wds).hover(function () {
2231      jQuery(".wds_right-ico_"+wds).animate({left: 0}, 0, "swing");
2232      jQuery(".wds_left-ico_"+wds).animate({left: 0}, 0, "swing");
2233      jQuery("#wds_slideshow_play_pause_"+wds).animate({opacity: 1, filter: "Alpha(opacity=100)"}, 0, "swing");
2234    }, function () {
2235      jQuery(".wds_right-ico_"+wds).css({left: 4000});
2236      jQuery(".wds_left-ico_"+wds).css({left: -4000});
2237      jQuery("#wds_slideshow_play_pause_"+wds).css({opacity: 0, filter: "Alpha(opacity=0)"});
2238    });
2239  }
2240
2241  if (!wds_params[wds].bull_hover) {
2242    jQuery("#wds_container2_"+wds).hover(function () {
2243      jQuery(".wds_slideshow_dots_container_"+wds).animate({opacity: 1, filter: "Alpha(opacity=100)"}, 0, "swing");
2244    }, function () {
2245      jQuery(".wds_slideshow_dots_container_"+wds).css({opacity: 0, filter: "Alpha(opacity=0)"});
2246    });
2247  }
2248  wds_resize_slider( wds );
2249
2250  if ( wds_params[wds].carousel != 1 ) {
2251    jQuery("#wds_container2_"+wds).css({visibility: 'visible'});
2252    jQuery(".wds_loading").hide();
2253  }
2254
2255
2256  function wds_filmstrip_move_left() {
2257    if (typeof jQuery().stop !== 'undefined') {
2258      if (jQuery.isFunction(jQuery().stop)) {
2259        jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).stop(true, false);
2260      }
2261    }
2262
2263    if (wds_params[wds].left_or_top == 'top') {
2264      if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().wds_params[wds].top < 0) {
2265        jQuery(".wds_slideshow_filmstrip_right_" + wds).css({opacity: 1, filter: "Alpha(opacity=100)"});
2266        if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().wds_params[wds].top > -wds_params[wds].filmstrip_thumb_margin_hor - wds_params[wds].filmstrip_width) {
2267          jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({top: 0}, 100, 'linear');
2268        }
2269        else {
2270          jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({top: (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().top + wds_params[wds].filmstrip_thumb_margin_hor + wds_params[wds].filmstrip_width)}, 100, 'linear');
2271        }
2272      }
2273      /* Disable left arrow.*/
2274      window.setTimeout(function () {
2275        if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().top == 0) {
2276          jQuery(".wds_slideshow_filmstrip_left_" + wds).css({opacity: 0.3, filter: "Alpha(opacity=30)"});
2277        }
2278      }, 500);
2279    }
2280    else if (wds_params[wds].left_or_top == 'left') {
2281      if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().left < 0) {
2282        jQuery(".wds_slideshow_filmstrip_right_" + wds).css({opacity: 1, filter: "Alpha(opacity=100)"});
2283        if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().left > -wds_params[wds].filmstrip_thumb_margin_hor - wds_params[wds].filmstrip_width) {
2284          jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({left: 0}, 100, 'linear');
2285        }
2286        else {
2287          jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({left: (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().left + wds_params[wds].filmstrip_thumb_margin_hor + wds_params[wds].filmstrip_width)}, 100, 'linear');
2288        }
2289      }
2290      window.setTimeout(function () {
2291        if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().left == 0) {
2292          jQuery(".wds_slideshow_filmstrip_left_" + wds).css({opacity: 0.3, filter: "Alpha(opacity=30)"});
2293        }
2294      }, 500);
2295    }
2296  }
2297
2298  function wds_filmstrip_move_right() {
2299    if (typeof jQuery().stop !== 'undefined') {
2300      if (jQuery.isFunction(jQuery().stop)) {
2301        jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).stop(true, false);
2302      }
2303    }
2304    if (wds_params[wds].left_or_top == 'top') {
2305      if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().top >= -(jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).height() - jQuery(".wds_slideshow_filmstrip_container_" + wds).height())) {
2306        jQuery(".wds_slideshow_filmstrip_left_" + wds).css({opacity: 1, filter: "Alpha(opacity=100)"});
2307        if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().top < -(jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).height() - jQuery(".wds_slideshow_filmstrip_container_" + wds).height() - wds_params[wds].filmstrip_thumb_margin_hor - wds_params[wds].filmstrip_width)) {
2308          jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({top: -(jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).height() - jQuery(".wds_slideshow_filmstrip_container_" + wds).height())}, 100, 'linear');
2309        }
2310        else {
2311          jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({top: (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().top - wds_params[wds].filmstrip_thumb_margin_hor - wds_params[wds].filmstrip_width)}, 100, 'linear');
2312        }
2313      }
2314      /* Disable right arrow.*/
2315      window.setTimeout(function () {
2316        if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().top == -(jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).height() - jQuery(".wds_slideshow_filmstrip_container_" + wds).height())) {
2317          jQuery(".wds_slideshow_filmstrip_right_" + wds).css({opacity: 0.3, filter: "Alpha(opacity=30)"});
2318        }
2319      }, 500);
2320    }
2321    else if (wds_params[wds].left_or_top == 'left') {
2322      if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().left >= -(jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).width() - jQuery(".wds_slideshow_filmstrip_container_" + wds).width())) {
2323        jQuery(".wds_slideshow_filmstrip_left_" + wds).css({opacity: 1, filter: "Alpha(opacity=100)"});
2324        if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().left < -(jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).width() - jQuery(".wds_slideshow_filmstrip_container_" + wds).width() - wds_params[wds].filmstrip_thumb_margin_hor - wds_params[wds].filmstrip_width)) {
2325          jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({left: -(jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).width() - jQuery(".wds_slideshow_filmstrip_container_" + wds).width())}, 100, 'linear');
2326        }
2327        else {
2328          jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).animate({left: (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().left - wds_params[wds].filmstrip_thumb_margin_hor - wds_params[wds].filmstrip_width)}, 100, 'linear');
2329        }
2330      }
2331      /* Disable right arrow.*/
2332      window.setTimeout(function () {
2333        if (jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).position().left == -(jQuery(".wds_slideshow_filmstrip_thumbnails_" + wds).width() - jQuery(".wds_slideshow_filmstrip_container_" + wds).width())) {
2334          jQuery(".wds_slideshow_filmstrip_right_" + wds).css({opacity: 0.3, filter: "Alpha(opacity=30)"});
2335        }
2336      }, 500);
2337    }
2338  }
2339
2340  if (wds_params[wds].slider_effect == 'zoomFade') {
2341    wds_genBgPos("#wds_image_id_"+wds+"_" + wds_params[wds].wds_data[parseInt(jQuery('#wds_current_image_key_'+wds).val())]["id"]);
2342  }
2343  if (wds_params[wds].image_right_click) {
2344    /* Disable right click.*/
2345    jQuery('div[id^="wds_container"]').bind("contextmenu", function () {
2346      return false;
2347    });
2348  }
2349  if (wds_params[wds].slider_effect == 'fade') {
2350    var curr_img_id = wds_params[wds].wds_data[parseInt(jQuery('#wds_current_image_key_'+wds).val())]["id"];
2351    jQuery("#wds_image_id_"+wds+"_" + curr_img_id).css('transition', 'opacity ' + wds_params[wds].wds_transition_duration + 'ms linear');
2352  }
2353  var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
2354  if (isMobile) {
2355    if (wds_params[wds].touch_swipe_nav) {
2356      wds_swipe(wds);
2357    }
2358  }
2359  else {
2360    if (wds_params[wds].mouse_swipe_nav) {
2361      wds_swipe(wds);
2362    }
2363  }
2364
2365  function wds_swipe(wds) {
2366    if (typeof jQuery().swiperight !== 'undefined') {
2367      if (jQuery.isFunction(jQuery().swiperight)) {
2368        jQuery('.wds_slideshow_filmstrip_thumbnails_'+wds).swiperight(function () {
2369          wds_filmstrip_move_left();
2370          return false;
2371        });
2372        jQuery('#wds_container1_'+wds).swiperight(function () {
2373          wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_'+wds).val()), (parseInt(jQuery('#wds_current_image_key_'+wds).val()) - wds_iterator_wds(wds)) >= 0 ? (parseInt(jQuery('#wds_current_image_key_'+wds).val()) - wds_iterator_wds( wds )) % wds_params[wds].wds_data.length : wds_params[wds].wds_data.length - 1, wds_params[wds].wds_data, false, "left");
2374          if ( wds_params[wds].carousel == 1 ) {
2375              wds_carousel[wds].prev();
2376          }
2377          jQuery.each( wds_params[wds].callback_items, function( index, value ) {
2378            if ( index === 'onSwipeS' && value !== '' ) {
2379              var wds_callback_f = new Function( wds_params[wds].callback_items.onSwipeS );
2380              wds_callback_f();
2381            }
2382          });
2383          return false;
2384        });
2385      }
2386    }
2387    if (typeof jQuery().swipeleft !== 'undefined') {
2388      if (jQuery.isFunction(jQuery().swipeleft)) {
2389        jQuery('.wds_slideshow_filmstrip_thumbnails_'+wds).swipeleft(function () {
2390          wds_filmstrip_move_right();
2391          return false;
2392        });
2393        jQuery('#wds_container1_'+wds).swipeleft(function () {
2394          wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_'+wds).val()), (parseInt(jQuery('#wds_current_image_key_'+wds).val()) + wds_iterator_wds(wds)) % wds_params[wds].wds_data.length, wds_params[wds].wds_data, false, "right");
2395          if ( wds_params[wds].carousel == 1 ) {
2396              wds_carousel[wds].next();
2397          }
2398          jQuery.each( wds_params[wds].callback_items, function( index, value ) {
2399            if ( index === 'onSwipeS' && value !== '' ) {
2400              var wds_callback_f = new Function( wds_params[wds].callback_items.onSwipeS );
2401              wds_callback_f();
2402            }
2403          });
2404          return false;
2405        });
2406      }
2407    }
2408  }
2409
2410  var wds_click = isMobile ? 'touchend' : 'click';
2411  var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel"; /* FF doesn't recognize mousewheel as of FF3.x */
2412  jQuery('.wds_slideshow_filmstrip_'+wds).bind(mousewheelevt, function(e) {
2413    var evt = window.event || e; /* Equalize event object.*/
2414    evt = evt.originalEvent ? evt.originalEvent : evt; /* Convert to originalEvent if possible.*/
2415    var delta = evt.detail ? evt.detail*(-40) : evt.wheelDelta; /* Check for detail first, because it is used by Opera and FF.*/
2416    if (delta > 0) {
2417      /* Scroll up.*/
2418      jQuery(".wds_slideshow_filmstrip_left_"+wds).trigger("click");
2419    }
2420    else {
2421      /* Scroll down.*/
2422      jQuery(".wds_slideshow_filmstrip_right_"+wds).trigger("click");
2423    }
2424    return false;
2425  });
2426  jQuery(".wds_slideshow_filmstrip_right_"+wds).on(wds_click, function () {
2427    wds_filmstrip_move_right();
2428  });
2429  jQuery(".wds_slideshow_filmstrip_left_"+wds).on(wds_click, function () {
2430    wds_filmstrip_move_left();
2431  });
2432
2433  /* Set filmstrip initial position.*/
2434  (wds_params[wds].width_or_height == 'width') ? wds_set_filmstrip_pos(wds, jQuery(".wds_slideshow_filmstrip_container_"+wds).width()) : wds_set_filmstrip_pos(wds, jQuery(".wds_slideshow_filmstrip_container_"+wds).height());
2435
2436  function wds_message_listener(e) {
2437    try {
2438      var data = JSON.parse(e.data);
2439      if (data.method == "paused") {
2440        wds_params[wds].iframe_message_received = wds_params[wds].iframe_message_received + 1;
2441        if (data.value == false) {
2442          wds_params[wds].video_is_playing = true;
2443        }
2444      }
2445    } catch (e) {
2446      return false;
2447    }
2448  }
2449
2450  if (window.addEventListener){
2451    window.addEventListener('message', wds_message_listener, false);
2452  }
2453  else {
2454    window.attachEvent('onmessage', wds_message_listener, false);
2455  }
2456  /* Mouswheel navigation.*/
2457  if ( wds_params[wds].mouse_wheel_nav) {
2458    jQuery('.wds_slide_container_'+wds).bind(mousewheelevt, function(e) {
2459      var evt = window.event || e; /* Equalize event object.*/
2460      evt = evt.originalEvent ? evt.originalEvent : evt; /* Convert to originalEvent if possible.*/
2461      var delta = evt.detail ? evt.detail*(-40) : evt.wheelDelta; /* Check for detail first, because it is used by Opera and FF.*/
2462      if (delta > 0) {
2463        /* Scroll up.*/
2464        wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_'+wds).val()), (parseInt(jQuery('#wds_current_image_key_'+wds).val()) - wds_iterator_wds(wds)) >= 0 ? (parseInt(jQuery('#wds_current_image_key_'+wds).val()) - wds_iterator_wds(wds)) % wds_params[wds].wds_data.length : wds_params[wds].wds_data.length - 1, wds_params[wds].wds_data, false, "left");
2465      }
2466      else {
2467        /* Scroll down.*/
2468        wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_'+wds).val()), (parseInt(jQuery('#wds_current_image_key_'+wds).val()) + wds_iterator_wds(wds)) % wds_params[wds].wds_data.length, wds_params[wds].wds_data, false, "right");
2469      }
2470      return false;
2471    });
2472  }
2473
2474  /* Keyboard navigation.*/
2475  if (wds_params[wds].keyboard_nav) {
2476    jQuery(document).on('keydown', function (e) {
2477      if (e.keyCode === 39 || e.keyCode === 38) { /* Right arrow.*/
2478        wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_'+wds).val()), (parseInt(jQuery('#wds_current_image_key_'+wds).val()) + wds_iterator_wds(wds)) % wds_params[wds].wds_data.length, wds_params[wds].wds_data, false, "right");
2479      }
2480      else if (e.keyCode === 37 || e.keyCode === 40) { /* Left arrow.*/
2481        wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_'+wds).val()), (parseInt(jQuery('#wds_current_image_key_'+wds).val()) - wds_iterator_wds(wds)) >= 0 ? (parseInt(jQuery('#wds_current_image_key_'+wds).val()) - wds_iterator_wds(wds)) % wds_params[wds].wds_data.length : wds_params[wds].wds_data.length - 1, wds_params[wds].wds_data, false, "left");
2482      }
2483      else if (e.keyCode === 32) { /* Space.*/
2484        wds_play_pause(wds);
2485      }
2486    });
2487  }
2488  /* Play/pause.*/
2489  jQuery("#wds_slideshow_play_pause_"+wds).on(wds_click, function () {
2490    wds_play_pause(wds);
2491  });
2492  if (wds_params[wds].enable_slideshow_autoplay) {
2493    play_wds(wds);
2494
2495    jQuery(".wds_slideshow_play_pause_"+wds).attr("title", wds_object.pause);
2496    jQuery(".wds_slideshow_play_pause_"+wds).attr("class", "wds_ctrl_btn_"+wds+" wds_slideshow_play_pause_"+wds+" fa fa-pause");
2497    if (wds_params[wds].enable_slideshow_music) {
2498      if (wds_params[wds].slideshow_music_url != '') {
2499        document.getElementById("wds_audio_"+wds).play();
2500      }
2501    }
2502    if (wds_params[wds].timer_bar_type != 'none') {
2503      if (wds_params[wds].timer_bar_type != 'top') {
2504        if (wds_params[wds].timer_bar_type != 'bottom') {
2505          wds_circle_timer(wds, 0);
2506        }
2507      }
2508    }
2509  }
2510
2511  if (wds_params[wds].preload_images) { 
2512    function wds_preload(wds, preload_key) {
2513      if (wds_params[wds].wds_data[preload_key]["is_video"] == 'image') {
2514        jQuery('<img />')
2515            .on('load', function() {
2516              jQuery(this).remove();
2517              if (preload_key < wds_params[wds].wds_data.length - 1) wds_preload(wds, preload_key + 1);
2518            })
2519            .on('error', function() {
2520              jQuery(this).remove();
2521              if (preload_key < wds_params[wds].wds_data.length - 1) wds_preload(wds, preload_key + 1);
2522            })
2523            .attr("src", wds_params[wds].wds_data[preload_key]["image_url"]);
2524      }
2525    else {
2526        if (preload_key < wds_params[wds].wds_data.length - 1) wds_preload(wds, preload_key + 1);
2527      }
2528    }
2529    wds_preload(wds, 0);
2530  }
2531  var first_slide_layers_count_wds = wds_params[wds].wds_data[wds_params[wds].start_slide_num]["slide_layers_count"];
2532  if (first_slide_layers_count_wds) {
2533    /* Loop through layers in.*/
2534    for (var j = 0; j < first_slide_layers_count_wds; j++) {
2535      wds_set_layer_effect_in_wds(wds, j, wds_params[wds].start_slide_num);
2536    }
2537    /* Loop through layers out.*/
2538    for (var i = 0; i < first_slide_layers_count_wds; i++) {
2539      wds_set_layer_effect_out_wds(wds, i, wds_params[wds].start_slide_num);
2540    }
2541  }
2542
2543  if ( !wds_object.is_free ) {
2544    wds_video_dimenstion(wds, jQuery("#wds_current_image_key_"+wds).val());
2545  }
2546  if (wds_params[wds].fixed_bg == 1) {
2547    wds_window_fixed_pos(wds);
2548  }
2549  jQuery(".wds_slideshow_filmstrip_container_"+wds).hover(function() {
2550    jQuery(".wds_slideshow_filmstrip_left_"+wds+" i, .wds_slideshow_filmstrip_right_"+wds+" i").animate({opacity: 1, filter: "Alpha(opacity=100)"}, 700, "swing");
2551  }, function () {
2552    jQuery(".wds_slideshow_filmstrip_left_"+wds+" i, .wds_slideshow_filmstrip_right_"+wds+" i").animate({opacity: 0, filter: "Alpha(opacity=0)"}, 700, "swing");
2553  });
2554  jQuery("#wds_container1_"+wds).hover(function() {
2555    jQuery.each( wds_params[wds].callback_items, function( index, value ) {
2556      if ( index === 'onSliderHover' && value !== '' ) {
2557        var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderHover );
2558        wds_callback_f();
2559      }
2560    });
2561  }, function () {
2562    jQuery.each( wds_params[wds].callback_items, function( index, value ) {
2563      if ( index === 'onSliderBlur' && value !== '' ) {
2564        var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderBlur );
2565        wds_callback_f();
2566      }
2567    });
2568  });
2569  jQuery("#wds_slideshow_play_pause_"+wds).on("click", ".fa-play", function() {
2570    jQuery.each( wds_params[wds].callback_items, function( index, value ) {
2571      if ( index === 'onSliderPlay' && value !== '' ) {
2572        var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderPlay );
2573        wds_callback_f();
2574      }
2575    });
2576  });
2577  jQuery("#wds_slideshow_play_pause_"+wds).on("click", ".fa-pause", function() {
2578    jQuery.each( wds_params[wds].callback_items, function( index, value ) {
2579      if ( index === 'onSliderPause' && value !== '' ) {
2580        var wds_callback_f = new Function( wds_params[wds].callback_items.onSliderPause );
2581        wds_callback_f();
2582      }
2583    });
2584
2585  });
2586}
2587
2588function wds_pause(wds) {
2589  /* Pause.*/
2590  /* Pause layers out effect.*/
2591  wds_params[wds].wds_play_pause_state = 1;
2592  var current_key = jQuery('#wds_current_image_key_'+wds).val();
2593  var current_slide_layers_count = wds_params[wds].wds_data[current_key]["slide_layers_count"];
2594  setTimeout(function() {
2595    for (var k = 0; k < current_slide_layers_count; k++) {
2596      clearTimeout(wds_params[wds].wds_clear_layers_effects_out[current_key][k]);
2597    }
2598  }, wds_params[wds].wds_duration_for_clear_effects);
2599  window.clearInterval(wds_params[wds].wds_playInterval);
2600  jQuery(".wds_slideshow_play_pause_"+wds).attr("title", wds_object.play);
2601  jQuery(".wds_slideshow_play_pause_"+wds).attr("class", "wds_ctrl_btn_"+wds+" wds_slideshow_play_pause_"+wds+" fa fa-play");
2602  if (wds_params[wds].enable_slideshow_music) {
2603    document.getElementById("wds_audio_"+wds).pause();
2604  }
2605  if (typeof jQuery().stop !== 'undefined') {
2606    if (jQuery.isFunction(jQuery().stop)) {
2607      if (wds_params[wds].timer_bar_type == 'top' || wds_params[wds].timer_bar_type == 'bottom') {
2608        jQuery(".wds_line_timer_" + wds).stop();
2609      }
2610      else if (wds_params[wds].timer_bar_type != 'none') {
2611        /* Pause circle timer.*/
2612        if (typeof wds_params[wds].circle_timer_animate.stop !== 'undefined') {
2613          wds_params[wds].circle_timer_animate.stop();
2614          if ( wds_params[wds].carousel == 1 ) {
2615              wds_carousel[wds].pause();
2616          }
2617        }
2618      }
2619    }
2620  }
2621  if ( wds_params[wds].carousel == 1 ) {
2622    wds_carousel[wds].pause();
2623  }
2624}
2625
2626function wds_play_pause(wds, play_pause) {
2627  if (typeof play_pause == "undefined") {
2628    var play_pause = "";
2629  }
2630  if (play_pause == "") {
2631    if (jQuery(".wds_ctrl_btn_"+wds).hasClass("fa-play") || wds_params[wds].wds_play_pause_state) {
2632      wds_play_wds( wds );
2633    }
2634  else {
2635      wds_pause( wds );
2636    }
2637  }
2638  else if (play_pause == "play") {
2639    wds_play_wds( wds );
2640  }
2641  else if (play_pause == "pause") {
2642    wds_pause( wds );
2643  }
2644}
2645
2646function wds_stop_animation( wds ) {
2647  window.clearInterval(wds_params[wds].wds_playInterval);
2648  /* Pause layers out effect.*/
2649  var current_key = jQuery('#wds_current_image_key_'+wds).val();
2650  var current_slide_layers_count = wds_params[wds].wds_data[current_key]["slide_layers_count"];
2651
2652  setTimeout(function() {
2653    for (var k = 0; k < current_slide_layers_count; k++) {
2654      clearTimeout(wds_params[wds].wds_clear_layers_effects_out[current_key][k]);
2655    }
2656  }, wds_params[wds].wds_duration_for_clear_effects);
2657  if (wds_params[wds].enable_slideshow_music) {
2658    document.getElementById("wds_audio_"+wds).pause();
2659  }
2660  if (typeof jQuery().stop !== 'undefined') {
2661    if (jQuery.isFunction(jQuery().stop)) {
2662      if (wds_params[wds].timer_bar_type == 'top' || wds_params[wds].timer_bar_type == 'bottom') {
2663        jQuery(".wds_line_timer_"+wds).stop();
2664        if ( wds_params[wds].carousel == 1 ) {
2665            wds_carousel[wds].pause();
2666        }
2667      }
2668      else if (wds_params[wds].timer_bar_type != 'none') {
2669        wds_params[wds].circle_timer_animate.stop();
2670        if ( wds_params[wds].carousel == 1 ) {
2671            wds_carousel[wds].pause();
2672        }
2673      }
2674    }
2675  }
2676}
2677
2678function wds_play_animation( wds ) {
2679  if (jQuery(".wds_ctrl_btn_"+wds).hasClass("fa-play")) {
2680    return;
2681  }
2682  play_wds( wds );
2683  if ( wds_params[wds].carousel == 1 ) {
2684      wds_carousel[wds].start();
2685  }
2686  if (wds_params[wds].timer_bar_type != 'none') {
2687    if (wds_params[wds].timer_bar_type != 'bottom') {
2688      if (wds_params[wds].timer_bar_type != 'top') {
2689        if (typeof wds_params[wds].circle_timer_animate !== 'undefined') {
2690          wds_params[wds].circle_timer_animate.stop();
2691          if ( wds_params[wds].carousel == 1 ) {
2692              wds_carousel[wds].pause();
2693          }
2694        }
2695          wds_circle_timer(wds_params[wds].curent_time_deggree);
2696      }
2697    }
2698  }
2699  if (wds_params[wds].enable_slideshow_music) {
2700    if (wds_params[wds].slideshow_music_url != '') {
2701      document.getElementById("wds_audio_"+wds).play();
2702    }
2703  }
2704  var next_slide_layers_count = wds_params[wds].wds_data[wds_params[wds].wds_current_key]["slide_layers_count"];
2705  for (var i = 0; i < next_slide_layers_count; i++) {
2706    wds_set_layer_effect_out_wds(wds, i, wds_params[wds].wds_current_key);
2707  }
2708}
2709
2710function wds_get_overall_parent(obj) {
2711  if (obj.parent().width()) {
2712    obj.width(obj.parent().width());
2713    return obj.parent().width();
2714  }
2715  else {
2716    return wds_get_overall_parent(obj.parent());
2717  }
2718}
2719
2720function wds_circle_timer(wds, angle) {
2721  wds_params[wds].circle_timer_animate = jQuery({deg: angle}).animate({deg: 360}, {
2722    duration: wds_params[wds].slideshow_interval * 1000,
2723    step: function (now) {
2724      wds_params[wds].curent_time_deggreewds = now;
2725      if (now >= 0) {
2726        if (now < 271) {
2727          jQuery('#top_right_' + wds).css({
2728            '-moz-transform': 'rotate(' + now + 'deg)',
2729            '-webkit-transform': 'rotate(' + now + 'deg)',
2730            '-o-transform': 'rotate(' + now + 'deg)',
2731            '-ms-transform': 'rotate(' + now + 'deg)',
2732            'transform': 'rotate(' + now + 'deg)',
2733            '-webkit-transform-origin': 'left bottom',
2734            '-ms-transform-origin': 'left bottom',
2735            '-moz-transform-origin': 'left bottom',
2736            'transform-origin': 'left bottom'
2737          });
2738        }
2739      }
2740      if (now >= 90) {
2741        if (now < 271) {
2742          wds_params[wds].bottom_right_deggree_wds = now - 90;
2743          jQuery('#bottom_right_' + wds).css({
2744            '-moz-transform': 'rotate(' + wds_params[wds].bottom_right_deggree_wds + 'deg)',
2745            '-webkit-transform': 'rotate(' + wds_params[wds].bottom_right_deggree_wds + 'deg)',
2746            '-o-transform': 'rotate(' + wds_params[wds].bottom_right_deggree_wds + 'deg)',
2747            '-ms-transform': 'rotate(' + wds_params[wds].bottom_right_deggree_wds + 'deg)',
2748            'transform': 'rotate(' + wds_params[wds].bottom_right_deggree_wds + 'deg)',
2749            '-webkit-transform-origin': 'left top',
2750            '-ms-transform-origin': 'left top',
2751            '-moz-transform-origin': 'left top',
2752            'transform-origin': 'left top'
2753          });
2754        }
2755      }
2756      if (now >= 180) {
2757        if (now < 361) {
2758          wds_params[wds].bottom_left_deggree_wds = now - 180;
2759          jQuery('#bottom_left_' + wds).css({
2760            '-moz-transform': 'rotate(' + wds_params[wds].bottom_left_deggree_wds + 'deg)',
2761            '-webkit-transform': 'rotate(' + wds_params[wds].bottom_left_deggree_wds + 'deg)',
2762            '-o-transform': 'rotate(' + wds_params[wds].bottom_left_deggree_wds + 'deg)',
2763            '-ms-transform': 'rotate(' + wds_params[wds].bottom_left_deggree_wds + 'deg)',
2764            'transform': 'rotate(' + wds_params[wds].bottom_left_deggree_wds + 'deg)',
2765            '-webkit-transform-origin': 'right top',
2766            '-ms-transform-origin': 'right top',
2767            '-moz-transform-origin': 'right top',
2768            'transform-origin': 'right top'
2769          });
2770        }
2771      }
2772      if (now >= 270) {
2773        if (now < 361) {
2774          wds_params[wds].top_left_deggree_wds = now - 270;
2775          jQuery('#top_left_' + wds).css({
2776            '-moz-transform': 'rotate(' + wds_params[wds].top_left_deggree_wds + 'deg)',
2777            '-webkit-transform': 'rotate(' + wds_params[wds].top_left_deggree_wds + 'deg)',
2778            '-o-transform': 'rotate(' + wds_params[wds].top_left_deggree_wds + 'deg)',
2779            '-ms-transform': 'rotate(' + wds_params[wds].top_left_deggree_wds + 'deg)',
2780            'transform': 'rotate(' + wds_params[wds].top_left_deggree_wds + 'deg)',
2781            '-webkit-transform-origin': 'right bottom',
2782            '-ms-transform-origin': 'right bottom',
2783            '-moz-transform-origin': 'right bottom',
2784            'transform-origin': 'right bottom'
2785          });
2786        }
2787      }
2788    }
2789  });
2790}
2791
2792function wds_slide_redirect_link(event, url, target) {
2793	if ( event.target.className != 'wds_play_btn_cont' && event.target.className != 'wds_bigplay_layer' && event.target.className != '') {
2794		window.open(url,target);
2795	}
2796}
2797
2798/* Pro. */
2799function onYouTubeIframeAPIReady() {
2800  jQuery("div[id^='wds_container1']").find("iframe[data-type='youtube']").each(function() {
2801    var player = new YT.Player(this.id, {
2802      videoId: this.id,
2803      events: {
2804        'onReady': wds_onPlayerReady,
2805        'onStateChange': onPlayerStateChange
2806      }
2807    });
2808    wds_params[wds].youtube_iframes_ids.push(this.id);
2809    wds_params[wds].youtube_iframes.push(player);
2810  });
2811}
2812
2813function onPlayerStateChange( event ) {
2814  if (event.data == YT.PlayerState.PLAYING && !wds_done) {
2815    wds_done = true;
2816  }
2817}
2818
2819function wds_onPlayerReady( event ) {
2820  wds_ready = true;
2821}
2822
2823function wds_playVideo( wds_player ) {
2824  if( wds_ready ){
2825    wds_player.playVideo();
2826  }
2827  else {
2828    setTimeout(function(){ wds_playVideo( wds_player ) }, 1000);
2829  }
2830}
2831
2832/* Parallax. */
2833function wds_parallax(wds, slide_id) {
2834  var current_key = jQuery("#wds_current_image_key_" + wds).val();
2835  var slide_id = wds_params[wds].wds_data[current_key]["id"];
2836  var layers_cont = ".wds_slideshow_image_" + wds + ">[id^='wds_" + wds + "_slide" + slide_id + "_layer']";
2837
2838  var slide_width = jQuery(".wds_slideshow_image_" + wds + "[data-image-id='" + slide_id + "']").outerWidth();
2839  var slide_height = jQuery(".wds_slideshow_image_" + wds + "[data-image-id='" + slide_id + "']").outerHeight();
2840
2841  var zIndex_arr = [];
2842  var hor = [];
2843  var ver = [];
2844
2845  jQuery(layers_cont).each(function() {
2846    jQuery(this).css({
2847      'transform': 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)',
2848      '-ms-transform': 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)',
2849      '-webkit-transform': 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)',
2850      'transform-origin': '50% 50% 0px',
2851      '-ms-transform-origin': '50% 50% 0px',
2852      '-webkit-transform-origin': '50% 50% 0px'
2853    });
2854    var cur_zIndex = parseInt(jQuery(this).css("z-index"));
2855    hor[cur_zIndex] = 0;
2856    ver[cur_zIndex] = 0;
2857    zIndex_arr.push(cur_zIndex);
2858  });
2859
2860  /* Arithmetic average for layer movement direction. */
2861  var average = (zIndex_arr[0] + zIndex_arr[zIndex_arr.length - 1]) / 2;
2862
2863  zIndex_arr.sort();
2864
2865  var last_position = {};
2866
2867  jQuery("#wds_container1_" + wds).off("mousemove touchmove");
2868  jQuery("#wds_container1_" + wds).off("mouseleave touchend");
2869
2870  jQuery("#wds_container1_" + wds).on("mousemove touchmove:withPreventDefault", function (event) {
2871    /* Check to make sure there is data to compare against. */
2872    var xPos,yPos,xclient,yclient;
2873    xPos = last_position.x;
2874    yPos = last_position.y;
2875    if(event.type == "touchmove" ) {
2876      xclient = event.originalEvent.touches[0].clientX;
2877      yclient = event.originalEvent.touches[0].clientY;
2878    }
2879    else {
2880      xclient = event.clientX;
2881      yclient = event.clientY;
2882    }
2883    if (typeof(xPos) != 'undefined') {
2884      /* Get the change from last position to this position.*/
2885      var deltaX = xPos - xclient,
2886          deltaY = yPos - yclient;
2887
2888      jQuery(layers_cont).each(function() {
2889        var cur_zIndex = jQuery(this).css('z-index');
2890        var layer_left = parseFloat(jQuery(this).css("left"));
2891        var layer_top = parseFloat(jQuery(this).css("top"));
2892        var layer_width = jQuery(this).outerWidth();
2893        var layer_height = jQuery(this).outerHeight();
2894        for (var j in zIndex_arr) {
2895          if (zIndex_arr[j] == cur_zIndex) {
2896            j = parseFloat(j);
2897            var step = (j + 1) / 10;
2898            /* Check which direction had the highest amplitude and then figure out direction by checking if the value is greater or less than zero.*/
2899            if (Math.abs(deltaX) > Math.abs(deltaY) && deltaX > 0) {
2900              /* Left.*/
2901              hor[cur_zIndex] = hor[cur_zIndex] + step;
2902            } else if (Math.abs(deltaX) > Math.abs(deltaY) && deltaX < 0) {
2903              /* Right.*/
2904              hor[cur_zIndex] = hor[cur_zIndex] - step;
2905            } else if (Math.abs(deltaY) > Math.abs(deltaX) && deltaY > 0) {
2906              /* Up.*/
2907              ver[cur_zIndex] = ver[cur_zIndex] + step;
2908            } else if (Math.abs(deltaY) > Math.abs(deltaX) && deltaY < 0) {
2909              /* Down. */
2910              ver[cur_zIndex] = ver[cur_zIndex] - step;
2911            }
2912            /* Layer movement direction. */
2913            var dir = (average >= cur_zIndex ? -1 : 1);
2914
2915            if (layer_left + dir * hor[cur_zIndex] < 0) {
2916              hor[cur_zIndex] += dir * step;
2917            }
2918            if (layer_left + layer_width + dir * hor[cur_zIndex] > slide_width) {
2919              hor[cur_zIndex] -= dir * step;
2920            }
2921            if (layer_top + dir * ver[cur_zIndex] < 0) {
2922              ver[cur_zIndex] += dir * step;
2923            }
2924            if (layer_top + layer_height + dir * ver[cur_zIndex] > slide_height) {
2925              ver[cur_zIndex] -= dir * step;
2926            }
2927            jQuery(this).stop();
2928            jQuery(this).css({
2929              marginTop: (ver[cur_zIndex] *  dir).toFixed(2) + 'px',
2930              marginLeft: (hor[cur_zIndex] * dir).toFixed(2) + 'px'
2931            });
2932          }
2933        }
2934      });
2935    }
2936    /* Set the new last position to the current for next time.*/
2937    if(event.type == "touchmove") {
2938      last_position = {
2939        x : event.originalEvent.touches[0].clientX,
2940        y : event.originalEvent.touches[0].clientY
2941      };
2942    }
2943    else {
2944      last_position = {
2945        x : event.clientX,
2946        y : event.clientY
2947      };
2948    }
2949  });
2950  /* Reset layer positions on mouse out. */
2951  jQuery("#wds_container1_" + wds).on("mouseleave touchend:withPreventDefault", function (event) {
2952    jQuery(layers_cont).each(function() {
2953      jQuery(this).animate({
2954            marginTop: 0,
2955            marginLeft: 0
2956          },
2957          500);
2958      var cur_zIndex = jQuery(this).css('z-index');
2959      hor[cur_zIndex] = 0;
2960      ver[cur_zIndex] = 0;
2961    });
2962  });
2963}
2964
2965function get_browser_info(){
2966  var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
2967  if(/trident/i.test(M[1])){
2968    tem=/\brv[ :]+(\d+)/g.exec(ua) || [];
2969    return {name:'IE ',version:(tem[1]||'')};
2970  }
2971  if(M[1]==='Chrome'){
2972    tem=ua.match(/\bOPR\/(\d+)/)
2973    if(tem!=null)   {return {name:'Opera', version:tem[1]};}
2974  }
2975  M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
2976  if((tem=ua.match(/version\/(\d+)/i))!=null) {M.splice(1,1,tem[1]);}
2977  return {
2978    name: M[0],
2979    version: M[1]
2980  };
2981}
2982
2983function wds_embed_slide_autoplay(slide_id, wds) {
2984  var browser=get_browser_info();
2985  jQuery(slide_id).find("iframe:not([class^='wds_video_layer_frame'])").each(function () {
2986    if (typeof jQuery(this)[0].contentWindow != "undefined") {
2987      if (jQuery(this).data('type') == 'youtube') {
2988        player = wds_params[wds].youtube_iframes_ids.indexOf(this.id
2988);
2989        /* Chrome 66 is block autoplay without mute */
2990        if( (browser.name == 'Chrome' && browser.version >= 66) || ((browser.name == 'Opera' && browser.version >= 53)) )
2991        {
2992          if( wds_params[wds].youtube_iframes[player] ) {
2993            wds_params[wds].youtube_iframes[player].mute();
2994          }
2995        }
2996        if( wds_params[wds].youtube_iframes[player] ) {
2997          wds_params[wds].youtube_iframes[player].playVideo();
2998        }
2999      }
3000      else if (jQuery(this).data('type') == 'vimeo') {
3001        /* Chrome 66 is block autoplay without mute */
3002        if( (browser.name == 'Chrome' && browser.version >= 66) || ((browser.name == 'Opera' && browser.version >= 53)) )
3003        {
3004          jQuery(this)[0].contentWindow.postMessage('{"method":"setVolume", "value":0}','*');
3005        }
3006        jQuery(this)[0].contentWindow.postMessage('{"method": "play"}', "*");
3007      }
3008      else {
3009        jQuery(this)[0].contentWindow.postMessage('play', '*');
3010      }
3011    }
3012  });
3013}
3014
3015/* Uploaded video. */
3016function wds_video_dimenstion(wds, current_key) {
3017  var slide_id = wds_params[wds].wds_data[current_key]["id"];
3018  var is_video = wds_params[wds].wds_data[current_key]["is_video"];
3019  var controls = wds_params[wds].wds_data[current_key]["link"];
3020  var autoplay = wds_params[wds].wds_data[current_key]["target_attr_slide"];
3021  var fillmode = wds_params[wds].wds_data[current_key]["fillmode"];
3022  var att_width = wds_params[wds].wds_data[current_key]["width"];
3023  var att_height = wds_params[wds].wds_data[current_key]["height"];
3024  if (is_video == 'video') {
3025    if (fillmode == 'fill') {
3026      var video_slide_width = jQuery("#wds_slide_container_" + wds + "").width();
3027      var video_slide_height = jQuery("#wds_slide_container_" + wds + "").height();
3028      var video_width = att_width;
3029      var video_height = att_height;
3030      var ratio = video_width / video_height;
3031      if ((video_slide_width / video_slide_height) <= (video_width / video_height)) {
3032        jQuery("#wds_slide_" + wds + '_' + slide_id).attr("height", video_slide_height);
3033        video_width = jQuery("#wds_slide_" + wds + '_' + slide_id).height() * ratio ;
3034        video_width = (video_width - video_slide_width) / 2;
3035        jQuery("#wds_slide_" + wds + '_' + slide_id).css({'position': 'relative', 'left': -video_width});
3036      }
3037      else {
3038        jQuery("#wds_slide_" + wds + '_' + slide_id).attr("width", video_slide_width);
3039        video_height = jQuery("#wds_slide_" + wds + '_' + slide_id).width() / ratio ;
3040        video_height = (video_height - video_slide_height) / 2;
3041        jQuery("#wds_slide_" + wds + '_' + slide_id).css({'position': 'relative', 'top': -video_height});
3042      }
3043    }
3044    else {
3045      jQuery("#wds_slide_" + wds + '_' + slide_id).attr("height", "100%");
3046    }
3047	/* Check slide autoplay video. */
3048	if (autoplay == 1 || controls == 0) {
3049      jQuery("#wds_slide_" + wds + '_' + slide_id).get(0).load();
3050      jQuery("#wds_slide_" + wds + '_' + slide_id).get(0).play();
3051      jQuery(".wds_bigplay_"+wds).addClass("wds_hide");
3052    }
3053  }
3054}
3055
3056function wds_upvideo_layer_dimenstion(wds, key, j) {
3057  var slide_id = wds_params[wds].wds_data[key]["id"];
3058  var data = wds_params[wds].wds_data[key];
3059  var controls = wds_params[wds].wds_data[key]["layer_" + j + "_controls"];
3060  var autoplay = wds_params[wds].wds_data[key]["layer_" + j + "_video_autoplay"];
3061  var width = wds_params[wds].wds_data[key]["layer_" + j + "_attr_width"];
3062  var height = wds_params[wds].wds_data[key]["layer_" + j + "_attr_height"];
3063  if (data["layer_" + j + "_type"] == "upvideo")  {
3064    var video_layer_width = jQuery('#wds_' + wds + '_slide' + slide_id + '_layer' + data["layer_" + j + "_id"]).width();
3065    var video_layer_height = jQuery('#wds_' + wds + '_slide' + slide_id + '_layer' +data["layer_" + j + "_id"]).height();
3066    var video_width = width;
3067    var video_height = height;
3068
3069    if ((video_layer_width / video_layer_height) <= (video_width / video_height)) {
3070      jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).attr("height", video_layer_height);
3071      video_width = jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).width();
3072      video_width = (video_width - video_layer_width) / 2;
3073      jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).css({'position': 'relative', 'left': -video_width});
3074    }
3075    else {
3076      jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).attr("width", video_layer_width);
3077      video_height = jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).height();
3078      video_height = (video_height - video_layer_height) / 2;
3079      jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).css({'position': 'relative', 'top': -video_height});
3080    }
3081    if ( autoplay == 'on' || controls == '0' ) {
3082      jQuery("#wds_slide_" + wds + "_" + slide_id + '_layer_' + data["layer_" + j + "_id"]).get(0).load();
3083      jQuery("#wds_slide_" + wds + "_" + slide_id + '_layer_' + data["layer_" + j + "_id"]).get(0).play();
3084    }
3085  }
3086}
3087
3088function wds_video_play_pause(wds, id) {
3089  if (jQuery(id).get(0).paused) {
3090    jQuery(id).get(0).play();
3091    jQuery('.wds_bigplay_' + wds).hide();
3092  }
3093  else {
3094    jQuery(id).get(0).pause();
3095    jQuery('.wds_bigplay_' + wds).show();
3096    jQuery(".wds_hide").removeClass("wds_hide");
3097  }
3098}
3099
3100function wds_video_play_pause_layer(event, wds, slide_id, layer_id) {
3101  var paused = jQuery('#wds_slide_' + wds + '_' + slide_id + '_layer_' + layer_id).get(0).paused;
3102  if (event.target.className == 'wds_bigplay_layer') {
3103    var paused = true;
3104  }
3105  if ( paused ) {
3106    jQuery('#wds_slide_' + wds + '_' + slide_id + '_layer_' + layer_id).get(0).play();
3107    jQuery('#wds_bigplay_layer_' + wds + '_' + slide_id + '_layer_' + layer_id).hide();
3108  }
3109  else {
3110    jQuery('#wds_slide_' + wds + '_' + slide_id + '_layer_' + layer_id).get(0).pause();
3111    jQuery('#wds_bigplay_layer_' + wds + '_' + slide_id + '_layer_' + layer_id).show();
3112  }
3113}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.