You could use bind
Creates a new function that, when called, has its this keyword set to
the provided value, with a given sequence of arguments preceding any
provided when the new function was called.
var f = document.getElementById.bind(document);
It was introduced in ES5, so be aware of browsers not yet supporting this version of ECMAScript!
As an alternative you could use the proxy method of jQuery, added in version 1.4
var f = $.proxy(document.getElementById, document);
Or you could delcare f
as an function of its own (this is a more verbose solution).
var f = function() { return document.getElementById(arguments); }