title: Can't find Variable when called function from onClick
body: <p>I'm trying to call a function with an onClick command, but I get the error "Can't find variable" in the Safari console and no action is taken. I can't see any errors, but I must be missing something that is causing this to fail.</p>
  
  <p><strong>The link</strong></p>
  
  <pre><code>&lt;a href="JavaScript:void(0);" onclick="controlWallMonitor('layout','Playback');"&gt;Show playback layout&lt;/a&gt;
  </code></pre>
  
  <p><strong>The Javascript</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      function controlWallMonitor(variable, option) {
          var WallMonitor = "10.0.50.163:9000";
          $.ajax({
              url: 'changelayout.php?target=' + WallMonitor + '&amp;variable=' + variable + '&amp;option=' + option,
          });
          return false;
      };
  });
  </code></pre>
  
  <p></p>
  
  <p>I'm sure it'll end up being incredibly obvious, but I have been googling and trying things for about 2 hours now and can't for the life of me see the problem.</p>
  
  <p>Cheers.</p>