title: jQuery condition for animation
body: <p>am brand new to javascript and jQuery so this question might seem dumb but i couldnt find any exemple or doc on it.</p>
  
  <p>I got this function for a little color animation roll-over and roll-out which works fine:</p>
  
  <pre><code>$(".box_nav").hover(function(){
              jQuery(this).stop(true, false);
              $(this).animate({ backgroundColor: "#fff"}, 300 ); },
          function() {
              jQuery(this).stop(true, false);
              $(this).animate({ backgroundColor: "#000"}, 300 ); }
  );
  </code></pre>
  
  <p>The fact if that i renctly added a stylesheet change button that also works fine:</p>
  
  <pre><code>$(".black-white").click(function(){
          $("link").attr("href", "&lt;?php bloginfo("template_url"); ?&gt;/css/styles-black-white.css");
          $(".wp-polls-loading").css({ display:"none"});
          return false;
      });
  
      $(".grey-white").click(function(){
          $("link").attr("href", "&lt;?php bloginfo("template_url"); ?&gt;/css/styles-grey-white.css");
          $(".wp-polls-loading").css({ display:"none"});
          return false;
      });
  </code></pre>
  
  <p>The point is that i'd like to create a condition on my roll-over menu so that i can switch the color of this over too. </p>
  
  <p>So i tried several things like this:</p>
  
  <pre><code>/////////////////////////////////////////////////////////////////////////////
      //Stylesheet change
      $(".black-white").click(function(){
          $("link").attr("href", "&lt;?php bloginfo("template_url"); ?&gt;/css/styles-black-white.css");
          $(".wp-polls-loading").css({ display:"none"});
          var tt = "black";
          return false;
      });
  
      $(".grey-white").click(function(){
          $("link").attr("href", "&lt;?php bloginfo("template_url"); ?&gt;/css/styles-grey-white.css");
          $(".wp-polls-loading").css({ display:"none"});
          var tt = "grey";
          return false;
      });
  
      /////////////////////////////////////////////////////////////////////////////
      //Over menu
      if (tt == "black"){
          $(".box_nav").hover(function(){
              jQuery(this).stop(true, false);
              $(this).animate({ backgroundColor: "#fff"}, 300 ); },
          function() {
              jQuery(this).stop(true, false);
              $(this).animate({ backgroundColor: "#000"}, 300 ); }
          );
      }else {
          $(".box_nav").hover(function(){
              jQuery(this).stop(true, false);
              $(this).animate({ backgroundColor: "#000"}, 300 ); },
          function() {
              jQuery(this).stop(true, false);
              $(this).animate({ backgroundColor: "#e2e2e2"}, 300 ); }
          );
      }
  </code></pre>
  
  <p>But of course doesnt go. The only thing that work a bit is if i change the "black" in the if () sor anything else it does well the second roll-over style.</p>
  
  <p>Any idea ?</p>