function resolve ( obj, lookups ) {
var curr = obj,
items = lookups.split("."),
i = 0,
len = items.length;
for ( ; i < len; i++ ) {
curr = curr[ items[ i ] ];
if ( typeof curr != 'object' ) break;
}
return curr;
}
alert(
resolve({a: {b: {c: {d: {e: { f: 1 }}}}}}, "a.b.c.d.e.f") + "\n" +
resolve({a: {b: {c: {d: {e: { f: 1 }}}}}}, "q.w.e.r.t.y")
);