$( window ).resize(function() { ChooseGallery(); }); $(document).ready(function() { ChooseGallery(); }); function ChooseGallery(){ var width = $(window).width(); var IS_IPAD = navigator.userAgent.match(/iPad/i) != null; var IS_IPHONE = (navigator.userAgent.match(/iPhone/i) != null) || (navigator.userAgent.match(/iPod/i) != null); if (IS_IPAD) { IS_IPHONE = false;} if ( width <= 1024 || IS_IPAD || IS_IPHONE) { deviceGallery(); } else { fullScreenGallery(); } } function fullScreenGallery(){ $('#pictures').removeClass('hide'); $('#MobileGallery').removeAttr('style'); $('#MobileGallery').addClass('hide'); (function(e) { var t = e(window); TLG.pictures = { init: function() { var n = this.$container = e("#pictures-wrap"), r = this, i = n.parent().find(".next:first"), s = n.parent().find(".prev:first"), o = n.find(".photo"); this.windowWidth = parseFloat(t.width()); var u, a = 440, f = 248, l = 640, c = 480; o.each(function() { var t = e(this).find("img").attr("alt"); if (t !== undefined) { e(this).append('' + t + "") } }); var h = o.length * 10 + o.filter(".w1").length * a + o.filter(".w2").length * f + o.filter(".w3").length * 400, p = function() { var e = 0; for (var t = 0; t < o.length; t++) { e += o.eq(t).hasClass("w1") ? a + 10 : o.eq(t).hasClass("w2") ? f + 10 : 410; if (e >= h / 2) return e } }; this.tiledWidth = p(); this.largeWidth = o.length * 20 + o.filter(".w1").length * l + o.filter(".w2").length * c + o.filter(".w3").length * 800; this.currentWidth = TLG.isTablet ? this.largeWidth : this.tiledWidth; n.css({ width: r.currentWidth + "px" }); this.minLeft = this.windowWidth - this.currentWidth; t.resize(function() { r.resize() }); if (TLG.isTablet) { n.css("visibility", "visible"); n.owlCarousel({ navigation: !0, slideSpeed: 300, paginationSpeed: 400, singleItem: !0 }) } else { n.isotope({ itemSelector: ".photo", layoutMode: "fitRows", containerStyle: null, getSortData: { category: "[data-category]" } }); n.isotope("once", "layoutComplete", function() { n.css("visibility", "visible") }); n.isotope("layout") } n.find("img.lazyload").unveil(800, function() { var t = e('
').appendTo(e(this).parent()); e(this).load(function() { t.remove() }) }); var d = function() { n.addClass("pictures-large"); if ( $('#content-section > div').hasClass('container')){ n.addClass("test"); } n.css({ width: r.largeWidth + "px" }); r.currentWidth = r.largeWidth; r.resize(); n.isotope("layout"); v.show() }; if (!TLG.isMobile) { var v = e("#pictures-contols nav"); v.hide(); if (v.find('ul').length == 0){ v.append("