getElementById
is a method on document. To call it, the interpreter needs to have the function body itself, the object to call it on (document in your case), and the arguments.
When you do f = document.getElementById
, you're copying the function body, but not the object to call it on.
When you do this:
f.call(document, “funname”);
You're providing both the object to call it on, and the arguments.
If you want to be able to call f directly, you need to get the "document" object stored in there somehow. Easiest is:
var f = function(name){return document.getElementById(name)}
This creates a closure which holds on the the value of document for you.
You can also use bind() to do the same thing.