device.print("<ul id=\"");
device.print("<ul"); writeListAttributes(device, menu); device.print(" id=\"");
    protected void writePopup(final Device device, SPopupMenu menu)            throws IOException {        if (menu.isEnabled()) {            String componentId = menu.getName();            device.print("<ul id=\"");            device.print(componentId);            device.print("_pop\">");            for (int i = 0; i < menu.getMenuComponentCount(); i++) {                SComponent menuItem = menu.getMenuComponent(i);                    if (menuItem.isVisible()) {                    device.print("<li");                    if (menuItem instanceof SMenu) {                        if (menuItem.isEnabled()) {                            device.print(" class=\"SMenu\"");                        } else {                            device.print(" class=\"SMenu_Disabled\"");                        }                    } else {                        if (menuItem.isEnabled()) {                            device.print(" class=\"SMenuItem\"");                        } else {                                device.print(" class=\"SMenuItem_Disabled\"");                        }                    }                    device.print(">");                    if (menuItem instanceof SMenuItem) {                            device.print("<a");                            if (menuItem.isEnabled()) {                                device.print(" href=\"");                                writeAnchorAddress(device, (SMenuItem) menuItem);                                device.print("\"");                            }                            if (menuItem instanceof SMenu) {                                if (menuItem.isEnabled()) {                                    device.print(" class=\"x\"");                                } else {                                    device.print(" class=\"y\"");                                }                            }                            device.print(">");                    }                    menuItem.write(device);                    if (menuItem instanceof SMenuItem) {                        device.print("</a>");                    }                    if (menuItem.isEnabled() && menuItem instanceof SMenu) {                        ((SMenu)menuItem).writePopup(device);                    }                    device.print("</li>\n");                }            }            device.print("</ul>");        }        device.print("\n");    }