+ if (gametypethiscustom !== null) {
+ // Fiddle with the Custom/Customise options. If we're
+ // about to select the Custom option, then it should be in
+ // the menu, and the other one should read "Re-customise";
+ // if we're about to select another one, then the static
+ // Custom option should disappear and the other one should
+ // read "Customise".
+
+ if (gametypethiscustom.parentNode == gametypeselector)
+ gametypeselector.removeChild(gametypethiscustom);
+ if (gametypenewcustom.parentNode == gametypeselector)
+ gametypeselector.removeChild(gametypenewcustom);
+
+ if (n < 0) {
+ gametypeselector.appendChild(gametypethiscustom);
+ gametypenewcustom.lastChild.data = "Re-customise...";
+ } else {
+ gametypenewcustom.lastChild.data = "Customise...";
+ }
+ gametypeselector.appendChild(gametypenewcustom);
+ gametypenewcustom.selected = false;
+ }
+
+ if (n < 0) {
+ gametypethiscustom.selected = true;
+ } else {
+ gametypeoptions[n].selected = true;
+ }