I have a javascript object (named resource) used for translating my texts.
resource
    .fileNotFound >> "File not found"
    .advSearch >> "Advanced search"
Usually I use this like below:
alert (resource.advSearch);
Now I need to access one of the member of this resource object through a variable. 
Example:
var trans = "advSearch";
My question: how can I get the translation in my resource object for 'advSearch' contained in the trans variable?
Thanks.
 
     
    