(function($) {
    function glozinIsVisible(el) {
        if (el instanceof jQuery) {
            el = el[0];
        }

        if (!el) {
            return false;
        }

        var rect = el.getBoundingClientRect();

        return (
            rect.bottom > 0 &&
            rect.right > 0 &&
            rect.left < (window.innerWidth || document.documentElement.clientWidth) &&
            rect.top < (window.innerHeight || document.documentElement.clientHeight)
        );
    }
    window.glozinIsVisible = glozinIsVisible;
})(jQuery);