Merfin.GetSpellInfo = GetSpellInfo or function(spellId)
    if C_Spell and C_Spell.GetSpellInfo then
        return C_Spell.GetSpellInfo(spellId).name
    end
end

Merfin.GetIconCropped = function(iconId, iconSize)
    local cropped = '|T'..iconId..':'..iconSize..':'..iconSize..':0:0:64:64:4:60:4:60|t'
    return cropped
end

local classIcons = {
    ["WARRIOR"] = 626008,
    ["PALADIN"] = 626003,
    ["HUNTER"] = 626000,
    ["ROGUE"] = 626005,
    ["PRIEST"] = 626004,
    ["DEATHKNIGHT"] = 135771,
    ["SHAMAN"] = 626006,
    ["MAGE"] = 626001,
    ["WARLOCK"] = 626007,
    ["MONK"] = 626002,
    ["DRUID"] = 625999,
    ["DEMONHUNTER"] = 1278301,
    ["EVOKER"] = 4514681
}

Merfin.GetClassIcon = function(className)
    return classIcons[className]
end

Merfin.GetShortColoredName = function(name, class, len)
    local shortName = string.sub(name, 1, len)
    local classColor = RAID_CLASS_COLORS[class]
    if not classColor then
        return shortName
    end
    return string.format("|cff%02x%02x%02x%s|r", classColor.r * 255, classColor.g * 255, classColor.b * 255, shortName)
end