title: one button one function on first click another on second
body: <p>I would like one button to perform two jquery functions. One on the first click then the other on the second click. Here is the code for the two buttons. Is there a way to combine the functions?</p>
  
  <pre><code>&lt;input type="button" value="View Page" onclick="ViewPage()" /&gt;
  
  &lt;script type="text/javascript"&gt;
  function ViewPage() {
  example_animate('-=50%');
  $("#mainContent").toggle();
  }
  &lt;/script&gt;
  
  &lt;input type="button" value="View Menu" onclick="ViewMenu()" /&gt;
  
  &lt;script type="text/javascript"&gt;
  function ViewMenu() {
  example_animate('+=50%');
  $("#mainContent").toggle();
  }
  &lt;/script&gt;
  </code></pre>