title: function is not defined in javascript. why?
body: <p>I am calling javascript function from html. But it keeps return error and saying function is not defined in <a href="http://jsfiddle.net/doforumda/95wqh/" rel="nofollow">jsfiddle</a>.</p>
  
  <p>here is html code</p>
  
  <pre><code>&lt;div id="Container"&gt;
      &lt;img alt="Click to zoom" class="image" onclick="resizeImg(this)" 
  src="http://www.extremetech.com/wp-content/uploads/2012/12/Audi-A1.jpg" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>here is javascript</p>
  
  <pre><code>function resizeImg (img) {
          var resize = 150; // resize amount in percentage
          var origH  = 61;  // original image height
          var origW  = 250; // original image width
          var mouseX = event.x;
          var mouseY = event.y;
          var newH   = origH * (resize / 100);
          var newW   = origW * (resize / 100);
  
          // Set the new width and height
          img.style.height = newH;
          img.style.width  = newW;
  
          var c = img.parentNode;
  
          // Work out the new center
          c.scrollLeft = (mouseX * (resize / 100)) - (newW / 2) / 2;
          c.scrollTop  = (mouseY * (resize / 100)) - (newH / 2) / 2;
      }
  </code></pre>
  
  <p>Why and how to solve it?</p>