Edit in JSFiddle

var selecciona = function(ids, propiedad, valor){
    var valores = ids.split(",");
    for (var i in valores)
        document.getElementById(valores[i].replace(/\s/g, "")).style[propiedad] = valor;
};
 
selecciona("nombre_1, nombre_2, nombre_3", "display", "block");
<div id = "nombre_1"></div>
<div id = "nombre_2"></div>
<div id = "nombre_3"></div>
div{
    width: 10em;
    height: 10em;
    margin-bottom: 1em;
    background: green;
    display: none;
}