$(document).ready(function() {
  i = document.getElementById("islemap_chat_name").value;
  if (i=="") i = "Ãîñòü";
  document.getElementById("islemap_chat_text").value = "Ñîîáùåíèå";
  //setInterval("reloaddatachat();",5000);

  //Ïîäñâåòêà òåãîâ
  $(".cloudtags a").hover(function() {
	f_color = this.style.color; f_back = this.style.background;
	$(this).animate({background:"#00b9e9",color:"blue"},900);
  },function() {$(this).animate({background:"transparent url(images/empty.png)",color:"#844e44"},200);});

  //Tabs for all.
  $('dl.sidebartabs dt').click(function(){
	$(this).siblings().removeClass('selected').end().next('dd').andSelf().addClass('selected');
  });
});

/*
document.onclick = function(e) {
  b1 = document.getElementById("smiles_more_div");
  b2 = document.getElementById("islemap_chat_dle_bb");
  b = document.getElementById("islemap_chat_dle_emo2");
  i = e.target.id;
  if (i!=b.id) {
	j1 = b.style;
	if (j1.display=="block") {j1.zIndex = 0; j1.visibility = "hidden"; j1.display = "none";}
  }
  //if (i=="" || (i!=b.id && b.style.display=="block")) b.style.display = "none";
}
*/
function islemap_chat_scroll_up() {
  lis = document.getElementById("islemap_chat_area").getElementsByTagName("li");
  if (lis && lis.length) lis[0].scrollIntoView();
}
function islemap_chat_hide_msg() {
  i = document.getElementById("islemap_chat_userGroup_hide_msg");
  j = document.getElementById("islemap_chat_userGroup_hide_msg_input");
  if (j.checked) {
	i.className = "islemap_chat_userGroup_hide_msg1";
	j.checked = false;
  } else {
	i.className = "islemap_chat_userGroup_hide_msg2";
	j.checked = true;
  }
}
function islemap_chat_previe_show() {
  i = document.getElementById("islemap_chat_text");
  j = document.getElementById("islemap_chat_previe_show").style;
  if ((i.value!="" || i.value!="Ñîîáùåíèå") && j.display=="block") {
	msg = i.value.replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s{2,}/g," ");
	//msg = msg.replace(/\s+\:\d\s+/gi," :wink: ");
	//msg = msg.replace(/\s+\:am\:\s+/gi," :diablo: ");
	//msg = msg.replace(/\s+\;\)\s+/gi," :fellow: ");
	//msg = msg.replace(/\s+\:\(\s+/gi," :sad: ");
	//msg = msg.replace(/\s+-_-\s+/gi," :zzz: ");

	msg = msg.replace(/\s+\>\:\/\s+/gi," :laughing: ");
	msg = msg.replace(/\s+\:\p\s+/gi," :tongue: ");
	msg = msg.replace(/\s+\:\)\s+/gi," :smile: ");
	msg = msg.replace(/:(hands_\w{2,}):/gi,'<img src="http://isle-poem.ru/engine/modules/islemap/images/smile_hands/$1.png" />');
	msg = msg.replace(/:((?!hands_)\w{2,}):/gi,'<img src="http://isle-poem.ru/engine/data/emoticons/$1.gif" />');
	msg = msg.replace(/\[img\](.*?)\[\/img\]/gi,'<br /><br /><center><img src="$1" /></center><br />');
	msg = msg.replace(/\[b\](.*?)\[\/b\]/gi,"<strong>$1</strong>");
	msg = msg.replace(/\[i\](.*?)\[\/i\]/gi,"<i>$1</i>");
	msg = msg.replace(/\[u\](.*?)\[\/u\]/gi,"<u>$1</u>");
	msg = msg.replace(/\[s\](.*?)\[\/s\]/gi,"<s>$1</s>");
	msg = msg.replace(/\[quote\](.*?)\[\/quote\]/gi,"<quote>$1</quote>");
	msg = msg.replace(/\[color=(#[\d\w]{6,6})\](.*?)\[\/color\]/gi,'<span style="color:$1;">$2</span>');
	msg = msg.replace(/\[url=(.*?)\](.*?)\[\/url\]/gi,'<a href="$1" target="_blank">$2</a>');
	msg = msg.replace(/\[leech=(.*?)\](.*?)\[\/leech\]/gi,'<a href="$1" target="_blank">$2</a>');
	document.getElementById("islemap_chat_previe_show").innerHTML = msg; //innerHTML,innerText
	//alert(msg);
  }
}
function islemap_chat_previe_onoff() {
  v = document.getElementById("islemap_chat_previe_show");
  j = document.getElementById("islemap_chat_previe_div");
  msg = document.getElementById("islemap_chat_text").value;
  v.value = msg; i = v.style;
  //if (v.value!="Ñîîáùåíèå" || v.value!="") m = v.value; else m = "";
  if (i.display=="block") {
	i.zIndex = 0; i.visibility = "hidden"; i.display = "none";
	j.className = "islemap_chat_previe_div_click1";
  } else {
	i.zIndex = 99; i.visibility = "visible"; i.display = "block";
	j.className = "islemap_chat_previe_div_click2";
	islemap_chat_previe_show();
  }
  islemap_chat_hide_buttons();
}
function islemap_chat_profile_info() {
  j = document.getElementById("islemap_chat_profile_info");
  i = document.getElementById("islemap_chat_user_profile").style;
  if (i.display=="block") {
	i.zIndex = 0; i.visibility = "hidden"; i.display = "none";
	j.className = "islemap_chat_profile_info1";
  } else {
	i.zIndex = 99; i.visibility = "visible"; i.display = "block";
	j.className = "islemap_chat_profile_info2";
  }
  islemap_chat_hide_buttons();
}
function limitText(limit) {
  i = document.getElementById("islemap_chat_text");
  j = document.getElementById("islemap_chat_count");
  msg = i.value.replace(/\s*\[img\].*?\[\/img\]\s*/g," ").replace(/\s*:\w{2,}:\s*/g," ");
  msg = msg.replace(/\s*\[\/?\w{1,10}(?:\=?\#?)?(?:[\w\d]{6})?(?:[\w\d\:\/]{5,})?\]\s*/g," ");
  msg = msg.replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s{2,}/g," ");
  l = limit - msg.length; j.value = l;
  if (l==0) {
	len = document.getElementById("islemap_chat_text").value.length;
	i.value = i.value.substring(0,len);
  }
  islemap_chat_hide_buttons();
  islemap_chat_previe_show();
}
function islemap_chat_ins_cp() {
  i = document.getElementById("islemap_chat_cp_div").style;
  if (i.display=="") {i.zIndex = 0; i.visibility = "hidden"; i.display = "none";}
  if (i.display=="block") {i.zIndex = 0; i.visibility = "hidden"; i.display = "none";}
  else if (i.display=="none") {i.zIndex = 99; i.visibility = "visible"; i.display = "block";}
}
function islemap_chat_hide_buttons() {
  i = new Array(
	"islemap_chat_cp_div",
	"islemap_chat_panel_bb",
	"islemap_chat_panel_emo2",
	"islemap_chat_panel_help",
	"islemap_chat_panel_links"
  );
  for (k=0;k< i.length;k++) {
	j = document.getElementById(i[k]).style;
	j.zIndex = 0; j.visibility = "hidden"; j.display = "none";
  }
}
function islemap_chat_msg_clear(o) {
  i = document.getElementById("islemap_chat_text");
  i.value = "Ñîîáùåíèå";
  document.getElementById("islemap_chat_count").value = o;
  islemap_chat_previe_show();
  islemap_chat_hide_buttons();
  i.focus();
}
function islemap_chat_ins_button(o) {
  if (o=="islemap_chat_code_div") o = "islemap_chat_panel_bb";
  else if (o=="islemap_chat_smiles_div") o = "islemap_chat_panel_emo2";
  else if (o=="islemap_chat_links_div") o = "islemap_chat_panel_links";
  else if (o=="islemap_chat_help_div") o = "islemap_chat_panel_help";
  else o = "";
  if (o!="") {
	i = new Array("islemap_chat_panel_bb","islemap_chat_panel_emo2",
	  "islemap_chat_panel_links","islemap_chat_cp_div","islemap_chat_panel_help");
	j = document.getElementById(o).style;
	if (j.display=="") {j.zIndex = 0; j.visibility = "hidden"; j.display = "none";}
	if (j.display=="block") {j.zIndex = 0; j.visibility = "hidden"; j.display = "none";}
	else if (j.display=="none") {j.zIndex = 99; j.visibility = "visible"; j.display = "block";}
	for (k=0;k< i.length;k++) {
	  if (o!=i[k]) {
		j = document.getElementById(i[k]).style;
		j.zIndex = 0; j.visibility = "hidden"; j.display = "none";
	  }
	}
	i = [];
  }
}
function islemap_chat_ins(o) {
  i = document.getElementById("islemap_chat_text");
  var v = document.getElementById("islemap_chat_text").value; l = o.length + 4; k = 0;
  if (o.charAt(0)==":") {o = " "+o+" "; k = 1;}
  else if (o=="quote" || o=="hide" || l==5) o = " ["+o+"][/"+o+"] ";
  else if (o=="url" || o=="leech") {o = " ["+o+"=http://]ññûëêà[/"+o+"] "; l = l + 7;}
  else if (o=="img" || l==9) o = " ["+o+"]http://[/"+o+"] ";
  else if (l==10) {o = " [color=#"+o+"][/color] "; l = 9;} else l = 0;
  if (l!=0 && l>4) {
	if (v=="Ñîîáùåíèå") v = o; else v = v + o;
	v = v.replace(/^\s+/,"").replace(/\s{2,}/g," ");
	document.getElementById("islemap_chat_text").value = v;
	if (k==1) l = v.length; else l = v.length - l; i.focus();
	if (document.getElementById("islemap_chat_text").setSelectionRange) 
	  document.getElementById("islemap_chat_text").setSelectionRange(l,l);
	else if (document.getElementById("islemap_chat_text").createTextRange) {
	  var range = document.getElementById("islemap_chat_text").createTextRange();
	  range.collapse(true);
	  range.moveEnd('character',l);
	  range.moveStart('character',l);
	  range.select();
	}
	if (l==10) islemap_chat_hide_buttons();
  }
  islemap_chat_previe_show();
}
function GoMessageChat(ip,o) {
  //engine/classes/js/js_edit.js
  function chatAlert(message,mytype) {
	if (mytype==null) mytype = "";
	style = ' style="vertical-align:top; margin:0px 3px 0px 0px;"';
	src = "http://isle-poem.ru/engine/modules/islemap/images/reload.gif";
	if (mytype=="wait") img = '<img src="'+src+'" alt="Loading..."'+style+' />';
	else img = ""; message = img + message; style = src = img = "";
	//var div = document.createElement("div"); div.id = "islemap_chat_alert";
	//document.getElementById("islemap_chat_alert2").parentNode.appendChild(div);
	//document.getElementById("islemap_chat_alert").innerHTML = message;
	//document.getElementById("islemap_chat_alert").style.visibility = "hidden";
	var timeOut = 3;
	jQuery("#islemap_chat_alert").text("");
	jQuery("#islemap_chat_alert").append(message).fadeIn("slow");
	jQuery("#islemap_chat_alert").css({"display":"block","visibility":"visible"});
	setTimeout(function() {
	  jQuery("#islemap_chat_alert").fadeOut("slow");
	  //jQuery("#islemap_chat_alert").css("display","none");
	},timeOut*1000);
	//document.getElementById("islemap_chat_alert").innerHTML = "";
  }
  chatAlert("Çàãðóçêà, ïîæàëóéñòà, æäèòå...","wait");

  function jstrim(str) {
	l = str.length;
	whitespace = "\n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000";
	for (i=0;i<l;i++) {
	  if (whitespace.indexOf(str.charAt(i))===-1) {str = str.substring(i); break;}
    }
	str = str.replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s{2,}/g," ");
	str = whitespace.indexOf(str.charAt(0))===-1?str:"";
	return str;
  }

  function htmlspecialchars(string,quote_style,charset,double_encode) {
	//http://phpjs.org/functions/htmlspecialchars:426
	var optTemp = 0, i = 0, noquotes = false;
	if (typeof quote_style==='undefined' || quote_style===null) quote_style = 2;
	string = string.toString();
	if (double_encode!==false) string = string.replace(/&/g,'&amp;');
	string = string.replace(/</g,'&lt;').replace(/>/g,'&gt;');
	var OPTS = {
	  'ENT_NOQUOTES': 0, 'ENT_HTML_QUOTE_SINGLE' : 1,
	  'ENT_HTML_QUOTE_DOUBLE' : 2,
	  'ENT_COMPAT': 2,
	  'ENT_QUOTES': 3,
	  'ENT_IGNORE' : 4
	};
	if (quote_style===0) noquotes = true;
	if (typeof quote_style !== 'number') {
	  //Allow for a single string or an array of string flags quote_style = [].concat(quote_style);
	  for (i=0;i< quote_style.length;i++) {
		//Resolve string input to bitwise e.g. 'PATHINFO_EXTENSION' becomes 4
		if (OPTS[quote_style[i]]===0) noquotes = true;
		else if (OPTS[quote_style[i]]) optTemp = optTemp | OPTS[quote_style[i]];
	  }
	  quote_style = optTemp;
	}
    if (quote_style & OPTS.ENT_HTML_QUOTE_SINGLE) string = string.replace(/'/g,'&#039;');
	if (!noquotes) string = string.replace(/"/g,'&quot;');
	return string;
  }

  alert = "";  stop = 0; ajax = new dle_ajax();
  f = document.getElementById("islemap_chat_form");
  user = ajax.encodeVAR(f.islemap_chat_name.value);
  text = ajax.encodeVAR(f.islemap_chat_text.value);
  email = ajax.encodeVAR(f.islemap_chat_email.value);
  hide = ajax.encodeVAR(f.islemap_chat_userGroup_hide_msg_input.checked);
  uid = ajax.encodeVAR(f.islemap_chat_name_id.value);
  if (hide=="false") hide = 0; else if (hide=="true") hide = 1; else hide = -1;
  ip = jstrim(ip); user = jstrim(user); text = jstrim(text); email = jstrim(email);
  //http://iana.org/domains/root/db/
  //http://ru.wikipedia.org/wiki/Äîìåí_âåðõíåãî_óðîâíÿ
  re = /^[a-z]+[\w\d-.]{0,99}@(?:(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2}\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2}))|(?:(?:[a-z]+[\w\d-]{0,99})(?:\.[a-z]+[\w\d-]{0,66})?\.(?:èñïûòàíèå|ñåêñ|ñìè|ðô|ðó|uucp|bitnet|fidonet|museum|travel|berlin|onion|csnet|aero|arpa|asia|bank|coop|info|mail|nato|root|jobs|kids|mobi|name|post|shop|biz|bzh|cat|com|cym|ddn|edu|gal|geo|gov|i2p|int|kid|lat|mil|net|nyc|org|pro|sco|sic|tel|xxx|web|om|qa|ye|yt|a[cdefgilmnoqrstwxz]|b[abdefghijlmnorstvwyz]|c[acdfghiklmnoruvxyz]|d[ejkmoz]|e[ceghrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdefghklmnopqrstuvwxyz]|n[acefgilopruz]|p[aefghklmnrstwy]|r[eosuw]|s[abcdeghijklmnortuvyz]|t[sdfghjklmnoprtvwz]|u[agkmsyz]|v[aceginufs]{1}|z[amw]{1,1})))$/i;
  if (!re.test(email) || email.length<6) {stop = 1; alert += "Ââåäèòå Âàø e-mail! ";}
  re = /^[a-zàáâãäå¸æçèéêëìíîïðñòóôõö÷øùúûüýþÿÀÁÂÃÄÅ¨ÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß]+[\w\d-. àáâãäå¸æçèéêëìíîïðñòóôõö÷øùúûüýþÿÀÁÂÃÄÅ¨ÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß]{1,99}$/i;
  if (!re.test(user) || user.length<2) {stop = 1; alert += "Ââåäèòå Âàøå èìÿ èëè íèê! ";}
  if (!user) user = "Àíîíèì"; else user = htmlspecialchars(jstrim(user),'ENT_QUOTES');
  if (text.length<2 || text=="Ñîîáùåíèå") {stop = 1; alert += "Ââåäèòå Âàøå ñîîáùåíèå! ";}
  if (!ip || ip=="" || ip=="undefined" || ip=="unknow" || ip.length<7) {stop = 1; user = "Àíîíèì"; alert += "Ïîïûòêà îñòàâèòü ñêðûòîå ñîîáùåíèå! ";}
  if (alert!="") {chatAlert("Âêëþ÷¸í àíòèôëóä! "+alert,""); alert = "";}
  if (stop==0) {
	keys = "islemap_chat_name="+user+"&islemap_chat_email="+email;
	keys += "&islemap_chat_text="+text+"&islemap_chat_ip="+ip;
	keys += "&islemap_chat_msg_hide="+hide+"&islemap_chat_name_id="+uid;
	ajax.requestFile = dle_root+"engine/modules/islemap/blocks.php";
	ajax.method = "POST";
	ajax.element = "islemap_chat_area";
	ajax.execute = true;
	ajax.sendAJAX(keys);
	islemap_chat_scroll_up();
  }
  islemap_chat_hide_buttons();
  document.getElementById("islemap_chat_count").value = o;
  return false;
}


$(document).ready(function(){
  $("ul#islemap_chat_area").hover(
	//function(){$(this).find('li').slideDown(1000);},
	//function(){$(this).find('li').slideUp(1000);}
  );
});


// ************************************************ //


function tools(act,val) {
  image = '<img src="/engine/modules/islemap/images/reload.gif" />';
  if (window.XMLHttpRequest) { //IE7+, Firefox, Chrome, Opera, Safari
	xmlDoc = new XMLHttpRequest();
	if (xmlDoc.overrideMimeType) {
	  xmlDoc.overrideMimeType('text/html');
	}
	//xmlDoc.onload = process;
  } else if (window.ActiveXObject && typeof window.ActiveXObject!="undefined") { //IE6, IE5
	try {
	  xmlDoc = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
	  try {
		xmlDoc = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch(e) {}
	}
	//xmlDoc.onload = process;
  }
  if (!xmlDoc) {alert('Cannot create XMLHTTP instance'); return false;}
  if (act=="word") {
	word = document.getElementById("islemap_tools_word").value;
	key = "?action=word&word="+word;
	xmlDoc.onreadystatechange = process_tools1; go = 1;
  } else if (act=="alphabet") {
	key = "?action=alphabet&alphabet=alphabet";
	xmlDoc.onreadystatechange = process_tools2; go = 1;
  } else if (act=="sentence") {
	sentence = document.getElementById("islemap_tools_sentence").value;
	key = "?action=sentence&sentence="+sentence;
	xmlDoc.onreadystatechange = process_tools3; go = 1;
  } else go = 0;
  if (go==1) {
	url = "engine/modules/tools/tools.php";
	xmlDoc.open("GET",url+key,true);
	xmlDoc.send(null);
  }
}
function process_tools1() {
  i = document.getElementById("islemap_tools_answer");
  i.value = getRequestStateTextGo(xmlDoc.readyState);
  abortRequest = window.setTimeout("xmlDoc.abort();",9000);
  if (xmlDoc.readyState==4) {
	clearTimeout(abortRequest);
	if (xmlDoc.status==200) {
	  i.innerHTML = xmlDoc.responseText;
	} else alert("There was a problem with the request. Status: "+xmlDoc.status);
  }
}
function process_tools2() {
  i = document.getElementById("islemap_tools_answer");
  i.value = getRequestStateTextGo(xmlDoc.readyState);
  abortRequest = window.setTimeout("xmlDoc.abort();",9000);
  if (xmlDoc.readyState==4) {
	clearTimeout(abortRequest);
	if (xmlDoc.status==200) {
	  i.innerHTML = xmlDoc.responseText;
	} else alert("There was a problem with the request. Status: "+xmlDoc.status);
  }
}
function process_tools3() {
  i = document.getElementById("islemap_tools_answer");
  i.value = getRequestStateTextGo(xmlDoc.readyState);
  abortRequest = window.setTimeout("xmlDoc.abort();",9000);
  if (xmlDoc.readyState==4) {
	clearTimeout(abortRequest);
	if (xmlDoc.status==200) {
	  i.innerHTML = xmlDoc.responseText;
	} else alert("There was a problem with the request. Status: "+xmlDoc.status);
  }
}


function tools_relation_words() {
  image = '<img src="/engine/modules/islemap/images/reload.gif" />';
  if (window.XMLHttpRequest) { //IE7+, Firefox, Chrome, Opera, Safari
	xmlDoc = new XMLHttpRequest();
	if (xmlDoc.overrideMimeType) {
	  xmlDoc.overrideMimeType('text/html');
	}
	//xmlDoc.onload = process;
  } else if (window.ActiveXObject && typeof window.ActiveXObject!="undefined") { //IE6, IE5
	try {
	  xmlDoc = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
	  try {
		xmlDoc = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch(e) {}
	}
	//xmlDoc.onload = process;
  }
  if (!xmlDoc) {alert('Cannot create XMLHTTP instance'); return false;}
  if (typeof(act_rel_words)=='undefined') act_rel_words = 1;
  if (act_rel_words==1) {
	word = document.getElementById("islemap_tools_word").value;
	key = "?action=rel_word&word="+word;
	xmlDoc.onreadystatechange = process_tools_relation_words; go = 1;
  } else go = word = 0;
  i = document.getElementById("islemap_tools_relation_words_more");
  if (go==1 && word!=0) {
	if (i.value!="") i.style.display = "block"; else i.style.display = "none";
	url = "engine/modules/tools/tools.php";
	xmlDoc.open("GET",url+key,true);
	xmlDoc.send(null);
  } else i.style.display = "none";
}
function process_tools_relation_words() {
  i = document.getElementById("islemap_tools_relation_words_more");
  i.value = getRequestStateTextGo(xmlDoc.readyState);
  abortRequest = window.setTimeout("xmlDoc.abort();",9000);
  if (xmlDoc.readyState==4) {
	clearTimeout(abortRequest);
	if (xmlDoc.status==200) {
	  //alert(i.value);
	  i.innerHTML = xmlDoc.responseText;
	} else alert("There was a problem with the request. Status: "+xmlDoc.status);
  }
}


function islemap_tools_text(v,id) {
  if (v>99) document.getElementById(id).value = "";
}


function user_live_geo(act,val) {
  image = '<img src="/engine/modules/islemap/images/reload.gif" />';
  if (window.XMLHttpRequest) { //IE7+, Firefox, Chrome, Opera, Safari
	xmlDoc = new XMLHttpRequest();
	if (xmlDoc.overrideMimeType) {
	  xmlDoc.overrideMimeType('text/html');
	}
	//xmlDoc.onload = process;
  } else if (window.ActiveXObject && typeof window.ActiveXObject!="undefined") { //IE6, IE5
	try {
	  xmlDoc = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
	  try {
		xmlDoc = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch(e) {}
	}
	//xmlDoc.onload = process;
  }
  if (!xmlDoc) {alert('Cannot create XMLHTTP instance'); return false;}
  if (act=="islemap_user_reg_countries") {
	key = "?action=geo&key=countries&value="+val;
	xmlDoc.onreadystatechange = process_go1; go = 1;
  } else if (act=="islemap_user_reg_regions") {
	key = "?action=geo&key=regions&value="+val;
	xmlDoc.onreadystatechange = process_go2; go = 1;
  } else if (act=="islemap_user_reg_cities") {
	key = "?action=geo&key=cities&value="+val;
	xmlDoc.onreadystatechange = process_go3; go = 1;
	i = document.getElementById("islemap_user_reg_cities").value;
	if (i!="") {
	  document.getElementById("land").value = i;
	  document.getElementById("geo_more").style.display = "none";
	  CheckLoginForm("land");
	}
	i = '';
  } else go = 0;
  if (go==1) {
	url = "engine/modules/register_users_live/register_users_live.php";
	xmlDoc.open("GET",url+key,true);
	xmlDoc.send(null);
  }
}
function getRequestStateTextGo(code) {
  switch (code) {
	case 0: return "Uninitialized."; break;
	case 1: return "Loading..."; break;
	case 2: return "Loaded."; break;
	case 3: return "Interactive..."; break;
	case 4: return "Complete."; break;
  }
}
function process_go1() {
  j = document.getElementById("islemap_user_reg_cities_block");
  j.innerHTML = '<select id="islemap_user_reg_cities" name="user_live_cities" onchange="user_live_geo(this.id,this.value);"><option value="">Âûáðàòü...</option></select>';
  i = document.getElementById("islemap_user_reg_regions_block");
  i.value = getRequestStateTextGo(xmlDoc.readyState);
  abortRequest = window.setTimeout("xmlDoc.abort();",9000);
  if (xmlDoc.readyState==4) {
	clearTimeout(abortRequest);
	if (xmlDoc.status==200) {
	  result = xmlDoc.responseText;
	  id = document.getElementById("islemap_user_reg_regions_block");
	  id.innerHTML = result;
	  id = document.getElementById("islemap_row_user_reg_regions");
	  id.style.display = "block";
	  id = document.getElementById("islemap_row_user_reg_cities");
	  id.style.display = "none"; id = "";
	} else alert("There was a problem with the request. Status: "+xmlDoc.status);
  } else {
	document.getElementById("islemap_user_reg_regions_block").innerHTML = image;
  }
}
function process_go2() {
  i = document.getElementById("islemap_user_reg_cities_block");
  i.value = getRequestStateTextGo(xmlDoc.readyState);
  abortRequest = window.setTimeout("xmlDoc.abort();",9000);
  if (xmlDoc.readyState==4) {
	clearTimeout(abortRequest);
	if (xmlDoc.status==200) {
	  result = xmlDoc.responseText;
	  id = document.getElementById("islemap_user_reg_cities_block");
	  id.innerHTML = result;
	  id = document.getElementById("islemap_row_user_reg_cities");
	  id.style.display = "block"; id = "";
	} else alert("There was a problem with the request. Status: "+xmlDoc.status);
  } else {
	document.getElementById("islemap_user_reg_cities_block").innerHTML = image;
  }
}
function process_go3() {
  i = document.getElementById("islemap_user_reg_cities_block2");
  i.value = getRequestStateTextGo(xmlDoc.readyState);
  abortRequest = window.setTimeout("xmlDoc.abort();",9000);
  if (xmlDoc.readyState==4) {
	clearTimeout(abortRequest);
	if (xmlDoc.status==200) {
	  result = xmlDoc.responseText;
	  id = document.getElementById("islemap_user_reg_cities_block2");
	  id.innerHTML = result;
	} else alert("There was a problem with the request. Status: "+xmlDoc.status);
  }
}
