CString CMUSHclientDoc::GetAlphaOptionItem (const int iItem)
  {

  return GetBaseAlphaOptionItem (iItem, 
                                 AlphaOptionsTable,
                                 NUMITEMS (AlphaOptionsTable),
                                 (char *) this);

  }  // end of CMUSHclientDoc::GetAlphaOptionItem
VARIANT CMUSHclientDoc::GetTriggerOption(LPCTSTR TriggerName, LPCTSTR OptionName) 
{
CString strTriggerName = TriggerName;
CTrigger * trigger_item;

	VARIANT vaResult;
	VariantInit(&vaResult);

  vaResult.vt = VT_NULL;

  // trim spaces from name, make lower-case
  CheckObjectName (strTriggerName, false);

  vaResult.vt = VT_EMPTY;

  // see if trigger exists, if not return EMPTY
  if (!GetTriggerMap ().Lookup (strTriggerName, trigger_item))
	  return vaResult;

int iItem;
int iResult = FindBaseOption (OptionName, TriggerOptionsTable, iItem);

  
  if (iResult == eOK)
    {

    // numeric option

    if (m_CurrentPlugin &&
        (TriggerOptionsTable [iItem].iFlags & OPT_PLUGIN_CANNOT_READ))
    	return vaResult;  // not available to plugin

    long Value =  GetBaseOptionItem (iItem, 
                              TriggerOptionsTable, 
                              NUMITEMS (TriggerOptionsTable),
                              (char *) trigger_item);  

    SetUpVariantLong (vaResult, Value);
    }  // end of found numeric option
  else
    { // not numeric option, try alpha
    int iResult = FindBaseAlphaOption (OptionName, TriggerAlphaOptionsTable, iItem);
    if (iResult == eOK)
      {

      // alpha option

      if (m_CurrentPlugin &&
          (TriggerAlphaOptionsTable [iItem].iFlags & OPT_PLUGIN_CANNOT_READ))
    	  return vaResult;  // not available to plugin

      CString strValue =  GetBaseAlphaOptionItem (iItem, 
                                                 TriggerAlphaOptionsTable,
                                                 NUMITEMS (TriggerAlphaOptionsTable),
                                                 (char *) trigger_item);

      SetUpVariantString (vaResult, strValue);
      }  // end of found
    }

	return vaResult;
} // end of GetTriggerOption
VARIANT CMUSHclientDoc::GetTimerOption(LPCTSTR TimerName, LPCTSTR OptionName)
{
    CString strTimerName = TimerName;
    CTimer * Timer_item;

    VARIANT vaResult;
    VariantInit(&vaResult);

    vaResult.vt = VT_NULL;

    // trim spaces from name, make lower-case
    CheckObjectName (strTimerName, false);

    vaResult.vt = VT_EMPTY;

    // see if Timer exists, if not return EMPTY
    if (!GetTimerMap ().Lookup (strTimerName, Timer_item))
        return vaResult;


    CString strOptionName = OptionName;

    strOptionName.MakeLower();
    strOptionName.TrimLeft ();
    strOptionName.TrimRight ();

    int iItem;
    int iResult = FindBaseOption (strOptionName, TimerOptionsTable, iItem);


    if (iResult == eOK)
    {

        // numeric option

        if (m_CurrentPlugin &&
                (TimerOptionsTable [iItem].iFlags & OPT_PLUGIN_CANNOT_READ))
            return vaResult;  // not available to plugin

        double Value;

        // this is a pest!
        if (strOptionName == "hour")
        {
            if (Timer_item->iType == CTimer::eInterval)
                Value = Timer_item->iEveryHour;
            else
                Value = Timer_item->iAtHour;
        } // end of option "hour"
        else if (strOptionName == "minute")
        {
            if (Timer_item->iType == CTimer::eInterval)
                Value = Timer_item->iEveryMinute;
            else
                Value = Timer_item->iAtMinute;
        } // end of option "minute"
        else if (strOptionName == "second")
        {
            if (Timer_item->iType == CTimer::eInterval)
                Value = Timer_item->fEverySecond;
            else
                Value = Timer_item->fAtSecond;
        } // end of option "second"
        else
            Value =  GetBaseOptionItem (iItem,
                                        TimerOptionsTable,
                                        NUMITEMS (TimerOptionsTable),
                                        (char *) Timer_item);

        SetUpVariantDouble (vaResult, Value);
    }  // end of found numeric option
    else
    {   // not numeric option, try alpha
        int iResult = FindBaseAlphaOption (OptionName, TimerAlphaOptionsTable, iItem);
        if (iResult == eOK)
        {

            // alpha option

            if (m_CurrentPlugin &&
                    (TimerAlphaOptionsTable [iItem].iFlags & OPT_PLUGIN_CANNOT_READ))
                return vaResult;  // not available to plugin

            CString strValue =  GetBaseAlphaOptionItem (iItem,
                                TimerAlphaOptionsTable,
                                NUMITEMS (TimerAlphaOptionsTable),
                                (char *) Timer_item);

            SetUpVariantString (vaResult, strValue);
        }  // end of found
    }

    return vaResult;
} // end of GetTimerOption