// repopulate an option box with an array of values
function repopulateOptions(theBox, optionarray, lookup) {
	clearOptions(theBox);

	addOption(theBox, '...............................', '');
	addOption(theBox, 'All Suburbs', '');
	addOptions(theBox, optionarray, lookup);
}

// add all of the options in an array
function addOptions(theBox, optionarray, lookup) {
	for (i=0; i < optionarray.length; i++) {
		addOption(theBox, lookup[optionarray[i]], optionarray[i]);
	}
}

function addOption(theBox, name, value) {
  if (navigator.appName == "Netscape") {
	addOptionNS(theBox, name, value);
  }
  else if ((document.all) ? true : false) {
	addOptionIE(theBox, name, value);
  }
}

function addOptionNS(theBox, name, value) {
  // create the new option
  var newOpt  = new Option(name, value);

  // add it to the select box
  var selLength = theBox.length;
  theBox.options[selLength] = newOpt;

  // strange thing for NS4
  if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 5) history.go(0);
}

function addOptionIE(theBox, name, value) {
  // create the new option
  var newOpt = document.createElement("OPTION");
  newOpt.text=name;
  newOpt.value=value;

  // add it to the select box
  theBox.add(newOpt);
}

function clearOptions(theBox) {	
  if (navigator.appName == "Netscape") {
	clearOptionsNS(theBox);
  }
  else if ((document.all) ? true : false) {
	clearOptionsIE(theBox);
  }	
}

function clearOptionsNS(theBox) {
  while (theBox.length > 0) {
	theBox.options[theBox.length - 1] = null;
  }

  // strange thing for NS4
  if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 5) history.go(0);
}

function clearOptionsIE(theBox) {
  while (theBox.length > 0) {
	theBox.remove(theBox.length - 1);
  }
}