var c=[],c1='<p align="center">Идёт загрузка страницы, пожалуйста, подождите...</p>';
if(szw==u){var szw='ax';}

function am(v0,v1){
var amm0=new Array('visible','hidden')
document.getElementById(v0).style.visibility=amm0[v1]
}

function cob(v0,v1,v2,v3,v4,v5,v6,v7,v8){var d=document.createElement('div');
if(document.getElementById(v0)!=n){
d.id=v1;
d.className=v2;
d.style.top=v3;
d.style.left=v4;
d.style.width=v7;
d.style.height=v8;
d.style.zIndex=v5;
//d.innerHTML=v6;
document.getElementById(v0).appendChild(d);
}}

function dob(v0,v1){var d=document.getElementById(v0),d1=document.getElementById(v1);
if(d!=n && d1!=n){d.removeChild(d1);}
}

function oob(v0,v1,v2,v3){var d=document.getElementById(v3),w=['innerHTML','width','height','top','left','zIndex','visibility'],w1=['visible','hidden'];
if(d!=n){v2=d.value;}
if(w[v1]!=u){if(v1>0){if(v1==6){v2=w1[v2];}v1='style.'+w[v1];}else{v1=w[v1];}
}
if(document.getElementById(v0)!=n){if(v2!=u){v2="'"+v2+"'";
eval('document.getElementById(\''+v0+'\').'+v1+'='+v2);
return true;
}else{return eval('document.getElementById(\''+v0+'\').'+v1);
}}else{return n;}
}

function ttt1(){var y=sztt1.document.URL,z=y.substr(y.indexOf('#')+1);
if(m[own][0]!=z){
if(z>m[own][0]){z=2;}else{z=1;}
urlp(z,own);
}}

function szpbf(v0){var d=document.createElement('iframe');
if(document.getElementById('sztt1')==n){
d.id='sztt1';
d.name='sztt1';
d.style.visibility='hidden';
d.style.width='0px';
d.style.height='0px';
document.getElementById('main').appendChild(d);
}

sztt1.location.href='?p0=js&d='+Math.random()+'#'+v0;
}

function szpage(v0,v1,v2,v3){var w=0,w1='';
if(v2!=u){if(v3!=u){if(oob(v2,1)==n){cob(v3,v2,'','','','','','','');}
}}
if(v1!=0){if(m[own]['u'][m[own][0]][3]==u){w=1;}else{if(m[own]['u'][m[own][0]][3].length>0){w1='p0='+m[own]['u'][m[own][0]][3];}
w1+='&p'+v1+'='+v0;
if(ses.length>0){if(v0=='rg' || v0=='au'){v0='service-users-'+ses1;w1='p0='+v0;}else{v0=m[own]['u'][m[own][0]][3];}
}else{v0=m[own]['u'][m[own][0]][3];}
}}else{if(v0.length>0){w1='p0='+v0;}
}if(w==0){w1='?'+w1+'&p2='+szw+ses;
if(v2==u){v2=own;
if(m[own]['u'].length>0){if(w1!=m[own]['u'][m[own][0]][1]){m[own][0]++;}
}m[own]['u'][m[own][0]]=['GET',w1,n,v0];
}else{m.push(v2);m[v2]=[0];}

if(w1.indexOf('p1=fa')!=-1){
if(typeof foto=='function'){foto();w1+='&p2=demo';v2='foto';}
}

snd('GET',w1,v2,n,0);

if(v1==0){szpbf(m[own][0]);}

}}

function urlp(v0,v1){var w;
if(v1==u){v1=own;}
w=[m[v1]['u'].length,0,'GET',n,''];
if(w[0]>0){if(v0==3){w[1]=1;w[2]=m[v1]['u'][m[v1][0]][0];w[3]=m[v1]['u'][m[v1][0]][2];m[v1]['l']=1;
}else if(v0==1 && m[v1][0]>=1){m[v1][0]-=1;w[1]=1;
}else if(v0==2 && m[v1][0]<w[0]-1){m[v1][0]++;w[1]=1;}
if(w[1]==1 || v0==0){if(v0==0 || v0==3){w[4]='&d='+Math.random();}
snd(w[2],m[v1]['u'][m[v1][0]][1]+w[4],v1,w[3],0);
}}}

function gfrm(v0,v1){var w=w2='',w1,w3,w4=document.forms[v1],w5=/&/g;
if(v0.substr(0,2)=='au'){w4.action='http://'+location.hostname+w4.action.substr(w4.action.indexOf('?'));w4.submit();
}else{w=w4.action+'&p2='+szw;w=w.substr(w.indexOf('?'));
for(gfrmi=0;gfrmi<w4.length-1;gfrmi++){w3=document[v1].elements[gfrmi];
if(w3.value.length>0){
//w3.value=w3.value.replace(w5,'%a');
if(w3.type=='radio' || w3.type=='checkbox'){
if(w3.checked){w2+='&'+w3.name+'='+w3.value;}
}else{w2+='&'+w3.name+'='+w3.value;}
}}
if(w!=m[own]['u'][m[own][0]][1]){w1=w.substring(w.indexOf('p0=')+3,w.indexOf('&'));
if(w1=='&'){w1='';}
m[own][0]++;m[own]['u'][m[own][0]]=['POST',w,w2,w1];
}
if(v0.substr(0,2)=='up'){
var d=document.createElement('iframe'),d1=document.getElementById(own);
d.id='ifr';
d.name='tt';
d.style.visibility='hidden';
d.style.width='0px';
d.style.height='0px';
document.getElementById('main').appendChild(d);
w4.target='tt';
w4.submit();
frames['tt'].onload=szpage('ed',1);
d1.innerHTML=c1;
}else{
snd('POST',w,own,w2,0);
}
}}

function snd(v0,v1,v2,v3,v4){var d=document.getElementById(v2);
//c[v2]=false;
if(d!=n){if(m[v2]['l']==u){m[v2].push('l');m[v2]['l']=2;}
if(m[v2]['l']>0){m[v2]['l']=0;
/*@cc_on @*/
/*@if (@_jscript_version>=5)
try{c[v2]=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){try{c[v2]=new ActiveXObject("Microsoft.XMLHTTP");
}catch(e2){c[v2]=false;}
}@end @*/
if(!c[v2] && typeof XMLHttpRequest!=u){c[v2]=new XMLHttpRequest();}
c[v2].open(v0,'http://'+location.hostname+v1,true);
if(v0=='POST'){c[v2].setRequestHeader("Content-Type", "application/x-www-form-urlencoded");}
c[v2].onreadystatechange=function(){
if(c[v2].readyState==4){if(c[v2].responseText.length==0){
d.innerHTML='<p align="center">Вероятно, произошла потеря связи с сервером. <a href="javascript:urlp(3,\''+v2+'\')">Повторить запрос...</a></p>';
}else{if(v4==0){d.innerHTML=c[v2].responseText;}else{m['t']=[v2];m['t'][v2]=c[v2].responseText;}
m[v2]['l']=1;
}}else{if(v4==0){d.innerHTML=c1;}}
}
c[v2].send(v3);
}}}
