
function createObject() {
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
}else{
request_type = new XMLHttpRequest();
}
return request_type;
}

var http = createObject();
var nocache = 0;

function do_show_search(evt)
{
	search_text=document.getElementById("inp_search_text").value
	show_content_search()
}

function show_content_search()
{
if(search_text=="")
{
return
}

//var ses = document.getElementById('session_id').value;
nocache = Math.random();
document.getElementById('search_list').innerHTML ='<img src="/img/ajax-loader.gif" alt="Поиск" />'
http.open('get', hname + 'library/_show_content_search.php?search_text='+ encodeURI(search_text) + '&count_search=' + count_search  + '&session_id='+ses+'&nocache = '+nocache);
http.setRequestHeader("Accept-Language", "ru, en");
http.setRequestHeader("Accept-Charset", "windows-1251");
//http.overrideMimeType('text/plain; charset=windows-1251'); // или text/plain
//alert( hname + 'library/_show_content_search.php?search_text='+ search_text + '&session_id='+ses+'&nocache = '+nocache)
http.onreadystatechange = loginReply;
http.send(null);
}


function loginReply() 
{
if(http.readyState == 4)
{ 
	
if (http.status == 200) 
{
            // обработка ответа
} else 
{
			
            alert("Не удалось получить данные:\n" +
                http.statusText);
document.getElementById('search_list').innerHTML =""
				return
}

var response = http.responseText;

//alert(response)
	if(response!="")
	{document.getElementById('search_list').innerHTML = response;}
	else
	{document.getElementById('search_list').innerHTML = rstr;}
	

}
}

