function SliderOnOffPGA(RegSlider, RegText, data, type)

if type == 1
%     col = [1 0.3 0.3];
    col = [0.8500 0.3250 0.0980];
else
    set(RegSlider(8), 'Enable', 'On');
    set(RegText(28), 'Enable', 'On');
    
    if (isfield(data, 'noc') == 0) || (data.noc > 0)
        set(RegSlider(9), 'Enable', 'On');
        set(RegText(29), 'Enable', 'On');
    end
    
    col = [1 1 1];
    
    for i=8:9
        set(RegSlider(i), 'BackgroundColor',col);
        set(RegText(20+i), 'BackgroundColor',col);
    end
end

for i=4:7
    set(RegSlider(i), 'BackgroundColor',col);
    set(RegText(20+i), 'BackgroundColor',col);
end

if type == 1
    if (isfield(data, 'isgivenspec') == 0) || (data.isgivenspec == 0)
        set(RegSlider(8), 'Enable', 'Off');
        set(RegText(28), 'Enable', 'Off');
    else
        set(RegSlider(8), 'BackgroundColor',col);
        set(RegText(28), 'BackgroundColor',col);
    end
    if (isfield(data, 'noc') == 0) || (data.noc == 0)
        set(RegSlider(9), 'Enable', 'Off');
        set(RegText(29), 'Enable', 'Off');
    else
        set(RegSlider(9), 'BackgroundColor',col);
        set(RegText(29), 'BackgroundColor',col);
    end
end
