
<!--

function gotoPage() {

// finds the selections in the drop-down boxes in the index page
// and works out which page to go to

  var toolbox = document.forms[0].tool;
  var cropbox = document.forms[0].crop;
  var toolindex = toolbox.selectedIndex;
  var cropindex = cropbox.selectedIndex;

  if (toolindex < 0 || toolindex >= toolbox.length) {
    window.location = "notool.html";
  } else {
    var pagename = toolbox.options[toolindex].value;
    var cropname = cropbox.options[cropindex].value;
    window.location = pagename + ".html?crop=" + cropname;
  }
}

function showTools() {

// creates the drop-down tool box in the index page
// with the entries relevant to the selected crop

  var toolbox = document.forms[0].tool;
  var cropbox = document.forms[0].crop;
  var crop = cropbox.options[cropbox.selectedIndex].value;

  var L = 0;
  if (has1(crop) == 1) {
    toolbox.options[L] = new Option("Interactive Recommended List");
    toolbox.options[L].value = "table1";
    L++;
  }
  if (has23(crop) == 1) {
    toolbox.options[L] = new Option("Varieties on your Farm");
    toolbox.options[L].value = "table2";
    L++;
    toolbox.options[L] = new Option("View trials data in detail");
    toolbox.options[L].value = "table3";
    L++;
  }
  if (has4(crop) == 1) {
    toolbox.options[L] = new Option("Disease risk");
    toolbox.options[L].value = "table4";
    L++;
  }
  toolbox.length = L;
  toolbox.selectedIndex = 0;

}

// -->


