If I have this object:

```
var myclass = {

  foo: {
    bar: function(var) {}
  },
  some: {
    bar: function(var) {}
  }
}

```

and I want to call the bar function depending on a variable that defines the parent level of the object like this:

```
var part = "some";
myclass.part.bar(var);

```

How can I do?