function hideAllHouseNumberSelects(highestId) {
    for (i=1; i<=highestId;i++) {
        var el = document.getElementById('houseNumberSelect'+i);
        try {
            el.innerHTML = '';
            //el.firstChild.style.visibility = 'hidden';
        }
        catch (e) {
            
        }
    }
}

function toggleHouseNumberSelect(id) {
    var el = document.getElementById(id);
    if (el.style.visibility == 'hidden') {
        hideAllHouseNumberSelects();
        el.style.visibility = 'visible';
    }
    else {
        el.style.visibility = 'hidden';
    }
}

function getHouseNumberSelect(street, numHouses, url) {
    var o = '<select style="font-size:10px;margin-left:5px;" onChange="self.location=this.options[this.selectedIndex].value">';
    for (var i=1; i<=numHouses; i++) {
        var urlWithKey = url+'&amp;key='+street+' '+i;
        o += '<option onClick="self.location=this.value;" value="'+urlWithKey+'">'+i+'</option>';
    }
    o += '</select>';
    return o;
}
