//////////////////////////
function showSearchDone(req) 
{
  if (req.readyState == 4)  // only if req is "loaded"
  {
    if (req.status == 200 || req.status == 304)    // only if "OK"(200) or "Not Modified"(304) 
      document.getElementById('search').innerHTML = req.responseText;
    else document.getElementById('search').innerHTML = 'System error. Please try later.' + exitText;
  } // if LOADED
} //showSearchDone

/////////////////////////////
function showSearch(param)
{
  var req;

  if (window.XMLHttpRequest) req = new XMLHttpRequest();
  else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP");
  else return;

  //Do the request to the PHP server
  req.onreadystatechange = function() {showSearchDone(req);};
  req.open("POST", "search.php", true);
  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  sendString = 'param=' + param;

  req.send(sendString);
} //showSearch

/////////////////////////////
//function showPhishMain(pageNo, processedTime)
function showPhishMain()
{
  var selectIndex = document.getElementById('searchSelect').selectedIndex;
  var sendString = 'index.php?index=4&searchString=' + document.getElementById('searchSelect').options[selectIndex].text;

  window.location.href = sendString;
} //showPhishMain

