var Hint3Name = ''; step=0; //книги function book() { var srcId, srcElement, targetElement; srcElement = window.event.srcElement; if (srcElement.className.toUpperCase() == "LEVEL1") { srcID = srcElement.id.substr(0, srcElement.id.length-1); targetElement = document.all(srcID + "s"); srcElement = document.all(srcID + "i"); if (targetElement.style.display == "none"){ targetElement.style.display = ""; if(srcID=="OUTchaR"){ }else{ targetElement.style.left = 100; targetElement.style.top = document.body.scrollTop+50; } }else{ targetElement.style.display = "none"; } } } document.onclick = book; //свитки function showmagic() { if(document.all("magicform").style.display=="none"){ document.all("magicform").style.display=""; }else{ document.all("magicform").style.display="none"; } } function errmess(s) { messid.innerHTML=''+s+''; highlight(); } function highlight() { if (step) return(0); step=10; setTimeout(dohi,50); } function dohi() { var hx=new Array(0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"); step--; messid.style.color="#"+hx[Math.floor(15-step/2)]+((step&1)?"F":"8")+"0000"; if (step>0) setTimeout(dohi,50); } function fixspaces(s) { while (s.substr(s.length-1,s.length)==" ") s=s.substr(0,s.length-1); while (s.substr(0,1)==" ") s=s.substr(1,s.length); return(s); } // Заголовок, название скрипта, имя поля с логином function form(title, script, name, opis, mtype) { var s; s='
'+ ' '+opis+'
'; s = crtmagic(mtype, title, s); document.all("hint4").innerHTML = s; document.all("hint4").style.visibility = "visible"; document.all("hint4").style.left = 100; document.all("hint4").style.top = document.body.scrollTop+90; document.all(name).focus(); Hint3Name = name; } //свиток с целью вне боя function findlogin(title, script, name, defaultlogin, mtype) { var s; s='
'+ 'Укажите логин персонажа:
(можно щелкнуть по логину в чате)
'; s = crtmagic(mtype, title, s); document.all("hint4").innerHTML = s; document.all("hint4").style.visibility = "visible"; document.all("hint4").style.left = 100; document.all("hint4").style.top = document.body.scrollTop+90; document.all(name).focus(); Hint3Name = name; } // Заголовок, название скрипта, имя поля с логином, логин по умолчанию, тип оформления, тип с целью или без function bMag(title, script, name, defaultlogin, mtype, btype, text){ var s; if(btype==1){ s=''+ ''+ ''+ ''+ '
'+ text+ '
Укажите логин персонажа:
(можно щелкнуть по логину в чате)
'; }else if(btype==2){ s=''+ ''+ ''+ ''+ '
'+ text+ '
Укаждите вашу цену:
'; } else{ s=''+ '
'+ text+'
'; } s = crtmagic(mtype, title, s); document.all("hint4").innerHTML = s; document.all("hint4").style.visibility = "visible"; document.all("hint4").style.left = 140; document.all("hint4").style.top = document.body.scrollTop+100; document.all(name).focus(); Hint3Name = name; } //цель плюс причина function loginP(title, script, name, defaultlogin, mtype) { var s; s='
'+ 'Укажите логин персонажа:
(можно щелкнуть по логину в чате)
'+ 'Укажите причину:
'; s = crtmagic(mtype, title, s); document.all("hint4").innerHTML = s; document.all("hint4").style.visibility = "visible"; document.all("hint4").style.left = 100; document.all("hint4").style.top = document.body.scrollTop+50; document.all(name).focus(); Hint3Name = name; } //пдтвержение использования function dialogconfirm(title, script, text, mtype) { var s; s='
'+ text+'
'; s = crtmagic(mtype, title, s); document.all("hint4").innerHTML = s; document.all("hint4").style.visibility = "visible"; document.all("hint4").style.left = 100; document.all("hint4").style.top = document.body.scrollTop+50; document.all("tmpname423").focus(); Hint3Name = name; } //типа красивый алерт function dialogOK(title, text, mtype) { var s; s='
'+ text+'
'; s = crtmagic(mtype, title, s); document.all("hint4").innerHTML = s; document.all("hint4").style.visibility = "visible"; document.all("hint4").style.left = 100; document.all("hint4").style.top = document.body.scrollTop+50; Hint3Name = name; } function foundmagictype (mtypes) { if (mtypes) { mtypes=mtypes+""; if (mtypes.indexOf(',') == -1) return parseInt(mtypes); var s=mtypes.split(','); var found=0; var doubl=0; var maxfound=0; for (i=0; i < s.length; i++) { var k=parseInt(s[i]); if (k > maxfound) { found=i + 1; maxfound=k; doubl=0; } else { if (k == maxfound) {doubl=1;} } } if (doubl) {return 0}; return found; } return 0; } // Для магии. Заголовок, название скрипта, название магии, номер вещицы в рюкзаке, логин по умолчанию, описание доп. поля //2 поля типа экстра форм function magicklogin(title, script, magickname, n, defaultlogin, extparam, mtype) { var s = ''; if (extparam != null && extparam != '') { s = s + ''; } s = s + '
'+ 'Укажите логин персонажа:
(можно щелкнуть по логину в чате)
'+extparam+'
'; s = crtmagic(mtype, title, s); document.all("hint4").innerHTML = s; document.all("hint4").style.visibility = "visible"; document.all("hint4").style.left = 100; document.all("hint4").style.top = document.body.scrollTop+50; document.all("param").focus(); Hint3Name = 'param'; } // Магия //хз function UseMagick(title, script, name, extparam, n, extparam2, mtype) { if ((extparam != null)&&(extparam != '')) { var t1='text',t2='text'; if (extparam.substr(0,1) == "!") { t1='password'; extparam=extparam.substr(1,extparam.length); } var s = ''; if (extparam2 != null && extparam2 != '') { if (extparam2.substr(0,1) == "!") { t2='password'; extparam2=extparam2.substr(1,extparam2.length); } s = s + ''; } s += '
'+ extparam + ':
'+extparam2+':
'; s = crtmagic(mtype, title, s); document.all("hint4").innerHTML = s; document.all("hint4").style.visibility = "visible"; document.all("hint4").style.left = 100; document.all("hint4").style.top = document.body.scrollTop+50; document.all("param").focus(); Hint3Name = 'param'; } else { dialogconfirm('Подтверждение', script, '
Использовать сейчас?
'+ '', mtype); } } // Закрывает окно ввода логина function closehint3() { document.all("hint4").style.visibility="hidden"; Hint3Name=''; } // Для боевой магии. Заголовок, название магии, номер вещицы в рюкзаке //с проверкой поля удара function BmagickLogin(title, magickname, n, defaultlogin, extparam, mtype) { if (defend==false) { errmess("Блок не выбран."); return false; } var s = ''; if (extparam != null && extparam != '') { s = s + ''; } s = s + '
'+ 'Укажите логин персонажа:
(можно щелкнуть по логину в чате)
'+extparam+'
'; s = crtmagic(mtype, title, s); document.all("hint4").innerHTML= s; document.all("hint4").style.visibility = "visible"; document.all("hint4").style.left = 100; document.all("hint4").style.top = 60; document.all("param").focus(); Hint3Name = 'param'; } // Магия function BUseMagick(name, extparam, n, mtype) { if (defend==false) { errmess("Блок не выбран."); return false; } if ((extparam != null)&&(extparam != '')) { var s = prompt(extparam+':', ''); if ((s != null)&&(s != '')) { re = /\%/g; s=s.replace(re, "%25"); re = /\+/g; s=s.replace(re, "%2B"); re = /\#/g; s=s.replace(re, "%23"); re = /\?/g; s=s.replace(re, "%3F"); re = /\&/g; s=s.replace(re, "%26"); window.location.href='/battle.pl?use='+name+'¶m='+s+'&n='+n+'&mdefend='+defend+'&enemy='+enemy+'&myid='+myid; } } else { dialogconfirm('Подтверждение', '/battle.pl', '
Использовать сейчас?
'+ '', mtype); } } function crtmagic(mtype, title, body, subm) { //name, XYX, X1-X2-Y2, pad.LRU mtype=foundmagictype(mtype); var names=new Array( 'neitral',17, 6, 14, 17, 14, 7,0,0, 3, 'fire', 57, 30, 33, 20, 21, 14, 11, 12, 0, 'water', 57, 30, 33, 20, 21, 14, 11, 12, 0, 'air', 57, 30, 33, 20, 21, 14, 11, 12, 0, 'earth', 57,30, 33, 20, 21, 14, 11, 12, 0, 'white', 51, 25, 46, 44, 44, 10, 5, 5, 0, 'gray', 51, 25, 46, 44, 44, 10, 5, 5, 0, 'black', 51, 25, 46, 44, 44, 10, 5, 5, 0); var colors=new Array('B1A993','DDD5BF', 'ACA396','D3CEC8', '96B0C6', 'BDCDDB', 'AEC0C9', 'CFE1EA', 'AAA291', 'D5CDBC', 'BCBBB6', 'EFEEE9', '969592', 'DADADA', '72726B', 'A6A6A0'); while (body.indexOf('#IMGSRC#')>=0) body = body.replace('#IMGSRC#', 'img/dmagic/'+names[mtype*10]+'_30.gif'); var s=''+ ''+ ''+ ''+ '
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+ ''+ ''+ (names[mtype*10+7]?'':'')+ ''+ ''+ ''+ (names[mtype*10+8]?'':'')+ ''+ '
  '+ ''+ ''+ ''+ ''+ '
'+ '
'+title+ ' 
'+ '
'+body+ '
  
'+ ''+ ''+ ''+ ''+ ''+ ''+ '
'; return s; }