I'm trying to build a sign-in form similar to Twitter, but I have one problem. When "Sign In" is clicked, the form appears. And when "Sign In" is clicked again, the form goes away. This fine, but I would like the form to go away also when the user clicks outside the form.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>jQuery Testing</title>
 <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
 <script type="text/javascript">
  $(function() {
   $('.signIn').click(function() {
    $(this).toggleClass('highlight');
    $('form').toggleClass('show');
   });
  });
 </script>
    <style type="text/css">
    #container {
 margin: 0 auto;
 width: 920px;
 border: #ccc solid 1px;
 padding: 20px;
 overflow: auto;
 background: #ebebeb;
    }
    .signIn {
 float: right;
 padding: 5px 5px 0;
    }
    form {
 background: #0000ff;
 padding: 10px;
 width: 200px;
 float: right;
 clear: both;
 position: absolute;
 margin-left: 700px;
 margin-top: 25px;
 display: none;
    }
    label, input {
 display: block;
    }
    .highlight {
 background: #0000ff;
 color: #fff;
    }
    .show {
 display: block;
    }
    </style>
    </head>
    <body>
    <div id="container">
 <div class="right">
  <a href="#" class="signIn">Sign In</a>
  <form>
   <label>Username</label>
   <input type="text" />
   <label>Password</label>
   <input type="text" />
  </form>
 </div>
    </div>
    </body>
    </html>