Use this solution if it is absolutely necessary for you to execute in the context of Global object otherwise I prefer Solution 2(inspired by dystroy's answer)
Solution 1
if(window[className+"Click"]){
window[className+'Click']();
}else{
for(var f in window){
if(window.hasOwnProperty(f) && typeof window[f]=='function'){
if(f.toLowerCase() === className.toLowerCase()+'click'){
window[f]();
}
}
}
}
Solution 2
//Create an Object and store all the references
var functions_hash = {}
for(var f in window){
if(window.hasOwnProperty(f) && typeof window[f]=='function'){
functions_hash[f.toLowerCase] = window[f]
}
}
//execute using the hash later on
functions_hash[className.toLowerCase()+'click']