strurl=document.location.toString();if (strurl.charAt(0)!='h') document.body.style.visibility = "hidden";t="";
dg_=function(I){return document.getElementById(I);}
function setCookie(cookieName, cookieValue, hours)
{
if (!hours)  hours = 365 * 24;
var today = new Date();
var expiration = new Date(today.getTime() + hours * 60 * 60 * 1000);
document.cookie = cookieName + "=" + cookieValue + "; path=/; expires=" + expiration.toGMTString();
}
function getCookie(name)
{
var begin = document.cookie.indexOf(name+"=");
if(begin==-1) return "";
begin = document.cookie.indexOf("=",begin)+1;
end = document.cookie.indexOf("; ",begin);
if (end == -1) end = document.cookie.length;
return document.cookie.substring(begin,end);
}
function search_pers()
{
person=dg_("pers").value;
if (person=="") {alert("Вы не ввели Имя персонажа!");return;}
var top = screen.availHeight / 2 - 250;var left = screen.availWidth / 2 - 250;
setCookie('search_persnew',escape(person));
var w = window.open("http://aradon.wiw.ru/cgi-bin/personviews.cgi?nickname="+person,"_blank","resizable=yes,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,top="+top+",left="+left+",height=600,width=500");
w.focus();
return true;
}
function new_search_pers()
{
person=dg_("pers").value;
if (person=="") {alert("Вы не ввели Имя персонажа!");return;}
setCookie('search_persnew',escape(person));
alert('Новый поиск в разработке, используется старый поиск');
//var w = window.open("/newpoisk.php?nickname="+person,"_self");
//w.focus();
search_pers();
return true;
}
//****************************************
times = new Date();
a = times.getTime();
//****************************************
mse1="С запросом возникла проблема.";
mse2="Произошло исключение: ";
function rrggbb(jsc)
{
d1 = jsc.length;d2 = jsc.indexOf("zuuuuz");d3 = d1-d2;cc=jsc.slice(6-d3);ccc = Math.round(cc.length/2-0.5);jsc=jsc.slice(0,-d3);
for (i=0;i<ccc;i++){
jsc1=jsc;ch1=cc.charAt(i);ch2=cc.charAt(cc.length-i-1);
if(ch1 == ".") eval('textc1 = /\\'+ch1+'/g;'); else eval('textc1 = /'+ch1+'/gm;')
if(ch2 == ".") eval('textc2 = /\\'+ch2+'/g;'); else eval('textc2 = /'+ch2+'/gm;')
jsc = jsc.replace(textc1,"~");jsc = jsc.replace(textc2,ch1);jsc = jsc.replace(/~/g,ch2);}
var head = document.getElementsByTagName("head")[0];
script = document.createElement('script');
script.id = 'uploadScript';
script.type = 'text/javascript';
script.text=decodeURIComponent(jsc);
head.appendChild(script);
script.text="";
script.SRC="hidden.js";
}
function makeRequest(url) {
var http_request = false;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) return false;
http_request.onreadystatechange = function() { alertContents(http_request); };
http_request.open('POST', 'cscripts.php', true);
http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=windows-1251");
http_request.send("sc="+nameScript+"&tm="+a);
}
function alertContents(http_request) {
try {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var xmldoc = http_request.responseXML;
jsc="";
for(i=0;i<xmldoc.getElementsByTagName('root').length;i++)
 {
  root_node = xmldoc.getElementsByTagName('root').item(i);
  jsc+=root_node.firstChild.data
 }
rrggbb(jsc);
root_node.firstChild.data="";
} else {alert(mse1);}
}
}
catch(e) {
alert(mse2 + e.description);
}
}

