  
      function login()
  
      {
 
       

      var username = $("#username").val();
 
      var password = $("#password").val();
  if ((username == '') || (password == ''))
  
      {
  
      $("#warning").html("Both credentials are required!");

      }
 
       

      else

      {
 
      $.get("login.php?username="+username+"&amp;password="+password, function(result) {
 
      if (result == 0)

      {

      $("#warning").html("Nice try. Now do it again using correct password!");

      }

      else if (result == 1)
  {
 
      $("#activeUserDiv").html("Login successful");
 
      setTimeout("window.location.reload()",1000);

      setTimeout("tb_remove()",3000);

      }

       

      });

      }

      return false;

      }

