function get_http(){
    var xmlhttp;
    /*@cc_on
    @if (@_jscript_version >= 5)
        try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                xmlhttp = new
                ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
                xmlhttp = false;
            }
        }
    @else
        xmlhttp = false;
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
        try {
            xmlhttp = new XMLHttpRequest();
        } catch (e) {
            xmlhttp = false;
        }
    }
    return xmlhttp;
}

function lookup(id) {
	// Получаем объект XMLHTTPRequest
    this.http = get_http();
    this.working = false;
	var url = '/inc/insert.php';
	select_id = 'bron_descr_full';
	if (id == 0) {
		var insert = document.getElementById(select_id);
		insert.innerHTML = "<span class='gray'>Информация</span>";
	}
	else {
    	// Запрос
    	if (!this.working && this.http) {
    		var http = this.http;
			//добавляем закодированный текст в URL запроса
        	url = url + "?id="+encodeURIComponent(id);
        	//создаём запрос
        	this.http.open("GET", url, true);
			//прикрепляем к запросу функцию-обработчик событий
			this.http.onreadystatechange = function() {
				// 4 - данные готовы для обработки
            	if (http.readyState == 4) {
					fill(select_id, http.responseText);
                	this.working = false;
            	}
            	else {
					var insert = document.getElementById(select_id);
					insert.innerHTML = "<center><div class='loadline'></div></center>";
				}
        	}
        	this.working = true;
        	this.http.send(null);
        }
	}
    if(!this.http) {
    	alert('Ошибка при создании XMLHTTP объекта!')
    }
}

function fill (select_id, data) {
	// поле SELECT в переменную в виде объекта
    var insert = document.getElementById(select_id);
    // если данных нет - не делаем больше ничего
    if(data.length == 0) return;
    insert.innerHTML = data;
}