var timer = 0;
var xml = null;
function hideQuerysZSearch() { window.clearTimeout(timer); timer = window.setTimeout('hideQuerysZSearch2()',123); }
function hideQuerysZSearch2() { document.getElementById('ZSearchQuery_results').style.display = 'none'; }
function getQuerysZSearch(q){window.clearTimeout(timer);timer = window.setTimeout('getQuerysZSearch2("'+escape(q)+'")',200);}
function getQuerysZSearch2(q){if(window.XMLHttpRequest){ xml = new XMLHttpRequest(); }
 else if(window.ActiveXObject){try{ xml = new ActiveXObject('Msxml2.XMLHTTP'); }
  catch(e1){try{ xml = new ActiveXObject('Microsoft.XMLHTTP'); }catch(e2){}}
 }
 if(xml != null){
 xml.open('GET','http://zipd.eu/api/search/input/default/'+q,true);
 xml.onreadystatechange = showQuerysZSearch;
 xml.send(null);
 }
}
function showQuerysZSearch()
{
if(xml.readyState == 4 && xml.status == 200){
 x = xml.responseXML.documentElement;
 s = '<table width="100%">';
 for(i=0;i<x.childNodes.length;i++)
  {
  itm = x.childNodes.item(i);
  if(itm.nodeType == 1) {
   name = itm.getAttribute('Name');
   link = itm.getAttribute('Link');
   s += '<tr'+(i%2==0?' bgcolor="#000000"':'')+'>';
   s += '<td title="'+name+'" onclick="location.href=\''+link+'\'" style="cursor:pointer;"><a title="'+name+'" class="link_item01" href="'+link+'">';
   s += name+'</a></td><td align="right"></td></tr>';
   }
  }
 if(x.childNodes.length == 0){s += '<tr><td>...</td></tr>';}
  s += '</table>';
  d = document.getElementById('ZSearchQuery_results');
  d.innerHTML = s;
  d.style.display = 'block';
 }
}
