function showResult(str,el)
{
for( i = 0; i < document.izbor.hb.length; i++ )
{
if( document.izbor.hb[i].checked == true )
im1 = document.izbor.hb[i].value;
}
if (im1 ==1) var limitch=1; else var limitch=3;
if (str.length<=limitch)
  {
  document.getElementById("livesearch").innerHTML="";
  document.getElementById("livesearch").style.border="0px";
  document.getElementById("livesearch").style.height="0px";
  return;
  }
else
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("livesearch").innerHTML=xmlhttp.responseText;
    document.getElementById("livesearch").style.border="1px solid #A5ACB2";
  	document.getElementById("livesearch").style.height="250px";
    }
  }
xmlhttp.open("GET","farmville/search/livesearch.php?q="+str+"&el="+el+"&sorti="+im1,true);
xmlhttp.send();
}
}

function showResult1(str)
{
for( i = 0; i < document.izbor.hb.length; i++ )
{
if( document.izbor.hb[i].checked == true )
im1 = document.izbor.hb[i].value;
}
if (im1 ==1) var limitch=1; else var limitch=3;
if (str.length<=limitch)
  {
  document.getElementById("livesearch").innerHTML="";
  document.getElementById("livesearch").style.border="0px";
  document.getElementById("livesearch").style.height="0px";
  return;
  }
else
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("livesearch").innerHTML=xmlhttp.responseText;
    document.getElementById("livesearch").style.border="1px solid #A5ACB2";
	document.getElementById("livesearch").style.height="250px";
    }
  }
xmlhttp.open("GET","farmville/search/livesearch2.php?q="+str+"&sorti="+im1,true);
xmlhttp.send();
}
}

function showResult3(str)
{
document.getElementById("livesearch").innerHTML="";
document.getElementById("livesearch").style.border="0px";
document.getElementById("livesearch").style.height="0px";
document.getElementById("livesearch1").innerHTML='<img style="margin-left:250px;margin-top:50px;" src="imagenew/roll.gif" />';
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
var url = "farmville/search/poka60.php";
var params = "nm="+str;
xmlhttp.open("POST", url, true);

//Send the proper header information along with the request
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");

xmlhttp.onreadystatechange = function() {//Call a function when the state changes.
	if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		document.getElementById("livesearch1").innerHTML=xmlhttp.responseText;
	}
}
xmlhttp.send(params);
}

function showResult4(str,str1)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("livesearch1").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","farmville/search/livesearch4.php?ng="+str+"&page="+str1,true);
xmlhttp.send();
}
