', image_markup: '', flash_markup: '', quicktime_markup: '', iframe_markup: ' ', inline_markup: ' ' }, tsvg_pp_settings); var matchedObjects = this, percentBased = false, correctSizes, pp_open, tsvg_pp_content_height, tsvg_pp_content_width, tsvg_pp_container_height, tsvg_pp_container_width, windowHeight = $(window).height(), windowWidth = $(window).width(), pp_slideshow; doresize = true, scroll_pos = _get_scroll796659(); $(window).resize(function () { tsvg_center_overlay796659(); tsvg_resize_overlay796659(); }); if (tsvg_pp_settings.keyboard_shortcuts) { $(document).unbind('keydown').keydown(function (e) { if (typeof $tsvg_pp_pic_holder796659 != 'undefined') { if ($tsvg_pp_pic_holder796659.is(':visible')) { switch (e.keyCode) { case 37: $.prettyPhoto796659.changePage('previous'); break; case 39: $.prettyPhoto796659.changePage('next'); break; case 27: if (!settings.modal) $.prettyPhoto796659.close(); break; } return false; } } }); } $.prettyPhoto796659.initialize = function () { settings = tsvg_pp_settings; if (navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequest && parseInt($.browser.version) == 6) settings.theme = "light_square"; _buildOverlay796659(this); if (settings.allow_resize) $(window).scroll(function () { tsvg_center_overlay796659(); }); tsvg_center_overlay796659(); set_position = jQuery(this).closest('li').index(); $.prettyPhoto796659.open(); return false; } $.prettyPhoto796659.open = function (event) { if (typeof settings == "undefined") { settings = tsvg_pp_settings; if (navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequest && $.browser.version == 6) settings.theme = "light_square"; _buildOverlay796659(event.target); pp_images = $.makeArray(arguments[0]); pp_titles = (arguments[1]) ? $.makeArray(arguments[1]) : $.makeArray(""); pp_descriptions = (arguments[2]) ? $.makeArray(arguments[2]) : $.makeArray(""); isSet = (pp_images.length > 1) ? true : false; set_position = 0; } if (navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequestmsie && $.browser.version == 6) $('select').css('visibility', 'hidden'); if (settings.hideflash) $('object,embed').css('visibility', 'hidden'); _checkPosition796659($(pp_images).length); $('.tsvg_pp_loader_icon796659').show(); if ($ppt.is(':hidden')) $ppt.css('opacity', 0).show(); $tsvg_pp_overlay.show().fadeTo(settings.animation_speed, settings.opacity); $tsvg_pp_pic_holder796659.find('.tsvg_current_text_holder').text((set_position + 1) + settings.counter_separator_label + $(pp_images).length); $tsvg_pp_pic_holder796659.find('.tsvg_pp_description796659').show().html(unescape(pp_descriptions[set_position])); (settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined") ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html(' '); movie_width = (parseFloat(grab_param796659('width', pp_images[set_position]))) ? grab_param796659('width', pp_images[set_position]) : settings.default_width.toString(); movie_height = (parseFloat(grab_param796659('height', pp_images[set_position]))) ? grab_param796659('height', pp_images[set_position]) : settings.default_height.toString(); if (movie_width.indexOf('%') != -1 || movie_height.indexOf('%') != -1) { movie_height = parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150); movie_width = parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150); percentBased = true; } else { percentBased = false; } $tsvg_pp_pic_holder796659.fadeIn(function () { var tsvg_autoplay = jQuery('.tsvg-main-content-796659').attr('data-tsvg-autoplay'); imgPreloader = ""; if (pp_images[set_position].indexOf('youtube.com/shorts/') > -1 ) { pp_images[set_position] = pp_images[set_position].replace("shorts", "embed") } pp_images[set_position] = pp_images[set_position].replace('embed/', 'watch?v='); switch (_getFileType796659(pp_images[set_position])) { case 'image': imgPreloader = new Image(); nextImage = new Image(); if (isSet && set_position > $(pp_images).length) nextImage.src = pp_images[set_position + 1]; prevImage = new Image(); if (isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1]; $tsvg_pp_pic_holder796659.find('#tsvg_pp_full_res796659')[0].innerHTML = settings.image_markup; $tsvg_pp_pic_holder796659.find('#tsvg_full_res_image').attr('src', pp_images[set_position]); imgPreloader.onload = function () { correctSizes = _fitToViewport796659(imgPreloader.width, imgPreloader.height); _showContent796659(); }; imgPreloader.onerror = function () { alert('Image cannot be loaded. Make sure the path is correct and image exist.'); $.prettyPhoto796659.close(); }; imgPreloader.src = pp_images[set_position]; break; case 'youtube': correctSizes = _fitToViewport796659(movie_width, movie_height); movie = 'https://www.youtube.com/embed/' + grab_param796659('v', pp_images[set_position]); if (tsvg_autoplay == "true") { movie += "?autoplay=1&mute=1"; } toInject = settings.iframe_markup.replace(/{width}/g, correctSizes['width']).replace(/{height}/g, correctSizes['height']).replace(/{path}/g, movie); break; case 'vimeo': correctSizes = _fitToViewport796659(movie_width, movie_height); movie_id = pp_images[set_position]; var regExp = movie_id.split('vimeo.com/'); var match = regExp[1]; movie = 'https://player.vimeo.com/' + match; if (tsvg_autoplay == "true") movie += "?autoplay=1&muted=1"; vimeo_width = correctSizes['width'] + '/embed/?moog_width=' + correctSizes['width']; toInject = settings.iframe_markup.replace(/{width}/g, vimeo_width).replace(/{height}/g, correctSizes['height']).replace(/{path}/g, movie); break; case 'wistia': correctSizes = _fitToViewport796659(movie_width, movie_height); movie_id = pp_images[set_position]; var regExp = movie_id.match(/wistia\.com\/medias\/([a-zA-Z0-9\-_]+)/); var match = regExp[1]; movie = '//fast.wistia.net/embed/iframe/' + match + ''; toInject = settings.iframe_markup.replace(/{width}/g, correctSizes['width']).replace(/{height}/g, correctSizes['height']).replace(/{path}/g, movie); break; case 'quicktime': correctSizes = _fitToViewport796659(movie_width, movie_height); correctSizes['height'] += 15; correctSizes['contentHeight'] += 15; correctSizes['containerHeight'] += 15; toInject = settings.quicktime_markup.replace(/{width}/g, correctSizes['width']).replace(/{height}/g, correctSizes['height']).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, pp_images[set_position]).replace(/{autoplay}/g, settings.autoplay); break; case 'flash': correctSizes = _fitToViewport796659(movie_width, movie_height); flash_vars = pp_images[set_position]; flash_vars = flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10, pp_images[set_position].length); filename = pp_images[set_position]; filename = filename.substring(0, filename.indexOf('?')); toInject = settings.flash_markup.replace(/{width}/g, correctSizes['width']).replace(/{height}/g, correctSizes['height']).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, filename + '?' + flash_vars); break; case 'iframe': correctSizes = _fitToViewport796659(movie_width, movie_height); frame_url = pp_images[set_position]; if (frame_url.indexOf("wistia") != -1) { var arr = frame_url.split('/'); var frame_url = '//' + arr[2] + '/embed/iframe/' + arr[4]; toInject = settings.iframe_markup.replace(/{width}/g, correctSizes['width']).replace(/{height}/g, correctSizes['height']).replace(/{path}/g, frame_url); } else { frame_url = frame_url.substr(0, frame_url.indexOf('iframe') - 1); toInject = settings.iframe_markup.replace(/{width}/g, correctSizes['width']).replace(/{height}/g, correctSizes['height']).replace(/{path}/g, frame_url); } break; case 'custom': correctSizes = _fitToViewport796659(movie_width, movie_height); toInject = settings.custom_markup; break; case 'inline': myClone = $(pp_images[set_position]).clone().css({ 'width': settings.default_width }).wrapInner(' "; } ; toInject = settings.gallery_markup.replace(/{gallery}/g, toInject); $tsvg_pp_pic_holder796659.find('#tsvg_pp_full_res796659').after(toInject); $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659 .tsvg_pp_arrow_next796659').click(function () { $.prettyPhoto796659.changeGalleryPage('next'); $.prettyPhoto796659.stopSlideshow(); return false; }); $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659 .tsvg_pp_arrow_previous796659').click(function () { $.prettyPhoto796659.changeGalleryPage('previous'); $.prettyPhoto796659.stopSlideshow(); return false; }); $tsvg_pp_pic_holder796659.find('.tsvg_pp_content796659').hover(function () { $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659:not(.disabled)').fadeIn(); }, function () { $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659:not(.disabled)').fadeOut(); }); itemWidth = 52 + 5; $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659 ul li').each(function (i) { $(this).css({ 'position': 'absolute', 'left': i * itemWidth }); $(this).find('a').unbind('click').click(function () { $.prettyPhoto796659.changePage(i); $.prettyPhoto796659.stopSlideshow(); return false; }); }); } if (settings.slideshow) { $tsvg_pp_pic_holder796659.find('.tsvg_pp_nav796659').prepend('') $tsvg_pp_pic_holder796659.find('.tsvg_pp_nav796659 .pp_play796659').click(function () { $.prettyPhoto796659.startSlideshow(); return false; }); } $tsvg_pp_pic_holder796659.attr('class', 'tsvg_pp_pic_holder796659 ' + settings.theme); $tsvg_pp_overlay.css({ 'opacity': 0, 'height': $(document).height(), 'width': $(document).width() }).bind('click', function () { if (!settings.modal) $.prettyPhoto796659.close(); }); $('i.pp_close796659').bind('click', function () { $.prettyPhoto796659.close(); return false; }); $('a.tsvg_pp_expand796659').bind('click', function (e) { if ($(this).hasClass('tsvg_pp_expand796659')) { $(this).removeClass('tsvg_pp_expand796659').addClass('pp_contract796659'); doresize = false; } else { $(this).removeClass('pp_contract796659').addClass('tsvg_pp_expand796659'); doresize = true; } _hideContent796659(function () { $.prettyPhoto796659.open(); }); return false; }); $tsvg_pp_pic_holder796659.find('.tsvg_pp_previous, .tsvg_pp_nav796659 .tsvg_pp_arrow_previous796659').bind('click', function () { $.prettyPhoto796659.changePage('previous'); $.prettyPhoto796659.stopSlideshow(); return false; }); $tsvg_pp_pic_holder796659.find('.tsvg_pp_next, .tsvg_pp_nav796659 .tsvg_pp_arrow_next796659').bind('click', function () { $.prettyPhoto796659.changePage('next'); $.prettyPhoto796659.stopSlideshow(); return false; }); tsvg_center_overlay796659(); }; return this.unbind('click').click($.prettyPhoto796659.initialize).children('a').click(function () { let link = jQuery(this).attr('href'), target = jQuery(this).attr('target'); if (target != '_self') { window.open(link); } else { window.location.assign(link) } return false; }); }; function grab_param796659(name, url) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + name + "=([^]*)"; var regex = new RegExp(regexS); var results = regex.exec(url); return (results == null) ? "" : results[1]; } })(jQuery); jQuery(document).on("ready", function ($) { jQuery(document).on("mousedown", ".tsvg-block-link-hover", function (e) { e.preventDefault(); e.stopPropagation(); return false; }); let tsvgLightBoxResizeTo796659, tsvgLightBoxHeight796659 = 0, tsvgDoneResizing796659 = function() { jQuery('#tsvg-section-796659').css("min-height",(jQuery('.tsvg-main-content-796659').height() + jQuery('#tsvg-section-796659 .tsvg-pagination-pages-wrapper').height()) + "px"); }; new ResizeSensor(jQuery('.tsvg-main-content-796659'), function(event){ tsvgLightBoxHeight796659 = event.height; clearTimeout(tsvgLightBoxResizeTo796659); tsvgLightBoxResizeTo796659 = setTimeout(tsvgDoneResizing796659, 100); }); }) function lightboxPhoto796659() { jQuery(".tsvg-lightbox-block-796659 figure").prettyPhoto796659({ animationSpeed:'fast', slideshow:5000, theme:'light_rounded', show_title:false, icon_play:jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-play'), icon_paus:jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-paus'), icon_close:jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-close'), icon_close_text:jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-close-text'), icon_next:jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-next'), icon_prev:jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-prev'), overlay_gallery: false }) } if(jQuery().prettyPhoto796659) { jQuery('.tsvg-section-796659').fadeIn(); lightboxPhoto796659(); } clearInterval(tsvgLightboxInterval796659); } }, tsvgLightboxInterval796659 = setInterval(tsvgLightboxCreate796659, 1000);
\ ', gallery_markup: '{content}
', custom_markup: '', mp4_markup: '').appendTo($('body')); correctSizes = _fitToViewport796659($(myClone).width(), $(myClone).height()); $(myClone).remove(); toInject = settings.inline_markup.replace(/{content}/g, $(pp_images[set_position]).html()); break; case 'mp4': correctSizes = _fitToViewport796659(movie_width, movie_height); toInject = settings.mp4_markup.replace(/{width}/g, correctSizes['width']).replace(/{height}/g, correctSizes['height']).replace(/{path}/g, pp_images[set_position]).replace(/{tsvg_autoplay_b}/g,tsvg_autoplay == "true" ? "autoplay" : ""); break; } if (!imgPreloader) { $tsvg_pp_pic_holder796659.find('#tsvg_pp_full_res796659')[0].innerHTML = toInject; _showContent796659(); } }) return false; } $.prettyPhoto796659.changePage = function (direction) { currentGalleryPage = 0; if (direction == 'previous') { set_position--; if (0 > set_position) { set_position = 0; return; } } else if (direction == 'next') { set_position++; if (set_position > $(pp_images).length - 1) { set_position = 0; } } else { set_position = direction; } if (!doresize) doresize = true; $('.pp_contract796659').removeClass('pp_contract796659').addClass('tsvg_pp_expand796659'); _hideContent796659(function () { $.prettyPhoto796659.open(); }) } $.prettyPhoto796659.changeGalleryPage = function (direction) { if (direction == 'next') { currentGalleryPage++; if (currentGalleryPage > totalPage) { currentGalleryPage = 0; } } else if (direction == 'previous') { currentGalleryPage--; if (0 > currentGalleryPage) { currentGalleryPage = totalPage; } } else { currentGalleryPage = direction; } itemsToSlide = (currentGalleryPage == totalPage) ? pp_images.length - ((totalPage) * itemsPerPage) : itemsPerPage; $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659 li').each(function (i) { $(this).animate({ 'left': (i * itemWidth) - ((itemsToSlide * itemWidth) * currentGalleryPage) }); }) } $.prettyPhoto796659.startSlideshow = function () { if (typeof pp_slideshow == 'undefined') { $tsvg_pp_pic_holder796659.find('.pp_play796659').unbind('click').removeClass('pp_play796659 ' + jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-play')).addClass('pp_pause796659 ' + jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-paus'),).click(function () { $.prettyPhoto796659.stopSlideshow(); return false; }) pp_slideshow = setInterval($.prettyPhoto796659.startSlideshow, settings.slideshow); } else { $.prettyPhoto796659.changePage('next'); } } $.prettyPhoto796659.stopSlideshow = function () { $tsvg_pp_pic_holder796659.find('.pp_pause796659').unbind('click').removeClass('pp_pause796659 ' + jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-paus'),).addClass('pp_play796659 ' + jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-play')).click(function () { $.prettyPhoto796659.startSlideshow(); return false; }) clearInterval(pp_slideshow); pp_slideshow = undefined; } $.prettyPhoto796659.close = function () { clearInterval(pp_slideshow); $tsvg_pp_pic_holder796659.stop().find('object,embed').css('visibility', 'hidden'); $('div.tsvg_pp_pic_holder796659,div.ppt796659,.tsvg_pp_fade796659').fadeOut(settings.animation_speed, function () { $(this).remove(); }) $tsvg_pp_overlay.fadeOut(settings.animation_speed, function () { if (navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequest && $.browser.version == 6) $('select').css('visibility', 'visible'); if (settings.hideflash) $('object,embed').css('visibility', 'visible'); $(this).remove(); settings.callback(); doresize = true; pp_open = false; delete settings; }) } _showContent796659 = function () { $('.tsvg_pp_loader_icon796659').hide(); $ppt.fadeTo(settings.animation_speed, 1); projectedLeft = Math.floor( $(window).width() - correctSizes['containerWidth'] ) / 2; $tsvg_pp_pic_holder796659.find('.tsvg_pp_content796659').animate({ 'height': correctSizes['contentHeight'] }, settings.animation_speed); $tsvg_pp_pic_holder796659.animate({ 'left': projectedLeft , 'width': correctSizes['containerWidth'] }, settings.animation_speed, function () { $tsvg_pp_pic_holder796659.find('.tsvg_pp_hover_container796659,#tsvg_full_res_image').height(correctSizes['height']).width(correctSizes['width']); $tsvg_pp_pic_holder796659.find('.tsvg_pp_fade796659').fadeIn(settings.animation_speed); if (isSet && _getFileType796659(pp_images[set_position]) == "image") { $tsvg_pp_pic_holder796659.find('.tsvg_pp_hover_container796659').show(); } else { $tsvg_pp_pic_holder796659.find('.tsvg_pp_hover_container796659').hide(); } if (correctSizes['resized']) $('a.tsvg_pp_expand796659,a.pp_contract796659').fadeIn(settings.animation_speed); if (settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto796659.startSlideshow(); settings.changepicturecallback(); pp_open = true; }) _insert_gallery796659(); } function _hideContent796659(callback) { $tsvg_pp_pic_holder796659.find('#tsvg_pp_full_res796659 object,#tsvg_pp_full_res796659 embed').css('visibility', 'hidden'); $tsvg_pp_pic_holder796659.find('.tsvg_pp_fade796659').fadeOut(settings.animation_speed, function () { $('.tsvg_pp_loader_icon796659').show(); callback(); }) } function _checkPosition796659(setCount) { if (set_position == setCount - 1) { $tsvg_pp_pic_holder796659.find('a.tsvg_pp_next').css('visibility', 'hidden'); $tsvg_pp_pic_holder796659.find('a.tsvg_pp_next').addClass('disabled').unbind('click'); } else { $tsvg_pp_pic_holder796659.find('a.tsvg_pp_next').css('visibility', 'visible'); $tsvg_pp_pic_holder796659.find('a.tsvg_pp_next.disabled').removeClass('disabled').bind('click', function () { $.prettyPhoto796659.changePage('next'); return false; }) } if (set_position == 0) { $tsvg_pp_pic_holder796659.find('a.tsvg_pp_previous').css('visibility', 'hidden').addClass('disabled').unbind('click'); } else { $tsvg_pp_pic_holder796659.find('a.tsvg_pp_previous.disabled').css('visibility', 'visible').removeClass('disabled').bind('click', function () { $.prettyPhoto796659.changePage('previous'); return false; }) } (setCount > 1) ? $('.tsvg_pp_nav796659').show() : $('.tsvg_pp_nav796659').hide(); } function _fitToViewport796659(width, height) { resized = false; _getDimensions796659(width, height); imageWidth = width, imageHeight = height; if (((tsvg_pp_container_width > windowWidth) || (tsvg_pp_container_height > windowHeight)) && doresize && settings.allow_resize && !percentBased) { resized = true, fitting = false; while (!fitting) { if ((tsvg_pp_container_width > windowWidth)) { imageWidth = (windowWidth - 50); imageHeight = (height / width) * imageWidth; } else if ((tsvg_pp_container_height > windowHeight)) { imageHeight = (windowHeight - 150); imageWidth = (width / height) * imageHeight; } else { fitting = true; } tsvg_pp_container_height = imageHeight, tsvg_pp_container_width = imageWidth; } _getDimensions796659(imageWidth, imageHeight); } return { width: Math.floor(imageWidth), height: Math.floor(imageHeight), containerHeight: Math.floor(tsvg_pp_container_height) , containerWidth: Math.floor(tsvg_pp_container_width) , contentHeight: Math.floor(tsvg_pp_content_height), contentWidth: Math.floor(tsvg_pp_content_width), resized: resized } } function _getDimensions796659(width, height) { width = parseFloat(width); height = parseFloat(height); tsvg_pp_border_width = parseFloat($tsvg_pp_pic_holder796659.css("border-left-width")) ; tsvg_pp_height = $tsvg_pp_pic_holder796659.height() + parseFloat(tsvg_pp_border_width * 2 ); tsvg_pp_width = $tsvg_pp_pic_holder796659.width() + parseFloat(tsvg_pp_border_width * 2 ); tsvg_pp_content_height = height + parseFloat(tsvg_pp_border_width * 2 ) ; tsvg_pp_content_width = width + parseFloat(tsvg_pp_border_width * 2 ) ; tsvg_pp_container_width = width ; tsvg_pp_container_height = tsvg_pp_content_height + parseFloat(tsvg_pp_border_width * 2 ) ; $tsvg_pp_pic_holder796659.attr('data-item-title-align', jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-title-align')) $tsvg_pp_pic_holder796659.attr('data-item-title-show', jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-title-show')) $tsvg_pp_pic_holder796659.find('.totalsoft-gv-lvg-pl-pa796659').attr('class', 'totalsoft-gv-lvg-pl-pa796659 pp_play796659 ' + jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-play')); $tsvg_pp_pic_holder796659.find('.totalsoft-gv-lvg-close796659').attr('class', 'totalsoft-gv-lvg-close796659 pp_close796659 ' + jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-close')); $tsvg_pp_pic_holder796659.find('.totalsoft-gv-lvg-close796659 span').text(jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-close-text')); $tsvg_pp_pic_holder796659.find('.tsvg_pp_arrow_previous796659').attr('class', 'tsvg_pp_arrow_previous796659 totalsoft-gv-lvg-nepr796659 ' + jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-prev')); $tsvg_pp_pic_holder796659.find('.tsvg_pp_arrow_next796659').attr('class', 'tsvg_pp_arrow_next796659 totalsoft-gv-lvg-nepr796659 ' + jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-next')); $tsvg_pp_pic_holder796659.find('.totalsoft-gv-lvg-close796659').attr('class', 'totalsoft-gv-lvg-close796659 pp_close796659 ' + jQuery(".tsvg-lb-blocks-container-796659").attr('data-item-close')); } function _getFileType796659(itemSrc) { if (itemSrc.match(/youtube\.com\/watch/i)) { return 'youtube'; } else if (itemSrc.match(/vimeo\.com/i)) { return 'vimeo'; } else if (itemSrc.indexOf('.mov') != -1) { return 'quicktime'; } else if (itemSrc.indexOf('.swf') != -1) { return 'flash'; } else if (itemSrc.indexOf('.mp4') != -1) { return 'mp4'; } else if (itemSrc.indexOf('iframe') != -1) { return 'iframe'; } else if (itemSrc.indexOf('custom') != -1) { return 'custom'; } else if (itemSrc.substr(0, 1) == '#') { return 'inline'; } else if (itemSrc.match(/wistia\.com\/medias/i)) { return 'wistia'; } else { return 'image'; } } function tsvg_center_overlay796659() { if (doresize && typeof $tsvg_pp_pic_holder796659 != 'undefined') { var width = $tsvg_pp_pic_holder796659.width(), height = $tsvg_pp_pic_holder796659.height(); _getDimensions796659(width, height); var top = Math.floor( $(window).height() - tsvg_pp_height ) / 2, left = Math.floor( $(window).width() - tsvg_pp_width ) / 2; $tsvg_pp_pic_holder796659.css({ 'left': left }) } } function _get_scroll796659() { if (self.pageYOffset) { return { scrollTop: self.pageYOffset, scrollLeft: self.pageXOffset }; } else if (document.documentElement && document.documentElement.scrollTop) { return { scrollTop: document.documentElement.scrollTop, scrollLeft: document.documentElement.scrollLeft }; } else if (document.body) { return { scrollTop: document.body.scrollTop, scrollLeft: document.body.scrollLeft }; } } function tsvg_resize_overlay796659() { windowHeight = $(window).height(), windowWidth = $(window).width(); if (typeof $tsvg_pp_overlay != "undefined") $tsvg_pp_overlay.height($(document).height()); } function _insert_gallery796659() { if (isSet && settings.overlay_gallery && _getFileType796659(pp_images[set_position]) == "image") { itemWidth = 52 + 5; navWidth = (settings.theme == "facebook") ? 58 : 38; itemsPerPage = Math.floor((correctSizes['containerWidth'] - 100 - navWidth) / itemWidth); itemsPerPage = (pp_images.length > itemsPerPage) ? itemsPerPage : pp_images.length; totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1; if (totalPage == 0) { navWidth = 0; $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659 .tsvg_pp_arrow_next796659,.tsvg_pp_gallery796659 .tsvg_pp_arrow_previous796659').hide(); } else { $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659 .tsvg_pp_arrow_next796659,.tsvg_pp_gallery796659 .tsvg_pp_arrow_previous796659').show(); } ; galleryWidth = itemsPerPage * itemWidth + navWidth; $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659').width(galleryWidth).css('margin-left', -Math.floor((galleryWidth / 2))); $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659 ul').width(itemsPerPage * itemWidth).find('li.selected').removeClass('selected'); goToPage = totalPage >= (Math.floor(set_position / itemsPerPage)) ? Math.floor(set_position / itemsPerPage) : totalPage; if (itemsPerPage) { $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659').hide().show().removeClass('disabled'); } else { $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659').hide().addClass('disabled'); } $.prettyPhoto796659.changeGalleryPage(goToPage); $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659 ul li:eq(' + set_position + ')').addClass('selected'); } else { $tsvg_pp_pic_holder796659.find('.tsvg_pp_content796659').unbind('mouseenter mouseleave'); $tsvg_pp_pic_holder796659.find('.tsvg_pp_gallery796659').hide(); } } function _buildOverlay796659(caller) { theRel = $(caller).attr('data-tsvg-href'); isSet = true; pp_images = (isSet) ? jQuery.map(matchedObjects, function (n, i) { return $(n).attr('data-tsvg-href'); }) : $.makeArray($(caller).attr('data-tsvg-href')); pp_titles = (isSet) ? jQuery.map(matchedObjects, function (n, i) { if ($(n).attr('data-tsvg-href').indexOf(theRel) != -1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt') : ""; }) : $.makeArray($(caller).find('img').attr('alt')); pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function (n, i) { return $(n).attr('data-tsvg-title'); }) : $.makeArray($(caller).attr('data-tsvg-title')); $('body').append(settings.markup); $tsvg_pp_pic_holder796659 = $('.tsvg_pp_pic_holder796659'), $ppt = $('.ppt796659'), $tsvg_pp_overlay = $('div.tsvg_pp_overlay796659'); if (isSet && settings.overlay_gallery) { currentGalleryPage = 0; toInject = ""; for (var i = 0;pp_images > i.length; i++) { var regex = new RegExp("(.*?)\.(jpg|jpeg|png|gif)$"); var results = regex.exec(pp_images[i]); if (!results) { classname = 'default'; } else { classname = ''; } toInject += "