

var FRiBarMasterBootstrapper = (function(FRConfigurationMaster, document) {

    function loadStyle(url){
        var link = document.createElement('link');
        link.type = 'text/css';
        link.rel = 'stylesheet';
        link.onload = function(){};
        link.href = url;
        document.getElementsByTagName('head')[0].appendChild(link);
    }
    
    function loadScript(url, callback){
        if(!url || !(typeof url === 'string')){return};
        var script = document.createElement('script');

        if(typeof document.attachEvent === 'object'){
            script.onreadystatechange = function(){
                if (script.readyState === 'loaded' || script.readyState === 'complete'){
                    if (callback) {callback();}
                };
            };  
        } else {
            script.onload = function(){if (callback) {callback();};};
        };

        script.src = url;
        script.type = 'text/javascript';
        document.getElementsByTagName('head')[0].appendChild(script);
    }
    
    function init(){

        loadStyle(FRConfigurationMaster.FrontiersJournalAPIUrl + '/bundles/frontiers-iBar-css?v=' + 1413732217679);

        loadScript(FRConfigurationMaster.FrontiersJournalAPIUrl + '/bundles/frontiers-iBar-js?v=' + 1413732217679, function(){

            FRiBar.init(1413732217679);
        });
    }
    
    setTimeout(function() {
        init();
    }, 0);


})(FRConfigurationMaster, document);