var dist = [
['Mvunyane Gate', [], []],
['Ntshondwe Camp', [6], ["0:12"]],
['Mhlangeni Bush Camp', [18,24], ["0:36","0:48"]],
['Mbizo Bush Camp', [24,20,38], ["0:48","0:40","1:16"]],
['Doornkraal Campsite', [25,21,39,1], ["0:50","0:42","1:18","0:02"]],
['Thalu Bush Camp', [26,22,40,2,1], ["0:52","0:44","1:20","0:04","0:02"]]
];


// Distance Calculator with Times at average speed of 30km/h
// copyright 27th April 2006, by Stephen Chapman
// permission to use this Javascript on your web page is granted
// provided that all of the code below in this script (including these
// comments) is used without any alteration
function reverse(a, b){if (a>b) return -1;if (a <b) return 1;return 0;}function setOptions(id) {var selbox = document.getElementById(id);selbox.options.length = 0;var ct = []; for (var i = dist.length - 1; i >= 0; i--) {ct[i] = dist[i][0]+','+i;} ct.sort(reverse); for (var i = dist.length - 1; i >= 0; i--) {var c = ct[i].split(','); selbox.options[selbox.options.length] = new Option(c[0],c[1]);}}function calc() {var v1 = document.getElementById('ca').value;var v2 =  document.getElementById('cb').value;var dst = 0;if (v1 != v2) {dst =dist[Math.max(v1,v2)][1][Math.min(v1,v2)];tme = dist[Math.max(v1,v2)][2][Math.min(v1,v2)];}
// change the following line to allow both miles and km if required
document.getElementById('m').value = dst/1.6;
document.getElementById('k').value = dst;
document.getElementById('t').value = tme;}function start() {setOptions('ca');setOptions('cb');}window.onload=start;
                  