local LSM = HealBot_Libs_LSM()
local HealBot_Options_ComboButtons_Modifier=1
local HealBot_Options_SkinsComboButtons_Modifier=1
local HealBot_buffbarcolr = {};
local HealBot_buffbarcolg = {};
local HealBot_buffbarcolb = {};
local HealBot_DebuffWatchTarget={}
local HealBot_BuffWatchTarget={}
local BuffTextClass=nil
local DoneInitTab={}
local hb_textures=nil
local texturesIndex={}
local fonts=nil
local fontsIndex={}
local sounds=nil
local soundsIndex={}
local ClickedBuffGroupDD=nil
local hbCurSkin=""
local hbCurSkinSubFrameID=1001
local _,g
local HealBot_DebuffSpell = {};
local customDebuffPriority=HEALBOT_CUSTOM_en.."15"
local customBuffPriority=HEALBOT_CUSTOM_en.."Buff"

local HealBot_Options_TabRunOnce={}
local HealBot_CDebuffCasyBy_List={}
local HealBot_CDebuffCasyBy_Indexed_List={}
local HealBot_Buff_WeaponEnchant_List={[1]={},[2]={}}
local HealBot_Options_AggroAlertLevel_List={}
local HealBot_Options_AuxAssign_List={}
local HealBot_Options_AuxOverlap_List={}
local HealBot_Options_AuxBarColours_List={}
local HealBot_Options_AuxBarOpacityType_List={}
local HealBot_Options_AuxBarAnchor_List={}
local HealBot_Options_AuxBarAnchor_ShortList={}
local HealBot_Options_Class_HoTctlAction_List={}
local HealBot_Options_Class_HoTctlIDMethod_List={}
local HealBot_Options_UseOverrideFocusGroups_List={}
local HealBot_Options_FilterHoTctl_List = {
        HEALBOT_CLASSES_ALL,
        HEALBOT_DEATHKNIGHT,
        HEALBOT_DEMONHUNTER,
        HEALBOT_DRUID,
        HEALBOT_EVOKER,
        HEALBOT_PALADIN,
        HEALBOT_MONK,
        HEALBOT_PRIEST,
        HEALBOT_SHAMAN,
        HEALBOT_WARRIOR,
        HEALBOT_HUNTER,
        HEALBOT_MAGE,
        HEALBOT_ROGUE,
        HEALBOT_WARLOCK,
    }
local HealBot_Options_ManaIndicator_List={}
local HealBot_Options_BarsGrowDirection_List={}
local HealBot_Options_BarsOrientation_List={}
local HealBot_Options_ActionAnchor_List={}
local HealBot_Options_ActionLocked_List={}
local HealBot_Options_ActionBarsCombo_List={}
local HealBot_Options_UseOverrides_List={}
local HealBot_Options_Sort_List={}
local HealBot_Options_EmergencyFClass_List={}
local HealBot_Options_hbCommands_List={}
local HealBot_Options_hbProfile_List={}
local HealBot_Options_hbLangs_List={}
local HealBot_Options_TooltipFontSize_List={}
local HealBot_Options_EmoteCat_List={}
local HealBot_Options_EmoteCombat_List={}
local HealBot_Options_EmoteEmotion_List={}
local HealBot_Options_EmoteHappy_List={}
local HealBot_Options_EmoteGreet_List={}
local HealBot_Options_EmoteOther_List={}
local HealBot_Options_EmoteRespect_List={}
local HealBot_Options_EmoteUnhappy_List={}
local HealBot_Options_ExtraSkinsCat_List={}
local HealBot_Options_TestBarsProfile_List={}
local HealBot_Options_ButtonCastMethod_List={}
local HealBot_Options_BarHealthType_List={}
local HealBot_Options_BarHealthAnchor_List={}
local HealBot_Options_AbsorbColour_List={}
local HealBot_Options_BarIncHealColour_List={}
local HealBot_Options_BarHealthColour_List={}
local HealBot_Options_EnemyOOC_List={}
local HealBot_Options_EnemyCombat_List={}
local HealBot_Options_BarHealthIncHeal_List={}
local HealBot_Options_BarHealthIncAbsorb_List={}
local HealBot_Options_BarHealthOverHeal_List={}
local HealBot_Options_FontOutline_List={}
local HealBot_Options_BuffTxt_List={}
local HealBot_Options_HealGroupsFrame_List={}
local HealBot_Options_TargetFocusInCombat_List={}
local HealBot_Options_NoDuplcates={}
local HealBot_Options_Lists={}
local hbOptionsTooltip = CreateFrame("GameTooltip", "hbOptionsTooltip", nil, "GameTooltipTemplate")
local HealBot_ComboKeys_List = {"","Shift","Ctrl","Alt","Alt-Shift","Ctrl-Shift","Alt-Ctrl","Alt-Ctrl-Shift"}
local HealBot_Options_BindsKeyList={}
local HealBot_Options_BindsKeyListRead={}
HealBot_Options_BindsKeyList[1]=""
HealBot_Options_BindsKeyList[2]="MOUSEWHEELUP"
HealBot_Options_BindsKeyList[3]="MOUSEWHEELDOWN"
HealBot_Options_BindsKeyListRead[1]=HEALBOT_WORDS_NONE
HealBot_Options_BindsKeyListRead[2]="Mouse Wheel Up"
HealBot_Options_BindsKeyListRead[3]="Mouse Wheel Down"
for x=0,9 do
    HealBot_Options_BindsKeyList[x+4]=""..x
    HealBot_Options_BindsKeyListRead[x+4]=""..x
end
for x=0,9 do
    HealBot_Options_BindsKeyList[x+14]="NUMPAD"..x
    HealBot_Options_BindsKeyListRead[x+14]="NumPad "..x
end
for x=65,90 do
    HealBot_Options_BindsKeyList[x-41]=string.char(x)
    HealBot_Options_BindsKeyListRead[x-41]=string.char(x)
end
HealBot_Options_BindsKeyList[50]="INSERT"
HealBot_Options_BindsKeyList[51]="DELETE"
HealBot_Options_BindsKeyList[52]="HOME"
HealBot_Options_BindsKeyList[53]="END"
HealBot_Options_BindsKeyList[54]="PAGEUP"
HealBot_Options_BindsKeyList[55]="PAGEDOWN"
HealBot_Options_BindsKeyList[56]="UP"
HealBot_Options_BindsKeyList[57]="LEFT"
HealBot_Options_BindsKeyList[58]="DOWN"
HealBot_Options_BindsKeyList[59]="RIGHT"
HealBot_Options_BindsKeyListRead[50]="Insert"
HealBot_Options_BindsKeyListRead[51]="Delete"
HealBot_Options_BindsKeyListRead[52]="Home"
HealBot_Options_BindsKeyListRead[53]="End"
HealBot_Options_BindsKeyListRead[54]="Page Up"
HealBot_Options_BindsKeyListRead[55]="Page Down"
HealBot_Options_BindsKeyListRead[56]="Up Arrow"
HealBot_Options_BindsKeyListRead[57]="Left Arrow"
HealBot_Options_BindsKeyListRead[58]="Down Arrow"
HealBot_Options_BindsKeyListRead[59]="Right Arrow"
function HealBot_Options_retBindKey(id)
    return HealBot_Options_BindsKeyList[id]
end

function HealBot_Options_retBindLists()
    return HealBot_Options_BindsKeyList, HealBot_Options_BindsKeyListRead
end

local OptionThemes={[1]={["egdeFile"]="Interface\\DialogFrame\\UI-DialogBox-Gold-Border", ["egdeSize"]=18,
                         ["TitleBox"]="Interface\\DialogFrame\\UI-DialogBox-Gold-Header",
                         ["R"]=1,["G"]=0.82,["B"]=0,["A"]=0.9,["Classic"]=true},
                    [2]={["egdeFile"]="Interface\\DialogFrame\\UI-DialogBox-Border", ["egdeSize"]=18,
                         ["TitleBox"]="Interface\\DialogFrame\\UI-DialogBox-Header",
                         ["R"]=0.84,["G"]=0.84,["B"]=0.84,["A"]=0.95,["Classic"]=true},
                    [3]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WORD_AQUA
                         ["TitleBox"]="",
                         ["R"]=0.32,["G"]=1,["B"]=1,["A"]=0.98,["Classic"]=false},
                    [4]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WORD_BLUE
                         ["TitleBox"]="",
                         ["R"]=0.15,["G"]=0.4,["B"]=1,["A"]=1,["Classic"]=false},
                    [5]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WORD_DARK
                         ["TitleBox"]="",
                         ["R"]=0.4,["G"]=0.4,["B"]=0.4,["A"]=1,["Classic"]=false},
                    [6]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WORD_FUCHSIA
                         ["TitleBox"]="",
                         ["R"]=1,["G"]=0.4,["B"]=0.8,["A"]=1,["Classic"]=false},
                    [7]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WORD_GREEN
                         ["TitleBox"]="",
                         ["R"]=0.05,["G"]=0.7,["B"]=0.1,["A"]=1,["Classic"]=false},
                    [8]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WORD_LIME
                         ["TitleBox"]="",
                         ["R"]=0.2,["G"]=1,["B"]=0.2,["A"]=1,["Classic"]=false},
                    [9]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WORD_ORANGE
                         ["TitleBox"]="",
                         ["R"]=1,["G"]=0.58,["B"]=0,["A"]=1,["Classic"]=false},
                   [10]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WORD_PURPLE
                         ["TitleBox"]="",
                         ["R"]=0.8,["G"]=0,["B"]=0.8,["A"]=1,["Classic"]=false},
                   [11]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WORD_RED
                         ["TitleBox"]="",
                         ["R"]=1,["G"]=0.1,["B"]=0.1,["A"]=1,["Classic"]=false},
                   [12]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --  HEALBOT_WORD_TEAL
                         ["TitleBox"]="",
                         ["R"]=0.02,["G"]=0.58,["B"]=0.58,["A"]=1,["Classic"]=false},
                   [13]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WORD_WHITE
                         ["TitleBox"]="",
                         ["R"]=1,["G"]=1,["B"]=1,["A"]=1,["Classic"]=false}, 
                   [14]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WORD_YELLOW
                         ["TitleBox"]="",
                         ["R"]=1,["G"]=1,["B"]=0,["A"]=1,["Classic"]=false},
                   [15]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_DEATHKNIGHT
                         ["TitleBox"]="",
                         ["R"]=0.77,["G"]=0.12,["B"]=0.23,["A"]=1,["Classic"]=false},
                   [16]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_DEMONHUNTER
                         ["TitleBox"]="",
                         ["R"]=0.64,["G"]=0.19,["B"]=0.79,["A"]=1,["Classic"]=false},
                   [17]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_DRUID
                         ["TitleBox"]="",
                         ["R"]=1,["G"]=0.49,["B"]=0.04,["A"]=1,["Classic"]=false},
                   [18]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_HUNTER
                         ["TitleBox"]="",
                         ["R"]=0.67,["G"]=0.83,["B"]=0.45,["A"]=1,["Classic"]=false},
                   [19]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_MAGE
                         ["TitleBox"]="",
                         ["R"]=0.25,["G"]=0.78,["B"]=0.92,["A"]=1,["Classic"]=false},
                   [20]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_MONK
                         ["TitleBox"]="",
                         ["R"]=0,["G"]=1,["B"]=0.59,["A"]=1,["Classic"]=false},
                   [21]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_PALADIN
                         ["TitleBox"]="",
                         ["R"]=0.96,["G"]=0.55,["B"]=0.73,["A"]=1,["Classic"]=false},
                   [22]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_PRIEST
                         ["TitleBox"]="",
                         ["R"]=1,["G"]=1,["B"]=1,["A"]=1,["Classic"]=false},
                   [23]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_ROGUE
                         ["TitleBox"]="",
                         ["R"]=1,["G"]=0.96,["B"]=0.41,["A"]=1,["Classic"]=false},
                   [24]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_SHAMAN
                         ["TitleBox"]="",
                         ["R"]=0,["G"]=0.44,["B"]=0.87,["A"]=1,["Classic"]=false},
                   [25]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WARLOCK
                         ["TitleBox"]="",
                         ["R"]=0.53,["G"]=0.53,["B"]=0.93,["A"]=1,["Classic"]=false},
                   [26]={["egdeFile"]="Interface\\Tooltips\\UI-Tooltip-Border", ["egdeSize"]=22, --    HEALBOT_WARRIOR
                         ["TitleBox"]="",
                         ["R"]=0.78,["G"]=0.61,["B"]=0.43,["A"]=1,["Classic"]=false},
                    }

if not HealBot_Globals.OptionsTheme then HealBot_Globals.OptionsTheme=1 end

local HealBot_Options_luVars={}
HealBot_Options_luVars["FramesSelFrame"]=1
HealBot_Options_luVars["customDebuffPriority"]=15
HealBot_Options_luVars["OptionsOpacityAdj"]=0.35
HealBot_Options_luVars["ModKeyShift"]=false
HealBot_Options_luVars["ModKeyCtrl"]=false
HealBot_Options_luVars["ModKeyAlt"]=false
HealBot_Options_luVars["AuxBar"]=1
HealBot_Options_luVars["AuxTxtBar"]=1
HealBot_Options_luVars["cSkin"]=""
HealBot_Options_luVars["HeaderSwitchNumColsHdrOn"]=0
HealBot_Options_luVars["HeaderSwitchNumColsHdrOff"]=0
HealBot_Options_luVars["TestBarsOn"]=false
HealBot_Options_luVars["mapName"]=""
HealBot_Options_luVars["SpellsTabOpenWarnId"]=0
HealBot_Options_luVars["HoTlvl"]=0
HealBot_Options_luVars["CDClvl"]=0
HealBot_Options_luVars["BuffIconSet"]=1
HealBot_Options_luVars["DebuffIconSet"]=1

function HealBot_Options_setLuVars(vName, vValue)
    HealBot_Options_luVars[vName]=vValue
      --HealBot_setCall("HealBot_Options_setLuVars - "..vName)
end

function HealBot_Options_retLuVars(vName)
    return HealBot_Options_luVars[vName]
end

local HealBot_Debuff_Types = {}

local optionsPanel = CreateFrame("Frame")
optionsPanel.name = HEALBOT_HEALBOT
InterfaceOptions_AddCategory(optionsPanel)
local optionsTitle = optionsPanel:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
optionsTitle:SetPoint("TOPLEFT", 16, -16)
optionsTitle:SetText(HEALBOT_HEALBOT)
local optionsText = optionsPanel:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
optionsText:SetPoint("TOPLEFT", optionsTitle, "BOTTOMLEFT", 0, -8)
optionsText:SetText(HEALBOT_ABOUT_DESC1)
local optionsButton = CreateFrame("Button", nil, optionsPanel, "UIPanelButtonTemplate")

HealBot_Options_luVars["InitFontsRerun"]=false
function HealBot_Options_InitFonts(id)
    if id<=#fonts then
        if id==0 then
            HealBot_Options_UpdateMediaIndex()
        else
            local g=_G["UsedToInitFonts"]
            g:SetText("i"..id)
            g:SetFont(LSM:Fetch('font',fonts[id]),10)
        end
        C_Timer.After(0.04, function() HealBot_Options_InitFonts(id+1) end)
    elseif not HealBot_Options_luVars["InitFontsRerun"] then
        HealBot_Timers_UpdateUsedIndex("Fonts")
        HealBot_Options_luVars["InitFontsRerun"]=true
        HealBot_AddDebug("InitFontsRuns Rerun","Load",true)
        C_Timer.After(0.1, function() HealBot_Options_InitFonts(0) end)
    else
        HealBot_AddDebug("InitFontsRuns Complete","Load",true)
        HealBot_Timers_UpdateUsedIndex("Fonts")
    end
end

function HealBot_Options_InitDebuffTypes()
    local hbPURIFICATION_POTION=GetItemInfoInstant(HEALBOT_PURIFICATION_POTION) or "Purification Potion"
    local hbANTI_VENOM=GetItemInfoInstant(HEALBOT_ANTI_VENOM) or "Anti-Venom"
    local hbPOWERFUL_ANTI_VENOM=GetItemInfoInstant(HEALBOT_POWERFUL_ANTI_VENOM) or "Powerful Anti-Venom"
    local hbSTONEFORM=GetSpellInfo(HEALBOT_STONEFORM)
    if HEALBOT_GAME_VERSION<4 then 
        HealBot_Debuff_Types = {
            [HEALBOT_REMOVE_CURSE] = {HEALBOT_CURSE_en},
            [hbPURIFICATION_POTION] = {HEALBOT_CURSE_en, HEALBOT_DISEASE_en, HEALBOT_POISON_en},
            [hbANTI_VENOM] = {HEALBOT_POISON_en},
            [hbPOWERFUL_ANTI_VENOM] = {HEALBOT_POISON_en},
            [hbSTONEFORM] = {HEALBOT_DISEASE_en, HEALBOT_POISON_en},
            [HBC_SHAMAN_CURE_POISON] = {HEALBOT_POISON_en},
            [HBC_DRUID_CURE_POISON] = {HEALBOT_POISON_en},
            [HBC_DRUID_ABOLISH_POISON] = {HEALBOT_POISON_en},
            [HBC_DRUID_REMOVE_CURSE] = {HEALBOT_CURSE_en},
            [HBC_DISPELL_MAGIC] = {HEALBOT_MAGIC_en},
            [HBC_SHAMAN_CURE_DISEASE] = {HEALBOT_DISEASE_en},
            [HBC_PRIEST_CURE_DISEASE] = {HEALBOT_DISEASE_en},
            [HBC_PRIEST_ABOLISH_DISEASE] = {HEALBOT_DISEASE_en},
            [HEALBOT_CLEANSE_SPIRIT] = {HEALBOT_CURSE_en, HEALBOT_DISEASE_en, HEALBOT_POISON_en},
        }

        if UnitLevel("player")<41 then
            HealBot_Debuff_Types[HEALBOT_CLEANSE] = {HEALBOT_DISEASE_en, HEALBOT_POISON_en, HEALBOT_MAGIC_en}
            HealBot_Debuff_Types[HBC_PURIFY] =  {HEALBOT_POISON_en, HEALBOT_DISEASE_en}
        else
            HealBot_Debuff_Types[HBC_PURIFY] =  {HEALBOT_POISON_en, HEALBOT_DISEASE_en}
            HealBot_Debuff_Types[HEALBOT_CLEANSE] = {HEALBOT_DISEASE_en, HEALBOT_POISON_en, HEALBOT_MAGIC_en}
        end
        HealBot_Options_luVars["HEALBOT_LAY_ON_HANDS"]=GetSpellInfo(HEALBOT_LAY_ON_HANDS)
    else
        local hbELIXIR_OF_POISON_RES=GetItemInfoInstant(HEALBOT_ELIXIR_OF_POISON_RES) or "Potion of Curing"
        local hbPOTION_OF_SOUL_PURITY=GetItemInfoInstant(HEALBOT_POTION_OF_SOUL_PURITY) or "Potion of Soul Purity"
        local hbPHIAL_OF_SERENITY=GetItemInfoInstant(HEALBOT_PHIAL_OF_SERENITY) or "Phial of Serenity"
        HealBot_Debuff_Types = {
            [HEALBOT_CLEANSE] = {HEALBOT_MAGIC_en},
            [HEALBOT_REMOVE_CURSE] = {HEALBOT_CURSE_en},
            [HEALBOT_REMOVE_CORRUPTION] = {HEALBOT_CURSE_en, HEALBOT_POISON_en},
            [HEALBOT_NATURES_CURE] = {HEALBOT_MAGIC_en, HEALBOT_CURSE_en, HEALBOT_POISON_en},
            [HEALBOT_PURIFY_DISEASE] = {HEALBOT_DISEASE_en},
            [HEALBOT_PURIFY] = {HEALBOT_MAGIC_en},
            [hbPURIFICATION_POTION] = {HEALBOT_CURSE_en, HEALBOT_DISEASE_en, HEALBOT_POISON_en},
            [hbANTI_VENOM] = {HEALBOT_POISON_en},
            [hbPOWERFUL_ANTI_VENOM] = {HEALBOT_POISON_en},
            [HEALBOT_CLEANSE_TOXIN] = {HEALBOT_DISEASE_en, HEALBOT_POISON_en},
            [hbELIXIR_OF_POISON_RES] = {HEALBOT_POISON_en},
            [hbSTONEFORM] = {HEALBOT_DISEASE_en, HEALBOT_POISON_en},
            [HEALBOT_PURIFY_SPIRIT] = {HEALBOT_MAGIC_en},
            [HEALBOT_MASS_DISPEL] = {HEALBOT_MAGIC_en},
            [HEALBOT_CLEANSE_SPIRIT] = {HEALBOT_CURSE_en},
            [HEALBOT_DETOX] = {HEALBOT_DISEASE_en, HEALBOT_POISON_en},
            [hbPOTION_OF_SOUL_PURITY] = {HEALBOT_CURSE_en, HEALBOT_DISEASE_en, HEALBOT_POISON_en},
            [hbPHIAL_OF_SERENITY] = {HEALBOT_CURSE_en, HEALBOT_DISEASE_en, HEALBOT_POISON_en},
            [HEALBOT_NATURALIZE] = {HEALBOT_MAGIC_en, HEALBOT_POISON_en},
            [HEALBOT_CAUTERIZING_FLAME] = {HEALBOT_CURSE_en, HEALBOT_DISEASE_en, HEALBOT_POISON_en},
            [HEALBOT_EXPUNGE] = {HEALBOT_POISON_en},
            [HEALBOT_DETOX] = {HEALBOT_MAGIC_en, HEALBOT_DISEASE_en, HEALBOT_POISON_en},
        }
    end
end

local HealBot_ExtraSkins_Image
local hbCustomDebuff_Text={}
local hbCustomBuff_Text={}
function HealBot_Options_InitVars()
    HealBot_Options_UpdateMediaIndex()
    if not HealBot_Globals.OptionsTheme then HealBot_Globals.OptionsTheme=1 end
    LSM.RegisterCallback(HEALBOT_HEALBOT, "LibSharedMedia_SetGlobal", function(mediatype, key) HealBot_UpdateUsedMedia(mediatype, key) end)
    optionsButton:SetText(HEALBOT_ACTION_OPTIONS)
    optionsButton:SetWidth(100)
    optionsButton:SetPoint("TOPLEFT", 14, -58)
	optionsButton:SetScript('OnClick', function()
		HealBot_TogglePanel(HealBot_Options)
	end)
    local f=_G["HealBot_Options_ShareExternalEditBoxFrame"]
    HealBot_ExtraSkins_Image = f:CreateTexture(nil, "BACKGROUND")
   -- HealBot_ExtraSkins_Image:SetAllPoints(f)
    HealBot_ExtraSkins_Image:SetColorTexture(0,0,0,0)
    HealBot_ExtraSkins_Image:SetHorizTile(true)
    HealBot_ExtraSkins_Image:SetVertTile(true)
    HealBot_ExtraSkins_Image:SetPoint("CENTER",0,-20)
    g=_G["HealBot_Options_ExtraSkinsDesc"]
    g:SetTextColor(1,1,1,1)
    g:SetJustifyH("CENTER")
    g:SetSpacing(2)
    g=_G["HealBot_Options_FrameAliasFixedFrame"] 
    g:Hide()
    
    g=_G["HealBot_Options_CustomCureFrame"]
    hbCustomDebuff_Text[0]={}
    hbCustomDebuff_Text[0]["Prio"]=g:CreateFontString()
    hbCustomDebuff_Text[0]["Prio"]:SetFontObject(GameFontNormal)
    hbCustomDebuff_Text[0]["Prio"]:SetTextColor(1,1,1,1)
    hbCustomDebuff_Text[0]["Prio"]:SetText(HEALBOT_WORD_PRIORITY)
    hbCustomDebuff_Text[0]["Prio"]:SetPoint("TOPLEFT", 20, -265)
    hbCustomDebuff_Text[0]["ID"]=g:CreateFontString()
    hbCustomDebuff_Text[0]["ID"]:SetFontObject(GameFontNormal)
    hbCustomDebuff_Text[0]["ID"]:SetTextColor(1,1,1,1)
    hbCustomDebuff_Text[0]["ID"]:SetText(HEALBOT_OPTIONS_CUSTOM_IDMETHODSID)
    hbCustomDebuff_Text[0]["ID"]:SetPoint("TOPLEFT", 80, -265)
    hbCustomDebuff_Text[0]["Name"]=g:CreateFontString()
    hbCustomDebuff_Text[0]["Name"]:SetFontObject(GameFontNormal)
    hbCustomDebuff_Text[0]["Name"]:SetTextColor(1,1,1,1)
    hbCustomDebuff_Text[0]["Name"]:SetText(HEALBOT_OPTIONS_CUSTOM_IDMETHODSNAME)
    hbCustomDebuff_Text[0]["Name"]:SetPoint("TOPLEFT", 140, -265)
    hbCustomDebuff_Text[0]["Tag"]=g:CreateFontString()
    hbCustomDebuff_Text[0]["Tag"]:SetFontObject(GameFontNormal)
    hbCustomDebuff_Text[0]["Tag"]:SetTextColor(1,1,1,1)
    hbCustomDebuff_Text[0]["Tag"]:SetText(HEALBOT_WORD_TAG)
    hbCustomDebuff_Text[0]["Tag"]:SetPoint("TOPLEFT", 340, -265)
    for x=1,15 do
        hbCustomDebuff_Text[x]={}
        hbCustomDebuff_Text[x]["Prio"]=g:CreateFontString()
        hbCustomDebuff_Text[x]["Prio"]:SetFontObject(GameFontNormalSmall)
        hbCustomDebuff_Text[x]["ID"]=g:CreateFontString()
        hbCustomDebuff_Text[x]["ID"]:SetFontObject(GameFontNormalSmall)
        hbCustomDebuff_Text[x]["Name"]=g:CreateFontString()
        hbCustomDebuff_Text[x]["Name"]:SetFontObject(GameFontNormalSmall)
        hbCustomDebuff_Text[x]["Tag"]=g:CreateFontString()
        hbCustomDebuff_Text[x]["Tag"]:SetFontObject(GameFontNormalSmall)
    end
    hbCustomDebuff_Text[1]["Prio"]:SetPoint("TOPLEFT", hbCustomDebuff_Text[0]["Prio"], "BOTTOMLEFT", 0, -5)
    hbCustomDebuff_Text[1]["ID"]:SetPoint("TOPLEFT", hbCustomDebuff_Text[0]["ID"], "BOTTOMLEFT", 0, -5)
    hbCustomDebuff_Text[1]["Name"]:SetPoint("TOPLEFT", hbCustomDebuff_Text[0]["Name"], "BOTTOMLEFT", 0, -5)
    hbCustomDebuff_Text[1]["Tag"]:SetPoint("TOPLEFT", hbCustomDebuff_Text[0]["Tag"], "BOTTOMLEFT", 0, -5)
    for x=2,15 do
        hbCustomDebuff_Text[x]["Prio"]:SetPoint("TOPLEFT", hbCustomDebuff_Text[x-1]["Prio"], "TOPLEFT", 0, -12)
        hbCustomDebuff_Text[x]["ID"]:SetPoint("TOPLEFT", hbCustomDebuff_Text[x-1]["ID"], "TOPLEFT", 0, -12)
        hbCustomDebuff_Text[x]["Name"]:SetPoint("TOPLEFT", hbCustomDebuff_Text[x-1]["Name"], "TOPLEFT", 0, -12)
        hbCustomDebuff_Text[x]["Tag"]:SetPoint("TOPLEFT", hbCustomDebuff_Text[x-1]["Tag"], "TOPLEFT", 0, -12)
    end
    
    g=_G["HealBot_Options_BuffIconFrame"]
    hbCustomBuff_Text[0]={}
    hbCustomBuff_Text[0]["Prio"]=g:CreateFontString()
    hbCustomBuff_Text[0]["Prio"]:SetFontObject(GameFontNormal)
    hbCustomBuff_Text[0]["Prio"]:SetTextColor(1,1,1,1)
    hbCustomBuff_Text[0]["Prio"]:SetText(HEALBOT_WORD_PRIORITY)
    hbCustomBuff_Text[0]["Prio"]:SetPoint("TOPLEFT", 20, -265)
    hbCustomBuff_Text[0]["ID"]=g:CreateFontString()
    hbCustomBuff_Text[0]["ID"]:SetFontObject(GameFontNormal)
    hbCustomBuff_Text[0]["ID"]:SetTextColor(1,1,1,1)
    hbCustomBuff_Text[0]["ID"]:SetText(HEALBOT_OPTIONS_CUSTOM_IDMETHODSID)
    hbCustomBuff_Text[0]["ID"]:SetPoint("TOPLEFT", 80, -265)
    hbCustomBuff_Text[0]["Name"]=g:CreateFontString()
    hbCustomBuff_Text[0]["Name"]:SetFontObject(GameFontNormal)
    hbCustomBuff_Text[0]["Name"]:SetTextColor(1,1,1,1)
    hbCustomBuff_Text[0]["Name"]:SetText(HEALBOT_OPTIONS_CUSTOM_IDMETHODSNAME)
    hbCustomBuff_Text[0]["Name"]:SetPoint("TOPLEFT", 140, -265)
    hbCustomBuff_Text[0]["Tag"]=g:CreateFontString()
    hbCustomBuff_Text[0]["Tag"]:SetFontObject(GameFontNormal)
    hbCustomBuff_Text[0]["Tag"]:SetTextColor(1,1,1,1)
    hbCustomBuff_Text[0]["Tag"]:SetText(HEALBOT_WORD_TAG)
    hbCustomBuff_Text[0]["Tag"]:SetPoint("TOPLEFT", 340, -265)
    for x=1,15 do
        hbCustomBuff_Text[x]={}
        hbCustomBuff_Text[x]["Prio"]=g:CreateFontString()
        hbCustomBuff_Text[x]["Prio"]:SetFontObject(GameFontNormalSmall)
        hbCustomBuff_Text[x]["ID"]=g:CreateFontString()
        hbCustomBuff_Text[x]["ID"]:SetFontObject(GameFontNormalSmall)
        hbCustomBuff_Text[x]["Name"]=g:CreateFontString()
        hbCustomBuff_Text[x]["Name"]:SetFontObject(GameFontNormalSmall)
        hbCustomBuff_Text[x]["Tag"]=g:CreateFontString()
        hbCustomBuff_Text[x]["Tag"]:SetFontObject(GameFontNormalSmall)
    end
    hbCustomBuff_Text[1]["Prio"]:SetPoint("TOPLEFT", hbCustomBuff_Text[0]["Prio"], "BOTTOMLEFT", 0, -5)
    hbCustomBuff_Text[1]["ID"]:SetPoint("TOPLEFT", hbCustomBuff_Text[0]["ID"], "BOTTOMLEFT", 0, -5)
    hbCustomBuff_Text[1]["Name"]:SetPoint("TOPLEFT", hbCustomBuff_Text[0]["Name"], "BOTTOMLEFT", 0, -5)
    hbCustomBuff_Text[1]["Tag"]:SetPoint("TOPLEFT", hbCustomBuff_Text[0]["Tag"], "BOTTOMLEFT", 0, -5)
    for x=2,15 do
        hbCustomBuff_Text[x]["Prio"]:SetPoint("TOPLEFT", hbCustomBuff_Text[x-1]["Prio"], "TOPLEFT", 0, -12)
        hbCustomBuff_Text[x]["ID"]:SetPoint("TOPLEFT", hbCustomBuff_Text[x-1]["ID"], "TOPLEFT", 0, -12)
        hbCustomBuff_Text[x]["Name"]:SetPoint("TOPLEFT", hbCustomBuff_Text[x-1]["Name"], "TOPLEFT", 0, -12)
        hbCustomBuff_Text[x]["Tag"]:SetPoint("TOPLEFT", hbCustomBuff_Text[x-1]["Tag"], "TOPLEFT", 0, -12)
    end
end

function HealBot_Options_cacheNames(list)
    local iName
    for j=1, getn(list), 1 do
        iName=GetItemInfo(list[j]);
    end
end

function HealBot_Options_setLists()
    HealBot_Options_BuffTxt_List = {
        HEALBOT_WORDS_NONE,
        HEALBOT_OPTIONS_BUFFSELF,
        HEALBOT_OPTIONS_BUFFPARTY,
        HEALBOT_OPTIONS_BUFFRAID,
        HEALBOT_CLASSES_MELEE,
        HEALBOT_CLASSES_RANGES,
        HEALBOT_CLASSES_HEALERS,
        HEALBOT_CLASSES_CUSTOM,
        HEALBOT_BUFF_PVP,
        HEALBOT_BUFF_PVE,
        HEALBOT_OPTIONS_TANKHEALS,
        HEALBOT_OPTIONS_MYTARGET,
        HEALBOT_FOCUS,
        HEALBOT_OPTIONS_MYFRIEND,
        HEALBOT_OPTIONS_SINGLETANK,
        HEALBOT_WORD_SOLO,
    }
    
    if HEALBOT_GAME_VERSION>3 then 
        HealBot_Options_FilterHoTctl_List = {
            HEALBOT_CLASSES_ALL,
            HEALBOT_DEATHKNIGHT,
            HEALBOT_DEMONHUNTER,
            HEALBOT_DRUID,
            HEALBOT_EVOKER,
            HEALBOT_PALADIN,
            HEALBOT_MONK,
            HEALBOT_PRIEST,
            HEALBOT_SHAMAN,
            HEALBOT_WARRIOR,
            HEALBOT_HUNTER,
            HEALBOT_MAGE,
            HEALBOT_ROGUE,
            HEALBOT_WARLOCK,
        }
    elseif HEALBOT_GAME_VERSION>2 then
        HealBot_Options_FilterHoTctl_List = {
            HEALBOT_CLASSES_ALL,
            HEALBOT_DEATHKNIGHT,
            HEALBOT_DRUID,
            HEALBOT_PALADIN,
            HEALBOT_PRIEST,
            HEALBOT_SHAMAN,
            HEALBOT_WARRIOR,
            HEALBOT_HUNTER,
            HEALBOT_MAGE,
            HEALBOT_ROGUE,
            HEALBOT_WARLOCK,
        }
    else    
        HealBot_Options_FilterHoTctl_List = {
            HEALBOT_CLASSES_ALL,
            HEALBOT_DRUID,
            HEALBOT_PALADIN,
            HEALBOT_PRIEST,
            HEALBOT_SHAMAN,
            HEALBOT_WARRIOR,
            HEALBOT_HUNTER,
            HEALBOT_MAGE,
            HEALBOT_ROGUE,
            HEALBOT_WARLOCK,
        }
    end
    
    HealBot_Options_TargetFocusInCombat_List = {
        HEALBOT_OPTIONS_ALWAYSHIDE,
        HEALBOT_OPTIONS_NOCHANGE,
        HEALBOT_OPTIONS_ALWAYSSHOW,
    }

    HealBot_Options_FontOutline_List = {
        HEALBOT_WORDS_NONE,
        HEALBOT_WORDS_THIN,
        HEALBOT_WORDS_THICK,
    }

    HealBot_Options_BarHealthIncHeal_List = {
        HEALBOT_WORDS_NO.." "..HEALBOT_OPTIONS_INCHEAL,
        HEALBOT_OPTIONS_BARHEALTHINCHEALS,
        HEALBOT_OPTIONS_BARHEALTHSEPHEALS,
    }

    HealBot_Options_BarHealthIncAbsorb_List = {
        HEALBOT_WORDS_NO.." "..HEALBOT_OPTIONS_INCABSORB,
        HEALBOT_OPTIONS_BARHEALTHINCABSORBS,
        HEALBOT_OPTIONS_BARHEALTHSEPABSORBS,
    }
    
    HealBot_Options_BarHealthOverHeal_List = {
        HEALBOT_OPTIONS_NOOVERHEALS,
        HEALBOT_OPTIONS_BARHEALTHMYOVERHEALS,
        HEALBOT_OPTIONS_BARHEALTHALLOVERHEALS,
    }
    
    HealBot_Options_Lists["OverHealFormat"] = {
        "100",
        "^100",
        "+100",
        "<100",
        "(100)",
        "{100}",
        "[100]",
        "<100>",
        "=100=",
    }
    
    HealBot_Options_Lists["AggroNameFormat"] = {
        HEALBOT_WORDS_NONE,
        ">>"..HEALBOT_SORTBY_NAME.."<<",
        "!!"..HEALBOT_SORTBY_NAME.."!!",
        "++"..HEALBOT_SORTBY_NAME.."++",
        "**"..HEALBOT_SORTBY_NAME.."**",
        "^^"..HEALBOT_SORTBY_NAME.."^^",
        "--"..HEALBOT_SORTBY_NAME.."--",
        "##"..HEALBOT_SORTBY_NAME.."##",
        "=="..HEALBOT_SORTBY_NAME.."==",
    }

    HealBot_Options_Lists["OverHealColour"] = {
        HEALBOT_OPTIONS_HEALTHOPTCOLOUR,
        HEALBOT_CLASSES_CUSTOM,
    }
    
    HealBot_Options_Lists["HealthCustomColour"] = {
        HEALBOT_OPTIONS_NAMEOPTCOLOUR,
        HEALBOT_CLASSES_CUSTOM,
    }
    
    HealBot_Options_BarHealthColour_List = {
        HEALBOT_WORD_HEALTH,
        HEALBOT_SORTBY_CLASS,
        HEALBOT_CLASSES_CUSTOM,
        HEALBOT_OPTIONS_CLASSHLTHMIX,
    }

    HealBot_Options_Lists["BarBack"] = {
        HEALBOT_WORD_HEALTH,
        HEALBOT_SORTBY_CLASS,
        HEALBOT_CLASSES_CUSTOM,
        HEALBOT_OPTIONS_CLASSHLTHMIX,
        HEALBOT_OPTIONS_ADAPTIVECLASSMIX,
        HEALBOT_OPTIONS_ADAPTIVECUSTOMMIX,
        HEALBOT_OPTIONS_ADAPTIVE,
    }
    
    HealBot_Options_Lists["BarBackBorder"] = {
        HEALBOT_OPTIONS_HAZARDONLY,
        HEALBOT_WORD_HEALTH,
        HEALBOT_SORTBY_CLASS,
        HEALBOT_CLASSES_CUSTOM,
        HEALBOT_OPTIONS_CLASSHLTHMIX,
        HEALBOT_OPTIONS_ADAPTIVECLASSMIX,
        HEALBOT_OPTIONS_ADAPTIVECUSTOMMIX,
        HEALBOT_OPTIONS_ADAPTIVE,
    }
    
    HealBot_Options_EnemyOOC_List = {
        HEALBOT_OPTIONS_ALWAYSHIDE,
        HEALBOT_ENEMY_EXISTS_SHOW,
        HEALBOT_OPTIONS_ALWAYSINCOMBAT,
    }

    if HEALBOT_GAME_VERSION>2 then
        HealBot_Options_EnemyCombat_List = {
            HEALBOT_OPTIONS_ALWAYSINCOMBAT,
            HEALBOT_ENEMY_EXISTS_SHOW,
            HEALBOT_ENEMY_NOBOSS_SHOW,
        }
    else
        HealBot_Options_EnemyCombat_List = {
            HEALBOT_OPTIONS_ALWAYSINCOMBAT,
            HEALBOT_ENEMY_EXISTS_SHOW,
        }
    end

    HealBot_Options_BarIncHealColour_List = {
        HEALBOT_OPTIONS_DONT_SHOW,
        HEALBOT_WORD_HEALTH,
        HEALBOT_OPTIONS_FUTURE_HLTH,
        HEALBOT_CLASSES_CUSTOM,
        HEALBOT_OPTIONS_CLASSHLTHMIX,
    }
    
    HealBot_Options_AbsorbColour_List = {
        HEALBOT_OPTIONS_DONT_SHOW,
        HEALBOT_WORD_HEALTH,
        HEALBOT_OPTIONS_FUTURE_HLTH,
        HEALBOT_CLASSES_CUSTOM,
        HEALBOT_OPTIONS_CLASSHLTHMIX,
    }

    HealBot_Options_BarHealthType_List = {
        HEALBOT_OPTIONS_BARHEALTH3,
        HEALBOT_OPTIONS_BARHEALTH1,
        HEALBOT_OPTIONS_BARHEALTH2,
    }

    HealBot_Options_BarHealthAnchor_List = {
        HEALBOT_OPTIONS_HLTHTXTANCHORINDL,
        HEALBOT_OPTIONS_HLTHTXTANCHORINDC,
        HEALBOT_OPTIONS_HLTHTXTANCHORINDR,
        HEALBOT_OPTIONS_HLTHTXTANCHORRIGHT,
        HEALBOT_OPTIONS_HLTHTXTANCHORBELOW,
    }

    HealBot_Options_Lists["BarStateTextAnchor"] = {
        HEALBOT_OPTIONS_HLTHTXTANCHORINDL,
        HEALBOT_OPTIONS_HLTHTXTANCHORINDC,
        HEALBOT_OPTIONS_HLTHTXTANCHORINDR,
        HEALBOT_OPTIONS_HLTHTXTANCHORLEFT,
        HEALBOT_OPTIONS_HLTHTXTANCHORABOVE,
    }
    
    HealBot_Options_Lists["BarAggroTextAnchor"] = {
        HEALBOT_OPTIONS_HLTHTXTANCHORINDL,
        HEALBOT_OPTIONS_HLTHTXTANCHORINDC,
        HEALBOT_OPTIONS_HLTHTXTANCHORINDR,
        HEALBOT_OPTIONS_HLTHTXTANCHORABOVE,
        HEALBOT_OPTIONS_HLTHTXTANCHORBELOW,
    }
    
    HealBot_Options_Lists["BarNameTextAnchor"] = {
        HEALBOT_OPTIONS_ICONBELOWANCHOR01,
        HEALBOT_OPTIONS_ICONBELOWANCHOR03,
        HEALBOT_OPTIONS_ICONBELOWANCHOR02,
    }
    
    HealBot_Options_Lists["HotBarsDebuffPrio"] = {
        HEALBOT_WORD_OFF,
        HEALBOT_ONE,
        HEALBOT_TWO,
        HEALBOT_THREE,
        HEALBOT_FOUR,
        HEALBOT_FIVE,
    }
    
    HealBot_Options_UseOverrideFocusGroups_List = {
        HEALBOT_OPTIONS_FOCUSGROUPS1,
        HEALBOT_OPTIONS_FOCUSGROUPS2,
        HEALBOT_OPTIONS_FOCUSGROUPS3,
    }
    
    HealBot_Options_ButtonCastMethod_List = {
        HEALBOT_OPTIONS_BUTTONCASTPRESSED,
        HEALBOT_OPTIONS_BUTTONCASTRELEASED,
    }
    
    HealBot_Options_TestBarsProfile_List = {
        HEALBOT_WORD_PARTY,
        HEALBOT_OPTIONS_EMERGENCYHEALS.." 10",
        HEALBOT_OPTIONS_EMERGENCYHEALS.." 25",
        HEALBOT_OPTIONS_EMERGENCYHEALS.." 40",
    }

    HealBot_Options_TooltipFontSize_List = {
        HEALBOT_WORDS_SMALL,
        HEALBOT_WORDS_MEDIUM,
        HEALBOT_WORDS_LARGE,
    }
        
    HealBot_Options_ExtraSkinsCat_List = {
        HEALBOT_EXTRASKINS_CAT_GROUP,
        HEALBOT_EXTRASKINS_CAT_SRAID,
        HEALBOT_EXTRASKINS_CAT_LRAID,
    }
    
    HealBot_Options_EmoteCat_List = {
        HEALBOT_EMOTE_CAT_COMBAT,
        HEALBOT_EMOTE_CAT_EMOTION,
        HEALBOT_EMOTE_CAT_HAPPY,
        HEALBOT_EMOTE_CAT_GREET,
        HEALBOT_EMOTE_CAT_OTHER,
        HEALBOT_EMOTE_CAT_RESPECT,
        HEALBOT_EMOTE_CAT_UNHAPPY,
    }
    
    HealBot_Options_EmoteCombat_List = {
        HEALBOT_EMOTE_ATTACKTARGET,
        HEALBOT_EMOTE_CHARGE,
        HEALBOT_EMOTE_DOOM,
        HEALBOT_EMOTE_FLEE,
        HEALBOT_EMOTE_FOLLOWME,
        HEALBOT_EMOTE_GROWL,
        HEALBOT_EMOTE_HEALME,
        HEALBOT_EMOTE_INCOMING,
        HEALBOT_EMOTE_INSULT,
        HEALBOT_EMOTE_OOM,
        HEALBOT_EMOTE_OPENFIRE,
        HEALBOT_EMOTE_ROAR,
        HEALBOT_EMOTE_RUDE,
        HEALBOT_EMOTE_SURRENDER,
        HEALBOT_EMOTE_TAUNT,
        HEALBOT_EMOTE_VICTORY,
        HEALBOT_EMOTE_WAIT,
    }
    
    HealBot_Options_EmoteEmotion_List = {
        HEALBOT_EMOTE_BASHFUL,
        HEALBOT_EMOTE_BLOW,
        HEALBOT_EMOTE_BLUSH,
        HEALBOT_EMOTE_FLIRT,
        HEALBOT_EMOTE_KISS,
        HEALBOT_EMOTE_SHY,
    }
    
    HealBot_Options_EmoteHappy_List = {
        HEALBOT_EMOTE_CACKLE,
        HEALBOT_EMOTE_CHUCKLE,
        HEALBOT_EMOTE_CLAP,
        HEALBOT_EMOTE_DANCE,
        HEALBOT_EMOTE_EXCITED,
        HEALBOT_EMOTE_GIGGLE,
        HEALBOT_EMOTE_LAUGH,
        HEALBOT_EMOTE_ROFL,
        HEALBOT_EMOTE_SILLY,
        HEALBOT_EMOTE_THANK,
        HEALBOT_EMOTE_TRAIN,
    }
    
    HealBot_Options_EmoteGreet_List = {
        HEALBOT_EMOTE_BYE,
        HEALBOT_EMOTE_GREET,
        HEALBOT_EMOTE_HELLO,
        HEALBOT_EMOTE_WAVE,
        HEALBOT_EMOTE_WELCOME,
    }
    
    HealBot_Options_EmoteOther_List = {
        HEALBOT_EMOTE_BOGGLE,
        HEALBOT_EMOTE_CURIOUS,
        HEALBOT_EMOTE_DRINK,
        HEALBOT_EMOTE_EAT,
        HEALBOT_EMOTE_FLEX,
        HEALBOT_EMOTE_GASP,
        HEALBOT_EMOTE_GUFFAW,
        HEALBOT_EMOTE_LAY,
        HEALBOT_EMOTE_NO,
        HEALBOT_EMOTE_NOD,
        HEALBOT_EMOTE_POINT,
        HEALBOT_EMOTE_PRAY,
        HEALBOT_EMOTE_PUZZLED,
        HEALBOT_EMOTE_RASP,
        HEALBOT_EMOTE_SHRUG,
        HEALBOT_EMOTE_SLEEP,
        HEALBOT_EMOTE_TALK,
    }
    
    HealBot_Options_EmoteRespect_List = {
        HEALBOT_EMOTE_APPLAUD,
        HEALBOT_EMOTE_BOW,
        HEALBOT_EMOTE_CHEER,
        HEALBOT_EMOTE_COMMEND,
        HEALBOT_EMOTE_CONGRATS,
        HEALBOT_EMOTE_CURTSEY,
        HEALBOT_EMOTE_HAIL,
        HEALBOT_EMOTE_KNEEL,
        HEALBOT_EMOTE_SALUTE,
    }
    
    HealBot_Options_EmoteUnhappy_List = {
        HEALBOT_EMOTE_ANGRY,
        HEALBOT_EMOTE_BEG,
        HEALBOT_EMOTE_BORED,
        HEALBOT_EMOTE_CONFUSED,
        HEALBOT_EMOTE_COWER,
        HEALBOT_EMOTE_CRY,
        HEALBOT_EMOTE_GLOAT,
        HEALBOT_EMOTE_GOLFCLAP,
        HEALBOT_EMOTE_GROVEL,
        HEALBOT_EMOTE_LOST,
        HEALBOT_EMOTE_MOURN,
        HEALBOT_EMOTE_ROLLEYES,
        HEALBOT_EMOTE_SIGH,
        HEALBOT_EMOTE_VIOLIN,
    }
    
    HealBot_Options_hbLangs_List = {
        HEALBOT_OPTIONS_LANG_ZHCN,
        HEALBOT_OPTIONS_LANG_ENUK,
        HEALBOT_OPTIONS_LANG_ENUS,
        HEALBOT_OPTIONS_LANG_FRFR,
        HEALBOT_OPTIONS_LANG_DEDE,
        HEALBOT_OPTIONS_LANG_GRGR,
        HEALBOT_OPTIONS_LANG_HUHU,
        HEALBOT_OPTIONS_LANG_ITIT,
        HEALBOT_OPTIONS_LANG_KRKR,
        HEALBOT_OPTIONS_LANG_ESMX,
        HEALBOT_OPTIONS_LANG_PTBR,
        HEALBOT_OPTIONS_LANG_RURU,
        HEALBOT_OPTIONS_LANG_ESES,
        HEALBOT_OPTIONS_LANG_TWTW,
    }
    
    HealBot_Options_hbProfile_List = {
        HEALBOT_OPTIONS_PROFILE_CHARACTER,
        HEALBOT_OPTIONS_PROFILE_CLASS,
        HEALBOT_OPTIONS_GLOBAL,
    }
    
    if HEALBOT_GAME_VERSION==3 then
        HealBot_Options_hbCommands_List = {
            HEALBOT_WORDS_NONE,
            HEALBOT_CMD_CLEARBLACKLIST,
            HEALBOT_CMD_COPYSPELLS,
            HEALBOT_CMD_RESETICONS,
            HEALBOT_CMD_RESETBARS,
            HEALBOT_CMD_RESETBUFFS,
            HEALBOT_CMD_RESETCURES,
            HEALBOT_CMD_RESETCUSTOMDEBUFFS,
            HEALBOT_CMD_RESETSKINS,
            HEALBOT_CMD_RESETSPELLS,
            HEALBOT_CMD_TOGGLEDISLIKEMOUNT,
            HEALBOT_CMD_TOGGLEEXCLUDEMOUNT,
            HEALBOT_CMD_SUPPRESSERRORS,
            HEALBOT_CMD_SUPPRESSSOUND,
            HEALBOT_CMD_TOGGLECUSTOMCURECASTBY,
            HEALBOT_CMD_TOGGLEMAINASSIST,
            HEALBOT_CMD_RESETSKINGROUP,
            HEALBOT_CMD_RESETSKINRAID25,
            HEALBOT_CMD_RESETSKINRAID40,
            HEALBOT_CMD_SETFAVMOUNT,
        }
    else
        HealBot_Options_hbCommands_List = {
            HEALBOT_WORDS_NONE,
            HEALBOT_CMD_CLEARBLACKLIST,
            HEALBOT_CMD_COPYSPELLS,
            HEALBOT_CMD_RESETICONS,
            HEALBOT_CMD_RESETBARS,
            HEALBOT_CMD_RESETBUFFS,
            HEALBOT_CMD_RESETCURES,
            HEALBOT_CMD_RESETCUSTOMDEBUFFS,
            HEALBOT_CMD_RESETSKINS,
            HEALBOT_CMD_RESETSPELLS,
            HEALBOT_CMD_TOGGLEDISLIKEMOUNT,
            HEALBOT_CMD_TOGGLEEXCLUDEMOUNT,
            HEALBOT_CMD_SUPPRESSERRORS,
            HEALBOT_CMD_SUPPRESSSOUND,
            HEALBOT_CMD_TOGGLECUSTOMCURECASTBY,
            HEALBOT_CMD_TOGGLEMAINASSIST,
            HEALBOT_CMD_RESETSKINGROUP,
            HEALBOT_CMD_RESETSKINRAID25,
            HEALBOT_CMD_RESETSKINRAID40,
        }
    end

    HealBot_Options_EmergencyFClass_List = {
        HEALBOT_CLASSES_MELEE,
        HEALBOT_CLASSES_RANGES,
        HEALBOT_CLASSES_HEALERS,
        HEALBOT_CLASSES_CUSTOM,
    }

    HealBot_Options_Sort_List = {
        HEALBOT_SORTBY_NAME,
        HEALBOT_SORTBY_CLASS,
        HEALBOT_SORTBY_GROUP,
        HEALBOT_SORTBY_MAXHEALTH,
        HEALBOT_SORTBY_ROLE,
        HEALBOT_SORTBY_UNITID,
    }

    HealBot_Options_UseOverrides_List = {
        HEALBOT_USE_OVERRIDE_NO,
        HEALBOT_USE_OVERRIDE_YES,
    }
    
    HealBot_Options_ActionBarsCombo_List = {
        HEALBOT_OPTIONS_ENABLEDBARS,
        HEALBOT_OPTIONS_ENEMYBARS,
        HEALBOT_OPTIONS_EMERGBARS,
        HEALBOT_OPTIONS_ICONS
    }

    HealBot_Options_ActionLocked_List = {
        HEALBOT_OPTIONS_LOCKOFF,
        HEALBOT_OPTIONS_LOCKON,
        HEALBOT_OPTIONS_LOCKCTRL,
        HEALBOT_OPTIONS_LOCKALT,
        HEALBOT_OPTIONS_LOCKCTRLALT,
    }
    
    HealBot_Options_Lists["AutoShow"] = {
        HEALBOT_WORD_OFF,
        HEALBOT_WORD_ONWITHOUTSOUND,
        HEALBOT_WORD_ONWITHSOUND,
    }
    
    HealBot_Options_Lists["GlowFrame"] = {
        HEALBOT_WORDS_TINY,
        HEALBOT_WORDS_SMALL,
        HEALBOT_WORDS_MEDIUM,
        HEALBOT_WORDS_LARGE,
        HEALBOT_WORDS_HUGE,
    }
    
    HealBot_Options_ActionAnchor_List = {
        HEALBOT_OPTIONS_TOPLEFT,
        HEALBOT_OPTIONS_BOTTOMLEFT,
        HEALBOT_OPTIONS_TOPRIGHT,
        HEALBOT_OPTIONS_BOTTOMRIGHT,
        HEALBOT_OPTIONS_TOP,
        HEALBOT_OPTIONS_BUTTONLEFT,
        HEALBOT_OPTIONS_BUTTONRIGHT,
        HEALBOT_OPTIONS_BOTTOM,
    }
    
    HealBot_Options_BarsGrowDirection_List = {
        HEALBOT_OPTIONS_GROW_HORIZONTAL,
        HEALBOT_OPTIONS_GROW_VERTICAL,
    }

    HealBot_Options_BarsOrientation_List = {
        HEALBOT_OPTIONS_GROW_HORIZONTAL,
        HEALBOT_OPTIONS_GROW_VERTICAL,
    }
    
    HealBot_Options_ManaIndicator_List = {
        HEALBOT_OPTIONS_LOWMANAINDICATOR1,
        HEALBOT_OPTIONS_LOWMANAINDICATOR2,
        HEALBOT_OPTIONS_LOWMANAINDICATOR3,
        HEALBOT_OPTIONS_LOWMANAINDICATOR4,
        HEALBOT_OPTIONS_LOWMANAINDICATOR5,
        HEALBOT_OPTIONS_LOWMANAINDICATOR6,
    }

    HealBot_Options_Class_HoTctlIDMethod_List = {
        HEALBOT_OPTIONS_CUSTOM_IDMETHODSID,
        HEALBOT_OPTIONS_CUSTOM_IDMETHODSNAME,
        HEALBOT_OPTIONS_CUSTOM_IDMETHODSBOTH,
    }
    
    HealBot_Options_Class_HoTctlAction_List = {
        HEALBOT_OPTIONS_SELFHEALS,
        HEALBOT_OPTIONS_MYCLASS,
        HEALBOT_CUSTOM_CASTBY_EVERYONE,
    }

    HealBot_Options_Lists["BuffsCustomAuto"] = {
        HEALBOT_WORDS_NONE,
        HEALBOT_OPTIONS_BUFFSAUTOTIMED,
        HEALBOT_OPTIONS_BUFFSAUTOALL,
    }
    
    HealBot_Options_Lists["BuffsCustomAutoCastBy"] = {
        HEALBOT_OPTIONS_CASTBYSELF,
        HEALBOT_OPTIONS_CASTBYMYCLASS,
        HEALBOT_OPTIONS_CASTBYEVERYONE,
    }
    
    HealBot_Options_Lists["AuraCustomSort"] = {
        HEALBOT_WORD_PRIORITY,
        HEALBOT_OPTIONS_CUSTOM_IDMETHODSNAME,
        HEALBOT_WORD_TAG,
    }

    HealBot_Options_Lists["AuraCustomFilter"] = {
        HEALBOT_WORD_PRIORITY.." (1 - 4)",
        HEALBOT_WORD_PRIORITY.." (5 - 8)",
        HEALBOT_WORD_PRIORITY.." (9 - 12)",
        HEALBOT_WORD_PRIORITY.." (13 - 16)",
        HEALBOT_WORD_PRIORITY.." (17 - 20)",
    }
    
    HealBot_Options_AggroAlertLevel_List = {
       -- HEALBOT_OPTIONS_ALERTAGGROLEVEL1,
        HEALBOT_OPTIONS_ALERTAGGROLEVEL2,
        HEALBOT_OPTIONS_ALERTAGGROLEVEL3,
    }
    
    HealBot_Options_Lists["AggroAdaptiveLevel"] = {
        HEALBOT_OPTIONS_ALERTAGGROLEVEL0,
        HEALBOT_OPTIONS_ALERTAGGROLEVEL2,
        HEALBOT_OPTIONS_ALERTAGGROLEVEL3,
    }
    
    HealBot_Options_AuxAssign_List = {
        HEALBOT_WORDS_NONE,
        HEALBOT_classicABSORBHOTUP,
        HEALBOT_OPTIONS_INCHEAL,
        HEALBOT_OPTIONS_POWER,
        HEALBOT_OPTIONS_TAB_AGGRO,
        HEALBOT_WORD_THREAT,
        HEALBOT_WORD_OVERHEALS,
        HEALBOT_OPTION_HIGHLIGHTACTIVEBAR,
        HEALBOT_OPTIONS_TAB_BUFFS,
        HEALBOT_OPTIONS_TAB_DEBUFFS,
        HEALBOT_OPTIONS_CASTBAR,
        HEALBOT_OPTIONS_TARGETHEALS,
        HEALBOT_OUTOFRANGE_LABEL,
        HEALBOT_RANGE30,
        HEALBOT_RECENTHEALS,
        HEALBOT_WORD_RESURRECTION,
        HEALBOT_WORD_SUMMONS,
        HEALBOT_OPTION_HEALTHDROP,
        HEALBOT_OPTIONS_TAB_NAMETEXT,
        HEALBOT_WORD_HEALTH,
        HEALBOT_OPTIONS_TAB_STATETEXT,
    }
    
    HealBot_Options_AuxBarColours_List = {
        HEALBOT_WORD_AUTO,
        HEALBOT_SORTBY_CLASS,
        HEALBOT_CLASSES_CUSTOM,
    }
    
    HealBot_Options_AuxBarOpacityType_List = {
        HEALBOT_OPTIONS_AUXOPACITYTYPE1,
        HEALBOT_OPTIONS_AUXOPACITYTYPE2,
        HEALBOT_CLASSES_CUSTOM,
    }
    
    HealBot_Options_AuxBarAnchor_List = {
        HEALBOT_OPTIONS_AUXBARANCHOR01,
        HEALBOT_OPTIONS_AUXBARANCHOR02,
        HEALBOT_OPTIONS_AUXBARANCHOR03,
        HEALBOT_OPTIONS_AUXBARANCHOR04,
        HEALBOT_OPTIONS_AUXBARANCHOR05,
        HEALBOT_OPTIONS_AUXBARANCHOR06,
        HEALBOT_OPTIONS_AUXBARANCHOR07,
        HEALBOT_OPTIONS_AUXBARANCHOR08,
    }
    
    HealBot_Options_AuxBarAnchor_ShortList = {
        HEALBOT_OPTIONS_AUXBARANCHOR11,
        HEALBOT_OPTIONS_AUXBARANCHOR12,
        HEALBOT_OPTIONS_AUXBARANCHOR13,
        HEALBOT_OPTIONS_AUXBARANCHOR14,
        HEALBOT_OPTIONS_AUXBARANCHOR15,
        HEALBOT_OPTIONS_AUXBARANCHOR16,
        HEALBOT_OPTIONS_AUXBARANCHOR17,
        HEALBOT_OPTIONS_AUXBARANCHOR18,
    }
    
    HealBot_Options_AuxOverlap_List = {
        HEALBOT_OPTIONS_GROW_VERTICAL,
        HEALBOT_OPTIONS_GROW_HORIZONTAL,
        HEALBOT_WORDS_NONE,
    }

    HealBot_Options_Lists["AuxConfigSelect"] = {
        HEALBOT_OPTIONS_FULLAUX.."1",
        HEALBOT_OPTIONS_FULLAUX.."2",
        HEALBOT_OPTIONS_FULLAUX.."3",
        HEALBOT_OPTIONS_FULLAUX.."4",
        HEALBOT_OPTIONS_FULLAUX.."5",
        HEALBOT_OPTIONS_FULLAUX.."6",
        HEALBOT_OPTIONS_FULLAUX.."7",
        HEALBOT_OPTIONS_FULLAUX.."8",
        HEALBOT_OPTIONS_FULLAUX.."9",
    }

    HealBot_Options_Lists["AggroIndAlertLevel"] = {
        HEALBOT_OPTIONS_ALERTAGGROLEVEL1,
        HEALBOT_OPTIONS_ALERTAGGROLEVEL2,
        HEALBOT_OPTIONS_ALERTAGGROLEVEL3,
    }

    HealBot_Options_Lists["TooltipPos"] = {
        HEALBOT_TOOLTIP_POSDEFAULT,
        HEALBOT_TOOLTIP_POSLEFT,
        HEALBOT_TOOLTIP_POSRIGHT,
        HEALBOT_TOOLTIP_POSABOVE,
        HEALBOT_TOOLTIP_POSBELOW,
        HEALBOT_TOOLTIP_POSCURSOR,
        HEALBOT_CUSTOM_CAT_CUSTOM,
    }

    HealBot_Options_Lists["DebuffItems"] = {
        HEALBOT_ANTI_VENOM,
        HEALBOT_PHIAL_OF_SERENITY,
        HEALBOT_ELIXIR_OF_POISON_RES,
        HEALBOT_POTION_OF_SOUL_PURITY,
        HEALBOT_POWERFUL_ANTI_VENOM,
        HEALBOT_PURIFICATION_POTION,
    }

    HealBot_Options_cacheNames(HealBot_Options_Lists["DebuffItems"])
    
    HealBot_Options_Lists["RangeWarning"] = {
        HEALBOT_WORD_ALWAYS,
        HEALBOT_VISIBLE_RANGE,
        HEALBOT_SPELL_RANGE,
    }

    HealBot_Options_Lists["CDebuffCat"] = {
        HEALBOT_CUSTOM_CAT_CUSTOM,
        HEALBOT_CUSTOM_CAT_02,
        HEALBOT_CUSTOM_CAT_03,
        HEALBOT_CUSTOM_CAT_04,
        HEALBOT_CUSTOM_CAT_05,
        HEALBOT_CUSTOM_CAT_06,
        HEALBOT_CUSTOM_CAT_07,
        HEALBOT_CUSTOM_CAT_08,
        HEALBOT_CUSTOM_CAT_09,
        HEALBOT_CUSTOM_CAT_10,
        HEALBOT_CUSTOM_CAT_11,
        HEALBOT_CUSTOM_CAT_12,
        HEALBOT_CUSTOM_CAT_13,
        HEALBOT_CUSTOM_CAT_14,
    }
    
    HealBot_Options_Lists["ImportMethods"] = {
        HEALBOT_IMPORT_OVERWRITEALL,
        HEALBOT_IMPORT_MERGEALL,
        HEALBOT_IMPORT_MERGENEW,
    }
    
    HealBot_Options_Lists["Plugins"] = {
    HEALBOT_PLUGIN_THREAT,
    HEALBOT_PLUGIN_TIMETODIE,
    HEALBOT_PLUGIN_TIMETOLIVE,
    HEALBOT_PLUGIN_EXTRABUTTONS,
    HEALBOT_PLUGIN_COMBATPROT,
    HEALBOT_PLUGIN_PERFORMANCE,
    HEALBOT_PLUGIN_MYCOOLDOWNS,
    HEALBOT_PLUGIN_TWEAKS,
    HEALBOT_PLUGIN_REQUESTS,
    HEALBOT_PLUGIN_AURAWATCH,
    HEALBOT_PLUGIN_HEALTHWATCH,
    HEALBOT_PLUGIN_MANAWATCH,
    --HEALBOT_PLUGIN_EFFECTIVETANKS,
    --HEALBOT_PLUGIN_EFFICIENTHEALERS,
    }
    
    HealBot_Options_Lists["IconPosition"] = {
        HEALBOT_OPTIONS_HOTONBAR,
        HEALBOT_OPTIONS_HOTOFFBAR,
        HEALBOT_OPTIONS_HOTBELOWBAR,
    }
    
    HealBot_Options_Lists["IconSets"] = {
        HEALBOT_ONE,
        HEALBOT_TWO,
        HEALBOT_THREE,
    }
    
    HealBot_Options_Lists["IconDebuffSets"] = {
        HEALBOT_SKIN_ICONDEBUFFSET01,
        HEALBOT_SKIN_ICONDEBUFFSET02,
        HEALBOT_SKIN_ICONDEBUFFSET03,
    }
    
    HealBot_Options_Lists["IconBuffSets"] = {
        HEALBOT_SKIN_ICONBUFFSET01,
        HEALBOT_SKIN_ICONBUFFSET02,
        HEALBOT_SKIN_ICONBUFFSET03,
    }
    
    HealBot_Options_Lists["UnitInCombat"] = {
        HEALBOT_OPTIONS_UNITINCOMBAT01,
        HEALBOT_OPTIONS_UNITINCOMBAT02,
        HEALBOT_OPTIONS_UNITINCOMBAT03,
    }

    HealBot_Options_Lists["AuraBarCol"] = {
        HEALBOT_WORDS_NONE,
        HEALBOT_OPTIONS_ADAPTIVEONLY,
        HEALBOT_OPTIONS_ADAPTIVEHEALTHBAR,
        HEALBOT_OPTIONS_HEALTHBARONLY,
        HEALBOT_SKIN_BORDER_HAZARD,
        HEALBOT_SKIN_FRAME_GLOW,
        HEALBOT_SKIN_FRAME_GLOWSTARS,
        HEALBOT_SKIN_FRAME_GLOWBLIZZ,
    }

    HealBot_Options_Lists["AuraIconGlow"] = {
        HEALBOT_WORDS_NONE,
        HEALBOT_SKIN_BORDER_HAZARD,
        HEALBOT_SKIN_FRAME_GLOW,
        HEALBOT_SKIN_FRAME_GLOWSTARS,
        HEALBOT_SKIN_FRAME_GLOWBLIZZ,
    }

    HealBot_Options_Lists["Themes"] = {
        HEALBOT_WORD_GOLD,
        HEALBOT_WORD_SILVER,
        HEALBOT_WORD_AQUA,
        HEALBOT_WORD_BLUE,
        HEALBOT_WORD_DARK,
        HEALBOT_WORD_FUCHSIA,
        HEALBOT_WORD_GREEN,
        HEALBOT_WORD_LIME,
        HEALBOT_WORD_ORANGE,
        HEALBOT_WORD_PURPLE,
        HEALBOT_WORD_RED,
        HEALBOT_WORD_TEAL,
        HEALBOT_WORD_WHITE,
        HEALBOT_WORD_YELLOW,
        HEALBOT_DEATHKNIGHT,
        HEALBOT_DEMONHUNTER,
        HEALBOT_DRUID,
        HEALBOT_HUNTER,
        HEALBOT_MAGE,
        HEALBOT_MONK,
        HEALBOT_PALADIN,
        HEALBOT_PRIEST,
        HEALBOT_ROGUE,
        HEALBOT_SHAMAN,
        HEALBOT_WARLOCK,
        HEALBOT_WARRIOR,
    }
    
    HealBot_Options_Lists["IndicatorCol"] = {
        HEALBOT_WORD_AUTO,
        HEALBOT_WORD_GOLD,
        HEALBOT_WORD_SILVER,
        HEALBOT_WORD_WHITE,
        HEALBOT_WORD_YELLOW,
        HEALBOT_WORD_ORANGE,
        HEALBOT_WORD_PINK,
        HEALBOT_WORD_RED,
        HEALBOT_WORD_PURPLE,
        HEALBOT_WORD_AQUA,
        HEALBOT_WORD_LIME,
        HEALBOT_WORD_GREEN,
        HEALBOT_WORD_BLUE,
        HEALBOT_WORD_BROWN,
        HEALBOT_WORD_BLACK,
    }

    HealBot_Options_Lists["IndicatorAnchor"] = {
        HEALBOT_OPTIONS_TOP,
        HEALBOT_OPTIONS_BOTTOM,
        HEALBOT_OPTIONS_BUTTONLEFT,
        HEALBOT_OPTIONS_BUTTONRIGHT,
        HEALBOT_OPTIONS_TOPLEFT,
        HEALBOT_OPTIONS_BOTTOMLEFT,
        HEALBOT_OPTIONS_TOPRIGHT,
        HEALBOT_OPTIONS_BOTTOMRIGHT,
    }

    HealBot_Options_Lists["AggroIndAnchor"] = {
        HEALBOT_OPTIONS_TOP,
        HEALBOT_OPTIONS_BOTTOM,
    }

    HealBot_Options_FrameAliasList()
    HealBot_Options_setCDebuffCasyBy()
end

function HealBot_Options_retAuraBarCol(val)
    return HealBot_Options_Lists["AuraBarCol"][val]
end

function HealBot_Options_retAuraIconGlow(val)
    return HealBot_Options_Lists["AuraIconGlow"][val]
end

local function HealBot_Options_ObjectsShowHide(oName,oShow)
    local g=_G[oName]
    if oShow then
        g:Show()
    else
        g:Hide()
    end
end

function HealBot_Options_ObjectsEnableDisable(oName,oEnable)
    local g=_G[oName]
    if oEnable then
        g:SetAlpha(1)
        g:Enable()
    else
        g:SetAlpha(0.4)
        g:Disable()
    end
end

local function HealBot_Options_ButtonHighlight(oName,oHighlight)
    local g=_G[oName]
    if oHighlight then
        g:LockHighlight()
    else
        g:UnlockHighlight()
    end
end

local function HealBot_Options_setCDebuffCasyByIndexed()
    for j=1, getn(HealBot_CDebuffCasyBy_List), 1 do
        HealBot_CDebuffCasyBy_Indexed_List[HealBot_CDebuffCasyBy_List[j]] = j
    end
    HealBot_Aura_setCDebuffCasyByIndexed(HealBot_CDebuffCasyBy_Indexed_List)
end

function HealBot_Options_setCDebuffCasyBy()
    if HealBot_Globals.CureCustomDefaultCastBy==2 then
        HealBot_CDebuffCasyBy_List = {
            HEALBOT_CUSTOM_CASTBY_ENEMY,
            HEALBOT_CUSTOM_CASTBY_FRIEND,
            HEALBOT_OPTIONS_SELFHEALS,
            HEALBOT_CUSTOM_CASTBY_EVERYONE,
        }
    else
        HealBot_CDebuffCasyBy_List = {
            HEALBOT_CUSTOM_CASTBY_EVERYONE,
            HEALBOT_CUSTOM_CASTBY_ENEMY,
            HEALBOT_CUSTOM_CASTBY_FRIEND,
            HEALBOT_OPTIONS_SELFHEALS,
        }
    end
    HealBot_Options_setCDebuffCasyByIndexed()
end

function HealBot_Options_framesChanged(skinUpdate, iconUpdate, indUpdate, textUpdate, auxUpdate)
    if skinUpdate or iconUpdate or indUpdate or textUpdate or auxUpdate then
        if iconUpdate then HealBot_Action_setLuVars("resetIcon", true) end
        if skinUpdate then HealBot_Action_setLuVars("resetSkin", true) end
        if indUpdate then HealBot_Action_setLuVars("resetIndicator", true) end
        if textUpdate then HealBot_Action_setLuVars("resetText", true) end
        if auxUpdate then HealBot_Action_setLuVars("resetAux", true) end
        HealBot_Timers_Set("INIT","ResetSkinAllButtons")
    end
    HealBot_Timers_Set("INIT","RefreshPartyNextRecalcAll")
end

function HealBot_Options_ToggleCustomCuresCastBy()
    if HealBot_Globals.CureCustomDefaultCastBy==2 then
        HealBot_Globals.CureCustomDefaultCastBy=1
        for dName, CastBy in pairs (HealBot_Globals.FilterCustomDebuff) do
            CastBy=CastBy+1
            if CastBy==5 then CastBy=1 end
            HealBot_Globals.FilterCustomDebuff[dName]=CastBy
        end
    else
        HealBot_Globals.CureCustomDefaultCastBy=2
        for dName, CastBy in pairs (HealBot_Globals.FilterCustomDebuff) do
            CastBy=CastBy-1
            if CastBy==0 then CastBy=4 end
            HealBot_Globals.FilterCustomDebuff[dName]=CastBy
        end
    end
    HealBot_Options_setCDebuffCasyBy()
    HealBot_Options_ResetUpdate()
end

function HealBot_Options_setClassEn()
    HealBot_Class_En = { 
                    [HEALBOT_CLASSES_ALL]="ALL",
                    [HEALBOT_DRUID]="DRUI",
                    [HEALBOT_HUNTER]="HUNT",
                    [HEALBOT_MAGE]="MAGE",
                    [HEALBOT_PALADIN]="PALA",
                    [HEALBOT_PRIEST]="PRIE",
                    [HEALBOT_ROGUE]="ROGU",
                    [HEALBOT_SHAMAN]="SHAM",
                    [HEALBOT_WARLOCK]="WARL",
                    [HEALBOT_WARRIOR]="WARR",
                    [HEALBOT_EVOKER]="EVOK",
                    [HEALBOT_DEATHKNIGHT]="DEAT",
                    [HEALBOT_MONK]="MONK",
                    [HEALBOT_DEMONHUNTER]="DEMO",
    }
end
HealBot_Options_setClassEn()

function HealBot_Options_FrameAliasList()
    if HEALBOT_GAME_VERSION<2 then 
        if Healbot_Config_Skins.FrameAlias and Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin] then
            HealBot_Options_HealGroupsFrame_List = {
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][1]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 1",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][2]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 2",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][3]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 3",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][4]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 4",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][5]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 5",
                "--------",
                HEALBOT_OPTIONS_PETHEALS_en,
                HEALBOT_OPTIONS_TARGETHEALS_en,
                "--------",
                HEALBOT_CUSTOM_CASTBY_ENEMY_en,
            }
        else
            HealBot_Options_HealGroupsFrame_List = {
                HEALBOT_OPTIONS_FRAME.." 1",
                HEALBOT_OPTIONS_FRAME.." 2",
                HEALBOT_OPTIONS_FRAME.." 3",
                HEALBOT_OPTIONS_FRAME.." 4",
                HEALBOT_OPTIONS_FRAME.." 5",
                "--------",
                HEALBOT_OPTIONS_PETHEALS_en,
                HEALBOT_OPTIONS_TARGETHEALS_en,
                "--------",
                HEALBOT_CUSTOM_CASTBY_ENEMY_en,
            }
        end
    elseif HEALBOT_GAME_VERSION<3 then 
        if Healbot_Config_Skins.FrameAlias and Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin] then
            HealBot_Options_HealGroupsFrame_List = {
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][1]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 1",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][2]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 2",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][3]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 3",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][4]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 4",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][5]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 5",
                "--------",
                HEALBOT_OPTIONS_PETHEALS_en,
                HEALBOT_OPTIONS_TARGETHEALS_en,
                HEALBOT_FOCUS_en,
                HEALBOT_CUSTOM_CASTBY_ENEMY_en,
            }
        else
            HealBot_Options_HealGroupsFrame_List = {
                HEALBOT_OPTIONS_FRAME.." 1",
                HEALBOT_OPTIONS_FRAME.." 2",
                HEALBOT_OPTIONS_FRAME.." 3",
                HEALBOT_OPTIONS_FRAME.." 4",
                HEALBOT_OPTIONS_FRAME.." 5",
                "--------",
                HEALBOT_OPTIONS_PETHEALS_en,
                HEALBOT_OPTIONS_TARGETHEALS_en,
                HEALBOT_FOCUS_en,
                HEALBOT_CUSTOM_CASTBY_ENEMY_en,
            }
        end
    else
        if Healbot_Config_Skins.FrameAlias and Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin] then
            HealBot_Options_HealGroupsFrame_List = {
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][1]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 1",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][2]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 2",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][3]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 3",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][4]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 4",
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][5]["ALIAS"] or HEALBOT_OPTIONS_FRAME.." 5",
                HEALBOT_VEHICLE_en,
                HEALBOT_OPTIONS_PETHEALS_en,
                HEALBOT_OPTIONS_TARGETHEALS_en,
                HEALBOT_FOCUS_en,
                HEALBOT_CUSTOM_CASTBY_ENEMY_en,
            }
        else
            HealBot_Options_HealGroupsFrame_List = {
                HEALBOT_OPTIONS_FRAME.." 1",
                HEALBOT_OPTIONS_FRAME.." 2",
                HEALBOT_OPTIONS_FRAME.." 3",
                HEALBOT_OPTIONS_FRAME.." 4",
                HEALBOT_OPTIONS_FRAME.." 5",
                HEALBOT_VEHICLE_en,
                HEALBOT_OPTIONS_PETHEALS_en,
                HEALBOT_OPTIONS_TARGETHEALS_en,
                HEALBOT_FOCUS_en,
                HEALBOT_CUSTOM_CASTBY_ENEMY_en,
            }
        end
    end
end

local HealBot_Buff_Spells_Class_List={}
local HealBot_Buff_Spells_List ={}
local Buff_WeaponEnchant_List={[1]={}, [2]={}}
function HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, id)
    local exists=false
    for j=1, getn(Buff_WeaponEnchant_List[id]) do
        if Buff_WeaponEnchant_List[id][j]==sName then
            exists=true
            break;
        end
    end
    if not exists then
        table.insert(Buff_WeaponEnchant_List[id], sName)
    end
end

function HealBot_Options_UpdateBuffSpellsWeaponEnchantList()
    local sName=nil
    if HEALBOT_GAME_VERSION<4 then
        sName=GetItemInfo(HEALBOT_BRILLIANT_MANA_OIL_SPELL)
        if sName then HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1) end
        sName=GetItemInfo(HEALBOT_BRILLIANT_WIZARD_OIL_SPELL)
        if sName then HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1) end
        sName=GetItemInfo(HEALBOT_BLESSED_WIZARD_OIL_SPELL)
        if sName then HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1) end
        if HEALBOT_GAME_VERSION>1 then
            sName=GetItemInfo(HEALBOT_SUPERIOR_MANA_OIL_SPELL)
            if sName then HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1) end
            sName=GetItemInfo(HEALBOT_SUPERIOR_WIZARD_OIL_SPELL)
            if sName then HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1) end
        end
    end
    table.sort(Buff_WeaponEnchant_List[1])
    table.sort(Buff_WeaponEnchant_List[2])
    table.insert(Buff_WeaponEnchant_List[1], 1, HEALBOT_WORDS_NONE)
    table.insert(Buff_WeaponEnchant_List[2], 1, HEALBOT_WORDS_NONE)
end

function HealBot_Options_InitBuffSpellsClassList(tClass)
	local Buff_Spells_List={}
    Buff_WeaponEnchant_List={[1]={}, [2]={}}
    HealBot_Options_UpdateBuffSpellsWeaponEnchantList()

    if tClass=="DEAT" then
        Buff_Spells_List = {
            HEALBOT_HORN_OF_WINTER,
            HEALBOT_BONE_SHIELD,
        }
    elseif tClass=="DEMO" then -- Demon Hunter
        Buff_Spells_List = {
        }
    elseif tClass=="DRUI" then
        Buff_Spells_List = {
            HEALBOT_MARK_OF_THE_WILD,
            HBC_GIFT_OF_THE_WILD,
            HBC_OMEN_OF_CLARITY,
            HEALBOT_BARKSKIN,
            HEALBOT_IRONBARK,
            HBC_THORNS,
            HBC_NATURE_GRASP,
        }
    elseif tClass=="EVOK" then
        Buff_Spells_List = {
            HEALBOT_BLESSING_OF_THE_BRONZE,
            HEALBOT_SOURCE_OF_MAGIC,
        }
    elseif tClass=="HUNT" then
        Buff_Spells_List = {
            HEALBOT_A_CHEETAH,
            HEALBOT_A_PACK,
            HEALBOT_A_WILD,
            HEALBOT_TRAP_LAUNCHER,
            HEALBOT_LW_FEROCITY_OF_THE_RAPTOR ,
            HEALBOT_LW_FORTITUDE_OF_THE_BEAR,
            HEALBOT_LW_GRACE_OF_THE_CAT,
            HEALBOT_LW_HASTE_OF_THE_HYENA,
            HEALBOT_LW_POWER_OF_THE_PRIMATES,
            HEALBOT_LW_QUICKNESS_OF_THE_DRAGONHAWK,
            HEALBOT_LW_VERSATILITY_OF_THE_RAVAGER,
            HEALBOT_LW_WISDOM_OF_THE_SERPENT,
        }
    elseif tClass=="MAGE" then
        Buff_Spells_List = {
            HEALBOT_ARCANE_BRILLIANCE,
            HBC_ARCANE_BRILLIANCE,
            HBC_AMPLIFY_MAGIC,
            HEALBOT_DALARAN_BRILLIANCE,
            HEALBOT_EVOCATION,
            HEALBOT_MAGE_WARD,
            HBC_MAGE_ARMOR,
            HBC_MANA_SHIELD,
            HEALBOT_BLAZING_BARRIER,
            HEALBOT_PRISMATIC_BARRIER,
            HEALBOT_ARCANE_POWER,
            HEALBOT_SLOW_FALL,
            HEALBOT_FOCUS_MAGIC,
            HBC_FOCUS_MAGIC,
            HEALBOT_ICE_WARD,
            HEALBOT_ICE_BARRIER,
            HBC_DAMPEN_MAGIC,
            HBC_FROST_ARMOR,
            HBC_ICE_ARMOR,
            HBC_MOLTEN_ARMOR,
        }
    elseif tClass=="MONK" then
        Buff_Spells_List = {
            HEALBOT_LEGACY_EMPEROR,
            HEALBOT_LEGACY_WHITETIGER,
            HEALBOT_RUSHING_JADE_WIND,
            HEALBOT_STANCE_MONK_TIGER,
            HEALBOT_STANCE_MONK_SERPENT,
            HEALBOT_STANCE_MONK_CRANE,
        }
    elseif tClass=="PALA" then
        Buff_Spells_List = {
            HEALBOT_BLESSING_OF_MIGHT,
            HBC_BLESSING_OF_MIGHT,
            HBC_GREATER_BLESSING_OF_MIGHT,
            HBC_BLESSING_OF_SANCTUARY,
            HBC_GREATER_BLESSING_OF_SANCTUARY,
            HEALBOT_BLESSING_OF_KINGS,
            HBC_BLESSING_OF_KINGS,
            HBC_GREATER_BLESSING_OF_KINGS,
            HBC_BLESSING_OF_LIGHT,
            HBC_BLESSING_OF_SALVATION,
            HBC_GREATER_BLESSING_OF_LIGHT,
            HEALBOT_BLESSING_OF_WISDOM,
            HBC_BLESSING_OF_WISDOM,
            HBC_GREATER_BLESSING_OF_WISDOM,
            HEALBOT_HAND_OF_FREEDOM,
            HEALBOT_HAND_OF_PROTECTION,
            HEALBOT_HAND_OF_SALVATION,
            HBC_GREATER_BLESSING_OF_SALVATION,
            HEALBOT_RIGHTEOUS_FURY,
            HEALBOT_CONCENTRATION_AURA,
            HEALBOT_DEVOTION_AURA,
            HBC_RETRIBUTION_AURA,
            HBC_FIRE_RESISTANCE_AURA,
            HBC_FROST_RESISTANCE_AURA,
            HBC_SHADOW_RESISTANCE_AURA,
            HEALBOT_BEACON_OF_LIGHT,
            HEALBOT_BEACON_OF_VIRTUE,
            HEALBOT_SEAL_OF_RIGHTEOUSNESS,
            HEALBOT_SEAL_OF_INSIGHT,
            HEALBOT_SEAL_OF_JUSTICE,
            HEALBOT_SEAL_OF_COMMAND,
            HBC_SEAL_OF_COMMAND,
            HEALBOT_SEAL_OF_TRUTH,
            HBC_SEAL_OF_CORRUPTION,
            HBC_SEAL_OF_THE_CRUSADER,
            HBC_SEAL_WISDOM,
            HEALBOT_SACRED_SHIELD,
            HBC_SACRED_SHIELD,
        }
        if HEALBOT_GAME_VERSION>3 then
            local i = GetSpecialization()
            local specID = 0
            if i then specID = GetSpecializationInfo(i,false,false) end
            if specID==70 then
                table.insert(Buff_Spells_List,HEALBOT_SEAL_OF_JUSTICE)
            end
        end
    elseif tClass=="PRIE" then
        Buff_Spells_List = {
            HEALBOT_POWER_WORD_FORTITUDE,
            HBC_POWER_WORD_FORTITUDE,
            HBC_SHADOW_PROTECTION,
            HBC_TOUCH_OF_WEAKNESS,
            HBC_DIVINE_SPIRIT,
            HBC_PRAYER_OF_SHADOW_PROTECTION,
            HBC_PRAYER_OF_SPIRIT,
            HBC_INNER_FIRE,
            HEALBOT_FEAR_WARD,
            HBC_SHADOWGUARD,
            HEALBOT_SHADOWFORM,
            HEALBOT_LEVITATE,
            HEALBOT_VAMPIRIC_EMBRACE,
        }
    elseif tClass=="ROGU" then
        Buff_Spells_List = {
            HEALBOT_DEADLY_POISON,
            HEALBOT_WOUND_POISON,
            HEALBOT_CRIPPLING_POISON,
            HEALBOT_INSTANT_POISON,
        }
    elseif tClass=="SHAM" then
        Buff_Spells_List = {
            HEALBOT_LIGHTNING_SHIELD,
            HBC_LIGHTNING_SHIELD,
            HEALBOT_EARTH_SHIELD,
            HBC_EARTH_SHIELD,
            HBC_WATER_SHIELD,
            HEALBOT_WATER_SHIELD,
            HEALBOT_WATER_WALKING,
            HEALBOT_WATER_BREATHING,
        }
        local sName=HealBot_KnownSpell(HEALBOT_FLAMETONGUE_SPELL)
        if sName then 
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1)
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 2)
        end
        sName=HealBot_KnownSpell(HEALBOT_WINDFURY_SPELL)
        if sName then HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1) end
        sName=HealBot_KnownSpell(HBC_ROCKBITER_WEAPON)
        if sName then 
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1)
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 2) 
        end
        sName=HealBot_KnownSpell(HBC_EARTHLIVING_WEAPON)
        if sName then 
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1)
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 2) 
        end
        sName=HealBot_KnownSpell(HEALBOT_EARTHLIVING_WEAPON)
        if sName then 
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1)
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 2) 
        end
        sName=HealBot_KnownSpell(HBC_FLAMETONGUE_WEAPON)
        if sName then 
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1)
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 2) 
        end
        sName=HealBot_KnownSpell(HBC_WINDFURY_WEAPON)
        if sName then 
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 1)
            HealBot_Options_InsertBuffSpellsWeaponEnchantList(sName, 2) 
        end
    elseif tClass=="WARL" then
        Buff_Spells_List = {
            HEALBOT_DEMON_ARMOR,
            HBC_DEMON_ARMOR,
            HEALBOT_FEL_ARMOR,
            HEALBOT_UNENDING_BREATH,
            HEALBOT_DARK_INTENT,
            HEALBOT_SOUL_LINK,
            HBC_DETECT_LESSER_INVISIBILITY,
            HBC_DETECT_INVISIBILITY,
            HBC_DETECT_GREATER_INVISIBILITY,
        }
    elseif tClass=="WARR" then
        Buff_Spells_List = {
            HEALBOT_BATTLE_SHOUT,
            HEALBOT_COMMANDING_SHOUT,
            HEALBOT_VIGILANCE,
        }
    elseif tClass=="WARR" then
        Buff_Spells_List = {
        }
    end
    if HEALBOT_GAME_VERSION>8 then
        table.insert(Buff_Spells_List,HEALBOT_FLESHCRAFT)
    end
	return Buff_Spells_List, Buff_WeaponEnchant_List[1], Buff_WeaponEnchant_List[2]
end

function HealBot_Options_InitBuffClassList()
    HealBot_Buff_Spells_Class_List, HealBot_Buff_WeaponEnchant_List[1], HealBot_Buff_WeaponEnchant_List[2]=HealBot_Options_InitBuffSpellsClassList(HealBot_Data["PCLASSTRIM"])
end

function HealBot_Options_InitBuffList()
    HealBot_Options_InitBuffClassList()
    HealBot_Buff_Spells_List ={}
    for x,_ in pairs(HealBot_Options_NoDuplcates) do
        HealBot_Options_NoDuplcates[x]=nil
    end 
    for j=1, getn(HealBot_Buff_Spells_Class_List), 1 do
        local spellName=HealBot_KnownSpell(HealBot_Buff_Spells_Class_List[j])
        if spellName and not HealBot_Options_NoDuplcates[spellName] then
            table.insert(HealBot_Buff_Spells_List,spellName)
            HealBot_Options_NoDuplcates[spellName]=true
        end
    end
    table.sort(HealBot_Buff_Spells_List) 
end

function HealBot_Options_GetDebuffSpells_List(class)
    local HealBot_Debuff_Spells = {}
    if HEALBOT_GAME_VERSION<3 then 
        HealBot_Debuff_Spells = {
          ["DRUI"] = {HBC_DRUID_CURE_POISON, HBC_DRUID_ABOLISH_POISON, HBC_DRUID_REMOVE_CURSE, },
          ["HUNT"] = {},
          ["MAGE"] = {HEALBOT_REMOVE_CURSE,},
          ["PALA"] = {HEALBOT_CLEANSE, HBC_PURIFY},
          ["PRIE"] = {HBC_DISPELL_MAGIC, HBC_PRIEST_CURE_DISEASE, HBC_PRIEST_ABOLISH_DISEASE},
          ["ROGU"] = {},
          ["SHAM"] = {HBC_SHAMAN_CURE_POISON, HBC_SHAMAN_CURE_DISEASE},
          ["WARL"] = {},
          ["WARR"] = {},
        }
    elseif HEALBOT_GAME_VERSION<4 then 
        HealBot_Debuff_Spells = {
          ["DEAT"] = {},
          ["DRUI"] = {HBC_DRUID_CURE_POISON, HBC_DRUID_ABOLISH_POISON, HBC_DRUID_REMOVE_CURSE, },
          ["HUNT"] = {},
          ["MAGE"] = {HEALBOT_REMOVE_CURSE,},
          ["PALA"] = {HEALBOT_CLEANSE, HBC_PURIFY},
          ["PRIE"] = {HBC_DISPELL_MAGIC, HBC_PRIEST_CURE_DISEASE, HBC_PRIEST_ABOLISH_DISEASE},
          ["ROGU"] = {},
          ["SHAM"] = {HBC_SHAMAN_CURE_POISON, HEALBOT_CLEANSE_SPIRIT},
          ["WARL"] = {},
          ["WARR"] = {},
        }
    else
        HealBot_Debuff_Spells = {
          ["DEAT"] = {},
          ["DEMO"] = {}, -- Demon Hunter
          ["DRUI"] = {HEALBOT_REMOVE_CORRUPTION, HEALBOT_NATURES_CURE,},
          ["HUNT"] = {},
          ["MAGE"] = {HEALBOT_REMOVE_CURSE,},
          ["MONK"] = {HEALBOT_DETOX,},
          ["PALA"] = {HEALBOT_CLEANSE, HEALBOT_CLEANSE_TOXIN},
          ["PRIE"] = {HEALBOT_PURIFY, HEALBOT_MASS_DISPEL, HEALBOT_PURIFY_DISEASE},
          ["ROGU"] = {},
          ["SHAM"] = {HEALBOT_PURIFY_SPIRIT, HEALBOT_CLEANSE_SPIRIT},
          ["WARL"] = {},
          ["WARR"] = {},
          ["EVOK"] = {HEALBOT_NATURALIZE,HEALBOT_CAUTERIZING_FLAME,HEALBOT_EXPUNGE,},
        }
    end
    --if (strsub(GetLocale(),1,2)~="en") then
    --    HealBot_Debuff_Spells["SHAM"] = {HEALBOT_CLEANSE_SPIRIT}
    --end
    return HealBot_Debuff_Spells[class]
end

function HealBot_Options_GetRacialDebuffSpells_List(race)
    local HealBot_Racial_Debuff_Spells = {
      ["Human"] = {},
      ["Dwarf"] = {HEALBOT_STONEFORM,},
      ["Night Elf"] = {},
      ["Gnome"] = {},
      ["Draenei"] = {HEALBOT_GIFT_OF_THE_NAARU,},
      ["Pandaren"] = {},
      ["Orc"] = {},
      ["Undead"] = {},
      ["Tauren"] = {},
      ["Troll"] = {}, 
      ["Blood Elf"] = {},
      ["Goblin"] = {},
      ["Worgen"] = {HEALBOT_DARKFLIGHT,},
      ["Highmountain Tauren"] = {},
      ["Void Elf"] = {},
      ["Lightforged Draenei"] = {},
      ["Nightborne"] = {},
    }
    local rArray = {}
    if HealBot_Racial_Debuff_Spells[race] then
        rArray = HealBot_Racial_Debuff_Spells[race]
    end
    return rArray
end



function HealBot_Options_setDebuffTypes()
    if HEALBOT_GAME_VERSION>9 then 
        if HealBot_Options_luVars["PriestImprovedPurify"] then
            HealBot_Debuff_Types[HEALBOT_PURIFY] = {HEALBOT_MAGIC_en, HEALBOT_DISEASE_en}
        else
            HealBot_Debuff_Types[HEALBOT_PURIFY] = {HEALBOT_MAGIC_en}
        end
        if HealBot_Options_luVars["PaladinImprovedCleanse"] then
            HealBot_Debuff_Types[HEALBOT_CLEANSE] = {HEALBOT_DISEASE_en, HEALBOT_POISON_en, HEALBOT_MAGIC_en}
        else
            HealBot_Debuff_Types[HEALBOT_CLEANSE] = {HEALBOT_MAGIC_en}
        end
        if HealBot_Options_luVars["ShamanImprovedPurifySpirit"] then
            HealBot_Debuff_Types[HEALBOT_PURIFY_SPIRIT] = {HEALBOT_MAGIC_en, HEALBOT_CURSE_en}
        else
            HealBot_Debuff_Types[HEALBOT_PURIFY_SPIRIT] = {HEALBOT_MAGIC_en}
        end
    end
end

function HealBot_Options_ReloadUI(reason)
    local msg=HEALBOT_OPTIONS_RELOADUIMSG
    if reason then msg=reason.."\n"..msg end
    StaticPopupDialogs["HEALBOT_OPTIONS_RELOADUI"] = {
        text = msg,
        button1 = HEALBOT_WORDS_YES,
        button2 = HEALBOT_WORDS_NO,
        OnAccept = function()
            ReloadUI();
        end,
        timeout = 0,
        whileDead = 1,
        hideOnEscape = 1
    };

    StaticPopup_Show ("HEALBOT_OPTIONS_RELOADUI");
end

local retIsDebuffSpell=""
function HealBot_Options_retIsDebuffSpell(spellID)
    retIsDebuffSpell = GetSpellInfo(spellID) or GetItemInfoInstant(spellID) or spellID
    if HealBot_Debuff_Types[retIsDebuffSpell] then
        return true
    end
    return nil
end

function HealBot_Options_retDebuffWatchTarget(debuffType)
    if HealBot_DebuffSpell[debuffType] then
        return HealBot_DebuffWatchTarget[debuffType]
    else
        return nil
    end
end

function HealBot_Options_retDebuffCureSpell(debuffType)
    return HealBot_DebuffSpell[debuffType]
end

local hbDebuffSpellRemain,hbDebuffSpellStart,hbDebuffSpellDuration=0,0,0
function HealBot_Options_retDebuffWatchTargetCD(debuffType, timeNow)
    hbDebuffSpellRemain=0
    if HealBot_DebuffSpell[debuffType] then
        hbDebuffSpellStart, hbDebuffSpellDuration, _, _ = GetSpellCooldown(HealBot_DebuffSpell[debuffType]);
        if hbDebuffSpellStart and hbDebuffSpellDuration then
            if hbDebuffSpellStart>0 and hbDebuffSpellDuration>1 then 
                hbDebuffSpellRemain = hbDebuffSpellDuration-(timeNow-hbDebuffSpellStart)
            end
            return hbDebuffSpellRemain, HealBot_DebuffSpell[debuffType]
        else
            return nil, nil
        end
    else
        return nil, nil
    end
end

function HealBot_Options_retBuffWatchTarget(buffName)
    return HealBot_BuffWatchTarget[buffName]
end

local hbCustomDebuffPrio = {}
function HealBot_Options_setDebuffPriority()
    for id,_ in pairs(hbCustomDebuffPrio) do
        hbCustomDebuffPrio[id]=false
    end
    for id, x in pairs(HealBot_Globals.HealBot_Custom_Debuffs) do
        local name, _, _, _, _, _, _ = GetSpellInfo(id)
        if (HealBot_Globals.CustomDebuffIDMethod[id] or 3)<3 then
            if HealBot_Globals.CustomDebuffIDMethod[id]==1 then
                if id~=HEALBOT_CUSTOM_CAT_CUSTOM_AUTOMATIC then hbCustomDebuffPrio[id]=x end
            elseif name then 
                hbCustomDebuffPrio[name]=x
            end
        else
            if name then hbCustomDebuffPrio[name]=x end
            if id~=HEALBOT_CUSTOM_CAT_CUSTOM_AUTOMATIC then hbCustomDebuffPrio[id]=x end
        end
    end
    for id,_ in pairs(hbCustomDebuffPrio) do
        if not hbCustomDebuffPrio[id] then hbCustomDebuffPrio[id]=nil end
    end
    HealBot_Aura_setCustomDebuffFilterCastBy()
    HealBot_Timers_Set("AURA","ResetDebuffCache")
end

function HealBot_Options_retDebuffPriority(spellId, spellName, debuffType)
    if HealBot_DebuffSpell[debuffType] then
        return hbCustomDebuffPrio[spellId] or hbCustomDebuffPrio[spellName] or 89, HealBot_Config_Cures.HealBotDebuffPriority[debuffType] or 88
    else
        return hbCustomDebuffPrio[spellId] or hbCustomDebuffPrio[spellName] or 89, 88
    end
end

function HealBot_Options_OptionsThemeCols()
    return OptionThemes[HealBot_Globals.OptionsTheme]["R"],
           OptionThemes[HealBot_Globals.OptionsTheme]["G"],
           OptionThemes[HealBot_Globals.OptionsTheme]["B"],
           OptionThemes[HealBot_Globals.OptionsTheme]["A"]
end

function HealBot_Options_Pct_OnLoad(self,vText)
    self.text = vText;
    local g=_G[self:GetName().."Text"]
    g:SetText(vText);
    g=_G[self:GetName().."Low"]
    g:SetText("0%");
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    g=_G[self:GetName().."High"]
    g:SetText("100%");
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    self:SetMinMaxValues(0.00,1.00);
    self:SetValueStep(0.01);
    self:SetStepsPerPage(5);
end

function HealBot_Options_Pct_OnLoad_MinMax(self,vText,Min,Max,Step,pageStep)
    self.text = vText;
    local StepsPerPage=pageStep or 0.05
    local i=(Min*100).."%";
    local j=(Max*100).."%";

    local g=_G[self:GetName().."Text"]
    g:SetText(vText);
    g=_G[self:GetName().."Low"]
    g:SetText(i);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    g=_G[self:GetName().."High"]
    g:SetText(j);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    self:SetMinMaxValues(Min,Max);
    self:SetValueStep(Step);
    self:SetStepsPerPage(StepsPerPage);
end

function HealBot_Options_val_OnLoad(self,vText,Min,Max,Step,pageStep)
    self.text = vText;
    local StepsPerPage=pageStep or HealBot_Options_getStepsPerPage(Max,Step)
    local g=_G[self:GetName().."Text"]
    g:SetText(vText);
    g=_G[self:GetName().."Low"]
    g:SetText(Min);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    g=_G[self:GetName().."High"]
    g:SetText(Max);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    self:SetMinMaxValues(Min,Max);
    self:SetValueStep(Step);
    self:SetStepsPerPage(StepsPerPage);
end

function HealBot_Options_val2_OnLoad(self,vText,Min,Max,Step,vDiv,pageStep)
    self.text = vText;
    local StepsPerPage=pageStep or HealBot_Options_getStepsPerPage(Max,Step)
    local g=_G[self:GetName().."Text"]
    g:SetText(vText);
    g=_G[self:GetName().."Low"]
    g:SetText(Min/vDiv);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    g=_G[self:GetName().."High"]
    g:SetText(Max/vDiv);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    self:SetMinMaxValues(Min,Max);
    self:SetValueStep(Step);
    self:SetStepsPerPage(StepsPerPage);
end

function HealBot_Options_sliderlabels_Init(self,vText,Min,Max,Step,pageStep,lowTxt,highTxt)
    self.text = vText;
    local StepsPerPage=pageStep or HealBot_Options_getStepsPerPage(Max,Step)
    local g=_G[self:GetName().."Text"]
    g:SetText(vText);
    g=_G[self:GetName().."Low"]
    g:SetText(lowTxt);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    g=_G[self:GetName().."High"]
    g:SetText(highTxt);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    self:SetMinMaxValues(Min,Max);
    self:SetValueStep(Step);
    self:SetStepsPerPage(StepsPerPage);
end

function HealBot_Options_valtime_OnLoad(self,vText,Min,Max,Step,pageStep)
    self.text = vText;
    local StepsPerPage=pageStep or 2 --HealBot_Options_getStepsPerPage(Max,Step)
    local g=_G[self:GetName().."Text"]
    g:SetText(vText);
    g=_G[self:GetName().."Low"]
    g:SetText(Min/60);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    g=_G[self:GetName().."High"]
    g:SetText(Max/60);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    self:SetMinMaxValues(Min,Max);
    self:SetValueStep(Step);
    self:SetStepsPerPage(StepsPerPage);
end

function HealBot_Options_getStepsPerPage(Max,Step)
    local i=ceil(Max/10)
    if i<Step then i=Step end
    if i>20 then
        i=10
    elseif i>5 then
        i=5
    elseif i>2 then
        i=2
    end
    return i
end

function HealBot_Options_SetText(self,vText)
    local g=_G[self:GetName().."Text"]
    g:SetText(vText);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                   OptionThemes[HealBot_Globals.OptionsTheme]["A"])
end

function HealBot_Options_SetLabel(label,vText)
    local g=_G[label]
    g:SetText(vText);
    g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["A"])
end

function HealBot_Options_UIDropDownMenu_OnLoad(self, width)
    UIDropDownMenu_SetWidth(self,width)
end

function HealBot_Options_OverrideNotifyOtherMsg_OnTextChanged(self)
    HealBot_Globals.OverrideChat["MSG"] = self:GetText()
    HealBot_Timers_Set("CHAT","SetChat")
end

function HealBot_Options_NotifyOtherMsg_OnTextChanged(self)
    Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["MSG"] = self:GetText()
    HealBot_Timers_Set("CHAT","SetChat")
end

function HealBot_Options_SetNoColsText()
    if Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"] then
        HealBot_Options_BarNumGroupPerCol:Hide()
        return HEALBOT_OPTIONS_SKINNUMHCOLS;
    else
        HealBot_Options_BarNumGroupPerCol:Show()
        if Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GRPCOLS"] then
            return HEALBOT_OPTIONS_SKINNUMHCOLS;
        else
            return HEALBOT_OPTIONS_SKINNUMCOLS;
        end
    end
end

function HealBot_Options_Pct_OnValueChanged(self)
    local pct = floor(self:GetValue()*100+0.5);
    local g=_G[self:GetName()]
    HealBot_Options_SetText(g, self.text .. ": " .. pct .. "%")
    --g:SetText(self.text .. " (" .. pct .. "%)");
    return self:GetValue();
end

function HealBot_Options_NewSkin_OnTextChanged(self)
    local text= self:GetText()
    if strlen(text)>0 then
        HealBot_Options_NewSkinb:Enable();
    else
        HealBot_Options_NewSkinb:Disable();
    end
end

function HealBot_Options_NewSkinb_OnClick(self)
    local skinName = HealBot_Options_NewSkin:GetText()
    if tonumber(skinName) then skinName='#'..skinName end
    HealBot_Options_setNewSkin(skinName)
end

function HealBot_Options_setNewSkin(newSkinName)
    Healbot_Config_Skins.HealBar[newSkinName]=HealBot_Options_copyTable(Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.BarTextCol[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.AuxBarText[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.BarCol[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.BarIACol[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.Frame[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.StickyFrames[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.StickyFrames[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.HeadBar[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.HeadText[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.General[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.AuxBarFrame[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.AuxBar[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.RaidIcon[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.Icons[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.BarAggro[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.BarText[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.IconText[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.IconText[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.IconSets[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.IconSetsText[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.HealGroups[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.Healing[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.Chat[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.Anchors[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin])
    HealBot_Config.SkinDefault[newSkinName] = {[HEALBOT_WORD_SOLO]=false, 
                                               [HEALBOT_WORD_PARTY]=false, 
                                               [HEALBOT_OPTIONS_RAID10]=false, 
                                               [HEALBOT_OPTIONS_RAID25]=false, 
                                               [HEALBOT_OPTIONS_RAID40]=false,
                                               [HEALBOT_WORD_ARENA]=false, 
                                               [HEALBOT_WORD_BG10]=false, 
                                               [HEALBOT_WORD_BG15]=false, 
                                               [HEALBOT_WORD_BG40]=false, 
                                               [HEALBOT_WORD_PETBATTLE]=false}
    Healbot_Config_Skins.FocusGroups[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.FocusGroups[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.BarVisibility[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.BarVisibility[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.FrameAlias[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.FrameAliasBar[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.Enemy[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.BarSort[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.DuplicateBars[newSkinName] = Healbot_Config_Skins.DuplicateBars[Healbot_Config_Skins.Current_Skin]
    Healbot_Config_Skins.Indicators[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.Emerg[newSkinName] = HealBot_Options_copyTable(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin])
    Healbot_Config_Skins.Author[newSkinName] = UnitName("Player").." "..HEALBOT_PLAYER_OF_REALM.." "..GetRealmName()
    if not HealBot_Options_checkSkinName(newSkinName) then
        table.insert(Healbot_Config_Skins.Skins,2,newSkinName)
        Healbot_Config_Skins.Skin_ID = 2;
    end
    HealBot_Options_Set_Current_Skin(newSkinName, nil, nil, true)
    HealBot_Options_NewSkin:SetText("")
end

function HealBot_Options_copyTable(t)
    if t == nil then return nil end
    local nt = {}
    for k, v in pairs(t) do
        if type(v) == 'table' then
            nt[k] = HealBot_Options_copyTable(v)
        else
            nt[k] = v
        end
    end
    return nt
end

function HealBot_Options_DeleteSkin_OnClick(self)
    if Healbot_Config_Skins.Current_Skin~=HEALBOT_SKINS_STD then
        local hbDelSkinName=HealBot_Options_SkinsText:GetText()
        if HealBot_Options_checkSkinName(hbDelSkinName) then
            Healbot_Config_Skins.HealBar[hbDelSkinName] = nil
            Healbot_Config_Skins.BarTextCol[hbDelSkinName] = nil
            Healbot_Config_Skins.BarCol[hbDelSkinName] = nil
            Healbot_Config_Skins.BarIACol[hbDelSkinName] = nil
            Healbot_Config_Skins.Frame[hbDelSkinName] = nil
            Healbot_Config_Skins.StickyFrames[hbDelSkinName] = nil
            Healbot_Config_Skins.HeadBar[hbDelSkinName] = nil
            Healbot_Config_Skins.HeadText[hbDelSkinName] = nil
            Healbot_Config_Skins.General[hbDelSkinName] = nil
            Healbot_Config_Skins.AuxBarFrame[hbDelSkinName] = nil
            Healbot_Config_Skins.AuxBar[hbDelSkinName] = nil
            Healbot_Config_Skins.RaidIcon[hbDelSkinName] = nil
            Healbot_Config_Skins.Icons[hbDelSkinName] = nil
            Healbot_Config_Skins.BarAggro[hbDelSkinName] = nil
            Healbot_Config_Skins.BarText[hbDelSkinName] = nil
            Healbot_Config_Skins.AuxBarText[hbDelSkinName] = nil
            Healbot_Config_Skins.IconText[hbDelSkinName] = nil
            Healbot_Config_Skins.IconSets[hbDelSkinName] = nil
            Healbot_Config_Skins.IconSetsText[hbDelSkinName] = nil
            Healbot_Config_Skins.HealGroups[hbDelSkinName] = nil
            Healbot_Config_Skins.Healing[hbDelSkinName] = nil
            Healbot_Config_Skins.BarVisibility[hbDelSkinName] = nil
            Healbot_Config_Skins.Chat[hbDelSkinName] = nil
            Healbot_Config_Skins.Anchors[hbDelSkinName] = nil
            HealBot_Config.SkinDefault[hbDelSkinName] = nil
            Healbot_Config_Skins.DuplicateBars[hbDelSkinName] = nil
            Healbot_Config_Skins.BarVisibility[hbDelSkinName] = nil
            Healbot_Config_Skins.Author[hbDelSkinName] = nil
            Healbot_Config_Skins.FrameAlias[hbDelSkinName] = nil
            Healbot_Config_Skins.FrameAliasBar[hbDelSkinName] = nil
            Healbot_Config_Skins.FocusGroups[hbDelSkinName] = nil
            Healbot_Config_Skins.Enemy[hbDelSkinName] = nil
            Healbot_Config_Skins.Indicators[hbDelSkinName] = nil
            Healbot_Config_Skins.Emerg[hbDelSkinName] = nil
            table.remove(Healbot_Config_Skins.Skins,Healbot_Config_Skins.Skin_ID)
            HealBot_Config.LastAutoSkinChangeTime=0
            local retryWithSkin = HealBot_getDefaultSkin()
            HealBot_Options_Set_Current_Skin(retryWithSkin, nil, nil, true)
        end
    end
end

function HealBot_Options_ShowEnemyIncSelf_OnClick(self)
    if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCSELF"]~=self:GetChecked() then
        Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCSELF"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged") 
    end
end

function HealBot_Options_ShowEnemyIncTanks_OnClick(self)
    if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCTANKS"]~=self:GetChecked() then
        Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCTANKS"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged") 
    end
end

function HealBot_Options_ShowEnemyIncFocus_OnClick(self)
    if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCFOCUS"]~=self:GetChecked() then
        Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCFOCUS"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged") 
    end
end

function HealBot_Options_ShowEnemyIncArena_OnClick(self)
    if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCARENA"]~=self:GetChecked() then
        Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCARENA"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged") 
    end
end

function HealBot_Options_ShowEnemyIncArenaPets_OnClick(self)
    if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCARENAPETS"]~=self:GetChecked() then
        Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCARENAPETS"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged") 
    end
end

function HealBot_Options_ShowEnemyIncMyTargets_OnClick(self)
    if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCMYTAR"]~=self:GetChecked() then
        Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCMYTAR"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged") 
    end
end

function HealBot_Options_ShowEnemyTargets_OnClick(self)
    if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["ENEMYTARGET"]~=self:GetChecked() then
        Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["ENEMYTARGET"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_DoubleEnemyBarWidth_OnClick(self)
    if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["DOUBLEWIDTH"]~=self:GetChecked() then
        Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["DOUBLEWIDTH"]=self:GetChecked()
        HealBot_Options_framesChanged(true, true)
    end
end

function HealBot_Options_EnemyExistsBosses_OnClick(self)
    if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["EXISTSHOWBOSS"]~=self:GetChecked() then
        Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["EXISTSHOWBOSS"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_DeleteAllCpMacros()
    if HealBot_Globals.OverrideProt and HealBot_Globals.OverrideProt["MACRONAME"] then
        DeleteMacro(HealBot_Globals.OverrideProt["MACRONAME"].."_0")
        DeleteMacro(HealBot_Globals.OverrideProt["MACRONAME"].."_1")
        DeleteMacro(HealBot_Globals.OverrideProt["MACRONAME"].."_2")
        DeleteMacro(HealBot_Globals.OverrideProt["MACRONAME"].."_3")
        DeleteMacro(HealBot_Globals.OverrideProt["MACRONAME"].."_4")
    end
    if HealBot_Config.CrashProtMacroName then
        DeleteMacro(HealBot_Config.CrashProtMacroName.."_0")
        DeleteMacro(HealBot_Config.CrashProtMacroName.."_1")
        DeleteMacro(HealBot_Config.CrashProtMacroName.."_2")
        DeleteMacro(HealBot_Config.CrashProtMacroName.."_3")
        DeleteMacro(HealBot_Config.CrashProtMacroName.."_4")
    end
end

function HealBot_Options_OverrideAfterCombatOOM_OnClick(self)
    if HealBot_Globals.OverrideChat["EOCOOM"]~=self:GetChecked() then
        HealBot_Globals.OverrideChat["EOCOOM"]=self:GetChecked()
        HealBot_Timers_Set("CHAT","SetChat")
    end
end

function HealBot_Options_AfterCombatOOM_OnClick(self)
    if Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["EOCOOM"]~=self:GetChecked() then
        Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["EOCOOM"]=self:GetChecked()
        HealBot_Timers_Set("CHAT","SetChat")
    end
end

function HealBot_Options_AuxBarOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"]~=val then
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsAuxFramesChanged")
    end
end

function HealBot_Options_AuxBarDepth_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["DEPTH"]~=val then
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["DEPTH"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsAuxFramesChanged")
    end
end

function HealBot_Options_AuxBarOpacityCustom_OnValueChanged(self)
    local val=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["A"]~=val then
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["A"] = val
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_AuxBarSize_OnValueChanged(self)
    local val=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["SIZE"]~=val then
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["SIZE"] = val
        HealBot_Timers_Set("SKINS","AuxFramesChanged")
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("LAST","AuxFramesChanged",0.05)
        HealBot_Timers_Set("LAST","TextFramesChanged",0.05)
    end
end

function HealBot_Options_OverrideAuxBarFlashFreq_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(),1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/100;
        if HealBot_Globals.OverrideEffects["OFREQ"]~=val then
            HealBot_Globals.OverrideEffects["OFREQ"] = val;
            HealBot_Timers_Set("LAST","BarFreqVars")
        end
    end
end

function HealBot_Options_OverrideBorderHazardFreq_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(),1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=1-(val/100)
        if HealBot_Globals.OverrideEffects["HAZARDFREQ"]~=val then
            HealBot_Globals.OverrideEffects["HAZARDFREQ"] = val;
            HealBot_Timers_Set("LAST","BarFreqVars")
        end
    end
end

function HealBot_Options_BorderHazardFreq_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(),1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=1-(val/100)
        if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HAZARDFREQ"]~=val then
            Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HAZARDFREQ"] = val;
            HealBot_Timers_Set("LAST","BarFreqVars")
        end
    end
end

function HealBot_Options_OverrideBorderHazardMinAlpha_OnValueChanged(self)
    if HealBot_Globals.OverrideEffects["HAZARDMINALPHA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        HealBot_Globals.OverrideEffects["HAZARDMINALPHA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("LAST","BarFreqVars")
    end
end

function HealBot_Options_BorderHazardMinAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HAZARDMINALPHA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HAZARDMINALPHA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("LAST","BarFreqVars")
    end
end

function HealBot_Options_AuxBarFlashFreq_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(),1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/100;
        if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OFREQ"]~=val then
            Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OFREQ"] = val;
            HealBot_Timers_Set("LAST","BarFreqVars")
        end
    end
end

function HealBot_Options_FocusGroupDimming_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(),1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FGDIMMING"]~=val then
            Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FGDIMMING"] = val;
            HealBot_Timers_Set("SKINS","SetFocusGroups")
        end
    end
end

function HealBot_Options_HotBarDimming_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(),1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HBDIMMING"]~=val then
            Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HBDIMMING"] = val;
            HealBot_Timers_Set("LAST","BarFreqVars")
        end
    end
end

function HealBot_Options_TooltipScale_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(),2)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else        
        val=val/100;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Globals.Tooltip_Scale = val;
        if HealBot_Options_luVars["TIPLOADED"] and HealBot_Options_luVars["OPTIONSTIPVISIBLE"] then
            HealBot_Tooltip_Hide()
            HealBot_Tooltip_SetScale()
            HealBot_Options_Show_Help("TOOLTIPSCALE",true)
        end
    end
end

function HealBot_Options_TooltipAlpha_OnValueChanged(self)
    if HealBot_Globals.Tooltip_Alpha~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        HealBot_Globals.Tooltip_Alpha = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if HealBot_Options_luVars["TIPLOADED"] and HealBot_Options_luVars["OPTIONSTIPVISIBLE"] then
            HealBot_Tooltip_Hide()
            HealBot_Options_Show_Help("TOOLTIPALPHA",true)
        end
    end
end

function HealBot_Options_OverrideFocusGroupDimming_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(),1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if HealBot_Globals.OverrideEffects["FGDIMMING"]~=val then
            HealBot_Globals.OverrideEffects["FGDIMMING"] = val;
            HealBot_Timers_Set("SKINS","SetFocusGroups")
        end
    end
end

function HealBot_Options_OverrideHotBarDimming_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(),1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if HealBot_Globals.OverrideEffects["HBDIMMING"]~=val then
            HealBot_Globals.OverrideEffects["HBDIMMING"] = val;
            HealBot_Timers_Set("LAST","BarFreqVars")
        end
    end
end

function HealBot_Options_UseOverrideFocusGroups_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    if HealBot_Globals.OverrideEffects["USE"]==1 then
        info.text = " "
        UIDropDownMenu_AddButton(info);
    else
        for j=1, getn(HealBot_Options_UseOverrideFocusGroups_List), 1 do
            info.text = HealBot_Options_UseOverrideFocusGroups_List[j];
            info.func = function(self)
                            if HealBot_Globals.OverrideEffects["FOCUSGROUPS"] ~= self:GetID() then 
                                HealBot_Globals.OverrideEffects["FOCUSGROUPS"] = self:GetID()
                                UIDropDownMenu_SetText(HealBot_Options_UseOverrideFocusGroups, HealBot_Options_UseOverrideFocusGroups_List[HealBot_Globals.OverrideEffects["FOCUSGROUPS"]])
                                HealBot_Timers_Set("SKINS","SetFocusGroups")
                            end
                        end
            info.checked = false;
            if HealBot_Globals.OverrideEffects["FOCUSGROUPS"]==j then info.checked = true end
            UIDropDownMenu_AddButton(info);
        end
    end
end

function HealBot_Options_UseFocusGroups_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    if HealBot_Globals.OverrideEffects["USE"]==2 then
        info.text = " "
        UIDropDownMenu_AddButton(info);
    else
        for j=1, getn(HealBot_Options_UseOverrideFocusGroups_List), 1 do
            info.text = HealBot_Options_UseOverrideFocusGroups_List[j];
            info.func = function(self)
                            if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FOCUSGROUPS"] ~= self:GetID() then 
                                Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FOCUSGROUPS"] = self:GetID()
                                UIDropDownMenu_SetText(HealBot_Options_UseFocusGroups, HealBot_Options_UseOverrideFocusGroups_List[Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FOCUSGROUPS"]])
                                HealBot_Timers_Set("SKINS","SetFocusGroups")
                            end
                        end
            info.checked = false;
            if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FOCUSGROUPS"]==j then info.checked = true end
            UIDropDownMenu_AddButton(info);
        end
    end
end

function HealBot_Options_HotBarDebuffPrio_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    if HealBot_Globals.OverrideEffects["USE"]==2 then
        info.text = " "
        UIDropDownMenu_AddButton(info);
    else
        for j=1, getn(HealBot_Options_Lists["HotBarsDebuffPrio"]), 1 do
            info.text = HealBot_Options_Lists["HotBarsDebuffPrio"][j];
            info.func = function(self)
                            if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HOTBARDEBUFF"] ~= self:GetID() then 
                                Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HOTBARDEBUFF"] = self:GetID()
                                UIDropDownMenu_SetText(HealBot_Options_HotBarDebuffPrio, HealBot_Options_Lists["HotBarsDebuffPrio"][Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HOTBARDEBUFF"]])
                                HealBot_Timers_Set("LAST","BarFreqVars")
                            end
                        end
            info.checked = false;
            if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HOTBARDEBUFF"]==j then info.checked = true end
            UIDropDownMenu_AddButton(info);
        end
    end
end

function HealBot_Options_OverrideHotBarDebuffPrio_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    if HealBot_Globals.OverrideEffects["USE"]==1 then
        info.text = " "
        UIDropDownMenu_AddButton(info);
    else
        for j=1, getn(HealBot_Options_Lists["HotBarsDebuffPrio"]), 1 do
            info.text = HealBot_Options_Lists["HotBarsDebuffPrio"][j];
            info.func = function(self)
                            if HealBot_Globals.OverrideEffects["HOTBARDEBUFF"] ~= self:GetID() then 
                                HealBot_Globals.OverrideEffects["HOTBARDEBUFF"] = self:GetID()
                                UIDropDownMenu_SetText(HealBot_Options_OverrideHotBarDebuffPrio, HealBot_Options_Lists["HotBarsDebuffPrio"][HealBot_Globals.OverrideEffects["HOTBARDEBUFF"]])
                                HealBot_Timers_Set("LAST","BarFreqVars")
                            end
                        end
            info.checked = false;
            if HealBot_Globals.OverrideEffects["HOTBARDEBUFF"]==j then info.checked = true end
            UIDropDownMenu_AddButton(info);
        end
    end
end

function HealBot_Options_AuxBarFlashAlphaMinMaxSet()
    if HealBot_Globals.OverrideEffects["USE"]==1 then
        HealBot_Aux_setLuVars("AUXOMIN", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMIN"])
        HealBot_Aux_setLuVars("AUXOMAX", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMAX"])
    else
        HealBot_Aux_setLuVars("AUXOMIN", HealBot_Globals.OverrideEffects["OMIN"])
        HealBot_Aux_setLuVars("AUXOMAX", HealBot_Globals.OverrideEffects["OMAX"])
    end
end

function HealBot_Options_OverrideAuxBarFlashAlphaMin_OnValueChanged(self)
    if HealBot_Globals.OverrideEffects["OMIN"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        HealBot_Globals.OverrideEffects["OMIN"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if HealBot_Globals.OverrideEffects["OMIN"]>=HealBot_Globals.OverrideEffects["OMAX"] then
            HealBot_Globals.OverrideEffects["OMAX"]=HealBot_Globals.OverrideEffects["OMIN"]+0.05
            HealBot_Options_AuxBarFlashAlphaMax:SetValue(HealBot_Globals.OverrideEffects["OMAX"])
        end
        HealBot_Timers_Set("AUX","BarFlashAlphaMinMax")
    end
end

function HealBot_Options_AuxBarFlashAlphaMin_OnValueChanged(self)
    if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMIN"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMIN"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMIN"]>=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMAX"] then
            Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMAX"]=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMIN"]+0.05
            HealBot_Options_AuxBarFlashAlphaMax:SetValue(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMAX"])
        end
        HealBot_Timers_Set("AUX","BarFlashAlphaMinMax")
    end
end

function HealBot_Options_OverrideAuxBarFlashAlphaMax_OnValueChanged(self)
    if HealBot_Globals.OverrideEffects["OMAX"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        HealBot_Globals.OverrideEffects["OMAX"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if HealBot_Globals.OverrideEffects["OMAX"]<=HealBot_Globals.OverrideEffects["OMIN"] then
            HealBot_Globals.OverrideEffects["OMIN"]=HealBot_Globals.OverrideEffects["OMAX"]-0.05
            HealBot_Options_AuxBarFlashAlphaMin:SetValue(HealBot_Globals.OverrideEffects["OMIN"])
        end
        HealBot_Timers_Set("AUX","BarFlashAlphaMinMax")
    end
end

function HealBot_Options_AuxBarFlashAlphaMax_OnValueChanged(self)
    if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMAX"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMAX"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMAX"]<=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMIN"] then
            Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMIN"]=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMAX"]-0.05
            HealBot_Options_AuxBarFlashAlphaMin:SetValue(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMIN"])
        end
        HealBot_Timers_Set("AUX","BarFlashAlphaMinMax")
    end
end

function HealBot_Options_ShowEnemyNumBoss_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["NUMBOSS"]~=val then
        Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["NUMBOSS"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_EnemyTargetSize_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["ENEMYTARGETSIZE"]~=val then
        Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["ENEMYTARGETSIZE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_ShowHeaders_OnClick(self)
    if Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"]~=self:GetChecked() then
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"] = self:GetChecked()
        if HealBot_Options_luVars["cSkin"]==Healbot_Config_Skins.Current_Skin then
            if Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"] then
                HealBot_Options_luVars["HeaderSwitchNumColsHdrOff"]=Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"]
                if HealBot_Options_luVars["HeaderSwitchNumColsHdrOn"]>0 then
                    Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"]=HealBot_Options_luVars["HeaderSwitchNumColsHdrOn"]
                else
                    Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"]=HealBot_Panel_retHeadersCols(HealBot_Options_luVars["FramesSelFrame"])
                end
            else
                HealBot_Options_luVars["HeaderSwitchNumColsHdrOn"]=Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"]
                if HealBot_Options_luVars["HeaderSwitchNumColsHdrOff"]>0 then
                    Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"]=HealBot_Options_luVars["HeaderSwitchNumColsHdrOff"]
                else
                    Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"]=HealBot_Panel_retNoCols(HealBot_Options_luVars["FramesSelFrame"])
                end
            end
        end
        HealBot_Options_BarNumColsS:SetValue(Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"] or 2)
        HealBot_Options_SetText(HealBot_Options_BarNumColsS,HealBot_Options_SetNoColsText() .. ": " .. Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"])
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end
 
function HealBot_Options_PlayBuffSound_OnClick(self)
    PlaySoundFile(LSM:Fetch('sound',sounds[HealBot_Options_BuffWarningSound:GetValue()]));    
end
    
function HealBot_Options_PlaySound_OnClick(self)
    PlaySoundFile(LSM:Fetch('sound',sounds[HealBot_Options_WarningSound:GetValue()]));    
end
    
function HealBot_Options_WarningSound_OnValueChanged(self)
    local g=nil
    local v=floor(self:GetValue()+0.5)
    if v~=self:GetValue() then
        self:SetValue(v) 
    else
        if v > 0 and sounds then
            if HealBot_Config_Cures.SoundDebuffPlay~=sounds[v] then
                HealBot_Config_Cures.SoundDebuffPlay = sounds[v];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. v..": " ..sounds[v]);
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_BuffWarningSound_OnValueChanged(self)
    local g=nil
    local v=floor(self:GetValue()+0.5)
    if v~=self:GetValue() then
        self:SetValue(v) 
    else
        if v > 0 and sounds then
            if HealBot_Config_Buffs.SoundBuffPlay~=sounds[v] then
                HealBot_Config_Buffs.SoundBuffPlay = sounds[v];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. v..": " ..sounds[v]);
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_BarTextureS_OnValueChanged(self)
    local g=nil
    local v=floor(self:GetValue()+0.5)
    if v~=self:GetValue() then
        self:SetValue(v) 
    else
        if v > 0 and hb_textures then
            if Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]~=hb_textures[v] then
                Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"] = hb_textures[v];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " "..v..": " .. hb_textures[v]);
                HealBot_Timers_Set("SKINS","SkinsFramesChanged")
                HealBot_Timers_Set("SKINS","SetSkinBars")
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_EmergBarTexture_OnValueChanged(self)
    local g=nil
    local v=floor(self:GetValue()+0.5)
    if v~=self:GetValue() then
        self:SetValue(v) 
    else
        if v > 0 and hb_textures then
            if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]~=hb_textures[v] then
                Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"] = hb_textures[v];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " "..v..": " .. hb_textures[v]);
                HealBot_Timers_Set("SKINS","SkinsFramesChanged")
                HealBot_Timers_Set("SKINS","SetSkinBars")
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_EmergBarHeight_OnValueChanged(self)
    local val=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2)
    if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"]~=val then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"] = val
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_EmergBarWidth_OnValueChanged(self)
    local val=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2)
    if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"]~=val then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"] = val
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_EmergBarEnabledOpacity_OnValueChanged(self)
    local val=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2)
    if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"]~=val then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"] = val
        HealBot_Timers_Set("SKINS","UpdateEmergBars")
    end
end

function HealBot_EmergBarOOROpacity_OnValueChanged(self)
    local val=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2)
    if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OA"]~=val then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OA"] = val
        HealBot_Timers_Set("SKINS","UpdateEmergBars")
    end
end

function HealBot_EmergBarDisabledOpacity_OnValueChanged(self)
    local val=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2)
    if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DA"]~=val then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DA"] = val
        HealBot_Timers_Set("SKINS","UpdateEmergBars")
    end
end

function HealBot_EmergBarVOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["VOFFSET"]~=val then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["VOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_EmergBarHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"]~=val then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_EmergInjTrig_OnValueChanged(self)
    local val=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2)
    if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["INJURED"]~=val then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["INJURED"] = val
        HealBot_Timers_Set("SKINS","UpdateEmergBars")
    end
end

function HealBot_EmergBarCritTrig_OnValueChanged(self)
    local val=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2)
    if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CRITICAL"]~=val then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CRITICAL"] = val
        HealBot_Timers_Set("SKINS","UpdateEmergBars")
    end
end

function HealBot_Options_FramePadding_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PADDING"]~=val then
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PADDING"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_FrameStickyOffsetHorizontal_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFOFFSETH"]~=val then
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFOFFSETH"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","FramesSetPoint")
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_FrameStickyOffsetVertical_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFOFFSETV"]~=val then
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFOFFSETV"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","FramesSetPoint")
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_OverrideAfterCombatOOMValue_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif HealBot_Globals.OverrideChat["EOCOOMV"]~=val then
        HealBot_Globals.OverrideChat["EOCOOMV"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val .. "%");
        HealBot_Timers_Set("CHAT","SetChat")
    end
end

function HealBot_Options_AfterCombatOOMValue_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["EOCOOMV"]~=val then
        Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["EOCOOMV"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val .. "%");
        HealBot_Timers_Set("CHAT","SetChat")
    end
end

function HealBot_FrameScale_OnValueChanged(self)
--    local val=floor(self:GetValue()+0.5)
    local val=HealBot_Comm_round(self:GetValue(), 1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCALE"]~=val then
            Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCALE"] = val;
            local g=_G[self:GetName().."Text"]
            g:SetText(self.text .. ": " .. val);
            HealBot_Timers_Set("SKINS","AllFramesChanged")
            HealBot_Timers_Set("LAST","UpdateButtonGlow")
        end
    end
end

function HealBot_BarButtonMaxDebuffIcons_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["MAXDICONS"]~=val then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["MAXDICONS"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
        HealBot_Timers_Set("AURA","CheckUnits")
        HealBot_Timers_Set("AURA","RemoveUnusedDebuffIcons")
    end
end

function HealBot_BarButtonDebuffIconVOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DVOFFSET"]~=val then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DVOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_BarButtonDebuffIconHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DHOFFSET"]~=val then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DHOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_BarButtonBuffIconVOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BVOFFSET"]~=val then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BVOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_BarButtonBuffIconHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BHOFFSET"]~=val then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BHOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_BarButtonMaxBuffIcons_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["MAXBICONS"]~=val then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["MAXBICONS"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
        HealBot_Timers_Set("AURA","CheckUnits")
        HealBot_Timers_Set("AURA","RemoveUnusedBuffIcons")
    end
end

function HealBot_BarButtonIconSpacer_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BICONSPACER"]~=val then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BICONSPACER"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_BarButtonDebuffIconSpacer_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DICONSPACER"]~=val then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DICONSPACER"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_BarButtonIconScale_OnValueChanged(self)
--    local val=floor(self:GetValue()+0.5)
    local val=HealBot_Comm_round(self:GetValue(), 1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BSCALE"]~=val then
            Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BSCALE"] = val;
            local g=_G[self:GetName().."Text"]
            g:SetText(self.text .. ": " .. val);
            HealBot_Timers_Set("SKINS","IconsFramesChanged")
            HealBot_Timers_Set("LAST","UpdateButtonGlow",0.2)
        end
    end
end

function HealBot_BarDebuffButtonIconScale_OnValueChanged(self)
--    local val=floor(self:GetValue()+0.5)
    local val=HealBot_Comm_round(self:GetValue(), 1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DSCALE"]~=val then
            Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DSCALE"] = val;
            local g=_G[self:GetName().."Text"]
            g:SetText(self.text .. ": " .. val);
            HealBot_Timers_Set("SKINS","IconsFramesChanged")
        end
    end
end

function HealBot_BarButtonIconFadeStartTime_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(), 0)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DFADESECS"]~=val then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DFADESECS"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val .. " " .. HEALBOT_WORDS_SEC);
    end
end

function HealBot_BarButtonIconBuffFadeStartTime_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(), 0)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFFADESECS"]~=val then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFFADESECS"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val .. " " .. HEALBOT_WORDS_SEC);
    end
end

function HealBot_BarButtonIconTextScale_OnValueChanged(self)
--    local val=floor(self:GetValue()+0.5)
    local val=HealBot_Comm_round(self:GetValue(), 1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBHEIGHT"]~=val then
        Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBHEIGHT"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_BarButtonIconBuffTextScale_OnValueChanged(self)
--    local val=floor(self:GetValue()+0.5)
    local val=HealBot_Comm_round(self:GetValue(), 1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFHEIGHT"]~=val then
        Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFHEIGHT"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_BarButtonIconTextDurationTime_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBDURTHRH"]~=val then
        Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBDURTHRH"]=val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBDURTHRH"]);
    end
end

function HealBot_BarButtonIconBuffTextDurationTime_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDURTHRH"]~=val then
        Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDURTHRH"]=val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDURTHRH"]);
    end
end

function HealBot_BarButtonIconTextDurationWarn_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBDURWARN"]~=val then
        Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBDURWARN"]=val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBDURWARN"]);
    end
end

function HealBot_BarButtonIconBuffTextDurationWarn_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDURWARN"]~=val then
        Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDURWARN"]=val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDURWARN"]);
    end
end

function HealBot_Options_HeadTextureS_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 and hb_textures then
            if Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]~=hb_textures[val] then
                Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"] = hb_textures[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " " .. val..": " .. hb_textures[val]);
                HealBot_Timers_Set("SKINS","SkinsFramesChanged")
                HealBot_Timers_Set("SKINS","SetSkinBars")
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_SkinFrameAliasTextureS_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val>0 and hb_textures then
            if Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]~=hb_textures[val] then
                Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"] = hb_textures[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " " .. val..": " .. hb_textures[val]);
                HealBot_Timers_Set("SKINS","SkinsFramesChanged")
                HealBot_Timers_Set("SKINS","SetSkinBars")
                HealBot_Timers_Set("SKINS","FrameAliases")
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_HeadFontNameS_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 then
            if fonts and Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]~=fonts[val] then
                Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"] = fonts[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. val..": " ..fonts[val]);
                HealBot_Timers_TextFramesChanged()
                HealBot_Options_SetSkinText()
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_BarButtonIconFont_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 then
            if fonts and Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBFONT"]~=fonts[val] then
                Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBFONT"] = fonts[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. val..": " ..fonts[val]);
                HealBot_UpdateUsedMedia("font")
                HealBot_Timers_Set("SKINS","IconsFramesChanged")
                HealBot_Timers_Set("SKINS","SetSkinText")
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_BarButtonIconBuffFont_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 then
            if fonts and Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFFONT"]~=fonts[val] then
                Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFFONT"] = fonts[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. val..": " ..fonts[val]);
                HealBot_UpdateUsedMedia("font")
                HealBot_Timers_Set("SKINS","IconsFramesChanged")
                HealBot_Timers_Set("SKINS","SetSkinText")
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_AliasFontName_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 then
            if fonts and Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]~=fonts[val] then
                Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"] = fonts[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. val..": " ..fonts[val]);
                HealBot_UpdateUsedMedia("font")
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end   
        if val>0 then
            HealBot_Timers_Set("SKINS","FrameAliases")
            HealBot_Timers_Set("SKINS","SetSkinText")
        end
    end
end

function HealBot_Options_HeadFontHeightS_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"]~=val then
        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_HeadFontOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"]~=val then
        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_SkinFrameAliasHeightS_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"]~=val then
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"] = val
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","FrameAliases")
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_SkinFrameAliasOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"]~=val then
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"] = val
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","FrameAliases")
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_SkinFrameAliasWidthS_OnValueChanged(self)
    local val=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2)
    if Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"]~=val then 
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"]=val
        HealBot_Timers_Set("SKINS","FrameAliases")
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_AliasFontHeight_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIZE"]~=val then
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIZE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","FrameAliases")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_AliasFontOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"]~=val then
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","FrameAliases")
    end
end

function HealBot_Options_BarHeightS_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"]~=val then
        Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Options_framesChanged(true, true)
        HealBot_Timers_Set("LAST","UpdateButtonGlow",0.2)
    end
end

function HealBot_Options_BarWidthS_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"]~=val then
        Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Options_framesChanged(true, false, false, false, true)
        HealBot_Text_setTextLen(HealBot_Options_luVars["FramesSelFrame"])
        HealBot_Timers_Set("SKINS","TextUpdateNames")
        HealBot_Timers_Set("SKINS","TextUpdateHealth")
        HealBot_Timers_Set("LAST","UpdateButtonGlow",0.2)
    end
end

function HealBot_Options_BarNumColsS_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"]~=val then
        Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(HealBot_Options_SetNoColsText() .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_BarBRSpaceS_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RMARGIN"]~=val then
        Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RMARGIN"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_BarBCSpaceS_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CMARGIN"]~=val then
        Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CMARGIN"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_FontName_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 then
            if fonts and Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]~=fonts[val] then
                Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"] = fonts[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. val..": " ..fonts[val]);
                HealBot_Timers_TextFramesChanged()
                HealBot_Options_SetSkinText()
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_StateFontName_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 then
            if fonts and Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFONT"]~=fonts[val] then
                Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFONT"] = fonts[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. val..": " ..fonts[val]);
                HealBot_Timers_TextFramesChanged()
                HealBot_Options_SetSkinText()
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_AuxFontName_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 then
            if fonts and Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]~=fonts[val] then
                Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["FONT"] = fonts[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. val..": " ..fonts[val]);
                HealBot_Timers_TextFramesChanged()
                HealBot_Options_SetSkinText()
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_HealthFontName_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 then
            if fonts and Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HFONT"]~=fonts[val] then
                Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HFONT"] = fonts[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. val..": " ..fonts[val]);
                HealBot_Timers_TextFramesChanged()
                HealBot_Options_SetSkinText()
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_TooltipHeaderFont_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 then
            if fonts and HealBot_Globals.Tooltip_HeaderFont~=fonts[val] then
                HealBot_Globals.Tooltip_HeaderFont = fonts[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. val..": " ..fonts[val]);
                HealBot_Timers_Set("LAST","LoadTips")
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_TooltipDetailFont_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 then
            if fonts and HealBot_Globals.Tooltip_DetailFont~=fonts[val] then
                HealBot_Globals.Tooltip_DetailFont = fonts[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. val..": " ..fonts[val]);
                HealBot_Timers_Set("LAST","LoadTips")
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_AggroFontName_OnValueChanged(self)
    local g=nil
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if val > 0 then
            if fonts and Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AFONT"]~=fonts[val] then
                Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AFONT"] = fonts[val];
                g=_G[self:GetName().."Text"]
                g:SetText(self.text .. " ".. val..": " ..fonts[val]);
                HealBot_Timers_TextFramesChanged()
                HealBot_Options_SetSkinText()
            end
        else
            g=_G[self:GetName().."Text"]
            g:SetText(self.text);
        end
    end
end

function HealBot_Options_FontOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"]~=val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_StateFontOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOFFSET"]~=val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_AuxFontOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"]~=val then
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("AUX","UpdateAllAuxByType")
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_AuxFontHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"] ~= val then
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Panel_setLuVars("resetAuxText", true)
        HealBot_Timers_Set("SKINS","TextFramesChanged")
    end
end

function HealBot_Options_HealthFontOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"]~=val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("AUX","UpdateAllAuxByType")
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_AggroFontOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOFFSET"]~=val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_FontHeight_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"]~=val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_StateFontHeight_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHEIGHT"]~=val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHEIGHT"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_AuxFontHeight_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"]~=val then
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_HealthFontHeight_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HHEIGHT"]~=val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HHEIGHT"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_AggroFontHeight_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AHEIGHT"]~=val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AHEIGHT"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

local HealBot_Alignment = { [1]=HEALBOT_OPTIONS_BUTTONLEFT, [2]=HEALBOT_OPTIONS_BUTTONMIDDLE, [3]=HEALBOT_OPTIONS_BUTTONRIGHT }

function HealBot_Options_NameTextHorOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET2"] ~= val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET2"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
    end
end

function HealBot_Options_HealthTextHorOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET2"] ~= val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET2"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
    end
end

function HealBot_Options_AggroTextHorOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOFFSET2"] ~= val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOFFSET2"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
    end
end

function HealBot_Options_StateTextHorOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOFFSET2"] ~= val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOFFSET2"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
    end
end

function HealBot_Options_TextOutLine_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"] ~= val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " ..HealBot_Options_FontOutline_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]]);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_StateTextOutLine_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOUTLINE"] ~= val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOUTLINE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " ..HealBot_Options_FontOutline_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOUTLINE"]]);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_AuxTextOutLine_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"] ~= val then
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " ..HealBot_Options_FontOutline_List[Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]]);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_HealthTextOutLine_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOUTLINE"] ~= val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOUTLINE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " ..HealBot_Options_FontOutline_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOUTLINE"]]);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_AggroTextOutLine_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOUTLINE"] ~= val then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOUTLINE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " ..HealBot_Options_FontOutline_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOUTLINE"]]);
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","SetSkinText")
    end
end

function HealBot_Options_MaxChars_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MAXCHARS"] ~= val then
        local g=_G[self:GetName().."Text"]
        if val==0 then
            g:SetText(self.text .. ": "..HEALBOT_WORD_AUTO)
        else
            g:SetText(self.text .. ": ".. val)
        end
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MAXCHARS"] = val
        HealBot_Text_setTextLen(HealBot_Options_luVars["FramesSelFrame"])
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","TextUpdateNames")
    end
end

function HealBot_Options_AuxMaxChars_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["MAXCHARS"] ~= val then
        local g=_G[self:GetName().."Text"]
        if val==0 then
            g:SetText(self.text .. ": "..HEALBOT_WORD_AUTO)
        else
            g:SetText(self.text .. ": ".. val)
        end
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["MAXCHARS"] = val
        HealBot_Text_setTextLen(HealBot_Options_luVars["FramesSelFrame"])
        HealBot_Timers_Set("SKINS","TextFramesChanged")
    end
end

function HealBot_Options_HealthMaxChars_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HMAXCHARS"] ~= val then
        local g=_G[self:GetName().."Text"]
        if val==0 then
            g:SetText(self.text .. ": "..HEALBOT_WORD_AUTO)
        else
            g:SetText(self.text .. ": ".. val)
        end
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HMAXCHARS"] = val
        HealBot_Text_setTextLen(HealBot_Options_luVars["FramesSelFrame"])
        HealBot_Timers_Set("SKINS","TextFramesChanged")
        HealBot_Timers_Set("SKINS","TextUpdateHealth")
    end
end

function HealBot_Options_ActionAlpha_OnValueChanged(self)
    Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
end

function HealBot_Options_BarAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("SKINS","SkinsFormat")
    end
end

function HealBot_Options_HeadWidthS_OnValueChanged(self)
    if Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_HeadHightS_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"]~=val then
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"] = val
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_BarAlphaInHeal_OnValueChanged(self)
    if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("SKINS","SkinsFormat")
    end
end

function HealBot_Options_BarAlphaAbsorb_OnValueChanged(self)
    if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("SKINS","SkinsFormat")
    end
end

function HealBot_Options_BarAlphaBackGround_OnValueChanged(self)
    if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("SKINS","SkinsFormat")
        HealBot_Timers_Set("SKINS","UpdateBackground")
    end
end

function HealBot_Options_BarAlphaBorder_OnValueChanged(self)
    if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("SKINS","SkinsFormat")
        HealBot_Timers_Set("SKINS","UpdateBackground")
    end
end

function HealBot_Options_NameTextAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    end
end

function HealBot_Options_StateTextAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    end
end

function HealBot_Options_AuxTextAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_AuxTextDisAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLDA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLDA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_HealthTextAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    end
end

function HealBot_Options_AggroTextAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    end
end

function HealBot_Options_NameTextDisAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCDA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCDA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    end
end

function HealBot_Options_StateTextDisAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCDA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCDA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    end
end

function HealBot_Options_HealthTextDisAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCDA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCDA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    end
end

function HealBot_Options_AggroTextDisAlpha_OnValueChanged(self)
    if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACDA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACDA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    end
end

function HealBot_Options_NameTextColourDebuff_OnClick(self)
    if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDEBUFF"]~=self:GetChecked() then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDEBUFF"] = self:GetChecked()
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    end
end

function HealBot_Options_HealthTextColourDebuff_OnClick(self)
    if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HDEBUFF"]~=self:GetChecked() then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HDEBUFF"] = self:GetChecked()
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    end
end

function HealBot_Options_BarOutlineBackGround_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BOUT"]~=val then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BOUT"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_BarSizeBorder_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORSIZE"]~=val then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORSIZE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_BarAlphaDis_OnValueChanged(self)
    if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DISA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DISA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("SKINS","SkinsFormat")
        HealBot_Timers_Set("AURA","UpdateAllIcons")
    end
end

function HealBot_Options_BarAlphaEor_OnValueChanged(self)
    if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ORA"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ORA"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("SKINS","SkinsFormat")
    end
end

function HealBot_Options_TipMaxButtons_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        HealBot_Globals.Tooltip_MaxButtons = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
    end
end

function HealBot_Options_TooltipHeaderFontSize_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        HealBot_Globals.Tooltip_HeaderFontSize = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val)
        HealBot_Timers_Set("LAST","LoadTips")
    end
end

function HealBot_Options_TooltipDetailFontSize_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        HealBot_Globals.Tooltip_DetailFontSize = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val)
        HealBot_Timers_Set("LAST","LoadTips")
    end
end

function HealBot_Options_Tooltip_ShowCustomAnchor(self)
    if HealBot_Data["TIPUSE"] then 
        HealBot_Tooltip_ShowCustomAnchor()
    end
end

function HealBot_Options_ClassColours()
    StaticPopupDialogs["HEALBOT_OPTIONS_CLASSCOL"] = {
        text = HEALBOT_OPTIONS_WARN_CLASSCOL,
        button1 = CLOSE,
        timeout = 0,
        whileDead = 1,
        hideOnEscape = 1
    };
    StaticPopup_Show("HEALBOT_OPTIONS_CLASSCOL");
end

local HealBot_ColourObjWaiting, HealBot_ColourObjWaitingExtra=nil,nil
function HealBot_SkinColorpick_OnClick(SkinType)
    HealBot_ColourObjWaiting=SkinType;

    if SkinType=="Back" then
        HealBot_UseColourPick(Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKR"],
                              Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKG"],
                              Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKB"],
                              Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKA"] or 1)
    elseif SkinType=="Bor" then
        HealBot_UseColourPick(Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERR"],
                              Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERG"],
                              Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERB"],
                              Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERA"] or 1)
    elseif SkinType=="AliasT" then
        HealBot_UseColourPick(Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
                              Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
                              Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
                              Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"] or 1)
    elseif SkinType=="Alias" then
        HealBot_UseColourPick(Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
                              Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
                              Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
                              Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"] or 1)
    elseif SkinType=="CustomAuxBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["R"],
                              Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["G"],
                              Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["B"])
    elseif SkinType=="HeadB" then
        HealBot_UseColourPick(Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
                              Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
                              Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
                              Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"] or 1)
    elseif SkinType=="HeadT" then
        HealBot_UseColourPick(Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
                              Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
                              Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
                              Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"] or 1)
    elseif SkinType=="CustomBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"])
    elseif SkinType=="CustomCriticalBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCR"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCG"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCB"])
    elseif SkinType=="CustomInjuredBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIR"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIG"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIB"])
    elseif SkinType=="CustomNameText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCB"])
    elseif SkinType=="CustomNameInjuredText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICB"])
    elseif SkinType=="CustomNameCriticalText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCB"])
    elseif SkinType=="CustomStateText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCB"])
    elseif SkinType=="CustomStateInjuredText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICB"])
    elseif SkinType=="CustomStateCriticalText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCB"])
    elseif SkinType=="DeadStateText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SDCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SDCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SDCB"])
    elseif SkinType=="DeadNameText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDCB"])
    elseif SkinType=="ResStateText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRCB"])
    elseif SkinType=="ResNameText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NRCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NRCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NRCB"])
    elseif SkinType=="SummonStateText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSCB"])
    elseif SkinType=="SummonNameText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NSCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NSCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NSCB"])
    elseif SkinType=="CustomEmergCrit" then
        HealBot_UseColourPick(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CR"],
                              Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CG"],
                              Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CB"])
    elseif SkinType=="CustomEmergInj" then
        HealBot_UseColourPick(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IR"],
                              Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IG"],
                              Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IB"])
    elseif SkinType=="CustomEmergHealthy" then
        HealBot_UseColourPick(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
                              Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
                              Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"])
    elseif SkinType=="CustomOverHealText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OCB"])
    elseif SkinType=="CustomInHealText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICB"])
    elseif SkinType=="CustomExtraHealthText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HECR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HECG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HECB"])
    elseif SkinType=="CustomAggroText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACB"])
    elseif SkinType=="CustomAggroInjuredText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICB"])
    elseif SkinType=="CustomAggroCriticalText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCB"])
    elseif SkinType=="CustomAuxText" then
        HealBot_UseColourPick(Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLR"],
                              Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLG"],
                              Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLB"])
    elseif SkinType=="CustomHealthText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCB"])
    elseif SkinType=="CustomHealthInjuredText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICB"])
    elseif SkinType=="CustomHealthCriticalText" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCR"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCG"],
                              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCB"])
    elseif SkinType=="CustomBackBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BR"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BG"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BB"])
    elseif SkinType=="CustomBackInjuredBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIR"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIG"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIB"])
    elseif SkinType=="CustomBackCriticalBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCR"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCG"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCB"])
    elseif SkinType=="CustomIHBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IR"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IG"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IB"])
    elseif SkinType=="CustomIHInjuredBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIR"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIG"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIB"])
    elseif SkinType=="CustomIHCriticalBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICR"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICG"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICB"])
    elseif SkinType=="CustomAbsorbBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AR"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AG"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AB"])
    elseif SkinType=="CustomAbsorbInjuredBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIR"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIG"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIB"])
    elseif SkinType=="CustomAbsorbCriticalBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACR"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACG"],
                              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACB"])
    elseif SkinType=="CustomBorderBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORR"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORG"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORB"])
    elseif SkinType=="CustomBorderInjuredBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIR"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIG"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIB"])
    elseif SkinType=="CustomBorderCriticalBar" then
        HealBot_UseColourPick(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCR"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCG"],
                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCB"])
    end
end

function HealBot_BuffColorpick_OnClick(BuffID,id)
    HealBot_ColourObjWaiting=BuffID;
    local buffbarcolrClass = HealBot_Config_Buffs.HealBotBuffColR or 1
    local buffbarcolgClass = HealBot_Config_Buffs.HealBotBuffColG or 1
    local buffbarcolbClass = HealBot_Config_Buffs.HealBotBuffColB or 1
    HealBot_UseColourPick(buffbarcolrClass[id],
                          buffbarcolgClass[id],
                          buffbarcolbClass[id]);
end

function HealBot_SetSkinColours()
    HealBot_Timers_Set("SKINS","UpdateTextButtons")
    HealBot_Options_SetBarsTextColour()
    HealBot_HeadTextColorpickt:SetTextColor(
        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"]);
    HealBot_AuxBarCustomColour:SetStatusBarColor(
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["B"]);
    HealBot_HeadBarColorpick:SetStatusBarColor(
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"])
    HealBot_HeadTextColorpick:SetStatusBarColor(
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"])
    HealBot_FrameAliasColorpick:SetStatusBarColor(
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"])
    HealBot_FrameAliasTextColorpick:SetStatusBarColor(
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"])
    HealBot_BarCustomHealthColourHealthy:SetStatusBarColor(
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"]);
    HealBot_BarCustomHealthColourCritical:SetStatusBarColor(
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCB"]);
    HealBot_BarCustomHealthColourInjured:SetStatusBarColor(
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIB"]);
    HealBot_BarCustomHealthBackColourHealthy:SetStatusBarColor(
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BB"]);
    HealBot_BarCustomHealthBackColourInjured:SetStatusBarColor(
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIB"]);
    HealBot_BarCustomHealthBackColourCritical:SetStatusBarColor(
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCB"]);
    HealBot_BarCustomBorderColourHealthy:SetStatusBarColor(
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORB"]);
    HealBot_BarCustomBorderColourInjured:SetStatusBarColor(
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIB"]);
    HealBot_BarCustomBorderColourCritical:SetStatusBarColor(
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCB"]);
    HealBot_BarCustomIHColourHealthy:SetStatusBarColor(
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IB"]);
    HealBot_BarCustomIHColourInjured:SetStatusBarColor(
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIB"]);
    HealBot_BarCustomIHColourCritical:SetStatusBarColor(
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICB"]);
    HealBot_BarCustomAbsorbColourHealthy:SetStatusBarColor(
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AB"]);
    HealBot_BarCustomAbsorbColourInjured:SetStatusBarColor(
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIB"]);
    HealBot_BarCustomAbsorbColourCritical:SetStatusBarColor(
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACB"]);
    HealBot_EmergCustomColCrit:SetStatusBarColor(
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CR"], 
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CG"], 
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CB"])
    HealBot_EmergCustomColInj:SetStatusBarColor(
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IR"], 
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IG"], 
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IB"])
    HealBot_EmergCustomColHealthy:SetStatusBarColor(
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"], 
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"], 
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"])
    HealBot_NameTextCustomColourHealthy:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCR"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCG"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCB"])
    HealBot_NameTextCustomColourInjured:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICR"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICG"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICB"])
    HealBot_NameTextCustomColourCritical:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCR"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCG"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCB"])
    HealBot_HealthTextCustomColourHealthy:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCR"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCG"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCB"])
    HealBot_HealthTextCustomColourInjured:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICR"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICG"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICB"])
    HealBot_HealthTextCustomColourCritical:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCR"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCG"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCB"])
    HealBot_AggroTextCustomColourHealthy:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACR"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACG"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACB"])
    HealBot_AggroTextCustomColourInjured:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICR"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICG"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICB"])
    HealBot_AggroTextCustomColourCritical:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCR"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCG"], 
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCB"])
    HealBot_Timers_Set("SKINS","ResetFrameAlias")
    HealBot_Options_SetFrameCols()
end

function HealBot_Options_SetFrameCols()
    HealBot_BackgroundColorpick:SetStatusBarColor(
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKR"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKG"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKB"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKA"]);
    HealBot_BorderColorpick:SetStatusBarColor(
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERR"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERG"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERB"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERA"]);
    HealBot_FrameAliasTextColorpickt:SetTextColor(
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"]);
    HealBot_Action_SetFrameCols(HealBot_Options_luVars["FramesSelFrame"])
end

function HealBot_Options_SetBarsStateTextColour()
    HealBot_StateTextCustomColourHealthy:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCB"], 1);
    HealBot_StateTextCustomColourInjured:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICB"], 1);
    HealBot_StateTextCustomColourCritical:SetStatusBarColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCB"], 1);
    HealBot_StateTextSummonColourt:SetTextColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSCB"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCA"]);
    HealBot_StateTextDeadColourt:SetTextColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SDCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SDCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SDCB"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCA"]);
    HealBot_StateTextResColourt:SetTextColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRCB"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCA"]);
    if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"]==1 then
        HealBot_StateTextSummonCol:SetStatusBarColor(0, 1, 0, 1);
    elseif Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"]==2 then
        local sbR, sbG, sbB = HealBot_Action_ClassColour("player")
        HealBot_StateTextSummonCol:SetStatusBarColor(sbR, sbG, sbB, 1);
    else
        HealBot_StateTextSummonCol:SetStatusBarColor(
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"], 1);
    end
end

function HealBot_Options_SetBarsTextColour()
    HealBot_NameTextDeadColourt:SetTextColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDCB"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCA"]);
    HealBot_NameTextResColourt:SetTextColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NRCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NRCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NRCB"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCA"]);
    HealBot_NameTextSummonColourt:SetTextColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NSCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NSCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NSCB"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCA"]);
    HealBot_ExtraOverHealCustomColourt:SetTextColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OCB"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCA"]);
    HealBot_ExtraInHealCustomColourt:SetTextColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICB"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCA"]);
    HealBot_ExtraHealthCustomColourt:SetTextColor(
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HECR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HECG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HECB"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCA"]);
    HealBot_AuxTextCustomColourt:SetTextColor(
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLR"],
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLG"],
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLB"],
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLA"]);
    
    if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"]==1 then
        HealBot_StateTextSummonCol:SetStatusBarColor(0, 1, 0);
        HealBot_NameTextSummonCol:SetStatusBarColor(0, 1, 0);
        HealBot_ExtraOverHealCustomColour:SetStatusBarColor(0, 1, 0);
        HealBot_ExtraInHealCustomColour:SetStatusBarColor(0, 1, 0);
        HealBot_ExtraHealthCustomColour:SetStatusBarColor(0, 1, 0)
        HealBot_TextHealthyCustomColour:SetStatusBarColor(0, 1, 0);
        HealBot_TextInjuredCustomColour:SetStatusBarColor(0, 1, 0);
        HealBot_TextCriticalCustomColour:SetStatusBarColor(0, 1, 0);
    elseif Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"]==3 then
        HealBot_TextHealthyCustomColour:SetStatusBarColor(
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"]);
        HealBot_TextInjuredCustomColour:SetStatusBarColor(
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"]);
        HealBot_TextCriticalCustomColour:SetStatusBarColor(
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"]);
        HealBot_StateTextSummonCol:SetStatusBarColor(
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"]);
        HealBot_NameTextSummonCol:SetStatusBarColor(
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"]);
        HealBot_ExtraOverHealCustomColour:SetStatusBarColor(
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"]);
        HealBot_ExtraHealthCustomColour:SetStatusBarColor(
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"])
        HealBot_ExtraInHealCustomColour:SetStatusBarColor(
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"]);
    else
        local sbR, sbG, sbB = HealBot_Action_ClassColour("player")
        HealBot_StateTextSummonCol:SetStatusBarColor(sbR, sbG, sbB);
        HealBot_NameTextSummonCol:SetStatusBarColor(sbR, sbG, sbB);
        HealBot_ExtraHealthCustomColour:SetStatusBarColor(sbR, sbG, sbB);
        HealBot_ExtraOverHealCustomColour:SetStatusBarColor(sbR, sbG, sbB);
        HealBot_ExtraInHealCustomColour:SetStatusBarColor(sbR, sbG, sbB);
        HealBot_TextHealthyCustomColour:SetStatusBarColor(sbR, sbG, sbB);
        HealBot_TextInjuredCustomColour:SetStatusBarColor(sbR, sbG, sbB);
        HealBot_TextCriticalCustomColour:SetStatusBarColor(sbR, sbG, sbB);
    end
    HealBot_NameTextDeadCol:SetStatusBarColor(0.4, 0.4, 0.4, 0.2)
    HealBot_NameTextResCol:SetStatusBarColor(0.4, 0.4, 0.4, 0.2)
    HealBot_AuxTextCustomColour:SetStatusBarColor(0.8,0.7,0.1)
    HealBot_StateTextDeadCol:SetStatusBarColor(0.4, 0.4, 0.4, 0.2)
    HealBot_StateTextResCol:SetStatusBarColor(0.4, 0.4, 0.4, 0.2)
    HealBot_Options_SetBarsStateTextColour()
end

function HealBot_Options_AlertLevelIC_OnValueChanged(self)
    if Healbot_Config_Skins.BarVisibility[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTIC"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarVisibility[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTIC"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("INIT","HealthAlertLevel")
        HealBot_Timers_Set("LAST","ResetUnitStatus")
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_AlertLevelOC_OnValueChanged(self)
    if Healbot_Config_Skins.BarVisibility[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTOC"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
        Healbot_Config_Skins.BarVisibility[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTOC"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
        HealBot_Timers_Set("INIT","HealthAlertLevel")
        HealBot_Timers_Set("LAST","ResetUnitStatus")
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_OptionsOpacityAdj_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue())
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif HealBot_Globals.OptionsOpacityAdj~=val then
        HealBot_Globals.OptionsOpacityAdj = val
        HealBot_Timers_Set("LAST","OptionsMainPanel")
    end
end

function HealBot_Options_BuffTimer_OnValueChanged(self,bufftype)
    --local val=HealBot_Comm_round(self:GetValue(), -1)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        if bufftype=="SHORT" then
            HealBot_Config_Buffs.ShortBuffTimer = val;
        else
            HealBot_Config_Buffs.LongBuffTimer = val;
        end
        local mins,secs=HealBot_ReturnMinsSecs(val)
        local g=nil
        if mins<1 then
            g=_G[self:GetName()]
            HealBot_Options_SetText(g,self.text .. ": " .. secs .." secs")
        else
            g=_G[self:GetName()]
            HealBot_Options_SetText(g,self.text .. ": " .. mins ..":".. secs .." mins")
        end
        HealBot_Timers_Set("AURA","CheckUnits")
    end
end

function HealBot_ReturnMinsSecs(s)
    local mins=floor(s/60)
    local secs=floor(s-(mins*60))
  --  mins=mins+1
    if secs<10 then secs="0"..secs end
    return mins,secs
end

HealBot_Options_luVars["FluidFreqAdj"]=0.01
HealBot_Options_luVars["FlashFreqAdj"]=0.04
HealBot_Options_luVars["StateFreqAdj"]=0.04

function HealBot_Options_PerfPlugin_adj(fluidAdj, flashAdj, stateAdj, cpuAdj)
    local fluidVals={[7]=0.005, [6]=0.007, [5]=0.009, [4]=0.01,  [3]=0.015, [2]=0.02,  [1]=0.025}
    local flashVals={[7]=0.025, [6]=0.03,  [5]=0.035, [4]=0.04,  [3]=0.045, [2]=0.05,  [1]=0.055}
    local stateVals={[7]=0.025, [6]=0.03,  [5]=0.035, [4]=0.04,  [3]=0.045, [2]=0.05,  [1]=0.055}
    local timedVals={[7]=0.005, [6]=0.01,  [5]=0.015, [4]=0.02,  [3]=0.024, [2]=0.27,  [1]=0.03}
    HealBot_Options_luVars["FluidFreqAdj"]=fluidVals[fluidAdj]
    HealBot_Options_luVars["FlashFreqAdj"]=flashVals[flashAdj]
    HealBot_Options_luVars["StateFreqAdj"]=stateVals[stateAdj]
    local hbCPU=cpuAdj-6
    HealBot_PerfPlugin_adj(hbCPU)
    HealBot_Timers_Set("LAST","BarFreqVars")
    HealBot_Aux_AdjUpdateTimedFreq(timedVals[fluidAdj])
end

HealBot_Options_luVars["hotBarHlth"]=0
HealBot_Options_luVars["hotBarDebuff"]=0
HealBot_Options_luVars["hotBarDimming"]=4
function HealBot_Options_BarFreq_setVars()
 --   local fluidFreqUpd=0
    local stateFreqUpd=0
    local stateFreq=0.02
    local flashFreqUpd=0
    local flashFreq=0.02
    local smoothAdj=9
    local fluidFreq=0
    local hotBarHlth=0
    local hotBarDebuff=0
    local hotBarDimming=4
    local hazardFreq=0.3
    local hazardMinAlpha=0.25
    if HealBot_Globals.OverrideEffects["USE"]==1 then
 --       fluidFreqUpd=275+(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDFREQ"]*25)
        stateFreqUpd=0.07+(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDFREQ"]/100)
        flashFreqUpd=0.05+(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OFREQ"]*0.4)
        fluidFreq=HealBot_Comm_round(HealBot_Options_luVars["FluidFreqAdj"]-(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDFREQ"]/1500),4)
        smoothAdj=9-ceil(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDFREQ"]/2)
        hotBarHlth=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HOTBARHLTH"]*10
        hotBarDebuff=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HOTBARDEBUFF"]-1
        hotBarDimming=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HBDIMMING"]
        hazardFreq=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HAZARDFREQ"] or 0.3
        hazardMinAlpha=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HAZARDMINALPHA"] or 0.25
    else
 --       fluidFreqUpd=275+(HealBot_Globals.OverrideEffects["FLUIDFREQ"]*25)
        stateFreqUpd=0.07+(HealBot_Globals.OverrideEffects["FLUIDFREQ"]/100)
        flashFreqUpd=0.05+(HealBot_Globals.OverrideEffects["OFREQ"]*0.4)
        fluidFreq=HealBot_Comm_round(HealBot_Options_luVars["FluidFreqAdj"]-(HealBot_Globals.OverrideEffects["FLUIDFREQ"]/1500),4)
        smoothAdj=9-ceil(HealBot_Globals.OverrideEffects["FLUIDFREQ"]/2)
        hotBarHlth=HealBot_Globals.OverrideEffects["HOTBARHLTH"]*10
        hotBarDebuff=HealBot_Globals.OverrideEffects["HOTBARDEBUFF"]-1
        hotBarDimming=HealBot_Globals.OverrideEffects["HBDIMMING"]
        hazardFreq=HealBot_Globals.OverrideEffects["HAZARDFREQ"] or 0.3
        hazardMinAlpha=HealBot_Globals.OverrideEffects["HAZARDMINALPHA"] or 0.25
    end
    flashFreq=HealBot_Comm_round(HealBot_Options_luVars["FlashFreqAdj"]-(flashFreqUpd/8),4)
    stateFreq=HealBot_Comm_round(HealBot_Options_luVars["StateFreqAdj"]-(stateFreqUpd/8),4)
    if fluidFreq<0.01 then fluidFreq=0.01 end
    if stateFreq<0.01 then stateFreq=0.01 end
    if flashFreq<0.01 then flashFreq=0.01 end
    if smoothAdj<2 then smoothAdj=2 end

 --   HealBot_Action_setLuVars("FluidBarUpdate", fluidFreqUpd)
    HealBot_Action_setLuVars("FluidBarFreq", fluidFreq)
 --   HealBot_Aux_setLuVars("AuxFluidBarUpdate", fluidFreqUpd)
    HealBot_Aux_setLuVars("AuxFluidBarFreq", fluidFreq)
    
    HealBot_Aux_setLuVars("AuxFluidBarOpacityUpdate", HealBot_Comm_round(flashFreqUpd,2))
    HealBot_Aux_setLuVars("AuxFluidBarOpacityFreq", flashFreq)
    
    HealBot_Action_setLuVars("FluidBarAlphaUpdate", HealBot_Comm_round(stateFreqUpd,2))
    HealBot_Action_setLuVars("FluidBarAlphaFreq", stateFreq)
    HealBot_Action_setLuVars("FluidBarSmoothAdj", smoothAdj)
    HealBot_Text_setLuVars("FluidTextAlphaUpdate", HealBot_Comm_round(stateFreqUpd,2))
    HealBot_Text_setLuVars("FluidTextAlphaFreq", stateFreq)
    HealBot_Aux_setLuVars("AuxFluidBarAlphaUpdate", HealBot_Comm_round(stateFreqUpd,2))
    HealBot_Aux_setLuVars("AuxFluidBarAlphaFreq", stateFreq)
    HealBot_Aux_setLuVars("FluidBarSmoothAdj", smoothAdj)
    HealBot_Action_setLuVars("HotBarsHealth", hotBarHlth)
    HealBot_Aura_setLuVars("HotBarDebuff", hotBarDebuff)
    HealBot_Action_setLuVars("HotBarDimming", hotBarDimming)
    HealBot_Action_setLuVars("HazardFreq", hazardFreq)
    HealBot_Action_setLuVars("HazardMinAlpha", hazardMinAlpha)
    
    if HealBot_Options_luVars["hotBarHlth"]~=hotBarHlth or HealBot_Options_luVars["hotBarDebuff"]~=hotBarDebuff or HealBot_Options_luVars["hotBarDimming"]~=hotBarDimming then
        HealBot_Options_luVars["hotBarHlth"]=hotBarHlth
        HealBot_Options_luVars["hotBarDebuff"]=hotBarDebuff
        HealBot_Options_luVars["hotBarDimming"]=hotBarDimming
        HealBot_Timers_Set("AURA","UpdateAllHotBars")
        HealBot_Timers_Set("LAST","ResetUnitStatus")
    end
  --  HealBot_AddDebug("fluidFreq="..fluidFreq.."  fluidFreqUpd="..fluidFreqUpd, "Effects", true)
    HealBot_AddDebug("stateFreq="..stateFreq.."  stateFreqUpd="..HealBot_Comm_round(stateFreqUpd,2), "Effects", true)
    HealBot_AddDebug("flashFreq="..HealBot_Comm_round(flashFreq,4).."  flashFreqUpd="..flashFreqUpd, "Effects", true)
    HealBot_AddDebug("hotBarHlth="..hotBarHlth.."  hotBarDebuff="..hotBarDebuff, "Effects", true)
end

function HealBot_Options_OverrideHealthDropPct_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif HealBot_Globals.OverrideEffects["HEALTHDROPPCT"]~=val then
        HealBot_Globals.OverrideEffects["HEALTHDROPPCT"] = val;
        HealBot_Options_SetText(HealBot_Options_OverrideHealthDropPct, HEALBOT_OPTION_HEALTHDROPPCT..floor(val/10).."%")
        HealBot_Timers_Set("SKINS","FluidFlashInUse")
    end
end

function HealBot_Options_OverrideHotBarHealthThres_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif HealBot_Globals.OverrideEffects["HOTBARHLTH"]~=val then
        HealBot_Globals.OverrideEffects["HOTBARHLTH"] = val;
        HealBot_Options_SetText(HealBot_Options_OverrideHotBarHealthThres, HEALBOT_OPTION_HOTBARHEALTHPCT..val.."%")
        HealBot_Timers_Set("LAST","BarFreqVars")
    end
end

function HealBot_Options_OverrideHealthDropSpeed_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif HealBot_Globals.OverrideEffects["HEALTHDROPSPEED"]~=val then
        HealBot_Globals.OverrideEffects["HEALTHDROPSPEED"] = val;
        HealBot_Timers_Set("SKINS","FluidFlashInUse")
    end
end

function HealBot_Options_HealthDropPct_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROPPCT"]~=val then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROPPCT"] = val;
        HealBot_Options_SetText(HealBot_Options_HealthDropPct, HEALBOT_OPTION_HEALTHDROPPCT..floor(val/10).."%")
        HealBot_Timers_Set("SKINS","FluidFlashInUse")
    end
end

function HealBot_Options_HealthDropSpeed_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROPSPEED"]~=val then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROPSPEED"] = val;
        HealBot_Timers_Set("SKINS","FluidFlashInUse")
    end
end

function HealBot_Options_OverrideBarFreq_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif HealBot_Globals.OverrideEffects["FLUIDFREQ"]~=val then
        HealBot_Globals.OverrideEffects["FLUIDFREQ"] = val;
        HealBot_Timers_Set("LAST","BarFreqVars")
    end
end

function HealBot_Options_BarFreq_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDFREQ"]~=val then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDFREQ"] = val;
        HealBot_Timers_Set("LAST","BarFreqVars")
    end
end

function HealBot_Options_HotBarHealthThres_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HOTBARHLTH"]~=val then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HOTBARHLTH"] = val;
        HealBot_Options_SetText(HealBot_Options_HotBarHealthThres, HEALBOT_OPTION_HOTBARHEALTHPCT..val.."%")
        HealBot_Timers_Set("LAST","BarFreqVars")
    end
end

function HealBot_Options_NumTestTanks_OnValueChanged(self)
    local v=floor(self:GetValue()+0.5)
    if v~=self:GetValue() then
        self:SetValue(v) 
    elseif HealBot_Globals.TestBars["TANKS"]~=v then
        HealBot_Globals.TestBars["TANKS"] = v;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. v);
        HealBot_Timers_Set("SKINS","AllFramesChanged")
        HealBot_Panel_resetTestCols()
    end
end

function HealBot_Options_NumberTestHealers_OnValueChanged(self)
    local v=floor(self:GetValue()+0.5)
    if v~=self:GetValue() then
        self:SetValue(v) 
    elseif HealBot_Globals.TestBars["HEALERS"]~=v then
        HealBot_Globals.TestBars["HEALERS"] = v;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. v);
        HealBot_Timers_Set("SKINS","AllFramesChanged")
        HealBot_Panel_resetTestCols()
    end
end

function HealBot_Options_NumTestMyTargets_OnValueChanged(self)
    local v=floor(self:GetValue()+0.5)
    if v~=self:GetValue() then
        self:SetValue(v) 
    elseif HealBot_Globals.TestBars["TARGETS"]~=v then
        HealBot_Globals.TestBars["TARGETS"] = v;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. v);
        HealBot_Timers_Set("SKINS","AllFramesChanged")
        HealBot_Panel_resetTestCols()
    end
end

function HealBot_Options_NumTestPets_OnValueChanged(self)
    local v=floor(self:GetValue()+0.5)
    if v~=self:GetValue() then
        self:SetValue(v) 
    elseif HealBot_Globals.TestBars["PETS"]~=v then
        HealBot_Globals.TestBars["PETS"] = v;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. v);
        HealBot_Timers_Set("SKINS","AllFramesChanged")
        HealBot_Panel_resetTestCols()
    end
end

function HealBot_Options_NumberTestEnemy_OnValueChanged(self)
    local v=floor(self:GetValue()+0.5)
    if v~=self:GetValue() then
        self:SetValue(v) 
    elseif HealBot_Globals.TestBars["ENEMY"]~=v then
        HealBot_Globals.TestBars["ENEMY"] = v;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. v);
        HealBot_Timers_Set("SKINS","AllFramesChanged")
        HealBot_Panel_resetTestCols()
    end
end

function HealBot_Options_IgnoreDebuffsDuration_setAura()
    if HealBot_Config_Cures.IgnoreOnCooldownDebuffs then
        HealBot_Aura_setLuVars("IgnoreFastDurDebuffsSecs", HealBot_Config_Cures.IgnoreFastDurDebuffsSecs/2)
    else
        HealBot_Aura_setLuVars("IgnoreFastDurDebuffsSecs", -1)
    end
end

function HealBot_Options_IgnoreDebuffsDuration_OnClick(self)
    if HealBot_Config_Cures.IgnoreFastDurDebuffs~=self:GetChecked() then
        HealBot_Config_Cures.IgnoreFastDurDebuffs = self:GetChecked()
        HealBot_Options_IgnoreDebuffsDuration_setAura()
    end
end

function HealBot_Options_IgnoreDebuffsCoolDown_OnClick(self)
    if HealBot_Config_Cures.IgnoreOnCooldownDebuffs~=self:GetChecked() then
        HealBot_Config_Cures.IgnoreOnCooldownDebuffs = self:GetChecked()
        HealBot_Aura_resetSpellCD()
        HealBot_Timers_Set("AURA","ResetDebuffCache")
    end
end

function HealBot_Options_IgnoreDebuffsFriend_OnClick(self)
    if HealBot_Config_Cures.IgnoreFriendDebuffs~=self:GetChecked() then
        HealBot_Config_Cures.IgnoreFriendDebuffs = self:GetChecked()
        HealBot_Timers_Set("AURA","ResetDebuffCache")
    end
end

function HealBot_Options_IgnoreDebuffsDurationSecs_OnValueChanged(self)
    local v=floor(self:GetValue()+0.5)
    if v~=self:GetValue() then
        self:SetValue(v) 
    elseif HealBot_Config_Cures.IgnoreFastDurDebuffsSecs~=v then
        HealBot_Config_Cures.IgnoreFastDurDebuffsSecs = v;
        local g=_G[self:GetName()]
        HealBot_Options_SetText(g, self.text .. ": " .. (v/2) .." Seconds")
        HealBot_Options_IgnoreDebuffsDuration_setAura()
    end
end

function HealBot_Options_OverrideCastNotifyResOnly_OnClick(self)
    if HealBot_Globals.OverrideChat["RESONLY"]~=self:GetChecked() then
        HealBot_Globals.OverrideChat["RESONLY"] = self:GetChecked()
        HealBot_Timers_Set("CHAT","SetChat")
    end
end

function HealBot_Options_CastNotifyResOnly_OnClick(self)
    if Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["RESONLY"]~=self:GetChecked() then
        Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["RESONLY"] = self:GetChecked()
        HealBot_Timers_Set("CHAT","SetChat")
    end
end

function HealBot_Options_BarNumGroupPerCol_OnClick(self)
    if Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GRPCOLS"]~=self:GetChecked() then
        Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GRPCOLS"] = self:GetChecked()
        HealBot_Options_BarNumColsSText:SetText(HealBot_Options_SetNoColsText() .. ": " .. Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"]);
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_ShowPowerCounter_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["POWERCNT"] then
        Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["POWERCNT"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","PowerIndicator")
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
    end
end

function HealBot_Options_ShowTooltipMyBuffs_OnClick(self)
    HealBot_Globals.Tooltip_ShowMyBuffs = self:GetChecked()
end

function HealBot_Options_ShowTooltipRequiredBuffs_OnClick(self)
    HealBot_Globals.Tooltip_ShowRequiredBuffs = self:GetChecked()
end

function HealBot_Options_ShowTooltipLevel_OnClick(self)
    HealBot_Globals.Tooltip_ShowLevel = self:GetChecked()
    HealBot_Timers_Set("LAST","LoadTips")
end

function HealBot_Options_ShowTooltipSpec_OnClick(self)
    HealBot_Globals.Tooltip_ShowSpec = self:GetChecked()
    HealBot_Timers_Set("LAST","LoadTips")
end

function HealBot_Options_ShowTooltipHealthLine_OnClick(self)
    HealBot_Globals.Tooltip_ShowHealth = self:GetChecked()
    HealBot_Timers_Set("LAST","LoadTips")
end

function HealBot_Options_ShowTooltipManaLine_OnClick(self)
    HealBot_Globals.Tooltip_ShowMana = self:GetChecked()
    HealBot_Timers_Set("LAST","LoadTips")
end

function HealBot_Options_ShowTooltipRanks_OnClick(self)
    HealBot_Globals.Tooltip_ShowRank = self:GetChecked()
    HealBot_Timers_Set("LAST","LoadTips")
end

function HealBot_Options_UseGameTooltip_OnClick(self)
    if HealBot_Globals.Tooltip_UseGameTooltip~=self:GetChecked() then
        HealBot_Globals.Tooltip_UseGameTooltip = self:GetChecked()
        HealBot_Globals.Tooltip_UseGameTooltip = self:GetChecked()
        HealBot_Options_SetTooltipState()
        if HealBot_Options_luVars["TIPLOADED"] and HealBot_Options_luVars["OPTIONSTIPVISIBLE"] then
            HealBot_Tooltip_Hide()
            HealBot_Tooltip_Init()
            HealBot_Options_Show_Help("TOOLTIPUSEGAME",true)
        end
    end
end

function HealBot_Options_ShowTooltipRoles_OnClick(self)
    HealBot_Globals.Tooltip_ShowRole = self:GetChecked()
    HealBot_Timers_Set("LAST","LoadTips")
end

function HealBot_Options_ShowTooltipHideRoleWhenRank_OnClick(self)
    HealBot_Globals.Tooltip_HideRoleWhenRank = self:GetChecked()
    HealBot_Timers_Set("LAST","LoadTips")
end

function HealBot_EmergBarColBuff_OnClick(self)
    if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BUFFBARCOL"]~=self:GetChecked() then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BUFFBARCOL"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","UpdateEmergBars")
        HealBot_Timers_Set("LAST","ResetUnitStatus")
    end
end

function HealBot_EmergBarColDebuff_OnClick(self)
    if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DEBUFFBARCOL"]~=self:GetChecked() then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DEBUFFBARCOL"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","UpdateEmergBars")
        HealBot_Timers_Set("LAST","ResetUnitStatus")
    end
end

function HealBot_Options_ShowClassOnBar_OnClick(self)
    if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSONBAR"]~=self:GetChecked() then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSONBAR"] = self:GetChecked()
        HealBot_RaidTargetToggle(nil)
        HealBot_Timers_Set("AURA","ResetClassIconTexture")
        if HealBot_Options_luVars["TestBarsOn"] then
            HealBot_Timers_Set("SKINS","UpdateTextButtons")
        else
            HealBot_Timers_Set("SKINS","TextUpdateNames")
        end
    end
end

function HealBot_Options_ShowNameOnBar_OnClick(self)
    if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NAMEONBAR"]~=self:GetChecked() then
    Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NAMEONBAR"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then
            HealBot_Timers_Set("SKINS","UpdateTextButtons")
        else
            HealBot_Timers_Set("SKINS","TextUpdateNames")
        end
        --HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_NameTextDeadCol_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RIP"] then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RIP"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","TextUpdateNames")
    end
end

function HealBot_Options_StateTextDeadCol_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRIP"] then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRIP"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","TextUpdateState")
    end
end

function HealBot_Options_NameTextResCol_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RES"] then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RES"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","TextUpdateNames")
    end
end

function HealBot_Options_StateTextResCol_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRES"] then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRES"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","TextUpdateState")
    end
end

function HealBot_Options_NameTextSummonCol_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUM"] then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUM"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","TextUpdateNames")
    end
end

function HealBot_Options_StateTextSummonCol_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSUM"] then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSUM"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","TextUpdateState")
    end
end

function HealBot_Options_StateOnlyTooltip_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGSTATEONLYTIP"] then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGSTATEONLYTIP"]=self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then
            HealBot_Timers_Set("SKINS","UpdateTextButtons")
        else
            HealBot_Timers_Set("SKINS","TextUpdateState")
        end
    end
end

function HealBot_Options_HealthAnchor_Options()
    if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTXTANCHOR"]==4 then
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthFontName",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthFontHeight",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthFontOffset",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthTextHorOffset",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthMaxChars",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthTextOutLine",false)
        HealBot_Options_HealthTextColourDebuff:Hide()
        HealBot_Options_HealthTextDisAlpha:Hide()
        HealBot_Options_HealthTextAlpha:Hide()
        HealBot_HealthTextCustomColourHealthy:Hide()
        HealBot_HealthTextCustomColourInjured:Hide()
        HealBot_HealthTextCustomColourCritical:Hide()
        HealBot_HealthTextCustomColour:Hide()
        HealBot_Options_HealthTextColour:Hide()
        HealBot_Options_BarHealthCustomColour:Show()
        HealBot_ExtraHealthCustomColour:Show()
        HealBot_Options_SkinBarExtraHealthPresetColour:Show()
    else
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthFontName",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthFontHeight",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthFontOffset",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthTextHorOffset",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthMaxChars",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthTextOutLine",true)
        HealBot_Options_HealthTextColourDebuff:Show()
        HealBot_Options_HealthTextDisAlpha:Show()
        HealBot_Options_HealthTextAlpha:Show()
        HealBot_HealthTextCustomColourHealthy:Show()
        HealBot_HealthTextCustomColourInjured:Show()
        HealBot_HealthTextCustomColourCritical:Show()
        HealBot_HealthTextCustomColour:Show()
        HealBot_Options_HealthTextColour:Show()
        HealBot_Options_BarHealthCustomColour:Hide()
        HealBot_ExtraHealthCustomColour:Hide()
        HealBot_Options_SkinBarExtraHealthPresetColour:Hide()
    end
end

function HealBot_Options_StateUseNameFontString_Options()
    if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STATETXTANCHOR"]==4 then
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_StateFontName",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_StateFontHeight",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_StateTextOutLine",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_StateFontOffset",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_StateTextHorOffset",false)
        HealBot_StateTextCustomColour:Hide()
        HealBot_Options_StateTextAlpha:Hide()
        HealBot_Options_StateTextDisAlpha:Hide()
        HealBot_StateTextDeadCol:Hide()
        HealBot_StateTextDeadColb:Hide()
        HealBot_Options_StateTextDeadCol:Hide()
        HealBot_Options_SkinStateDeadColPresetColour:Hide()
        HealBot_StateTextResCol:Hide()
        HealBot_StateTextResColb:Hide()
        HealBot_Options_StateTextResCol:Hide()
        HealBot_Options_SkinStateResColPresetColour:Hide()
        HealBot_StateTextSummonCol:Hide()
        HealBot_StateTextSummonColb:Hide()
        HealBot_Options_StateTextSummonCol:Hide()
        HealBot_Options_SkinStateSummonColPresetColour:Hide()
        HealBot_StateTextCustomColourHealthy:Hide()
        HealBot_StateTextCustomColourInjured:Hide()
        HealBot_StateTextCustomColourCritical:Hide()
        HealBot_Options_StateTextColour:Hide()
        HealBot_Options_Skins_StateTextColNotAvail:Show()
    else
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_StateFontName",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_StateFontHeight",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_StateTextOutLine",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_StateFontOffset",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_StateTextHorOffset",true)
        HealBot_StateTextCustomColour:Show()
        HealBot_Options_StateTextAlpha:Show()
        HealBot_Options_StateTextDisAlpha:Show()
        HealBot_StateTextDeadCol:Show()
        HealBot_StateTextDeadColb:Show()
        HealBot_Options_StateTextDeadCol:Show()
        HealBot_Options_SkinStateDeadColPresetColour:Show()
        HealBot_StateTextResCol:Show()
        HealBot_StateTextResColb:Show()
        HealBot_Options_StateTextResCol:Show()
        HealBot_Options_SkinStateResColPresetColour:Show()
        HealBot_StateTextSummonCol:Show()
        HealBot_StateTextSummonColb:Show()
        HealBot_Options_StateTextSummonCol:Show()
        HealBot_Options_SkinStateSummonColPresetColour:Show()
        HealBot_StateTextCustomColourHealthy:Show()
        HealBot_StateTextCustomColourInjured:Show()
        HealBot_StateTextCustomColourCritical:Show()
        HealBot_Options_StateTextColour:Show()
        HealBot_Options_Skins_StateTextColNotAvail:Hide()
    end
    HealBot_Options_SetBarsStateTextColour()
    HealBot_Timers_Set("SKINS","TextUpdateState")
    if HealBot_Options_luVars["TestBarsOn"] then
        HealBot_Timers_Set("SKINS","UpdateTextButtons")
    else
        HealBot_Timers_Set("SKINS","TextUpdateNames")
    end
end

function HealBot_Options_libUTF8_OnClick(self)
    if HealBot_Globals.useUTF8~=self:GetChecked() then
        HealBot_Globals.useUTF8 = self:GetChecked()
        HealBot_Timers_Set("SKINS","TextUpdateNames")
    end
end

function HealBot_Options_UseStickyFrames_OnClick(self)
    if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["STICKYFRAME"]~=self:GetChecked() then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["STICKYFRAME"] = self:GetChecked()
        if not self:GetChecked() then
            HealBot_Action_StickyFrameClearStuck()
            HealBot_Options_ActionAnchor_SetAlpha(HealBot_Options_luVars["FramesSelFrame"])
        end
        HealBot_Timers_Set("SKINS","FramesSetPoint")
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_NotInUseOpacity_OnValueChanged(self)
    local val=HealBot_Comm_round(self:GetValue(),1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["GLOBALDIMMING"]~=val then
            Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["GLOBALDIMMING"] = val;
            HealBot_Action_ResetGlobalDimming()
        end
    end
end

function HealBot_Options_OverridePartyFrames_OnClick(self)
    if HealBot_Globals.OverrideFrames["HIDEPARTYF"]~=self:GetChecked() then
        HealBot_Globals.OverrideFrames["HIDEPARTYF"] = self:GetChecked()
        HealBot_Options_SetFrames()
        HealBot_Timers_Set("SKINS","TogglePartyFrames")
    end
end

function HealBot_Options_PartyFrames_OnClick(self)
    if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEPARTYF"]~=self:GetChecked() then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEPARTYF"] = self:GetChecked()
        HealBot_Options_SetFrames()
        HealBot_Timers_Set("SKINS","TogglePartyFrames")
    end
end

function HealBot_Options_OverrideAlwaysRunEvents_OnClick(self)
    if HealBot_Globals.OverrideFrames["RUNBLIZZEVENTS"]~=self:GetChecked() then
        HealBot_Globals.OverrideFrames["RUNBLIZZEVENTS"] = self:GetChecked()
        HealBot_Options_SetFrames()
    end
end

function HealBot_Options_AlwaysRunEvents_OnClick(self)
    if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["RUNBLIZZEVENTS"]~=self:GetChecked() then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["RUNBLIZZEVENTS"] = self:GetChecked()
        HealBot_Options_SetFrames()
    end
end

function HealBot_Options_OverridePlayerTargetFrames_OnClick(self)
    if HealBot_Globals.OverrideFrames["HIDEPTF"]~=self:GetChecked() then
        HealBot_Globals.OverrideFrames["HIDEPTF"] = self:GetChecked()
        HealBot_Options_SetFrames()
        HealBot_Timers_Set("SKINS","TogglePartyFrames")
    end
end

function HealBot_Options_PlayerTargetFrames_OnClick(self)
    if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEPTF"]~=self:GetChecked() then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEPTF"] = self:GetChecked()
        HealBot_Options_SetFrames()
        HealBot_Timers_Set("SKINS","TogglePartyFrames")
    end
end

function HealBot_Options_OverrideMiniBossFrames_OnClick(self)
    if HealBot_Globals.OverrideFrames["HIDEBOSSF"]~=self:GetChecked() then
        HealBot_Globals.OverrideFrames["HIDEBOSSF"] = self:GetChecked()
        HealBot_Options_SetFrames()
        HealBot_Timers_Set("SKINS","ToggleMiniBossFrames")
    end
end

function HealBot_Options_MiniBossFrames_OnClick(self)
    if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEBOSSF"]~=self:GetChecked() then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEBOSSF"] = self:GetChecked()
        HealBot_Options_SetFrames()
        HealBot_Timers_Set("SKINS","ToggleMiniBossFrames")
    end
end

function HealBot_Options_OverrideFocusFrame_OnClick(self)
    if HealBot_Globals.OverrideFrames["HIDEFOCUSF"]~=self:GetChecked() then
        HealBot_Globals.OverrideFrames["HIDEFOCUSF"] = self:GetChecked()
        HealBot_Options_SetFrames()
        HealBot_Timers_Set("SKINS","ToggleFocusFrame")
    end
end

function HealBot_Options_FocusFrame_OnClick(self)
    if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEFOCUSF"]~=self:GetChecked() then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEFOCUSF"] = self:GetChecked()
        HealBot_Options_SetFrames()
        HealBot_Timers_Set("SKINS","ToggleFocusFrame")
    end
end

function HealBot_Options_OverrideRaidFrames_OnClick(self)
    if HealBot_Globals.OverrideFrames["HIDERAIDF"]~=self:GetChecked() then
        HealBot_Globals.OverrideFrames["HIDERAIDF"] = self:GetChecked()
        HealBot_Options_SetFrames()
        HealBot_Timers_Set("SKINS","ToggleRaidFrames")
    end
end

function HealBot_Options_RaidFrames_OnClick(self)
    if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDERAIDF"]~=self:GetChecked() then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDERAIDF"] = self:GetChecked()
        HealBot_Options_SetFrames()
        HealBot_Timers_Set("SKINS","ToggleRaidFrames")
    end
end

function HealBot_Options_AggroTrack_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"] then
        Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"] = self:GetChecked()
        HealBot_Options_framesChanged(false, false, true)
        --HealBot_Timers_Set("SKINS","SkinsFormat")
        HealBot_Timers_Set("LAST","RegAggro")        
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    end
end

function HealBot_Options_AggroHazard_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HAZARD"] then
        Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HAZARD"] = self:GetChecked()
    end
end

function HealBot_Options_FluidFlashInUse()
    if HealBot_Globals.CPUUsage>2 then
        if HealBot_Globals.OverrideEffects["USE"]==1 then
            HealBot_Aux_setLuVars("FluidInUse", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDBARS"])
            HealBot_Action_setLuVars("FluidInUse", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDBARS"])
            HealBot_Action_setLuVars("FluidAlphaInUse", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDALPHA"])
            HealBot_Text_setLuVars("FluidAlphaInUse", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDALPHA"])
            HealBot_Aux_setLuVars("FluidAlphaInUse", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDALPHA"])
            HealBot_setLuVars("UseHealthDrop", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROP"])
            HealBot_Action_setLuVars("HealthDropSpeed", (Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROPSPEED"]/750))
        else
            HealBot_Aux_setLuVars("FluidInUse", HealBot_Globals.OverrideEffects["FLUIDBARS"])
            HealBot_Action_setLuVars("FluidInUse", HealBot_Globals.OverrideEffects["FLUIDBARS"])
            HealBot_Action_setLuVars("FluidAlphaInUse", HealBot_Globals.OverrideEffects["FLUIDALPHA"])
            HealBot_Text_setLuVars("FluidAlphaInUse", HealBot_Globals.OverrideEffects["FLUIDALPHA"])
            HealBot_Aux_setLuVars("FluidAlphaInUse", HealBot_Globals.OverrideEffects["FLUIDALPHA"])
            HealBot_setLuVars("UseHealthDrop", HealBot_Globals.OverrideEffects["HEALTHDROP"])
            HealBot_Action_setLuVars("HealthDropSpeed", (HealBot_Globals.OverrideEffects["HEALTHDROPSPEED"]/750))
        end
    else
        HealBot_Aux_setLuVars("FluidInUse", false)
        HealBot_Action_setLuVars("FluidInUse", false)
        HealBot_Text_setLuVars("FluidInUse", false)
        HealBot_Action_setLuVars("FluidAlphaInUse", false)
        HealBot_Aux_setLuVars("FluidAlphaInUse", false)
        HealBot_Text_setLuVars("FluidAlphaInUse", false)
        HealBot_setLuVars("UseHealthDrop", false)
    end
    if HealBot_Globals.OverrideEffects["USE"]==1 then
        HealBot_setLuVars("HealthDropPct", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROPPCT"])
    else
        HealBot_setLuVars("HealthDropPct", HealBot_Globals.OverrideEffects["HEALTHDROPPCT"])
    end
end

function HealBot_Options_OverrideUseHealthDrop_OnClick(self)
    if self:GetChecked()~=HealBot_Globals.OverrideEffects["HEALTHDROP"] then
        HealBot_Globals.OverrideEffects["HEALTHDROP"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","FluidFlashInUse")
    end
end

function HealBot_Options_OverrideUseFluidBars_OnClick(self)
    if self:GetChecked()~=HealBot_Globals.OverrideEffects["FLUIDBARS"] then
        HealBot_Globals.OverrideEffects["FLUIDBARS"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","FluidFlashInUse")
    end
end

function HealBot_Options_OverrideUseFluidBarsAlpha_OnClick(self)
    if self:GetChecked()~=HealBot_Globals.OverrideEffects["FLUIDALPHA"] then
        HealBot_Globals.OverrideEffects["FLUIDALPHA"]=self:GetChecked()
        HealBot_Timers_Set("SKINS","FluidFlashInUse")
    end
end

function HealBot_Options_UseHealthDrop_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROP"] then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROP"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","FluidFlashInUse")
    end
end

function HealBot_Options_UseFluidBars_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDBARS"] then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDBARS"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","FluidFlashInUse")
    end
end

function HealBot_Options_UseFluidBarsAlpha_OnClick(self)
    if self:GetChecked()~=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDALPHA"] then
        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDALPHA"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","FluidFlashInUse")
    end
end

function HealBot_Options_SkinBarAuxBarManaOnly_OnClick(self)
    if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["MANAONLY"]~=self:GetChecked() then
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["MANAONLY"] = self:GetChecked()
        HealBot_Options_clearAuxBars(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
    end
end

function HealBot_Options_SkinBarAuxBarHealersManaOnly_OnClick(self)
    if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HEALERSMANAONLY"]~=self:GetChecked() then
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HEALERSMANAONLY"] = self:GetChecked()
        HealBot_Options_clearAuxBars(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
    end
end

function HealBot_Options_SkinBarAuxBarOverlayRecentHeals_OnClick(self)
    if Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYRECENTHEALS"]~=self:GetChecked() then
        Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYRECENTHEALS"] = self:GetChecked()
        HealBot_Options_clearAuxBars(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
    end
end

function HealBot_Options_SkinBarAuxBarOverlayHealthDrop_OnClick(self)
    if Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYHEALTHDROP"]~=self:GetChecked() then
        Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYHEALTHDROP"] = self:GetChecked()
        HealBot_Options_clearAuxBars(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
    end
end

function HealBot_Options_SkinBarAuxBarOverlayAggro_OnClick(self)
    if Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYAGGRO"]~=self:GetChecked() then
        Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYAGGRO"] = self:GetChecked()
        HealBot_Options_clearAuxBars(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
    end
end

function HealBot_Options_SkinBarAuxBarOverlayDebuff_OnClick(self)
    if Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYDEBUFF"]~=self:GetChecked() then
        Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYDEBUFF"] = self:GetChecked()
        HealBot_Options_clearAuxBars(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
    end
end

function HealBot_Options_SkinBarAuxBarOverlayHighlight_OnClick(self)
    if Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYHIGHLIGHT"]~=self:GetChecked() then
        Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYHIGHLIGHT"] = self:GetChecked()
        HealBot_Options_clearAuxBars(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
    end
end

function HealBot_Options_SkinBarAuxBarOverlayTarget_OnClick(self)
    if Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYTARGET"]~=self:GetChecked() then
        Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYTARGET"] = self:GetChecked()
        HealBot_Options_clearAuxBars(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
    end
end

function HealBot_Options_SkinBarAuxBarOverlayOOR_OnClick(self)
    if Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYOOR"]~=self:GetChecked() then
        Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYOOR"] = self:GetChecked()
        HealBot_Options_clearAuxBars(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
    end
end

function HealBot_Options_SkinBarAuxBarOverlayBuff_OnClick(self)
    if Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYBUFF"]~=self:GetChecked() then
        Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYBUFF"] = self:GetChecked()
        HealBot_Options_clearAuxBars(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
    end
end

function HealBot_Options_AggroInd_OnClick(self)
    if Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWIND"]~=self:GetChecked() then
        Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWIND"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
    end
end

function HealBot_Options_AggroTxtPct_OnClick(self)
    if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGAGGROONLYTIP"]~=self:GetChecked() then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGAGGROONLYTIP"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then
            HealBot_Timers_Set("SKINS","UpdateTextButtons")
        else
            HealBot_Timers_Set("SKINS","UpdateAggroText")
        end
        --HealBot_Timers_Set("SKINS","TextFramesChanged")
        --HealBot_Timers_Set("SKINS","SkinsFormat")
    end
end

function HealBot_Options_MonitorBuffs_OnClick(self)
    if HealBot_Config_Buffs.BuffWatch~=self:GetChecked() then
        HealBot_Config_Buffs.BuffWatch = self:GetChecked()
        HealBot_Options_MonitorBuffs_Toggle()
    end
end

function HealBot_Options_MonitorBuffs_Toggle()
    HealBot_Timers_Set("AURA","BuffReset")
    HealBot_Timers_Set("AURA","PlayerCheckExtended")
    if HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","IconsFramesChanged") end
end

function HealBot_Options_MonitorDebuffs_OnClick(self)
    if HealBot_Config_Cures.DebuffWatch~=self:GetChecked() then
        HealBot_Config_Cures.DebuffWatch = self:GetChecked()
        HealBot_Options_MonitorDebuffs_Toggle()
    end
end

function HealBot_Options_MonitorDebuffs_Toggle()
    HealBot_Timers_Set("AURA","DebuffReset")
    HealBot_Timers_Set("AURA","PlayerCheckExtended")
    if HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","IconsFramesChanged") end
end

function HealBot_Options_MonitorBuffsInCombat_OnClick(self)
    if HealBot_Config_Buffs.BuffWatchInCombat~=self:GetChecked() then
        HealBot_Config_Buffs.BuffWatchInCombat = self:GetChecked()
        HealBot_Timers_Set("AURA","BuffReset")
        HealBot_Timers_Set("AURA","PlayerCheckExtended")
    end
end

function HealBot_Options_MonitorBuffsWhenMounted_OnClick(self)
    if HealBot_Config_Buffs.BuffWatchWhenMounted~=self:GetChecked() then
        HealBot_Config_Buffs.BuffWatchWhenMounted = self:GetChecked()
        HealBot_Timers_Set("AURA","BuffReset")
        HealBot_Timers_Set("AURA","PlayerCheckExtended")
    end
end

function HealBot_Options_MonitorExtraBuffsOnlyInInstance_OnClick(self)
    if HealBot_Config_Buffs.ExtraBuffsOnlyInInstance~=self:GetChecked() then
        HealBot_Config_Buffs.ExtraBuffsOnlyInInstance = self:GetChecked()
        HealBot_Timers_Set("LAST","InitItemsData")
    end
end

function HealBot_Options_MonitorBuffsWhenGrouped_OnClick(self)
    if HealBot_Config_Buffs.BuffWatchWhenGrouped~=self:GetChecked() then
        HealBot_Config_Buffs.BuffWatchWhenGrouped = self:GetChecked()
        HealBot_Timers_Set("AURA","BuffReset")
        HealBot_Timers_Set("AURA","PlayerCheckExtended")
    end
end

function HealBot_Options_MonitorBuffsPalaBlessing_OnClick(self)
    if HealBot_Config_Buffs.PalaBlessingsAsOne~=self:GetChecked() then
        HealBot_Config_Buffs.PalaBlessingsAsOne = self:GetChecked()
        HealBot_Timers_Set("AURA","BuffReset")
    end
end

function HealBot_Options_SkinDefault_OnClick(self, gType)
    if HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][gType]~=self:GetChecked() then
        HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][gType] = self:GetChecked()
        if self:GetChecked() then
            for x in pairs (Healbot_Config_Skins.Skins) do
                if Healbot_Config_Skins.Skins[x]~=Healbot_Config_Skins.Current_Skin and HealBot_Config.SkinDefault[Healbot_Config_Skins.Skins[x]][gType] then
                    HealBot_Config.SkinDefault[Healbot_Config_Skins.Skins[x]][gType]=false
                end
            end
        end
    end
end

function HealBot_Options_SkinDefaultSpec_SetText()
    HealBot_Options_SetText(HealBot_Options_SkinDefaultSpec,HEALBOT_WORD_SPEC..": "..HealBot_Config.Spec)
    if HealBot_Config.SkinSpecEnabled[HealBot_Config.Spec] and HealBot_Config.SkinSpecEnabled[HealBot_Config.Spec]==Healbot_Config_Skins.Current_Skin then
        HealBot_Options_SkinDefaultSpec:SetChecked(true)
    else
        HealBot_Options_SkinDefaultSpec:SetChecked(false)
    end
end

function HealBot_Options_SkinDefaultSpec_OnClick(self)
    if self:GetChecked() then
        if not HealBot_Config.SkinSpecEnabled[HealBot_Config.Spec] or HealBot_Config.SkinSpecEnabled[HealBot_Config.Spec]~=Healbot_Config_Skins.Current_Skin then
            HealBot_Config.SkinSpecEnabled[HealBot_Config.Spec]=Healbot_Config_Skins.Current_Skin
            HealBot_Options_SkinDefaultSpec_SetText()
        end
    elseif HealBot_Config.SkinSpecEnabled[HealBot_Config.Spec] and HealBot_Config.SkinSpecEnabled[HealBot_Config.Spec]==Healbot_Config_Skins.Current_Skin then
        HealBot_Config.SkinSpecEnabled[HealBot_Config.Spec]=nil
        HealBot_Options_SkinDefaultSpec_SetText()
        HealBot_Timers_Set("SKINS","PartyUpdateCheckSkin")
    end
end

function HealBot_Options_SkinDefaultZone_SetText()
    HealBot_Options_SetText(HealBot_Options_SkinDefaultZone,HEALBOT_WORD_ZONE..": "..HealBot_Options_luVars["mapName"])
    if HealBot_Config.SkinZoneEnabled[HealBot_Options_luVars["mapName"]] and HealBot_Config.SkinZoneEnabled[HealBot_Options_luVars["mapName"]]==Healbot_Config_Skins.Current_Skin then
        HealBot_Options_SkinDefaultZone:SetChecked(true)
    else
        HealBot_Options_SkinDefaultZone:SetChecked(false)
    end
end

function HealBot_Options_SkinDefaultZone_OnClick(self)
    if self:GetChecked() then
        if not HealBot_Config.SkinZoneEnabled[HealBot_Options_luVars["mapName"]] or HealBot_Config.SkinZoneEnabled[HealBot_Options_luVars["mapName"]]~=Healbot_Config_Skins.Current_Skin then
            HealBot_Config.SkinZoneEnabled[HealBot_Options_luVars["mapName"]]=Healbot_Config_Skins.Current_Skin
            HealBot_Options_SkinDefaultZone_SetText()
        end
    elseif HealBot_Config.SkinZoneEnabled[HealBot_Options_luVars["mapName"]] and HealBot_Config.SkinZoneEnabled[HealBot_Options_luVars["mapName"]]==Healbot_Config_Skins.Current_Skin then
        HealBot_Config.SkinZoneEnabled[HealBot_Options_luVars["mapName"]]=nil
        HealBot_Options_SkinDefaultZone_SetText()
        HealBot_Timers_Set("SKINS","PartyUpdateCheckSkin")
    end
end

function HealBot_Options_ManaIndicatorInCombat_OnClick(self)
    Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["LOWMANACOMBAT"] = self:GetChecked()
end

function HealBot_Options_MonitorDebuffsInCombat_OnClick(self)
    if HealBot_Config_Cures.DebuffWatchInCombat~=self:GetChecked() then
        HealBot_Config_Cures.DebuffWatchInCombat = self:GetChecked()
        HealBot_Timers_Set("AURA","DebuffReset")
        HealBot_Timers_Set("AURA","PlayerCheckExtended")
    end
end

function HealBot_Options_MonitorDebuffsWhenMounted_OnClick(self)
    if HealBot_Config_Cures.DebuffWatchWhenMounted~=self:GetChecked() then
        HealBot_Config_Cures.DebuffWatchWhenMounted = self:GetChecked()
        HealBot_Timers_Set("AURA","DebuffReset")
        HealBot_Timers_Set("AURA","PlayerCheckExtended")
    end
end

function HealBot_Options_MonitorDebuffsWhenGrouped_OnClick(self)
    if HealBot_Config_Cures.DebuffWatchWhenGrouped~=self:GetChecked() then
        HealBot_Config_Cures.DebuffWatchWhenGrouped = self:GetChecked()
        HealBot_Timers_Set("AURA","DebuffReset")
        HealBot_Timers_Set("AURA","PlayerCheckExtended")
    end
end

function HealBot_Options_CDCCol_ShowOnHealthBar_OnClick(self)
    if HealBot_Config_Cures.CDCshownHB~=self:GetChecked() then
        HealBot_Config_Cures.CDCshownHB = self:GetChecked()
        HealBot_Action_SetAllHealButtonAuraCols()
        HealBot_Timers_Set("LAST","ResetUnitStatus")
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
        HealBot_Timers_Set("AURA","CheckUnits")
    end
end

function HealBot_Options_BuffCol_ShowOnHealthBar_OnClick(self)
    if HealBot_Config_Buffs.CBshownHB~=self:GetChecked() then
        HealBot_Config_Buffs.CBshownHB = self:GetChecked()
        HealBot_Action_SetAllHealButtonAuraCols()
        HealBot_Timers_Set("LAST","ResetUnitStatus")
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
        HealBot_Timers_Set("AURA","CheckUnits")
    end
end

function HealBot_Options_CDCCol_DropDown()
    local info = UIDropDownMenu_CreateInfo()

    for j=1, getn(HealBot_Options_Lists["AuraBarCol"]), 1 do
        info.text = HealBot_Options_Lists["AuraBarCol"][j];
        info.func = function(self)
                        if HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[HealBot_Options_luVars["CDebuffcustomSpellID"]]~=self:GetID() then
                            HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[HealBot_Options_luVars["CDebuffcustomSpellID"]]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_CDCCol,HealBot_Options_Lists["AuraBarCol"][self:GetID()]) 
                            local sName=HealBot_Options_SpellGetName(HealBot_Options_luVars["CDebuffcustomSpellID"])
                            if sName then HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[sName]=self:GetID() end
                            HealBot_setLuVars("UpdateAllAura", 5)
                            HealBot_Aura_setLuVars("updateAll", true)
                            HealBot_Aura_ClearAllDebuffs()
                            HealBot_Timers_Set("AURA","CheckUnits")
                            HealBot_Timers_Set("LAST","UpdateButtonGlow")
                        end
                    end
        info.checked = false;
        if HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[HealBot_Options_luVars["CDebuffcustomSpellID"]]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_CDCIconGlow_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AuraIconGlow"]), 1 do
        info.text = HealBot_Options_Lists["AuraIconGlow"][j];
        info.func = function(self)
                        if HealBot_Globals.HealBot_Custom_Debuffs_IconGlow[HealBot_Options_luVars["CDebuffcustomSpellID"]]~=self:GetID() then
                            HealBot_Globals.HealBot_Custom_Debuffs_IconGlow[HealBot_Options_luVars["CDebuffcustomSpellID"]]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_CDCIconGlow,HealBot_Options_Lists["AuraIconGlow"][self:GetID()]) 
                            local sName=HealBot_Options_SpellGetName(HealBot_Options_luVars["CDebuffcustomSpellID"])
                            if sName then HealBot_Globals.HealBot_Custom_Debuffs_IconGlow[sName]=self:GetID() end
                            HealBot_Timers_Set("AURA","UpdateAllIcons")
                        end
                    end
        info.checked = false;
        if HealBot_Globals.HealBot_Custom_Debuffs_IconGlow[HealBot_Options_luVars["CDebuffcustomSpellID"]]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_CDCIconSet_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IconSets"]), 1 do
        info.text = HealBot_Options_Lists["IconSets"][j];
        info.func = function(self)
                        if HealBot_Globals.HealBot_Custom_Debuffs_IconSet[HealBot_Options_luVars["CDebuffcustomSpellID"]]~=self:GetID() then
                            HealBot_Globals.HealBot_Custom_Debuffs_IconSet[HealBot_Options_luVars["CDebuffcustomSpellID"]]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_CDCIconSet,HealBot_Options_Lists["IconSets"][self:GetID()]) 
                            local sName=HealBot_Options_SpellGetName(HealBot_Options_luVars["CDebuffcustomSpellID"])
                            if sName then HealBot_Globals.HealBot_Custom_Debuffs_IconSet[sName]=self:GetID() end
                            HealBot_Aura_ResetDebuffCache()
                            HealBot_Timers_Set("AURA","UpdateAllIcons",1)
                        end
                    end
        info.checked = false;
        if HealBot_Globals.HealBot_Custom_Debuffs_IconSet[HealBot_Options_luVars["CDebuffcustomSpellID"]]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BuffDefaultBarColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AuraBarCol"]), 1 do
        info.text = HealBot_Options_Lists["AuraBarCol"][j];
        info.func = function(self)
                        local cbBarCol=HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol["DEFAULT"] or 3
                        if cbBarCol~=self:GetID() then
                            HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol["DEFAULT"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BuffDefaultBarColour,HealBot_Options_Lists["AuraBarCol"][self:GetID()])
                            HealBot_setLuVars("UpdateAllAura", 5)
                            HealBot_Aura_setLuVars("updateAll", true)
                            HealBot_Timers_Set("AURA","CheckUnits")
                            HealBot_Timers_Set("LAST","UpdateButtonGlow")
                        end
                    end
        info.checked = false;
        if HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol["DEFAULT"] and HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol["DEFAULT"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_CDCDefaultBarColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AuraBarCol"]), 1 do
        info.text = HealBot_Options_Lists["AuraBarCol"][j];
        info.func = function(self)
                        local cdBarCol=HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol["DEFAULT"] or 3
                        if cdBarCol~=self:GetID() then
                            HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol["DEFAULT"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_CDCDefaultBarColour,HealBot_Options_Lists["AuraBarCol"][self:GetID()])
                            HealBot_setLuVars("UpdateAllAura", 5)
                            HealBot_Aura_setLuVars("updateAll", true)
                            HealBot_Aura_ClearAllDebuffs()
                            HealBot_Timers_Set("AURA","CheckUnits")
                            HealBot_Timers_Set("LAST","UpdateButtonGlow")
                        end
                    end
        info.checked = false;
        if HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol["DEFAULT"] and HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol["DEFAULT"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_CustomBuffCol_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AuraBarCol"]), 1 do
        info.text = HealBot_Options_Lists["AuraBarCol"][j];
        info.func = function(self)
                        local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"]) or 0
                        local cbBarCol=HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[sId] or 1
                        if cbBarCol~=self:GetID() then
                            HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[sId]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_CustomBuffCol,HealBot_Options_Lists["AuraBarCol"][self:GetID()])
                            if type(sId)=="number" then
                                local sName=HealBot_Options_SpellGetName(sId)
                                if sName then HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[sName]=self:GetID() end
                            end
                            HealBot_setLuVars("UpdateAllAura", 5)
                            HealBot_Aura_setLuVars("updateAll", true)
                            HealBot_Timers_Set("AURA","CheckUnits")
                            HealBot_Timers_Set("LAST","UpdateButtonGlow")
                        end
                    end
        info.checked = false;
        local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"]) or 0
        if HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[sId] and HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[sId]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_CustomBuffIconGlow_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AuraIconGlow"]), 1 do
        info.text = HealBot_Options_Lists["AuraIconGlow"][j];
        info.func = function(self)
                        local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"]) or 0
                        local cbBarCol=HealBot_Globals.HealBot_Custom_Buffs_IconGlow[sId] or 1
                        if cbBarCol~=self:GetID() then
                            HealBot_Globals.HealBot_Custom_Buffs_IconGlow[sId]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_CustomBuffIconGlow,HealBot_Options_Lists["AuraIconGlow"][self:GetID()])
                            if type(sId)=="number" then
                                local sName=HealBot_Options_SpellGetName(sId)
                                if sName then HealBot_Globals.HealBot_Custom_Buffs_IconGlow[sName]=self:GetID() end
                            end
                            HealBot_Timers_Set("AURA","UpdateAllIcons")
                        end
                    end
        info.checked = false;
        local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"]) or 0
        if HealBot_Globals.HealBot_Custom_Buffs_IconGlow[sId] and HealBot_Globals.HealBot_Custom_Buffs_IconGlow[sId]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BuffIconSet_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IconSets"]), 1 do
        info.text = HealBot_Options_Lists["IconSets"][j];
        info.func = function(self)
                        local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"]) or 0
                        local cbBarCol=HealBot_Globals.HealBot_Custom_Buffs_IconSet[sId] or 1
                        if cbBarCol~=self:GetID() then
                            HealBot_Globals.HealBot_Custom_Buffs_IconSet[sId]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BuffIconSet,HealBot_Options_Lists["IconSets"][self:GetID()])
                            if type(sId)=="number" then
                                local sName=HealBot_Options_SpellGetName(sId)
                                if sName then HealBot_Globals.HealBot_Custom_Buffs_IconSet[sName]=self:GetID() end
                            end
                            HealBot_Aura_ResetBuffCache()
                            HealBot_Timers_Set("AURA","UpdateAllIcons",1)
                        end
                    end
        info.checked = false;
        local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"]) or 0
        if HealBot_Globals.HealBot_Custom_Buffs_IconSet[sId] and HealBot_Globals.HealBot_Custom_Buffs_IconSet[sId]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_DisableHealBot_OnClick(self)
    HealBot_Options_DisableHealBot(self:GetChecked())
end

function HealBot_Options_NoAuraWhenRested_OnClick(self)
    if HealBot_Config_Buffs.NoAuraWhenRested~=self:GetChecked() then
        HealBot_Config_Buffs.NoAuraWhenRested=self:GetChecked()
        HealBot_Timers_Set("AURA","PlayerCheckExtended")
    end
end

function HealBot_Options_DisableHealBot(disable)
    HealBot_Config.DisableHealBot=disable
    HealBot_Timers_Set("LAST","DisableCheck")
end

function HealBot_Options_DisableHealBotSolo_OnClick(self)
    if HealBot_Config.DisableSolo~=self:GetChecked() then
        HealBot_Config.DisableSolo=self:GetChecked()
        HealBot_Timers_Set("LAST","DisableCheck")
    end
end

function HealBot_Options_DisableCheck()
    local z=0
    if not HealBot_Config.DisableHealBot then
        z=0
    elseif not HealBot_Config.DisableSolo then
        z=1
    elseif not IsInRaid() and not IsInGroup() then
        z=1
    end
    if HealBot_Config.DisabledNow~=z then
        if z==0 then 
            HealBot_Timers_Set("INIT","EnableHealBot")
        else
            HealBot_Timers_Set("INIT","DisableHealBot")
        end
    end
end

function HealBot_Options_HealGroups_OnClick(self, id)
    if Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][id]["STATE"]~=self:GetChecked() then
        Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][id]["STATE"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_HealGroupsAllowDups_OnClick(self)
    if Healbot_Config_Skins.DuplicateBars[Healbot_Config_Skins.Current_Skin]~=self:GetChecked() then
        Healbot_Config_Skins.DuplicateBars[Healbot_Config_Skins.Current_Skin]=self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_HealGroupUp_OnClick(self, id)
    if id>1 and id<7 then
        local hbId = id-1
        HealBot_Options_HealGroupSwap(Healbot_Config_Skins.Current_Skin, hbId, id)
    end
end

function HealBot_Options_HealGroupDown_OnClick(self, id)
    if id>0 and id<6 then
        local hbId = id+1
        HealBot_Options_HealGroupSwap(Healbot_Config_Skins.Current_Skin, hbId, id)
    end
end

function HealBot_Options_HealGroupSwap(skinName, hbId, id)
    local hgName=Healbot_Config_Skins.HealGroups[skinName][id]["NAME"]
    local hgState=Healbot_Config_Skins.HealGroups[skinName][id]["STATE"]
    local hgFrame=Healbot_Config_Skins.HealGroups[skinName][id]["FRAME"]
    Healbot_Config_Skins.HealGroups[skinName][id]["STATE"] = Healbot_Config_Skins.HealGroups[skinName][hbId]["STATE"]
    Healbot_Config_Skins.HealGroups[skinName][id]["NAME"]  = Healbot_Config_Skins.HealGroups[skinName][hbId]["NAME"]
    Healbot_Config_Skins.HealGroups[skinName][id]["FRAME"] = Healbot_Config_Skins.HealGroups[skinName][hbId]["FRAME"]
    Healbot_Config_Skins.HealGroups[skinName][hbId]["STATE"] = hgState
    Healbot_Config_Skins.HealGroups[skinName][hbId]["NAME"]  = hgName
    Healbot_Config_Skins.HealGroups[skinName][hbId]["FRAME"] = hgFrame
    HealBot_Options_ResetUpdate()
    HealBot_Timers_Set("SKINS","QuickFramesChanged")
end

function HealBot_Options_SortOutOfRangeLast_OnClick(self)
    if Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORLAST"]~=self:GetChecked() then
        Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORLAST"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_HideBar_OnClick(self)
    if Healbot_Config_Skins.BarVisibility[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIDEOOR"]~=self:GetChecked() then
        Healbot_Config_Skins.BarVisibility[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIDEOOR"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_FocusOnlyFriend_OnClick(self)
    if Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["FONLYFRIEND"]~=self:GetChecked() then
        Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["FONLYFRIEND"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_FocusExcludeRaid_OnClick(self)
    if Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["FEXRAID"]~=self:GetChecked() then
        Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["FEXRAID"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_TargetOnlyFriend_OnClick(self)
    if Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["TONLYFRIEND"]~=self:GetChecked() then
        Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["TONLYFRIEND"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_VehicleInCombat_OnClick(self)
    if Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["VEHICLEINCOMBAT"]~=self:GetChecked() then
        Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["VEHICLEINCOMBAT"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_PrivListPetsInCombat_OnClick(self)
    if Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["PRIVLISTPETSINCOMBAT"]~=self:GetChecked() then
        Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["PRIVLISTPETSINCOMBAT"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_TargetExcludeRaid_OnClick(self)
    if Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["TEXRAID"]~=self:GetChecked() then
        Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["TEXRAID"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_GroupPetsByFive_OnClick(self)
    if Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["GROUPPETS"]~=self:GetChecked() then
        Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["GROUPPETS"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_SelfPet_OnClick(self)
    if Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["SELFPET"]~=self:GetChecked() then
        Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["SELFPET"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_EFGroup_OnClick(self,id)
    if Healbot_Config_Skins.FocusGroups[Healbot_Config_Skins.Current_Skin][id]~=self:GetChecked() then
        Healbot_Config_Skins.FocusGroups[Healbot_Config_Skins.Current_Skin][id] = self:GetChecked()
        HealBot_Timers_Set("SKINS","SetFocusGroups")
    end
end

function HealBot_Options_OverrideEFGroup_OnClick(self,id)
    if HealBot_Globals.OverrideFocusGroups[id]~=self:GetChecked() then
        HealBot_Globals.OverrideFocusGroups[id] = self:GetChecked()
        HealBot_Timers_Set("SKINS","SetFocusGroups")
    end
end

function HealBot_Options_CuresWarnGroup_OnClick(self,id)
    if HealBot_Config_Cures.ShowGroups[id]~=self:GetChecked() then
        HealBot_Config_Cures.ShowGroups[id] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
        HealBot_Timers_Set("AURA","CheckUnits")
    end
end

function HealBot_Options_BuffWarnGroup_OnClick(self,id)
    if HealBot_Config_Buffs.ShowGroups[id]~=self:GetChecked() then
        HealBot_Config_Buffs.ShowGroups[id] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
        HealBot_Timers_Set("AURA","CheckUnits")
    end
end

function HealBot_Options_EFClass_OnClick(self)
    if HealBot_Globals.EmergencyFClass==1 then
        if HealBot_Options_EFClassDruid:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_DRUID] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_DRUID] = false
        end
        if HealBot_Options_EFClassHunter:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_HUNTER] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_HUNTER] = false
        end
        if HealBot_Options_EFClassMage:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_MAGE] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_MAGE] = false
        end
        if HealBot_Options_EFClassPaladin:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_PALADIN] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_PALADIN] = false
        end
        if HealBot_Options_EFClassPriest:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_PRIEST] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_PRIEST] = false
        end
        if HealBot_Options_EFClassRogue:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_ROGUE] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_ROGUE] = false
        end
        if HealBot_Options_EFClassShaman:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_SHAMAN] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_SHAMAN] = false
        end
        if HealBot_Options_EFClassWarlock:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_WARLOCK] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_WARLOCK] = false
        end
        if HealBot_Options_EFClassWarrior:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_WARRIOR] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_WARRIOR] = false
        end
        if HealBot_Options_EFClassDemonHunter:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_DEMONHUNTER] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_DEMONHUNTER] = false
        end
        if HealBot_Options_EFClassDeathKnight:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_DEATHKNIGHT] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_DEATHKNIGHT] = false
        end
        if HealBot_Options_EFClassMonk:GetChecked() then
            HealBot_Globals.EmergIncMelee[HEALBOT_MONK] = true
        else
            HealBot_Globals.EmergIncMelee[HEALBOT_MONK] = false
        end
    elseif HealBot_Globals.EmergencyFClass==2 then
        if HealBot_Options_EFClassDruid:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_DRUID] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_DRUID] = false
        end
        if HealBot_Options_EFClassHunter:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_HUNTER] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_HUNTER] = false
        end
        if HealBot_Options_EFClassMage:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_MAGE] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_MAGE] = false
        end
        if HealBot_Options_EFClassPaladin:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_PALADIN] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_PALADIN] = false
        end
        if HealBot_Options_EFClassPriest:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_PRIEST] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_PRIEST] = false
        end
        if HealBot_Options_EFClassRogue:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_ROGUE] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_ROGUE] = false
        end
        if HealBot_Options_EFClassShaman:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_SHAMAN] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_SHAMAN] = false
        end
        if HealBot_Options_EFClassWarlock:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_WARLOCK] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_WARLOCK] = false
        end
        if HealBot_Options_EFClassWarrior:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_WARRIOR] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_WARRIOR] = false
        end
        if HealBot_Options_EFClassDemonHunter:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_DEMONHUNTER] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_DEMONHUNTER] = false
        end
        if HealBot_Options_EFClassDeathKnight:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_DEATHKNIGHT] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_DEATHKNIGHT] = false
        end
        if HealBot_Options_EFClassMonk:GetChecked() then
            HealBot_Globals.EmergIncRange[HEALBOT_MONK] = true
        else
            HealBot_Globals.EmergIncRange[HEALBOT_MONK] = false
        end
    elseif HealBot_Globals.EmergencyFClass==3 then
        if HealBot_Options_EFClassDruid:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_DRUID] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_DRUID] = false
        end
        if HealBot_Options_EFClassHunter:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_HUNTER] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_HUNTER] = false
        end
        if HealBot_Options_EFClassMage:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_MAGE] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_MAGE] = false
        end
        if HealBot_Options_EFClassPaladin:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_PALADIN] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_PALADIN] = false
        end
        if HealBot_Options_EFClassPriest:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_PRIEST] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_PRIEST] = false
        end
        if HealBot_Options_EFClassRogue:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_ROGUE] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_ROGUE] = false
        end
        if HealBot_Options_EFClassShaman:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_SHAMAN] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_SHAMAN] = false
        end
        if HealBot_Options_EFClassWarlock:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_WARLOCK] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_WARLOCK] = false
        end
        if HealBot_Options_EFClassWarrior:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_WARRIOR] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_WARRIOR] = false
        end
        if HealBot_Options_EFClassDemonHunter:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_DEMONHUNTER] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_DEMONHUNTER] = false
        end
        if HealBot_Options_EFClassDeathKnight:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_DEATHKNIGHT] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_DEATHKNIGHT] = false
        end
        if HealBot_Options_EFClassMonk:GetChecked() then
            HealBot_Globals.EmergIncHealers[HEALBOT_MONK] = true
        else
            HealBot_Globals.EmergIncHealers[HEALBOT_MONK] = false
        end
    elseif HealBot_Globals.EmergencyFClass==4 then
        if HealBot_Options_EFClassDruid:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_DRUID] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_DRUID] = false
        end
        if HealBot_Options_EFClassHunter:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_HUNTER] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_HUNTER] = false
        end
        if HealBot_Options_EFClassMage:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_MAGE] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_MAGE] = false
        end
        if HealBot_Options_EFClassPaladin:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_PALADIN] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_PALADIN] = false
        end
        if HealBot_Options_EFClassPriest:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_PRIEST] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_PRIEST] = false
        end
        if HealBot_Options_EFClassRogue:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_ROGUE] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_ROGUE] = false
        end
        if HealBot_Options_EFClassShaman:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_SHAMAN] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_SHAMAN] = false
        end
        if HealBot_Options_EFClassWarlock:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_WARLOCK] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_WARLOCK] = false
        end
        if HealBot_Options_EFClassWarrior:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_WARRIOR] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_WARRIOR] = false
        end
        if HealBot_Options_EFClassDemonHunter:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_DEMONHUNTER] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_DEMONHUNTER] = false
        end
        if HealBot_Options_EFClassDeathKnight:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_DEATHKNIGHT] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_DEATHKNIGHT] = false
        end
        if HealBot_Options_EFClassMonk:GetChecked() then
            HealBot_Globals.EmergIncCustom[HEALBOT_MONK] = true
        else
            HealBot_Globals.EmergIncCustom[HEALBOT_MONK] = false
        end
    end
    HealBot_Timers_Set("SKINS","QuickFramesChanged")
end

HealBot_Options_luVars["OverrideCastNotify"]=1
function HealBot_Options_OverrideCastNotify_OnClick(self,id)
    local g=nil
    if id>0 and id~=HealBot_Options_luVars["OverrideCastNotify"] then
        g=_G["HealBot_Options_OverrideCastNotify"..HealBot_Options_luVars["OverrideCastNotify"]]
        g:SetChecked(false);
        HealBot_Options_luVars["OverrideCastNotify"]=id
    end
    HealBot_Globals.OverrideChat["NOTIFY"] = id;
    if HealBot_Globals.OverrideChat["NOTIFY"]>0 then
        g=_G["HealBot_Options_OverrideCastNotify"..HealBot_Globals.OverrideChat["NOTIFY"]]
        g:SetChecked(true);
    end
    HealBot_Timers_Set("CHAT","SetChat")
end

HealBot_Options_luVars["CastNotify"]=1
function HealBot_Options_CastNotify_OnClick(self,id)
    local g=nil
    if id>0 and id~=HealBot_Options_luVars["CastNotify"] then
        g=_G["HealBot_Options_CastNotify"..HealBot_Options_luVars["CastNotify"]]
        g:SetChecked(false);
        HealBot_Options_luVars["CastNotify"]=id
    end
    Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["NOTIFY"] = id;
    if Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["NOTIFY"]>0 then
        g=_G["HealBot_Options_CastNotify"..Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["NOTIFY"]]
        g:SetChecked(true);
    end
    HealBot_Timers_Set("CHAT","SetChat")
end

function HealBot_Options_HideOptions_OnClick(self)
    if HealBot_Globals.HideOptions~=self:GetChecked() then
        HealBot_Globals.HideOptions = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_HideUnlocked_OnClick(self)
    if HealBot_Globals.HideUnlockedTag~=self:GetChecked() then
        HealBot_Globals.HideUnlockedTag = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_RightButtonOptions_OnClick(self)
    HealBot_Globals.RightButtonOptions=self:GetChecked()
end

function HealBot_Options_ShowMinimapButton_OnClick(self)
    if self:GetChecked() then
        HealBot_Globals.MinimapIcon.hide=false  -- Reversed intentionally 
    else
        HealBot_Globals.MinimapIcon.hide=true
    end
    HealBot_MMButton_Toggle()
end

function HealBot_Options_ShowTooltip_OnClick(self)
    if HealBot_Globals.ShowTooltip~=self:GetChecked() then
        HealBot_Globals.ShowTooltip = self:GetChecked()
        if self:GetChecked() then HealBot_Timers_Set("LAST","LoadTips") end
        HealBot_Options_SetTooltipState()
    end
end

function HealBot_Options_InOutCompressExport_OnClick(self)
    HealBot_Globals.CompressExport = self:GetChecked()
end

function HealBot_Options_AddonFail(reason, addon)
    StaticPopupDialogs["HEALBOT_OPTIONS_ADDONFAIL"] = {
        text = HEALBOT_OPTIONS_ADDON_FAIL.." "..addon.."\n"..HEALBOT_OPTIONS_LANG_ADDON_FAIL2.." "..reason.."\n\n"..HEALBOT_OPTIONS_LANG_ADDON_FAIL3.." "..addon,
        button1 = CLOSE,
        timeout = 0,
        whileDead = 1,
        hideOnEscape = 1
    };
    StaticPopup_Show("HEALBOT_OPTIONS_ADDONFAIL");
end

function HealBot_Options_LoadTips()
    local loaded, reason=HealBot_Options_luVars["TIPLOADED"],""
    if not loaded then loaded, reason = LoadAddOn("HealBot_Tips") end
    if loaded then
        if HealBot_Globals.ShowTooltip then
            HealBot_Data["TIPUSE"]=true
            HealBot_Tooltip_Init()
            --if HealBot_Config_Buffs.BuffWatch then
            --    HealBot_Timers_Set("AURA","BuffReset")
            --end
            HealBot_Timers_Set("LAST","TipPowerCol")
        else
            HealBot_Data["TIPUSE"]=false
        end
        HealBot_Options_luVars["TIPLOADED"]=true
    elseif HealBot_Globals.ShowTooltip then
        HealBot_Data["TIPUSE"]=false
        local failreason = reason or HEALBOT_WORDS_UNKNOWN
        HealBot_AddChat("Unable to load addon HealBot_Tips - Reason: "..failreason)
        if not HealBot_Globals.OneTimeMsg["Tips"] then
            HealBot_Globals.OneTimeMsg["Tips"]=true
            HealBot_Options_AddonFail(failreason, "HealBot_Tips")
        end
        HealBot_Options_luVars["TIPLOADED"]=false
    end
    HealBot_setTooltipUpdateInterval()
end

function HealBot_Options_HideTooltipInCombat_OnClick(self)
    HealBot_Globals.DisableToolTipInCombat = self:GetChecked()
end

function HealBot_Options_CopyDummy_OnClick(self)
  -- Nothing to do here
end

function HealBot_Options_ShowTooltipTarget_OnClick(self)
    if HealBot_Globals.Tooltip_ShowTarget~=self:GetChecked() then
        HealBot_Globals.Tooltip_ShowTarget = self:GetChecked()
        HealBot_Options_SetTooltipState()
    end
end

function HealBot_Options_ShowTooltipSpellInfo_OnClick(self)
    if HealBot_Globals.Tooltip_ShowSpellInfo~=self:GetChecked() then
        HealBot_Globals.Tooltip_ShowSpellInfo = self:GetChecked()
        HealBot_Options_SetTooltipState()
    end
end

function HealBot_Options_ShowTooltipSpellExtra_OnClick(self)
    HealBot_Globals.Tooltip_ShowSpellExtra = self:GetChecked()
end

function HealBot_Options_ShowTooltipSpellCoolDown_OnClick(self)
    if HealBot_Globals.Tooltip_ShowCD~=self:GetChecked() then
        HealBot_Globals.Tooltip_ShowCD = self:GetChecked()
        HealBot_setTooltipUpdateInterval()
    end
end

function HealBot_Options_ShowTooltipSpellIgnoreGlobalCoolDown_OnClick(self)
    HealBot_Globals.Tooltip_IgnoreGCD = self:GetChecked()
end

function HealBot_Options_ShowTooltipShowUnitTip_OnClick(self)
    if HealBot_Globals.ShowGameUnitInfo~=self:GetChecked() then
        HealBot_Globals.ShowGameUnitInfo = self:GetChecked()
        HealBot_Options_SetTooltipState()
    end
end

function HealBot_Options_ShowTooltipShowHoT_OnClick(self)
    if HealBot_Globals.Tooltip_ShowHoT~=self:GetChecked() then
        HealBot_Globals.Tooltip_ShowHoT = self:GetChecked()
    end
end

function HealBot_Options_ShowDebuffWarning_OnClick(self)
    if HealBot_Config_Cures.ShowDebuffWarning~=self:GetChecked() then
        HealBot_Config_Cures.ShowDebuffWarning = self:GetChecked()
        HealBot_Timers_Set("AURA","SetAuraWarningFlags")
    end
end

function HealBot_Options_ShowBuffWarning_OnClick(self)
    if HealBot_Config_Buffs.ShowBuffWarning~=self:GetChecked() then
        HealBot_Config_Buffs.ShowBuffWarning = self:GetChecked()
        HealBot_Timers_Set("AURA","SetAuraWarningFlags")
    end
end

function HealBot_Options_BuffManaDrinkThreshold_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif HealBot_Config_Buffs.ManaDrinkThreshold~=val then
        HealBot_Config_Buffs.ManaDrinkThreshold=val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val .. "%");
        HealBot_Timers_Set("AURA","CheckPlayer",0.5)
    end
end

function HealBot_Options_BuffCheckManaDrink_OnClick(self)
    if HealBot_Config_Buffs.CheckManaDrink~=self:GetChecked() then
        HealBot_Config_Buffs.CheckManaDrink = self:GetChecked()
        HealBot_Timers_Set("AURA","BuffReset")
    end
end

function HealBot_Options_BuffCheckWellFed_OnClick(self)
    if HealBot_Config_Buffs.CheckWellFed~=self:GetChecked() then
        HealBot_Config_Buffs.CheckWellFed = self:GetChecked()
        HealBot_Timers_Set("AURA","BuffReset")
    end
end

function HealBot_Options_BuffExtraCheck_OnClick(self, id)
    if HealBot_Config_Buffs.CustomBuffCheck[id]~=self:GetChecked() then
        HealBot_Config_Buffs.CustomBuffCheck[id] = self:GetChecked()
        HealBot_Timers_Set("AURA","BuffReset")
    end
end

function HealBot_Options_SoundDebuffWarning_OnClick(self)
    if HealBot_Config_Cures.SoundDebuffWarning~=self:GetChecked() then
        HealBot_Config_Cures.SoundDebuffWarning = self:GetChecked()
        HealBot_Timers_Set("AURA","SetAuraWarningFlags")
    end
end

function HealBot_Options_SoundBuffWarning_OnClick(self)
    if HealBot_Config_Buffs.SoundBuffWarning~=self:GetChecked() then
        HealBot_Config_Buffs.SoundBuffWarning = self:GetChecked()
        HealBot_Timers_Set("AURA","SetAuraWarningFlags")
    end
end

function HealBot_Options_BarButtonShowRaidIcon_OnClick(self)
    if Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"]~=self:GetChecked() then
        Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then 
            HealBot_Timers_Set("SKINS","IconsFramesChanged") 
        else
            HealBot_Timers_Set("SKINS","RaidTargetUpdate")
        end
    end
end

function HealBot_Options_BarButtonShowRaidIconStar_OnClick(self)
    if Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STAR"]~=self:GetChecked() then
        Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STAR"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","RaidTargetUpdate")
    end
end

function HealBot_Options_BarButtonShowRaidIconCircle_OnClick(self)
    if Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CIRCLE"]~=self:GetChecked() then
        Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CIRCLE"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","RaidTargetUpdate")
    end
end

function HealBot_Options_BarButtonShowRaidIconDiamond_OnClick(self)
    if Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DIAMOND"]~=self:GetChecked() then
        Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DIAMOND"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","RaidTargetUpdate")
    end
end

function HealBot_Options_BarButtonShowRaidIconTriangle_OnClick(self)
    if Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TRIANGLE"]~=self:GetChecked() then
        Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TRIANGLE"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","RaidTargetUpdate")
    end
end

function HealBot_Options_BarButtonShowRaidIconMoon_OnClick(self)
    if Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MOON"]~=self:GetChecked() then
        Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MOON"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","RaidTargetUpdate")
    end
end

function HealBot_Options_BarButtonShowRaidIconSquare_OnClick(self)
    if Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SQUARE"]~=self:GetChecked() then
        Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SQUARE"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","RaidTargetUpdate")
    end
end

function HealBot_Options_BarButtonShowRaidIconCross_OnClick(self)
    if Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CROSS"]~=self:GetChecked() then
        Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CROSS"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","RaidTargetUpdate")
    end
end

function HealBot_Options_BarButtonShowRaidIconSkull_OnClick(self)
    if Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SKULL"]~=self:GetChecked() then
        Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SKULL"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","RaidTargetUpdate")
    end
end

function HealBot_Options_SubSortPlayerFirst_OnClick(self)
    if Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUBPF"]~=self:GetChecked() then
        Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUBPF"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_ShowReadyCheck_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWRC"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWRC"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then 
            HealBot_Timers_Set("SKINS","IconsFramesChanged") 
        else
            HealBot_Options_CheckReadyCheckEvent()
        end
    end
end

function HealBot_Options_ShowCombatState_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWCOMBAT"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWCOMBAT"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then 
            HealBot_Timers_Set("SKINS","IconsFramesChanged") 
        end
    end
end

function HealBot_Options_ShowHostile_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWHOSTILE"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWHOSTILE"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then 
            HealBot_Timers_Set("SKINS","IconsFramesChanged") 
        end
    end
end

function HealBot_Options_ShowResting_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWRESTING"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWRESTING"] = self:GetChecked()
        HealBot_Timers_Set("PLAYER","SetRestingState")
    end
end

function HealBot_Options_ShowLeader_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWRANK"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWRANK"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then 
            HealBot_Timers_Set("SKINS","IconsFramesChanged") 
        end
    end
end

function HealBot_Options_ShowAFK_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWAFK"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWAFK"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then 
            HealBot_Timers_Set("SKINS","IconsFramesChanged")
        else
            HealBot_Timers_Set("SKINS","UpdateAFK")
        end
    end
end

function HealBot_Options_ShowClassIcon_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWCLASS"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWCLASS"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then 
            HealBot_Timers_Set("SKINS","IconsFramesChanged") 
        else
            HealBot_Timers_Set("AURA","ResetClassIconTexture")
        end
    end
end

function HealBot_Options_ShowRoleIcon_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWROLE"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWROLE"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then 
            HealBot_Timers_Set("SKINS","IconsFramesChanged") 
        else
            HealBot_Timers_Set("AURA","ResetClassIconTexture")
        end
    end
end

function HealBot_IconClassVOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSVOFFSET"]~=val then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSVOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_IconClassHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSHOFFSET"]~=val then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSHOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_IconClassScale_OnValueChanged(self)
--    local val=floor(self:GetValue()+0.5)
    local val=HealBot_Comm_round(self:GetValue(), 1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSSCALE"]~=val then
            Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSSCALE"] = val;
            local g=_G[self:GetName().."Text"]
            g:SetText(self.text .. ": " .. val);
            HealBot_Timers_Set("SKINS","IconsFramesChanged")
        end
    end
end

function HealBot_IconClassAlwaysEnabled_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSEN"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSEN"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
        HealBot_Aura_Update_UnitAllExtraIcons(nil, 91)
    end
end

function HealBot_IconTargetVOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETVOFFSET"]~=val then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETVOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_IconTargetHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETHOFFSET"]~=val then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETHOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_IconTargetScale_OnValueChanged(self)
--    local val=floor(self:GetValue()+0.5)
    local val=HealBot_Comm_round(self:GetValue(), 1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETSCALE"]~=val then
            Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETSCALE"] = val;
            local g=_G[self:GetName().."Text"]
            g:SetText(self.text .. ": " .. val);
            HealBot_Timers_Set("SKINS","IconsFramesChanged")
        end
    end
end

function HealBot_IconTargetAlwaysEnabled_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETEN"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETEN"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
        HealBot_Aura_Update_UnitAllExtraIcons(nil, 92)
    end
end

function HealBot_IconRCVOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCVOFFSET"]~=val then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCVOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_IconRCHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCHOFFSET"]~=val then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCHOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_IconRCScale_OnValueChanged(self)
--    local val=floor(self:GetValue()+0.5)
    local val=HealBot_Comm_round(self:GetValue(), 1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCSCALE"]~=val then
            Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCSCALE"] = val;
            local g=_G[self:GetName().."Text"]
            g:SetText(self.text .. ": " .. val);
            HealBot_Timers_Set("SKINS","IconsFramesChanged")
        end
    end
end

function HealBot_IconRCAlwaysEnabled_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCEN"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCEN"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
        HealBot_Aura_Update_UnitAllExtraIcons(nil, 93)
    end
end

function HealBot_IconOORArrowVOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORVOFFSET"]~=val then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORVOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_IconOORArrowHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORHOFFSET"]~=val then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORHOFFSET"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

function HealBot_IconOORArrowScale_OnValueChanged(self)
--    local val=floor(self:GetValue()+0.5)
    local val=HealBot_Comm_round(self:GetValue(), 1)
    if val~=self:GetValue() then
        self:SetValue(val) 
    else
        val=val/10;
        if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORSCALE"]~=val then
            Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORSCALE"] = val;
            local g=_G[self:GetName().."Text"]
            g:SetText(self.text .. ": " .. val);
            HealBot_Timers_Set("SKINS","IconsFramesChanged")
        end
    end
end

function HealBot_IconOORArrowAlwaysEnabled_OnClick(self)
    if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OOREN"]~=self:GetChecked() then
        Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OOREN"] = self:GetChecked()
        HealBot_Aura_Update_UnitAllExtraIcons(nil, 94)
    end
end

function HealBot_SkinsSpellsUse_OnClick(self)
    if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["USE"]~=self:GetChecked() then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["USE"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
        HealBot_Timers_Set("SKINS","UpdateEmergBars")
    end
end

function HealBot_Options_ShowDirection_OnClick(self)
    Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWDIR"] = self:GetChecked()
end

function HealBot_Options_ShowDirectionMouseOver_OnClick(self)
    Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWDIRMOUSE"] = self:GetChecked()
end

function HealBot_Options_CheckReadyCheckEvent()
    local noReadyCheck=true
    for h=1,10 do
        if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][h]["SHOWRC"] then
            noReadyCheck=false
        end
    end
    if noReadyCheck then
        HealBot_UnRegister_ReadyCheck()
        HealBot_Timers_Set("LAST","ReadyCheckClear")
    else
        HealBot_Register_ReadyCheck()
        HealBot_Timers_Set("LAST","ReadyCheck")
    end
end

function HealBot_Options_RaidTargetUpdate()
    local tVal=false
    for j=1,10 do
        if Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][j]["SHOW"] then 
            tVal=true
        end
    end
    HealBot_setRaidTargetChecked()
    HealBot_RaidTargetToggle(tVal) 
end

function HealBot_BarButtonShowHoTTextCount_OnClick(self) -- This is now debuffs
    Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBSCNT"] = self:GetChecked()
    HealBot_Timers_Set("AURA","UpdateAllDebuffIcons")
    if HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","IconsFramesChanged") end
end

function HealBot_BarButtonShowBuffTextCount_OnClick(self)
    Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFSCNT"] = self:GetChecked()
    HealBot_Timers_Set("AURA","UpdateAllBuffIcons")
    if HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","IconsFramesChanged") end
end

function HealBot_BarButtonShowBuffTextCountSelfCast_OnClick(self)
    Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFSSCNT"] = self:GetChecked()
    HealBot_Timers_Set("AURA","UpdateAllBuffIcons")
end

function HealBot_BarButtonShowHoTTextDuration_OnClick(self) -- This is now debuffs
    Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBSDUR"] = self:GetChecked()
    HealBot_Timers_Set("AURA","UpdateAllDebuffIcons")
    if HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","IconsFramesChanged") end
end

function HealBot_BarButtonShowBuffTextDuration_OnClick(self)
    Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFSDUR"] = self:GetChecked()
    HealBot_Timers_Set("AURA","UpdateAllBuffIcons")
    if HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","IconsFramesChanged") end
end

function HealBot_Options_SelfCastIndicator_OnClick(self)
    Healbot_Config_Skins.IconText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SELFIND"] = self:GetChecked()
    HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
    HealBot_Timers_setLuVars("UpdateAllBuffIcons", true)
end

function HealBot_BarButtonShowBuffTextDurationSelfCast_OnClick(self)
    Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFSSDUR"] = self:GetChecked()
    HealBot_Timers_Set("AURA","UpdateAllBuffIcons")
end

function HealBot_Options_ShowHealthOnBar_OnClick(self)
    if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHONBAR"]~=self:GetChecked() then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHONBAR"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then
            HealBot_Timers_Set("SKINS","UpdateTextButtons")
        else
            HealBot_Timers_Set("SKINS","TextUpdateHealth")
            if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STATETXTANCHOR"]==4 then
                HealBot_Timers_Set("SKINS","TextUpdateNames")
            end
        end
    end
end

function HealBot_Options_HealthIncludePercent_OnClick(self)
    if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHINCPTC"]~=self:GetChecked() then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHINCPTC"] = self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then
            HealBot_Timers_Set("SKINS","UpdateTextButtons")
        else
            HealBot_Timers_Set("SKINS","TextUpdateHealth")
            if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STATETXTANCHOR"]==4 then
                HealBot_Timers_Set("SKINS","TextUpdateNames")
            end
        end
    end
end

function HealBot_Options_HealthInVehicleShowPlayer_OnClick(self)
    if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHINVEHSHOWPLAYER"]~=self:GetChecked() then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHINVEHSHOWPLAYER"]=self:GetChecked()
        if HealBot_Options_luVars["TestBarsOn"] then
            HealBot_Timers_Set("SKINS","UpdateTextButtons")
        else
            HealBot_Timers_Set("SKINS","TextUpdateHealth")
        end
    end
end

function HealBot_Options_ShowTextOnAuxBar_OnClick(self)
    if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["TEXT"]~=self:GetChecked() then
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["TEXT"]=self:GetChecked()
        HealBot_Globals.AuxTextPrefs[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["USE"]]=self:GetChecked()
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
        HealBot_Timers_Set("AUX","UpdateAllAuxByType")
    end
end

function HealBot_Options_IgnoreIncomingHealOnFull_OnClick(self)
    if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IGNOREONFULL"]~=self:GetChecked() then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IGNOREONFULL"] = self:GetChecked()
        --HealBot_Timers_Set("SKINS","SkinsFormat")
    end
end

function HealBot_Debuffx2Bar_OnClick(self)
    if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFDOUBLE"]~=self:GetChecked() then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFDOUBLE"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
        HealBot_Timers_Set("LAST","UpdateButtonGlow",0.2)
    end
end

function HealBot_Buffx2Bar_OnClick(self)
    if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDOUBLE"]~=self:GetChecked() then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDOUBLE"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
        HealBot_Timers_Set("LAST","UpdateButtonGlow",0.2)
    end
end

function HealBot_BarButtonIconAlwaysEnabled_OnClick(self)
    if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DI15EN"]~=self:GetChecked() then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DI15EN"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
        if not HealBot_Options_luVars["TestBarsOn"] then
            HealBot_Timers_Set("AURA","UpdateAllDebuffIcons")
        end
    end
end

function HealBot_BarButtonIconBuffAlwaysEnabled_OnClick(self)
    if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFI15EN"]~=self:GetChecked() then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFI15EN"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
        if not HealBot_Options_luVars["TestBarsOn"] then
            HealBot_Timers_Set("AURA","UpdateAllBuffIcons")
        end
    end
end

function HealBot_BarButtonIconFadeOnExpire_OnClick(self)
    if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DFADE"]~=self:GetChecked() then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DFADE"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_BarButtonIconBuffFadeOnExpire_OnClick(self)
    if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFFADE"]~=self:GetChecked() then
        Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFFADE"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","QuickFramesChanged")
    end
end

function HealBot_Options_ProtectPvP_OnClick(self)
    HealBot_Globals.ProtectPvP = self:GetChecked()
end

function HealBot_Options_ShowRoleOnBar_OnClick(self)
    if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWROLE"]~=self:GetChecked() then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWROLE"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","TextUpdateNames")
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_TargetInCombat_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_TargetFocusInCombat_List), 1 do
        info.text = HealBot_Options_TargetFocusInCombat_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["TARGETINCOMBAT"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_TargetInCombat,HealBot_Options_TargetFocusInCombat_List[Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["TARGETINCOMBAT"]]) 
                        HealBot_Timers_Set("SKINS","QuickFramesChanged")
                    end
        info.checked = false;
        if Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["TARGETINCOMBAT"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_FocusInCombat_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_TargetFocusInCombat_List), 1 do
        info.text = HealBot_Options_TargetFocusInCombat_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["FOCUSINCOMBAT"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_FocusInCombat,HealBot_Options_TargetFocusInCombat_List[Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["FOCUSINCOMBAT"]]) 
                        HealBot_Timers_Set("SKINS","QuickFramesChanged")
                    end
        info.checked = false;
        if Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["FOCUSINCOMBAT"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

HealBot_Options_luVars["hbBarHealthNumFormatTxt"]="1,2K"

function HealBot_Options_BarHealthNumFormat_genList()
    local HealBot_Options_BarHealthNumFormat_List={}
    if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTYPE"]==1 then
        local HealBot_Options_BarHealthNumFormat1h_List = {
            "1234",
            "1K",
            "1.2K",
            "1.23K",
            "1k",
            "1.2k",
            "1.23k",
            "1",
            "1.2",
            "1.23",
            HEALBOT_WORD_AUTO,
        }
        HealBot_Options_BarHealthNumFormat_List=HealBot_Options_BarHealthNumFormat1h_List
    elseif Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTYPE"]==2 then
        local HealBot_Options_BarHealthNumFormat1d_List = {
            "-4321",
            "-4K",
            "-4.3K",
            "-4.32K",
            "-4k",
            "-4.3k",
            "-4.32k",
            "-4",
            "-4.3",
            "-4.32",
            HEALBOT_WORD_AUTO,
        }
        HealBot_Options_BarHealthNumFormat_List=HealBot_Options_BarHealthNumFormat1d_List
    else
        local HealBot_Options_BarHealthNumFormat1p_List = {
            "88%",
            "88%",
            "88%",
            "88%",
            "88%",
            "88%",
            "88%",
            "88%",
            "88%",
            "88%",
            HEALBOT_WORD_AUTO,
        }
        HealBot_Options_BarHealthNumFormat_List=HealBot_Options_BarHealthNumFormat1p_List
    end
    HealBot_Options_luVars["hbBarHealthNumFormatTxt"]=HealBot_Options_BarHealthNumFormat_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMFORMAT1"]]
    return HealBot_Options_BarHealthNumFormat_List
end

function HealBot_Options_BarHealthNumFormat1_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local HealBot_Options_BarHealthNumFormat1_List=HealBot_Options_BarHealthNumFormat_genList()
    for j=1, getn(HealBot_Options_BarHealthNumFormat1_List), 1 do
        info.text = HealBot_Options_BarHealthNumFormat1_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMFORMAT1"]~=self:GetID() then
                            Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMFORMAT1"] = self:GetID()
                            HealBot_Options_luVars["hbBarHealthNumFormatTxt"]=self:GetText()
                            UIDropDownMenu_SetText(HealBot_Options_BarHealthNumFormat1,HealBot_Options_BarHealthNumFormat1_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMFORMAT1"]]) 
                            HealBot_Options_ResetUpdate()
                            HealBot_Timers_Set("SKINS","SkinsFormat")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMFORMAT1"]==j then
            HealBot_Options_luVars["hbBarHealthNumFormatTxt"]=HealBot_Options_BarHealthNumFormat1_List[j]
            info.checked = true
        end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

local HealBot_Options_BarHealthNumFormat2_List = {
    " ", " ",
    "(", ")",
    "[", "]",
    "{", "}",
    "<", ">",
    "~", " ",
    ":", ":",
    "*", "*",
}

function HealBot_Options_BarHealthNumFormat2_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local i=0
    for j=1, getn(HealBot_Options_BarHealthNumFormat2_List), 2 do
        i=i+1
        local nFormat = HealBot_Options_BarHealthNumFormat2_List[j]..HealBot_Options_luVars["hbBarHealthNumFormatTxt"]..HealBot_Options_BarHealthNumFormat2_List[j+1];
        info.text = nFormat
        info.func = function(self)
                        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMFORMAT2"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BarHealthNumFormat2,nFormat) 
                        HealBot_Timers_Set("SKINS","SkinsFormat")
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMFORMAT2"]==i then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_BarHealthNumFormatAggro_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local i=0
    for j=1, getn(HealBot_Options_BarHealthNumFormat2_List), 2 do
        local nFormat = HealBot_Options_BarHealthNumFormat2_List[j].."77%"..HealBot_Options_BarHealthNumFormat2_List[j+1];
        i=i+1
        info.text = nFormat
        info.func = function(self)
                        Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTFORMAT"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BarHealthNumFormatAggro,nFormat) 
                        HealBot_Timers_Set("SKINS","SkinsFormat")
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTFORMAT"]==i then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AggroTextIndicator_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AggroNameFormat"]), 1 do
        info.text = HealBot_Options_Lists["AggroNameFormat"][j]
        info.func = function(self)
                        Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWTEXT"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_AggroTextIndicator,HealBot_Options_Lists["AggroNameFormat"][Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWTEXT"]]) 
                        HealBot_Timers_Set("SKINS","TextUpdateNames")
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWTEXT"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------
function HealBot_Options_HealGroupsFrame_DropDown(info, object, id)
    for j=1, 5, 1 do
        info.text = HealBot_Options_HealGroupsFrame_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][id]["FRAME"]~=self:GetID() then
                            Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][id]["FRAME"] = self:GetID()
                            UIDropDownMenu_SetText(object,HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][id]["FRAME"]]) 
                            HealBot_Timers_Set("SKINS","QuickFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][id]["FRAME"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_HealGroups1Frame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    HealBot_Options_HealGroupsFrame_DropDown(info, HealBot_Options_HealGroups1Frame, 1)
end

function HealBot_Options_HealGroups2Frame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    HealBot_Options_HealGroupsFrame_DropDown(info, HealBot_Options_HealGroups2Frame, 2)
end

function HealBot_Options_HealGroups3Frame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    HealBot_Options_HealGroupsFrame_DropDown(info, HealBot_Options_HealGroups3Frame, 3)
end

function HealBot_Options_HealGroups4Frame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    HealBot_Options_HealGroupsFrame_DropDown(info, HealBot_Options_HealGroups4Frame, 4)
end

function HealBot_Options_HealGroups5Frame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    HealBot_Options_HealGroupsFrame_DropDown(info, HealBot_Options_HealGroups5Frame, 5)
end

function HealBot_Options_HealGroups6Frame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    HealBot_Options_HealGroupsFrame_DropDown(info, HealBot_Options_HealGroups6Frame, 6)
end

function HealBot_Options_HealGroups7Frame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    HealBot_Options_HealGroupsFrame_DropDown(info, HealBot_Options_HealGroups7Frame, 7)
    info.text = HEALBOT_VEHICLE_en
    info.func = function(self)
                    Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][7]["FRAME"]=6
                    UIDropDownMenu_SetText(HealBot_Options_HealGroups7Frame,HEALBOT_VEHICLE_en) 
                    HealBot_Timers_Set("SKINS","QuickFramesChanged")
                end
    info.checked = false;
    if Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][7]["FRAME"]==6 then info.checked = true end
    UIDropDownMenu_AddButton(info);
end

function HealBot_Options_HealGroups8Frame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    HealBot_Options_HealGroupsFrame_DropDown(info, HealBot_Options_HealGroups8Frame, 8)
    info.text = HEALBOT_OPTIONS_PETHEALS_en
    info.func = function(self)
                    Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][8]["FRAME"]=7
                    UIDropDownMenu_SetText(HealBot_Options_HealGroups8Frame,HEALBOT_OPTIONS_PETHEALS_en) 
                    HealBot_Timers_Set("SKINS","QuickFramesChanged")
                end
    info.checked = false;
    if Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][8]["FRAME"]==7 then info.checked = true end
    UIDropDownMenu_AddButton(info);
end

function HealBot_Options_HealGroups9Frame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    HealBot_Options_HealGroupsFrame_DropDown(info, HealBot_Options_HealGroups9Frame, 9)
    info.text = HEALBOT_OPTIONS_TARGETHEALS_en
    info.func = function(self)
                    Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][9]["FRAME"]=8
                    UIDropDownMenu_SetText(HealBot_Options_HealGroups9Frame,HEALBOT_OPTIONS_TARGETHEALS_en) 
                    HealBot_Timers_Set("SKINS","QuickFramesChanged")
                end
    info.checked = false;
    if Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][9]["FRAME"]==8 then info.checked = true end
    UIDropDownMenu_AddButton(info)
end

function HealBot_Options_HealGroups10Frame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    HealBot_Options_HealGroupsFrame_DropDown(info, HealBot_Options_HealGroups10Frame, 10)
    info.text = HEALBOT_FOCUS_en
    info.func = function(self)
                    Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][10]["FRAME"]=9
                    UIDropDownMenu_SetText(HealBot_Options_HealGroups10Frame,HEALBOT_FOCUS_en) 
                    HealBot_Timers_Set("SKINS","QuickFramesChanged")
                end
    info.checked = false;
    if Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][10]["FRAME"]==9 then info.checked = true end
    UIDropDownMenu_AddButton(info)
end

function HealBot_Options_HealGroups11Frame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    info.text = HEALBOT_CUSTOM_CASTBY_ENEMY_en
    info.checked = true;
    UIDropDownMenu_AddButton(info);
end

--------------------------------------------------------------------------------

function HealBot_Options_AliasFontOutline_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_FontOutline_List), 1 do
        info.text = HealBot_Options_FontOutline_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_AliasFontOutline,HealBot_Options_FontOutline_List[Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]]) 
                        HealBot_Timers_Set("SKINS","FrameAliases")
                        HealBot_Timers_Set("SKINS","SetSkinText")
                    end
        info.checked = false;
        if Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_HeadFontOutline_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_FontOutline_List), 1 do
        info.text = HealBot_Options_FontOutline_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_HeadFontOutline,HealBot_Options_FontOutline_List[Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]]) 
                        HealBot_Timers_Set("SKINS","TextFramesChanged")
                        HealBot_Timers_Set("SKINS","SetSkinText")
                    end
        info.checked = false;
        if Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_IconFontOutline_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_FontOutline_List), 1 do
        info.text = HealBot_Options_FontOutline_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBOUTLINE"] ~= self:GetID() then
                            Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBOUTLINE"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_IconFontOutline,HealBot_Options_FontOutline_List[Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBOUTLINE"]]) 
                            HealBot_Timers_Set("SKINS","IconsFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBOUTLINE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_IconBuffFontOutline_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_FontOutline_List), 1 do
        info.text = HealBot_Options_FontOutline_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFOUTLINE"] ~= self:GetID() then
                            Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFOUTLINE"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_IconBuffFontOutline,HealBot_Options_FontOutline_List[Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFOUTLINE"]]) 
                            HealBot_Timers_Set("SKINS","IconsFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFOUTLINE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_UnitInCombat_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["UnitInCombat"]), 1 do
        info.text = HealBot_Options_Lists["UnitInCombat"][j];
        info.func = function(self)
                        Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["UNITINCOMBAT"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_UnitInCombat,HealBot_Options_Lists["UnitInCombat"][Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["UNITINCOMBAT"]]) 
                    end
        info.checked = false;
        if Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["UNITINCOMBAT"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_IconDebuffPosition_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IconPosition"]), 1 do
        info.text = HealBot_Options_Lists["IconPosition"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFONBAR"] ~= self:GetID() then
                            Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFONBAR"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_IconDebuffPosition,HealBot_Options_Lists["IconPosition"][Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFONBAR"]]) 
                            local list = HealBot_Options_AnchorList(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFONBAR"], false)
                            if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFONBAR"]==1 then
                                UIDropDownMenu_SetText(HealBot_Options_IconDebuffAnchor,list[Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"]]) 
                            elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFONBAR"]==2 then
                                if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"]>4 then
                                    Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"]=Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DEBUFFANCHOR"]-4
                                end
                                UIDropDownMenu_SetText(HealBot_Options_IconDebuffAnchor,list[Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"]]) 
                            else
                                if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"]>2 then
                                    Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"]=1
                                end
                                UIDropDownMenu_SetText(HealBot_Options_IconDebuffAnchor,list[Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"]]) 
                            end
                            HealBot_Timers_Set("SKINS","IconsFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFONBAR"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_IconDebuffIconSet_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IconDebuffSets"]), 1 do
        info.text = HealBot_Options_Lists["IconDebuffSets"][j];
        info.func = function(self)
                        if HealBot_Options_luVars["DebuffIconSet"] ~= self:GetID() then
                           HealBot_Options_luVars["DebuffIconSet"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_IconDebuffIconSet,HealBot_Options_Lists["IconDebuffSets"][HealBot_Options_luVars["DebuffIconSet"]]) 
                            HealBot_Options_ResetUpdate()
                        end
                    end
        info.checked = false;
        if HealBot_Options_luVars["DebuffIconSet"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_IconBuffIconSet_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IconBuffSets"]), 1 do
        info.text = HealBot_Options_Lists["IconBuffSets"][j];
        info.func = function(self)
                        if HealBot_Options_luVars["BuffIconSet"] ~= self:GetID() then
                           HealBot_Options_luVars["BuffIconSet"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_IconBuffIconSet,HealBot_Options_Lists["IconBuffSets"][HealBot_Options_luVars["BuffIconSet"]]) 
                            HealBot_Options_ResetUpdate()
                        end
                    end
        info.checked = false;
        if HealBot_Options_luVars["BuffIconSet"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_IconBuffPosition_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IconPosition"]), 1 do
        info.text = HealBot_Options_Lists["IconPosition"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFONBAR"] ~= self:GetID() then
                            Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFONBAR"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_IconBuffPosition,HealBot_Options_Lists["IconPosition"][Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFONBAR"]]) 
                            local list = HealBot_Options_AnchorList(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFONBAR"], false)
                            if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFONBAR"]==1 then
                                UIDropDownMenu_SetText(HealBot_Options_IconBuffAnchor,list[Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"]]) 
                            elseif Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFONBAR"]==2 then
                                if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"]>4 then
                                    Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"]=Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"]-4
                                end
                                UIDropDownMenu_SetText(HealBot_Options_IconBuffAnchor,list[Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"]]) 
                            else
                                if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"]>2 then
                                    Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"]=2
                                end
                                UIDropDownMenu_SetText(HealBot_Options_IconBuffAnchor,list[Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"]]) 
                            end
                            HealBot_Timers_Set("SKINS","IconsFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFONBAR"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_IconExtraPosition_DropDown(object, id, eId)
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IconPosition"]), 1 do
        info.text = HealBot_Options_Lists["IconPosition"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id] ~= self:GetID() then
                            Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id] = self:GetID()
                            UIDropDownMenu_SetText(object,HealBot_Options_Lists["IconPosition"][Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id]]) 
                            if eId==91 then
                                Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSANCHOR"]=1
                                UIDropDownMenu_SetText(HealBot_Options_IconClassAnchor,HEALBOT_OPTIONS_ICONEXTRAANCHOR01) 
                            elseif eId==92 then
                                Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETANCHOR"]=1
                                UIDropDownMenu_SetText(HealBot_Options_IconTargetAnchor,HEALBOT_OPTIONS_ICONEXTRAANCHOR01) 
                            elseif eId==93 then
                                Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCANCHOR"]=1
                                UIDropDownMenu_SetText(HealBot_Options_IconRCAnchor,HEALBOT_OPTIONS_ICONEXTRAANCHOR01) 
                            elseif eId==94 then
                                Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORANCHOR"]=1
                                UIDropDownMenu_SetText(HealBot_Options_IconOORArrowAnchor,HEALBOT_OPTIONS_ICONEXTRAANCHOR01) 
                            end
                            HealBot_Aura_RemoveExtraIcons(eId)
                            HealBot_Timers_Set("SKINS","IconsFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["id"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_IconClassPosition_DropDown()
    HealBot_Options_IconExtraPosition_DropDown(HealBot_Options_IconClassPosition, "CLASSONBAR", 91)
end

function HealBot_Options_IconTargetPosition_DropDown()
    HealBot_Options_IconExtraPosition_DropDown(HealBot_Options_IconTargetAnchor, "TARGETONBAR", 92)
end

function HealBot_Options_IconRCPosition_DropDown()
    HealBot_Options_IconExtraPosition_DropDown(HealBot_Options_IconRCPosition, "RCONBAR", 93)
end

function HealBot_Options_IconOORArrowPosition_DropDown()
    HealBot_Options_IconExtraPosition_DropDown(HealBot_Options_IconOORArrowPosition, "OORONBAR", 94)
end

function HealBot_Options_AnchorList(onBar, Extra)
    local list={}
    if Extra then
        if onBar==3 then
            list  = {
                HEALBOT_OPTIONS_ICONEXTRAANCHOR01,
                HEALBOT_OPTIONS_ICONEXTRAANCHOR02,
                HEALBOT_OPTIONS_ICONBELOWANCHOR03,
            }
        elseif onBar==2 then
            list  = {
                HEALBOT_OPTIONS_ICONEXTRAANCHOR01,
                HEALBOT_OPTIONS_ICONEXTRAANCHOR02,
            }
        else
            list  = {
                HEALBOT_OPTIONS_ICONEXTRAANCHOR01,
                HEALBOT_OPTIONS_ICONEXTRAANCHOR02,
                HEALBOT_OPTIONS_ICONEXTRAANCHOR03,
                HEALBOT_OPTIONS_ICONEXTRAANCHOR04,
                HEALBOT_OPTIONS_ICONOFFBARANCHOR03,
                HEALBOT_OPTIONS_ICONOFFBARANCHOR04,
                HEALBOT_OPTIONS_ICONOFFBARANCHOR01,
                HEALBOT_OPTIONS_ICONOFFBARANCHOR02,
            }
        end
    elseif onBar==1 then
        list  = {
            HEALBOT_OPTIONS_ICONONBARANCHOR01,
            HEALBOT_OPTIONS_ICONONBARANCHOR02,
            HEALBOT_OPTIONS_ICONONBARANCHOR03,
            HEALBOT_OPTIONS_ICONONBARANCHOR04,
            HEALBOT_OPTIONS_ICONONBARANCHOR05,
            HEALBOT_OPTIONS_ICONONBARANCHOR06,
            HEALBOT_OPTIONS_ICONONBARANCHOR07,
            HEALBOT_OPTIONS_ICONONBARANCHOR08,
        }
    elseif onBar==2 then
        list  = {
            HEALBOT_OPTIONS_ICONOFFBARANCHOR01,
            HEALBOT_OPTIONS_ICONOFFBARANCHOR02,
            HEALBOT_OPTIONS_ICONOFFBARANCHOR03,
            HEALBOT_OPTIONS_ICONOFFBARANCHOR04,
        }
    else
        list  = {
            HEALBOT_OPTIONS_ICONBELOWANCHOR01,
            HEALBOT_OPTIONS_ICONBELOWANCHOR02,
        }
    end
    return list
end

function HealBot_Options_IconDebuffAnchor_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local list = HealBot_Options_AnchorList(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFONBAR"], false)
    for j=1, getn(list), 1 do
        info.text = list[j];
        info.func = function(self)
                        if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"] ~= self:GetID() then
                            Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_IconDebuffAnchor,list[Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"]]) 
                            HealBot_Timers_Set("SKINS","IconsFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_IconBuffAnchor_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local list = HealBot_Options_AnchorList(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFONBAR"], false)
    for j=1, getn(list), 1 do
        info.text = list[j];
        info.func = function(self)
                        if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"] ~= self:GetID() then
                            Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_IconBuffAnchor,list[Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"]]) 
                            HealBot_Timers_Set("SKINS","IconsFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_IconAnchor_DropDown(object, id, listid, liststate)
    local info = UIDropDownMenu_CreateInfo()
    local list = HealBot_Options_AnchorList(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][listid], liststate)
    for j=1, getn(list), 1 do
        info.text = list[j];
        info.func = function(self)
                        if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id] ~= self:GetID() then
                            Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id] = self:GetID()
                            UIDropDownMenu_SetText(object,list[Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id]]) 
                            HealBot_Timers_Set("SKINS","IconsFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_IconClassAnchor_DropDown()
    HealBot_Options_IconAnchor_DropDown(HealBot_Options_IconClassAnchor, "CLASSANCHOR", "CLASSONBAR", true)
end

function HealBot_Options_IconTargetAnchor_DropDown()
    HealBot_Options_IconAnchor_DropDown(HealBot_Options_IconTargetAnchor, "TARGETANCHOR", "TARGETONBAR", true)
end

function HealBot_Options_IconRCAnchor_DropDown()
    HealBot_Options_IconAnchor_DropDown(HealBot_Options_IconRCAnchor, "RCANCHOR", "RCONBAR", true)
end

function HealBot_Options_IconOORArrowAnchor_DropDown()
    HealBot_Options_IconAnchor_DropDown(HealBot_Options_IconOORArrowAnchor, "OORANCHOR", "OORONBAR", true)
end

-------------------------------------------

function HealBot_Options_BarHealthIncHeal_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarHealthIncHeal_List), 1 do
        info.text = HealBot_Options_BarHealthIncHeal_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["INCHEALS"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BarHealthIncHeal,HealBot_Options_BarHealthIncHeal_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["INCHEALS"]]) 
                        HealBot_Timers_Set("INIT","SeparateInHealsAbsorbs")
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["INCHEALS"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BarHealthIncAbsorb_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarHealthIncAbsorb_List), 1 do
        info.text = HealBot_Options_BarHealthIncAbsorb_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["INCABSORBS"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BarHealthIncAbsorb,HealBot_Options_BarHealthIncAbsorb_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["INCABSORBS"]]) 
                        HealBot_Timers_Set("INIT","SeparateInHealsAbsorbs")
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["INCABSORBS"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BarHealthOverHeal_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarHealthOverHeal_List), 1 do
        info.text = HealBot_Options_BarHealthOverHeal_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERHEAL"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BarHealthOverHeal,HealBot_Options_BarHealthOverHeal_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERHEAL"]]) 
                        HealBot_Timers_Set("INIT","SeparateInHealsAbsorbs")
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERHEAL"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BarHealthInFormat_DropDown(object, id)
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["OverHealFormat"]), 1 do
        info.text = HealBot_Options_Lists["OverHealFormat"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id]~=self:GetID() then
                            Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id] = self:GetID()
                            UIDropDownMenu_SetText(object,HealBot_Options_Lists["OverHealFormat"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id]]) 
                            HealBot_Timers_Set("SKINS","SkinsFormat")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BarHealthOverHealFormat_DropDown()
    HealBot_Options_BarHealthInFormat_DropDown(HealBot_Options_BarHealthOverHealFormat, "OVERHEALFORMAT")
end

function HealBot_Options_BarHealthInHealFormat_DropDown()
    HealBot_Options_BarHealthInFormat_DropDown(HealBot_Options_BarHealthInHealFormat, "SEPARATEFORMAT")
end

function HealBot_Options_BarHealthInColour_DropDown(object, id)
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["OverHealColour"]), 1 do
        info.text = HealBot_Options_Lists["OverHealColour"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id]~=self:GetID() then
                            Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id] = self:GetID()
                            UIDropDownMenu_SetText(object,HealBot_Options_Lists["OverHealColour"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id]]) 
                            HealBot_Timers_Set("SKINS","SetBarsTextColour")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][id]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BarHealthOverHealColour_DropDown()
    HealBot_Options_BarHealthInColour_DropDown(HealBot_Options_BarHealthOverHealColour, "OVERHEALCOL")
end

function HealBot_Options_BarHealthInHealColour_DropDown()
    HealBot_Options_BarHealthInColour_DropDown(HealBot_Options_BarHealthInHealColour, "SEPARATECOL")
end

function HealBot_Options_BarHealthCustomColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["HealthCustomColour"]), 1 do
        info.text = HealBot_Options_Lists["HealthCustomColour"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEALEXTRACOL"]~=self:GetID() then
                            Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEALEXTRACOL"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BarHealthCustomColour,HealBot_Options_Lists["HealthCustomColour"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEALEXTRACOL"]]) 
                            HealBot_Timers_Set("SKINS","TextExtraCustomCols")
                            HealBot_Timers_Set("SKINS","TextUpdateHealth")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEALEXTRACOL"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

local function HealBot_Options_BarHealthTextPosition_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarHealthAnchor_List), 1 do
        info.text = HealBot_Options_BarHealthAnchor_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTXTANCHOR"]==4 or self:GetID()==4 then
                            HealBot_Timers_Set("SKINS","TextUpdateNames")
                        end
                        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTXTANCHOR"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BarHealthTextPosition, HealBot_Options_BarHealthAnchor_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTXTANCHOR"]])
                        HealBot_Text_setTextLen(HealBot_Options_luVars["FramesSelFrame"])
                        HealBot_Timers_Set("SKINS","TextFramesChanged")
                        HealBot_Timers_Set("SKINS","TextUpdateHealth")
                        HealBot_Options_HealthAnchor_Options()
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTXTANCHOR"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

local function HealBot_Options_BarAggroTextPosition_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["BarAggroTextAnchor"]), 1 do
        info.text = HealBot_Options_Lists["BarAggroTextAnchor"][j];
        info.func = function(self)
                        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AGGROTXTANCHOR"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BarAggroTextPosition, HealBot_Options_Lists["BarAggroTextAnchor"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AGGROTXTANCHOR"]])
                        HealBot_Timers_Set("SKINS","TextFramesChanged")
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AGGROTXTANCHOR"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

local function HealBot_Options_BarNameTextPosition_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["BarNameTextAnchor"]), 1 do
        info.text = HealBot_Options_Lists["BarNameTextAnchor"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALIGN"]~=self:GetID() then
                            Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALIGN"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BarNameTextPosition, HealBot_Options_Lists["BarNameTextAnchor"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALIGN"]])
                            HealBot_Timers_Set("SKINS","TextFramesChanged")
                            if HealBot_Options_luVars["TestBarsOn"] then
                                HealBot_Timers_Set("SKINS","UpdateTextButtons")
                            else
                                HealBot_Timers_Set("SKINS","TextUpdateNames")
                                if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTXTANCHOR"]>4 then
                                    HealBot_Timers_Set("SKINS","TextUpdateHealth")
                                end
                            end
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALIGN"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AuxTextAlign_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["BarNameTextAnchor"]), 1 do
        info.text = HealBot_Options_Lists["BarNameTextAnchor"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["ALIGN"]~=self:GetID() then
                            Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["ALIGN"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BarNameTextPosition, HealBot_Options_Lists["BarNameTextAnchor"][Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["ALIGN"]])
                            HealBot_Panel_setLuVars("resetAuxText", true)
                            HealBot_Timers_Set("SKINS","TextFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["ALIGN"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BarStateTextPosition_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["BarStateTextAnchor"]), 1 do
        info.text = HealBot_Options_Lists["BarStateTextAnchor"][j];
        info.func = function(self)
                        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STATETXTANCHOR"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BarStateTextPosition, HealBot_Options_Lists["BarStateTextAnchor"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STATETXTANCHOR"]])
                        HealBot_Timers_Set("SKINS","TextFramesChanged")
                        HealBot_Options_StateUseNameFontString_Options()
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STATETXTANCHOR"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_EnemyCombat_DropDown(obect, id)
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_EnemyCombat_List), 1 do
        info.text = HealBot_Options_EnemyCombat_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin][id]~=self:GetID() then
                            Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin][id] = self:GetID()
                            UIDropDownMenu_SetText(obect,HealBot_Options_EnemyCombat_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin][id]]) 
                            HealBot_Timers_Set("INIT","RefreshPartyNextRecalcEnemy")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin][id]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_EnemyCombatSelf_DropDown()
    HealBot_Options_EnemyCombat_DropDown(HealBot_Options_EnemyCombatSelf, "INCOMBATSHOWSELF")
end

function HealBot_Options_EnemyCombatFocus_DropDown()
    HealBot_Options_EnemyCombat_DropDown(HealBot_Options_EnemyCombatFocus, "INCOMBATSHOWFOCUS")
end

function HealBot_Options_EnemyCombatTanks_DropDown()
    HealBot_Options_EnemyCombat_DropDown(HealBot_Options_EnemyCombatTanks, "INCOMBATSHOWTANK")
end

function HealBot_Options_EnemyCombatMyTargets_DropDown()
    HealBot_Options_EnemyCombat_DropDown(HealBot_Options_EnemyCombatMyTargets, "INCOMBATSHOWLIST")
end

function HealBot_Options_EnemyCombatArena_DropDown()
    HealBot_Options_EnemyCombat_DropDown(HealBot_Options_EnemyCombatArena, "INCOMBATSHOWARENA")
end

function HealBot_Options_EnemyExists_DropDown(object, id)
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_EnemyOOC_List), 1 do
        info.text = HealBot_Options_EnemyOOC_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin][id]~=self:GetID() then
                            Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin][id] = self:GetID()
                            UIDropDownMenu_SetText(object,HealBot_Options_EnemyOOC_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin][id]]) 
                            HealBot_Timers_Set("INIT","RefreshPartyNextRecalcEnemy")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin][id]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_EnemyExistsPlayerTargets_DropDown()
    HealBot_Options_EnemyExists_DropDown(HealBot_Options_EnemyExistsPlayerTargets, "EXISTSHOWPTAR")
end

function HealBot_Options_EnemyExistsFocus_DropDown()
    HealBot_Options_EnemyExists_DropDown(HealBot_Options_EnemyExistsFocus, "EXISTSHOWFOCUS")
end

function HealBot_Options_EnemyExistsTankTargets_DropDown()
    HealBot_Options_EnemyExists_DropDown(HealBot_Options_EnemyExistsTankTargets, "EXISTSHOWTANK")
end

function HealBot_Options_EnemyExistsMyTargets_DropDown()
    HealBot_Options_EnemyExists_DropDown(HealBot_Options_EnemyExistsMyTargets, "EXISTSHOWMYTAR")
end

function HealBot_Options_EnemyExistsArena_DropDown()
    HealBot_Options_EnemyExists_DropDown(HealBot_Options_EnemyExistsArena, "EXISTSHOWARENA")
end
--------------------------------------------------------------------------------

function HealBot_Options_BarHealthColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarHealthColour_List), 1 do
        info.text = HealBot_Options_BarHealthColour_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"]~=self:GetID() then
                            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BarHealthColour,HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"]]) 
                            HealBot_Timers_Set("SKINS","SkinsFormat")
                            HealBot_Options_SetBarsTextColour()
                            HealBot_Panel_resetTestCols(true)
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BarHealthBackColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["BarBack"]), 1 do
        info.text = HealBot_Options_Lists["BarBack"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACK"]~=self:GetID() then
                            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACK"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BarHealthBackColour,HealBot_Options_Lists["BarBack"][Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACK"]]) 
                            HealBot_Timers_Set("SKINS","SkinsFormat")
                            HealBot_Timers_Set("SKINS","UpdateBackground")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACK"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BarBorderColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["BarBackBorder"]), 1 do
        info.text = HealBot_Options_Lists["BarBackBorder"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDER"]~=self:GetID() then
                            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDER"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BarBorderColour,HealBot_Options_Lists["BarBackBorder"][Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDER"]]) 
                            HealBot_Timers_Set("SKINS","SkinsFormat")
                            HealBot_Timers_Set("SKINS","UpdateBackground")
                            HealBot_Timers_Set("SKINS","SkinsFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDER"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_EmergBarCol_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarHealthColour_List), 1 do
        info.text = HealBot_Options_BarHealthColour_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BARCOL"]~=self:GetID() then
                            Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BARCOL"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_EmergBarCol,HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BARCOL"]]) 
                            HealBot_Timers_Set("SKINS","SkinsFramesChanged")
                            HealBot_Timers_Set("SKINS","UpdateEmergBars")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BARCOL"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

-------------------------------------------

function HealBot_Options_Theme_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["Themes"]), 1 do
        info.text = HealBot_Options_Lists["Themes"][j];
        info.func = function(self)
                        if HealBot_Globals.OptionsTheme~=self:GetID() then
                            HealBot_Globals.OptionsTheme = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_Theme,HealBot_Options_Lists["Themes"][HealBot_Globals.OptionsTheme]) 
                            HealBot_Action_StickyFrameIndCols()
                            HealBot_Options_OnLoad(nil, "Theme")
                            HealBot_Timers_InitExtraOptions()
                        end
                    end
        info.checked = false;
        if HealBot_Globals.OptionsTheme==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

-------------------------------------------

function HealBot_Options_NameTextColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarHealthColour_List), 1 do
        info.text = HealBot_Options_BarHealthColour_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NAME"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_NameTextColour,HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NAME"]]) 
                        HealBot_Timers_Set("SKINS","SkinBarTextColours")
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NAME"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_StateTextColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarHealthColour_List), 1 do
        info.text = HealBot_Options_BarHealthColour_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STATE"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_StateTextColour,HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STATE"]]) 
                        HealBot_Timers_Set("SKINS","SkinBarTextColours")
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STATE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_HealthTextColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarHealthColour_List), 1 do
        info.text = HealBot_Options_BarHealthColour_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_HealthTextColour,HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"]]) 
                        HealBot_Timers_Set("SKINS","SkinBarTextColours")
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AggroTextColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarHealthColour_List), 1 do
        info.text = HealBot_Options_BarHealthColour_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AGGRO"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_AggroTextColour,HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AGGRO"]]) 
                        HealBot_Timers_Set("SKINS","SkinBarTextColours")
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AGGRO"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AuxTextColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_AuxBarColours_List), 1 do
        info.text = HealBot_Options_AuxBarColours_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLTYPE"]~=self:GetID() then
                            Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLTYPE"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_AuxTextColour,HealBot_Options_AuxBarColours_List[Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLTYPE"]]) 
                            HealBot_Aux_UpdateAllAuxByType(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxTxtBar"])
                            if HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("AUX","TestUpdate") end
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLTYPE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

-------------------------------------------

function HealBot_Options_BarIncHealColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarIncHealColour_List), 1 do
        info.text = HealBot_Options_BarIncHealColour_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IC"]~=self:GetID() then
                            Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IC"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BarIncHealColour,HealBot_Options_BarIncHealColour_List[Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IC"]]) 
                            if HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("AUX","TestUpdate") end
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IC"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

-------------------------------------------

function HealBot_Options_AbsorbColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_AbsorbColour_List), 1 do
        info.text = HealBot_Options_AbsorbColour_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AC"]~=self:GetID() then
                            Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AC"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_AbsorbColour,HealBot_Options_AbsorbColour_List[Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AC"]]) 
                            if HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("AUX","TestUpdate") end
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AC"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

-------------------------------------------
local function HealBot_Options_BarHealthType_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BarHealthType_List), 1 do
        info.text = HealBot_Options_BarHealthType_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTYPE"]~=self:GetID() then
                            Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTYPE"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BarHealthType, HealBot_Options_BarHealthType_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTYPE"]])
                            HealBot_Options_ResetUpdate()
                            HealBot_Timers_Set("SKINS","SkinsFormat")
                            HealBot_Panel_resetTestCols()
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTYPE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_SetCastModifierId()
    if not HealBot_Options_luVars["ModKeyShift"] and not HealBot_Options_luVars["ModKeyCtrl"] and not HealBot_Options_luVars["ModKeyAlt"] then
        HealBot_Options_ComboButtons_Modifier=1
    elseif not HealBot_Options_luVars["ModKeyCtrl"] and not HealBot_Options_luVars["ModKeyAlt"] then
        HealBot_Options_ComboButtons_Modifier=2
    elseif not HealBot_Options_luVars["ModKeyShift"] and not HealBot_Options_luVars["ModKeyAlt"] then
        HealBot_Options_ComboButtons_Modifier=3
    elseif not HealBot_Options_luVars["ModKeyShift"] and not HealBot_Options_luVars["ModKeyCtrl"] then
        HealBot_Options_ComboButtons_Modifier=4
    elseif not HealBot_Options_luVars["ModKeyAlt"] then
        HealBot_Options_ComboButtons_Modifier=5
    elseif not HealBot_Options_luVars["ModKeyCtrl"] then
        HealBot_Options_ComboButtons_Modifier=6
    elseif not HealBot_Options_luVars["ModKeyShift"] then
        HealBot_Options_ComboButtons_Modifier=7
    else
        HealBot_Options_ComboButtons_Modifier=8
    end 
end

function HealBot_Options_ModKeyShift_OnClick(self)
    if HealBot_Options_luVars["ModKeyShift"]~=self:GetChecked() then
        HealBot_Options_luVars["ModKeyShift"]=self:GetChecked()
        HealBot_Options_SetCastModifierId()
        HealBot_Options_ComboClass_Text()
    end
end

function HealBot_Options_ModKeyCtrl_OnClick(self)
    if HealBot_Options_luVars["ModKeyCtrl"]~=self:GetChecked() then
        HealBot_Options_luVars["ModKeyCtrl"]=self:GetChecked()
        HealBot_Options_SetCastModifierId()
        HealBot_Options_ComboClass_Text()
    end
end

function HealBot_Options_ModKeyAlt_OnClick(self)
    if HealBot_Options_luVars["ModKeyAlt"]~=self:GetChecked() then
        HealBot_Options_luVars["ModKeyAlt"]=self:GetChecked()
        HealBot_Options_SetCastModifierId()
        HealBot_Options_ComboClass_Text()
    end
end

function HealBot_Options_UseIconCmds_OnClick(self)
    if HealBot_Globals.UseIconCommands~=self:GetChecked() then
        HealBot_Globals.UseIconCommands=self:GetChecked()
        HealBot_Timers_Set("SKINS","IconsFramesChanged")
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_SkinsSetCastModifierId()
    if not HealBot_Options_luVars["SkinsModKeyShift"] and not HealBot_Options_luVars["SkinsModKeyCtrl"] and not HealBot_Options_luVars["SkinsModKeyAlt"] then
        HealBot_Options_SkinsComboButtons_Modifier=1
    elseif not HealBot_Options_luVars["SkinsModKeyCtrl"] and not HealBot_Options_luVars["SkinsModKeyAlt"] then
        HealBot_Options_SkinsComboButtons_Modifier=2
    elseif not HealBot_Options_luVars["SkinsModKeyShift"] and not HealBot_Options_luVars["SkinsModKeyAlt"] then
        HealBot_Options_SkinsComboButtons_Modifier=3
    elseif not HealBot_Options_luVars["SkinsModKeyShift"] and not HealBot_Options_luVars["SkinsModKeyCtrl"] then
        HealBot_Options_SkinsComboButtons_Modifier=4
    elseif not HealBot_Options_luVars["SkinsModKeyAlt"] then
        HealBot_Options_SkinsComboButtons_Modifier=5
    elseif not HealBot_Options_luVars["SkinsModKeyCtrl"] then
        HealBot_Options_SkinsComboButtons_Modifier=6
    elseif not HealBot_Options_luVars["SkinsModKeyShift"] then
        HealBot_Options_SkinsComboButtons_Modifier=7
    else
        HealBot_Options_SkinsComboButtons_Modifier=8
    end 
end

--------------------------------------------------------------------------------

function HealBot_Options_ButtonCastMethod_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_ButtonCastMethod_List), 1 do
        info.text = HealBot_Options_ButtonCastMethod_List[j];
        info.func = function(self)
                        local x=HealBot_Config_Spells.ButtonCastMethod
                        HealBot_Config_Spells.ButtonCastMethod = self:GetID()
                        if x~=HealBot_Config_Spells.ButtonCastMethod then 
                            UIDropDownMenu_SetText(HealBot_Options_ButtonCastMethod, HealBot_Options_ButtonCastMethod_List[HealBot_Config_Spells.ButtonCastMethod])
                            HealBot_Timers_Set("INIT","RegisterForClicks")
                        end
                    end
        info.checked = false;
        if HealBot_Config_Spells.ButtonCastMethod==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end


--------------------------------------------------------------------------------

function HealBot_Options_TestBarsProfile_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_TestBarsProfile_List), 1 do
        info.text = HealBot_Options_TestBarsProfile_List[j];
        info.func = function(self)
                        local x=HealBot_Globals.TestBars["PROFILE"]
                        HealBot_Globals.TestBars["PROFILE"] = self:GetID()
                        if x~=HealBot_Globals.TestBars["PROFILE"] then 
                            UIDropDownMenu_SetText(HealBot_Options_TestBarsProfile, HealBot_Options_TestBarsProfile_List[HealBot_Globals.TestBars["PROFILE"]])
                            HealBot_Panel_resetTestCols()
                        end
                    end
        info.checked = false;
        if HealBot_Globals.TestBars["PROFILE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_TestShowDebuffIcons_OnClick(self)
    if HealBot_Globals.TestBarsIcons["DEBUFF"]~=self:GetChecked() then
        HealBot_Globals.TestBarsIcons["DEBUFF"]=self:GetChecked()
        HealBot_Panel_resetTestCols()
    end
end

function HealBot_Options_TestShowBuffIcons_OnClick(self)
    if HealBot_Globals.TestBarsIcons["BUFF"]~=self:GetChecked() then
        HealBot_Globals.TestBarsIcons["BUFF"]=self:GetChecked()
        HealBot_Panel_resetTestCols()
    end
end

function HealBot_Options_TestShowExtraIcons_OnClick(self)
    if HealBot_Globals.TestBarsIcons["EXTRA"]~=self:GetChecked() then
        HealBot_Globals.TestBarsIcons["EXTRA"]=self:GetChecked()
        HealBot_Panel_resetTestCols()
    end
end
--------------------------------------------------------------------------------

function HealBot_OptionBinds_Level1Info(object, info, index)
    for j=1, 3 do
        info.text = HealBot_Options_BindsKeyListRead[j];
        info.func = function(self)
                        if HealBot_Config_Spells.Binds[index]~=self:GetID() then
                            HealBot_Config_Spells.Binds[index]=self:GetID()
                            UIDropDownMenu_SetText(object,HealBot_Options_BindsKeyListRead[HealBot_Config_Spells.Binds[index]])
                            HealBot_Options_CheckBindsOnChange(HealBot_Config_Spells.Binds[index], index)
                        end
                    end
        info.checked = false;
        if HealBot_Config_Spells.Binds[index]==j then info.checked = true end
        UIDropDownMenu_AddButton(info, 1);
    end
    wipe(info)
    info.disabled = true
    info.notCheckable = true
    UIDropDownMenu_AddButton(info)
    info.disabled = false
    info.hasArrow = true
    info.notCheckable = true
    info.keepShownOnClick=false
    info.text = "     0 - 9"
    info.menuList = 1
    UIDropDownMenu_AddButton(info)
    info.text = "     NumPad 0 - 9"
    info.menuList = 2
    UIDropDownMenu_AddButton(info)
    info.text = "     A - M"
    info.menuList = 3
    UIDropDownMenu_AddButton(info)
    info.text = "     N - Z"
    info.menuList = 4
    UIDropDownMenu_AddButton(info)
    info.text = "     Nav Keys"
    info.menuList = 5
    UIDropDownMenu_AddButton(info)
end

function HealBot_OptionBinds_09_Info(object, info, level, index)
    for j=4, 13, 1 do
        info.text = HealBot_Options_BindsKeyListRead[j];
        info.func = function(self)
                        if HealBot_Config_Spells.Binds[index]~=self:GetID()+3 then
                            HealBot_Config_Spells.Binds[index]=self:GetID()+3
                            UIDropDownMenu_SetText(object,HealBot_Options_BindsKeyListRead[HealBot_Config_Spells.Binds[index]])
                            HealBot_Options_CheckBindsOnChange(HealBot_Config_Spells.Binds[index], index)
                        end
                    end
        info.checked = false;
        if HealBot_Config_Spells.Binds[index]==j then info.checked = true end
        UIDropDownMenu_AddButton(info, level);
    end
end

function HealBot_OptionBinds_num09_Info(object, info, level, index)
    for j=14, 23, 1 do
        info.text = HealBot_Options_BindsKeyListRead[j];
        info.func = function(self)
                        if HealBot_Config_Spells.Binds[index]~=self:GetID()+13 then
                            HealBot_Config_Spells.Binds[index]=self:GetID()+13
                            UIDropDownMenu_SetText(object,HealBot_Options_BindsKeyListRead[HealBot_Config_Spells.Binds[index]])
                            HealBot_Options_CheckBindsOnChange(HealBot_Config_Spells.Binds[index], index)
                        end
                    end
        info.checked = false;
        if HealBot_Config_Spells.Binds[index]==j then info.checked = true end
        UIDropDownMenu_AddButton(info, level);
    end
end

function HealBot_OptionBinds_am_Info(object, info, level, index)
    for j=24, 36, 1 do
        info.text = HealBot_Options_BindsKeyListRead[j];
        info.func = function(self)
                        if HealBot_Config_Spells.Binds[index]~=self:GetID()+23 then
                            HealBot_Config_Spells.Binds[index]=self:GetID()+23
                            UIDropDownMenu_SetText(object,HealBot_Options_BindsKeyListRead[HealBot_Config_Spells.Binds[index]])
                            HealBot_Options_CheckBindsOnChange(HealBot_Config_Spells.Binds[index], index)
                        end
                    end
        info.checked = false;
        if HealBot_Config_Spells.Binds[index]==j then info.checked = true end
        UIDropDownMenu_AddButton(info, level);
    end
end

function HealBot_OptionBinds_nz_Info(object, info, level, index)
    for j=37, 49, 1 do
        info.text = HealBot_Options_BindsKeyListRead[j];
        info.func = function(self)
                        if HealBot_Config_Spells.Binds[index]~=self:GetID()+36 then
                            HealBot_Config_Spells.Binds[index]=self:GetID()+36
                            UIDropDownMenu_SetText(object,HealBot_Options_BindsKeyListRead[HealBot_Config_Spells.Binds[index]])
                            HealBot_Options_CheckBindsOnChange(HealBot_Config_Spells.Binds[index], index)
                        end
                    end
        info.checked = false;
        if HealBot_Config_Spells.Binds[index]==j then info.checked = true end
        UIDropDownMenu_AddButton(info, level);
    end
end

function HealBot_OptionBinds_nav_Info(object, info, level, index)
    for j=50, 59, 1 do
        info.text = HealBot_Options_BindsKeyListRead[j];
        info.func = function(self)
                        if HealBot_Config_Spells.Binds[index]~=self:GetID()+49 then
                            HealBot_Config_Spells.Binds[index]=self:GetID()+49
                            UIDropDownMenu_SetText(object,HealBot_Options_BindsKeyListRead[HealBot_Config_Spells.Binds[index]])
                            HealBot_Options_CheckBindsOnChange(HealBot_Config_Spells.Binds[index], index)
                        end
                    end
        info.checked = false;
        if HealBot_Config_Spells.Binds[index]==j then info.checked = true end
        UIDropDownMenu_AddButton(info, level);
    end
end

function HealBot_OptionBinds_DropDown(self, level, menuList, index, object)
    local info = UIDropDownMenu_CreateInfo()
    info.keepShownOnClick=false
    if level == 1 then
        HealBot_OptionBinds_Level1Info(object, info, index)
    elseif menuList == 1 then
        HealBot_OptionBinds_09_Info(object, info, level, index)
    elseif menuList == 2 then
        HealBot_OptionBinds_num09_Info(object, info, level, index)
    elseif menuList == 3 then
        HealBot_OptionBinds_am_Info(object, info, level, index)
    elseif menuList == 4 then
        HealBot_OptionBinds_nz_Info(object, info, level, index)
    elseif menuList == 5 then
        HealBot_OptionBinds_nav_Info(object, info, level, index)
    end
end

function HealBot_Options_Bind1_DropDown(self, level, menuList)
    HealBot_OptionBinds_DropDown(self, level, menuList, 1, HealBot_Options_Bind1)
end

function HealBot_Options_Bind2_DropDown(self, level, menuList)
    HealBot_OptionBinds_DropDown(self, level, menuList, 2, HealBot_Options_Bind2)
end

function HealBot_Options_Bind3_DropDown(self, level, menuList)
    HealBot_OptionBinds_DropDown(self, level, menuList, 3, HealBot_Options_Bind3)
end

function HealBot_Options_Bind4_DropDown(self, level, menuList)
    HealBot_OptionBinds_DropDown(self, level, menuList, 4, HealBot_Options_Bind4)
end

function HealBot_Options_Bind5_DropDown(self, level, menuList)
    HealBot_OptionBinds_DropDown(self, level, menuList, 5, HealBot_Options_Bind5)
end

function HealBot_Options_InitBinds()
    HealBot_Options_Bind1.initialize = HealBot_Options_Bind1_DropDown
    UIDropDownMenu_SetText(HealBot_Options_Bind1,HealBot_Options_BindsKeyListRead[HealBot_Config_Spells.Binds[1]] or HEALBOT_WORDS_NONE)
	HealBot_Options_Bind2.initialize = HealBot_Options_Bind2_DropDown
    UIDropDownMenu_SetText(HealBot_Options_Bind2,HealBot_Options_BindsKeyListRead[HealBot_Config_Spells.Binds[2]] or HEALBOT_WORDS_NONE)
	HealBot_Options_Bind3.initialize = HealBot_Options_Bind3_DropDown
    UIDropDownMenu_SetText(HealBot_Options_Bind3,HealBot_Options_BindsKeyListRead[HealBot_Config_Spells.Binds[3]] or HEALBOT_WORDS_NONE)
	HealBot_Options_Bind4.initialize = HealBot_Options_Bind4_DropDown
    UIDropDownMenu_SetText(HealBot_Options_Bind4,HealBot_Options_BindsKeyListRead[HealBot_Config_Spells.Binds[4]] or HEALBOT_WORDS_NONE)
	HealBot_Options_Bind5.initialize = HealBot_Options_Bind5_DropDown
    UIDropDownMenu_SetText(HealBot_Options_Bind5,HealBot_Options_BindsKeyListRead[HealBot_Config_Spells.Binds[5]] or HEALBOT_WORDS_NONE)
end

--------------------------------------------------------------------------------

HealBot_Options_luVars["hbLangs"] = 3

function HealBot_Options_hbLangs_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_hbLangs_List), 1 do
        info.text = HealBot_Options_hbLangs_List[j];
        info.func = function(self)
                        HealBot_Options_luVars["hbLangs"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_hbLangs, HealBot_Options_hbLangs_List[HealBot_Options_luVars["hbLangs"]])
                    end
        info.checked = false;
        if HealBot_Options_luVars["hbLangs"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_LangsButton_OnClick(self)
    if HealBot_Options_luVars["hbLangs"]==1 then
        HealBot_Options_Lang("zhCN", true)
    elseif HealBot_Options_luVars["hbLangs"]==2 then
        HealBot_Options_Lang("enUK", true)
    elseif HealBot_Options_luVars["hbLangs"]==3 then
        HealBot_Options_Lang("enUS", true)
    elseif HealBot_Options_luVars["hbLangs"]==4 then
        HealBot_Options_Lang("frFR", true)
    elseif HealBot_Options_luVars["hbLangs"]==5 then
        HealBot_Options_Lang("deDE", true)
    elseif HealBot_Options_luVars["hbLangs"]==6 then
        HealBot_Options_Lang("grGR", true)
    elseif HealBot_Options_luVars["hbLangs"]==7 then
        HealBot_Options_Lang("huHU", true)
    elseif HealBot_Options_luVars["hbLangs"]==8 then
        HealBot_Options_Lang("itIT", true)
    elseif HealBot_Options_luVars["hbLangs"]==9 then
        HealBot_Options_Lang("koKR", true)
    elseif HealBot_Options_luVars["hbLangs"]==10 then
        HealBot_Options_Lang("esMX", true)
    elseif HealBot_Options_luVars["hbLangs"]==11 then
        HealBot_Options_Lang("ptBR", true)
    elseif HealBot_Options_luVars["hbLangs"]==12 then
        HealBot_Options_Lang("ruRU", true)
    elseif HealBot_Options_luVars["hbLangs"]==13 then
        HealBot_Options_Lang("esES", true)
    elseif HealBot_Options_luVars["hbLangs"]==14 then
        HealBot_Options_Lang("zhTW", true)
    end                        
end

--------------------------------------------------------------------------------

HealBot_Options_luVars["hbCommands"] = 1

function HealBot_Options_hbCommands_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_hbCommands_List), 1 do
        info.text = HealBot_Options_hbCommands_List[j];
        info.func = function(self)
                        HealBot_Options_luVars["hbCommands"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_hbCommands, HealBot_Options_hbCommands_List[HealBot_Options_luVars["hbCommands"]])
                    end
        info.checked = false;
        if HealBot_Options_luVars["hbCommands"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_ToggleMainAssist()
    if HealBot_Globals.IncMainAssist then
        HealBot_Globals.IncMainAssist=false
        HealBot_AddChat(HEALBOT_CHAT_ADDONID..HEALBOT_CHAT_MAINASSISTOFF)
    else
        HealBot_Globals.IncMainAssist=true
        HealBot_AddChat(HEALBOT_CHAT_ADDONID..HEALBOT_CHAT_MAINASSISTON)
    end
    HealBot_Timers_Set("INIT","RefreshPartyNextRecalcPlayers")
end

function HealBot_Options_CommandsButton_OnClick(self)
    if HealBot_Options_luVars["hbCommands"]==2 then
        HealBot_Panel_ClearBlackList()
    elseif HealBot_Options_luVars["hbCommands"]==3 then
        HealBot_Copy_SpellCombos()
    elseif HealBot_Options_luVars["hbCommands"]==4 then
        HealBot_Reset_Icons()
    elseif HealBot_Options_luVars["hbCommands"]==5 then
        HealBot_SetResetFlag("FRAMES")
    elseif HealBot_Options_luVars["hbCommands"]==6 then
        HealBot_Reset_Buffs()
    elseif HealBot_Options_luVars["hbCommands"]==7 then
        HealBot_Reset_Cures()
    elseif HealBot_Options_luVars["hbCommands"]==8 then
        HealBot_Timers_Set("RESET","CustomDebuffs")
    elseif HealBot_Options_luVars["hbCommands"]==9 then
        HealBot_Timers_Set("RESET","Skins")
    elseif HealBot_Options_luVars["hbCommands"]==10 then
        HealBot_Reset_Spells()
    elseif HealBot_Options_luVars["hbCommands"]==11 then
        HealBot_MountsPets_DislikeMount("Dislike")
    elseif HealBot_Options_luVars["hbCommands"]==12 then
        HealBot_MountsPets_DislikeMount("Exclude")
    elseif HealBot_Options_luVars["hbCommands"]==13 then
        HealBot_ToggleSuppressSetting("error")
    elseif HealBot_Options_luVars["hbCommands"]==14 then
        HealBot_ToggleSuppressSetting("sound")
    elseif HealBot_Options_luVars["hbCommands"]==15 then
        HealBot_Options_ToggleCustomCuresCastBy()
    elseif HealBot_Options_luVars["hbCommands"]==16 then
        HealBot_Options_ToggleMainAssist()
    elseif HealBot_Options_luVars["hbCommands"]==17 then
        HealBot_Include_Skin(HEALBOT_OPTIONS_GROUPHEALS, false)
    elseif HealBot_Options_luVars["hbCommands"]==18 then
        HealBot_Include_Skin(HEALBOT_OPTIONS_RAID25, false)
    elseif HealBot_Options_luVars["hbCommands"]==19 then
        HealBot_Include_Skin(HEALBOT_OPTIONS_RAID40, false)
    elseif HealBot_Options_luVars["hbCommands"]==20 and HEALBOT_GAME_VERSION==3 then
        HealBot_MountsPets_FavClassicMount()
    end
end

--------------------------------------------------------------------------------


HealBot_Options_luVars["hbProfile"] = 1

function HealBot_Options_hbProfile_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_hbProfile_List), 1 do
        info.text = HealBot_Options_hbProfile_List[j];
        info.func = function(self)
                        HealBot_Config.Profile = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_hbProfile, HealBot_Options_hbProfile_List[HealBot_Config.Profile])
                    end
        info.checked = false;
        if HealBot_Config.Profile==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_hbProfile_OnClick(self)
    HealBot_Options_LoadProfile()
end

function HealBot_Options_ProfileSpellCheck(sName,cType)
    local sType,sID = string.split(":", sName)
    if sType=="S" and GetSpellInfo(sID) and IsSpellKnown(sID) then
        return true
    elseif GetMacroIndexByName(sName)>0 then
        return true
    elseif sType=="I" and HealBot_IsKnownItem(sID) then
        return true
    elseif sType=="C" and HealBot_Action_SpellCmdText(cType, sID) then
        return true
    elseif sType=="E" then 
        if sID then return true end
    end
    return false
end

function HealBot_Options_hbProfile_setGlobalSpells(combo, globalcombo, maxButtons, cType)
    local button,key,sType,sID,keySpec=nil,nil,nil,nil,nil
    local HealBot_Keys_List=HealBot_Action_retComboKeysList()
    for z=1,maxButtons do
        button = HealBot_Options_ComboClass_Button(z)
        for y=1, getn(HealBot_Keys_List), 1 do
            key=HealBot_Keys_List[y]..button
            keySpec=HealBot_Action_GetComboSpec(HealBot_Keys_List[y], button)
            if globalcombo[key] and HealBot_Options_ProfileSpellCheck(globalcombo[key],cType) then
                combo[keySpec]=globalcombo[key]
            elseif combo[keySpec] then
                sID=GetMacroIndexByName(combo[keySpec])
                if sID>0 and sID<121 then
                    sType="M"
                else
                    sType,sID = string.split(":", combo[keySpec])
                end
                if sID and sType~="S" then
                    combo[keySpec]=nil
                end
            end
        end
    end
end

function HealBot_Options_LoadProfile()
    if HealBot_Config.Profile>1 then
        if not HealBot_Data["PCLASSTRIM"] then HealBot_SetPlayerData() end
        if HealBot_Data["PCLASSTRIM"] then
            if HealBot_Class_Spells[HealBot_Data["PCLASSTRIM"]] then
                HealBot_Config_Spells=HealBot_Options_copyTable(HealBot_Class_Spells[HealBot_Data["PCLASSTRIM"]])
                table.foreach(HealBot_Config_SpellsDefaults, function (key,val)
                    if HealBot_Config_Spells[key]==nil then
                        HealBot_Config_Spells[key] = val;
                    end
                end);
            else
                HealBot_Options_SaveProfile("SPELLS")
            end
            if HealBot_Class_Buffs[HealBot_Data["PCLASSTRIM"]] then
                HealBot_Config_Buffs=HealBot_Options_copyTable(HealBot_Class_Buffs[HealBot_Data["PCLASSTRIM"]])
                table.foreach(HealBot_Config_BuffsDefaults, function (key,val)
                    if HealBot_Config_Buffs[key]==nil then
                        HealBot_Config_Buffs[key] = val;
                    end
                end);        
            else
                HealBot_Options_SaveProfile("BUFFS")
            end
            if HealBot_Class_Cures[HealBot_Data["PCLASSTRIM"]] then
                HealBot_Config_Cures=HealBot_Options_copyTable(HealBot_Class_Cures[HealBot_Data["PCLASSTRIM"]])
                table.foreach(HealBot_Config_CuresDefaults, function (key,val)
                    if HealBot_Config_Cures[key]==nil then
                        HealBot_Config_Cures[key] = val;
                    end
                end);
            else
                HealBot_Options_SaveProfile("CURES")
            end
            if HealBot_Config.Profile==3 and HealBot_Class_Spells["GLOBAL"] then
                HealBot_Options_hbProfile_setGlobalSpells(HealBot_Config_Spells.EnabledKeyCombo, HealBot_Class_Spells["GLOBAL"].EnabledKeyCombo, 20, "ENABLED")
                HealBot_Options_hbProfile_setGlobalSpells(HealBot_Config_Spells.EnemyKeyCombo, HealBot_Class_Spells["GLOBAL"].EnemyKeyCombo, 20, "ENEMY")
                HealBot_Options_hbProfile_setGlobalSpells(HealBot_Config_Spells.EmergKeyCombo, HealBot_Class_Spells["GLOBAL"].EmergKeyCombo, 5, "EMERG")
                for x=1,20 do 
                    HealBot_Config_Spells.Binds[x]=HealBot_Class_Spells["GLOBAL"].Binds[x]
                end
            end
            HealBot_Timers_InitExtraOptions()
            HealBot_Timers_Set("INIT","PrepSetAllAttribs",0.1)
        else
            HealBot_Timers_Set("PLAYER","LoadProfile",1)
        end
    end
end

function HealBot_Options_hbProfile_saveGlobalCombo(combo, globalcombo, maxButtons)
    local button,sType,sID,key,keySpec=nil,nil,nil,nil
    local HealBot_Keys_List=HealBot_Action_retComboKeysList()
    for z=1,maxButtons do
        button = HealBot_Options_ComboClass_Button(z)
        for y=1, getn(HealBot_Keys_List), 1 do
            key=HealBot_Keys_List[y]..button
            keySpec=HealBot_Action_GetComboSpec(HealBot_Keys_List[y], button)
            if combo[keySpec] then
                sID=GetMacroIndexByName(combo[keySpec])
                if sID>0 and sID<121 then
                    sType="M"
                else
                    sType,sID = string.split(":", combo[keySpec])
                end
                if sID and sType~="S" then 
                    globalcombo[key]=combo[keySpec] 
                else
                    globalcombo[key]=nil
                end
            else
                globalcombo[key]=nil
            end
        end
    end
end

function HealBot_Options_SaveProfile(cType)
    if HealBot_Config.Profile>1 then
        if not HealBot_Data["PCLASSTRIM"] or not HealBot_Data["PLEVEL"] then HealBot_SetPlayerData() end
        if not HealBot_Data["PCLASSTRIM"] or not HealBot_Data["PLEVEL"] then return end
        local sType=cType or "ALL"
        if sType=="SPELLS" or sType=="ALL" then 
            HealBot_Class_Spells[HealBot_Data["PCLASSTRIM"]]=HealBot_Options_copyTable(HealBot_Config_Spells) 
            if HealBot_Config.Profile==3 then 
                if not HealBot_Class_Spells["GLOBAL"] then 
                    HealBot_Class_Spells["GLOBAL"]={} 
                    HealBot_Class_Spells["GLOBAL"].EnabledKeyCombo={}
                    HealBot_Class_Spells["GLOBAL"].EnemyKeyCombo={}
                    HealBot_Class_Spells["GLOBAL"].EmergKeyCombo={}
                    HealBot_Class_Spells["GLOBAL"].Binds={}
                end
                HealBot_Options_hbProfile_saveGlobalCombo(HealBot_Config_Spells.EnabledKeyCombo, HealBot_Class_Spells["GLOBAL"].EnabledKeyCombo, 20)
                HealBot_Options_hbProfile_saveGlobalCombo(HealBot_Config_Spells.EnemyKeyCombo, HealBot_Class_Spells["GLOBAL"].EnemyKeyCombo, 20)
                HealBot_Options_hbProfile_saveGlobalCombo(HealBot_Config_Spells.EmergKeyCombo, HealBot_Class_Spells["GLOBAL"].EmergKeyCombo, 5)
                for x=1,20 do 
                    HealBot_Class_Spells["GLOBAL"].Binds[x]=HealBot_Config_Spells.Binds[x]
                end
            end
        end
        if sType=="BUFFS" or sType=="ALL" then HealBot_Class_Buffs[HealBot_Data["PCLASSTRIM"]]=HealBot_Options_copyTable(HealBot_Config_Buffs) end
        if sType=="CURES" or sType=="ALL" then HealBot_Class_Cures[HealBot_Data["PCLASSTRIM"]]=HealBot_Options_copyTable(HealBot_Config_Cures) end
    end
end

--------------------------------------------------------------------------------

HealBot_Options_luVars["hbFAQ"]=1
function HealBot_Options_FAQ_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, #HEALBOT_ABOUT_FAQ_QUESTIONS, 1 do
        info.text = HEALBOT_ABOUT_FAQ_QUESTIONS[j];
        info.func = function(self)
                        HealBot_Options_luVars["hbFAQ"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_FAQ, HEALBOT_ABOUT_FAQ_QUESTIONS[HealBot_Options_luVars["hbFAQ"]])
                        local g=_G["HealBot_Options_FAQAnswerTextD"] 
                        g:SetText(HEALBOT_ABOUT_FAQ_ANSWERS[HealBot_Options_luVars["hbFAQ"]])
                    end
        info.checked = false;
        if HealBot_Options_luVars["hbFAQ"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_EmergencyFClass_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_EmergencyFClass_List), 1 do
        info.text = HealBot_Options_EmergencyFClass_List[j];
        info.func = function(self)
                        HealBot_Globals.EmergencyFClass = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_EmergencyFClass, HealBot_Options_EmergencyFClass_List[HealBot_Globals.EmergencyFClass])
                        HealBot_Options_EFClass_Reset()
                    end
        info.checked = false;
        if HealBot_Globals.EmergencyFClass==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_EFClass_Reset()
    if HealBot_Globals.EmergencyFClass==1 then
        HealBot_Options_EFClassDruid:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_DRUID]);
        HealBot_Options_EFClassHunter:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_HUNTER]);
        HealBot_Options_EFClassMage:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_MAGE]);
        HealBot_Options_EFClassPaladin:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_PALADIN]);
        HealBot_Options_EFClassPriest:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_PRIEST]);
        HealBot_Options_EFClassRogue:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_ROGUE]);
        HealBot_Options_EFClassShaman:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_SHAMAN]);
        HealBot_Options_EFClassWarlock:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_WARLOCK]);
        HealBot_Options_EFClassWarrior:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_WARRIOR]);
        HealBot_Options_EFClassDemonHunter:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_DEMONHUNTER]);
        HealBot_Options_EFClassDeathKnight:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_DEATHKNIGHT]);
        HealBot_Options_EFClassMonk:SetChecked(HealBot_Globals.EmergIncMelee[HEALBOT_MONK]);
    elseif HealBot_Globals.EmergencyFClass==2 then
        HealBot_Options_EFClassDruid:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_DRUID]);
        HealBot_Options_EFClassHunter:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_HUNTER]);
        HealBot_Options_EFClassMage:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_MAGE]);
        HealBot_Options_EFClassPaladin:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_PALADIN]);
        HealBot_Options_EFClassPriest:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_PRIEST]);
        HealBot_Options_EFClassRogue:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_ROGUE]);
        HealBot_Options_EFClassShaman:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_SHAMAN]);
        HealBot_Options_EFClassWarlock:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_WARLOCK]);
        HealBot_Options_EFClassWarrior:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_WARRIOR]);
        HealBot_Options_EFClassDemonHunter:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_DEMONHUNTER]);
        HealBot_Options_EFClassDeathKnight:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_DEATHKNIGHT]);
        HealBot_Options_EFClassMonk:SetChecked(HealBot_Globals.EmergIncRange[HEALBOT_MONK]);
    elseif HealBot_Globals.EmergencyFClass==3 then
        HealBot_Options_EFClassDruid:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_DRUID]);
        HealBot_Options_EFClassHunter:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_HUNTER]);
        HealBot_Options_EFClassMage:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_MAGE]);
        HealBot_Options_EFClassPaladin:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_PALADIN]);
        HealBot_Options_EFClassPriest:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_PRIEST]);
        HealBot_Options_EFClassRogue:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_ROGUE]);
        HealBot_Options_EFClassShaman:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_SHAMAN]);
        HealBot_Options_EFClassWarlock:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_WARLOCK]);
        HealBot_Options_EFClassWarrior:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_WARRIOR]);
        HealBot_Options_EFClassDemonHunter:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_DEMONHUNTER]);
        HealBot_Options_EFClassDeathKnight:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_DEATHKNIGHT]);
        HealBot_Options_EFClassMonk:SetChecked(HealBot_Globals.EmergIncHealers[HEALBOT_MONK]);
    elseif HealBot_Globals.EmergencyFClass==4 then
        HealBot_Options_EFClassDruid:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_DRUID]);
        HealBot_Options_EFClassHunter:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_HUNTER]);
        HealBot_Options_EFClassMage:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_MAGE]);
        HealBot_Options_EFClassPaladin:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_PALADIN]);
        HealBot_Options_EFClassPriest:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_PRIEST]);
        HealBot_Options_EFClassRogue:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_ROGUE]);
        HealBot_Options_EFClassShaman:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_SHAMAN]);
        HealBot_Options_EFClassWarlock:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_WARLOCK]);
        HealBot_Options_EFClassWarrior:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_WARRIOR]);
        HealBot_Options_EFClassDemonHunter:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_DEMONHUNTER]);
        HealBot_Options_EFClassDeathKnight:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_DEATHKNIGHT]);
        HealBot_Options_EFClassMonk:SetChecked(HealBot_Globals.EmergIncCustom[HEALBOT_MONK]);
    end
    HealBot_Timers_Set("SKINS","QuickFramesChanged")
end

--------------------------------------------------------------------------------
function HealBot_Options_ExtraSubSort_UpdateDropDown()
    HealBot_Options_ExtraSubSort.initialize = HealBot_Options_ExtraSubSort_DropDown
    UIDropDownMenu_SetText(HealBot_Options_ExtraSubSort,HealBot_Options_Sort_List[Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUBORDER"]]) 
end

function HealBot_Options_ExtraSubSort_SetAlpha()
    if Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RAIDORDER"]==1 or
       Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RAIDORDER"]==4 then
        HealBot_Options_ExtraSubSort:SetAlpha(0.4)
        Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUBORDER"] = Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RAIDORDER"]
        HealBot_Options_ExtraSubSort_UpdateDropDown()
    else
        HealBot_Options_ExtraSubSort:SetAlpha(1)
    end
end

function HealBot_Options_ExtraSort_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Sort_List), 1 do
        info.text = HealBot_Options_Sort_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RAIDORDER"] = self:GetID();
                        UIDropDownMenu_SetText(HealBot_Options_ExtraSort,HealBot_Options_Sort_List[Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RAIDORDER"]]) 
                        HealBot_Timers_Set("SKINS","QuickFramesChanged")
                        HealBot_Options_ExtraSubSort_SetAlpha()
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RAIDORDER"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_ExtraSubSort_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Sort_List), 1 do
        info.text = HealBot_Options_Sort_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUBORDER"] = self:GetID();
                        UIDropDownMenu_SetText(HealBot_Options_ExtraSubSort,HealBot_Options_Sort_List[Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUBORDER"]]) 
                        HealBot_Timers_Set("SKINS","QuickFramesChanged")
                        HealBot_Options_ExtraSubSort_SetAlpha()
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUBORDER"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_Override_EffectsUse_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_UseOverrides_List), 1 do
        info.text = HealBot_Options_UseOverrides_List[j];
        info.func = function(self)
                        HealBot_Globals.OverrideEffects["USE"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_Override_EffectsUse,HealBot_Options_UseOverrides_List[HealBot_Globals.OverrideEffects["USE"]]) 
                        HealBot_Timers_Set("LAST","OverrideEffectsUseToggle")
                    end
        info.checked = false;
        if HealBot_Globals.OverrideEffects["USE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_Override_EffectsUse_Toggle()
    HealBot_Options_DoEffects_DropDowns()
    if HealBot_Globals.OverrideEffects["USE"]==1 then
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideUseHealthDrop",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideUseFluidBars",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideUseFluidBarsAlpha",false)
        HealBot_Options_UseOverrideFocusGroups:SetAlpha(0.4)
        HealBot_Options_OverrideHotBarDebuffPrio:SetAlpha(0.4)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideBarUpdateFreq",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideHealthDropPct",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideHotBarHealthThres",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideHealthDropSpeed",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideFocusGroupDimming",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideHotBarDimming",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAuxBarFlashFreq",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAuxBarFlashAlphaMin",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAuxBarFlashAlphaMax",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideGoToAuxBarConfig",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideBorderHazardFreq",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideBorderHazardMinAlpha",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_UseHealthDrop",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_UseFluidBars",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_UseFluidBarsAlpha",true)
        HealBot_Options_UseFocusGroups:SetAlpha(1)
        HealBot_Options_HotBarDebuffPrio:SetAlpha(1)
        for x=1,8 do
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideEFGroup"..x,false)
        end
        for x=1,8 do
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_EFGroup"..x,true)
        end
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthDropPct",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthDropSpeed",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HotBarHealthThres",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_BarUpdateFreq",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_FocusGroupDimming",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HotBarDimming",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AuxBarFlashFreq",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AuxBarFlashAlphaMin",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AuxBarFlashAlphaMax",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_GoToAuxBarConfig",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_BorderHazardFreq",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_BorderHazardMinAlpha",true)
        g=_G["HealBot_OverrideHealthDrop_FontStr"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_OverrideHotBars_FontStr"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_OverrideEffectsFluid_FontStr"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_SkinsOverrideFocusGroupsText"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_SkinsOverrideBorderHazardText"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_OverrideAuxBarsAssign_FontStr"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_HealthDrop_FontStr"]
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_EffectsFluid_FontStr"]
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_AuxBarsAssign_FontStr"]
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_SkinsBorderHazardText"]
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_SkinsFocusGroupsText"]
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_HotBars_FontStr"]
        g:SetTextColor(1,1,1,1)
    else
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideUseHealthDrop",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideUseFluidBars",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideUseFluidBarsAlpha",true)
        HealBot_Options_UseOverrideFocusGroups:SetAlpha(1)
        HealBot_Options_OverrideHotBarDebuffPrio:SetAlpha(1)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideBarUpdateFreq",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideHealthDropPct",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideHotBarHealthThres",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideHealthDropSpeed",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideFocusGroupDimming",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideHotBarDimming",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAuxBarFlashFreq",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAuxBarFlashAlphaMin",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAuxBarFlashAlphaMax",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideGoToAuxBarConfig",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideBorderHazardFreq",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideBorderHazardMinAlpha",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_UseHealthDrop",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_UseFluidBars",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_UseFluidBarsAlpha",false)
        HealBot_Options_UseFocusGroups:SetAlpha(0.4)
        HealBot_Options_HotBarDebuffPrio:SetAlpha(0.4)
        for x=1,8 do
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideEFGroup"..x,true)
        end
        for x=1,8 do
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_EFGroup"..x,false)
        end
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthDropPct",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HealthDropSpeed",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HotBarHealthThres",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_BarUpdateFreq",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_FocusGroupDimming",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HotBarDimming",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AuxBarFlashFreq",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AuxBarFlashAlphaMin",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AuxBarFlashAlphaMax",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_GoToAuxBarConfig",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_BorderHazardFreq",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_BorderHazardMinAlpha",false)
        g=_G["HealBot_EffectsFluid_FontStr"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_AuxBarsAssign_FontStr"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_SkinsBorderHazardText"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_SkinsFocusGroupsText"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_HealthDrop_FontStr"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_HotBars_FontStr"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_OverrideEffectsFluid_FontStr"]
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_OverrideHealthDrop_FontStr"]
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_OverrideHotBars_FontStr"]
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_SkinsOverrideFocusGroupsText"]
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_SkinsOverrideBorderHazardText"]
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_OverrideAuxBarsAssign_FontStr"]
        g:SetTextColor(1,1,1,1)
    end
    HealBot_Timers_Set("AUX","BarFlashAlphaMinMax")
    HealBot_Timers_Set("LAST","BarFreqVars")
    HealBot_Timers_Set("SKINS","SetFocusGroups")
    --HealBot_Options_DoEffects_DropDowns()
    --if HealBot_Globals.OverrideEffects["FLUIDBARS"]~=Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDBARS"] then
    --    HealBot_Timers_Set("AUX","UpdateAllAuxByType")
    --else
        HealBot_Timers_Set("SKINS","FluidFlashInUse")
    --end
end

function HealBot_Options_Override_ChatUse_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_UseOverrides_List), 1 do
        info.text = HealBot_Options_UseOverrides_List[j];
        info.func = function(self)
                        HealBot_Globals.OverrideChat["USE"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_Override_ChatUse,HealBot_Options_UseOverrides_List[HealBot_Globals.OverrideChat["USE"]]) 
                        HealBot_Timers_Set("CHAT","OverrideChatUseToggle")
                    end
        info.checked = false;
        if HealBot_Globals.OverrideChat["USE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_Override_ChatUse_Toggle()
    if HealBot_Globals.OverrideChat["USE"]==1 then
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify1",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify2",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify3",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify4",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify5",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify6",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotifyResOnly",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideNotifyOtherMsg",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAfterCombatOOM",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAfterCombatOOMValue",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify1",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify2",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify3",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify4",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify5",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify6",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotifyResOnly",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_NotifyOtherMsg",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AfterCombatOOM",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AfterCombatOOMValue",true)
    else
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify1",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify2",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify3",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify4",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify5",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotify6",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideCastNotifyResOnly",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideNotifyOtherMsg",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAfterCombatOOM",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAfterCombatOOMValue",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify1",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify2",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify3",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify4",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify5",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotify6",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_CastNotifyResOnly",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_NotifyOtherMsg",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AfterCombatOOM",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AfterCombatOOMValue",false)
    end
    HealBot_Timers_Set("CHAT","SetChat")
end

function HealBot_Options_SetChat()
    if HealBot_Globals.OverrideChat["USE"]==1 then
        HealBot_setLuVars("EOCOOM", Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["EOCOOM"])
        HealBot_setLuVars("EOCOOMV", Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["EOCOOMV"])
        HealBot_setLuVars("ChatMSG", Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["MSG"])
        HealBot_setLuVars("ChatRESONLY", Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["RESONLY"])
        HealBot_setLuVars("ChatNOTIFY", Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["NOTIFY"])
    else
        HealBot_setLuVars("EOCOOM", HealBot_Globals.OverrideChat["EOCOOM"])
        HealBot_setLuVars("EOCOOMV", HealBot_Globals.OverrideChat["EOCOOMV"])
        HealBot_setLuVars("ChatMSG", HealBot_Globals.OverrideChat["MSG"])
        HealBot_setLuVars("ChatRESONLY", HealBot_Globals.OverrideChat["RESONLY"])
        HealBot_setLuVars("ChatNOTIFY", HealBot_Globals.OverrideChat["NOTIFY"])
    end
end

function HealBot_Options_Override_FramesUse_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_UseOverrides_List), 1 do
        info.text = HealBot_Options_UseOverrides_List[j];
        info.func = function(self)
                        HealBot_Globals.OverrideFrames["USE"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_Override_FramesUse,HealBot_Options_UseOverrides_List[HealBot_Globals.OverrideFrames["USE"]]) 
                        HealBot_Timers_Set("LAST","OverrideFramesUseToggle")
                    end
        info.checked = false;
        if HealBot_Globals.OverrideFrames["USE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_Override_FramesUse_Toggle()
    if HealBot_Globals.OverrideFrames["USE"]==1 then
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAlwaysRunEvents",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverridePartyFrames",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverridePlayerTargetFrames",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideFocusFrame",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideMiniBossFrames",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideRaidFrames",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AlwaysRunEvents",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_PartyFrames",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_PlayerTargetFrames",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_MiniBossFrames",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_FocusFrame",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_RaidFrames",true)
        g=_G["HealBot_GeneralSkinBlizz_FontStr"]
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_OverrideGeneralSkinBlizz_FontStr"]
        g:SetTextColor(1,1,1,0.4)
    else
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideAlwaysRunEvents",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverridePartyFrames",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverridePlayerTargetFrames",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideFocusFrame",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideMiniBossFrames",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_OverrideRaidFrames",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_AlwaysRunEvents",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_PartyFrames",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_PlayerTargetFrames",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_MiniBossFrames",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_FocusFrame",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_RaidFrames",false)
        g=_G["HealBot_GeneralSkinBlizz_FontStr"]
        g:SetTextColor(1,1,1,0.4)
        g=_G["HealBot_OverrideGeneralSkinBlizz_FontStr"]
        g:SetTextColor(1,1,1,1)
    end
    HealBot_Options_SetFrames()
    HealBot_Timers_ToggleBlizzardFrames()
end

function HealBot_Options_SetFrames()
    if HealBot_Globals.OverrideFrames["USE"]==1 then
        HealBot_setLuVars("HIDEPARTYF", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEPARTYF"])
        HealBot_setLuVars("HIDEPTF", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEPTF"])
        HealBot_setLuVars("HIDEFOCUSF", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEFOCUSF"])
        HealBot_setLuVars("HIDEBOSSF", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEBOSSF"])
        HealBot_setLuVars("HIDERAIDF", Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDERAIDF"])
        HealBot_Options_luVars["RUNBLIZZEVENTS"] = Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["RUNBLIZZEVENTS"]
    else
        HealBot_setLuVars("HIDEPARTYF", HealBot_Globals.OverrideFrames["HIDEPARTYF"])
        HealBot_setLuVars("HIDEPTF", HealBot_Globals.OverrideFrames["HIDEPTF"])
        HealBot_setLuVars("HIDEFOCUSF", HealBot_Globals.OverrideFrames["HIDEFOCUSF"])
        HealBot_setLuVars("HIDEBOSSF", HealBot_Globals.OverrideFrames["HIDEBOSSF"])
        HealBot_setLuVars("HIDERAIDF", HealBot_Globals.OverrideFrames["HIDERAIDF"])
        HealBot_Options_luVars["RUNBLIZZEVENTS"] = HealBot_Globals.OverrideFrames["RUNBLIZZEVENTS"]
    end
end
--------------------------------------------------------------------------------

HealBot_Options_luVars["ActionBarsCombo"]=1
HealBot_Options_luVars["hbIconHelpSelectID"]=0
function HealBot_Options_ActionBarsCombo_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_ActionBarsCombo_List), 1 do
        info.text = HealBot_Options_ActionBarsCombo_List[j];
        info.func = function(self)
                        HealBot_Options_luVars["ActionBarsCombo"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_ActionBarsCombo,HealBot_Options_ActionBarsCombo_List[HealBot_Options_luVars["ActionBarsCombo"]]) 
                        HealBot_Options_ComboClass_Text();
                        if HealBot_Options_luVars["ActionBarsCombo"]<4 and HealBot_Options_luVars["hbIconHelpSelectID"]>0 then
                            HealBot_Options_HelpSpellsSelect_HideIconDropdown(HealBot_Options_luVars["hbIconHelpSelectID"])
                        end
                    end
        info.checked = false;
        if HealBot_Options_luVars["ActionBarsCombo"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

local HealBot_Options_SCAC = { [1] = HEALBOT_WOWMENU,
                               [2] = HEALBOT_TOGGLE_ENABLED,
                               [3] = HEALBOT_HBMENU
                             }
function HealBot_Options_ComboClass_Text()
    local combo=nil
    local cType="ICON"
    local modifier=HealBot_Options_ComboButton_ModifierKey(HealBot_Options_ComboButtons_Modifier)
    if HealBot_Options_luVars["ActionBarsCombo"]==1 then
        cType="ENABLED"
    elseif HealBot_Options_luVars["ActionBarsCombo"]==2 then
        cType="ENEMY"
    elseif HealBot_Options_luVars["ActionBarsCombo"]==3 then
        cType="EMERG"
    end
    HealBot_Action_ClearSpellCache(cType)
    
    HealBot_Options_Button1:SetText(HealBot_Action_GetSpell(cType, HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(1))) or "")
    HealBot_Options_Button2:SetText(HealBot_Action_GetSpell(cType, HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(2))) or "")
    HealBot_Options_Button3:SetText(HealBot_Action_GetSpell(cType, HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(3))) or "")
    HealBot_Options_Button4:SetText(HealBot_Action_GetSpell(cType, HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(4))) or "")
    HealBot_Options_Button5:SetText(HealBot_Action_GetSpell(cType, HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(5))) or "")

    if cType=="ICON" then
        HealBot_SpellAutoTarget:Hide()
        HealBot_ShiftSpellAutoTarget:Hide()
        HealBot_CtrlSpellAutoTarget:Hide()
        HealBot_AltSpellAutoTarget:Hide()
        HealBot_CtrlShiftSpellAutoTarget:Hide()
        HealBot_SpellAutoTrinket1:Hide()
        HealBot_ShiftSpellAutoTrinket1:Hide()
        HealBot_CtrlSpellAutoTrinket1:Hide()
        HealBot_AltSpellAutoTrinket1:Hide()
        HealBot_CtrlShiftSpellAutoTrinket1:Hide()
        HealBot_SpellAutoTrinket2:Hide()
        HealBot_ShiftSpellAutoTrinket2:Hide()
        HealBot_CtrlSpellAutoTrinket2:Hide()
        HealBot_AltSpellAutoTrinket2:Hide()
        HealBot_CtrlShiftSpellAutoTrinket2:Hide()
        HealBot_AvoidBlueCursor:Hide()
        HealBot_ShiftAvoidBlueCursor:Hide()
        HealBot_CtrlAvoidBlueCursor:Hide()
        HealBot_AltAvoidBlueCursor:Hide()
        HealBot_CtrlShiftAvoidBlueCursor:Hide()
        HealBot_Options_Bind1:Hide()
        HealBot_Options_Bind2:Hide()
        HealBot_Options_Bind3:Hide()
        HealBot_Options_Bind4:Hide()
        HealBot_Options_Bind5:Hide()
        HealBot_Options_Button1:ClearAllPoints()
        HealBot_Options_Button1:SetPoint("TOPLEFT",220,-180)
        HealBot_Options_UseIconCmds:Show()
    else
        HealBot_Options_Button1:ClearAllPoints()
        HealBot_Options_Button1:SetPoint("TOPLEFT",135,-180)
        HealBot_Options_UseIconCmds:Hide()
        HealBot_SpellAutoTarget:Show()
        HealBot_ShiftSpellAutoTarget:Show()
        HealBot_CtrlSpellAutoTarget:Show()
        HealBot_AltSpellAutoTarget:Show()
        HealBot_CtrlShiftSpellAutoTarget:Show()
        HealBot_SpellAutoTrinket1:Show()
        HealBot_ShiftSpellAutoTrinket1:Show()
        HealBot_CtrlSpellAutoTrinket1:Show()
        HealBot_AltSpellAutoTrinket1:Show()
        HealBot_CtrlShiftSpellAutoTrinket1:Show()
        HealBot_SpellAutoTrinket2:Show()
        HealBot_ShiftSpellAutoTrinket2:Show()
        HealBot_CtrlSpellAutoTrinket2:Show()
        HealBot_AltSpellAutoTrinket2:Show()
        HealBot_CtrlShiftSpellAutoTrinket2:Show()
        HealBot_AvoidBlueCursor:Show()
        HealBot_ShiftAvoidBlueCursor:Show()
        HealBot_CtrlAvoidBlueCursor:Show()
        HealBot_AltAvoidBlueCursor:Show()
        HealBot_CtrlShiftAvoidBlueCursor:Show()
        HealBot_Options_Bind1:Show()
        HealBot_Options_Bind2:Show()
        HealBot_Options_Bind3:Show()
        HealBot_Options_Bind4:Show()
        HealBot_Options_Bind5:Show()
        
        if HealBot_Options_luVars["ActionBarsCombo"]==1 then
            combo = HealBot_Config_Spells.EnabledSpellTarget;
        elseif HealBot_Options_luVars["ActionBarsCombo"]==2 then
            combo = HealBot_Config_Spells.EnemySpellTarget;
        elseif HealBot_Options_luVars["ActionBarsCombo"]==3 then
            combo = HealBot_Config_Spells.EmergSpellTarget;
        else
            combo=false
        end
        if combo then
            HealBot_SpellAutoTarget:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(1))] or false)
            HealBot_ShiftSpellAutoTarget:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(2))] or false)
            HealBot_CtrlSpellAutoTarget:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(3))] or false)
            HealBot_AltSpellAutoTarget:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(4))] or false)
            HealBot_CtrlShiftSpellAutoTarget:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(5))] or false)
        end
        if HealBot_Options_luVars["ActionBarsCombo"]==1 then
            combo = HealBot_Config_Spells.EnabledSpellTrinket1;
        elseif HealBot_Options_luVars["ActionBarsCombo"]==2 then
            combo = HealBot_Config_Spells.EnemySpellTrinket1;
        elseif HealBot_Options_luVars["ActionBarsCombo"]==3 then
            combo = HealBot_Config_Spells.EmergSpellTrinket1;
        else
            combo=false
        end
        if combo then
            HealBot_SpellAutoTrinket1:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(1))] or false)
            HealBot_ShiftSpellAutoTrinket1:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(2))] or false)
            HealBot_CtrlSpellAutoTrinket1:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(3))] or false)
            HealBot_AltSpellAutoTrinket1:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(4))] or false)
            HealBot_CtrlShiftSpellAutoTrinket1:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(5))] or false)
        end
        if HealBot_Options_luVars["ActionBarsCombo"]==1 then
            combo = HealBot_Config_Spells.EnabledSpellTrinket2;
        elseif HealBot_Options_luVars["ActionBarsCombo"]==2 then
            combo = HealBot_Config_Spells.EnemySpellTrinket2;
        elseif HealBot_Options_luVars["ActionBarsCombo"]==3 then
            combo = HealBot_Config_Spells.EmergSpellTrinket2;
        else
            combo=false
        end
        if combo then
            HealBot_SpellAutoTrinket2:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(1))] or false)
            HealBot_ShiftSpellAutoTrinket2:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(2))] or false)
            HealBot_CtrlSpellAutoTrinket2:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(3))] or false)
            HealBot_AltSpellAutoTrinket2:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(4))] or false)
            HealBot_CtrlShiftSpellAutoTrinket2:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(5))] or false)
        end
        if HealBot_Options_luVars["ActionBarsCombo"]==1 then
            combo = HealBot_Config_Spells.EnabledAvoidBlueCursor;
        elseif HealBot_Options_luVars["ActionBarsCombo"]==2 then
            combo = HealBot_Config_Spells.EnemyAvoidBlueCursor;
        elseif HealBot_Options_luVars["ActionBarsCombo"]==3 then
            combo = HealBot_Config_Spells.EmergAvoidBlueCursor;
        else
            combo=false
        end
        if combo then
            HealBot_AvoidBlueCursor:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(1))] or false)
            HealBot_ShiftAvoidBlueCursor:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(2))] or false)
            HealBot_CtrlAvoidBlueCursor:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(3))] or false)
            HealBot_AltAvoidBlueCursor:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(4))] or false)
            HealBot_CtrlShiftAvoidBlueCursor:SetChecked(combo[HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(5))] or false)
        end
    end
end

--------------------------------------------------------------------------------

HealBot_Options_luVars["HealSpellsComboID"] = 0
HealBot_Options_luVars["SkinsHealSpellsComboID"] = 0

function HealBot_Options_FullHealSpellsCombo_list(sType)
    local HealBot_Options_SelectHealSpellsCombo_List = {}
    if sType==2 then
        HealBot_Options_SelectHealSpellsCombo_List = {
            HEALBOT_MINDBENDER,
            HEALBOT_SMITE,
            HEALBOT_HOLY_WORD_CHASTISE,
            HEALBOT_HOLY_FIRE,
            HEALBOT_SHADOW_WORD_PAIN,
            HEALBOT_WRATH,
            HEALBOT_FAERIE_FIRE,
            HEALBOT_JAB,
            HEALBOT_TIGER_PALM,
            HEALBOT_CHI_BURST,
            HEALBOT_JUDGMENT,
            HEALBOT_SHIELD_OF_THE_RIGHTEOUS,
            HEALBOT_CRUSADER_STRIKE,
            HEALBOT_CHAIN_LIGHTNING,
            HEALBOT_ELEMENTAL_BLAST,
            HEALBOT_FLAME_SHOCK,
            HBC_FLAME_SHOCK,
            HEALBOT_FROST_SHOCK,
            HEALBOT_MAGE_BOMB,
            HEALBOT_CONCUSSIVE_SHOT,
            HEALBOT_PLAGUE_STRIKE,
            HEALBOT_GOUGE,
            HEALBOT_CORRUPTION,
            HEALBOT_EXECUTE,
            HEALBOT_EARTH_SHOCK,
            HEALBOT_LAVA_BLAST,
            HEALBOT_LIGHTNING_BOLT,
            HBC_LIGHTNING_BOLT,
            HEALBOT_FAERIE_SWARM,
            HEALBOT_MOONFIRE,
            HEALBOT_PRIMAL_STRIKE,
            HEALBOT_MIND_SEAR,
            HEALBOT_SHADOW_WORD_DEATH,
            HEALBOT_BLACKOUT_KICK,
            HEALBOT_TOUCH_OF_DEATH,
            HEALBOT_CRACKLING_JADE_LIGHTNING,
            HEALBOT_DENOUNCE,
            HEALBOT_HAMMER_OF_WRATH,
            HEALBOT_HOLY_SHOCK,
            HEALBOT_TAUNT,
            HEALBOT_FEAR,
            HEALBOT_THROW,
            HEALBOT_DEATH_COIL,
            HEALBOT_ARCANE_SHOT,
            HEALBOT_AIMED_SHOT,
            HEALBOT_FIRE_BLAST,
            HEALBOT_FROSTFIRE_BOLT,
        }
    else
        HealBot_Options_SelectHealSpellsCombo_List = {
            HEALBOT_BINDING_HEAL,
            HEALBOT_HOLY_NOVA,
            HEALBOT_UNHOLY_HOVA,
            HEALBOT_CIRCLE_OF_HEALING,
            HEALBOT_DESPERATE_PRAYER,
            HEALBOT_CHAIN_HEAL,
            HEALBOT_SPIRIT_LINK_TOTEM,
            HEALBOT_FLASH_HEAL,
            HEALBOT_POWER_WORD_LIFE,
            HEALBOT_HOLY_WORD_SERENITY,
            HEALBOT_SURGING_MIST,
            HEALBOT_HOLY_WORD_SALVATION,
            HEALBOT_FLASH_OF_LIGHT,
            HEALBOT_GREATER_HEAL,
            HEALBOT_HEALING_TOUCH,
            HEALBOT_HEAL,
            HBC_HEAL,
            HBC_HOLY_NOVA,
            HEALBOT_HEALING_WAVE,
            HBC_HEALING_WAVE,
            HBC_LESSER_HEALING_WAVE,
            HBC_RU_LESSER_HEALING_WAVE,
            HEALBOT_HEALING_SURGE,
            HEALBOT_LIGHT_OF_DAWN,
            HEALBOT_HOLY_LIGHT,
            HBC_HOLY_LIGHT,
            HEALBOT_HOLY_RADIANCE,
            HEALBOT_HOLY_PRISM,
            HEALBOT_WORD_OF_GLORY,
            HEALBOT_DIVINE_LIGHT,
            HEALBOT_LAY_ON_HANDS,
            HEALBOT_TYRS_DELIVERANCE,
            HEALBOT_HOLY_SHOCK,
            HEALBOT_LIFEBLOOM,
            HEALBOT_HEALING_STREAM_TOTEM,
            HEALBOT_HEALING_TIDE_TOTEM,
            HEALBOT_PENANCE,
            HEALBOT_PRAYER_OF_HEALING,
            HEALBOT_PRAYER_OF_MENDING,
            HEALBOT_RIPTIDE,
            HEALBOT_PRIMORDIAL_WAVE,
            HEALBOT_WELLSPRING,
            HEALBOT_DOWNPOUR,
            HEALBOT_REGROWTH,
            HEALBOT_NOURISH,
            HBC_NOURISH,
            HEALBOT_RENEW,
            HEALBOT_DIVINE_HYMN,
            HEALBOT_HEALING_RAIN,
            HEALBOT_REJUVENATION,
            HEALBOT_OVERGROWTH,
            HEALBOT_WILD_GROWTH,
            HEALBOT_SWIFTMEND,
            HEALBOT_TRANQUILITY,
            HEALBOT_GIFT_OF_THE_NAARU,
            HEALBOT_MENDPET,
            HEALBOT_HEALTH_FUNNEL,
            HEALBOT_SOOTHING_MIST,
            HEALBOT_ZEN_MEDITATION,
            HEALBOT_LIFE_COCOON,
            HEALBOT_ENVELOPING_MIST,
            HEALBOT_REVIVAL,
            HEALBOT_RENEWING_MIST,
            HEALBOT_UPLIFT,
            HEALBOT_SURGING_MIST,
            HEALBOT_CHI_WAVE,
            HEALBOT_ZEN_SPHERE,
            HEALBOT_CHI_BURST,
            HEALBOT_EXECUTION_SENTENCE,
            HEALBOT_CASCADE,
            HEALBOT_DIVINE_STAR,
            HEALBOT_HALO,               
            --HEALBOT_SAVING_GRACE,                    
            HEALBOT_CLARITY_OF_PURPOSE,
            HEALBOT_CENARION_WARD,
            HEALBOT_BREATH_OF_THE_SERPENT,
            HEALBOT_CHI_EXPLOSION,
            HEALBOT_RUSHING_JADE_WIND,              
            HEALBOT_CHI_TOROEDO,
            HEALBOT_BEACON_OF_LIGHT,
            --Legion Added
            HEALBOT_PLEA, --Priest                           
            HEALBOT_POWER_WORD_RADIANCE,            
            HEALBOT_SHADOW_COVENANT,                
            HEALBOT_SHADOW_MEND,
            HEALBOT_HOLY_WORD_SANCTIFY,              
            HEALBOT_BESTOW_FAITH, --Paladin                    
            HEALBOT_LIGHT_OF_THE_MARTYR, 
            HEALBOT_BEACON_OF_VIRTUE,     
            HEALBOT_HAND_OF_THE_PROTECTOR,   
            HEALBOT_ESSENCE_FONT,
            HEALBOT_LIGHT_OF_TUURE, --Priest       
            HEALBOT_LIVING_FLAME,
            HEALBOT_EMERALD_BLOSSOM,
            HEALBOT_ECHO,
            HEALBOT_DREAM_FLIGHT,
            HEALBOT_REVERSION,
            HEALBOT_REWIND,
            HEALBOT_DREAM_BREATH,
            HEALBOT_SPIRITBLOOM,
            HEALBOT_VERDANT_EMBRACE,
            HEALBOT_RENEWING_BLAZE,
            HEALBOT_DREAM_PROJECTION,
            HEALBOT_EMERALD_COMMUNION,
        }
    end
    return HealBot_Options_SelectHealSpellsCombo_List
end

local cHealDDClassicMaxRank={}
function HealBot_Options_SelectClassicHealSpellsRanksCombo_DDlist(spellName)
    local rankHealDDlist={}
    for j=1, cHealDDClassicMaxRank[spellName], 1 do
        table.insert(rankHealDDlist, HealBot_Init_retRank(spellName, j))
    end
    return rankHealDDlist
end
    
function HealBot_Options_SelectHealSpellsCombo_DDlist(sType)
    local tmpHealDDlist={}
    for x,_ in pairs(HealBot_Options_NoDuplcates) do
        HealBot_Options_NoDuplcates[x]=nil
    end 
    if sType==2 or HEALBOT_GAME_VERSION>2 or HealBot_Globals.NoRanks then
        local fullHealDDlist=HealBot_Options_FullHealSpellsCombo_list(sType)
        for j=1, getn(fullHealDDlist), 1 do
            local spellName=HealBot_KnownSpell(fullHealDDlist[j])
            if spellName and not HealBot_Options_NoDuplcates[spellName] then
                table.insert(tmpHealDDlist, spellName)
                HealBot_Options_NoDuplcates[spellName]=true
            end
        end
    else
        local knownHealSpells=HealBot_Init_retFoundHealSpells()
        for kSpell,_ in pairs(knownHealSpells) do
            if not HealBot_Options_NoDuplcates[kSpell] then
                HealBot_Options_NoDuplcates[kSpell]=true
                table.insert(tmpHealDDlist, kSpell)
                cHealDDClassicMaxRank[kSpell]=HealBot_Init_ClassicHealSpellMaxRank(kSpell)
            end
        end
    end
    table.sort(tmpHealDDlist)
    return tmpHealDDlist
end

local function HealBot_Options_SelectHealSpellsCombo_DropDown(self, level, menuList)
    local info = UIDropDownMenu_CreateInfo()
    local hbHealDDlist=HealBot_Options_SelectHealSpellsCombo_DDlist(HealBot_Options_luVars["ActionBarsCombo"])
    if getn(hbHealDDlist)>0 then
        if HealBot_Options_luVars["ActionBarsCombo"]==2 or HEALBOT_GAME_VERSION>2 or HealBot_Globals.NoRanks then
            for j=1, getn(hbHealDDlist), 1 do
                info.text = hbHealDDlist[j];
                info.func = function(self)
                            HealBot_Options_luVars["hbHelpHealSelect"] = self:GetText()
                            HealBot_Options_luVars["HealSpellsComboID"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_SelectHealSpellsCombo,hbHealDDlist[HealBot_Options_luVars["HealSpellsComboID"]]) 
                        end
                info.checked = false;
                if HealBot_Options_luVars["HealSpellsComboID"]==j then info.checked = true end
                UIDropDownMenu_AddButton(info);
            end
        else
            if level == 1 then
                for j=1, getn(hbHealDDlist), 1 do
                    info.text = "    "..hbHealDDlist[j];
                    info.hasArrow = true
                    info.notCheckable = true
                    info.menuList = hbHealDDlist[j], true, hbHealDDlist[j]
                    UIDropDownMenu_AddButton(info)
                end
            else
                local cHealDDlist=HealBot_Options_SelectClassicHealSpellsRanksCombo_DDlist(menuList)
                if getn(cHealDDlist)>0 then
                    for j=1, getn(cHealDDlist), 1 do
                        info.text = cHealDDlist[j];
                        info.func = function(self)
                                    HealBot_Options_luVars["hbHelpHealSelect"] = self:GetText()
                                    HealBot_Options_luVars["HealSpellsComboID"] = self:GetID()
                                    UIDropDownMenu_SetText(HealBot_Options_SelectHealSpellsCombo,cHealDDlist[HealBot_Options_luVars["HealSpellsComboID"]]) 
                                end
                        info.checked = false;
                        --if HealBot_Options_luVars["HealSpellsComboID"]==j then info.checked = true end
                        UIDropDownMenu_AddButton(info, level);
                    end
                else
                    info.text = HEALBOT_TOOLTIP_NONE
                    info.func = function(self)
                                    HealBot_Options_luVars["hbHelpHealSelect"] = nil
                                    HealBot_Options_luVars["HealSpellsComboID"] = self:GetID()
                                    UIDropDownMenu_SetText(HealBot_Options_SelectHealSpellsCombo,HEALBOT_TOOLTIP_NONE) 
                                end
                    UIDropDownMenu_AddButton(info, level);
                end
            end
        end
    else
        info.text = HEALBOT_TOOLTIP_NONE
        info.func = function(self)
                        HealBot_Options_luVars["hbHelpHealSelect"] = nil
                        HealBot_Options_luVars["HealSpellsComboID"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_SelectHealSpellsCombo,HEALBOT_TOOLTIP_NONE) 
                    end
        info.checked = true;
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

HealBot_Options_luVars["OtherSpellsComboID"] = 0
HealBot_Options_luVars["SkinsOtherSpellsComboID"] = 0

function HealBot_Options_SelectOtherSpellsCombo_DDlist()
    local HealBot_Options_SelectOtherSpellsCombo_List = {}
    local tmpOtherDDlist={}
    for x,_ in pairs(HealBot_Options_NoDuplcates) do
        HealBot_Options_NoDuplcates[x]=nil
    end 
    if HealBot_Options_luVars["ActionBarsCombo"]==2 then
        HealBot_Options_SelectOtherSpellsCombo_List = {
            HEALBOT_HEX,
            HEALBOT_ENTANGLING_ROOTS,
            HEALBOT_GROWL,
            HEALBOT_SOOTHE,
            HEALBOT_MASS_ENTANGLEMENT,
            HEALBOT_PURGE,
            HEALBOT_WIND_SHEAR,
            HEALBOT_CYCLONE,
            HEALBOT_DOMINATE_MIND,
            HEALBOT_SHACKLE_UNDEAD,
            HEALBOT_DISPELL_MAGIC,
            HEALBOT_PROVOKE,
            HEALBOT_DISABLE,
            HEALBOT_EXPEL_HARM,
            HEALBOT_SPEAR_HAND_STRIKE,
            HEALBOT_PARALYSIS,
            HEALBOT_HAMMER_OF_JUSTICE,
            HEALBOT_REBUKE,
            HEALBOT_RECKONING,
            HEALBOT_REPENTANCE,
            HEALBOT_TURN_EVIL,
        }
        for j=1, getn(HealBot_Options_SelectOtherSpellsCombo_List), 1 do
            local spellName=HealBot_KnownSpell(HealBot_Options_SelectOtherSpellsCombo_List[j])
            if spellName and not HealBot_Options_NoDuplcates[spellName] then
                HealBot_Options_NoDuplcates[spellName]=true
                table.insert(tmpOtherDDlist,spellName)
            end
        end
    elseif HealBot_Options_luVars["ActionBarsCombo"]<4 then
       HealBot_Options_SelectOtherSpellsCombo_List = {
            HEALBOT_STONEFORM,
            HEALBOT_DARKFLIGHT,
            HEALBOT_GIFT_OF_THE_NAARU,
            HEALBOT_POWER_WORD_SHIELD,
            HEALBOT_SPIRIT_SHELL,
            HEALBOT_REVIVE,
            HEALBOT_INTERCESSION,
            HEALBOT_GUARDIAN_SPIRIT,
            HEALBOT_SHINING_FORCE,
            HEALBOT_PAIN_SUPPRESSION,
            HEALBOT_INTERVENE,
            HEALBOT_RESURRECTION,
            HEALBOT_REDEMPTION,
            HEALBOT_REBIRTH,
            HEALBOT_TREE_OF_LIFE,
            HEALBOT_INNERVATE,
            HEALBOT_ANCESTRALSPIRIT,
            HEALBOT_RESUSCITATE,
            HEALBOT_ABSOLUTION,
            HEALBOT_ANCESTRAL_VISION,
            HEALBOT_MASS_RESURRECTION,
            HEALBOT_MASS_RETURN,
            HEALBOT_RETURN,
            HEALBOT_REAWAKEN,
            HEALBOT_REVITALIZE,
            HEALBOT_CLEANSE,
            HEALBOT_REMOVE_CURSE,
            HEALBOT_CLEANSE_TOXIN,
            HEALBOT_REMOVE_CORRUPTION,
            HEALBOT_NATURALIZE,
            HEALBOT_CAUTERIZING_FLAME,
            HEALBOT_EXPUNGE,
            HEALBOT_NATURES_CURE,
            HEALBOT_PURIFY_DISEASE,
            HEALBOT_PURIFY,
            HBC_PURIFY,
            HBC_SHAMAN_CURE_DISEASE,
            HBC_DRUID_ABOLISH_POISON,
            HBC_PRIEST_ABOLISH_DISEASE,
            --HBC_DRUID_CURE_POISON,
            HBC_SHAMAN_CURE_POISON,
            HEALBOT_BLOODLUST,
            HEALBOT_HEROISM,
            --HBC_DISPELL_MAGIC,
            HEALBOT_CLEANSE_SPIRIT,
            HEALBOT_PURIFY_SPIRIT,
            HEALBOT_MASS_DISPEL,
            HEALBOT_LIFE_TAP,
            HEALBOT_DIVINE_SHIELD,
            HEALBOT_DIVINE_PROTECTION,
            HBC_DIVINE_INTERVENTION,
            HBC_DIVINE_FAVOR,
            HBC_DIVINE_FAVOR,
            HEALBOT_ANACESTRAL_SWIFTNESS,
            HEALBOT_LEAP_OF_FAITH,
            HEALBOT_UNLEASH_ELEMENTS,
            HEALBOT_DETOX,
            HEALBOT_SPEED_OF_LIGHT,
            HEALBOT_HAND_OF_PURITY,
            HEALBOT_THUNDER_FOCUS_TEA,
            HEALBOT_ASTRAL_SHIFT,
            HEALBOT_GUARDIAN_ANCIENT_KINGS,
            HEALBOT_UNLEASH_LIFE,
            HEALBOT_CLOUDBURST_TOTEM,
            HEALBOT_POWER_INFUSION,
            HEALBOT_VAMPIRIC_EMBRACE,
            HEALBOT_CLARITY_OF_WILL,
            HEALBOT_DETONATE_CHI,
            HEALBOT_BEACON_OF_FAITH,
            HEALBOT_BEACON_OF_INSIGHT,
            HEALBOT_RAPTURE,
            HEALBOT_APOTHEOSIS,
            HEALBOT_SYMBOL_OF_HOPE,
            HEALBOT_BODY_AND_MIND,
            HEALBOT_BLESSING_OF_SACRIFICE, --Paladin
            HEALBOT_HOLY_WARD,
            HEALBOT_RESCUE,
            HEALBOT_ZEPHYR,
            HEALBOT_OBSIDIAN_SCALES,
            HEALBOT_TIME_DILATION,
            HEALBOT_TIME_STOP,
            HEALBOT_STASIS,
            HEALBOT_FURY_OF_THE_ASPECTS,
            HEALBOT_VISAGE,
            HEALBOT_TEMPRAL_ANOMALY,
            HEALBOT_NULLIFYING_SHROUD,
        }
        if HEALBOT_GAME_VERSION<4 then 
            table.insert(HealBot_Options_SelectOtherSpellsCombo_List, HBC_PRIEST_CURE_DISEASE)
            table.insert(HealBot_Options_SelectOtherSpellsCombo_List, HBC_RIGHTEOUS_DEFENSE)
            table.insert(HealBot_Options_SelectOtherSpellsCombo_List, HBC_SEAL_OF_COMMAND)
        end
        for j=1, getn(HealBot_Options_SelectOtherSpellsCombo_List), 1 do
            local spellName=HealBot_KnownSpell(HealBot_Options_SelectOtherSpellsCombo_List[j])
            if spellName and not HealBot_Options_NoDuplcates[spellName] then
                HealBot_Options_NoDuplcates[spellName]=true
                table.insert(tmpOtherDDlist,spellName)
            end
        end
        for j=1, getn(HealBot_Buff_Spells_List), 1 do
            if not HealBot_Options_NoDuplcates[HealBot_Buff_Spells_List[j]] then
                table.insert(tmpOtherDDlist,HealBot_Buff_Spells_List[j])
                HealBot_Options_NoDuplcates[HealBot_Buff_Spells_List[j]]=true
            end
        end
    end
    table.sort(tmpOtherDDlist)
    return tmpOtherDDlist
end

function HealBot_Options_SelectOtherSpellsCombo_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local hbOtherDDlist=HealBot_Options_SelectOtherSpellsCombo_DDlist()
    if getn(hbOtherDDlist)>0 then
        for j=1, getn(hbOtherDDlist), 1 do
            info.text = hbOtherDDlist[j];
            info.func = function(self)
                        HealBot_Options_luVars["hbHelpOtherSelect"] = self:GetText()
                        HealBot_Options_luVars["OtherSpellsComboID"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_SelectOtherSpellsCombo,hbOtherDDlist[HealBot_Options_luVars["OtherSpellsComboID"]]) 
                    end
            info.checked = false;
            if HealBot_Options_luVars["OtherSpellsComboID"]==j then info.checked = true end
            UIDropDownMenu_AddButton(info);
        end
    else
        info.text = HEALBOT_TOOLTIP_NONE
        info.func = function(self)
                        HealBot_Options_luVars["hbHelpOtherSelect"] = nil
                        HealBot_Options_luVars["OtherSpellsComboID"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_SelectOtherSpellsCombo,HEALBOT_TOOLTIP_NONE) 
                    end
        info.checked = true;
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

HealBot_Options_luVars["MacrosComboID"] = 0
HealBot_Options_luVars["SkinsMacrosComboID"] = 0
function HealBot_Options_UpdateMacrosList()
    local numglobal,numperchar = GetNumMacros();
    local totalMacros=numglobal+numperchar
    local hbMacroName=nil
    local macroList={}
    for x,_ in pairs(HealBot_Options_NoDuplcates) do
        HealBot_Options_NoDuplcates[x]=nil
    end 
    for j=1, numglobal, 1 do
        hbMacroName=GetMacroInfo(j)
        if hbMacroName and not HealBot_Options_NoDuplcates[hbMacroName] then
            HealBot_Options_NoDuplcates[hbMacroName]=true
            table.insert(macroList,hbMacroName)
        end
    end
    for j=MAX_ACCOUNT_MACROS+1, numperchar+MAX_ACCOUNT_MACROS, 1 do
        hbMacroName=GetMacroInfo(j)
        if hbMacroName and not HealBot_Options_NoDuplcates[hbMacroName] then
            HealBot_Options_NoDuplcates[hbMacroName]=true
            table.insert(macroList,hbMacroName)
        end
    end
    table.sort(macroList)
    return macroList
end

function HealBot_Options_SelectMacrosCombo_DropDown(self, level, menuList)
    local info = UIDropDownMenu_CreateInfo()
    local macroList=HealBot_Options_UpdateMacrosList()
    if getn(macroList)>10 then
        if level == 1 then
            for j=1, ceil(getn(macroList)/10), 1 do
                local n=j*10
                if n > getn(macroList) then n=getn(macroList) end
                info.text = "    "..((j*10)-9).." - "..n;
                info.hasArrow = true
                info.notCheckable = true
                info.menuList = j, true, j
                UIDropDownMenu_AddButton(info)
            end
        else
            local n=menuList*10
            if n > getn(macroList) then n=getn(macroList) end
            for j=((menuList*10)-9), n, 1 do
                local mText=macroList[j]
                info.text = mText
                info.func = function(self)
                                HealBot_Options_luVars["hbHelpMacroSelect"] = self:GetText()
                                HealBot_Options_luVars["MacrosComboID"] = self:GetID()
                                UIDropDownMenu_SetText(HealBot_Options_SelectMacrosCombo,mText) 
                            end
                info.checked = false;
                if HealBot_Options_luVars["MacrosComboID"]==j then info.checked = true end
                UIDropDownMenu_AddButton(info, level)
            end
        end
    elseif getn(macroList)>0 then
        for j=1, getn(macroList), 1 do
            local mText=macroList[j]
            info.text = mText
            info.func = function(self)
                            HealBot_Options_luVars["hbHelpMacroSelect"] = self:GetText()
                            HealBot_Options_luVars["MacrosComboID"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_SelectMacrosCombo,mText) 
                        end
            info.checked = false;
            if HealBot_Options_luVars["MacrosComboID"]==j then info.checked = true end
            UIDropDownMenu_AddButton(info)
        end
    else
        info.text = HEALBOT_TOOLTIP_NONE
        info.func = function(self)
                        HealBot_Options_luVars["MacrosComboID"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_SelectMacrosCombo,HEALBOT_TOOLTIP_NONE) 
                    end
        info.checked = true;
        UIDropDownMenu_AddButton(info);
        HealBot_Options_luVars["hbHelpMacroSelect"]=nil
    end
end

function HealBot_Options_SkinsSelectMacrosCombo_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local numglobal,numperchar = GetNumMacros();
    local totalMacros=numglobal+numperchar
    local hbMacroName=nil
    for x,_ in pairs(HealBot_Options_NoDuplcates) do
        HealBot_Options_NoDuplcates[x]=nil
    end 
    if totalMacros>0 then
        for j=1, numglobal, 1 do
            hbMacroName=GetMacroInfo(j)
            if hbMacroName and not HealBot_Options_NoDuplcates[hbMacroName] then
                HealBot_Options_NoDuplcates[hbMacroName]=true
                local mgName = hbMacroName
                info.text = mgName
                info.func = function(self)
                                HealBot_Options_luVars["hbSkinsHelpMacroSelect"] = self:GetText()
                                HealBot_Options_luVars["SkinsMacrosComboID"] = self:GetID()
                                UIDropDownMenu_SetText(HealBot_Options_SkinsSelectMacrosCombo,mgName) 
                            end
                info.checked = false;
                if HealBot_Options_luVars["SkinsMacrosComboID"]==j then info.checked = true end
                UIDropDownMenu_AddButton(info);
            end
        end
        for j=MAX_ACCOUNT_MACROS+1, numperchar+MAX_ACCOUNT_MACROS, 1 do
            hbMacroName=GetMacroInfo(j)
            if hbMacroName and not HealBot_Options_NoDuplcates[hbMacroName] then
                HealBot_Options_NoDuplcates[hbMacroName]=true
                local mpName = hbMacroName
                info.text = mpName
                info.func = function(self)
                                HealBot_Options_luVars["hbSkinsHelpMacroSelect"] = self:GetText()
                                HealBot_Options_luVars["SkinsMacrosComboID"] = self:GetID()
                                UIDropDownMenu_SetText(HealBot_Options_SkinsSelectMacrosCombo,mpName) 
                            end
                info.checked = false;
                if HealBot_Options_luVars["SkinsMacrosComboID"]==j then info.checked = true end
                UIDropDownMenu_AddButton(info);
            end
        end
    else
        info.text = HEALBOT_TOOLTIP_NONE
        info.func = function(self)
                        HealBot_Options_luVars["SkinsMacrosComboID"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_SkinsSelectMacrosCombo,HEALBOT_TOOLTIP_NONE) 
                    end
        info.checked = true;
        UIDropDownMenu_AddButton(info);
        HealBot_Options_luVars["hbSkinsHelpMacroSelect"]=nil
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_itemsByLevel()
    local hbLevel = UnitLevel("player")
    local hbItemsByLevel={}
    for x,_ in pairs(HealBot_Options_NoDuplcates) do
        HealBot_Options_NoDuplcates[x]=nil
    end 
    local hbTmpText1=nil
    if HEALBOT_GAME_VERSION>3 then
        hbTmpText1 = GetItemInfo(19009) or "Healthstone"
        if not HealBot_Options_NoDuplcates[hbTmpText1] then
            table.insert(hbItemsByLevel,hbTmpText1)
            HealBot_Options_NoDuplcates[hbTmpText1]=true
        end
    else
        if hbLevel <= 20 then
            hbTmpText1 = GetItemInfo(19004) or "Minor Healthstone"
            table.insert(hbItemsByLevel,hbTmpText1)
            HealBot_Options_NoDuplcates[hbTmpText1]=true
        elseif hbLevel <= 30 then
            hbTmpText1 = GetItemInfo(19007) or "Lesser Healthstone"
            if not HealBot_Options_NoDuplcates[hbTmpText1] then
                table.insert(hbItemsByLevel,hbTmpText1)
                HealBot_Options_NoDuplcates[hbTmpText1]=true
            end
        elseif hbLevel <= 40 then
            hbTmpText1 = GetItemInfo(19009) or "Healthstone"
            if not HealBot_Options_NoDuplcates[hbTmpText1] then
                table.insert(hbItemsByLevel,hbTmpText1)
                HealBot_Options_NoDuplcates[hbTmpText1]=true
            end
        elseif hbLevel <= 50 then
            hbTmpText1 = GetItemInfo(19011) or "Greater Healthstone"
            if not HealBot_Options_NoDuplcates[hbTmpText1] then
                table.insert(hbItemsByLevel,hbTmpText1)
                HealBot_Options_NoDuplcates[hbTmpText1]=true
            end
        elseif hbLevel <= 60 then
            hbTmpText1 = GetItemInfo(9421) or "Major Healthstone"
            if not HealBot_Options_NoDuplcates[hbTmpText1] then
                table.insert(hbItemsByLevel,hbTmpText1)
                HealBot_Options_NoDuplcates[hbTmpText1]=true
            end
        elseif hbLevel <= 70 then
            hbTmpText1 = GetItemInfo(19008) or "Master Healthstone"
            if not HealBot_Options_NoDuplcates[hbTmpText1] then
                table.insert(hbItemsByLevel,hbTmpText1)
                HealBot_Options_NoDuplcates[hbTmpText1]=true
            end
        else
            hbTmpText1 = GetItemInfo(36892) or "Fel Healthstone"
            if not HealBot_Options_NoDuplcates[hbTmpText1] then
                table.insert(hbItemsByLevel,hbTmpText1)
                HealBot_Options_NoDuplcates[hbTmpText1]=true
            end
        end
    end
    return hbItemsByLevel
end
    
HealBot_Options_luVars["ItemsComboID"]=0
HealBot_Options_luVars["SkinsItemsComboID"]=0
local hbItemsIfExists={}
function HealBot_Options_ItemsInBag(cType)
    local HealBot_Options_SelectItemsCombo_List={}
    if cType==2 then
        HealBot_Options_SelectItemsCombo_List={
            HEALBOT_WORDS_NONE,
        }
    else
        hbItemsIfExists = {
            [1] = HEALBOT_SILK_BANDAGE,
            [2] = HEALBOT_HEAVY_SILK_BANDAGE,
            [3] = HEALBOT_MAGEWEAVE_BANDAGE,
            [4] = HEALBOT_HEAVY_MAGEWEAVE_BANDAGE,
            [5] = HEALBOT_RUNECLOTH_BANDAGE,
            [6] = HEALBOT_HEAVY_RUNECLOTH_BANDAGE,
            [7] = HEALBOT_NETHERWEAVE_BANDAGE,
            [8] = HEALBOT_HEAVY_NETHERWEAVE_BANDAGE,
            [9] = HEALBOT_FROSTWEAVE_BANDAGE,
            [10] = HEALBOT_HEAVY_FROSTWEAVE_BANDAGE,
            [11] = HEALBOT_EMBERSILK_BANDAGE,
            [12] = HEALBOT_DENSE_EMBERSILK_BANDAGE,
            [13] = HEALBOT_MAJOR_HEALING_POTION,
            [14] = HEALBOT_SUPER_HEALING_POTION,
            [15] = HEALBOT_MAJOR_COMBAT_HEALING_POTION,
            [16] = HEALBOT_RUNIC_HEALING_POTION,
            [17] = HEALBOT_ENDLESS_HEALING_POTION,    
            [18] = HEALBOT_MAJOR_MANA_POTION,
            [19] = HEALBOT_SUPER_MANA_POTION,
            [20] = HEALBOT_MAJOR_COMBAT_MANA_POTION,
            [21] = HEALBOT_RUNIC_MANA_POTION,
            [22] = HEALBOT_ENDLESS_MANA_POTION,
            [23] = HEALBOT_PURIFICATION_POTION,
            [24] = HEALBOT_ANTI_VENOM,
            [25] = HEALBOT_POWERFUL_ANTI_VENOM,
            [26] = HEALBOT_ELIXIR_OF_POISON_RES,
            [27] = HEALBOT_HEAVY_WOOL_BANDAGE,
            [28] = HEALBOT_WOOL_BANDAGE,
            [29] = HEALBOT_HEAVY_LINEN_BANDAGE,
            [30] = HEALBOT_LINEN_BANDAGE,
            [31] = HEALBOT_HEAVY_EMBERSILK_BANDAGE,
            [32] = HEALBOT_WINDWOOL_BANDAGE,
            [33] = HEALBOT_HEAVY_WINDWOOL_BANDAGE,
            [34] = HEALBOT_ASHRAN_BANDAGE,
            [35] = HEALBOT_SILKWEAVE_BANDAGE,
            [36] = HEALBOT_DEEP_SEA_BANDAGE,
            [37] = HEALBOT_TIDESPRAY_LINEN_BANDAGE,
            [38] = HEALBOT_SOULFUL_HEALING_POTION,
            [39] = HEALBOT_SPIRITUAL_HEALING_POTION,
            [40] = HEALBOT_SOULFUL_MANA_POTION,
            [41] = HEALBOT_SPIRITUAL_MANA_POTION,
            [42] = HEALBOT_POTION_OF_SOUL_PURITY,
            [43] = HEALBOT_PHIAL_OF_SERENITY,
            [44] = HEALBOT_SHROUDED_CLOTH_BANDAGE,
            [45] = HEALBOT_HEAVY_SHROUDED_CLOTH_BANDAGE,
        }
        HealBot_Options_SelectItemsCombo_List=HealBot_Options_itemsByLevel()
        local tID=nil
        local tName=nil
        for j=1, getn(hbItemsIfExists), 1 do
            tName=GetItemInfo(hbItemsIfExists[j]) 
            if tName and not HealBot_Options_NoDuplcates[tName] and HealBot_IsKnownItem(tName) then
                table.insert(HealBot_Options_SelectItemsCombo_List, tName)
                HealBot_Options_NoDuplcates[tName]=true
            end
        end
        for j=1,19 do 
            tID=GetInventoryItemID("player", j);
            if tID then 
                tName=GetItemInfo(tID) 
            else
                tName=nil
            end
            if tName and GetItemSpell(tName) and not HealBot_Options_NoDuplcates[tName] then
                table.insert(HealBot_Options_SelectItemsCombo_List, tName)
                HealBot_Options_NoDuplcates[tName]=true
            end
        end
    end
    return HealBot_Options_SelectItemsCombo_List
end

function HealBot_Options_SelectItemsCombo_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local items=HealBot_Options_ItemsInBag(HealBot_Options_luVars["ActionBarsCombo"])
    table.sort(items)
    for j=1, getn(items), 1 do
        local iName = items[j];
        info.text = iName
        info.func = function(self)
                        HealBot_Options_luVars["hbHelpItemSelect"] = self:GetText()
                        HealBot_Options_luVars["ItemsComboID"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_SelectItemsCombo,iName) 
                    end
        info.checked = false;
        if HealBot_Options_luVars["ItemsComboID"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

HealBot_Options_luVars["CmdsComboID"]=0
HealBot_Options_luVars["SkinsCmdsComboID"]=0
function HealBot_Options_SelectCmds_List(cType)
    local HealBot_Options_SelectCmdsCombo_List={}
    if cType==2 then
        HealBot_Options_SelectCmdsCombo_List = {
                HEALBOT_DISABLED_TARGET,
                HEALBOT_FOCUS,
            }
    elseif cType==4 then
        HealBot_Options_SelectCmdsCombo_List = {
                HEALBOT_IGNOREAURAALL,
                HEALBOT_ICONRAISEPRIO1,
                HEALBOT_ICONRAISEPRIO3,
                HEALBOT_ICONLOWERPRIO1,
                HEALBOT_ICONLOWERPRIO3,
                HEALBOT_ICONBARCOLOURON,
                HEALBOT_ICONBARCOLOURCYCLE,
                HEALBOT_ICONBARCOLOUROFF,
                HEALBOT_ICONNEXTSET,
                HEALBOT_ICONPREVSET,
                HEALBOT_ICONGLOWON,
                HEALBOT_ICONGLOWCYCLE,
                HEALBOT_ICONGLOWOFF,
                HEALBOT_ICONRAISESCALE,
                HEALBOT_ICONRAISESCALE,
            }
    elseif HEALBOT_GAME_VERSION>3 then
        HealBot_Options_SelectCmdsCombo_List = {
                HEALBOT_DISABLED_TARGET,
                HEALBOT_ASSIST,
                HEALBOT_FOCUS,
                HEALBOT_MENU,
                HEALBOT_HBMENU,
                HEALBOT_STOP,
                HEALBOT_MOUNTSPETS,
                HEALBOT_FAVMOUNT,
                HEALBOT_RANDOMMOUNT,
                HEALBOT_RANDOMGOUNDMOUNT,
                HEALBOT_FAVPET,
                HEALBOT_CANCELPLUGINALERT,
                HEALBOT_TARGETVEHICLE,
            }
    elseif HEALBOT_GAME_VERSION>2 then
        HealBot_Options_SelectCmdsCombo_List = {
                HEALBOT_DISABLED_TARGET,
                HEALBOT_ASSIST,
                HEALBOT_FOCUS,
                HEALBOT_MENU,
                HEALBOT_HBMENU,
                HEALBOT_STOP,
                HEALBOT_MOUNTS,
                HEALBOT_FAVMOUNT,
                HEALBOT_RANDOMMOUNT,
                HEALBOT_RANDOMGOUNDMOUNT,
                HEALBOT_CANCELPLUGINALERT,
                HEALBOT_TARGETVEHICLE,
            }
    else
        HealBot_Options_SelectCmdsCombo_List = {
                HEALBOT_DISABLED_TARGET,
                HEALBOT_ASSIST,
                HEALBOT_FOCUS,
                HEALBOT_MENU,
                HEALBOT_HBMENU,
                HEALBOT_STOP,
                HEALBOT_CANCELPLUGINALERT,
            }
    end
    return HealBot_Options_SelectCmdsCombo_List
end

function HealBot_Options_SelectCmdsCombo_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local cmdList=HealBot_Options_SelectCmds_List(HealBot_Options_luVars["ActionBarsCombo"])
    for j=1, getn(cmdList), 1 do
        info.text = cmdList[j];
        info.func = function(self)
                        HealBot_Options_luVars["hbHelpCmdsSelect"] = self:GetText()
                        HealBot_Options_luVars["CmdsComboID"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_SelectCmdsCombo,cmdList[HealBot_Options_luVars["CmdsComboID"]]) 
                    end
        info.checked = false;
        if HealBot_Options_luVars["CmdsComboID"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_RetEmote_List(lType)
    if lType=="CAT" then
        return HealBot_Options_EmoteCat_List
    elseif lType=="COMBAT" then
        return HealBot_Options_EmoteCombat_List
    elseif lType=="EMOTION" then
        return HealBot_Options_EmoteEmotion_List
    elseif lType=="HAPPY" then
        return HealBot_Options_EmoteHappy_List
    elseif lType=="GREET" then
        return HealBot_Options_EmoteGreet_List
    elseif lType=="OTHER" then
        return HealBot_Options_EmoteOther_List
    elseif lType=="RESPECT" then
        return HealBot_Options_EmoteRespect_List
    elseif lType=="UNHAPPY" then
        return HealBot_Options_EmoteUnhappy_List
    end
end

function HealBot_Options_SelectEmotesCombo_DropDown(self, level, menuList)
    local info = UIDropDownMenu_CreateInfo()
    if level == 1 then
        for j=1, getn(HealBot_Options_EmoteCat_List), 1 do
            info.text = "    "..HealBot_Options_EmoteCat_List[j];
            info.hasArrow = true
            info.notCheckable = true
            info.menuList = HealBot_Options_EmoteCat_List[j], true, HealBot_Options_EmoteCat_List[j]
            UIDropDownMenu_AddButton(info)
        end
    elseif menuList == HEALBOT_EMOTE_CAT_COMBAT then
        for j=1, getn(HealBot_Options_EmoteCombat_List), 1 do
            info.text = HealBot_Options_EmoteCombat_List[j];
            info.func = function(self)
                        HealBot_Options_luVars["hbHelpEmotesSelect"] = HEALBOT_EMOTE.."="..self:GetText()
                        UIDropDownMenu_SetText(HealBot_Options_SelectEmotesCombo, self:GetText())
                    end
            info.checked = false;
            UIDropDownMenu_AddButton(info, level);
        end
    elseif menuList == HEALBOT_EMOTE_CAT_EMOTION then
        for j=1, getn(HealBot_Options_EmoteEmotion_List), 1 do
            info.text = HealBot_Options_EmoteEmotion_List[j];
            info.func = function(self)
                        HealBot_Options_luVars["hbHelpEmotesSelect"] = HEALBOT_EMOTE.."="..self:GetText()
                        UIDropDownMenu_SetText(HealBot_Options_SelectEmotesCombo, self:GetText())
                    end
            info.checked = false;
            UIDropDownMenu_AddButton(info, level);
        end
    elseif menuList == HEALBOT_EMOTE_CAT_HAPPY then
        for j=1, getn(HealBot_Options_EmoteHappy_List), 1 do
            info.text = HealBot_Options_EmoteHappy_List[j];
            info.func = function(self)
                        HealBot_Options_luVars["hbHelpEmotesSelect"] = HEALBOT_EMOTE.."="..self:GetText()
                        UIDropDownMenu_SetText(HealBot_Options_SelectEmotesCombo, self:GetText())
                    end
            info.checked = false;
            UIDropDownMenu_AddButton(info, level);
        end
    elseif menuList == HEALBOT_EMOTE_CAT_GREET then
        for j=1, getn(HealBot_Options_EmoteGreet_List), 1 do
            info.text = HealBot_Options_EmoteGreet_List[j];
            info.func = function(self)
                        HealBot_Options_luVars["hbHelpEmotesSelect"] = HEALBOT_EMOTE.."="..self:GetText()
                        UIDropDownMenu_SetText(HealBot_Options_SelectEmotesCombo, self:GetText())
                    end
            info.checked = false;
            UIDropDownMenu_AddButton(info, level);
        end
    elseif menuList == HEALBOT_EMOTE_CAT_OTHER then
        for j=1, getn(HealBot_Options_EmoteOther_List), 1 do
            info.text = HealBot_Options_EmoteOther_List[j];
            info.func = function(self)
                        HealBot_Options_luVars["hbHelpEmotesSelect"] = HEALBOT_EMOTE.."="..self:GetText()
                        UIDropDownMenu_SetText(HealBot_Options_SelectEmotesCombo, self:GetText())
                    end
            info.checked = false;
            UIDropDownMenu_AddButton(info, level);
        end
    elseif menuList == HEALBOT_EMOTE_CAT_RESPECT then
        for j=1, getn(HealBot_Options_EmoteRespect_List), 1 do
            info.text = HealBot_Options_EmoteRespect_List[j];
            info.func = function(self)
                        HealBot_Options_luVars["hbHelpEmotesSelect"] = HEALBOT_EMOTE.."="..self:GetText()
                        UIDropDownMenu_SetText(HealBot_Options_SelectEmotesCombo, self:GetText())
                    end
            info.checked = false;
            UIDropDownMenu_AddButton(info, level);
        end
    elseif menuList == HEALBOT_EMOTE_CAT_UNHAPPY then
        for j=1, getn(HealBot_Options_EmoteUnhappy_List), 1 do
            info.text = HealBot_Options_EmoteUnhappy_List[j];
            info.func = function(self)
                        HealBot_Options_luVars["hbHelpEmotesSelect"] = HEALBOT_EMOTE.."="..self:GetText()
                        UIDropDownMenu_SetText(HealBot_Options_SelectEmotesCombo, self:GetText())
                    end
            info.checked = false;
            UIDropDownMenu_AddButton(info, level);
        end
    end
end

local hbIconHelpSelect={[1]=false,[2]=false,[3]=false,[4]=false,[5]=false}
function HealBot_Options_HideSelectIconCmdsCombo(dropdown, editbox, id)
    dropdown:Hide()
    editbox:Show()
    hbIconHelpSelect[id]=false
    HealBot_Options_luVars["hbIconHelpSelectID"]=0
end

function HealBot_Options_SelectIconCmdsCombo_DropDown(dropdown, object, id)
    local info = UIDropDownMenu_CreateInfo()
    local cmdList=HealBot_Options_SelectCmds_List(4)
    for j=1, getn(cmdList), 1 do
        info.text = cmdList[j];
        info.func = function(self)
                        object:SetText(self:GetText())
                        HealBot_Options_HideSelectIconCmdsCombo(dropdown, object, id)
                    end
        info.checked = false;
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_SelectIconCmds1Combo_DropDown()
    HealBot_Options_SelectIconCmdsCombo_DropDown(HealBot_Options_SelectIconCmds1Combo, HealBot_Options_Button1, 1)
end

function HealBot_Options_SelectIconCmds2Combo_DropDown()
    HealBot_Options_SelectIconCmdsCombo_DropDown(HealBot_Options_SelectIconCmds2Combo, HealBot_Options_Button2, 2)
end

function HealBot_Options_SelectIconCmds3Combo_DropDown()
    HealBot_Options_SelectIconCmdsCombo_DropDown(HealBot_Options_SelectIconCmds3Combo, HealBot_Options_Button3, 3)
end

function HealBot_Options_SelectIconCmds4Combo_DropDown()
    HealBot_Options_SelectIconCmdsCombo_DropDown(HealBot_Options_SelectIconCmds4Combo, HealBot_Options_Button4, 4)
end

function HealBot_Options_SelectIconCmds5Combo_DropDown()
    HealBot_Options_SelectIconCmdsCombo_DropDown(HealBot_Options_SelectIconCmds5Combo, HealBot_Options_Button5, 5)
end

--------------------------------------------------------------------------------

function HealBot_Options_SpellsSelect_OnClick(self, sType)
    if sType~="Cancel" then
        local hbTmpText1=nil
        if sType=="Heal" then
            hbTmpText1=HealBot_Options_luVars["hbHelpHealSelect"] or ""
        elseif sType=="Other" then
            hbTmpText1=HealBot_Options_luVars["hbHelpOtherSelect"] or ""
        elseif sType=="Macro" then
            hbTmpText1=HealBot_Options_luVars["hbHelpMacroSelect"] or ""
        elseif sType=="Item" then
            hbTmpText1=HealBot_Options_luVars["hbHelpItemSelect"] or ""
        elseif sType=="Cmd" then
            hbTmpText1=HealBot_Options_luVars["hbHelpCmdsSelect"] or ""
        else
            hbTmpText1=HealBot_Options_luVars["hbHelpEmotesSelect"] or ""
        end
        if hbTmpText1~=HEALBOT_TOOLTIP_NONE then
            if HealBot_Options_luVars["HealBot_Options_sLoc"]==1 then
                HealBot_Options_Button1:SetText(hbTmpText1)
            elseif HealBot_Options_luVars["HealBot_Options_sLoc"]==2 then
                HealBot_Options_Button2:SetText(hbTmpText1)
            elseif HealBot_Options_luVars["HealBot_Options_sLoc"]==3 then
                HealBot_Options_Button3:SetText(hbTmpText1)
            elseif HealBot_Options_luVars["HealBot_Options_sLoc"]==4 then
                HealBot_Options_Button4:SetText(hbTmpText1)
            elseif HealBot_Options_luVars["HealBot_Options_sLoc"]==5 then
                HealBot_Options_Button5:SetText(hbTmpText1)
            end
        end
    end
    HealBot_Options_SelectSpellsFrame:Hide()
    HealBot_Options_luVars["SelectSpellsFrame"]=false
    HealBot_Options_KeysFrame:Show()
end

function HealBot_Options_ShowSelectIconCmdsCombo(dropdown, editbox, id)
    editbox:Hide()
    dropdown:Show()
    hbIconHelpSelect[id]=true
    HealBot_Options_luVars["hbIconHelpSelectID"]=id
end

local hbOptionText={[1]="",[2]="",[3]=""}
function HealBot_Options_HelpSpellsSelect_HideIconDropdown(sLoc)
    if sLoc==1 then
        HealBot_Options_HideSelectIconCmdsCombo(HealBot_Options_SelectIconCmds1Combo, HealBot_Options_Button1, 1)
    elseif sLoc==2 then
        HealBot_Options_HideSelectIconCmdsCombo(HealBot_Options_SelectIconCmds2Combo, HealBot_Options_Button2, 2)
    elseif sLoc==3 then
        HealBot_Options_HideSelectIconCmdsCombo(HealBot_Options_SelectIconCmds3Combo, HealBot_Options_Button3, 3)
    elseif sLoc==4 then
        HealBot_Options_HideSelectIconCmdsCombo(HealBot_Options_SelectIconCmds4Combo, HealBot_Options_Button4, 4)
    else
        HealBot_Options_HideSelectIconCmdsCombo(HealBot_Options_SelectIconCmds5Combo, HealBot_Options_Button5, 5)
    end
end

function HealBot_Options_HelpSpellsSelect_OnClick(self, sLoc)
    if HealBot_Options_luVars["ActionBarsCombo"]==4 then
        if hbIconHelpSelect[sLoc] then
            HealBot_Options_HelpSpellsSelect_HideIconDropdown(sLoc)
        else
            if sLoc==1 then
                HealBot_Options_ShowSelectIconCmdsCombo(HealBot_Options_SelectIconCmds1Combo, HealBot_Options_Button1, 1)
            elseif sLoc==2 then
                HealBot_Options_ShowSelectIconCmdsCombo(HealBot_Options_SelectIconCmds2Combo, HealBot_Options_Button2, 2)
            elseif sLoc==3 then
                HealBot_Options_ShowSelectIconCmdsCombo(HealBot_Options_SelectIconCmds3Combo, HealBot_Options_Button3, 3)
            elseif sLoc==4 then
                HealBot_Options_ShowSelectIconCmdsCombo(HealBot_Options_SelectIconCmds4Combo, HealBot_Options_Button4, 4)
            else
                HealBot_Options_ShowSelectIconCmdsCombo(HealBot_Options_SelectIconCmds5Combo, HealBot_Options_Button5, 5)
            end
        end
    else
        if hbIconHelpSelect[sLoc] then HealBot_Options_HelpSpellsSelect_HideIconDropdown(sLoc) end
        HealBot_Options_luVars["HealBot_Options_sLoc"]=sLoc
        if HealBot_Options_luVars["ActionBarsCombo"]==1 then
            hbOptionText[1]=HEALBOT_OPTIONS_SETSPELLS..": "..HEALBOT_OPTIONS_ENABLEDBARS
        elseif HealBot_Options_luVars["ActionBarsCombo"]==2 then
            hbOptionText[1]=HEALBOT_OPTIONS_SETSPELLS..": "..HEALBOT_OPTIONS_ENEMYBARS
        else
            hbOptionText[1]=HEALBOT_OPTIONS_SETSPELLS..": "..HEALBOT_OPTIONS_EMERGBARS
        end
        HealBot_Options_SetLabel("HealBot_Options_SelectSpellsFrame_TextH1",hbOptionText[1])
        local hbTmpText1=HealBot_Options_ComboButton_ModifierKey(HealBot_Options_ComboButtons_Modifier)
        if sLoc==1 then
            hbOptionText[2]=HEALBOT_OPTIONS_COMBOCLASS..":  "..hbTmpText1.." "..HEALBOT_OPTIONS_BUTTONLEFT.." "..HEALBOT_OPTIONS_CLICK
        elseif sLoc==2 then
            hbOptionText[2]=HEALBOT_OPTIONS_COMBOCLASS..":  "..hbTmpText1.." "..HEALBOT_OPTIONS_BUTTONMIDDLE.." "..HEALBOT_OPTIONS_CLICK
        elseif sLoc==3 then
            hbOptionText[2]=HEALBOT_OPTIONS_COMBOCLASS..":  "..hbTmpText1.." "..HEALBOT_OPTIONS_BUTTONRIGHT.." "..HEALBOT_OPTIONS_CLICK
        elseif sLoc==4 then
            hbOptionText[2]=HEALBOT_OPTIONS_COMBOCLASS..":  "..hbTmpText1.." "..HEALBOT_OPTIONS_BUTTON4.." "..HEALBOT_OPTIONS_CLICK
        else
            hbOptionText[2]=HEALBOT_OPTIONS_COMBOCLASS..":  "..hbTmpText1.." "..HEALBOT_OPTIONS_BUTTON5.." "..HEALBOT_OPTIONS_CLICK
        end
        HealBot_Options_SetLabel("HealBot_Options_SelectSpellsFrame_TextH2",hbOptionText[2])
        HealBot_Options_KeysFrame:Hide()
        HealBot_Options_SelectSpellsFrame:Show()
        HealBot_Options_luVars["SelectSpellsFrame"]=true
    end
end

function HealBot_Options_BuffExtraItems1_HelpItemSelect_OnClick()
    if HealBot_Options_BuffExtraItems1:IsVisible() then
        HealBot_Options_BuffExtraItems1:Hide()
        HealBot_Options_BuffExtraItem1:Show()
    else
        HealBot_Options_BuffExtraItem1:Hide()
        HealBot_Options_BuffExtraItems1:Show()
    end
end

function HealBot_Options_BuffExtraItems2_HelpItemSelect_OnClick()
    if HealBot_Options_BuffExtraItems2:IsVisible() then
        HealBot_Options_BuffExtraItems2:Hide()
        HealBot_Options_BuffExtraItem2:Show()
    else
        HealBot_Options_BuffExtraItem2:Hide()
        HealBot_Options_BuffExtraItems2:Show()
    end
end

function HealBot_Options_BuffExtraItems3_HelpItemSelect_OnClick()
    if HealBot_Options_BuffExtraItems3:IsVisible() then
        HealBot_Options_BuffExtraItems3:Hide()
        HealBot_Options_BuffExtraItem3:Show()
    else
        HealBot_Options_BuffExtraItem3:Hide()
        HealBot_Options_BuffExtraItems3:Show()
    end
end

function HealBot_Options_BuffManaDrinkItem_HelpItemSelect_OnClick()
    if HealBot_Options_BuffManaDrinkItems:IsVisible() then
        HealBot_Options_BuffManaDrinkItems:Hide()
        HealBot_Options_BuffManaDrinkItem:Show()
    else
        HealBot_Options_BuffManaDrinkItem:Hide()
        HealBot_Options_BuffManaDrinkItems:Show()
    end
end

function HealBot_Options_BuffBackupManaDrinkItem_HelpItemSelect_OnClick()
    if HealBot_Options_BuffBackupManaDrinkItems:IsVisible() then
        HealBot_Options_BuffBackupManaDrinkItems:Hide()
        HealBot_Options_BuffBackupManaDrinkItem:Show()
    else
        HealBot_Options_BuffBackupManaDrinkItem:Hide()
        HealBot_Options_BuffBackupManaDrinkItems:Show()
    end
end

function HealBot_Options_BuffWellFedItem_HelpItemSelect_OnClick()
    if HealBot_Options_BuffWellFedItems:IsVisible() then
        HealBot_Options_BuffWellFedItems:Hide()
        HealBot_Options_BuffWellFedItem:Show()
    else
        HealBot_Options_BuffWellFedItem:Hide()
        HealBot_Options_BuffWellFedItems:Show()
    end
end

function HealBot_Options_BuffBackupWellFedItem_HelpItemSelect_OnClick()
    if HealBot_Options_BackupBuffWellFedItems:IsVisible() then
        HealBot_Options_BackupBuffWellFedItems:Hide()
        HealBot_Options_BuffBackupWellFedItem:Show()
    else
        HealBot_Options_BuffBackupWellFedItem:Hide()
        HealBot_Options_BackupBuffWellFedItems:Show()
    end
end

function HealBot_Options_SkinsHelpSpellsSelect_OnClick(self, sLoc)
    HealBot_Options_luVars["HealBot_Options_SkinsLoc"]=sLoc
    local hbTmpText1=HealBot_Options_ComboButton_ModifierKey(HealBot_Options_ComboButtons_Modifier)
    if sLoc==1 then
        hbOptionText[3]=HEALBOT_OPTIONS_COMBOCLASS..":  "..hbTmpText1.." "..HEALBOT_OPTIONS_BUTTONLEFT.." "..HEALBOT_OPTIONS_CLICK
    elseif sLoc==2 then
        hbOptionText[3]=HEALBOT_OPTIONS_COMBOCLASS..":  "..hbTmpText1.." "..HEALBOT_OPTIONS_BUTTONMIDDLE.." "..HEALBOT_OPTIONS_CLICK
    elseif sLoc==3 then
        hbOptionText[3]=HEALBOT_OPTIONS_COMBOCLASS..":  "..hbTmpText1.." "..HEALBOT_OPTIONS_BUTTONRIGHT.." "..HEALBOT_OPTIONS_CLICK
    elseif sLoc==4 then
        hbOptionText[3]=HEALBOT_OPTIONS_COMBOCLASS..":  "..hbTmpText1.." "..HEALBOT_OPTIONS_BUTTON4.." "..HEALBOT_OPTIONS_CLICK
    else
        hbOptionText[3]=HEALBOT_OPTIONS_COMBOCLASS..":  "..hbTmpText1.." "..HEALBOT_OPTIONS_BUTTON5.." "..HEALBOT_OPTIONS_CLICK
    end
    HealBot_Options_SpellsSkinsFrame:Hide()
end

--------------------------------------------------------------------------------
function HealBot_Options_ActionAnchor_UpdateDropDown()
    HealBot_Options_ActionAnchor.initialize = HealBot_Options_ActionAnchor_DropDown
    UIDropDownMenu_SetText(HealBot_Options_ActionAnchor, HealBot_Options_ActionAnchor_List[Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FRAME"]])
end

function HealBot_Options_ActionAnchor_SetAlpha(hbCurFrame)
    if hbCurFrame==HealBot_Options_luVars["FramesSelFrame"] then
        if HealBot_Action_hbStickyFrameGetCoords(hbCurFrame) then
            HealBot_Options_ActionAnchor:SetAlpha(0.4)
        else
            HealBot_Options_ActionAnchor:SetAlpha(1)
        end
    end
end

function HealBot_Options_ActionAnchor_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_ActionAnchor_List), 1 do
        info.text = HealBot_Options_ActionAnchor_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FRAME"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_ActionAnchor,HealBot_Options_ActionAnchor_List[Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FRAME"]]) 
                        --local g=_G["f"..HealBot_Options_luVars["FramesSelFrame"].."_HealBot_Action"]
                        HealBot_Action_setPoint(HealBot_Options_luVars["FramesSelFrame"], true)
                        HealBot_Timers_Set("INIT","RefreshPartyNextRecalcAll")
                    end
        info.checked = false;
        if Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FRAME"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_EmergBarAnchor_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_ActionAnchor_List), 1 do
        info.text = HealBot_Options_ActionAnchor_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ANCHOR"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_EmergBarAnchor,HealBot_Options_ActionAnchor_List[Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ANCHOR"]]) 
                        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
                    end
        info.checked = false;
        if Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ANCHOR"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_ActionBarsAnchor_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, 4, 1 do
        info.text = HealBot_Options_ActionAnchor_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BARS"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_ActionBarsAnchor,HealBot_Options_ActionAnchor_List[Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BARS"]]) 
                        --local g=_G["f"..HealBot_Options_luVars["FramesSelFrame"].."_HealBot_Action"]
                        HealBot_Action_setPoint(HealBot_Options_luVars["FramesSelFrame"], true)
                        HealBot_Timers_Set("INIT","RefreshPartyNextRecalcAll")
                    end
        info.checked = false;
        if Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BARS"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_ActionLocked_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_ActionLocked_List), 1 do
        info.text = HealBot_Options_ActionLocked_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["LOCKED"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_ActionLocked,HealBot_Options_ActionLocked_List[Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["LOCKED"]]) 
                    end
        info.checked = false;
        if Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["LOCKED"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AutoShow_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AutoShow"]), 1 do
        info.text = HealBot_Options_Lists["AutoShow"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AUTOCLOSE"] ~= self:GetID() then
                            Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AUTOCLOSE"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_AutoShow,HealBot_Options_Lists["AutoShow"][Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AUTOCLOSE"]]) 
                            HealBot_Timers_Set("LAST","SetAutoClose")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AUTOCLOSE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_GlowFrame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["GlowFrame"]), 1 do
        info.text = HealBot_Options_Lists["GlowFrame"][j];
        info.func = function(self)
                        if Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GLOW"] ~= self:GetID() then
                            Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GLOW"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_GlowFrame,HealBot_Options_Lists["GlowFrame"][Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GLOW"]]) 
                            HealBot_Timers_Set("LAST","UpdateButtonGlow")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GLOW"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BarsGrowDirection_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, 2, 1 do
        info.text = HealBot_Options_BarsGrowDirection_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GROW"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BarsGrowDirection,HealBot_Options_BarsGrowDirection_List[Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GROW"]]) 
                        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
                    end
        info.checked = false;
        if Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GROW"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BarsOrientation_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, 2, 1 do
        info.text = HealBot_Options_BarsOrientation_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFIX"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BarsOrientation,HealBot_Options_BarsOrientation_List[Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFIX"]]) 
                        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
                    end
        info.checked = false;
        if Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFIX"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_FramesSelFrame_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1,10, 1 do
        info.text = HealBot_Options_HealGroupsFrame_List[j];
        info.func = function(self)
                        if HealBot_Options_luVars["FramesSelFrame"]~=self:GetID() then
                            HealBot_Options_luVars["FramesSelFrame"]=self:GetID()
                            if HEALBOT_GAME_VERSION<3 then 
                                if HealBot_Options_luVars["FramesSelFrame"]==6 then HealBot_Options_luVars["FramesSelFrame"]=7 end
                                if HEALBOT_GAME_VERSION<2 then 
                                    if HealBot_Options_luVars["FramesSelFrame"]==9 then HealBot_Options_luVars["FramesSelFrame"]=10 end
                                end
                            end
                            UIDropDownMenu_SetText(HealBot_Options_FramesSelFrame,HealBot_Options_HealGroupsFrame_List[HealBot_Options_luVars["FramesSelFrame"]]) 
                            HealBot_Options_SetSkins(true)
                            if HealBot_Options_luVars["FramesSelFrame"]>5 then
                                g=_G["HealBot_Options_FrameAlias"] 
                                g:Hide()
                                g=_G["HealBot_Options_FrameAliasFixedFrame"] 
                                g:SetText(HealBot_Options_HealGroupsFrame_List[HealBot_Options_luVars["FramesSelFrame"]])
                                g:Show()
                            else
                                g=_G["HealBot_Options_FrameAliasFixedFrame"] 
                                g:Hide()
                                HealBot_Options_SetText(HealBot_Options_FrameAlias,HEALBOT_OPTIONS_FRAME_ALIAS)
                                g=_G["HealBot_Options_FrameAlias"] 
                                g:Show()
                            end
                            if HealBot_Options_luVars["FramesSelFrame"]>1 then
                                HealBot_Options_ObjectsEnableDisable("HealBot_FrameStickyOffsetHorizontal",true)
                                HealBot_Options_ObjectsEnableDisable("HealBot_FrameStickyOffsetVertical",true)
                            else
                                HealBot_Options_ObjectsEnableDisable("HealBot_FrameStickyOffsetHorizontal",false)
                                HealBot_Options_ObjectsEnableDisable("HealBot_FrameStickyOffsetVertical",false)
                            end
                            HealBot_Options_DoEffects_DropDowns()
                            if HealBot_Options_luVars["FramesSelFrame"]>5 then
                                HealBot_Options_ObjectsEnableDisable("HealBot_Options_SubSortPlayerFirst",false)
                                if HealBot_Options_luVars["FramesSelFrame"]==7 then
                                    HealBot_Options_ObjectsEnableDisable("HealBot_Options_GroupPetsByFive",true)
                                    HealBot_Options_ObjectsEnableDisable("HealBot_Options_SelfPet",true)
                                else
                                    HealBot_Options_ObjectsEnableDisable("HealBot_Options_GroupPetsByFive",false)
                                    HealBot_Options_ObjectsEnableDisable("HealBot_Options_SelfPet",false)
                                end
                            else
                                HealBot_Options_ObjectsEnableDisable("HealBot_Options_SubSortPlayerFirst",true)
                                HealBot_Options_ObjectsEnableDisable("HealBot_Options_GroupPetsByFive",false)
                                HealBot_Options_ObjectsEnableDisable("HealBot_Options_SelfPet",false)
                            end
                            HealBot_Timers_InitExtraOptions()
                        end
                    end
        info.checked = false;
        if HealBot_Options_luVars["FramesSelFrame"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

local hbCopyFrameIdx={}
function HealBot_Options_CopyTab2Frames(frame, tab)
    local s=Healbot_Config_Skins.Current_Skin
    local f=HealBot_Options_luVars["FramesSelFrame"]
    
    if tab==1 then
        Healbot_Config_Skins.Frame[s][frame]["SCALE"]=Healbot_Config_Skins.Frame[s][f]["SCALE"]
        Healbot_Config_Skins.FrameAlias[s][frame]["SIZE"]=Healbot_Config_Skins.FrameAlias[s][f]["SIZE"]
        Healbot_Config_Skins.FrameAlias[s][frame]["OFFSET"]=Healbot_Config_Skins.FrameAlias[s][f]["OFFSET"]
        Healbot_Config_Skins.Frame[s][frame]["LOCKED"]=Healbot_Config_Skins.Frame[s][f]["LOCKED"]
        Healbot_Config_Skins.Frame[s][frame]["AUTOCLOSE"]=Healbot_Config_Skins.Frame[s][f]["AUTOCLOSE"]
        Healbot_Config_Skins.Anchors[s][frame]["GROW"]=Healbot_Config_Skins.Anchors[s][f]["GROW"]
        Healbot_Config_Skins.Anchors[s][frame]["FRAME"]=Healbot_Config_Skins.Anchors[s][f]["FRAME"]
        Healbot_Config_Skins.Anchors[s][frame]["BARS"]=Healbot_Config_Skins.Anchors[s][f]["BARS"]
        Healbot_Config_Skins.Frame[s][frame]["TIPLOC"]=Healbot_Config_Skins.Frame[s][f]["TIPLOC"]
        Healbot_Config_Skins.Frame[s][frame]["PADDING"]=Healbot_Config_Skins.Frame[s][f]["PADDING"]
        Healbot_Config_Skins.Frame[s][frame]["BACKR"]=Healbot_Config_Skins.Frame[s][f]["BACKR"]
        Healbot_Config_Skins.Frame[s][frame]["BACKG"]=Healbot_Config_Skins.Frame[s][f]["BACKG"]
        Healbot_Config_Skins.Frame[s][frame]["BACKB"]=Healbot_Config_Skins.Frame[s][f]["BACKB"]
        Healbot_Config_Skins.Frame[s][frame]["BACKA"]=Healbot_Config_Skins.Frame[s][f]["BACKA"]
        Healbot_Config_Skins.Frame[s][frame]["BORDERR"]=Healbot_Config_Skins.Frame[s][f]["BORDERR"]
        Healbot_Config_Skins.Frame[s][frame]["BORDERG"]=Healbot_Config_Skins.Frame[s][f]["BORDERG"]
        Healbot_Config_Skins.Frame[s][frame]["BORDERB"]=Healbot_Config_Skins.Frame[s][f]["BORDERB"]
        Healbot_Config_Skins.Frame[s][frame]["BORDERA"]=Healbot_Config_Skins.Frame[s][f]["BORDERA"]
    elseif tab==2 then
        Healbot_Config_Skins.HeadBar[s][frame]["TEXTURE"]=Healbot_Config_Skins.HeadBar[s][f]["TEXTURE"]
        Healbot_Config_Skins.HeadBar[s][frame]["WIDTH"]=Healbot_Config_Skins.HeadBar[s][f]["WIDTH"]
        Healbot_Config_Skins.HeadBar[s][frame]["HEIGHT"]=Healbot_Config_Skins.HeadBar[s][f]["HEIGHT"]
        Healbot_Config_Skins.HeadText[s][frame]["FONT"]=Healbot_Config_Skins.HeadText[s][f]["FONT"]
        Healbot_Config_Skins.HeadText[s][frame]["HEIGHT"]=Healbot_Config_Skins.HeadText[s][f]["HEIGHT"]
        Healbot_Config_Skins.HeadBar[s][frame]["SHOW"]=Healbot_Config_Skins.HeadBar[s][f]["SHOW"]
        Healbot_Config_Skins.HeadBar[s][frame]["R"]=Healbot_Config_Skins.HeadBar[s][f]["R"]
        Healbot_Config_Skins.HeadBar[s][frame]["G"]=Healbot_Config_Skins.HeadBar[s][f]["G"]
        Healbot_Config_Skins.HeadBar[s][frame]["B"]=Healbot_Config_Skins.HeadBar[s][f]["B"]
        Healbot_Config_Skins.HeadBar[s][frame]["A"]=Healbot_Config_Skins.HeadBar[s][f]["A"]
        Healbot_Config_Skins.HeadText[s][frame]["OUTLINE"]=Healbot_Config_Skins.HeadText[s][f]["OUTLINE"]
        Healbot_Config_Skins.HeadText[s][frame]["R"]=Healbot_Config_Skins.HeadText[s][f]["R"]
        Healbot_Config_Skins.HeadText[s][frame]["G"]=Healbot_Config_Skins.HeadText[s][f]["G"]
        Healbot_Config_Skins.HeadText[s][frame]["B"]=Healbot_Config_Skins.HeadText[s][f]["B"]
        Healbot_Config_Skins.HeadText[s][frame]["A"]=Healbot_Config_Skins.HeadText[s][f]["A"]
    elseif tab==3 then
        Healbot_Config_Skins.FrameAlias[s][frame]["SHOW"]=Healbot_Config_Skins.FrameAlias[s][f]["SHOW"]
        Healbot_Config_Skins.FrameAlias[s][frame]["FONT"]=Healbot_Config_Skins.FrameAlias[s][f]["FONT"]
        Healbot_Config_Skins.FrameAlias[s][frame]["OUTLINE"]=Healbot_Config_Skins.FrameAlias[s][f]["OUTLINE"]
        Healbot_Config_Skins.FrameAlias[s][frame]["R"]=Healbot_Config_Skins.FrameAlias[s][f]["R"]
        Healbot_Config_Skins.FrameAlias[s][frame]["G"]=Healbot_Config_Skins.FrameAlias[s][f]["G"]
        Healbot_Config_Skins.FrameAlias[s][frame]["B"]=Healbot_Config_Skins.FrameAlias[s][f]["B"]
        Healbot_Config_Skins.FrameAlias[s][frame]["A"]=Healbot_Config_Skins.FrameAlias[s][f]["A"]
        Healbot_Config_Skins.FrameAliasBar[s][frame]["TEXTURE"]=Healbot_Config_Skins.FrameAliasBar[s][f]["TEXTURE"]
        Healbot_Config_Skins.FrameAliasBar[s][frame]["WIDTH"]=Healbot_Config_Skins.FrameAliasBar[s][f]["WIDTH"]
        Healbot_Config_Skins.FrameAliasBar[s][frame]["HEIGHT"]=Healbot_Config_Skins.FrameAliasBar[s][f]["HEIGHT"]
        Healbot_Config_Skins.FrameAliasBar[s][frame]["R"]=Healbot_Config_Skins.FrameAliasBar[s][f]["R"]
        Healbot_Config_Skins.FrameAliasBar[s][frame]["G"]=Healbot_Config_Skins.FrameAliasBar[s][f]["G"]
        Healbot_Config_Skins.FrameAliasBar[s][frame]["B"]=Healbot_Config_Skins.FrameAliasBar[s][f]["B"]
        Healbot_Config_Skins.FrameAliasBar[s][frame]["A"]=Healbot_Config_Skins.FrameAliasBar[s][f]["A"]
    elseif tab==4 then
        Healbot_Config_Skins.HealBar[s][frame]["CMARGIN"]=Healbot_Config_Skins.HealBar[s][f]["CMARGIN"]
        Healbot_Config_Skins.HealBar[s][frame]["GRPCOLS"]=Healbot_Config_Skins.HealBar[s][f]["GRPCOLS"]
        Healbot_Config_Skins.HealBar[s][frame]["TEXTURE"]=Healbot_Config_Skins.HealBar[s][f]["TEXTURE"]
        Healbot_Config_Skins.HealBar[s][frame]["HEIGHT"]=Healbot_Config_Skins.HealBar[s][f]["HEIGHT"]
        Healbot_Config_Skins.HealBar[s][frame]["WIDTH"]=Healbot_Config_Skins.HealBar[s][f]["WIDTH"]
        Healbot_Config_Skins.HealBar[s][frame]["NUMCOLS"]=Healbot_Config_Skins.HealBar[s][f]["NUMCOLS"]
        Healbot_Config_Skins.HealBar[s][frame]["RMARGIN"]=Healbot_Config_Skins.HealBar[s][f]["RMARGIN"]
    elseif tab==5 then
        Healbot_Config_Skins.BarCol[s][frame]["DISA"]=Healbot_Config_Skins.BarCol[s][f]["DISA"]
        Healbot_Config_Skins.BarCol[s][frame]["ORA"]=Healbot_Config_Skins.BarCol[s][f]["ORA"]
        Healbot_Config_Skins.BarCol[s][frame]["HR"]=Healbot_Config_Skins.BarCol[s][f]["HR"]
        Healbot_Config_Skins.BarCol[s][frame]["HG"]=Healbot_Config_Skins.BarCol[s][f]["HG"]
        Healbot_Config_Skins.BarCol[s][frame]["HB"]=Healbot_Config_Skins.BarCol[s][f]["HB"]
        Healbot_Config_Skins.BarCol[s][frame]["HA"]=Healbot_Config_Skins.BarCol[s][f]["HA"]
        Healbot_Config_Skins.BarCol[s][frame]["HIR"]=Healbot_Config_Skins.BarCol[s][f]["HIR"]
        Healbot_Config_Skins.BarCol[s][frame]["HIG"]=Healbot_Config_Skins.BarCol[s][f]["HIG"]
        Healbot_Config_Skins.BarCol[s][frame]["HIB"]=Healbot_Config_Skins.BarCol[s][f]["HIB"]
        Healbot_Config_Skins.BarCol[s][frame]["HCR"]=Healbot_Config_Skins.BarCol[s][f]["HCR"]
        Healbot_Config_Skins.BarCol[s][frame]["HCG"]=Healbot_Config_Skins.BarCol[s][f]["HCG"]
        Healbot_Config_Skins.BarCol[s][frame]["HCB"]=Healbot_Config_Skins.BarCol[s][f]["HCB"]
        Healbot_Config_Skins.BarCol[s][frame]["HIT"]=Healbot_Config_Skins.BarCol[s][f]["HIT"]
        Healbot_Config_Skins.BarCol[s][frame]["HCT"]=Healbot_Config_Skins.BarCol[s][f]["HCT"]
        Healbot_Config_Skins.BarIACol[s][frame]["IR"]=Healbot_Config_Skins.BarIACol[s][f]["IR"]
        Healbot_Config_Skins.BarIACol[s][frame]["IG"]=Healbot_Config_Skins.BarIACol[s][f]["IG"]
        Healbot_Config_Skins.BarIACol[s][frame]["IB"]=Healbot_Config_Skins.BarIACol[s][f]["IB"]
        Healbot_Config_Skins.BarIACol[s][frame]["IIR"]=Healbot_Config_Skins.BarIACol[s][f]["IIR"]
        Healbot_Config_Skins.BarIACol[s][frame]["IIG"]=Healbot_Config_Skins.BarIACol[s][f]["IIG"]
        Healbot_Config_Skins.BarIACol[s][frame]["IIB"]=Healbot_Config_Skins.BarIACol[s][f]["IIB"]
        Healbot_Config_Skins.BarIACol[s][frame]["ICR"]=Healbot_Config_Skins.BarIACol[s][f]["ICR"]
        Healbot_Config_Skins.BarIACol[s][frame]["ICG"]=Healbot_Config_Skins.BarIACol[s][f]["ICG"]
        Healbot_Config_Skins.BarIACol[s][frame]["ICB"]=Healbot_Config_Skins.BarIACol[s][f]["ICB"]
        Healbot_Config_Skins.BarIACol[s][frame]["IIT"]=Healbot_Config_Skins.BarIACol[s][f]["IIT"]
        Healbot_Config_Skins.BarIACol[s][frame]["ICT"]=Healbot_Config_Skins.BarIACol[s][f]["ICT"]
        Healbot_Config_Skins.BarIACol[s][frame]["IA"]=Healbot_Config_Skins.BarIACol[s][f]["IA"]
        Healbot_Config_Skins.BarIACol[s][frame]["AR"]=Healbot_Config_Skins.BarIACol[s][f]["AR"]
        Healbot_Config_Skins.BarIACol[s][frame]["AG"]=Healbot_Config_Skins.BarIACol[s][f]["AG"]
        Healbot_Config_Skins.BarIACol[s][frame]["AB"]=Healbot_Config_Skins.BarIACol[s][f]["AB"]
        Healbot_Config_Skins.BarIACol[s][frame]["AIR"]=Healbot_Config_Skins.BarIACol[s][f]["AIR"]
        Healbot_Config_Skins.BarIACol[s][frame]["AIG"]=Healbot_Config_Skins.BarIACol[s][f]["AIG"]
        Healbot_Config_Skins.BarIACol[s][frame]["AIB"]=Healbot_Config_Skins.BarIACol[s][f]["AIB"]
        Healbot_Config_Skins.BarIACol[s][frame]["ACR"]=Healbot_Config_Skins.BarIACol[s][f]["ACR"]
        Healbot_Config_Skins.BarIACol[s][frame]["ACG"]=Healbot_Config_Skins.BarIACol[s][f]["ACG"]
        Healbot_Config_Skins.BarIACol[s][frame]["ACB"]=Healbot_Config_Skins.BarIACol[s][f]["ACB"]
        Healbot_Config_Skins.BarIACol[s][frame]["AIT"]=Healbot_Config_Skins.BarIACol[s][f]["AIT"]
        Healbot_Config_Skins.BarIACol[s][frame]["ACT"]=Healbot_Config_Skins.BarIACol[s][f]["ACT"]
        Healbot_Config_Skins.BarIACol[s][frame]["AA"]=Healbot_Config_Skins.BarIACol[s][f]["AA"]
        Healbot_Config_Skins.BarCol[s][frame]["BR"]=Healbot_Config_Skins.BarCol[s][f]["BR"]
        Healbot_Config_Skins.BarCol[s][frame]["BG"]=Healbot_Config_Skins.BarCol[s][f]["BG"]
        Healbot_Config_Skins.BarCol[s][frame]["BB"]=Healbot_Config_Skins.BarCol[s][f]["BB"]
        Healbot_Config_Skins.BarCol[s][frame]["BA"]=Healbot_Config_Skins.BarCol[s][f]["BA"]
        Healbot_Config_Skins.BarCol[s][frame]["BIR"]=Healbot_Config_Skins.BarCol[s][f]["BIR"]
        Healbot_Config_Skins.BarCol[s][frame]["BIG"]=Healbot_Config_Skins.BarCol[s][f]["BIG"]
        Healbot_Config_Skins.BarCol[s][frame]["BIB"]=Healbot_Config_Skins.BarCol[s][f]["BIB"]
        Healbot_Config_Skins.BarCol[s][frame]["BCR"]=Healbot_Config_Skins.BarCol[s][f]["BCR"]
        Healbot_Config_Skins.BarCol[s][frame]["BCG"]=Healbot_Config_Skins.BarCol[s][f]["BCG"]
        Healbot_Config_Skins.BarCol[s][frame]["BCB"]=Healbot_Config_Skins.BarCol[s][f]["BCB"]
        Healbot_Config_Skins.BarCol[s][frame]["BIT"]=Healbot_Config_Skins.BarCol[s][f]["BIT"]
        Healbot_Config_Skins.BarCol[s][frame]["BCT"]=Healbot_Config_Skins.BarCol[s][f]["BCT"]
        Healbot_Config_Skins.BarCol[s][frame]["BOUT"]=Healbot_Config_Skins.BarCol[s][f]["BOUT"]
        Healbot_Config_Skins.BarIACol[s][frame]["IC"]=Healbot_Config_Skins.BarIACol[s][f]["IC"]
        Healbot_Config_Skins.BarCol[s][frame]["HLTH"]=Healbot_Config_Skins.BarCol[s][f]["HLTH"]
        Healbot_Config_Skins.BarCol[s][frame]["BACK"]=Healbot_Config_Skins.BarCol[s][f]["BACK"]
        Healbot_Config_Skins.BarCol[s][frame]["BORDER"]=Healbot_Config_Skins.BarCol[s][f]["BORDER"]
        Healbot_Config_Skins.BarIACol[s][frame]["AC"]=Healbot_Config_Skins.BarIACol[s][f]["AC"]
        Healbot_Config_Skins.BarCol[s][frame]["BORR"]=Healbot_Config_Skins.BarCol[s][f]["BORR"]
        Healbot_Config_Skins.BarCol[s][frame]["BORG"]=Healbot_Config_Skins.BarCol[s][f]["BORG"]
        Healbot_Config_Skins.BarCol[s][frame]["BORB"]=Healbot_Config_Skins.BarCol[s][f]["BORB"]
        Healbot_Config_Skins.BarCol[s][frame]["BORIR"]=Healbot_Config_Skins.BarCol[s][f]["BORIR"]
        Healbot_Config_Skins.BarCol[s][frame]["BORIG"]=Healbot_Config_Skins.BarCol[s][f]["BORIG"]
        Healbot_Config_Skins.BarCol[s][frame]["BORIB"]=Healbot_Config_Skins.BarCol[s][f]["BORIB"]
        Healbot_Config_Skins.BarCol[s][frame]["BORCR"]=Healbot_Config_Skins.BarCol[s][f]["BORCR"]
        Healbot_Config_Skins.BarCol[s][frame]["BORCG"]=Healbot_Config_Skins.BarCol[s][f]["BORCG"]
        Healbot_Config_Skins.BarCol[s][frame]["BORCB"]=Healbot_Config_Skins.BarCol[s][f]["BORCB"]
        Healbot_Config_Skins.BarCol[s][frame]["BORA"]=Healbot_Config_Skins.BarCol[s][f]["BORA"]
        Healbot_Config_Skins.BarCol[s][frame]["BORSIZE"]=Healbot_Config_Skins.BarCol[s][f]["BORSIZE"]
    elseif tab==6 then
        Healbot_Config_Skins.BarSort[s][frame]["RAIDORDER"]=Healbot_Config_Skins.BarSort[s][f]["RAIDORDER"]
        Healbot_Config_Skins.BarSort[s][frame]["SUBORDER"]=Healbot_Config_Skins.BarSort[s][f]["SUBORDER"]
        Healbot_Config_Skins.BarSort[s][frame]["OORLAST"]=Healbot_Config_Skins.BarSort[s][f]["OORLAST"]
        Healbot_Config_Skins.BarSort[s][frame]["SUBPF"]=Healbot_Config_Skins.BarSort[s][f]["SUBPF"]
    elseif tab==7 then
        Healbot_Config_Skins.BarVisibility[s][frame]["HIDEOOR"]=Healbot_Config_Skins.BarVisibility[s][f]["HIDEOOR"]
        Healbot_Config_Skins.BarVisibility[s][frame]["ALERTIC"]=Healbot_Config_Skins.BarVisibility[s][f]["ALERTIC"]
        Healbot_Config_Skins.BarVisibility[s][frame]["ALERTOC"]=Healbot_Config_Skins.BarVisibility[s][f]["ALERTOC"]
    elseif tab==9 then
        Healbot_Config_Skins.AuxBarFrame[s][frame]["OVERLAP"]=Healbot_Config_Skins.AuxBarFrame[s][f]["OVERLAP"]
        Healbot_Config_Skins.AuxBarFrame[s][frame]["OVERLAYRECENTHEALS"]=Healbot_Config_Skins.AuxBarFrame[s][f]["OVERLAYRECENTHEALS"]
        Healbot_Config_Skins.AuxBarFrame[s][frame]["OVERLAYHEALTHDROP"]=Healbot_Config_Skins.AuxBarFrame[s][f]["OVERLAYHEALTHDROP"]
        Healbot_Config_Skins.AuxBarFrame[s][frame]["OVERLAYAGGRO"]=Healbot_Config_Skins.AuxBarFrame[s][f]["OVERLAYAGGRO"]
        Healbot_Config_Skins.AuxBarFrame[s][frame]["OVERLAYDEBUFF"]=Healbot_Config_Skins.AuxBarFrame[s][f]["OVERLAYDEBUFF"]
        Healbot_Config_Skins.AuxBarFrame[s][frame]["OVERLAYHIGHLIGHT"]=Healbot_Config_Skins.AuxBarFrame[s][f]["OVERLAYHIGHLIGHT"]
        Healbot_Config_Skins.AuxBarFrame[s][frame]["OVERLAYTARGET"]=Healbot_Config_Skins.AuxBarFrame[s][f]["OVERLAYTARGET"]
        Healbot_Config_Skins.AuxBarFrame[s][frame]["OVERLAYOOR"]=Healbot_Config_Skins.AuxBarFrame[s][f]["OVERLAYOOR"]
        Healbot_Config_Skins.AuxBarFrame[s][frame]["OVERLAYBUFF"]=Healbot_Config_Skins.AuxBarFrame[s][f]["OVERLAYBUFF"]
        for x=1,9 do
            Healbot_Config_Skins.AuxBar[s][x][frame]["COLOUR"]=Healbot_Config_Skins.AuxBar[s][x][f]["COLOUR"]
            Healbot_Config_Skins.AuxBar[s][x][frame]["ANCHOR"]=Healbot_Config_Skins.AuxBar[s][x][f]["ANCHOR"]
            Healbot_Config_Skins.AuxBar[s][x][frame]["OFFSET"]=Healbot_Config_Skins.AuxBar[s][x][f]["OFFSET"]
            Healbot_Config_Skins.AuxBar[s][x][frame]["DEPTH"]=Healbot_Config_Skins.AuxBar[s][x][f]["DEPTH"]
            Healbot_Config_Skins.AuxBar[s][x][frame]["SIZE"]=Healbot_Config_Skins.AuxBar[s][x][f]["SIZE"]
            if frame==10 and Healbot_Config_Skins.AuxBar[s][x][f]["USE"]>11 then
                Healbot_Config_Skins.AuxBar[s][x][frame]["USE"]=1
            elseif frame>7 and Healbot_Config_Skins.AuxBar[s][x][f]["USE"]>16 then
                Healbot_Config_Skins.AuxBar[s][x][frame]["USE"]=1
            else
                Healbot_Config_Skins.AuxBar[s][x][frame]["USE"]=Healbot_Config_Skins.AuxBar[s][x][f]["USE"]
            end
            Healbot_Config_Skins.AuxBar[s][x][frame]["OTYPE"]=Healbot_Config_Skins.AuxBar[s][x][f]["OTYPE"]
            Healbot_Config_Skins.AuxBar[s][x][frame]["R"]=Healbot_Config_Skins.AuxBar[s][x][f]["R"]
            Healbot_Config_Skins.AuxBar[s][x][frame]["G"]=Healbot_Config_Skins.AuxBar[s][x][f]["G"]
            Healbot_Config_Skins.AuxBar[s][x][frame]["B"]=Healbot_Config_Skins.AuxBar[s][x][f]["B"]
            Healbot_Config_Skins.AuxBar[s][x][frame]["A"]=Healbot_Config_Skins.AuxBar[s][x][f]["A"]
        end
        HealBot_Aux_resetBars()
    elseif tab==23 then
        Healbot_Config_Skins.BarTextCol[s][frame]["SCR"]=Healbot_Config_Skins.BarTextCol[s][f]["SCR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SCG"]=Healbot_Config_Skins.BarTextCol[s][f]["SCG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SCB"]=Healbot_Config_Skins.BarTextCol[s][f]["SCB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SCA"]=Healbot_Config_Skins.BarTextCol[s][f]["SCA"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SICR"]=Healbot_Config_Skins.BarTextCol[s][f]["SICR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SICG"]=Healbot_Config_Skins.BarTextCol[s][f]["SICG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SICB"]=Healbot_Config_Skins.BarTextCol[s][f]["SICB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SCCR"]=Healbot_Config_Skins.BarTextCol[s][f]["SCCR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SCCG"]=Healbot_Config_Skins.BarTextCol[s][f]["SCCG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SCCB"]=Healbot_Config_Skins.BarTextCol[s][f]["SCCB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SIT"]=Healbot_Config_Skins.BarTextCol[s][f]["SIT"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SCT"]=Healbot_Config_Skins.BarTextCol[s][f]["SCT"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SCDA"]=Healbot_Config_Skins.BarTextCol[s][f]["SCDA"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SDCR"]=Healbot_Config_Skins.BarTextCol[s][f]["SDCR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SDCG"]=Healbot_Config_Skins.BarTextCol[s][f]["SDCG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SDCB"]=Healbot_Config_Skins.BarTextCol[s][f]["SDCB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SRCR"]=Healbot_Config_Skins.BarTextCol[s][f]["SRCR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SRCG"]=Healbot_Config_Skins.BarTextCol[s][f]["SRCG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SRCB"]=Healbot_Config_Skins.BarTextCol[s][f]["SRCB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SSCR"]=Healbot_Config_Skins.BarTextCol[s][f]["SSCR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SSCG"]=Healbot_Config_Skins.BarTextCol[s][f]["SSCG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SSCB"]=Healbot_Config_Skins.BarTextCol[s][f]["SSCB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SRIP"]=Healbot_Config_Skins.BarTextCol[s][f]["SRIP"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SRES"]=Healbot_Config_Skins.BarTextCol[s][f]["SRES"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SSUM"]=Healbot_Config_Skins.BarTextCol[s][f]["SSUM"]
        Healbot_Config_Skins.BarText[s][frame]["TAGDC"]=Healbot_Config_Skins.BarText[s][f]["TAGDC"]
        Healbot_Config_Skins.BarText[s][frame]["TAGRIP"]=Healbot_Config_Skins.BarText[s][f]["TAGRIP"]
        Healbot_Config_Skins.BarText[s][frame]["TAGRES"]=Healbot_Config_Skins.BarText[s][f]["TAGRES"]
        Healbot_Config_Skins.BarText[s][frame]["TAGSUM"]=Healbot_Config_Skins.BarText[s][f]["TAGSUM"]
        Healbot_Config_Skins.BarText[s][frame]["TAGOOR"]=Healbot_Config_Skins.BarText[s][f]["TAGOOR"]
        Healbot_Config_Skins.BarText[s][frame]["TAGR"]=Healbot_Config_Skins.BarText[s][f]["TAGR"]
        Healbot_Config_Skins.BarText[s][frame]["STATETXTANCHOR"]=Healbot_Config_Skins.BarText[s][f]["STATETXTANCHOR"]
        Healbot_Config_Skins.BarText[s][frame]["TAGSTATEONLYTIP"]=Healbot_Config_Skins.BarText[s][f]["TAGSTATEONLYTIP"]
        Healbot_Config_Skins.BarText[s][frame]["SFONT"]=Healbot_Config_Skins.BarText[s][f]["SFONT"]
        Healbot_Config_Skins.BarText[s][frame]["SHEIGHT"]=Healbot_Config_Skins.BarText[s][f]["SHEIGHT"]
        Healbot_Config_Skins.BarText[s][frame]["SOUTLINE"]=Healbot_Config_Skins.BarText[s][f]["SOUTLINE"]
        Healbot_Config_Skins.BarText[s][frame]["SOFFSET"]=Healbot_Config_Skins.BarText[s][f]["SOFFSET"]
        Healbot_Config_Skins.BarText[s][frame]["SOFFSET2"]=Healbot_Config_Skins.BarText[s][f]["SOFFSET2"]
        Healbot_Config_Skins.BarTextCol[s][frame]["STATE"]=Healbot_Config_Skins.BarTextCol[s][f]["STATE"]
    elseif tab==10 then
        Healbot_Config_Skins.BarTextCol[s][frame]["NCR"]=Healbot_Config_Skins.BarTextCol[s][f]["NCR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NCG"]=Healbot_Config_Skins.BarTextCol[s][f]["NCG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NCB"]=Healbot_Config_Skins.BarTextCol[s][f]["NCB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NCA"]=Healbot_Config_Skins.BarTextCol[s][f]["NCA"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NICR"]=Healbot_Config_Skins.BarTextCol[s][f]["NICR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NICG"]=Healbot_Config_Skins.BarTextCol[s][f]["NICG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NICB"]=Healbot_Config_Skins.BarTextCol[s][f]["NICB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NCCR"]=Healbot_Config_Skins.BarTextCol[s][f]["NCCR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NCCG"]=Healbot_Config_Skins.BarTextCol[s][f]["NCCG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NCCB"]=Healbot_Config_Skins.BarTextCol[s][f]["NCCB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NIT"]=Healbot_Config_Skins.BarTextCol[s][f]["NIT"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NCT"]=Healbot_Config_Skins.BarTextCol[s][f]["NCT"]
        Healbot_Config_Skins.BarTextCol[s][frame]["RIP"]=Healbot_Config_Skins.BarTextCol[s][f]["RIP"]
        Healbot_Config_Skins.BarTextCol[s][frame]["RES"]=Healbot_Config_Skins.BarTextCol[s][f]["RES"]
        Healbot_Config_Skins.BarTextCol[s][frame]["SUM"]=Healbot_Config_Skins.BarTextCol[s][f]["SUM"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NCDA"]=Healbot_Config_Skins.BarTextCol[s][f]["NCDA"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NAME"]=Healbot_Config_Skins.BarTextCol[s][f]["NAME"]
        Healbot_Config_Skins.BarTextCol[s][frame]["NDEBUFF"]=Healbot_Config_Skins.BarTextCol[s][f]["NDEBUFF"]
        Healbot_Config_Skins.BarText[s][frame]["FONT"]=Healbot_Config_Skins.BarText[s][f]["FONT"]
        Healbot_Config_Skins.BarText[s][frame]["HEIGHT"]=Healbot_Config_Skins.BarText[s][f]["HEIGHT"]
        Healbot_Config_Skins.BarText[s][frame]["SHOWROLE"]=Healbot_Config_Skins.BarText[s][f]["SHOWROLE"]
        Healbot_Config_Skins.BarText[s][frame]["CLASSONBAR"]=Healbot_Config_Skins.BarText[s][f]["CLASSONBAR"]
        Healbot_Config_Skins.BarText[s][frame]["NAMEONBAR"]=Healbot_Config_Skins.BarText[s][f]["NAMEONBAR"]
        Healbot_Config_Skins.BarText[s][frame]["ALIGN"]=Healbot_Config_Skins.BarText[s][f]["ALIGN"]
        Healbot_Config_Skins.BarText[s][frame]["OUTLINE"]=Healbot_Config_Skins.BarText[s][f]["OUTLINE"]
        Healbot_Config_Skins.BarText[s][frame]["MAXCHARS"]=Healbot_Config_Skins.BarText[s][f]["MAXCHARS"]
        Healbot_Config_Skins.BarText[s][frame]["OFFSET"]=Healbot_Config_Skins.BarText[s][f]["OFFSET"]
        Healbot_Config_Skins.BarText[s][frame]["OFFSET2"]=Healbot_Config_Skins.BarText[s][f]["OFFSET2"]
    elseif tab==11 then
        Healbot_Config_Skins.BarTextCol[s][frame]["HCR"]=Healbot_Config_Skins.BarTextCol[s][f]["HCR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HCG"]=Healbot_Config_Skins.BarTextCol[s][f]["HCG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HCB"]=Healbot_Config_Skins.BarTextCol[s][f]["HCB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HECR"]=Healbot_Config_Skins.BarTextCol[s][f]["HECR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HECG"]=Healbot_Config_Skins.BarTextCol[s][f]["HECG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HECB"]=Healbot_Config_Skins.BarTextCol[s][f]["HECB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HICR"]=Healbot_Config_Skins.BarTextCol[s][f]["HICR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HICG"]=Healbot_Config_Skins.BarTextCol[s][f]["HICG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HICB"]=Healbot_Config_Skins.BarTextCol[s][f]["HICB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HCCR"]=Healbot_Config_Skins.BarTextCol[s][f]["HCCR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HCCG"]=Healbot_Config_Skins.BarTextCol[s][f]["HCCG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HCCB"]=Healbot_Config_Skins.BarTextCol[s][f]["HCCB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HIT"]=Healbot_Config_Skins.BarTextCol[s][f]["HIT"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HCT"]=Healbot_Config_Skins.BarTextCol[s][f]["HCT"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HCA"]=Healbot_Config_Skins.BarTextCol[s][f]["HCA"]
        Healbot_Config_Skins.BarTextCol[s][frame]["OCR"]=Healbot_Config_Skins.BarTextCol[s][f]["OCR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["OCG"]=Healbot_Config_Skins.BarTextCol[s][f]["OCG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["OCB"]=Healbot_Config_Skins.BarTextCol[s][f]["OCB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["ICR"]=Healbot_Config_Skins.BarTextCol[s][f]["ICR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["ICG"]=Healbot_Config_Skins.BarTextCol[s][f]["ICG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["ICB"]=Healbot_Config_Skins.BarTextCol[s][f]["ICB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HCDA"]=Healbot_Config_Skins.BarTextCol[s][f]["HCDA"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HLTH"]=Healbot_Config_Skins.BarTextCol[s][f]["HLTH"]
        Healbot_Config_Skins.BarTextCol[s][frame]["HDEBUFF"]=Healbot_Config_Skins.BarTextCol[s][f]["HDEBUFF"]
        Healbot_Config_Skins.BarText[s][frame]["HLTHONBAR"]=Healbot_Config_Skins.BarText[s][f]["HLTHONBAR"]
        Healbot_Config_Skins.BarText[s][frame]["INCHEALS"]=Healbot_Config_Skins.BarText[s][f]["INCHEALS"]
        Healbot_Config_Skins.BarText[s][frame]["INCABSORBS"]=Healbot_Config_Skins.BarText[s][f]["INCABSORBS"]
        Healbot_Config_Skins.BarText[s][frame]["OVERHEAL"]=Healbot_Config_Skins.BarText[s][f]["OVERHEAL"]
        Healbot_Config_Skins.BarText[s][frame]["HLTHTXTANCHOR"]=Healbot_Config_Skins.BarText[s][f]["HLTHTXTANCHOR"]
        Healbot_Config_Skins.BarText[s][frame]["NUMFORMAT1"]=Healbot_Config_Skins.BarText[s][f]["NUMFORMAT1"]
        Healbot_Config_Skins.BarText[s][frame]["NUMFORMAT2"]=Healbot_Config_Skins.BarText[s][f]["NUMFORMAT2"]
        Healbot_Config_Skins.BarText[s][frame]["HLTHTYPE"]=Healbot_Config_Skins.BarText[s][f]["HLTHTYPE"]
        Healbot_Config_Skins.BarText[s][frame]["HFONT"]=Healbot_Config_Skins.BarText[s][f]["HFONT"]
        Healbot_Config_Skins.BarText[s][frame]["HHEIGHT"]=Healbot_Config_Skins.BarText[s][f]["HHEIGHT"]
        Healbot_Config_Skins.BarText[s][frame]["HOFFSET2"]=Healbot_Config_Skins.BarText[s][f]["HOFFSET2"]
        Healbot_Config_Skins.BarText[s][frame]["HOUTLINE"]=Healbot_Config_Skins.BarText[s][f]["HOUTLINE"]
        Healbot_Config_Skins.BarText[s][frame]["HMAXCHARS"]=Healbot_Config_Skins.BarText[s][f]["HMAXCHARS"]
        Healbot_Config_Skins.BarText[s][frame]["HOFFSET"]=Healbot_Config_Skins.BarText[s][f]["HOFFSET"]
    elseif tab==12 then
        Healbot_Config_Skins.BarTextCol[s][frame]["ACR"]=Healbot_Config_Skins.BarTextCol[s][f]["ACR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["ACG"]=Healbot_Config_Skins.BarTextCol[s][f]["ACG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["ACB"]=Healbot_Config_Skins.BarTextCol[s][f]["ACB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["ACA"]=Healbot_Config_Skins.BarTextCol[s][f]["ACA"]
        Healbot_Config_Skins.BarTextCol[s][frame]["AICR"]=Healbot_Config_Skins.BarTextCol[s][f]["AICR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["AICG"]=Healbot_Config_Skins.BarTextCol[s][f]["AICG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["AICB"]=Healbot_Config_Skins.BarTextCol[s][f]["AICB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["ACCR"]=Healbot_Config_Skins.BarTextCol[s][f]["ACCR"]
        Healbot_Config_Skins.BarTextCol[s][frame]["ACCG"]=Healbot_Config_Skins.BarTextCol[s][f]["ACCG"]
        Healbot_Config_Skins.BarTextCol[s][frame]["ACCB"]=Healbot_Config_Skins.BarTextCol[s][f]["ACCB"]
        Healbot_Config_Skins.BarTextCol[s][frame]["AIT"]=Healbot_Config_Skins.BarTextCol[s][f]["AIT"]
        Healbot_Config_Skins.BarTextCol[s][frame]["ACT"]=Healbot_Config_Skins.BarTextCol[s][f]["ACT"]
        Healbot_Config_Skins.BarTextCol[s][frame]["ACDA"]=Healbot_Config_Skins.BarTextCol[s][f]["ACDA"]
        Healbot_Config_Skins.BarText[s][frame]["TAGAGGROONLYTIP"]=Healbot_Config_Skins.BarText[s][f]["TAGAGGROONLYTIP"]
        Healbot_Config_Skins.BarAggro[s][frame]["TEXTFORMAT"]=Healbot_Config_Skins.BarAggro[s][f]["TEXTFORMAT"]
        Healbot_Config_Skins.BarText[s][frame]["AGGROTXTANCHOR"]=Healbot_Config_Skins.BarText[s][f]["AGGROTXTANCHOR"]
        Healbot_Config_Skins.BarText[s][frame]["AFONT"]=Healbot_Config_Skins.BarText[s][f]["AFONT"]
        Healbot_Config_Skins.BarText[s][frame]["AHEIGHT"]=Healbot_Config_Skins.BarText[s][f]["AHEIGHT"]
        Healbot_Config_Skins.BarText[s][frame]["AOUTLINE"]=Healbot_Config_Skins.BarText[s][f]["AOUTLINE"]
        Healbot_Config_Skins.BarText[s][frame]["AOFFSET"]=Healbot_Config_Skins.BarText[s][f]["AOFFSET"]
        Healbot_Config_Skins.BarText[s][frame]["AOFFSET2"]=Healbot_Config_Skins.BarText[s][f]["AOFFSET2"]
        Healbot_Config_Skins.BarTextCol[s][frame]["AGGRO"]=Healbot_Config_Skins.BarTextCol[s][f]["AGGRO"]
    elseif tab==13 then
        for x=1,9 do
            Healbot_Config_Skins.AuxBar[s][x][frame]["TEXT"]=Healbot_Config_Skins.AuxBar[s][x][f]["TEXT"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["FONT"]=Healbot_Config_Skins.AuxBarText[s][x][f]["FONT"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["HEIGHT"]=Healbot_Config_Skins.AuxBarText[s][x][f]["HEIGHT"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["ALIGN"]=Healbot_Config_Skins.AuxBarText[s][x][f]["ALIGN"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["OUTLINE"]=Healbot_Config_Skins.AuxBarText[s][x][f]["OUTLINE"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["MAXCHARS"]=Healbot_Config_Skins.AuxBarText[s][x][f]["MAXCHARS"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["OFFSET"]=Healbot_Config_Skins.AuxBarText[s][x][f]["OFFSET"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["COLTYPE"]=Healbot_Config_Skins.AuxBarText[s][x][f]["COLTYPE"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["COLR"]=Healbot_Config_Skins.AuxBarText[s][x][f]["COLR"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["COLG"]=Healbot_Config_Skins.AuxBarText[s][x][f]["COLG"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["COLB"]=Healbot_Config_Skins.AuxBarText[s][x][f]["COLB"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["COLA"]=Healbot_Config_Skins.AuxBarText[s][x][f]["COLA"]
            Healbot_Config_Skins.AuxBarText[s][x][frame]["COLDA"]=Healbot_Config_Skins.AuxBarText[s][x][f]["COLDA"]
        end
    elseif tab==14 then
        for z=1,3 do
            Healbot_Config_Skins.IconSets[s][frame][z]["DEBUFFONBAR"]=Healbot_Config_Skins.IconSets[s][f][z]["DEBUFFONBAR"]
            Healbot_Config_Skins.IconSets[s][frame][z]["DEBUFFANCHOR"]=Healbot_Config_Skins.IconSets[s][f][z]["DEBUFFANCHOR"]
            Healbot_Config_Skins.IconSets[s][frame][z]["DEBUFFDOUBLE"]=Healbot_Config_Skins.IconSets[s][f][z]["DEBUFFDOUBLE"]
            Healbot_Config_Skins.IconSets[s][frame][z]["DI15EN"]=Healbot_Config_Skins.IconSets[s][f][z]["DI15EN"]
            Healbot_Config_Skins.IconSets[s][frame][z]["DSCALE"]=Healbot_Config_Skins.IconSets[s][f][z]["DSCALE"]
            Healbot_Config_Skins.IconSets[s][frame][z]["DFADE"]=Healbot_Config_Skins.IconSets[s][f][z]["DFADE"]
            Healbot_Config_Skins.IconSets[s][frame][z]["DFADESECS"]=Healbot_Config_Skins.IconSets[s][f][z]["DFADESECS"]
            Healbot_Config_Skins.IconSets[s][frame][z]["MAXDICONS"]=Healbot_Config_Skins.IconSets[s][f][z]["MAXDICONS"]
            Healbot_Config_Skins.IconSets[s][frame][z]["DICONSPACER"]=Healbot_Config_Skins.IconSets[s][f][z]["DICONSPACER"]
            Healbot_Config_Skins.IconSets[s][frame][z]["DVOFFSET"]=Healbot_Config_Skins.IconSets[s][f][z]["DVOFFSET"]
            Healbot_Config_Skins.IconSets[s][frame][z]["DHOFFSET"]=Healbot_Config_Skins.IconSets[s][f][z]["DHOFFSET"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["DBSCNT"]=Healbot_Config_Skins.IconSetsText[s][f][z]["DBSCNT"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["DBSDUR"]=Healbot_Config_Skins.IconSetsText[s][f][z]["DBSDUR"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["DBHEIGHT"]=Healbot_Config_Skins.IconSetsText[s][f][z]["DBHEIGHT"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["DBFONT"]=Healbot_Config_Skins.IconSetsText[s][f][z]["DBFONT"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["DBOUTLINE"]=Healbot_Config_Skins.IconSetsText[s][f][z]["DBOUTLINE"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["DBDURTHRH"]=Healbot_Config_Skins.IconSetsText[s][f][z]["DBDURTHRH"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["DBDURWARN"]=Healbot_Config_Skins.IconSetsText[s][f][z]["DBDURWARN"]
        end
    elseif tab==15 then 
        for z=1,3 do
            Healbot_Config_Skins.IconSets[s][frame][z]["BUFFONBAR"]=Healbot_Config_Skins.IconSets[s][f][z]["BUFFONBAR"]
            Healbot_Config_Skins.IconSets[s][frame][z]["BUFFANCHOR"]=Healbot_Config_Skins.IconSets[s][f][z]["BUFFANCHOR"]
            Healbot_Config_Skins.IconSets[s][frame][z]["BUFFDOUBLE"]=Healbot_Config_Skins.IconSets[s][f][z]["BUFFDOUBLE"]
            Healbot_Config_Skins.IconSets[s][frame][z]["BUFFI15EN"]=Healbot_Config_Skins.IconSets[s][f][z]["BUFFI15EN"]
            Healbot_Config_Skins.IconSets[s][frame][z]["BSCALE"]=Healbot_Config_Skins.IconSets[s][f][z]["BSCALE"]
            Healbot_Config_Skins.IconSets[s][frame][z]["BUFFFADE"]=Healbot_Config_Skins.IconSets[s][f][z]["BUFFFADE"]
            Healbot_Config_Skins.IconSets[s][frame][z]["BUFFFADESECS"]=Healbot_Config_Skins.IconSets[s][f][z]["BUFFFADESECS"]
            Healbot_Config_Skins.IconSets[s][frame][z]["MAXBICONS"]=Healbot_Config_Skins.IconSets[s][f][z]["MAXBICONS"]
            Healbot_Config_Skins.IconSets[s][frame][z]["BICONSPACER"]=Healbot_Config_Skins.IconSets[s][f][z]["BICONSPACER"]
            Healbot_Config_Skins.IconSets[s][frame][z]["BVOFFSET"]=Healbot_Config_Skins.IconSets[s][f][z]["BVOFFSET"]
            Healbot_Config_Skins.IconSets[s][frame][z]["BHOFFSET"]=Healbot_Config_Skins.IconSets[s][f][z]["BHOFFSET"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["BUFFSCNT"]=Healbot_Config_Skins.IconSetsText[s][f][z]["BUFFSCNT"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["BUFFSSCNT"]=Healbot_Config_Skins.IconSetsText[s][f][z]["BUFFSSCNT"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["BUFFSDUR"]=Healbot_Config_Skins.IconSetsText[s][f][z]["BUFFSDUR"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["BUFFSSDUR"]=Healbot_Config_Skins.IconSetsText[s][f][z]["BUFFSSDUR"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["BUFFHEIGHT"]=Healbot_Config_Skins.IconSetsText[s][f][z]["BUFFHEIGHT"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["BUFFFONT"]=Healbot_Config_Skins.IconSetsText[s][f][z]["BUFFFONT"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["BUFFOUTLINE"]=Healbot_Config_Skins.IconSetsText[s][f][z]["BUFFOUTLINE"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["BUFFDURTHRH"]=Healbot_Config_Skins.IconSetsText[s][f][z]["BUFFDURTHRH"]
            Healbot_Config_Skins.IconSetsText[s][frame][z]["BUFFDURWARN"]=Healbot_Config_Skins.IconSetsText[s][f][z]["BUFFDURWARN"]
        end
    elseif tab==16 then
        Healbot_Config_Skins.Icons[s][frame]["CLASSONBAR"]=Healbot_Config_Skins.Icons[s][f]["CLASSONBAR"]
        Healbot_Config_Skins.Icons[s][frame]["TARGETONBAR"]=Healbot_Config_Skins.Icons[s][f]["TARGETONBAR"]
        Healbot_Config_Skins.Icons[s][frame]["RCONBAR"]=Healbot_Config_Skins.Icons[s][f]["RCONBAR"]
        Healbot_Config_Skins.Icons[s][frame]["OORONBAR"]=Healbot_Config_Skins.Icons[s][f]["OORONBAR"]
        Healbot_Config_Skins.Icons[s][frame]["CLASSANCHOR"]=Healbot_Config_Skins.Icons[s][f]["CLASSANCHOR"]
        Healbot_Config_Skins.Icons[s][frame]["TARGETANCHOR"]=Healbot_Config_Skins.Icons[s][f]["TARGETANCHOR"]
        Healbot_Config_Skins.Icons[s][frame]["RCANCHOR"]=Healbot_Config_Skins.Icons[s][f]["RCANCHOR"]
        Healbot_Config_Skins.Icons[s][frame]["OORANCHOR"]=Healbot_Config_Skins.Icons[s][f]["OORANCHOR"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWRC"]=Healbot_Config_Skins.Icons[s][f]["SHOWRC"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWRANK"]=Healbot_Config_Skins.Icons[s][f]["SHOWRANK"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWAFK"]=Healbot_Config_Skins.Icons[s][f]["SHOWAFK"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWHOSTILE"]=Healbot_Config_Skins.Icons[s][f]["SHOWHOSTILE"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWCOMBAT"]=Healbot_Config_Skins.Icons[s][f]["SHOWCOMBAT"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWRESTING"]=Healbot_Config_Skins.Icons[s][f]["SHOWRESTING"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWDIR"]=Healbot_Config_Skins.Icons[s][f]["SHOWDIR"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWDIRMOUSE"]=Healbot_Config_Skins.Icons[s][f]["SHOWDIRMOUSE"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWROLE"]=Healbot_Config_Skins.Icons[s][f]["SHOWROLE"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWCLASS"]=Healbot_Config_Skins.Icons[s][f]["SHOWCLASS"]
        Healbot_Config_Skins.Icons[s][frame]["TARGETVOFFSET"]=Healbot_Config_Skins.Icons[s][f]["TARGETVOFFSET"]
        Healbot_Config_Skins.Icons[s][frame]["TARGETHOFFSET"]=Healbot_Config_Skins.Icons[s][f]["TARGETHOFFSET"]
        Healbot_Config_Skins.Icons[s][frame]["TARGETSCALE"]=Healbot_Config_Skins.Icons[s][f]["TARGETSCALE"]
        Healbot_Config_Skins.Icons[s][frame]["TARGETEN"]=Healbot_Config_Skins.Icons[s][f]["TARGETEN"]
        Healbot_Config_Skins.Icons[s][frame]["CLASSVOFFSET"]=Healbot_Config_Skins.Icons[s][f]["CLASSVOFFSET"]
        Healbot_Config_Skins.Icons[s][frame]["CLASSHOFFSET"]=Healbot_Config_Skins.Icons[s][f]["CLASSHOFFSET"]
        Healbot_Config_Skins.Icons[s][frame]["CLASSSCALE"]=Healbot_Config_Skins.Icons[s][f]["CLASSSCALE"]
        Healbot_Config_Skins.Icons[s][frame]["CLASSEN"]=Healbot_Config_Skins.Icons[s][f]["CLASSEN"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWDIRMOUSE"]=Healbot_Config_Skins.Icons[s][f]["SHOWDIRMOUSE"]
        Healbot_Config_Skins.Icons[s][frame]["OORVOFFSET"]=Healbot_Config_Skins.Icons[s][f]["OORVOFFSET"]
        Healbot_Config_Skins.Icons[s][frame]["OORHOFFSET"]=Healbot_Config_Skins.Icons[s][f]["OORHOFFSET"]
        Healbot_Config_Skins.Icons[s][frame]["OORSCALE"]=Healbot_Config_Skins.Icons[s][f]["OORSCALE"]
        Healbot_Config_Skins.Icons[s][frame]["OOREN"]=Healbot_Config_Skins.Icons[s][f]["OOREN"]
        Healbot_Config_Skins.Icons[s][frame]["RCVOFFSET"]=Healbot_Config_Skins.Icons[s][f]["RCVOFFSET"]
        Healbot_Config_Skins.Icons[s][frame]["RCHOFFSET"]=Healbot_Config_Skins.Icons[s][f]["RCHOFFSET"]
        Healbot_Config_Skins.Icons[s][frame]["RCSCALE"]=Healbot_Config_Skins.Icons[s][f]["RCSCALE"]
        Healbot_Config_Skins.Icons[s][frame]["RCEN"]=Healbot_Config_Skins.Icons[s][f]["RCEN"]
        Healbot_Config_Skins.Icons[s][frame]["SHOWDIRMOUSE"]=Healbot_Config_Skins.Icons[s][f]["SHOWDIRMOUSE"]
        Healbot_Config_Skins.RaidIcon[s][frame]["SHOW"]=Healbot_Config_Skins.RaidIcon[s][f]["SHOW"]
        Healbot_Config_Skins.RaidIcon[s][frame]["STAR"]=Healbot_Config_Skins.RaidIcon[s][f]["STAR"]
        Healbot_Config_Skins.RaidIcon[s][frame]["CIRCLE"]=Healbot_Config_Skins.RaidIcon[s][f]["CIRCLE"]
        Healbot_Config_Skins.RaidIcon[s][frame]["DIAMOND"]=Healbot_Config_Skins.RaidIcon[s][f]["DIAMOND"]
        Healbot_Config_Skins.RaidIcon[s][frame]["TRIANGLE"]=Healbot_Config_Skins.RaidIcon[s][f]["TRIANGLE"]
        Healbot_Config_Skins.RaidIcon[s][frame]["MOON"]=Healbot_Config_Skins.RaidIcon[s][f]["MOON"]
        Healbot_Config_Skins.RaidIcon[s][frame]["SQUARE"]=Healbot_Config_Skins.RaidIcon[s][f]["SQUARE"]
        Healbot_Config_Skins.RaidIcon[s][frame]["CROSS"]=Healbot_Config_Skins.RaidIcon[s][f]["CROSS"]
        Healbot_Config_Skins.RaidIcon[s][frame]["SKULL"]=Healbot_Config_Skins.RaidIcon[s][f]["SKULL"]
    end

    if frame<10 then
        if tab==8 then
            Healbot_Config_Skins.BarAggro[s][frame]["ALERT"]=Healbot_Config_Skins.BarAggro[s][f]["ALERT"]
            Healbot_Config_Skins.BarAggro[s][frame]["ALERTIND"]=Healbot_Config_Skins.BarAggro[s][f]["ALERTIND"]
            Healbot_Config_Skins.BarAggro[s][frame]["TEXTFORMAT"]=Healbot_Config_Skins.BarAggro[s][f]["TEXTFORMAT"]
            Healbot_Config_Skins.BarAggro[s][frame]["SHOW"]=Healbot_Config_Skins.BarAggro[s][f]["SHOW"]
            Healbot_Config_Skins.BarAggro[s][frame]["SHOWBARS"]=Healbot_Config_Skins.BarAggro[s][f]["SHOWBARS"]
            Healbot_Config_Skins.BarAggro[s][frame]["SHOWTEXT"]=Healbot_Config_Skins.BarAggro[s][f]["SHOWTEXT"]
            Healbot_Config_Skins.BarAggro[s][frame]["SHOWBARSPCT"]=Healbot_Config_Skins.BarAggro[s][f]["SHOWBARSPCT"]
        elseif tab==17 then
            Healbot_Config_Skins.BarAggro[s][frame]["SHOWIND"]=Healbot_Config_Skins.BarAggro[s][f]["SHOWIND"]
            Healbot_Config_Skins.Indicators[s][frame]["ACOL"]=Healbot_Config_Skins.Indicators[s][f]["ACOL"]
            Healbot_Config_Skins.Indicators[s][frame]["AANCHOR"]=Healbot_Config_Skins.Indicators[s][f]["AANCHOR"]
            Healbot_Config_Skins.Indicators[s][frame]["AVOFF"]=Healbot_Config_Skins.Indicators[s][f]["AVOFF"]
            Healbot_Config_Skins.Indicators[s][frame]["AHOFF"]=Healbot_Config_Skins.Indicators[s][f]["AHOFF"]
            Healbot_Config_Skins.Indicators[s][frame]["ASIZE"]=Healbot_Config_Skins.Indicators[s][f]["ASIZE"]
            Healbot_Config_Skins.Indicators[s][frame]["ASPACE"]=Healbot_Config_Skins.Indicators[s][f]["ASPACE"]
        elseif tab==18 then
            Healbot_Config_Skins.Indicators[s][frame]["MCOL"]=Healbot_Config_Skins.Indicators[s][f]["MCOL"]
            Healbot_Config_Skins.Indicators[s][frame]["MANCHOR"]=Healbot_Config_Skins.Indicators[s][f]["MANCHOR"]
            Healbot_Config_Skins.Indicators[s][frame]["MVOFF"]=Healbot_Config_Skins.Indicators[s][f]["MVOFF"]
            Healbot_Config_Skins.Indicators[s][frame]["MHOFF"]=Healbot_Config_Skins.Indicators[s][f]["MHOFF"]
            Healbot_Config_Skins.Indicators[s][frame]["MSIZE"]=Healbot_Config_Skins.Indicators[s][f]["MSIZE"]
            Healbot_Config_Skins.Indicators[s][frame]["MSPACE"]=Healbot_Config_Skins.Indicators[s][f]["MSPACE"]
        elseif tab==22 then
            Healbot_Config_Skins.IconText[s][frame]["SELFIND"]=Healbot_Config_Skins.IconText[s][f]["SELFIND"]
            Healbot_Config_Skins.Indicators[s][frame]["SCOL"]=Healbot_Config_Skins.Indicators[s][f]["SCOL"]
            Healbot_Config_Skins.Indicators[s][frame]["SANCHOR"]=Healbot_Config_Skins.Indicators[s][f]["SANCHOR"]
            Healbot_Config_Skins.Indicators[s][frame]["SVOFF"]=Healbot_Config_Skins.Indicators[s][f]["SVOFF"]
            Healbot_Config_Skins.Indicators[s][frame]["SHOFF"]=Healbot_Config_Skins.Indicators[s][f]["SHOFF"]
            Healbot_Config_Skins.Indicators[s][frame]["SSIZE"]=Healbot_Config_Skins.Indicators[s][f]["SSIZE"]
        elseif tab==19 then
            Healbot_Config_Skins.HealBar[s][frame]["POWERCNT"]=Healbot_Config_Skins.HealBar[s][f]["POWERCNT"]
            Healbot_Config_Skins.Indicators[s][frame]["PCOL"]=Healbot_Config_Skins.Indicators[s][f]["PCOL"]
            Healbot_Config_Skins.Indicators[s][frame]["PANCHOR"]=Healbot_Config_Skins.Indicators[s][f]["PANCHOR"]
            Healbot_Config_Skins.Indicators[s][frame]["PVOFF"]=Healbot_Config_Skins.Indicators[s][f]["PVOFF"]
            Healbot_Config_Skins.Indicators[s][frame]["PHOFF"]=Healbot_Config_Skins.Indicators[s][f]["PHOFF"]
            Healbot_Config_Skins.Indicators[s][frame]["PSIZE"]=Healbot_Config_Skins.Indicators[s][f]["PSIZE"]
            Healbot_Config_Skins.Indicators[s][frame]["PSPACE"]=Healbot_Config_Skins.Indicators[s][f]["PSPACE"]
        elseif tab==20 then
            Healbot_Config_Skins.Emerg[s][frame]["USE"]=Healbot_Config_Skins.Emerg[s][f]["USE"]
            Healbot_Config_Skins.Emerg[s][frame]["TEXTURE"]=Healbot_Config_Skins.Emerg[s][f]["TEXTURE"]
            Healbot_Config_Skins.Emerg[s][frame]["ANCHOR"]=Healbot_Config_Skins.Emerg[s][f]["ANCHOR"]
            Healbot_Config_Skins.Emerg[s][frame]["VOFFSET"]=Healbot_Config_Skins.Emerg[s][f]["VOFFSET"]
            Healbot_Config_Skins.Emerg[s][frame]["HOFFSET"]=Healbot_Config_Skins.Emerg[s][f]["HOFFSET"]
            Healbot_Config_Skins.Emerg[s][frame]["HEIGHT"]=Healbot_Config_Skins.Emerg[s][f]["HEIGHT"]
            Healbot_Config_Skins.Emerg[s][frame]["WIDTH"]=Healbot_Config_Skins.Emerg[s][f]["WIDTH"]
        elseif tab==21 then
            Healbot_Config_Skins.Emerg[s][frame]["A"]=Healbot_Config_Skins.Emerg[s][f]["A"]
            Healbot_Config_Skins.Emerg[s][frame]["DA"]=Healbot_Config_Skins.Emerg[s][f]["DA"]
            Healbot_Config_Skins.Emerg[s][frame]["CRITICAL"]=Healbot_Config_Skins.Emerg[s][f]["CRITICAL"]
            Healbot_Config_Skins.Emerg[s][frame]["INJURED"]=Healbot_Config_Skins.Emerg[s][f]["INJURED"]
            Healbot_Config_Skins.Emerg[s][frame]["BUFFBARCOL"]=Healbot_Config_Skins.Emerg[s][f]["BUFFBARCOL"]
            Healbot_Config_Skins.Emerg[s][frame]["DEBUFFBARCOL"]=Healbot_Config_Skins.Emerg[s][f]["DEBUFFBARCOL"]
            Healbot_Config_Skins.Emerg[s][frame]["CR"]=Healbot_Config_Skins.Emerg[s][f]["CR"]
            Healbot_Config_Skins.Emerg[s][frame]["CG"]=Healbot_Config_Skins.Emerg[s][f]["CG"]
            Healbot_Config_Skins.Emerg[s][frame]["CB"]=Healbot_Config_Skins.Emerg[s][f]["CB"]
            Healbot_Config_Skins.Emerg[s][frame]["IR"]=Healbot_Config_Skins.Emerg[s][f]["IR"]
            Healbot_Config_Skins.Emerg[s][frame]["IG"]=Healbot_Config_Skins.Emerg[s][f]["IG"]
            Healbot_Config_Skins.Emerg[s][frame]["IB"]=Healbot_Config_Skins.Emerg[s][f]["IB"]
            Healbot_Config_Skins.Emerg[s][frame]["HR"]=Healbot_Config_Skins.Emerg[s][f]["HR"]
            Healbot_Config_Skins.Emerg[s][frame]["HG"]=Healbot_Config_Skins.Emerg[s][f]["HG"]
            Healbot_Config_Skins.Emerg[s][frame]["HB"]=Healbot_Config_Skins.Emerg[s][f]["HB"]
            Healbot_Config_Skins.Emerg[s][frame]["BARCOL"]=Healbot_Config_Skins.Emerg[s][f]["BARCOL"]
        end
    end
end

function HealBot_Options_CopyOptionsCopy()
    local g, h
    local tab5, tab9, tab16 =false, false, false
    for x=1,9 do
        g=_G["HealBot_Options_CopyFrame"..x]
        if g:GetChecked() then
            for y=1,23 do
                h=_G["HealBot_Options_CopyTab"..y]
                if h:GetChecked() then
                    HealBot_Options_CopyTab2Frames(hbCopyFrameIdx[x], y)
                    if y==5 then tab5=true end
                    if y==9 then tab9=true end
                    if y==16 then tab16=true end
                end
            end
        end
    end
    if tab5 and HealBot_Options_luVars["TestBarsOn"] then HealBot_Panel_resetTestCols(true) end
    if tab9 and HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsAux" then HealBot_Aux_resetBars() end
    if tab16 then
        HealBot_Aura_RemoveExtraIcons(91)
        HealBot_Aura_RemoveExtraIcons(92)
        HealBot_Aura_RemoveExtraIcons(93)
        HealBot_Aura_RemoveExtraIcons(94)
        HealBot_Timers_Set("SKINS","SetSkinBars")
        HealBot_Timers_Set("SKINS","SetSkinText")
        HealBot_Timers_Set("AURA","RaidTargetUpdateAll",0.2)
    end
    HealBot_Timers_Set("SKINS","AllFramesChanged")
    HealBot_Options_ShowSkinsPanel("BACK", 0)
end

--------------------------------------------------------------------------------
local function HealBot_Options_ManaIndicator_DropDown(dropDown, level, menuList)
    local info = UIDropDownMenu_CreateInfo()
    if HealBot_Options_luVars["FramesSelFrame"]>9 then
        info.text = " "
        UIDropDownMenu_AddButton(info);
    else
        for j=1, getn(HealBot_Options_ManaIndicator_List), 1 do
            info.text = HealBot_Options_ManaIndicator_List[j];
         --   info.func = HealBot_Options_ManaIndicator_OnSelect;
            info.func = function(self)
                            if Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["LOWMANA"]~=self:GetID() then
                                Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["LOWMANA"] = self:GetID()
                                UIDropDownMenu_SetSelectedID(HealBot_Options_ManaIndicator,Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["LOWMANA"]) 
                                HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
                                HealBot_Timers_Set("LAST","LowManaTrig")
                            end
                        end
            info.checked = false;
            if Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["LOWMANA"]==j then info.checked = true end
            UIDropDownMenu_AddButton(info);
        end
    end
end

function HealBot_Options_AggroIndColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IndicatorCol"]), 1 do
        info.text = HealBot_Options_Lists["IndicatorCol"][j]
        info.func = function(self)
                        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACOL"]~=self:GetID() then
                            Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACOL"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_AggroIndColour, HealBot_Options_Lists["IndicatorCol"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACOL"]])
                            HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACOL"]==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_SelfCastIndColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IndicatorCol"]), 1 do
        info.text = HealBot_Options_Lists["IndicatorCol"][j]
        info.func = function(self)
                        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCOL"]~=self:GetID() then
                            Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCOL"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_SelfCastIndColour, HealBot_Options_Lists["IndicatorCol"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCOL"]])
                            HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
                            HealBot_Timers_setLuVars("UpdateAllBuffIcons", true)
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCOL"]==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_LowManaIndColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IndicatorCol"]), 1 do
        info.text = HealBot_Options_Lists["IndicatorCol"][j]
        info.func = function(self)
                        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MCOL"]~=self:GetID() then
                            Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MCOL"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_LowManaIndColour, HealBot_Options_Lists["IndicatorCol"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MCOL"]])
                            HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MCOL"]==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_PowerIndColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IndicatorCol"]), 1 do
        info.text = HealBot_Options_Lists["IndicatorCol"][j]
        info.func = function(self)
                        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PCOL"]~=self:GetID() then
                            Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PCOL"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_PowerIndColour, HealBot_Options_Lists["IndicatorCol"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PCOL"]])
                            HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
                            HealBot_Timers_Set("SKINS","PowerIndicator")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PCOL"]==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AggroIndAnchor_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AggroIndAnchor"]), 1 do
        info.text = HealBot_Options_Lists["AggroIndAnchor"][j]
        info.func = function(self)
                        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AANCHOR"]~=self:GetID() then
                            Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AANCHOR"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_AggroIndAnchor, HealBot_Options_Lists["AggroIndAnchor"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AANCHOR"]])
                            HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AANCHOR"]==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_SelfCastIndAnchor_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AggroIndAnchor"]), 1 do
        info.text = HealBot_Options_Lists["AggroIndAnchor"][j]
        info.func = function(self)
                        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SANCHOR"]~=self:GetID() then
                            Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SANCHOR"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_SelfCastIndAnchor, HealBot_Options_Lists["AggroIndAnchor"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SANCHOR"]])
                            HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
                            HealBot_Timers_setLuVars("UpdateAllBuffIcons", true)
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SANCHOR"]==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_LowManaIndAnchor_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IndicatorAnchor"]), 1 do
        info.text = HealBot_Options_Lists["IndicatorAnchor"][j]
        info.func = function(self)
                        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MANCHOR"]~=self:GetID() then
                            Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MANCHOR"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_LowManaIndAnchor, HealBot_Options_Lists["IndicatorAnchor"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MANCHOR"]])
                            HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MANCHOR"]==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_PowerIndAnchor_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["IndicatorAnchor"]), 1 do
        info.text = HealBot_Options_Lists["IndicatorAnchor"][j]
        info.func = function(self)
                        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PANCHOR"]~=self:GetID() then
                            Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PANCHOR"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_PowerIndAnchor, HealBot_Options_Lists["IndicatorAnchor"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PANCHOR"]])
                            HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
                            HealBot_Timers_Set("SKINS","PowerIndicator")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PANCHOR"]==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AggroIndVOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AVOFF"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AVOFF"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
    end
end

function HealBot_Options_SelfCastIndVOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SVOFF"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SVOFF"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
        HealBot_Timers_setLuVars("UpdateAllBuffIcons", true)
    end
end

function HealBot_Options_LowManaIndVOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MVOFF"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MVOFF"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
    end
end

function HealBot_Options_PowerIndVOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PVOFF"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PVOFF"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
        HealBot_Timers_Set("SKINS","PowerIndicator")
    end
end

function HealBot_Options_AggroIndHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AHOFF"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AHOFF"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
    end
end

function HealBot_Options_SelfCastIndHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOFF"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOFF"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
        HealBot_Timers_setLuVars("UpdateAllBuffIcons", true)
    end
end

function HealBot_Options_LowManaIndHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MHOFF"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MHOFF"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
    end
end

function HealBot_Options_PowerIndHOffset_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PHOFF"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PHOFF"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
        HealBot_Timers_Set("SKINS","PowerIndicator")
    end
end

function HealBot_Options_AggroIndSize_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ASIZE"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ASIZE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
    end
end

function HealBot_Options_SelfCastIndSize_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSIZE"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSIZE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
        HealBot_Timers_setLuVars("UpdateAllBuffIcons", true)
    end
end

function HealBot_Options_LowManaIndSize_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MSIZE"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MSIZE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
    end
end

function HealBot_Options_PowerIndSize_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PSIZE"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PSIZE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
        HealBot_Timers_Set("SKINS","PowerIndicator")
    end
end

function HealBot_Options_AggroIndSpace_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ASPACE"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ASPACE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
    end
end

function HealBot_Options_LowManaIndSpace_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MSPACE"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MSPACE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
    end
end
function HealBot_Options_PowerIndSpace_OnValueChanged(self)
    local val=floor(self:GetValue()+0.5)
    if val~=self:GetValue() then
        self:SetValue(val) 
    elseif Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PSPACE"]~=val then
        Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PSPACE"] = val;
        local g=_G[self:GetName().."Text"]
        g:SetText(self.text .. ": " .. val);
        HealBot_Timers_Set("SKINS","IndicatorFramesChanged")
        HealBot_Timers_Set("SKINS","PowerIndicator")
    end
end

--------------------------------------------------------------------------------

HealBot_Options_luVars["FilterHoTctlName"]=HealBot_Options_FilterHoTctl_List[1]
HealBot_Options_luVars["FilterHoTctlNameTrim"]=HealBot_Class_En[HealBot_Options_luVars["FilterHoTctlName"]]
HealBot_Options_luVars["FilterHoTctlID"]=1
HealBot_Options_luVars["HoTindex"]=1
HealBot_Options_luVars["HoTname"]=""

function HealBot_Options_Class_HoTctlName_genList()
--    local class=nil
    local tmpHoTctlName_List={}

    local hbClassHoTwatch=HealBot_Globals.WatchHoT
    for xClass,_  in pairs(hbClassHoTwatch) do
        if HealBot_Class_En[HealBot_Options_luVars["FilterHoTctlName"]]==xClass then
            local HealBot_configClassHoTClass=HealBot_Globals.WatchHoT[xClass]
            for bId,_  in pairs(HealBot_configClassHoTClass) do
                local bName=HealBot_Options_CDebuffTextID(bId) or " "
                if tonumber(bName) == nil then
                    table.insert(tmpHoTctlName_List, bName)
                else
                    HealBot_Options_DeleteBuffHoT(xClass, bId, bName)
                end
            end
        end
    end
    table.sort(tmpHoTctlName_List)
    local x=nil
    for j=1, getn(tmpHoTctlName_List), 1 do
        if tmpHoTctlName_List[j]==HealBot_Options_luVars["HoTname"] then
            HealBot_Options_luVars["HoTindex"]=j
            x=true
            break
        end
    end
    if not x then HealBot_Options_luVars["HoTindex"]=1 end
    HealBot_Options_luVars["HoTname"]=tmpHoTctlName_List[HealBot_Options_luVars["HoTindex"]]
    return tmpHoTctlName_List
end

function HealBot_Options_SpellGetName(id)
    local sName=id
    local sId=HealBot_Options_CDebuffGetId(id)
    if sId then
        local name, _, _, _, _, _, spellId = GetSpellInfo(sId)
        if name and spellId then sName=name end
    end
    return sName
end

function HealBot_Options_ResetBuff()
    local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
    if sId then
        local sName=HealBot_Options_SpellGetName(sId)
        HealBot_Options_DeleteBuffHoTBtn_OnClick()
        HealBot_Options_NewHoTBuffBtn_OnClick(sName)
        HealBot_Options_ResetUpdate()
        HealBot_SetBuffBarColours();
    end
end

HealBot_Options_luVars["numCustomBuffs"]=0
function HealBot_Options_BuffCatNameUpdate()
    if HealBot_Options_luVars["numCustomBuffs"]>0 then
        HealBot_Options_DeleteBuffHoTBtn:Enable();
        HealBot_Options_ResetBuffBtn:Enable();
        HealBot_BuffCustomColorpickb:Enable()
        HealBot_Options_BuffHoTPresetColour:Enable()
        HealBot_Options_HoTctlActionCustom:Hide()
        HealBot_Options_HoTctlIDMethodCustom:Hide()
        HealBot_Options_BuffPriorityCustom:Hide()
        HealBot_Options_CustomBuffColCustom:Hide()
        HealBot_Options_CustomBuffIconGlowCustom:Hide()
        HealBot_Options_BuffIconSetCustom:Hide()
        HealBot_Options_BuffIconSet:Show()
        HealBot_Options_Class_HoTctlAction:Show()
        HealBot_Options_Class_HoTctlIDMethod:Show()
        HealBot_Options_BuffPriorityC:Show()
        HealBot_Options_CustomBuffCol:Show()
        HealBot_Options_CustomBuffIconGlow:Show()
    else
        HealBot_Options_DeleteBuffHoTBtn:Disable();
        HealBot_Options_ResetBuffBtn:Disable();
        HealBot_BuffCustomColorpickb:Disable()
        HealBot_Options_BuffHoTPresetColour:Disable()
        HealBot_Options_Class_HoTctlAction:Hide()
        HealBot_Options_Class_HoTctlIDMethod:Hide()
        HealBot_Options_BuffPriorityC:Hide()
        HealBot_Options_CustomBuffCol:Hide()
        HealBot_Options_CustomBuffIconGlow:Hide()
        HealBot_Options_BuffIconSet:Hide()
        HealBot_Options_HoTctlActionCustom:Show()
        HealBot_Options_HoTctlIDMethodCustom:Show()
        HealBot_Options_BuffIconSetCustom:Show()
        HealBot_Options_BuffPriorityCustom:Show()
        HealBot_Options_CustomBuffColCustom:Show()
        HealBot_Options_CustomBuffIconGlowCustom:Show()
    end
end

function HealBot_Options_Class_HoTctlName_DropDown(self, level, menuList)
    local info = UIDropDownMenu_CreateInfo()
    local HoTctlName_List = HealBot_Options_Class_HoTctlName_genList()
    if getn(HoTctlName_List) > 10 then
        if level == 1 then
            for j=1, ceil(getn(HoTctlName_List)/10), 1 do
                local n=j*10
                if n > getn(HoTctlName_List) then n=getn(HoTctlName_List) end
                info.text = "    "..((j*10)-9).." - "..n;
                info.hasArrow = true
                info.notCheckable = true
                info.menuList = j, true, j
                UIDropDownMenu_AddButton(info)
            end
        else 
            local n=menuList*10
            if n > getn(HoTctlName_List) then n=getn(HoTctlName_List) end
            for j=((menuList*10)-9), n, 1 do
                info.text = HoTctlName_List[j];
                info.func = function(self)
                                if HealBot_Options_luVars["HoTindex"]~=self:GetID() or HealBot_Options_luVars["HoTlvl"]~=menuList then
                                    HealBot_Options_luVars["HoTlvl"]=menuList
                                    HealBot_Options_luVars["HoTindex"] = self:GetID()
                                    HealBot_Options_luVars["HoTname"] = self:GetText()
                                    UIDropDownMenu_SetText(HealBot_Options_Class_HoTctlName, HealBot_Options_luVars["HoTname"])
                                    HealBot_Options_ResetUpdate()
                                end
                            end
                info.checked = false;
                if HealBot_Options_luVars["HoTname"]==HoTctlName_List[j] then info.checked = true; end
                UIDropDownMenu_AddButton(info, level);
            end
        end
    else
        for j=1, getn(HoTctlName_List), 1 do
            info.text = HoTctlName_List[j];
            info.func = function(self)
                            if HealBot_Options_luVars["HoTindex"]~=self:GetID() then
                                HealBot_Options_luVars["HoTindex"] = self:GetID()
                                HealBot_Options_luVars["HoTname"] = self:GetText()
                                UIDropDownMenu_SetText(HealBot_Options_Class_HoTctlName, HealBot_Options_luVars["HoTname"])
                                HealBot_Options_ResetUpdate()
                            end
                        end
            info.checked = false;
            if HealBot_Options_luVars["HoTname"]==HoTctlName_List[j] then info.checked = true; end
            UIDropDownMenu_AddButton(info);
        end
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_Class_HoTctlIDMethod_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Class_HoTctlIDMethod_List), 1 do
        info.text = HealBot_Options_Class_HoTctlIDMethod_List[j]
        info.func = function(self)
                        local y=self:GetID()
                        local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
                        if y<3 then
                            HealBot_Globals.CustomBuffIDMethod[sId]=y
                        else
                            HealBot_Globals.CustomBuffIDMethod[sId]=nil
                        end
                        UIDropDownMenu_SetText(HealBot_Options_Class_HoTctlIDMethod,HealBot_Options_Class_HoTctlIDMethod_List[j])
                        HealBot_Timers_Set("AURA","ConfigClassHoT")
                        HealBot_Timers_Set("AURA","ResetBuffCache")
                    end
        info.checked = false;
        local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"]) or 0
        if (HealBot_Globals.CustomBuffIDMethod[sId] or 3)==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
    --HealBot_Options_BuffCatNameUpdate()
end

function HealBot_Options_Class_HoTctlAction_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Class_HoTctlAction_List), 1 do
        if HealBot_Options_Class_HoTctlAction_List[j] then
            info.text = HealBot_Options_Class_HoTctlAction_List[j]
            info.func = function(self)
                            local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
                            if sId then
                                HealBot_Globals.WatchHoT[HealBot_Options_luVars["FilterHoTctlNameTrim"]][sId]=self:GetID()
                                UIDropDownMenu_SetText(HealBot_Options_Class_HoTctlAction,HealBot_Options_Class_HoTctlAction_List[j]) 
                                HealBot_Timers_Set("AURA","ConfigClassHoT")
                                HealBot_Timers_Set("AURA","ResetBuffCache")
                            end
                        end
            info.checked = false;
            if HealBot_Options_luVars["FilterHoTctlNameTrim"] and HealBot_Globals.WatchHoT[HealBot_Options_luVars["FilterHoTctlNameTrim"]] then
                local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
                if sId then
                    local x=HealBot_Globals.WatchHoT[HealBot_Options_luVars["FilterHoTctlNameTrim"]][sId] or 1
                    if x==j then info.checked = true; end 
                end
            end
            UIDropDownMenu_AddButton(info);
        end
    end
    HealBot_Options_BuffCatNameUpdate()
end

function HealBot_Options_BuffAuto_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["BuffsCustomAuto"]), 1 do
        info.text = HealBot_Options_Lists["BuffsCustomAuto"][j]
        info.func = function(self)
                        HealBot_Config_Buffs.AutoBuff=self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BuffAuto,HealBot_Options_Lists["BuffsCustomAuto"][j])
                        HealBot_Timers_Set("AURA","ResetBuffCache")
                    end
        info.checked = false;
        if HealBot_Config_Buffs.AutoBuff==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
    --HealBot_Options_BuffCatNameUpdate()
end

function HealBot_Options_BuffAutoCastBy_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["BuffsCustomAutoCastBy"]), 1 do
        info.text = HealBot_Options_Lists["BuffsCustomAutoCastBy"][j]
        info.func = function(self)
                        HealBot_Config_Buffs.AutoBuffCastBy=self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_BuffAutoCastBy,HealBot_Options_Lists["BuffsCustomAutoCastBy"][j])
                        HealBot_Timers_Set("AURA","ResetBuffCache")
                    end
        info.checked = false;
        if HealBot_Config_Buffs.AutoBuffCastBy==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_DebuffSort_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AuraCustomSort"]), 1 do
        info.text = HealBot_Options_Lists["AuraCustomSort"][j]
        info.func = function(self)
                        if HealBot_Config_Cures.ListSortOrder~=self:GetID() then
                            HealBot_Config_Cures.ListSortOrder=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_DebuffSort,HealBot_Options_Lists["AuraCustomSort"][j])
                            HealBot_Timers_Set("AURA","CustomDebuffListPrep")
                        end
                    end
        info.checked = false;
        if HealBot_Config_Cures.ListSortOrder==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BuffSort_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AuraCustomSort"]), 1 do
        info.text = HealBot_Options_Lists["AuraCustomSort"][j]
        info.func = function(self)
                        if HealBot_Config_Buffs.ListSortOrder~=self:GetID() then
                            HealBot_Config_Buffs.ListSortOrder=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BuffSort,HealBot_Options_Lists["AuraCustomSort"][j])
                            HealBot_Timers_Set("AURA","CustomBuffListPrep")
                        end
                    end
        info.checked = false;
        if HealBot_Config_Buffs.ListSortOrder==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_DebuffFilter_TagList()
    local tagList={}
    local tagListSeen={}
    for _,tag in pairs(HealBot_Globals.CDCTag) do
        if string.len(tag)>0 and not tagListSeen[tag] then
            tagListSeen[tag]=true
            table.insert(tagList, tag)
        end
    end
    table.sort(tagList)
    return tagList
end

function HealBot_Options_DebuffFilter_DropDown(self, level, menuList)
    local info = UIDropDownMenu_CreateInfo()
    info.keepShownOnClick=false
    if level==1 then
        info.text = HEALBOT_WORDS_NONE
        info.func = function(self)
                        if HealBot_Config_Cures.ListSortFilter~=self:GetID() then
                            HealBot_Config_Cures.ListSortFilter=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_DebuffFilter, HEALBOT_WORDS_NONE)
                            HealBot_Timers_Set("AURA","CustomDebuffListPrep")
                        end
                    end
                    if HealBot_Config_Cures.ListSortFilter==1 then info.checked = true end 
        UIDropDownMenu_AddButton(info)
        wipe(info)    
        info.disabled = true
        info.notCheckable = true
        UIDropDownMenu_AddButton(info)
        info.disabled = false
        info.hasArrow = true
        info.keepShownOnClick=false
        info.text = "     "..HEALBOT_WORD_PRIORITY
        info.menuList = 1
        UIDropDownMenu_AddButton(info)
        info.text = "     "..HEALBOT_WORD_TAG
        info.menuList = 2
        UIDropDownMenu_AddButton(info)
    elseif menuList == 1 then
        for j=1, getn(HealBot_Options_Lists["AuraCustomFilter"]), 1 do
            info.text = HealBot_Options_Lists["AuraCustomFilter"][j]
            info.func = function(self)
                        if HealBot_Config_Cures.ListSortFilter~=(self:GetID()+1) then
                            HealBot_Config_Cures.ListSortFilter=(self:GetID()+1)
                            UIDropDownMenu_SetText(HealBot_Options_DebuffFilter, HealBot_Options_Lists["AuraCustomFilter"][j])
                            HealBot_Timers_Set("AURA","CustomDebuffListPrep")
                        end
                    end
            info.checked = false;
            if HealBot_Config_Cures.ListSortFilter==j+1 then info.checked = true; end 
            UIDropDownMenu_AddButton(info, level)
        end
    elseif menuList == 2 then
        local tags=HealBot_Options_DebuffFilter_TagList()
        for j=1, getn(tags), 1 do
            info.text = tags[j]
            info.func = function(self)
                            if HealBot_Config_Cures.ListSortFilter<7 or HealBot_Config_Cures.ListSortFilterTag~=self:GetText() then
                                HealBot_Config_Cures.ListSortFilter=7
                                HealBot_Config_Cures.ListSortFilterTag=self:GetText()
                                UIDropDownMenu_SetText(HealBot_Options_DebuffFilter, HealBot_Config_Cures.ListSortFilterTag)
                                HealBot_Timers_Set("AURA","CustomDebuffListPrep")
                            end
                        end
            info.checked = false;
            if HealBot_Config_Cures.ListSortFilter==7 and HealBot_Config_Cures.ListSortFilterTag==tags[j] then info.checked = true; end 
            UIDropDownMenu_AddButton(info, level)
        end
    end
end

function HealBot_Options_BuffFilter_TagList()
    local tagList={}
    local tagListSeen={}
    for _,tag in pairs(HealBot_Globals.CustomBuffTag) do
        if string.len(tag)>0 and not tagListSeen[tag] then
            tagListSeen[tag]=true
            table.insert(tagList, tag)
        end
    end
    table.sort(tagList)
    return tagList
end

function HealBot_Options_BuffFilter_DropDown(self, level, menuList)
    local info = UIDropDownMenu_CreateInfo()
    info.keepShownOnClick=false
    if level==1 then
        info.text = HEALBOT_WORDS_NONE
        info.func = function(self)
                        if HealBot_Config_Buffs.ListSortFilter~=self:GetID() then
                            HealBot_Config_Buffs.ListSortFilter=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BuffFilter, HEALBOT_WORDS_NONE)
                            HealBot_Timers_Set("AURA","CustomBuffListPrep")
                        end
                    end
                    if HealBot_Config_Buffs.ListSortFilter==1 then info.checked = true end 
        UIDropDownMenu_AddButton(info)
        wipe(info)    
        info.disabled = true
        info.notCheckable = true
        UIDropDownMenu_AddButton(info)
        info.disabled = false
        info.hasArrow = true
        info.keepShownOnClick=false
        info.text = "     "..HEALBOT_WORD_PRIORITY
        info.menuList = 1
        UIDropDownMenu_AddButton(info)
        info.text = "     "..HEALBOT_WORD_TAG
        info.menuList = 2
        UIDropDownMenu_AddButton(info)
    elseif menuList == 1 then
        for j=1, getn(HealBot_Options_Lists["AuraCustomFilter"]), 1 do
            info.text = HealBot_Options_Lists["AuraCustomFilter"][j]
            info.func = function(self)
                        if HealBot_Config_Buffs.ListSortFilter~=(self:GetID()+1) then
                            HealBot_Config_Buffs.ListSortFilter=(self:GetID()+1)
                            UIDropDownMenu_SetText(HealBot_Options_BuffFilter, HealBot_Options_Lists["AuraCustomFilter"][j])
                            HealBot_Timers_Set("AURA","CustomBuffListPrep")
                        end
                    end
            info.checked = false;
            if HealBot_Config_Buffs.ListSortFilter==j+1 then info.checked = true; end 
            UIDropDownMenu_AddButton(info, level)
        end
    elseif menuList == 2 then
        local tags=HealBot_Options_BuffFilter_TagList()
        for j=1, getn(tags), 1 do
            info.text = tags[j]
            info.func = function(self)
                            if HealBot_Config_Buffs.ListSortFilter<7 or HealBot_Config_Buffs.ListSortFilterTag~=self:GetText() then
                                HealBot_Config_Buffs.ListSortFilter=7
                                HealBot_Config_Buffs.ListSortFilterTag=self:GetText()
                                UIDropDownMenu_SetText(HealBot_Options_BuffFilter, HealBot_Config_Buffs.ListSortFilterTag)
                                HealBot_Timers_Set("AURA","CustomBuffListPrep")
                            end
                        end
            info.checked = false;
            if HealBot_Config_Buffs.ListSortFilter==7 and HealBot_Config_Buffs.ListSortFilterTag==tags[j] then info.checked = true; end 
            UIDropDownMenu_AddButton(info, level)
        end
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_FilterHoTctl_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    table.sort(HealBot_Options_FilterHoTctl_List)
    for j=1, getn(HealBot_Options_FilterHoTctl_List), 1 do
        info.text = HealBot_Options_FilterHoTctl_List[j];
        info.func = function(self)
                        if HealBot_Options_luVars["FilterHoTctlName"]~=self.value then
                            HealBot_Options_luVars["FilterHoTctlName"]=self.value
                            HealBot_Options_luVars["FilterHoTctlID"]=self:GetID()
                            HealBot_Options_luVars["FilterHoTctlNameTrim"]=HealBot_Class_En[HealBot_Options_luVars["FilterHoTctlName"]]
                            UIDropDownMenu_SetText(HealBot_Options_FilterHoTctl,HealBot_Options_luVars["FilterHoTctlName"]) 
                            HealBot_Options_ResetUpdate()
                        end
                    end
        info.checked = false;
        if HealBot_Options_luVars["FilterHoTctlName"]==HealBot_Options_FilterHoTctl_List[j] then info.checked = true; end
        UIDropDownMenu_AddButton(info);
    end
end


HealBot_Options_luVars["custombufftextpage"]=1
local hbCustomBuffList = {}
local hbCustomBuffOrder = {}
local hbCustomBuffIDs = {}
function HealBot_Options_sortCustomBuffList(bID, bName, prio)
    if not hbCustomBuffList[bID] then hbCustomBuffList[bID]={} end
    hbCustomBuffList[bID]["Prio"]=prio
    hbCustomBuffList[bID]["Name"]=GetSpellInfo(bID) or bName
    if HealBot_Globals.CustomBuffTag[bID] and string.len(HealBot_Globals.CustomBuffTag[bID])>0 then
        hbCustomBuffList[bID]["Tag"]=HealBot_Globals.CustomBuffTag[bID]
    else
        hbCustomBuffList[bID]["Tag"]=""
    end
    if HealBot_Config_Buffs.ListSortOrder==1 then  -- Prio
        if prio<10 then
            hbCustomBuffOrder[bID]="0"..prio..bName
        else
            hbCustomBuffOrder[bID]=prio..bName
        end
    elseif HealBot_Config_Buffs.ListSortOrder==2 then  -- Name
        hbCustomBuffOrder[bID]=bName
    else  -- Tag
        if prio<10 then
            hbCustomBuffOrder[bID]=hbCustomBuffList[bID]["Tag"].."0"..prio..bName
        else
            hbCustomBuffOrder[bID]=hbCustomBuffList[bID]["Tag"]..prio..bName
        end
    end
    table.insert(hbCustomBuffIDs, bID)
end

function HealBot_Options_prepCustomBuffList()
    local dName, dTag="", ""
    local cusPrio=nil
    local hbClassHoTwatch=HealBot_Globals.WatchHoT
    for x,_ in pairs(hbCustomBuffIDs) do
        hbCustomBuffIDs[x]=nil;
    end
    for xClass,_  in pairs(hbClassHoTwatch) do
        local HealBot_configClassHoTClass=HealBot_Globals.WatchHoT[xClass]
        for bID,_  in pairs(HealBot_configClassHoTClass) do
            local bName=HealBot_Options_CDebuffTextID(bID)
            if tonumber(bName) == nil then
                if bName==HEALBOT_CUSTOM_CAT_CUSTOM_AUTOMATIC then bID="Auto" end
                cusPrio=HealBot_Globals.HealBot_Custom_Buffs[bID] or 20
                if HealBot_Config_Buffs.ListSortFilter==1 then
                    HealBot_Options_sortCustomBuffList(bID, bName, cusPrio)
                elseif HealBot_Config_Buffs.ListSortFilter==2 then
                    if cusPrio<5 then
                        HealBot_Options_sortCustomBuffList(bID, bName, cusPrio)
                    end
                elseif HealBot_Config_Buffs.ListSortFilter==3 then
                    if cusPrio>4 and cusPrio<9 then
                        HealBot_Options_sortCustomBuffList(bID, bName, cusPrio)
                    end
                elseif HealBot_Config_Buffs.ListSortFilter==4 then
                    if cusPrio>8 and cusPrio<13 then
                        HealBot_Options_sortCustomBuffList(bID, bName, cusPrio)
                    end
                elseif HealBot_Config_Buffs.ListSortFilter==5 then
                    if cusPrio>12 and cusPrio<17 then
                        HealBot_Options_sortCustomBuffList(bID, bName, cusPrio)
                    end
                elseif HealBot_Config_Buffs.ListSortFilter==6 then
                    if cusPrio>16 then
                        HealBot_Options_sortCustomBuffList(bID, bName, cusPrio)
                    end
                elseif HealBot_Globals.CustomBuffTag[bID] and strtrim(HealBot_Config_Buffs.ListSortFilterTag)==strtrim(HealBot_Globals.CustomBuffTag[bID]) then
                    HealBot_Options_sortCustomBuffList(bID, bName, cusPrio)
                end
            else
                HealBot_Options_DeleteBuffHoT(xClass, bID, bName)
            end
        end
    end
    table.sort(hbCustomBuffIDs,function (a,b)
        if not hbCustomBuffOrder[a] or not hbCustomBuffOrder[b] then
            return false
        else
            if hbCustomBuffOrder[a]<hbCustomBuffOrder[b] then return true end
            if hbCustomBuffOrder[a]>hbCustomBuffOrder[b] then return false end
            if type(a)==type(b) then
                return a<b
            else
                return false
            end
        end
    end)
    HealBot_Options_setCustomBuffList()
end

function HealBot_Options_setCustomBuffList()
    local startEntry=((HealBot_Options_luVars["custombufftextpage"]-1)*15)+1
    local endEntry=HealBot_Options_luVars["custombufftextpage"]*15
    local x=1
    for j=startEntry,endEntry do
        x=(j-((HealBot_Options_luVars["custombufftextpage"]-1)*15))
        if hbCustomBuffIDs[j] then
            hbCustomBuff_Text[x]["Prio"]:SetText(hbCustomBuffList[hbCustomBuffIDs[j]]["Prio"])
            if tonumber(hbCustomBuffIDs[j]) then
                hbCustomBuff_Text[x]["ID"]:SetText(hbCustomBuffIDs[j])
            else
                hbCustomBuff_Text[x]["ID"]:SetText("-")
            end
            hbCustomBuff_Text[x]["Name"]:SetText(hbCustomBuffList[hbCustomBuffIDs[j]]["Name"])
            hbCustomBuff_Text[x]["Tag"]:SetText(hbCustomBuffList[hbCustomBuffIDs[j]]["Tag"])
            local z=hbCustomBuffIDs[j]
            local r,g,b=0,0,0
            if HealBot_Globals.CustomBuffBarColour[z] then
                r=HealBot_Globals.CustomBuffBarColour[z].R or 0.45
                g=HealBot_Globals.CustomBuffBarColour[z].G or 0
                b=HealBot_Globals.CustomBuffBarColour[z].B or 0.26
            else
                r=HealBot_Globals.CustomBuffBarColour[customBuffPriority].R or 0.45
                g=HealBot_Globals.CustomBuffBarColour[customBuffPriority].G or 0
                b=HealBot_Globals.CustomBuffBarColour[customBuffPriority].B or 0.26
            end
            if r<0.2 and g<0.2 and b<0.2 then
                r=r+0.4
                g=g+0.4
                b=b+0.4
            elseif r<0.3 and g<0.3 and b<0.3 then
                r=r+0.3
                g=g+0.3
                b=b+0.3
            elseif r<0.4 and g<0.4 and b<0.4 then
                r=r+0.2
                g=g+0.2
                b=b+0.2
            elseif r<0.5 and g<0.5 and b<0.5 then
                r=r+0.1
                g=g+0.1
                b=b+0.1
            end
            hbCustomBuff_Text[x]["Prio"]:SetTextColor(r,g,b,1)
            hbCustomBuff_Text[x]["ID"]:SetTextColor(r,g,b,1)
            hbCustomBuff_Text[x]["Name"]:SetTextColor(r,g,b,1)
            hbCustomBuff_Text[x]["Tag"]:SetTextColor(r,g,b,1)
        else
            hbCustomBuff_Text[x]["Prio"]:SetText("")
            hbCustomBuff_Text[x]["ID"]:SetText("")
            hbCustomBuff_Text[x]["Name"]:SetText("")
            hbCustomBuff_Text[x]["Tag"]:SetText("")
        end
    end
    if hbCustomBuffIDs[endEntry+1] then
        HealBot_Options_PageNextCBuffBtn:Enable()
    else
        HealBot_Options_PageNextCBuffBtn:Disable()
    end
    if HealBot_Options_luVars["custombufftextpage"]==1 then
        HealBot_Options_PagePrevCBuffBtn:Disable()
    end

    HealBot_Options_SetLabel("HealBot_Options_PageCBuff",HEALBOT_OPTIONS_PAGE.." "..HealBot_Options_luVars["custombufftextpage"])
end

function HealBot_Options_PageNextCBuff()
    HealBot_Options_luVars["custombufftextpage"]=HealBot_Options_luVars["custombufftextpage"]+1
    HealBot_Options_PagePrevCBuffBtn:Enable()
    HealBot_Timers_Set("AURA","CustomBuffList")
end

function HealBot_Options_PagePrevCBuff()
    if HealBot_Options_luVars["custombufftextpage"]>1 then
        HealBot_Options_luVars["custombufftextpage"]=HealBot_Options_luVars["custombufftextpage"]-1
    end
    HealBot_Timers_Set("AURA","CustomBuffList")
end
--------------------------------------------------------------------------------
HealBot_Options_luVars["MaxClassicAuxBarAssign"]=20
function HealBot_Options_Aux1Assign_GenList()
    local list={}
    if HealBot_Options_luVars["FramesSelFrame"]==10 then 
        for j=1, 4 do
            list[j]=HealBot_Options_AuxAssign_List[j]
        end
        list[5]=HEALBOT_OPTIONS_CASTBAR
        list[6]=HEALBOT_OUTOFRANGE_LABEL
        list[7]=HEALBOT_RANGE30
        list[8]=HEALBOT_OPTION_HEALTHDROP
        list[9]=HEALBOT_OPTIONS_TAB_NAMETEXT
        list[10]=HEALBOT_WORD_HEALTH
        list[11]=HEALBOT_OPTIONS_TAB_STATETEXT
    elseif HEALBOT_GAME_VERSION<4 then
        for j=1, HealBot_Options_luVars["MaxClassicAuxBarAssign"] do
            list[j]=HealBot_Options_AuxAssign_List[j]
        end
        list[17]=HEALBOT_OPTION_HEALTHDROP
        list[18]=HEALBOT_OPTIONS_TAB_NAMETEXT
        list[19]=HEALBOT_WORD_HEALTH
        list[20]=HEALBOT_OPTIONS_TAB_STATETEXT
    else
        list=HealBot_Options_AuxAssign_List
    end
    return list
end

function HealBot_Options_AuxDefaultShowText(frame, use, id)
    if frame==10 then
        if use==4 or use==5 then
            Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][id][frame]["TEXT"]=true
        else
            Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][id][frame]["TEXT"]=false
        end
    elseif HealBot_Globals.AuxTextPrefs[use]~=nil then
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][id][frame]["TEXT"]=HealBot_Globals.AuxTextPrefs[use]
    elseif use==4 or use==9 or use==10 or use==11 or use==16 then
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][id][frame]["TEXT"]=true
        HealBot_Globals.AuxTextPrefs[use]=true
    else
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][id][frame]["TEXT"]=false
        HealBot_Globals.AuxTextPrefs[use]=false
    end
end

function HealBot_Options_AuxAssign_DropDown(object, id)
    local info = UIDropDownMenu_CreateInfo()
    local list=HealBot_Options_Aux1Assign_GenList()
    for j=1, getn(list), 1 do
        info.text = list[j];
        info.func = function(self)
                        if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][id][HealBot_Options_luVars["FramesSelFrame"]]["USE"]~=self:GetID() then
                            Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][id][HealBot_Options_luVars["FramesSelFrame"]]["USE"]=self:GetID()
                            UIDropDownMenu_SetText(object,list[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][id][HealBot_Options_luVars["FramesSelFrame"]]["USE"]]) 
                            HealBot_Options_AuxDefaultShowText(HealBot_Options_luVars["FramesSelFrame"], self:GetID(), id)
                            HealBot_Options_clearAuxBars(HealBot_Options_luVars["FramesSelFrame"],id)
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][id][HealBot_Options_luVars["FramesSelFrame"]]["USE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_Aux1Assign_DropDown()
    HealBot_Options_AuxAssign_DropDown(HealBot_Options_Aux1Assign, 1)
end

function HealBot_Options_Aux2Assign_DropDown()
    HealBot_Options_AuxAssign_DropDown(HealBot_Options_Aux2Assign, 2)
end

function HealBot_Options_Aux3Assign_DropDown()
    HealBot_Options_AuxAssign_DropDown(HealBot_Options_Aux3Assign, 3)
end

function HealBot_Options_Aux4Assign_DropDown()
    HealBot_Options_AuxAssign_DropDown(HealBot_Options_Aux4Assign, 4)
end

function HealBot_Options_Aux5Assign_DropDown()
    HealBot_Options_AuxAssign_DropDown(HealBot_Options_Aux5Assign, 5)
end

function HealBot_Options_Aux6Assign_DropDown()
    HealBot_Options_AuxAssign_DropDown(HealBot_Options_Aux6Assign, 6)
end

function HealBot_Options_Aux7Assign_DropDown()
    HealBot_Options_AuxAssign_DropDown(HealBot_Options_Aux7Assign, 7)
end

function HealBot_Options_Aux8Assign_DropDown()
    HealBot_Options_AuxAssign_DropDown(HealBot_Options_Aux8Assign, 8)
end

function HealBot_Options_Aux9Assign_DropDown()
    HealBot_Options_AuxAssign_DropDown(HealBot_Options_Aux9Assign, 9)
end

function HealBot_Options_AuxOverlap_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_AuxOverlap_List), 1 do
        info.text = HealBot_Options_AuxOverlap_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAP"]~=self:GetID() then
                            Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAP"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_AuxOverlap,HealBot_Options_AuxOverlap_List[Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAP"]]) 
                            --HealBot_Aux_resetBars()
                            HealBot_Timers_Set("SKINS","SkinsAuxFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAP"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

local function HealBot_Options_AuxConfigBarChangeOverlayShowHide(show)
    local overlayAggro=_G["HealBot_Options_SkinBarAuxBarOverlayAggro"]
    local overlayHighlight=_G["HealBot_Options_SkinBarAuxBarOverlayHighlight"]
    local overlayTarget=_G["HealBot_Options_SkinBarAuxBarOverlayTarget"]
    local overlayOOR=_G["HealBot_Options_SkinBarAuxBarOverlayOOR"]
    local overlayRecentHeals=_G["HealBot_Options_SkinBarAuxBarOverlayRecentHeals"]
    local overlayHealthDrop=_G["HealBot_Options_SkinBarAuxBarOverlayHealthDrop"]
    local overlayBuff=_G["HealBot_Options_SkinBarAuxBarOverlayBuff"]
    local overlayDebuff=_G["HealBot_Options_SkinBarAuxBarOverlayDebuff"]
    if show then
        overlayAggro:Show()
        overlayHighlight:Show()
        overlayTarget:Show()
        overlayOOR:Show()
        overlayRecentHeals:Show()
        overlayHealthDrop:Show()
        overlayBuff:Show()
        overlayDebuff:Show()
        HealBot_Options_SkinBarAuxBarOverlayRecentHeals:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYRECENTHEALS"])
        HealBot_Options_SkinBarAuxBarOverlayHealthDrop:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYHEALTHDROP"])
        HealBot_Options_SkinBarAuxBarOverlayAggro:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYAGGRO"])
        HealBot_Options_SkinBarAuxBarOverlayDebuff:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYDEBUFF"])
        HealBot_Options_SkinBarAuxBarOverlayHighlight:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYHIGHLIGHT"])
        HealBot_Options_SkinBarAuxBarOverlayTarget:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYTARGET"])
        HealBot_Options_SkinBarAuxBarOverlayOOR:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYOOR"])
        HealBot_Options_SkinBarAuxBarOverlayBuff:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYBUFF"])
    else
        overlayAggro:Hide()
        overlayHighlight:Hide()
        overlayTarget:Hide()
        overlayOOR:Hide()
        overlayRecentHeals:Hide()
        overlayHealthDrop:Hide()
        overlayBuff:Hide()
        overlayDebuff:Hide()
    end
end

local function HealBot_Options_AuxConfigBarChange()
    local assignment=Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["USE"]
    HealBot_Options_AuxBarColour.initialize = HealBot_Options_AuxBarColour_DropDown
    UIDropDownMenu_SetText(HealBot_Options_AuxBarColour,HealBot_Options_AuxBarColours_List[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLOUR"]])  
    HealBot_Options_AuxBarOpacityType.initialize = HealBot_Options_AuxBarOpacityType_DropDown
    UIDropDownMenu_SetText(HealBot_Options_AuxBarOpacityType,HealBot_Options_AuxBarOpacityType_List[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OTYPE"]]) 
    HealBot_Options_AuxBarAnchor.initialize = HealBot_Options_AuxBarAnchor_DropDown
    UIDropDownMenu_SetText(HealBot_Options_AuxBarAnchor,HealBot_Options_AuxBarAnchor_List[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["ANCHOR"]])
    if HealBot_Options_AuxBarSize:GetValue()~=Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["SIZE"] then
        HealBot_Options_AuxBarSize:SetValue(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["SIZE"])
    end
    HealBot_Options_SetText(HealBot_Options_AuxBarSize, HEALBOT_OPTIONS_TXTSIZE.." ("..(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["SIZE"]*100).."%)")
    if HealBot_Options_AuxBarOpacityCustom:GetValue()~=Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["A"] then
        HealBot_Options_AuxBarOpacityCustom:SetValue(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["A"])
    end
    if HealBot_Options_AuxBarDepth:GetValue()~=Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["DEPTH"] then
        HealBot_Options_AuxBarDepth:SetValue(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["DEPTH"])
    end
    HealBot_Options_SetText(HealBot_Options_AuxBarDepth, HEALBOT_OPTIONS_TXTDEPTH..": "..Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["DEPTH"])
    if HealBot_Options_AuxBarOffset:GetValue()~=Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"] then
        HealBot_Options_AuxBarOffset:SetValue(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
    end
    HealBot_Options_SetText(HealBot_Options_AuxBarOffset, HEALBOT_OPTIONS_TXTOFFSET..": "..Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
    HealBot_AuxBarCustomColour:SetStatusBarColor(
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["B"]);

    local list=HealBot_Options_Aux1Assign_GenList()
    local fstr=_G["HealBot_AuxBarsConfigAssign2_FontStr"]
    fstr:SetText(list[assignment])
    HealBot_Options_luVars["AuxBarsFlash"]=false
    local monly=_G["HealBot_Options_SkinBarAuxBarManaOnly"]
    local honly=_G["HealBot_Options_SkinBarAuxBarHealersManaOnly"]
    if assignment==4 then
        monly:Show()
        honly:Show()
        HealBot_Options_SkinBarAuxBarManaOnly:SetChecked(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["MANAONLY"])
        HealBot_Options_SkinBarAuxBarHealersManaOnly:SetChecked(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HEALERSMANAONLY"])
    else
        monly:Hide()
        honly:Hide()
    end
    if HealBot_Options_luVars["FramesSelFrame"]==10 then
        if assignment>8 and assignment<11 then
            HealBot_Options_AuxConfigBarChangeOverlayShowHide(true)
        else
            HealBot_Options_AuxConfigBarChangeOverlayShowHide(false)
        end
    elseif HealBot_Options_luVars["FramesSelFrame"]>7 then
        if assignment>13 and assignment<16 then
            HealBot_Options_AuxConfigBarChangeOverlayShowHide(true)
        else
            HealBot_Options_AuxConfigBarChangeOverlayShowHide(false)
        end
    elseif HEALBOT_GAME_VERSION>3 then
        if assignment>18 and assignment<21 then
            HealBot_Options_AuxConfigBarChangeOverlayShowHide(true)
        else
            HealBot_Options_AuxConfigBarChangeOverlayShowHide(false)
        end
    else
        if assignment>17 and assignment<20 then
            HealBot_Options_AuxConfigBarChangeOverlayShowHide(true)
        else
            HealBot_Options_AuxConfigBarChangeOverlayShowHide(false)
        end
    end
    for x=1,9 do
        fstr=_G["HealBot_Aux"..x.."Config_FontStr1"]
        fstr:SetText(HEALBOT_WORD_ANCHOR.." |cffffffff"..HealBot_Options_AuxBarAnchor_ShortList[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][HealBot_Options_luVars["FramesSelFrame"]]["ANCHOR"]])
        if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][HealBot_Options_luVars["FramesSelFrame"]]["USE"]>1 and
           Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][HealBot_Options_luVars["FramesSelFrame"]]["OTYPE"]==2 then
            HealBot_Options_luVars["AuxBarsFlash"]=true
        end
    end
    HealBot_Timers_Set("SKINS","FluidFlashInUse")
end

local function HealBot_Options_AuxConfigTxtChange()
    local assignment=Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["USE"]
    UIDropDownMenu_SetText(HealBot_Options_AuxTextSelect1,HealBot_Options_Lists["AuxConfigSelect"][HealBot_Options_luVars["AuxTxtBar"]])
    UIDropDownMenu_SetText(HealBot_Options_AuxTextSelect2,HealBot_Options_Lists["AuxConfigSelect"][HealBot_Options_luVars["AuxTxtBar"]])
    UIDropDownMenu_SetText(HealBot_Options_AuxTextAlign,HealBot_Options_Lists["BarNameTextAnchor"][Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["ALIGN"]])
    HealBot_Options_UpdateMediaFont(HealBot_Options_AuxFontName,fontsIndex[Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]])
    HealBot_Options_AuxFontHeight:SetValue(Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"] or 9)
    HealBot_Options_SetText(HealBot_Options_AuxFontHeight, HEALBOT_OPTIONS_SKINFHEIGHT..": "..Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"])
    HealBot_Options_AuxFontOffset:SetValue(Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"] or 0)
    HealBot_Options_SetText(HealBot_Options_AuxFontOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
    HealBot_Options_AuxFontHOffset:SetValue(Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"])
    HealBot_Options_SetText(HealBot_Options_AuxFontHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"])
    HealBot_Options_AuxMaxChars:SetValue(Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["MAXCHARS"])
    if Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["MAXCHARS"]==0 then
        HealBot_Options_SetText(HealBot_Options_AuxMaxChars, HEALBOT_OPTIONS_MAXCHARS .. ": "..HEALBOT_WORD_AUTO)
    else
        HealBot_Options_SetText(HealBot_Options_AuxMaxChars, HEALBOT_OPTIONS_MAXCHARS .. ": ".. Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["MAXCHARS"])
    end
    HealBot_Options_AuxTextOutLine:SetValue(Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"])
    HealBot_Options_SetText(HealBot_Options_AuxTextOutLine, HEALBOT_OPTIONS_SKINFOUTLINE .. ": ".. HealBot_Options_FontOutline_List[Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]])
    UIDropDownMenu_SetText(HealBot_Options_AuxTextColour, HealBot_Options_AuxBarColours_List[Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLTYPE"]])
    HealBot_AuxTextCustomColourt:SetTextColor(
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLR"],
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLG"],
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLB"],
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLA"])
    HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_AuxTextAlpha,HEALBOT_OPTIONS_BARALPHA,0,1,0.01,5)
    HealBot_Options_AuxTextAlpha:SetValue(Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLA"]);
    HealBot_Options_Pct_OnValueChanged(HealBot_Options_AuxTextAlpha)
    HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_AuxTextDisAlpha,HEALBOT_OPTIONS_BARALPHADIS,0,1,0.01,5)
    HealBot_Options_AuxTextDisAlpha:SetValue(Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLDA"]);
    HealBot_Options_Pct_OnValueChanged(HealBot_Options_AuxTextDisAlpha)
    local list=HealBot_Options_Aux1Assign_GenList()
    local fstr=_G["HealBot_AuxTextConfigAssign1_FontStr2"]
    fstr:SetText(list[assignment])
    fstr=_G["HealBot_AuxTextConfigAssign2_FontStr2"]
    fstr:SetText(list[assignment])
    if (HealBot_Options_luVars["FramesSelFrame"]==10 and assignment>8) or 
           (HealBot_Options_luVars["FramesSelFrame"]<10 and HealBot_Options_luVars["FramesSelFrame"]>7 and assignment>13) or 
           (HealBot_Options_luVars["FramesSelFrame"]<8 and assignment>18 and HEALBOT_GAME_VERSION>3) or 
           (HealBot_Options_luVars["FramesSelFrame"]<8 and assignment>17 and HEALBOT_GAME_VERSION<4) then
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTextOnAuxBar",false)
            HealBot_Options_ShowTextOnAuxBar:SetChecked(true)
    elseif (HealBot_Options_luVars["FramesSelFrame"]==10 and (assignment>5 and assignment<9)) or
           (HealBot_Options_luVars["FramesSelFrame"]<10 and HealBot_Options_luVars["FramesSelFrame"]>7 and (assignment==5 or assignment==8 or (assignment>10 and assignment<14))) or
           (HealBot_Options_luVars["FramesSelFrame"]<8 and (assignment==5 or assignment==8 or (assignment>11 and assignment<16))) or
           (HealBot_Options_luVars["FramesSelFrame"]<8 and HEALBOT_GAME_VERSION>3 and assignment==18) or
           (HealBot_Options_luVars["FramesSelFrame"]<8 and HEALBOT_GAME_VERSION<4 and assignment==17) then
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTextOnAuxBar",false)
        HealBot_Options_ShowTextOnAuxBar:SetChecked(false)
    else
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTextOnAuxBar",true)
        if HealBot_Options_ShowTextOnAuxBar:GetChecked()~=Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["TEXT"] then
            HealBot_Options_ShowTextOnAuxBar:SetChecked(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["TEXT"])
        end
    end
end

function HealBot_Options_clearAuxBars(frame,id)
    HealBot_Aux_clearAggroAssigned(frame,id)
    HealBot_Aux_clearAuraAssigned(frame,id)
    HealBot_Aux_clearHightlightAssigned(frame,id)
    HealBot_Aux_clearTargetAssigned(frame,id)
    HealBot_Aux_clearOORAssigned(frame,id)
    HealBot_Aux_clearRange30Assigned(frame,id)
    HealBot_Aux_clearRecentHealsAssigned(frame,id)
    HealBot_Aux_clearHealthDropAssigned(frame,id)
    HealBot_Aux_clearNameAssigned(frame,id)
    HealBot_Aux_clearHealthAssigned(frame,id)
    HealBot_Aux_clearStateAssigned(frame,id)
    HealBot_Aux_clearResAssigned(frame,id)
    HealBot_Aux_clearSummonsAssigned(frame,id)
    HealBot_Aux_clearInHealsAssigned(frame,id)
    HealBot_Aux_clearPowerAssigned(frame,id)
    HealBot_Aux_clearOverHealAssigned(frame,id)
    HealBot_Aux_clearCastBarAssigned(frame,id)
    if frame then 
        HealBot_Options_setAuxBars(frame,id)
        HealBot_Timers_AuxFramesChanged()
        HealBot_Aux_UpdateAllAuxByType(frame, id)
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    else
        HealBot_Aux_resetAllBars() 
    end
    HealBot_Options_AuxConfigBarChange()
    HealBot_Options_AuxConfigTxtChange()
end

local function HealBot_Options_setAuxBarsByID(f,x)
    if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==2 then
        HealBot_Aux_setInHealsAssigned("ABSORB", f, x)
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==3 then
        HealBot_Aux_setInHealsAssigned("INHEAL", f, x)
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==4 then
        HealBot_Aux_setPowerAssigned(f, x)  -- Power
    elseif f<10 then
        if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==5 then
            HealBot_Aux_setAggroAssigned("AGGRO", f, x)
        elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==6 then
            HealBot_Aux_setAggroAssigned("THREAT", f, x)
        elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==7 then
            HealBot_Aux_setOverHealAssigned(f, x) -- OverHeal
        elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==8 then
            HealBot_Aux_setHightlightAssigned(f, x)  -- Highlight
        elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==9 then
            HealBot_Aux_setAuraAssigned("BUFF", f, x)
        elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==10 then
            HealBot_Aux_setAuraAssigned("DEBUFF", f, x)
        elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==11 then
            HealBot_Aux_setCastBarAssigned(f, x)
        elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==12 then
            HealBot_Aux_setTargetAssigned(f, x)
        elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==13 then
            HealBot_Aux_setOORAssigned(f, x)
        elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==14 then
            HealBot_Aux_setRange30Assigned(f, x)
        elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==15 then
            HealBot_Aux_setRecentHealsAssigned(f, x)
        elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==16 then
            HealBot_Aux_setResAssigned(f, x)
        elseif HEALBOT_GAME_VERSION<4 then
            if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==17 then
                HealBot_Aux_setHealthDropAssigned(f, x)
            elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==18 then
                HealBot_Aux_setNameAssigned(f, x)
            elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==19 then
                HealBot_Aux_setHealthAssigned(f, x)
            elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==20 then
                HealBot_Aux_setStateAssigned(f, x)
            end
        else
            if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==17 then
                HealBot_Aux_setSummonsAssigned(f, x)
            elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==18 then
                HealBot_Aux_setHealthDropAssigned(f, x)
            elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==19 then
                HealBot_Aux_setNameAssigned(f, x)
            elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==20 then
                HealBot_Aux_setHealthAssigned(f, x)
            elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==21 then
                HealBot_Aux_setStateAssigned(f, x)
            end
        end
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==5 then
        HealBot_Aux_setCastBarAssigned(f, x)
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==6 then
        HealBot_Aux_setOORAssigned(f, x)
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==7 then
        HealBot_Aux_setRange30Assigned(f, x)
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==8 then
        HealBot_Aux_setHealthDropAssigned(f, x)
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==9 then
        HealBot_Aux_setNameAssigned(f, x)
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==10 then    
        HealBot_Aux_setHealthAssigned(f, x)
    elseif Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]==11 then    
        HealBot_Aux_setStateAssigned(f, x)
    end
end

function HealBot_Options_setAuxBars(frame,id)
    if frame and id then
        HealBot_Options_setAuxBarsByID(frame,id)
    else
        for f=1,10 do
            for x=1,9 do
                HealBot_Options_setAuxBarsByID(f,x)
            end
        end
        HealBot_setFuncUnitInRange()
    end
end

function HealBot_Options_AuxBarOpacityType_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_AuxBarOpacityType_List), 1 do
        info.text = HealBot_Options_AuxBarOpacityType_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OTYPE"]~=self:GetID() then
                            Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OTYPE"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_AuxBarOpacityType,HealBot_Options_AuxBarOpacityType_List[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OTYPE"]]) 
                            HealBot_Aux_UpdateAllAuxByType(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OTYPE"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AuxConfigBar_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AuxConfigSelect"]), 1 do
        info.text = HealBot_Options_Lists["AuxConfigSelect"][j];
        info.func = function(self)
                        if HealBot_Options_luVars["AuxBar"]~=self:GetID() then
                            HealBot_Options_luVars["AuxBar"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_AuxConfigBar,HealBot_Options_Lists["AuxConfigSelect"][HealBot_Options_luVars["AuxBar"]]) 
                            HealBot_Options_AuxConfigBarChange()
                        end
                    end
        info.checked = false;
        if HealBot_Options_luVars["AuxBar"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AuxTextSelect_DropDown(object)
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AuxConfigSelect"]), 1 do
        info.text = HealBot_Options_Lists["AuxConfigSelect"][j];
        info.func = function(self)
                        if HealBot_Options_luVars["AuxTxtBar"]~=self:GetID() then
                            HealBot_Options_luVars["AuxTxtBar"]=self:GetID()
                            UIDropDownMenu_SetText(object,HealBot_Options_Lists["AuxConfigSelect"][HealBot_Options_luVars["AuxTxtBar"]]) 
                            HealBot_Options_AuxConfigTxtChange()
                        end
                    end
        info.checked = false;
        if HealBot_Options_luVars["AuxTxtBar"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AuxTextSelect1_DropDown()
    HealBot_Options_AuxTextSelect_DropDown(HealBot_Options_AuxTextSelect1)
end

function HealBot_Options_AuxTextSelect2_DropDown()
    HealBot_Options_AuxTextSelect_DropDown(HealBot_Options_AuxTextSelect2)
end

function HealBot_Options_AuxBarColour_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_AuxBarColours_List), 1 do
        info.text = HealBot_Options_AuxBarColours_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLOUR"]~=self:GetID() then
                            Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLOUR"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_AuxBarColour,HealBot_Options_AuxBarColours_List[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLOUR"]]) 
                            HealBot_Aux_UpdateAllAuxByType(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
                            if HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("AUX","TestUpdate") end
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLOUR"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end


function HealBot_Options_AuxBarAnchor_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_AuxBarAnchor_List), 1 do
        info.text = HealBot_Options_AuxBarAnchor_List[j];
        info.func = function(self)
                        if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["ANCHOR"]~=self:GetID() then
                            Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["ANCHOR"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_AuxBarAnchor,HealBot_Options_AuxBarAnchor_List[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["ANCHOR"]]) 
                            HealBot_Aux_UpdateAllAuxByType(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
                            HealBot_Timers_Set("SKINS","SkinsAuxFramesChanged")
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["ANCHOR"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------
function HealBot_Options_AggroAlertLevel_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_AggroAlertLevel_List), 1 do
        info.text = HealBot_Options_AggroAlertLevel_List[j];
        info.func = function(self)
                        Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERT"]=self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_AggroAlertLevel,HealBot_Options_AggroAlertLevel_List[Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERT"]]) 
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERT"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AggroAdapAlertLevel_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AggroAdaptiveLevel"]), 1 do
        info.text = HealBot_Options_Lists["AggroAdaptiveLevel"][j];
        info.func = function(self)
                        local id=self:GetID()
                        if id==1 then
                            Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTADAP"]=3
                        else
                            Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTADAP"]=id-1
                        end
                        UIDropDownMenu_SetText(HealBot_Options_AggroAdapAlertLevel,HealBot_Options_Lists["AggroAdaptiveLevel"][id]) 
                    end
        info.checked = false
        local id=Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTADAP"]+1
        if id==4 then id=1 end
        if id==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_AggroIndAlertLevel_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["AggroIndAlertLevel"]), 1 do
        info.text = HealBot_Options_Lists["AggroIndAlertLevel"][j];
        info.func = function(self)
                        Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTIND"]=self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_AggroIndAlertLevel,HealBot_Options_Lists["AggroIndAlertLevel"][Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTIND"]]) 
                    end
        info.checked = false;
        if Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTIND"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_DoEffects_DropDowns()     
    HealBot_Options_UseFocusGroups.initialize = HealBot_Options_UseFocusGroups_DropDown
    HealBot_Options_UseOverrideFocusGroups.initialize = HealBot_Options_UseOverrideFocusGroups_DropDown
    HealBot_Options_HotBarDebuffPrio.initialize = HealBot_Options_HotBarDebuffPrio_DropDown
    HealBot_Options_OverrideHotBarDebuffPrio.initialize = HealBot_Options_OverrideHotBarDebuffPrio_DropDown
    if HealBot_Globals.OverrideEffects["USE"]==2 then
        UIDropDownMenu_SetText(HealBot_Options_UseOverrideFocusGroups, HealBot_Options_UseOverrideFocusGroups_List[HealBot_Globals.OverrideEffects["FOCUSGROUPS"]])
        UIDropDownMenu_SetText(HealBot_Options_OverrideHotBarDebuffPrio, HealBot_Options_Lists["HotBarsDebuffPrio"][HealBot_Globals.OverrideEffects["HOTBARDEBUFF"]])
        UIDropDownMenu_SetText(HealBot_Options_UseFocusGroups," ")
        UIDropDownMenu_SetText(HealBot_Options_HotBarDebuffPrio," ")
    else
        UIDropDownMenu_SetText(HealBot_Options_UseFocusGroups, HealBot_Options_UseOverrideFocusGroups_List[Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FOCUSGROUPS"]])
        UIDropDownMenu_SetText(HealBot_Options_HotBarDebuffPrio, HealBot_Options_Lists["HotBarsDebuffPrio"][Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HOTBARDEBUFF"]])
        UIDropDownMenu_SetText(HealBot_Options_UseOverrideFocusGroups," ")
        UIDropDownMenu_SetText(HealBot_Options_OverrideHotBarDebuffPrio," ")
    end
end

--------------------------------------------------------------------------------

function HealBot_Options_Skins_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(Healbot_Config_Skins.Skins), 1 do
        info.text = Healbot_Config_Skins.Skins[j];
        info.func = function(self)
                        if Healbot_Config_Skins.Skin_ID~=self:GetID() then
                            Healbot_Config_Skins.Skin_ID = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_Skins,Healbot_Config_Skins.Skins[Healbot_Config_Skins.Skin_ID])
                            if self:GetID()>=1 then HealBot_Options_Set_Current_Skin(self:GetText(), true) end
                        end
                    end
        info.checked = false;
        if Healbot_Config_Skins.Skin_ID==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_DoSet_Current_Skin(newSkin, ddRefresh, noCallback, optSetSkins)
    if newSkin then
        HealBot_Panel_resetInitFrames()
        local hbFoundSkin=nil
        local hbValidSkins=nil
        for j=1, getn(Healbot_Config_Skins.Skins), 1 do
            if newSkin==Healbot_Config_Skins.Skins[j] then
                hbFoundSkin=true
                Healbot_Config_Skins.Skin_ID=j
                if Healbot_Config_Skins.Current_Skin~=Healbot_Config_Skins.Skins[j] then
                    Healbot_Config_Skins.Current_Skin=Healbot_Config_Skins.Skins[j]
                    HealBot_Skins_Check(Healbot_Config_Skins.Current_Skin)
                    HealBot_Action_setAutoClose(true)
                    HealBot_Timers_Set("LAST","SetAutoClose", 1)
                    HealBot_Timers_Set("LAST","DisableAllButtonGlow")
                    HealBot_Timers_TurboOn(3)
                    HealBot_Config.LastAutoSkinChangeTime=GetTime()+300
                    optSetSkins=true
                    HealBot_setLuVars("showReloadMsg", true)
                    HealBot_Action_setLuVars("resetIcon", true)
                    HealBot_Action_setLuVars("resetSkin", true)
                    HealBot_Action_setLuVars("resetIndicator", true)
                    HealBot_Action_setLuVars("resetText", true)
                    HealBot_Action_setLuVars("resetAux", true)
                    HealBot_Action_ResetrCalls()
                    HealBot_Timers_ToggleBlizzardFrames()
                    HealBot_Timers_Set("SKINS","EmergHealthCol")
                    HealBot_Timers_Set("INIT","SeparateInHealsAbsorbs")
                    HealBot_Timers_Set("LAST","CheckFramesOnCombat")
                    HealBot_Timers_Set("LAST","ShowFramesOnSkinChange")
                    HealBot_Skins_ResetSkin("init")
                    if not ddRefresh then
                        HealBot_Timers_Set("AURA","ResetClassIconTexture")
                    end
                    HealBot_setLuVars("TargetNeedReset", true)
                    HealBot_setLuVars("FocusNeedReset", true)
                    if HealBot_Data["TIPUSE"] then HealBot_Tooltip_CustomAnchor_Hide() end
                    HealBot_Timers_InitExtraOptions()
                end
            end
            if hbValidSkins then
                hbValidSkins=hbValidSkins.."  +  "..Healbot_Config_Skins.Skins[j]
            else
                hbValidSkins=Healbot_Config_Skins.Skins[j]
            end
        end
        if not hbFoundSkin then
            HealBot_AddChat(HEALBOT_CHAT_ADDONID..HEALBOT_CHAT_CHANGESKINERR1..newSkin)
            if hbValidSkins then HealBot_AddChat(HEALBOT_CHAT_ADDONID..HEALBOT_CHAT_CHANGESKINERR2..hbValidSkins) end
            if not Healbot_Config_Skins.Author[Healbot_Config_Skins.Current_Skin] then 
                local retryWithSkin = HealBot_getDefaultSkin()
                if not noCallback then
                    HealBot_Options_DoSet_Current_Skin(retryWithSkin, nil, true, optSetSkins)
                elseif newSkin~=HEALBOT_SKINS_STD then
                    HealBot_Options_DoSet_Current_Skin(HEALBOT_SKINS_STD, nil, true, optSetSkins)
                end
            end
        end
    elseif not Healbot_Config_Skins.Author[Healbot_Config_Skins.Current_Skin] then 
        local retryWithSkin = HealBot_getDefaultSkin()
        if not noCallback then
            HealBot_Options_DoSet_Current_Skin(retryWithSkin, nil, true, optSetSkins)
        elseif newSkin~=HEALBOT_SKINS_STD then
            HealBot_Options_DoSet_Current_Skin(HEALBOT_SKINS_STD, nil, true, optSetSkins)
        end
        HealBot_Timers_Set("RESET","Skins")
    end
    return optSetSkins
end

function HealBot_Options_Set_Current_Skin(newSkin, ddRefresh, noCallback, optSetSkins)
    if not InCombatLockdown() then
        local initCurFrame=HealBot_Options_DoSet_Current_Skin(newSkin, ddRefresh, noCallback, optSetSkins)
        if initCurFrame then HealBot_Options_SetSkins(true) end
    else
        C_Timer.After(1, function() HealBot_Options_Set_Current_Skin(newSkin, ddRefresh, noCallback, optSetSkins) end)
    end
end

--------------------------------------------------------------------------------
HealBot_Options_luVars["InOutSkin"]=1
HealBot_Options_luVars["hbTempNumUnitNames"]=0
function HealBot_Options_InOutSkin_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(Healbot_Config_Skins.Skins), 1 do
        info.text = Healbot_Config_Skins.Skins[j];
        info.func = function(self)
                        HealBot_Options_luVars["InOutSkin"] = self:GetID()
                        HealBot_Share_setLuVars("InOutSkin", HealBot_Options_luVars["InOutSkin"])
                        UIDropDownMenu_SetText(HealBot_Options_InOutSkin,Healbot_Config_Skins.Skins[HealBot_Options_luVars["InOutSkin"]])
                    end
        info.checked = false;
        if HealBot_Options_luVars["InOutSkin"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_ExtraSkins_Image(show, name)
    if show then
        HealBot_Share_ClosePostLink();
        local image, desc=HealBot_ExtraSkins_retImageDesc(name)
        HealBot_ExtraSkins_Image:SetTexture(image,"CLAMPTOBLACKADDITIVE","CLAMPTOBLACKADDITIVE")
        HealBot_ExtraSkins_Image:Show()
        HealBot_Options_ExtraSkinsImageClose:Show()
        HealBot_Options_ShareExternalScroll:Hide()
        HealBot_Options_ShareExternalEditBox:Hide()
        g=_G["HealBot_Options_ExtraSkinsDesc"]
        g:SetText(desc)
    else
        HealBot_ExtraSkins_Image:Hide()
        HealBot_Options_ExtraSkinsImageClose:Hide()
        HealBot_Options_ShareExternalScroll:Show()
        HealBot_Options_ShareExternalEditBox:Show()
        g=_G["HealBot_Options_ExtraSkinsDesc"]
        g:SetText("")
    end
end

function HealBot_Options_ExtraSkins_DropDown(self, level, menuList)
    local info = UIDropDownMenu_CreateInfo()
    if level == 1 then
        for j=1, getn(HealBot_Options_ExtraSkinsCat_List), 1 do
            info.text = "    "..HealBot_Options_ExtraSkinsCat_List[j];
            info.hasArrow = true
            info.notCheckable = true
            info.menuList = HealBot_Options_ExtraSkinsCat_List[j], true, HealBot_Options_ExtraSkinsCat_List[j]
            UIDropDownMenu_AddButton(info)
        end
    elseif menuList == HEALBOT_EXTRASKINS_CAT_GROUP then
        local skinlist=HealBot_ExtraSkins_retNamesForCat("GROUP")
        for j=1, getn(skinlist), 1 do
            info.text = skinlist[j];
            info.func = function(self)
                        HealBot_Options_luVars["ExtraSkins"]=skinlist[j]
                        HealBot_ExtraSkins_copyData(skinlist[j])
                        UIDropDownMenu_SetText(HealBot_Options_ExtraSkins, skinlist[j])
                        HealBot_Options_ExtraSkins_Image(true, HealBot_Options_luVars["ExtraSkins"])
                    end
            info.checked = false;
            if HealBot_Options_luVars["ExtraSkins"] == skinlist[j] then info.checked = true; end
            UIDropDownMenu_AddButton(info, level);
        end
    elseif menuList == HEALBOT_EXTRASKINS_CAT_SRAID then
        local skinlist=HealBot_ExtraSkins_retNamesForCat("SMALL-RAID")
        for j=1, getn(skinlist), 1 do
            info.text = skinlist[j];
            info.func = function(self)
                        HealBot_Options_luVars["ExtraSkins"]=skinlist[j]
                        HealBot_ExtraSkins_copyData(skinlist[j])
                        UIDropDownMenu_SetText(HealBot_Options_ExtraSkins, skinlist[j])
                        HealBot_Options_ExtraSkins_Image(true, HealBot_Options_luVars["ExtraSkins"])
                    end
            info.checked = false;
            if HealBot_Options_luVars["ExtraSkins"] == skinlist[j] then info.checked = true; end
            UIDropDownMenu_AddButton(info, level);
        end
    elseif menuList == HEALBOT_EXTRASKINS_CAT_LRAID then
        local skinlist=HealBot_ExtraSkins_retNamesForCat("LARGE-RAID")
        for j=1, getn(skinlist), 1 do
            info.text = skinlist[j];
            info.func = function(self)
                        HealBot_Options_luVars["ExtraSkins"]=skinlist[j]
                        HealBot_ExtraSkins_copyData(skinlist[j])
                        UIDropDownMenu_SetText(HealBot_Options_ExtraSkins, skinlist[j])
                        HealBot_Options_ExtraSkins_Image(true, HealBot_Options_luVars["ExtraSkins"])
                    end
            info.checked = false;
            if HealBot_Options_luVars["ExtraSkins"] == skinlist[j] then info.checked = true; end
            UIDropDownMenu_AddButton(info, level);
        end
    end
end

HealBot_Options_luVars["InMethodSpell"]=2
HealBot_Options_luVars["InMethodBuff"]=2
HealBot_Options_luVars["InMethodDebuff"]=2
function HealBot_Options_ImportMethod_DropDown(object, id)
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["ImportMethods"]), 1 do
        info.text = HealBot_Options_Lists["ImportMethods"][j];
        info.func = function(self)
                        HealBot_Options_luVars[id] = self:GetID()
                        HealBot_Share_setLuVars(id, HealBot_Options_luVars[id])
                        UIDropDownMenu_SetText(object,HealBot_Options_Lists["ImportMethods"][HealBot_Options_luVars[id]])
                    end
        info.checked = false;
        if HealBot_Options_luVars[id]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_ImportMethodSpells_DropDown()
    HealBot_Options_ImportMethod_DropDown(HealBot_Options_ImportMethodSpells, "InMethodSpell")
end

function HealBot_Options_ImportMethodBuffs_DropDown()
    HealBot_Options_ImportMethod_DropDown(HealBot_Options_ImportMethodBuffs, "InMethodBuff")
end

function HealBot_Options_ImportMethodCDebuff_DropDown()
    HealBot_Options_ImportMethod_DropDown(HealBot_Options_ImportMethodCDebuff, "InMethodDebuff")
end

HealBot_Options_luVars["curPlugin"]=1
local function HealBot_Options_Plugins_ShowFrame()
    local pluginId={[1]="pluginThreat",
                    [2]="pluginTimeToDie",
                    [3]="pluginTimeToLive",
                    [4]="pluginExtraButtons",
                    [5]="pluginCombatProt",
                    [6]="pluginPerformance",
                    [7]="pluginMyCooldowns",
                    [8]="pluginTweaks",
                    [9]="pluginRequests",
                   [10]="pluginAuraWatch",
                   [11]="pluginHealthWatch",
                   [12]="pluginManaWatch",}
    HealBot_Options_PluginThreatFrame:Hide()
    HealBot_Options_PluginTimeToDieFrame:Hide()
    HealBot_Options_PluginTimeToLiveFrame:Hide()
    HealBot_Options_PluginExtraButtonsFrame:Hide()
    HealBot_Options_PluginCombatProtFrame:Hide()
    HealBot_Options_PluginPerformanceFrame:Hide()
    HealBot_Options_PluginTweaksFrame:Hide()
    HealBot_Options_PluginRequestsFrame:Hide()
    HealBot_Options_PluginAuraWatchFrame:Hide()
    HealBot_Options_PluginHealthWatchFrame:Hide()
    HealBot_Options_PluginManaWatchFrame:Hide()
    HealBot_Options_PluginMyCooldownsFrame:Hide()
    if not HealBot_retLuVars(pluginId[HealBot_Options_luVars["curPlugin"]].."Loaded") then
        HealBot_Options_PluginNATxt:Show()
        HealBot_Options_PluginNAReasonTxt:Show()
        HealBot_Options_PluginNAReasonTxt:SetText(HealBot_retLuVars(pluginId[HealBot_Options_luVars["curPlugin"]].."Reason"))
    else
        HealBot_Options_PluginNATxt:Hide()
        HealBot_Options_PluginNAReasonTxt:Hide()
        if HealBot_Options_luVars["curPlugin"]==1 then
            HealBot_Options_PluginThreatFrame:Show()
            HealBot_Plugin_Threat_Options()
        elseif HealBot_Options_luVars["curPlugin"]==2 then
            HealBot_Plugin_TimeToDie_Options()
            HealBot_Options_PluginTimeToDieFrame:Show()
        elseif HealBot_Options_luVars["curPlugin"]==3 then
            HealBot_Plugin_TimeToLive_Options()
            HealBot_Options_PluginTimeToLiveFrame:Show()
        elseif HealBot_Options_luVars["curPlugin"]==4 then
            HealBot_Plugin_ExtraButtons_Options()
            HealBot_Options_PluginExtraButtonsFrame:Show()
        elseif HealBot_Options_luVars["curPlugin"]==5 then
            HealBot_Plugin_CombatProt_Options()
            HealBot_Options_PluginCombatProtFrame:Show()
        elseif HealBot_Options_luVars["curPlugin"]==6 then
            HealBot_Plugin_Performance_Options()
            HealBot_Options_PluginPerformanceFrame:Show()
        elseif HealBot_Options_luVars["curPlugin"]==7 then
            HealBot_Plugin_MyCooldowns_Options()
            HealBot_Options_PluginMyCooldownsFrame:Show()
        elseif HealBot_Options_luVars["curPlugin"]==8 then
            HealBot_Plugin_Tweaks_Options()
            HealBot_Options_PluginTweaksFrame:Show()
        elseif HealBot_Options_luVars["curPlugin"]==9 then
            HealBot_Plugin_Requests_Options()
            HealBot_Options_PluginRequestsFrame:Show()
        elseif HealBot_Options_luVars["curPlugin"]==10 then
            HealBot_Plugin_AuraWatch_Options()
            HealBot_Options_PluginAuraWatchFrame:Show()
        elseif HealBot_Options_luVars["curPlugin"]==11 then
            HealBot_Plugin_HealthWatch_Options()
            HealBot_Options_PluginHealthWatchFrame:Show()
        elseif HealBot_Options_luVars["curPlugin"]==12 then
            HealBot_Plugin_ManaWatch_Options()
            HealBot_Options_PluginManaWatchFrame:Show()
        end
    end
end

function HealBot_Options_Plugins_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["Plugins"]), 1 do
        info.text = HealBot_Options_Lists["Plugins"][j];
        info.func = function(self)
                        if HealBot_Options_luVars["curPlugin"]~=self:GetID() then
                            HealBot_Options_luVars["curPlugin"]=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_Plugins,HealBot_Options_Lists["Plugins"][HealBot_Options_luVars["curPlugin"]])
                            HealBot_Options_Plugins_ShowFrame()
                        end
                    end
        info.checked = false;
        if HealBot_Options_luVars["curPlugin"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_ResetDoneInit(n)
    DoneInitTab[n]=nil
end

function HealBot_SpellAutoButton_Update(autoType, autoMod, ActionBarsCombo, Buttons_Button, isTrue)
    local combo=nil
    if ActionBarsCombo==1 then
        if autoType=="Target" then combo = HealBot_Config_Spells.EnabledSpellTarget;
        elseif autoType=="Trinket1" then combo = HealBot_Config_Spells.EnabledSpellTrinket1;
        elseif autoType=="Trinket2" then combo = HealBot_Config_Spells.EnabledSpellTrinket2; 
        else combo = HealBot_Config_Spells.EnabledAvoidBlueCursor; end
    elseif ActionBarsCombo==2 then
        if autoType=="Target" then combo = HealBot_Config_Spells.EnemySpellTarget;
        elseif autoType=="Trinket1" then combo = HealBot_Config_Spells.EnemySpellTrinket1;
        elseif autoType=="Trinket2" then combo = HealBot_Config_Spells.EnemySpellTrinket2;
        else combo = HealBot_Config_Spells.EnemyAvoidBlueCursor; end
    else
        if autoType=="Target" then combo = HealBot_Config_Spells.EmergSpellTarget;
        elseif autoType=="Trinket1" then combo = HealBot_Config_Spells.EmergSpellTrinket1;
        elseif autoType=="Trinket2" then combo = HealBot_Config_Spells.EmergSpellTrinket2;
        else combo = HealBot_Config_Spells.EmergAvoidBlueCursor; end
    end
    local button = HealBot_Options_ComboClass_Button(Buttons_Button)
    if isTrue=="true" then
        combo[HealBot_Action_GetComboSpec(autoMod, button)] = true
    else
        combo[HealBot_Action_GetComboSpec(autoMod, button)] = nil
    end
end

function HealBot_Options_checkSkinName(skinName)
    local hbFoundSkin=false
    table.foreach(Healbot_Config_Skins.Skins, function (index,skin)
        if skin==skinName then hbFoundSkin=true; end
    end)
    return hbFoundSkin
end

function HealBot_Options_val2str ( v )
  if "string" == type( v ) then
    v = string.gsub( v, "\n", "\\n" )
    if string.match( string.gsub(v,"[^'\"]",""), '^"+$' ) then
      return "'" .. v .. "'"
    end
    return '"' .. string.gsub(v,'"', '\\"' ) .. '"'
  else
    return "table" == type( v ) and HealBot_Options_tab2str( v ) or
      tostring( v )
  end
end

function HealBot_Options_key2str ( k )
  if "string" == type( k ) and string.match( k, "^[_%a][_%a%d]*$" ) then
    return k
  else
    return "[" .. HealBot_Options_val2str( k ) .. "]"
  end
end

function HealBot_Options_tab2str( tbl )
  local result, done = {}, {}
  for k, v in ipairs( tbl ) do
    local value = '"' .. HealBot_Options_val2str( v ) .. '"'
    if value~='"false"' and value~='"true"' then value=HealBot_Options_val2str( v ) end
    table.insert( result, value )
    done[ k ] = true
  end
  for k, v in pairs( tbl ) do
    if not done[ k ] then
      local value = '"' .. HealBot_Options_val2str( v ) .. '"'
      if value~='"false"' and value~='"true"' then value=HealBot_Options_val2str( v ) end
      table.insert( result,
        HealBot_Options_key2str( k ) .. "=" .. value )
    end
  end
  return "{" .. table.concat( result, "," ) .. "}"
end

--------------------------------------------------------------------------------

function HealBot_Options_TooltipPos_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["TooltipPos"]), 1 do
        info.text = HealBot_Options_Lists["TooltipPos"][j];
        info.func = function(self)
                        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TIPLOC"] = self:GetID()
                        UIDropDownMenu_SetText(HealBot_Options_TooltipPos,HealBot_Options_Lists["TooltipPos"][Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TIPLOC"]]) 
                    end
        info.checked = false;
        if Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TIPLOC"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

--------------------------------------------------------------------------------

local function HealBot_Options_BuffTxt_DropDown(object, id)
    local info = UIDropDownMenu_CreateInfo()
    info.text = HEALBOT_WORDS_NONE;
    info.func = function(self)
                    BuffTextClass = HealBot_Config_Buffs.HealBotBuffText
                    BuffTextClass[HealBot_Options_getDropDownId_bySpec(id)] = self:GetText()
                    UIDropDownMenu_SetText(object,HEALBOT_WORDS_NONE)
                    HealBot_Timers_Set("AURA","BuffReset")
                end
    info.checked = false;
    if BuffTextClass[HealBot_Options_getDropDownId_bySpec(id)]==HEALBOT_WORDS_NONE then info.checked = true end
    UIDropDownMenu_AddButton(info);
    for j=1, getn(HealBot_Buff_Spells_List), 1 do
        local sName = HealBot_Buff_Spells_List[j];
        info.text = sName
        info.func = function(self)
                        BuffTextClass = HealBot_Config_Buffs.HealBotBuffText
                        BuffTextClass[HealBot_Options_getDropDownId_bySpec(id)] = self:GetText()
                        UIDropDownMenu_SetText(object,sName)
                        HealBot_Timers_Set("AURA","BuffReset")
                    end
        info.checked = false;
        if BuffTextClass[HealBot_Options_getDropDownId_bySpec(id)]==HealBot_Buff_Spells_List[j] then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

local function HealBot_Options_BuffTxt1_DropDown()
    HealBot_Options_BuffTxt_DropDown(HealBot_Options_BuffTxt1, 1)
end

local function HealBot_Options_BuffTxt2_DropDown()
    HealBot_Options_BuffTxt_DropDown(HealBot_Options_BuffTxt2, 2)
end

local function HealBot_Options_BuffTxt3_DropDown()
    HealBot_Options_BuffTxt_DropDown(HealBot_Options_BuffTxt3, 3)
end

local function HealBot_Options_BuffTxt4_DropDown()
    HealBot_Options_BuffTxt_DropDown(HealBot_Options_BuffTxt4, 4)
end

local function HealBot_Options_BuffTxt5_DropDown()
    HealBot_Options_BuffTxt_DropDown(HealBot_Options_BuffTxt5, 5)
end

local function HealBot_Options_BuffTxt6_DropDown()
    HealBot_Options_BuffTxt_DropDown(HealBot_Options_BuffTxt6, 6)
end

local function HealBot_Options_BuffTxt7_DropDown()
    HealBot_Options_BuffTxt_DropDown(HealBot_Options_BuffTxt7, 7)
end

local function HealBot_Options_BuffTxt8_DropDown()
    HealBot_Options_BuffTxt_DropDown(HealBot_Options_BuffTxt8, 8)
end

local function HealBot_Options_BuffGroups_DropDown(object, id)
    local info = UIDropDownMenu_CreateInfo()
    local BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
    for j=1, getn(HealBot_Options_BuffTxt_List), 1 do
        info.text = HealBot_Options_BuffTxt_List[j];
        info.func = function(self)
                        BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
                        BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(id)] = self:GetID()
                        UIDropDownMenu_SetText(object,HealBot_Options_BuffTxt_List[BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(id)]])
                        ClickedBuffGroupDD=id
                        HealBot_Timers_Set("AURA","BuffReset")
                    end
        info.checked = false;
        if BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(id)]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

local function HealBot_Options_BuffGroups1_DropDown()
    HealBot_Options_BuffGroups_DropDown(HealBot_Options_BuffGroups1, 1)
end

local function HealBot_Options_BuffGroups2_DropDown()
    HealBot_Options_BuffGroups_DropDown(HealBot_Options_BuffGroups2, 2)
end

local function HealBot_Options_BuffGroups3_DropDown()
    HealBot_Options_BuffGroups_DropDown(HealBot_Options_BuffGroups3, 3)
end

local function HealBot_Options_BuffGroups4_DropDown()
    HealBot_Options_BuffGroups_DropDown(HealBot_Options_BuffGroups4, 4)
end

local function HealBot_Options_BuffGroups5_DropDown()
    HealBot_Options_BuffGroups_DropDown(HealBot_Options_BuffGroups5, 5)
end

local function HealBot_Options_BuffGroups6_DropDown()
    HealBot_Options_BuffGroups_DropDown(HealBot_Options_BuffGroups6, 6)
end

local function HealBot_Options_BuffGroups7_DropDown()
    HealBot_Options_BuffGroups_DropDown(HealBot_Options_BuffGroups7, 7)
end

local function HealBot_Options_BuffGroups8_DropDown()
    HealBot_Options_BuffGroups_DropDown(HealBot_Options_BuffGroups8, 8)
end

function HealBot_Options_BuffWeaponEnchant_DropDown(object, id, eId)
    local info = UIDropDownMenu_CreateInfo()
    local BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
    for j=1, getn(HealBot_Buff_WeaponEnchant_List[eId]), 1 do
        info.text = HealBot_Buff_WeaponEnchant_List[eId][j];
        info.func = function(self)
                        if BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(id)]~=self:GetID() then
                            BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(id)] = self:GetID()
                            if eId==1 then
                                UIDropDownMenu_SetText(HealBot_Options_BuffWeaponEnchant1,HealBot_Buff_WeaponEnchant_List[eId][BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(id)]]) 
                            else
                                UIDropDownMenu_SetText(HealBot_Options_BuffWeaponEnchant2,HealBot_Buff_WeaponEnchant_List[eId][BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(id)]]) 
                            end
                            HealBot_Options_BuffWeaponEnchantSetAura(eId)
                            HealBot_Timers_Set("AURA","BuffReset")
                        end
                    end
        info.checked = false;
        if BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(id)]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BuffWeaponEnchant1_DropDown()
    HealBot_Options_BuffWeaponEnchant_DropDown(HealBot_Options_BuffWeaponEnchant1, 9, 1)
end

function HealBot_Options_BuffWeaponEnchant2_DropDown()
    HealBot_Options_BuffWeaponEnchant_DropDown(HealBot_Options_BuffWeaponEnchant2, 10, 2)
end

function HealBot_Options_BuffWarnRange_DropDown(id, var)
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["RangeWarning"]), 1 do
        info.text = HealBot_Options_Lists["RangeWarning"][j];
        info.func = function(self)
                        if id==1 then
                            HealBot_Config_Buffs.HealBot_CBWarnRange_Bar = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BuffWarnRange1,HealBot_Options_Lists["RangeWarning"][HealBot_Config_Buffs.HealBot_CBWarnRange_Bar])
                        elseif id==3 then
                            HealBot_Config_Buffs.HealBot_CBWarnRange_Screen = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BuffWarnRange3,HealBot_Options_Lists["RangeWarning"][HealBot_Config_Buffs.HealBot_CBWarnRange_Screen])
                        else
                            HealBot_Config_Buffs.HealBot_CBWarnRange_Sound = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_BuffWarnRange4,HealBot_Options_Lists["RangeWarning"][HealBot_Config_Buffs.HealBot_CBWarnRange_Sound])
                        end
                    end
        info.checked = false;
        if var==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BuffWarnRange1_DropDown()
    HealBot_Options_BuffWarnRange_DropDown(1, HealBot_Config_Buffs.HealBot_CBWarnRange_Bar)
end

function HealBot_Options_BuffWarnRange3_DropDown()
    HealBot_Options_BuffWarnRange_DropDown(3, HealBot_Config_Buffs.HealBot_CBWarnRange_Screen)
end

function HealBot_Options_BuffWarnRange4_DropDown()
    HealBot_Options_BuffWarnRange_DropDown(4, HealBot_Config_Buffs.HealBot_CBWarnRange_Sound)
end

function HealBot_Options_BuffWeaponEnchantSetAura(x)
    local BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
    HealBot_Aura_WeaponEnchants(HealBot_Buff_WeaponEnchant_List[x][BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(8+x)]], x)
end

function HealBot_Options_BuffManaDrinkItems_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local BuffDropItems = HealBot_retManaDrinkItems()

    info.text = HEALBOT_WORDS_NONE;
    info.func = function(self)
                    HealBot_Config_Buffs.ManaDrinkItem=""
                    HealBot_Options_BuffManaDrinkItem:SetText(HealBot_Config_Buffs.ManaDrinkItem)
                    HealBot_Options_BuffManaDrinkItem_HelpItemSelect_OnClick()
                    HealBot_Timers_Set("AURA","BuffReset")
                end
    info.checked = false;
    UIDropDownMenu_AddButton(info);
    for iName,_ in pairs(BuffDropItems) do
        info.text = iName;
        info.func = function(self)
                        HealBot_Config_Buffs.ManaDrinkItem=self:GetText()
                        HealBot_Options_BuffManaDrinkItem:SetText(HealBot_Config_Buffs.ManaDrinkItem)
                        HealBot_Options_BuffManaDrinkItem_HelpItemSelect_OnClick()
                        HealBot_Timers_Set("AURA","BuffReset")
                    end
        info.checked = false;
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BuffBackupManaDrinkItems_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local BuffDropItems = HealBot_retManaDrinkItems()

    info.text = HEALBOT_WORDS_NONE;
    info.func = function(self)
                    HealBot_Config_Buffs.BackupManaDrinkItem=""
                    HealBot_Options_BuffBackupManaDrinkItem:SetText(HealBot_Config_Buffs.BackupManaDrinkItem)
                    HealBot_Options_BuffBackupManaDrinkItem_HelpItemSelect_OnClick()
                    HealBot_Timers_Set("AURA","BuffReset")
                end
    info.checked = false;
    UIDropDownMenu_AddButton(info);
    for iName,_ in pairs(BuffDropItems) do
        info.text = iName;
        info.func = function(self)
                        HealBot_Config_Buffs.BackupManaDrinkItem=self:GetText()
                        HealBot_Options_BuffBackupManaDrinkItem:SetText(HealBot_Config_Buffs.BackupManaDrinkItem)
                        HealBot_Options_BuffBackupManaDrinkItem_HelpItemSelect_OnClick()
                        HealBot_Timers_Set("AURA","BuffReset")
                    end
        info.checked = false;
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BuffExtraItems1_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local BuffDropItems = HealBot_retBuffExtraItems()

    info.text = HEALBOT_WORDS_NONE;
    info.func = function(self)
                    HealBot_Config_Buffs.CustomItemName[1]=""
                    HealBot_Options_BuffExtraItem1:SetText(HealBot_Config_Buffs.CustomItemName[1])
                    HealBot_Options_BuffExtraItems1_HelpItemSelect_OnClick()
                    HealBot_Timers_Set("AURA","BuffReset")
                end
    info.checked = false;
    UIDropDownMenu_AddButton(info);
    for iName,_ in pairs(BuffDropItems) do
        info.text = iName;
        info.func = function(self)
                        HealBot_Config_Buffs.CustomItemName[1]=self:GetText()
                        HealBot_Options_BuffExtraItem1:SetText(HealBot_Config_Buffs.CustomItemName[1])
                        if HealBot_Config_Buffs.CustomBuffName[1]=="" then
                            HealBot_Config_Buffs.CustomBuffName[1]=HealBot_Config_Buffs.CustomItemName[1]
                            HealBot_Options_BuffExtraBuff1:SetText(HealBot_Config_Buffs.CustomBuffName[1])
                        end
                        HealBot_Options_BuffExtraItems1_HelpItemSelect_OnClick()
                        HealBot_Timers_Set("AURA","BuffReset")
                    end
        info.checked = false;
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BuffExtraItems2_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local BuffDropItems = HealBot_retBuffExtraItems()

    info.text = HEALBOT_WORDS_NONE;
    info.func = function(self)
                    HealBot_Config_Buffs.CustomItemName[2]=""
                    HealBot_Options_BuffExtraItem2:SetText(HealBot_Config_Buffs.CustomItemName[2])
                    HealBot_Options_BuffExtraItems2_HelpItemSelect_OnClick()
                    HealBot_Timers_Set("AURA","BuffReset")
                end
    info.checked = false;
    UIDropDownMenu_AddButton(info);
    for iName,_ in pairs(BuffDropItems) do
        info.text = iName;
        info.func = function(self)
                        HealBot_Config_Buffs.CustomItemName[2]=self:GetText()
                        HealBot_Options_BuffExtraItem2:SetText(HealBot_Config_Buffs.CustomItemName[2])
                        if HealBot_Config_Buffs.CustomBuffName[2]=="" then
                            HealBot_Config_Buffs.CustomBuffName[2]=HealBot_Config_Buffs.CustomItemName[2]
                            HealBot_Options_BuffExtraBuff2:SetText(HealBot_Config_Buffs.CustomBuffName[2])
                        end
                        HealBot_Options_BuffExtraItems2_HelpItemSelect_OnClick()
                        HealBot_Timers_Set("AURA","BuffReset")
                    end
        info.checked = false;
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BuffExtraItems3_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local BuffDropItems = HealBot_retBuffExtraItems()

    info.text = HEALBOT_WORDS_NONE;
    info.func = function(self)
                    HealBot_Config_Buffs.CustomItemName[3]=""
                    HealBot_Options_BuffExtraItem3:SetText(HealBot_Config_Buffs.CustomItemName[3])
                    HealBot_Options_BuffExtraItems3_HelpItemSelect_OnClick()
                    HealBot_Timers_Set("AURA","BuffReset")
                end
    info.checked = false;
    UIDropDownMenu_AddButton(info);
    for iName,_ in pairs(BuffDropItems) do
        info.text = iName;
        info.func = function(self)
                        HealBot_Config_Buffs.CustomItemName[3]=self:GetText()
                        HealBot_Options_BuffExtraItem3:SetText(HealBot_Config_Buffs.CustomItemName[3])
                        if HealBot_Config_Buffs.CustomBuffName[3]=="" then
                            HealBot_Config_Buffs.CustomBuffName[3]=HealBot_Config_Buffs.CustomItemName[3]
                            HealBot_Options_BuffExtraBuff3:SetText(HealBot_Config_Buffs.CustomBuffName[3])
                        end
                        HealBot_Options_BuffExtraItems3_HelpItemSelect_OnClick()
                        HealBot_Timers_Set("AURA","BuffReset")
                    end
        info.checked = false;
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BuffWellFedItems_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local BuffDropItems = HealBot_retWellFedItems()

    info.text = HEALBOT_WORDS_NONE;
    info.func = function(self)
                    HealBot_Config_Buffs.WellFedItem=""
                    HealBot_Options_BuffWellFedItem:SetText(HealBot_Config_Buffs.WellFedItem)
                    HealBot_Options_BuffWellFedItem_HelpItemSelect_OnClick()
                    HealBot_Timers_Set("AURA","BuffReset")
                end
    info.checked = false;
    UIDropDownMenu_AddButton(info);
    for iName,_ in pairs(BuffDropItems) do
        info.text = iName;
        info.func = function(self)
                        HealBot_Config_Buffs.WellFedItem=self:GetText()
                        HealBot_Options_BuffWellFedItem:SetText(HealBot_Config_Buffs.WellFedItem)
                        HealBot_Options_BuffWellFedItem_HelpItemSelect_OnClick()
                        HealBot_Timers_Set("AURA","BuffReset")
                    end
        info.checked = false;
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BackupBuffWellFedItems_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local BuffDropItems = HealBot_retWellFedItems()

    info.text = HEALBOT_WORDS_NONE;
    info.func = function(self)
                    HealBot_Config_Buffs.BackupWellFedItem=""
                    HealBot_Options_BuffBackupWellFedItem:SetText(HealBot_Config_Buffs.BackupWellFedItem)
                    HealBot_Options_BuffBackupWellFedItem_HelpItemSelect_OnClick()
                    HealBot_Timers_Set("AURA","BuffReset")
                end
    info.checked = false;
    UIDropDownMenu_AddButton(info);
    for iName,_ in pairs(BuffDropItems) do
        info.text = iName;
        info.func = function(self)
                        HealBot_Config_Buffs.BackupWellFedItem=self:GetText()
                        HealBot_Options_BuffBackupWellFedItem:SetText(HealBot_Config_Buffs.BackupWellFedItem)
                        HealBot_Options_BuffBackupWellFedItem_HelpItemSelect_OnClick()
                        HealBot_Timers_Set("AURA","BuffReset")
                    end
        info.checked = false;
        UIDropDownMenu_AddButton(info);
    end
end
--------------------------------------------------------------------------------

function HealBot_Options_CDCTxt_DropDown(object, id)
    local DebuffSpells_List = HealBot_Options_GetDebuffSpells_List(HealBot_Data["PCLASSTRIM"])
    table.sort(DebuffSpells_List)
    local RacialDebuffSpells_List = HealBot_Options_GetRacialDebuffSpells_List(HealBot_Data["PRACE_EN"])
    table.sort(RacialDebuffSpells_List)
    local info = UIDropDownMenu_CreateInfo()
    info.text = HEALBOT_WORDS_NONE;
    info.func = function(self)
                    HealBot_Config_Cures.HealBotDebuffText[HealBot_Options_getDropDownId_bySpec(id)] = self:GetText()
                    HealBot_Timers_Set("AURA","DebuffReset")
                    UIDropDownMenu_SetText(object,HEALBOT_WORDS_NONE)
                end
    info.checked = false;
    if HealBot_Config_Cures.HealBotDebuffText[HealBot_Options_getDropDownId_bySpec(id)]==HEALBOT_WORDS_NONE then info.checked = true end
    UIDropDownMenu_AddButton(info);
    for j=1, getn(DebuffSpells_List), 1 do
        local sName=HealBot_KnownSpell(DebuffSpells_List[j])
        if sName then
            info.text = sName;
            info.func = function(self)
                            HealBot_Config_Cures.HealBotDebuffText[HealBot_Options_getDropDownId_bySpec(id)] = self:GetText()
                            HealBot_Timers_Set("AURA","DebuffReset")
                            UIDropDownMenu_SetText(object,sName)
                        end
            info.checked = false;
            if HealBot_Config_Cures.HealBotDebuffText[HealBot_Options_getDropDownId_bySpec(id)]==sName then info.checked = true end
            UIDropDownMenu_AddButton(info);
        end
    end
    for j=1, getn(RacialDebuffSpells_List), 1 do
        local rName = HealBot_KnownSpell(RacialDebuffSpells_List[j]);
        info.text = rName
        info.func = function(self)
                        HealBot_Config_Cures.HealBotDebuffText[HealBot_Options_getDropDownId_bySpec(id)] = self:GetText()
                        HealBot_Timers_Set("AURA","DebuffReset")
                        UIDropDownMenu_SetText(object,rName)
                    end
        info.checked = false;
        if HealBot_Config_Cures.HealBotDebuffText[HealBot_Options_getDropDownId_bySpec(id)]==rName then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
    for j=1, getn(HealBot_Options_Lists["DebuffItems"]), 1 do
        local iName = GetItemInfo(HealBot_Options_Lists["DebuffItems"][j]);
        if iName then
            info.text = iName
            info.func = function(self)
                            HealBot_Config_Cures.HealBotDebuffText[HealBot_Options_getDropDownId_bySpec(id)] = self:GetText()
                            HealBot_Timers_Set("AURA","DebuffReset")
                            UIDropDownMenu_SetText(object,iName)
                        end
            info.checked = false;
            if HealBot_Config_Cures.HealBotDebuffText[HealBot_Options_getDropDownId_bySpec(id)]==iName then info.checked = true end
            UIDropDownMenu_AddButton(info);
        end
    end
end

function HealBot_Options_CDCTxt1_DropDown()
    HealBot_Options_CDCTxt_DropDown(HealBot_Options_CDCTxt1, 1)
end

function HealBot_Options_CDCTxt2_DropDown()
    HealBot_Options_CDCTxt_DropDown(HealBot_Options_CDCTxt2, 2)
end

function HealBot_Options_CDCTxt3_DropDown()
    HealBot_Options_CDCTxt_DropDown(HealBot_Options_CDCTxt3, 3)
end

function HealBot_Options_CDCGroups_DropDown(object, id)
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_BuffTxt_List), 1 do
        info.text = HealBot_Options_BuffTxt_List[j];
        info.func = function(self)
                        HealBot_Config_Cures.HealBotDebuffDropDown[HealBot_Options_getDropDownId_bySpec(id)] = self:GetID()
                        UIDropDownMenu_SetText(object,HealBot_Options_BuffTxt_List[HealBot_Config_Cures.HealBotDebuffDropDown[HealBot_Options_getDropDownId_bySpec(id)]]) 
                        ClickedBuffGroupDD=id
                        HealBot_Timers_Set("AURA","DebuffReset")
                    end
        info.checked = false;
        if HealBot_Config_Cures.HealBotDebuffDropDown[HealBot_Options_getDropDownId_bySpec(id)]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_CDCGroups1_DropDown()
    HealBot_Options_CDCGroups_DropDown(HealBot_Options_CDCGroups1, 1)
end

function HealBot_Options_CDCGroups2_DropDown()
    HealBot_Options_CDCGroups_DropDown(HealBot_Options_CDCGroups2, 2)
end

function HealBot_Options_CDCGroups3_DropDown()
    HealBot_Options_CDCGroups_DropDown(HealBot_Options_CDCGroups3, 3)
end

function HealBot_Options_CDCPriority_DropDown(object, dType)
    local info = UIDropDownMenu_CreateInfo()
    for j=1, 20, 1 do
        info.text = j;
        info.func = function(self)
                        HealBot_Config_Cures.HealBotDebuffPriority[dType] = self:GetID()
                        UIDropDownMenu_SetText(object,HealBot_Config_Cures.HealBotDebuffPriority[dType]) 
                        HealBot_Timers_Set("AURA","CustomDebuffListPrep")
                    end
        info.checked = false;
        if HealBot_Config_Cures.HealBotDebuffPriority[dType]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_CDCPriority1_DropDown()
    HealBot_Options_CDCPriority_DropDown(HealBot_Options_CDCPriority1, HEALBOT_DISEASE_en)
end

function HealBot_Options_CDCPriority2_DropDown()
    HealBot_Options_CDCPriority_DropDown(HealBot_Options_CDCPriority2, HEALBOT_MAGIC_en)
end

function HealBot_Options_CDCPriority3_DropDown()
    HealBot_Options_CDCPriority_DropDown(HealBot_Options_CDCPriority3, HEALBOT_POISON_en)
end

function HealBot_Options_CDCPriority4_DropDown()
    HealBot_Options_CDCPriority_DropDown(HealBot_Options_CDCPriority4, HEALBOT_CURSE_en)
end

function HealBot_Options_CDCPriorityC_DropDown()
    local s,e=1,20
    local info = UIDropDownMenu_CreateInfo()
--    if HealBot_Options_luVars["CDebuffcustomNameDefault"]==HEALBOT_CUSTOM_CAT_CUSTOM_AUTOMATIC then
--        s,e=15,15
--    end
    for j=s, e, 1 do
        info.text = j;
        info.func = function(self)
                        local x=self:GetID()
                        if HealBot_Options_luVars["CDebuffcustomSpellID"] then
                            HealBot_Globals.HealBot_Custom_Debuffs[HealBot_Options_luVars["CDebuffcustomSpellID"]] = x
                            HealBot_Options_CDC_checkStatus(HealBot_Options_luVars["CDebuffcustomSpellID"])
                            HealBot_Timers_Set("AURA","DebuffPriority")
                        end
                        UIDropDownMenu_SetSelectedID(HealBot_Options_CDCPriorityC,x) 
                        HealBot_Timers_Set("AURA","CustomDebuffListPrep")
                    end
        info.checked = false;
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_BuffPriorityC_DropDown()
    local s,e=1,20
    local info = UIDropDownMenu_CreateInfo()
--    if HealBot_Options_luVars["CDebuffcustomNameDefault"]==HEALBOT_CUSTOM_CAT_CUSTOM_AUTOMATIC then
--        s,e=15,15
--    end
    for j=s, e, 1 do
        info.text = j;
        info.func = function(self)
                        local x=self:GetID()
                        if HealBot_Options_luVars["HoTname"] then
                            local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
                            if sId then 
                                HealBot_Globals.HealBot_Custom_Buffs[sId] = x
                                local sName=HealBot_Options_SpellGetName(sId)
                                if sName then HealBot_Globals.HealBot_Custom_Buffs[sName] = x end
                                HealBot_Timers_Set("AURA","ConfigClassHoT")
                                HealBot_Timers_Set("AURA","ResetBuffCache")
                                HealBot_Options_CustomBuffs_checkStatus(sId)
                            end
                        end
                        UIDropDownMenu_SetSelectedID(HealBot_Options_BuffPriorityC,x) 
                        HealBot_Timers_Set("AURA","CustomBuffListPrep")
                    end
        info.checked = false;
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_CustomBuffs_checkStatus(spellId)
    if not HealBot_Globals.CustomBuffBarColour[spellId] then
        HealBot_Globals.CustomBuffBarColour[spellId]={}
        HealBot_Globals.CustomBuffBarColour[spellId].R = HealBot_Globals.CustomBuffBarColour[customBuffPriority].R
        HealBot_Globals.CustomBuffBarColour[spellId].G = HealBot_Globals.CustomBuffBarColour[customBuffPriority].G
        HealBot_Globals.CustomBuffBarColour[spellId].B = HealBot_Globals.CustomBuffBarColour[customBuffPriority].B
        HealBot_SetCustomBuffBarColours()
    end
end

function HealBot_Options_CDC_checkStatus(cName)
    if not cName then return end
    
    if (HealBot_GlobalsDefaults.HealBot_Custom_Debuffs[cName] or 0)~=HealBot_Globals.HealBot_Custom_Debuffs[cName] then
        if not HealBot_Globals.CDCBarColour[cName] then
            HealBot_Globals.CDCBarColour[cName]={}
            HealBot_Globals.CDCBarColour[cName].R = HealBot_Globals.CDCBarColour[customDebuffPriority].R
            HealBot_Globals.CDCBarColour[cName].G = HealBot_Globals.CDCBarColour[customDebuffPriority].G
            HealBot_Globals.CDCBarColour[cName].B = HealBot_Globals.CDCBarColour[customDebuffPriority].B
            HealBot_SetCDCBarColours()
        end
    end
end

function HealBot_Options_CDCWarnRange_DropDown(id, var)
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["RangeWarning"]), 1 do
        info.text = HealBot_Options_Lists["RangeWarning"][j];
        info.func = function(self)
                        if id==1 then
                            HealBot_Config_Cures.HealBot_CDCWarnRange_Bar=self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_CDCWarnRange1,HealBot_Options_Lists["RangeWarning"][HealBot_Config_Cures.HealBot_CDCWarnRange_Bar])
                        elseif id==3 then
                            HealBot_Config_Cures.HealBot_CDCWarnRange_Screen = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_CDCWarnRange3,HealBot_Options_Lists["RangeWarning"][HealBot_Config_Cures.HealBot_CDCWarnRange_Screen]) 
                        else
                            HealBot_Config_Cures.HealBot_CDCWarnRange_Sound = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_CDCWarnRange4,HealBot_Options_Lists["RangeWarning"][HealBot_Config_Cures.HealBot_CDCWarnRange_Sound]) 
                        end
                    end
        info.checked = false;
        if var==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_CDCWarnRange1_DropDown()
    HealBot_Options_CDCWarnRange_DropDown(1, HealBot_Config_Cures.HealBot_CDCWarnRange_Bar)
end

function HealBot_Options_CDCWarnRange3_DropDown()
    HealBot_Options_CDCWarnRange_DropDown(3, HealBot_Config_Cures.HealBot_CDCWarnRange_Screen)
end

function HealBot_Options_CDCWarnRange4_DropDown()
    HealBot_Options_CDCWarnRange_DropDown(4, HealBot_Config_Cures.HealBot_CDCWarnRange_Sound)
end

HealBot_Options_luVars["CDebuffCatID"] = 2

function HealBot_Options_CDebuffTextID(dName)
    local cdName=dName
    local name, _, _, _, _, _, spellId = GetSpellInfo(dName)
    if name and spellId then cdName=name.." ("..spellId..")" end
    return cdName
end

function HealBot_Options_CDebuffCat_genList()
    local tmpCDebuffCat_List={}
    local j=0
    local dText=""
    for dID,x in pairs(HealBot_Globals.Custom_Debuff_Categories) do
        if HealBot_Options_luVars["CDebuffCatID"]==x and HealBot_Globals.HealBot_Custom_Debuffs[dID] then
            local dName=HealBot_Options_CDebuffTextID(dID)
            if tonumber(dName) == nil then
                table.insert(tmpCDebuffCat_List, dName)
                j=j+1
            else
                HealBot_Options_DeleteCDebuff(dID, dName)
            end
        end
    end
    local x=nil
    if j>0 then
        table.sort(tmpCDebuffCat_List)
        for j=1, getn(tmpCDebuffCat_List), 1 do
            dText=HealBot_Options_CDebuffGetId(tmpCDebuffCat_List[j])
            if dText==HealBot_Options_luVars["CDebuffcustomSpellID"] then
                HealBot_Options_luVars["CDebuffcustomID"]=j
                x=true
                break
            end
        end
    end
    if not x then 
        HealBot_Options_luVars["CDebuffcustomID"]=1 
        dText=HealBot_Options_CDebuffGetId(tmpCDebuffCat_List[HealBot_Options_luVars["CDebuffcustomID"]])
        HealBot_Options_luVars["CDebuffcustomNameDefault"]=dText
        HealBot_Options_CDebuffCatNameUpdate()
    end
    dText=HealBot_Options_CDebuffGetId(tmpCDebuffCat_List[HealBot_Options_luVars["CDebuffcustomID"]])
    HealBot_Options_luVars["CDebuffcustomSpellID"]=dText
    return tmpCDebuffCat_List
end

function HealBot_Options_CDebuffCat_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Lists["CDebuffCat"]), 1 do
        info.text = HealBot_Options_Lists["CDebuffCat"][j];
        info.func = function(self)
                        if HealBot_Options_luVars["CDebuffCatID"]~=self:GetID() then
                            HealBot_Options_luVars["CDebuffCatID"] = self:GetID()
                            UIDropDownMenu_SetText(HealBot_Options_CDebuffCat,HealBot_Options_Lists["CDebuffCat"][HealBot_Options_luVars["CDebuffCatID"]]) 
                            HealBot_Options_luVars["CDebuffcustomNameDefault"]=HealBot_Options_luVars["CDebuffcustomSpellID"]       
                            local CDebuffCat_List = HealBot_Options_CDebuffCat_genList()
                            HealBot_Options_luVars["numCustomDebuffs"]=#CDebuffCat_List
                            HealBot_Options_CDebuffCatNameUpdate()
                            HealBot_SetCDCBarColours();
                            HealBot_Options_ResetUpdate()
                            if HealBot_Options_luVars["CDebuffCatID"]==1 then
                                HealBot_Options_NewCDebuff:Disable();
                                HealBot_Options_NewCDebuff:SetText("")
                            else
                                HealBot_Options_NewCDebuff:Enable();
                            end
                        end
                    end
        info.checked = false;
        if HealBot_Options_luVars["CDebuffCatID"]==j then info.checked = true end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_CDebuffGetId(cdText)
    local rText=cdText
    if cdText then
        local s=string.find(cdText, "%(%d")
        local e=string.find(cdText, "%d%)")
        if s and e then
            rText=tonumber(string.sub(cdText,s+1,e))
        elseif HealBot_Spell_Names[cdText] then
            rText=HealBot_Spell_Names[cdText]
        elseif GetSpellInfo(cdText) then
            _, _, _, _, _, _, rText=GetSpellInfo(cdText)
        end
    end
    return rText
end

function HealBot_Options_CDebuffTxt1_DropDown(self, level, menuList)
    local info = UIDropDownMenu_CreateInfo()
    local CDebuffCat_List = HealBot_Options_CDebuffCat_genList()
    if getn(CDebuffCat_List) > 10 then
        if level == 1 then
            for j=1, ceil(getn(CDebuffCat_List)/10), 1 do
                local n=j*10
                if n > getn(CDebuffCat_List) then n=getn(CDebuffCat_List) end
                info.text = "    "..((j*10)-9).." - "..n;
                info.hasArrow = true
                info.notCheckable = true
                info.menuList = j, true, j
                UIDropDownMenu_AddButton(info)
            end
        else 
            local n=menuList*10
            local dText=nil
            if n > getn(CDebuffCat_List) then n=getn(CDebuffCat_List) end
            for j=((menuList*10)-9), n, 1 do
                info.text = CDebuffCat_List[j];
                info.func = function(self)
                                if HealBot_Options_luVars["CDebuffcustomID"]~=self:GetID() or HealBot_Options_luVars["CDClvl"]~=menuList then
                                    HealBot_Options_luVars["CDClvl"]=menuList
                                    HealBot_Options_luVars["CDebuffcustomID"] = self:GetID()
                                    local cdText=self.value
                                    dText=HealBot_Options_CDebuffGetId(cdText)
                                    HealBot_Options_luVars["CDebuffcustomSpellID"]=dText
                                    HealBot_Options_luVars["CDebuffcustomNameDefault"]=dText
                                    UIDropDownMenu_SetText(HealBot_Options_CDebuffTxt1,cdText) 
                                    HealBot_Options_ResetUpdate()
                                    HealBot_SetCDCBarColours()
                                end
                            end
                info.checked = false;
                dText=HealBot_Options_CDebuffGetId(CDebuffCat_List[j])
                if HealBot_Options_luVars["CDebuffcustomSpellID"]==dText then info.checked = true end
                UIDropDownMenu_AddButton(info, level);
            end
        end
    else
        local dText=nil
        for j=1, getn(CDebuffCat_List), 1 do
            info.text = CDebuffCat_List[j];
            info.func = function(self)
                            if HealBot_Options_luVars["CDebuffcustomID"]~=self:GetID() then
                                HealBot_Options_luVars["CDebuffcustomID"] = self:GetID()
                                local cdText=self.value
                                dText=HealBot_Options_CDebuffGetId(cdText)
                                HealBot_Options_luVars["CDebuffcustomSpellID"]=dText
                                HealBot_Options_luVars["CDebuffcustomNameDefault"]=dText
                                UIDropDownMenu_SetText(HealBot_Options_CDebuffTxt1,cdText) 
                                HealBot_Options_ResetUpdate()
                                HealBot_SetCDCBarColours()
                            end
                        end
            info.checked = false;
            dText=HealBot_Options_CDebuffGetId(CDebuffCat_List[j])
            if HealBot_Options_luVars["CDebuffcustomSpellID"]==dText then info.checked = true end
            UIDropDownMenu_AddButton(info);
        end
    end
    HealBot_Options_luVars["numCustomDebuffs"]=#CDebuffCat_List
    HealBot_Options_CDebuffCatNameUpdate()
end

HealBot_Options_luVars["numCustomDebuffs"]=0
function HealBot_Options_CDebuffCatNameUpdate()
    if HealBot_Options_luVars["CDebuffCatID"]==1 or HealBot_Options_luVars["numCustomDebuffs"]==0 then
        HealBot_Options_luVars["customDebuffPriority"]=15
        local g=_G["HealBot_Options_CDCPriorityCustomText"]
        g:SetText(HealBot_Options_luVars["customDebuffPriority"]);
        HealBot_Options_DeleteCDebuffBtn:Disable();
        HealBot_Options_ResetCDebuffBtn:Disable();
        HealBot_Options_NewCDebuffBtn:Disable();
        HealBot_Options_CDCCastBy:Hide();
        HealBot_Options_CDCIDMethod:Hide();
        HealBot_Options_CDCCastByCustom:Show()
        HealBot_Options_CDCIDMethodCustom:Show()
        HealBot_Options_CDCPriorityCustom:Show()
        HealBot_Options_CDCPriorityC:Hide()
        HealBot_Options_CDCIconGlow:Hide()
        HealBot_Options_CDCIconGlowCustom:Show()
        HealBot_Options_CDCIconSet:Hide()
        HealBot_Options_CDCIconSetCustom:Show()
        if HealBot_Options_luVars["CDebuffCatID"]>1 then
            HealBot_CustomColorpickb:Disable();
            HealBot_Options_CustomDebuffPresetColour:Disable();
            HealBot_Options_CDCCol:Hide();
            HealBot_Options_CDCColCustom:Show()
        else
            HealBot_CustomColorpickb:Enable();
            HealBot_Options_CustomDebuffPresetColour:Enable();
            HealBot_Options_CDCCol:Show();
            HealBot_Options_CDCColCustom:Hide()
        end
    else
        if HealBot_GlobalsDefaults.HealBot_Custom_Debuffs[HealBot_Options_luVars["CDebuffcustomNameDefault"]] then
            HealBot_Options_luVars["customDebuffPriority"]=HealBot_GlobalsDefaults.HealBot_Custom_Debuffs[HealBot_Options_luVars["CDebuffcustomNameDefault"]]
        end
        HealBot_Options_CDCCastByCustom:Hide()
        HealBot_Options_CDCIDMethodCustom:Hide()
        HealBot_Options_CDCPriorityCustom:Hide()
        HealBot_Options_CDCCastBy:Show();
        HealBot_Options_CDCIDMethod:Show();
        HealBot_Options_CDCPriorityC:Show();        
        HealBot_Options_DeleteCDebuffBtn:Enable();
        HealBot_Options_ResetCDebuffBtn:Enable();
        HealBot_CustomColorpickb:Enable();
        HealBot_Options_CustomDebuffPresetColour:Enable();
        HealBot_Options_CDCCol:Show();
        HealBot_Options_CDCColCustom:Hide();
        HealBot_Options_CDCIconGlow:Show()
        HealBot_Options_CDCIconGlowCustom:Hide()
        HealBot_Options_CDCIconSetCustom:Hide()
        HealBot_Options_CDCIconSet:Show()
    end
end

function HealBot_Options_CDCIDMethod_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    for j=1, getn(HealBot_Options_Class_HoTctlIDMethod_List), 1 do
        info.text = HealBot_Options_Class_HoTctlIDMethod_List[j]
        info.func = function(self)
                        local y=self:GetID()
                        if y<3 then
                            HealBot_Globals.CustomDebuffIDMethod[HealBot_Options_luVars["CDebuffcustomSpellID"]]=y
                        elseif HealBot_Options_luVars["CDebuffcustomSpellID"] then
                            HealBot_Globals.CustomDebuffIDMethod[HealBot_Options_luVars["CDebuffcustomSpellID"]]=nil
                        end 
                        UIDropDownMenu_SetText(HealBot_Options_CDCIDMethod,HealBot_Options_Class_HoTctlIDMethod_List[j])
                        HealBot_Timers_Set("AURA","DebuffPriority")
                    end
        info.checked = false;
        if (HealBot_Globals.CustomDebuffIDMethod[HealBot_Options_luVars["CDebuffcustomSpellID"]] or 3)==j then info.checked = true; end 
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_CDCCastBy_DropDown()
    local info = UIDropDownMenu_CreateInfo()
    local cby = nil
    if HealBot_Globals.CureCustomDefaultCastBy==1 then
        cby = HEALBOT_CUSTOM_CASTBY_EVERYONE
    else
        cby = HEALBOT_CUSTOM_CASTBY_ENEMY
    end
    for j=1, getn(HealBot_CDebuffCasyBy_List), 1 do
        info.text = HealBot_CDebuffCasyBy_List[j];
        info.func = function(self)
                        HealBot_Options_luVars["CDebuffcustomCastBy"] = self:GetText()
                        if HealBot_Options_luVars["CDebuffcustomSpellID"] and self:GetID()>=1 and cby~=HealBot_CDebuffCasyBy_List[j] then
                            HealBot_Globals.FilterCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]]=self:GetID()
                        elseif HealBot_Options_luVars["CDebuffcustomSpellID"] then
                            HealBot_Globals.FilterCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]]=nil
                        end
                        HealBot_Timers_Set("AURA","CustomDebuffFilterCastBy")
                        HealBot_Timers_Set("AURA","ResetDebuffCache")
                        UIDropDownMenu_SetText(HealBot_Options_CDCCastBy,HealBot_Options_luVars["CDebuffcustomCastBy"]) 
                    end
        info.checked = false;
        if HealBot_Options_luVars["CDebuffcustomSpellID"] then
            local x=HealBot_Globals.FilterCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]] or 0
            if x==0 then
                if cby and cby==HealBot_CDebuffCasyBy_List[j] then x=j; end
            end
            if x==j then info.checked = true; end 
        end
        UIDropDownMenu_AddButton(info);
    end
end

function HealBot_Options_NewCDebuff_OnTextChanged(self)
    local text = strtrim(self:GetText())
    if strlen(text)>0 and HealBot_Options_luVars["CDebuffCatID"]>1 then
        HealBot_Options_NewCDebuffBtn:Enable();
    else
        HealBot_Options_NewCDebuffBtn:Disable();
    end
end

function HealBot_Options_NewHoTBuff_OnTextChanged(self)
    local text = strtrim(self:GetText())
    if strlen(text)>0 then
        HealBot_Options_NewBuffHoTBtn:Enable();
    else
        HealBot_Options_NewBuffHoTBtn:Disable();
    end
end

function HealBot_Options_CDebuffTag_OnTextChanged(self)
    local text = strtrim(self:GetText())
    if strlen(text)>0 and HealBot_Options_luVars["CDebuffcustomSpellID"] then
        HealBot_Globals.CDCTag[HealBot_Options_luVars["CDebuffcustomSpellID"]]=text
    elseif HealBot_Options_luVars["CDebuffcustomSpellID"] then
        HealBot_Globals.CDCTag[HealBot_Options_luVars["CDebuffcustomSpellID"]]=nil
    end
    HealBot_Timers_Set("AURA","CustomDebuffListPrep")
end

function HealBot_Options_HoTBuffTag_OnTextChanged(self)
    local text = strtrim(self:GetText())
    local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
    if strlen(text)>0 and sId then
        HealBot_Globals.CustomBuffTag[sId]=text
    elseif sId then
        HealBot_Globals.CustomBuffTag[sId]=nil
    end
    HealBot_Timers_Set("AURA","CustomBuffListPrep")
end

function HealBot_Options_BuffResetList()
    local BuffCat_List = HealBot_Options_Class_HoTctlName_genList()
    HealBot_Options_luVars["numCustomBuffs"]=#BuffCat_List
    HealBot_Options_BuffCatNameUpdate()
    HealBot_Options_ResetUpdate()
end

function HealBot_Options_NewCDebuffBtn_OnClick(NewCDebuffTxt)
    local name, _, _, _, _, _, spellId = GetSpellInfo(NewCDebuffTxt)
    local useId=NewCDebuffTxt
    if spellId then 
        useId=spellId 
    end
    if not name then name=NewCDebuffTxt end
    local unique=true;
    for k, _ in pairs(HealBot_Globals.HealBot_Custom_Debuffs) do
        if k==useId then unique=false; end
    end
    if unique then
        HealBot_Globals.HealBot_Custom_Debuffs[useId]=10;
        HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[useId]=3;
    end
    HealBot_Globals.Custom_Debuff_Categories[useId]=HealBot_Options_luVars["CDebuffCatID"]
    HealBot_Options_luVars["CDebuffcustomSpellID"]=useId
    HealBot_Options_NewCDebuff:SetText("")
    HealBot_Options_CDC_checkStatus(useId)
  --  UIDropDownMenu_SetSelectedValue(HealBot_Options_CDebuffTxt1, useId);
    HealBot_Timers_Set("AURA","DebuffPriority")
    HealBot_Timers_Set("AURA","CheckUnits")
    HealBot_Options_ResetUpdate()
end

function HealBot_Options_UpperFirstChar(str)
    if type(str)=="string" then
        return string.upper(string.sub(str,1,1))..string.sub(str,2)
    else 
        return str
    end
end

function HealBot_Options_NewCDebuffBtn_SetCat(debuff)
    debuff=HealBot_Options_UpperFirstChar(debuff)
    local name = GetSpellInfo(debuff) or debuff
    if name then
        name=string.sub(name,1,1)
        if string.find(name,"A") or string.find(name,"B") then
            HealBot_Options_luVars["CDebuffCatID"]=2
        elseif string.find(name,"C") or string.find(name,"D") then
            HealBot_Options_luVars["CDebuffCatID"]=3
        elseif string.find(name,"E") or string.find(name,"F") then
            HealBot_Options_luVars["CDebuffCatID"]=4
        elseif string.find(name,"G") or string.find(name,"H") then
            HealBot_Options_luVars["CDebuffCatID"]=5
        elseif string.find(name,"I") or string.find(name,"J") then
            HealBot_Options_luVars["CDebuffCatID"]=6
        elseif string.find(name,"K") or string.find(name,"L") then
            HealBot_Options_luVars["CDebuffCatID"]=7
        elseif string.find(name,"M") or string.find(name,"N") then
            HealBot_Options_luVars["CDebuffCatID"]=8
        elseif string.find(name,"O") or string.find(name,"P") then
            HealBot_Options_luVars["CDebuffCatID"]=9
        elseif string.find(name,"Q") or string.find(name,"R") then
            HealBot_Options_luVars["CDebuffCatID"]=10
        elseif string.find(name,"S") or string.find(name,"T") then
            HealBot_Options_luVars["CDebuffCatID"]=11
        elseif string.find(name,"U") or string.find(name,"V") then
            HealBot_Options_luVars["CDebuffCatID"]=12
        elseif string.find(name,"W") or string.find(name,"Y") then
            HealBot_Options_luVars["CDebuffCatID"]=13
        elseif string.find(name,"X") or string.find(name,"Z") then
            HealBot_Options_luVars["CDebuffCatID"]=14
        end
        UIDropDownMenu_SetText(HealBot_Options_CDebuffCat, HealBot_Options_Lists["CDebuffCat"][HealBot_Options_luVars["CDebuffCatID"]])
    end
    HealBot_Options_NewCDebuffBtn_OnClick(debuff)
end

function HealBot_Options_NewHoTBuffBtn_OnClick(NewHoTBuffTxt, class)
    NewHoTBuffTxt=HealBot_Options_UpperFirstChar(NewHoTBuffTxt)
    local name, _, _, _, _, _, spellId = GetSpellInfo(NewHoTBuffTxt)
    local useId=NewHoTBuffTxt
    local cClass=class or HealBot_Options_luVars["FilterHoTctlNameTrim"]
    if spellId then useId=spellId end
    if not name then name=NewHoTBuffTxt end
    local unique=true;
    local hbClassHoTwatch=HealBot_Globals.WatchHoT
    for xClass,_  in pairs(hbClassHoTwatch) do
        local HealBot_configClassHoTClass=HealBot_Globals.WatchHoT[xClass]
        for bId,x  in pairs(HealBot_configClassHoTClass) do
            if bId==useId then unique=false; end
        end
    end
    if unique then
        HealBot_Globals.WatchHoT[cClass][useId]=2
    end
    HealBot_Options_NewBuffHoT:SetText("")
    HealBot_Options_luVars["HoTname"]=HealBot_Options_CDebuffTextID(useId)
    HealBot_Timers_Set("AURA","BuffResetList")
    HealBot_Timers_Set("AURA","ConfigClassHoT")
    HealBot_Timers_Set("AURA","ResetBuffCache")
end

function HealBot_Options_ConfirmNewCDebuff()
    local NewCDebuffTxt=strtrim(HealBot_Options_NewCDebuff:GetText())
    local name, _, _, _, _, _, _ = GetSpellInfo(NewCDebuffTxt)
    if not name then name=NewCDebuffTxt end
    if NewCDebuffTxt and NewCDebuffTxt~="" then
        StaticPopupDialogs["HEALBOT_OPTIONS_NEWCDEBUFF"] = {
            text = HEALBOT_OPTIONS_SAVESKIN..": "..(name or NewCDebuffTxt),
            button1 = HEALBOT_WORDS_YES,
            button2 = HEALBOT_WORDS_NO,
            OnAccept = function()
                HealBot_Options_NewCDebuffBtn_SetCat(NewCDebuffTxt)
            end,
            timeout = 0,
            whileDead = 1,
            hideOnEscape = 1
        };
    
        StaticPopup_Show ("HEALBOT_OPTIONS_NEWCDEBUFF", NewCDebuffTxt);
    else
            StaticPopupDialogs["HEALBOT_OPTIONS_ERROR"] = {
                text = HEALBOT_WORDS_ERROR..": %s",
                button1 = OKAY,
                showAlert = 1,
                timeout = 0,
                whileDead = 1,
                hideOnEscape = 1
            };
        
            StaticPopup_Show ("HEALBOT_OPTIONS_ERROR", HEALBOT_SPELL_NOT_FOUND);
    end
end

function HealBot_Options_ConfirmNewHoTBuff()
    local NewHoTBuffTxt=strtrim(HealBot_Options_NewBuffHoT:GetText())
    local name, _, _, _, _, _, _ = GetSpellInfo(NewHoTBuffTxt)
    if not name then name=NewHoTBuffTxt end
    if NewHoTBuffTxt and NewHoTBuffTxt~="" then
        StaticPopupDialogs["HEALBOT_OPTIONS_NEWCDEBUFF"] = {
            text = HEALBOT_OPTIONS_SAVESKIN..": "..name,
            button1 = HEALBOT_WORDS_YES,
            button2 = HEALBOT_WORDS_NO,
            OnAccept = function()
                HealBot_Options_NewHoTBuffBtn_OnClick(NewHoTBuffTxt)
            end,
            timeout = 0,
            whileDead = 1,
            hideOnEscape = 1
        };
    
        StaticPopup_Show ("HEALBOT_OPTIONS_NEWCDEBUFF", NewHoTBuffTxt);
    else
            StaticPopupDialogs["HEALBOT_OPTIONS_ERROR"] = {
                text = HEALBOT_WORDS_ERROR..": %s",
                button1 = OKAY,
                showAlert = 1,
                timeout = 0,
                whileDead = 1,
                hideOnEscape = 1
            };
        
            StaticPopup_Show ("HEALBOT_OPTIONS_ERROR", HEALBOT_SPELL_NOT_FOUND);
    end
end

function HealBot_Options_DeleteCDebuff(dId, dName)
    HealBot_Globals.Custom_Debuff_Categories[dId]=nil;
    HealBot_Globals.HealBot_Custom_Debuffs[dId]=nil;
    HealBot_Globals.CDCBarColour[dId]=nil
    HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[dId]=nil
    HealBot_Globals.FilterCustomDebuff[dId]=nil
    HealBot_Globals.IgnoreCustomDebuff[dId]=nil
    HealBot_Globals.CustomDebuffIDMethod[dId]=nil
    HealBot_Globals.HealBot_Custom_Debuffs[dName]=nil;
    HealBot_Globals.CDCBarColour[dName]=nil
    HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[dName]=nil
    HealBot_Globals.FilterCustomDebuff[dName]=nil
    HealBot_Globals.IgnoreCustomDebuff[dName]=nil
    HealBot_AddDebug("Delete debuff id="..dId.." name="..(dName or "nil"), "Aura", true)
    local sName=HealBot_Options_SpellGetName(sId)
    if sName and sName~=dName then 
        HealBot_Globals.HealBot_Custom_Debuffs[sName]=nil;
        HealBot_Globals.CDCBarColour[sName]=nil
        HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[sName]=nil
        HealBot_Globals.FilterCustomDebuff[sName]=nil
        HealBot_Globals.IgnoreCustomDebuff[sName]=nil
    end
    HealBot_Options_setDebuffPriority()
    HealBot_SetCDCBarColours();
    HealBot_Options_ResetUpdate()
end

function HealBot_Options_DeleteCDebuffBtn_OnClick()
    local sName=HealBot_Options_SpellGetName(HealBot_Options_luVars["CDebuffcustomSpellID"]) or "nil"
    HealBot_Options_DeleteCDebuff(HealBot_Options_luVars["CDebuffcustomSpellID"], sName)
    HealBot_Aura_ClearCustomDebuffsDone()
end

function HealBot_Options_DeleteBuffHoT(classTr, sId, bName)
    HealBot_Globals.WatchHoT[classTr][sId]=nil
    HealBot_Globals.IgnoreCustomBuff[sId]=nil
    HealBot_Globals.IgnoreCustomBuff[bName]=nil
    HealBot_Globals.CustomBuffIDMethod[sId]=nil
    HealBot_Globals.CustomBuffIDMethod[bName]=nil
    HealBot_Globals.HealBot_Custom_Buffs[sId]=nil
    HealBot_Globals.HealBot_Custom_Buffs[bName]=nil
    HealBot_Globals.CustomBuffBarColour[sId]=nil
    HealBot_Globals.CustomBuffBarColour[bName]=nil
    HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[sId]=nil
    HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[bName]=nil
    local sName=HealBot_Options_SpellGetName(sId)
    if sName and sName~=bName then 
        HealBot_Globals.IgnoreCustomBuff[sName]=nil
        HealBot_Globals.HealBot_Custom_Buffs[sName]=nil
        HealBot_Globals.CustomBuffBarColour[sName]=nil
        HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[sName]=nil
    end
    HealBot_Timers_Set("AURA","BuffResetList")
    HealBot_Timers_Set("AURA","ConfigClassHoT")
    HealBot_Timers_Set("AURA","ResetBuffCache")
end

function HealBot_Options_DeleteBuffHoTBtn_OnClick()
    local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"]) or "nil"
    HealBot_Options_DeleteBuffHoT(HealBot_Options_luVars["FilterHoTctlNameTrim"], sId, HealBot_Options_luVars["HoTname"])
end

function HealBot_Options_EnableDisableCDBtn_OnClick(self)
    local InstName=HealBot_Aura_retLuVars("mapName")
    if HealBot_Globals.IgnoreCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]] and
        (HealBot_Globals.IgnoreCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]][InstName] or HealBot_Globals.IgnoreCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]]["ALL"]) then
        if HealBot_Globals.IgnoreCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]][InstName] then
            HealBot_Globals.IgnoreCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]][InstName]=nil
            HealBot_Globals.IgnoreCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]]["ALL"]=true
        else
            HealBot_Globals.IgnoreCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]]["ALL"]=nil
        end
    else
        if not HealBot_Globals.IgnoreCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]] then
            HealBot_Globals.IgnoreCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]]={}
        end
        HealBot_Globals.IgnoreCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]][InstName]=true
    end
    HealBot_Options_SetEnableDisableCDBtn()
    HealBot_Timers_Set("AURA","ResetDebuffCache")
end

function HealBot_Options_DebuffIconUpdate()
    HealBot_Aura_ResetDebuffCache()
    HealBot_Aura_setCustomDebuffFilterDisabled()
    HealBot_Timers_Set("AURA","CheckUnits")
    HealBot_Options_SetEnableDisableCDBtn()
    HealBot_Timers_Set("AURA","CustomDebuffListPrep")
end

function HealBot_Options_DebuffIconScaleUpdate(button, scale)
    Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][button.frame][HealBot_Options_luVars["DebuffIconSet"]]["DSCALE"]=scale
    if HealBot_Options:IsVisible() then
        HealBot_Options_SkinsFramesIconsDebuffsGeneralTabIconScale()
    end
    HealBot_Timers_Set("SKINS","IconsFramesChanged")
end

function HealBot_Options_DebuffIconPrioUpdate(spellId, prio)
    HealBot_Globals.HealBot_Custom_Debuffs[spellId]=prio
    local sName=GetSpellInfo(spellId)
    if sName and HealBot_Globals.HealBot_Custom_Debuffs[sName] then
        HealBot_Globals.HealBot_Custom_Debuffs[sName]=prio
    end
    HealBot_Timers_Set("AURA","DebuffPriority")
    HealBot_Options_ResetUpdate()
    HealBot_Timers_Set("AURA","CustomDebuffListPrep")
end

function HealBot_Options_DebuffIconColUpdate(spellId, col)
    HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[spellId]=col
    local sName=GetSpellInfo(spellId)
    if sName then HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[sName]=col end
    HealBot_setLuVars("UpdateAllAura", 5)
    HealBot_Aura_setLuVars("updateAll", true)
    HealBot_Aura_ClearAllDebuffs()
    HealBot_Timers_Set("AURA","CheckUnits")
    HealBot_Options_ResetUpdate()
end

function HealBot_Options_DebuffIconGlowUpdate(spellId, glow)
    HealBot_Globals.HealBot_Custom_Debuffs_IconGlow[spellId]=glow
    local sName=GetSpellInfo(spellId)
    if sName then HealBot_Globals.HealBot_Custom_Debuffs_IconGlow[sName]=glow end
    HealBot_Timers_Set("AURA","UpdateAllIcons")
    HealBot_Options_ResetUpdate()
end

function HealBot_Options_DebuffIconSetUpdate(spellId, set)
    HealBot_Globals.HealBot_Custom_Debuffs_IconSet[spellId]=set
    local sName=GetSpellInfo(spellId)
    if sName then HealBot_Globals.HealBot_Custom_Debuffs_IconSet[sName]=set end
    HealBot_Aura_ResetDebuffCache()
    HealBot_Timers_Set("AURA","UpdateAllIcons",1)
    HealBot_Options_ResetUpdate()
end

function HealBot_Options_DebuffClick(button, id, click)
    local spellId=HealBot_Aura_ReturnDebuffSpellId(button.id, id)
    if spellId>0 then
        if click=="LeftButton" then 
            click="Left"
        elseif click=="MiddleButton" then 
            click="Middle"
        elseif click=="RightButton" then 
            click="Right"
        end
        local cmd=HealBot_Action_IconSpellPattern(click)
        if not HealBot_Globals.HealBot_Custom_Debuffs[spellId] then HealBot_Options_NewCDebuffBtn_SetCat(spellId) end
        if cmd==HEALBOT_IGNOREAURAALL then
            if not HealBot_Globals.IgnoreCustomDebuff[spellId] then HealBot_Globals.IgnoreCustomDebuff[spellId]={} end
            HealBot_Globals.IgnoreCustomDebuff[spellId]["ALL"]=true
            HealBot_Options_DebuffIconUpdate()
        elseif cmd==HEALBOT_ICONRAISEPRIO1 then
            if HealBot_Globals.HealBot_Custom_Debuffs[spellId] and HealBot_Globals.HealBot_Custom_Debuffs[spellId]>1 then
                HealBot_Options_DebuffIconPrioUpdate(spellId, HealBot_Globals.HealBot_Custom_Debuffs[spellId]-1)
            end
        elseif cmd==HEALBOT_ICONRAISEPRIO3 then
            if HealBot_Globals.HealBot_Custom_Debuffs[spellId] and HealBot_Globals.HealBot_Custom_Debuffs[spellId]>3 then
                HealBot_Options_DebuffIconPrioUpdate(spellId, HealBot_Globals.HealBot_Custom_Debuffs[spellId]-3)
            end
        elseif cmd==HEALBOT_ICONLOWERPRIO1 then
            if HealBot_Globals.HealBot_Custom_Debuffs[spellId] and HealBot_Globals.HealBot_Custom_Debuffs[spellId]<20 then
                HealBot_Options_DebuffIconPrioUpdate(spellId, HealBot_Globals.HealBot_Custom_Debuffs[spellId]+1)
            end
        elseif cmd==HEALBOT_ICONLOWERPRIO3 then
            if HealBot_Globals.HealBot_Custom_Debuffs[spellId] and HealBot_Globals.HealBot_Custom_Debuffs[spellId]<18 then
                HealBot_Options_DebuffIconPrioUpdate(spellId, HealBot_Globals.HealBot_Custom_Debuffs[spellId]+3)
            end
        elseif cmd==HEALBOT_ICONBARCOLOURON then
            HealBot_Options_DebuffIconColUpdate(spellId, 3)
        elseif cmd==HEALBOT_ICONBARCOLOURCYCLE then
            if HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[spellId] then
                if HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[spellId]<8 then
                    HealBot_Options_DebuffIconColUpdate(spellId, HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[spellId]+1)
                else
                    HealBot_Options_DebuffIconColUpdate(spellId, 2)
                end
            else
                HealBot_Options_DebuffIconColUpdate(spellId, 3)
            end
        elseif cmd==HEALBOT_ICONBARCOLOUROFF then
            HealBot_Options_DebuffIconColUpdate(spellId, 1)
        elseif cmd==HEALBOT_ICONRAISESCALE then
            if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][button.frame][HealBot_Options_luVars["DebuffIconSet"]]["DSCALE"]<0.96 then
                HealBot_Options_DebuffIconScaleUpdate(button, Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][button.frame][HealBot_Options_luVars["DebuffIconSet"]]["DSCALE"]+0.05)
            end
        elseif cmd==HEALBOT_ICONLOWERSCALE then
            if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][button.frame][HealBot_Options_luVars["DebuffIconSet"]]["DSCALE"]>0.29 then
                HealBot_Options_DebuffIconScaleUpdate(button, Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][button.frame][HealBot_Options_luVars["DebuffIconSet"]]["DSCALE"]-0.05)
            end
        elseif cmd==HEALBOT_ICONNEXTSET then
            if HealBot_Globals.HealBot_Custom_Debuffs_IconSet[spellId] then
                if HealBot_Globals.HealBot_Custom_Debuffs_IconSet[spellId]<3 then
                    HealBot_Options_DebuffIconSetUpdate(spellId, HealBot_Globals.HealBot_Custom_Debuffs_IconSet[spellId]+1)
                else
                    HealBot_Options_DebuffIconSetUpdate(spellId, 1)
                end
            else
                HealBot_Options_DebuffIconSetUpdate(spellId, 2)
            end
        elseif cmd==HEALBOT_ICONPREVSET then
            if HealBot_Globals.HealBot_Custom_Debuffs_IconSet[spellId] then
                if HealBot_Globals.HealBot_Custom_Debuffs_IconSet[spellId]>1 then
                    HealBot_Options_DebuffIconSetUpdate(spellId, HealBot_Globals.HealBot_Custom_Debuffs_IconSet[spellId]-1)
                else
                    HealBot_Options_DebuffIconSetUpdate(spellId, 3)
                end
            else
                HealBot_Options_DebuffIconSetUpdate(spellId, 3)
            end
        else
            local sName=GetSpellInfo(spellId) or "x"
            local iGlow=HealBot_Globals.HealBot_Custom_Debuffs_IconGlow[spellId] or HealBot_Globals.HealBot_Custom_Debuffs_IconGlow[sName] or 1
            if cmd==HEALBOT_ICONGLOWON then
                HealBot_Options_DebuffIconGlowUpdate(spellId, 3)
            elseif cmd==HEALBOT_ICONGLOWCYCLE then
                if iGlow<5 then
                    HealBot_Options_DebuffIconGlowUpdate(spellId, iGlow+1)
                else
                    HealBot_Options_DebuffIconGlowUpdate(spellId, 2)
                end
            elseif cmd==HEALBOT_ICONGLOWOFF then
                HealBot_Options_DebuffIconGlowUpdate(spellId, 1)
            end
        end
        HealBot_Options_DebuffIconTooltip(button, id)
    end
end

function HealBot_Options_DebuffIconTooltip(button, id)
    if HealBot_Globals.ShowTooltip and HealBot_Data["TIPUSE"] then
        HealBot_Tooltip_DebuffIconTooltip(button, id)
    end
end

function HealBot_Options_MissingBuffPrio(spellId)
    if not HealBot_Globals.HealBot_Custom_Buffs[spellId] then
        local sName=GetSpellInfo(spellId)
        if not sName then
            HealBot_Globals.HealBot_Custom_Buffs[spellId]=20
            return
        end
        local sId=nil
        for xClass,_  in pairs(HealBot_Globals.WatchHoT) do
            local HealBot_configClassHoTClass=HealBot_Globals.WatchHoT[xClass]
            for bID,_  in pairs(HealBot_configClassHoTClass) do
                local bName=GetSpellInfo(bID)
                if bName==sName then
                    sId=bID
                    break
                end
            end
            if sId then break end
        end
        if not sId then
            if HealBot_Globals.HealBot_Custom_Buffs[sName] then
                HealBot_Globals.HealBot_Custom_Buffs[spellId]=HealBot_Globals.HealBot_Custom_Buffs[sName]
            else
                HealBot_Globals.HealBot_Custom_Buffs[spellId]=20
            end
        else
            if not HealBot_Globals.HealBot_Custom_Buffs[sName] then
                if HealBot_Globals.HealBot_Custom_Buffs[sId] then
                    HealBot_Globals.HealBot_Custom_Buffs[sName]=HealBot_Globals.HealBot_Custom_Buffs[sId]
                else
                    HealBot_Globals.HealBot_Custom_Buffs[sName]=20
                end
            end
            if HealBot_Globals.HealBot_Custom_Buffs[sId] then HealBot_Globals.HealBot_Custom_Buffs[sId]=nil end
            HealBot_Globals.HealBot_Custom_Buffs[spellId]=HealBot_Globals.HealBot_Custom_Buffs[sName]
        end
    end
end

function HealBot_Options_BuffIconUpdate()
    HealBot_Aura_ResetBuffCache()
    HealBot_Aura_setCustomBuffFilterDisabled()
    HealBot_Timers_Set("AURA","CheckUnits")
    HealBot_Options_SetEnableDisableBuffBtn()
end

function HealBot_Options_BuffIconScaleUpdate(button, scale)
    Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][button.frame][HealBot_Options_luVars["BuffIconSet"]]["BSCALE"]=scale
    if HealBot_Options:IsVisible() then
        HealBot_Options_SkinsFramesIconsBuffsGeneralTabIconScale()
    end
    HealBot_Timers_Set("SKINS","IconsFramesChanged")
end

function HealBot_Options_BuffIconPrioUpdate(spellId, prio)
    HealBot_Globals.HealBot_Custom_Buffs[spellId]=prio
    local sName=GetSpellInfo(spellId)
    if sName and HealBot_Globals.HealBot_Custom_Buffs[sName] then
        HealBot_Globals.HealBot_Custom_Buffs[sName]=prio
    end
    HealBot_Aura_ResetBuffCache()
    HealBot_Timers_Set("AURA","CheckUnits")
    HealBot_Options_ResetUpdate()
end

function HealBot_Options_BuffIconColUpdate(spellId, col)
    HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[spellId]=col
    local sName=GetSpellInfo(spellId)
    if sName then HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[sName]=col end
    HealBot_setLuVars("UpdateAllAura", 5)
    HealBot_Aura_setLuVars("updateAll", true)
    HealBot_Timers_Set("AURA","CheckUnits")
    HealBot_Options_ResetUpdate()
end

function HealBot_Options_BuffIconGlowUpdate(spellId, glow)
    HealBot_Globals.HealBot_Custom_Buffs_IconGlow[spellId]=glow
    local sName=GetSpellInfo(spellId)
    if sName then HealBot_Globals.HealBot_Custom_Buffs_IconGlow[sName]=glow end
    HealBot_Timers_Set("AURA","UpdateAllIcons")
    HealBot_Options_ResetUpdate()
end

function HealBot_Options_BuffIconSetUpdate(spellId, set)
    HealBot_Globals.HealBot_Custom_Buffs_IconSet[spellId]=set
    local sName=GetSpellInfo(spellId)
    if sName then HealBot_Globals.HealBot_Custom_Buffs_IconSet[sName]=set end
    HealBot_Aura_ResetBuffCache()
    HealBot_Timers_Set("AURA","UpdateAllIcons",1)
    HealBot_Options_ResetUpdate()
end

function HealBot_Options_BuffClick(button, id, click)
    local spellId=HealBot_Aura_ReturnBuffSpellId(button.id, id)
    if spellId>0 then
        if click=="LeftButton" then 
            click="Left"
        elseif click=="MiddleButton" then 
            click="Middle"
        elseif click=="RightButton" then 
            click="Right"
        end
        local cmd=HealBot_Action_IconSpellPattern(click)
        if cmd==HEALBOT_IGNOREAURAALL then
            if not HealBot_Globals.HealBot_Custom_Buffs[spellId] then spellId=HealBot_Options_MissingBuffPrio(spellId) end
            if not HealBot_Globals.IgnoreCustomBuff[spellId] then HealBot_Globals.IgnoreCustomBuff[spellId]={} end
            HealBot_Globals.IgnoreCustomBuff[spellId]["ALL"]=true
            HealBot_Options_BuffIconUpdate()
        elseif cmd==HEALBOT_ICONRAISEPRIO1 then
            if not HealBot_Globals.HealBot_Custom_Buffs[spellId] then spellId=HealBot_Options_MissingBuffPrio(spellId) end
            if HealBot_Globals.HealBot_Custom_Buffs[spellId] and HealBot_Globals.HealBot_Custom_Buffs[spellId]>1 then
                HealBot_Options_BuffIconPrioUpdate(spellId, HealBot_Globals.HealBot_Custom_Buffs[spellId]-1)
            end
        elseif cmd==HEALBOT_ICONRAISEPRIO3 then
            if not HealBot_Globals.HealBot_Custom_Buffs[spellId] then spellId=HealBot_Options_MissingBuffPrio(spellId) end
            if HealBot_Globals.HealBot_Custom_Buffs[spellId] and HealBot_Globals.HealBot_Custom_Buffs[spellId]>3 then
                HealBot_Options_BuffIconPrioUpdate(spellId, HealBot_Globals.HealBot_Custom_Buffs[spellId]-3)
            end
        elseif cmd==HEALBOT_ICONLOWERPRIO1 then
            if not HealBot_Globals.HealBot_Custom_Buffs[spellId] then spellId=HealBot_Options_MissingBuffPrio(spellId) end
            if HealBot_Globals.HealBot_Custom_Buffs[spellId] and HealBot_Globals.HealBot_Custom_Buffs[spellId]<20 then
                HealBot_Options_BuffIconPrioUpdate(spellId, HealBot_Globals.HealBot_Custom_Buffs[spellId]+1)
            end
        elseif cmd==HEALBOT_ICONLOWERPRIO3 then
            if not HealBot_Globals.HealBot_Custom_Buffs[spellId] then spellId=HealBot_Options_MissingBuffPrio(spellId) end
            if HealBot_Globals.HealBot_Custom_Buffs[spellId] and HealBot_Globals.HealBot_Custom_Buffs[spellId]<18 then
                HealBot_Options_BuffIconPrioUpdate(spellId, HealBot_Globals.HealBot_Custom_Buffs[spellId]+3)
            end
        elseif cmd==HEALBOT_ICONBARCOLOURON then
            HealBot_Options_BuffIconColUpdate(spellId, 3)
        elseif cmd==HEALBOT_ICONBARCOLOURCYCLE then
            if HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[spellId] then
                if HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[spellId]<8 then
                    HealBot_Options_BuffIconColUpdate(spellId, HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[spellId]+1)
                else
                    HealBot_Options_BuffIconColUpdate(spellId, 2)
                end
            else
                HealBot_Options_BuffIconColUpdate(spellId, 3)
            end
        elseif cmd==HEALBOT_ICONBARCOLOUROFF then
            HealBot_Options_BuffIconColUpdate(spellId, 1)
        elseif cmd==HEALBOT_ICONRAISESCALE then
            if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][button.frame][HealBot_Options_luVars["BuffIconSet"]]["BSCALE"]<0.96 then
                HealBot_Options_BuffIconScaleUpdate(button, Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][button.frame][HealBot_Options_luVars["BuffIconSet"]]["BSCALE"]+0.05)
            end
        elseif cmd==HEALBOT_ICONLOWERSCALE then
            if Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][button.frame][HealBot_Options_luVars["BuffIconSet"]]["BSCALE"]>0.29 then
                HealBot_Options_BuffIconScaleUpdate(button, Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][button.frame][HealBot_Options_luVars["BuffIconSet"]]["BSCALE"]-0.05)
            end
        elseif cmd==HEALBOT_ICONNEXTSET then
            if HealBot_Globals.HealBot_Custom_Buffs_IconSet[spellId] then
                if HealBot_Globals.HealBot_Custom_Buffs_IconSet[spellId]<3 then
                    HealBot_Options_BuffIconSetUpdate(spellId, HealBot_Globals.HealBot_Custom_Buffs_IconSet[spellId]+1)
                else
                    HealBot_Options_BuffIconSetUpdate(spellId, 1)
                end
            else
                HealBot_Options_BuffIconSetUpdate(spellId, 2)
            end
        elseif cmd==HEALBOT_ICONPREVSET then
            if HealBot_Globals.HealBot_Custom_Buffs_IconSet[spellId] then
                if HealBot_Globals.HealBot_Custom_Buffs_IconSet[spellId]>1 then
                    HealBot_Options_BuffIconSetUpdate(spellId, HealBot_Globals.HealBot_Custom_Buffs_IconSet[spellId]-1)
                else
                    HealBot_Options_BuffIconSetUpdate(spellId, 3)
                end
            else
                HealBot_Options_BuffIconSetUpdate(spellId, 3)
            end
        else
            local sName=GetSpellInfo(spellId) or "x"
            local iGlow=HealBot_Globals.HealBot_Custom_Buffs_IconGlow[spellId] or HealBot_Globals.HealBot_Custom_Buffs_IconGlow[sName] or 1
            if cmd==HEALBOT_ICONGLOWON then
                HealBot_Options_BuffIconGlowUpdate(spellId, 3)
            elseif cmd==HEALBOT_ICONGLOWCYCLE then
                if iGlow<5 then
                    HealBot_Options_BuffIconGlowUpdate(spellId, iGlow+1)
                else
                    HealBot_Options_BuffIconGlowUpdate(spellId, 2)
                end
            elseif cmd==HEALBOT_ICONGLOWOFF then
                HealBot_Options_BuffIconGlowUpdate(spellId, 1)
            end
        end
        HealBot_Options_BuffIconTooltip(button, id)
    end
end

function HealBot_Options_BuffIconTooltip(button, id)
    if HealBot_Globals.ShowTooltip and HealBot_Data["TIPUSE"] then
        HealBot_Tooltip_BuffIconTooltip(button, id)
    end
end

function HealBot_Options_SetEnableDisableCDBtn()
    local InstName=HealBot_Aura_retLuVars("mapName")
    HealBot_Options_EnableDisableCDBtn:Enable()
    local dId=HealBot_Options_luVars["CDebuffcustomSpellID"]
    if HealBot_Globals.IgnoreCustomDebuff[dId] and (HealBot_Globals.IgnoreCustomDebuff[dId][InstName] or HealBot_Globals.IgnoreCustomDebuff[dId]["ALL"]) then
        HealBot_Options_EnableDisableCDText:SetTextColor(0.88,0.1,0.1)
        if HealBot_Globals.IgnoreCustomDebuff[dId][InstName] then
            HealBot_Options_EnableDisableCDText:SetText(InstName..": "..HEALBOT_SKIN_DISTEXT)
            HealBot_Options_EnableDisableCDBtn:SetText(HEALBOT_WORD_ALLZONE)
        else
            HealBot_Options_EnableDisableCDText:SetText(HEALBOT_WORD_ALLZONE..": "..HEALBOT_SKIN_DISTEXT)
            HealBot_Options_EnableDisableCDBtn:SetText(HEALBOT_WORD_ENABLE)
        end
    elseif dId and HealBot_Options_luVars["CDebuffCatID"]>1 then
        HealBot_Options_EnableDisableCDText:SetTextColor(0.1,1,0.1)
        HealBot_Options_EnableDisableCDText:SetText(InstName..": "..HEALBOT_SKIN_ENTEXT)
        HealBot_Options_EnableDisableCDBtn:SetText(HEALBOT_WORD_DISABLE)
    else
        HealBot_Options_EnableDisableCDText:SetTextColor(0.7,0.7,0)
        HealBot_Options_EnableDisableCDText:SetText(" ")
        HealBot_Options_EnableDisableCDBtn:SetText(HEALBOT_WORD_DISABLE)
        HealBot_Options_EnableDisableCDBtn:Disable()
    end
    HealBot_Options_CDebuffCatNameUpdate()
end

function HealBot_Options_EnableDisableBuffBtn_OnClick(self)
    local InstName=HealBot_Aura_retLuVars("mapName")
    local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
    if HealBot_Globals.IgnoreCustomBuff[sId] and (HealBot_Globals.IgnoreCustomBuff[sId][InstName] or HealBot_Globals.IgnoreCustomBuff[sId]["ALL"]) then
        if HealBot_Globals.IgnoreCustomBuff[sId][InstName] then
            HealBot_Globals.IgnoreCustomBuff[sId][InstName]=nil
            HealBot_Globals.IgnoreCustomBuff[sId]["ALL"]=true
        else
            HealBot_Globals.IgnoreCustomBuff[sId]=nil
        end
    else
        if not HealBot_Globals.IgnoreCustomBuff[sId] then
            HealBot_Globals.IgnoreCustomBuff[sId]={}
        end
        HealBot_Globals.IgnoreCustomBuff[sId][InstName]=true
    end
    local sName=HealBot_Options_SpellGetName(sId)
    if sName then 
        HealBot_Globals.IgnoreCustomBuff[sName]=HealBot_Options_copyTable(HealBot_Globals.IgnoreCustomBuff[sId])
    end
    HealBot_Timers_Set("AURA","ResetBuffCache")
    HealBot_Options_SetEnableDisableBuffBtn()
end

function HealBot_Options_SetEnableDisableBuffBtn()
    local InstName=HealBot_Aura_retLuVars("mapName")
    HealBot_Options_EnableDisableBuffBtn:Enable()
    local bName=HealBot_Options_CDebuffTextID(HealBot_Options_luVars["HoTname"])
    local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
    if HealBot_Globals.IgnoreCustomBuff[sId] and (HealBot_Globals.IgnoreCustomBuff[sId][InstName] or HealBot_Globals.IgnoreCustomBuff[sId]["ALL"]) then
        HealBot_Options_EnableDisableBuffText:SetTextColor(0.88,0.1,0.1)
        if HealBot_Globals.IgnoreCustomBuff[sId][InstName] then
            HealBot_Options_EnableDisableBuffText:SetText(InstName..": "..HEALBOT_SKIN_DISTEXT)
            HealBot_Options_EnableDisableBuffBtn:SetText(HEALBOT_WORD_ALLZONE)
        else
            HealBot_Options_EnableDisableBuffText:SetText(HEALBOT_WORD_ALLZONE..": "..HEALBOT_SKIN_DISTEXT)
            HealBot_Options_EnableDisableBuffBtn:SetText(HEALBOT_WORD_ENABLE)
        end
    elseif bName then
        if HealBot_Globals.IgnoreCustomBuff[sId] then
            HealBot_Options_EnableDisableBuffText:SetTextColor(0.1,1,0.1)
            HealBot_Options_EnableDisableBuffText:SetText(InstName..": "..HEALBOT_SKIN_ENTEXT)
            HealBot_Options_EnableDisableBuffBtn:SetText(HEALBOT_WORD_DISABLE)
        else
            HealBot_Options_EnableDisableBuffText:SetTextColor(0.1,1,0.1)
            HealBot_Options_EnableDisableBuffText:SetText(HEALBOT_WORD_ALLZONE..": "..HEALBOT_SKIN_ENTEXT)
            HealBot_Options_EnableDisableBuffBtn:SetText(HEALBOT_WORD_DISABLE)
        end
    else
        HealBot_Options_EnableDisableBuffText:SetTextColor(0.88,0.1,0)
        HealBot_Options_EnableDisableBuffText:SetText("")
        HealBot_Options_EnableDisableBuffBtn:SetText(HEALBOT_WORD_ENABLE)
        HealBot_Options_EnableDisableBuffBtn:Disable()
    end
    HealBot_Options_BuffCatNameUpdate()
end

function HealBot_Options_CDCAll_OnClick(self, debuffType)
    if HealBot_Config_Cures.HealBot_Custom_Debuffs_All[debuffType]~=self:GetChecked() then
        HealBot_Config_Cures.HealBot_Custom_Debuffs_All[debuffType]=self:GetChecked()
        HealBot_Timers_Set("AURA","ResetDebuffCache")
    end
end

function HealBot_Options_CDCAllBoss_OnClick(self, debuffType)
    if HealBot_Config_Cures.AlwaysShowBoss~=self:GetChecked() then
        HealBot_Config_Cures.AlwaysShowBoss=self:GetChecked()
        HealBot_Timers_Set("AURA","ResetDebuffCache")
    end
end

function HealBot_Options_CDCAllTimed_OnClick(self, debuffType)
    if HealBot_Config_Cures.AlwaysShowTimed~=self:GetChecked() then
        HealBot_Config_Cures.AlwaysShowTimed=self:GetChecked()
        HealBot_Timers_Set("AURA","ResetDebuffCache")
    end
end

function HealBot_Options_ResetCDebuff()
    local sName=HealBot_Options_SpellGetName(HealBot_Options_luVars["CDebuffcustomSpellID"])
    HealBot_Options_DeleteCDebuffBtn_OnClick()
    HealBot_Options_NewCDebuffBtn_SetCat(sName)
    HealBot_Timers_InitExtraOptions()
    HealBot_SetCDCBarColours();
    HealBot_Aura_ClearCustomDebuffsDone()
    HealBot_Timers_Set("AURA","CustomDebuffListPrep")
end

HealBot_Options_luVars["customdebufftextpage"]=1
local hbCustomDebuffList = {}
local hbCustomDebuffOrder = {}
local hbCustomDebuffIDs = {}
function HealBot_Options_sortCustomDebuffList(dID, dName, prio)
    if not hbCustomDebuffList[dID] then hbCustomDebuffList[dID]={} end
    hbCustomDebuffList[dID]["Prio"]=prio
    hbCustomDebuffList[dID]["Name"]=GetSpellInfo(dID) or dName
    if HealBot_Globals.CDCTag[dID] and string.len(HealBot_Globals.CDCTag[dID])>0 then
        hbCustomDebuffList[dID]["Tag"]=HealBot_Globals.CDCTag[dID]
    else
        hbCustomDebuffList[dID]["Tag"]=""
    end
    if HealBot_Config_Cures.ListSortOrder==1 then  -- Prio
        if prio<10 then
            hbCustomDebuffOrder[dID]="0"..prio..dName
        else
            hbCustomDebuffOrder[dID]=prio..dName
        end
    elseif HealBot_Config_Cures.ListSortOrder==2 then  -- Name
        hbCustomDebuffOrder[dID]=dName
    else  -- Tag
        if prio<10 then
            hbCustomDebuffOrder[dID]=hbCustomDebuffList[dID]["Tag"].."0"..prio..dName
        else
            hbCustomDebuffOrder[dID]=hbCustomDebuffList[dID]["Tag"]..prio..dName
        end
    end
    table.insert(hbCustomDebuffIDs, dID)
end

function HealBot_Options_prepGeneralDebuffList(dID, dName, prio)
    if HealBot_Config_Cures.ListSortFilter==1 or 
      (HealBot_Config_Cures.ListSortFilter==2 and prio<5) or
      (HealBot_Config_Cures.ListSortFilter==3 and prio>4 and prio<9) or
      (HealBot_Config_Cures.ListSortFilter==4 and prio>8 and prio<13) or
      (HealBot_Config_Cures.ListSortFilter==5 and prio>12 and prio<17) or
      (HealBot_Config_Cures.ListSortFilter==6 and prio>16) then
        HealBot_Options_sortCustomDebuffList(dID, dName, prio)
    end
end

function HealBot_Options_prepCustomDebuffList()
    local dName, dTag="", ""
    for x,_ in pairs(hbCustomDebuffIDs) do
        hbCustomDebuffIDs[x]=nil;
    end
    for dID, x in pairs(HealBot_Globals.HealBot_Custom_Debuffs) do
        dName=HealBot_Options_CDebuffTextID(dID)
        if tonumber(dName) == nil then
            if dName==HEALBOT_CUSTOM_CAT_CUSTOM_AUTOMATIC then dID="Auto" end
            if HealBot_Config_Cures.ListSortFilter==1 then
                HealBot_Options_sortCustomDebuffList(dID, dName, x)
            elseif HealBot_Config_Cures.ListSortFilter==2 then
                if x<5 then
                    HealBot_Options_sortCustomDebuffList(dID, dName, x)
                end
            elseif HealBot_Config_Cures.ListSortFilter==3 then
                if x>4 and x<9 then
                    HealBot_Options_sortCustomDebuffList(dID, dName, x)
                end
            elseif HealBot_Config_Cures.ListSortFilter==4 then
                if x>8 and x<13 then
                    HealBot_Options_sortCustomDebuffList(dID, dName, x)
                end
            elseif HealBot_Config_Cures.ListSortFilter==5 then
                if x>12 and x<17 then
                    HealBot_Options_sortCustomDebuffList(dID, dName, x)
                end
            elseif HealBot_Config_Cures.ListSortFilter==6 then
                if x>16 then
                    HealBot_Options_sortCustomDebuffList(dID, dName, x)
                end
            elseif HealBot_Globals.CDCTag[dID] and strtrim(HealBot_Config_Cures.ListSortFilterTag)==strtrim(HealBot_Globals.CDCTag[dID]) then
                HealBot_Options_sortCustomDebuffList(dID, dName, x)
            end
        else
            HealBot_Options_DeleteCDebuff(dID, dName)
        end
    end
    HealBot_Options_prepGeneralDebuffList(HEALBOT_DISEASE_en, HEALBOT_DISEASE, HealBot_Config_Cures.HealBotDebuffPriority[HEALBOT_DISEASE_en])
    HealBot_Options_prepGeneralDebuffList(HEALBOT_MAGIC_en, HEALBOT_MAGIC, HealBot_Config_Cures.HealBotDebuffPriority[HEALBOT_MAGIC_en])
    HealBot_Options_prepGeneralDebuffList(HEALBOT_CURSE_en, HEALBOT_CURSE, HealBot_Config_Cures.HealBotDebuffPriority[HEALBOT_CURSE_en])
    HealBot_Options_prepGeneralDebuffList(HEALBOT_POISON_en, HEALBOT_POISON, HealBot_Config_Cures.HealBotDebuffPriority[HEALBOT_POISON_en])

    table.sort(hbCustomDebuffIDs,function (a,b)
        if not hbCustomDebuffOrder[a] or not hbCustomDebuffOrder[b] then
            return false
        else
            if hbCustomDebuffOrder[a]<hbCustomDebuffOrder[b] then return true end
            if hbCustomDebuffOrder[a]>hbCustomDebuffOrder[b] then return false end
            if type(a)==type(b) then
                return a<b
            else
                return false
            end
        end
    end)
    HealBot_Options_setCustomDebuffList()
end

function HealBot_Options_setCustomDebuffList()
    local startEntry=((HealBot_Options_luVars["customdebufftextpage"]-1)*15)+1
    local endEntry=HealBot_Options_luVars["customdebufftextpage"]*15
    local x=1
    for j=startEntry,endEntry do
        x=(j-((HealBot_Options_luVars["customdebufftextpage"]-1)*15))
        if hbCustomDebuffIDs[j] then
            hbCustomDebuff_Text[x]["Prio"]:SetText(hbCustomDebuffList[hbCustomDebuffIDs[j]]["Prio"])
            if tonumber(hbCustomDebuffIDs[j]) then
                hbCustomDebuff_Text[x]["ID"]:SetText(hbCustomDebuffIDs[j])
            else
                hbCustomDebuff_Text[x]["ID"]:SetText("-")
            end
            hbCustomDebuff_Text[x]["Name"]:SetText(hbCustomDebuffList[hbCustomDebuffIDs[j]]["Name"])
            hbCustomDebuff_Text[x]["Tag"]:SetText(hbCustomDebuffList[hbCustomDebuffIDs[j]]["Tag"])
            local z=hbCustomDebuffIDs[j]
            local r,g,b=0,0,0
            if HealBot_Globals.CDCBarColour[z] then
                r=HealBot_Globals.CDCBarColour[z].R or 0.45
                g=HealBot_Globals.CDCBarColour[z].G or 0
                b=HealBot_Globals.CDCBarColour[z].B or 0.26
            elseif HealBot_Config_Cures.CDCBarColour[z] then
                r=HealBot_Config_Cures.CDCBarColour[z].R or 0.7
                g=HealBot_Config_Cures.CDCBarColour[z].G or 0.2
                b=HealBot_Config_Cures.CDCBarColour[z].B or 0.5
            else
                r=HealBot_Globals.CDCBarColour[customDebuffPriority].R or 0.45
                g=HealBot_Globals.CDCBarColour[customDebuffPriority].G or 0
                b=HealBot_Globals.CDCBarColour[customDebuffPriority].B or 0.26
            end
            if r<0.2 and g<0.2 and b<0.2 then
                r=r+0.4
                g=g+0.4
                b=b+0.4
            elseif r<0.3 and g<0.3 and b<0.3 then
                r=r+0.3
                g=g+0.3
                b=b+0.3
            elseif r<0.4 and g<0.4 and b<0.4 then
                r=r+0.2
                g=g+0.2
                b=b+0.2
            elseif r<0.5 and g<0.5 and b<0.5 then
                r=r+0.1
                g=g+0.1
                b=b+0.1
            end
            hbCustomDebuff_Text[x]["Prio"]:SetTextColor(r,g,b,1)
            hbCustomDebuff_Text[x]["ID"]:SetTextColor(r,g,b,1)
            hbCustomDebuff_Text[x]["Name"]:SetTextColor(r,g,b,1)
            hbCustomDebuff_Text[x]["Tag"]:SetTextColor(r,g,b,1)
        else
            hbCustomDebuff_Text[x]["Prio"]:SetText(" ")
            hbCustomDebuff_Text[x]["ID"]:SetText(" ")
            hbCustomDebuff_Text[x]["Name"]:SetText(" ")
            hbCustomDebuff_Text[x]["Tag"]:SetText(" ")
        end
    end
    if hbCustomDebuffIDs[endEntry+1] then
        HealBot_Options_PageNextCDebuffBtn:Enable()
    else
        HealBot_Options_PageNextCDebuffBtn:Disable()
    end
    if HealBot_Options_luVars["customdebufftextpage"]==1 then
        HealBot_Options_PagePrevCDebuffBtn:Disable()
    end

    g=_G["HealBot_Options_PageCDebuff"]
    g:SetText(HEALBOT_OPTIONS_PAGE.." "..HealBot_Options_luVars["customdebufftextpage"])
end

function HealBot_Options_PageNextCDebuff()
    HealBot_Options_luVars["customdebufftextpage"]=HealBot_Options_luVars["customdebufftextpage"]+1
    HealBot_Options_PagePrevCDebuffBtn:Enable()
    HealBot_Timers_Set("AURA","CustomDebuffList")
end

function HealBot_Options_PagePrevCDebuff()
    if HealBot_Options_luVars["customdebufftextpage"]>1 then
        HealBot_Options_luVars["customdebufftextpage"]=HealBot_Options_luVars["customdebufftextpage"]-1
    end
    HealBot_Timers_Set("AURA","CustomDebuffList")
end
----------------------------------------------------------------------------------

function HealBot_Options_getDropDownId_bySpec(ddId)
    return HealBot_Config.CurrentSpec..ddId
end

local hbComboButtons={
                        [1]={["BTN"]="Left",      ["TXT"]=HEALBOT_OPTIONS_BUTTONLEFT},
                        [2]={["BTN"]="Middle",    ["TXT"]=HEALBOT_OPTIONS_BUTTONMIDDLE},
                        [3]={["BTN"]="Right",     ["TXT"]=HEALBOT_OPTIONS_BUTTONRIGHT},
                        [4]={["BTN"]="Button4",   ["TXT"]=HEALBOT_OPTIONS_BUTTON4},
                        [5]={["BTN"]="Button5",   ["TXT"]=HEALBOT_OPTIONS_BUTTON5},
                        [6]={["BTN"]="Button6",   ["TXT"]=HEALBOT_OPTIONS_BUTTON6},
                        [7]={["BTN"]="Button7",   ["TXT"]=HEALBOT_OPTIONS_BUTTON7},
                        [8]={["BTN"]="Button8",   ["TXT"]=HEALBOT_OPTIONS_BUTTON8},
                        [9]={["BTN"]="Button9",   ["TXT"]=HEALBOT_OPTIONS_BUTTON9},
                       [10]={["BTN"]="Button10",  ["TXT"]=HEALBOT_OPTIONS_BUTTON10},
                       [11]={["BTN"]="Button11",  ["TXT"]=HEALBOT_OPTIONS_BUTTON11},
                       [12]={["BTN"]="Button12",  ["TXT"]=HEALBOT_OPTIONS_BUTTON12},
                       [13]={["BTN"]="Button13",  ["TXT"]=HEALBOT_OPTIONS_BUTTON13},
                       [14]={["BTN"]="Button14",  ["TXT"]=HEALBOT_OPTIONS_BUTTON14},
                       [15]={["BTN"]="Button15",  ["TXT"]=HEALBOT_OPTIONS_BUTTON15},
                       [16]={["BTN"]="Button16",  ["TXT"]=HEALBOT_OPTIONS_BUTTON15},
                       [17]={["BTN"]="Button17",  ["TXT"]=HEALBOT_OPTIONS_BUTTON15},
                       [18]={["BTN"]="Button18",  ["TXT"]=HEALBOT_OPTIONS_BUTTON15},
                       [19]={["BTN"]="Button19",  ["TXT"]=HEALBOT_OPTIONS_BUTTON15},
                       [20]={["BTN"]="Button20",  ["TXT"]=HEALBOT_OPTIONS_BUTTON15},
                     }
function HealBot_Options_ComboClass_Button(bNo)
    return hbComboButtons[bNo]["BTN"], hbComboButtons[bNo]["TXT"]
end

local hbComboModifiers={
                        [1]="",
                        [2]="Shift",
                        [3]="Ctrl",
                        [4]="Alt",
                        [5]="Ctrl-Shift",
                        [6]="Alt-Shift",
                        [7]="Alt-Ctrl",
                        [8]="Alt-Ctrl-Shift",
                        }
function HealBot_Options_ComboButton_ModifierKey(mod)
    return hbComboModifiers[mod]
end

local FirstDebuffLoad=true
function HealBot_Options_Debuff_Reset()
    HealBot_Options_setDebuffTypes()
    HealBot_DebuffWatchTarget[HEALBOT_DISEASE_en] = {HEALBOT_DISEASE_en = {}};
    HealBot_DebuffWatchTarget[HEALBOT_POISON_en] = {HEALBOT_POISON_en = {}};
    HealBot_DebuffWatchTarget[HEALBOT_MAGIC_en] = {HEALBOT_MAGIC_en = {}};
    HealBot_DebuffWatchTarget[HEALBOT_CURSE_en] = {HEALBOT_CURSE_en = {}};
    HealBot_DebuffWatchTarget[HEALBOT_CUSTOM_en] = {HEALBOT_CUSTOM_en = {}}; -- added by Diacono
    for x,_ in pairs(HealBot_DebuffSpell) do
        HealBot_DebuffSpell[x]=nil;
    end
    local DebuffTextClass = HealBot_Config_Cures.HealBotDebuffText
    local DebuffDropDownClass = HealBot_Config_Cures.HealBotDebuffDropDown
    
    for k=1,3 do
        if DebuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)] and DebuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)]>1 then
            local dropdownID=DebuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)]
            local sName = DebuffTextClass[HealBot_Options_getDropDownId_bySpec(k)] or "x"

            if HealBot_Debuff_Types[sName] then
                table.foreach(HealBot_Debuff_Types[sName], function (i,dName)
                    if not HealBot_DebuffSpell[dName] then
                        HealBot_DebuffSpell[dName]=sName;
                    end
                    local HealBot_DebuffWatchTargetSpell=HealBot_DebuffWatchTarget[dName];
                    if dropdownID==2 then
                        HealBot_DebuffWatchTargetSpell["Self"]=true;
                    elseif dropdownID==3 then
                        HealBot_DebuffWatchTargetSpell["Party"]=true;
                    elseif dropdownID==4 then
                        HealBot_DebuffWatchTargetSpell["Raid"]=true;
                    elseif dropdownID==5 then
                        if HealBot_Globals.EmergIncMelee[HEALBOT_DRUID] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DRUID]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_HUNTER] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_HUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_MAGE] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MAGE]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_PALADIN] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PALADIN]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_PRIEST] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PRIEST]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_ROGUE] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_ROGUE]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_SHAMAN] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_SHAMAN]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_WARLOCK] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARLOCK]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_WARRIOR] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARRIOR]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_DEATHKNIGHT] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEATHKNIGHT]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_DEMONHUNTER] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEMONHUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_MONK] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MONK]]=true;
                        end
                    elseif dropdownID==6 then
                        if HealBot_Globals.EmergIncRange[HEALBOT_DRUID] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DRUID]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_HUNTER] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_HUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_MAGE] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MAGE]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_PALADIN] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PALADIN]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_PRIEST] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PRIEST]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_ROGUE] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_ROGUE]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_SHAMAN] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_SHAMAN]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_WARLOCK] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARLOCK]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_WARRIOR] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARRIOR]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_DEATHKNIGHT] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEATHKNIGHT]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_DEMONHUNTER] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEMONHUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_MONK] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MONK]]=true;
                        end
                    elseif dropdownID==7 then
                        if HealBot_Globals.EmergIncHealers[HEALBOT_DRUID] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DRUID]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_HUNTER] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_HUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_MAGE] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MAGE]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_PALADIN] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PALADIN]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_PRIEST] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PRIEST]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_ROGUE] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_ROGUE]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_SHAMAN] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_SHAMAN]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_WARLOCK] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARLOCK]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_WARRIOR] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARRIOR]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_DEATHKNIGHT] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEATHKNIGHT]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_DEMONHUNTER] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEMONHUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_MONK] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MONK]]=true;
                        end
                    elseif dropdownID==8 then
                        if HealBot_Globals.EmergIncCustom[HEALBOT_DRUID] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DRUID]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_HUNTER] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_HUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_MAGE] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MAGE]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_PALADIN] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PALADIN]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_PRIEST] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PRIEST]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_ROGUE] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_ROGUE]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_SHAMAN] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_SHAMAN]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_WARLOCK] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARLOCK]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_WARRIOR] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARRIOR]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_DEATHKNIGHT] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEATHKNIGHT]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_DEMONHUNTER] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEMONHUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_MONK] then
                            HealBot_DebuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MONK]]=true;
                        end
                    elseif dropdownID==9 then
                        HealBot_DebuffWatchTargetSpell["PvP"]=true
                    elseif dropdownID==10 then
                        HealBot_DebuffWatchTargetSpell["PvE"]=true
                    elseif dropdownID==11 then
                        HealBot_DebuffWatchTargetSpell["MainTanks"]=true
                    elseif dropdownID==12 then
                        HealBot_DebuffWatchTargetSpell["MyTargets"]=true
                    elseif dropdownID==13 then
                        HealBot_DebuffWatchTargetSpell["Focus"]=true
                    elseif dropdownID==14 then
                        HealBot_DebuffWatchTargetSpell["Name"]=true
                    elseif dropdownID==15 then
                        HealBot_DebuffWatchTargetSpell["SingleTank"]=true
                    elseif dropdownID==16 then
                        HealBot_DebuffWatchTargetSpell["Solo"]=true;
                    end        
                end)
            end
        end
    end
    HealBot_Timers_Set("AURA","DebuffPriority")
    FirstDebuffLoad=nil
end

function HealBot_Options_ExtraBuff_Reset()
    local buffbarcolrClass = HealBot_Config_Buffs.HealBotBuffColR or 1
    local buffbarcolgClass = HealBot_Config_Buffs.HealBotBuffColG or 1
    local buffbarcolbClass = HealBot_Config_Buffs.HealBotBuffColB or 1
    if HealBot_Config_Buffs.CheckWellFed then
        local wellFedItem=HealBot_Config_Buffs.WellFedItem
        local hbCustomItemID=GetItemInfoInstant(wellFedItem) or 0
        if hbCustomItemID>0 and HealBot_IsItemInBag(hbCustomItemID) then
            HealBot_buffbarcolr[wellFedItem]=buffbarcolrClass[11] or 1
            HealBot_buffbarcolg[wellFedItem]=buffbarcolgClass[11] or 1
            HealBot_buffbarcolb[wellFedItem]=buffbarcolbClass[11] or 1
            HealBot_BuffWatchTarget[wellFedItem] = {};
            HealBot_BuffWatchTarget[wellFedItem]["Self"]=true
        else
            wellFedItem=HealBot_Config_Buffs.BackupWellFedItem
            hbCustomItemID=GetItemInfoInstant(wellFedItem) or 0
            if hbCustomItemID>0 and HealBot_IsItemInBag(hbCustomItemID) then
                HealBot_buffbarcolr[wellFedItem]=buffbarcolrClass[11] or 1
                HealBot_buffbarcolg[wellFedItem]=buffbarcolgClass[11] or 1
                HealBot_buffbarcolb[wellFedItem]=buffbarcolbClass[11] or 1
                HealBot_BuffWatchTarget[wellFedItem] = {};
                HealBot_BuffWatchTarget[wellFedItem]["Self"]=true
            end
        end
    end
    if HealBot_Config_Buffs.CheckManaDrink then
        local manaDrinkItem=HealBot_Config_Buffs.ManaDrinkItem
        local hbCustomItemID=GetItemInfoInstant(manaDrinkItem) or 0
        if hbCustomItemID>0 and HealBot_IsItemInBag(hbCustomItemID) then
            HealBot_buffbarcolr[manaDrinkItem]=buffbarcolrClass[15] or 1
            HealBot_buffbarcolg[manaDrinkItem]=buffbarcolgClass[15] or 1
            HealBot_buffbarcolb[manaDrinkItem]=buffbarcolbClass[15] or 1
            HealBot_BuffWatchTarget[manaDrinkItem] = {};
            HealBot_BuffWatchTarget[manaDrinkItem]["Self"]=true
        else
            manaDrinkItem=HealBot_Config_Buffs.BackupManaDrinkItem
            local hbCustomItemID=GetItemInfoInstant(manaDrinkItem) or 0
            if hbCustomItemID>0 and HealBot_IsItemInBag(hbCustomItemID) then
                HealBot_buffbarcolr[manaDrinkItem]=buffbarcolrClass[15] or 1
                HealBot_buffbarcolg[manaDrinkItem]=buffbarcolgClass[15] or 1
                HealBot_buffbarcolb[manaDrinkItem]=buffbarcolbClass[15] or 1
                HealBot_BuffWatchTarget[manaDrinkItem] = {};
                HealBot_BuffWatchTarget[manaDrinkItem]["Self"]=true
            end
        end
    end
    for x=1,3 do
        if HealBot_Config_Buffs.CustomBuffCheck[x] and string.len(HealBot_Config_Buffs.CustomBuffName[x])>0 then
            local extraItem=HealBot_Config_Buffs.CustomItemName[x]
            local hbCustomItemID=GetItemInfoInstant(extraItem) or 0
            if hbCustomItemID>0 and HealBot_IsItemInBag(hbCustomItemID) then
                HealBot_buffbarcolr[extraItem]=buffbarcolrClass[11+x] or 1
                HealBot_buffbarcolg[extraItem]=buffbarcolgClass[11+x] or 1
                HealBot_buffbarcolb[extraItem]=buffbarcolbClass[11+x] or 1
                HealBot_BuffWatchTarget[extraItem] = {};
                HealBot_BuffWatchTarget[extraItem]["Self"]=true
            end
        end
    end
end

local spells={}
function HealBot_Options_Buff_Reset()
    if HealBot_retLuVars("BagsScanned") then
        HealBot_Options_InitBuffClassList()
        BuffTextClass = HealBot_Config_Buffs.HealBotBuffText
        local BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
        local buffbarcolrClass = HealBot_Config_Buffs.HealBotBuffColR or 1
        local buffbarcolgClass = HealBot_Config_Buffs.HealBotBuffColG or 1
        local buffbarcolbClass = HealBot_Config_Buffs.HealBotBuffColB or 1
        for x,_ in pairs(spells) do
            spells[x]=nil;
        end
        HealBot_Aura_ClearBuffWatch()
        HealBot_Aura_ClearCheckBuffs()
        HealBot_Aura_InitItemsData()
        for x,_ in pairs(HealBot_BuffWatchTarget) do
            HealBot_BuffWatchTarget[x]=nil;
        end
        for x,_ in pairs(HealBot_buffbarcolr) do
            HealBot_buffbarcolr[x]=nil;
        end
        for x,_ in pairs(HealBot_buffbarcolg) do
            HealBot_buffbarcolg[x]=nil;
        end
        for x,_ in pairs(HealBot_buffbarcolb) do
            HealBot_buffbarcolb[x]=nil;
        end
        if HealBot_Data["TIPUSE"] then HealBot_Tooltip_Clear_CheckBuffs() end
        
        for k=1,8 do
            if BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)] and BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)]>1 then
                local dropdownID=BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)]
                local sName=BuffTextClass[HealBot_Options_getDropDownId_bySpec(k)]
                if HealBot_Spell_Names[sName] or HealBot_IsKnownItem(sName) then  
               
                    if not spells[sName] then
                        spells[sName]=true;
                        HealBot_Aura_SetBuffWatch(sName)
                        HealBot_Aura_SetCheckBuffs(sName)
                        HealBot_BuffWatchTarget[sName] = {};
                    end

                    local HealBot_BuffWatchTargetSpell=HealBot_BuffWatchTarget[sName];
                    if HealBot_Data["TIPUSE"] then HealBot_Tooltip_CheckBuffs(sName) end
            
                    if dropdownID==2 then
                        HealBot_BuffWatchTargetSpell["Self"]=true;
                    elseif dropdownID==3 then
                        HealBot_BuffWatchTargetSpell["Party"]=true;
                    elseif dropdownID==4 then
                        HealBot_BuffWatchTargetSpell["Raid"]=true;
                    elseif dropdownID==5 then
                        if HealBot_Globals.EmergIncMelee[HEALBOT_DRUID] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DRUID]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_HUNTER] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_HUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_MAGE] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MAGE]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_PALADIN] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PALADIN]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_PRIEST] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PRIEST]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_ROGUE] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_ROGUE]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_SHAMAN] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_SHAMAN]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_WARLOCK] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARLOCK]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_WARRIOR] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARRIOR]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_DEATHKNIGHT] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEATHKNIGHT]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_DEMONHUNTER] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEMONHUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncMelee[HEALBOT_MONK] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MONK]]=true;
                        end
                    elseif dropdownID==6 then
                        if HealBot_Globals.EmergIncRange[HEALBOT_DRUID] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DRUID]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_HUNTER] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_HUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_MAGE] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MAGE]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_PALADIN] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PALADIN]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_PRIEST] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PRIEST]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_ROGUE] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_ROGUE]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_SHAMAN] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_SHAMAN]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_WARLOCK] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARLOCK]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_WARRIOR] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARRIOR]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_DEATHKNIGHT] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEATHKNIGHT]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_DEMONHUNTER] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEMONHUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncRange[HEALBOT_MONK] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MONK]]=true;
                        end
                    elseif dropdownID==7 then
                        if HealBot_Globals.EmergIncHealers[HEALBOT_DRUID] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DRUID]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_HUNTER] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_HUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_MAGE] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MAGE]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_PALADIN] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PALADIN]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_PRIEST] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PRIEST]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_ROGUE] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_ROGUE]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_SHAMAN] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_SHAMAN]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_WARLOCK] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARLOCK]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_WARRIOR] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARRIOR]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_DEATHKNIGHT] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEATHKNIGHT]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_DEMONHUNTER] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEMONHUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncHealers[HEALBOT_MONK] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MONK]]=true;
                        end
                    elseif dropdownID==8 then
                        if HealBot_Globals.EmergIncCustom[HEALBOT_DRUID] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DRUID]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_HUNTER] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_HUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_MAGE] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MAGE]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_PALADIN] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PALADIN]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_PRIEST] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_PRIEST]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_ROGUE] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_ROGUE]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_SHAMAN] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_SHAMAN]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_WARLOCK] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARLOCK]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_WARRIOR] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_WARRIOR]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_DEATHKNIGHT] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEATHKNIGHT]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_DEMONHUNTER] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_DEMONHUNTER]]=true;
                        end
                        if HealBot_Globals.EmergIncCustom[HEALBOT_MONK] then
                            HealBot_BuffWatchTargetSpell[HealBot_Class_En[HEALBOT_MONK]]=true;
                        end
                    elseif dropdownID==9 then
                        HealBot_BuffWatchTargetSpell["PvP"]=true
                    elseif dropdownID==10 then
                        HealBot_BuffWatchTargetSpell["PvE"]=true
                    elseif dropdownID==11 then
                        HealBot_BuffWatchTargetSpell["MainTanks"]=true
                    elseif dropdownID==12 then
                        HealBot_BuffWatchTargetSpell["MyTargets"]=true
                    elseif dropdownID==13 then
                        HealBot_BuffWatchTargetSpell["Focus"]=true
                    elseif dropdownID==14 then
                        HealBot_BuffWatchTargetSpell["Name"]=true
                    elseif dropdownID==15 then
                        HealBot_BuffWatchTargetSpell["SingleTank"]=true
                    elseif dropdownID==16 then
                        HealBot_BuffWatchTargetSpell["Solo"]=true;
                    end
                    HealBot_buffbarcolr[sName]=buffbarcolrClass[k];
                    HealBot_buffbarcolg[sName]=buffbarcolgClass[k];
                    HealBot_buffbarcolb[sName]=buffbarcolbClass[k];
                end
            end
        end    
        for k=9,10 do
            if BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)] and BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)]>1 and getn(HealBot_Buff_WeaponEnchant_List[k-8])>=BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)] then
                HealBot_buffbarcolr[HealBot_Buff_WeaponEnchant_List[k-8][BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)]]]=buffbarcolrClass[k];
                HealBot_buffbarcolg[HealBot_Buff_WeaponEnchant_List[k-8][BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)]]]=buffbarcolgClass[k];
                HealBot_buffbarcolb[HealBot_Buff_WeaponEnchant_List[k-8][BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(k)]]]=buffbarcolbClass[k];
            end
        end
        --HealBot_Options_ExtraBuff_Reset()
        HealBot_Timers_Set("AURA","ExtraBuffReset")
        HealBot_Timers_Set("AURA","ResetBuffCache")
        --HealBot_Timers_Set("PLAYER","InvChange")
    else
        HealBot_Timers_Set("AURA","BuffReset", 0.5)
    end
end

function HealBot_Options_RetDebuffRGB(button)
    if button.aura.debuff.type~=HEALBOT_CUSTOM_en and HealBot_Config_Cures.CDCBarColour[button.aura.debuff.type] then
        return HealBot_Config_Cures.CDCBarColour[button.aura.debuff.type].R or 1,
               HealBot_Config_Cures.CDCBarColour[button.aura.debuff.type].G or 0.25,
               HealBot_Config_Cures.CDCBarColour[button.aura.debuff.type].B or 0.25
    elseif HealBot_Globals.CDCBarColour[button.aura.debuff.id] then
        return HealBot_Globals.CDCBarColour[button.aura.debuff.id].R or 1,
               HealBot_Globals.CDCBarColour[button.aura.debuff.id].G or 0.25,
               HealBot_Globals.CDCBarColour[button.aura.debuff.id].B or 0.25
    elseif HealBot_Globals.CDCBarColour[button.aura.debuff.name] then
        return HealBot_Globals.CDCBarColour[button.aura.debuff.name].R or 1,
               HealBot_Globals.CDCBarColour[button.aura.debuff.name].G or 0.25,
               HealBot_Globals.CDCBarColour[button.aura.debuff.name].B or 0.25
    else
        return HealBot_Globals.CDCBarColour[customDebuffPriority].R or 1,
               HealBot_Globals.CDCBarColour[customDebuffPriority].G or 0.25,
               HealBot_Globals.CDCBarColour[customDebuffPriority].B or 0.25
    end
end

function HealBot_Options_RetBuffRGB(button)
    if button.aura.buff.missingbuff and HealBot_buffbarcolr[button.aura.buff.missingbuff] then
        return HealBot_buffbarcolr[button.aura.buff.missingbuff] or 1,
               HealBot_buffbarcolg[button.aura.buff.missingbuff] or 1,
               HealBot_buffbarcolb[button.aura.buff.missingbuff] or 1
    elseif HealBot_Globals.CustomBuffBarColour[button.aura.buff.id] then
        return HealBot_Globals.CustomBuffBarColour[button.aura.buff.id]["R"] or 1,
               HealBot_Globals.CustomBuffBarColour[button.aura.buff.id]["G"] or 1,
               HealBot_Globals.CustomBuffBarColour[button.aura.buff.id]["B"] or 1
    elseif HealBot_Globals.CustomBuffBarColour[button.aura.buff.name] then
        return HealBot_Globals.CustomBuffBarColour[button.aura.buff.name]["R"] or 1,
               HealBot_Globals.CustomBuffBarColour[button.aura.buff.name]["G"] or 1,
               HealBot_Globals.CustomBuffBarColour[button.aura.buff.name]["B"] or 1
    elseif button.aura.buff.missingbuff then
        return 1,1,1
    else
        return HealBot_Globals.CustomBuffBarColour[customBuffPriority]["R"] or 1,
               HealBot_Globals.CustomBuffBarColour[customBuffPriority]["G"] or 1,
               HealBot_Globals.CustomBuffBarColour[customBuffPriority]["B"] or 1
    end
end

function HealBot_Options_RetBuffRGBName(spellName)
    return HealBot_buffbarcolr[spellName],HealBot_buffbarcolg[spellName],HealBot_buffbarcolb[spellName];
end

function HealBot_Options_PresetColours_AliasSave(self,id)
    HealBot_Globals.PresetColoursAlias[id]=self:GetText()
end

function HealBot_Options_PresetColourClick(self)
    HealBot_Options_luVars["PresetColourCaller"]=self:GetName()
    if HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_BuffHoTPresetColour" then
        HealBot_Options_Panel5:Hide()
        HealBot_Options_PresetColours:Show()
    elseif strsub(HealBot_Options_luVars["PresetColourCaller"],1,20)=="HealBot_Options_Buff" then
        local id=tonumber(strsub(HealBot_Options_luVars["PresetColourCaller"] ,33));
        HealBot_Options_luVars["PresetColourCaller"]="Buff"..id
        HealBot_Options_Panel5:Hide()
        HealBot_Options_PresetColours:Show()
    elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_CustomDebuffPresetColour" then
        HealBot_Options_Panel4:Hide()
        HealBot_Options_PresetColours:Show()
    elseif strsub(HealBot_Options_luVars["PresetColourCaller"],1,22)=="HealBot_Options_Debuff" then
        HealBot_Options_Panel4:Hide()
        HealBot_Options_PresetColours:Show()
    elseif strsub(HealBot_Options_luVars["PresetColourCaller"],1,20)=="HealBot_Options_Skin" then
        HealBot_Options_Panel3:Hide()
        HealBot_Options_PresetColours:Show()
    end
end

function HealBot_Colorpick_OnClick(CDCType)
    if CDCType==HEALBOT_CUSTOM_en then
        HealBot_ColourObjWaiting=customDebuffPriority
        local sName=nil
        if HealBot_Options_luVars["CDebuffcustomSpellID"] and HealBot_Options_luVars["CDebuffcustomSpellID"]~=HEALBOT_CUSTOM_CAT_CUSTOM_AUTOMATIC then 
            sName=HealBot_Options_SpellGetName(HealBot_Options_luVars["CDebuffcustomSpellID"]) 
        end
        if HealBot_Options_luVars["CDebuffcustomSpellID"] and sName then
            HealBot_ColourObjWaiting=HealBot_Options_luVars["CDebuffcustomSpellID"]
            HealBot_ColourObjWaitingExtra=sName
            if not HealBot_Globals.CDCBarColour[HealBot_Options_luVars["CDebuffcustomSpellID"]] then 
                HealBot_Globals.CDCBarColour[HealBot_Options_luVars["CDebuffcustomSpellID"]]={}
                HealBot_UseColourPick(HealBot_Globals.CDCBarColour[customDebuffPriority].R,HealBot_Globals.CDCBarColour[customDebuffPriority].G,HealBot_Globals.CDCBarColour[customDebuffPriority].B, nil)
            else
                HealBot_UseColourPick(HealBot_Globals.CDCBarColour[HealBot_Options_luVars["CDebuffcustomSpellID"]].R,
                                      HealBot_Globals.CDCBarColour[HealBot_Options_luVars["CDebuffcustomSpellID"]].G,
                                      HealBot_Globals.CDCBarColour[HealBot_Options_luVars["CDebuffcustomSpellID"]].B, nil)
            end
        else
            HealBot_ColourObjWaitingExtra=nil
            HealBot_UseColourPick(HealBot_Globals.CDCBarColour[customDebuffPriority].R,HealBot_Globals.CDCBarColour[customDebuffPriority].G,HealBot_Globals.CDCBarColour[customDebuffPriority].B, nil)
        end
    elseif CDCType=="CustomBuff" then
        HealBot_ColourObjWaiting=customBuffPriority
        local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
        local sName=nil
        if sId then sName=HealBot_Options_SpellGetName(sId) end
        if sId and sName then
            HealBot_ColourObjWaiting=sId
            HealBot_ColourObjWaitingExtra=sName
            if not HealBot_Globals.CustomBuffBarColour[sId] then 
                HealBot_Globals.CustomBuffBarColour[sId]={}
                HealBot_UseColourPick(HealBot_Globals.CustomBuffBarColour[customBuffPriority].R,HealBot_Globals.CustomBuffBarColour[customBuffPriority].G,HealBot_Globals.CustomBuffBarColour[customBuffPriority].B, nil)
            else
                HealBot_UseColourPick(HealBot_Globals.CustomBuffBarColour[sId].R,
                                      HealBot_Globals.CustomBuffBarColour[sId].G,
                                      HealBot_Globals.CustomBuffBarColour[sId].B, nil)
            end
        else
            HealBot_ColourObjWaitingExtra=nil
            HealBot_UseColourPick(HealBot_Globals.CustomBuffBarColour[customBuffPriority].R,HealBot_Globals.CustomBuffBarColour[customBuffPriority].G,HealBot_Globals.CustomBuffBarColour[customBuffPriority].B, nil)
        end
    else
        HealBot_ColourObjWaiting=CDCType;
        HealBot_UseColourPick(HealBot_Config_Cures.CDCBarColour[CDCType].R,HealBot_Config_Cures.CDCBarColour[CDCType].G,HealBot_Config_Cures.CDCBarColour[CDCType].B, nil)
    end
end

function HealBot_PresetColorpick_OnClick(id)
    HealBot_Options_luVars["PresetColoursID"]=id
    HealBot_ColourObjWaiting="Preset"
    HealBot_UseColourPick(HealBot_Globals.PresetColours[id].R,HealBot_Globals.PresetColours[id].G,HealBot_Globals.PresetColours[id].B, HealBot_Globals.PresetColours[id].A)
end

local function HealBot_Returned_Colours(R, G, B, A, preset)
  --R, G, B = ColorPickerFrame:GetColorRGB(); -- added by Diacono
  --A = OpacitySliderFrame:GetValue();
    if A and not preset then
        A = ((0-A)+1);
        A=HealBot_Comm_round(A,2)
    end
    R=HealBot_Comm_round(R,3)
    G=HealBot_Comm_round(G,3)
    B=HealBot_Comm_round(B,3)
    local setskincols=true;
    local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
    if HealBot_ColourObjWaiting=="Back" then
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKR"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKG"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKB"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACKA"] = R, G, B, A;
    elseif HealBot_ColourObjWaiting=="Bor" then
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERR"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERG"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERB"],
        Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDERA"] = R, G, B, A;
    elseif HealBot_ColourObjWaiting=="AliasT" then
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"] = R, G, B, A;
    elseif HealBot_ColourObjWaiting=="Alias" then
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
        Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"] = R, G, B, A;
    elseif HealBot_ColourObjWaiting=="HeadB" then
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
        Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"] = R, G, B, A;
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    elseif HealBot_ColourObjWaiting=="HeadT" then
        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["B"],
        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"] = R, G, B, A;
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
    elseif HealBot_ColourObjWaiting=="CustomBar" then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"] = R, G, B;
        HealBot_Timers_Set("LAST","ResetUnitStatus")
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomInjuredBar" then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIB"] = R, G, B;
        HealBot_Timers_Set("LAST","ResetUnitStatus")
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomCriticalBar" then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCB"] = R, G, B;
        HealBot_Timers_Set("LAST","ResetUnitStatus")
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomAuxBar" then
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["R"],
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["G"],
        Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["B"]= R, G, B;
        HealBot_Aux_UpdateAllAuxByType(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxBar"])
    elseif HealBot_ColourObjWaiting=="CustomNameText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomNameInjuredText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomNameCriticalText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomStateText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomStateInjuredText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomStateCriticalText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="DeadStateText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SDCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SDCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SDCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    elseif HealBot_ColourObjWaiting=="DeadNameText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    elseif HealBot_ColourObjWaiting=="ResStateText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    elseif HealBot_ColourObjWaiting=="ResNameText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NRCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NRCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NRCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    elseif HealBot_ColourObjWaiting=="SummonStateText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    elseif HealBot_ColourObjWaiting=="SummonNameText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NSCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NSCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NSCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
    elseif HealBot_ColourObjWaiting=="CustomEmergCrit" then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CR"],
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CG"],
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CB"] = R, G, B;
        HealBot_Timers_Set("SKINS","UpdateEmergBars")
    elseif HealBot_ColourObjWaiting=="CustomEmergInj" then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IR"],
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IG"],
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IB"] = R, G, B;
        HealBot_Timers_Set("SKINS","UpdateEmergBars")
    elseif HealBot_ColourObjWaiting=="CustomEmergHealthy" then
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
        Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"] = R, G, B;
        HealBot_Timers_Set("SKINS","UpdateEmergBars")
    elseif HealBot_ColourObjWaiting=="CustomOverHealText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OCB"] = R, G, B;
        HealBot_Timers_Set("SKINS","SetBarsTextColour")
    elseif HealBot_ColourObjWaiting=="CustomInHealText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICB"] = R, G, B;
        HealBot_Timers_Set("SKINS","SetBarsTextColour")
    elseif HealBot_ColourObjWaiting=="CustomExtraHealthText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HECR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HECG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HECB"] = R, G, B;
        HealBot_Timers_Set("SKINS","TextExtraCustomCols")
        HealBot_Timers_Set("SKINS","TextUpdateHealth")
    elseif HealBot_ColourObjWaiting=="CustomAggroText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACB"] = R, G, B;
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomAggroInjuredText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICB"] = R, G, B;
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomAggroCriticalText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCB"] = R, G, B;
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomAuxText" then
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLR"],
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLG"],
        Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["COLB"] = R, G, B;
        HealBot_Aux_UpdateAllAuxByType(HealBot_Options_luVars["FramesSelFrame"], HealBot_Options_luVars["AuxTxtBar"])
    elseif HealBot_ColourObjWaiting=="CustomHealthText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_Timers_Set("SKINS","TextExtraCustomCols")
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomHealthInjuredText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomHealthCriticalText" then
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCR"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCG"],
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCB"] = R, G, B;
        if not HealBot_Options_luVars["TestBarsOn"] then HealBot_Timers_Set("SKINS","SkinBarTextColours") end
        HealBot_TextCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomBackBar" then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BB"] = R, G, B;
        HealBot_Timers_Set("LAST","ResetUnitStatus")
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomBackInjuredBar" then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIB"] = R, G, B;
        HealBot_Timers_Set("LAST","ResetUnitStatus")
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomBackCriticalBar" then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCB"] = R, G, B;
        HealBot_Timers_Set("LAST","ResetUnitStatus")
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomIHBar" then
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IB"] = R, G, B;
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomIHInjuredBar" then
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIB"] = R, G, B;
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomIHCriticalBar" then
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICB"] = R, G, B;
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomAbsorbBar" then
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AB"] = R, G, B;
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomAbsorbInjuredBar" then
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIB"] = R, G, B;
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomAbsorbCriticalBar" then
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACR"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACG"],
        Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACB"] = R, G, B;
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomBorderBar" then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORB"] = R, G, B;
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomBorderInjuredBar" then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIB"] = R, G, B;
        HealBot_BarCustomColours_SetStatusBars()
    elseif HealBot_ColourObjWaiting=="CustomBorderCriticalBar" then
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCR"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCG"],
        Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCB"] = R, G, B;
        HealBot_BarCustomColours_SetStatusBars()
    elseif strsub(HealBot_ColourObjWaiting ,1,4)=="Buff" then
        local id=tonumber(strsub(HealBot_ColourObjWaiting ,5));
        local buffbarcolrClass = HealBot_Config_Buffs.HealBotBuffColR or 1
        local buffbarcolgClass = HealBot_Config_Buffs.HealBotBuffColG or 1
        local buffbarcolbClass = HealBot_Config_Buffs.HealBotBuffColB or 1
        buffbarcolrClass[id],
        buffbarcolgClass[id],
        buffbarcolbClass[id] = R, G, B;
        HealBot_Timers_Set("AURA","BuffBarColours")
        setskincols=false;
    elseif HealBot_ColourObjWaiting==customDebuffPriority or HealBot_ColourObjWaiting==HealBot_Options_luVars["CDebuffcustomSpellID"] then
        HealBot_Globals.CDCBarColour[HealBot_ColourObjWaiting].R,
        HealBot_Globals.CDCBarColour[HealBot_ColourObjWaiting].G,
        HealBot_Globals.CDCBarColour[HealBot_ColourObjWaiting].B = R, G, B;
        if HealBot_ColourObjWaiting==HealBot_Options_luVars["CDebuffcustomSpellID"] and HealBot_ColourObjWaitingExtra then
            if not HealBot_Globals.CDCBarColour[HealBot_ColourObjWaitingExtra] then
                HealBot_Globals.CDCBarColour[HealBot_ColourObjWaitingExtra]={}
            end
            HealBot_Globals.CDCBarColour[HealBot_ColourObjWaitingExtra].R,
            HealBot_Globals.CDCBarColour[HealBot_ColourObjWaitingExtra].G,
            HealBot_Globals.CDCBarColour[HealBot_ColourObjWaitingExtra].B = R, G, B;
        end
        HealBot_SetCDCBarColours();
        setskincols=false;
    elseif HealBot_ColourObjWaiting==customBuffPriority or HealBot_ColourObjWaiting==sId then
        HealBot_Globals.CustomBuffBarColour[HealBot_ColourObjWaiting].R,
        HealBot_Globals.CustomBuffBarColour[HealBot_ColourObjWaiting].G,
        HealBot_Globals.CustomBuffBarColour[HealBot_ColourObjWaiting].B = R, G, B;
        if HealBot_ColourObjWaiting==sId and HealBot_ColourObjWaitingExtra then
            if not HealBot_Globals.CustomBuffBarColour[HealBot_ColourObjWaitingExtra] then
                HealBot_Globals.CustomBuffBarColour[HealBot_ColourObjWaitingExtra]={}
            end
            HealBot_Globals.CustomBuffBarColour[HealBot_ColourObjWaitingExtra].R,
            HealBot_Globals.CustomBuffBarColour[HealBot_ColourObjWaitingExtra].G,
            HealBot_Globals.CustomBuffBarColour[HealBot_ColourObjWaitingExtra].B = R, G, B;
        end
        HealBot_SetCustomBuffBarColours();
        HealBot_Timers_Set("AURA","CustomBuffList")
        setskincols=false;
    elseif HealBot_Config_Cures.CDCBarColour[HealBot_ColourObjWaiting] then
        HealBot_Config_Cures.CDCBarColour[HealBot_ColourObjWaiting].R,
        HealBot_Config_Cures.CDCBarColour[HealBot_ColourObjWaiting].G,
        HealBot_Config_Cures.CDCBarColour[HealBot_ColourObjWaiting].B = R, G, B;
        HealBot_SetCDCBarColours();
        setskincols=false;
    elseif HealBot_ColourObjWaiting=="Preset" then
        HealBot_Globals.PresetColours[HealBot_Options_luVars["PresetColoursID"]].R,
        HealBot_Globals.PresetColours[HealBot_Options_luVars["PresetColoursID"]].G,
        HealBot_Globals.PresetColours[HealBot_Options_luVars["PresetColoursID"]].B,
        HealBot_Globals.PresetColours[HealBot_Options_luVars["PresetColoursID"]].A = R, G, B, A;
        g=_G["HealBot_PresetColourpick"..HealBot_Options_luVars["PresetColoursID"]]
        g:SetStatusBarColor(HealBot_Globals.PresetColours[HealBot_Options_luVars["PresetColoursID"]].R, 
                            HealBot_Globals.PresetColours[HealBot_Options_luVars["PresetColoursID"]].G, 
                            HealBot_Globals.PresetColours[HealBot_Options_luVars["PresetColoursID"]].B, 
                            HealBot_Globals.PresetColours[HealBot_Options_luVars["PresetColoursID"]].A) 
    end
    if setskincols then
        HealBot_Timers_Set("SKINS","SkinsFormat")
        HealBot_Timers_Set("SKINS","SkinColours")
    end
end

function HealBot_Options_CustomColourInjured_OnValueChanged(self)
    if HealBot_Options_luVars["BarCustomColoursCaller"]=="Health" then
        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"]<Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"] then
                Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"]=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"]
                HealBot_BarCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Back" then
        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIT"]<Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCT"] then
                Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCT"]=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIT"]
                HealBot_BarCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="InHeal" then
        if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIT"]<Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICT"] then
                Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICT"]=Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIT"]
                HealBot_BarCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Absorb" then
        if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"]<Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"] then
                Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"]=Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"]
                HealBot_BarCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Border" then
        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIT"]<Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCT"] then
                Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCT"]=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIT"]
                HealBot_BarCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    end
end

function HealBot_Options_CustomColourCritical_OnValueChanged(self)
    if HealBot_Options_luVars["BarCustomColoursCaller"]=="Health" then
        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"]>Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"] then
                Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"]=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"]
                HealBot_BarCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Back" then
        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCT"]>Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIT"] then
                Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIT"]=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCT"]
                HealBot_BarCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="InHeal" then
        if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICT"]>Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIT"] then
                Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIT"]=Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICT"]
                HealBot_BarCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Absorb" then
        if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"]>Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"] then
                Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"]=Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"]
                HealBot_BarCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Border" then
        if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCT"]>Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIT"] then
                Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIT"]=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCT"]
                HealBot_BarCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    end
end

function HealBot_Options_TextCustomColourInjured_OnValueChanged(self)
    if HealBot_Options_luVars["TextCustomColoursCaller"]=="Name" then
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NIT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NIT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NIT"]<Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCT"] then
                Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCT"]=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NIT"]
                HealBot_TextCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Health" then
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"]<Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"] then
                Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"]=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"]
                HealBot_TextCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="State" then
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIT"]<Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCT"] then
                Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCT"]=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIT"]
                HealBot_TextCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Aggro" then
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"]<Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"] then
                Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"]=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"]
                HealBot_TextCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    end
end

function HealBot_Options_TextCustomColourCritical_OnValueChanged(self)
    if HealBot_Options_luVars["TextCustomColoursCaller"]=="Name" then
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCT"]>Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NIT"] then
                Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NIT"]=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCT"]
                HealBot_TextCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Health" then
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"]>Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"] then
                Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"]=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"]
                HealBot_TextCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="State" then
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCT"]>Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIT"] then
                Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIT"]=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCT"]
                HealBot_TextCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Aggro" then
        if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"]~=HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2) then
            Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"] = HealBot_Comm_round(HealBot_Options_Pct_OnValueChanged(self),2);
            if Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"]>Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"] then
                Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"]=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"]
                HealBot_TextCustomColours_SetStatusBars()
            end
            HealBot_Timers_Set("LAST","ResetUnitStatus")
        end
    end
end

function HealBot_BarCustomColours_SetStatusBars()
    local r,g,b
    if HealBot_Options_luVars["BarCustomColoursCaller"]=="Health" then
        r,g,b=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HR"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HG"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HB"]

        HealBot_Options_CustomColourInjured:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"] or 70);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourInjured)
        HealBot_Options_CustomColourCritical:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"] or 40);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourCritical)
        
        HealBot_SkinsFramesBarsColoursCustom_Text:SetText(HEALBOT_OPTIONS_CUSTOMCOLHEALTH)
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Back" then
        r,g,b=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BR"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BG"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BB"]

        HealBot_Options_CustomColourInjured:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIT"] or 70);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourInjured)
        HealBot_Options_CustomColourCritical:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCT"] or 40);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourCritical)
        
        HealBot_SkinsFramesBarsColoursCustom_Text:SetText(HEALBOT_OPTIONS_CUSTOMCOLBACK)
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="InHeal" then
        r,g,b=Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IR"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IG"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IB"]

        HealBot_Options_CustomColourInjured:SetValue(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIT"] or 70);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourInjured)
        HealBot_Options_CustomColourCritical:SetValue(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICT"] or 40);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourCritical)
        
        HealBot_SkinsFramesBarsColoursCustom_Text:SetText(HEALBOT_OPTIONS_CUSTOMCOLINHEAL)
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Absorb" then
        r,g,b=Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AR"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AG"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AB"]

        HealBot_Options_CustomColourInjured:SetValue(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"] or 70);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourInjured)
        HealBot_Options_CustomColourCritical:SetValue(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"] or 40);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourCritical)
        
        HealBot_SkinsFramesBarsColoursCustom_Text:SetText(HEALBOT_OPTIONS_CUSTOMCOLABSORB)
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Border" then
        r,g,b=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORR"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORG"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORB"]

        HealBot_Options_CustomColourInjured:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIT"] or 70);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourInjured)
        HealBot_Options_CustomColourCritical:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCT"] or 40);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourCritical)
        
        HealBot_SkinsFramesBarsColoursCustom_Text:SetText(HEALBOT_OPTIONS_CUSTOMCOLBACKBOR)
    end
    HealBot_BarHealthyCustomColour:SetStatusBarColor(r,g,b,1)

    if HealBot_Options_luVars["BarCustomColoursCaller"]=="Health" then
        r,g,b=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIR"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIG"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIB"]
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Back" then
        r,g,b=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIR"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIG"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BIB"]
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="InHeal" then
        r,g,b=Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIR"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIG"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IIB"]
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Absorb" then
        r,g,b=Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIR"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIG"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIB"]
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Border" then
        r,g,b=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIR"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIG"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORIB"]
    end
    HealBot_BarInjuredCustomColour:SetStatusBarColor(r,g,b,1)
    
    if HealBot_Options_luVars["BarCustomColoursCaller"]=="Health" then
        r,g,b=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCR"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCG"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCB"]
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Back" then
        r,g,b=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCR"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCG"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BCB"]
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="InHeal" then
        r,g,b=Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICR"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICG"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ICB"]
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Absorb" then
        r,g,b=Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACR"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACG"],
              Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACB"]
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Border" then
        r,g,b=Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCR"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCG"],
              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORCB"]
    end
    HealBot_BarCriticalCustomColour:SetStatusBarColor(r,g,b,1)
end

function HealBot_TextCustomColours_SetStatusBars()
    local r,g,b,fn,fh,fo
    if HealBot_Options_luVars["TextCustomColoursCaller"]=="Name" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCB"]
        fn=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]
        fh=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"]
        fo=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]
        
        HealBot_Options_TextCustomColourInjured:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NIT"] or 70);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_TextCustomColourInjured)
        HealBot_Options_TextCustomColourCritical:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCT"] or 40);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_TextCustomColourCritical)
        
        HealBot_SkinsFramesTextColoursCustom_Text:SetText(HEALBOT_OPTIONS_CUSTOMTEXTCOLNAME)
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Health" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCB"]
        fn=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HFONT"]
        fh=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HHEIGHT"]
        fo=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOUTLINE"]

        HealBot_Options_TextCustomColourInjured:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIT"] or 70);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_TextCustomColourInjured)
        HealBot_Options_TextCustomColourCritical:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCT"] or 40);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_TextCustomColourCritical)
        
        HealBot_SkinsFramesTextColoursCustom_Text:SetText(HEALBOT_OPTIONS_CUSTOMTEXTCOLHEALTH)
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="State" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCB"]
        fn=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFONT"]
        fh=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHEIGHT"]
        fo=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOUTLINE"]

        HealBot_Options_TextCustomColourInjured:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIT"] or 70);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_TextCustomColourInjured)
        HealBot_Options_TextCustomColourCritical:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCT"] or 40);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_TextCustomColourCritical)
        
        HealBot_SkinsFramesTextColoursCustom_Text:SetText(HEALBOT_OPTIONS_CUSTOMTEXTCOLSTATE)
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Aggro" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACB"]
        fn=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AFONT"]
        fh=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AHEIGHT"]
        fo=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOUTLINE"]

        HealBot_Options_TextCustomColourInjured:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AIT"] or 70);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_TextCustomColourInjured)
        HealBot_Options_TextCustomColourCritical:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACT"] or 40);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_TextCustomColourCritical)
        
        HealBot_SkinsFramesTextColoursCustom_Text:SetText(HEALBOT_OPTIONS_CUSTOMTEXTCOLAGGRO)
    end
    HealBot_TextHealthyCustomColourt:SetTextColor(r,g,b,1)
    HealBot_TextHealthyCustomColourt:SetFont(LSM:Fetch('font',fn),fh,HealBot_Font_Outline[fo]);
    HealBot_TextInjuredCustomColourt:SetFont(LSM:Fetch('font',fn),fh,HealBot_Font_Outline[fo]);
    HealBot_TextCriticalCustomColourt:SetFont(LSM:Fetch('font',fn),fh,HealBot_Font_Outline[fo]);
                                       
    if HealBot_Options_luVars["TextCustomColoursCaller"]=="Name" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NICB"]
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Health" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HICB"]
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="State" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SICB"]
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Aggro" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AICB"]
    end
    HealBot_TextInjuredCustomColourt:SetTextColor(r,g,b,1)
    
    if HealBot_Options_luVars["TextCustomColoursCaller"]=="Name" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCCB"]
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Health" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCCB"]
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="State" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCCB"]
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Aggro" then
        r,g,b=Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCR"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCG"],
              Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACCB"]
    end
    HealBot_TextCriticalCustomColourt:SetTextColor(r,g,b,1)
end

function HealBot_BarCustomColours_OnClick(caller)
    HealBot_Options_luVars["BarCustomColoursCaller"]=caller
    HealBot_Options_SkinsFramesBarsColoursCustom:Show()
    HealBot_Options_SkinsFramesBarsColours:Hide()
    HealBot_BarCustomColours_SetStatusBars()
end

function HealBot_TextCustomColours_OnClick(caller)
    HealBot_Options_luVars["TextCustomColoursCaller"]=caller
    HealBot_Options_SkinsFramesTextColoursCustom:Show()
    if HealBot_Options_luVars["TextCustomColoursCaller"]=="Name" then
        HealBot_Options_SkinsFrameTextNameColour:Hide()
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Health" then
        HealBot_Options_SkinsFrameTextHealthColour:Hide()
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="State" then
        HealBot_Options_SkinsFrameTextStateColour:Hide()
    else
        HealBot_Options_SkinsFrameTextAggroColour:Hide()
    end
    HealBot_TextCustomColours_SetStatusBars()
end

function HealBot_SkinCustomColoursColorpick_OnClick(caller)
    if HealBot_Options_luVars["BarCustomColoursCaller"]=="Health" then
        if caller=="Critical" then
            HealBot_SkinColorpick_OnClick("CustomCriticalBar")
        elseif caller=="Injured" then
            HealBot_SkinColorpick_OnClick("CustomInjuredBar")
        else
            HealBot_SkinColorpick_OnClick("CustomBar")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Back" then
        if caller=="Critical" then
            HealBot_SkinColorpick_OnClick("CustomBackCriticalBar")
        elseif caller=="Injured" then
            HealBot_SkinColorpick_OnClick("CustomBackInjuredBar")
        else
            HealBot_SkinColorpick_OnClick("CustomBackBar")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="InHeal" then
        if caller=="Critical" then
            HealBot_SkinColorpick_OnClick("CustomIHCriticalBar")
        elseif caller=="Injured" then
            HealBot_SkinColorpick_OnClick("CustomIHInjuredBar")
        else
            HealBot_SkinColorpick_OnClick("CustomIHBar")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Absorb" then
        if caller=="Critical" then
            HealBot_SkinColorpick_OnClick("CustomAbsorbCriticalBar")
        elseif caller=="Injured" then
            HealBot_SkinColorpick_OnClick("CustomAbsorbInjuredBar")
        else
            HealBot_SkinColorpick_OnClick("CustomAbsorbBar")
        end
    elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Border" then
        if caller=="Critical" then
            HealBot_SkinColorpick_OnClick("CustomBorderCriticalBar")
        elseif caller=="Injured" then
            HealBot_SkinColorpick_OnClick("CustomBorderInjuredBar")
        else
            HealBot_SkinColorpick_OnClick("CustomBorderBar")
        end
    end
end

function HealBot_SkinTextCustomColoursColorpick_OnClick(caller)
    if HealBot_Options_luVars["TextCustomColoursCaller"]=="Name" then
        if caller=="Critical" then
            HealBot_SkinColorpick_OnClick("CustomNameCriticalText")
        elseif caller=="Injured" then
            HealBot_SkinColorpick_OnClick("CustomNameInjuredText")
        else
            HealBot_SkinColorpick_OnClick("CustomNameText")
        end
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Health" then
        if caller=="Critical" then
            HealBot_SkinColorpick_OnClick("CustomHealthCriticalText")
        elseif caller=="Injured" then
            HealBot_SkinColorpick_OnClick("CustomHealthInjuredText")
        else
            HealBot_SkinColorpick_OnClick("CustomHealthText")
        end
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="State" then
        if caller=="Critical" then
            HealBot_SkinColorpick_OnClick("CustomStateCriticalText")
        elseif caller=="Injured" then
            HealBot_SkinColorpick_OnClick("CustomStateInjuredText")
        else
            HealBot_SkinColorpick_OnClick("CustomStateText")
        end
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Aggro" then
        if caller=="Critical" then
            HealBot_SkinColorpick_OnClick("CustomAggroCriticalText")
        elseif caller=="Injured" then
            HealBot_SkinColorpick_OnClick("CustomAggroInjuredText")
        else
            HealBot_SkinColorpick_OnClick("CustomAggroText")
        end
    end
    if caller~="Critical" and caller~="Injured" then
        HealBot_Options_luVars["CustomTxtColourHealthyChange"]=true
    end
end

function HealBot_Options_TextCustomColourDone_OnClick()
    if HealBot_Options_luVars["TextCustomColoursCaller"]=="Name" then
        HealBot_Options_SkinsFrameTextNameColour:Show()
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Health" then
        HealBot_Options_SkinsFrameTextHealthColour:Show()
    elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="State" then
        HealBot_Options_SkinsFrameTextStateColour:Show()
    else
        HealBot_Options_SkinsFrameTextAggroColour:Show()
    end
    HealBot_Options_SkinsFramesTextColoursCustom:Hide()
    if HealBot_Options_luVars["CustomTxtColourHealthyChange"] then
        HealBot_Options_luVars["CustomTxtColourHealthyChange"]=false
        HealBot_Timers_Set("SKINS","SkinBarTextColours")
    end
end

function HealBot_Options_PresetColourSelect_OnClick(id,cancel)
    if HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_BuffHoTPresetColour" then
        local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
        if sId and HealBot_Globals.CustomBuffBarColour[sId] then
            HealBot_ColourObjWaiting=sId
        else
            HealBot_ColourObjWaiting=customBuffPriority
        end
        HealBot_Options_PresetColours:Hide()
        HealBot_Options_Panel5:Show()
    elseif strsub(HealBot_Options_luVars["PresetColourCaller"] ,1,4)=="Buff" then
        HealBot_ColourObjWaiting=HealBot_Options_luVars["PresetColourCaller"]
        HealBot_Options_PresetColours:Hide()
        HealBot_Options_Panel5:Show()
    elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_CustomDebuffPresetColour" then
        if HealBot_Options_luVars["CDebuffcustomSpellID"] and HealBot_Globals.CDCBarColour[HealBot_Options_luVars["CDebuffcustomSpellID"]] then
            HealBot_ColourObjWaiting=HealBot_Options_luVars["CDebuffcustomSpellID"]
        else
            HealBot_ColourObjWaiting=customDebuffPriority
        end
        HealBot_Options_PresetColours:Hide()
        HealBot_Options_Panel4:Show()
    elseif strsub(HealBot_Options_luVars["PresetColourCaller"],1,22)=="HealBot_Options_Debuff" then
        if HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_DebuffCursePresetColour" then
            HealBot_ColourObjWaiting=HEALBOT_CURSE_en
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_DebuffPoisonPresetColour" then
            HealBot_ColourObjWaiting=HEALBOT_POISON_en
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_DebuffMagicPresetColour" then
            HealBot_ColourObjWaiting=HEALBOT_MAGIC_en
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_DebuffDiseasePresetColour" then
            HealBot_ColourObjWaiting=HEALBOT_DISEASE_en
        end
        HealBot_Options_PresetColours:Hide()
        HealBot_Options_Panel4:Show()
    elseif strsub(HealBot_Options_luVars["PresetColourCaller"],1,20)=="HealBot_Options_Skin" then
        if HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinBarHealthyPresetColour" then
            if HealBot_Options_luVars["BarCustomColoursCaller"]=="Health" then
                HealBot_ColourObjWaiting="CustomBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Back" then
                HealBot_ColourObjWaiting="CustomBackBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="InHeal" then
                HealBot_ColourObjWaiting="CustomIHBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Absorb" then
                HealBot_ColourObjWaiting="CustomAbsorbBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Border" then
                HealBot_ColourObjWaiting="CustomBorderBar"
            end
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinBarInjuredPresetColour" then
            if HealBot_Options_luVars["BarCustomColoursCaller"]=="Health" then
                HealBot_ColourObjWaiting="CustomInjuredBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Back" then
                HealBot_ColourObjWaiting="CustomBackInjuredBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="InHeal" then
                HealBot_ColourObjWaiting="CustomIHInjuredBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Absorb" then
                HealBot_ColourObjWaiting="CustomAbsorbInjuredBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Border" then
                HealBot_ColourObjWaiting="CustomBorderInjuredBar"
            end
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinBarCriticalPresetColour" then
            if HealBot_Options_luVars["BarCustomColoursCaller"]=="Health" then
                HealBot_ColourObjWaiting="CustomCriticalBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Back" then
                HealBot_ColourObjWaiting="CustomBackCriticalBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="InHeal" then
                HealBot_ColourObjWaiting="CustomIHCriticalBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Absorb" then
                HealBot_ColourObjWaiting="CustomAbsorbCriticalBar"
            elseif HealBot_Options_luVars["BarCustomColoursCaller"]=="Border" then
                HealBot_ColourObjWaiting="CustomBorderCriticalBar"
            end
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinTextHealthyPresetColour" then
            if HealBot_Options_luVars["TextCustomColoursCaller"]=="Name" then
                HealBot_ColourObjWaiting="CustomNameText"
            elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Health" then
                HealBot_ColourObjWaiting="CustomHealthText"
            elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="State" then
                HealBot_ColourObjWaiting="CustomStateText"
            elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Aggro" then
                HealBot_ColourObjWaiting="CustomAggroText"
            end
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinTextInjuredPresetColour" then
            if HealBot_Options_luVars["TextCustomColoursCaller"]=="Name" then
                HealBot_ColourObjWaiting="CustomNameInjuredText"
            elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Health" then
                HealBot_ColourObjWaiting="CustomHealthInjuredText"
            elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="State" then
                HealBot_ColourObjWaiting="CustomStateInjuredText"
            elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Aggro" then
                HealBot_ColourObjWaiting="CustomAggroInjuredText"
            end
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinTextCriticalPresetColour" then
            if HealBot_Options_luVars["TextCustomColoursCaller"]=="Name" then
                HealBot_ColourObjWaiting="CustomNameCriticalText"
            elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Health" then
                HealBot_ColourObjWaiting="CustomHealthCriticalText"
            elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="State" then
                HealBot_ColourObjWaiting="CustomStateCriticalText"
            elseif HealBot_Options_luVars["TextCustomColoursCaller"]=="Aggro" then
                HealBot_ColourObjWaiting="CustomAggroCriticalText"
            end
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinStateDeadColPresetColour" then
            HealBot_ColourObjWaiting="DeadStateText"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinDeadColPresetColour" then
            HealBot_ColourObjWaiting="DeadNameText"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinStateResColPresetColour" then
            HealBot_ColourObjWaiting="ResStateText"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinResColPresetColour" then
            HealBot_ColourObjWaiting="ResNameText"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinStateSummonColPresetColour" then
            HealBot_ColourObjWaiting="SummonStateText"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinSummonColPresetColour" then
            HealBot_ColourObjWaiting="SummonNameText"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinEmergCritPresetColour" then
            HealBot_ColourObjWaiting="CustomEmergCrit"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinEmergInjPresetColour" then
            HealBot_ColourObjWaiting="CustomEmergInj"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinEmergHealthyPresetColour" then
            HealBot_ColourObjWaiting="CustomEmergHealthy"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinBarExtraOverHealPresetColour" then
            HealBot_ColourObjWaiting="CustomOverHealText"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinBarExtraInHealPresetColour" then
            HealBot_ColourObjWaiting="CustomInHealText"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinBarExtraHealthPresetColour" then
            HealBot_ColourObjWaiting="CustomExtraHealthText"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinBarAuxTextPresetColour" then
            HealBot_ColourObjWaiting="CustomAuxText"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinBarAuxBarPresetColour" then
            HealBot_ColourObjWaiting="CustomAuxBar"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinHeaderBarPresetColour" then
            HealBot_ColourObjWaiting="HeadB"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinHeaderTextPresetColour" then
            HealBot_ColourObjWaiting="HeadT"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinFrameAliasTextPresetColour" then
            HealBot_ColourObjWaiting="AliasT"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinFrameAliasPresetColour" then
            HealBot_ColourObjWaiting="Alias"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinFrameBackPresetColour" then
            HealBot_ColourObjWaiting="Back"
        elseif HealBot_Options_luVars["PresetColourCaller"]=="HealBot_Options_SkinFrameBorderPresetColour" then
            HealBot_ColourObjWaiting="Bor"
        end
        HealBot_Options_PresetColours:Hide()
        HealBot_Options_Panel3:Show()
    end
    if not cancel then
        HealBot_Returned_Colours(HealBot_Globals.PresetColours[id].R, HealBot_Globals.PresetColours[id].G, 
                                 HealBot_Globals.PresetColours[id].B, HealBot_Globals.PresetColours[id].A, true)
    end
end

HealBot_Options_luVars["prevR"] = nil
HealBot_Options_luVars["prevG"] = nil
HealBot_Options_luVars["prevB"] = nil
HealBot_Options_luVars["prevA"] = nil
function HealBot_UseColourPick(R, G, B, A)
    if not R then R=1 end
    if not G then G=1 end
    if not B then B=1 end
    HealBot_Options_luVars["prevR"], HealBot_Options_luVars["prevG"], HealBot_Options_luVars["prevB"], HealBot_Options_luVars["prevA"] = R, G, B, A;
    if ColorPickerFrame:IsVisible() then 
        ColorPickerFrame:Hide();
    elseif A then
        ColorPickerFrame.hasOpacity = true;
        ColorPickerFrame.opacity = 1-A;
        ColorPickerFrame.func = function() local lR,lG,lB=ColorPickerFrame:GetColorRGB(); local lA=OpacitySliderFrame:GetValue() HealBot_Returned_Colours(lR,lG,lB,lA); end;
        ColorPickerFrame.opacityFunc = function() local lR,lG,lB=ColorPickerFrame:GetColorRGB(); local lA=OpacitySliderFrame:GetValue() HealBot_Returned_Colours(lR,lG,lB,lA); end;
        ColorPickerFrame.cancelFunc = function() HealBot_Returned_Colours(HealBot_Options_luVars["prevR"], HealBot_Options_luVars["prevG"], HealBot_Options_luVars["prevB"], 1-HealBot_Options_luVars["prevA"]); end; --added by Diacono
        ColorPickerFrame:ClearAllPoints();
        ColorPickerFrame:SetPoint("TOPLEFT","HealBot_Options","TOPRIGHT",0,-152);
        OpacitySliderFrame:SetValue(1-A);
        ColorPickerFrame:SetColorRGB(R, G, B);
        ColorPickerFrame:Show();
    else
        ColorPickerFrame.hasOpacity = false;
        ColorPickerFrame.func = function() HealBot_Returned_Colours(ColorPickerFrame:GetColorRGB()); end;
        ColorPickerFrame.cancelFunc = function() HealBot_Returned_Colours(HealBot_Options_luVars["prevR"], HealBot_Options_luVars["prevG"], HealBot_Options_luVars["prevB"]); end; --added by Diacono
        ColorPickerFrame:ClearAllPoints();
        ColorPickerFrame:SetPoint("TOPLEFT","HealBot_Options","TOPRIGHT",0,-152);
        ColorPickerFrame:SetColorRGB(R, G, B);
        ColorPickerFrame:Show();
    end
    return ColorPickerFrame:GetColorRGB();
end

function HealBot_SetCustomBuffBarColours()
    local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
    if sId and HealBot_Globals.CustomBuffBarColour[sId] then
        HealBot_BuffCustomColorpick:SetStatusBarColor(HealBot_Globals.CustomBuffBarColour[sId].R or 0.45,
                                                 HealBot_Globals.CustomBuffBarColour[sId].G or 0,
                                                 HealBot_Globals.CustomBuffBarColour[sId].B or 0.26,
                                                 Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"]);
    else
        HealBot_BuffCustomColorpick:SetStatusBarColor(HealBot_Globals.CustomBuffBarColour[customBuffPriority].R or 0.45,
                                                 HealBot_Globals.CustomBuffBarColour[customBuffPriority].G or 0,
                                                 HealBot_Globals.CustomBuffBarColour[customBuffPriority].B or 0.26,
                                                 Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"]);
    end
end

function HealBot_SetCDCBarColours()
    HealBot_DiseaseColorpick:SetStatusBarColor(HealBot_Config_Cures.CDCBarColour[HEALBOT_DISEASE_en].R or 0.55,
                                               HealBot_Config_Cures.CDCBarColour[HEALBOT_DISEASE_en].G or 0.19,
                                               HealBot_Config_Cures.CDCBarColour[HEALBOT_DISEASE_en].B or 0.7,
                                               Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"]);
    HealBot_MagicColorpick:SetStatusBarColor(HealBot_Config_Cures.CDCBarColour[HEALBOT_MAGIC_en].R or 0.26,
                                             HealBot_Config_Cures.CDCBarColour[HEALBOT_MAGIC_en].G or 0.33,
                                             HealBot_Config_Cures.CDCBarColour[HEALBOT_MAGIC_en].B or 0.83,
                                             Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"]);
    HealBot_PoisonColorpick:SetStatusBarColor(HealBot_Config_Cures.CDCBarColour[HEALBOT_POISON_en].R or 0.12,
                                              HealBot_Config_Cures.CDCBarColour[HEALBOT_POISON_en].G or 0.46,
                                              HealBot_Config_Cures.CDCBarColour[HEALBOT_POISON_en].B or 0.24,
                                              Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"]);
    HealBot_CurseColorpick:SetStatusBarColor(HealBot_Config_Cures.CDCBarColour[HEALBOT_CURSE_en].R or 0.83,
                                             HealBot_Config_Cures.CDCBarColour[HEALBOT_CURSE_en].G or 0.43,
                                             HealBot_Config_Cures.CDCBarColour[HEALBOT_CURSE_en].B or 0.09,
                                             Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"]);
    if HealBot_Options_luVars["CDebuffcustomSpellID"] and HealBot_Globals.CDCBarColour[HealBot_Options_luVars["CDebuffcustomSpellID"]] then
        HealBot_CustomColorpick:SetStatusBarColor(HealBot_Globals.CDCBarColour[HealBot_Options_luVars["CDebuffcustomSpellID"]].R or 0.45,
                                                 HealBot_Globals.CDCBarColour[HealBot_Options_luVars["CDebuffcustomSpellID"]].G or 0,
                                                 HealBot_Globals.CDCBarColour[HealBot_Options_luVars["CDebuffcustomSpellID"]].B or 0.26,
                                                 Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"]);
    else
        HealBot_CustomColorpick:SetStatusBarColor(HealBot_Globals.CDCBarColour[customDebuffPriority].R or 0.45,
                                                 HealBot_Globals.CDCBarColour[customDebuffPriority].G or 0,
                                                 HealBot_Globals.CDCBarColour[customDebuffPriority].B or 0.26,
                                                 Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"]);
    end
    HealBot_Timers_Set("AURA","CustomDebuffList")
end

function HealBot_SetBuffBarColours()
    local buffbarcolrClass = HealBot_Config_Buffs.HealBotBuffColR
    local buffbarcolgClass = HealBot_Config_Buffs.HealBotBuffColG
    local buffbarcolbClass = HealBot_Config_Buffs.HealBotBuffColB

    for k=1,15 do
        local bar=_G["HealBot_Buff"..k.."Colour"]
        if bar then
            bar:SetStatusBarColor((buffbarcolrClass[k] or 1),
                                  (buffbarcolgClass[k] or 1),
                                  (buffbarcolbClass[k] or 1),
                                  Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"]);
        end
    end
    HealBot_Timers_Set("AURA","BuffReset")
end
--------------------------------------------------------------------------------

function HealBot_Options_FrameAlias_OnTextChanged(self)
    if Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALIAS"]~=self:GetText() then
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALIAS"] = self:GetText()
        HealBot_Timers_InitExtraOptions()
    end
end

function HealBot_Options_FrameTitle_OnTextChanged(self)
    Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NAME"] = self:GetText()
    if Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"] then
        HealBot_Timers_Set("SKINS","FrameAliases")
    end
end

function HealBot_Options_FrameAliasShow_OnClick(self)
    if Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"]~=self:GetChecked() then
        Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"] = self:GetChecked()
        HealBot_Timers_Set("SKINS","SkinsFramesChanged")
        HealBot_Timers_Set("SKINS","FrameAliases")
    end
end

function HealBot_Options_KnownSpellCheckButtonNum(bNo)
    if bNo==2 then
        bNo=3
    elseif bNo==3 then
        bNo=2
    end
    return bNo
end

function HealBot_SpellAutoButton_OnClick(self, autoType, autoButton)
    if self:GetChecked() then
        HealBot_SpellAutoButton_Update(autoType, HealBot_Options_ComboButton_ModifierKey(HealBot_Options_ComboButtons_Modifier), HealBot_Options_luVars["ActionBarsCombo"], autoButton, "true")
    else
        HealBot_SpellAutoButton_Update(autoType, HealBot_Options_ComboButton_ModifierKey(HealBot_Options_ComboButtons_Modifier), HealBot_Options_luVars["ActionBarsCombo"], autoButton, "false")
    end
    if HealBot_Options_luVars["ActionBarsCombo"]==1 then
        HealBot_Timers_Set("INIT","PrepSetEnabledAttribs")
    elseif HealBot_Options_luVars["ActionBarsCombo"]==2 then
        HealBot_Timers_Set("INIT","PrepSetEnemyAttribs")
    elseif HealBot_Options_luVars["ActionBarsCombo"]==3 then
        HealBot_Timers_Set("INIT","PrepSetEmergAttribs")
    end
    
end

function HealBot_Options_KnownSpellCheckSetColour(self,sName,cType)
    if HealBot_Spell_Names[sName] or HealBot_Init_knownClassicHealSpell(sName) then
        self:SetTextColor(1,1,1,1)
    elseif GetMacroIndexByName(sName)>0 then
        self:SetTextColor(0.2,1,0.5,1)
    elseif HealBot_IsKnownItem(sName) then
        self:SetTextColor(0.2,0.5,1,1)
    elseif HealBot_Action_SpellCmdCodes(cType, sName) then
        self:SetTextColor(1,1,0,1)
    else
        local e,t=string.split("=", sName)
        if e and e==HEALBOT_EMOTE and t then
            self:SetTextColor(1,0.58,0,1)
        else
            self:SetTextColor(0.7,0.7,0.7,1)
        end
    end
end

function HealBot_Options_KnownSpellCheck(self, sName,cType,key,bNo)
    if self then
        if cType~="ICON" then
            HealBot_Options_KnownSpellCheckSetColour(self,sName,cType)
        elseif HealBot_Action_SpellCmdCodes(cType, sName) then
            self:SetTextColor(1,1,0,1)
        else
            self:SetTextColor(0.7,0.7,0.7,1)
        end
    end
end

function HealBot_Options_CheckBindsOnChange(newBind, index)
    if newBind>1 then 
        for x=1,20 do
            if x~=index and HealBot_Config_Spells.Binds[x]==newBind then
                HealBot_Config_Spells.Binds[x]=1
                if x>5 then 
                    HealBot_Timers_Set("LAST","PluginInitBinds",0.1)
                else
                    HealBot_Timers_Set("LAST","InitBinds",0.1)
                end
            end
        end
    end
    HealBot_Timers_Set("INIT","PrepSetAllAttribs",0.1)
end

function HealBot_Options_DoSpellsOnTextChanged(self, cType, bNo, key, spellText)
    local mButton = HealBot_Options_ComboClass_Button(bNo)
    if not HealBot_Spell_Names[spellText] and not HealBot_Init_knownClassicHealSpell(spellText) then
        local uSpell=HealBot_Options_UpperFirstChar(spellText)
        if HealBot_Spell_Names[uSpell] or HealBot_Init_knownClassicHealSpell(uSpell) then
            spellText=uSpell
        end
    end
    HealBot_Action_SetSpell(cType, HealBot_Action_GetComboSpec(key, mButton), spellText)
    HealBot_Options_KnownSpellCheck(self, spellText,cType,key,HealBot_Options_KnownSpellCheckButtonNum(bNo))
end

local spellText=nil
function HealBot_Options_SpellsOnTextChanged(self, bNo)
    local cType="ICON"
    if HealBot_Options_luVars["ActionBarsCombo"]==1 then
        cType="ENABLED"
        HealBot_Timers_Set("INIT","PrepSetEnabledAttribs",0.5)
    elseif HealBot_Options_luVars["ActionBarsCombo"]==2 then
        cType="ENEMY"
        HealBot_Timers_Set("INIT","PrepSetEnemyAttribs",0.5)
    elseif HealBot_Options_luVars["ActionBarsCombo"]==3 then
        cType="EMERG"
        HealBot_Timers_Set("INIT","PrepSetEmergAttribs",0.5)
    else
        HealBot_Action_ClearSpellCache("ICON")
    end
    local key=HealBot_Options_ComboButton_ModifierKey(HealBot_Options_ComboButtons_Modifier)
    spellText = strtrim(self:GetText())
    HealBot_Options_DoSpellsOnTextChanged(self, cType, bNo, key, spellText)
    if bNo==1 then HealBot_Timers_Set("PLAYER","SetRangeSpells",1) end
    HealBot_Timers_Set("PLAYER","SaveProfile",1)
end

function HealBot_Options_SpellsCheckTextValid()
    if HealBot_Options_luVars["SpellsTabOpenWarnId"]>0 then
        local cType="ICON"
        local modifier=HealBot_Options_ComboButton_ModifierKey(HealBot_Options_ComboButtons_Modifier)
        if HealBot_Options_luVars["ActionBarsCombo"]==1 then
            cType="ENABLED"
        elseif HealBot_Options_luVars["ActionBarsCombo"]==2 then
            cType="ENEMY"
        elseif HealBot_Options_luVars["ActionBarsCombo"]==3 then
            cType="EMERG"
        end
        local g,s
        for x=1,5 do
            s=HealBot_Action_GetSpell(cType, HealBot_Action_GetComboSpec(modifier, HealBot_Options_ComboClass_Button(x)))
            if s then
                g=_G["HealBot_Options_Button"..x]
                g:SetText("")
                g:SetText(s)
            end
        end
    end
end
function HealBot_Options_SetBuffExtraItemTextColour(object, item)
    if HealBot_IsKnownItem(item) then
        object:SetTextColor(0.2,0.5,1,1)
        return true
    else
        object:SetTextColor(0.7,0.7,0.7,1)
        return false
    end
end

function HealBot_Options_BuffManaDrinkItemOnTextChanged(self)
    if HealBot_Config_Buffs.ManaDrinkItem~=strtrim(self:GetText()) then
        local prevValid=false
        if HealBot_IsKnownItem(HealBot_Config_Buffs.ManaDrinkItem) then prevValid=true end
        HealBot_Config_Buffs.ManaDrinkItem = strtrim(self:GetText())
        if HealBot_Options_SetBuffExtraItemTextColour(self, HealBot_Config_Buffs.ManaDrinkItem) or prevValid then
            HealBot_Timers_Set("AURA","BuffReset")
        end
    end
end

function HealBot_Options_BuffBackupManaDrinkItemOnTextChanged(self)
    if HealBot_Config_Buffs.BackupManaDrinkItem~=strtrim(self:GetText()) then
        local prevValid=false
        if HealBot_IsKnownItem(HealBot_Config_Buffs.BackupManaDrinkItem) then prevValid=true end
        HealBot_Config_Buffs.BackupManaDrinkItem = strtrim(self:GetText())
        if HealBot_Options_SetBuffExtraItemTextColour(self, HealBot_Config_Buffs.BackupManaDrinkItem) or prevValid then
            HealBot_Timers_Set("AURA","BuffReset")
        end
    end
end

function HealBot_Options_BuffWellFedItemOnTextChanged(self)
    if HealBot_Config_Buffs.WellFedItem~=strtrim(self:GetText()) then
        local prevValid=false
        if HealBot_IsKnownItem(HealBot_Config_Buffs.WellFedItem) then prevValid=true end
        HealBot_Config_Buffs.WellFedItem = strtrim(self:GetText())
        if HealBot_Options_SetBuffExtraItemTextColour(self, HealBot_Config_Buffs.WellFedItem) or prevValid then
            HealBot_Timers_Set("AURA","BuffReset")
        end
    end
end

function HealBot_Options_BuffBackupWellFedItemOnTextChanged(self)
    if HealBot_Config_Buffs.BackupWellFedItem~=strtrim(self:GetText()) then
        local prevValid=false
        if HealBot_IsKnownItem(HealBot_Config_Buffs.BackupWellFedItem) then prevValid=true end
        HealBot_Config_Buffs.BackupWellFedItem = strtrim(self:GetText())
        if HealBot_Options_SetBuffExtraItemTextColour(self, HealBot_Config_Buffs.BackupWellFedItem) or prevValid then
            HealBot_Timers_Set("AURA","BuffReset")
        end
    end
end

function HealBot_Options_BuffExtraBuffOnTextChanged(self, id)
    if HealBot_Config_Buffs.CustomBuffName[id]~=strtrim(self:GetText()) then
        HealBot_Config_Buffs.CustomBuffName[id] = strtrim(self:GetText())
        HealBot_Timers_Set("AURA","BuffReset")
    end
    self:SetTextColor(0.7,1,0.7,0.95)
end

function HealBot_Options_SetBuffExtraItemText()
    g=_G["HealBot_Options_BuffExtraItem1"]
    HealBot_Options_SetBuffExtraItemTextColour(g, HealBot_Config_Buffs.CustomItemName[1])
    g=_G["HealBot_Options_BuffExtraItem2"]
    HealBot_Options_SetBuffExtraItemTextColour(g, HealBot_Config_Buffs.CustomItemName[2])
    g=_G["HealBot_Options_BuffExtraItem3"]
    HealBot_Options_SetBuffExtraItemTextColour(g, HealBot_Config_Buffs.CustomItemName[3])

    g=_G["HealBot_Options_BuffWellFedItem"]
    HealBot_Options_SetBuffExtraItemTextColour(g,HealBot_Config_Buffs.WellFedItem)
    g=_G["HealBot_Options_BuffBackupWellFedItem"]
    HealBot_Options_SetBuffExtraItemTextColour(g,HealBot_Config_Buffs.BackupWellFedItem)
    g=_G["HealBot_Options_BuffManaDrinkItem"]
    HealBot_Options_SetBuffExtraItemTextColour(g,HealBot_Config_Buffs.ManaDrinkItem)
    g=_G["HealBot_Options_BuffBackupManaDrinkItem"]
    HealBot_Options_SetBuffExtraItemTextColour(g,HealBot_Config_Buffs.BackupManaDrinkItem)
end

function HealBot_Options_BuffExtraItemOnTextChanged(self, id)
    if HealBot_Config_Buffs.CustomItemName[id]~=strtrim(self:GetText()) then
        local prevValid=false
        if HealBot_IsKnownItem(HealBot_Config_Buffs.CustomItemName[id]) then prevValid=true end
        HealBot_Config_Buffs.CustomItemName[id] = strtrim(self:GetText())
        if HealBot_Options_SetBuffExtraItemTextColour(self, HealBot_Config_Buffs.CustomItemName[id]) or prevValid then
            HealBot_Timers_Set("AURA","BuffReset")
        end
    end
end

function HealBot_Options_DisconnectedTag_OnTextChanged(self)
    Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGDC"] = self:GetText()
    HealBot_Timers_Set("SKINS","TextUpdateState")
end

function HealBot_Options_UnitDeadTag_OnTextChanged(self)
    Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGRIP"] = self:GetText()
    HealBot_Timers_Set("SKINS","TextUpdateState")
end

function HealBot_Options_ResTag_OnTextChanged(self)
    Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGRES"] = self:GetText()
    HealBot_Timers_Set("SKINS","TextUpdateState")
end

function HealBot_Options_SummonsTag_OnTextChanged(self)
    Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGSUM"] = self:GetText()
    HealBot_Timers_Set("SKINS","TextUpdateState")
end

function HealBot_Options_OutOfRangeTag_OnTextChanged(self)
    Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGOOR"] = self:GetText()
    HealBot_Timers_Set("SKINS","TextUpdateState")
end

function HealBot_Options_ReserverTag_OnTextChanged(self)
    Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGR"] = self:GetText()
    HealBot_Timers_Set("SKINS","TextUpdateState")
end

function HealBot_Options_EnableSmartCast_OnClick(self)
    HealBot_Globals.SmartCast = self:GetChecked()
end

function HealBot_Options_SmartCastDisspell_OnClick(self)
    HealBot_Globals.SmartCastDebuff = self:GetChecked()
end

function HealBot_Options_SmartCastBuff_OnClick(self)
    HealBot_Globals.SmartCastBuff = self:GetChecked()
end

function HealBot_Options_SmartCastRes_OnClick(self)
    HealBot_Globals.SmartCastRes = self:GetChecked()
end

--------------------------------------------------------------------------------
function HealBot_About_Copy_OnClick(self, titleText, copyText)
    StaticPopupDialogs["HEALBOT_OPTIONS_COPY"] = {
		text = titleText,
		button1 = CLOSE,
		hasEditBox = 1,
		maxLetters = 120,
		editBoxWidth = 220,
		OnShow = function(self)
			self.editBox:SetText(copyText);
			self.editBox:SetFocus();
			self.editBox:HighlightText();
		end,
    }
    StaticPopup_Show ("HEALBOT_OPTIONS_COPY");
end

function HealBot_Options_Defaults_OnClick(self, global)
    local popMsg=""
    if global then
        popMsg=HEALBOT_OPTIONS_SETDEFAULTSMSG
    else
        popMsg=HEALBOT_OPTIONS_SETLOCALDEFAULTSMSG
    end
    StaticPopupDialogs["HEALBOT_OPTIONS_SETDEFAULTS"] = {
        text = popMsg,
        button1 = HEALBOT_WORDS_YES,
        button2 = HEALBOT_WORDS_NO,
        OnAccept = function()
            HealBot_Options_SetDefaults(global);
        end,
        timeout = 0,
        whileDead = 1,
        hideOnEscape = 1
    };

    StaticPopup_Show ("HEALBOT_OPTIONS_SETDEFAULTS");
end

function HealBot_Options_Reset_OnClick(self,mode)
    HealBot_Options_SaveProfile()
    HealBot_SetResetFlag(mode)
end

function HealBot_Options_SetDefaults(global)
    HealBot_Globals.LastVersionSkinUpdate=HealBot_Global_Version()
    HealBot_Config.LastVersionUpdate=HealBot_Global_Version()
    if global then
        HealBot_Config = HealBot_Options_copyTable(HealBot_ConfigDefaults)
        HealBot_Globals = HealBot_Options_copyTable(HealBot_GlobalsDefaults)
        HealBot_Globals.FirstLoad=false
        HealBot_Config_Spells = HealBot_Options_copyTable(HealBot_Config_SpellsDefaults)
        HealBot_Config_Buffs = HealBot_Options_copyTable(HealBot_Config_BuffsDefaults)
        HealBot_Config_Cures = HealBot_Options_copyTable(HealBot_Config_CuresDefaults)
        HealBot_Config.CurrentSpec=1
        Healbot_Config_Skins.Current_Skin=HEALBOT_SKINS_STD
        Healbot_Config_Skins.Author[HEALBOT_SKINS_STD]=nil
        Healbot_Config_Skins.Author[HEALBOT_OPTIONS_GROUPHEALS]=nil
        Healbot_Config_Skins.Author[HEALBOT_OPTIONS_RAID25]=nil
        Healbot_Config_Skins.Author[HEALBOT_OPTIONS_RAID40]=nil
        HealBot_Include_Skin(HEALBOT_OPTIONS_GROUPHEALS, true)
        HealBot_Include_Skin(HEALBOT_OPTIONS_RAID25, true)
        HealBot_Include_Skin(HEALBOT_OPTIONS_RAID40, true)
        HealBot_Include_Skin(HEALBOT_SKINS_STD, false)
    else
        HealBot_Reset_Spells()
        HealBot_Reset_Cures()
        HealBot_Reset_Buffs()
    end
    HealBot_Update_Skins()
    HealBot_runDefaults()
    HealBot_Timers_Set("INIT","PrepSetAllAttribs")
    HealBot_Options:Hide()
    if Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["NOTIFY"] then HealBot_Options_CastNotify_OnClick(nil,0); end   
    DoneInitTab={}
    HealBot_Timers_InitExtraOptions()
    HealBot_Timers_Set("AURA","CheckPlayer")
    HealBot_Options_OnLoad(nil, "Defaults")
    HealBot_Timers_Set("PLAYER","SaveProfile")
end

local function HealBot_Options_Content_MainPanel(panel)
    panel:SetBackdrop({
        bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
        edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
        tile = true, tileSize = 12, edgeSize = 12,
        insets = { left = 2, right = 2, top = 2, bottom = 2, },
    })
    panel:SetBackdropColor(0,0,0,0.25+HealBot_Options_luVars["OptionsOpacityAdj"]);
    panel:SetBackdropBorderColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["A"])
end

local function HealBot_Options_Content_InnerPanel(panel, a)
    panel:SetBackdrop({
        bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
        edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
        tile = true, tileSize = 8, edgeSize = 8,
        insets = { left = 0, right = 0, top = 0, bottom = 0, },
    })
    panel:SetBackdropColor(0,0,0,0);
    panel:SetBackdropBorderColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["B"],a)
end

local function HealBot_Options_Content_Colour(menu, menutxt, highlight)
    if highlight then
        if menu then menu:SetStatusBarColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                                            OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                                            OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                                            OptionThemes[HealBot_Globals.OptionsTheme]["A"]) end
        menutxt:SetTextColor(1,1,1,1)
    else
        if menu then menu:SetStatusBarColor(0.2,0.2,0.2,0) end
        menutxt:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    end
end

local function HealBot_Options_InnerContent_Colour(menu, menutxt, highlight)
    if highlight then
        if menu then menu:SetStatusBarColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                                            OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                                            OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                                            OptionThemes[HealBot_Globals.OptionsTheme]["A"]) end
        menutxt:SetTextColor(1,1,1,1)
    else
        if menu then menu:SetStatusBarColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                                            OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                                            OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                                            0.5) end
        menutxt:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                                 OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                                 0.8)
    end
end

function HealBot_Options_MainPanel()
    HealBot_Options_luVars["OptionsOpacityAdj"]=(HealBot_Globals.OptionsOpacityAdj or 35)/100
    local panel=_G["HealBot_Options"]
    panel:SetBackdrop({
        bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background-Dark",
        edgeFile = OptionThemes[HealBot_Globals.OptionsTheme]["egdeFile"],
        tile = true, tileSize = 0, edgeSize = OptionThemes[HealBot_Globals.OptionsTheme]["egdeSize"],
        insets = { left = 2, right = 2, top = 2, bottom = 2, },
    })
    panel:SetBackdropColor(0,0,0,0.25+HealBot_Options_luVars["OptionsOpacityAdj"]);
    if not OptionThemes[HealBot_Globals.OptionsTheme]["Classic"] then
        panel:SetBackdropBorderColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                                     OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                                     OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                                     OptionThemes[HealBot_Globals.OptionsTheme]["A"])
        panel=_G["HealBot_Options_ModernTitleBox"]
        panel:Show()
        panel:SetStatusBarColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                                     OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                                     OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                                     OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    else
        panel=_G["HealBot_Options_ModernTitleBox"]
        panel:Hide()
    end
    HealBot_Options_Content_MainPanel(_G["HealBot_Options_Contents"])
    HealBot_Options_Content_MainPanel(_G["HealBot_Options_MainFrame"])
    panel=_G["HealBot_Options_TitleBox"]
    panel:SetTexture(OptionThemes[HealBot_Globals.OptionsTheme]["TitleBox"])
end

function HealBot_Options_OnLoad(self, caller)
    DoneInitTab={}
    HealBot_Options_MainPanel()
    if self then
        HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT0"], _G["HealBot_Contents_ButtonT0Txt"], true)
        HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT1"], _G["HealBot_Contents_ButtonT1Txt"])
    elseif caller=="Theme" then
        HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT0"], _G["HealBot_Contents_ButtonT0Txt"])
        HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT1"], _G["HealBot_Contents_ButtonT1Txt"], true)
    else
        HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT0"], _G["HealBot_Contents_ButtonT0Txt"])
        HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT1"], _G["HealBot_Contents_ButtonT1Txt"])
    end
    HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT10"], _G["HealBot_Contents_ButtonT10Txt"])
    HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT2"], _G["HealBot_Contents_ButtonT2Txt"])
    HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT3"], _G["HealBot_Contents_ButtonT3Txt"])
    HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT3"], _G["HealBot_Contents_ButtonT3Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT301Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT303Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT304Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT307Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT308Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT309Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT310Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT311Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT312Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT314Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT315Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT316Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT313Txt"])
    HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT4"], _G["HealBot_Contents_ButtonT4Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT41Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT42Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT43Txt"])
    HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT5"], _G["HealBot_Contents_ButtonT5Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT51Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT52Txt"])
    HealBot_Options_Content_Colour(nil, _G["HealBot_Contents_ButtonT53Txt"])
    HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT6"], _G["HealBot_Contents_ButtonT6Txt"])
    HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT8"], _G["HealBot_Contents_ButtonT8Txt"])
    HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT9"], _G["HealBot_Contents_ButtonT9Txt"])
    HealBot_Options_Content_Colour(_G["HealBot_Contents_ButtonT99"], _G["HealBot_Contents_ButtonT99Txt"])
    --HealBot_Contents_ButtonT99:Hide()
    HealBot_Options_Content_Colour(nil,_G["HealBot_Options_TitleBoxText"],true)
    HealBot_Options_Content_Colour(nil,_G["HealBot_Options_ModernTitleBoxTxt"],true)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_Panel0_1"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_Panel0_2"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_Panel0_3"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_GenFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_EmergLFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_Override_EffectsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_OverrideHotBarsPanel"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_OverrideHealthDropPanel"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_OverrideFluidBarsPanel"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_EffectsOverrideFocusGroups"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_EffectsOverrideBorderHazard"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_OverrideFlashEffectPanel"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_Override_ChatFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_OverrideChatPanel"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_OverrideChatSkinsOOMFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_Override_FramesFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_OverrideFramesPanel"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_KeysFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SelectSpellsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_DisabledBarPanel"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_GeneralSkinsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_GeneralSkinsFrameBlizz"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_HealGroupsSkinsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_EffectsSkinsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_EnemySkinsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_EnemySkinsFrameTop"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_EnemySkinsFrameBottom"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_FluidBarsPanel"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_HealthDropPanel"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_HotBarsPanel"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_FlashEffectFocusGroups"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_FlashEffectPanel"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_EffectsBorderHazard"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_FramesCopyOptions"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_FramesCopyOptionsTabs"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_FramesCopyOptionsFrames"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_ChatSkinsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_ChatSkinsGeneralFrame"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_ChatSkinsOOMFrame"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_FramesSkinsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_HeadersSkinsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameHeadersBar"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameHeadersFrame"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_BarsSkinsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesBarsGeneral"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesBarsColours"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesBarsSort"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesBarsTabNotAvail"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesBarsColoursCustom"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesTextColoursCustom"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesEmergencyTabNotAvail"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesIndicatorsTabNotAvail"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesBarsVisibility"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesBarsAggro"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesBarsAux"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesBarsAuxAssign"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFramesBarsAuxConfig"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_TextSkinsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextState"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextStateText"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextStateColour"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextName"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextNameText"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextNameColour"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextHealth"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextHealthText"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextHealthColour"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextAux"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextAuxText"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextAuxColour"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextAggro"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextAggroText"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextAggroColour"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextExtraOverHeal"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameTextExtraInHeal"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_IconsSkinsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIconsDebuff"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIconsBuff"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIconsExtra"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIconsDebuffGeneral"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIconsDebuffText"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIconsBuffGeneral"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIconsBuffText"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIconsExtraClass"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIconsExtraTarget"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIconsExtraReadyCheck"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIconsExtraOORArrow"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_IndicatorsSkinsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIndicatorsAggro"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIndicatorsLowMana"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIndicatorsSelfCast"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameIndicatorsPower"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameEmergGeneral"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SkinsFrameEmergencyColour"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_EmergencyFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_CureDispelCleanse"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_CustomCureFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_WarningCureFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_BuffsPanel"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_BuffsPanelTimers"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_BuffIconFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_WarningBuffFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_TipsGeneralFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_TipsTargetFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_TipsSpellsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_InOut_SkinFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_ShareExternalEditBoxFrame"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_BuffsPanelGeneralBuffs"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_BuffsPanelExtraBuffs"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_BuffsPanelExtraBuffsWeaponEnchants"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_BuffsPanelExtraBuffsWellFed"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_BuffsPanelExtraBuffsManaDrink"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_BuffsPanelExtraBuffsExtras"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_InOut_CDbuffsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_ShareCDebuffExternalEditBoxFrame"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_InOut_BuffsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_ShareBuffsExternalEditBoxFrame"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_InOut_SpellsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_ShareSpellsExternalEditBoxFrame"], 0.5)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_InOut_PresetColsFrame"], 0.7)
    HealBot_Options_Content_InnerPanel(_G["HealBot_Options_SharePresetColsExternalEditBoxFrame"], 0.5)

    HealBot_Options_Content_Colour(nil,_G["HealBot_About_AuthorH"],true)
    HealBot_Options_Content_Colour(nil,_G["HealBot_About_URLH"],true)
    HealBot_Options_Content_Colour(nil,_G["HealBot_About_CatH"],true)
    HealBot_Options_Content_Colour(nil,_G["HealBot_About_LocalH"],true)
    HealBot_Options_Content_Colour(nil,_G["HealBot_About_Desc1"],true)
    HealBot_Options_Content_Colour(nil,_G["HealBot_Options_SkinURL"],true)
    HealBot_Options_Content_Colour(nil,_G["HealBot_Options_CopyTabsCurrentFrame"],true)
    HealBot_Options_Content_Colour(nil,_G["HealBot_AuxBarsConfigAssign2_FontStr"],true)
    HealBot_Options_Content_Colour(nil,_G["HealBot_AuxTextConfigAssign1_FontStr2"],true)
    HealBot_Options_Content_Colour(nil,_G["HealBot_AuxTextConfigAssign2_FontStr2"],true)

    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_OverrideEffectb"],_G["HealBot_Options_OverrideEffectbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_OverrideChatb"],_G["HealBot_Options_OverrideChatbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_Overrideframesb"],_G["HealBot_Options_OverrideframesbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentOverridePanelButton"]],
                                   _G[HealBot_Options_luVars["CurrentOverridePanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_TipsGeneralb"],_G["HealBot_Options_TipsGeneralbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_TipsTargetb"],_G["HealBot_Options_TipsTargetbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_TipsSpellsb"],_G["HealBot_Options_TipsSpellsbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentTipsPanelButton"]],
                                   _G[HealBot_Options_luVars["CurrentTipsPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameHeadersBarb"],_G["HealBot_Options_SkinsFrameHeadersBarbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameHeadersFrameb"],_G["HealBot_Options_SkinsFrameHeadersFramebTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsHeaderPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsHeaderPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFramesBarsGeneralb"],_G["HealBot_Options_SkinsFramesBarsGeneralbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFramesBarsColoursb"],_G["HealBot_Options_SkinsFramesBarsColoursbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFramesBarsSortb"],_G["HealBot_Options_SkinsFramesBarsSortbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFramesBarsVisibilityb"],_G["HealBot_Options_SkinsFramesBarsVisibilitybTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFramesBarsAggrob"],_G["HealBot_Options_SkinsFramesBarsAggrobTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFramesBarsAuxb"],_G["HealBot_Options_SkinsFramesBarsAuxbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsBarsPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsBarsPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFramesBarsAuxAssignb"],_G["HealBot_Options_SkinsFramesBarsAuxAssignbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFramesBarsAuxConfigb"],_G["HealBot_Options_SkinsFramesBarsAuxConfigbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsBarsAuxPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsBarsAuxPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextStateb"],_G["HealBot_Options_SkinsFrameTextStatebTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextNameb"],_G["HealBot_Options_SkinsFrameTextNamebTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextHealthb"],_G["HealBot_Options_SkinsFrameTextHealthbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextAuxb"],_G["HealBot_Options_SkinsFrameTextAuxbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextAggrob"],_G["HealBot_Options_SkinsFrameTextAggrobTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextNameTextb"],_G["HealBot_Options_SkinsFrameTextNameTextbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextAuxTextb"],_G["HealBot_Options_SkinsFrameTextAuxTextbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextAggroTextb"],_G["HealBot_Options_SkinsFrameTextAggroTextbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextExtraOverHealb"],_G["HealBot_Options_SkinsFrameTextExtraOverHealbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextExtraInHealb"],_G["HealBot_Options_SkinsFrameTextExtraInHealbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextNameColourb"],_G["HealBot_Options_SkinsFrameTextNameColourbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextStateColourb"],_G["HealBot_Options_SkinsFrameTextStateColourbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextStateTextb"],_G["HealBot_Options_SkinsFrameTextStateTextbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextAuxColourb"],_G["HealBot_Options_SkinsFrameTextAuxColourbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextAggroColourb"],_G["HealBot_Options_SkinsFrameTextAggroColourbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextHealthTextb"],_G["HealBot_Options_SkinsFrameTextHealthTextbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameTextHealthColourb"],_G["HealBot_Options_SkinsFrameTextHealthColourbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextStatePanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextStatePanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextNamePanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextNamePanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextHealthPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextHealthPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextAuxPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextAuxPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextAggroPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextAggroPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIconsDebuffb"],_G["HealBot_Options_SkinsFrameIconsDebuffbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIconsBuffb"],_G["HealBot_Options_SkinsFrameIconsBuffbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIconsExtrab"],_G["HealBot_Options_SkinsFrameIconsExtrabTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIconsDebuffGeneralb"],_G["HealBot_Options_SkinsFrameIconsDebuffGeneralbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIconsDebuffTextb"],_G["HealBot_Options_SkinsFrameIconsDebuffTextbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsDebuffPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsDebuffPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIconsBuffGeneralb"],_G["HealBot_Options_SkinsFrameIconsBuffGeneralbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIconsBuffTextb"],_G["HealBot_Options_SkinsFrameIconsBuffTextbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsBuffPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsBuffPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIconsExtraClassb"],_G["HealBot_Options_SkinsFrameIconsExtraClassbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIconsExtraTargetb"],_G["HealBot_Options_SkinsFrameIconsExtraTargetbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIconsExtraReadyCheckb"],_G["HealBot_Options_SkinsFrameIconsExtraReadyCheckbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIconsExtraOORArrowb"],_G["HealBot_Options_SkinsFrameIconsExtraOORArrowbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsExtraPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsExtraPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIndicatorsAggrob"],_G["HealBot_Options_SkinsFrameIndicatorsAggrobTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIndicatorsLowManab"],_G["HealBot_Options_SkinsFrameIndicatorsLowManabTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIndicatorsSelfCastb"],_G["HealBot_Options_SkinsFrameIndicatorsSelfCastbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameIndicatorsPowerb"],_G["HealBot_Options_SkinsFrameIndicatorsPowerbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIndicatorsPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIndicatorsPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameEmergGeneralb"],_G["HealBot_Options_SkinsFrameEmergGeneralbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_SkinsFrameEmergencyColourb"],_G["HealBot_Options_SkinsFrameEmergencyColourbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsEmergencyPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsEmergencyPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_InOutSkinb"],_G["HealBot_Options_InOutSkinbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_InOutCustomDebuffb"],_G["HealBot_Options_InOutCustomDebuffbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_InOutCustomBuffb"],_G["HealBot_Options_InOutCustomBuffbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_InOutSpellsb"],_G["HealBot_Options_InOutSpellsbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_InOutPresetColoursb"],_G["HealBot_Options_InOutPresetColoursbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentInOutPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentInOutPanelButton"].."Txt"],true)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_BuffsPanelGeneralBuffsb"],_G["HealBot_Options_BuffsPanelGeneralBuffsbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G["HealBot_Options_BuffsPanelExtraBuffsb"],_G["HealBot_Options_BuffsPanelExtraBuffsbTxt"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentBuffsGeneralPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentBuffsGeneralPanelButton"].."Txt"],true)
                                        
    HealBot_Options_CDCCastByCustom:Disable() 
    HealBot_Options_CDCIDMethodCustom:Disable()   
    HealBot_Options_CDCPriorityCustom:Disable()
    HealBot_Options_CDCColCustom:Disable()
    HealBot_Options_CDCIconGlowCustom:Disable()
    HealBot_Options_CDCIconSetCustom:Disable()
end

HealBot_Options_luVars["TabNo"] = 0;
HealBot_Options_luVars["CurrentTab"]="About"
function HealBot_Options_OnShow(self)
    HealBot_Options_UpdateTab(HealBot_Options_luVars["TabNo"])
    HealBot_Timers_InitExtraOptions()
end

function HealBot_Options_Close()
    if HealBot_Options_luVars["SkinsPanelCopyBackName"] then HealBot_Options_ShowSkinsPanel("BACK", 0) end
    if HealBot_Options_luVars["SelectSpellsFrame"] then HealBot_Options_SpellsSelect_OnClick(nil,"Cancel") end
    HealBot_Timers_Set("PLAYER","SaveProfile")
end

HealBot_Options_luVars["hbrCode"]=""
function HealBot_Options_Lang(region, msgchat)
    if region~=HealBot_Options_luVars["hbrCode"] then
        HealBot_Options_luVars["hbrCode"]=region
        local validCode = true
        local loaded, reason = nil,nil
        if region=="ptBR" then
            HealBot_Lang_ptBR()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_ptBR() end
            if msgchat then HealBot_AddChat("Switching Lang to ptBR") end
            HealBot_Options_luVars["hbLangs"]=11
        elseif region=="zhCN" then
            HealBot_Lang_zhCN()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_zhCN() end
            if msgchat then HealBot_AddChat("Switching Lang to zhCN") end
            HealBot_Options_luVars["hbLangs"]=1
        elseif region=="deDE" then
            HealBot_Lang_deDE()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_deDE() end
            if msgchat then HealBot_AddChat("Switching Lang to deDE") end
            HealBot_Options_luVars["hbLangs"]=5
        elseif region=="esES" then
            HealBot_Lang_esES()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_esALL() end
            if msgchat then HealBot_AddChat("Switching Lang to esES") end
            HealBot_Options_luVars["hbLangs"]=13
        elseif region=="esMX" then
            HealBot_Lang_esMX()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_esALL() end
            if msgchat then HealBot_AddChat("Switching Lang to esMX") end
            HealBot_Options_luVars["hbLangs"]=10
        elseif region=="frFR" then
            HealBot_Lang_frFR()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_frFR() end
            if msgchat then HealBot_AddChat("Switching Lang to frFR") end
            HealBot_Options_luVars["hbLangs"]=4
        elseif region=="huHU" then
            HealBot_Lang_huHU()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_huHU() end
            if msgchat then HealBot_AddChat("Switching Lang to huHU") end
            HealBot_Options_luVars["hbLangs"]=7
        elseif region=="koKR" then
            HealBot_Lang_koKR()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_koKR() end
            if msgchat then HealBot_AddChat("Switching Lang to koKR") end
            HealBot_Options_luVars["hbLangs"]=9
        elseif region=="ruRU" then
            HealBot_Lang_ruRU()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_ruRU() end
            if msgchat then HealBot_AddChat("Switching Lang to ruRU") end
            HealBot_Options_luVars["hbLangs"]=12
        elseif region=="zhTW" then
            HealBot_Lang_zhTW()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_zhTW() end
            if msgchat then HealBot_AddChat("Switching Lang to zhTW") end
            HealBot_Options_luVars["hbLangs"]=14
        elseif region=="itIT" then
            HealBot_Lang_itIT()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_itIT() end
            if msgchat then HealBot_AddChat("Switching Lang to itIT") end
            HealBot_Options_luVars["hbLangs"]=9
        elseif region=="grGR" then
            HealBot_Lang_grGR()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_grGR() end
            if msgchat then HealBot_AddChat("Switching Lang to grGR") end
            HealBot_Options_luVars["hbLangs"]=7
        elseif region=="enUK" then
            HealBot_Lang_enUK()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_enALL() end
            if msgchat then HealBot_AddChat("Switching Lang to enUK") end
            HealBot_Options_luVars["hbLangs"]=2
        elseif region=="enUS" then
            HealBot_Lang_enUS()
            if HealBot_Options_luVars["TIPLOADED"] then HealBot_Lang_Options_enALL() end
            if msgchat then HealBot_AddChat("Switching Lang to enUS") end
            HealBot_Options_luVars["hbLangs"]=3
        else
            validCode=nil
            HealBot_AddChat("Invalid Region code "..region)
        end
        HealBot_HealGroupsTrans = { [HEALBOT_OPTIONS_SELFHEALS_en] = HEALBOT_OPTIONS_SELFHEALS,
                                    [HEALBOT_OPTIONS_TANKHEALS_en] = HEALBOT_OPTIONS_TANKHEALS,
                                    [HEALBOT_CLASSES_HEALERS_en] = HEALBOT_CLASSES_HEALERS,
                                    [HEALBOT_OPTIONS_GROUPHEALS_en] = HEALBOT_OPTIONS_GROUPHEALS,
                                    [HEALBOT_OPTIONS_MYTARGET_en] = HEALBOT_OPTIONS_MYTARGET,
                                    [HEALBOT_FOCUS_en] = HEALBOT_FOCUS,
                                    [HEALBOT_OPTIONS_EMERGENCYHEALS_en] = HEALBOT_OPTIONS_EMERGENCYHEALS,
                                    [HEALBOT_OPTIONS_PETHEALS_en] = HEALBOT_OPTIONS_PETHEALS,
                                    [HEALBOT_VEHICLE_en] = HEALBOT_VEHICLE,
                                    [HEALBOT_OPTIONS_TARGETHEALS_en] = HEALBOT_OPTIONS_TARGETHEALS,
                                    [HEALBOT_CUSTOM_CASTBY_ENEMY_en] = HEALBOT_CUSTOM_CASTBY_ENEMY,
                                    }
        HealBot_Options_SetSkins()
        local g=_G["HealBot_Contents_ButtonT0Txt"] 
        g:SetText(HEALBOT_HEALBOT)
        g=_G["HealBot_Contents_ButtonT1Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_GENERAL)
        g=_G["HealBot_Contents_ButtonT10Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_OVERRIDES)
        g=_G["HealBot_Contents_ButtonT2Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_SPELLS)
        g=_G["HealBot_Contents_ButtonT3Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_SKINS)
        g=_G["HealBot_Contents_ButtonT301Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_SKINS_GENERAL)
        g=_G["HealBot_Contents_ButtonT303Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_SKINS_EFFECTS)
        g=_G["HealBot_Contents_ButtonT304Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_SKINS_ENEMY)
        g=_G["HealBot_Contents_ButtonT307Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_SKINS_CHAT)
        g=_G["HealBot_Contents_ButtonT308Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_SKINS_FRAMES)
        g=_G["HealBot_Contents_ButtonT309Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_GENERAL)
        g=_G["HealBot_Contents_ButtonT310Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_SKINS_HEALGROUP)
        g=_G["HealBot_Contents_ButtonT311Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_SKINS_HEADERS)
        g=_G["HealBot_Contents_ButtonT312Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_SKINS_BARS)
        g=_G["HealBot_Contents_ButtonT313Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_SKINS_TEXT)
        g=_G["HealBot_Contents_ButtonT314Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_SKINS_ICONS)
        g=_G["HealBot_Contents_ButtonT4Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_CURE)
        g=_G["HealBot_Contents_ButtonT41Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_CURE_DEBUFF)
        g=_G["HealBot_Contents_ButtonT42Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_CURE_CUSTOM)
        g=_G["HealBot_Contents_ButtonT43Txt"]
        g:SetText(HEALBOT_OPTIONS_CONTENT_CURE_WARNING)
        g=_G["HealBot_Contents_ButtonT5Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_BUFFS)
        g=_G["HealBot_Contents_ButtonT51Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_BUFFS_GENERAL)
        g=_G["HealBot_Contents_ButtonT52Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_BUFFS_HOTS)
        g=_G["HealBot_Contents_ButtonT53Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_CURE_WARNING)
        g=_G["HealBot_Contents_ButtonT6Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_TIPS)
        g=_G["HealBot_Contents_ButtonT8Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_TEST)
        g=_G["HealBot_Contents_ButtonT9Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_INOUT)
        g=_G["HealBot_Contents_ButtonT99Txt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_PLUGINS)
        g=_G["HealBot_Options_InOutSkinbTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_SKIN)
        g=_G["HealBot_Options_InOutCustomDebuffbTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_CUSTOM_DEBUFFS)
        g=_G["HealBot_Options_InOutCustomBuffbTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_CUSTOM_BUFFS)
        g=_G["HealBot_Options_InOutSpellsbTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_SPELLS)
        g=_G["HealBot_Options_InOutPresetColoursbTxt"] 
        g:SetText(HEALBOT_OPTIONS_CONTENT_INOUT_PRESETCOL)
        g=_G["HealBot_Options_CloseButton"] 
        g:SetText(HEALBOT_OPTIONS_CLOSE)
        g=_G["HealBot_Options_Defaults"] 
        g:SetText(HEALBOT_OPTIONS_DEFAULTS)
        g=_G["HealBot_Options_Reload"] 
        g:SetText(HEALBOT_OPTIONS_HARDRESET)
        g=_G["HealBot_Options_Reset"] 
        g:SetText(HEALBOT_OPTIONS_SOFTRESET)
        g=_G["HealBot_Options_TooltipPosSettings"] 
        g:SetText(HEALBOT_OPTIONS_SETTOOLTIP_POSITION)
        g=_G["HealBot_Options_SkinsFrameIconsDebuffGeneralbTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_GENERAL)
        g=_G["HealBot_Options_SkinsFrameTextStatebTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_STATETEXT)
        g=_G["HealBot_Options_SkinsFrameTextNamebTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_NAMETEXT)
        g=_G["HealBot_Options_SkinsFrameTextHealthbTxt"] 
        g:SetText(HEALBOT_WORD_HEALTH)
        g=_G["HealBot_Options_SkinsFrameTextAuxbTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_AUX)
        g=_G["HealBot_Options_SkinsFrameTextAggrobTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_AGGRO)
        g=_G["HealBot_Options_SkinsFrameTextExtraOverHealbTxt"] 
        g:SetText(HEALBOT_WORD_OVERHEALS)
        g=_G["HealBot_Options_SkinsFrameTextExtraInHealbTxt"] 
        g:SetText(HEALBOT_OPTIONS_INCHEAL)
        g=_G["HealBot_Options_SkinsFrameIconsDebuffTextbTxt"] 
        g:SetText(HEALBOT_WORD_TEXT)
        g=_G["HealBot_Options_SkinsFramesBarsGeneralbTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_GENERAL)
        g=_G["HealBot_Options_SkinsFramesBarsColoursbTxt"] 
        g:SetText(HEALBOT_WORD_COLOURS)
        g=_G["healbotaggroindcoltxt"] 
        g:SetText(HEALBOT_WORD_COLOUR)
        g=_G["healbotaggroindanchortxt"] 
        g:SetText(HEALBOT_OPTIONS_AUXBARANCHOR)
        g=_G["healbotlowmanaindcoltxt"] 
        g:SetText(HEALBOT_WORD_COLOUR)
        g=_G["healbotlowmanaindanchortxt"] 
        g:SetText(HEALBOT_OPTIONS_AUXBARANCHOR)
        g=_G["healbotpowerindcoltxt"] 
        g:SetText(HEALBOT_WORD_COLOUR)
        g=_G["healbotpowerindanchortxt"] 
        g:SetText(HEALBOT_OPTIONS_AUXBARANCHOR)
        g=_G["HealBot_Options_SkinsFrameTextStateTextbTxt"] 
        g:SetText(HEALBOT_WORD_TEXT)
        g=_G["HealBot_Options_SkinsFrameTextNameTextbTxt"] 
        g:SetText(HEALBOT_WORD_TEXT)
        g=_G["HealBot_Options_SkinsFrameTextHealthTextbTxt"] 
        g:SetText(HEALBOT_WORD_TEXT)
        g=_G["HealBot_Options_SkinsFrameTextAuxTextbTxt"] 
        g:SetText(HEALBOT_WORD_TEXT)
        g=_G["HealBot_Options_SkinsFrameTextAggroTextbTxt"] 
        g:SetText(HEALBOT_WORD_TEXT)
        g=_G["HealBot_Options_SkinsFrameTextStateColourbTxt"] 
        g:SetText(HEALBOT_WORD_COLOURS)
        g=_G["HealBot_Options_SkinsFrameTextNameColourbTxt"] 
        g:SetText(HEALBOT_WORD_COLOURS)
        g=_G["HealBot_Options_SkinsFrameEmergencyColourbTxt"] 
        g:SetText(HEALBOT_WORD_COLOURS)
        g=_G["HealBot_Options_SkinsFrameTextHealthColourbTxt"] 
        g:SetText(HEALBOT_WORD_COLOURS)
        g=_G["HealBot_Options_SkinsFrameTextAuxColourbTxt"] 
        g:SetText(HEALBOT_WORD_COLOURS)
        g=_G["HealBot_Options_SkinsFrameTextAggroColourbTxt"] 
        g:SetText(HEALBOT_WORD_COLOURS)
        g=_G["HealBot_Options_SkinsFramesBarsSortbTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_SORT)
        g=_G["HealBot_Options_SkinsFramesBarsVisibilitybTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_VISIBILITY)
        g=_G["HealBot_Options_SkinsFramesBarsAggrobTxt"] 
        g:SetText(HEALBOT_OPTIONS_TAB_AGGRO)
        g=_G["HealBot_Options_Skins_NameTextOptTxt"]
        g:SetText(HEALBOT_OPTIONS_NAMEOPTTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_StateTextOptTxt"]
        g:SetText(HEALBOT_OPTIONS_STATEOPTTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_StateTextColNotAvail"]
        g:SetText(HEALBOT_OPTIONS_STATECOLNOTAVAIL)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_AggroTextOptTxt"]
        g:SetText(HEALBOT_OPTIONS_AGGROOPTTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_HealthTextColOptTxt"]
        g:SetText(HEALBOT_OPTIONS_HEALTHOPTCOLOUR)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_AggroTextColOptTxt"]
        g:SetText(HEALBOT_OPTIONS_AGGROOPTCOLOUR)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_AuxColourOptTxt"]
        g:SetText(HEALBOT_OPTIONS_AUXOPTCOLOUR)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_ExtraInHealOptTxt"]
        g:SetText(HEALBOT_OPTIONS_EXTRAHOPTINHEAL)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_StateTextColOptTxt"]
        g:SetText(HEALBOT_OPTIONS_STATEOPTCOLOUR)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_NameTextColOptTxt"]
        g:SetText(HEALBOT_OPTIONS_NAMEOPTCOLOUR)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_HealthTextOptTxt"]
        g:SetText(HEALBOT_OPTIONS_HEALTHOPTTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_AuxTextOptTxt"]
        g:SetText(HEALBOT_OPTIONS_AUXOPTTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_SkinsFrameIndicatorsAggroTxt"]
        g:SetText(HEALBOT_OPTIONS_TAB_AGGROINDICATORS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_SkinsFrameIndicatorsLowManaTxt"]
        g:SetText(HEALBOT_OPTIONS_TAB_LOWMANAINDICATORS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_SkinsFrameIndicatorsSelfCastTxt"]
        g:SetText(HEALBOT_OPTIONS_TAB_SELFCASTINDICATORS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_SkinsFrameIndicatorsPowerTxt"]
        g:SetText(HEALBOT_OPTIONS_TAB_POWERINDICATORS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_IndTabNotAvail_Text"]
        g:SetText(HEALBOT_OPTIONS_TABNOTAVAIL)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_EmergTabNotAvailTxt"]
        g:SetText(HEALBOT_OPTIONS_TABNOTAVAIL)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_EmergCustomColCritt"]
        g:SetText(HEALBOT_WORDS_CRITICAL)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_EmergCustomColInjt"]
        g:SetText(HEALBOT_WORDS_INJURED)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_EmergCustomColHealthyt"]
        g:SetText(HEALBOT_WORDS_HEALTHY)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_SkinsFrameEmergGeneralTxt"]
        g:SetText(HEALBOT_OPTIONS_EMERGGENERAL)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_SkinsFrameEmergColTxt"]
        g:SetText(HEALBOT_OPTIONS_EMERGCOLS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_FrameAliasColorpickt"]
        g:SetText(HEALBOT_SKIN_HEADERBARCOL)
        g=_G["HealBot_FrameAliasTextColorpickt"]
        g:SetText(HEALBOT_SKIN_HEADERTEXTCOL)
        g=_G["HealBot_HealButtons_FramesFrameText"]
        g:SetText(HEALBOT_OPTIONS_FRAMESOPTTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_HealButtons_FramesCopyTabsText"]
        g:SetText(HEALBOT_OPTIONS_SET_ALL_FRAMES)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_HealButtons_FramesCopyTabsTxt"]
        g:SetText(HEALBOT_OPTIONS_COPY_TABS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_HealButtons_FramesToFramesText"]
        g:SetText(HEALBOT_OPTIONS_TO_FRAMES)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_SkinsFramesTextColoursCustom_Text"]
        g:SetText(HEALBOT_OPTIONS_CUSTOMCOLHEALTH)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_SkinsFramesBarsColoursCustom_Text"]
        g:SetText(HEALBOT_OPTIONS_CUSTOMCOLHEALTH)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_SkinsFramesBarsGeneralTxt"]
        g:SetText(HEALBOT_OPTIONS_SKINBARS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_BarColorsOptionsText3"]
        g:SetText(HEALBOT_OPTIONS_CDCBARS)
        g:SetTextColor(1,1,1,1)
        g=_G["healbotfocusincombatfontstr"]
        g:SetText(HEALBOT_FOCUS)
        g:SetTextColor(1,1,1,1)
        g=_G["healbottargetincombatfontstr"]
        g:SetText(HEALBOT_DISABLED_TARGET)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_CopyTab1Txt"]
        g:SetText(HEALBOT_OPTIONS_TAB_GENERAL)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_CopyTab2Txt"]
        g:SetText(HEALBOT_OPTIONS_TAB_HEADERS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_CopyTab4Txt"]
        g:SetText(HEALBOT_OPTIONS_TAB_BARS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_CopyTab10Txt"]
        g:SetText(HEALBOT_OPTIONS_TEXTOPTIONS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_CopyTab14Txt"]
        g:SetText(HEALBOT_OPTIONS_TAB_ICONS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_CopyTab17Txt"]
        g:SetText(HEALBOT_OPTIONS_TAB_INDICATORS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_CopyTab20Txt"]
        g:SetText(HEALBOT_OPTIONS_TAB_EMERG)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_EnemySkin_FontStr"]
        g:SetText(HEALBOT_OPTIONS_ENEMYFRAME)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_EffectsSkin_FontStr"]
        g:SetText(HEALBOT_OPTIONS_TAB_EFFECTS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_DebuffTxt"]
        g:SetText(HEALBOT_OPTIONS_ICONDEBUFFOPTTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_IconBuffText_FontStr"]
        g:SetText(HEALBOT_OPTIONS_ICONBUFFOPTTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_OORArrowTxt"]
        g:SetText(HEALBOT_OPTIONS_ICONOPTOORARROW)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_ReadyCheckTxt"]
        g:SetText(HEALBOT_OPTIONS_ICONOPTREADYCHECK)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_TargetTxt"]
        g:SetText(HEALBOT_OPTIONS_ICONOPTRAIDTARGET)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_ClassTxt"]
        g:SetText(HEALBOT_OPTIONS_ICONOPTCLASSROLE)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_SortNotAvail_Text"]
        g:SetText(HEALBOT_OPTIONS_TABNOTAVAIL)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_AuxBarsConfig_FontStr"]
        g:SetText(HEALBOT_OPTIONS_AUXCONFIG)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_IconText_FontStr"]
        g:SetText(HEALBOT_OPTIONS_TAB_DEBUFFICONTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_IconBuffText_FontStr"]
        g:SetText(HEALBOT_OPTIONS_TAB_BUFFICONTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_Buffs2Txt"]
        g:SetText(HEALBOT_OPTIONS_ICONBUFFOPTTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_fhbTxt"]
        g:SetText(HEALBOT_OPTIONS_BARHEADEROPTTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Skins_fhfTxt"]
        g:SetText(HEALBOT_OPTIONS_FRAMEHEADEROPTTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_SkinAuthorText"]
        g:SetText(HEALBOT_OPTIONS_SKINAUTHOR)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_CDCWarn_Text"]
        g:SetText(HEALBOT_OPTIONS_CDCWARNINGS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_DispellableDebuff_Text"]
        g:SetText(HEALBOT_OPTIONS_DEBUFFDISPELL)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_CustomAuto"]
        g:SetText(HEALBOT_CUSTOM_CAT_CUSTOM_AUTOMATIC)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_BuffWarn_Text"]
        g:SetText(HEALBOT_OPTIONS_BUFFWARNINGS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_BuffCustom_Text"]
        g:SetText(HEALBOT_OPTIONS_BUFFCUSTOM)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_BuffCustomShare_Text"]
        g:SetText(HEALBOT_OPTIONS_CBUFFS_DISCORD)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_DebuffCustomShare_Text"]
        g:SetText(HEALBOT_OPTIONS_CDEBUFFS_DISCORD)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_InOut_ShareSkins_Text"]
        g:SetText(HEALBOT_OPTIONS_SKINS_DISCORD)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_InOut_ShareCDbuffs_Text"]
        g:SetText(HEALBOT_OPTIONS_CDEBUFFS_DISCORD)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_InOut_ShareBuffs_Text"]
        g:SetText(HEALBOT_OPTIONS_CBUFFS_DISCORD)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_InOut_ShareSpells_Text"]
        g:SetText(HEALBOT_OPTIONS_SPELLS_DISCORD)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_InOut_SharePresetCols_Text"]
        g:SetText(HEALBOT_OPTIONS_PRECOLS_DISCORD)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_BuffAutoTxt"]
        g:SetText(HEALBOT_CUSTOM_CAT_CUSTOM_AUTOBUFFS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_BuffMissing_Text"]
        g:SetText(HEALBOT_OPTIONS_BUFFMISSING)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_BuffMissing_Text"]
        g:SetText(HEALBOT_OPTIONS_BUFFMISSING)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_BuffExtra_Text"]
        g:SetText(HEALBOT_OPTIONS_BUFFMISSING)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_BuffExtraWE_Text"]
        g:SetText(HEALBOT_OPTIONS_BUFFSTEXTWE)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_BuffExtraWellFed_Text"]
        g:SetText(HEALBOT_WELL_FED)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_BuffExtraManaDrink_Text"]
        g:SetText(HEALBOT_MANA_DRINK)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_BuffExtraBuffs_Text"]
        g:SetText(HEALBOT_OPTIONS_TAB_EXTRAS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_DebuffCustom_Text"]
        g:SetText(HEALBOT_OPTIONS_DEBUFFCUSTOM)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Panel6_1"]
        g:SetText(HEALBOT_OPTIONS_TIPTEXT)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Panel6_2"]
        g:SetText(HEALBOT_OPTIONS_TIPTEXT2)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_Panel6_3"]
        g:SetText(HEALBOT_OPTIONS_TIPTEXT3)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_Options_PrioDebuffDisease_FontStr"]
        g:SetText(HEALBOT_DISEASE)
        g=_G["HealBot_Options_PrioDebuffMagic_FontStr"]
        g:SetText(HEALBOT_MAGIC)
        g=_G["HealBot_Options_PrioDebuffPoison_FontStr"]
        g:SetText(HEALBOT_POISON)
        g=_G["HealBot_Options_PrioDebuffCurse_FontStr"]
        g:SetText(HEALBOT_CURSE)
        g=_G["healbotcustomdebuffclassfontstr"]
        g:SetText(HEALBOT_WORD_COLOUR)
        g=_G["healbotcustombuffclassfontstr"]
        g:SetText(HEALBOT_WORD_COLOUR)
        HealBot_Globals.localLang=region
        HealBot_Timers_InitExtraOptions()
    end
    if msgchat then HealBot_Timers_Set("PLAYER","SpecUpdate") end
end

HealBot_Options_luVars["OnLoad"]=true
function HealBot_Options_AboutTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        local g=_G["HealBot_About_Header"]
        g:SetTextColor(1,1,1,1)
        HealBot_Options_FAQ.initialize = HealBot_Options_FAQ_DropDown
        UIDropDownMenu_SetText(HealBot_Options_FAQ, HEALBOT_ABOUT_FAQ_QUESTIONS[1])
        g=_G["HealBot_Options_FAQAnswerTextD"]
        g:SetTextColor(1,1,1,1);    
        g:SetText(HEALBOT_ABOUT_FAQ_ANSWERS[HealBot_Options_luVars["hbFAQ"]])
        g=_G["HealBot_About_AuthorH"] 
        g:SetText(HEALBOT_ABOUT_AUTHORH)
        g=_G["HealBot_About_URLH"] 
        g:SetText(HEALBOT_ABOUT_WEBSITE)
        g=_G["HealBot_About_CatH"] 
        g:SetText(HEALBOT_ABOUT_CATH)
        g=_G["HealBot_About_CatD"] 
        g=_G["HealBot_About_LocalH"] 
        g:SetText(HEALBOT_ABOUT_LOCALH)
        g=_G["HealBot_About_FAQH"] 
        g:SetText(HEALBOT_ABOUT_FAQH)
        g=_G["HBIncHealsColHeader1"] 
        g:SetText(HEALBOT_WORD_HEALER)
        g=_G["HBIncHealsColHeader2"] 
        g:SetText(HEALBOT_WORD_VERSION)
        g=_G["HBIncHealsColHeader3"] 
        g:SetText(HEALBOT_ABOUT_CREDITH)
        HealBot_Comms_Print_Supports()
        HealBot_Options_SetLabel("HealBot_About_Desc1",HEALBOT_ABOUT_DESC1)
        HealBot_Options_SetLabel("HealBot_Info_SuppressSounds",HEALBOT_SUPPRESSSOUND)
        HealBot_Options_SetLabel("HealBot_Info_SuppressErrors",HEALBOT_SUPPRESSERROR)
        HealBot_Options_SetLabel("HealBot_Info_PerfLevel",HEALBOT_PERFLEVEL)
        HealBot_Options_SetLabel("HealBot_About_AuthorD",HEALBOT_ABOUT_AUTHORD)
        HealBot_Options_SetLabel("HealBot_About_URLD",HEALBOT_ABOUT_URL)
        HealBot_Options_SetLabel("HealBot_Options_FAQTxt",HEALBOT_ABOUT_FAQ_QUESTION)
        HealBot_Options_SetLabel("HealBot_Options_FAQAnswerTextH",HEALBOT_ABOUT_FAQ_ANSWER)
        HealBot_Options_SetLabel("HealBot_About_LocalD",HEALBOT_ABOUT_LOCALD)
        HealBot_Options_SetLabel("HealBot_About_CatD",HEALBOT_ABOUT_CATD)
        HealBot_Options_TabRunOnce[tab]=true
    end
    if HealBot_Options_luVars["OnLoad"] then
        HealBot_Timers_Lang()
        local g=_G["UsedToInitFonts"]
        g:SetTextColor(0,0,0,0)
        C_Timer.After(0.1, function() HealBot_Options_InitFonts(0) end)
        HealBot_Options_luVars["OnLoad"]=false
    end
end

function HealBot_Options_GeneralTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_Theme.initialize = HealBot_Options_Theme_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Theme, HealBot_Options_Lists["Themes"][HealBot_Globals.OptionsTheme])
        HealBot_Options_hbCommands.initialize = HealBot_Options_hbCommands_DropDown
        UIDropDownMenu_SetText(HealBot_Options_hbCommands, HealBot_Options_hbCommands_List[HealBot_Options_luVars["hbCommands"]])
        HealBot_Options_EmergencyFClass.initialize = HealBot_Options_EmergencyFClass_DropDown
        UIDropDownMenu_SetText(HealBot_Options_EmergencyFClass, HealBot_Options_EmergencyFClass_List[HealBot_Globals.EmergencyFClass])
        HealBot_Options_hbLangs.initialize = HealBot_Options_hbLangs_DropDown
        UIDropDownMenu_SetText(HealBot_Options_hbLangs, HealBot_Options_hbLangs_List[HealBot_Options_luVars["hbLangs"]])
        HealBot_Options_NoAuraWhenRested:SetChecked(HealBot_Config_Buffs.NoAuraWhenRested)
        local mmButtonShown=false
        if HealBot_Globals.MinimapIcon.hide==false then mmButtonShown=true end
        HealBot_Options_ShowMinimapButton:SetChecked(mmButtonShown)
        HealBot_Options_HideOptions:SetChecked(HealBot_Globals.HideOptions)
        HealBot_Options_HideUnlocked:SetChecked(HealBot_Globals.HideUnlockedTag)
        HealBot_Options_RightButtonOptions:SetChecked(HealBot_Globals.RightButtonOptions)
        HealBot_Options_sliderlabels_Init(HealBot_Options_OptionsOpacityAdj,HEALBOT_OPTIONS_OPTIONSOPACITY,1,75,1,5,HEALBOT_WORD_LOW,HEALBOT_WORD_HIGH)
        HealBot_Options_OptionsOpacityAdj:SetValue(HealBot_Globals.OptionsOpacityAdj or 35)
        HealBot_Options_CommandsButton:SetText(HEALBOT_WORD_RUN)
        HealBot_Options_LangsButton:SetText(HEALBOT_WORD_SET)
        HealBot_Options_hbProfileButtonText:SetText(HEALBOT_WORD_SET)
        HealBot_Options_hbProfile.initialize = HealBot_Options_hbProfile_DropDown
        UIDropDownMenu_SetText(HealBot_Options_hbProfile, HealBot_Options_hbProfile_List[HealBot_Config.Profile])
        HealBot_Options_SetText(HealBot_Options_NoAuraWhenRested,HEALBOT_OPTION_IGNORE_AURA_RESTED)
        HealBot_Options_SetText(HealBot_Options_ShowMinimapButton,HEALBOT_OPTIONS_SHOWMINIMAPBUTTON)
        HealBot_Options_SetText(HealBot_Options_HideOptions,HEALBOT_OPTIONS_HIDEOPTIONS)
        HealBot_Options_SetText(HealBot_Options_HideUnlocked,HEALBOT_OPTIONS_HIDEUNLOCKEDTAG)
        HealBot_Options_SetText(HealBot_Options_RightButtonOptions,HEALBOT_OPTIONS_RIGHTBOPTIONS)
        HealBot_Options_SetText(HealBot_Options_OptionsOpacityAdj,HEALBOT_OPTIONS_OPTIONSOPACITY)
        HealBot_Options_SetText(HealBot_Options_DisableHealBotOpt,HEALBOT_OPTIONS_DISABLEHEALBOT)
        HealBot_Options_SetText(HealBot_Options_DisableHealBotSolo,HEALBOT_OPTIONS_DISABLEHEALBOTSOLO)
        HealBot_Options_SetLabel("healbotcmdfontstr",HEALBOT_OPTIONS_COMMANDS)
        HealBot_Options_SetText(HealBot_Options_EFClassDruid,HEALBOT_DRUID)
        HealBot_Options_SetText(HealBot_Options_EFClassHunter,HEALBOT_HUNTER)
        HealBot_Options_SetText(HealBot_Options_EFClassMage,HEALBOT_MAGE)
        HealBot_Options_SetText(HealBot_Options_EFClassPaladin,HEALBOT_PALADIN)
        HealBot_Options_SetText(HealBot_Options_EFClassPriest,HEALBOT_PRIEST)
        HealBot_Options_SetText(HealBot_Options_EFClassRogue,HEALBOT_ROGUE)
        HealBot_Options_SetText(HealBot_Options_EFClassShaman,HEALBOT_SHAMAN)
        HealBot_Options_SetText(HealBot_Options_EFClassWarlock,HEALBOT_WARLOCK)
        HealBot_Options_SetText(HealBot_Options_EFClassWarrior,HEALBOT_WARRIOR)
        HealBot_Options_SetText(HealBot_Options_EFClassDeathKnight,HEALBOT_DEATHKNIGHT)
        HealBot_Options_SetText(HealBot_Options_EFClassDemonHunter,HEALBOT_DEMONHUNTER)
        HealBot_Options_SetText(HealBot_Options_EFClassMonk,HEALBOT_MONK)
        HealBot_Options_SetLabel("healbotlangfontstr",HEALBOT_OPTIONS_LANG)
        HealBot_Options_SetLabel("healbotcrolesfontstr",HEALBOT_OPTIONS_EMERGFCLASS)
        HealBot_Options_SetLabel("healbotprofilefontstr",HEALBOT_OPTIONS_PROFILE)
        HealBot_Options_SetLabel("HealBot_OptionThemet",HEALBOT_OPTIONS_THEME)
        if HEALBOT_GAME_VERSION<4 then
            HealBot_Options_EFClassDemonHunter:Hide()
            HealBot_Options_EFClassMonk:Hide()
            HealBot_Options_EFClassDruid:ClearAllPoints()
            HealBot_Options_EFClassDruid:SetPoint("TOPLEFT","HealBot_Options_EFClassDeathKnight","TOPRIGHT",120,0)
            HealBot_Options_EFClassMage:ClearAllPoints()
            HealBot_Options_EFClassMage:SetPoint("TOPLEFT","HealBot_Options_EFClassHunter","TOPRIGHT",120,0)
            HealBot_Options_EFClassPaladin:ClearAllPoints()
            HealBot_Options_EFClassPaladin:SetPoint("TOPLEFT","HealBot_Options_EFClassDeathKnight","BOTTOMLEFT",0,-7)
            HealBot_Options_EFClassRogue:ClearAllPoints()
            HealBot_Options_EFClassRogue:SetPoint("TOPLEFT","HealBot_Options_EFClassPriest","TOPRIGHT",120,0)
            HealBot_Options_EFClassWarlock:ClearAllPoints()
            HealBot_Options_EFClassWarlock:SetPoint("TOPLEFT","HealBot_Options_EFClassPriest","BOTTOMLEFT",0,-7)
            HealBot_Options_EFClassShaman:ClearAllPoints()
            HealBot_Options_EFClassShaman:SetPoint("TOPLEFT","HealBot_Options_EFClassRogue","TOPRIGHT",120,0)
        elseif HEALBOT_GAME_VERSION<3 then 
            HealBot_Options_EFClassDeathKnight:Hide()
            HealBot_Options_EFClassDemonHunter:Hide()
            HealBot_Options_EFClassMonk:Hide()
            HealBot_Options_EFClassDruid:ClearAllPoints()
            HealBot_Options_EFClassDruid:SetPoint("TOPLEFT","HealBot_Options_EmergencyFClass","BOTTOMLEFT",-135,-10)
            HealBot_Options_EFClassMage:ClearAllPoints()
            HealBot_Options_EFClassMage:SetPoint("TOPLEFT","HealBot_Options_EFClassHunter","TOPRIGHT",120,0)
            HealBot_Options_EFClassPaladin:ClearAllPoints()
            HealBot_Options_EFClassPaladin:SetPoint("TOPLEFT","HealBot_Options_EFClassDruid","BOTTOMLEFT",0,-7)
            HealBot_Options_EFClassRogue:ClearAllPoints()
            HealBot_Options_EFClassRogue:SetPoint("TOPLEFT","HealBot_Options_EFClassPriest","TOPRIGHT",120,0)
            HealBot_Options_EFClassShaman:ClearAllPoints()
            HealBot_Options_EFClassShaman:SetPoint("TOPLEFT","HealBot_Options_EFClassPaladin","BOTTOMLEFT",0,-7)
        end
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_OverridesEffectsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_sliderlabels_Init(HealBot_Options_OverrideBarUpdateFreq,HEALBOT_OPTION_BARUPDFREQ,1,19,1,2,HEALBOT_OPTIONS_WORD_SLOWER,HEALBOT_OPTIONS_WORD_FASTER)
        HealBot_Options_OverrideBarUpdateFreq:SetValue(HealBot_Globals.OverrideEffects["FLUIDFREQ"] or 10)
        HealBot_Options_SetText(HealBot_Options_OverrideBarUpdateFreq, HEALBOT_OPTION_BARUPDFREQ)
        HealBot_Options_sliderlabels_Init(HealBot_Options_OverrideHealthDropPct,HEALBOT_OPTION_HEALTHDROPPCT,50,500,10,5,"5%","50%")
        HealBot_Options_OverrideHealthDropPct:SetValue(HealBot_Globals.OverrideEffects["HEALTHDROPPCT"] or 350)
        HealBot_Options_SetText(HealBot_Options_OverrideHealthDropPct, HEALBOT_OPTION_HEALTHDROPPCT..floor(HealBot_Globals.OverrideEffects["HEALTHDROPPCT"]/10).."%")
        HealBot_Options_sliderlabels_Init(HealBot_Options_OverrideHotBarHealthThres,HEALBOT_OPTION_HOTBARHEALTHPCT,0,50,1,5,"0%","50%")
        HealBot_Options_OverrideHotBarHealthThres:SetValue(HealBot_Globals.OverrideEffects["HOTBARHLTH"] or 10)
        HealBot_Options_SetText(HealBot_Options_OverrideHotBarHealthThres, HEALBOT_OPTION_HOTBARHEALTHPCT..HealBot_Globals.OverrideEffects["HOTBARHLTH"].."%")            
        HealBot_Options_sliderlabels_Init(HealBot_Options_OverrideHealthDropSpeed,HEALBOT_OPTION_HEALTHDROPSPEED,5,75,5,2,HEALBOT_OPTIONS_WORD_SLOWER,HEALBOT_OPTIONS_WORD_FASTER)
        HealBot_Options_OverrideHealthDropSpeed:SetValue(HealBot_Globals.OverrideEffects["HEALTHDROPSPEED"] or 40)
        HealBot_Options_SetText(HealBot_Options_OverrideHealthDropSpeed, HEALBOT_OPTION_HEALTHDROPSPEED)
        HealBot_Options_sliderlabels_Init(HealBot_Options_OverrideAuxBarFlashFreq,HEALBOT_OPTIONS_AGGROFLASHFREQ,2,20,1,2,HEALBOT_OPTIONS_WORD_SLOWER,HEALBOT_OPTIONS_WORD_FASTER)
        HealBot_Options_OverrideAuxBarFlashFreq:SetValue(HealBot_Globals.OverrideEffects["OFREQ"]*100)
        HealBot_Options_SetText(HealBot_Options_OverrideAuxBarFlashFreq, HEALBOT_OPTIONS_AGGROFLASHFREQ) 
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_OverrideAuxBarFlashAlphaMax,HEALBOT_OPTIONS_MAXALPHA,0.2,1,0.05,2)
        HealBot_Options_OverrideAuxBarFlashAlphaMax:SetValue(HealBot_Globals.OverrideEffects["OMAX"])
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_OverrideAuxBarFlashAlphaMax)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_OverrideAuxBarFlashAlphaMin,HEALBOT_OPTIONS_MINALPHA,0,0.8,0.05,2)
        HealBot_Options_OverrideAuxBarFlashAlphaMin:SetValue(HealBot_Globals.OverrideEffects["OMIN"])
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_OverrideAuxBarFlashAlphaMin)
        HealBot_Options_sliderlabels_Init(HealBot_Options_OverrideFocusGroupDimming,HEALBOT_OPTION_FOCUSGROUPDIMMING,12,44,1,4,HEALBOT_WORD_LOW,HEALBOT_WORD_HIGH)
        HealBot_Options_OverrideFocusGroupDimming:SetValue((HealBot_Globals.OverrideEffects["FGDIMMING"] or 2.8)*10)
        HealBot_Options_SetText(HealBot_Options_OverrideFocusGroupDimming, HEALBOT_OPTION_FOCUSGROUPDIMMING)
        HealBot_Options_sliderlabels_Init(HealBot_Options_OverrideHotBarDimming,HEALBOT_OPTION_NONHOTBARSDIMMING,12,44,1,4,HEALBOT_WORD_LOW,HEALBOT_WORD_HIGH)
        HealBot_Options_OverrideHotBarDimming:SetValue((HealBot_Globals.OverrideEffects["HBDIMMING"] or 2.2)*10)
        HealBot_Options_SetText(HealBot_Options_OverrideHotBarDimming, HEALBOT_OPTION_NONHOTBARSDIMMING) 
        HealBot_Options_SetLabel("HealBot_Options_OverrideHotBarDebuffPrio_FontStr",HEALBOT_OPTION_HOTBARSDEBUFFPRIO)
        HealBot_Options_Override_EffectsUse.initialize = HealBot_Options_Override_EffectsUse_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Override_EffectsUse, HealBot_Options_UseOverrides_List[HealBot_Globals.OverrideEffects["USE"]])
        HealBot_Options_sliderlabels_Init(HealBot_Options_OverrideBorderHazardFreq,HEALBOT_OPTIONS_AGGROFLASHFREQ,10,90,5,2,HEALBOT_OPTIONS_WORD_SLOWER,HEALBOT_OPTIONS_WORD_FASTER)
        HealBot_Options_OverrideBorderHazardFreq:SetValue((1-(HealBot_Globals.OverrideEffects["HAZARDFREQ"] or 0.3))*100)
        HealBot_Options_SetText(HealBot_Options_OverrideBorderHazardFreq, HEALBOT_OPTIONS_AGGROFLASHFREQ) 
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_OverrideBorderHazardMinAlpha,HEALBOT_OPTIONS_MINALPHA,0,0.75,0.05,2)
        HealBot_Options_OverrideBorderHazardMinAlpha:SetValue(HealBot_Globals.OverrideEffects["HAZARDMINALPHA"] or 0.25)
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_OverrideBorderHazardMinAlpha)
        g=_G["HealBot_OverrideEffects_FontStr"]
        g:SetTextColor(1,1,1,1)
        g:SetText(HEALBOT_OPTIONS_TAB_EFFECTS)
        g=_G["HealBot_OverrideAuxBarsAssign_FontStr"]
        g:SetTextColor(1,1,1,1)
        g:SetText(HEALBOT_OPTIONS_AUXFLASH)
        g=_G["HealBot_OverrideEffectsFluid_FontStr"]
        g:SetTextColor(1,1,1,1)
        g:SetText(HEALBOT_OPTION_FLUIDBARS)
        g=_G["HealBot_OverrideHealthDrop_FontStr"]
        g:SetTextColor(1,1,1,1)
        g:SetText(HEALBOT_OPTION_HEALTHDROPALERT)
        g=_G["HealBot_OverrideHotBars_FontStr"]
        g:SetTextColor(1,1,1,1)
        g:SetText(HEALBOT_OPTION_HOTBARS)
        g=_G["HealBot_HealthDrop_FontStr"]
        g:SetTextColor(1,1,1,1)
        g:SetText(HEALBOT_OPTION_HEALTHDROPALERT)
        g=_G["HealBot_HotBars_FontStr"]
        g:SetTextColor(1,1,1,1)
        g:SetText(HEALBOT_OPTION_HOTBARS)
        HealBot_Options_SetLabel("healbotOverride_Effectsfontstr",HEALBOT_OPTIONS_OVERRIDE_EFFECTS)
        HealBot_Options_Override_EffectsUse_Toggle()
        HealBot_Options_OverrideUseFluidBars:SetChecked(HealBot_Globals.OverrideEffects["FLUIDBARS"])
        HealBot_Options_SetText(HealBot_Options_OverrideUseFluidBars,HEALBOT_OPTION_USE)
        HealBot_Options_OverrideUseFluidBarsAlpha:SetChecked(HealBot_Globals.OverrideEffects["FLUIDALPHA"])
        HealBot_Options_SetText(HealBot_Options_OverrideUseFluidBarsAlpha,HEALBOT_OPTION_FLUIDBARSINCALPHA)
        HealBot_Options_OverrideUseHealthDrop:SetChecked(HealBot_Globals.OverrideEffects["HEALTHDROP"])
        HealBot_Options_SetText(HealBot_Options_OverrideUseHealthDrop,HEALBOT_OPTION_USE)
        HealBot_Options_DoEffects_DropDowns()
        HealBot_Options_SetEFGroups()
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_OverrideChatTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_Override_ChatUse.initialize = HealBot_Options_Override_ChatUse_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Override_ChatUse, HealBot_Options_UseOverrides_List[HealBot_Globals.OverrideChat["USE"]])
        g=_G["HealBot_OverrideChat_FontStr"]
        g:SetTextColor(1,1,1,1)
        g:SetText(HEALBOT_OPTIONS_TAB_CHAT)
        HealBot_Options_SetLabel("healbotOverride_Chatfontstr",HEALBOT_OPTIONS_OVERRIDE_CHAT)
        HealBot_Options_SetLabel("HealBot_Options_OverrideNotifyOtherMsgTxt",HEALBOT_OPTIONS_NOTIFY_MSG.."  ("..HEALBOT_OPTIONS_CASTNOTIFYTAGS..")")
        HealBot_Options_val_OnLoad(HealBot_Options_OverrideAfterCombatOOMValue,HEALBOT_OPTIONS_EOC_OOM_VALUE,1,50,1,5)
        HealBot_Options_OverrideAfterCombatOOMValue:SetValue(HealBot_Globals.OverrideChat["EOCOOMV"] or 20)
        HealBot_Options_SetText(HealBot_Options_OverrideAfterCombatOOMValue,HEALBOT_OPTIONS_EOC_OOM_VALUE..": "..HealBot_Globals.OverrideChat["EOCOOMV"].."%")
        HealBot_Options_OverrideAfterCombatOOM:SetChecked(HealBot_Globals.OverrideChat["EOCOOM"])
        HealBot_Options_SetText(HealBot_Options_OverrideAfterCombatOOM,HEALBOT_OPTIONS_EOC_OOM)
        HealBot_Options_OverrideCastNotify_OnClick(nil,HealBot_Globals.OverrideChat["NOTIFY"])
        HealBot_Options_OverrideNotifyOtherMsg:SetText(HealBot_Globals.OverrideChat["MSG"])   
        HealBot_Options_OverrideCastNotifyResOnly:SetChecked(HealBot_Globals.OverrideChat["RESONLY"])
        HealBot_Options_SetText(HealBot_Options_OverrideCastNotifyResOnly,HEALBOT_OPTIONS_CASTNOTIFYRESONLY)
        HealBot_Options_SetText(HealBot_Options_OverrideCastNotify1,HEALBOT_OPTIONS_CASTNOTIFY1)
        HealBot_Options_SetText(HealBot_Options_OverrideCastNotify2,HEALBOT_OPTIONS_CASTNOTIFY2)
        HealBot_Options_SetText(HealBot_Options_OverrideCastNotify3,HEALBOT_OPTIONS_CASTNOTIFY3)
        HealBot_Options_SetText(HealBot_Options_OverrideCastNotify4,HEALBOT_OPTIONS_CASTNOTIFY4)
        HealBot_Options_SetText(HealBot_Options_OverrideCastNotify5,HEALBOT_OPTIONS_CASTNOTIFY5)
        HealBot_Options_SetText(HealBot_Options_OverrideCastNotify6,HEALBOT_OPTIONS_CASTNOTIFY6)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_OverrideFramesTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_Override_FramesUse.initialize = HealBot_Options_Override_FramesUse_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Override_FramesUse, HealBot_Options_UseOverrides_List[HealBot_Globals.OverrideFrames["USE"]])
        g=_G["HealBot_OverrideFrames_FontStr"]
        g:SetTextColor(1,1,1,1)
        g:SetText(HEALBOT_OPTIONS_TAB_FRAMES)
        HealBot_Options_SetLabel("healbotOverride_Framesfontstr",HEALBOT_OPTIONS_OVERRIDE_FRAMES)
        HealBot_Options_OverridePartyFrames:SetChecked(HealBot_Globals.OverrideFrames["HIDEPARTYF"])
        HealBot_Options_SetText(HealBot_Options_OverridePartyFrames,HEALBOT_OPTIONS_HIDEPARTYFRAMES)
        HealBot_Options_OverrideAlwaysRunEvents:SetChecked(HealBot_Globals.OverrideFrames["RUNBLIZZEVENTS"])
        HealBot_Options_SetText(HealBot_Options_OverrideAlwaysRunEvents,HEALBOT_OPTIONS_ALWAYRUNEVENTS)
        HealBot_Options_OverridePlayerTargetFrames:SetChecked(HealBot_Globals.OverrideFrames["HIDEPTF"])
        HealBot_Options_SetText(HealBot_Options_OverridePlayerTargetFrames,HEALBOT_OPTIONS_HIDEPLAYERTARGET)
        HealBot_Options_OverrideMiniBossFrames:SetChecked(HealBot_Globals.OverrideFrames["HIDEBOSSF"])
        HealBot_Options_SetText(HealBot_Options_OverrideMiniBossFrames,HEALBOT_OPTIONS_HIDEMINIBOSSFRAMES)
        HealBot_Options_OverrideFocusFrame:SetChecked(HealBot_Globals.OverrideFrames["HIDEFOCUSF"])
        HealBot_Options_SetText(HealBot_Options_OverrideFocusFrame,HEALBOT_OPTIONS_HIDEFOCUSFRAME)
        
        HealBot_Options_OverrideRaidFrames:SetChecked(HealBot_Globals.OverrideFrames["HIDERAIDF"])
        HealBot_Options_SetText(HealBot_Options_OverrideRaidFrames,HEALBOT_OPTIONS_HIDERAIDFRAMES)
        g=_G["HealBot_Options_OverrideEffectbTxt"]
        g:SetText(HEALBOT_OPTIONS_TAB_EFFECTS)
        g=_G["HealBot_OverrideGeneralSkinBlizz_FontStr"]
        g:SetText(HEALBOT_OPTIONS_BLIZZARD_FRAMES)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_WarnOnSelfCast(wId)
    if HealBot_Options_luVars["SpellsTabOpenWarnId"]==wId then 
        if GetModifiedClick("SELFCAST")~="NONE" then
            healbotSelfCastWarning:SetText("WARNING: Self Cast Key is set to modifier "..GetModifiedClick("SELFCAST").." in your UI settings")
        else
            local autoSelfCast=C_CVar.GetCVar("autoSelfCast")
            if autoSelfCast and tonumber(autoSelfCast)==1 then
                healbotSelfCastWarning:SetText("WARNING: Auto Self Cast is turned on in your UI settings")
            else
                healbotSelfCastWarning:SetText("")
            end
        end
        C_Timer.After(1, function() HealBot_Options_WarnOnSelfCast(wId) end)
    end
end

function HealBot_Options_SpellsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ComboClass_Text()
        local g=_G["healbotspellshelphealfontstr"]
        if HealBot_Options_luVars["ActionBarsCombo"]==1 then
            g:SetText(HEALBOT_OPTIONS_SMARTCASTHEAL)
        elseif HealBot_Options_luVars["ActionBarsCombo"]==2 then
            g:SetText(HEALBOT_OPTIONS_HARMFUL_SPELLS)
        elseif HealBot_Options_luVars["ActionBarsCombo"]==3 then
            g:SetText(HEALBOT_OPTIONS_EMERGSPELLS)
        else
            g:SetText(HEALBOT_OPTIONS_ICONSCMD)
        end
        HealBot_Options_SetLabel("HealBot_Options_SelectSpellsFrame_TextH1",hbOptionText[1])
        HealBot_Options_SetLabel("HealBot_Options_SelectSpellsFrame_TextH2",hbOptionText[2])
        HealBot_Options_UseIconCmds:SetChecked(HealBot_Globals.UseIconCommands)
        HealBot_Options_SetText(HealBot_Options_UseIconCmds,HEALBOT_OPTIONS_USEICONCMDS)
        HealBot_Options_ModKeyShift:SetChecked(HealBot_Options_luVars["ModKeyShift"])
        HealBot_Options_SetText(HealBot_Options_ModKeyShift,HEALBOT_OPTIONS_SHIFT)
        HealBot_Options_ModKeyCtrl:SetChecked(HealBot_Options_luVars["ModKeyCtrl"])
        HealBot_Options_SetText(HealBot_Options_ModKeyCtrl,HEALBOT_OPTIONS_CTRL)
        HealBot_Options_ModKeyAlt:SetChecked(HealBot_Options_luVars["ModKeyAlt"])
        HealBot_Options_SetText(HealBot_Options_ModKeyAlt,HEALBOT_OPTIONS_ALT)
        g=_G["HealBot_Options_HealSpellsSelect"]
        g:SetText(HEALBOT_WORD_SELECT)
        HealBot_Options_SetLabel("healbotspellshelpotherfontstr",HEALBOT_OPTIONS_OTHERSPELLS)
        g=_G["HealBot_Options_OtherSpellsSelect"]
        g:SetText(HEALBOT_WORD_SELECT)
        HealBot_Options_SetLabel("healbotspellshelpmacrofontstr",HEALBOT_WORD_MACROS)
        g=_G["HealBot_Options_MacrosSelect"]
        g:SetText(HEALBOT_WORD_SELECT)
        HealBot_Options_SetLabel("healbotspellshelpitemsfontstr",HEALBOT_OPTIONS_ITEMS)
        g=_G["HealBot_Options_ItemsSelect"]
        g:SetText(HEALBOT_WORD_SELECT)
        HealBot_Options_SetLabel("healbotspellshelpcmdsfontstr",HEALBOT_WORD_COMMANDS)
        g=_G["HealBot_Options_CmdsSelect"]
        g:SetText(HEALBOT_WORD_SELECT)
        HealBot_Options_SetLabel("healbotspellshelpemotesfontstr",HEALBOT_EMOTES)
        g=_G["HealBot_Options_CancelHelpSelect"]
        g:SetText(HEALBOT_WORD_CANCEL)
        HealBot_Options_SetLabel("HealBot_Options_SmartCastSpellTxt",HEALBOT_OPTIONS_SMARTCASTSPELLS)
        HealBot_Options_ButtonCastMethod.initialize = HealBot_Options_ButtonCastMethod_DropDown
        UIDropDownMenu_SetText(HealBot_Options_ButtonCastMethod, HealBot_Options_ButtonCastMethod_List[HealBot_Config_Spells.ButtonCastMethod])
        HealBot_Options_ActionBarsCombo.initialize = HealBot_Options_ActionBarsCombo_DropDown
        UIDropDownMenu_SetText(HealBot_Options_ActionBarsCombo, HealBot_Options_ActionBarsCombo_List[HealBot_Options_luVars["ActionBarsCombo"]])
        HealBot_Options_SmartCastBuff:SetChecked(HealBot_Globals.SmartCastBuff)
        HealBot_Options_SetText(HealBot_Options_SmartCastBuff,HEALBOT_OPTIONS_SMARTCASTBUFF)
        HealBot_Options_SmartCastRes:SetChecked(HealBot_Globals.SmartCastRes)
        HealBot_Options_SetText(HealBot_Options_SmartCastRes,GetSpellInfo(HEALBOT_RESURRECTION))
        HealBot_Options_SmartCastDisspell:SetChecked(HealBot_Globals.SmartCastDebuff)
        HealBot_Options_SetText(HealBot_Options_SmartCastDisspell,HEALBOT_OPTIONS_SMARTCASTDISPELL)
        HealBot_Options_ProtectPvP:SetChecked(HealBot_Globals.ProtectPvP)
        HealBot_Options_SetText(HealBot_Options_ProtectPvP,HEALBOT_OPTIONS_PROTECTPVP)
        HealBot_Options_EnableSmartCast:SetChecked(HealBot_Globals.SmartCast)
        HealBot_Options_SetText(HealBot_Options_EnableSmartCast,HEALBOT_OPTIONS_ENABLESMARTCAST)
        HealBot_Options_SetLabel("healbotspellshelphealfontstr",HEALBOT_OPTIONS_SMARTCASTHEAL)
        HealBot_Options_SetLabel("healbotsetspellsfontstr",HEALBOT_OPTIONS_SETSPELLS)
        HealBot_Options_SetLabel("HealBot_AutoTarget_ButtonText",HEALBOT_OPTIONS_COMBOAUTOTARGET)
        HealBot_Options_SetLabel("HealBot_AutoTrinket_ButtonText",HEALBOT_OPTIONS_COMBOAUTOTRINKET)
        HealBot_Options_SetLabel("HealBot_AvoidBC_ButtonText",HEALBOT_OPTIONS_AVOIDBLUECURSOR)
        HealBot_Options_SetLabel("healbotcastmethodfontstr",HEALBOT_OPTIONS_BUTTONCASTMETHOD)
        HealBot_Options_SetLabel("healbotmodkeyfontstr",HEALBOT_OPTIONS_MODIFIERKEYS)
        HealBot_Options_SetText(HealBot_SpellAutoTrinket1,HEALBOT_ONE)
        HealBot_Options_SetText(HealBot_SpellAutoTrinket2,HEALBOT_TWO)
        HealBot_Options_SetText(HealBot_ShiftSpellAutoTrinket1,HEALBOT_ONE)
        HealBot_Options_SetText(HealBot_ShiftSpellAutoTrinket2,HEALBOT_TWO)
        HealBot_Options_SetText(HealBot_CtrlSpellAutoTrinket1,HEALBOT_ONE)
        HealBot_Options_SetText(HealBot_CtrlSpellAutoTrinket2,HEALBOT_TWO)
        HealBot_Options_SetText(HealBot_AltSpellAutoTrinket1,HEALBOT_ONE)
        HealBot_Options_SetText(HealBot_AltSpellAutoTrinket2,HEALBOT_TWO)
        HealBot_Options_SetText(HealBot_CtrlShiftSpellAutoTrinket1,HEALBOT_ONE)
        HealBot_Options_SetText(HealBot_CtrlShiftSpellAutoTrinket2,HEALBOT_TWO)
        HealBot_Options_SetText(HealBot_Options_Button1,HEALBOT_OPTIONS_BUTTONLEFT)
        HealBot_Options_SetLabel("healbotspellshelpcmds1fontstr",HEALBOT_OPTIONS_BUTTONLEFT)
        HealBot_Options_SetLabel("healbotspellshelpcmds2fontstr",HEALBOT_OPTIONS_BUTTONMIDDLE)
        HealBot_Options_SetLabel("healbotspellshelpcmds3fontstr",HEALBOT_OPTIONS_BUTTONRIGHT)
        HealBot_Options_SetLabel("healbotspellshelpcmds4fontstr",HEALBOT_OPTIONS_BUTTON4)
        HealBot_Options_SetLabel("healbotspellshelpcmds5fontstr",HEALBOT_OPTIONS_BUTTON5)
        HealBot_Options_SetText(HealBot_Options_Button2,HEALBOT_OPTIONS_BUTTONMIDDLE)
        HealBot_Options_SetText(HealBot_Options_Button3,HEALBOT_OPTIONS_BUTTONRIGHT)
        HealBot_Options_SetText(HealBot_Options_Button4,HEALBOT_OPTIONS_BUTTON4)
        HealBot_Options_SetText(HealBot_Options_Button5,HEALBOT_OPTIONS_BUTTON5)
        HealBot_Options_SelectHealSpellsCombo.initialize = HealBot_Options_SelectHealSpellsCombo_DropDown
        if HealBot_Options_luVars["ActionBarsCombo"]==1 then
            UIDropDownMenu_SetText(HealBot_Options_SelectHealSpellsCombo, HEALBOT_OPTIONS_SMARTCASTHEAL)
        elseif HealBot_Options_luVars["ActionBarsCombo"]==2 then
            UIDropDownMenu_SetText(HealBot_Options_SelectHealSpellsCombo, HEALBOT_OPTIONS_HARMFUL_SPELLS)
        elseif HealBot_Options_luVars["ActionBarsCombo"]==3 then
            UIDropDownMenu_SetText(HealBot_Options_SelectHealSpellsCombo, HEALBOT_OPTIONS_EMERGSPELLS)
        else
            UIDropDownMenu_SetText(HealBot_Options_SelectHealSpellsCombo, HEALBOT_OPTIONS_ICONSCMD)
        end
        HealBot_Options_SelectOtherSpellsCombo.initialize = HealBot_Options_SelectOtherSpellsCombo_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelectOtherSpellsCombo, HEALBOT_OPTIONS_OTHERSPELLS)
        HealBot_Options_SelectMacrosCombo.initialize = HealBot_Options_SelectMacrosCombo_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelectMacrosCombo, HEALBOT_WORD_MACROS)
        HealBot_Options_SelectItemsCombo.initialize = HealBot_Options_SelectItemsCombo_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelectItemsCombo, HEALBOT_OPTIONS_ITEMS)
        HealBot_Options_SelectCmdsCombo.initialize = HealBot_Options_SelectCmdsCombo_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelectCmdsCombo, HEALBOT_WORD_COMMANDS)
        HealBot_Options_SelectEmotesCombo.initialize = HealBot_Options_SelectEmotesCombo_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelectEmotesCombo, HEALBOT_EMOTES)
        HealBot_Options_SelectIconCmds1Combo.initialize = HealBot_Options_SelectIconCmds1Combo_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelectIconCmds1Combo, HEALBOT_WORD_COMMANDS)
        HealBot_Options_SelectIconCmds2Combo.initialize = HealBot_Options_SelectIconCmds2Combo_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelectIconCmds2Combo, HEALBOT_WORD_COMMANDS)
        HealBot_Options_SelectIconCmds3Combo.initialize = HealBot_Options_SelectIconCmds3Combo_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelectIconCmds3Combo, HEALBOT_WORD_COMMANDS)
        HealBot_Options_SelectIconCmds4Combo.initialize = HealBot_Options_SelectIconCmds4Combo_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelectIconCmds4Combo, HEALBOT_WORD_COMMANDS)
        HealBot_Options_SelectIconCmds5Combo.initialize = HealBot_Options_SelectIconCmds5Combo_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelectIconCmds5Combo, HEALBOT_WORD_COMMANDS)
        healbotSelfCastWarning:SetTextColor(1,0.55,0.2,1)
        healbotSelfCastWarning:SetText("")
        HealBot_Options_InitBinds()
        HealBot_Options_SetLabel("healbotbinds1fontstr",HEALBOT_OPTIONS_COMBOBINDS)
        HealBot_Options_TabRunOnce[tab]=true
    end
    HealBot_Options_luVars["SpellsTabOpenWarnId"]=GetTime()
    HealBot_Options_WarnOnSelfCast(HealBot_Options_luVars["SpellsTabOpenWarnId"])
end

function HealBot_Options_SkinsGeneralTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_SkinDefaultSolo:SetChecked(HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][HEALBOT_WORD_SOLO] or false)
        HealBot_Options_SetText(HealBot_Options_SkinDefaultSolo,HEALBOT_WORD_SOLO)
        HealBot_Options_SkinDefaultParty:SetChecked(HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][HEALBOT_WORD_PARTY])
        HealBot_Options_SetText(HealBot_Options_SkinDefaultParty,HEALBOT_WORD_PARTY)
        HealBot_Options_SkinDefaultRaid10:SetChecked(HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][HEALBOT_OPTIONS_RAID10])
        HealBot_Options_SetText(HealBot_Options_SkinDefaultRaid10,HEALBOT_OPTIONS_RAID10)
        HealBot_Options_SkinDefaultRaid25:SetChecked(HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][HEALBOT_OPTIONS_RAID25])
        if HEALBOT_GAME_VERSION<2 then 
            HealBot_Options_SetText(HealBot_Options_SkinDefaultRaid25,HEALBOT_OPTIONS_RAID20)
        else
            HealBot_Options_SetText(HealBot_Options_SkinDefaultRaid25,HEALBOT_OPTIONS_RAID25)
        end
        HealBot_Options_SkinDefaultRaid40:SetChecked(HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][HEALBOT_OPTIONS_RAID40])
        HealBot_Options_SetText(HealBot_Options_SkinDefaultRaid40,HEALBOT_OPTIONS_RAID40)
        HealBot_Options_SkinDefaultArena:SetChecked(HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][HEALBOT_WORD_ARENA])
        HealBot_Options_SetText(HealBot_Options_SkinDefaultArena,HEALBOT_WORD_ARENA)
        HealBot_Options_SkinDefaultBG10:SetChecked(HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][HEALBOT_WORD_BG10])
        HealBot_Options_SetText(HealBot_Options_SkinDefaultBG10,HEALBOT_WORD_BG10)
        HealBot_Options_SkinDefaultBG15:SetChecked(HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][HEALBOT_WORD_BG15])
        HealBot_Options_SetText(HealBot_Options_SkinDefaultBG15,HEALBOT_WORD_BG15)
        HealBot_Options_SkinDefaultBG40:SetChecked(HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][HEALBOT_WORD_BG40])
        HealBot_Options_SetText(HealBot_Options_SkinDefaultBG40,HEALBOT_WORD_BG40)
        HealBot_Options_SkinDefaultPet:SetChecked(HealBot_Config.SkinDefault[Healbot_Config_Skins.Current_Skin][HEALBOT_WORD_PETBATTLE])
        HealBot_Options_SetText(HealBot_Options_SkinDefaultPet,HEALBOT_WORD_PETBATTLE)
        HealBot_Options_UseStickyFrames:SetChecked(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["STICKYFRAME"])
        HealBot_Options_SetText(HealBot_Options_UseStickyFrames,HEALBOT_OPTIONS_STICKYFRAMES)
        HealBot_Options_sliderlabels_Init(HealBot_Options_NotInUseOpacity,HEALBOT_OPTION_GLOBALDIMMING,10,40,1,5,HEALBOT_WORDS_NONE,HEALBOT_WORD_HIGH)
        HealBot_Options_NotInUseOpacity:SetValue((Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["GLOBALDIMMING"] or 1)*10)
        HealBot_Options_SetText(HealBot_Options_NotInUseOpacity,HEALBOT_OPTION_GLOBALDIMMING) 
        HealBot_Options_PartyFrames:SetChecked(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEPARTYF"])
        HealBot_Options_SetText(HealBot_Options_PartyFrames,HEALBOT_OPTIONS_HIDEPARTYFRAMES)
        HealBot_Options_AlwaysRunEvents:SetChecked(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["RUNBLIZZEVENTS"])
        HealBot_Options_SetText(HealBot_Options_AlwaysRunEvents,HEALBOT_OPTIONS_ALWAYRUNEVENTS)
        HealBot_Options_UnitInCombat.initialize = HealBot_Options_UnitInCombat_DropDown
        UIDropDownMenu_SetText(HealBot_Options_UnitInCombat, HealBot_Options_Lists["UnitInCombat"][Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["UNITINCOMBAT"]])
        HealBot_Options_SetLabel("HealBot_UnitInCombat_Txt",HEALBOT_OPTIONS_UNITINCOMBAT)
        HealBot_Options_PlayerTargetFrames:SetChecked(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEPTF"])
        HealBot_Options_SetText(HealBot_Options_PlayerTargetFrames,HEALBOT_OPTIONS_HIDEPLAYERTARGET)
        HealBot_Options_MiniBossFrames:SetChecked(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEBOSSF"])
        HealBot_Options_SetText(HealBot_Options_MiniBossFrames,HEALBOT_OPTIONS_HIDEMINIBOSSFRAMES)
        HealBot_Options_FocusFrame:SetChecked(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDEFOCUSF"])
        HealBot_Options_SetText(HealBot_Options_FocusFrame,HEALBOT_OPTIONS_HIDEFOCUSFRAME)
        HealBot_Options_RaidFrames:SetChecked(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HIDERAIDF"])
        HealBot_Options_SetText(HealBot_Options_RaidFrames,HEALBOT_OPTIONS_HIDERAIDFRAMES)
        g=_G["HealBot_GeneralSkin_FontStr"]
        g:SetText(HEALBOT_OPTIONS_TAB_GENERAL)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_GeneralSkinBlizz_FontStr"]
        g:SetText(HEALBOT_OPTIONS_BLIZZARD_FRAMES)
        HealBot_Options_SetLabel("HealBot_GeneralDefaultSkin_FontStr",HEALBOT_OPTIONS_SKINDEFAULTFOR)
        if strlen(HealBot_Config.Spec)>0 then
            HealBot_Options_SkinDefaultZone:ClearAllPoints();
            HealBot_Options_SkinDefaultZone:SetPoint("TOP",25,-120)
            HealBot_Options_SkinDefaultSpec:ClearAllPoints();
            HealBot_Options_SkinDefaultSpec:SetPoint("TOP",-125,-120)
            HealBot_Options_SkinDefaultSpec:Show()
            HealBot_Options_SkinDefaultZone_SetText()
            HealBot_Options_SkinDefaultSpec_SetText()
        else
            HealBot_Options_SkinDefaultZone:ClearAllPoints();
            HealBot_Options_SkinDefaultZone:SetPoint("TOP",-50,-120)
            HealBot_Options_SkinDefaultSpec:Hide()
            HealBot_Options_SkinDefaultZone_SetText()
        end
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsEffectsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_SetLabel("HealBot_Options_HotBarDebuffPrio_FontStr",HEALBOT_OPTION_HOTBARSDEBUFFPRIO)
        g=_G["HealBot_AuxBarsAssign_FontStr"]
        g:SetText(HEALBOT_OPTIONS_AUXFLASH)
        g=_G["HealBot_SkinsBorderHazardText"]
        g:SetText(HEALBOT_SKIN_BORDER_HAZARDU)
        g=_G["HealBot_SkinsFocusGroupsText"]
        g:SetText(HEALBOT_OPTIONS_FOCUSGROUPS)
        g=_G["HealBot_EffectsFluid_FontStr"]
        g:SetText(HEALBOT_OPTION_FLUIDBARS)
        HealBot_Options_UseHealthDrop:SetChecked(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDBARS"])
        HealBot_Options_SetText(HealBot_Options_UseHealthDrop,HEALBOT_OPTION_USE)
        HealBot_Options_UseFluidBars:SetChecked(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDBARS"])
        HealBot_Options_SetText(HealBot_Options_UseFluidBars,HEALBOT_OPTION_USE)
        HealBot_Options_UseFluidBarsAlpha:SetChecked(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDALPHA"])
        HealBot_Options_SetText(HealBot_Options_UseFluidBarsAlpha,HEALBOT_OPTION_FLUIDBARSINCALPHA)
        HealBot_Options_DoEffects_DropDowns()
        HealBot_Options_sliderlabels_Init(HealBot_Options_BarUpdateFreq,HEALBOT_OPTION_BARUPDFREQ,1,19,1,2,HEALBOT_OPTIONS_WORD_SLOWER,HEALBOT_OPTIONS_WORD_FASTER)
        HealBot_Options_BarUpdateFreq:SetValue(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FLUIDFREQ"] or 10)
        HealBot_Options_SetText(HealBot_Options_BarUpdateFreq,HEALBOT_OPTION_BARUPDFREQ)
        HealBot_Options_sliderlabels_Init(HealBot_Options_HotBarHealthThres,HEALBOT_OPTION_HOTBARHEALTHPCT,0,50,1,5,"0%","50%")
        HealBot_Options_HotBarHealthThres:SetValue(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HOTBARHLTH"] or 10)
        HealBot_Options_SetText(HealBot_Options_HotBarHealthThres, HEALBOT_OPTION_HOTBARHEALTHPCT..Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HOTBARHLTH"].."%")
        HealBot_Options_sliderlabels_Init(HealBot_Options_HealthDropPct,HEALBOT_OPTION_HEALTHDROPPCT,50,500,10,5,"5%","50%")
        HealBot_Options_HealthDropPct:SetValue(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROPPCT"] or 350)
        HealBot_Options_SetText(HealBot_Options_HealthDropPct, HEALBOT_OPTION_HEALTHDROPPCT..floor(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROPPCT"]/10).."%")
        HealBot_Options_sliderlabels_Init(HealBot_Options_HealthDropSpeed,HEALBOT_OPTION_HEALTHDROPSPEED,5,75,5,2,HEALBOT_OPTIONS_WORD_SLOWER,HEALBOT_OPTIONS_WORD_FASTER)
        HealBot_Options_HealthDropSpeed:SetValue(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HEALTHDROPSPEED"] or 40)
        HealBot_Options_SetText(HealBot_Options_HealthDropSpeed, HEALBOT_OPTION_HEALTHDROPSPEED)
        HealBot_Options_sliderlabels_Init(HealBot_Options_AuxBarFlashFreq,HEALBOT_OPTIONS_AGGROFLASHFREQ,2,20,1,2,HEALBOT_OPTIONS_WORD_SLOWER,HEALBOT_OPTIONS_WORD_FASTER)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_AuxBarFlashAlphaMax,HEALBOT_OPTIONS_MAXALPHA,0.2,1,0.05,2)
        HealBot_Options_AuxBarFlashAlphaMax:SetValue(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMAX"])
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_AuxBarFlashAlphaMax)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_AuxBarFlashAlphaMin,HEALBOT_OPTIONS_MINALPHA,0,0.8,0.05,2)
        HealBot_Options_AuxBarFlashAlphaMin:SetValue(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OMIN"])
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_AuxBarFlashAlphaMin)
        HealBot_Options_sliderlabels_Init(HealBot_Options_HotBarDimming,HEALBOT_OPTION_NONHOTBARSDIMMING,12,44,1,4,HEALBOT_WORD_LOW,HEALBOT_WORD_HIGH)
        HealBot_Options_HotBarDimming:SetValue((Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HBDIMMING"] or 2.2)*10)
        HealBot_Options_SetText(HealBot_Options_HotBarDimming, HEALBOT_OPTION_NONHOTBARSDIMMING) 
        HealBot_Options_sliderlabels_Init(HealBot_Options_FocusGroupDimming,HEALBOT_OPTION_FOCUSGROUPDIMMING,12,44,1,4,HEALBOT_WORD_LOW,HEALBOT_WORD_HIGH)
        HealBot_Options_FocusGroupDimming:SetValue((Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["FGDIMMING"] or 2.8)*10)
        HealBot_Options_SetText(HealBot_Options_FocusGroupDimming,HEALBOT_OPTION_FOCUSGROUPDIMMING) 
        HealBot_Options_AuxBarFlashFreq:SetValue(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["OFREQ"]*100)
        HealBot_Options_SetText(HealBot_Options_AuxBarFlashFreq,HEALBOT_OPTIONS_AGGROFLASHFREQ)
        HealBot_Options_sliderlabels_Init(HealBot_Options_BorderHazardFreq,HEALBOT_OPTIONS_AGGROFLASHFREQ,10,90,5,2,HEALBOT_OPTIONS_WORD_SLOWER,HEALBOT_OPTIONS_WORD_FASTER)
        HealBot_Options_BorderHazardFreq:SetValue((1-(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HAZARDFREQ"] or 0.3))*100)
        HealBot_Options_SetText(HealBot_Options_BorderHazardFreq, HEALBOT_OPTIONS_AGGROFLASHFREQ) 
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_BorderHazardMinAlpha,HEALBOT_OPTIONS_MINALPHA,0,0.75,0.05,2)
        HealBot_Options_BorderHazardMinAlpha:SetValue(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["HAZARDMINALPHA"] or 0.25)
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_BorderHazardMinAlpha)
        
        HealBot_Options_SetEFGroups()
        HealBot_Options_Override_EffectsUse_Toggle()
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsEnemyTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ShowEnemyIncSelf:SetChecked(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCSELF"])
        HealBot_Options_SetText(HealBot_Options_ShowEnemyIncSelf,HEALBOT_ENEMY_INCLUDE_SELF)
        HealBot_Options_ShowEnemyIncTanks:SetChecked(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCTANKS"])
        HealBot_Options_SetText(HealBot_Options_ShowEnemyIncTanks,HEALBOT_ENEMY_INCLUDE_TANKS)
        HealBot_Options_ShowEnemyIncFocus:SetChecked(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCFOCUS"])
        HealBot_Options_SetText(HealBot_Options_ShowEnemyIncFocus,HEALBOT_ENEMY_INCLUDE_FOCUS)
        HealBot_Options_ShowEnemyIncArena:SetChecked(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCARENA"])
        HealBot_Options_SetText(HealBot_Options_ShowEnemyIncArena,HEALBOT_ENEMY_INCLUDE_ARENA)
        HealBot_Options_ShowEnemyIncArenaPets:SetChecked(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCARENAPETS"])
        HealBot_Options_SetText(HealBot_Options_ShowEnemyIncArenaPets,HEALBOT_ENEMY_INCLUDE_ARENAPETS)
        HealBot_Options_ShowEnemyIncMyTargets:SetChecked(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCMYTAR"])
        HealBot_Options_SetText(HealBot_Options_ShowEnemyIncMyTargets,HEALBOT_ENEMY_INCLUDE_MYTARGETS)
        HealBot_Options_val_OnLoad(HealBot_Options_ShowEnemyNumBoss,HEALBOT_ENEMY_NUMBER_BOSSES,0,8,1,1)
        HealBot_Options_ShowEnemyNumBoss:SetValue(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["NUMBOSS"])
        HealBot_Options_SetText(HealBot_Options_ShowEnemyNumBoss,HEALBOT_ENEMY_NUMBER_BOSSES..": "..Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["NUMBOSS"])
        HealBot_Options_val_OnLoad(HealBot_Options_EnemyTargetSize,HEALBOT_ENEMY_TARGET_SIZE,20,80,1,5)
        HealBot_Options_EnemyTargetSize:SetValue(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["ENEMYTARGETSIZE"])
        HealBot_Options_SetText(HealBot_Options_EnemyTargetSize,HEALBOT_ENEMY_TARGET_SIZE..": "..Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["ENEMYTARGETSIZE"])
        HealBot_Options_ShowEnemyTargets:SetChecked(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["ENEMYTARGET"])
        HealBot_Options_SetText(HealBot_Options_ShowEnemyTargets,HEALBOT_ENEMY_SHOW_TARGET)
        HealBot_Options_DoubleEnemyBarWidth:SetChecked(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["DOUBLEWIDTH"])
        HealBot_Options_SetText(HealBot_Options_DoubleEnemyBarWidth,HEALBOT_ENEMY_DOUBLE_WIDTH)
        HealBot_Options_EnemyExistsBosses:SetChecked(Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["EXISTSHOWBOSS"])
        HealBot_Options_SetText(HealBot_Options_EnemyExistsBosses,HEALBOT_ENEMY_EXISTS_SHOW)
        HealBot_Options_EnemyCombatSelf.initialize = HealBot_Options_EnemyCombatSelf_DropDown
        UIDropDownMenu_SetText(HealBot_Options_EnemyCombatSelf, HealBot_Options_EnemyCombat_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCOMBATSHOWSELF"]])
        HealBot_Options_EnemyCombatFocus.initialize = HealBot_Options_EnemyCombatFocus_DropDown
        UIDropDownMenu_SetText(HealBot_Options_EnemyCombatFocus, HealBot_Options_EnemyCombat_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCOMBATSHOWFOCUS"]])
        HealBot_Options_EnemyCombatTanks.initialize = HealBot_Options_EnemyCombatTanks_DropDown
        UIDropDownMenu_SetText(HealBot_Options_EnemyCombatTanks, HealBot_Options_EnemyCombat_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCOMBATSHOWTANK"]])
        HealBot_Options_EnemyCombatMyTargets.initialize = HealBot_Options_EnemyCombatMyTargets_DropDown
        UIDropDownMenu_SetText(HealBot_Options_EnemyCombatMyTargets, HealBot_Options_EnemyCombat_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCOMBATSHOWLIST"]])
        HealBot_Options_EnemyCombatArena.initialize = HealBot_Options_EnemyCombatArena_DropDown
        UIDropDownMenu_SetText(HealBot_Options_EnemyCombatArena, HealBot_Options_EnemyCombat_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["INCOMBATSHOWARENA"]])
        HealBot_Options_EnemyExistsPlayerTargets.initialize = HealBot_Options_EnemyExistsPlayerTargets_DropDown
        UIDropDownMenu_SetText(HealBot_Options_EnemyExistsPlayerTargets, HealBot_Options_EnemyOOC_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["EXISTSHOWPTAR"]])
        HealBot_Options_EnemyExistsFocus.initialize = HealBot_Options_EnemyExistsFocus_DropDown
        UIDropDownMenu_SetText(HealBot_Options_EnemyExistsFocus, HealBot_Options_EnemyOOC_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["EXISTSHOWFOCUS"]])
        HealBot_Options_EnemyExistsTankTargets.initialize = HealBot_Options_EnemyExistsTankTargets_DropDown
        UIDropDownMenu_SetText(HealBot_Options_EnemyExistsTankTargets, HealBot_Options_EnemyOOC_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["EXISTSHOWTANK"]])
        HealBot_Options_EnemyExistsMyTargets.initialize = HealBot_Options_EnemyExistsMyTargets_DropDown
        UIDropDownMenu_SetText(HealBot_Options_EnemyExistsMyTargets, HealBot_Options_EnemyOOC_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["EXISTSHOWMYTAR"]])
        HealBot_Options_EnemyExistsArena.initialize = HealBot_Options_EnemyExistsArena_DropDown
        UIDropDownMenu_SetText(HealBot_Options_EnemyExistsArena, HealBot_Options_EnemyOOC_List[Healbot_Config_Skins.Enemy[Healbot_Config_Skins.Current_Skin]["EXISTSHOWARENA"]])
        HealBot_Options_SetLabel("HealBot_EnemyOOC_FontStr",HEALBOT_OPTIONS_OUTOFCOMBAT)
        HealBot_Options_SetLabel("HealBot_EnemyCombat_FontStr",HEALBOT_OPTIONS_ENTERINGCOMBAT)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsChatTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_CastNotify_OnClick(nil,Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["NOTIFY"])
        HealBot_Options_NotifyOtherMsg:SetText(Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["MSG"])   
        HealBot_Options_CastNotifyResOnly:SetChecked(Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["RESONLY"])
        HealBot_Options_SetText(HealBot_Options_CastNotifyResOnly,HEALBOT_OPTIONS_CASTNOTIFYRESONLY)
        HealBot_Options_SetText(HealBot_Options_CastNotify1,HEALBOT_OPTIONS_CASTNOTIFY1)
        HealBot_Options_SetText(HealBot_Options_CastNotify2,HEALBOT_OPTIONS_CASTNOTIFY2)
        HealBot_Options_SetText(HealBot_Options_CastNotify3,HEALBOT_OPTIONS_CASTNOTIFY3)
        HealBot_Options_SetText(HealBot_Options_CastNotify4,HEALBOT_OPTIONS_CASTNOTIFY4)
        HealBot_Options_SetText(HealBot_Options_CastNotify5,HEALBOT_OPTIONS_CASTNOTIFY5)
        HealBot_Options_SetText(HealBot_Options_CastNotify6,HEALBOT_OPTIONS_CASTNOTIFY6)
        HealBot_Options_SetLabel("HealBot_Options_NotifyOtherMsgTxt",HEALBOT_OPTIONS_NOTIFY_MSG.."  ("..HEALBOT_OPTIONS_CASTNOTIFYTAGS..")")
        g=_G["HealBot_HealButtons_ChatFrameTxt"]
        g:SetText(HEALBOT_OPTIONS_HEAL_CHATOPT)
        g:SetTextColor(1,1,1,1)
        HealBot_Options_AfterCombatOOM:SetChecked(Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["EOCOOM"])
        HealBot_Options_SetText(HealBot_Options_AfterCombatOOM,HEALBOT_OPTIONS_EOC_OOM)
        HealBot_Options_val_OnLoad(HealBot_Options_AfterCombatOOMValue,HEALBOT_OPTIONS_EOC_OOM_VALUE,1,50,1,5)
        HealBot_Options_AfterCombatOOMValue:SetValue(Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["EOCOOMV"] or 20)
        HealBot_Options_SetText(HealBot_Options_AfterCombatOOMValue,HEALBOT_OPTIONS_EOC_OOM_VALUE..": "..Healbot_Config_Skins.Chat[Healbot_Config_Skins.Current_Skin]["EOCOOMV"].."%")
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesGeneralTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ActionAnchor.initialize = HealBot_Options_ActionAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_ActionAnchor, HealBot_Options_ActionAnchor_List[Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FRAME"]])
        HealBot_Options_ActionBarsAnchor.initialize = HealBot_Options_ActionBarsAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_ActionBarsAnchor, HealBot_Options_ActionAnchor_List[Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BARS"]])
        HealBot_Options_TooltipPos.initialize = HealBot_Options_TooltipPos_DropDown
        UIDropDownMenu_SetText(HealBot_Options_TooltipPos, HealBot_Options_Lists["TooltipPos"][Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TIPLOC"]])
        HealBot_Options_SetLabel("healbotframelockedfontstr",HEALBOT_OPTIONS_ACTIONLOCKED)
        HealBot_Options_SetLabel("HealBot_Options_FrameAliasFixedFrame",HealBot_Options_HealGroupsFrame_List[HealBot_Options_luVars["FramesSelFrame"]])
        HealBot_Options_SetLabel("healbotframeautoshowfontstr",HEALBOT_OPTIONS_AUTOSHOW)
        HealBot_Options_SetLabel("healbotframeanchorfontstr",HEALBOT_OPTIONS_ANCHOR)
        HealBot_Options_SetLabel("healbotbarsanchorfontstr",HEALBOT_OPTIONS_BARSANCHOR)
        HealBot_Options_SetLabel("healbotbarsgrowdirectionfontstr",HEALBOT_OPTIONS_GROW_DIRECTION)
        HealBot_Options_SetLabel("healbotbarsorientationfontstr",HEALBOT_OPTIONS_BARSORIENTATION)
        HealBot_Options_val2_OnLoad(HealBot_FrameScale,HEALBOT_OPTIONS_FRAMESCALE,2.5,40,0.5,10,5)
        HealBot_FrameScale:SetValue((Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCALE"])*10)
        HealBot_Options_SetText(HealBot_FrameScale,HEALBOT_OPTIONS_FRAMESCALE..": "..Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCALE"])
        HealBot_Options_val_OnLoad(HealBot_FrameStickyOffsetHorizontal,HEALBOT_OPTIONS_STICKFRAMEOFFSETH,-150,150,1,10)
        HealBot_FrameStickyOffsetHorizontal:SetValue(Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFOFFSETH"])
        HealBot_Options_SetText(HealBot_FrameStickyOffsetHorizontal,HEALBOT_OPTIONS_STICKFRAMEOFFSETH..": "..Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFOFFSETH"])
        HealBot_Options_val_OnLoad(HealBot_FrameStickyOffsetVertical,HEALBOT_OPTIONS_STICKFRAMEOFFSETV,-100,100,1,10)
        HealBot_FrameStickyOffsetVertical:SetValue(Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFOFFSETV"])
        HealBot_Options_SetText(HealBot_FrameStickyOffsetVertical,HEALBOT_OPTIONS_STICKFRAMEOFFSETV..": "..Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFOFFSETV"])
        HealBot_Options_SetFrameCols()
        HealBot_Options_ActionLocked.initialize = HealBot_Options_ActionLocked_DropDown
        UIDropDownMenu_SetText(HealBot_Options_ActionLocked, HealBot_Options_ActionLocked_List[Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["LOCKED"]])
        HealBot_Options_AutoShow.initialize = HealBot_Options_AutoShow_DropDown
        UIDropDownMenu_SetText(HealBot_Options_AutoShow, HealBot_Options_Lists["AutoShow"][Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AUTOCLOSE"]])
        HealBot_Options_SetText(HealBot_Options_FrameAlias,HEALBOT_OPTIONS_FRAME_ALIAS)
        HealBot_Options_val_OnLoad(HealBot_Options_FramePadding,HEALBOT_OPTION_FRAMEPADDING,0,10,1,2)
        HealBot_Options_FramePadding:SetValue(Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PADDING"])
        HealBot_Options_SetText(HealBot_Options_FramePadding,HEALBOT_OPTION_FRAMEPADDING..": "..Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PADDING"])
        
        if HealBot_Options_luVars["FramesSelFrame"]<6 then
            local aliasText=HEALBOT_OPTIONS_FRAME.." "..HealBot_Options_luVars["FramesSelFrame"]
            if Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALIAS"] and
               string.len(Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALIAS"])>0 then
                aliasText=Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALIAS"]
            end
            if HealBot_Options_FrameAlias:GetText()~=aliasText then
                HealBot_Options_FrameAlias:SetText(aliasText)
            end
        end
        HealBot_Options_BarsGrowDirection.initialize = HealBot_Options_BarsGrowDirection_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarsGrowDirection, HealBot_Options_BarsGrowDirection_List[Healbot_Config_Skins.Anchors[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GROW"]])
        HealBot_Options_BarsOrientation.initialize = HealBot_Options_BarsOrientation_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarsOrientation, HealBot_Options_BarsOrientation_List[Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFIX"]])
        HealBot_Options_ActionAnchor_SetAlpha(HealBot_Options_luVars["FramesSelFrame"])
        HealBot_Options_SetLabel("HealBot_Options_TooltipPosTxt",HEALBOT_OPTIONS_POSTOOLTIP)
        HealBot_Options_SetLabel("healbotbacktextfontstr",HEALBOT_SKIN_BACKTEXT)
        HealBot_Options_SetLabel("healbotbordertextfontstr",HEALBOT_SKIN_BORDERTEXT)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesHealGroupsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_FrameAliasList()
        for id=1,11 do
            g=_G["HealBot_Options_HealGroups"..id]
            g:SetChecked(Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][id]["STATE"])
            HealBot_Options_SetLabel("HealBot_Options_HealGroups"..id.."Text",HealBot_HealGroupsTrans[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][id]["NAME"]])
        end
        HealBot_Options_HealGroups1Frame.initialize = HealBot_Options_HealGroups1Frame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealGroups1Frame, HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][1]["FRAME"]])
        HealBot_Options_HealGroups2Frame.initialize = HealBot_Options_HealGroups2Frame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealGroups2Frame, HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][2]["FRAME"]])
        HealBot_Options_HealGroups3Frame.initialize = HealBot_Options_HealGroups3Frame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealGroups3Frame, HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][3]["FRAME"]])
        HealBot_Options_HealGroups4Frame.initialize = HealBot_Options_HealGroups4Frame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealGroups4Frame, HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][4]["FRAME"]])
        HealBot_Options_HealGroups5Frame.initialize = HealBot_Options_HealGroups5Frame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealGroups5Frame, HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][5]["FRAME"]])
        HealBot_Options_SetLabel("HealBot_HealButtonsGroups1_Text",HEALBOT_OPTIONS_GROUPHEALS)
        HealBot_Options_HealGroups6Frame.initialize = HealBot_Options_HealGroups6Frame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealGroups6Frame, HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][6]["FRAME"]])
        HealBot_Options_HealGroups7Frame.initialize = HealBot_Options_HealGroups7Frame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealGroups7Frame, HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][7]["FRAME"]])
        HealBot_Options_HealGroups8Frame.initialize = HealBot_Options_HealGroups8Frame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealGroups8Frame, HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][8]["FRAME"]])
        HealBot_Options_HealGroups9Frame.initialize = HealBot_Options_HealGroups9Frame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealGroups9Frame, HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][9]["FRAME"]])
        HealBot_Options_HealGroups10Frame.initialize = HealBot_Options_HealGroups10Frame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealGroups10Frame, HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][10]["FRAME"]])
        HealBot_Options_HealGroups11Frame.initialize = HealBot_Options_HealGroups11Frame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealGroups11Frame, HealBot_Options_HealGroupsFrame_List[Healbot_Config_Skins.HealGroups[Healbot_Config_Skins.Current_Skin][11]["FRAME"]])
        HealBot_Options_SetLabel("HealBot_HealButtonsFrames1_Text",HEALBOT_OPTIONS_FRAME)
        HealBot_Options_HealGroupsAllowDups:SetChecked(Healbot_Config_Skins.DuplicateBars[Healbot_Config_Skins.Current_Skin])
        HealBot_Options_SetText(HealBot_Options_HealGroupsAllowDups,HEALBOT_ALLOW_DUPLICATES)
        if HEALBOT_GAME_VERSION<3 then 
            HealBot_Options_HealGroups7:Hide()
            HealBot_Options_HealGroups7Frame:Hide()
            HealBot_Options_HealGroups8:ClearAllPoints()
            HealBot_Options_HealGroups8:SetPoint("TOPLEFT",HealBot_Options_HealGroups6,"TOPLEFT",0,-40)
            if HEALBOT_GAME_VERSION<2 then 
                HealBot_Options_HealGroups10:Hide()
                HealBot_Options_HealGroups10Frame:Hide()
                HealBot_Options_HealGroups11:ClearAllPoints()
                HealBot_Options_HealGroups11:SetPoint("TOPLEFT",HealBot_Options_HealGroups9,"TOPLEFT",0,-40)
            end
        end
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesHeadersBarsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ShowHeaders:SetChecked(Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"])
        HealBot_Options_SetText(HealBot_Options_ShowHeaders,HEALBOT_OPTIONS_SHOWHEADERS)
        g=_G["HealBot_HeadBarColorpickt"]
        g:SetText(HEALBOT_SKIN_HEADERBARCOL)
        g=_G["HealBot_HeadTextColorpickt"]
        g:SetText(HEALBOT_SKIN_HEADERTEXTCOL)
        HealBot_Options_UpdateMediaTexture(HealBot_Options_HeadTextureS,texturesIndex[Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]],true)
        HealBot_Options_val_OnLoad(HealBot_Options_HeadHightS,HEALBOT_OPTIONS_SKINHEIGHT,5,80,1,5)
        HealBot_Options_HeadHightS:SetValue(Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"])
        HealBot_Options_SetText(HealBot_Options_HeadHightS, HEALBOT_OPTIONS_SKINHEIGHT..": "..Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_HeadWidthS,HEALBOT_OPTIONS_SKINWIDTH,0.25,1,0.01,5)
        HealBot_Options_HeadWidthS:SetValue(Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"])
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_HeadWidthS)
        HealBot_Options_UpdateMediaFont(HealBot_Options_HeadFontNameS,fontsIndex[Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]])
        HealBot_Options_val_OnLoad(HealBot_Options_HeadFontHeightS,HEALBOT_OPTIONS_SKINFHEIGHT,4,28,1,2)
        HealBot_Options_HeadFontHeightS:SetValue(Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"])
        HealBot_Options_SetText(HealBot_Options_HeadFontHeightS, HEALBOT_OPTIONS_SKINFHEIGHT..": "..Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"])
        HealBot_Options_HeadFontOutline.initialize = HealBot_Options_HeadFontOutline_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HeadFontOutline, HealBot_Options_FontOutline_List[Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]])
        HealBot_Options_val_OnLoad(HealBot_Options_HeadFontOffset,HEALBOT_OPTIONS_FONT_OFFSET,-10,25,1,5)
        HealBot_Options_HeadFontOffset:SetValue(Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
        HealBot_Options_SetText(HealBot_Options_HeadFontOffset, HEALBOT_OPTIONS_FONT_OFFSET..": "..Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
        HealBot_Options_SetLabel("healbotskinfontoutlinefontstr",HEALBOT_OPTIONS_SKINFOUTLINE)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesHeadersFramesTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_SetText(HealBot_Options_FrameTitle,HEALBOT_OPTIONS_FRAME_TITLE)
        HealBot_Options_FrameTitle:SetText(Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NAME"])
        HealBot_Options_SetText(HealBot_Options_FrameAliasShow,HEALBOT_OPTIONS_FRAME_TITLE_SHOW)
        HealBot_Options_FrameAliasShow:SetChecked(Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"])
        HealBot_Options_UpdateMediaTexture(HealBot_Options_SkinFrameAliasTextureS,texturesIndex[Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]],true)
        HealBot_Options_val_OnLoad(HealBot_Options_SkinFrameAliasHeightS,HEALBOT_OPTIONS_SKINHEIGHT,5,80,1,5)
        HealBot_Options_SkinFrameAliasHeightS:SetValue(Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"])
        HealBot_Options_SetText(HealBot_Options_SkinFrameAliasHeightS, HEALBOT_OPTIONS_SKINHEIGHT..": "..Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"])
        HealBot_Options_val_OnLoad(HealBot_Options_SkinFrameAliasOffset,HEALBOT_OPTIONS_TXTOFFSET,-10,10,1,2)
        HealBot_Options_SkinFrameAliasOffset:SetValue(Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
        HealBot_Options_SetText(HealBot_Options_SkinFrameAliasOffset, HEALBOT_OPTIONS_TXTOFFSET..": "..Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_SkinFrameAliasWidthS,HEALBOT_OPTIONS_SKINWIDTH,0.25,1,0.01,5)
        HealBot_Options_SkinFrameAliasWidthS:SetValue(Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"])
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_SkinFrameAliasWidthS)
        HealBot_Options_UpdateMediaFont(HealBot_Options_AliasFontName,fontsIndex[Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]])
        HealBot_Options_val_OnLoad(HealBot_Options_AliasFontHeight,HEALBOT_OPTIONS_SKINFHEIGHT,4,28,1,2)
        HealBot_Options_AliasFontHeight:SetValue(Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIZE"])
        HealBot_Options_SetText(HealBot_Options_AliasFontHeight, HEALBOT_OPTIONS_SKINFHEIGHT..": "..Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIZE"])
        HealBot_Options_AliasFontOutline.initialize = HealBot_Options_AliasFontOutline_DropDown
        UIDropDownMenu_SetText(HealBot_Options_AliasFontOutline, HealBot_Options_FontOutline_List[Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]])
        HealBot_Options_val_OnLoad(HealBot_Options_AliasFontOffset,HEALBOT_OPTIONS_FONT_OFFSET,-10,25,1,5)
        HealBot_Options_AliasFontOffset:SetValue(Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
        HealBot_Options_SetText(HealBot_Options_AliasFontOffset, HEALBOT_OPTIONS_FONT_OFFSET..": "..Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
        HealBot_Options_SetText(HealBot_Options_FrameTitle,HEALBOT_OPTIONS_FRAME_TITLE)
        HealBot_Options_SetText(HealBot_Options_FrameAlias,HEALBOT_OPTIONS_FRAME_ALIAS)
        HealBot_Options_SetText(HealBot_Options_FrameAliasShow,HEALBOT_OPTIONS_FRAME_TITLE_SHOW)
        HealBot_Options_SetLabel("healbotaliasfontoutlinestr",HEALBOT_OPTIONS_SKINFOUTLINE)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesBarsGeneralTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_UpdateMediaTexture(HealBot_Options_BarTextureS,texturesIndex[Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]],true)
        HealBot_Options_val_OnLoad(HealBot_Options_BarNumColsS,HEALBOT_OPTIONS_SKINBRSPACE,1,10,1,2)
        HealBot_Options_BarNumColsS:SetValue(Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"] or 2)
        HealBot_Options_SetText(HealBot_Options_BarNumColsS,HealBot_Options_SetNoColsText() .. ": " .. Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMCOLS"])
        HealBot_Options_BarNumGroupPerCol:SetChecked(Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GRPCOLS"])
        HealBot_Options_SetText(HealBot_Options_BarNumGroupPerCol,HEALBOT_OPTIONS_GROUPSPERCOLUMN)
        HealBot_Options_val_OnLoad(HealBot_Options_BarHeightS,HEALBOT_OPTIONS_SKINHEIGHT,10,180,1,10)
        HealBot_Options_BarHeightS:SetValue(Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"])
        HealBot_Options_SetText(HealBot_Options_BarHeightS,HEALBOT_OPTIONS_SKINHEIGHT..": "..Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"])
        HealBot_Options_val_OnLoad(HealBot_Options_BarWidthS,HEALBOT_OPTIONS_SKINWIDTH,20,320,1,10)
        HealBot_Options_BarWidthS:SetValue(Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"])
        HealBot_Options_SetText(HealBot_Options_BarWidthS,HEALBOT_OPTIONS_SKINWIDTH..": "..Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"])
        HealBot_Options_val_OnLoad(HealBot_Options_BarBRSpaceS,HEALBOT_OPTIONS_SKINBRSPACE,0,100,1,10)
        HealBot_Options_BarBRSpaceS:SetValue(Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RMARGIN"])
        HealBot_Options_SetText(HealBot_Options_BarBRSpaceS,HEALBOT_OPTIONS_SKINBRSPACE..": "..Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RMARGIN"])
        HealBot_Options_val_OnLoad(HealBot_Options_BarBCSpaceS,HEALBOT_OPTIONS_SKINBCSPACE,0,150,1,10)
        HealBot_Options_BarBCSpaceS:SetValue(Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CMARGIN"])
        HealBot_Options_SetText(HealBot_Options_BarBCSpaceS,HEALBOT_OPTIONS_SKINBCSPACE..": "..Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CMARGIN"])
        HealBot_Options_SetLabel("healbotframeglowfontstr",HEALBOT_OPTIONS_FRAMEGLOWSIZE)
        HealBot_Options_GlowFrame.initialize = HealBot_Options_GlowFrame_DropDown
        UIDropDownMenu_SetText(HealBot_Options_GlowFrame, HealBot_Options_Lists["GlowFrame"][Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["GLOW"]])
        HealBot_Options_TabRunOnce[tab]=true
    end
end

HealBot_Options_luVars["OnLoadBarsColours"]=true
function HealBot_Options_SkinsFramesBarsColourTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_BarHealthColour.initialize = HealBot_Options_BarHealthColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthColour, HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"]])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_BarAlpha,HEALBOT_OPTIONS_BARALPHA,0.75,1,0.01,5)
        HealBot_Options_BarAlpha:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HA"] or 95);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_BarAlpha)
        HealBot_Options_BarHealthBackColour.initialize = HealBot_Options_BarHealthBackColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthBackColour, HealBot_Options_Lists["BarBack"][Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BACK"]])
        HealBot_Options_SetLabel("HealBot_Options_BarHealthBackColourt",HEALBOT_SKIN_HEALTHBACKCOL_TEXT)
        HealBot_Options_val_OnLoad(HealBot_Options_BarOutlineBackGround,HEALBOT_OPTIONS_OUTLINE,0,10,1,2)
        HealBot_Options_BarOutlineBackGround:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BOUT"]);
        HealBot_Options_SetText(HealBot_Options_BarOutlineBackGround,HEALBOT_OPTIONS_OUTLINE..": "..Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BOUT"])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_BarAlphaBackGround,HEALBOT_OPTIONS_TTALPHA,0,1,0.01,5)
        HealBot_Options_BarAlphaBackGround:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_BarAlphaBackGround)
        HealBot_Options_BarBorderColour.initialize = HealBot_Options_BarBorderColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarBorderColour, HealBot_Options_Lists["BarBackBorder"][Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORDER"]])
        HealBot_Options_SetLabel("HealBot_Options_BarBorderColourt",HEALBOT_SKIN_BACKBORDERCOL_TEXT)
        HealBot_Options_val_OnLoad(HealBot_Options_BarSizeBorder,HEALBOT_OPTIONS_TXTSIZE,1,8,1,1)
        HealBot_Options_BarSizeBorder:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORSIZE"]);
        HealBot_Options_SetText(HealBot_Options_BarSizeBorder,HEALBOT_OPTIONS_TXTSIZE..": "..Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORSIZE"])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_BarAlphaBorder,HEALBOT_OPTIONS_TTALPHA,0,1,0.01,5)
        HealBot_Options_BarAlphaBorder:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BORA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_BarAlphaBorder)
        HealBot_Options_BarIncHealColour.initialize = HealBot_Options_BarIncHealColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarIncHealColour, HealBot_Options_BarIncHealColour_List[Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IC"]])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_BarAlphaInHeal,HEALBOT_OPTIONS_TTALPHA,0.20,0.80,0.01,5)
        HealBot_Options_BarAlphaInHeal:SetValue(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_BarAlphaInHeal)
        HealBot_Options_AbsorbColour.initialize = HealBot_Options_AbsorbColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_AbsorbColour, HealBot_Options_AbsorbColour_List[Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AC"]])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_BarAlphaAbsorb,HEALBOT_OPTIONS_TTALPHA,0.20,0.80,0.01,5)
        HealBot_Options_BarAlphaAbsorb:SetValue(Healbot_Config_Skins.BarIACol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AA"] or 50);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_BarAlphaAbsorb)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_BarAlphaEor,HEALBOT_OPTIONS_BARALPHAEOR,0,0.75,0.01,5)
        HealBot_Options_BarAlphaEor:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ORA"])
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_BarAlphaEor)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_BarAlphaDis,HEALBOT_OPTIONS_BARALPHADIS,0,0.75,0.01,5)
        HealBot_Options_BarAlphaDis:SetValue(Healbot_Config_Skins.BarCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DISA"])
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_BarAlphaDis)
        HealBot_Options_SetLabel("HealBot_BarHealthColourt",HEALBOT_SKIN_HEALTHBARCOL_TEXT)
        HealBot_Options_SetLabel("HealBot_AbsorbColourt",HEALBOT_SKIN_ABSORBCOL_TEXT)
        HealBot_Options_SetLabel("HealBot_BarIncHealColourt",HEALBOT_SKIN_INCHEALBARCOL_TEXT)
        HealBot_Options_TabRunOnce[tab]=true
    end
    if HealBot_Options_luVars["OnLoadBarsColours"] then
        HealBot_BarCustomHealthColourCritical:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomHealthColourInjured:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomHealthColourHealthy:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomHealthBackColourCritical:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomHealthBackColourInjured:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomHealthBackColourHealthy:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomBorderColourCritical:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomBorderColourInjured:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomBorderColourHealthy:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomIHColourCritical:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomIHColourInjured:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomIHColourHealthy:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomAbsorbColourCritical:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomAbsorbColourInjured:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_BarCustomAbsorbColourHealthy:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_Options_TabRunOnce[tab.."OnLoadBarsColours"]=false
    end
end

function HealBot_Options_SkinsFramesBarsSortTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ExtraSort.initialize = HealBot_Options_ExtraSort_DropDown
        UIDropDownMenu_SetText(HealBot_Options_ExtraSort, HealBot_Options_Sort_List[Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RAIDORDER"]])
        HealBot_Options_SortOutOfRangeLast:SetChecked(Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORLAST"])
        HealBot_Options_SetText(HealBot_Options_SortOutOfRangeLast,HEALBOT_OPTIONS_SORTOORLAST)
        HealBot_Options_ExtraSubSort.initialize = HealBot_Options_ExtraSubSort_DropDown
        UIDropDownMenu_SetText(HealBot_Options_ExtraSubSort, HealBot_Options_Sort_List[Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUBORDER"]])
        HealBot_Options_ExtraSubSort_SetAlpha()
        HealBot_Options_SubSortPlayerFirst:SetChecked(Healbot_Config_Skins.BarSort[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUBPF"])
        HealBot_Options_SetText(HealBot_Options_SubSortPlayerFirst,HEALBOT_OPTIONS_SUBSORTSELFFIRST)
        HealBot_Options_SelfPet:SetChecked(Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["SELFPET"])
        HealBot_Options_SetText(HealBot_Options_SelfPet,HEALBOT_OPTIONS_OWN_PET_WITH_SELF)
        HealBot_Options_GroupPetsByFive:SetChecked(Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["GROUPPETS"])
        HealBot_Options_SetText(HealBot_Options_GroupPetsByFive,HEALBOT_OPTIONS_GROUP_PETS_BY_FIVE)
        g=_G["HealBot_SortButtons_Text"]
        if HealBot_Options_luVars["FramesSelFrame"]<6 then
            g:SetText(HEALBOT_OPTIONS_PLAYERSORT)
        elseif HealBot_Options_luVars["FramesSelFrame"]==6 then
            g:SetText(HEALBOT_OPTIONS_VEHICLESORT)
        elseif HealBot_Options_luVars["FramesSelFrame"]==7 then
            g:SetText(HEALBOT_OPTIONS_PETSORT)
        elseif HealBot_Options_luVars["FramesSelFrame"]==10 then
            g:SetText(HEALBOT_OPTIONS_ENEMYSORT)
        end
        g:SetTextColor(1,1,1,1)
        HealBot_Options_SetLabel("healbotmainsortfontstr",HEALBOT_OPTIONS_MAINSORT)
        HealBot_Options_SetLabel("healbotsubsortfontstr",HEALBOT_OPTIONS_SUBSORT)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

HealBot_Options_luVars["OnLoadBarsVisibility"]=true
function HealBot_Options_SkinsFramesBarsVisibilityTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_FocusInCombat.initialize = HealBot_Options_FocusInCombat_DropDown
        HealBot_Options_TargetInCombat.initialize = HealBot_Options_TargetInCombat_DropDown
        UIDropDownMenu_SetText(HealBot_Options_TargetInCombat,HealBot_Options_TargetFocusInCombat_List[Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["TARGETINCOMBAT"]]) 
        UIDropDownMenu_SetText(HealBot_Options_FocusInCombat,HealBot_Options_TargetFocusInCombat_List[Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["FOCUSINCOMBAT"]]) 
        HealBot_Options_Pct_OnLoad(HealBot_Options_AlertLevelIC,HEALBOT_OPTIONS_INCOMBATALERTLEVEL)
        HealBot_Options_AlertLevelIC:SetValue(Healbot_Config_Skins.BarVisibility[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTIC"])
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_AlertLevelIC)
        HealBot_Options_Pct_OnLoad(HealBot_Options_AlertLevelOC,HEALBOT_OPTIONS_OUTCOMBATALERTLEVEL)
        HealBot_Options_AlertLevelOC:SetValue(Healbot_Config_Skins.BarVisibility[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTOC"])
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_AlertLevelOC)
        HealBot_Options_HideBars:SetChecked(Healbot_Config_Skins.BarVisibility[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HIDEOOR"])
        HealBot_Options_SetText(HealBot_Options_HideBars,HEALBOT_HIDE_BARS)            
        HealBot_Options_TargetOnlyFriend:SetChecked(Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["TONLYFRIEND"])
        HealBot_Options_SetText(HealBot_Options_TargetOnlyFriend,HEALBOT_OPTIONS_SHOW_ONLY_FRIEND)
        HealBot_Options_VehicleInCombat:SetChecked(Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["VEHICLEINCOMBAT"])
        HealBot_Options_SetText(HealBot_Options_VehicleInCombat,HEALBOT_OPTIONS_ALWAYSINCOMBAT.." "..HEALBOT_VEHICLE.." "..HEALBOT_OPTIONS_ENTERINGCOMBAT)
        HealBot_Options_PrivListPetsInCombat:SetChecked(Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["PRIVLISTPETSINCOMBAT"])
        HealBot_Options_SetText(HealBot_Options_PrivListPetsInCombat,HEALBOT_OPTIONS_ALWAYSINCOMBAT.." "..HEALBOT_OPTIONS_MYTARGET.." "..HEALBOT_OPTIONS_PETHEALS.." "..HEALBOT_OPTIONS_ENTERINGCOMBAT)
        HealBot_Options_TargetExcludeRaid:SetChecked(Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["TEXRAID"])
        HealBot_Options_SetText(HealBot_Options_TargetExcludeRaid,HEALBOT_OPTIONS_EXCLUDE_RAID)
        HealBot_Options_FocusOnlyFriend:SetChecked(Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["FONLYFRIEND"])
        HealBot_Options_SetText(HealBot_Options_FocusOnlyFriend,HEALBOT_OPTIONS_SHOW_ONLY_FRIEND)
        HealBot_Options_FocusExcludeRaid:SetChecked(Healbot_Config_Skins.Healing[Healbot_Config_Skins.Current_Skin]["FEXRAID"])
        HealBot_Options_SetText(HealBot_Options_FocusExcludeRaid,HEALBOT_OPTIONS_EXCLUDE_RAID)
        g=_G["HealBot_HealButtons_Text"]
        if HealBot_Options_luVars["FramesSelFrame"]<8 then
            g:SetText(HEALBOT_OPTIONS_PLAYERVISIBILITY)
        elseif HealBot_Options_luVars["FramesSelFrame"]==8 then
            g:SetText(HEALBOT_OPTIONS_TARGETVISIBILITY)
        elseif HealBot_Options_luVars["FramesSelFrame"]==9 then
            g:SetText(HEALBOT_OPTIONS_FOCUSVISIBILITY)
        end
        g:SetTextColor(1,1,1,1)
        HealBot_Options_SetLabel("healbotfincombatfontstr",HEALBOT_OPTIONS_ENTERINGCOMBAT)
        HealBot_Options_SetLabel("healbotincombatfontstr",HEALBOT_OPTIONS_ENTERINGCOMBAT)
        HealBot_Options_SetLabel("HealBot_TargetOutOfCombat_Text",HEALBOT_OPTIONS_OUTOFCOMBAT)
        HealBot_Options_SetLabel("HealBot_FocusOutOfCombat_Text",HEALBOT_OPTIONS_OUTOFCOMBAT)
        HealBot_Options_TabRunOnce[tab]=true
    end
    if HealBot_Options_luVars["OnLoadBarsVisibility"] then
        if HEALBOT_GAME_VERSION<2 then
            HealBot_Options_FocusInCombat:Hide()
            HealBot_Options_FocusOnlyFriend:Hide()
            HealBot_Options_FocusExcludeRaid:Hide()
            HealBot_Options_TargetInCombat:ClearAllPoints()
            HealBot_Options_TargetInCombat:SetPoint("BOTTOM",0,120)
        end
        HealBot_Options_luVars["OnLoadBarsVisibility"]=false
    end
end

function HealBot_Options_SkinsFramesBarsAggroTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_AggroTrack:SetChecked(Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"])
        HealBot_Options_SetText(HealBot_Options_AggroTrack,HEALBOT_OPTION_AGGROTRACK)
        HealBot_Options_AggroHazard:SetChecked(Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HAZARD"])
        HealBot_Options_SetText(HealBot_Options_AggroHazard,HEALBOT_OPTION_AGGROHAZARD)
        HealBot_Options_AggroIndAlertLevel.initialize = HealBot_Options_AggroIndAlertLevel_DropDown
        UIDropDownMenu_SetText(HealBot_Options_AggroIndAlertLevel, HealBot_Options_Lists["AggroIndAlertLevel"][Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTIND"]])
        HealBot_Options_SetLabel("healbotaggroindalertfontstr",HEALBOT_OPTIONS_AGGROINDALERT)
        HealBot_Options_AggroAlertLevel.initialize = HealBot_Options_AggroAlertLevel_DropDown
        UIDropDownMenu_SetText(HealBot_Options_AggroAlertLevel, HealBot_Options_AggroAlertLevel_List[Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERT"]])
        HealBot_Options_AggroAdapAlertLevel.initialize = HealBot_Options_AggroAdapAlertLevel_DropDown
        local id=Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALERTADAP"]+1
        if id==4 then id=1 end
        UIDropDownMenu_SetText(HealBot_Options_AggroAdapAlertLevel, HealBot_Options_Lists["AggroAdaptiveLevel"][id])
        HealBot_Options_SetLabel("healbotaggroalertfontstr",HEALBOT_OPTIONS_AGGROALERT)
        HealBot_Options_SetLabel("healbotaggroadapalertfontstr",HEALBOT_OPTIONS_AGGROADAPALERT)
        HealBot_Options_AggroIndicatorsLink:SetText(HEALBOT_OPTIONS_TAB_AGGROINDICATORS)
        g=_G["HealBot_AggroBars_FontStr"]
        g:SetText(HEALBOT_OPTIONS_TAB_AGGRO)
        g:SetTextColor(1,1,1,1)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesBarsAuxSettingsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        g=_G["HealBot_AuxBarsAssignSettings_FontStr"]
        g:SetText(HEALBOT_OPTIONS_AUXSETTINGS)
        g:SetTextColor(1,1,1,1)
        g=_G["HealBot_AuxBarsAssignments_FontStr"]
        g:SetText(HEALBOT_OPTIONS_AUXASSIGN)
        g:SetTextColor(1,1,1,1)
        HealBot_Options_AuxOverlap.initialize = HealBot_Options_AuxOverlap_DropDown
        UIDropDownMenu_SetText(HealBot_Options_AuxOverlap,HealBot_Options_AuxOverlap_List[Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAP"]]) 
        HealBot_Options_SetLabel("HealBot_AuxOverlap_FontStr",HEALBOT_OPTIONS_AUXOVERLAP)
        local list=HealBot_Options_Aux1Assign_GenList()
        HealBot_Options_Aux1Assign.initialize = HealBot_Options_Aux1Assign_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Aux1Assign, list[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][1][HealBot_Options_luVars["FramesSelFrame"]]["USE"]])
        HealBot_Options_Aux2Assign.initialize = HealBot_Options_Aux2Assign_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Aux2Assign, list[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][2][HealBot_Options_luVars["FramesSelFrame"]]["USE"]])
        HealBot_Options_Aux3Assign.initialize = HealBot_Options_Aux3Assign_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Aux3Assign, list[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][3][HealBot_Options_luVars["FramesSelFrame"]]["USE"]])
        HealBot_Options_Aux4Assign.initialize = HealBot_Options_Aux4Assign_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Aux4Assign, list[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][4][HealBot_Options_luVars["FramesSelFrame"]]["USE"]])
        HealBot_Options_Aux5Assign.initialize = HealBot_Options_Aux5Assign_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Aux5Assign, list[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][5][HealBot_Options_luVars["FramesSelFrame"]]["USE"]])
        HealBot_Options_Aux6Assign.initialize = HealBot_Options_Aux6Assign_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Aux6Assign, list[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][6][HealBot_Options_luVars["FramesSelFrame"]]["USE"]])
        HealBot_Options_Aux7Assign.initialize = HealBot_Options_Aux7Assign_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Aux7Assign, list[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][7][HealBot_Options_luVars["FramesSelFrame"]]["USE"]])
        HealBot_Options_Aux8Assign.initialize = HealBot_Options_Aux8Assign_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Aux8Assign, list[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][8][HealBot_Options_luVars["FramesSelFrame"]]["USE"]])
        HealBot_Options_Aux9Assign.initialize = HealBot_Options_Aux9Assign_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Aux9Assign, list[Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][9][HealBot_Options_luVars["FramesSelFrame"]]["USE"]])
        for i=1,9 do
            HealBot_Options_SetLabel("HealBot_Aux"..i.."Assign_FontStr",HEALBOT_OPTIONS_AUX.." "..i)
            HealBot_Options_SetLabel("HealBot_Aux"..i.."Config_FontStr1",HEALBOT_WORD_ANCHOR)
        end
        HealBot_Options_AuxConfigBarChange()
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesBarsAuxConfigTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_AuxConfigBar.initialize = HealBot_Options_AuxConfigBar_DropDown
        UIDropDownMenu_SetText(HealBot_Options_AuxConfigBar,HealBot_Options_Lists["AuxConfigSelect"][HealBot_Options_luVars["AuxBar"]])
        HealBot_Options_SetLabel("HealBot_AuxConfigBar_FontStr",HEALBOT_OPTIONS_AUXINDCONFIG)
        HealBot_Options_SetLabel("HealBot_AuxBarsConfigAssign_FontStr",HEALBOT_WORD_ASSIGNMENT)
        HealBot_Options_SetLabel("HealBot_Options_AuxBarAnchor_FontStr",HEALBOT_OPTIONS_AUXBARANCHOR)
        HealBot_Options_SetLabel("HealBot_Options_AuxBarColourt",HEALBOT_SKIN_HEADERBARCOL)
        HealBot_Options_SetLabel("HealBot_Options_AuxBarOpacityTypet",HEALBOT_OPTIONS_AUXOPACITYTYPE)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_AuxBarOpacityCustom,HEALBOT_CLASSES_CUSTOM.." "..HEALBOT_OPTIONS_ALPHA,0,1,0.05,2)
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_AuxBarOpacityCustom)
        g=_G["HealBot_AuxBarCustomColourt"]
        g:SetText(HEALBOT_CUSTOM_CAT_CUSTOM)
        HealBot_Options_SkinBarAuxBarManaOnly:SetChecked(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["MANAONLY"])
        HealBot_Options_SetText(HealBot_Options_SkinBarAuxBarManaOnly,HEALBOT_OPTION_MANAONLY)
        HealBot_Options_SkinBarAuxBarHealersManaOnly:SetChecked(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["HEALERSMANAONLY"])
        HealBot_Options_SetText(HealBot_Options_SkinBarAuxBarHealersManaOnly,HEALBOT_OPTION_HEALERSMANAONLY)
        HealBot_Options_SkinBarAuxBarOverlayRecentHeals:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYRECENTHEALS"])
        HealBot_Options_SetText(HealBot_Options_SkinBarAuxBarOverlayRecentHeals,HEALBOT_RECENTHEALS)
        HealBot_Options_SkinBarAuxBarOverlayHealthDrop:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYHEALTHDROP"])
        HealBot_Options_SetText(HealBot_Options_SkinBarAuxBarOverlayHealthDrop,HEALBOT_OPTION_HEALTHDROP)
        HealBot_Options_SkinBarAuxBarOverlayDebuff:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYDEBUFF"])
        HealBot_Options_SetText(HealBot_Options_SkinBarAuxBarOverlayDebuff,HEALBOT_SKIN_DEBTEXT)
        HealBot_Options_SkinBarAuxBarOverlayAggro:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYAGGRO"])
        HealBot_Options_SetText(HealBot_Options_SkinBarAuxBarOverlayAggro,HEALBOT_OPTIONS_TAB_AGGRO)
        HealBot_Options_SkinBarAuxBarOverlayHighlight:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYHIGHLIGHT"])
        HealBot_Options_SetText(HealBot_Options_SkinBarAuxBarOverlayHighlight,HEALBOT_OPTION_HIGHLIGHTACTIVEBAR)
        HealBot_Options_SkinBarAuxBarOverlayTarget:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYTARGET"])
        HealBot_Options_SetText(HealBot_Options_SkinBarAuxBarOverlayTarget,HEALBOT_OPTIONS_TARGETHEALS)
        HealBot_Options_SkinBarAuxBarOverlayOOR:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYOOR"])
        HealBot_Options_SetText(HealBot_Options_SkinBarAuxBarOverlayOOR,HEALBOT_OUTOFRANGE_LABEL)
        HealBot_Options_SkinBarAuxBarOverlayBuff:SetChecked(Healbot_Config_Skins.AuxBarFrame[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERLAYBUFF"])
        HealBot_Options_SetText(HealBot_Options_SkinBarAuxBarOverlayBuff,HEALBOT_OPTIONS_BUFF)
        HealBot_Options_val_OnLoad(HealBot_Options_AuxBarDepth,HEALBOT_OPTIONS_TXTDEPTH,1,40,1,5)
        HealBot_Options_val_OnLoad(HealBot_Options_AuxBarOffset,HEALBOT_OPTIONS_TXTOFFSET,-20,20,1,5)
        HealBot_Options_AuxBarOffset:SetValue(Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxBar"]][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_AuxBarSize,HEALBOT_OPTIONS_TXTSIZE,0.25,1,0.01,5)
        HealBot_Options_SetLabel("HealBot_SkinBarAuxBarOverlayRecentHealst",HEALBOT_SKIN_OVERLAYCOL_TEXT)
        HealBot_Options_AuxConfigBarChange()
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesTextNameTextTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ShowNameOnBar:SetChecked(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NAMEONBAR"])
        HealBot_Options_SetText(HealBot_Options_ShowNameOnBar,HEALBOT_OPTIONS_SHOWNAMEONBAR)
        HealBot_Options_TextlibUTF8:SetChecked(HealBot_Globals.useUTF8)
        HealBot_Options_SetText(HealBot_Options_TextlibUTF8,HEALBOT_OPTIONS_ENABLELIBUTF8)
        HealBot_Options_ShowClassOnBar:SetChecked(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSONBAR"])
        HealBot_Options_SetText(HealBot_Options_ShowClassOnBar,HEALBOT_OPTIONS_SHOWCLASSONBAR)
        HealBot_Options_ShowRoleOnBar:SetChecked(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWROLE"])
        HealBot_Options_SetText(HealBot_Options_ShowRoleOnBar,HEALBOT_SHOW_ROLE)
        HealBot_Options_AggroTextIndicator.initialize = HealBot_Options_AggroTextIndicator_DropDown
        UIDropDownMenu_SetText(HealBot_Options_AggroTextIndicator, HealBot_Options_Lists["AggroNameFormat"][Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWTEXT"]])
        HealBot_Options_SetLabel("HealBot_Options_AggroTextIndicatortxt",HEALBOT_OPTIONS_AGGROINDTEXT)
        HealBot_Options_BarNameTextPosition.initialize = HealBot_Options_BarNameTextPosition_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarNameTextPosition, HealBot_Options_Lists["BarNameTextAnchor"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ALIGN"]])
        HealBot_Options_UpdateMediaFont(HealBot_Options_FontName, fontsIndex[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]])
        HealBot_Options_val_OnLoad(HealBot_Options_FontHeight,HEALBOT_OPTIONS_SKINFHEIGHT,4,28,1,2)
        HealBot_Options_FontHeight:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"])
        HealBot_Options_SetText(HealBot_Options_FontHeight, HEALBOT_OPTIONS_SKINFHEIGHT..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"])
        HealBot_Options_val_OnLoad(HealBot_Options_FontOffset,HEALBOT_OPTIONS_TEXTOFFSET,-75,75,1,5)
        HealBot_Options_FontOffset:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
        HealBot_Options_SetText(HealBot_Options_FontOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET"])
        HealBot_Options_val_OnLoad(HealBot_Options_NameTextHorOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-40,40,1,5)
        HealBot_Options_NameTextHorOffset:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET2"])
        HealBot_Options_SetText(HealBot_Options_NameTextHorOffset, HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OFFSET2"])
        HealBot_Options_sliderlabels_Init(HealBot_Options_MaxChars,HEALBOT_OPTIONS_MAXCHARS,0,30,1,5,HEALBOT_WORD_AUTO,30)
        HealBot_Options_MaxChars:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MAXCHARS"])
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MAXCHARS"]==0 then
            HealBot_Options_SetText(HealBot_Options_MaxChars, HEALBOT_OPTIONS_MAXCHARS .. ": "..HEALBOT_WORD_AUTO)
        else
            HealBot_Options_SetText(HealBot_Options_MaxChars, HEALBOT_OPTIONS_MAXCHARS .. ": ".. Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MAXCHARS"])
        end
        HealBot_Options_sliderlabels_Init(HealBot_Options_TextOutLine,HEALBOT_OPTIONS_SKINFOUTLINE,1,3,1,1,HEALBOT_WORDS_NONE,HEALBOT_WORDS_THICK)
        HealBot_Options_TextOutLine:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"])
        HealBot_Options_SetText(HealBot_Options_TextOutLine, HEALBOT_OPTIONS_SKINFOUTLINE .. ": ".. HealBot_Options_FontOutline_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]])
        HealBot_Options_SetLabel("HealBot_BarNameTextPositiontxt",HEALBOT_OPTIONS_TEXTALIGNMENT)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

HealBot_Options_luVars["OnLoadSkinsFramesTextNameColours"]=true
function HealBot_Options_SkinsFramesTextNameColoursTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_NameTextColour.initialize = HealBot_Options_NameTextColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_NameTextColour, HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NAME"]])
        HealBot_Options_NameTextColourDebuff:SetChecked(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NDEBUFF"])
        HealBot_Options_SetText(HealBot_Options_NameTextColourDebuff,HEALBOT_OPTIONS_TEXTCOL_DEBUFF)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_NameTextAlpha,HEALBOT_OPTIONS_BARALPHA,0,1,0.01,5)
        HealBot_Options_NameTextAlpha:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_NameTextAlpha)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_NameTextDisAlpha,HEALBOT_OPTIONS_BARALPHADIS,0,1,0.01,5)
        HealBot_Options_NameTextDisAlpha:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NCDA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_NameTextDisAlpha)
        if HEALBOT_GAME_VERSION>3 then
            HealBot_Options_NameTextSummonCol:SetChecked(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUM"])
        end
        g=_G["HealBot_NameTextDeadColourt"]
        g:SetText(HEALBOT_DEAD_LABEL)
        HealBot_Options_NameTextDeadCol:SetChecked(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RIP"])
        g=_G["HealBot_NameTextResColourt"]
        g:SetText(HEALBOT_WORD_RESURRECTION)
        HealBot_Options_NameTextResCol:SetChecked(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RES"])
        g=_G["HealBot_NameTextSummonColourt"]
        g:SetText(HEALBOT_WORD_SUMMONS)
        HealBot_Options_SetLabel("HealBot_NameTextColourt",HEALBOT_SKIN_NAMETEXTCOL_TEXT)
        HealBot_Options_TabRunOnce[tab]=true
    end
    if HealBot_Options_luVars["OnLoadSkinsFramesTextNameColours"] then
        HealBot_NameTextCustomColourCritical:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_NameTextCustomColourInjured:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_NameTextCustomColourHealthy:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        if HEALBOT_GAME_VERSION<4 then
            HealBot_NameTextDeadColb:ClearAllPoints()
            HealBot_NameTextDeadColb:SetPoint("BOTTOM",-120,25)
            HealBot_NameTextResColb:ClearAllPoints()
            HealBot_NameTextResColb:SetPoint("BOTTOM",120,25)
            HealBot_NameTextSummonColb:Hide()
            HealBot_NameTextSummonCol:Hide()
            HealBot_Options_NameTextSummonCol:Hide()
            HealBot_Options_SkinSummonColPresetColour:Hide()
        end
        HealBot_Options_luVars["OnLoadSkinsFramesTextNameColours"]=false
    end
end

function HealBot_Options_SkinsFramesTextHealthTextTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ShowHealthOnBar:SetChecked(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHONBAR"])
        HealBot_Options_SetText(HealBot_Options_ShowHealthOnBar,HEALBOT_OPTIONS_SHOWHEALTHONBAR)
        HealBot_Options_HealthIncludePercent:SetChecked(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHINCPTC"])
        HealBot_Options_SetText(HealBot_Options_HealthIncludePercent,HEALBOT_OPTIONS_HEALTHINCPERCENT)
        HealBot_Options_HealthInVehicleShowPlayer:SetChecked(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHINVEHSHOWPLAYER"])
        HealBot_Options_SetText(HealBot_Options_HealthInVehicleShowPlayer,HEALBOT_OPTIONS_HEALTHINVEHSHOWPLAYER)
        HealBot_Options_BarHealthType.initialize = HealBot_Options_BarHealthType_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthType, HealBot_Options_BarHealthType_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTYPE"]])
        HealBot_Options_BarHealthNumFormat1.initialize = HealBot_Options_BarHealthNumFormat1_DropDown
        local tmpBarHealthNumFormat1_List=HealBot_Options_BarHealthNumFormat_genList()
        local i=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMFORMAT2"]
        if i>1 then i=(i*2)-1 end
        UIDropDownMenu_SetText(HealBot_Options_BarHealthNumFormat1, tmpBarHealthNumFormat1_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["NUMFORMAT1"]])
        HealBot_Options_BarHealthNumFormat2.initialize = HealBot_Options_BarHealthNumFormat2_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthNumFormat2, HealBot_Options_BarHealthNumFormat2_List[i]..HealBot_Options_luVars["hbBarHealthNumFormatTxt"]..HealBot_Options_BarHealthNumFormat2_List[i+1])
        HealBot_Options_BarHealthTextPosition.initialize = HealBot_Options_BarHealthTextPosition_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthTextPosition, HealBot_Options_BarHealthAnchor_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTHTXTANCHOR"]])
        HealBot_Options_UpdateMediaFont(HealBot_Options_HealthFontName,fontsIndex[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HFONT"]])
        HealBot_Options_val_OnLoad(HealBot_Options_HealthFontHeight,HEALBOT_OPTIONS_SKINFHEIGHT,4,28,1,2)
        HealBot_Options_HealthFontHeight:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HHEIGHT"])
        HealBot_Options_SetText(HealBot_Options_HealthFontHeight, HEALBOT_OPTIONS_SKINFHEIGHT..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HHEIGHT"])
        HealBot_Options_val_OnLoad(HealBot_Options_HealthFontOffset,HEALBOT_OPTIONS_TEXTOFFSET,-75,75,1,5)
        HealBot_Options_HealthFontOffset:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"])
        HealBot_Options_SetText(HealBot_Options_HealthFontOffset, HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"])
        HealBot_Options_val_OnLoad(HealBot_Options_HealthTextHorOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-40,40,1,5)
        HealBot_Options_HealthTextHorOffset:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET2"])
        HealBot_Options_SetText(HealBot_Options_HealthTextHorOffset, HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET2"])
        HealBot_Options_sliderlabels_Init(HealBot_Options_HealthMaxChars,HEALBOT_OPTIONS_MAXCHARS,0,30,1,5,HEALBOT_WORD_AUTO,30)
        HealBot_Options_HealthMaxChars:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HMAXCHARS"])
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HMAXCHARS"]==0 then
            HealBot_Options_SetText(HealBot_Options_HealthMaxChars, HEALBOT_OPTIONS_MAXCHARS .. ": "..HEALBOT_WORD_AUTO)
        else
            HealBot_Options_SetText(HealBot_Options_HealthMaxChars, HEALBOT_OPTIONS_MAXCHARS .. ": ".. Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HMAXCHARS"])
        end
        HealBot_Options_sliderlabels_Init(HealBot_Options_HealthTextOutLine,HEALBOT_OPTIONS_SKINFOUTLINE,1,3,1,1,HEALBOT_WORDS_NONE,HEALBOT_WORDS_THICK)
        HealBot_Options_HealthTextOutLine:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOUTLINE"])
        HealBot_Options_SetText(HealBot_Options_HealthTextOutLine, HEALBOT_OPTIONS_SKINFOUTLINE .. ": ".. HealBot_Options_FontOutline_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOUTLINE"]])
        HealBot_Options_SetLabel("HealBot_BarHealthTextPositiontxt",HEALBOT_OPTIONS_HEALTHTEXTANCHOR)
        HealBot_Options_HealthAnchor_Options()
        HealBot_Options_TabRunOnce[tab]=true
    end
end

HealBot_Options_luVars["OnLoadSkinsFramesTextHealthColours"]=true
function HealBot_Options_SkinsFramesTextHealthColoursTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_HealthTextColour.initialize = HealBot_Options_HealthTextColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_HealthTextColour, HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HLTH"]])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_HealthTextAlpha,HEALBOT_OPTIONS_BARALPHA,0,1,0.01,5)
        HealBot_Options_HealthTextAlpha:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_HealthTextAlpha)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_HealthTextDisAlpha,HEALBOT_OPTIONS_BARALPHADIS,0,1,0.01,5)
        HealBot_Options_HealthTextDisAlpha:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HCDA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_HealthTextDisAlpha)
        HealBot_Options_HealthTextColourDebuff:SetChecked(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HDEBUFF"])
        HealBot_Options_SetText(HealBot_Options_HealthTextColourDebuff,HEALBOT_OPTIONS_TEXTCOL_DEBUFF)
        HealBot_Options_BarHealthCustomColour.initialize = HealBot_Options_BarHealthCustomColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthCustomColour, HealBot_Options_Lists["HealthCustomColour"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEALEXTRACOL"]])
        HealBot_Options_SetLabel("HealBot_Options_BarHealthCustomColourtxt",HEALBOT_SKIN_NAMETEXTCOL_TEXT)
        HealBot_Options_SetLabel("HealBot_HealthTextColourt",HEALBOT_SKIN_NAMETEXTCOL_TEXT)
        HealBot_Options_TabRunOnce[tab]=true
    end
    if HealBot_Options_luVars["OnLoadSkinsFramesTextHealthColours"] then
        HealBot_HealthTextCustomColourCritical:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_HealthTextCustomColourInjured:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_HealthTextCustomColourHealthy:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_Options_luVars["OnLoadSkinsFramesTextHealthColours"]=false
    end
end

function HealBot_Options_SkinsFramesTextHealthInHealsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_IgnoreIncomingHealOnFull:SetChecked(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["IGNOREONFULL"])
        HealBot_Options_SetText(HealBot_Options_IgnoreIncomingHealOnFull,HEALBOT_OPTIONS_IGNOREINCOMINGONFULL)
        HealBot_Options_BarHealthIncHeal.initialize = HealBot_Options_BarHealthIncHeal_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthIncHeal, HealBot_Options_BarHealthIncHeal_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["INCHEALS"]])
        HealBot_Options_BarHealthIncAbsorb.initialize = HealBot_Options_BarHealthIncAbsorb_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthIncAbsorb, HealBot_Options_BarHealthIncAbsorb_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["INCABSORBS"]])
        HealBot_Options_BarHealthInHealFormat.initialize = HealBot_Options_BarHealthInHealFormat_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthInHealFormat, HealBot_Options_Lists["OverHealFormat"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SEPARATEFORMAT"]])
        HealBot_Options_SetLabel("HealBot_Options_BarHealthInHealFormattxt",HEALBOT_OPTIONS_SEPARATEFORMAT)
        HealBot_Options_BarHealthInHealColour.initialize = HealBot_Options_BarHealthInHealColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthInHealColour, HealBot_Options_Lists["OverHealColour"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SEPARATECOL"]])
        HealBot_Options_SetLabel("HealBot_Options_BarHealthInHealColourtxt",HEALBOT_OPTIONS_SEPARATECOLOUR)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesTextHealthOverhealsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        g=_G["HealBot_Options_Skins_ExtraOverHealOptTxt"]
        g:SetText(HEALBOT_OPTIONS_EXTRAHOPTOVERHEAL)
        g:SetTextColor(1,1,1,1)
        HealBot_Options_BarHealthOverHeal.initialize = HealBot_Options_BarHealthOverHeal_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthOverHeal, HealBot_Options_BarHealthOverHeal_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERHEAL"]])
        HealBot_Options_BarHealthOverHealFormat.initialize = HealBot_Options_BarHealthOverHealFormat_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthOverHealFormat, HealBot_Options_Lists["OverHealFormat"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERHEALFORMAT"]])
        HealBot_Options_SetLabel("HealBot_Options_BarHealthOverHealFormattxt",HEALBOT_OPTIONS_OVERHEALFORMAT)
        HealBot_Options_BarHealthOverHealColour.initialize = HealBot_Options_BarHealthOverHealColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthOverHealColour, HealBot_Options_Lists["OverHealColour"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OVERHEALCOL"]])
        HealBot_Options_SetLabel("HealBot_Options_BarHealthOverHealColourtxt",HEALBOT_OPTIONS_OVERHEALCOLOUR)
        g=_G["HealBot_ExtraOverHealCustomColourt"]
        g:SetText(HEALBOT_CUSTOM_CAT_CUSTOM)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesTextStateTextTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_StateOnlyTooltip:SetChecked(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGSTATEONLYTIP"])
        HealBot_Options_SetText(HealBot_Options_StateOnlyTooltip,HEALBOT_OPTIONS_TEXTONLYTIP)
        HealBot_Options_DisconnectedTag:SetText(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGDC"])
        HealBot_Options_UnitDeadTag:SetText(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGRIP"])
        HealBot_Options_OutOfRangeTag:SetText(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGOOR"])
        HealBot_Options_ReserverTag:SetText(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGR"])
        HealBot_Options_ResTag:SetText(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGRES"])
        HealBot_Options_SetText(HealBot_Options_DisconnectedTag,HEALBOT_DISCONNECTED_LABEL)
        HealBot_Options_SetText(HealBot_Options_UnitDeadTag,HEALBOT_DEAD_LABEL)
        HealBot_Options_SetText(HealBot_Options_OutOfRangeTag,HEALBOT_OUTOFRANGE_LABEL)
        HealBot_Options_SetText(HealBot_Options_ReserverTag,HEALBOT_RESERVED_LABEL)
        HealBot_Options_SetText(HealBot_Options_ResTag,HEALBOT_WORD_RESURRECTION)
        if HEALBOT_GAME_VERSION>3 then
            HealBot_Options_SetText(HealBot_Options_SummonsTag,HEALBOT_WORD_SUMMONS)
            HealBot_Options_SummonsTag:SetText(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGSUM"])
        else
            HealBot_Options_SummonsTag:Hide()
        end
        HealBot_Options_BarStateTextPosition.initialize = HealBot_Options_BarStateTextPosition_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarStateTextPosition, HealBot_Options_Lists["BarStateTextAnchor"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STATETXTANCHOR"]])
        HealBot_Options_UpdateMediaFont(HealBot_Options_StateFontName,fontsIndex[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFONT"]])
        HealBot_Options_val_OnLoad(HealBot_Options_StateFontHeight,HEALBOT_OPTIONS_SKINFHEIGHT,4,28,1,2)
        HealBot_Options_StateFontHeight:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHEIGHT"])
        HealBot_Options_SetText(HealBot_Options_StateFontHeight, HEALBOT_OPTIONS_SKINFHEIGHT..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHEIGHT"])
        HealBot_Options_sliderlabels_Init(HealBot_Options_StateTextOutLine,HEALBOT_OPTIONS_SKINFOUTLINE,1,3,1,1,HEALBOT_WORDS_NONE,HEALBOT_WORDS_THICK)
        HealBot_Options_StateTextOutLine:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOUTLINE"])
        HealBot_Options_SetText(HealBot_Options_StateTextOutLine, HEALBOT_OPTIONS_SKINFOUTLINE .. ": ".. HealBot_Options_FontOutline_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOUTLINE"]])
        HealBot_Options_val_OnLoad(HealBot_Options_StateFontOffset,HEALBOT_OPTIONS_TEXTOFFSET,-75,75,1,5)
        HealBot_Options_StateFontOffset:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOFFSET"])
        HealBot_Options_SetText(HealBot_Options_StateFontOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOFFSET"])
        HealBot_Options_val_OnLoad(HealBot_Options_StateTextHorOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-40,40,1,5)
        HealBot_Options_StateTextHorOffset:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOFFSET2"])
        HealBot_Options_SetText(HealBot_Options_StateTextHorOffset, HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SOFFSET2"])
        HealBot_Options_SetLabel("HealBot_BarStateTextPositiontxt",HEALBOT_OPTIONS_STATETEXTANCHOR)
        HealBot_Options_StateUseNameFontString_Options()
        HealBot_Options_TabRunOnce[tab]=true
    end
end

HealBot_Options_luVars["OnLoadSkinsFramesTextStateColours"]=true
function HealBot_Options_SkinsFramesTextStateColoursTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_StateTextColour.initialize = HealBot_Options_StateTextColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_StateTextColour,HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STATE"]])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_StateTextAlpha,HEALBOT_OPTIONS_BARALPHA,0,1,0.01,5)
        HealBot_Options_StateTextAlpha:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_StateTextAlpha)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_StateTextDisAlpha,HEALBOT_OPTIONS_BARALPHADIS,0,1,0.01,5)
        HealBot_Options_StateTextDisAlpha:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCDA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_StateTextDisAlpha)
        g=_G["HealBot_StateTextDeadColourt"]
        g:SetText(HEALBOT_DEAD_LABEL)
        HealBot_Options_StateTextDeadCol:SetChecked(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRIP"])
        g=_G["HealBot_StateTextResColourt"]
        g:SetText(HEALBOT_WORD_RESURRECTION)
        HealBot_Options_StateTextResCol:SetChecked(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SRES"])
        if HEALBOT_GAME_VERSION>3 then
            HealBot_Options_StateTextSummonCol:SetChecked(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSUM"])
        end
        HealBot_Options_SetLabel("HealBot_StateTextColourt",HEALBOT_SKIN_NAMETEXTCOL_TEXT)
        HealBot_Options_TabRunOnce[tab]=true
    end
    if HealBot_Options_luVars["OnLoadSkinsFramesTextStateColours"] then
        HealBot_StateTextCustomColourCritical:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_StateTextCustomColourInjured:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_StateTextCustomColourHealthy:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        if HEALBOT_GAME_VERSION<4 then
            HealBot_StateTextDeadColb:ClearAllPoints()
            HealBot_StateTextDeadColb:SetPoint("BOTTOM",-120,25)
            HealBot_StateTextResColb:ClearAllPoints()
            HealBot_StateTextResColb:SetPoint("BOTTOM",120,25)
            HealBot_StateTextSummonColb:Hide()
            HealBot_StateTextSummonCol:Hide()
            HealBot_Options_StateTextSummonCol:Hide()
            HealBot_Options_SkinStateSummonColPresetColour:Hide()
        end
        HealBot_Options_luVars["OnLoadSkinsFramesTextStateColours"]=false
    end
end

function HealBot_Options_SkinsFramesTextAggroTextTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_AggroTxtPct:SetChecked(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGAGGROONLYTIP"])
        HealBot_Options_SetText(HealBot_Options_AggroTxtPct,HEALBOT_OPTIONS_TEXTONLYTIP)
        local i=Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTFORMAT"]
        if i>1 then i=(i*2)-1 end
        HealBot_Options_BarHealthNumFormatAggro.initialize = HealBot_Options_BarHealthNumFormatAggro_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarHealthNumFormatAggro, HealBot_Options_BarHealthNumFormat2_List[i].."77%"..HealBot_Options_BarHealthNumFormat2_List[i+1])
        HealBot_Options_BarAggroTextPosition.initialize = HealBot_Options_BarAggroTextPosition_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BarAggroTextPosition, HealBot_Options_Lists["BarAggroTextAnchor"][Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AGGROTXTANCHOR"]])
        HealBot_Options_UpdateMediaFont(HealBot_Options_AggroFontName,fontsIndex[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AFONT"]])
        HealBot_Options_val_OnLoad(HealBot_Options_AggroFontHeight,HEALBOT_OPTIONS_SKINFHEIGHT,4,28,1,2)
        HealBot_Options_AggroFontHeight:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AHEIGHT"])
        HealBot_Options_SetText(HealBot_Options_AggroFontHeight, HEALBOT_OPTIONS_SKINFHEIGHT..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AHEIGHT"])
        HealBot_Options_sliderlabels_Init(HealBot_Options_AggroTextOutLine,HEALBOT_OPTIONS_SKINFOUTLINE,1,3,1,1,HEALBOT_WORDS_NONE,HEALBOT_WORDS_THICK)
        HealBot_Options_AggroTextOutLine:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOUTLINE"])
        HealBot_Options_SetText(HealBot_Options_AggroTextOutLine, HEALBOT_OPTIONS_SKINFOUTLINE .. ": ".. HealBot_Options_FontOutline_List[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOUTLINE"]])
        HealBot_Options_val_OnLoad(HealBot_Options_AggroFontOffset,HEALBOT_OPTIONS_TEXTOFFSET,-75,75,1,5)
        HealBot_Options_AggroFontOffset:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOFFSET"])
        HealBot_Options_SetText(HealBot_Options_AggroFontOffset, HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOFFSET"])
        HealBot_Options_val_OnLoad(HealBot_Options_AggroTextHorOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-40,40,1,5)
        HealBot_Options_AggroTextHorOffset:SetValue(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOFFSET2"])
        HealBot_Options_SetText(HealBot_Options_AggroTextHorOffset, HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AOFFSET2"])
        HealBot_Options_SetLabel("HealBot_BarAggroTextPositiontxt",HEALBOT_OPTIONS_AGGROTEXTANCHOR)
        HealBot_Options_SetLabel("HealBot_Options_BarHealthAggroFormattxt",HEALBOT_OPTIONS_PERCENTAGEFORMAT)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

HealBot_Options_luVars["OnLoadSkinsFramesTextAggroColours"]=true
function HealBot_Options_SkinsFramesTextAggroColoursTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_AggroTextColour.initialize = HealBot_Options_AggroTextColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_AggroTextColour, HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AGGRO"]])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_AggroTextAlpha,HEALBOT_OPTIONS_BARALPHA,0,1,0.01,5)
        HealBot_Options_AggroTextAlpha:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_AggroTextAlpha)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_AggroTextDisAlpha,HEALBOT_OPTIONS_BARALPHADIS,0,1,0.01,5)
        HealBot_Options_AggroTextDisAlpha:SetValue(Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACDA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_AggroTextDisAlpha)
        HealBot_Options_SetLabel("HealBot_AggroTextColourt",HEALBOT_SKIN_NAMETEXTCOL_TEXT)
        HealBot_Options_TabRunOnce[tab]=true
    end
    if HealBot_Options_luVars["OnLoadSkinsFramesTextAggroColours"] then
        HealBot_AggroTextCustomColourCritical:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_AggroTextCustomColourInjured:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_AggroTextCustomColourHealthy:SetStatusBarTexture(LSM:Fetch('statusbar',HealBot_Default_Textures[8]))
        HealBot_Options_luVars["OnLoadSkinsFramesTextAggroColours"]=false
    end
end

function HealBot_Options_SkinsFramesTextAuxTextTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_AuxTextSelect1.initialize = HealBot_Options_AuxTextSelect1_DropDown
        HealBot_Options_AuxTextAlign.initialize = HealBot_Options_AuxTextAlign_DropDown
        HealBot_Options_SetText(HealBot_Options_ShowTextOnAuxBar,HEALBOT_OPTIONS_SHOWTEXT)
        HealBot_Options_val_OnLoad(HealBot_Options_AuxFontHeight,HEALBOT_OPTIONS_SKINFHEIGHT,4,28,1,2)
        HealBot_Options_val_OnLoad(HealBot_Options_AuxFontOffset,HEALBOT_OPTIONS_TEXTOFFSET,-75,75,1,5)
        HealBot_Options_val_OnLoad(HealBot_Options_AuxFontHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-40,40,1,5)
        HealBot_Options_sliderlabels_Init(HealBot_Options_AuxMaxChars,HEALBOT_OPTIONS_MAXCHARS,0,30,1,5,HEALBOT_WORD_AUTO,30)
        HealBot_Options_sliderlabels_Init(HealBot_Options_AuxTextOutLine,HEALBOT_OPTIONS_SKINFOUTLINE,1,3,1,1,HEALBOT_WORDS_NONE,HEALBOT_WORDS_THICK)
        HealBot_Options_AuxConfigTxtChange()
        HealBot_Options_SetLabel("HealBot_Options_AuxTextSelect1t",HEALBOT_OPTIONS_AUXINDCONFIG)
        HealBot_Options_SetLabel("HealBot_AuxTextConfigAssign1_FontStr1",HEALBOT_WORD_ASSIGNMENT)
        HealBot_Options_SetLabel("HealBot_Options_AuxTextAlignt",HEALBOT_OPTIONS_TEXTALIGNMENT)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesTextAuxColoursTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_AuxTextColour.initialize = HealBot_Options_AuxTextColour_DropDown
        HealBot_Options_AuxTextSelect2.initialize = HealBot_Options_AuxTextSelect2_DropDown
        HealBot_Options_AuxConfigTxtChange()
        g=_G["HealBot_AuxTextCustomColourt"]
        g:SetText(HEALBOT_CUSTOM_CAT_CUSTOM)
        HealBot_Options_SetLabel("HealBot_Options_AuxTextSelect2t",HEALBOT_OPTIONS_AUXINDCONFIG)
        HealBot_Options_SetLabel("HealBot_AuxTextConfigAssign2_FontStr1",HEALBOT_WORD_ASSIGNMENT)
        HealBot_Options_SetLabel("HealBot_Options_AuxTextColourt",HEALBOT_SKIN_NAMETEXTCOL_TEXT)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIconsDebuffsGeneralTabIconScale()
    HealBot_Options_val2_OnLoad(HealBot_BarButtonDebuffIconScale,HEALBOT_OPTIONS_ICONSCALE,2.5,10,0.5,10)
    HealBot_BarButtonDebuffIconScale:SetValue((Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DSCALE"] or 7.5)*10)
    HealBot_Options_SetText(HealBot_BarButtonDebuffIconScale,HEALBOT_OPTIONS_ICONSCALE..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DSCALE"])
end

function HealBot_Options_SkinsFramesIconsDebuffsGeneralTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_IconDebuffIconSet.initialize = HealBot_Options_IconDebuffIconSet_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconDebuffIconSet, HealBot_Options_Lists["IconDebuffSets"][HealBot_Options_luVars["DebuffIconSet"]])
        HealBot_Options_IconDebuffPosition.initialize = HealBot_Options_IconDebuffPosition_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconDebuffPosition, HealBot_Options_Lists["IconPosition"][Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFONBAR"]])
        local list=HealBot_Options_AnchorList(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFONBAR"], false)
        HealBot_Options_IconDebuffAnchor.initialize = HealBot_Options_IconDebuffAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconDebuffAnchor, list[Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFANCHOR"]])
        HealBot_Options_val_OnLoad(HealBot_BarButtonDebuffIconVOffset,HEALBOT_OPTIONS_TEXTOFFSET,-25,25,1,5)
        HealBot_BarButtonDebuffIconVOffset:SetValue(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DVOFFSET"] or 0)
        HealBot_Options_SetText(HealBot_BarButtonDebuffIconVOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DVOFFSET"])
        HealBot_Options_val_OnLoad(HealBot_BarButtonDebuffIconHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-25,25,1,5)
        HealBot_BarButtonDebuffIconHOffset:SetValue(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DHOFFSET"] or 0)
        HealBot_Options_SetText(HealBot_BarButtonDebuffIconHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DHOFFSET"])
        if HealBot_Options_luVars["DebuffIconSet"]==1 then
            HealBot_Options_val_OnLoad(HealBot_BarButtonMaxDebuffIcons,HEALBOT_OPTIONS_MAXICONS,0,5,1,2)
        else
            HealBot_Options_val_OnLoad(HealBot_BarButtonMaxDebuffIcons,HEALBOT_OPTIONS_MAXICONS,0,2,1,1)
        end
        HealBot_BarButtonMaxDebuffIcons:SetValue(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["MAXDICONS"] or 2)
        HealBot_Options_SetText(HealBot_BarButtonMaxDebuffIcons,HEALBOT_OPTIONS_MAXICONS..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["MAXDICONS"])
        HealBot_Options_val_OnLoad(HealBot_BarButtonDebuffIconSpacer,HEALBOT_OPTIONS_ICONSPACER,0,5,1,1)
        HealBot_BarButtonDebuffIconSpacer:SetValue(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DICONSPACER"] or 0)
        HealBot_Options_SetText(HealBot_BarButtonDebuffIconSpacer,HEALBOT_OPTIONS_ICONSPACER..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DICONSPACER"])
        HealBot_BarButtonShowDebuffx2Bar:SetChecked(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DEBUFFDOUBLE"])
        HealBot_Options_SetText(HealBot_BarButtonShowDebuffx2Bar,HEALBOT_OPTIONS_DOUBLEROW)
        HealBot_BarButtonIconAlwaysEnabled:SetChecked(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DI15EN"])
        HealBot_Options_SetText(HealBot_BarButtonIconAlwaysEnabled,HEALBOT_OPTIONS_TTALPHA..": "..HEALBOT_OPTIONS_ENABLEHEALTHY)
        HealBot_BarButtonIconFadeOnExpire:SetChecked(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DFADE"])
        HealBot_Options_SetText(HealBot_BarButtonIconFadeOnExpire,HEALBOT_OPTIONS_TTALPHA..": "..HEALBOT_OPTIONS_FADEONEXPIRE)
        HealBot_Options_val_OnLoad(HealBot_BarButtonIconFadeStartTime,HEALBOT_OPTIONS_FADESTARTTIME,5,30,1,5)
        HealBot_BarButtonIconFadeStartTime:SetValue(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DFADESECS"])
        HealBot_Options_SetText(HealBot_BarButtonIconFadeStartTime,HEALBOT_OPTIONS_FADESTARTTIME..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DFADESECS"].." "..HEALBOT_WORDS_SEC)
        HealBot_Options_SetLabel("healboticondebuffposfontstr",HEALBOT_OPTIONS_ICONPOSITION)
        HealBot_Options_SetLabel("healboticondebuffanchorfontstr",HEALBOT_OPTIONS_ICONANCHOR)
        HealBot_Options_SkinsFramesIconsDebuffsGeneralTabIconScale()
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIconsDebuffsTextTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_BarButtonShowHoTTextCount:SetChecked(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBSCNT"])
        HealBot_Options_SetText(HealBot_BarButtonShowHoTTextCount,HEALBOT_OPTIONS_HOTTEXTCOUNT)
        HealBot_BarButtonShowHoTTextDuration:SetChecked(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBSDUR"])
        HealBot_Options_SetText(HealBot_BarButtonShowHoTTextDuration,HEALBOT_OPTIONS_HOTTEXTDURATION)
        HealBot_Options_val_OnLoad(HealBot_BarButtonIconTextDurationTime,HEALBOT_OPTIONS_SHOWDURATIONFROM,3,99,1,5)
        HealBot_BarButtonIconTextDurationTime:SetValue(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBDURTHRH"])
        HealBot_Options_SetText(HealBot_BarButtonIconTextDurationTime,HEALBOT_OPTIONS_SHOWDURATIONFROM..": "..Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBDURTHRH"])
        HealBot_Options_val_OnLoad(HealBot_BarButtonIconTextDurationWarn,HEALBOT_OPTIONS_SHOWDURATIONWARN,1,9,1,2)
        HealBot_BarButtonIconTextDurationWarn:SetValue(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBDURWARN"])
        HealBot_Options_SetText(HealBot_BarButtonIconTextDurationWarn,HEALBOT_OPTIONS_SHOWDURATIONWARN..": "..Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBDURWARN"])
        HealBot_Options_UpdateMediaFont(HealBot_BarButtonIconFont, fontsIndex[Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBFONT"]])
        HealBot_Options_val_OnLoad(HealBot_BarButtonIconTextScale,HEALBOT_OPTIONS_SKINFHEIGHT,4,32,1,5)
        HealBot_BarButtonIconTextScale:SetValue(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBHEIGHT"])
        HealBot_Options_SetText(HealBot_BarButtonIconTextScale,HEALBOT_OPTIONS_SKINFHEIGHT..": "..Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBHEIGHT"])
        HealBot_Options_IconFontOutline.initialize = HealBot_Options_IconFontOutline_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconFontOutline, HealBot_Options_FontOutline_List[Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["DebuffIconSet"]]["DBOUTLINE"]])
        HealBot_Options_SetLabel("HealBot_Options_Skins_HoTs2Text2", HEALBOT_OPTIONS_HOTSHOWTEXT)
        HealBot_Options_SetLabel("healboticonfontoutlinefontstr", HEALBOT_OPTIONS_SKINFOUTLINE)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIconsBuffsGeneralTabIconScale()
    HealBot_Options_val2_OnLoad(HealBot_BarButtonIconScale,HEALBOT_OPTIONS_ICONSCALE,2.5,10,0.5,10)
    HealBot_BarButtonIconScale:SetValue((Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BSCALE"])*10)
    HealBot_Options_SetText(HealBot_BarButtonIconScale,HEALBOT_OPTIONS_ICONSCALE..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BSCALE"])
end

function HealBot_Options_SkinsFramesIconsBuffsGeneralTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_IconBuffIconSet.initialize = HealBot_Options_IconBuffIconSet_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconBuffIconSet, HealBot_Options_Lists["IconBuffSets"][HealBot_Options_luVars["BuffIconSet"]])
        HealBot_Options_IconBuffPosition.initialize = HealBot_Options_IconBuffPosition_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconBuffPosition, HealBot_Options_Lists["IconPosition"][Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFONBAR"]])
        local list=HealBot_Options_AnchorList(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFONBAR"], false)
        HealBot_Options_IconBuffAnchor.initialize = HealBot_Options_IconBuffAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconBuffAnchor, list[Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFANCHOR"]])
        HealBot_Options_val_OnLoad(HealBot_BarButtonBuffIconVOffset,HEALBOT_OPTIONS_TEXTOFFSET,-25,25,1,5)
        HealBot_BarButtonBuffIconVOffset:SetValue(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BVOFFSET"] or 0)
        HealBot_Options_SetText(HealBot_BarButtonBuffIconVOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BVOFFSET"])
        HealBot_Options_val_OnLoad(HealBot_BarButtonBuffIconHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-25,25,1,5)
        HealBot_BarButtonBuffIconHOffset:SetValue(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BHOFFSET"] or 0)
        HealBot_Options_SetText(HealBot_BarButtonBuffIconHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BHOFFSET"])
        if HealBot_Options_luVars["BuffIconSet"]==1 then
            HealBot_Options_val_OnLoad(HealBot_BarButtonMaxBuffIcons,HEALBOT_OPTIONS_MAXICONS,0,5,1,2)
        else
            HealBot_Options_val_OnLoad(HealBot_BarButtonMaxBuffIcons,HEALBOT_OPTIONS_MAXICONS,0,2,1,1)
        end
        HealBot_BarButtonMaxBuffIcons:SetValue(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["MAXBICONS"] or 5)
        HealBot_Options_SetText(HealBot_BarButtonMaxBuffIcons,HEALBOT_OPTIONS_MAXICONS..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["MAXBICONS"])
        HealBot_Options_val_OnLoad(HealBot_BarButtonIconSpacer,HEALBOT_OPTIONS_ICONSPACER,0,5,1,1)
        HealBot_BarButtonIconSpacer:SetValue(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BICONSPACER"] or 8)
        HealBot_Options_SetText(HealBot_BarButtonIconSpacer,HEALBOT_OPTIONS_ICONSPACER..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BICONSPACER"])
        HealBot_BarButtonShowBuffx2Bar:SetChecked(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDOUBLE"])
        HealBot_Options_SetText(HealBot_BarButtonShowBuffx2Bar,HEALBOT_OPTIONS_DOUBLEROW)
        HealBot_BarButtonIconBuffAlwaysEnabled:SetChecked(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFI15EN"])
        HealBot_Options_SetText(HealBot_BarButtonIconBuffAlwaysEnabled,HEALBOT_OPTIONS_TTALPHA..": "..HEALBOT_OPTIONS_ENABLEHEALTHY)
        HealBot_BarButtonIconBuffFadeOnExpire:SetChecked(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFFADE"])
        HealBot_Options_SetText(HealBot_BarButtonIconBuffFadeOnExpire,HEALBOT_OPTIONS_TTALPHA..": "..HEALBOT_OPTIONS_FADEONEXPIRE)
        HealBot_Options_val_OnLoad(HealBot_BarButtonIconBuffFadeStartTime,HEALBOT_OPTIONS_FADESTARTTIME,5,30,1,5)
        HealBot_BarButtonIconBuffFadeStartTime:SetValue(Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFFADESECS"])
        HealBot_Options_SetText(HealBot_BarButtonIconBuffFadeStartTime,HEALBOT_OPTIONS_FADESTARTTIME..": "..Healbot_Config_Skins.IconSets[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFFADESECS"].." "..HEALBOT_WORDS_SEC)
        HealBot_Options_BarButtonIconBuffSelfCastLink:SetText(HEALBOT_OPTIONS_TAB_SELFCASTINDICATORS)
        HealBot_Options_SetLabel("healboticonbuffposfontstr",HEALBOT_OPTIONS_ICONPOSITION)
        HealBot_Options_SetLabel("healboticonbuffanchorfontstr",HEALBOT_OPTIONS_ICONANCHOR)
        HealBot_Options_SkinsFramesIconsBuffsGeneralTabIconScale()
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIconsBuffsTextTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_BarButtonShowBuffTextCount:SetChecked(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFSCNT"])
        HealBot_BarButtonShowBuffTextCountSelfCast:SetChecked(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFSSCNT"])
        HealBot_BarButtonShowBuffTextDuration:SetChecked(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFSDUR"])
        HealBot_BarButtonShowBuffTextDurationSelfCast:SetChecked(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFSSDUR"])
        HealBot_Options_SetText(HealBot_BarButtonShowBuffTextCount,HEALBOT_OPTIONS_HOTTEXTCOUNT)
        HealBot_Options_SetText(HealBot_BarButtonShowBuffTextCountSelfCast,HEALBOT_OPTIONS_SELFCASTS)
        HealBot_Options_SetText(HealBot_BarButtonShowBuffTextDuration,HEALBOT_OPTIONS_HOTTEXTDURATION)
        HealBot_Options_SetText(HealBot_BarButtonShowBuffTextDurationSelfCast,HEALBOT_OPTIONS_SELFCASTS)
        HealBot_Options_val_OnLoad(HealBot_BarButtonIconBuffTextDurationTime,HEALBOT_OPTIONS_SHOWDURATIONFROM,3,99,1,5)
        HealBot_BarButtonIconBuffTextDurationTime:SetValue(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDURTHRH"])
        HealBot_Options_SetText(HealBot_BarButtonIconBuffTextDurationTime,HEALBOT_OPTIONS_SHOWDURATIONFROM..": "..Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDURTHRH"])
        HealBot_Options_val_OnLoad(HealBot_BarButtonIconBuffTextDurationWarn,HEALBOT_OPTIONS_SHOWDURATIONWARN,1,9,1,2)
        HealBot_BarButtonIconBuffTextDurationWarn:SetValue(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDURWARN"])
        HealBot_Options_SetText(HealBot_BarButtonIconBuffTextDurationWarn,HEALBOT_OPTIONS_SHOWDURATIONWARN..": "..Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFDURWARN"])
        HealBot_Options_UpdateMediaFont(HealBot_BarButtonIconBuffFont,fontsIndex[Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFFONT"]])
        HealBot_Options_val_OnLoad(HealBot_BarButtonIconBuffTextScale,HEALBOT_OPTIONS_SKINFHEIGHT,4,32,1,5)
        HealBot_BarButtonIconBuffTextScale:SetValue(Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFHEIGHT"])
        HealBot_Options_SetText(HealBot_BarButtonIconBuffTextScale,HEALBOT_OPTIONS_SKINFHEIGHT..": "..Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFHEIGHT"])
        HealBot_Options_IconBuffFontOutline.initialize = HealBot_Options_IconBuffFontOutline_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconBuffFontOutline, HealBot_Options_FontOutline_List[Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][HealBot_Options_luVars["BuffIconSet"]]["BUFFOUTLINE"]])
        HealBot_Options_SetLabel("HealBot_Options_Skins_Buffs2Text2", HEALBOT_OPTIONS_HOTSHOWTEXT)
        HealBot_Options_SetLabel("healboticonbufffontoutlinefontstr",HEALBOT_OPTIONS_SKINFOUTLINE)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIconsExtrasClassTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ShowClassIcon:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWCLASS"])
        HealBot_Options_SetText(HealBot_Options_ShowClassIcon,HEALBOT_OPTIONS_SHOWCLASSICON)
        HealBot_Options_ShowRoleIcon:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWROLE"])
        HealBot_Options_SetText(HealBot_Options_ShowRoleIcon,HEALBOT_SHOW_ROLE)
        HealBot_Options_IconClassPosition.initialize = HealBot_Options_IconClassPosition_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconClassPosition, HealBot_Options_Lists["IconPosition"][Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSONBAR"]])
        local list=HealBot_Options_AnchorList(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSONBAR"], true)
        HealBot_Options_IconClassAnchor.initialize = HealBot_Options_IconClassAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconClassAnchor, list[Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSANCHOR"]])
        HealBot_Options_val_OnLoad(HealBot_IconClassVOffset,HEALBOT_OPTIONS_TEXTOFFSET,-50,50,1,10)
        HealBot_IconClassVOffset:SetValue(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSVOFFSET"])
        HealBot_Options_SetText(HealBot_IconClassVOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSVOFFSET"])
        HealBot_Options_val_OnLoad(HealBot_IconClassHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-75,75,1,10)
        HealBot_IconClassHOffset:SetValue(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSHOFFSET"])
        HealBot_Options_SetText(HealBot_IconClassHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSHOFFSET"])
        HealBot_Options_val2_OnLoad(HealBot_IconClassScale,HEALBOT_OPTIONS_ICONSCALE,2.5,10,0.5,10)
        HealBot_IconClassScale:SetValue((Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSSCALE"] or 7.5)*10)
        HealBot_Options_SetText(HealBot_IconClassScale,HEALBOT_OPTIONS_ICONSCALE..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSSCALE"])
        HealBot_IconClassAlwaysEnabled:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CLASSEN"])
        HealBot_Options_SetText(HealBot_IconClassAlwaysEnabled,HEALBOT_OPTIONS_TTALPHA..": "..HEALBOT_OPTIONS_ENABLEHEALTHY)
        HealBot_Options_SetLabel("healboticonclassposfontstr",HEALBOT_OPTIONS_ICONPOSITION)
        HealBot_Options_SetLabel("healboticonclassanchorfontstr",HEALBOT_OPTIONS_ICONANCHOR)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIconsExtrasRaidTargetTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_BarButtonShowRaidIcon:SetChecked(Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOW"])
        HealBot_Options_SetText(HealBot_Options_BarButtonShowRaidIcon,HEALBOT_OPTIONS_BARBUTTONSHOWRAIDICON)
        HealBot_Options_BarButtonShowRaidIconStar:SetChecked(Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["STAR"])
        HealBot_Options_SetText(HealBot_Options_BarButtonShowRaidIconStar,HEALBOT_WORD_STAR)
        HealBot_Options_BarButtonShowRaidIconCircle:SetChecked(Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CIRCLE"])
        HealBot_Options_SetText(HealBot_Options_BarButtonShowRaidIconCircle,HEALBOT_WORD_CIRCLE)
        HealBot_Options_BarButtonShowRaidIconDiamond:SetChecked(Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DIAMOND"])
        HealBot_Options_SetText(HealBot_Options_BarButtonShowRaidIconDiamond,HEALBOT_WORD_DIAMOND)
        HealBot_Options_BarButtonShowRaidIconTriangle:SetChecked(Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TRIANGLE"])
        HealBot_Options_SetText(HealBot_Options_BarButtonShowRaidIconTriangle,HEALBOT_WORD_TRIANGLE)
        HealBot_Options_BarButtonShowRaidIconMoon:SetChecked(Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MOON"])
        HealBot_Options_SetText(HealBot_Options_BarButtonShowRaidIconMoon,HEALBOT_WORD_MOON)
        HealBot_Options_BarButtonShowRaidIconSquare:SetChecked(Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SQUARE"])
        HealBot_Options_SetText(HealBot_Options_BarButtonShowRaidIconSquare,HEALBOT_WORD_SQUARE)
        HealBot_Options_BarButtonShowRaidIconCross:SetChecked(Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CROSS"])
        HealBot_Options_SetText(HealBot_Options_BarButtonShowRaidIconCross,HEALBOT_WORD_CROSS)
        HealBot_Options_BarButtonShowRaidIconSkull:SetChecked(Healbot_Config_Skins.RaidIcon[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SKULL"])
        HealBot_Options_SetText(HealBot_Options_BarButtonShowRaidIconSkull,HEALBOT_WORD_SKULL)
        HealBot_Options_IconTargetPosition.initialize = HealBot_Options_IconTargetPosition_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconTargetPosition, HealBot_Options_Lists["IconPosition"][Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETONBAR"]])
        local list=HealBot_Options_AnchorList(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETONBAR"], true)
        HealBot_Options_IconTargetAnchor.initialize = HealBot_Options_IconTargetAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconTargetAnchor, list[Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETANCHOR"]])
        HealBot_Options_val_OnLoad(HealBot_IconTargetVOffset,HEALBOT_OPTIONS_TEXTOFFSET,-50,50,1,10)
        HealBot_IconTargetVOffset:SetValue(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETVOFFSET"])
        HealBot_Options_SetText(HealBot_IconTargetVOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETVOFFSET"])
        HealBot_Options_val_OnLoad(HealBot_IconTargetHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-75,75,1,10)
        HealBot_IconTargetHOffset:SetValue(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETHOFFSET"])
        HealBot_Options_SetText(HealBot_IconTargetHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETHOFFSET"])
        HealBot_Options_val2_OnLoad(HealBot_IconTargetScale,HEALBOT_OPTIONS_ICONSCALE,2.5,10,0.5,10)
        HealBot_IconTargetScale:SetValue((Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETSCALE"] or 7.5)*10)
        HealBot_Options_SetText(HealBot_IconTargetScale,HEALBOT_OPTIONS_ICONSCALE..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETSCALE"])
        HealBot_IconTargetAlwaysEnabled:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TARGETEN"])
        HealBot_Options_SetText(HealBot_IconTargetAlwaysEnabled,HEALBOT_OPTIONS_TTALPHA..": "..HEALBOT_OPTIONS_ENABLEHEALTHY)
        HealBot_Options_SetLabel("healboticontargetposfontstr",HEALBOT_OPTIONS_ICONPOSITION)
        HealBot_Options_SetLabel("healboticontargetanchorfontstr",HEALBOT_OPTIONS_ICONANCHOR)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIconsExtrasReadyCheckTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ShowReadyCheck:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWRC"])
        HealBot_Options_SetText(HealBot_Options_ShowReadyCheck,HEALBOT_OPTIONS_SHOWREADYCHECK)
        HealBot_Options_ShowCombatState:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWCOMBAT"])
        HealBot_Options_SetText(HealBot_Options_ShowCombatState,HEALBOT_OPTIONS_SHOWCOMBATSTATE)
        HealBot_Options_ShowHostile:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWHOSTILE"])
        HealBot_Options_SetText(HealBot_Options_ShowHostile,HEALBOT_OPTIONS_SHOWHOSTILE)
        HealBot_Options_ShowResting:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWRESTING"])
        HealBot_Options_SetText(HealBot_Options_ShowResting,HEALBOT_OPTIONS_SHOWRESTING)
        HealBot_Options_ShowLeader:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWRANK"])
        HealBot_Options_SetText(HealBot_Options_ShowLeader,HEALBOT_OPTIONS_SHOWLEADER)
        HealBot_Options_ShowAFK:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWAFK"])
        HealBot_Options_SetText(HealBot_Options_ShowAFK,HEALBOT_OPTIONS_SHOWAFK)
        HealBot_Options_IconRCPosition.initialize = HealBot_Options_IconRCPosition_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconRCPosition, HealBot_Options_Lists["IconPosition"][Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCONBAR"]])
        local list=HealBot_Options_AnchorList(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCONBAR"], true)
        HealBot_Options_IconRCAnchor.initialize = HealBot_Options_IconRCAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconRCAnchor, list[Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCANCHOR"]])
        HealBot_Options_val_OnLoad(HealBot_IconRCVOffset,HEALBOT_OPTIONS_TEXTOFFSET,-50,50,1,10)
        HealBot_IconRCVOffset:SetValue(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCVOFFSET"])
        HealBot_Options_SetText(HealBot_IconRCVOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCVOFFSET"])
        HealBot_Options_val_OnLoad(HealBot_IconRCHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-75,75,1,10)
        HealBot_IconRCHOffset:SetValue(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCHOFFSET"])
        HealBot_Options_SetText(HealBot_IconRCHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCHOFFSET"])
        HealBot_Options_val2_OnLoad(HealBot_IconRCScale,HEALBOT_OPTIONS_ICONSCALE,2.5,10,0.5,10)
        HealBot_IconRCScale:SetValue((Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCSCALE"] or 7.5)*10)
        HealBot_Options_SetText(HealBot_IconRCScale,HEALBOT_OPTIONS_ICONSCALE..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCSCALE"])
        HealBot_IconRCAlwaysEnabled:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["RCEN"])
        HealBot_Options_SetText(HealBot_IconRCAlwaysEnabled,HEALBOT_OPTIONS_TTALPHA..": "..HEALBOT_OPTIONS_ENABLEHEALTHY)
        HealBot_Options_SetLabel("healboticonRCposfontstr",HEALBOT_OPTIONS_ICONPOSITION)
        HealBot_Options_SetLabel("healboticonRCanchorfontstr",HEALBOT_OPTIONS_ICONANCHOR)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIconsExtrasOORArrowTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ShowDirection:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWDIR"])
        HealBot_Options_SetText(HealBot_Options_ShowDirection,HEALBOT_OPTIONS_SHOWDIRECTION)
        HealBot_Options_ShowDirectionMouseOver:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWDIRMOUSE"])
        HealBot_Options_SetText(HealBot_Options_ShowDirectionMouseOver,HEALBOT_OPTIONS_SHOWDIRECTIONMOUSE)
        HealBot_Options_IconOORArrowPosition.initialize = HealBot_Options_IconOORArrowPosition_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconOORArrowPosition, HealBot_Options_Lists["IconPosition"][Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORONBAR"]])
        local list=HealBot_Options_AnchorList(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORONBAR"], true)
        HealBot_Options_IconOORArrowAnchor.initialize = HealBot_Options_IconOORArrowAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_IconOORArrowAnchor, list[Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORANCHOR"]])
        HealBot_Options_val_OnLoad(HealBot_IconOORArrowVOffset,HEALBOT_OPTIONS_TEXTOFFSET,-50,50,1,10)
        HealBot_IconOORArrowVOffset:SetValue(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORVOFFSET"])
        HealBot_Options_SetText(HealBot_IconOORArrowVOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORVOFFSET"])
        HealBot_Options_val_OnLoad(HealBot_IconOORArrowHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-75,75,1,10)
        HealBot_IconOORArrowHOffset:SetValue(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORHOFFSET"])
        HealBot_Options_SetText(HealBot_IconOORArrowHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORHOFFSET"])
        HealBot_Options_val2_OnLoad(HealBot_IconOORArrowScale,HEALBOT_OPTIONS_ICONSCALE,2.5,10,0.5,10)
        HealBot_IconOORArrowScale:SetValue((Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORSCALE"] or 7.5)*10)
        HealBot_Options_SetText(HealBot_IconOORArrowScale,HEALBOT_OPTIONS_ICONSCALE..": "..Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OORSCALE"])
        HealBot_IconOORArrowAlwaysEnabled:SetChecked(Healbot_Config_Skins.Icons[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OOREN"])
        HealBot_Options_SetText(HealBot_IconOORArrowAlwaysEnabled,HEALBOT_OPTIONS_TTALPHA..": "..HEALBOT_OPTIONS_ENABLEHEALTHY)
        HealBot_Options_SetLabel("healboticonOORArrowposfontstr",HEALBOT_OPTIONS_ICONPOSITION)
        HealBot_Options_SetLabel("healboticonOORArrowanchorfontstr",HEALBOT_OPTIONS_ICONANCHOR)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIndicatorsAggroTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_AggroInd:SetChecked(Healbot_Config_Skins.BarAggro[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOWIND"])
        HealBot_Options_SetText(HealBot_Options_AggroInd,HEALBOT_OPTION_AGGROIND)
        HealBot_Options_AggroIndColour.initialize = HealBot_Options_AggroIndColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_AggroIndColour, HealBot_Options_Lists["IndicatorCol"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ACOL"]])
        HealBot_Options_AggroIndAnchor.initialize = HealBot_Options_AggroIndAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_AggroIndAnchor, HealBot_Options_Lists["AggroIndAnchor"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AANCHOR"]])
        HealBot_Options_val_OnLoad(HealBot_Options_AggroIndVOffset,HEALBOT_OPTIONS_TEXTOFFSET,-50,50,1,10)
        HealBot_Options_AggroIndVOffset:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AVOFF"])
        HealBot_Options_SetText(HealBot_Options_AggroIndVOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AVOFF"])
        HealBot_Options_val_OnLoad(HealBot_Options_AggroIndHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-25,125,1,10)
        HealBot_Options_AggroIndHOffset:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AHOFF"])
        HealBot_Options_SetText(HealBot_Options_AggroIndHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AHOFF"])
        HealBot_Options_val_OnLoad(HealBot_Options_AggroIndSize,HEALBOT_OPTIONS_TXTSIZE,2,20,1,2)
        HealBot_Options_AggroIndSize:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ASIZE"])
        HealBot_Options_SetText(HealBot_Options_AggroIndSize,HEALBOT_OPTIONS_TXTSIZE..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ASIZE"])
        HealBot_Options_val_OnLoad(HealBot_Options_AggroIndSpace,HEALBOT_WORDS_SPACE,-5,10,1,2)
        HealBot_Options_AggroIndSpace:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ASPACE"])
        HealBot_Options_SetText(HealBot_Options_AggroIndSpace,HEALBOT_WORDS_SPACE..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ASPACE"])
        HealBot_Options_SetLabel("healbotaggroindcoltxt",HEALBOT_WORD_COLOUR)
        HealBot_Options_SetLabel("healbotaggroindanchortxt",HEALBOT_WORD_ANCHOR)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIndicatorsLowManaTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ManaIndicator.initialize = HealBot_Options_ManaIndicator_DropDown
        UIDropDownMenu_SetText(HealBot_Options_ManaIndicator, HealBot_Options_ManaIndicator_List[Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["LOWMANA"]])
        HealBot_Options_ManaIndicatorInCombat:SetChecked(Healbot_Config_Skins.General[Healbot_Config_Skins.Current_Skin]["LOWMANACOMBAT"])
        HealBot_Options_SetText(HealBot_Options_ManaIndicatorInCombat,HEALBOT_OPTIONS_MONITORBUFFSC)
        HealBot_Options_LowManaIndColour.initialize = HealBot_Options_LowManaIndColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_LowManaIndColour, HealBot_Options_Lists["IndicatorCol"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MCOL"]])
        HealBot_Options_LowManaIndAnchor.initialize = HealBot_Options_LowManaIndAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_LowManaIndAnchor, HealBot_Options_Lists["IndicatorAnchor"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MANCHOR"]])
        HealBot_Options_val_OnLoad(HealBot_Options_LowManaIndVOffset,HEALBOT_OPTIONS_TEXTOFFSET,-50,50,1,10)
        HealBot_Options_LowManaIndVOffset:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MVOFF"])
        HealBot_Options_SetText(HealBot_Options_LowManaIndVOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MVOFF"])
        HealBot_Options_val_OnLoad(HealBot_Options_LowManaIndHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-50,50,1,10)
        HealBot_Options_LowManaIndHOffset:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MHOFF"])
        HealBot_Options_SetText(HealBot_Options_LowManaIndHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MHOFF"])
        HealBot_Options_val_OnLoad(HealBot_Options_LowManaIndSize,HEALBOT_OPTIONS_TXTSIZE,2,20,1,2)
        HealBot_Options_LowManaIndSize:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MSIZE"])
        HealBot_Options_SetText(HealBot_Options_LowManaIndSize,HEALBOT_OPTIONS_TXTSIZE..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MSIZE"])
        HealBot_Options_val_OnLoad(HealBot_Options_LowManaIndSpace,HEALBOT_WORDS_SPACE,-5,10,1,2)
        HealBot_Options_LowManaIndSpace:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MSPACE"])
        HealBot_Options_SetText(HealBot_Options_LowManaIndSpace,HEALBOT_WORDS_SPACE..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["MSPACE"])
        HealBot_Options_SetLabel("healbotlowmanaindfontstr",HEALBOT_OPTIONS_LOWMANAINDICATOR)
        HealBot_Options_SetLabel("healbotlowmanaindcoltxt",HEALBOT_WORD_COLOUR)
        HealBot_Options_SetLabel("healbotlowmanaindanchortxt",HEALBOT_WORD_ANCHOR)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIndicatorsSelfCastTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_SelfCastIndicator:SetChecked(Healbot_Config_Skins.IconText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SELFIND"])
        HealBot_Options_SetText(HealBot_Options_SelfCastIndicator,HEALBOT_OPTION_AGGROIND)
        HealBot_Options_SelfCastIndColour.initialize = HealBot_Options_SelfCastIndColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelfCastIndColour, HealBot_Options_Lists["IndicatorCol"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SCOL"]])
        HealBot_Options_SelfCastIndAnchor.initialize = HealBot_Options_SelfCastIndAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_SelfCastIndAnchor, HealBot_Options_Lists["AggroIndAnchor"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SANCHOR"]])
        HealBot_Options_val_OnLoad(HealBot_Options_SelfCastIndVOffset,HEALBOT_OPTIONS_TEXTOFFSET,-15,15,1,5)
        HealBot_Options_SelfCastIndVOffset:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SVOFF"])
        HealBot_Options_SetText(HealBot_Options_SelfCastIndVOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SVOFF"])
        HealBot_Options_val_OnLoad(HealBot_Options_SelfCastIndHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-15,15,1,5)
        HealBot_Options_SelfCastIndHOffset:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOFF"])
        HealBot_Options_SetText(HealBot_Options_SelfCastIndHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SHOFF"])
        HealBot_Options_val_OnLoad(HealBot_Options_SelfCastIndSize,HEALBOT_OPTIONS_TXTSIZE,2,20,1,2)
        HealBot_Options_SelfCastIndSize:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSIZE"])
        HealBot_Options_SetText(HealBot_Options_SelfCastIndSize,HEALBOT_OPTIONS_TXTSIZE..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SSIZE"])
        HealBot_Options_SetLabel("healbotselfcastindcoltxt",HEALBOT_WORD_COLOUR)
        HealBot_Options_SetLabel("healbotselfcastindanchortxt",HEALBOT_OPTIONS_AUXBARANCHOR)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesIndicatorsPowerTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ShowPowerCounter:SetChecked(Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["POWERCNT"])
        HealBot_Options_SetText(HealBot_Options_ShowPowerCounter,HEALBOT_OPTION_AGGROIND)
        HealBot_Options_PowerIndColour.initialize = HealBot_Options_PowerIndColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_PowerIndColour, HealBot_Options_Lists["IndicatorCol"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PCOL"]])
        HealBot_Options_PowerIndAnchor.initialize = HealBot_Options_PowerIndAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_Options_PowerIndAnchor, HealBot_Options_Lists["IndicatorAnchor"][Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PANCHOR"]])
        HealBot_Options_val_OnLoad(HealBot_Options_PowerIndVOffset,HEALBOT_OPTIONS_TEXTOFFSET,-50,50,1,10)
        HealBot_Options_PowerIndVOffset:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PVOFF"])
        HealBot_Options_SetText(HealBot_Options_PowerIndVOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PVOFF"])
        HealBot_Options_val_OnLoad(HealBot_Options_PowerIndHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-50,50,1,10)
        HealBot_Options_PowerIndHOffset:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PHOFF"])
        HealBot_Options_SetText(HealBot_Options_PowerIndHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PHOFF"])
        HealBot_Options_val_OnLoad(HealBot_Options_PowerIndSize,HEALBOT_OPTIONS_TXTSIZE,2,20,1,2)
        HealBot_Options_PowerIndSize:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PSIZE"])
        HealBot_Options_SetText(HealBot_Options_PowerIndSize,HEALBOT_OPTIONS_TXTSIZE..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PSIZE"])
        HealBot_Options_val_OnLoad(HealBot_Options_PowerIndSpace,HEALBOT_WORDS_SPACE,-5,10,1,2)
        HealBot_Options_PowerIndSpace:SetValue(Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PSPACE"])
        HealBot_Options_SetText(HealBot_Options_PowerIndSpace,HEALBOT_WORDS_SPACE..": "..Healbot_Config_Skins.Indicators[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["PSPACE"])
        HealBot_Options_SetLabel("healbotpowerindcoltxt",HEALBOT_WORD_COLOUR)
        HealBot_Options_SetLabel("healbotpowerindanchortxt",HEALBOT_WORD_ANCHOR)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesEmergencyGeneralTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_SkinsSpellsUse:SetChecked(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["USE"])
        HealBot_Options_SetText(HealBot_SkinsSpellsUse,HEALBOT_OPTIONS_EMERGBUTTONUSE)
        HealBot_Options_UpdateMediaTexture(HealBot_EmergBarTexture, texturesIndex[Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_EmergBarHeight,HEALBOT_OPTIONS_SKINHEIGHT,0.01,2,0.01,5)
        HealBot_EmergBarHeight:SetValue(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_EmergBarHeight)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_EmergBarWidth,HEALBOT_OPTIONS_SKINWIDTH,0.01,2,0.01,5)
        HealBot_EmergBarWidth:SetValue(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["WIDTH"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_EmergBarWidth)
        HealBot_EmergBarAnchor.initialize = HealBot_EmergBarAnchor_DropDown
        UIDropDownMenu_SetText(HealBot_EmergBarAnchor, HealBot_Options_ActionAnchor_List[Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["ANCHOR"]])
        HealBot_Options_val_OnLoad(HealBot_EmergBarVOffset,HEALBOT_OPTIONS_TEXTOFFSET,-75,75,1,5)
        HealBot_EmergBarVOffset:SetValue(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["VOFFSET"])
        HealBot_Options_SetText(HealBot_EmergBarVOffset,HEALBOT_OPTIONS_TEXTOFFSET..": "..Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["VOFFSET"])
        HealBot_Options_val_OnLoad(HealBot_EmergBarHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET,-75,75,1,5)
        HealBot_EmergBarHOffset:SetValue(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"])
        HealBot_Options_SetText(HealBot_EmergBarHOffset,HEALBOT_OPTIONS_TEXTHOROFFSET..": "..Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HOFFSET"])
        HealBot_Options_SetLabel("healbotemergbaranchorstr",HEALBOT_OPTIONS_AUXBARANCHOR)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_SkinsFramesEmergencyColoursTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_EmergBarCol.initialize = HealBot_EmergBarCol_DropDown
        UIDropDownMenu_SetText(HealBot_EmergBarCol, HealBot_Options_BarHealthColour_List[Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BARCOL"]])
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_EmergInjTrig,HEALBOT_OPTIONS_EMERGINJTRIG,0,0.75,0.01,5)
        HealBot_EmergInjTrig:SetValue(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["INJURED"])
        HealBot_Options_Pct_OnValueChanged(HealBot_EmergInjTrig)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_EmergBarCritTrig,HEALBOT_OPTIONS_EMERGCRITTRIG,0,0.5,0.01,5)
        HealBot_EmergBarCritTrig:SetValue(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["CRITICAL"])
        HealBot_Options_Pct_OnValueChanged(HealBot_EmergBarCritTrig)
        HealBot_EmergBarColBuff:SetChecked(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["BUFFBARCOL"])
        HealBot_Options_SetText(HealBot_EmergBarColBuff,HEALBOT_OPTIONS_BUFFWARNINGS)
        HealBot_EmergBarColDebuff:SetChecked(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DEBUFFBARCOL"])
        HealBot_Options_SetText(HealBot_EmergBarColDebuff,HEALBOT_OPTIONS_CDCWARNINGS)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_EmergBarEnabledOpacity,HEALBOT_OPTIONS_BARALPHA,0.75,1,0.01,5)
        HealBot_EmergBarEnabledOpacity:SetValue(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["A"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_EmergBarEnabledOpacity)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_EmergBarOOROpacity,HEALBOT_OPTIONS_BARALPHAEOR,0,0.75,0.01,5)
        HealBot_EmergBarOOROpacity:SetValue(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_EmergBarOOROpacity)
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_EmergBarDisabledOpacity,HEALBOT_OPTIONS_BARALPHADIS,0,0.75,0.01,5)
        HealBot_EmergBarDisabledOpacity:SetValue(Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["DA"]);
        HealBot_Options_Pct_OnValueChanged(HealBot_EmergBarDisabledOpacity)
        HealBot_Options_SetLabel("healbotemergbarcolstr",HEALBOT_SKIN_HEADERBARCOL)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_DebuffsGeneralTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_CDCTxt1.initialize = HealBot_Options_CDCTxt1_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCTxt1, HealBot_Config_Cures.HealBotDebuffText[HealBot_Options_getDropDownId_bySpec(1)])
        HealBot_Options_CDCGroups1.initialize = HealBot_Options_CDCGroups1_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCGroups1, HealBot_Options_BuffTxt_List[HealBot_Config_Cures.HealBotDebuffDropDown[HealBot_Options_getDropDownId_bySpec(1)]])
        HealBot_Options_CDCTxt2.initialize = HealBot_Options_CDCTxt2_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCTxt2, HealBot_Config_Cures.HealBotDebuffText[HealBot_Options_getDropDownId_bySpec(2)])
        HealBot_Options_CDCGroups2.initialize = HealBot_Options_CDCGroups2_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCGroups2, HealBot_Options_BuffTxt_List[HealBot_Config_Cures.HealBotDebuffDropDown[HealBot_Options_getDropDownId_bySpec(2)]])
        HealBot_Options_CDCTxt3.initialize = HealBot_Options_CDCTxt3_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCTxt3, HealBot_Config_Cures.HealBotDebuffText[HealBot_Options_getDropDownId_bySpec(3)])
        HealBot_Options_CDCGroups3.initialize = HealBot_Options_CDCGroups3_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCGroups3, HealBot_Options_BuffTxt_List[HealBot_Config_Cures.HealBotDebuffDropDown[HealBot_Options_getDropDownId_bySpec(3)]])
        HealBot_Options_IgnoreDebuffsDuration:SetChecked(HealBot_Config_Cures.IgnoreFastDurDebuffs)
        HealBot_Options_SetText(HealBot_Options_IgnoreDebuffsDuration,HEALBOT_OPTIONS_IGNOREDEBUFFDURATION)
        HealBot_Options_sliderlabels_Init(HealBot_Options_IgnoreDebuffsDurationSecs,HEALBOT_OPTIONS_HOTTEXTDURATION,1,5,1,1,"0.5","2.5")
        HealBot_Options_IgnoreDebuffsDurationSecs:SetValue(HealBot_Config_Cures.IgnoreFastDurDebuffsSecs)
        HealBot_Options_SetText(HealBot_Options_IgnoreDebuffsDurationSecs,HEALBOT_OPTIONS_HOTTEXTDURATION .. ": " .. (HealBot_Config_Cures.IgnoreFastDurDebuffsSecs/2) .." Seconds")
        HealBot_Options_IgnoreDebuffsCoolDown:SetChecked(HealBot_Config_Cures.IgnoreOnCooldownDebuffs)
        HealBot_Options_SetText(HealBot_Options_IgnoreDebuffsCoolDown,HEALBOT_OPTIONS_IGNOREDEBUFFCOOLDOWN)
        HealBot_Options_IgnoreDebuffsFriend:SetChecked(HealBot_Config_Cures.IgnoreFriendDebuffs)
        HealBot_Options_SetText(HealBot_Options_IgnoreDebuffsFriend,HEALBOT_OPTIONS_IGNOREDEBUFFFRIEND)
        HealBot_Options_CDCPriority1.initialize = HealBot_Options_CDCPriority1_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCPriority1, HealBot_Config_Cures.HealBotDebuffPriority[HEALBOT_DISEASE_en])
        HealBot_Options_CDCPriority2.initialize = HealBot_Options_CDCPriority2_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCPriority2, HealBot_Config_Cures.HealBotDebuffPriority[HEALBOT_MAGIC_en])
        HealBot_Options_CDCPriority3.initialize = HealBot_Options_CDCPriority3_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCPriority3, HealBot_Config_Cures.HealBotDebuffPriority[HEALBOT_POISON_en])
        HealBot_Options_CDCPriority4.initialize = HealBot_Options_CDCPriority4_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCPriority4, HealBot_Config_Cures.HealBotDebuffPriority[HEALBOT_CURSE_en])
        local cdBarCol=HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol["DEFAULT"] or 3
        HealBot_Options_CDCDefaultBarColour.initialize = HealBot_Options_CDCDefaultBarColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCDefaultBarColour, HealBot_Options_Lists["AuraBarCol"][cdBarCol])
        HealBot_Options_SetLabel("HealBot_Options_Panel4_1", HEALBOT_OPTIONS_DEBUFFTEXT1)
        HealBot_Options_SetLabel("HealBot_Options_Panel4_2", HEALBOT_OPTIONS_BUFFSTEXT2)
        HealBot_Options_SetLabel("HealBot_Options_IgnoreDebuffsTxt", HEALBOT_OPTIONS_IGNOREDEBUFF)
        HealBot_Options_SetLabel("HealBot_Options_DebuffDisease_FontStr", HEALBOT_DISEASE)
        HealBot_Options_SetLabel("HealBot_Options_DebuffMagic_FontStr", HEALBOT_MAGIC)
        HealBot_Options_SetLabel("HealBot_Options_DebuffPoison_FontStr", HEALBOT_POISON)
        HealBot_Options_SetLabel("HealBot_Options_DebuffCurse_FontStr", HEALBOT_CURSE)
        HealBot_Options_SetLabel("HealBot_Options_Panel4_3", HEALBOT_WORD_PRIORITY)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_DebuffsCustomTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_SetLabel("HealBot_Options_CDCCastByCustomTxt",HEALBOT_OPTIONS_CUSTOM_CASTBY)
        HealBot_Options_ResetCDebuffBtn:SetText(HEALBOT_WORD_RESET)
        HealBot_Options_DeleteCDebuffBtn:SetText(HEALBOT_OPTIONS_DELSKIN)
        HealBot_Options_NewCDebuffBtn:SetText(HEALBOT_OPTIONS_SAVESKIN)
        HealBot_Options_SetLabel("HealBot_Options_CDCPriorityCustomTxt",HEALBOT_WORD_PRIORITY)
        HealBot_Options_SetLabel("HealBot_Options_CDCColTxt", HEALBOT_SKIN_HEADERBARCOL)
        HealBot_Options_SetLabel("HealBot_Options_CDCColTxtC",HEALBOT_SKIN_HEADERBARCOL)
        HealBot_Options_SetLabel("HealBot_Options_CDCIconGlowTxt", HEALBOT_SKIN_ICONGLOW)
        HealBot_Options_SetLabel("HealBot_Options_CDCIconGlowTxtC",HEALBOT_SKIN_ICONGLOW)
        HealBot_Options_SetLabel("HealBot_Options_CDCIconSetTxt", HEALBOT_SKIN_ICONSET)
        HealBot_Options_SetLabel("HealBot_Options_CDCIconSetTxtC",HEALBOT_SKIN_ICONSET)
        HealBot_Options_CDCAllDisease:SetChecked(HealBot_Config_Cures.HealBot_Custom_Debuffs_All[HEALBOT_DISEASE_en])
        HealBot_Options_SetText(HealBot_Options_CDCAllDisease,HEALBOT_OPTIONS_CUSTOM_ALLDISEASE)
        HealBot_Options_CDCAllMagic:SetChecked(HealBot_Config_Cures.HealBot_Custom_Debuffs_All[HEALBOT_MAGIC_en])
        HealBot_Options_SetText(HealBot_Options_CDCAllMagic,HEALBOT_OPTIONS_CUSTOM_ALLMAGIC)
        HealBot_Options_CDCAllPoison:SetChecked(HealBot_Config_Cures.HealBot_Custom_Debuffs_All[HEALBOT_POISON_en])
        HealBot_Options_SetText(HealBot_Options_CDCAllPoison,HEALBOT_OPTIONS_CUSTOM_ALLPOISON)
        HealBot_Options_CDCAllCurse:SetChecked(HealBot_Config_Cures.HealBot_Custom_Debuffs_All[HEALBOT_CURSE_en])
        HealBot_Options_SetText(HealBot_Options_CDCAllCurse,HEALBOT_OPTIONS_CUSTOM_ALLCURSE)
        HealBot_Options_CDCAllBoss:SetChecked(HealBot_Config_Cures.AlwaysShowBoss)
        HealBot_Options_SetText(HealBot_Options_CDCAllBoss,HEALBOT_OPTIONS_CUSTOM_ALLBOSS)
        HealBot_Options_CDCAllTimed:SetChecked(HealBot_Config_Cures.AlwaysShowTimed)
        HealBot_Options_SetText(HealBot_Options_CDCAllTimed,HEALBOT_OPTIONS_CUSTOM_ALLTIMED)
        HealBot_Options_SetLabel("HealBot_Options_CustomDebuff_CDCIDMethodText",HEALBOT_OPTIONS_CUSTOM_IDMETHOD)
        HealBot_Options_SetLabel("HealBot_Options_CDebuffText", HEALBOT_CUSTOM_CATEGORY)
        HealBot_Options_SetLabel("HealBot_Options_CDebuffCustomText", HEALBOT_OPTIONS_DEBUFFNAME)
        HealBot_Options_SetLabel("HealBot_Options_CustomDebuff_CastByText", HEALBOT_OPTIONS_CUSTOM_CASTBY)
        HealBot_Options_SetLabel("HealBot_Options_CustomDebuff_CDCIDMethod", HEALBOT_OPTIONS_CUSTOM_IDMETHOD)
        HealBot_Options_SetLabel("HealBot_Options_CDebuffText2", HEALBOT_OPTIONS_NEWDEBUFFTEXT)
        HealBot_Options_SetLabel("HealBot_Options_CDebuffTagTxt", HEALBOT_WORD_TAG)
        HealBot_Options_SetLabel("HealBot_Options_CustomDebuff_PriorityTxt", HEALBOT_WORD_PRIORITY)
        HealBot_Options_SetLabel("HealBot_Options_PageCDebuff", HEALBOT_OPTIONS_PAGE)
        HealBot_Options_SetLabel("HealBot_Options_DebuffSortTxt", HEALBOT_OPTIONS_TAB_SORT)
        HealBot_Options_SetLabel("HealBot_Options_DebuffFilterTxt", HEALBOT_PLUGIN_FILTER)
        HealBot_Options_DebuffSort.initialize = HealBot_Options_DebuffSort_DropDown
        UIDropDownMenu_SetText(HealBot_Options_DebuffSort, HealBot_Options_Lists["AuraCustomSort"][HealBot_Config_Cures.ListSortOrder])
        HealBot_Options_DebuffFilter.initialize = HealBot_Options_DebuffFilter_DropDown
        if HealBot_Config_Cures.ListSortFilter==7 then
            UIDropDownMenu_SetText(HealBot_Options_DebuffFilter, HealBot_Config_Cures.ListSortFilterTag)
        elseif HealBot_Config_Cures.ListSortFilter==1 then
            UIDropDownMenu_SetText(HealBot_Options_DebuffFilter, HEALBOT_WORDS_NONE)
        else
            UIDropDownMenu_SetText(HealBot_Options_DebuffFilter, HealBot_Options_Lists["AuraCustomFilter"][HealBot_Config_Cures.ListSortFilter-1])
        end
        HealBot_Options_TabRunOnce[tab]=true
    end
    HealBot_Options_CDebuffCat.initialize = HealBot_Options_CDebuffCat_DropDown
    UIDropDownMenu_SetText(HealBot_Options_CDebuffCat, HealBot_Options_Lists["CDebuffCat"][HealBot_Options_luVars["CDebuffCatID"]])
    local CDebuffCat_List = HealBot_Options_CDebuffCat_genList()
    HealBot_Options_luVars["numCustomDebuffs"]=#CDebuffCat_List
    HealBot_Options_CDebuffCatNameUpdate()
    HealBot_Options_CDebuffTxt1.initialize = HealBot_Options_CDebuffTxt1_DropDown
    UIDropDownMenu_SetText(HealBot_Options_CDebuffTxt1, HealBot_Options_CDebuffTextID(HealBot_Options_luVars["CDebuffcustomSpellID"]))
    HealBot_Options_luVars["customDebuffPriority"]=15
    if HealBot_Options_luVars["CDebuffcustomSpellID"] and HealBot_Globals.HealBot_Custom_Debuffs[HealBot_Options_luVars["CDebuffcustomSpellID"]] then
        HealBot_Options_luVars["customDebuffPriority"]=HealBot_Globals.HealBot_Custom_Debuffs[HealBot_Options_luVars["CDebuffcustomSpellID"]]
    end
    HealBot_Options_CDCPriorityC.initialize = HealBot_Options_CDCPriorityC_DropDown
    UIDropDownMenu_SetSelectedID(HealBot_Options_CDCPriorityC, HealBot_Options_luVars["customDebuffPriority"])
    UIDropDownMenu_SetText(HealBot_Options_CDCPriorityC, HealBot_Options_luVars["customDebuffPriority"])
    HealBot_Options_CDCCastBy.initialize = HealBot_Options_CDCCastBy_DropDown
    local castBy=HEALBOT_CUSTOM_CASTBY_EVERYONE
    if HealBot_Globals.CureCustomDefaultCastBy==2 then
        castBy=HEALBOT_CUSTOM_CASTBY_ENEMY
    end
    if HealBot_Options_luVars["CDebuffcustomSpellID"] and HealBot_Globals.FilterCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]] then
        castBy=HealBot_CDebuffCasyBy_List[HealBot_Globals.FilterCustomDebuff[HealBot_Options_luVars["CDebuffcustomSpellID"]]]
    end
    UIDropDownMenu_SetText(HealBot_Options_CDCCastBy, castBy)
    HealBot_Options_CDCCol.initialize = HealBot_Options_CDCCol_DropDown
    local cdcDropdown=HealBot_Globals.HealBot_Custom_Debuffs_ShowBarCol[HealBot_Options_luVars["CDebuffcustomSpellID"]] or 1
    UIDropDownMenu_SetText(HealBot_Options_CDCCol, HealBot_Options_Lists["AuraBarCol"][cdcDropdown])
    HealBot_Options_CDCIconGlow.initialize = HealBot_Options_CDCIconGlow_DropDown
    cdcDropdown=HealBot_Globals.HealBot_Custom_Debuffs_IconGlow[HealBot_Options_luVars["CDebuffcustomSpellID"]] or 1 
    UIDropDownMenu_SetText(HealBot_Options_CDCIconGlow, HealBot_Options_Lists["AuraIconGlow"][cdcDropdown])
    HealBot_Options_CDCIconSet.initialize = HealBot_Options_CDCIconSet_DropDown
    cdcDropdown=HealBot_Globals.HealBot_Custom_Debuffs_IconSet[HealBot_Options_luVars["CDebuffcustomSpellID"]] or 1 
    UIDropDownMenu_SetText(HealBot_Options_CDCIconSet, HealBot_Options_Lists["IconSets"][cdcDropdown])
    HealBot_Options_CDCIDMethod.initialize = HealBot_Options_CDCIDMethod_DropDown
    UIDropDownMenu_SetText(HealBot_Options_CDCIDMethod, HealBot_Options_Class_HoTctlIDMethod_List[(HealBot_Globals.CustomDebuffIDMethod[HealBot_Options_luVars["CDebuffcustomSpellID"]] or 3)])
    HealBot_Options_SetEnableDisableCDBtn()
    HealBot_Options_CDebuffTag:SetText(HealBot_Globals.CDCTag[HealBot_Options_luVars["CDebuffcustomSpellID"]] or "")
end

function HealBot_Options_DebuffsWarningTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_CDCCol_ShowOnHealthBar:SetChecked(HealBot_Config_Cures.CDCshownHB)
        HealBot_Options_SetText(HealBot_Options_CDCCol_ShowOnHealthBar,HEALBOT_OPTIONS_CDCSHOWHBARS)
        HealBot_Options_CDCWarnRange1.initialize = HealBot_Options_CDCWarnRange1_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCWarnRange1, HealBot_Options_Lists["RangeWarning"][HealBot_Config_Cures.HealBot_CDCWarnRange_Bar])
        HealBot_Options_ShowDebuffWarning:SetChecked(HealBot_Config_Cures.ShowDebuffWarning)
        HealBot_Options_SetText(HealBot_Options_ShowDebuffWarning,HEALBOT_OPTIONS_SHOWDEBUFFWARNING)
        HealBot_Options_CDCWarnRange3.initialize = HealBot_Options_CDCWarnRange3_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCWarnRange3, HealBot_Options_Lists["RangeWarning"][HealBot_Config_Cures.HealBot_CDCWarnRange_Screen])
        HealBot_Options_SoundDebuffWarning:SetChecked(HealBot_Config_Cures.SoundDebuffWarning)
        HealBot_Options_SetText(HealBot_Options_SoundDebuffWarning,HEALBOT_OPTIONS_SOUNDDEBUFFWARNING)
        HealBot_Options_CDCWarnRange4.initialize = HealBot_Options_CDCWarnRange4_DropDown
        UIDropDownMenu_SetText(HealBot_Options_CDCWarnRange4, HealBot_Options_Lists["RangeWarning"][HealBot_Config_Cures.HealBot_CDCWarnRange_Sound])
        HealBot_Options_WarningSound:SetValue(soundsIndex[HealBot_Config_Cures.SoundDebuffPlay] or 0);
        HealBot_Options_SetWarnCureGroups()
        HealBot_Options_SetLabel("HealBot_Options_CureWarnGroupTxt", HEALBOT_OPTIONS_RAIDGROUPWARN)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_BuffsGeneralBuffsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        local cdBarCol=HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol["DEFAULT"] or 3
        HealBot_Options_BuffDefaultBarColour.initialize = HealBot_Options_BuffDefaultBarColour_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffDefaultBarColour, HealBot_Options_Lists["AuraBarCol"][cdBarCol])
        local BuffTextClass = HealBot_Config_Buffs.HealBotBuffText
        if not BuffTextClass[HealBot_Options_getDropDownId_bySpec(1)] then BuffTextClass[HealBot_Options_getDropDownId_bySpec(1)]=HEALBOT_WORDS_NONE  end;
        HealBot_Options_BuffTxt1.initialize = HealBot_Options_BuffTxt1_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffTxt1, BuffTextClass[HealBot_Options_getDropDownId_bySpec(1)])
        local BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
        if not BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(1)] then BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(1)]=1 end;
        HealBot_Options_BuffGroups1.initialize = HealBot_Options_BuffGroups1_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffGroups1, HealBot_Options_BuffTxt_List[BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(1)]])
        BuffTextClass = HealBot_Config_Buffs.HealBotBuffText
        if not BuffTextClass[HealBot_Options_getDropDownId_bySpec(2)] then BuffTextClass[HealBot_Options_getDropDownId_bySpec(2)]=HEALBOT_WORDS_NONE  end;
        HealBot_Options_BuffTxt2.initialize = HealBot_Options_BuffTxt2_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffTxt2, BuffTextClass[HealBot_Options_getDropDownId_bySpec(2)])
        BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
        if not BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(2)] then BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(2)]=1 end;
        HealBot_Options_BuffGroups2.initialize = HealBot_Options_BuffGroups2_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffGroups2, HealBot_Options_BuffTxt_List[BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(2)]])
        BuffTextClass = HealBot_Config_Buffs.HealBotBuffText
        if not BuffTextClass[HealBot_Options_getDropDownId_bySpec(3)] then BuffTextClass[HealBot_Options_getDropDownId_bySpec(3)]=HEALBOT_WORDS_NONE  end;
        HealBot_Options_BuffTxt3.initialize = HealBot_Options_BuffTxt3_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffTxt3, BuffTextClass[HealBot_Options_getDropDownId_bySpec(3)])
        BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
        if not BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(3)] then BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(3)]=1 end;
        HealBot_Options_BuffGroups3.initialize = HealBot_Options_BuffGroups3_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffGroups3, HealBot_Options_BuffTxt_List[BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(3)]])
        BuffTextClass = HealBot_Config_Buffs.HealBotBuffText
        if not BuffTextClass[HealBot_Options_getDropDownId_bySpec(4)] then BuffTextClass[HealBot_Options_getDropDownId_bySpec(4)]=HEALBOT_WORDS_NONE  end;
        HealBot_Options_BuffTxt4.initialize = HealBot_Options_BuffTxt4_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffTxt4, BuffTextClass[HealBot_Options_getDropDownId_bySpec(4)])
        BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
        if not BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(4)] then BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(4)]=1 end;
        HealBot_Options_BuffGroups4.initialize = HealBot_Options_BuffGroups4_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffGroups4, HealBot_Options_BuffTxt_List[BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(4)]])
        BuffTextClass = HealBot_Config_Buffs.HealBotBuffText
        if not BuffTextClass[HealBot_Options_getDropDownId_bySpec(5)] then BuffTextClass[HealBot_Options_getDropDownId_bySpec(5)]=HEALBOT_WORDS_NONE  end;
        HealBot_Options_BuffTxt5.initialize = HealBot_Options_BuffTxt5_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffTxt5, BuffTextClass[HealBot_Options_getDropDownId_bySpec(5)])
        BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
        if not BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(5)] then BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(5)]=1 end;
        HealBot_Options_BuffGroups5.initialize = HealBot_Options_BuffGroups5_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffGroups5, HealBot_Options_BuffTxt_List[BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(5)]])
        BuffTextClass = HealBot_Config_Buffs.HealBotBuffText
        if not BuffTextClass[HealBot_Options_getDropDownId_bySpec(6)] then BuffTextClass[HealBot_Options_getDropDownId_bySpec(6)]=HEALBOT_WORDS_NONE  end;
        HealBot_Options_BuffTxt6.initialize = HealBot_Options_BuffTxt6_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffTxt6, BuffTextClass[HealBot_Options_getDropDownId_bySpec(6)])
        BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
        if not BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(6)] then BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(6)]=1 end;
        HealBot_Options_BuffGroups6.initialize = HealBot_Options_BuffGroups6_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffGroups6, HealBot_Options_BuffTxt_List[BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(6)]])
        BuffTextClass = HealBot_Config_Buffs.HealBotBuffText
        if not BuffTextClass[HealBot_Options_getDropDownId_bySpec(7)] then BuffTextClass[HealBot_Options_getDropDownId_bySpec(7)]=HEALBOT_WORDS_NONE  end;
        HealBot_Options_BuffTxt7.initialize = HealBot_Options_BuffTxt7_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffTxt7, BuffTextClass[HealBot_Options_getDropDownId_bySpec(7)])
        BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
        if not BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(7)] then BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(7)]=1 end;
        HealBot_Options_BuffGroups7.initialize = HealBot_Options_BuffGroups7_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffGroups7, HealBot_Options_BuffTxt_List[BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(7)]])
        BuffTextClass = HealBot_Config_Buffs.HealBotBuffText
        if not BuffTextClass[HealBot_Options_getDropDownId_bySpec(8)] then BuffTextClass[HealBot_Options_getDropDownId_bySpec(8)]=HEALBOT_WORDS_NONE  end;
        HealBot_Options_BuffTxt8.initialize = HealBot_Options_BuffTxt8_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffTxt8, BuffTextClass[HealBot_Options_getDropDownId_bySpec(8)])
        BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
        if not BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(8)] then BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(8)]=1 end;
        HealBot_Options_BuffGroups8.initialize = HealBot_Options_BuffGroups8_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffGroups8, HealBot_Options_BuffTxt_List[BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(8)]])
        HealBot_Options_SetLabel("HealBot_Options_Panel5_1", HEALBOT_OPTIONS_BUFFSTEXT1)
        HealBot_Options_SetLabel("HealBot_Options_Panel5_2", HEALBOT_OPTIONS_BUFFSTEXT2)
        HealBot_Options_SetLabel("HealBot_Options_BuffDefaultBarColourTxt", HEALBOT_OPTIONS_CDCBARS)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_BuffsExtraBuffsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_MonitorExtraBuffsOnlyInInstance:SetChecked(HealBot_Config_Buffs.ExtraBuffsOnlyInInstance)
        HealBot_Options_SetText(HealBot_Options_MonitorExtraBuffsOnlyInInstance,HEALBOT_OPTIONS_ONLY_IN_INSTANCE)
        local BuffDropDownClass = HealBot_Config_Buffs.HealBotBuffDropDown
        HealBot_Options_BuffWeaponEnchant1.initialize = HealBot_Options_BuffWeaponEnchant1_DropDown
        if not BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(9)] then BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(9)]=1 end;
        if not HealBot_Buff_WeaponEnchant_List[1][BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(9)]] then
            BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(9)]=1
        end
        UIDropDownMenu_SetText(HealBot_Options_BuffWeaponEnchant1, HealBot_Buff_WeaponEnchant_List[1][BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(9)]]) 
        HealBot_Options_BuffWeaponEnchant2.initialize = HealBot_Options_BuffWeaponEnchant2_DropDown
        if not BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(10)] then BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(10)]=1 end;
        if not HealBot_Buff_WeaponEnchant_List[2][BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(10)]] then
            BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(10)]=1
        end
        UIDropDownMenu_SetText(HealBot_Options_BuffWeaponEnchant2, HealBot_Buff_WeaponEnchant_List[2][BuffDropDownClass[HealBot_Options_getDropDownId_bySpec(10)]]) 
        HealBot_Options_BuffCheckWellFed:SetChecked(HealBot_Config_Buffs.CheckWellFed)
        HealBot_Options_SetText(HealBot_Options_BuffCheckWellFed,HEALBOT_OPTIONS_CHECKWELLFED)
        HealBot_Options_BuffCheckManaDrink:SetChecked(HealBot_Config_Buffs.CheckManaDrink)
        HealBot_Options_SetText(HealBot_Options_BuffCheckManaDrink,HEALBOT_OPTIONS_CHECKLOWMANA)
        HealBot_Options_SetLabel("HealBot_Options_BuffWellFedItemTxt", HEALBOT_OPTIONS_PRIMARYITEM)
        HealBot_Options_SetLabel("HealBot_Options_BuffBackupWellFedItemTxt", HEALBOT_OPTIONS_BACKUPITEM)
        HealBot_Options_BuffWellFedItem:SetText(HealBot_Config_Buffs.WellFedItem)
        HealBot_Options_BuffBackupWellFedItem:SetText(HealBot_Config_Buffs.BackupWellFedItem)
        HealBot_Options_BuffWellFedItems.initialize = HealBot_Options_BuffWellFedItems_DropDown
        HealBot_Options_BackupBuffWellFedItems.initialize = HealBot_Options_BackupBuffWellFedItems_DropDown
        HealBot_Options_SetLabel("HealBot_Options_BuffManaDrinkItemTxt", HEALBOT_OPTIONS_PRIMARYITEM)
        HealBot_Options_SetLabel("HealBot_Options_BuffBackupManaDrinkItemTxt", HEALBOT_OPTIONS_BACKUPITEM)
        HealBot_Options_BuffManaDrinkItem:SetText(HealBot_Config_Buffs.ManaDrinkItem)
        HealBot_Options_BuffBackupManaDrinkItem:SetText(HealBot_Config_Buffs.BackupManaDrinkItem)
        HealBot_Options_BuffManaDrinkItems.initialize = HealBot_Options_BuffManaDrinkItems_DropDown
        HealBot_Options_BuffBackupManaDrinkItems.initialize = HealBot_Options_BuffBackupManaDrinkItems_DropDown
        HealBot_Options_BuffExtraCheck1:SetChecked(HealBot_Config_Buffs.CustomBuffCheck[1])
        HealBot_Options_BuffExtraCheck2:SetChecked(HealBot_Config_Buffs.CustomBuffCheck[2])
        HealBot_Options_BuffExtraCheck3:SetChecked(HealBot_Config_Buffs.CustomBuffCheck[3])
        HealBot_Options_BuffExtraBuff1:SetText(HealBot_Config_Buffs.CustomBuffName[1] or "")
        HealBot_Options_BuffExtraBuff2:SetText(HealBot_Config_Buffs.CustomBuffName[2] or "")
        HealBot_Options_BuffExtraBuff3:SetText(HealBot_Config_Buffs.CustomBuffName[3] or "")
        HealBot_Options_BuffExtraItem1:SetText(HealBot_Config_Buffs.CustomItemName[1] or "")
        HealBot_Options_BuffExtraItem2:SetText(HealBot_Config_Buffs.CustomItemName[2] or "")
        HealBot_Options_BuffExtraItem3:SetText(HealBot_Config_Buffs.CustomItemName[3] or "")
        HealBot_Options_BuffExtraItems1.initialize = HealBot_Options_BuffExtraItems1_DropDown
        HealBot_Options_BuffExtraItems2.initialize = HealBot_Options_BuffExtraItems2_DropDown
        HealBot_Options_BuffExtraItems3.initialize = HealBot_Options_BuffExtraItems3_DropDown
        HealBot_Options_SetLabel("HealBot_Options_Panel5_1_Weapon", HEALBOT_OPTIONS_BUFFSTEXTWEMAIN)
        HealBot_Options_SetLabel("HealBot_Options_Panel5_2_Weapon", HEALBOT_OPTIONS_BUFFSTEXTWEOFF)
        HealBot_Options_SetLabel("HealBot_Options_Panel5_3_Weapon", HEALBOT_OPTIONS_BUFFSTEXT3)
        HealBot_Options_SetLabel("HealBot_Options_WellFedCol", HEALBOT_OPTIONS_BUFFSTEXT3)
        HealBot_Options_SetLabel("HealBot_Options_ManaDrinkCol", HEALBOT_OPTIONS_BUFFSTEXT3)
        HealBot_Options_SetLabel("HealBot_Options_ExtraBuffCol", HEALBOT_OPTIONS_BUFFSTEXT3)
        HealBot_Options_SetLabel("HealBot_Options_ExtraBuffName", HEALBOT_OPTIONS_BUFFNAME)
        HealBot_Options_SetLabel("HealBot_Options_ExtraBuffItemName", HEALBOT_OPTIONS_ITEMNAME)
        HealBot_Options_val_OnLoad(HealBot_Options_BuffManaDrinkThreshold,HEALBOT_MANA_LOWTHRESHOLD,20,80,1,5)
        HealBot_Options_BuffManaDrinkThreshold:SetValue(HealBot_Config_Buffs.ManaDrinkThreshold)
        HealBot_Options_SetText(HealBot_Options_BuffManaDrinkThreshold,HEALBOT_MANA_LOWTHRESHOLD..": "..(HealBot_Config_Buffs.ManaDrinkThreshold).."%")
        
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_BuffsCustomTab(tab)
    local HoTctlName_List = HealBot_Options_Class_HoTctlName_genList()
    local sId=HealBot_Options_CDebuffGetId(HealBot_Options_luVars["HoTname"])
    local sName=HealBot_Options_SpellGetName(sId) or ""
    HealBot_Options_luVars["FilterHoTctlName"]=HealBot_Options_FilterHoTctl_List[HealBot_Options_luVars["FilterHoTctlID"]]
    HealBot_Options_FilterHoTctl.initialize = HealBot_Options_FilterHoTctl_DropDown
    UIDropDownMenu_SetText(HealBot_Options_FilterHoTctl, HealBot_Options_luVars["FilterHoTctlName"])
    HealBot_Options_NewBuffHoTBtn:SetText(HEALBOT_OPTIONS_SAVESKIN)
    HealBot_Options_Class_HoTctlName.initialize = HealBot_Options_Class_HoTctlName_DropDown
    UIDropDownMenu_SetText(HealBot_Options_Class_HoTctlName, HealBot_Options_luVars["HoTname"])
    HealBot_Options_Class_HoTctlAction.initialize = HealBot_Options_Class_HoTctlAction_DropDown
    local x=HealBot_Globals.WatchHoT[HealBot_Options_luVars["FilterHoTctlNameTrim"]][sId] or 1
    UIDropDownMenu_SetText(HealBot_Options_Class_HoTctlAction, HealBot_Options_Class_HoTctlAction_List[x])
    HealBot_Options_Class_HoTctlIDMethod.initialize = HealBot_Options_Class_HoTctlIDMethod_DropDown
    x=HealBot_Globals.CustomBuffIDMethod[sId] or 3
    UIDropDownMenu_SetText(HealBot_Options_Class_HoTctlIDMethod, HealBot_Options_Class_HoTctlIDMethod_List[x])
    x=HealBot_Globals.HealBot_Custom_Buffs[sId] or 20
    HealBot_Options_BuffPriorityC.initialize = HealBot_Options_BuffPriorityC_DropDown
    UIDropDownMenu_SetSelectedID(HealBot_Options_BuffPriorityC, x)
    UIDropDownMenu_SetText(HealBot_Options_BuffPriorityC, x)
    HealBot_Options_luVars["numCustomBuffs"]=#HoTctlName_List
    HealBot_Options_BuffCatNameUpdate()
    HealBot_Options_SetEnableDisableBuffBtn()
    HealBot_SetCustomBuffBarColours()
    HealBot_Timers_Set("AURA","CustomBuffListPrep")
    local cbBarDropdown=HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[sId] or HealBot_Globals.HealBot_Custom_Buffs_ShowBarCol[sName] or 1
    HealBot_Options_CustomBuffCol.initialize = HealBot_Options_CustomBuffCol_DropDown
    UIDropDownMenu_SetText(HealBot_Options_CustomBuffCol, HealBot_Options_Lists["AuraBarCol"][cbBarDropdown])
    cbBarDropdown=HealBot_Globals.HealBot_Custom_Buffs_IconGlow[sId] or 1
    HealBot_Options_CustomBuffIconGlow.initialize = HealBot_Options_CustomBuffIconGlow_DropDown
    UIDropDownMenu_SetText(HealBot_Options_CustomBuffIconGlow, HealBot_Options_Lists["AuraIconGlow"][cbBarDropdown])
    cbBarDropdown=HealBot_Globals.HealBot_Custom_Buffs_IconSet[sId] or 1
    HealBot_Options_BuffIconSet.initialize = HealBot_Options_BuffIconSet_DropDown
    UIDropDownMenu_SetText(HealBot_Options_BuffIconSet, HealBot_Options_Lists["IconSets"][cbBarDropdown])
    HealBot_Options_BuffHoTTag:SetText(HealBot_Globals.CustomBuffTag[sId] or "")
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ResetBuffBtn:SetText(HEALBOT_WORD_RESET)
        HealBot_Options_SetLabel("HealBot_Options_Class_HoTctlNameTxt",HEALBOT_OPTIONS_BUFFNAME)
        HealBot_Options_SetLabel("HealBot_Options_Class_HoTctlActionTxt",HEALBOT_OPTIONS_CUSTOM_CASTBY)
        HealBot_Options_SetLabel("HealBot_Options_Class_HoTctlIDMethodTxt",HEALBOT_OPTIONS_CUSTOM_IDMETHOD)
        HealBot_Options_SetLabel("HealBot_Options_Class_HoTctlFilterNameTxt",HEALBOT_SORTBY_CLASS)
        HealBot_Options_SetLabel("HealBot_Options_CustomBuffColTxt",HEALBOT_SKIN_HEADERBARCOL)
        HealBot_Options_SetLabel("HealBot_Options_CustomBuffColTxtC",HEALBOT_SKIN_HEADERBARCOL)
        HealBot_Options_SetLabel("HealBot_Options_CustomBuffIconGlowTxt",HEALBOT_SKIN_ICONGLOW)
        HealBot_Options_SetLabel("HealBot_Options_CustomBuffIconGlowTxtC",HEALBOT_SKIN_ICONGLOW)
        HealBot_Options_SetLabel("HealBot_Options_BuffIconSetTxt",HEALBOT_SKIN_ICONSET)
        HealBot_Options_SetLabel("HealBot_Options_BuffIconSetCustomText",HEALBOT_SKIN_ICONSET)
        HealBot_Options_SetLabel("HealBot_Options_BuffText2", HEALBOT_OPTIONS_NEWHOTBUFFTEXT)
        HealBot_Options_SetLabel("HealBot_Options_BuffTag", HEALBOT_WORD_TAG)
        HealBot_Options_SetLabel("HealBot_Options_CustomBuff_PriorityTxt", HEALBOT_WORD_PRIORITY)
        HealBot_Options_SetLabel("HealBot_Options_BuffSortTxt",HEALBOT_OPTIONS_TAB_SORT)
        HealBot_Options_SetLabel("HealBot_Options_BuffFilterTxt",HEALBOT_PLUGIN_FILTER)
        HealBot_Options_HoTctlActionCustom:Disable()
        HealBot_Options_HoTctlIDMethodCustom:Disable()
        HealBot_Options_BuffPriorityCustom:Disable()
        HealBot_Options_CustomBuffColCustom:Disable()
        HealBot_Options_BuffIconSetCustom:Disable()
        HealBot_Options_CustomBuffIconGlowCustom:Disable()
        HealBot_Options_BuffAuto.initialize = HealBot_Options_BuffAuto_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffAuto, HealBot_Options_Lists["BuffsCustomAuto"][HealBot_Config_Buffs.AutoBuff])
        HealBot_Options_BuffAutoCastBy.initialize = HealBot_Options_BuffAutoCastBy_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffAutoCastBy, HealBot_Options_Lists["BuffsCustomAutoCastBy"][HealBot_Config_Buffs.AutoBuffCastBy])
        HealBot_Options_BuffSort.initialize = HealBot_Options_BuffSort_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffSort, HealBot_Options_Lists["AuraCustomSort"][HealBot_Config_Buffs.ListSortOrder])
        HealBot_Options_BuffFilter.initialize = HealBot_Options_BuffFilter_DropDown
        if HealBot_Config_Buffs.ListSortFilter==7 then
            UIDropDownMenu_SetText(HealBot_Options_BuffFilter, HealBot_Config_Buffs.ListSortFilterTag)
        elseif HealBot_Config_Buffs.ListSortFilter==1 then
            UIDropDownMenu_SetText(HealBot_Options_BuffFilter, HEALBOT_WORDS_NONE)
        else
            UIDropDownMenu_SetText(HealBot_Options_BuffFilter, HealBot_Options_Lists["AuraCustomFilter"][HealBot_Config_Buffs.ListSortFilter-1])
        end
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_BuffsWarningTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_BuffCol_ShowOnHealthBar:SetChecked(HealBot_Config_Buffs.CBshownHB)
        HealBot_Options_SetText(HealBot_Options_BuffCol_ShowOnHealthBar,HEALBOT_OPTIONS_CDCSHOWHBARS)
        HealBot_Options_BuffWarnRange1.initialize = HealBot_Options_BuffWarnRange1_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffWarnRange1, HealBot_Options_Lists["RangeWarning"][HealBot_Config_Buffs.HealBot_CBWarnRange_Bar])
        HealBot_Options_ShowBuffWarning:SetChecked(HealBot_Config_Buffs.ShowBuffWarning)
        HealBot_Options_SetText(HealBot_Options_ShowBuffWarning,HEALBOT_OPTIONS_SHOWBUFFWARNING)
        HealBot_Options_BuffWarnRange3.initialize = HealBot_Options_BuffWarnRange3_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffWarnRange3, HealBot_Options_Lists["RangeWarning"][HealBot_Config_Buffs.HealBot_CBWarnRange_Screen])
        HealBot_Options_SoundBuffWarning:SetChecked(HealBot_Config_Buffs.SoundBuffWarning)
        HealBot_Options_SetText(HealBot_Options_SoundBuffWarning,HEALBOT_OPTIONS_SOUNDBUFFWARNING)
        HealBot_Options_BuffWarnRange4.initialize = HealBot_Options_BuffWarnRange4_DropDown
        UIDropDownMenu_SetText(HealBot_Options_BuffWarnRange4, HealBot_Options_Lists["RangeWarning"][HealBot_Config_Buffs.HealBot_CBWarnRange_Sound])
        HealBot_Options_SetSliderValue(HealBot_Options_BuffWarningSound,soundsIndex[HealBot_Config_Buffs.SoundBuffPlay])
        HealBot_Options_SetWarnBuffGroups()
        HealBot_Options_SetLabel("HealBot_Options_BuffWarnGroupTxt", HEALBOT_OPTIONS_RAIDGROUPWARN)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_TipsGeneralTab(tab)
        HealBot_Options_ShowTooltip:SetChecked(HealBot_Globals.ShowTooltip)
        HealBot_Options_SetText(HealBot_Options_ShowTooltip,HEALBOT_OPTIONS_SHOWTOOLTIP)
        HealBot_Options_HideTooltipInCombat:SetChecked(HealBot_Globals.DisableToolTipInCombat)
        HealBot_Options_SetText(HealBot_Options_HideTooltipInCombat,HEALBOT_OPTIONS_DISABLETOOLTIPINCOMBAT)
        HealBot_Options_UseGameTooltip:SetChecked(HealBot_Globals.Tooltip_UseGameTooltip)
        HealBot_Options_SetText(HealBot_Options_UseGameTooltip,HEALBOT_OPTIONS_USEGAMETOOLTIP)
        HealBot_Options_ShowTooltipShowUnitTip:SetChecked(HealBot_Globals.ShowGameUnitInfo)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipShowUnitTip,HEALBOT_OPTIONS_SHOWWOWTOOLTIP)
        HealBot_Options_sliderlabels_Init(HealBot_Options_TooltipScale,HEALBOT_OPTION_TOOLTIPSCALE,50,200,5,2,0.5,2)
        HealBot_Options_TooltipScale:SetValue(HealBot_Globals.Tooltip_Scale*100)
        HealBot_Options_SetText(HealBot_Options_TooltipScale, HEALBOT_OPTION_TOOLTIPSCALE..": "..HealBot_Globals.Tooltip_Scale) 
        HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_TooltipAlpha,HEALBOT_OPTIONS_ALPHA,0.25,1,0.01,5)
        HealBot_Options_TooltipAlpha:SetValue(HealBot_Globals.Tooltip_Alpha);
        HealBot_Options_Pct_OnValueChanged(HealBot_Options_TooltipAlpha)
        HealBot_Options_val_OnLoad(HealBot_Options_TooltipHeaderFontSize,HEALBOT_TOOLTIP_HEADERFONTSIZE,4,28,1,2)
        HealBot_Options_TooltipHeaderFontSize:SetValue(HealBot_Globals.Tooltip_HeaderFontSize or 14)
        HealBot_Options_SetText(HealBot_Options_TooltipHeaderFontSize,HEALBOT_TOOLTIP_HEADERFONTSIZE..": "..HealBot_Globals.Tooltip_HeaderFontSize)
        HealBot_Options_val_OnLoad(HealBot_Options_TooltipDetailFontSize,HEALBOT_TOOLTIP_DETAILFONTSIZE,4,28,1,2)
        HealBot_Options_TooltipDetailFontSize:SetValue(HealBot_Globals.Tooltip_DetailFontSize or 12)
        HealBot_Options_SetText(HealBot_Options_TooltipDetailFontSize,HEALBOT_TOOLTIP_DETAILFONTSIZE..": "..HealBot_Globals.Tooltip_DetailFontSize)
        HealBot_Options_UpdateMediaFont(HealBot_Options_TooltipHeaderFont,fontsIndex[HealBot_Globals.Tooltip_HeaderFont],HEALBOT_TOOLTIP_HEADERFONT)
        HealBot_Options_UpdateMediaFont(HealBot_Options_TooltipDetailFont,fontsIndex[HealBot_Globals.Tooltip_DetailFont],HEALBOT_TOOLTIP_DETAILFONT)
        g=_G["HealBot_Options_TipsGeneralbTxt"]
        g:SetText(HEALBOT_OPTIONS_TAB_GENERAL)
        HealBot_Options_SetTooltipState()
end

function HealBot_Options_TipsTargetTab(tab)
        HealBot_Options_ShowTooltipTarget:SetChecked(HealBot_Globals.Tooltip_ShowTarget)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipTarget,HEALBOT_OPTIONS_SHOWUNITTOOLTIP)
        HealBot_Options_ShowTooltipHealthLine:SetChecked(HealBot_Globals.Tooltip_ShowHealth)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipHealthLine,HEALBOT_TOOLTIP_SHOWHEALTH)
        HealBot_Options_ShowTooltipLevel:SetChecked(HealBot_Globals.Tooltip_ShowLevel)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipLevel,HEALBOT_TOOLTIP_SHOWLEVEL)
        HealBot_Options_ShowTooltipSpec:SetChecked(HealBot_Globals.Tooltip_ShowSpec)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipSpec,HEALBOT_TOOLTIP_SHOWSPEC)
        HealBot_Options_ShowTooltipManaLine:SetChecked(HealBot_Globals.Tooltip_ShowMana)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipManaLine,HEALBOT_TOOLTIP_SHOWMANA)
        HealBot_Options_ShowTooltipRanks:SetChecked(HealBot_Globals.Tooltip_ShowRank)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipRanks,HEALBOT_SHOW_RAIDRANK)
        HealBot_Options_ShowTooltipRoles:SetChecked(HealBot_Globals.Tooltip_ShowRole)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipRoles,HEALBOT_SHOW_PLAYERROLE)
        HealBot_Options_ShowTooltipHideRoleWhenRank:SetChecked(HealBot_Globals.Tooltip_HideRoleWhenRank)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipHideRoleWhenRank,HEALBOT_SHOW_HIDEROLEWHENRANK)
        HealBot_Options_ShowTooltipMyBuffs:SetChecked(HealBot_Globals.Tooltip_ShowMyBuffs)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipMyBuffs,HEALBOT_OPTIONS_SHOWUNITBUFFTIME)
        HealBot_Options_ShowTooltipRequiredBuffs:SetChecked(HealBot_Globals.Tooltip_ShowRequiredBuffs)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipRequiredBuffs,HEALBOT_OPTIONS_SHOWUNITBUFFREQUIRED)
        g=_G["HealBot_Options_TipsTargetbTxt"]
        g:SetText(HEALBOT_DISABLED_TARGET)
        HealBot_Options_SetTooltipState()
end

function HealBot_Options_TipsSpellsTab(tab)
        HealBot_Options_ShowTooltipSpellCoolDown:SetChecked(HealBot_Globals.Tooltip_ShowCD)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipSpellCoolDown,HEALBOT_OPTIONS_SHOWCDTOOLTIP)
        HealBot_Options_ShowTooltipSpellExtra:SetChecked(HealBot_Globals.Tooltip_ShowSpellExtra)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipSpellExtra,HEALBOT_TOOLTIP_SHOWSPELLEXTRA)
        HealBot_Options_ShowTooltipSpellInfo:SetChecked(HealBot_Globals.Tooltip_ShowSpellInfo)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipSpellInfo,HEALBOT_TOOLTIP_SHOWASSIGNEDSPELLS)
        HealBot_Options_ShowTooltipSpellIgnoreGlobalCoolDown:SetChecked(HealBot_Globals.Tooltip_IgnoreGCD)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipSpellIgnoreGlobalCoolDown,HEALBOT_OPTIONS_IGNOREGCDTOOLTIP)
        HealBot_Options_ShowTooltipShowHoT:SetChecked(HealBot_Globals.Tooltip_ShowHoT)
        HealBot_Options_SetText(HealBot_Options_ShowTooltipShowHoT,HEALBOT_OPTIONS_TOOLTIPSHOWHOT)
        HealBot_Options_val_OnLoad(HealBot_Options_TipMaxButtons,HEALBOT_OPTIONS_TTMAXBUTTONS,3,20,1,2)
        HealBot_Options_TipMaxButtons:SetValue(HealBot_Globals.Tooltip_MaxButtons)
        HealBot_Options_SetText(HealBot_Options_TipMaxButtons,HEALBOT_OPTIONS_TTMAXBUTTONS..": "..HealBot_Globals.Tooltip_MaxButtons)
        g=_G["HealBot_Options_TipsSpellsbTxt"]
        g:SetText(HEALBOT_OPTIONS_TAB_SPELLS)
        HealBot_Options_SetTooltipState()
end

function HealBot_Options_TipsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_BindsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_TestTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_TestBarsButton:SetText(HEALBOT_OPTIONS_TURNTESTBARSON)
        HealBot_Options_TestBarsProfile.initialize = HealBot_Options_TestBarsProfile_DropDown
        UIDropDownMenu_SetText(HealBot_Options_TestBarsProfile, HealBot_Options_TestBarsProfile_List[HealBot_Globals.TestBars["PROFILE"]])
        HealBot_Options_SetLabel("HealBot_Options_TestBarsProfileTxt",HEALBOT_WORDS_PROFILE)
        HealBot_Options_val_OnLoad(HealBot_Options_NumberTestTanks,HEALBOT_OPTION_NUMTANKS,0,8,1,2)
        HealBot_Options_NumberTestTanks:SetValue(HealBot_Globals.TestBars["TANKS"])
        HealBot_Options_SetText(HealBot_Options_NumberTestTanks,HEALBOT_OPTION_NUMTANKS..": "..HealBot_Globals.TestBars["TANKS"])
        HealBot_Options_val_OnLoad(HealBot_Options_NumberTestHealers,HEALBOT_OPTION_NUMHEALERS,0,12,1,2)
        HealBot_Options_NumberTestHealers:SetValue(HealBot_Globals.TestBars["HEALERS"])
        HealBot_Options_SetText(HealBot_Options_NumberTestHealers,HEALBOT_OPTION_NUMHEALERS..": "..HealBot_Globals.TestBars["HEALERS"])
        HealBot_Options_val_OnLoad(HealBot_Options_NumberTestMyTargets,HEALBOT_OPTION_NUMMYTARGETS,0,10,1,2)
        HealBot_Options_NumberTestMyTargets:SetValue(HealBot_Globals.TestBars["TARGETS"])
        HealBot_Options_SetText(HealBot_Options_NumberTestMyTargets,HEALBOT_OPTION_NUMMYTARGETS..": "..HealBot_Globals.TestBars["TARGETS"])
        HealBot_Options_val_OnLoad(HealBot_Options_NumberTestPets,HEALBOT_OPTION_NUMPETS,0,10,1,2)
        HealBot_Options_NumberTestPets:SetValue(HealBot_Globals.TestBars["PETS"])
        HealBot_Options_SetText(HealBot_Options_NumberTestPets,HEALBOT_OPTION_NUMPETS..": "..HealBot_Globals.TestBars["PETS"])
        HealBot_Options_val_OnLoad(HealBot_Options_NumberTestEnemy,HEALBOT_OPTION_NUMENEMYS,0,10,1,2)
        HealBot_Options_NumberTestEnemy:SetValue(HealBot_Globals.TestBars["ENEMY"])
        HealBot_Options_SetText(HealBot_Options_NumberTestEnemy,HEALBOT_OPTION_NUMENEMYS..": "..HealBot_Globals.TestBars["ENEMY"])
        HealBot_Options_TestShowDebuffIcons:SetChecked(HealBot_Globals.TestBarsIcons["DEBUFF"])
        HealBot_Options_SetText(HealBot_Options_TestShowDebuffIcons,HEALBOT_OPTION_DEBUFFICONS)
        HealBot_Options_TestShowBuffIcons:SetChecked(HealBot_Globals.TestBarsIcons["BUFF"])
        HealBot_Options_SetText(HealBot_Options_TestShowBuffIcons,HEALBOT_OPTION_BUFFICONS)
        HealBot_Options_TestShowExtraIcons:SetChecked(HealBot_Globals.TestBarsIcons["EXTRA"])
        HealBot_Options_SetText(HealBot_Options_TestShowExtraIcons,HEALBOT_OPTION_EXTRAICONS)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_ImportExportSkinsTab(tab)
    HealBot_Options_InOutSkin.initialize = HealBot_Options_InOutSkin_DropDown
    UIDropDownMenu_SetText(HealBot_Options_InOutSkin, Healbot_Config_Skins.Skins[HealBot_Options_luVars["InOutSkin"]])
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ShareSkinb:SetText(HEALBOT_OPTIONS_BUTTONEXPORT)
        local loaded = nil
        loaded = LoadAddOn("HealBot_ExtraSkins")
        if loaded then
            HealBot_Options_ExtraSkins.initialize = HealBot_Options_ExtraSkins_DropDown
        else
            HealBot_Options_ExtraSkins:Hide()
        end
        HealBot_Options_SetLabel("HealBot_Options_ExtraSkinst",HEALBOT_OPTIONS_EXTRASKINS)
        HealBot_Options_LoadSkinb:SetText(HEALBOT_OPTIONS_BUTTONIMPORT)
        HealBot_Options_InOutSkint:SetText(HEALBOT_OPTIONS_EXPORTSKIN)
        HealBot_Options_SetLabel("HealBot_Options_InOutSkint",HEALBOT_OPTIONS_EXPORTSKIN)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_ImportExportCustomDebuffsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ShareCDebuffb:SetText(HEALBOT_OPTIONS_BUTTONEXPORT)
        HealBot_Options_ImportMethodCDebuff.initialize = HealBot_Options_ImportMethodCDebuff_DropDown
        UIDropDownMenu_SetText(HealBot_Options_ImportMethodCDebuff, HealBot_Options_Lists["ImportMethods"][HealBot_Options_luVars["InMethodDebuff"]])
        HealBot_Options_LoadCDebuffb:SetText(HEALBOT_OPTIONS_BUTTONIMPORT)
        HealBot_Options_SetLabel("HealBot_Options_ImportMethodCDebufft",HEALBOT_OPTIONS_BUTTONIMPORTMETHOD)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_ImportExportCustomBuffsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ImportMethodBuffs.initialize = HealBot_Options_ImportMethodBuffs_DropDown
        UIDropDownMenu_SetText(HealBot_Options_ImportMethodBuffs, HealBot_Options_Lists["ImportMethods"][HealBot_Options_luVars["InMethodBuff"]])
        HealBot_Options_SetLabel("HealBot_Options_ImportMethodBuffst",HEALBOT_OPTIONS_BUTTONIMPORTMETHOD)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_ImportExportSpellsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_ImportMethodSpells.initialize = HealBot_Options_ImportMethodSpells_DropDown
        UIDropDownMenu_SetText(HealBot_Options_ImportMethodSpells, HealBot_Options_Lists["ImportMethods"][HealBot_Options_luVars["InMethodSpell"]])
        HealBot_Options_SetLabel("HealBot_Options_ImportMethodSpellst",HEALBOT_OPTIONS_BUTTONIMPORTMETHOD)
        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_ImportExportPresetColoursTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then

        HealBot_Options_TabRunOnce[tab]=true
    end
end

function HealBot_Options_PluginsTab(tab)
    if not HealBot_Options_TabRunOnce[tab] then
        HealBot_Options_Plugins.initialize = HealBot_Options_Plugins_DropDown
        UIDropDownMenu_SetText(HealBot_Options_Plugins, HealBot_Options_Lists["Plugins"][HealBot_Options_luVars["curPlugin"]])
        HealBot_Options_SetLabel("HealBot_Options_PluginsTxt",HEALBOT_OPTIONS_PLUGINS)
        HealBot_Options_SetLabel("HealBot_Options_PluginNATxt",HEALBOT_OPTIONS_PLUGIN_NA)
        HealBot_Options_SetLabel("HealBot_Options_PluginNAReasonTxt",HEALBOT_OPTIONS_PLUGIN_NA)
        HealBot_Options_Plugins_ShowFrame()
        HealBot_Options_TabRunOnce[tab]=true
    end
end

local HealBot_Options_TabFuncs={
                                ["About"]=HealBot_Options_AboutTab,
                                ["General"]=HealBot_Options_GeneralTab,
                                ["OverridesEffects"]=HealBot_Options_OverridesEffectsTab,
                                ["OverrideChat"]=HealBot_Options_OverrideChatTab,
                                ["OverrideFrames"]=HealBot_Options_OverrideFramesTab,
                                ["Spells"]=HealBot_Options_SpellsTab,
                                ["SkinsGeneral"]=HealBot_Options_SkinsGeneralTab,
                                ["SkinsEffects"]=HealBot_Options_SkinsEffectsTab,
                                ["SkinsEnemy"]=HealBot_Options_SkinsEnemyTab,
                                ["SkinsChat"]=HealBot_Options_SkinsChatTab,
                                ["SkinsFramesGeneral"]=HealBot_Options_SkinsFramesGeneralTab,
                                ["SkinsFramesHealGroups"]=HealBot_Options_SkinsFramesHealGroupsTab,
                                ["SkinsFramesHeadersBars"]=HealBot_Options_SkinsFramesHeadersBarsTab,
                                ["SkinsFramesHeadersFrames"]=HealBot_Options_SkinsFramesHeadersFramesTab,
                                ["SkinsFramesBarsGeneral"]=HealBot_Options_SkinsFramesBarsGeneralTab,
                                ["SkinsFramesBarsColour"]=HealBot_Options_SkinsFramesBarsColourTab,
                                ["SkinsFramesBarsSort"]=HealBot_Options_SkinsFramesBarsSortTab,
                                ["SkinsFramesBarsVisibility"]=HealBot_Options_SkinsFramesBarsVisibilityTab,
                                ["SkinsFramesBarsAggro"]=HealBot_Options_SkinsFramesBarsAggroTab,
                                ["SkinsFramesBarsAuxSettings"]=HealBot_Options_SkinsFramesBarsAuxSettingsTab,
                                ["SkinsFramesBarsAuxConfig"]=HealBot_Options_SkinsFramesBarsAuxConfigTab,
                                ["SkinsFramesTextNameText"]=HealBot_Options_SkinsFramesTextNameTextTab,
                                ["SkinsFramesTextNameColours"]=HealBot_Options_SkinsFramesTextNameColoursTab,
                                ["SkinsFramesTextHealthText"]=HealBot_Options_SkinsFramesTextHealthTextTab,
                                ["SkinsFramesTextHealthColours"]=HealBot_Options_SkinsFramesTextHealthColoursTab,
                                ["SkinsFramesTextHealthInHeals"]=HealBot_Options_SkinsFramesTextHealthInHealsTab,
                                ["SkinsFramesTextHealthOverheals"]=HealBot_Options_SkinsFramesTextHealthOverhealsTab,
                                ["SkinsFramesTextStateText"]=HealBot_Options_SkinsFramesTextStateTextTab,
                                ["SkinsFramesTextStateColours"]=HealBot_Options_SkinsFramesTextStateColoursTab,
                                ["SkinsFramesTextAggroText"]=HealBot_Options_SkinsFramesTextAggroTextTab,
                                ["SkinsFramesTextAggroColours"]=HealBot_Options_SkinsFramesTextAggroColoursTab,
                                ["SkinsFramesTextAuxText"]=HealBot_Options_SkinsFramesTextAuxTextTab,
                                ["SkinsFramesTextAuxColours"]=HealBot_Options_SkinsFramesTextAuxColoursTab,
                                ["SkinsFramesIconsDebuffsGeneral"]=HealBot_Options_SkinsFramesIconsDebuffsGeneralTab,
                                ["SkinsFramesIconsDebuffsText"]=HealBot_Options_SkinsFramesIconsDebuffsTextTab,
                                ["SkinsFramesIconsBuffsGeneral"]=HealBot_Options_SkinsFramesIconsBuffsGeneralTab,
                                ["SkinsFramesIconsBuffsText"]=HealBot_Options_SkinsFramesIconsBuffsTextTab,
                                ["SkinsFramesIconsExtrasClass"]=HealBot_Options_SkinsFramesIconsExtrasClassTab,
                                ["SkinsFramesIconsExtrasRaidTarget"]=HealBot_Options_SkinsFramesIconsExtrasRaidTargetTab,
                                ["SkinsFramesIconsExtrasReadyCheck"]=HealBot_Options_SkinsFramesIconsExtrasReadyCheckTab,
                                ["SkinsFramesIconsExtrasOORArrow"]=HealBot_Options_SkinsFramesIconsExtrasOORArrowTab,
                                ["SkinsFramesIndicatorsAggro"]=HealBot_Options_SkinsFramesIndicatorsAggroTab,
                                ["SkinsFramesIndicatorsLowMana"]=HealBot_Options_SkinsFramesIndicatorsLowManaTab,
                                ["SkinsFramesIndicatorsSelfCast"]=HealBot_Options_SkinsFramesIndicatorsSelfCastTab,
                                ["SkinsFramesIndicatorsPower"]=HealBot_Options_SkinsFramesIndicatorsPowerTab,
                                ["SkinsFramesEmergencyGeneral"]=HealBot_Options_SkinsFramesEmergencyGeneralTab,
                                ["SkinsFramesEmergencyColours"]=HealBot_Options_SkinsFramesEmergencyColoursTab,
                                ["DebuffsGeneral"]=HealBot_Options_DebuffsGeneralTab,
                                ["DebuffsCustom"]=HealBot_Options_DebuffsCustomTab,
                                ["DebuffsWarning"]=HealBot_Options_DebuffsWarningTab,
                                ["BuffsGeneralBuffs"]=HealBot_Options_BuffsGeneralBuffsTab,
                                ["BuffsExtraBuffs"]=HealBot_Options_BuffsExtraBuffsTab,
                                ["BuffsCustom"]=HealBot_Options_BuffsCustomTab,
                                ["BuffsWarning"]=HealBot_Options_BuffsWarningTab,
                                ["TipsGeneral"]=HealBot_Options_TipsGeneralTab,
                                ["TipsTarget"]=HealBot_Options_TipsTargetTab,
                                ["TipsSpells"]=HealBot_Options_TipsSpellsTab,
                                ["Binds"]=HealBot_Options_BindsTab,
                                ["Test"]=HealBot_Options_TestTab,
                                ["ImportExportSkins"]=HealBot_Options_ImportExportSkinsTab,
                                ["ImportExportCustomDebuffs"]=HealBot_Options_ImportExportCustomDebuffsTab,
                                ["ImportExportCustomBuffs"]=HealBot_Options_ImportExportCustomBuffsTab,
                                ["ImportExportSpells"]=HealBot_Options_ImportExportSpellsTab,
                                ["ImportExportPresetColours"]=HealBot_Options_ImportExportPresetColoursTab,
                                ["Plugins"]=HealBot_Options_PluginsTab,
                               }
local HealBot_Options_SubTabs={
                               ["Overrides"]="OverridesEffects",
                               ["SkinsFramesHeaders"]="SkinsFramesHeadersBars",
                               ["SkinsFramesBars"]="SkinsFramesBarsGeneral",
                               ["SkinsFramesBarsAux"]="SkinsFramesBarsAuxSettings",
                               ["SkinsFramesText"]="SkinsFramesTextNameText",
                               ["SkinsFramesTextName"]="SkinsFramesTextNameText",
                               ["SkinsFramesTextHealth"]="SkinsFramesTextHealthText",
                               ["SkinsFramesTextState"]="SkinsFramesTextStateText",
                               ["SkinsFramesTextAggro"]="SkinsFramesTextAggroText",
                               ["SkinsFramesTextAux"]="SkinsFramesTextAuxText",
                               ["SkinsFramesIcons"]="SkinsFramesIconsDebuffsGeneral",
                               ["SkinsFramesIconsDebuffs"]="SkinsFramesIconsDebuffsGeneral",
                               ["SkinsFramesIconsBuffs"]="SkinsFramesIconsBuffsGeneral",
                               ["SkinsFramesIconsExtras"]="SkinsFramesIconsExtrasClass",
                               ["SkinsFramesIndicators"]="SkinsFramesIndicatorsAggro",
                               ["SkinsFramesEmergency"]="SkinsFramesEmergencyGeneral",
                               ["BuffsGeneral"]="BuffsGeneralBuffs",
                               ["Tips"]="TipsGeneral",
                               ["ImportExport"]="ImportExportSkins",
                              }

function HealBot_Options_UpdateTab(tabNo, subTabNo, tab, isParent, subTab)
    if isParent then
        HealBot_Options_SubTabs[tab]=subTab or HealBot_Options_SubTabs[tab]
        tab=HealBot_Options_SubTabs[tab]
    end
    HealBot_Options_luVars["CurrentTab"]=tab or HealBot_Options_luVars["CurrentTab"] or "About"
    HealBot_Options_TabFuncs[HealBot_Options_luVars["CurrentTab"]](HealBot_Options_luVars["CurrentTab"])
    if tab and tab~="Spells" then HealBot_Options_luVars["SpellsTabOpenWarnId"]=0 end
    if tabNo then
        HealBot_Options_ShowPanel(tabNo, subTabNo)
    end
end

function HealBot_Options_ResetUpdate()
    HealBot_Options_TabRunOnce={}
    HealBot_Options_UpdateTab()
end

function HealBot_Options_SkinsFramesInit()
    HealBot_Options_Skins.initialize = HealBot_Options_Skins_DropDown
    UIDropDownMenu_SetText(HealBot_Options_Skins, Healbot_Config_Skins.Skins[Healbot_Config_Skins.Skin_ID])
    HealBot_Options_FrameAliasList()
    HealBot_Options_FramesSelFrame.initialize = HealBot_Options_FramesSelFrame_DropDown
    UIDropDownMenu_SetText(HealBot_Options_FramesSelFrame, HealBot_Options_HealGroupsFrame_List[HealBot_Options_luVars["FramesSelFrame"]])
    HealBot_Options_SetLabel("HealBot_PresetColours_AliasHeader",HEALBOT_OPTIONS_FRAME_ALIAS)
    HealBot_Options_SetLabel("HealBot_PresetColours_BarHeader",HEALBOT_OPTIONS_PRESET_COLOUR)
    for id=1,10 do
        f=_G["HealBot_PresetColourAlias"..id]
        f:SetText(HealBot_Globals.PresetColoursAlias[id])
        f=_G["HealBot_PresetColourpick"..id]
        HealBot_Globals.PresetColours[id].R=tonumber(HealBot_Globals.PresetColours[id].R or 1) or 1
        HealBot_Globals.PresetColours[id].G=tonumber(HealBot_Globals.PresetColours[id].G or 1) or 1
        HealBot_Globals.PresetColours[id].B=tonumber(HealBot_Globals.PresetColours[id].B or 1) or 1
        HealBot_Globals.PresetColours[id].A=tonumber(HealBot_Globals.PresetColours[id].A or 1) or 1
        f:SetStatusBarColor(HealBot_Globals.PresetColours[id].R,
                            HealBot_Globals.PresetColours[id].G,
                            HealBot_Globals.PresetColours[id].B,
                            HealBot_Globals.PresetColours[id].A)
    end
    HealBot_Options_InOutCompressExport:SetChecked(HealBot_Globals.CompressExport)
    HealBot_Options_SetText(HealBot_Options_InOutCompressExport,HEALBOT_OPTION_COMPRESSEXPORT)
    HealBot_Options_EFClass_Reset()
    HealBot_Comms_About()
    HealBot_Options_DisableHealBotOpt:SetChecked(HealBot_Config.DisableHealBot)
    HealBot_Options_DisableHealBotSolo:SetChecked(HealBot_Config.DisableSolo)
    HealBot_Options_SelectSpellsFrame:Hide()
    HealBot_Options_NewSkinb:Disable()
    HealBot_Options_SetLabel("HealBot_Options_ScaleFrameText",HEALBOT_OPTIONS_SKINTEXT)
    HealBot_Options_DeleteSkin:SetText(HEALBOT_OPTIONS_DELSKIN)
    HealBot_Options_SetLabel("HealBot_Options_ScaleFrameText2",HEALBOT_OPTIONS_NEWSKINTEXT)
    HealBot_Options_NewSkinb:SetText(HEALBOT_OPTIONS_SAVESKIN)
    HealBot_Options_ApplyTab2Frames:SetText(HEALBOT_OPTIONS_SET_ALL_FRAMES)
    HealBot_Options_SetLabel("HealBot_Options_SkinAuthorName",Healbot_Config_Skins.Author[Healbot_Config_Skins.Current_Skin])
    if HEALBOT_GAME_VERSION<4 then
        Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TAGSUM"]=""
        Healbot_Config_Skins.BarTextCol[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SUM"]=false
        for f=1,10 do
            for x=1,9 do
                if Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]>HealBot_Options_luVars["MaxClassicAuxBarAssign"] then
                    Healbot_Config_Skins.AuxBar[Healbot_Config_Skins.Current_Skin][x][f]["USE"]=1
                end
            end
        end
    end
    HealBot_setLuVars("TargetNeedReset", true)
    HealBot_setLuVars("FocusNeedReset", true)
    HealBot_Options_luVars["cSkin"]=Healbot_Config_Skins.Current_Skin
    HealBot_Options_luVars["SelectSpellsFrame"]=false
    HealBot_Options_SetLabel("HealBot_Options_FramesSelFrameFontStr",HEALBOT_OPTIONS_FRAME)
    if HealBot_Options_luVars["FramesSelFrame"]==10 then
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsEmergencyPanel"],false)
        HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesEmergencyTabNotAvail",true)
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsIndicatorsPanel"],false)
        HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesIndicatorsTabNotAvail",true)
    else
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsEmergencyPanel"],true)
        HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesEmergencyTabNotAvail",false)
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsIndicatorsPanel"],true)
        HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesIndicatorsTabNotAvail",false)
    end
    if HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsSort" then
        if HealBot_Options_luVars["FramesSelFrame"]>7 and HealBot_Options_luVars["FramesSelFrame"]<10 then
            HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsTabNotAvail",true)
            HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsBarsPanel"],false)
        else
            HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsBarsPanel"],true)
            HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsTabNotAvail",false)
        end
    elseif HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsAggro" then
        if HealBot_Options_luVars["FramesSelFrame"]==10 then
            HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsTabNotAvail",true)
            HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsBarsPanel"],false)
        else
            HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsBarsPanel"],true)
            HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsTabNotAvail",false)
        end
    else
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsBarsPanel"],true)
        HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsTabNotAvail",false)
    end
    if HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsColours" then
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsBarsPanel"],true)
    end
    HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsColoursCustom",false)
    if HealBot_Options_luVars["CurrentSkinsTextStatePanel"]=="HealBot_Options_SkinsFrameTextStateColour" then
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsTextStatePanel"],true)
    end
    if HealBot_Options_luVars["CurrentSkinsTextNamePanel"]=="HealBot_Options_SkinsFrameTextNameColour" then
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsTextNamePanel"],true)
    end
    if HealBot_Options_luVars["CurrentSkinsTextHealthPanel"]=="HealBot_Options_SkinsFrameTextHealthColour" then
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsTextHealthPanel"],true)
    end
    if HealBot_Options_luVars["CurrentSkinsTextAggroPanel"]=="HealBot_Options_SkinsFrameTextAggroColour" then
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsTextAggroPanel"],true)
    end
    HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesTextColoursCustom",false)
end

function HealBot_Options_CopyFrameTab()
    HealBot_Options_SetText(HealBot_Options_CopyTab1,HEALBOT_OPTIONS_TAB_GENERAL)
    HealBot_Options_SetText(HealBot_Options_CopyTab2,HEALBOT_OPTIONS_TAB_BARS)
    HealBot_Options_SetText(HealBot_Options_CopyTab3,HEALBOT_OPTIONS_TAB_FRAMES)
    HealBot_Options_SetText(HealBot_Options_CopyTab4,HEALBOT_OPTIONS_TAB_GENERAL)
    HealBot_Options_SetText(HealBot_Options_CopyTab5,HEALBOT_WORD_COLOURS)
    HealBot_Options_SetText(HealBot_Options_CopyTab6,HEALBOT_OPTIONS_TAB_SORT)
    HealBot_Options_SetText(HealBot_Options_CopyTab7,HEALBOT_OPTIONS_TAB_VISIBILITY)
    HealBot_Options_SetText(HealBot_Options_CopyTab8,HEALBOT_OPTIONS_TAB_AGGRO)
    HealBot_Options_SetText(HealBot_Options_CopyTab9,HEALBOT_OPTIONS_TAB_AUX)
    HealBot_Options_SetText(HealBot_Options_CopyTab23,HEALBOT_OPTIONS_TAB_STATETEXT)
    HealBot_Options_SetText(HealBot_Options_CopyTab10,HEALBOT_OPTIONS_TAB_NAMETEXT)
    HealBot_Options_SetText(HealBot_Options_CopyTab11,HEALBOT_WORD_HEALTH)
    HealBot_Options_SetText(HealBot_Options_CopyTab12,HEALBOT_OPTIONS_TAB_AGGRO)
    HealBot_Options_SetText(HealBot_Options_CopyTab13,HEALBOT_OPTIONS_TAB_AUX)
    HealBot_Options_SetText(HealBot_Options_CopyTab14,HEALBOT_OPTIONS_TAB_DEBUFFS)
    HealBot_Options_SetText(HealBot_Options_CopyTab15,HEALBOT_OPTIONS_TAB_BUFFS)
    HealBot_Options_SetText(HealBot_Options_CopyTab16,HEALBOT_OPTIONS_TAB_EXTRAS)
    HealBot_Options_SetText(HealBot_Options_CopyTab17,HEALBOT_OPTIONS_TAB_AGGRO)
    HealBot_Options_SetText(HealBot_Options_CopyTab18,HEALBOT_OPTIONS_LOWMANA)
    HealBot_Options_SetText(HealBot_Options_CopyTab22,HEALBOT_OPTIONS_SELFCASTIND)
    HealBot_Options_SetText(HealBot_Options_CopyTab19,HEALBOT_OPTIONS_POWER)
    HealBot_Options_SetText(HealBot_Options_CopyTab20,HEALBOT_OPTIONS_TAB_GENERAL)
    HealBot_Options_SetText(HealBot_Options_CopyTab21,HEALBOT_WORD_COLOURS)
end

function HealBot_Options_CustomColoursFrameTab()
    HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_CustomColourInjured,HEALBOT_OPTIONS_EMERGINJTRIG,0,1,0.01,5)
    HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_CustomColourCritical,HEALBOT_OPTIONS_EMERGCRITTRIG,0,1,0.01,5)
    HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourInjured)
    HealBot_Options_Pct_OnValueChanged(HealBot_Options_CustomColourCritical)
    HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_TextCustomColourInjured,HEALBOT_OPTIONS_EMERGINJTRIG,0,1,0.01,5)
    HealBot_Options_Pct_OnLoad_MinMax(HealBot_Options_TextCustomColourCritical,HEALBOT_OPTIONS_EMERGCRITTRIG,0,1,0.01,5)
    HealBot_Options_Pct_OnValueChanged(HealBot_Options_TextCustomColourInjured)
    HealBot_Options_Pct_OnValueChanged(HealBot_Options_TextCustomColourCritical)
end

function HealBot_Options_DebuffsTab()
    HealBot_Options_MonitorDebuffs:SetChecked(HealBot_Config_Cures.DebuffWatch)
    HealBot_Options_SetText(HealBot_Options_MonitorDebuffs,HEALBOT_OPTIONS_MONITORDEBUFFS)
    HealBot_Options_MonitorDebuffsInCombat:SetChecked(HealBot_Config_Cures.DebuffWatchInCombat)
    HealBot_Options_SetText(HealBot_Options_MonitorDebuffsInCombat,HEALBOT_OPTIONS_MONITORBUFFSC)
    HealBot_Options_MonitorDebuffsWhenGrouped:SetChecked(HealBot_Config_Cures.DebuffWatchWhenGrouped)
    HealBot_Options_SetText(HealBot_Options_MonitorDebuffsWhenGrouped,HEALBOT_OPTIONS_IN_A_GROUP)
    HealBot_Options_MonitorDebuffsWhenMounted:SetChecked(HealBot_Config_Cures.DebuffWatchWhenMounted)
    HealBot_Options_SetText(HealBot_Options_MonitorDebuffsWhenMounted,HEALBOT_OPTIONS_ALSO_WHEN_MOUNTED)
    HealBot_SetCDCBarColours()
end

function HealBot_Options_BuffsTab()
    HealBot_Options_MonitorBuffs:SetChecked(HealBot_Config_Buffs.BuffWatch)
    HealBot_Options_SetText(HealBot_Options_MonitorBuffs,HEALBOT_OPTIONS_MONITORBUFFS)
    HealBot_Options_MonitorBuffsInCombat:SetChecked(HealBot_Config_Buffs.BuffWatchInCombat)
    HealBot_Options_SetText(HealBot_Options_MonitorBuffsInCombat,HEALBOT_OPTIONS_MONITORBUFFSC)
    HealBot_Options_MonitorBuffsWhenGrouped:SetChecked(HealBot_Config_Buffs.BuffWatchWhenGrouped)
    HealBot_Options_SetText(HealBot_Options_MonitorBuffsWhenGrouped,HEALBOT_OPTIONS_IN_A_GROUP)
    HealBot_Options_MonitorBuffsWhenMounted:SetChecked(HealBot_Config_Buffs.BuffWatchWhenMounted)
    HealBot_Options_SetText(HealBot_Options_MonitorBuffsWhenMounted,HEALBOT_OPTIONS_ALSO_WHEN_MOUNTED)
    HealBot_Options_MonitorBuffsPalaBlessing:SetChecked(HealBot_Config_Buffs.PalaBlessingsAsOne)
    HealBot_Options_SetText(HealBot_Options_MonitorBuffsPalaBlessing,HEALBOT_OPTIONS_PALADIN_BLESSINGS)
    HealBot_Options_valtime_OnLoad(HealBot_Options_ShortBuffTimer,HEALBOT_OPTIONS_SHORTBUFFTIMER,0,120,5,6)
    HealBot_Options_ShortBuffTimer:SetValue(HealBot_Config_Buffs.ShortBuffTimer)
    HealBot_Options_BuffTimer_OnValueChanged(HealBot_Options_ShortBuffTimer,"SHORT")
    HealBot_Options_valtime_OnLoad(HealBot_Options_LongBuffTimer,HEALBOT_OPTIONS_LONGBUFFTIMER,0,300,15,4)
    HealBot_Options_LongBuffTimer:SetValue(HealBot_Config_Buffs.LongBuffTimer)
    HealBot_Options_BuffTimer_OnValueChanged(HealBot_Options_LongBuffTimer,"LONG")
    HealBot_Options_SetLabel("HealBot_Options_Panel5_4", HEALBOT_OPTIONS_BUFFSTEXTTIMER)
    HealBot_Timers_Set("AURA","BuffBarColours")
end

function HealBot_Options_EnemyTab()
    if HEALBOT_GAME_VERSION<2 then 
        HealBot_FocusOutOfCombat_Text:Hide()
        HealBot_Options_ShowEnemyIncArena:Hide()
        HealBot_Options_ShowEnemyIncArenaPets:Hide()
        HealBot_Options_ShowEnemyIncSelf:ClearAllPoints()
        HealBot_Options_ShowEnemyIncSelf:SetPoint("TOPLEFT",20,-95)
        HealBot_Options_ShowEnemyIncTanks:ClearAllPoints()
        HealBot_Options_ShowEnemyIncTanks:SetPoint("TOPLEFT",20,-170)
        HealBot_Options_ShowEnemyIncMyTargets:ClearAllPoints()
        HealBot_Options_ShowEnemyIncMyTargets:SetPoint("TOPLEFT",20,-245)
        HealBot_Options_EnemyExistsArena:Hide()
        HealBot_Options_EnemyCombatArena:Hide()
        HealBot_Options_ShowEnemyIncFocus:Hide()
        HealBot_Options_EnemyExistsFocus:Hide()
        HealBot_Options_EnemyCombatFocus:Hide()
        HealBot_Options_ShowEnemyNumBoss:Hide()
        HealBot_Options_EnemyExistsBosses:Hide()
    elseif HEALBOT_GAME_VERSION<3 then 
        HealBot_Options_ShowEnemyIncSelf:ClearAllPoints()
        HealBot_Options_ShowEnemyIncSelf:SetPoint("TOPLEFT",20,-45)
        HealBot_Options_ShowEnemyIncFocus:ClearAllPoints()
        HealBot_Options_ShowEnemyIncFocus:SetPoint("TOPLEFT",20,-105)
        HealBot_Options_ShowEnemyIncTanks:ClearAllPoints()
        HealBot_Options_ShowEnemyIncTanks:SetPoint("TOPLEFT",20,-165)
        HealBot_Options_ShowEnemyIncMyTargets:ClearAllPoints()
        HealBot_Options_ShowEnemyIncMyTargets:SetPoint("TOPLEFT",20,-225)
        HealBot_Options_ShowEnemyIncArena:ClearAllPoints()
        HealBot_Options_ShowEnemyIncArena:SetPoint("TOPLEFT",20,-285)
        HealBot_Options_ShowEnemyNumBoss:Hide()
        HealBot_Options_EnemyExistsBosses:Hide()
    end
end

function HealBot_Options_IndicatorsTab()
    local showPowerTab=false
    if HEALBOT_GAME_VERSION>3 then
        if HealBot_Data["PCLASSTRIM"]==HealBot_Class_En[HEALBOT_ROGUE] or
           HealBot_Data["PCLASSTRIM"]==HealBot_Class_En[HEALBOT_PALADIN] or
           HealBot_Data["PCLASSTRIM"]==HealBot_Class_En[HEALBOT_WARLOCK] or
           HealBot_Data["PCLASSTRIM"]==HealBot_Class_En[HEALBOT_MONK] or
           HealBot_Data["PCLASSTRIM"]==HealBot_Class_En[HEALBOT_DRUID] or
           HealBot_Data["PCLASSTRIM"]==HealBot_Class_En[HEALBOT_EVOKER] then
            showPowerTab=true
        end
    end
    if showPowerTab then
        HealBot_Options_SkinsFrameIndicatorsPowerb:Show()
        HealBot_Options_SkinsFrameIndicatorsAggrob:SetWidth(130)
        HealBot_Options_SkinsFrameIndicatorsAggrob:ClearAllPoints()
        HealBot_Options_SkinsFrameIndicatorsAggrob:SetPoint("TOP",-210,-10)
        HealBot_Options_SkinsFrameIndicatorsLowManab:SetWidth(130)
        HealBot_Options_SkinsFrameIndicatorsLowManab:ClearAllPoints()
        HealBot_Options_SkinsFrameIndicatorsLowManab:SetPoint("TOP",-70,-10)
        HealBot_Options_SkinsFrameIndicatorsSelfCastb:SetWidth(130)
        HealBot_Options_SkinsFrameIndicatorsSelfCastb:ClearAllPoints()
        HealBot_Options_SkinsFrameIndicatorsSelfCastb:SetPoint("TOP",70,-10)
        if HealBot_Data["PCLASSTRIM"]==HealBot_Class_En[HEALBOT_PALADIN] then
            HealBot_Options_ShowPowerCounterText:SetText(HEALBOT_OPTIONS_SHOWPOWERCOUNTER_PALA)
        elseif HealBot_Data["PCLASSTRIM"]==HealBot_Class_En[HEALBOT_ROGUE] then
            HealBot_Options_ShowPowerCounterText:SetText(HEALBOT_OPTIONS_SHOWPOWERCOUNTER_ROGU)
        elseif HealBot_Data["PCLASSTRIM"]==HealBot_Class_En[HEALBOT_WARLOCK] then
            HealBot_Options_ShowPowerCounterText:SetText(HEALBOT_OPTIONS_SHOWPOWERCOUNTER_WARL)
        elseif HealBot_Data["PCLASSTRIM"]==HealBot_Class_En[HEALBOT_MONK] then
            HealBot_Options_ShowPowerCounterText:SetText(HEALBOT_OPTIONS_SHOWPOWERCOUNTER_MONK)
        end
    else
        HealBot_Options_SkinsFrameIndicatorsPowerb:Hide()
        HealBot_Options_SkinsFrameIndicatorsAggrob:SetWidth(175)
        HealBot_Options_SkinsFrameIndicatorsAggrob:ClearAllPoints()
        HealBot_Options_SkinsFrameIndicatorsAggrob:SetPoint("TOP",-190,-10)
        HealBot_Options_SkinsFrameIndicatorsLowManab:SetWidth(175)
        HealBot_Options_SkinsFrameIndicatorsLowManab:ClearAllPoints()
        HealBot_Options_SkinsFrameIndicatorsLowManab:SetPoint("TOP",0,-10)
        HealBot_Options_SkinsFrameIndicatorsSelfCastb:SetWidth(175)
        HealBot_Options_SkinsFrameIndicatorsSelfCastb:ClearAllPoints()
        HealBot_Options_SkinsFrameIndicatorsSelfCastb:SetPoint("TOP",190,-10)
    end
end

function HealBot_Options_MediaUpdateFonts()
    HealBot_Options_UpdateMedia("Fonts")
end

function HealBot_Options_MediaUpdateTextures()
    HealBot_Options_UpdateMedia("Textures")
end

function HealBot_Options_MediaUpdateSounds()
    HealBot_Options_UpdateMedia("Sounds")
end

local HealBot_Options_ExtraTabFuncs={
                                     [1]=HealBot_Options_ResetUpdate,
                                     [2]=HealBot_SetSkinColours,
                                     [3]=HealBot_Options_SkinsFramesInit,
                                     [4]=HealBot_Options_CopyFrameTab,
                                     [5]=HealBot_Options_CustomColoursFrameTab,
                                     [6]=HealBot_Options_DebuffsTab,
                                     [7]=HealBot_Options_BuffsTab,
                                     [8]=HealBot_Options_EnemyTab,
                                     [9]=HealBot_Options_IndicatorsTab,
                                    [10]=HealBot_Options_MediaUpdateFonts,
                                    [11]=HealBot_Options_MediaUpdateTextures,
                                    [12]=HealBot_Options_MediaUpdateSounds,
                                    }

function HealBot_Options_DoInitExtras(tab)
    if HealBot_Options_ExtraTabFuncs[tab] then
        HealBot_Options_ExtraTabFuncs[tab]()
        C_Timer.After(0.02, function() HealBot_Options_DoInitExtras(tab+1) end)
    else
        HealBot_Options_luVars["RunInitExtras"]=false
    end
end

function HealBot_Options_InitExtras()
    if not HealBot_Options_luVars["RunInitExtras"] then
        HealBot_Options_luVars["RunInitExtras"]=true
        HealBot_Options_DoInitExtras(1)
    else
        HealBot_Timers_Set("LAST","OptionsInitExtraTabs",1)
    end
end

function HealBot_Options_SetTooltipState()
    if HealBot_Globals.ShowTooltip then
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HideTooltipInCombat",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipPosSettings",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipCustomAnchor",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipShowUnitTip",true)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_UseGameTooltip",true)
        if HealBot_Globals.Tooltip_UseGameTooltip then
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipHeaderFont",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipHeaderFontSize",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipDetailFont",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipDetailFontSize",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipScale",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipAlpha",false)
        else
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipHeaderFont",true)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipHeaderFontSize",true)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipDetailFont",true)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipDetailFontSize",true)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipScale",true)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipAlpha",true)
        end
        if HealBot_Globals.ShowGameUnitInfo then
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipTarget",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellInfo",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellExtra",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellCoolDown",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellIgnoreGlobalCoolDown",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipShowHoT",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipMyBuffs",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRequiredBuffs",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipLevel",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpec",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipHealthLine",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipManaLine",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRanks",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRoles",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipHideRoleWhenRank",false)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_TipMaxButtons",false)
        else
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipTarget",true)
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellInfo",true)
            if HealBot_Globals.Tooltip_ShowSpellInfo then
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellExtra",true)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellCoolDown",true)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellIgnoreGlobalCoolDown",true)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_TipMaxButtons",true)
            else
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellExtra",false)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellCoolDown",false)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellIgnoreGlobalCoolDown",false)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_TipMaxButtons",false)
            end
            HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipShowHoT",true)
            if HealBot_Globals.Tooltip_ShowTarget then
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipMyBuffs",true)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRequiredBuffs",true)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipLevel",true)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpec",true)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipHealthLine",true)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipManaLine",true)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRanks",true)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRoles",true)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipHideRoleWhenRank",true)
            else
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipMyBuffs",false)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRequiredBuffs",false)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipLevel",false)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpec",false)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipHealthLine",false)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipManaLine",false)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRanks",false)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRoles",false)
                HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipHideRoleWhenRank",false)
            end
        end
    else
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_HideTooltipInCombat",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipTarget",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipMyBuffs",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRequiredBuffs",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipLevel",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpec",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipHealthLine",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipManaLine",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRanks",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_UseGameTooltip",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipRoles",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipHideRoleWhenRank",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellInfo",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellExtra",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellCoolDown",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipSpellIgnoreGlobalCoolDown",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipShowUnitTip",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_ShowTooltipShowHoT",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipPosSettings",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipCustomAnchor",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_TipMaxButtons",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipScale",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipAlpha",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipHeaderFont",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipHeaderFontSize",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipDetailFont",false)
        HealBot_Options_ObjectsEnableDisable("HealBot_Options_TooltipDetailFontSize",false)
    end
end

function HealBot_Options_SetEFGroups()
    local g=nil
    for x=1,8 do
        g=_G["HealBot_Options_EFGroup"..x]
        if Healbot_Config_Skins.FocusGroups[Healbot_Config_Skins.Current_Skin][x] then 
            g:SetChecked(true)
        else
            g:SetChecked(false)
        end
        HealBot_Options_SetText(g,x)
        g=_G["HealBot_Options_OverrideEFGroup"..x]
        if HealBot_Globals.OverrideFocusGroups[x] then 
            g:SetChecked(true)
        else
            g:SetChecked(false)
        end
        HealBot_Options_SetText(g,x)
    end
end

function HealBot_Options_SetWarnCureGroups()
    local g=nil
    for x=1,8 do
        g=_G["HealBot_Options_CuresWarnGroup"..x]
        if HealBot_Config_Cures.ShowGroups[x] then 
            g:SetChecked(true)
        else
            g:SetChecked(false)
        end
        HealBot_Options_SetText(g,x)
    end
end

function HealBot_Options_SetWarnBuffGroups()
    local g=nil
    for x=1,8 do
        g=_G["HealBot_Options_BuffWarnGroup"..x]
        if HealBot_Config_Buffs.ShowGroups[x] then 
            g:SetChecked(true)
        else
            g:SetChecked(false)
        end
        HealBot_Options_SetText(g,x)
    end
end

local HealBot_disabledState=-1
hbCurSkin=Healbot_Config_Skins.Current_Skin
function HealBot_Options_SetSkins(force)
    if hbCurSkin~=Healbot_Config_Skins.Current_Skin or force then
        if hbCurSkin~=Healbot_Config_Skins.Current_Skin then
            HealBot_Options_luVars["HeaderSwitchNumColsHdrOn"]=0
            HealBot_Options_luVars["HeaderSwitchNumColsHdrOff"]=0
            HealBot_Panel_resetInitFrames()
            HealBot_Action_setLuVars("resetIcon", true)
            HealBot_Action_setLuVars("resetSkin", true)
            HealBot_Action_setLuVars("resetIndicator", true)
            HealBot_Action_setLuVars("resetText", true)
            HealBot_Action_setLuVars("resetAux", true)
            HealBot_Aura_RemoveExtraIcons(91)
            HealBot_Aura_RemoveExtraIcons(92)
            HealBot_Aura_RemoveExtraIcons(93)
            HealBot_Aura_RemoveExtraIcons(94)
            HealBot_Timers_Set("AURA","RaidTargetUpdateAll")
            HealBot_Aux_resetBars()
            HealBot_Timers_Set("SKINS","SkinsFormat")
            HealBot_Timers_Set("SKINS","SkinColours")
            HealBot_Timers_Set("SKINS","SetSkinBars")
            HealBot_Timers_Set("SKINS","SetSkinText")
        end
        if Healbot_Config_Skins.Current_Skin==HEALBOT_SKINS_STD then
            HealBot_Options_DeleteSkin:Disable();
        else
            HealBot_Options_DeleteSkin:Enable();
        end
        HealBot_Options_RaidTargetUpdate()
        HealBot_Options_CheckReadyCheckEvent()
        hbCurSkin=Healbot_Config_Skins.Current_Skin
    end
end

function HealBot_Options_SetSkinText()
    local btextoutline=Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"];
    HealBot_HeadBarColorpickt:SetFont(LSM:Fetch('font',Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]),
                                       Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"],
                                       HealBot_Font_Outline[Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]]);
    HealBot_HeadTextColorpickt:SetFont(LSM:Fetch('font',Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]),
                                       Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"],
                                       HealBot_Font_Outline[Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]]);
    HealBot_FrameAliasColorpickt:SetFont(LSM:Fetch('font',Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]),
                                       Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIZE"],
                                       HealBot_Font_Outline[Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]]);
    HealBot_FrameAliasTextColorpickt:SetFont(LSM:Fetch('font',Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]),
                                       Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SIZE"],
                                       HealBot_Font_Outline[Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["OUTLINE"]]);
    HealBot_BarHealthyCustomColourt:SetFont(LSM:Fetch('font',Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]),
                                       Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"],
                                       HealBot_Font_Outline[btextoutline]);
    HealBot_BarInjuredCustomColourt:SetFont(LSM:Fetch('font',Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]),
                                       Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"],
                                       HealBot_Font_Outline[btextoutline]);
    HealBot_BarCriticalCustomColourt:SetFont(LSM:Fetch('font',Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]),
                                       Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HEIGHT"],
                                       HealBot_Font_Outline[btextoutline]);
    HealBot_UpdateUsedMedia("font")
end

function HealBot_Options_SetSkinBars()
    HealBot_DiseaseColorpick:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_MagicColorpick:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_PoisonColorpick:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_CurseColorpick:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_CustomColorpick:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_BuffCustomColorpick:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_PresetColourpick1:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_PresetColourpick2:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_PresetColourpick3:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_PresetColourpick4:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_PresetColourpick5:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_PresetColourpick6:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_PresetColourpick7:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_PresetColourpick8:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_PresetColourpick9:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_PresetColourpick10:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_HeadBarColorpick:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_HeadTextColorpick:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_FrameAliasColorpick:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_FrameAliasTextColorpick:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff1Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff2Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff3Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff4Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff5Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff6Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff7Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff8Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff9Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff10Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff11Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff12Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff13Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff14Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_Buff15Colour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_NameTextDeadCol:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_StateTextDeadCol:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_NameTextResCol:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_StateTextResCol:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_NameTextSummonCol:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_StateTextSummonCol:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_AuxTextCustomColour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_ExtraOverHealCustomColour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_ExtraInHealCustomColour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_ExtraHealthCustomColour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_AuxBarCustomColour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_BarHealthyCustomColour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_BarInjuredCustomColour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_BarCriticalCustomColour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_EmergCustomColCrit:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_EmergCustomColInj:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_EmergCustomColHealthy:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]));
    HealBot_TextHealthyCustomColour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_TextInjuredCustomColour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_TextCriticalCustomColour:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]))
    HealBot_Options_SetLabel("HealBot_Options_SkinAuthorName",Healbot_Config_Skins.Author[Healbot_Config_Skins.Current_Skin])
    HealBot_DiseaseColorpick:GetStatusBarTexture():SetHorizTile(false)
    HealBot_MagicColorpick:GetStatusBarTexture():SetHorizTile(false)
    HealBot_PoisonColorpick:GetStatusBarTexture():SetHorizTile(false)
    HealBot_CurseColorpick:GetStatusBarTexture():SetHorizTile(false)
    HealBot_CustomColorpick:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BuffCustomColorpick:GetStatusBarTexture():SetHorizTile(false)
    HealBot_PresetColourpick1:GetStatusBarTexture():SetHorizTile(false)
    HealBot_PresetColourpick2:GetStatusBarTexture():SetHorizTile(false)
    HealBot_PresetColourpick3:GetStatusBarTexture():SetHorizTile(false)
    HealBot_PresetColourpick4:GetStatusBarTexture():SetHorizTile(false)
    HealBot_PresetColourpick5:GetStatusBarTexture():SetHorizTile(false)
    HealBot_PresetColourpick6:GetStatusBarTexture():SetHorizTile(false)
    HealBot_PresetColourpick7:GetStatusBarTexture():SetHorizTile(false)
    HealBot_PresetColourpick8:GetStatusBarTexture():SetHorizTile(false)
    HealBot_PresetColourpick9:GetStatusBarTexture():SetHorizTile(false)
    HealBot_PresetColourpick10:GetStatusBarTexture():SetHorizTile(false)
    HealBot_HeadBarColorpick:GetStatusBarTexture():SetHorizTile(false)
    HealBot_HeadTextColorpick:GetStatusBarTexture():SetHorizTile(false)
    HealBot_FrameAliasColorpick:GetStatusBarTexture():SetHorizTile(false)
    HealBot_FrameAliasTextColorpick:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff1Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff2Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff3Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff4Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff5Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff6Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff7Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff8Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff9Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff10Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff11Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff12Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff13Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff14Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Buff15Colour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomHealthColourHealthy:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomHealthColourCritical:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomHealthColourInjured:GetStatusBarTexture():SetHorizTile(false)
    HealBot_NameTextCustomColourCritical:GetStatusBarTexture():SetHorizTile(false)
    HealBot_NameTextCustomColourInjured:GetStatusBarTexture():SetHorizTile(false)
    HealBot_NameTextCustomColourHealthy:GetStatusBarTexture():SetHorizTile(false)
    HealBot_StateTextCustomColourHealthy:GetStatusBarTexture():SetHorizTile(false)
    HealBot_StateTextCustomColourInjured:GetStatusBarTexture():SetHorizTile(false)
    HealBot_StateTextCustomColourCritical:GetStatusBarTexture():SetHorizTile(false)
    HealBot_NameTextDeadCol:GetStatusBarTexture():SetHorizTile(false)
    HealBot_StateTextDeadCol:GetStatusBarTexture():SetHorizTile(false)
    HealBot_NameTextResCol:GetStatusBarTexture():SetHorizTile(false)
    HealBot_StateTextResCol:GetStatusBarTexture():SetHorizTile(false)
    HealBot_NameTextSummonCol:GetStatusBarTexture():SetHorizTile(false)
    HealBot_StateTextSummonCol:GetStatusBarTexture():SetHorizTile(false)
    HealBot_EmergCustomColCrit:GetStatusBarTexture():SetHorizTile(false)
    HealBot_EmergCustomColInj:GetStatusBarTexture():SetHorizTile(false)
    HealBot_EmergCustomColHealthy:GetStatusBarTexture():SetHorizTile(false)
    HealBot_AuxTextCustomColour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_ExtraOverHealCustomColour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_ExtraInHealCustomColour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_ExtraHealthCustomColour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_AuxBarCustomColour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_HealthTextCustomColourHealthy:GetStatusBarTexture():SetHorizTile(false)
    HealBot_HealthTextCustomColourInjured:GetStatusBarTexture():SetHorizTile(false)
    HealBot_HealthTextCustomColourCritical:GetStatusBarTexture():SetHorizTile(false)
    HealBot_AggroTextCustomColourHealthy:GetStatusBarTexture():SetHorizTile(false)
    HealBot_AggroTextCustomColourInjured:GetStatusBarTexture():SetHorizTile(false)
    HealBot_AggroTextCustomColourCritical:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomHealthBackColourHealthy:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomHealthBackColourInjured:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomHealthBackColourCritical:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomBorderColourHealthy:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomBorderColourInjured:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomBorderColourCritical:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomIHColourHealthy:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomIHColourInjured:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomIHColourCritical:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomAbsorbColourHealthy:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomAbsorbColourInjured:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCustomAbsorbColourCritical:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarHealthyCustomColour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarInjuredCustomColour:GetStatusBarTexture():SetHorizTile(false)
    HealBot_BarCriticalCustomColour:GetStatusBarTexture():SetHorizTile(false)
    local barScale = HealBot_BarCustomHealthColourHealthy:GetScale();
    HealBot_BarCustomHealthColourHealthy:SetScale(barScale + 0.01);
    HealBot_BarCustomHealthColourHealthy:SetScale(barScale);
    HealBot_BarCustomHealthColourCritical:SetScale(barScale + 0.01);
    HealBot_BarCustomHealthColourCritical:SetScale(barScale);
    HealBot_BarCustomHealthColourInjured:SetScale(barScale + 0.01);
    HealBot_BarCustomHealthColourInjured:SetScale(barScale);
    HealBot_NameTextCustomColourHealthy:SetScale(barScale + 0.01)
    HealBot_NameTextCustomColourHealthy:SetScale(barScale)
    HealBot_NameTextCustomColourInjured:SetScale(barScale + 0.01)
    HealBot_NameTextCustomColourInjured:SetScale(barScale)
    HealBot_NameTextCustomColourCritical:SetScale(barScale + 0.01)
    HealBot_NameTextCustomColourCritical:SetScale(barScale)
    HealBot_StateTextCustomColourHealthy:SetScale(barScale + 0.01)
    HealBot_StateTextCustomColourHealthy:SetScale(barScale)
    HealBot_StateTextCustomColourInjured:SetScale(barScale + 0.01)
    HealBot_StateTextCustomColourInjured:SetScale(barScale)
    HealBot_StateTextCustomColourCritical:SetScale(barScale + 0.01)
    HealBot_StateTextCustomColourCritical:SetScale(barScale)
    HealBot_NameTextDeadCol:SetScale(barScale + 0.01)
    HealBot_NameTextDeadCol:SetScale(barScale)
    HealBot_StateTextDeadCol:SetScale(barScale + 0.01)
    HealBot_StateTextDeadCol:SetScale(barScale)
    HealBot_NameTextResCol:SetScale(barScale + 0.01)
    HealBot_NameTextResCol:SetScale(barScale)
    HealBot_StateTextResCol:SetScale(barScale + 0.01)
    HealBot_StateTextResCol:SetScale(barScale)
    HealBot_NameTextSummonCol:SetScale(barScale + 0.01)
    HealBot_NameTextSummonCol:SetScale(barScale)
    HealBot_StateTextSummonCol:SetScale(barScale + 0.01)
    HealBot_StateTextSummonCol:SetScale(barScale)
    HealBot_EmergCustomColCrit:SetScale(barScale + 0.01)
    HealBot_EmergCustomColCrit:SetScale(barScale)
    HealBot_EmergCustomColInj:SetScale(barScale + 0.01)
    HealBot_EmergCustomColInj:SetScale(barScale)
    HealBot_EmergCustomColHealthy:SetScale(barScale + 0.01)
    HealBot_EmergCustomColHealthy:SetScale(barScale)
    HealBot_AuxTextCustomColour:SetScale(barScale + 0.01)
    HealBot_AuxTextCustomColour:SetScale(barScale)
    HealBot_ExtraOverHealCustomColour:SetScale(barScale + 0.01)
    HealBot_ExtraOverHealCustomColour:SetScale(barScale)
    HealBot_ExtraInHealCustomColour:SetScale(barScale + 0.01)
    HealBot_ExtraInHealCustomColour:SetScale(barScale)
    HealBot_ExtraHealthCustomColour:SetScale(barScale + 0.01)
    HealBot_ExtraHealthCustomColour:SetScale(barScale)
    HealBot_AuxBarCustomColour:SetScale(barScale + 0.01)
    HealBot_AuxBarCustomColour:SetScale(barScale)
    HealBot_HealthTextCustomColourHealthy:SetScale(barScale + 0.01)
    HealBot_HealthTextCustomColourHealthy:SetScale(barScale)
    HealBot_HealthTextCustomColourInjured:SetScale(barScale + 0.01)
    HealBot_HealthTextCustomColourInjured:SetScale(barScale)
    HealBot_HealthTextCustomColourCritical:SetScale(barScale + 0.01)
    HealBot_HealthTextCustomColourCritical:SetScale(barScale)
    HealBot_AggroTextCustomColourHealthy:SetScale(barScale + 0.01)
    HealBot_AggroTextCustomColourHealthy:SetScale(barScale)
    HealBot_AggroTextCustomColourInjured:SetScale(barScale + 0.01)
    HealBot_AggroTextCustomColourInjured:SetScale(barScale)
    HealBot_AggroTextCustomColourCritical:SetScale(barScale + 0.01)
    HealBot_AggroTextCustomColourCritical:SetScale(barScale)
    HealBot_BarCustomHealthBackColourHealthy:SetScale(barScale + 0.01);
    HealBot_BarCustomHealthBackColourHealthy:SetScale(barScale);
    HealBot_BarCustomHealthBackColourInjured:SetScale(barScale + 0.01);
    HealBot_BarCustomHealthBackColourInjured:SetScale(barScale);
    HealBot_BarCustomHealthBackColourCritical:SetScale(barScale + 0.01);
    HealBot_BarCustomHealthBackColourCritical:SetScale(barScale);
    HealBot_BarCustomBorderColourHealthy:SetScale(barScale + 0.01);
    HealBot_BarCustomBorderColourHealthy:SetScale(barScale);
    HealBot_BarCustomBorderColourInjured:SetScale(barScale + 0.01);
    HealBot_BarCustomBorderColourInjured:SetScale(barScale);
    HealBot_BarCustomBorderColourCritical:SetScale(barScale + 0.01);
    HealBot_BarCustomBorderColourCritical:SetScale(barScale);
    HealBot_BarCustomIHColourHealthy:SetScale(barScale + 0.01);
    HealBot_BarCustomIHColourHealthy:SetScale(barScale);
    HealBot_BarCustomIHColourInjured:SetScale(barScale + 0.01);
    HealBot_BarCustomIHColourInjured:SetScale(barScale);
    HealBot_BarCustomIHColourCritical:SetScale(barScale + 0.01);
    HealBot_BarCustomIHColourCritical:SetScale(barScale);
    HealBot_BarCustomAbsorbColourHealthy:SetScale(barScale + 0.01);
    HealBot_BarCustomAbsorbColourHealthy:SetScale(barScale);
    HealBot_BarCustomAbsorbColourInjured:SetScale(barScale + 0.01);
    HealBot_BarCustomAbsorbColourInjured:SetScale(barScale);
    HealBot_BarCustomAbsorbColourCritical:SetScale(barScale + 0.01);
    HealBot_BarCustomAbsorbColourCritical:SetScale(barScale);
    HealBot_BarHealthyCustomColour:SetScale(barScale + 0.01);
    HealBot_BarHealthyCustomColour:SetScale(barScale);
    HealBot_BarInjuredCustomColour:SetScale(barScale + 0.01);
    HealBot_BarInjuredCustomColour:SetScale(barScale);
    HealBot_BarCriticalCustomColour:SetScale(barScale + 0.01);
    HealBot_BarCriticalCustomColour:SetScale(barScale);
    HealBot_UpdateUsedMedia("statusbar")
end

function HealBot_Options_ShowPanel(tabNo, subTabNo)
    local g=nil
    HealBot_Options_PresetColours:Hide()

    if HealBot_Options_luVars["PrevTabNo"] and HealBot_Options_luVars["PrevTabNo"]~=tabNo then
        g=_G["HealBot_Options_Panel"..HealBot_Options_luVars["PrevTabNo"]]
        g:Hide();
        g=_G["HealBot_Contents_ButtonT"..HealBot_Options_luVars["PrevTabNo"]]
        g:SetStatusBarColor(0.2,0.2,0.2,0)
        g=_G["HealBot_Contents_ButtonT"..HealBot_Options_luVars["PrevTabNo"].."Txt"]
        g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],OptionThemes[HealBot_Globals.OptionsTheme]["G"],OptionThemes[HealBot_Globals.OptionsTheme]["B"],OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    end
    if HealBot_Options_luVars["subTabNo3"] then
        g=_G["HealBot_Contents_ButtonT"..HealBot_Options_luVars["subTabNo3"].."Txt"]
        g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],OptionThemes[HealBot_Globals.OptionsTheme]["G"],OptionThemes[HealBot_Globals.OptionsTheme]["B"],OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    end
    if HealBot_Options_luVars["subTabNo4"] then
        g=_G["HealBot_Contents_ButtonT"..HealBot_Options_luVars["subTabNo4"].."Txt"]
        g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],OptionThemes[HealBot_Globals.OptionsTheme]["G"],OptionThemes[HealBot_Globals.OptionsTheme]["B"],OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    end
    if HealBot_Options_luVars["subTabNo5"] then
        g=_G["HealBot_Contents_ButtonT"..HealBot_Options_luVars["subTabNo5"].."Txt"]
        g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],OptionThemes[HealBot_Globals.OptionsTheme]["G"],OptionThemes[HealBot_Globals.OptionsTheme]["B"],OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    end
    if HealBot_Options_luVars["subTabNo9"] then
        g=_G["HealBot_Contents_ButtonT"..HealBot_Options_luVars["subTabNo9"].."Txt"]
        g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],OptionThemes[HealBot_Globals.OptionsTheme]["G"],OptionThemes[HealBot_Globals.OptionsTheme]["B"],OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    end
    if tabNo==3 and not subTabNo and not HealBot_Options_luVars["subTabNo3"] then subTabNo=301 end
    if tabNo==4 and not subTabNo and not HealBot_Options_luVars["subTabNo4"] then subTabNo=41 end
    if tabNo==5 and not subTabNo and not HealBot_Options_luVars["subTabNo5"] then subTabNo=51 end
    HealBot_Options_luVars["TabNo"] = tabNo;
    
    if subTabNo then 
        if tabNo==3 then
            HealBot_Options_luVars["subTabNo3"]=subTabNo
        elseif tabNo==4 then
            HealBot_Options_luVars["subTabNo4"]=subTabNo
        elseif tabNo==5 then
            HealBot_Options_luVars["subTabNo5"]=subTabNo
        elseif tabNo==9 then
            HealBot_Options_luVars["subTabNo9"]=subTabNo
        end
        if subTabNo==51 then
            HealBot_Options_MonitorBuffsInCombat:Show()
            HealBot_Options_MonitorBuffsWhenGrouped:Show()
            HealBot_Options_MonitorBuffsWhenMounted:Show()
            if HealBot_Data["PCLASSTRIM"]==HealBot_Class_En[HEALBOT_PALADIN] and HEALBOT_GAME_VERSION<4 then
                HealBot_Options_MonitorBuffsPalaBlessing:Show()
            else
                HealBot_Options_MonitorBuffsPalaBlessing:Hide()
            end
        elseif subTabNo>51 and subTabNo<54 then
            HealBot_Options_MonitorBuffsInCombat:Hide()
            HealBot_Options_MonitorBuffsWhenGrouped:Hide()
            HealBot_Options_MonitorBuffsPalaBlessing:Hide()
            HealBot_Options_MonitorBuffsWhenMounted:Hide()
        end
    end;

    g=_G["HealBot_Options_Panel"..tabNo]
    g:Show();
    g=_G["HealBot_Contents_ButtonT"..tabNo]
    g:SetStatusBarColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],
                        OptionThemes[HealBot_Globals.OptionsTheme]["G"],
                        OptionThemes[HealBot_Globals.OptionsTheme]["B"],
                        OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    g=_G["HealBot_Contents_ButtonT"..tabNo.."Txt"]
    g:SetTextColor(1,1,1,1)

    if tabNo==3 and HealBot_Options_luVars["subTabNo3"]>308 and HealBot_Options_luVars["subTabNo3"]<399 then
        g=_G["HealBot_Contents_ButtonT308Txt"]
        g:SetTextColor(1,1,1,1)
    else
        g=_G["HealBot_Contents_ButtonT308Txt"]
        g:SetTextColor(OptionThemes[HealBot_Globals.OptionsTheme]["R"],OptionThemes[HealBot_Globals.OptionsTheme]["G"],OptionThemes[HealBot_Globals.OptionsTheme]["B"],OptionThemes[HealBot_Globals.OptionsTheme]["A"])
    end
    HealBot_Options_luVars["PrevTabNo"] = tabNo;
    if subTabNo then
        g=_G["HealBot_Contents_ButtonT"..subTabNo.."Txt"]
        g:SetTextColor(1,1,1,1)
    elseif tabNo==3 then
        if HealBot_Options_luVars["subTabNo3"] then
            g=_G["HealBot_Contents_ButtonT"..HealBot_Options_luVars["subTabNo3"].."Txt"]
            g:SetTextColor(1,1,1,1)
        else
            g=_G["HealBot_Contents_ButtonT301Txt"]
            g:SetTextColor(1,1,1,1)
        end
    elseif tabNo==4 then
        if HealBot_Options_luVars["subTabNo4"] then
            g=_G["HealBot_Contents_ButtonT"..HealBot_Options_luVars["subTabNo4"].."Txt"]
            g:SetTextColor(1,1,1,1)
        else
            g=_G["HealBot_Contents_ButtonT41Txt"]
            g:SetTextColor(1,1,1,1)
        end
    elseif tabNo==5 then
        if HealBot_Options_luVars["subTabNo5"] then
            g=_G["HealBot_Contents_ButtonT"..HealBot_Options_luVars["subTabNo5"].."Txt"]
            g:SetTextColor(1,1,1,1)
        else
            g=_G["HealBot_Contents_ButtonT51Txt"]
            g:SetTextColor(1,1,1,1)
        end
    end
    HealBot_Options_luVars["PanelShown"]=true
end

HealBot_Options_luVars["CurrentOverridePanel"]="HealBot_Options_Override_EffectsFrame"
HealBot_Options_luVars["CurrentOverridePanelButton"]="HealBot_Options_OverrideEffectb"
function HealBot_Options_ShowOverridePanel(frameName, buttonName, tab)
    HealBot_Options_UpdateTab(nil, nil, "Overrides", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentOverridePanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentOverridePanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentOverridePanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentOverridePanel"]=frameName
    HealBot_Options_luVars["CurrentOverridePanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentOverridePanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentOverridePanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentTipsPanel"]="HealBot_Options_TipsGeneralFrame"
HealBot_Options_luVars["CurrentTipsPanelButton"]="HealBot_Options_TipsGeneralb"
function HealBot_Options_ShowTipsPanel(frameName, buttonName, tab)
    HealBot_Options_UpdateTab(nil, nil, "Tips", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentTipsPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentTipsPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentTipsPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentTipsPanel"]=frameName
    HealBot_Options_luVars["CurrentTipsPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentTipsPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentTipsPanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentInOutPanel"]="HealBot_Options_InOut_SkinFrame"
HealBot_Options_luVars["CurrentInOutPanelButton"]="HealBot_Options_InOutSkinb"
function HealBot_Options_ShowInOutPanel(frameName, buttonName, tab)
    HealBot_Options_UpdateTab(nil, nil, "ImportExport", true, tab)
    if HealBot_Options_luVars["CurrentInOutPanel"]~=frameName then
        HealBot_Options_ExtraSkins_Image(false)
        HealBot_Share_ClosePostLink()
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentInOutPanel"],false)
        HealBot_Options_ObjectsShowHide(frameName,true)
        HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentInOutPanelButton"]],
                                            _G[HealBot_Options_luVars["CurrentInOutPanelButton"].."Txt"],false)
        HealBot_Options_luVars["CurrentInOutPanel"]=frameName
        HealBot_Options_luVars["CurrentInOutPanelButton"]=buttonName
        HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentInOutPanelButton"]],
                                            _G[HealBot_Options_luVars["CurrentInOutPanelButton"].."Txt"],true)
    end
end

HealBot_Options_luVars["CurrentBuffsGeneralPanel"]="HealBot_Options_BuffsPanelGeneralBuffs"
HealBot_Options_luVars["CurrentBuffsGeneralPanelButton"]="HealBot_Options_BuffsPanelGeneralBuffsb"
function HealBot_Options_BuffsGeneralPanel(frameName, buttonName, tab)
    HealBot_Options_UpdateTab(nil, nil, "BuffsGeneral", true, tab)
    if frameName=="HealBot_Options_BuffsPanelGeneralBuffs" then
        HealBot_Options_ObjectsShowHide("HealBot_Options_BuffsPanelTimers",true)
    else
        HealBot_Options_ObjectsShowHide("HealBot_Options_BuffsPanelTimers",false)
    end
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentBuffsGeneralPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentBuffsGeneralPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentBuffsGeneralPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentBuffsGeneralPanel"]=frameName
    HealBot_Options_luVars["CurrentBuffsGeneralPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentBuffsGeneralPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentBuffsGeneralPanelButton"].."Txt"],true)
end

function HealBot_Options_CopyFramesSelect(All)
    local g
    for x=1,9 do
        g=_G["HealBot_Options_CopyFrame"..x]
        g:SetChecked(All)
    end
end

function HealBot_Options_CopyTabsSelect(All)
    local g
    for x=1,23 do
        g=_G["HealBot_Options_CopyTab"..x]
        g:SetChecked(All)
    end
end

function HealBot_Options_InitCopyTabs()
    HealBot_Options_CopyTabsSelect(false)
    HealBot_Options_CopyFramesSelect(false)
    local g
    if hbCurSkinSubFrameID==1008 then
        g=_G["HealBot_Options_CopyTab1"]
    elseif hbCurSkinSubFrameID==1010 then
        if HealBot_Options_luVars["CurrentSkinsHeaderPanel"]=="HealBot_Options_SkinsFrameHeadersBar" then
            g=_G["HealBot_Options_CopyTab2"]
        else
            g=_G["HealBot_Options_CopyTab3"]
        end
    elseif hbCurSkinSubFrameID==1011 then
        if HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsGeneral" then
            g=_G["HealBot_Options_CopyTab4"]
        elseif HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsColours" then
            g=_G["HealBot_Options_CopyTab5"]
        elseif HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsSort" then
            g=_G["HealBot_Options_CopyTab6"]
        elseif HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsVisibility" then
            g=_G["HealBot_Options_CopyTab7"]
        elseif HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsAggro" then
            g=_G["HealBot_Options_CopyTab8"]
        elseif HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsAux" then
            g=_G["HealBot_Options_CopyTab9"]
        end
    elseif hbCurSkinSubFrameID==1013 then
        if HealBot_Options_luVars["CurrentSkinsTextPanel"]=="HealBot_Options_SkinsFrameTextState" then
            g=_G["HealBot_Options_CopyTab23"]
        elseif HealBot_Options_luVars["CurrentSkinsTextPanel"]=="HealBot_Options_SkinsFrameTextName" then
            g=_G["HealBot_Options_CopyTab10"]
        elseif HealBot_Options_luVars["CurrentSkinsTextPanel"]=="HealBot_Options_SkinsFrameTextHealth" then
            g=_G["HealBot_Options_CopyTab11"]
        elseif HealBot_Options_luVars["CurrentSkinsTextPanel"]=="HealBot_Options_SkinsFrameTextAggro" then
            g=_G["HealBot_Options_CopyTab12"]
        elseif HealBot_Options_luVars["CurrentSkinsTextPanel"]=="HealBot_Options_SkinsFrameTextAux" then
            g=_G["HealBot_Options_CopyTab13"]
        end
    elseif hbCurSkinSubFrameID==1014 then
        if HealBot_Options_luVars["CurrentSkinsIconsPanel"]=="HealBot_Options_SkinsFrameIconsDebuff" then
            g=_G["HealBot_Options_CopyTab14"]
        elseif HealBot_Options_luVars["CurrentSkinsIconsPanel"]=="HealBot_Options_SkinsFrameIconsBuff" then
            g=_G["HealBot_Options_CopyTab15"]
        elseif HealBot_Options_luVars["CurrentSkinsIconsPanel"]=="HealBot_Options_SkinsFrameIconsExtra" then
            g=_G["HealBot_Options_CopyTab16"]
        end
    elseif hbCurSkinSubFrameID==1015 then
        if HealBot_Options_luVars["CurrentSkinsIndicatorsPanel"]=="HealBot_Options_SkinsFrameIndicatorsAggro" then
            g=_G["HealBot_Options_CopyTab17"]
        elseif HealBot_Options_luVars["CurrentSkinsIndicatorsPanel"]=="HealBot_Options_SkinsFrameIndicatorsLowMana" then
            g=_G["HealBot_Options_CopyTab18"]
        elseif HealBot_Options_luVars["CurrentSkinsIndicatorsPanel"]=="HealBot_Options_SkinsFrameIndicatorsSelfCast" then
            g=_G["HealBot_Options_CopyTab22"]
        elseif HealBot_Options_luVars["CurrentSkinsIndicatorsPanel"]=="HealBot_Options_SkinsFrameIndicatorsPower" then
            g=_G["HealBot_Options_CopyTab19"]
        end
    elseif hbCurSkinSubFrameID==1016 then
        if HealBot_Options_luVars["CurrentSkinsEmergencyPanel"]=="HealBot_Options_SkinsFrameEmergGeneral" then
            g=_G["HealBot_Options_CopyTab20"]
        elseif HealBot_Options_luVars["CurrentSkinsEmergencyPanel"]=="HealBot_Options_SkinsFrameEmergencyColour" then
            g=_G["HealBot_Options_CopyTab21"]
        end
    end
    g:SetChecked(true)
    
    local i=0
    for x=1,10 do
        if x~=HealBot_Options_luVars["FramesSelFrame"] then
            i=i+1
            g=_G["HealBot_Options_CopyFrame"..i]
            HealBot_Options_SetText(g,HealBot_Options_HealGroupsFrame_List[x])
            hbCopyFrameIdx[i]=x
        end
    end    
end

HealBot_Options_luVars["CurrentSkinsPanel"]="HealBot_Options_GeneralSkinsFrame"
HealBot_Options_luVars["SkinsPanelCopyBackName"]=false
function HealBot_Options_ShowSkinsPanel(frameName, hbFrameID)
    if HealBot_Options_luVars["SkinsPanelCopyBackName"] and frameName=="BACK" then
        frameName=HealBot_Options_luVars["SkinsPanelCopyBackName"]
        hbFrameID=HealBot_Options_luVars["SkinsPanelCopyBackID"]
        HealBot_Options_luVars["SkinsPanelCopyBackName"]=false
    elseif hbFrameID==1000 then
        HealBot_Options_luVars["SkinsPanelCopyBackName"]=HealBot_Options_luVars["CurrentSkinsPanel"]
        HealBot_Options_luVars["SkinsPanelCopyBackID"]=hbCurSkinSubFrameID
        HealBot_Options_InitCopyTabs()
    end
    hbCurSkinSubFrameID=hbFrameID
    local g=_G[HealBot_Options_luVars["CurrentSkinsPanel"]]
    g:Hide()
    g=_G[frameName]
    g:Show()
    HealBot_Options_luVars["CurrentSkinsPanel"]=frameName
    HealBot_Options_SetSkins()
    g=_G["HealBot_Options_FramesSelFrame"]
    if hbCurSkinSubFrameID==1008 or hbCurSkinSubFrameID>1009 then
        g:Show()
        g=_G["HealBot_Options_ApplyTab2Frames"]
        g:Show()
        g=_G["HealBot_Options_SkinURL"]
        g:Hide()
        g=_G["HealBot_Options_CopyTabsCurrentFrame"]
        g:Hide()
            g=_G["HealBot_Options_CopyTabsCurrentFrameName"]
            g:Hide()
    else
        g:Hide()
        g=_G["HealBot_Options_ApplyTab2Frames"]
        g:Hide()
        if hbFrameID==1000 then
            g=_G["HealBot_Options_SkinURL"]
            g:Hide()
            g=_G["HealBot_Options_CopyTabsCurrentFrame"]
            g:Show()
            g=_G["HealBot_Options_CopyTabsCurrentFrameName"]
            g:SetText(HealBot_Options_HealGroupsFrame_List[HealBot_Options_luVars["FramesSelFrame"]])
        else
            g=_G["HealBot_Options_CopyTabsCurrentFrame"]
            g:Hide()
            g=_G["HealBot_Options_CopyTabsCurrentFrameName"]
            g:Hide()
            g=_G["HealBot_Options_SkinURL"]
        end
        g:Show()
    end
end

HealBot_Options_luVars["CurrentCurePanel"]="HealBot_Options_CureDispelCleanse"
function HealBot_Options_ShowCurePanel(frameName)
    local g=_G[HealBot_Options_luVars["CurrentCurePanel"]]
    g:Hide()
    g=_G[frameName]
    g:Show()
    HealBot_Options_luVars["CurrentCurePanel"]=frameName
end

HealBot_Options_luVars["CurrentBuffPanel"]="HealBot_Options_BuffsPanel"
function HealBot_Options_ShowBuffPanel(frameName)
    local g=_G[HealBot_Options_luVars["CurrentBuffPanel"]]
    g:Hide()
    g=_G[frameName]
    g:Show()
    HealBot_Options_luVars["CurrentBuffPanel"]=frameName
end


HealBot_Options_luVars["CurrentSkinsHeaderPanel"]="HealBot_Options_SkinsFrameHeadersBar"
HealBot_Options_luVars["CurrentSkinsHeaderPanelButton"]="HealBot_Options_SkinsFrameHeadersBarb"
function HealBot_Options_ShowHeaderPanel(frameName, buttonName, tab)
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesHeaders", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsHeaderPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsHeaderPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsHeaderPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsHeaderPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsHeaderPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsHeaderPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsHeaderPanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentSkinsTextPanel"]="HealBot_Options_SkinsFrameTextName"
HealBot_Options_luVars["CurrentSkinsTextPanelButton"]="HealBot_Options_SkinsFrameTextNameb"
function HealBot_Options_ShowTextPanel(frameName, buttonName, tab, isParent)
    if isParent then tab=HealBot_Options_SubTabs[tab] end
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesText", true, tab)
    
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsTextPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsTextPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsTextPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextPanelButton"].."Txt"],true)
    
    if frameName=="HealBot_Options_SkinsFrameTextName" then
        HealBot_Options_ShowTextNamePanel(HealBot_Options_luVars["CurrentSkinsTextNamePanel"], HealBot_Options_luVars["CurrentSkinsTextNamePanelButton"], HealBot_Options_SubTabs["SkinsFramesTextName"])
    elseif frameName=="HealBot_Options_SkinsFrameTextHealth" then
        HealBot_Options_ShowTextHealthPanel(HealBot_Options_luVars["CurrentSkinsTextHealthPanel"], HealBot_Options_luVars["CurrentSkinsTextHealthPanelButton"], HealBot_Options_SubTabs["SkinsFramesTextHealth"])
    elseif frameName=="HealBot_Options_SkinsFrameTextState" then
        HealBot_Options_ShowTextStatePanel(HealBot_Options_luVars["CurrentSkinsTextStatePanel"], HealBot_Options_luVars["CurrentSkinsTextStatePanelButton"], HealBot_Options_SubTabs["SkinsFramesTextState"])
    elseif frameName=="HealBot_Options_SkinsFrameTextAggro" then
        HealBot_Options_ShowTextAggroPanel(HealBot_Options_luVars["CurrentSkinsTextAggroPanel"], HealBot_Options_luVars["CurrentSkinsTextAggroPanelButton"], HealBot_Options_SubTabs["SkinsFramesTextAggro"])
    end
    HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesTextColoursCustom",false)
end

HealBot_Options_luVars["CurrentSkinsTextStatePanel"]="HealBot_Options_SkinsFrameTextStateText"
HealBot_Options_luVars["CurrentSkinsTextStatePanelButton"]="HealBot_Options_SkinsFrameTextStateTextb"
function HealBot_Options_ShowTextStatePanel(frameName, buttonName, tab)
    HealBot_Options_SubTabs["SkinsFramesTextState"]=tab
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesText", true, tab)
    HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesTextColoursCustom",false)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsTextStatePanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextStatePanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextStatePanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsTextStatePanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsTextStatePanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextStatePanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextStatePanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentSkinsTextNamePanel"]="HealBot_Options_SkinsFrameTextNameText"
HealBot_Options_luVars["CurrentSkinsTextNamePanelButton"]="HealBot_Options_SkinsFrameTextNameTextb"
function HealBot_Options_ShowTextNamePanel(frameName, buttonName, tab)
    HealBot_Options_SubTabs["SkinsFramesTextName"]=tab
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesText", true, tab)
    HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesTextColoursCustom",false)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsTextNamePanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextNamePanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextNamePanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsTextNamePanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsTextNamePanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextNamePanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextNamePanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentSkinsTextHealthPanel"]="HealBot_Options_SkinsFrameTextHealthText"
HealBot_Options_luVars["CurrentSkinsTextHealthPanelButton"]="HealBot_Options_SkinsFrameTextHealthTextb"
function HealBot_Options_ShowTextHealthPanel(frameName, buttonName, tab)
    HealBot_Options_SubTabs["SkinsFramesTextHealth"]=tab
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesText", true, tab)
    HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesTextColoursCustom",false)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsTextHealthPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextHealthPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextHealthPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsTextHealthPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsTextHealthPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextHealthPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextHealthPanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentSkinsTextAggroPanel"]="HealBot_Options_SkinsFrameTextAggroText"
HealBot_Options_luVars["CurrentSkinsTextAggroPanelButton"]="HealBot_Options_SkinsFrameTextAggroTextb"
function HealBot_Options_ShowTextAggroPanel(frameName, buttonName, tab)
    HealBot_Options_SubTabs["SkinsFramesTextAggro"]=tab
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesText", true, tab)
    HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesTextColoursCustom",false)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsTextAggroPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextAggroPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextAggroPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsTextAggroPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsTextAggroPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextAggroPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextAggroPanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentSkinsTextAuxPanel"]="HealBot_Options_SkinsFrameTextAuxText"
HealBot_Options_luVars["CurrentSkinsTextAuxPanelButton"]="HealBot_Options_SkinsFrameTextAuxTextb"
function HealBot_Options_ShowTextAuxPanel(frameName, buttonName, tab)
    HealBot_Options_SubTabs["SkinsFramesTextAux"]=tab
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesText", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsTextAuxPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextAuxPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextAuxPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsTextAuxPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsTextAuxPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsTextAuxPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsTextAuxPanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentSkinsIconsPanel"]="HealBot_Options_SkinsFrameIconsDebuff"
HealBot_Options_luVars["CurrentSkinsIconsPanelButton"]="HealBot_Options_SkinsFrameIconsDebuffb"
function HealBot_Options_ShowIconPanel(frameName, buttonName, tab, isParent)
    if isParent then tab=HealBot_Options_SubTabs[tab] end
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesIcons", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsIconsPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsIconsPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsIconsPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsPanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentSkinsIndicatorsPanel"]="HealBot_Options_SkinsFrameIndicatorsAggro"
HealBot_Options_luVars["CurrentSkinsIndicatorsPanelButton"]="HealBot_Options_SkinsFrameIndicatorsAggrob"
function HealBot_Options_ShowIndicatorsPanel(frameName, buttonName, tab)
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesIndicators", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsIndicatorsPanel"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIndicatorsPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIndicatorsPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsIndicatorsPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsIndicatorsPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIndicatorsPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIndicatorsPanelButton"].."Txt"],true)
    if HealBot_Options_luVars["FramesSelFrame"]==10 then
        HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesIndicatorsTabNotAvail",true)
    else
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsIndicatorsPanel"],true)
        HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesIndicatorsTabNotAvail",false)
    end
end

HealBot_Options_luVars["CurrentSkinsEmergencyPanel"]="HealBot_Options_SkinsFrameEmergGeneral"
HealBot_Options_luVars["CurrentSkinsEmergencyPanelButton"]="HealBot_Options_SkinsFrameEmergGeneralb"
function HealBot_Options_ShowEmergencyPanel(frameName, buttonName, tab)
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesEmergency", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsEmergencyPanel"],false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsEmergencyPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsEmergencyPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsEmergencyPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsEmergencyPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsEmergencyPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsEmergencyPanelButton"].."Txt"],true)
    if HealBot_Options_luVars["FramesSelFrame"]==10 then
        HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesEmergencyTabNotAvail",true)
    else
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsEmergencyPanel"],true)
        HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesEmergencyTabNotAvail",false)
    end
end

HealBot_Options_luVars["CurrentSkinsIconsDebuffPanel"]="HealBot_Options_SkinsFrameIconsDebuffGeneral"
HealBot_Options_luVars["CurrentSkinsIconsDebuffPanelButton"]="HealBot_Options_SkinsFrameIconsDebuffGeneralb"
function HealBot_Options_ShowIconDebuffPanel(frameName, buttonName, tab)
    HealBot_Options_SubTabs["SkinsFramesIconsDebuffs"]=tab
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesIcons", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsIconsDebuffPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsDebuffPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsDebuffPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsIconsDebuffPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsIconsDebuffPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsDebuffPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsDebuffPanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentSkinsIconsBuffPanel"]="HealBot_Options_SkinsFrameIconsBuffGeneral"
HealBot_Options_luVars["CurrentSkinsIconsBuffPanelButton"]="HealBot_Options_SkinsFrameIconsBuffGeneralb"
function HealBot_Options_ShowIconBuffPanel(frameName, buttonName, tab)
    HealBot_Options_SubTabs["SkinsFramesIconsBuffs"]=tab
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesIcons", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsIconsBuffPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsBuffPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsBuffPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsIconsBuffPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsIconsBuffPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsBuffPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsBuffPanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentSkinsIconsExtraPanel"]="HealBot_Options_SkinsFrameIconsExtraClass"
HealBot_Options_luVars["CurrentSkinsIconsExtraPanelButton"]="HealBot_Options_SkinsFrameIconsExtraClassb"
function HealBot_Options_ShowIconExtraPanel(frameName, buttonName, tab)
    HealBot_Options_SubTabs["SkinsFramesIconsExtras"]=tab
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesIcons", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsIconsExtraPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsExtraPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsExtraPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsIconsExtraPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsIconsExtraPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsIconsExtraPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsIconsExtraPanelButton"].."Txt"],true)
end

HealBot_Options_luVars["CurrentSkinsBarsPanel"]="HealBot_Options_SkinsFramesBarsGeneral"
HealBot_Options_luVars["CurrentSkinsBarsPanelButton"]="HealBot_Options_SkinsFramesBarsGeneralb"
function HealBot_Options_ShowBarsPanel(frameName, buttonName, tab, isParent)
    if isParent then tab=HealBot_Options_SubTabs[tab] end
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesBars", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsBarsPanel"],false)
    HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsColoursCustom",false)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsBarsPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsBarsPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsBarsPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsBarsPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsBarsPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsBarsPanelButton"].."Txt"],true)
    if HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsSort" then
        if HealBot_Options_luVars["FramesSelFrame"]>7 and HealBot_Options_luVars["FramesSelFrame"]<10 then
            HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsTabNotAvail",true)
        else
            HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsBarsPanel"],true)
            HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsTabNotAvail",false)
        end
    elseif HealBot_Options_luVars["CurrentSkinsBarsPanel"]=="HealBot_Options_SkinsFramesBarsAggro" then
        if HealBot_Options_luVars["FramesSelFrame"]==10 then
            HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsTabNotAvail",true)
        else
            HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsBarsPanel"],true)
            HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsTabNotAvail",false)
        end
    else
        HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsBarsPanel"],true)
        HealBot_Options_ObjectsShowHide("HealBot_Options_SkinsFramesBarsTabNotAvail",false)
    end
end

HealBot_Options_luVars["CurrentSkinsBarsAuxPanel"]="HealBot_Options_SkinsFramesBarsAuxAssign"
HealBot_Options_luVars["CurrentSkinsBarsAuxPanelButton"]="HealBot_Options_SkinsFramesBarsAuxAssignb"
function HealBot_Options_ShowBarsAuxPanel(frameName, buttonName, tab)
    HealBot_Options_SubTabs["SkinsFramesBarsAux"]=tab
    HealBot_Options_UpdateTab(nil, nil, "SkinsFramesBars", true, tab)
    HealBot_Options_ObjectsShowHide(HealBot_Options_luVars["CurrentSkinsBarsAuxPanel"],false)
    HealBot_Options_ObjectsShowHide(frameName,true)
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsBarsAuxPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsBarsAuxPanelButton"].."Txt"],false)
    HealBot_Options_luVars["CurrentSkinsBarsAuxPanel"]=frameName
    HealBot_Options_luVars["CurrentSkinsBarsAuxPanelButton"]=buttonName
    HealBot_Options_InnerContent_Colour(_G[HealBot_Options_luVars["CurrentSkinsBarsAuxPanelButton"]],
                                        _G[HealBot_Options_luVars["CurrentSkinsBarsAuxPanelButton"].."Txt"],true)
end

function HealBot_Options_OnMouseDown(self)
    HealBot_StartMoving(self);
end

function HealBot_Options_OnMouseUp(self)
    HealBot_StopMoving(self);
end

function HealBot_Options_OnDragStart(self)
    HealBot_StartMoving(self);
end

function HealBot_Options_OnDragStop(self)
    HealBot_StopMoving(self);
end

local hbBlizzEvents = {
    "CHARACTER_POINTS_CHANGED",
    "CVAR_UPDATE",
    "DISPLAY_SIZE_CHANGED",
    "GROUP_ROSTER_UPDATE",
    "HONOR_LEVEL_UPDATE",
    "IGNORELIST_UPDATE",
    "INCOMING_RESURRECT_CHANGED",
    "INCOMING_SUMMON_CHANGED",
    "INSTANCE_ENCOUNTER_ENGAGE_UNIT",
    "MODIFIER_STATE_CHANGED",
    "MUTELIST_UPDATE",
    "PARTY_LEADER_CHANGED",
    "PARTY_LFG_RESTRICTED",
    "PARTY_LOOT_METHOD_CHANGED",
    "PARTY_MEMBERS_CHANGED",
    "PARTY_MEMBER_DISABLE",
    "PARTY_MEMBER_ENABLE",
    "PET_ATTACK_START",
    "PET_ATTACK_STOP",
    "PET_UI_UPDATE",
    "PLAYER_ALIVE",
    "PLAYER_CONTROL_GAINED",
    "PLAYER_CONTROL_LOST",
    "PLAYER_ENTERING_WORLD",
    "PLAYER_ENTER_COMBAT",
    "PLAYER_EQUIPMENT_CHANGED",
    "PLAYER_FLAGS_CHANGED",
    "PLAYER_FOCUS_CHANGED",
    "PLAYER_LEAVE_COMBAT",
    "PLAYER_LEAVING_WORLD",
    "PLAYER_LEVEL_CHANGED",
    "PLAYER_LEVEL_UP",
    "PLAYER_REGEN_DISABLED",
    "PLAYER_REGEN_ENABLED",
    "PLAYER_ROLES_ASSIGNED",
    "PLAYER_SPECIALIZATION_CHANGED",
    "PLAYER_TALENT_UPDATE",
    "PLAYER_TARGET_CHANGED",
    "PLAYER_TARGET_SET_ATTACKING",
    "PLAYER_UPDATE_RESTING",
    "PLAYTIME_CHANGED",
    "PVP_TIMER_UPDATE",
    "QUEST_SESSION_JOINED",
    "QUEST_SESSION_LEFT",
    "RAID_ROSTER_UPDATE",
    "RAID_TARGET_UPDATE",
    "READY_CHECK",
    "READY_CHECK_CONFIRM",
    "READY_CHECK_FINISHED",
    "ROLE_CHANGED_INFORM",
    "RUNE_POWER_UPDATE",
    "SPELL_UPDATE_COOLDOWN",
    "UI_SCALE_CHANGED",
    "UNIT_ABSORB_AMOUNT_CHANGED",
    "UNIT_ATTACK",
    "UNIT_AURA",
    "UNIT_CLASSIFICATION_CHANGED",
    "UNIT_COMBAT",
    "UNIT_COMBO_POINTS",
    "UNIT_CONNECTION",
    "UNIT_CTR_OPTIONS",
    "UNIT_DISPLAYPOWER",
    "UNIT_ENTERED_VEHICLE",
    "UNIT_ENTERING_VEHICLE",
    "UNIT_EXITING_VEHICLE",
    "UNIT_EXITED_VEHICLE",
    "UNIT_FACTION",
    "UNIT_FLAGS",
    "UNIT_HEALTH",
    "UNIT_HEALTH_FREQUENT",
    "UNIT_HEAL_PREDICTION",
    "UNIT_LEVEL",
    "UNIT_MAXHEALTH",
    "UNIT_MAXPOWER",
    "UNIT_NAME_UPDATE",
    "UNIT_OTHER_PARTY_CHANGED",
    "UNIT_PET",
    "UNIT_PHASE",
    "UNIT_PORTRAIT_UPDATE",
    "UNIT_POWER_BAR_HIDE",
    "UNIT_POWER_BAR_SHOW",
    "UNIT_POWER_FREQUENT",
    "UNIT_POWER_POINT_CHARGE",
    "UNIT_POWER_UPDATE",
    "UNIT_SPELLCAST_CHANNEL_START",
    "UNIT_SPELLCAST_CHANNEL_STOP",
    "UNIT_SPELLCAST_FAILED",
    "UNIT_SPELLCAST_INTERRUPTED",
    "UNIT_SPELLCAST_SENT",
    "UNIT_SPELLCAST_START",
    "UNIT_SPELLCAST_STOP",
    "UNIT_SPELLCAST_SUCCEEDED",
    "UNIT_TARGET",
    "UNIT_TARGETABLE_CHANGED",
    "UNIT_THREAT_LIST_UPDATE",
    "UNIT_THREAT_SITUATION_UPDATE",
    "UPDATE_ACTIVE_BATTLEFIELD",
    "UPDATE_INSTANCE_INFO",
    "UPDATE_CHAT_COLOR",
    "UPDATE_MOUSEOVER_UNIT",
    "UPDATE_SHAPESHIFT_FORM",
    "UPDATE_STEALTH",
    "VARIABLES_LOADED",
    "VOICE_START",
    "VOICE_STATUS_UPDATE",
    "VOICE_STOP",
    "ZONE_CHANGED_NEW_AREA",
    "ZONE_CHANGED",
    "ZONE_CHANGED_INDOORS",
}
local hbBlizzFramesHidden={}
local hbBlizzFramesEvents={}
local hbHiddenParent = CreateFrame('Frame', nil, UIParent)
hbHiddenParent:SetAllPoints()
hbHiddenParent:Hide()

function HealBot_Options_DisableEnablePlayerFrame(enable)
    if enable then
        HealBot_Options_UnitFrameEnable(PlayerFrame, "player")
    else
        HealBot_Options_UnitFrameDisable(PlayerFrame)
    end
end

function HealBot_Options_DisableEnablePetFrame(enable)
    if enable then
        HealBot_Options_UnitFrameEnable(PetFrame, "pet")
    else
        HealBot_Options_UnitFrameDisable(PetFrame)
    end
end

function HealBot_Options_DisableEnableTargetFrame(enable)
    if enable then
        if not hbBlizzFramesEvents[TargetFrame:GetName()] then
            HealBot_Options_UnitFrameEnable(TargetFrame, "target")
        else
            HealBot_Options_UnitFrameEnable(TargetFrame)
        end
    else
        HealBot_Options_UnitFrameDisable(TargetFrame)
    end
end

function HealBot_Options_DisableEnableFocusFrame(enable)
    if enable then
        if not hbBlizzFramesEvents[FocusFrame:GetName()] then
            HealBot_Options_UnitFrameEnable(FocusFrame, "focus")
        else
            HealBot_Options_UnitFrameEnable(FocusFrame)
        end
    else
        HealBot_Options_UnitFrameDisable(FocusFrame)
    end
end

function HealBot_Options_DisableEnablePartyFrame(enable)
    if PartyFrame then
        if enable then
            HealBot_Options_UnitFrameEnable(PartyFrame)
        else
            HealBot_Options_UnitFrameDisable(PartyFrame)
        end
    else
        for x = 1, 4 do
            local f = _G["PartyMemberFrame"..x]
            if enable then
                local u = "Party"..x
                HealBot_Options_UnitFrameEnable(f, u)
            else
                HealBot_Options_UnitFrameDisable(f)
            end
        end
    end
    if CompactPartyFrame then
        if enable then
            HealBot_Options_UnitFrameEnable(CompactPartyFrame)
        else
            HealBot_Options_UnitFrameDisable(CompactPartyFrame)
        end
    end
end

function HealBot_Options_DisableEnableMiniBossFrame(enable)
    for x = 1, MAX_BOSS_FRAMES do
        local f = _G["Boss"..x.."TargetFrame"]
        if enable then
            local u = "Boss"..x
            HealBot_Options_UnitFrameEnable(f, u)
        else
            HealBot_Options_UnitFrameDisable(f)
        end
    end
end

function HealBot_Options_DisableEnableRaidFrame(enable)
    if CompactRaidFrameManager then
        if enable then
            HealBot_Options_UnitFrameEnable(CompactRaidFrameManager)
        else
            HealBot_Options_UnitFrameDisable(CompactRaidFrameManager)
        end
    end
    if CompactRaidFrameContainer then
        if enable then
            HealBot_Options_UnitFrameEnable(CompactRaidFrameContainer)
        else
            HealBot_Options_UnitFrameDisable(CompactRaidFrameContainer)
        end
    end
end

local function HealBot_Options_UnregisterBlizzEvents(f)
    if f and not HealBot_Options_luVars["RUNBLIZZEVENTS"] then
        if not hbBlizzFramesEvents[f:GetName()] then
            hbBlizzFramesEvents[f:GetName()]={}
        end
        for i=1, getn(hbBlizzEvents), 1 do
            if (f:IsEventRegistered(hbBlizzEvents[i])) then
                hbBlizzFramesEvents[f:GetName()][hbBlizzEvents[i]]=true
                f:UnregisterEvent(hbBlizzEvents[i])
            end
        end
    end
end

local function HealBot_Options_RegisterBlizzEvents(f)
    if f and hbBlizzFramesEvents[f:GetName()] then
        for event,_ in pairs(hbBlizzFramesEvents[f:GetName()]) do
            f:RegisterEvent(event)
            --HealBot_AddDebug("Reg Event "..event,"Events",true)
        end
    end
    hbBlizzFramesEvents[f:GetName()]=nil
end

local function HealBot_Options_UnitFrameHide(f)
	if f and not hbBlizzFramesHidden[f:GetName()] then
		hbBlizzFramesHidden[f:GetName()] = f:GetParent()
		f:SetParent(hbHiddenParent)
        UnregisterUnitWatch(f)
        f:Hide()
        HealBot_Options_UnregisterBlizzEvents(f)
	end
end

local function HealBot_Options_UnitFrameShow(f, u)
	if f and hbBlizzFramesHidden[f:GetName()] then
		f:SetParent(hbBlizzFramesHidden[f:GetName()])
        RegisterUnitWatch(f)
        if u and UnitExists(u) then f:Show() end
		hbBlizzFramesHidden[f:GetName()] = nil
        HealBot_Options_RegisterBlizzEvents(f)
	end
end

function HealBot_Options_UnitFrameDisable(f)
    if f then
        HealBot_Options_UnitFrameHide(f)
        local ToTFrame=_G[f:GetName().."ToT"]
        if ToTFrame then
            HealBot_Options_UnitFrameDisable(ToTFrame)
        end
    end
end

function HealBot_Options_UnitFrameEnable(f, u)
    if f then
        HealBot_Options_UnitFrameShow(f, u)
        local ToTFrame=_G[f:GetName().."ToT"]
        if ToTFrame then
            local uID=u or HEALBOT_WORDS_UNKNOWN
            HealBot_Options_UnitFrameEnable(ToTFrame, uID.."target")
        end
    end
end

function HealBot_Options_SetSliderValue(slider,value)
    if value then
        if value>1 then
            slider:SetValue(1)
        else
            slider:SetValue(2)
        end
        slider:SetValue(value)
    end
end

function HealBot_Options_UpdateMediaFont(object, index, label)
    if not index then index=fontsIndex[HealBot_Default_Font] or 1 end
    label=label or HEALBOT_OPTIONS_SKINFONT
    HealBot_Options_val_OnLoad(object,label,1,#fonts,1,5)
    HealBot_Options_SetText(object,label)
    HealBot_Options_SetSliderValue(object,index)
    local g=_G[object:GetName().."Text"]
    g:SetText((object.text or label) .. " ".. index..": " ..fonts[index]);
end

function HealBot_Options_UpdateMediaTexture(object, index)
    if not index then index=texturesIndex[HealBot_Default_Textures[20].name] or 1 end
    HealBot_Options_val_OnLoad(object,HEALBOT_OPTIONS_SKINTEXTURE,1,#hb_textures,1,5)
    HealBot_Options_SetText(object,HEALBOT_OPTIONS_SKINTEXTURE)
    HealBot_Options_SetSliderValue(object,index)
    local g=_G[object:GetName().."Text"]
    g:SetText(object.text .. " ".. index..": " ..hb_textures[index]);            
end

function HealBot_Options_UpdateMediaIndex()
    hb_textures = LSM:List('statusbar');
    for x,_ in pairs(texturesIndex) do
        texturesIndex[x]=nil
    end 
    for i=1,#hb_textures do
        texturesIndex[hb_textures[i]] = i
    end
    fonts = LSM:List('font');
    for x,_ in pairs(fontsIndex) do
        fontsIndex[x]=nil
    end
    for i=1,#fonts do
        fontsIndex[fonts[i]] = i
        LSM:Fetch('font',fonts[i])
    end
    sounds = LSM:List('sound');
    for x,_ in pairs(soundsIndex) do
        soundsIndex[x]=nil
    end 
    for i=1,#sounds do
        soundsIndex[sounds[i]] = i
    end
end

function HealBot_Options_UpdateMedia(mType)
    if mType == "Textures" then
        HealBot_Options_UpdateMediaTexture(HealBot_Options_SkinFrameAliasTextureS,texturesIndex[Healbot_Config_Skins.FrameAliasBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]],true)
        HealBot_Options_UpdateMediaTexture(HealBot_Options_BarTextureS,texturesIndex[Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]],true)
        HealBot_Options_UpdateMediaTexture(HealBot_Options_HeadTextureS,texturesIndex[Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]],true)
        HealBot_Options_UpdateMediaTexture(HealBot_EmergBarTexture, texturesIndex[Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["TEXTURE"]])
    elseif mType == "Fonts" then
        HealBot_Options_UpdateMediaFont(HealBot_Options_HeadFontNameS,fontsIndex[Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]])
        HealBot_Options_UpdateMediaFont(HealBot_Options_AliasFontName,fontsIndex[Healbot_Config_Skins.FrameAlias[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]])
        HealBot_Options_UpdateMediaFont(HealBot_Options_HealthFontName,fontsIndex[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["HFONT"]])
        HealBot_Options_UpdateMediaFont(HealBot_Options_AggroFontName,fontsIndex[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["AFONT"]])
        HealBot_Options_UpdateMediaFont(HealBot_Options_AuxFontName,fontsIndex[Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["AuxTxtBar"]][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]])
        HealBot_Options_UpdateMediaFont(HealBot_Options_StateFontName,fontsIndex[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["SFONT"]])
        for z=1,3 do
            HealBot_Options_UpdateMediaFont(HealBot_BarButtonIconBuffFont,fontsIndex[Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][z]["BUFFFONT"]])
            HealBot_Options_UpdateMediaFont(HealBot_BarButtonIconFont, fontsIndex[Healbot_Config_Skins.IconSetsText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]][z]["DBFONT"]])
        end
        HealBot_Options_UpdateMediaFont(HealBot_Options_FontName, fontsIndex[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][HealBot_Options_luVars["FramesSelFrame"]]["FONT"]])
    else
        HealBot_Options_val_OnLoad(HealBot_Options_WarningSound,HEALBOT_OPTIONS_SOUND,1,#sounds,1,2)
        HealBot_Options_SetText(HealBot_Options_WarningSound,HEALBOT_OPTIONS_SOUND)
        HealBot_Options_SetSliderValue(HealBot_Options_WarningSound,soundsIndex[HealBot_Config_Cures.SoundDebuffPlay])
        HealBot_Options_val_OnLoad(HealBot_Options_BuffWarningSound,HEALBOT_OPTIONS_SOUND,1,#sounds,1,2)
        HealBot_Options_SetText(HealBot_Options_BuffWarningSound,HEALBOT_OPTIONS_SOUND)
        HealBot_Options_SetSliderValue(HealBot_Options_BuffWarningSound,soundsIndex[HealBot_Config_Buffs.SoundBuffPlay])
    end
end

function HealBot_Options_UpdateUsedButtonText(button)
    button.gref.txt["text"]:SetFont(LSM:Fetch('font',Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["FONT"]),
                               ceil(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["HEIGHT"]*
                                    Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][button.frame]["SCALE"]),
                                    HealBot_Font_Outline[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["OUTLINE"]]);
    button.gref.txt["text2"]:SetFont(LSM:Fetch('font',Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["HFONT"]),
                                ceil(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["HHEIGHT"]*
                                     Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][button.frame]["SCALE"]),
                                     HealBot_Font_Outline[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["HOUTLINE"]]);
    button.gref.txt["text3"]:SetFont(LSM:Fetch('font',Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["SFONT"]),
                                ceil(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["SHEIGHT"]*
                                     Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][button.frame]["SCALE"]),
                                     HealBot_Font_Outline[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["SOUTLINE"]]);
    button.gref.txt["text4"]:SetFont(LSM:Fetch('font',Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["AFONT"]),
                                ceil(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["AHEIGHT"]*
                                     Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][button.frame]["SCALE"]),
                                HealBot_Font_Outline[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["AOUTLINE"]]);
    if ceil(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["HHEIGHT"]*Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][button.frame]["SCALE"])-HealBot_Globals.VehicleFontSizeReduction<2 then
        button.gref.txt["text5"]:SetFont(LSM:Fetch('font',Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["HFONT"]),
                                         2,
                                         HealBot_Font_Outline[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["HOUTLINE"]]);

    else
        button.gref.txt["text5"]:SetFont(LSM:Fetch('font',Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["HFONT"]),
                                    ceil(Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["HHEIGHT"]*
                                         Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][button.frame]["SCALE"])-HealBot_Globals.VehicleFontSizeReduction,
                                         HealBot_Font_Outline[Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin][button.frame]["HOUTLINE"]]);
    end
end

function HealBot_Options_UpdateUsedTextures(button)
    button.gref["Bar"]:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][button.frame]["TEXTURE"]));
    button.gref["InHeal"]:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][button.frame]["TEXTURE"]));
    for x=1,9 do
        button.gref.aux[x]:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][button.frame]["TEXTURE"]))
    end
    button.gref["Absorb"]:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin][button.frame]["TEXTURE"]));
    button.gref["Bar"]:GetStatusBarTexture():SetHorizTile(false)
    button.gref["InHeal"]:GetStatusBarTexture():SetHorizTile(false)
    for x=1,9 do
        button.gref.aux[x]:GetStatusBarTexture():SetHorizTile(false)
    end
    button.gref["Absorb"]:GetStatusBarTexture():SetHorizTile(false)
    HealBot_Emerg_Button[button.id].bar:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.Emerg[Healbot_Config_Skins.Current_Skin][button.frame]["TEXTURE"]));
    HealBot_Emerg_Button[button.id].bar:GetStatusBarTexture():SetHorizTile(false)
end

function HealBot_Options_UpdateUsedAuxText(button)
    for x=1,9 do
        button.gref.auxtxt[x]:SetFont(LSM:Fetch('font',Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][x][button.frame]["FONT"]),
                                           ceil(Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][x][button.frame]["HEIGHT"]*
                                                Healbot_Config_Skins.Frame[Healbot_Config_Skins.Current_Skin][button.frame]["SCALE"]),
                                                HealBot_Font_Outline[Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin][x][button.frame]["OUTLINE"]]);
    end
end

function HealBot_UpdateUsedMedia(mediatype, key)
    if mediatype == "statusbar" then
        if Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin] then
            local hFrames=HealBot_Panel_retHealBot_Header_Frames()
            for _,h in pairs(hFrames) do
                if h["GetName"] then
                    local bar = _G[h:GetName().."Bar"]
                    if bar then
                        bar:SetStatusBarTexture(LSM:Fetch('statusbar',Healbot_Config_Skins.HeadBar[Healbot_Config_Skins.Current_Skin][h.frame]["TEXTURE"]));
                        bar:GetStatusBarTexture():SetHorizTile(false)
                    end
                end
            end
        end
        if Healbot_Config_Skins.HealBar[Healbot_Config_Skins.Current_Skin] then 
            for _,xButton in pairs(HealBot_Unit_Button) do
                HealBot_Options_UpdateUsedTextures(xButton)
            end
            for _,xButton in pairs(HealBot_Private_Button) do
                HealBot_Options_UpdateUsedTextures(xButton)
            end 
            for _,xButton in pairs(HealBot_Pet_Button) do
                HealBot_Options_UpdateUsedTextures(xButton)
            end 
            for _,xButton in pairs(HealBot_Vehicle_Button) do
                HealBot_Options_UpdateUsedTextures(xButton)
            end 
            for _,xButton in pairs(HealBot_Enemy_Button) do
                HealBot_Options_UpdateUsedTextures(xButton)
            end 
            for _,xButton in pairs(HealBot_Extra_Button) do
                HealBot_Options_UpdateUsedTextures(xButton)
            end 
        end
    elseif mediatype == "font" then
        if Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin] then
            local hFrames=HealBot_Panel_retHealBot_Header_Frames()
            for _,h in pairs(hFrames) do
                if h["GetName"] then
                    local bar = _G[h:GetName().."Bar_text"]
                    if bar then
                        bar:SetFont(LSM:Fetch('font',Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][h.frame]["FONT"]),
                                        Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][h.frame]["HEIGHT"],
                                        HealBot_Font_Outline[Healbot_Config_Skins.HeadText[Healbot_Config_Skins.Current_Skin][h.frame]["OUTLINE"]]);
                    end
                end
            end
        end
        if Healbot_Config_Skins.BarText[Healbot_Config_Skins.Current_Skin] then
            for _,xButton in pairs(HealBot_Unit_Button) do
                HealBot_Options_UpdateUsedButtonText(xButton)
            end
            for _,xButton in pairs(HealBot_Private_Button) do
                HealBot_Options_UpdateUsedButtonText(xButton)
            end      
            for _,xButton in pairs(HealBot_Pet_Button) do
                HealBot_Options_UpdateUsedButtonText(xButton)
            end 
            for _,xButton in pairs(HealBot_Vehicle_Button) do
                HealBot_Options_UpdateUsedButtonText(xButton)
            end 
            for _,xButton in pairs(HealBot_Enemy_Button) do
                HealBot_Options_UpdateUsedButtonText(xButton)
            end 
            for _,xButton in pairs(HealBot_Extra_Button) do
                HealBot_Options_UpdateUsedButtonText(xButton)
            end
        end
        if Healbot_Config_Skins.AuxBarText[Healbot_Config_Skins.Current_Skin] then
            for _,xButton in pairs(HealBot_Unit_Button) do
                HealBot_Options_UpdateUsedAuxText(xButton)
            end
            for _,xButton in pairs(HealBot_Private_Button) do
                HealBot_Options_UpdateUsedAuxText(xButton)
            end
            for _,xButton in pairs(HealBot_Enemy_Button) do
                HealBot_Options_UpdateUsedAuxText(xButton)
            end
            for _,xButton in pairs(HealBot_Pet_Button) do
                HealBot_Options_UpdateUsedAuxText(xButton)
            end
            for _,xButton in pairs(HealBot_Vehicle_Button) do
                HealBot_Options_UpdateUsedAuxText(xButton)
            end
            for _,xButton in pairs(HealBot_Extra_Button) do
                HealBot_Options_UpdateUsedAuxText(xButton)
            end
        end
    end
end

function HealBot_Options_Show_Help(index,show)
    if HealBot_Options_luVars["TIPLOADED"] then
        if show then
            HealBot_Tooltip_OptionsHelp(HEALBOT_OPTIONS_HELP_TITLES[index],HEALBOT_OPTIONS_HELP_TEXT[index])
            HealBot_Options_luVars["OPTIONSTIPVISIBLE"]=true
        else
            HealBot_Tooltip_Hide()
            HealBot_Options_luVars["OPTIONSTIPVISIBLE"]=false
        end
    end
end
