
TimerBuffOptionsFrameSliders = { };
TimerBuffOptionsFrameSliders [TIMERBUFFOPTIONS_SLIDER1.name] = { index = 1, TimerBuffVar = "Mode", minValue = 1, maxValue = 3, valueStep = 1, minText=TIMERBUFFOPTIONS_SLIDER1.minText, maxText=TIMERBUFFOPTIONS_SLIDER1.maxText, tooltipText = TIMERBUFFOPTIONS_SLIDER1.tooltipText};

function TimerBuffOptions_OnLoad()
	UIPanelWindows["TimerBuffOptionsFrame"] = {area = "center", pushable = 0};
end

function TimerBuffOptions_OnShow()
	local slider, string, low, high, getvalue
	for key, value in TimerBuffOptionsFrameSliders do
		slider = getglobal("TimerBuffOptionsFrame_Slider"..value.index);
		string = getglobal("TimerBuffOptionsFrame_Slider"..value.index.."Text");
		low = getglobal("TimerBuffOptionsFrame_Slider"..value.index.."Low");
		high = getglobal("TimerBuffOptionsFrame_Slider"..value.index.."High");
		getvalue = TimerBuff_Get(value.TimerBuffVar);
		OptionsFrame_EnableSlider(slider);
		slider:SetMinMaxValues(value.minValue, value.maxValue);
		slider:SetValueStep(value.valueStep);
		slider:SetValue(getvalue);
		string:SetText(key);
		low:SetText(value.minText);
		high:SetText(value.maxText);
		slider.tooltipText = value.tooltipText;
	end
end

function TimerBuffOptions_SliderOnValueChanged()
	local slider;
	for key, value in TimerBuffOptionsFrameSliders do
		if (this:GetName() == "TimerBuffOptionsFrame_Slider"..value.index) then
			--slider = getglobal("TimerBuffOptionsFrame_CheckButton"..value.index);
			if ( value.TimerBuffVar ) then
				TimerBuff_Set(value.TimerBuffVar,this:GetValue());
			end
		end
	end
end

function TimerBuffOptions_OnHide()
 	if (MYADDONS_ACTIVE_OPTIONSFRAME == this) then
		ShowUIPanel(myAddOnsFrame);
	end
end
