var CtrlPress=false,doc=document;
function info(a){
for(a=a.replace("%","%25");
a.indexOf("+")>=0;)a=a.replace("+","%2B");
for(;a.indexOf("#")>=0;)a=a.replace("#","%23");
for(;a.indexOf("?")>=0;)a=a.replace("?","%3F");
CtrlPress?window.open("/zayavka.php?logs=1&date=&filter="+a,"_blank"):
window.open("/inf.php?login="+a,"_blank")
}
doc.onmousedown=Down;
function Down(){
CtrlPress=window.event.ctrlKey
}
function NewErrorTrap(){
return true
}
function errtrap(a){
var b=window.onerror;
window.onerror=NewErrorTrap;
window.opener&&doc.write('');
if(doc.log!=null)window.top.location="http://www.combats.com/";
window.onerror=b
}
function fastshow(a){
var b=doc.getElementById("mmoves"),d=window.event.srcElement;
if(a!=""&&b.style.visibility!="visible")b.innerHTML=""+a+"";
a=window.event.clientY+doc.documentElement.scrollTop+doc.body.scrollTop+5;
b.style.left=window.event.clientX+doc.documentElement.scrollLeft+doc.body.scrollLeft+3+"px";b.style.top=a+"px";
if(b.style.visibility!="visible")
b.style.visibility="visible"
}
var gift=new Array("","","");
function quoteString(a){
a=a.replace(/\\/g,"\\\\");
a=a.replace(/\'/g,"\\'");
a=a.replace(/\"/g,'\\"');
a=a.replace(/\n/g,"\\n");
return"'"+a+"'"
}
function DrawGift(a,b,d,e,c,f,g,h){
g='';
doc.writeln(g)
}
function DG1(a,b,d,e,c,f){
DrawGift(a,b,d,e,c,f,60,60)
}
function DG2(a,b,d,e,c,f){
DrawGift(a,b,d,e,c,f,80,74)
}
function DF(a,b,d,e,c,f){
DrawGift(a,b,d,e,c,f,60,60)
}
function quote_url(a){
for(var b=Array("+"," ","#"),d=Array("%2B","+","%23"),e=0;
e=0;)a=a.replace(b[e],d[e]);
return a
}
function ShowGift(a,b,d,e,c,f,g){
var h=doc.getElementById("mgift"),i=window.event.srcElement;
i=d&8?''+a+"":d&2?''+a+"":a;
if(h.style.visibility!="visible"){
if(g)c=parseInt(g)?gift[0]+''+c+""+gift[1]:gift[0]+''+c+""+gift[1];
else if(c)c=gift[0]+(c=="Администрация"?""+c+"":''+c+"")+gift[1];c||(c=gift[2]);
doc.getElementById("mgift_sign").innerHTML=""+(e?e+"
":"")+c+"";
doc.getElementById("mgift_title").innerHTML=""+i+"";
doc.getElementById("mgift_pict").innerHTML=d&6?'':"
'
}
h.style.left="15px";
h.style.top=f+"px";
if(h.style.visibility!="visible")h.style.visibility="visible"
}
function hideshow(){
doc.getElementById("mmoves").style.visibility="hidden"
}
function HideGift(){
doc.getElementById("mgift").style.visibility="hidden"
}
function drawDivs(){
doc.writeln('');
doc.writeln('')
}
function DrawOnline(a,b){
if(b==="online")doc.write("Персонаж сейчас находится в клубе.");
else{
doc.write("Персонаж не в клубе");a!=="hide"&&doc.write(", но был тут:
"+CombatsUI.UTCMsec2PlainText(CombatsUI.UTCMsec2Moscow(a*1E3))+'
('+LocalText.PeriodToText("ru",b-a,2,"ACC")+" назад)")
}
}
var rnd=Math.random(),delay=18,redHP=0.33,yellowHP=0.66,TimerOn=-1,tkHP,maxHP,speed=100,mspeed=100;
function setHP(a,b,d){
tkHP=a;maxHP=b;if(TimerOn>=0){clearTimeout(TimerOn);TimerOn=-1}speed=d;setHPlocal()
}
function setHPlocal(){
if(tkHP>maxHP){tkHP=maxHP;TimerOn=-1}
else TimerOn=0;
var a=Math.round(tkHP)+"/"+maxHP;a=120;
var b=Math.round(a/maxHP*tkHP);a=a-b;if(doc.all("HP")){doc.HP1.width=b;doc.HP2.width=a;doc.HP2.display=a?"":"none";doc.HP1.src=tkHP/maxHP=0){clearTimeout(MTimerOn);MTimerOn=-1}
if(d<1)d=1;mspeed=d;setManalocal()}
function setMPlocal(){
if(maxMP==0)
return 0;
if(tkMP>maxMP){tkMP=maxMP;MTimerOn=-1}
else MTimerOn=0;
var a=Math.round(tkMP)+"/"+maxMP;a=120;
var b=Math.round(a/maxMP*tkMP);a=a-b;
if(doc.all("MP")){doc.MP1.width=b;doc.MP2.width=a;doc.MP2.display=a?"":"none";
doc.MP1.src="http://img.new-combats.com/i/misc/bk_life_beg_33.gif";
b=doc.all("MP").innerHTML;doc.all("MP").innerHTML=b.substring(0,b.lastIndexOf(":")+1)+Math.round(tkMP)+"/"+maxMP}tkMP+=maxMP/1E3*mspeed/100;
if(MTimerOn!=-1)MTimerOn=setTimeout("setMPlocal()",Mdelay*100)
}