function show(k,disp)
{

         var el=document.getElementById(k);
         el.style.visibility='visible';

}
function hide(k)
{
                subhide(k);
                //setTimeout("subhide('"+k+"');",500);
}
function subhide(k)
{
       var el=document.getElementById(k);
                el.style.visibility='hidden';
}
function keep(k)
{
                subkeep(k);
                //setTimeout("subkeep('"+k+"');",500);
}
function subkeep(k)
{
         var el=document.getElementById(k);
        el.style.visibility='visible';
}

function sr(s,id,url)
{


 var text=document.getElementById(s).value;

        if(!this.http){
            this.http = get_http();
            this.working = false;
        }
        if (!this.working && this.http) {
            var http = this.http;

                url = url + "?gmarks="+text;
                //alert(url);

            this.http.open("GET", url, true);
            this.http.onreadystatechange = function() {
        // 4 - данные готовы для обработки
                if (http.readyState == 4) {
                    fill(id, http.responseText);
                    this.working = false;
                  }else{

                  }
            }
            this.working = true;
            this.http.send(null);
        }
        if(!this.http){
              alert('Ошибка при создании XMLHTTP объекта!')
        }
}
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 fill (select_id, data)
{
    //alert(data);
    var select = document.getElementById(select_id);
    //alert(data.replace("<html>","").replace("</html>",""));
    select.outerHTML="<select name=gmodels id=gmodels class=select1>"+data+"</select>";
    //alert(select.outerHTML);

}
function roll(it) {
		elem=document.getElementById(it);
		if (elem.style.display=='block') {
			elem.style.display='none';
			}
		else {
			elem.style.display='block';
			}
}
