function domFunction(f, a)
{
	var n = 0;
	var t = setInterval(function()
	{
		var c = true;
		n++;
		if(typeof document.getElementsByTagName != 'undefined' && (document.getElementsByTagName('body')[0] != null || document.body != null))
		{
			c = false;
			if(typeof a == 'object')
			{
				for(var i in a)
				{
					if
					(
						(a[i] == 'id' && document.getElementById(i) == null)
						||
						(a[i] == 'tag' && document.getElementsByTagName(i).length < 1)
					)
					{
						c = true;
						break;
					}
				}
			}

			if(!c) { f(); clearInterval(t); }
		}
		if(n >= 60)
		{
			clearInterval(t);
		}

	}, 250);
};

	var ajax_go=0;
	var serv_http_request = false;
	function makeSERVRequest(url, parameters, my_span, ajax_span) {
   			if(ajax_go!=0){return;}
   			ajax_go=1;
		serv_http_request = false;
		if (window.XMLHttpRequest) { // Mozilla, Safari,...
			serv_http_request = new XMLHttpRequest();
			if (serv_http_request.overrideMimeType) {
            serv_http_request.overrideMimeType("text/html");
         }
      } else if (window.ActiveXObject) { // IE
         try {
            serv_http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               serv_http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }

if(ajax_span){
document.getElementById(ajax_span).innerHTML='<img src="/mkportal/modules/panel/images/ajax_load_black.gif" alt="Процесс" border="0"/>';
}
      if (!serv_http_request) {
         alert("Cannot create XMLHTTP instance");
         return false;
      }
      serv_http_request.onreadystatechange = function() { alertSERVContents(my_span, ajax_span); };
      serv_http_request.open("POST", url, true);
      serv_http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      serv_http_request.setRequestHeader("Content-length", parameters.length);
      serv_http_request.setRequestHeader("Connection", "close");
      serv_http_request.send(parameters);
   }

   function alertSERVContents(my_span, ajax_span) {
      if (serv_http_request.readyState == 4) {
         if (serv_http_request.status == 200) {
            result = serv_http_request.responseText;
            if(result.lastIndexOf("error:")==0){
            	err_msg=result.substr(6, result.indexOf("<br />"));
            	result=result.substr(result.indexOf("<br />")+6);
            	document.getElementById("srv_error_status").innerHTML='<img src="/mkportal/modules/panel/images/noloader.gif" alt="" border="0" /><font color="red"><b>Ошибка:</b></font> ' + err_msg;
				ajax_showPop('./mkportal/modules/panel/actions.php?mode=errortx&popuptext='+encodeURIComponent(err_msg), 1);
	            if(result){document.getElementById(my_span).innerHTML = result;}
				ajax_go=0;
				if(ajax_span){
				document.getElementById(ajax_span).innerHTML='';
				}
				return;
				}
            if(result.lastIndexOf("infor:")==0){
            	err_msg=result.substr(6, result.indexOf("<br />"));
            	result=result.substr(result.indexOf("<br />")+6);
            	document.getElementById("srv_error_status").innerHTML='<img src="/mkportal/modules/panel/images/noloader.gif" alt="" border="0" /><font color="#00FFFF"><b>Инфо:</b></font> ' + err_msg;
	            if(result){document.getElementById(my_span).innerHTML = result;}
				ajax_go=0;
				if(ajax_span){
				document.getElementById(ajax_span).innerHTML='';
				}
				return;
				}
            if(result.lastIndexOf("cicle:")==0){
            	err_msg=result.substr(6, result.indexOf("<br />"));
            	result=result.substr(result.indexOf("<br />")+6);
            	document.getElementById("srv_error_status").innerHTML='<img src="/mkportal/modules/panel/images/noloader.gif" alt="" border="0" />' + err_msg;
	            if(result){document.getElementById(my_span).innerHTML=result;}
				ajax_go=0;
				return;
				}
			document.getElementById("srv_error_status").innerHTML='<img src="/mkportal/modules/panel/images/noloader.gif" alt="" border="0" />';
            if(result){document.getElementById(my_span).innerHTML = result;}
			ajax_go=0;
         	} else {
            alert("Ошибка запроса");
			ajax_go=0;
         }
if(ajax_span && document.getElementById(ajax_span)){
document.getElementById(ajax_span).innerHTML='';
}
     }
   }



			function makesuretop() {
			if (confirm("Вы уверены?")) {
			return true;
			}
			return false;
			}

function srv_configs(ajax_span) {
   			if(ajax_go!=0){return;}
		new makeSERVRequest("index.php?ind=panel&op=control&mode=srv_configs", "", "serv_main", ajax_span);
   }
   function refresh_srv(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Обновление";
		new makeSERVRequest("index.php?ind=panel&op=control&mode=refresh_srv", "", "serv_main", ajax_span);
   }
   function my_servers(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=control&mode=servers", "", "serv_main", ajax_span);
   }
   function srv_restart(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Легкий рестарт...";
		new makeSERVRequest("index.php?ind=panel&op=control&mode=srv_restart", "", "serv_main", ajax_span);
   }
   function srv_reinstal(ajax_span) {
   			if(ajax_go!=0){return;}
		new makeSERVRequest("index.php?ind=panel&op=control&mode=srv_reinstal", "", "serv_main", ajax_span);
   }
   function srv_reinstal_new(ajax_span, ide){
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Инициализация установки...";
		new makeSERVRequest("index.php?ind=panel&op=control&mode=reinstal_test", "", "serv_main", ajax_span);
		intInterval=setInterval('reinstal_status("' + ide + '")', 2000);
   }
   function srv_reinstal_fast_full(ajax_span, ide){
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сервер будет переустановлен в течении 5 минут...";
		new makeSERVRequest("index.php?ind=panel&op=control&mode=reinstal_fast_full", "", "serv_main", ajax_span);
		intInterval=setInterval('reinstal_status("' + ide + '")', 2000);
   }
var intInterval=0;
   function reinstal_status(ide) {
   		if(ajax_go!=0){return;}
        if(document.getElementById("percent_instal")){
            if(document.getElementById("percent_instal").value>=100)
            {
				intInterval=clearInterval(intInterval);
            }
   		}
		makeSERVRequest("index.php?ind=panel&op=control&mode=reinstal_status&s_id=" + ide, "", "load_map_image", "");
   }
	function srv_rcon(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
   		document.onkeydown = checkKeys;
		new makeSERVRequest("index.php?ind=panel&op=control&mode=srv_rcon", "", "serv_main", ajax_span);
   }

   function srv_start_stop(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=control&mode=srv_start_stop", "", "serv_main", ajax_span);
   }
   function start_log(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сервер запущен, подождите сколько нужно, и остановите сервер на соседней вкладке. После этого на этой странице появится лог сервера...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=start_log", "", "serv_main", ajax_span);
   }
   function srv_update(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Запущено обновление сервера, <font color=\"red\">не закрывайте страницу</font>, если хотите что бы обновление прошло успешно.<br /><br />После окончания процесса вы увидите лог обновления, если есть строчки \"<b>please retry the command</b>\" повторите операцию ещё раз...<br />Если же написано \"<b>HLDS installation up to date</b>\" то обновление произведено успешно.<br /><br />Обычно обновление занимает 10-15 минут.";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=update", "", "serv_main", ajax_span);
   }
   function ts_site(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=site", "", "serv_main", ajax_span);
   }
   function send_ts() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=submit_ts", "ts_name="+encodeURI(document.getElementById("ts_name").value)+"&ts_password="+encodeURI(document.getElementById("ts_password").value), "serv_main", "ajax_ts_site");
   }
   function send_site() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=submit_site", "site_name="+encodeURI(document.getElementById("site_name").value)+"&domen="+encodeURI(document.getElementById("domen").value)+"&site="+encodeURI(document.getElementById("site").value), "serv_main", "ajax_ts_site");
   }
	function send_rcon(ajax_span){
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Ожидание ответа...";
		new makeSERVRequest("index.php?ind=panel&op=control&mode=srv_rcon&submod=action", "COMMAND="+encodeURI(document.getElementById("COMMAND").value), "rcon_query", ajax_span);
		}
// Помощь
   function help_form(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=control&mode=help_form", "", "serv_main", ajax_span);
   }
   function view_ticket(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружаю сообщение...";
		new makeSERVRequest("index.php?ind=panel&op=control&mode=view_ticket&bmod="+ide, "", "razdel_"+ide, "ajax_razdel_"+ide);
   }
   function cancel_ticket(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=control&mode=close_ticket&bmod="+ide, "", "serv_main", "ajax_razdel_"+ide);
   }
   function ticket_answer(ide) {
   			if(ajax_go!=0){return;}
   			var answval = document.getElementById("admin_text").value;
			if(!answval){return;}
			var poststr = "admin_text=" + encodeURI( answval );
			new makeSERVRequest("index.php?ind=panel&op=control&mode=ticket_answer&bmod="+ide, poststr, "serv_main", "ajax_razdel_"+ide);
	}
   function mes_submit() {
		document.getElementById("message_ajax").innerHTML="<img src=\"/mkportal/modules/panel/images/ajax_load_black.gif\" alt=\"Процесс\" border=\"0\"/>";
        document.getElementById("err_prichina").innerHTML="";
        document.getElementById("err_text").innerHTML="";
        var prichinaid = document.getElementById("prichina").value;
        var textid = document.getElementById("text").value;
		var err = 0;
        if(!prichinaid)
        {
        	document.getElementById("err_prichina").innerHTML="<font color=\"red\"><i>Введите тему сообщения</i></font>";
			document.getElementById("message_ajax").innerHTML="<br />";
        	err = 1;
        }
        if(!textid)
        {
        	document.getElementById("err_text").innerHTML="<font color=\"red\"><i>Введите текст сообщения</i></font>";
			document.getElementById("message_ajax").innerHTML="<br />";
        	err = 1;
        }
		if(err==1){return;}
		var poststr = "razdel=" + encodeURI( document.getElementById("razdel").value ) +
		"&prichina=" + encodeURI( prichinaid ) +
		"&text=" + encodeURI( textid );
        makeSERVRequest("index.php?ind=panel&op=control&mode=message_send", poststr, "serv_main", "message_ajax");
   }


// DEMO записи
   function view_demos(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=demos", "", "serv_main", ajax_span);
   }
   function del_demo(ide, demodir, ajax_span) {
   			if(ajax_go!=0){return;}
   			if(!makesuretop()){return;}
		document.getElementById("srv_error_status").innerHTML="Удаление...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=demos&bmod=delete&demodir="+demodir+"&ide="+ide, "", "demo_file_"+ide, ajax_span);
   }
   function create_demo(ide, demodir, ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Скачиваю и архивирую...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=demos&bmod=create&demodir="+demodir+"&ide="+ide, "", "demo_zip_"+ide, ajax_span);
   }
// Pank Buster screens
   function view_pbscr(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Считываю список скринов с сервера...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=pbscr", "", "serv_main", ajax_span);
   }
   function del_pbscr(ide, ajax_span) {
   			if(ajax_go!=0){return;}
   			if(!makesuretop()){return;}
		document.getElementById("srv_error_status").innerHTML="Удаление...";
		document.getElementById("screen_"+ide).innerHTML="";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=pbscr&bmod=delete&ide="+ide, "", "scr_file_"+ide, ajax_span);
   }
   function del_all_pbscr(ide, ajax_span) {
   			if(ajax_go!=0){return;}
   			if(!makesuretop()){return;}
		document.getElementById("srv_error_status").innerHTML="Удаление всех скриншотов с сервера...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=pbscr&bmod=deleteall", "", "serv_main", ajax_span);
   }
   function view_screen(ide, ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Просмотр...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=pbscr&bmod=view&ide="+ide, "", "screen_"+ide, ajax_span);
   }


// Для модов и их установки удаления настройки
   function the_mod(ide, ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=mods&bmod="+ide, "", "serv_main", ajax_span);
   }
  function edit_config(ide){
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружается страница настроек...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=view_config&bmod="+ide, "", "mod_config", "ajax_config_"+ide);
   }
   function save_config(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю настройки...";
		ide1=0;
		var post_data="the_data=1";
		while(document.getElementById("id_"+ide1))
			{
				post_data=post_data+"&id_"+ide1+"="+encodeURI(document.getElementById("id_"+ide1).value);
				post_data=post_data+"&type_"+ide1+"="+encodeURI(document.getElementById("type_"+ide1).value);
				post_data=post_data+"&value_"+ide1+"="+encodeURI(document.getElementById("value_"+ide1).value);
				ide1=ide1+1;
			}
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=save_config&bmod="+ide, post_data, "mod_config_"+ide, "ajax_config1_"+ide);
   }
   function save_config2(ide) {
   			if(ajax_go!=0){return;}
			document.getElementById("srv_error_status").innerHTML="Сохраняю настройки...";
			post_data="&config="+encodeURIComponent(document.getElementById("config").value);
			new makeSERVRequest("index.php?ind=panel&op=configs&mode=save_config&bmod="+ide, post_data, "mod_config_"+ide, "ajax_config1_"+ide);
   }
   function uninstal_mod(ide, ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Удаляю модификацию...";
		new makeSERVRequest("index.php?ind=panel&op=mods&mode=uninstal&bmod="+ide, "", "serv_main", ajax_span);
   }
   function instal_mod(ide, ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Устанавливаю модификацию...";
		new makeSERVRequest("index.php?ind=panel&op=mods&mode=instal&bmod="+ide, "", "serv_main", ajax_span);
   }


// Управление картами
   function maps_page(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подожите...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=maps", "", "serv_main", ajax_span);
   }
   function map_onchange() {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загрузка информации о карте...";
		var map_name="map_name="+encodeURI(document.getElementById("map_name").value) +
		"&maps_list="+encodeURI(document.getElementById("maps_list").value);
		new makeSERVRequest("index.php?ind=panel&op=add&mode=map_view", map_name, "about_map", "ajax_map");
   }
   function view_map(map_name) {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загрузка информации о карте...";
		var map_name="map_name=" + map_name +
		"&maps_list="+encodeURI(document.getElementById("maps_list").value);
		new makeSERVRequest("index.php?ind=panel&op=add&mode=map_view", map_name, "about_map", "ajax_map");
   }
   function delete_map(map_name) {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Удаляю карту...";
		if (document.getElementById("map_key")){
			document.getElementById("map_key").innerHTML="Не установлена. <a href=\"javascript://\" onclick=\"instal_map('" + map_name + "')\" title=\"Установить\"><b><font color=\"red\">[Установить]</font></b></a>";
        }
		var map_name="map_name=" + map_name;
		new makeSERVRequest("index.php?ind=panel&op=add&mode=maps&bmod=delete_map", map_name, "maps_instaled", "ajax_map");
   }
   function instal_map(map_name) {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Устанавливаю карту...";
		if (document.getElementById("map_key")){
			document.getElementById("map_key").innerHTML="Установлена. <a href=\"javascript://\" onclick=\"delete_map('" + map_name + "')\" title=\"Удалить\"><b><font color=\"red\">[Удалить]</font></b></a>";
        }
		var map_name="map_name=" + map_name;
		new makeSERVRequest("index.php?ind=panel&op=add&mode=maps&bmod=instal_map", map_name, "maps_instaled", "ajax_map");
   }
   function upload_map_img() {
		document.getElementById('res').innerHTML='';
		document.getElementById('loading_process').style.display='block';
		return true;
   }
   function edit_map_description(map_name) {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		var map_name="map_name=" + map_name;
		new makeSERVRequest("index.php?ind=panel&op=add&mode=edit_map_description", map_name, "edit_map_description", "ajax_map");
   }
   function submit_map_description(map_name) {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю описание карты...";
		var map_name="map_name=" + map_name +
		"&map_description="+encodeURI(document.getElementById("map_description").value);
		new makeSERVRequest("index.php?ind=panel&op=add&mode=submit_map_description", map_name, "edit_map_description", "ajax_map");
   }
   function maps_submit() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю настройки карт...";
		ide1=0;
		var post_data="maps_list="+encodeURI(document.getElementById("maps_list").value);
		while(document.getElementById("map_name_"+ide1))
			{
				post_data=post_data+"&map_name_"+ide1+"="+encodeURI(document.getElementById("map_name_"+ide1).value);
				post_data=post_data+"&mapcycle_"+ide1+"="+encodeURI(document.getElementById("mapcycle_"+ide1).checked);
				post_data=post_data+"&votemaplist_"+ide1+"="+encodeURI(document.getElementById("votemaplist_"+ide1).checked);
				ide1=ide1+1;
			}
		new makeSERVRequest("index.php?ind=panel&op=add&mode=maps&bmod=maps_submit", post_data, "maps_instaled", "ajax_map");
   }



// Управление админами.... admins.cfg и clients.txt
   function admins_cfg(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружается редактор администраторов...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admins", "", "mod_config", "ajax_config_"+ide);
   }
   function admins_reread() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Обновляю файл с сервера...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admins&emode=reread", "", "mod_config", "ajax_clients_config");
   }
   function admins_new() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Создаю новый файл...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admins&emode=new", "", "mod_config", "ajax_clients_config");
   }
   function admins_save() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю на сервер...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admins&emode=save", "", "mod_config", "ajax_clients_config");
   }
   function admins_new_admin() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Добавляю клиента...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admins&emode=new_admin", "", "mod_config", "ajax_clients_config");
   }
   function admins_del_client(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Удаляю клиента...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admins&emode=del_client&key="+ide, "", "mod_config", "ajax_clients_config");
   }
   function admins_edit_client(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admins&emode=edit_client&key="+ide, "", "mod_config", "ajax_clients_config");
   }
   function admins_view() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admins", "", "mod_config", "ajax_clients_config");
   }
	var ide1=0;
   function admins_submit(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю данные клиента...";
		ide1=0;
		var post_data="nick="+encodeURI(document.getElementById("nick").value) +
		"&auth="+encodeURI(document.getElementById("auth").value) +
		"&immunity="+encodeURI(document.getElementById("immunity").value) +
		"&group="+encodeURI(document.getElementById("group").value) +
		"&identity="+encodeURI(document.getElementById("identity").value);
		while(document.getElementById("comm_"+ide1))
			{
				post_data=post_data+"&comm_"+ide1+"="+encodeURI(document.getElementById("comm_"+ide1).value);
				post_data=post_data+"&value_"+ide1+"="+encodeURI(document.getElementById("value_"+ide1).checked);
				ide1=ide1+1;
			}
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admins&emode=submit_client&key="+ide, post_data, "mod_config", "ajax_clients_config");
   }


// Ace_match
   function ace_match(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружаются настройки CW мода ace_match...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=ace_match", "", "mod_config", "ajax_config_"+ide);
   }
   function ace_match_change() {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Меняю данные мода...";
		var postdata="ace_match_cmd=" + encodeURI(document.getElementById("ace_match_cmd").value) +
		"&ace_match_pwd="+encodeURI(document.getElementById("ace_match_pwd").value);
		new makeSERVRequest("index.php?ind=panel&op=add&mode=ace_match&bmod=save", postdata, "save_ace_match", "ajax1_ace_match");
   }
   function save_ftp_data() {
   		if(ajax_go!=0){return;}
		var postdata="ftp_access=" + encodeURI(document.getElementById("ftp_access").value) +
		"&ftp_host="+encodeURI(document.getElementById("ftp_host").value)+
		"&ftp_login="+encodeURI(document.getElementById("ftp_login").value)+
		"&ftp_pass="+encodeURI(document.getElementById("ftp_pass").value);
		new makeSERVRequest("index.php?ind=panel&op=add&mode=demos&bmod=save_ftp", postdata, "save_ftp_data", "save_ftp_ajax");
   }


// Режим игры COD4
   function cod4_map_mode(ajax_span) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружается...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=cod4_map_mode", "", "serv_main", ajax_span);
   }
   function cod4_map_mode_change(ajax_span, postdata) {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Меняю режим игры...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=cod4_map_mode&bmod=save", "regim="+postdata, "serv_main", ajax_span);
   }
// Ротация карт COD4
   function cod4_map_rotate(ajax_span){
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружается редактор списка карт... Обновление списка карт...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=cod4_map_rotate&bmod=reread", "", "serv_main", ajax_span);
   }
   function cod4_map_rotate_change(postdata, changed) {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		ide1=0;
		postdata="map="+postdata;
		while(document.getElementById("regim_"+ide1))
			{
				postdata=postdata+"&regim_"+ide1+"="+encodeURI(document.getElementById("regim_"+ide1).value);
				ide1=ide1+1;
			}
		new makeSERVRequest("index.php?ind=panel&op=add&mode=cod4_map_rotate&bmod=change&chmod="+changed, postdata, "serv_main", "ajax_cod4_map_rotate");
   }

// Обновление PunkBuster
   function cod4_pb_update(ide){
		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите, обновляю Punk Buser... Не закрывайте эту страницу...";
		new makeSERVRequest("index.php?ind=panel&op=add&mode=cod4_pb_update", "", "mod_config", "ajax_config_" + ide);
   }



   function admins_simple(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружается редактор администраторов...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admins_simple&bmod="+ide, "", "mod_config", "ajax_config_"+ide);
   }

   function clients(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружается редактор администраторов...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=clients", "", "mod_config", "ajax_config_"+ide);
   }
   function clients_reread() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Обновляю файл с сервера...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=clients&bmod=reread", "", "mod_config", "ajax_clients_config");
   }
   function clients_new() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Создаю новый файл...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=clients&emode=new", "", "mod_config", "ajax_clients_config");
   }
   function clients_save() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю на сервер...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=clients&bmod=save", "", "mod_config", "ajax_clients_config");
   }
   function clients_new_admin() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Добавляю клиента...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=clients&emode=new_admin", "", "mod_config", "ajax_clients_config");
   }
   function clients_del_client(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Удаляю клиента...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=clients&emode=del_client&key="+ide, "", "mod_config", "ajax_clients_config");
   }
   function clients_edit_client(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=clients&emode=edit_client&key="+ide, "", "mod_config", "ajax_clients_config");
   }
   function clients_view() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=clients", "", "mod_config", "ajax_clients_config");
   }
	var ide1=0;
   function clients_submit(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю данные клиента...";
		ide1=0;
		var post_data="nick="+encodeURI(document.getElementById("nick").value) + "&steam="+encodeURI(document.getElementById("steam").value);
		while(document.getElementById("comm_"+ide1))
			{
				post_data=post_data+"&comm_"+ide1+"="+encodeURI(document.getElementById("comm_"+ide1).value);
				post_data=post_data+"&value_"+ide1+"="+encodeURI(document.getElementById("value_"+ide1).checked);
				ide1=ide1+1;
			}
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=clients&emode=submit_client&key="+ide, post_data, "mod_config", "ajax_clients_config");
   }
//admin_cod4

   function admin_cod4(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружается редактор админов...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admin_cod4", "", "mod_config", "ajax_config_"+ide);
   }
   function admin_cod4_submit(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю данные группы...";
		ide1=0;
		var post_data="guid="+encodeURI(document.getElementById("guid").value) +
		"&immunity="+encodeURI(document.getElementById("immunity").value)+
		"&group="+encodeURI(document.getElementById("group").value)+
		"&names="+encodeURI(document.getElementById("names").value);
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admin_cod4&emode=submit_client&key="+ide, post_data, "mod_config", "ajax_config_0");
   }
//admins_group

   function admin_groups(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружается редактор групп...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admin_groups", "", "mod_config", "ajax_config_"+ide);
   }
   function adminsg_reread() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Обновляю файл с сервера...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admin_groups&emode=reread", "", "mod_config", "ajax_clients_config");
   }
   function adminsg_new() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Создаю новый файл...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admin_groups&emode=new", "", "mod_config", "ajax_clients_config");
   }
   function adminsg_save() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю на сервер...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admin_groups&emode=save", "", "mod_config", "ajax_clients_config");
   }
   function adminsg_new_admin() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Добавляю группу...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admin_groups&emode=new_admin", "", "mod_config", "ajax_clients_config");
   }
   function adminsg_del_client(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Удаляю группу...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admin_groups&emode=del_client&key="+ide, "", "mod_config", "ajax_clients_config");
   }
   function adminsg_edit_client(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admin_groups&emode=edit_client&key="+ide, "", "mod_config", "ajax_clients_config");
   }
   function adminsg_view() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Подождите...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admin_groups", "", "mod_config", "ajax_clients_config");
   }
	var ide1=0;
   function adminsg_submit(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю данные группы...";
		ide1=0;
		var post_data="nick="+encodeURI(document.getElementById("nick").value) +
		"&immunity="+encodeURI(document.getElementById("immunity").value);
		while(document.getElementById("comm_"+ide1))
			{
				post_data=post_data+"&comm_"+ide1+"="+encodeURI(document.getElementById("comm_"+ide1).value);
				post_data=post_data+"&value_"+ide1+"="+encodeURI(document.getElementById("value_"+ide1).checked);
				ide1=ide1+1;
			}
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=admin_groups&emode=submit_client&key="+ide, post_data, "mod_config", "ajax_clients_config");
   }
// Менеджер скинов sourcemod
   function skins_manager(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружается менеджер скинов...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=skins_manager", "", "mod_config", "ajax_config_"+ide);
   }
   function view_skin(skin) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загрузка информации о скине...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=skins_manager&bmod=view_skin&skin="+skin, "", "skin_sp", "ajax_skin");
   }
   function instal_skin(skin) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Установка скина...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=skins_manager&bmod=instal_skin&skin="+skin, "", "skin_sp", "ajax_skin");
   }
   function delete_skin(skin) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Удаление скина...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=skins_manager&bmod=delete_skin&skin="+skin, "", "skin_sp", "ajax_skin");
   }
   function save_skin_settings() {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю данные на сервер...";
		ide1=0;
		var post_data="";
		while(document.getElementById("groupskin_"+ide1))
			{
				post_data=post_data+"&groupskin_"+ide1+"="+encodeURI(document.getElementById("groupskin_"+ide1).checked);
				ide1=ide1+1;
			}
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=skins_manager&bmod=save_skin_settings", post_data, "skin_sp", "ajax_save_skin");
   }

// Менеджер скинов mani
   function mani_skins_manager(ide) {
   			if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружается менеджер скинов...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=mani_skins_manager", "", "mod_config", "ajax_config_"+ide);
   }
   function mani_view_skin(skin) {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загрузка информации о скине...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=mani_skins_manager&bmod=view_skin&skin="+skin, "", "skin_sp", "ajax_skin");
   }
   function mani_instal_skin(skin) {
   		if(ajax_go!=0){return;}
		post_data=document.getElementById("team").value;
		document.getElementById("srv_error_status").innerHTML="Установка скина...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=mani_skins_manager&bmod=instal_skin&skin="+skin+"&team="+post_data, "", "skin_sp", "ajax_skin");
   }
   function mani_delete_skin(skin) {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Удаление скина...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=mani_skins_manager&bmod=delete_skin&skin="+skin, "", "skin_sp", "ajax_skin");
   }
// Менеджер звуков mani
   function mani_sounds(ide) {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Загружается менеджер звуков Mani_admin_plugin...";
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=mani_sounds", "", "mod_config", "ajax_config_"+ide);
   }
   function delmusfile() {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Удаляю музыкальный файл с сервера...";
		post_data="&delfile="+encodeURIComponent(document.getElementById("delfile").value);
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=mani_sounds&bmod=delfile", post_data, "mod_config", "ajax_mani_d");
   }
   function submit_manisounds() {
   		if(ajax_go!=0){return;}
		document.getElementById("srv_error_status").innerHTML="Сохраняю настройки...";
		ide1=0;
		var post_data="";
		while(document.getElementById("msound_"+ide1))
			{
				post_data=post_data+"&msound_"+ide1+"="+encodeURI(document.getElementById("msound_"+ide1).value);
				ide1=ide1+1;
			}
		new makeSERVRequest("index.php?ind=panel&op=configs&mode=mani_sounds&bmod=submit_manisounds", post_data, "mod_config", "ajax_mani_s");
   }


// Для RCON управления...

    function iPostData(a, b, c, d)
{
        var http_request = false;
        if ((a==null) || (a.length < 1))
            {return;}
        var request = "a="+escape(a);
        if ((b!=null) && (b.length > 0)) {request += "&b="+escape(b);
			if ((c!=null) && (c.length > 0)) {request += "&c="+escape(c);
				if ((d!=null) && (d.length > 0)) {request += "&d="+escape(d);
				}}}

		if (a!="plist")
		    {
			var elem = document.getElementById("res");
			if (elem != null)
				elem.innerHTML = "";
			}

        waiting_for_data++;

        WorkingIndicator();

		// AJAX
        if (window.XMLHttpRequest) {
            http_request = new XMLHttpRequest();
        } else if (window.ActiveXObject) {
            try {
              http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (eror) {
              http_request = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }

        http_request.onreadystatechange = function() { iIncomingData(http_request); };
        http_request.open("POST", "index.php?ind=panel&op=control&mode=srv_rcon&submod=action", true);
        http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        http_request.send(request);
   }
function serverstatus()
		{
   			if(ajax_go!=0){return;}
		document.getElementById("COMMAND").value = "status";
		send_rcon("ajax_srv_rcon");
		}
function maplist()
		{
   			if(ajax_go!=0){return;}
		document.getElementById("COMMAND").value = "maps *";
		send_rcon("ajax_srv_rcon");
		}
function changemap()
		{
   			if(ajax_go!=0){return;}
		document.getElementById("COMMAND").value = ("map " + document.getElementById("MAPNAME").value);
		send_rcon("ajax_srv_rcon");
		}
function restart()
		{
   			if(ajax_go!=0){return;}
		document.getElementById("COMMAND").value = "restart";
		send_rcon("ajax_srv_rcon");
                }
function kickid()
		{
   			if(ajax_go!=0){return;}
		document.getElementById("COMMAND").value = ("kickid " + document.getElementById("KICKID").value + " " + "\"" + document.getElementById("KICKREASON").value + "\"");
		send_rcon("ajax_srv_rcon");
                }
function say()
		{
   			if(ajax_go!=0){return;}
		document.getElementById("COMMAND").value = ("say " + "\"" + document.getElementById("SAY").value + "\"");
		send_rcon("ajax_srv_rcon");
		}
function search()
		{
   			if(ajax_go!=0){return;}
		document.getElementById("COMMAND").value = ("cvarlist " + document.getElementById("SEARCH").value);
		send_rcon("ajax_srv_rcon");
		}

// RCON управление COD4

function iIncomingData(http_request)
	{
	if (http_request.readyState == 4) {
	    waiting_for_data--;
     	if (http_request.responseText.substring(0,1) == "~")
     	    {
			target = "plist";
			var res = http_request.responseText.substring(1);
			} else {
			target = "res";
			var res = http_request.responseText;
			}
		var elem = document.getElementById(target);
		WorkingIndicator();
		if (elem != null)
			{
			if (http_request.status == 200)
				{
				elem.innerHTML = res;
				} else
				{
                elem.innerHTML = "<h2>HTTP error "+http_request.status+": "+http_request.statusText+"</h2><br>";
				}
			}
		}
	}

function removec(s, t)
	{
	i = s.indexOf(t);
	r = "";
	if (i == -1) return s;
	r += s.substring(0,i) + removec(s.substring(i + t.length), t);
	return r;
	}

var selected_obj;
var waiting_for_data=0;

/// timed reload
var defrefreshinterval=30;  // Пауза между перезагрузками
var refreshinterval = defrefreshinterval;
var displaycountdown="yes";
var starttime=new Date();;
var nowtime;
var reloadseconds=0;
var secondssinceloaded=0;
var stopping=1;

function start_counter()
{
	starttime=new Date();
	starttime=starttime.getTime();
	countdown();
}

function start_stoptime()
{
	if (stopping != 1)
	    {stopping = 1;}
		else
	        {
			stopping = 0;
            refreshinterval = reloadseconds;
			start_counter();
			}
}

function countdown()
{
	if (stopping == 1) return;
	nowtime= new Date();
	nowtime=nowtime.getTime();
	secondssinceloaded=(nowtime-starttime)/1000;
	reloadseconds=Math.round(refreshinterval-secondssinceloaded);
	if (refreshinterval>=secondssinceloaded) {
		var timer=setTimeout("countdown()", 1000);
		if (displaycountdown=="yes") {
			var elem = document.getElementById("refreshinfo");
			if (elem != null)
				{elem.innerHTML = reloadseconds+" s";}
			}
		}
	else {
	    RefreshNow();
		}
}

function SwitchDiv(theDiv)
	{
	elem = document.getElementById(theDiv);
	if (elem.style.display == "")
	    {elem.style.display = "none";} else
		{elem.style.display = "";}
}

function HandleEnter()
	{
	elem = document.getElementById(selected_obj);
	if (elem != null)
		{elem.click();}
	return false;
	}

function WorkingIndicator(what)
{
    var elem = document.getElementById("working");
	if (elem != null)
		{
		if (waiting_for_data > 0) {elem.innerHTML = "<img src=\"/mkportal/modules/panel/images/ajax_load_black.gif\" alt=\"Процесс\" border=\"0\"/>";}
			else {elem.innerHTML = "";}
		}
}

function Startup()
	{
	RefreshNow();
	}

function RefreshNow()
	{
	iPostData("plist","status","1");
	refreshinterval = defrefreshinterval;
	start_counter();
	}

function Mail(n)
	{
	start_stoptime();
	text = prompt("Пожалуйста введите сообщение для "+n,"");
	if (text)
		{
		text = removec(text,"\"");
		var elem = document.getElementById("cmdbox");
		if (n == "all")
			{elem.value = "say \"^6ADMIN (All): ^7"+text+"\"";} else
			{elem.value = "tell "+n+" \"^6ADMIN (Priv.): ^7"+text+"\"";}
		SubmitCustomCmd();
		}
    start_stoptime();
	}

function CustomCmd(n)
	{
	var elem = document.getElementById("cmdbox");
	elem.value = n;
	EditedCmdBox = false;
	SubmitCustomCmd();
	}

function SubmitCustomCmd()
	{
	if (window.event != null)
		{var evtobj = window.event;}
		else if (window.e != null)
		{var evtobj = window.e;}
	if ((evtobj == null) || (! evtobj.shiftKey))
		{
		var elem = document.getElementById("cmdbox");
		if (document.cmd_form.colors.checked) {col = "1";} else {col = "0";}

		iPostData("cmd", elem.value, col);
		return false;
	    }
	}

function SubmitChangeMapOrGametype(what)
	{
	if (what == 0)
	    {
        CustomCmd("g_gametype");
		} else if (what == 1)
		{
		var s = document.misc.gtype.value;
		if (s != "")
		    {CustomCmd("g_gametype "+s);}
		} else if (what == 2)
		{
		var s = document.misc.map.value;
		if ((s != "") && (s != "restart"))
		    {CustomCmd("map "+s);}
		       else {CustomCmd("map_restart");}
		}
	}

function SubmitChangeWeapon(weap, what)
	{
	if (what == -1)
	    {
        CustomCmd(weap);
		} else if ((what == 0) || (what == 1))
		{
		CustomCmd(weap+" "+what);
		}
	}

function SubmitChangePass()
	{
    var s = document.misc.pass.value;
    iPostData("pass", s, 1)
	}

function MapImgShow(what)
{
    var elem = document.getElementById("mapimg");
	if (elem != null)
		{
		if (what != "") {elem.innerHTML = "<img src=\"stats/images/maps/cod4/"+what+".png\" style=\"border: 2px ridge;\">";}
			else {elem.innerHTML = "";}
		}
}

var EditedCmdBox = false;

function checkKeyPressed(evt, sc, func, params)
{
  var elem = document.getElementById("cmdbox");
  if ((evt) && (EditedCmdBox == false))
  {
    var charCode = (evt.charCode) ? evt.charCode :
                   ((evt.keyCode) ? evt.keyCode :
                   ((evt.which) ? evt.which : 0));
    if (charCode == sc) func(params);
	// document.write(charCode); // use for debug
  }
}

function checkKeys(evt)
{
  if (! evt)
  	{var evt = window.event;}
checkKeyPressed(evt, 82, RefreshNow, null);
}

// О хостинге
function about_hosting(game){
   	if(ajax_go!=0){return;}
	document.getElementById("srv_error_status").innerHTML="<img src=\"/mkportal/modules/panel/images/loadinfo_1e.gif\" alt=\"Процесс\" border=\"0\"/> Идет загрузка...";
	makeSERVRequest("index.php?ind=about&op=game&game_type=" + game, "", "serv_main", "");
	}

function about_servers(game){
   	if(ajax_go!=0){return;}
	document.getElementById("srv_error_status").innerHTML="<img src=\"/mkportal/modules/panel/images/loadinfo_1e.gif\" alt=\"Процесс\" border=\"0\"/> Загрузка списка серверов...";
	document.getElementById("servers_loading").innerHTML="<img src=\"/mkportal/modules/panel/images/loadinfo_1e.gif\" alt=\"Процесс\" border=\"0\"/>&nbsp;";
	makeSERVRequest("index.php?ind=about&op=servers_online&view_all=1&game_type=" + game, "", "servers_online", "");
	}