var req;

function loadChoices(url) {
    // Mozilla and Friends
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        // Internet Explorer
        req = new ActiveXObject("Microsoft.XMLHTTP");
    }
    req.onreadystatechange = processChoices
    req.open("GET", url, true);
    req.send(null);
}

function processChoices() {
  // wait until the request is done
  if (req.readyState == 4) {
    // Make sure request came back OK
    if (req.status == 200) {
      var d = req.responseXML.getElementsByTagName("func");
      if (d.length > 0) {
        document.forms.funclist.menu.length = 0;
        for (var n = 0; n < d.length; n++) {
          document.forms.funclist.menu[n] = new Option(d[n].firstChild.data,
                                                       d[n].getAttribute("id"));
        }
      } else {
      	//no match
      }
    } else {
        alert("Can't retrieve XML: " + req.statusText);
    }    
  }
} 

function setAction() {
     document.funclist.action = document.funclist.menu.options[document.funclist.menu.selectedIndex].value;
     return true;
}

function clickandrelocate() {
	url = document.funclist.menu.options[document.funclist.menu.selectedIndex].value;
	window.location.href= url;
}
