JMenu createSelectMenu(boolean popup) {

		String s = getInternationalText("Select");
		JMenu menu = new JMenu(s != null ? s : "Select");

		s = getInternationalText("All");
		JMenuItem menuItem = new JMenuItem(s != null ? s : "All");
		menuItem.setAccelerator(System.getProperty("os.name").startsWith("Mac") ? KeyStroke.getKeyStroke(KeyEvent.VK_A,
				KeyEvent.META_MASK) : KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_MASK));
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				jmolContainer.setAtomSelection(JmolContainer.SELECT_ALL);
			}
		});
		menu.add(menuItem);

		s = getInternationalText("ClearSelection");
		menuItem = new JMenuItem(s != null ? s : "Clear Selection");
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				jmolContainer.setAtomSelection((byte) -1);
			}
		});
		menu.add(menuItem);

		s = getInternationalText("Inverse");
		menuItem = new JMenuItem(s != null ? s : "Inverse");
		menuItem.setAccelerator(System.getProperty("os.name").startsWith("Mac") ? KeyStroke.getKeyStroke(KeyEvent.VK_I,
				KeyEvent.SHIFT_MASK | KeyEvent.META_MASK) : KeyStroke.getKeyStroke(KeyEvent.VK_I, KeyEvent.SHIFT_MASK
				| KeyEvent.CTRL_MASK));
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				jmolContainer.setAtomSelection(JmolContainer.SELECT_NOT_SELECTED);
			}
		});
		menu.add(menuItem);
		menu.addSeparator();

		s = getInternationalText("Element");
		if (popup) {
			elementsComputedMenu2 = new JMenu(s != null ? s : "Element");
			menu.add(elementsComputedMenu2);
		}
		else {
			elementsComputedMenu1 = new JMenu(s != null ? s : "Element");
			menu.add(elementsComputedMenu1);
		}

		// amino acids

		s = getInternationalText("AminoAcid");
		final JMenu aaMenu = new JMenu(s != null ? s : "Amino Acids");
		menu.add(aaMenu);

		s = getInternationalText("ByResidue");
		if (popup) {
			residuesComputedMenu2 = new JMenu(s != null ? s : "By Residue");
			aaMenu.add(residuesComputedMenu2);
		}
		else {
			residuesComputedMenu1 = new JMenu(s != null ? s : "By Residue");
			aaMenu.add(residuesComputedMenu1);
		}
		aaMenu.addSeparator();

		proteinGroup = new ButtonGroup();

		s = getInternationalText("All");
		final JMenuItem miAll = new JRadioButtonMenuItem(s != null ? s : "All");
		miAll.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_PROTEIN);
			}
		});
		aaMenu.add(miAll);
		proteinGroup.add(miAll);

		s = getInternationalText("Backbone");
		final JMenuItem miBackbone = new JRadioButtonMenuItem(s != null ? s : "Backbone");
		miBackbone.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_PROTEIN_BACKBONE);
			}
		});
		aaMenu.add(miBackbone);
		proteinGroup.add(miBackbone);

		s = getInternationalText("SideChain");
		final JMenuItem miSideChain = new JRadioButtonMenuItem(s != null ? s : "Side Chains");
		miSideChain.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_PROTEIN_SIDECHAIN);
			}
		});
		aaMenu.add(miSideChain);
		proteinGroup.add(miSideChain);

		s = getInternationalText("PolarResidue");
		final JMenuItem miPolar = new JRadioButtonMenuItem(s != null ? s : "Polar Residues");
		miPolar.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_PROTEIN_POLAR);
			}
		});
		aaMenu.add(miPolar);
		proteinGroup.add(miPolar);

		s = getInternationalText("NonPolarResidue");
		final JMenuItem miNonpolar = new JRadioButtonMenuItem(s != null ? s : "Non-polar Residues");
		miNonpolar.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_PROTEIN_NONPOLAR);
			}
		});
		aaMenu.add(miNonpolar);
		proteinGroup.add(miNonpolar);

		s = getInternationalText("BasicResidue");
		final JMenuItem miBasic = new JRadioButtonMenuItem(s != null ? s : "Basic Residues");
		miBasic.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_PROTEIN_BASIC);
			}
		});
		aaMenu.add(miBasic);
		proteinGroup.add(miBasic);

		s = getInternationalText("AcidicResidue");
		final JMenuItem miAcidic = new JRadioButtonMenuItem(s != null ? s : "Acidic Residues");
		miAcidic.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_PROTEIN_ACIDIC);
			}
		});
		aaMenu.add(miAcidic);
		proteinGroup.add(miAcidic);

		s = getInternationalText("NeutralResidue");
		final JMenuItem miNeutral = new JRadioButtonMenuItem(s != null ? s : "Neutral Residues");
		miNeutral.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_PROTEIN_NEUTRAL);
			}
		});
		aaMenu.add(miNeutral);
		proteinGroup.add(miNeutral);

		aaMenu.getPopupMenu().addPopupMenuListener(new PopupMenuListener() {
			public void popupMenuCanceled(PopupMenuEvent e) {
			}

			public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
				switch (jmolContainer.getAtomSelection()) {
				case JmolContainer.SELECT_PROTEIN:
					ModelerUtilities.setWithoutNotifyingListeners(miAll, true);
					break;
				case JmolContainer.SELECT_PROTEIN_BACKBONE:
					ModelerUtilities.setWithoutNotifyingListeners(miBackbone, true);
					break;
				case JmolContainer.SELECT_PROTEIN_SIDECHAIN:
					ModelerUtilities.setWithoutNotifyingListeners(miSideChain, true);
					break;
				case JmolContainer.SELECT_PROTEIN_POLAR:
					ModelerUtilities.setWithoutNotifyingListeners(miPolar, true);
					break;
				case JmolContainer.SELECT_PROTEIN_NONPOLAR:
					ModelerUtilities.setWithoutNotifyingListeners(miNonpolar, true);
					break;
				case JmolContainer.SELECT_PROTEIN_BASIC:
					ModelerUtilities.setWithoutNotifyingListeners(miBasic, true);
					break;
				case JmolContainer.SELECT_PROTEIN_ACIDIC:
					ModelerUtilities.setWithoutNotifyingListeners(miAcidic, true);
					break;
				case JmolContainer.SELECT_PROTEIN_NEUTRAL:
					ModelerUtilities.setWithoutNotifyingListeners(miNeutral, true);
					break;
				}
			}

			public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
			}
		});

		// nucleic acids

		s = getInternationalText("NucleicAcid");
		final JMenu naMenu = new JMenu(s != null ? s : "Nucleic Acids");
		menu.add(naMenu);

		ButtonGroup bg = new ButtonGroup();

		s = getInternationalText("All");
		final JMenuItem miNucleicAll = new JRadioButtonMenuItem(s != null ? s : "All");
		miNucleicAll.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_NUCLEIC_ALL);
			}
		});
		naMenu.add(miNucleicAll);
		bg.add(miNucleicAll);

		s = getInternationalText("Backbone");
		final JMenuItem miNucleicBackbone = new JRadioButtonMenuItem(s != null ? s : "Backbone");
		miNucleicBackbone.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_NUCLEIC_BACKBONE);
			}
		});
		naMenu.add(miNucleicBackbone);
		bg.add(miNucleicBackbone);

		s = getInternationalText("Base");
		final JMenuItem miNucleicBase = new JRadioButtonMenuItem(s != null ? s : "Bases");
		miNucleicBase.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_NUCLEIC_BASE);
			}
		});
		naMenu.add(miNucleicBase);
		bg.add(miNucleicBase);
		naMenu.addSeparator();

		s = getInternationalText("Adenine");
		final JMenuItem miAdenine = new JRadioButtonMenuItem(s != null ? s : "A - Adenine");
		miAdenine.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_NUCLEIC_ADENINE);
			}
		});
		naMenu.add(miAdenine);
		bg.add(miAdenine);

		s = getInternationalText("Cytosine");
		final JMenuItem miCytosine = new JRadioButtonMenuItem(s != null ? s : "C - Cytosine");
		miCytosine.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_NUCLEIC_CYTOSINE);
			}
		});
		naMenu.add(miCytosine);
		bg.add(miCytosine);

		s = getInternationalText("Guanine");
		final JMenuItem miGuanine = new JRadioButtonMenuItem(s != null ? s : "G - Guanine");
		miGuanine.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_NUCLEIC_GUANINE);
			}
		});
		naMenu.add(miGuanine);
		bg.add(miGuanine);

		s = getInternationalText("Thymine");
		final JMenuItem miThymine = new JRadioButtonMenuItem(s != null ? s : "T - Thymine");
		miThymine.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_NUCLEIC_THYMINE);
			}
		});
		naMenu.add(miThymine);
		bg.add(miThymine);

		s = getInternationalText("Uracil");
		final JMenuItem miUracil = new JRadioButtonMenuItem(s != null ? s : "U - Uracil");
		miUracil.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_NUCLEIC_URACIL);
			}
		});
		naMenu.add(miUracil);
		bg.add(miUracil);
		naMenu.addSeparator();

		s = getInternationalText("ATPair");
		final JMenuItem miAT = new JRadioButtonMenuItem(s != null ? s : "A-T Pairs");
		miAT.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_NUCLEIC_AT);
			}
		});
		naMenu.add(miAT);
		bg.add(miAT);

		s = getInternationalText("CGPair");
		final JMenuItem miCG = new JRadioButtonMenuItem(s != null ? s : "C-G Pairs");
		miCG.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_NUCLEIC_CG);
			}
		});
		naMenu.add(miCG);
		bg.add(miCG);

		s = getInternationalText("AUPair");
		final JMenuItem miAU = new JRadioButtonMenuItem(s != null ? s : "A-U Pairs");
		miAU.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED)
					jmolContainer.setAtomSelection(JmolContainer.SELECT_NUCLEIC_AU);
			}
		});
		naMenu.add(miAU);
		bg.add(miAU);

		naMenu.getPopupMenu().addPopupMenuListener(new PopupMenuListener() {
			public void popupMenuCanceled(PopupMenuEvent e) {
			}

			public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
				switch (jmolContainer.getAtomSelection()) {
				case JmolContainer.SELECT_NUCLEIC_ALL:
					ModelerUtilities.setWithoutNotifyingListeners(miNucleicAll, true);
					break;
				case JmolContainer.SELECT_NUCLEIC_BACKBONE:
					ModelerUtilities.setWithoutNotifyingListeners(miNucleicBackbone, true);
					break;
				case JmolContainer.SELECT_NUCLEIC_BASE:
					ModelerUtilities.setWithoutNotifyingListeners(miNucleicBase, true);
					break;
				case JmolContainer.SELECT_NUCLEIC_ADENINE:
					ModelerUtilities.setWithoutNotifyingListeners(miAdenine, true);
					break;
				case JmolContainer.SELECT_NUCLEIC_CYTOSINE:
					ModelerUtilities.setWithoutNotifyingListeners(miCytosine, true);
					break;
				case JmolContainer.SELECT_NUCLEIC_GUANINE:
					ModelerUtilities.setWithoutNotifyingListeners(miGuanine, true);
					break;
				case JmolContainer.SELECT_NUCLEIC_THYMINE:
					ModelerUtilities.setWithoutNotifyingListeners(miThymine, true);
					break;
				case JmolContainer.SELECT_NUCLEIC_URACIL:
					ModelerUtilities.setWithoutNotifyingListeners(miUracil, true);
					break;
				case JmolContainer.SELECT_NUCLEIC_AT:
					ModelerUtilities.setWithoutNotifyingListeners(miAT, true);
					break;
				case JmolContainer.SELECT_NUCLEIC_CG:
					ModelerUtilities.setWithoutNotifyingListeners(miCG, true);
					break;
				case JmolContainer.SELECT_NUCLEIC_AU:
					ModelerUtilities.setWithoutNotifyingListeners(miAU, true);
					break;
				}
			}

			public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
			}
		});

		return menu;

	}