(function(q, m) {
    "function" === typeof define && define.amd ? define(m) : "object" === typeof exports ? module.exports = m() : q.Blazy = m()
})(this, function() {
    function q(b) {
        var c = b._util;
        c.elements = E(b.options);
        c.count = c.elements.length;
        c.destroyed && (c.destroyed = !1, b.options.container && l(b.options.container, function(a) {
            n(a, "scroll", c.validateT)
        }), n(window, "resize", c.saveViewportOffsetT), n(window, "resize", c.validateT), n(window, "scroll", c.validateT));
        m(b)
    }

    function m(b) {
        for (var c = b._util, a = 0; a < c.count; a++) {
            var d = c.elements[a],
                e;
            a: {
                var g = d;
                e = b.options;
                var p = g.getBoundingClientRect();
                if (e.container && y && (g = g.closest(e.containerClass))) {
                    g = g.getBoundingClientRect();
                    e = r(g, f) ? r(p, {
                        top: g.top - e.offset,
                        right: g.right + e.offset,
                        bottom: g.bottom + e.offset,
                        left: g.left - e.offset
                    }) : !1;
                    break a
                }
                e = r(p, f)
            }
            if (e || t(d, b.options.successClass)) b.load(d), c.elements.splice(a, 1), c.count--, a--
        }
        0 === c.count && b.destroy()
    }

    function r(b, c) {
        return b.right >= c.left && b.bottom >= c.top && b.left <= c.right && b.top <= c.bottom
    }

    function z(b, c, a) {
        if (!t(b, a.successClass) && (c || a.loadInvisible || 0 < b.offsetWidth && 0 < b.offsetHeight))
            if (c = b.getAttribute(u) || b.getAttribute(a.src)) {
                c = c.split(a.separator);
                var d = c[A && 1 < c.length ? 1 : 0],
                    e = b.getAttribute(a.srcset),
                    g = "img" === b.nodeName.toLowerCase(),
                    p = (c = b.parentNode) && "picture" === c.nodeName.toLowerCase();
                if (g || void 0 === b.src) {
                    var h = new Image,
                        w = function() {
                            a.error && a.error(b, "invalid");
                            v(b, a.errorClass);
                            k(h, "error", w);
                            k(h, "load", f)
                        },
                        f = function() {
                            g ? p || B(b, d, e) : b.style.backgroundImage = 'url("' + d + '")';
                            x(b, a);
                            k(h, "load", f);
                            k(h, "error", w)
                        };
                    p && (h = b, l(c.getElementsByTagName("source"), function(b) {
                        var c = a.srcset,
                            e = b.getAttribute(c);
                        e && (b.setAttribute("srcset", e), b.removeAttribute(c))
                    }));
                    n(h, "error", w);
                    n(h, "load", f);
                    B(h, d, e)
                } else b.src = d, x(b, a)
            } else "video" === b.nodeName.toLowerCase() ? (l(b.getElementsByTagName("source"), function(b) {
                var c = a.src,
                    e = b.getAttribute(c);
                e && (b.setAttribute("src", e), b.removeAttribute(c))
            }), b.load(), x(b, a)) : (a.error && a.error(b, "missing"), v(b, a.errorClass))
    }

    function x(b, c) {
        v(b, c.successClass);
        c.success && c.success(b);
        b.removeAttribute(c.src);
        b.removeAttribute(c.srcset);
        l(c.breakpoints, function(a) {
            b.removeAttribute(a.src)
        })
    }

    function B(b, c, a) {
        a && b.setAttribute("srcset", a);
        b.src = c
    }

    function t(b, c) {
        return -1 !== (" " + b.className + " ").indexOf(" " + c + " ")
    }

    function v(b, c) {
        t(b, c) || (b.className += " " + c)
    }

    function E(b) {
        var c = [];
        b = b.root.querySelectorAll(b.selector);
        for (var a = b.length; a--; c.unshift(b[a]));
        return c
    }

    function C(b) {
        f.bottom = (window.innerHeight || document.documentElement.clientHeight) + b;
        f.right = (window.innerWidth || document.documentElement.clientWidth) + b
    }

    function n(b, c, a) {
        b.attachEvent ? b.attachEvent && b.attachEvent("on" + c, a) : b.addEventListener(c, a, {
            capture: !1,
            passive: !0
        })
    }

    function k(b, c, a) {
        b.detachEvent ? b.detachEvent && b.detachEvent("on" + c, a) : b.removeEventListener(c, a, {
            capture: !1,
            passive: !0
        })
    }

    function l(b, c) {
        if (b && c)
            for (var a = b.length, d = 0; d < a && !1 !== c(b[d], d); d++);
    }

    function D(b, c, a) {
        var d = 0;
        return function() {
            var e = +new Date;
            e - d < c || (d = e, b.apply(a, arguments))
        }
    }
    var u, f, A, y;
    return function(b) {
        if (!document.querySelectorAll) {
            var c = document.createStyleSheet();
            document.querySelectorAll = function(a, b, d, h, f) {
                f = document.all;
                b = [];
                a = a.replace(/\[for\b/gi, "[htmlFor").split(",");
                for (d = a.length; d--;) {
                    c.addRule(a[d], "k:v");
                    for (h = f.length; h--;) f[h].currentStyle.k && b.push(f[h]);
                    c.removeRule(0)
                }
                return b
            }
        }
        var a = this,
            d = a._util = {};
        d.elements = [];
        d.destroyed = !0;
        a.options = b || {};
        a.options.error = a.options.error || !1;
        a.options.offset = a.options.offset || 100;
        a.options.root = a.options.root || document;
        a.options.success = a.options.success || !1;
        a.options.selector = a.options.selector || ".b-lazy";
        a.options.separator = a.options.separator || "|";
        a.options.containerClass = a.options.container;
        a.options.container = a.options.containerClass ? document.querySelectorAll(a.options.containerClass) : !1;
        a.options.errorClass = a.options.errorClass || "b-error";
        a.options.breakpoints = a.options.breakpoints || !1;
        a.options.loadInvisible = a.options.loadInvisible || !1;
        a.options.successClass = a.options.successClass || "b-loaded";
        a.options.validateDelay = a.options.validateDelay || 25;
        a.options.saveViewportOffsetDelay = a.options.saveViewportOffsetDelay || 50;
        a.options.srcset = a.options.srcset || "data-srcset";
        a.options.src = u = a.options.src || "data-src";
        y = Element.prototype.closest;
        A = 1 < window.devicePixelRatio;
        f = {};
        f.top = 0 - a.options.offset;
        f.left = 0 - a.options.offset;
        a.revalidate = function() {
            q(a)
        };
        a.load = function(a, b) {
            var c = this.options;
            void 0 === a.length ? z(a, b, c) : l(a, function(a) {
                z(a, b, c)
            })
        };
        a.destroy = function() {
            var a = this._util;
            this.options.container && l(this.options.container, function(b) {
                k(b, "scroll", a.validateT)
            });
            k(window, "scroll", a.validateT);
            k(window, "resize", a.validateT);
            k(window, "resize", a.saveViewportOffsetT);
            a.count = 0;
            a.elements.length = 0;
            a.destroyed = !0
        };
        d.validateT = D(function() {
            m(a)
        }, a.options.validateDelay, a);
        d.saveViewportOffsetT = D(function() {
            C(a.options.offset)
        }, a.options.saveViewportOffsetDelay, a);
        C(a.options.offset);
        l(a.options.breakpoints, function(a) {
            if (a.width >= window.screen.width) return u = a.src, !1
        });
        setTimeout(function() {
            q(a)
        })
    }
});
var player;
var done = !1;
var rbHomepage = {
    heroSlider: function() {
        var heroSlider = $('div.hero-container ul.hero-slider');
        $(heroSlider).bxSlider({
            auto: !0,
            nextSelector: '#hero-next',
            prevSelector: '#hero-prev',
            nextText: '<i class="fa fa-angle-right hero-next" aria-hidden="true"></i>',
            prevText: '<i class="fa fa-angle-left hero-prev" aria-hidden="true"></i>',
            slideMargin: 5,
            slideWidth: 960,
            autoHover: !0,
            onSliderLoad: function(currentIndex) {
                $('div.hero-container').removeClass('loading');
                $('div.hero-container ul.hero-slider > li.bx-clone').removeClass('active-slide');
                $('div.hero-container ul.hero-slider > li').eq(currentIndex + 1).addClass('active-slide')
            },
            onSlideAfter: function($slideElement, oldIndex, newIndex) {
                $('div.hero-container ul.hero-slider > li').eq(newIndex + 1).addClass('active-slide');
                $('div.hero-container ul.hero-slider > li').eq(oldIndex + 1).removeClass('active-slide')
            }
        });
        $('div.hero-container ul.hero-slider li.active-slider').onmouseover = function() {
            heroSlider.stopAuto()
        };
        $('div.hero-container ul.hero-slider li.active-slider').onmouseout = function() {
            heroSlider.startAuto()
        }
    },
    hoverFade: function() {
        $(".rbct-banner-container").hover(function() {
            $(".rbct-banner-container").not(this).stop().fadeTo(300, 0.4)
        }, function() {
            $(".rbct-banner-container").stop().fadeTo(300, 1)
        })
    },
    videoPlayer: function() {
        window.display_center_1($("#D_Home_VideoContainer"));
        window.show_full_fadeout_1();
        $("#D_Home_VideoContainer").show().removeClass("wcs-hidden");
        player = new YT.Player('player', {
            height: '480',
            width: '854',
            videoId: $(this).data('id'),
            playerVars: {
                rel: 0,
                showinfo: 0
            },
            events: {
                'onReady': rbHomepage.onPlayerReady,
                'onStateChange': rbHomepage.onPlayerStateChange
            }
        });
        $('.rbct-video-reload').on('click', function() {
            player.playVideo();
            $('.rbct-video-reload').removeClass('visible');
            $('.rbct-icon-reload').removeClass('visible')
        });
        $('.wcs-close-btn, .wcs-fadeout-full').on('click', function() {
            if (!done || $('.rbct-video-reload').hasClass('visible')) {
                $('.rbct-video-reload').removeClass('visible');
                $('.rbct-icon-reload').removeClass('visible');
                player.destroy();
                done = !0
            }
        })
    },
    onPlayerReady: function(event) {
        event.target.playVideo();
        done = !1
    },
    onPlayerStateChange: function(event) {
        if (event.data == YT.PlayerState.ENDED && !done) {
            rbHomepage.stopVideo();
            $('.rbct-video-reload').addClass('visible');
            $('.rbct-icon-reload').addClass('visible');
            done = !0
        }
        if (event.data == YT.PlayerState.PLAYING) {
            done = !1
        }
    },
    stopVideo: function() {
        player.stopVideo()
    },
    isOnScreen: function(elem) {
        if (elem.length == 0) {
            return
        }
        var $window = jQuery(window)
        var viewport_top = $window.scrollTop()
        var viewport_height = $window.height()
        var viewport_bottom = viewport_top + viewport_height
        var $elem = jQuery(elem)
        var top = $elem.offset().top
        var height = $elem.height()
        var bottom = top + height
        return (top >= viewport_top && top < viewport_bottom) || (bottom > viewport_top && bottom <= viewport_bottom) || (height > viewport_height && top <= viewport_top && bottom >= viewport_bottom)
    },
    animatedTitle: function() {
        if (rbHomepage.isOnScreen($('#D_Home_Hub_Title .rbct-title'))) {
            $('#D_Home_Hub_Title .rbct-title').addClass('inview')
        }
        if (rbHomepage.isOnScreen($('#D_Home_Recommends_Title .rbct-title'))) {
            $('#D_Home_Recommends_Title .rbct-title').addClass('inview')
        }
    },
    cookieMaxmind: function() {
        if (getCookie('ctryid') !== null) {
            $.cookie("ctryid", '', -1);
            SetCookie("ctryid", '27', 180)
        } else {
            SetCookie("ctryid", '27', 180)
        }
        if (getCookie('ctrypckr') !== null) {
            $.removeCookie('ctrypckr', {
                domain: '.ray-ban.com',
                path: '/'
            });
            $.cookie("ctrypckr", '27', {
                domain: 'ray-ban.com',
                path: '/'
            })
        } else {
            $.cookie("ctrypckr", '27', {
                domain: 'ray-ban.com',
                path: '/'
            })
        }
    },
    repositionItemHPSlider: function() {
        try {
            $('.hero-slider li').each(function(i, e) {
                if ($(e).attr('data-label') && $(e).attr('data-label') == labelLiToMove) {
                    liTMP = e;
                    e.remove();
                    $('.hero-slider').prepend(liTMP)
                }
            })
        } catch (e) {
            console.error('Unknown error : view file HP_CarouselReposition_script')
        }
    },
    init: function() {
        labelLiToMove = 'reloaded';
        /*this.repositionItemHPSlider();*/
        this.heroSlider();
        this.hoverFade();
        var bLazy = new Blazy({
            offset: 50
        });
        if ($('.rbct-video-btn-container').length > 0) {
            var tag = document.createElement('script');
            tag.src = "//www.youtube.com/player_api";
            var firstScriptTag = document.getElementsByTagName('script')[0];
            firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
            $('.rbct-video-btn-container').off("click").on("click", this.videoPlayer)
        }
    }
};
var liTMP;
var labelLiToMove;
$(document).ready(function() {
    rbHomepage.init();
    $(window).scroll(function() {
        rbHomepage.animatedTitle()
    })
})(function(q, m) {
    "function" === typeof define && define.amd ? define(m) : "object" === typeof exports ? module.exports = m() : q.Blazy = m()
})(this, function() {
    function q(b) {
        var c = b._util;
        c.elements = E(b.options);
        c.count = c.elements.length;
        c.destroyed && (c.destroyed = !1, b.options.container && l(b.options.container, function(a) {
            n(a, "scroll", c.validateT)
        }), n(window, "resize", c.saveViewportOffsetT), n(window, "resize", c.validateT), n(window, "scroll", c.validateT));
        m(b)
    }

    function m(b) {
        for (var c = b._util, a = 0; a < c.count; a++) {
            var d = c.elements[a],
                e;
            a: {
                var g = d;
                e = b.options;
                var p = g.getBoundingClientRect();
                if (e.container && y && (g = g.closest(e.containerClass))) {
                    g = g.getBoundingClientRect();
                    e = r(g, f) ? r(p, {
                        top: g.top - e.offset,
                        right: g.right + e.offset,
                        bottom: g.bottom + e.offset,
                        left: g.left - e.offset
                    }) : !1;
                    break a
                }
                e = r(p, f)
            }
            if (e || t(d, b.options.successClass)) b.load(d), c.elements.splice(a, 1), c.count--, a--
        }
        0 === c.count && b.destroy()
    }

    function r(b, c) {
        return b.right >= c.left && b.bottom >= c.top && b.left <= c.right && b.top <= c.bottom
    }

    function z(b, c, a) {
        if (!t(b, a.successClass) && (c || a.loadInvisible || 0 < b.offsetWidth && 0 < b.offsetHeight))
            if (c = b.getAttribute(u) || b.getAttribute(a.src)) {
                c = c.split(a.separator);
                var d = c[A && 1 < c.length ? 1 : 0],
                    e = b.getAttribute(a.srcset),
                    g = "img" === b.nodeName.toLowerCase(),
                    p = (c = b.parentNode) && "picture" === c.nodeName.toLowerCase();
                if (g || void 0 === b.src) {
                    var h = new Image,
                        w = function() {
                            a.error && a.error(b, "invalid");
                            v(b, a.errorClass);
                            k(h, "error", w);
                            k(h, "load", f)
                        },
                        f = function() {
                            g ? p || B(b, d, e) : b.style.backgroundImage = 'url("' + d + '")';
                            x(b, a);
                            k(h, "load", f);
                            k(h, "error", w)
                        };
                    p && (h = b, l(c.getElementsByTagName("source"), function(b) {
                        var c = a.srcset,
                            e = b.getAttribute(c);
                        e && (b.setAttribute("srcset", e), b.removeAttribute(c))
                    }));
                    n(h, "error", w);
                    n(h, "load", f);
                    B(h, d, e)
                } else b.src = d, x(b, a)
            } else "video" === b.nodeName.toLowerCase() ? (l(b.getElementsByTagName("source"), function(b) {
                var c = a.src,
                    e = b.getAttribute(c);
                e && (b.setAttribute("src", e), b.removeAttribute(c))
            }), b.load(), x(b, a)) : (a.error && a.error(b, "missing"), v(b, a.errorClass))
    }

    function x(b, c) {
        v(b, c.successClass);
        c.success && c.success(b);
        b.removeAttribute(c.src);
        b.removeAttribute(c.srcset);
        l(c.breakpoints, function(a) {
            b.removeAttribute(a.src)
        })
    }

    function B(b, c, a) {
        a && b.setAttribute("srcset", a);
        b.src = c
    }

    function t(b, c) {
        return -1 !== (" " + b.className + " ").indexOf(" " + c + " ")
    }

    function v(b, c) {
        t(b, c) || (b.className += " " + c)
    }

    function E(b) {
        var c = [];
        b = b.root.querySelectorAll(b.selector);
        for (var a = b.length; a--; c.unshift(b[a]));
        return c
    }

    function C(b) {
        f.bottom = (window.innerHeight || document.documentElement.clientHeight) + b;
        f.right = (window.innerWidth || document.documentElement.clientWidth) + b
    }

    function n(b, c, a) {
        b.attachEvent ? b.attachEvent && b.attachEvent("on" + c, a) : b.addEventListener(c, a, {
            capture: !1,
            passive: !0
        })
    }

    function k(b, c, a) {
        b.detachEvent ? b.detachEvent && b.detachEvent("on" + c, a) : b.removeEventListener(c, a, {
            capture: !1,
            passive: !0
        })
    }

    function l(b, c) {
        if (b && c)
            for (var a = b.length, d = 0; d < a && !1 !== c(b[d], d); d++);
    }

    function D(b, c, a) {
        var d = 0;
        return function() {
            var e = +new Date;
            e - d < c || (d = e, b.apply(a, arguments))
        }
    }
    var u, f, A, y;
    return function(b) {
        if (!document.querySelectorAll) {
            var c = document.createStyleSheet();
            document.querySelectorAll = function(a, b, d, h, f) {
                f = document.all;
                b = [];
                a = a.replace(/\[for\b/gi, "[htmlFor").split(",");
                for (d = a.length; d--;) {
                    c.addRule(a[d], "k:v");
                    for (h = f.length; h--;) f[h].currentStyle.k && b.push(f[h]);
                    c.removeRule(0)
                }
                return b
            }
        }
        var a = this,
            d = a._util = {};
        d.elements = [];
        d.destroyed = !0;
        a.options = b || {};
        a.options.error = a.options.error || !1;
        a.options.offset = a.options.offset || 100;
        a.options.root = a.options.root || document;
        a.options.success = a.options.success || !1;
        a.options.selector = a.options.selector || ".b-lazy";
        a.options.separator = a.options.separator || "|";
        a.options.containerClass = a.options.container;
        a.options.container = a.options.containerClass ? document.querySelectorAll(a.options.containerClass) : !1;
        a.options.errorClass = a.options.errorClass || "b-error";
        a.options.breakpoints = a.options.breakpoints || !1;
        a.options.loadInvisible = a.options.loadInvisible || !1;
        a.options.successClass = a.options.successClass || "b-loaded";
        a.options.validateDelay = a.options.validateDelay || 25;
        a.options.saveViewportOffsetDelay = a.options.saveViewportOffsetDelay || 50;
        a.options.srcset = a.options.srcset || "data-srcset";
        a.options.src = u = a.options.src || "data-src";
        y = Element.prototype.closest;
        A = 1 < window.devicePixelRatio;
        f = {};
        f.top = 0 - a.options.offset;
        f.left = 0 - a.options.offset;
        a.revalidate = function() {
            q(a)
        };
        a.load = function(a, b) {
            var c = this.options;
            void 0 === a.length ? z(a, b, c) : l(a, function(a) {
                z(a, b, c)
            })
        };
        a.destroy = function() {
            var a = this._util;
            this.options.container && l(this.options.container, function(b) {
                k(b, "scroll", a.validateT)
            });
            k(window, "scroll", a.validateT);
            k(window, "resize", a.validateT);
            k(window, "resize", a.saveViewportOffsetT);
            a.count = 0;
            a.elements.length = 0;
            a.destroyed = !0
        };
        d.validateT = D(function() {
            m(a)
        }, a.options.validateDelay, a);
        d.saveViewportOffsetT = D(function() {
            C(a.options.offset)
        }, a.options.saveViewportOffsetDelay, a);
        C(a.options.offset);
        l(a.options.breakpoints, function(a) {
            if (a.width >= window.screen.width) return u = a.src, !1
        });
        setTimeout(function() {
            q(a)
        })
    }
});
var player;
var done = !1;
var rbHomepage = {
    heroSlider: function() {
        var heroSlider = $('div.hero-container ul.hero-slider');
        $(heroSlider).bxSlider({
            auto: !0,
            nextSelector: '#hero-next',
            prevSelector: '#hero-prev',
            nextText: '<i class="fa fa-angle-right hero-next" aria-hidden="true"></i>',
            prevText: '<i class="fa fa-angle-left hero-prev" aria-hidden="true"></i>',
            slideMargin: 5,
            slideWidth: 960,
            autoHover: !0,
            onSliderLoad: function(currentIndex) {
                $('div.hero-container').removeClass('loading');
                $('div.hero-container ul.hero-slider > li.bx-clone').removeClass('active-slide');
                $('div.hero-container ul.hero-slider > li').eq(currentIndex + 1).addClass('active-slide')
            },
            onSlideAfter: function($slideElement, oldIndex, newIndex) {
                $('div.hero-container ul.hero-slider > li').eq(newIndex + 1).addClass('active-slide');
                $('div.hero-container ul.hero-slider > li').eq(oldIndex + 1).removeClass('active-slide')
            }
        });
        $('div.hero-container ul.hero-slider li.active-slider').onmouseover = function() {
            heroSlider.stopAuto()
        };
        $('div.hero-container ul.hero-slider li.active-slider').onmouseout = function() {
            heroSlider.startAuto()
        }
    },
    hoverFade: function() {
        $(".rbct-banner-container").hover(function() {
            $(".rbct-banner-container").not(this).stop().fadeTo(300, 0.4)
        }, function() {
            $(".rbct-banner-container").stop().fadeTo(300, 1)
        })
    },
    videoPlayer: function() {
        window.display_center_1($("#D_Home_VideoContainer"));
        window.show_full_fadeout_1();
        $("#D_Home_VideoContainer").show().removeClass("wcs-hidden");
        player = new YT.Player('player', {
            height: '480',
            width: '854',
            videoId: $(this).data('id'),
            playerVars: {
                rel: 0,
                showinfo: 0
            },
            events: {
                'onReady': rbHomepage.onPlayerReady,
                'onStateChange': rbHomepage.onPlayerStateChange
            }
        });
        $('.rbct-video-reload').on('click', function() {
            player.playVideo();
            $('.rbct-video-reload').removeClass('visible');
            $('.rbct-icon-reload').removeClass('visible')
        });
        $('.wcs-close-btn, .wcs-fadeout-full').on('click', function() {
            if (!done || $('.rbct-video-reload').hasClass('visible')) {
                $('.rbct-video-reload').removeClass('visible');
                $('.rbct-icon-reload').removeClass('visible');
                player.destroy();
                done = !0
            }
        })
    },
    onPlayerReady: function(event) {
        event.target.playVideo();
        done = !1
    },
    onPlayerStateChange: function(event) {
        if (event.data == YT.PlayerState.ENDED && !done) {
            rbHomepage.stopVideo();
            $('.rbct-video-reload').addClass('visible');
            $('.rbct-icon-reload').addClass('visible');
            done = !0
        }
        if (event.data == YT.PlayerState.PLAYING) {
            done = !1
        }
    },
    stopVideo: function() {
        player.stopVideo()
    },
    isOnScreen: function(elem) {
        if (elem.length == 0) {
            return
        }
        var $window = jQuery(window)
        var viewport_top = $window.scrollTop()
        var viewport_height = $window.height()
        var viewport_bottom = viewport_top + viewport_height
        var $elem = jQuery(elem)
        var top = $elem.offset().top
        var height = $elem.height()
        var bottom = top + height
        return (top >= viewport_top && top < viewport_bottom) || (bottom > viewport_top && bottom <= viewport_bottom) || (height > viewport_height && top <= viewport_top && bottom >= viewport_bottom)
    },
    animatedTitle: function() {
        if (rbHomepage.isOnScreen($('#D_Home_Hub_Title .rbct-title'))) {
            $('#D_Home_Hub_Title .rbct-title').addClass('inview')
        }
        if (rbHomepage.isOnScreen($('#D_Home_Recommends_Title .rbct-title'))) {
            $('#D_Home_Recommends_Title .rbct-title').addClass('inview')
        }
    },
    cookieMaxmind: function() {
        if (getCookie('ctryid') !== null) {
            $.cookie("ctryid", '', -1);
            SetCookie("ctryid", '27', 180)
        } else {
            SetCookie("ctryid", '27', 180)
        }
        if (getCookie('ctrypckr') !== null) {
            $.removeCookie('ctrypckr', {
                domain: '.ray-ban.com',
                path: '/'
            });
            $.cookie("ctrypckr", '27', {
                domain: 'ray-ban.com',
                path: '/'
            })
        } else {
            $.cookie("ctrypckr", '27', {
                domain: 'ray-ban.com',
                path: '/'
            })
        }
    },
    repositionItemHPSlider: function() {
        try {
            $('.hero-slider li').each(function(i, e) {
                if ($(e).attr('data-label') && $(e).attr('data-label') == labelLiToMove) {
                    liTMP = e;
                    e.remove();
                    $('.hero-slider').prepend(liTMP)
                }
            })
        } catch (e) {
            console.error('Unknown error : view file HP_CarouselReposition_script')
        }
    },
    init: function() {
        labelLiToMove = 'reloaded';
        /*this.repositionItemHPSlider();*/
        this.heroSlider();
        this.hoverFade();
        var bLazy = new Blazy({
            offset: 50
        });
        if ($('.rbct-video-btn-container').length > 0) {
            var tag = document.createElement('script');
            tag.src = "//www.youtube.com/player_api";
            var firstScriptTag = document.getElementsByTagName('script')[0];
            firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
            $('.rbct-video-btn-container').off("click").on("click", this.videoPlayer)
        }
    }
};
var liTMP;
var labelLiToMove;
$(document).ready(function() {
    rbHomepage.init();
    $(window).scroll(function() {
        rbHomepage.animatedTitle()
    })
})