var xmlHttp
function search(str,page,resid)
{	
xmlHttp=GetXmlHttpObject1()

if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
lang = document.getElementById('txtlang').value;

var url="autocomplete.php"
url=url+"?q="+str+"&lang="+lang
//alert(url);
if(str==""){
	document.getElementById("searchresult").style.display='none';
}
xmlHttp.onreadystatechange = stateChanged23
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged23()
{	
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
	if(xmlHttp.responseText.length>0){
		document.getElementById("searchresult").style.display='block';
		document.getElementById("searchresult").innerHTML=xmlHttp.responseText;
	}else{
		document.getElementById("searchresult").style.display='none';
		
	}
}
}

function GetXmlHttpObject1()
{
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;
}



 function GetXMLHttp123() {
            var xmlhttp = false;
           /* *@cc_on@**/
            /*@if (@_jscript_version >= 5)
            try {
                xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (E) {
                    xmlhttp = false;
                }
            }
            @end@*/
            if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
                try {
                    xmlhttp = new XMLHttpRequest();
                } catch (e) {
                    xmlhttp = false;
                }
            }
            if (!xmlhttp && window.createRequest) {
                try {
                    xmlhttp = window.createRequest();
                } catch (e) {
                    xmlhttp = false;
                }
            }


            return xmlhttp;
        }
