title: Thoughts on image replacement fading etc. via jQuery
body: <p>Any thoughts on this approach? Any feedback greatly appreciated. tryFindUserName is an AJAX call that returns a simple true or false. My concern is that it is not neat enough, nor does it extend very well. Also, should I check state change as the code below always hides and shows the img.</p>
  
  <p>Also any thoughts on the hard coding of the image path?</p>
  
  <pre><code>// Change handlers for registration form
  //
  $('#login_register_username').keyup(function () {
      var length = $('#login_register_username').val().length;
      if (length &lt; 4) {
          return;
      }
  
      var source = null;
      var result = tryFindUserName($('#login_register_username').val());
      if (result == false) {
          source = "tick.png";
      }
      else {
          source = "cross.png";
      }
  
      $("#login_register_username_confirmation_img").hide().attr('src', '../../Images/Ajax/' + source);
      $("#login_register_username_confirmation_img").fadeIn(1000);
  
      updateRegisterButtonState();
  });
  </code></pre>