Can't get addClass() to work out side of $(document.ready)

Can't get addClass() to work out side of $(document.ready)

I want to be able to call a js function from any where in my site and cause a class change. 

  1. ex. in some .js 
  2. function hightlight_memorial_menu(){
  3.   $("#the-fund-subnav #memorial_scholarship a").addClass('active');
  4. }

  5. js in some page:
  6. <script type="text/javascript" language="JavaScript">
  7.   hightlight_memorial_menu();
  8. </script>
The problem is that when the function is called nothing happens... if my code is in the doc.ready function it works fine. 

I don't think I'm doing anything wrong, but maybe someone can shed some light on why this isn't working for me.