call function using if statement
<p>I want to be able to call a function within an if statement.</p>

<p>For example:</p>

<pre><code>var photo = "yes";

if (photo=="yes") {

    capturePhoto();

}

else {
  //do nothing
}; 
</code></pre>

<p>This does nothing though. The function is clearly defined above this if statement.</p>

<p>Edit: Wow, downboated to hell! capturePhoto(); was just an example function that didn't really need any more explanation in this scenario?</p>
