Cambia esto
lVentanas[lVentanas.length] = id
por esto
lVentanas.push(id);
Creo que funcionará.... no se... como minimo es mas elegante.
Tambien cambiaria la funcion para eliminar una unicaventana y usaria la función
The splice() method is used to remove and add new elements to an array.
Te ahorraras matrices auxiliares...
Quim