function ListToPopUp () {
var all_div = document.getElementsByTagName('div');

for (var i = 0; i < all_div.length; i++) {

if (all_div[i].className == 'list-to-popup') {

var form = document.createElement('form');
var select = document.createElement('select');

if(navigator.userAgent.indexOf("MSIE")!=-1) {
select.setAttribute('onchange',new Function("window.location.href = this.value"));
} else {
select.setAttribute('onchange',"window.location.href = this.value");
}
form.appendChild(select);
all_div[i].appendChild(form);

var option = document.createElement('option');
option.setAttribute('value',"");
var selectName = document.createTextNode('Select...');
option.appendChild(selectName);
select.appendChild(option);

var all_li = all_div[i].getElementsByTagName('li');

for (var n = 0; n < all_li.length; n++) {
var srcName = all_li[n].firstChild.getAttribute('href');
var a = all_li[n].firstChild;

if (a.firstChild.nodeValue) {
var selectNameText = a.firstChild.nodeValue;
var countText = all_li[n].lastChild.nodeValue;
selectNameText = selectNameText+countText;

option = document.createElement('option');
option.setAttribute('value',srcName);
selectName = document.createTextNode(selectNameText);
option.appendChild(selectName);
select.appendChild(option);
}
}
all_div[i].removeChild(all_div[i].getElementsByTagName('ul')[0]);
}
}
}
