function getel(id) // Возвращет объект с нужным id
  {
  return document.getElementById(id);
  }
function get_http() // Создается класс для работы Ajax
  {
      var xmlhttp;
   try{
        try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                xmlhttp = new
                ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
                xmlhttp = false;
            }
        }
   }catch(e){}
      if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
        try {
            xmlhttp = new XMLHttpRequest();
        } catch (e) {
            xmlhttp = false;
        }
      }
	return xmlhttp;
   }

function takeContent(divid,url,func) // Получение информации с заданного адреса при помощи ajax
  {
  if(!this.http)
    {
    this.http = get_http();
    }
  if (this.http)
    {
    var http = this.http;

    http.open("GET",url);


    http.onreadystatechange = function() {
      if (http.readyState == 4)
        {
        if (func) eval(func);

        var response = http.responseText;
        if (divid)
          {
          getel(divid).innerHTML=response;
          }
        else if (response.indexOf('javascript:') != -1) // Если скрипт вывел "javascript:", то выполняем код
          {
          response = response.replace(/javascript\:/,'');

          eval(response);

          }
        }
      }
    }
  this.http.send(null);
  }

function show_kv(num){	getel('kv').style.display='block';

	for(i=1;i<5;i++){		if(i!=num){			getel(('kv'+i)).style.display='none';
		}
	}
	getel(('kv'+num)).style.display='block';
	getel('con').src=('/images/con'+num+'.gif');
	getel('con_div').style.display='';

	margins=new Array(0,85,284,482,681);
	getel('con_div').style.margin=('-12px 0px 0px '+margins[num]+'px');
}

function display(id){	getel(id).style.display=(getel(id).style.display=='block'?'none':'block');
	return false;
}
