var maxLength = 10;
Menu2Options= new Array;
var Menu2OriginalLength = Menu2Options.length;


Menu1Options= new Array;

Menu1Options[0] = "Personal Development";
Menu1Options[1] = "HTML Tutorial";
Menu1Options[2] = "JavaScript Tutorial";


function changeListOfPages()
/*This function changes the list of pages-to-go in Menu2, depending on the subject selected in Menu1*/
{
Menu2Options.length = 0;
Menu1SelectedItem = document.DoubleDropDownMenu.Menu1.selectedIndex;
        if (Menu1SelectedItem == null) return;

        if (Menu1SelectedItem == 0)
         /*Personal Development*/
        {
        Menu2Options= new Array;
        Menu2Options[0] = new Option("Select a Page");
        Menu2Options[1] = new Option("Freeing the Mind");
        Menu2Options[2] = new Option("Life, Death and the Spirit");
        Menu2Options[3] = new Option("Voyage from Flatland");
        Menu2Options[4] = new Option("Deal with Emotions Now");
        Menu2Options[5] = new Option("30 Plus Techniques");
        Menu2Options[6] = new Option("General Semantics");
        Menu2Options[7] = new Option("New Life Course");
        Pages = new Array;
        Pages[0] = "";
        Pages[1] = "../index.html";
        Pages[2] = "../Spiritual/index.html";
        Pages[3] = "../Flatland/voyage_from_flatland.htm";
        Pages[4] = "../FeelingGood/FeelingGood.html";
        Pages[5] = "../Vignettes/index.html";
        Pages[6] = "../KenGenSemantics.htm";
        Pages[7] = "http://www.trans4mind.com/new_life_course/index.htmll";
        }
        if (Menu1SelectedItem == 1)
       /*HTML Tutorial Topics*/
        {
        Menu2Options= new Array;
        Menu2Options[0] = new Option("Select a Page");
        Menu2Options[1] = new Option(" Introduction ");
Menu2Options[2] = new Option(" Headings  ");
Menu2Options[3] = new Option(" Making comments in HTMl   ");
Menu2Options[4] = new Option(" Bold Text   ");
Menu2Options[5] = new Option(" Using Page Colour ");
Menu2Options[6] = new Option(" An example of using background colour ");
Menu2Options[7] = new Option(" Using Background Images   ");
Menu2Options[8] = new Option(" Putting in horizontal rules ");
Menu2Options[9] = new Option(" Jumping to a new page   ");
Menu2Options[10] = new Option(" Jumping within a page.   ");
Menu2Options[11] = new Option(" Inserting Images   ");
Menu2Options[12] = new Option(" Getting the images aligned ");
Menu2Options[13] = new Option(" Jumping to a new page from an");
Menu2Options[14] = new Option(" Listing things  using");
Menu2Options[15] = new Option(" Controlling the fonts. ");
Menu2Options[16] = new Option(" Special Characters  ");
Menu2Options[17] = new Option(" Inserting Tables   ");
Menu2Options[18] = new Option(" The frame page ");
Menu2Options[19] = new Option(" Jumping in frames. ");
Menu2Options[20] = new Option(" The noframes tag! ");
Menu2Options[21] = new Option(" Iframes  ");
Menu2Options[22] = new Option(" Forms ");
Menu2Options[23] = new Option(" Buttons in Forms  ");
Menu2Options[24] = new Option(" Menus in Forms  ");
Menu2Options[25] = new Option(" Meta tags. ");
Menu2Options[26] = new Option(" Doing it with style! ");
Menu2Options[27] = new Option(" Making your site navigable  ");
Menu2Options[28] = new Option(" Useful resources  ");

        /*HTML Tutorial Files*/
        Pages = new Array;
        Pages[0] = "";
Pages[1] = "../HTMLGuide/introHTML.htm ";
Pages[2] = "../HTMLGuide/Headings.htm ";
Pages[3] = "../HTMLGuide/Comments.htm ";
Pages[4] = "../HTMLGuide/Bold.htm ";
Pages[5] = "../HTMLGuide/PageColour.htm ";
Pages[6] = "../HTMLGuide/ExPageColour.htm ";
Pages[7] = "../HTMLGuide/background_images.htm ";
Pages[8] = "../HTMLGuide/horizontal_rules.htm ";
Pages[9] = "../HTMLGuide/hypertext_links.htm ";
Pages[10] = "../HTMLGuide/anchors.htm ";
Pages[11] = "../HTMLGuide/images.htm ";
Pages[12] = "../HTMLGuide/ImageAlignment.htm ";
Pages[13] = "../HTMLGuide/ImageHyperlink.htm ";
Pages[14] = "../HTMLGuide/Lists.htm ";
Pages[15] = "../HTMLGuide/font.htm ";
Pages[16] = "../HTMLGuide/specialCharacters.htm ";
Pages[17] = "../HTMLGuide/tables.htm ";
Pages[18] = "../HTMLGuide/framesFrame.htm ";
Pages[19] = "../HTMLGuide/framesHyperlinks.htm ";
Pages[20] = "../HTMLGuide/noframes.htm ";
Pages[21] = "../HTMLGuide/iframes.htm ";
Pages[22] = "../HTMLGuide/forms.htm ";
Pages[23] = "../HTMLGuide/buttons.htm ";
Pages[24] = "../HTMLGuide/FormSelect.htm ";
Pages[25] = "../HTMLGuide/metaTags.htm ";
Pages[26] = "../HTMLGuide/Style.htm ";
Pages[27] = "../HTMLGuide/navigation.htm ";
Pages[28] = "../HTMLGuide/resources.htm ";



        }
        if (Menu1SelectedItem == 2)
        /*Java Script Tutorial*/
        {
        Menu2Options= new Array;
        Menu2Options[0] = new Option("Select a Page");
        Menu2Options[1] = new Option(" Message Boxes    ");
Menu2Options[2] = new Option(" Text Alerts  ");
Menu2Options[3] = new Option(" Alerts with images  ");
Menu2Options[4] = new Option(" Jumping with a form button  ");
Menu2Options[5] = new Option(" Confirming Options  ");
Menu2Options[6] = new Option(" More on the Confirmation Message Box  ");
Menu2Options[7] = new Option(" Hello and Goodbye Messages    ");
Menu2Options[8] = new Option(" Example of Hello and Goodbye Page  ");
Menu2Options[9] = new Option(" Prompting for User Input    ");
Menu2Options[10] = new Option(" Example of Prompting for Input  ");
Menu2Options[11] = new Option(" Writing with Java Script    ");
Menu2Options[12] = new Option(" Writing where you like ");
Menu2Options[13] = new Option(" Example  ");
Menu2Options[14] = new Option(" Opening new Windows    ");
Menu2Options[15] = new Option(" Writing to Windows  ");
Menu2Options[16] = new Option(" Using Hyperlinks in New Windows  ");
Menu2Options[17] = new Option(" Drop-down menus    ");
Menu2Options[18] = new Option(" Menus without a buttons   ");
Menu2Options[19] = new Option(" Menus with Descriptions   ");
Menu2Options[20] = new Option(" Frames    ");
Menu2Options[21] = new Option(" Hyperlinks in Frames  ");
Menu2Options[22] = new Option(" Backward and Forward Buttons  ");
Menu2Options[23] = new Option(" Double Drop-Down Menu ");

        /*Java Script Files*/
        Pages = new Array;
        Pages[0] = "";
        Pages[1] = "alerts.htm";
Pages[2] = "alertsText.htm";
Pages[3] = "alertsImages.htm";
Pages[4] = "jumpfunction.htm";
Pages[5] = "alertConfirm.htm";
Pages[6] = "alertConfirm2Locs.htm";
Pages[7] = "alertOnLoad.htm";
Pages[8] = "alertHelloEx.htm";
Pages[9] = "alertPrompts.htm";
Pages[10] = "alertPromptEx.htm";
Pages[11] = "documentWrite.htm";
Pages[12] = "documentWrite2.htm";
Pages[13] = "alertPromptEx2.htm";
Pages[14] = "WindowNew.htm";
Pages[15] = "WindowNew2.htm";
Pages[16] = "WindowNewHyperlinks.htm";
Pages[17] = "menu1.htm";
Pages[18] = "menuSelectOnChange.htm";
Pages[19] = "ArrayText.htm";
Pages[20] = "jsFrames.htm";
Pages[21] = "frameHyperlinks.htm";
Pages[22] = "BackForward.htm";
Pages[23] = "Doublemenu.htm";
        }
/*Depending on what has been selected, this is the function that loads the pages-to-go into Menu2*/
tot = Menu2Options.length;
  for (i = Menu2OriginalLength; i > 0; i--)
        { document.DoubleDropDownMenu.Menu2.options[i] = null; }
/* The above nulls off all the options to allow the subjects to be changed without leaving data in the array from previous, longer lists of files. */
        for (i = 0; i < tot; i++)
        { document.DoubleDropDownMenu.Menu2.options[i] = Menu2Options[i]; }
        document.DoubleDropDownMenu.Menu2.options[0].selected = true;
/* The above fills the options with the descriptions of the files and makes the first description the selected one. */
Menu2OriginalLength = Menu2Options.length;
/* This makes the value of Menu2OriginalLength correct, if the subjects have been changed. */
}

function gotoPage()
/*This function loads the selected page to go into the browser.*/
        {

        i = document.DoubleDropDownMenu.Menu2.selectedIndex;
        window.location.href = Pages[i];
        }



