var zoominVideoImage = zoominVideoImage || [];
(function(w) {
    if (typeof w.zoominJSVideoControl === 'undefined' || w.zoominJSVideoControl === 'initiated') {
        if (typeof jQuery === 'undefined') {
            setTimeout(function() {
                var e = document.createElement('script');
                e.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js';
                e.async = true;
                (document.getElementsByTagName('head')[0]).appendChild(e);
            }, 5);
        }
        if (typeof w.zoominJsTimer === 'undefined') {
            var nrTries = 0;
            var hasJQ = setInterval(function() {
                if (typeof jQuery !== 'undefined') {
                    w.zoominJsTimer = setTimeout(function() {
                        var s = document.createElement('link');
                        s.href = 'http://blackbird.zoomin.tv/FloatingPlayers/css/zoomin_floating_player.css';
                        s.rel = 'stylesheet';
                        (document.getElementsByTagName('head')[0]).appendChild(s);

                        var e = document.createElement('script');
                        e.src = 'http://blackbird.zoomin.tv/FloatingPlayers/float_conteneonetworkesdp.js';
                        e.async = true;
                        (document.getElementsByTagName('head')[0]).appendChild(e);
                    }, 5);
                    clearInterval(hasJQ);
                } else {
                    nrTries++;
                    if (nrTries === 100) {
                        clearInterval(hasJQ);
                    }
                }
            }, 50);
        }
        w.zoominJSVideoControl = 'loaded';
    }
})(window);

