My issue is this: I call this method twice once inside a function and another in the HTML onclick. Reason is the DIV is part of a context menu. The first function call res is the correct variable I want. The second however changes res b/c Im forced to pass something as res. How do I either keep the value of the first function value of res and have the second invoke but not change res?