LBP.Media.Fansub = new Hash({
    presets: {},
    initialize: function() {
        this.presets = $merge(this.presets,LBP.Media.presets);
    },
    
    runOnce: function() {
        if(window.retrieve('processThroughMedia')) return;
        window.store('processThroughMedia', true);
        LBP.Media.setUpError();
        this.rating = new LBP.Rating();
    },
    
    runEachTime: function() {
        var searchControl = new LBP.Media.Search();
        try {
        if(!$('mport-home-browse').retrieve('hasMenu')) {
            var mportHome = new LBP.MenuDropdown({ relativeTo: 'mport-home-browse', subItemHeight: 15, subItemMargin: 3, subMargin: 0 });
            mportHome.assign($$('a.mport-home-icon'));
            $('mport-home-browse').store('hasMenu', true);
        }
        }catch(e) {}
        LBP.Media.setGlobal();
        $$('[a[caller!=]').each(function(linkObj) {
            LBP.Media.Links.assign(linkObj);
        });
//        var browseScroller = new LBP.Scroller({ containerId: 'mport-cnt-browse', contentId: 'mport-items-browse', mode: 'vertical', noOverflow: true, fade: false });
        //var seriesScroller = new LBP.Scroller({ containerId: 'mport-cnt-series', contentId: 'mport-items-series', mode: 'vertical', noOverflow: true, fade: false });        
        //var favoriteScroller = new LBP.Scroller({ containerId: 'mport-cnt-favorite', contentId: 'mport-items-favorite', mode: 'vertical', noOverflow: true, fade: false });
        $$('.menu-tab').each(function(menutab){
            if(!menutab.retrieve('hasTabProcessed')){
                var mytab = new LBP.Media.Tab(menutab,{
                    mode: menutab.get('mode'), headerCss: 'tab-item', contentCss: 'tab-content', overlayCss: 'tab-overlay', currentCss:'tab-current', markers: { url: 'href', caller: 'content'}, collapse: 'closebtn' });
                menutab.store('hasTabProcessed', true);
                menutab.removeProperty('mode');
            }
        }.bind(this));
        $$('div.rate-inactive').each(function(obj){
            this.rating.assign(obj,{ active: false});
        }.bind(this));
        $$('div.rate-active').each(function(obj){
            this.rating.assign(obj,{ active: true});
        }.bind(this));
    }
});