title: Magento: jQuery in custom file does not work
body: <p>So I am trying to add some simple jQuery to a magento-theme.
  I have put my jQuery in an external file, which lies in the "js" (skin/frontend/default/myTheme/js) folder of the theme.
  Here is the link to my site: <code>http://shop.veivecouture.com/</code>
  I am including it in the page.xml file with the following method:  </p>
  
  <pre><code>&lt;action method="addItem"&gt;&lt;type&gt;skin_js&lt;/type&gt;&lt;name&gt;js/functions.js&lt;/name&gt;&lt;/action&gt;
  </code></pre>
  
  <p>I have also tried:</p>
  
  <pre><code>&lt;action method="addJs"&gt;&lt;script&gt;../skin/frontend/default/trego/js/functions.js&lt;/script&gt;&lt;/action&gt;
  </code></pre>
  
  <p>I put them both in the "Head" block like this:</p>
  
  <pre><code>&lt;block type="page/html_head" name="head" as="head"&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;prototype/prototype.js&lt;/script&gt;&lt;/action&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;lib/ccard.js&lt;/script&gt;&lt;/action&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;prototype/validation.js&lt;/script&gt;&lt;/action&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;scriptaculous/builder.js&lt;/script&gt;&lt;/action&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;scriptaculous/effects.js&lt;/script&gt;&lt;/action&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;scriptaculous/dragdrop.js&lt;/script&gt;&lt;/action&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;scriptaculous/controls.js&lt;/script&gt;&lt;/action&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;scriptaculous/slider.js&lt;/script&gt;&lt;/action&gt;  
     &lt;action method="addJs"&gt;&lt;script&gt;varien/js.js&lt;/script&gt;&lt;/action&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;varien/form.js&lt;/script&gt;&lt;/action&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;varien/menu.js&lt;/script&gt;&lt;/action&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;mage/translate.js&lt;/script&gt;&lt;/action&gt;
     &lt;action method="addJs"&gt;&lt;script&gt;mage/cookies.js&lt;/script&gt;&lt;/action&gt;
  
     &lt;block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/&gt;
      &lt;action method="addItem"&gt;&lt;type&gt;skin_js&lt;/type&gt;&lt;name&gt;js/functions.js&lt;/name&gt;&lt;/action&gt; &lt;!-- my line --&gt;
  
      &lt;action method="addCss"&gt;&lt;stylesheet&gt;css/styles.css&lt;/stylesheet&gt;&lt;/action&gt;
      &lt;action method="addItem"&gt;&lt;type&gt;skin_css&lt;/type&gt;&lt;name&gt;css/styles-ie.css&lt;/name&gt;&lt;params/&gt;&lt;if&gt;lt IE 8&lt;/if&gt;&lt;/action&gt;
      &lt;action method="addCss"&gt;&lt;stylesheet&gt;css/widgets.css&lt;/stylesheet&gt;&lt;/action&gt;
      &lt;action method="addCss"&gt;&lt;stylesheet&gt;css/print.css&lt;/stylesheet&gt;&lt;params&gt;media="print"&lt;/params&gt;&lt;/action&gt;
      &lt;action method="addItem"&gt;&lt;type&gt;js&lt;/type&gt;&lt;name&gt;lib/ds-sleight.js&lt;/name&gt;&lt;params/&gt;&lt;if&gt;lt IE 7&lt;/if&gt;&lt;/action&gt;
      &lt;action method="addItem"&gt;&lt;type&gt;skin_js&lt;/type&gt;&lt;name&gt;js/ie6.js&lt;/name&gt;&lt;params/&gt;&lt;if&gt;lt IE 7&lt;/if&gt;&lt;/action&gt;
  &lt;/block&gt;
  </code></pre>
  
  <p>I can get to both files via "view source", so the linking seems to be right, however no jQuery takes effect.
  What am I doing wrong?</p>
  
  <p>This is the javascript in the functions.js file:</p>
  
  <pre><code>$('.block-content').hide(); //edit by Carl Papworth
  $('.block-title').click(function(e){
      e.preventDefault();
      $('.block-content').show();
      $('.close-block').click(function(e){
          e.preventDefault();
          $('.block-content').hide();
      });
  });
  </code></pre>