/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Carl Leiby | http://leibys-place.com/ */
var otherStuff = {
   "Day Tours" : [ "Cape Point Day Tour - Full Day", "Whale Watching - Full Day", "Kirstenbosch & Winelands - Full Day", "Wildlife in a Day - Full Day", "Robben Island and City visit - Full Day" ],
   "Packaged Tours" : [ "20 Day Cape Town to Victoria Falls", "15 Days Nomadic Namibia", "15 Day South Africa and Swaziland", "8 or 10 Day Wine Route to Garden Route", "14 Day East Africa Trade Winds", "10 Day Mozambique", "7 Day Cape Town to Swakopmund", "5 Day Western Wanderer", "Wine and Gourmet Tour" ],
   "Specialised Tours" : [ "Golf Tour", "Festival Tour", "Wellness Spar Holidays", "Honeymoon - Namibia Desert", "Honeymoon - Botswana Vic Falls", "Honeymoon - Tanzania Wildlife", "Active Option - 16 Day Swaziland", "Active Option - 12 day Botswana", "Active Option - Cycling Package", "Active Option - 8 Day West Coast", "Active Option - Hiking Tours" ]
};

function selectAll(listName, selected) {
  var listBox = document.getElementById(listName);
  for(i=0; i<listBox.length; i++) {
    listBox.options[i].selected=selected;
  }
  if( listBox.onchange ) {
    listBox.onchange();
  }
}

function lstStuff_OnChange() {
  var listBox = document.getElementById("lstStuff");
  var subListBox = document.getElementById("lstOtherStuff");
  subListBox.options.length=0;
  for(i=0; i<listBox.length; i++) {
    if( listBox.options[i].selected ) {
      var key = listBox.options[i].text;
      if(otherStuff[key]) {
        for(j=0; j<otherStuff[key].length; j++) {
        subListBox.options.add(new Option(otherStuff[key][j],otherStuff[key][j]));
        }
      }
    }
  }
}

