/**
 * genre Javascript
 * 
 * @author: Chanel Munezero <chanel.munezero@escapemg.com>
 */
(function(){
    if(!window.gs) {
        return;
    }
    
    var genres = window.gs.genres = {
        // default options/settings
        empty: null
    };
    
    genres.init = function(pid, gid)
    {
        pid = pid || 0;
        gid = gid || 0;
        // create modal box
        var options = {
            ajax: '/genre.php?pid='+pid+'&gid='+gid,
            onHide: function(hash) {
                gs.widget.showPreviews();
                gs.modal_hide(hash);
            },
            onShow: function(hash) {
                gs.widget.hidePreviews();
                gs.modal_show(hash);
                setTimeout(function() {
                    $('#genreSubmit').css('opacity', 0.5);
                }, 500);
            }
        };
        var divinfo = {
            newid: 'genreBox',
            newclass: 'results'
        };
        gs.lbFactory.newModalBox(options, divinfo, true);
    };
    
    genres.hideForm = function()
    {
        gs.lbFactory.disposeModalBox($("#genreBox"));
    }
    
})();