setting a focus event not working

setting a focus event not working

Hi experts,
 
I am working in a third party application which has a hook into their window.onload() function.(it calls my fnCustomOnload()). In my fnCustomOnload() function I have tried to bind a focusout event on a particular input and have it call a function callled fnGetRestriction(). The function fnGetRestriction() actually works without errors, I have forced it with the grabfocus.focus() (lines 2 and 3) but it is called not being called any time other than once at the beginning when it is force by lines 2 and 3.. The line that performs the alert() (line 4) works properly all the time. What is wrong with line 5?
  1. function fnCustomOnload() {
  2. //var grabfocus = document.getElementById("WCCode");
  3. //grabfocus.focus();
  4. $('#WCCode').bind('focusout',function (){ alert("WCCode lost focus"); });
  5. //$('#WCCode').bind('focusout',fnGetRestriction());
  6. }
  7. Thanks very much for your help.