Element 'Mysteriously' reappearing

Element 'Mysteriously' reappearing

Hopefully this is not a duplication... 

I have created a login screen that uses jQuery.post for validation. During validation it shows and then hides a #loading div to denote that the data is being validated. The problem I am having is that,on some occasions (more often than I like), the #loading div appears to blink and does not go away. You can test it yourself at  test link,

The css code for this div is:
  1. #loading {
  2. clear:both;
  3. position:absolute;
  4. display: none;
  5. background: url('/images/wait.gif') center 15px no-repeat white ;
  6. text-align:center;
  7. padding: 25px;
  8. font-size:12px;
  9. font-family:Verdana, Arial, Helvetica, sans-serif;
  10. border: #000099 1px solid;
  11. }

The HTML is  (the #loading div is at the bottom):
  1. <div id="dialog" class="window">
  2. <form id="frmLogin" action="" >
  3. <input type="text" id="userName" name="userName" />
  4. <input type="password" id="password" name="password" />
  5. <input type="image" src="images/loginBtn.png" id="mySubmit"
  6.   onClick="login_verify(event,this);"/>
  7. </form>
  8. <div id="msgError"></div>
  9. <a href="javascript:void(0)" class="close" onClick="login_close(event,this)">Close it</a>

  10. <div id="loading"><br /><br />LOADING</div>
  11. </div>

The code to control this is:
  1. $("#loading").show("fast");
  2. $.post("login.php", $("#frmLogin").serialize() ,
  3. function(data) {
  4. $("#mySubmit").removeAttr("disabled");
  5. if (data.length > 0) {
  6. $("#msgError").html(data);
  7. $("#msgError").show();
  8. $("#loading").hide();
  9. } else {
  10. $("#loading").hide();
  11. window.location = "http://www.google.com";
  12. }
  13.     }
  14.   );

I have scoured the code and this is the only place where  $("#loading").show("fast"); and  $("#loading").hide(); are located.

I am thinking it is an issue with the .post callback function so I have put an alert() function in the callback function and it is being called every time.

Thanks