/* Начало работы */ function startEng() { lineResize(); lineResize2(); testResize(); //preventSelection(document.body); startChat(0); seeBtns(0); } /* Переменные */ var norz = 0; var id_log = 0; var id_log_ar = new Array(); var battle_log = 0; var goodIE = 7; var lstW = 0; var lstH = 0; var tmoff = 0; var tmgof = 1; var chatBtnsDate = { }; var chatReflesh = 0; var newTimeReflesh = 20; var lastMessage = 0; var trnsl = 0; var snd = 0; var max_window = 10; // максимальное число окошек var toInpLogin = ''; var nowraz = 0; var battle = 0; var battle_now = 0; var tmr10 = 0; var onr = 0; var chat_id = 0; function rmve(id) { $(id).remove(); } /* ==========[ Авто обновление чата ] ============================================================================================================================================= */ var tr07 = 0; function startChat(id) { if(id==1) { clearTimeout(tmr10); } if(tr07==0) { $.post('chat.php',{reflesh:top.lastMessage,fi:document.F1.fi.value,romz:onr},function(data){$("#output").html(data);top.lineResize2();}); setTimeout('top.tr07 = 0;',1000); } tmr10 = setTimeout('startChat(1);',newTimeReflesh*1000); } /* ==========[ Работа с чатом ]==================================================================================================================================================== */ var id_file = 'test'; var ltr = 0; var tt1; function giveTtl() { var i = 1; while(i<=20) { if(nb[i]!=undefined) { var obj = document.getElementById('chBtn'+i); if(obj!=undefined) { obj.title = nb[i][1]; } } i++; } } function autoAllChat(onref) { if(tmoff==0) { var onr = top.onlineRef; if(onref==1) { onr = 1; } $.post('chat.php',{reflesh:top.lastMessage,fi:document.F1.fi.value,romz:onr},function(data){$("#output").html(data);top.lineResize2();}); tmoff = 10; }else{ if(tmoff>0 && tmgof==1) { setTimeout('tmoff = 0; tmgof = 1; autoAllChat('+onref+');',500); tmgof = 0; } } } function autoFocus() { if(document.getElementById('F1')!=undefined) { if(document.getElementById('text')!=undefined) { document.getElementById('text').focus(); } } } function trmb() { if(top.trnsl==1) { document.F1.text.value = convert2(document.F1.text.value); } } function convert2(txt) { var trn = new Array(); trn = txt.split(' '); for(var i=0;i=7.0) //{ elem.removeAttribute("handle"); elem.removeAttribute("events"); //} } } } }()); /* ==========[ Высплывающие подсказки ]========================================================================================================================================== */ var addMoveFRM = new Array(); var iAct = 0; function moveTitle(event,f,tp) { var f2 = ''; chf = f; if(f=='online') { f2 = f; f = ''; } if (!event) { event = window.event; } var __HintObject = top.document.getElementById('ttl'); if(__HintObject.innerHTML!='') { var x,y; if(event.clientX+top.document.body.scrollLeft+__HintObject.clientWidth+20>=top.document.body.clientWidth) { x = event.clientX-__HintObject.clientWidth-20; }else{ x = event.clientX+top.document.body.scrollLeft+20; } if(event.clientY+top.document.body.scrollTop+__HintObject.clientHeight+20>=top.document.body.clientHeight+top.document.body.scrollTop-5) { y = top.document.body.clientHeight-__HintObject.clientHeight+top.document.body.scrollTop-5; }else{ y = event.clientY+top.document.body.scrollTop+20; } var dptop = 0; var dpleft = 0; if(f!='' && top.frames[f]!=undefined) { var dp = top.frames[f].document; }else{ var dp = top.document; } if(addMoveFRM[f]==undefined || addMoveFRM[f]!=1) { Event.add(dp, 'mousemove', test2); addMoveFRM[f] = 1; } if(dp!=undefined && f=='chat') { dptop = getFrH(top.frames['main']); }else if(dp!=undefined && f=='online') { dptop = getFrH(top.frames['main']); dpleft = 0; } if(f=='main') { x -= 2; y += 7; }else if(f2=='online') { x -= 10; y -= 37; } if(f=='online') { x -= 10; y -= 37; } if(top.frames['main']==undefined) { x -= 10; y -= 37; } __HintObject.style.left = x -10 + dpleft + 'px'; __HintObject.style.top = y + 37 + dptop + 'px'; } } function test2(event) { moveTitle(event,chf,null); iAct++; } function test(event) { moveTitle(event,chf,null); } var chf = ''; function title(t,event,tp,frm,stl) { if(chf!='' && frm!='online' && top.frames[chf]!=undefined) { var dp = top.frames[chf].document; }else{ var dp = top.document; } if(stl==null || stl==undefined) { stl = 'white-space:nowrap;'; } //Event.remove(dp, 'mousemove', test); chf = frm; if (!event) { event = window.event; } //white-space:nowrap; var s = ''+t+''; var dv = top.document.getElementById('ttl'); if(dv!=undefined) { if(tp==0) { addMoveFRM[chf] = 1; } dv.innerHTML = s; top.moveTitle(event,frm,tp); dv.style.display = ''; } } function ct(event) { var dv = top.document.getElementById('ttl'); if(dv!=undefined) { dv.innerHTML = ''; dv.style.display = 'none'; } var q,w=''; if(chf!='' && top.frames[chf]!=undefined) { var dp = top.frames[chf].document; }else{ var dp = top.document; } if(chf!='') { Event.remove(dp, 'mousemove', test); addMoveFRM[chf] = 0; } chf = ''; } /* ==========[ Запрет выделения ]================================================================================================================================================ */ function preventSelection(element) { var preventSelection = false; function addHandler(element, event, handler){ if (element.attachEvent) element.attachEvent('on' + event, handler); else if (element.addEventListener) element.addEventListener(event, handler, false); } function removeSelection(){ if (window.getSelection) { window.getSelection().removeAllRanges(); } else if (document.selection && document.selection.clear) document.selection.clear(); } function killCtrlA(event){ var event = event || window.event; var sender = event.target || event.srcElement; if (sender.tagName.match(/INPUT|TEXTAREA/i)) return; var key = event.keyCode || event.which; if (event.ctrlKey && key == 'A'.charCodeAt(0)) { removeSelection(); if (event.preventDefault) event.preventDefault(); else event.returnValue = false; } } addHandler(element, 'mousemove', function(){ if(preventSelection){removeSelection();} }); addHandler(element, 'mousedown', function(event){ var event = event || window.event; var sender = event.target || event.srcElement; preventSelection = !sender.tagName.match(/INPUT|TEXTAREA/i); }); addHandler(element, 'mouseup', function(){ if (preventSelection) removeSelection(); preventSelection = false; }); addHandler(element, 'keydown', killCtrlA); addHandler(element, 'keyup', killCtrlA); } /* ==========[ Изменение размеров линии ]================================================================================================================================================ */ function showtable(id) { hidesel(id); hidemenu(0); document.getElementById('menu'+id).style.display = ''; } function hidemenu (time) { for (var i=1;i<=4;i++) { document.getElementById('menu'+i).style.display = 'none'; } } function hidesel (id) { for (var i=1;i<=5;i++) { if (i!=id) {document.getElementById('el'+i).style.backgroundColor='';document.getElementById('el'+i).style.color='';} } } function resizeLine2(evt) { if(document.getElementById('glob').style.display!='') { document.getElementById('glob').style.display = ''; } evt = evt || window.event; var ln = document.getElementById('resizeLine2'); if(ln!=undefined) { Event.add(document, 'mousemove', resizeLine2); ln.style.left = evt.clientX-1+'px'; norz = 1; } } function resizeLineEnd2(evt) { if(document.getElementById('glob').style.display=='') { document.getElementById('glob').style.display = 'none'; } Event.remove(document, 'mousemove', resizeLine2); evt = evt || window.event; var ln = document.getElementById('resizeLine2'); if(ln!=undefined) { //сохраняем координаты загрушки var wh = getClientWidth(); var newSz = evt.clientX+15; if(newSz<301){ newSz = 301; } if(newSz>wh-51){ newSz = wh-51; } var bln = document.getElementById('backresizeLine2'); var newY = ln.style.top; var ms = document.getElementById('online2'); if(ms!=undefined) { var cf = document.getElementById('onlineframe'); cf.style.width = wh-newSz+'px'; ms.style.width = 100-((newSz)/wh*100)+'%'; lineResize2(); } if(bln!=undefined) { bln.style.left = ln.style.left; } norz = 0; } } function resizeLine(evt) { if(document.getElementById('glob').style.display!='') { document.getElementById('glob').style.display = ''; } evt = evt || window.event; var ln = document.getElementById('resizeLine'); if(ln!=undefined) { Event.add(document, 'mousemove', resizeLine); ln.style.top = evt.clientY-2+'px'; norz = 1; } } function resizeLineEnd(evt) { if(document.getElementById('glob').style.display=='') { document.getElementById('glob').style.display = 'none'; } Event.remove(document, 'mousemove', resizeLine); evt = evt || window.event; var ln = document.getElementById('resizeLine'); if(ln!=undefined) { //сохраняем координаты загрушки var wh = getClientHeight(); var newSz = evt.clientY-42; if(newSz<50){ newSz = 50; } if(newSz>wh-107){ newSz = wh-107; } var bln = document.getElementById('backresizeLine'); var newY = ln.style.top; var ms = document.getElementById('main_frame'); var cs = document.getElementById('chat_frame'); var cs2 = document.getElementById('chat_frame2'); if(ms!=undefined) { ms.style.height = ((newSz)/wh*100)+'%'; chatResize(newSz); lineResize(); lineResize2(); } if(bln!=undefined) { bln.style.top = ln.style.top; lineResize2(); } norz = 0; } } function bodyisresize() { if(lstH==0) { lstH = document.getElementById('main_frame').clientHeight; } if(lstH!=document.getElementById('main_frame').clientHeight) { lstH = document.getElementById('main_frame').clientHeight; lineResize(); lineResize2(); }else{ if(lstW==0) { lstW = document.getElementById('main_frame').clientWidth; } if(lstW!=document.getElementById('main_frame').clientWidth) { lstW = document.getElementById('main_frame').clientWidth; lineResize2(); } } } function testResize() { if(norz==0) { bodyisresize(); } chatResize(0); setTimeout(testResize,20); } function chatResize(newSize) { var m = document.getElementById('chat_menus'); if(m!=undefined) { var chW = !window.opera?document.getElementById('chat').clientWidth:document.getElementById('chat').clientWidth; if(m.style.width!=chW) { m.style.width = chW+'px'; } } var n = document.getElementById('chat'); if(n!=undefined) { var cfH = !window.opera?document.getElementById('main_frame').clientHeight:document.getElementById('main_frame').clientHeight; if(newSize>0) { cfH = newSize; } if(-(cfH-getClientHeight())-73>0) { cfH = -(cfH-getClientHeight())-73; }else{ cfH = 0; } n.style.height = cfH+'px'; } } function testMsg(txt,ch) { var cht = document.getElementById('chatID'+ch); if(cht!=undefined) { cht.innerHTML += txt; } } function clearMsgs() { if(lastMsgIds>0) { var i = lastMsgIds-500; while(i < lastMsgIds-300) { if(document.getElementById('message'+i)!=undefined) { $('#message'+i).remove(); } i++; } } } function lineResize() { document.getElementById('onlineframe').style.height = '0px'; var cf = document.getElementById('chat_frame'); if(cf!=undefined) { var ln = document.getElementById('resizeLine'); if(ln!=undefined) { var xy = getOffset(cf); chatResize(xy.top); var xy2 = getOffset(ln); ln.style.top = xy.top+'px'; var bln = document.getElementById('backresizeLine'); if(bln!=undefined) { bln.style.top = xy.top+'px'; document.getElementById('onlineframe').style.height = (getClientHeight()-xy.top-37)+'px'; } } } } function lineResize2() { var cf = document.getElementById('onlineframe'); if(cf!=undefined) { var wh = getClientWidth(); var ln = document.getElementById('resizeLine2'); if(ln!=undefined) { var xy = getOffset(cf); ln.style.left = xy.left+'px'; ln.style.height = getClientHeight()-67-document.getElementById('main_frame').clientHeight-1+'px'; ln.style.top = xy.top-4+'px'; var bln = document.getElementById('backresizeLine2'); if(bln!=undefined) { bln.style.height = ln.style.height; bln.style.top = ln.style.top; bln.style.left = ln.style.left; } } } } /* Высота и ширина окна */ function getClientHeight() { return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight; } function getClientWidth() { return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth; } /* Получение координат Элемента */ function getOffsetSum(elem) { var top=0, left=0; while(elem) { top = top + parseFloat(elem.offsetTop); left = left + parseFloat(elem.offsetLeft); elem = elem.offsetParent; } return {top: Math.round(top), left: Math.round(left)} } function getOffsetRect(elem) { var box = elem.getBoundingClientRect(); var body = document.body; var docElem = document.documentElement; var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop; var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft; var clientTop = docElem.clientTop || body.clientTop || 0; var clientLeft = docElem.clientLeft || body.clientLeft || 0; var top = box.top + scrollTop - clientTop; var left = box.left + scrollLeft - clientLeft; return { top: Math.round(top), left: Math.round(left) } } function getOffset(elem) { if(elem.getBoundingClientRect) { return getOffsetRect(elem); }else{ return getOffsetSum(elem); } } /* ================================================================================================================================== */ function goGames() { top.openNewWindow(0,"goGames",'Игральный зал','',1,1); } function gobattle(id) { if(top.frames['main']!=undefined) { if(top.frames['main'].battle!=id) { top.frames['main'].location = top.frames['main'].location; } } } function useInLOck(id,r) { if(id>0) { top.openNewWindow(1,id,'Замок для рюкзака','
Введите пароль:
','top.useInLOck2('+id+','+r+');',1); } } function ertext(ee,txt) { if(ee!=undefined) { ee.innerHTML = txt; } } function addNewSmile(id,r) { if(r==0) { top.openNewWindow(2,id,'Установить личный "смайлик"','Загрузите изображение смайлика:
Короткое имя смайлика:


- Размер не более: 60 x 35 px ("Ширина" х "Высота")
- Файл не должен привышать 15 кб.
- Формат изображения GIF
- Изображение не должно содержать запрещенных надписей / обьектов
- Попытка взлома или загрузка вредоностных файлов карается смертью персонажа

','top.addNewSmile('+id+',1);',1); }else{ } } function newLider(id,login,uid) { if(id==1) { top.openNewWindow(1,"psh2",'Выбрать нового лидера','Выбрать `'+login+'`
новым лидером группы?
','top.newLider(0,'+uid+');',1,1,1); }else{ } } function delMan(id,login,uid) { if(id==1) { top.openNewWindow(1,"psh1",'Выгнать персонажа','Выгнать `'+login+'`?
','top.newLider(0,'+uid+');',1,1,1); }else{ } } function useMagic(name,id,img,type,urlUse) { top.openNewWindow(1,"useMagic",'Использовать магию "'+name+'"','Введите логин персонажа:

(можно щелкнуть по логину в чате)
','top.useMagicGoGo(\''+urlUse+'\');',1,1,1); } function useMagicGoGo(urlUse) { document.getElementById('useMagicLogin').value = document.getElementById('useMagicLogin').value.replace(' ','%',document.getElementById('useMagicLogin').value); top.frames['main'].location = urlUse+'&login='+document.getElementById('useMagicLogin').value; } function useMagicPriem(name,pid,type,adon) { top.openNewWindow(1,"priemMagic",'"'+name+'"','
Введите логин персонажа:

(можно щелкнуть по логину в чате)','top.useMagicNow('+pid+');',1,1,1); } function useMagicNow(id) { top.frames['main'].use_on_pers = document.getElementById('usePriemLogin').value; top.frames['main'].magic_use = id; top.frames['main'].reflesh(); } function smiles() { var x = document.body.clientWidth - 200; var y = document.body.clientHeight - 500; var sFeatures = 'dialogLeft:'+x+'px;dialogTop:'+y+'px;dialogHeight:510px;dialogWidth:400px;help:no;status:no;unadorned:yes'; if (document.all && document.all.item && !window.opera && !document.layers) { window.showModelessDialog("smiles.html", window, sFeatures); } else { window.open("smiles.html", "", "left="+x+",top="+y+",location=no,scrollbars=yes,resizable=yes,width=200,height=500"); } } function useInLOck2(id,r) { top.frames['main'].location = 'main.php?edit=1&otdel='+r+'&addPassInvNew='+top.document.getElementById('inPassLock'+id).value+'&use_sid='+id+''; } function usePaper(id,r) { if(id>0) { top.openNewWindow(1,id,'Использовать предмет','
Введите текст:
','top.addTxtPaper('+id+','+r+');',1); } } function addTxtPaper(id,r) { top.frames['main'].location = 'main.php?edit=1&otdel='+r+'&add_txt='+top.document.getElementById('addTxtPaper'+id).value+'&itmID='+id+''; } var sd4key = ''; function drop(id,img,name,x,date,r,fdfdf) { if(id>0) { top.openNewWindow(1,id,'Выбросить предмет?',date,'top.del('+id+','+r+');',1); } } function useiteminv(id,img,name,x,date,r) { if(id>0) { top.openNewWindow(1,id,'Подтверждение',date,'top.useitminv('+id+','+r+');',1); } } function hlam(id,img,name,x,date,r) { if(id>0) { top.openNewWindow(1,id,'Выбросить хлам?',date,'top.hlamdel('+id+','+r+');',1); } } function hlamdel(id,r) { top.frames['main'].location = 'main.php?edit=1&otdel='+r+'&drop_hlam=1'; } function useitminv(id,r) { top.frames['main'].location = 'main.php?inv=1&otdel='+r+'&use_pid='+id+''; } function btlUseItems(id,img,name,x,date) { if(id>0) { top.openNewWindow(1,id,'Подтверждение','Использовать сейчас?
','top.btlUse('+id+');',1); } } function btlUse(id) { alert('Ошибка использования.'); } function btlclearlog() { top.openNewWindow(1,'778_clear_btl','Подтверждение','Очистить лог боя?
','top.btlclearlogSt();',1); } function priemOnUser(pr,id,nm) { if(id==1) { top.openNewWindow(1,'779_use_priem','Используем "'+nm+'"','
Введите логин противника
(Можно кликнуть на логин в чате)','top.usePriemNow(top.document.getElementById(\'useOnLogin\').value,'+pr+');',2); } } function usePriemNow(lgn,id) { top.frames['main'].use_on_pers = lgn; top.frames['main'].usepriem(id,1); } function btlclearlogSt() { if(top.document.getElementById('chsee2')!=undefined) { top.document.getElementById('chsee2').innerHTML = ''; } if(top.document.getElementById('chsee3')!=undefined) { top.document.getElementById('chsee3').innerHTML = ''; } } function smena1() { top.openNewWindow(1,'778_smena','Смена противника','Введите логин персонажа:


(можно щелкнуть по логину в чате)','top.smena2(top.document.getElementById(\'smenaLogin\').value);',1); toInpLogin = 'smenaLogin'; } function smena2(login) { //var i = 0; //while(i<=65) //{ // login = login.replace(new RegExp(ruD[i],'g'),ruC[ruD[i]]); // i++; //} top.frames['main'].smena_login = login; top.frames['main'].reflesh(); } function del(id,r) { top.frames['main'].location = 'main.php?inv=1&otdel='+r+'&delete='+id+'&sd4='+sd4key+''; } function unstack(id,img,name,x,date,r) { if(id>0) { top.openNewWindow(1,'uns'+id,'Разделить предмет?',date+'
Кол-во:
','top.uns('+id+','+r+');',1); } } function uns(id,r) { top.frames['main'].location = 'main.php?edit=1&otdel='+r+'&unstack='+id+'&x='+top.document.getElementById("unsIMP"+id).value; } function delWin(divId,tsa) { if(document.getElementById(divId)!=undefined) { if(divId=='778_smena') { toInpLogin = ''; } if(tsa==1) { document.getElementById(divId+"_title").className="windowsmf_css1_title_active"; setTimeout('delWin("'+divId+'",2)',50); }else if(tsa==2){ document.getElementById(divId+"_title").className="windowsmf_css1_title_active2"; document.getElementById(divId+"_main").className="windowsmf_css1_main_active2"; document.getElementById(divId).className="windowsmf_css1_active2"; setTimeout('delWin("'+divId+'",3)',50); }else if(tsa==3){ elem = document.getElementById(divId); document.getElementById('windows').removeChild(elem); } } } function AutoSizeIFrame(IFrameId,td) { var c1,c2; c1 = document.getElementById(IFrameId); c2 = document.getElementById(td); c1.style.height = c2.clientHeight+"px"; } function sizeFrameX(fr) { var size = top.document.getElementById(fr).clientWidth; return size; } function sizeFrameY(fr) { var size = top.document.getElementById(fr).clientHeight; return size; } function getchH() { return 'test'} function getchY(d){ return d.self.pageYOffset || (d.document.documentElement && d.document.documentElement.scrollTop) || (d.document.body && d.document.body.scrollTop);} function getchX(d){ return d.self.pageXOffset || (d.document.documentElement && d.document.documentElement.scrollLeft) || (d.document.body && d.document.body.scrollLeft);} var newmsgh = 0; function getBounds(element) { var left = element.offsetLeft; var top = element.offsetTop; for (var parent = element.offsetParent; parent; parent = parent.offsetParent) { left += parent.offsetLeft - parent.scrollLeft; top += parent.offsetTop - parent.scrollTop } return {left: left, top: top, width: element.offsetWidth, height: element.offsetHeight}; } var actmd = 0; function GoGoGoUp() { var element3 = document.getElementById('menuD'); var bounds3 = getBounds(element3); var element4 = document.getElementById('menuimg'); var bounds4 = getBounds(element4); var m = document.getElementById('menuD'); if(actmd-100) { actmd = actmd-5; m.style.top = bounds4.top-actmd+"px"; if(bounds4.top+bounds4.height-bounds4.top-actmd>80) { m.style.display = 'none'; actmd = 0; document.getElementById('menuimg2').style.display = 'none'; document.getElementById('menuimg').style.display = ''; }else{ setTimeout('GoGoGoDown()',11); } } } function openNewWindow(type,id,title,dates,action,x,pos,ttlal) { if(!document.getElementById('windowMF_'+id)) { //создаем if(type==1) { //Форма типа Да \ Нет dates = ''+dates+'

 
'; }else if(type==2) { //Форма типа Отмена dates = ''+dates+'
'; } if(x==1) { ttlals = ''; if(ttlal==1) { ttlals = 'text-align:left;'; } title = '
'+title+'
'; } //document.print('
'); var wind = '
'+title+'
'+dates+'
'; wind = '
'+wind+'
' document.getElementById('windows').innerHTML = document.getElementById('windows').innerHTML + (wind); var nw = document.getElementById('windowMF_'+id); var nwt = document.getElementById('windowMF_'+id+'_title'); serPositionWin("windowMF_"+id,pos); }else{ //обновляем } } function serPositionWin(obj,pos) { obj = document.getElementById(obj); var winX=(window.innerWidth)?window.innerWidth:((document.all)?document.body.offsetWidth:null); var winY=(window.innerHeight)?window.innerHeight:((document.all)?document.body.offsetHeight:null); var objH=obj.offsetHeight; var objW=obj.offsetWidth; if(pos==1) { obj.style.left = 300+"px"; obj.style.top = 150+"px"; }else{ obj.style.left = Math.floor(winX/2-objW/2)+"px"; obj.style.top = Math.floor(winY/2-objH/2)+"px"; } } function drag_object(evt,obj) { if(obj!=undefined) { obj = document.getElementById(obj); } if(obj!=undefined) { evt = evt || window.event; obj.clicked = true; obj.mousePosX = evt.clientX; obj.mousePosY = evt.clientY; document.onmouseup = function(evt) { if(document.getElementById(obj.id+'_title')!=undefined) { obj.clicked = false; obj.style.zIndex = 1000; document.getElementById('glob').style.display = 'none'; document.getElementById(obj.id+'_title').className="windowsmf_css1_title"; } } var winX=(window.innerWidth)?window.innerWidth: ((document.all)?document.body.offsetWidth:null); var winY=(window.innerHeight)?window.innerHeight: ((document.all)?document.body.offsetHeight:null); if(obj.clicked==true && obj!=undefined) { document.getElementById('glob').style.display = ''; document.onmousemove = function(evt) { evt = evt || window.event; if(obj.clicked==true) { document.getElementById(obj.id+'_title').className="windowsmf_css1_title_active"; posLeft = !obj.style.left ? obj.offsetLeft : parseInt( obj.style.left ); posTop = !obj.style.top ? obj.offsetTop : parseInt( obj.style.top ); mousePosX = evt.clientX; mousePosY = evt.clientY; if(posLeft + mousePosX - obj.mousePosX>5 && obj.offsetWidth + posLeft + mousePosX - obj.mousePosX5 && obj.offsetHeight + posTop + mousePosY - obj.mousePosYhpmax) { hpnow = hpmax; } h1.innerHTML = ' '+Math.floor(hpnow)+'/'+hpmax+''; if(Math.floor(hpnow/hpmax*120)<1) { h2.className = 'hp_none'; } if(Math.floor(hpnow/hpmax*120)>0) { h2.className = 'hp_1'; } if(Math.floor(hpnow/hpmax*120)>32) { h2.className = 'hp_2'; } if(Math.floor(hpnow/hpmax*120)>65) { h2.className = 'hp_3'; } if(Math.floor(hpnow/hpmax*120)<=120) { h2.style.width = Math.floor(hpnow/hpmax*120)+'px'; } } } } //мана var m1 = d.getElementById('vmp'+id); if(m1!=undefined) { var m2 = d.getElementById('lmp'+id); if(m2!=undefined) { //Восстанавливаем MP var newMP = ''; newMP = sec_m*speed_mp; if(newMP!=0) { mpnow += newMP; if(mpnow<0) { mpnow = 0; } if(mpnow>mpmax) { mpnow = mpmax; } m1.innerHTML = ' '+Math.floor(mpnow)+'/'+mpmax+''; if(Math.floor(mpnow/mpmax*120)<1) { m2.className = 'hp_none'; }else{ m2.className = 'hp_mp'; } if(Math.floor(mpnow/mpmax*120)<=120) { m2.style.width = Math.floor(mpnow/mpmax*120)+'px'; } } } } lafstReg[id] = 0+lafstReg[id]+1; var tt1 = setTimeout('top.startHpRegen("'+f+'",'+id+','+hpnow+','+hpmax+','+mpnow+','+mpmax+',1,1,'+speed_hp+','+speed_mp+',0,'+timerHP+');',1000); } if(lafstReg[id]==0 || lafstReg[id]==undefined) { lafstReg[id] = 0+lafstReg[id]+1; var tt1 = setTimeout('top.startHpRegen("'+f+'",'+id+','+hpnow+','+hpmax+','+mpnow+','+mpmax+',1,1,'+speed_hp+','+speed_mp+',0,'+timerHP+');',1000); } } } function filterChat() { if(top.document.F1.fi!=undefined) { if(top.document.F1.fi.value==0) { top.document.F1.fi.value = 1; }else{ top.document.F1.fi.value = 0; } } } function test(event) { if (!event) { event = window.event; } } function nameRoom(nm) { top.document.getElementById('roomName').innerHTML = ''+nm+''; lastRoom = nm; } var lastData = ''; var lastRoom = ''; var alignName = new Array(); alignName[0] = ''; alignName[1] = 'Свет'; alignName[2] = 'Хаос'; alignName[3] = 'Тьма'; alignName[7] = 'Нейтрал'; alignName[50] = 'Алхимик'; alignName[100] = 'Ангел'; function alignNames(nm) { var an = ''; if(nm>1 && nm<2) { an = 'Паладин'; }else if(nm>3 && nm<4) { an = 'Тарман'; }else{ an = alignName[nm]; } if(an == undefined) { an = ''; } return an; } function refleshOnline(data) { lastData = data; top.document.getElementById('onlineReflesh').innerHTML = ''; var d = data.split('|'); var i = 0; var j = 0; var k = 0; var r = ''; var s = 0; while(i!=-1) { if(d[i]!=undefined) { if(j==0) { s = k*14; if(d[s+1]!=undefined) { var prmb = ''; var pcl = ''; if(d[s+4]>0) { pcl = ''; } if(top.level>0) { var btlmb = ''; if(d[s+7]>0) { btlmb = '1'; } prmb = ''; } var efs = ''; if(d[s+5]>0) { efs += ' '; } if(d[s+9]!=0) { pcl += ' afk '; }else if(d[s+10]!=0) { pcl += ' dnd '; } r += ''+prmb+''+pcl+''+d[s+1]+'['+d[s+2]+']'+efs+'
'; } j++; }else if(j<12) { j++; }else{ j = 0; k++; } }else{ i = -2; } i++; } top.document.getElementById('onlineReflesh').innerHTML = ''+r+''; } function hint(txt,e,f) { var d = top.document.getElementById('persinfo'); if(d!=undefined) { var s = d.style; s.display = ''; } } function c() { var d = top.document.getElementById('persinfo'); if(d!=undefined) { var s = d.style; s.display = 'none'; d.innerHTML = ''; } } function mousePageXY(e) { var x = 0, y = 0; if (e.pageX || e.pageY) { x = e.pageX; y = e.pageY; } else if (e.clientX || e.clientY) { x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft; y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop; } return {"x":x, "y":y}; } var doTest; function MBcMenu() { T_cm = setTimeout("if(doTest){ top.infoMenuClose(1); clearTimeout(T_cm);}", 100); } function infoMenu(u,e,f) { if (!e) e = window.event; var d = top.document.getElementById('persmenu'); var d2 = top.document.getElementById('glob'); if(d!=undefined) { var dptop = -5; var dpleft = -5; var dp = top; var s = d.style; d2.style.display = ''; d.className = 'topusermenu'; s.display = ''; var obtop = mousePageXY(e)['y']+dptop; if(getNameBrouser()=='msie') { obtop -= dp.document.body.scrollTop; }else{ obtop -= dp.document.documentElement.scrollTop+dp.document.body.scrollTop; } var obleft = mousePageXY(e)['x']+dpleft; d.style.top = obtop+'px'; d.style.left = obleft+'px'; d.innerHTML = '
' +'
TO
' +'
PRIVATE
' +'
INFO
' +'
COPY
' +'
'; var bdx = document.body.clientWidth; var bdy = document.body.clientHeight; var obx = d.clientWidth; var oby = d.clientHeight; var ots = bdy-obtop-oby; var ols = bdx-obleft-obx; if(ots<10) { obtop = bdy-10-oby; d.style.top = obtop+'px'; } if(ols<10) { obleft = bdx-10-obx; d.style.left = obleft+'px'; } } } function infoMenuClose(id) { var d = top.document.getElementById('persmenu'); var d2 = top.document.getElementById('glob'); if(d!=undefined) { if(id>0 && id<5) { d.className = 'topusermenu inviseMen'+id; T_mn = setTimeout('top.infoMenuClose('+(id+1)+')',30); }else if(id==5) { var s = d.style; s.display = 'none'; d2.style.display = 'none'; d.innerHTML = ''; d.className = ''; clearTimeout(T_mn); } } } function speedChat() { if(newTimeReflesh==20) { newTimeReflesh = 60; chatReflesh = 60 }else if(newTimeReflesh==60) { newTimeReflesh = -1; chatReflesh = -1; }else if(newTimeReflesh==-1) { newTimeReflesh = 20; chatReflesh = 20; } } function refleshChat() { if(top!=undefined) { if(chatReflesh<1) { if(newTimeReflesh>0 && typeof top.window['autoAllChat'] == 'function') { top.autoAllChat(); chatReflesh = newTimeReflesh; } } chatReflesh--; } setTimeout('refleshChat()',1000); } function sendMsg() { if(top.document.getElementById('chBtn2').className=='chatBtn2_1') { top.document.getElementById('chBtn2').className = 'chatBtn2_2'; top.document.getElementById('sbm').click(); } } function seeGoodMsg(id) { top.lastMessage = id; var mv = top.document.getElementById('mval'); if(mv!=undefined) { mv.value = id; } } function getFrW(fr) { return fr.document.compatMode=='CSS1Compat' && !fr.window.opera?fr.document.documentElement.clientWidth:fr.document.body.clientWidth; } function getFrH(fr) { return fr.document.compatMode=='CSS1Compat' && !fr.window.opera?fr.document.documentElement.clientHeight:fr.document.body.clientHeight; } function getFrScH(fr) { return fr.self.pageYOffset || (fr.document.documentElement && fr.document.documentElement.scrollTop) || (fr.document.body && fr.document.body.scrollTop); } function getFrScW(fr) { return fr.self.pageXOffset || (fr.document.documentElement && fr.document.documentElement.scrollLeft) || (fr.document.body && fr.document.body.scrollLeft); } function getDcH(fr) { return (fr.document.body.scrollHeight > fr.document.body.offsetHeight)?fr.document.body.scrollHeight:fr.document.body.offsetHeight; } function getDcW(fr) { return (fr.document.body.scrollWidth > fr.document.body.offsetWidth)?fr.document.body.scrollWidth:fr.document.body.offsetWidth; } var cc = 0; var newMsgs = 0; var lastHw = 0; var fst = 1; var pixScroll = 1000; function SmartScroll(cc) { startScrollChat('chat',pixScroll); } function startScrollChat(id,w) { sCht = top.document.getElementById(id); sCh = top.document.getElementById('chat_see'); if(sCht!=undefined && nowraz!=3 && nowraz!=4 && nowraz!=5) { maxttt = sCh.offsetHeight-(sCht.scrollTop+sCht.offsetHeight); if(maxttt<150) { sCht.scrollTop += 1; w -= 1; if(sCh.offsetHeight>sCht.scrollTop+sCht.offsetHeight) { setTimeout('startScrollChat("'+id+'",'+(0+w)+')',10); } }else if(fst==1) { fst = 0; sCht.scrollTop = sCh.offsetHeight; } } } var map_en = new Array('s`h','S`h','S`H','s`Х','sh`','Sh`','SH`',"'o",'yo',"'O",'Yo','YO','zh','w','Zh','ZH','W','ch','Ch','CH','sh','Sh','SH','e`','E`',"'u",'yu',"'U",'Yu',"YU","'a",'ya',"'A",'Ya','YA','a','A','b','B','v','V','g','G','d','D','e','E','z','Z','i','I','j','J','k','K','l','L','m','M','n','N','o','O','p','P','r','R','s','S','t','T','u','U','f','F','h','H','c','C','`','y','Y',"'") var map_ru = new Array('сх','Сх','СХ','сХ','щ','Щ','Щ','ё','ё','Ё','Ё','Ё','ж','ж','Ж','Ж','Ж','ч','Ч','Ч','ш','Ш','Ш','э','Э','ю','ю','Ю','Ю','Ю','я','я','Я','Я','Я','а','А','б','Б','в','В','г','Г','д','Д','е','Е','з','З','и','И','й','Й','к','К','л','Л','м','М','н','Н','о','О','п','П','р','Р','с','С','т','Т','у','У','ф','Ф','х','Х','ц','Ц','ъ','ы','Ы','ь') function addSm(i) { top.getFocus('','text'); top.document.F1.text.value += ' :'+i+': '; } function convert(str) { var p1 = new RegExp("private\\s*\\[(.*?)\\]",""); var t1 = new RegExp("to\\s*\\[(.*?)\\]",""); var newstr = ''; if(str.match(p1)!=null) { newstr = str.match(p1)[0]; str = str.replace(str.match(p1)[0],''); }else if(str.match(t1)!=null) { newstr = str.match(t1)[0]; str = str.replace(str.match(t1)[0],''); } for(var i=0;i=0) str = str.replace(map_en[i],map_ru[i]); newstr += str; return newstr; } function getNameBrouser() { var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf("msie") != -1 && ua.indexOf("opera") == -1 && ua.indexOf("webtv") == -1) { return "msie" } if (ua.indexOf("opera") != -1) { return "opera" } if (ua.indexOf("gecko") != -1) { return "gecko"; } if (ua.indexOf("safari") != -1) { return "safari"; } if (ua.indexOf("konqueror") != -1) { return "konqueror"; } return "unknown"; } function chatBtnClick(id,clss,maxch,act,ttl) { if(chatBtnsDate[id]==undefined) { chatBtnsDate[id] = 1; } chatBtnsDate[id]++; if(chatBtnsDate[id]>maxch) { chatBtnsDate[id] = 1; } var btn = top.document.getElementById(id); if(btn!=undefined) { if(ttl!=null) { btn.title = ttl[chatBtnsDate[id]]; } btn.className = clss+chatBtnsDate[id]; if(act!='') { eval(act); } } } /* ============================================================[ frames.js ] ============================= */ function goReSizeIframe() { } var lastMsgIds = 0; function addMessage(id,time,to,from,type,ch,text,s,color) { if(id>0 || id==-1) { if(top.document.getElementById('chat')!=undefined) { lastMsgIds = id; var chat = top.document.getElementById('chsee'+ch); if(chat!=undefined && (top.document.getElementById('message'+id)==undefined || id==-1)) { var forYou = 0,fromType = 'to',ftps = '',ftpsTo = '',ftpsToUt = '',timeClass = 'date'; text = ''+text+''; if(from!='') { if(type==3 && to!='') { fromType = 'private'; } ftps += '['+from+']'; } blnd = ''; if(to!='') { if(from.toLowerCase()==top.login.toLowerCase() && type==3) { forYou++; } var arr = to.split(','); var i = 0,arrLogin = ''; var newto = ''; while(i!=-1) { if(arr[i]!=undefined) { newto += trim(arr[i]); if(arr[i+1]!=undefined) { newto += ', '; } if(arr[i]!='' && trim(arr[i].toLowerCase())==top.login.toLowerCase()) { forYou = 1; blnd = 'font-weight:bold;'; } }else{ i = -2; to = newto; } i++; } if(type==1) { ftpsTo = '['+to+']'; ftpsTo = ' to '+ftpsTo+''; }else if(type==3) { ftpsToU = ''; ftpsToUt = ''; var arr = to.split(','); var i = 0,arrLogin = ''; while(i!=-1) { if(arr[i]!=undefined) { if(arr[i]!='') { arr[i] = trim(arr[i]); if(arr[i].toLowerCase()==top.login.toLowerCase()) { arrLogin = from; }else{ arrLogin = arr[i]; } ftpsToU += ''+arr[i]+''; ftpsToUt += arrLogin; if(arr[i+1]!='' && arr[i+1]!=undefined) { ftpsToU += ', '; ftpsToUt += ','; } } }else{ i = -2; } i++; } ftpsTo = ' private [ '+ftpsToU+' ]'; } ftps += ftpsTo; } if(type==10 || type==11 || type==12) { var zmlogin = new RegExp("\\[login:(.*?)\\]",""); var reflcd = new RegExp("\\[reflesh_main_zv_priem:(.*?)\\]",""); if(text.match(zmlogin)!=null) { zmlogin = text.match(zmlogin)[1]; text = text.replace('[login:'+zmlogin+']',''+zmlogin+''); } if(text.match(reflcd)!=null) { reflcd = text.match(reflcd)[1]; text = text.replace('[reflesh_main_zv_priem:'+reflcd+']',''); if(top.frames['main'].zv_Priem!=undefined && top.frames['main'].zv_Priem != reflcd && reflcd>0) { top.frames['main'].location = top.frames['main'].location; } } } if(s==1 || forYou==1) { timeClass = 'date2'; } if(type==12) { timeClass = 'date1'; } if(type==21) { ftps = ''+from+''; var mblogin = new RegExp("\\[login:(.*?)\\]",""); text = text.replace('[loginfrom]',ftps); if(text.match(mblogin)!=null) { mblogin = text.match(mblogin)[1]; text = text.replace('[login:'+mblogin+']',''+mblogin+''); } text = ''+text+''; } if(forYou==1 && from.toUpperCase()!=top.login.toUpperCase() && top.snd>0) { top.window.document.Sound.SetVariable("Sndplay",1); } if(type==10) { ftps += 'Внимание!'; } chat.innerHTML += ''+time+' '+ftps+' '+text+'
'; } } } } function playSound(id,ddd) { if(!ddd) { ddd = 1; } if(top.snd>ddd) { top.window.document.Sound.SetVariable("Sndplay",id); } } function changeni(nm) { } function addToMany(users,tp) { var arr = users.split(','); var i = arr.length; while(i>=0) { if(arr[i]!=undefined) { top.addTo(arr[i],tp); } i--; } } function trim(s) { return rtrim(ltrim(s)); } function ltrim(s) { return s.replace(/^\s+/, ''); } function rtrim(s) { return s.replace(/\s+$/, ''); } function addTo(login,type2) { var loginaddT = login; top.window.document.getElementById('text').focus(); var s=top.document.getElementById('text').value; var reg555 = new RegExp("private\\s*\\[(.*?)\\]",""); var reg551 = new RegExp("to\\s*\\[(.*?)\\]",""); var test1 = s.match(reg555); if(s.match(reg555)==null) { type = "to"; }else if(s.match(reg551)==null) { type = "private"; } var type3 = 'to'; var reg2 = new RegExp(""+type+"(\\s*)\\[(.*?)\\]",""); var cs = s.replace(reg2,""+type+"$1[,$2,]"); var slogin = login.replace(/([\^.*{}$%?\[\]+|\/\(\)])/g,"\\$1"); var reg = new RegExp(""+type+"\\s*\\[.*,\\s*"+slogin+"\\s*,.*\\]",""); var result = ''; var reg3 = new RegExp(""+type+"\\s*\\[(.*?)\\]",""); while (res = s.match(reg3)) { result += res[1]+','; s = s.replace(reg3,''); } result = result.replace(/,$/,''); var prar = result.split(','); for (i=0;i2 && battle!=1) { smenabtn = 1; document.getElementById('chsee2').innerHTML = ''; document.getElementById('chsee3').innerHTML = ''; }else{ smenabtn = 0; } document.getElementById('usbtn3').style.display = 'none'; document.getElementById('usbtn4').style.display = 'none'; document.getElementById('usbtn5').style.display = 'none'; battle = 0; }else{ if(mbbtl!=0){ if(nowraz!=3 && battle==0) { smenabtn = 2; if(top.window.document.Sound!=undefined) { //top.phpaySound(2,0); } }else{ smenabtn = 0; } document.getElementById('usbtn3').style.display = ''; document.getElementById('usbtn4').style.display = ''; document.getElementById('usbtn5').style.display = ''; battle = mbbtl; if(battle_log!=0 && battle_log!=battle) { document.getElementById('chsee2').innerHYML = ''; document.getElementById('chsee3').innerHYML = ''; battle_log = battle; } } } }else if(document.getElementById('usbtn5').style.display==''){ if(nowraz>2 && battle!=1) { smenabtn = 1; document.getElementById('chsee2').innerHTML = ''; document.getElementById('chsee3').innerHTML = ''; }else{ smenabtn = 0; } document.getElementById('usbtn3').style.display = 'none'; document.getElementById('usbtn4').style.display = 'none'; document.getElementById('usbtn5').style.display = 'none'; battle = 0; } if(id==0) { var timergo = setTimeout("seeBtns(0);", 1000); } if(smenabtn!=0) { if(smenabtn==1) { //pressBtn(1); }else{ pressBtn(3); } } if(battle==0) { document.getElementById('chsee2').innerHTML = ''; document.getElementById('chsee3').innerHTML = ''; } if(battle==0 && battle_now!=0) { if(nowraz==1){ } pressBtn(1); blueText(1); } battle_now = battle; }else{ if(id==0) { var timergo = setTimeout("seeBtns(0);", 1000); } } } function usb(id,id2,tk) { if(document.getElementById(id+'db'+id2)) { document.getElementById(id+'db'+id2).className = tk; } } function allOff(id) { usb('l',1,'zbtn1l'); usb('c',1,'zbtn1c'); usb('r',1,'zbtn1r2'); usb('c',2,'zbtn1c'); if(battle==0) { usb('r',2,'zbtn1r'); }else{ usb('r',2,'zbtn1r2'); usb('r',3,'zbtn1r2'); usb('c',3,'zbtn1c'); usb('r',4,'zbtn1r2'); usb('c',4,'zbtn1c'); usb('r',5,'zbtn1r'); usb('c',5,'zbtn1c'); } } function seeChat(id) { i = 0; while(i<=4) { if(document.getElementById('chsee'+i)) { document.getElementById('chsee'+i).style.display = 'none'; } i++; } if(id==1) { if(document.getElementById('chsee0')) { document.getElementById('chsee0').style.display = ''; chat_id = 0; } }else{ if(document.getElementById('chsee'+(id-1))) { document.getElementById('chsee'+(id-1)).style.display = ''; chat_id = id-1; } } } function pressBtn(id) { if(nowraz!=id) { nowraz = id; seeBtns(1); allOff(id); seeChat(id); if(id==1) { usb('l',1,'zbtn2l'); usb('c',1,'zbtn2c'); usb('r',1,'zbtn2r2'); top.document.getElementById('chat').scrollTop = 100000000; }else if(id==2) { usb('r',1,'zbtn2r3'); usb('c',2,'zbtn2c'); if(battle==0) { usb('r',2,'zbtn2r'); }else{ usb('r',2,'zbtn2r2'); } top.document.getElementById('chat').scrollTop = 100000000; }else if(battle!=0) { if(id==3) { usb('r',2,'zbtn2r3'); usb('c',3,'zbtn2c'); usb('r',3,'zbtn2r2'); top.document.getElementById('chat').scrollTop = -100000000; }else if(id==4) { usb('r',3,'zbtn2r3'); usb('c',4,'zbtn2c'); usb('r',4,'zbtn2r2'); top.document.getElementById('chat').scrollTop = -100000000; }else if(id==5) { usb('r',4,'zbtn2r3'); usb('c',5,'zbtn2c'); usb('r',5,'zbtn2r'); } } } } function blueText(id) { if(nowraz!=1) { document.getElementById('blueTextmb').style.color = 'blue'; }else{ if(id==1) { if(nowraz==1) { document.getElementById('blueTextmb').style.color = ''; } } } } /* ==========[ Уникальные функции ] =============================================================================================================================================== */ //Перетаскивание логина var mlto; var mlto_Login; var mlto_Act; var fps = 0; var nowLoginMove = 0; var sX = null; var sY = null; function loginGo(lgn,event) { mlto_Login = lgn; mlto = top.document; if(!event) { event = window.event; } var obj = document.getElementById('dragLogin'); obj.innerHTML = '[0]           '+mlto_Login+''; loginGoMove(event); } function loginGoMove(event) { if (!event) { event = window.event; } var obj = document.getElementById('dragLogin'); if(nowLoginMove==0) { Event.add(mlto, 'mousemove', loginGoMoveTest); Event.add(mlto, 'mouseup', loginGoEnd); nowLoginMove = 1; } var x,y; x = event.clientX; y = event.clientY; if(sX==null) { sX = x; } if(sY==null) { sY = y; } if(x>sX+20 || y>sY+20 || x