var xmlHttp
function showResult(str)
{
if (str.length==0)
 { 
 document.getElementById("result").
 innerHTML="<h1 style=\"font-size:13px;\">Welcome to Dictionary .hm!</h1><ul><li>To Begin, just type! Results will appear here automatically (using Ajax).</li><li>Having problems? Try the <a href=\"no-javascript.php\">javascript free version</a>.</li><li>Find out more - just type 'about us'!</li><li>Try <a href=\"./browse\">Browsing</a> our database.</li><li>Now you can highlight the word and click for an instant definition!<ul><li>IE users drag this link to your 'links' bar: <a href=\"javascript:Wrd=document.selection.createRange().text;if(!Wrd){void(Wrd=prompt('No Word Selected, Please Type One In',''))}if(Wrd)location.href='http://www.dictionary.hm?'+escape(Wrd)+' '\">Dictionary.hm</a>.</li><li>Firefox/Opera users, drag this link to your 'Bookmarks' Bar: <a href=\"javascript:Wrd=document.getSelection();if(!Wrd){void(Wrd=prompt('No Word Selected, Please Type One In',''))}if(Wrd)location.href='http://www.dictionary.hm?'+escape(Wrd)+' '\">Dictionary.hm</a>.</li><li>Safari users, drag this link to your 'Bookmarks' Bar: <a href=\"javascript:Wrd=window.getSelection()+'';Wrd=(Wrd.length==0)?document.title:Wrd;if(!Wrd){void(Wrd=prompt('No%20Word%20Selected,%20Please%20Type%20One%20In',''))}if(Wrd)location.href='http://www.dictionary.hm?'+escape(Wrd)+'%20'\">Dictionary.hm</a>.</li></ul></ul><br /><center><small>Copyright &copy; Dictionary.hm. Database courtesy of WordNet, Princeton University - <a href=\"http://www.dictionary.hm/license.txt\">View License</a></small></center>";
 return
 }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="search_function.php"
url=url+"?sid="+Math.random()
url=url+"&q="+str
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("result").
 innerHTML=xmlHttp.responseText;
 } 
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
