I've seen this technique for calling a Javascript function based on the value of a string variable.
function foo() {
alert('foo');
}
var test = 'foo';
window[test](); //This calls foo()
Is this the accepted way to do it or is there a better way? Any cross-browser issues to worry about?