dimast,
var main_arr = [[0,[0,100]],1];
var path_arr = [0,1,1];
function x(e, d, f) {
for (var c = [], b = e, a = 0; a < d.length; a++) c[a] = b, b = b[d[a]];
if (3 == arguments.length) {
b = f;
for (a = c.length - 1; - 1 < a; a--) c[a][d[a]] = b, b = c[a]
}
return b
};
alert(x(main_arr,path_arr))
alert(x(main_arr,path_arr,25))
alert(main_arr)
alert(x(main_arr,path_arr,"test"))
alert(main_arr)