/* septani */
var whisperTimeout = null;
var httpRequestWhisper;

function whisper(base_dir, web)
{
  var c = readCookie(web + "_option_whisper"); 
  if ((readCookie(web + "_user_login") != null) && (c == "0"))
    return; 

  if (whisperTimeout != null)
    clearTimeout(whisperTimeout);
  
  whisperTimeout = setTimeout("whisperSearch('" + base_dir + "');", 500);
}

function whisperHide()
{
  setTimeout('e("whisper").style.display = "none";', 200);
}

function whisperSearch(base_dir)
{
  var link = base_dir + "svc_whisper.php?w=" + urlencode(e("tbxSearch").value);
  
  httpRequestWhisper = createAjax();
  httpRequestWhisper.open("GET", link, true);
  httpRequestWhisper.onreadystatechange= function () {whisperShow(); } ;
  httpRequestWhisper.send(null);
}

function whisperShow()
{
  if (httpRequestWhisper.readyState == 4)
    if (httpRequestWhisper.status == 200)
    {
      var resp = httpRequestWhisper.responseText;
      
      if ((resp != "error") && (resp != ""))
      {
        e("whisper").innerHTML = resp;
        e("whisper").style.display = "";
      }
      else
        whisperHide();
    }
}

