L0k1,
var arr = [
['a1','a2','a3'],
['b1','b2'],
['c1','c2']
]
;
function go(b) {
for (var a = 0; a < b.length - 1; a++) {
for (var c = [], d = 0 ; d < b[a].length; d++)
for (var e = 0; e < b[a + 1].length; e++) c.push(b[a][d] + " " + b[a + 1][e]);
b[a + 1] = c
}
return c
};
alert(go(arr).join('\n'))