Added link function to window scope.