function ul2select(hid, sel, foo){
  var select=document.createElement('select');
  var holder = document.getElementById(hid);
  var ul = holder.getElementsByTagName('ul')[0];
  var az = ul.getElementsByTagName('A');
  var createOption = function (a) {
    	var opt = document.createElement('option');
	opt.innerHTML = a.innerHTML;
	opt.value = a.href;
	opt.selected = a.id == sel ? "selected" : "";
	return opt;
  }

  select.onchange = function(){
    if(this.options[this.selectedIndex].value != false) 
      location.href = this.options[this.selectedIndex].value
  };

  var deft = {innerHTML:foo, href:0, id:"x0"};
  select.appendChild(createOption(deft));

  for (var i = 0;it = az[i];i++){
	select.appendChild(createOption(it));
  }
  holder.removeChild(ul);
  holder.appendChild(select);
  
}