Okay, so I really would rather avoid using eval
at all costs, so I'm trying to figure out an alternative to calling a global function using the window object method:
var time = new Date();
var varname = time.getDay();
var obj = {'eleID':'varname'};
for (var key in obj) {
var vn = obj[key];
eval(vn); //this works
window[vn]; //this doesnt work
}