var rf = 0;
var ls = "";

$(document).ready(function() {
  $("#tomt input").change(function() { tomt_trig(); });
  $("#tomt input").keyup(function() { tomt_trig(); });
  tomt();
});

function tomt_trig()
{
  clearTimeout(rf);
  rf = setTimeout(function() { tomt(); }, 400);
}

function tomt()
{
  var ns = "tomt.shtml?" + $("#ftomt").serialize();
  if(ls == ns) return;
  ls = ns;

  $("#w_h").html("Searching...");
  $.get(ls, function(ret) { $("#w_f").html(ret); });
}