
function look(text, select_id, url) {//alert (text);
        var select = document.getElementById(select_id);
        //select.innerHTML='<div style=\"float: left;\"><img src=img/spinner.gif></div>';
        //select.innerHTML='подождите';
        //alert(text);
        if(!this.http){
            this.http = get_http();
            this.working = false; 
        }
        if (!this.working && this.http) {
        var http = this.http; 
            url = url +text;// alert(url);
            this.http.open("GET", url, true); 
            this.http.onreadystatechange = function() {
	            if (http.readyState == 4) {
	            	
                    if(select_id=='info'){fill_info(select_id, http.responseText);}
                    else {fill(select_id, http.responseText);}
                    this.working = false;
                  }
            }
            this.working = false;
            this.http.send(null);
        }
        if(!this.http){
              alert('Error XMLHTTP!');
        }
    }

function  get_http()
{
    var  xhr;
    if(window.XMLHttpRequest)  {
        try  {
            xhr  =  new  XMLHttpRequest();
        }  catch(e)  {
            xhr  =  false;
        }
    }  else  if(window.ActiveXObject)  { 
        try  {
            xhr  =  new  ActiveXObject("Microsoft.XMLHTTP");
        }  catch(e)  {
            xhr  =  false;
        }
    }
    return  xhr;
}
function fill (select_id, data)
{ 
	//alert (data);
    var select = document.getElementById(select_id);
   select.innerHTML='';

    select.innerHTML=data;


}
function fill_info (select_id, data)
{
	//alert (data);
    //var select = document.getElementById(select_id);
    //select.innerHTML='';

    //select.innerHTML=data;
    jQuery.facebox(data);
    
 
}
function look2(text, select_id, url) {//alert (text);
        var select = document.getElementById(select_id);
        if(!this.http){
            this.http = get_http2();
            this.working = false; 
        }
        if (!this.working && this.http) {
        var http = this.http; 
            url = url +text;// alert(url);
            this.http.open("GET", url, true); 
            this.http.onreadystatechange = function() {
	            if (http.readyState == 4) {
	            	
                    if(select_id=='info'){fill_info(select_id, http.responseText);}
                    else {fill2(select_id, http.responseText);}
                    this.working = false;
                  }
            }
            this.working = false;
            this.http.send(null);
        }
        if(!this.http){
              alert('Error XMLHTTP!');
        }
    }

function  get_http2()
{
    var  xhr;
    if(window.XMLHttpRequest)  {
        try  {
            xhr  =  new  XMLHttpRequest();
        }  catch(e)  {
            xhr  =  false;
        }
    }  else  if(window.ActiveXObject)  { 
        try  {
            xhr  =  new  ActiveXObject("Microsoft.XMLHTTP");
        }  catch(e)  {
            xhr  =  false;
        }
    }
    return  xhr;
}
function fill2 (select_id, data)
{ 
	//alert (data);
    var select = document.getElementById(select_id);
   select.innerHTML='';

    select.innerHTML=data;


}
