initial commit

This commit is contained in:
lopar
2018-01-28 18:40:49 +02:00
commit 46c75d1542
8193 changed files with 183296 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
(function(){function m(){var b={id:341269,t:50,j:true,js:13,rand:Math.random(),r:escape(f.referrer)},a;if(a=screen){b.s=[a.width,a.height].join("*");b.d=a.colorDepth||a.pixelDepth}a=[];for(var c in b)a.push(c+"="+b[c]);c=f.createElement("div");var e=f.createElement("a");e.setAttribute("target","_blank");e.setAttribute("href","http://top.mail.ru/jump?from="+b.id);b=f.createElement("img");b.setAttribute("src","http://top.list.ru/counter?"+a.join(";"));b.setAttribute("title","Рейтинг@Mail.ru");b.setAttribute("border",0);b.setAttribute("height",31);b.setAttribute("width",88);e.appendChild(b);c.appendChild(e);return c}function n(b){b=b+108E5;var a=new Date(b),c=a.getUTCMonth();if(c>2&&c<9)return b+36E5;if(c<2||c>9)return b;var e=a.getUTCDate();c=c===2;if(e<=24)return c?b:b+36E5;var d=a.getUTCDay();if(d===0)return a.getUTCHours()>=2?c?b+36E5:b:c?b:b+36E5;return e-d<=24?c?b:b+36E5:c?b+36E5:b}function o(b){b=new Date(b);var a=b.getUTCMonth()+1;if(a<10)a="0"+a;var c=b.getUTCDate();if(c<10)c="0"+c;var e=b.getUTCHours();if(e<10)e="0"+e;var d=b.getUTCMinutes();if(d<10)d="0"+d;return b.getUTCFullYear()+"."+a+"."+c+" "+e+":"+d}function p(b){var a=q.ru,c=f.createElement("div"),e,d;(e=c.style).display="inline-block";e.whiteSpace="pre";if(e=b.align){var h;d=f.createElement("a");d.target="_blank";d.href="http://capitalcity.combats.com/encicl/"+((h=parseInt(e))===50?"alchemist":"alignment")+".html";if(a=parseFloat(e)===7?a["7="]:a[h])d.title=a;a=f.createElement("img");a.src="http://img.combats.ru/i/align"+e+".gif";a.width=12;a.height=15;a.border=0;d.appendChild(a);c.appendChild(d)}if(b.hasOwnProperty("clan")){e=b.clan;d=f.createElement("a");d.target="_blank";d.href="/clans_inf.pl?"+e;d.title="Информация о клане "+e;a=f.createElement("img");a.src="http://img.combats.ru/i/klan/"+e+".gif";a.width=24;a.height=15;a.border=0;d.appendChild(a);c.appendChild(d)}d=f.createElement("b");d.appendChild(f.createTextNode(e=b.login));c.appendChild(d);c.appendChild(f.createTextNode(" ["+b.level+"]"));d=f.createElement("a");d.target="_blank";d.href="/inf.pl?"+b.id;d.title="Информация о "+e;a=f.createElement("img");a.src="http://img.combats.ru/i/inf.gif";a.width=12;a.height=11;a.border=0;d.appendChild(a);c.appendChild(d);return c}function r(b,a,c){a=a;i||(i=j());g||(g=new i);switch(b){case "get":case "GET":if(c!=undefined)a+=c;g.open("GET",a,false);g.send();break;case "post":case "POST":g.open("POST",a,false);g.send(c);break}if((b=g.status)!==200)return parseInt(b,10);else{var e;try{var d=g.responseText;e=d.substring(0,2)==="//"?k(d.substring(2)):d=="undefined"?void 0:k(d)}catch(h){e=500}return e}}var f=document,l=window,q={ru:{"1":"Белое братство","2":"Хаос","3":"Темное братство","7=":"Нейтральное братство","7":"Орден Очищения Стихий","50":"Алхимики"}},k=typeof JSON==="object"&&JSON.parse?JSON.parse:function(b){return eval("("+b+")")},i,g,j=function(){j=undefined;var b;if(b=l.XMLHttpRequest)return b;if(b=l.ActiveXObject){var a;try{a=new b("MSxml2.XMLHTTP.6.0")}catch(c){}if(a){a=null;return function(){return new b("MSxml2.XMLHTTP.6.0")}}try{a=new b("MSxml2.XMLHTTP.3.0")}catch(e){}if(a){a=null;return function(){return new b("MSxml2.XMLHTTP.3.0")}}try{a=new b("MSxml2.XMLHTTP")}catch(d){}if(a){a=null;return function(){return new b("MSxml2.XMLHTTP")}}try{a=new b("Microsoft.XMLHTTP")}catch(h){}if(a){a=null;return function(){return new b("Microsoft.XMLHTTP")}}}};(function(b){var a=b.CombatsUI;a||(b.CombatsUI=a={});a.CounterMailRu=m;a.UTCMsec2Moscow=n;a.UTCMsec2PlainText=o;a.UserLink=p;a.SyncJSON=r;this.DLoad&&(new this.DLoad.pkg("CombatsUI")).use("LocalText").complete()})(this)})()
+1
View File
@@ -0,0 +1 @@
(function(){function n(b,a,e){e||(e=r);var d={};b=[b];for(var f,j={},h;h=b.length;){f=s;for(var c=0;c<h;c++){var g=b[c];if(!(!g||j[g])){var i=e[g];if(i)f=f.concat(i);if(i=a[g])for(var k in i)!i.hasOwnProperty(k)||d.hasOwnProperty(k)||(d[k]=i[k]);j[g]=true}}b=f}return d}function o(b,a){if(b=="ru"){a=t(a)%100;return a%10===1&&a%100!==11?1:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?2:0}else return b=="en"?a==1||a==-1?1:0:0}function u(b,a,e){var d=a[e+"G"];if(d)return d;a=a[e];if(b=="ru")if(v.test(a))return"F";else if(w.test(a))return"P";return"M"}function x(b,a,e,d){var f,j=e&&e;f=p[b]||(p[b]=n(b,y));if(a<=0)return"0 "+(d&&f["second0"+d]||f.second0);var h,c;l.length=0;for(var g=z;g-=2;){c=m[g];if(a>=c){if(c===1)h=a;else a-=(h=A(a/c))*c;c=m[g+1]+o(b,h);l.push(h+" "+(d&&f[c+d]||f[c]));if(e&&!--j)break}}return l.join(" ")}function q(b){var a=b.LocalText;a||(b.LocalText=a={});a.Inherit=n;a.PluralForm=o;a.Gender=u;a.PeriodToText=x;a.ExportTo=q}var r={ja:["en","zh"],en:["ru"]},s=[],l=[],t=Math.abs,A=Math.floor,v=/[ая]$/i,w=/[иы]$/i,y={ru:{year0:"лет",year1:"год",year2:"года",month0:"месяцев",month1:"месяц",month2:"месяца",week0:"недель",week1:"неделя",week1ACC:"неделю",week2:"недели",day0:"дней",day1:"день",day2:"дня",hour0:"часов",hour1:"час",hour2:"часа",minute0:"минут",minute1:"минута",minute1ACC:"минуту",minute2:"минуты",second0:"секунд",second1:"секунда",second1ACC:"секунду",second2:"секунды"},en:{year0:"years",year1:"year",month0:"months",month1:"month",week0:"weeks",week1:"week",day0:"days",day1:"day",hour0:"hours",hour1:"hour",minute0:"minutes",minute1:"minute",second0:"seconds",second1:"second"}},m=[0,0,1,"second",60,"minute",3600,"hour",86400,"day",604800,"week",2592E3,"month",31536E3,"year"],z=m.length,p={};q(this);typeof DLoad==="object"&&(new DLoad.pkg("LocalText")).complete()})()
+312
View File
@@ -0,0 +1,312 @@
// Simple Set Clipboard System
// Author: Joseph Huckaby
var ZeroClipboard = {
version: "1.0.6",
clients: {}, // registered upload clients on page, indexed by id
moviePath: 'i/popup/ZeroClipboard.swf', // URL to movie
nextId: 1, // ID of next movie
$: function(thingy) {
// simple DOM lookup utility function
if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
if (!thingy.addClass) {
// extend element with a few useful methods
thingy.hide = function() { this.style.display = 'none'; };
thingy.show = function() { this.style.display = ''; };
thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
thingy.removeClass = function(name) {
var classes = this.className.split(/\s+/);
var idx = -1;
for (var k = 0; k < classes.length; k++) {
if (classes[k] == name) { idx = k; k = classes.length; }
}
if (idx > -1) {
classes.splice( idx, 1 );
this.className = classes.join(' ');
}
return this;
};
thingy.hasClass = function(name) {
return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
};
}
return thingy;
},
setMoviePath: function(path) {
// set path to ZeroClipboard.swf
this.moviePath = path;
},
dispatch: function(id, eventName, args) {
// receive event from flash movie, send to client
var client = this.clients[id];
if (client) {
client.receiveEvent(eventName, args);
}
},
register: function(id, client) {
// register new client to receive events
this.clients[id] = client;
},
getDOMObjectPosition: function(obj, stopObj) {
// get absolute coordinates for dom element
var info = {
left: 0,
top: 0,
width: obj.width ? obj.width : obj.offsetWidth,
height: obj.height ? obj.height : obj.offsetHeight
};
while (obj && (obj != stopObj)) {
info.left += obj.offsetLeft;
info.top += obj.offsetTop;
obj = obj.offsetParent;
}
return info;
},
Client: function(elem) {
// constructor for new simple upload client
this.handlers = {};
// unique ID
this.id = ZeroClipboard.nextId++;
this.movieId = 'ZeroClipboardMovie_' + this.id;
// register client with singleton to receive flash events
ZeroClipboard.register(this.id, this);
// create movie
if (elem) this.glue(elem);
}
};
ZeroClipboard.Client.prototype = {
id: 0, // unique ID for us
ready: false, // whether movie is ready to receive events or not
movie: null, // reference to movie object
clipText: '', // text to copy to clipboard
handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
cssEffects: true, // enable CSS mouse effects on dom container
handlers: null, // user event handlers
glue: function(elem, appendElem, stylesToAdd) {
// glue to DOM element
// elem can be ID or actual DOM element object
this.domElement = ZeroClipboard.$(elem);
// float just above object, or zIndex 99 if dom element isn't set
var zIndex = 99;
if (this.domElement.style.zIndex) {
zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
}
if (typeof(appendElem) == 'string') {
appendElem = ZeroClipboard.$(appendElem);
}
else if (typeof(appendElem) == 'undefined') {
appendElem = document.getElementsByTagName('body')[0];
}
// find X/Y position of domElement
var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem);
// create floating DIV above element
this.div = document.createElement('div');
var style = this.div.style;
style.position = 'absolute';
style.left = '' + box.left + 'px';
style.top = '' + box.top + 'px';
style.width = '' + box.width + 'px';
style.height = '' + box.height + 'px';
style.zIndex = zIndex;
if (typeof(stylesToAdd) == 'object') {
for (addedStyle in stylesToAdd) {
style[addedStyle] = stylesToAdd[addedStyle];
}
}
// style.backgroundColor = '#f00'; // debug
appendElem.appendChild(this.div);
this.div.innerHTML = this.getHTML( box.width, box.height );
},
getHTML: function(width, height) {
// return HTML for movie
var html = '';
var flashvars = 'id=' + this.id +
'&width=' + width +
'&height=' + height;
if (navigator.userAgent.match(/MSIE/)) {
// IE gets an OBJECT tag
var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
}
else {
// all other browsers get an EMBED tag
html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
}
return html;
},
hide: function() {
// temporarily hide floater offscreen
if (this.div) {
this.div.style.left = '-100px';
this.div.style.top = '-20px';
}
},
show: function() {
// show ourselves after a call to hide()
this.reposition();
},
destroy: function() {
// destroy control and floater
if (this.domElement && this.div) {
this.hide();
this.div.innerHTML = '';
var body = document.getElementsByTagName('body')[0];
try { body.removeChild( this.div ); } catch(e) {;}
this.domElement = null;
this.div = null;
}
},
reposition: function(elem) {
// reposition our floating div, optionally to new container
// warning: container CANNOT change size, only position
if (elem) {
this.domElement = ZeroClipboard.$(elem);
if (!this.domElement) this.hide();
}
if (this.domElement && this.div) {
var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
var style = this.div.style;
style.left = '' + box.left + 'px';
style.top = '' + box.top + 'px';
}
},
setText: function(newText) {
// set text to be copied to clipboard
this.clipText = newText;
if (this.ready) this.movie.setText(newText);
},
addEventListener: function(eventName, func) {
// add user event listener for event
// event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel
eventName = eventName.toString().toLowerCase().replace(/^on/, '');
if (!this.handlers[eventName]) this.handlers[eventName] = [];
this.handlers[eventName].push(func);
},
setHandCursor: function(enabled) {
// enable hand cursor (true), or default arrow cursor (false)
this.handCursorEnabled = enabled;
if (this.ready) this.movie.setHandCursor(enabled);
},
setCSSEffects: function(enabled) {
// enable or disable CSS effects on DOM container
this.cssEffects = !!enabled;
},
receiveEvent: function(eventName, args) {
// receive event from flash
eventName = eventName.toString().toLowerCase().replace(/^on/, '');
// special behavior for certain events
switch (eventName) {
case 'load':
// movie claims it is ready, but in IE this isn't always the case...
// bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function
this.movie = document.getElementById(this.movieId);
if (!this.movie) {
var self = this;
setTimeout( function() { self.receiveEvent('load', null); }, 1 );
return;
}
// firefox on pc needs a "kick" in order to set these in certain cases
if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
var self = this;
setTimeout( function() { self.receiveEvent('load', null); }, 100 );
this.ready = true;
return;
}
this.ready = true;
this.movie.setText( this.clipText );
this.movie.setHandCursor( this.handCursorEnabled );
break;
case 'mouseover':
if (this.domElement && this.cssEffects) {
this.domElement.addClass('hover');
if (this.recoverActive) this.domElement.addClass('active');
}
break;
case 'mouseout':
if (this.domElement && this.cssEffects) {
this.recoverActive = false;
if (this.domElement.hasClass('active')) {
this.domElement.removeClass('active');
this.recoverActive = true;
}
this.domElement.removeClass('hover');
}
break;
case 'mousedown':
if (this.domElement && this.cssEffects) {
this.domElement.addClass('active');
}
break;
case 'mouseup':
if (this.domElement && this.cssEffects) {
this.domElement.removeClass('active');
this.recoverActive = false;
}
break;
} // switch eventName
if (this.handlers[eventName]) {
for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
var func = this.handlers[eventName][idx];
if (typeof(func) == 'function') {
// actual function reference
func(this, args);
}
else if ((typeof(func) == 'object') && (func.length == 2)) {
// PHP style object + method, i.e. [myObject, 'myMethod']
func[0][ func[1] ](this, args);
}
else if (typeof(func) == 'string') {
// name of function
window[func](this, args);
}
} // foreach event handler defined
} // user defined handler for event
}
};
+10
View File
@@ -0,0 +1,10 @@
CWS €
е1Є—„PЌ\__Нq€QЈЕ<6»ЋР‡‘-9&шDk€јялw”­щ¶KC{Ќ]0/
ҐЭxCрМч]F=сВw¬В/,рk®Уiъ4°
iёе„—^ЙЌNаDLnvЈИч
!‹^PПЄuѓРт-ЧiЅЌ}—Д±дF8Ю™ВйО{ЏЋчЃмп"xФ-нf`Яг{›¶X№пЙС4jЩк№Я
™qБ±E]WIЭn”тuяТѓw¤0ўgl ЫЏe‡ѕЕФЭЧ;µЈ7{ыGjxГeZ„WaДО•kuyuWx9Зуы—uяњ:ћvаS‹ы^ЫЯЏ4ч“Їuh@Пїv(Н_Y+љіЈЁіU­RЛoІµ–^ЭilV7tэIµЩuЬИсrй‘ЭИqГ‘>m·RmъЙzє§йkѕс+±`¦?(‘Ћ¶"з‚ҐЃ“я“dкцШJ@=“˜ZЪЩXњЧтџо*gнШN+T›мМсцЧidK—ЋЕmЫхэ@¶™sfGЉРЛ—ь$‰є›*ФІj¶гZЪaЬћд@©v°_ыaђ‡7Ђ—ҐЗЌЭ7ЖП»/Х edЭxхЈ’ВгџrqNЮ¤&mЅг†ЁIQ”wў‘t3П_Ы§7¤рNt\ЮЁвїК-ф)SъLЗтЛ?\ЖeЎ гІ„Кѓе) Ќ Кby©"WоUоWT++ ¤(¬ЁZNМЉѓҐЎЗЂ DAIўЃ”)¤
d„Y s@оІ ж1ђ «@ЦЂTЃик:g6ФMny д а/Ђ| д+ [@ѕт
ђoЃ|к6АђgЂл м‚°Вs
%Sfш"8эИ‡p6H°(©"d>k$Ѓ‚‘ў"¤ 8—X>¦в9¤bQДHC˜k!ффзњ’€¦МВКђ©® П"'Йmr4#…Ыd9#ЕЫдXFJ2СтаћюjщOЅ·ЏМў9Ш.С!sxеЋ1‚>нµЛн±ЅQЬ?qЋOU†]Ь®Шк©|"}/![6е%:)SnOЇbгЋБZ6g’аЩЅ9њБ»уў)W1]8Y4ecKн{¦bЬ' |°Ќoат6№Ѓ·…ёІ-Ж°°ў™`¬Ж hжSЧц4­
Ї!<ЃdBTMйй§№ЏvЋ ™oКйч‰ыcЬЇљ9CЗYЉw}TВхџпй є№®›є№©›ЏtSвїЧh:YvъtxҐя}smsжoO·љ$
+1
View File
@@ -0,0 +1 @@
(function(){function v(a){if(!a._e_version)for(func in j)a[func]=j[func];return a}function w(a){this.o=this.original=a}function q(a,b){w.prototype[b]=function(c,d,i){if(typeof i==="undefined"){if(this[a+"|"+c]===d)return this;this[a+"|"+c]=d;this.original[a](c,d)}else{var f=[];for(g=len=arguments.length;g-- >1;){var l=arguments[g],h=arguments[--g];if(this[a+"|"+h]!==d){this[a+"|"+h]=d;f.push(h,l)}}f.length&&this.original[a].apply(this.original,f)}return this}}function u(a,b){w.prototype[b]=function(c){if(this[a]===c)return this;this[a]=c;this.original[a](c);return this}}function y(a){this.o=this.original=a}function s(a,b,c,d,i,f){var l;try{var h="";if(c||c==0)h=' name="'+c+'"';var z="";if(b)z=' type="'+b+'"';l=n.createElement("<input"+h+z+"/>")}catch(A){l=n.createElement("input")}l.name=c;l.type=b;b=v(l);if(i&&(d||d==0))b.sp(i,d);a&&a.AppendChild(b);if(f)if(typeof f==="object")b.sp(f);else return b;return a}function p(a,b,c){var d=b.length,i;for(i=0;i<d;i++){var f=b[i];if(typeof f==="object"){var l;for(l in f){var h=f[l];if(c)a[c](l,h);else a[l]=h;h&&h.addRewritable&&h.addRewritable(a,c,l,h.addRewritableKey)}}else{h=b[i+1];if(c)a[c](f,h);else a[f]=h;i++;h&&h.addRewritable&&h.addRewritable(a,c,f,h.addRewritableKey)}}}var x=window;if(x._e)return true;var n=document,r,o=true;if(typeof Element!="undefined")r=Element;else o=false;if(o)try{r.prototype._e_version="2"}catch(B){o=false}var j={_e_version:"2",AppendText:function(a,b,c){var d=n.createTextNode(a);a.hasOwnProperty("addRewritable")&&a.addRewritable(d,"","data",a.addRewritableKey);this.appendChild(d);if(b){if(typeof c==="undefined")return d;b[c]=new y(d)}return this},AppendChild:function(a){this.appendChild(a);return this},SetProperties:function(){p(this,arguments);return this},SetStyle:function(){p(this.style,arguments);return this},SetAttributes:function(){p(this,arguments,"setAttribute");return this},SetClass:function(a){this.SetProperties("className",a);return this},Title:function(a){a=["title",a];p(this,a,"setAttribute");p(this,a);return this},AppendElement:function(a,b){this.appendChild(t(a,b));return this},AppendElementNext:function(a,b){var c=t(a,b);this.appendChild(c);return c},CacheSetter:function(a,b){a[b]=new w(this);return this},checkbox:function(a,b,c,d){a=s(this,"checkbox",a,c,"defaultChecked",1);a.value=b;return d?a:this},submit:function(a,b,c){return s(this,"submit",a,b,"value",c)},button:function(a,b){return s(this,"button",null,a,"value",b)},hidden:function(a,b,c){return s(this,"hidden",a,b,"value",c)},input:function(a,b,c){return s(this,"text",a,b,"value",c)},td:o?function(){return this.insertCell(-1)}:function(){return v(this.insertCell(-1))},tr:o?function(){return this.insertRow(-1)}:function(){return v(this.insertRow(-1))}},m={AppendText:["at"],AppendChild:["ac"],SetProperties:["sp"],SetStyle:["st","ss"],SetAttributes:["sa"],SetClass:["sc"],AppendElement:["e"],AppendElementNext:["ex"],AddEvent:["ev"],Title:["tt"],CacheSetter:["c"]};(function(a,b){if(o){var c=function(){var d=b();r.prototype[a]=d;return d.apply(this,arguments)};r.prototype[a]=c;j[a]=c}else j[a]=function(){var d=arguments.callee.real;if(!d){d=b();arguments.callee.real=d}if(!arguments.callee.install){j[a]=d;for(var i=m[a].length;i--;)j[m[a][i]]=d;arguments.callee.install=1}this[a]=d;return d.apply(this,arguments)}})("AddEvent",function(){return this.addEventListener?function(a,b){this.addEventListener(a,b,false);return this}:this.attachEvent?function(a,b){this.attachEvent("on"+a,b);return this}:function(){return this}});var e;for(e in m)for(var g=m[e].length;g--;)j[m[e][g]]=j[e];if(o)for(e in j)r.prototype[e]=j[e];e="SetStyle";q(e,e);var k=m[e];for(g=k.length;g--;)q(e,k[g]);e="SetProperties";q(e,e);k=m[e];for(g=k.length;g--;)q(e,k[g]);e="SetAttributes";q(e,e);k=m[e];for(g=k.length;g--;)q(e,k[g]);e="SetClass";u(e,e);k=m[e];for(g=k.length;g--;)u(e,k[g]);e="Title";u(e,e);k=m[e];for(g=k.length;g--;)u(e,k[g]);var t=o?function(a,b){a=n.createElement(a);if(b)typeof b==="object"?a.SetAttributes(b):p(a,["className",b]);return a}:function(a,b){a=n.createElement(a);var c;for(c in j)a[c]=j[c];if(b)typeof b==="object"?a.SetAttributes(b):p(a,["className",b]);return a};y.prototype.data=function(a){if(this.d===a)return this;this.d=a;a.hasOwnProperty("addRewritable")&&a.addRewritable(tnode,"","data",a.addRewritableKey);this.original.data=a;return this};x._e=t;t.add=o?function(a,b){r.prototype[a]=b;j[a]=b}:function(a,b){j[a]=b};t.post=function(){var a=n.createElement("form");a.method="POST";a.style.display="none";var b=arguments.length,c;for(c=0;c<b;c++){var d=arguments[c];if(typeof d==="object"){var i;for(i in d){var f=n.createElement("input");f.name=i;f.value=d[i];a.appendChild(f)}}else{f=n.createElement("input");f.name=d;f.value=arguments[c+1];a.appendChild(f);c++}}n.body.appendChild(a);a.submit()};typeof x.DLoad==="object"&&(new DLoad.pkg("_e")).complete()})()
+166
View File
@@ -0,0 +1,166 @@
var _e
;(function(){ // Global closure START
if(_e){ return }
// Helpers
// Create 'input' reliably with correct call or broken IE<8 call.
// Pre-8 IE:
// 1) Doesn't allow to set name on dynamicaly created element.
// 2) Doesn't allow to set type after element is appended to tree.
function input(type, name){
var ielem
try{ // Old IE way
var namea=''; if(name || name==0){ namea=' name="'+name+'"' }
var typea=''; if(type){ typea=' type="'+type+'"' }
ielem=document.createElement('<input'+namea+typea+'/>')
}
catch(err){ ielem=document.createElement('input') } // Correct way
ielem.name=name; ielem.type=type // Correct way + double it just in case IE way works for some weird reason
return _e(ielem)
}
function input_return(where, type, name, value, prop, return_new){
var ielem=input(type, name)
if(prop && (value || value==0)){ ielem.sp(prop, value) }
if(where){ where.AppendChild(ielem) } // IE doesn't allows to change input type after append.
if(return_new){
if(typeof(return_new)=='object'){ ielem.sp(return_new) } else { return ielem }
}
return where
}
// Copies properties from arguments to target object. Arguments can be any of
// complete objects - every property will be copied from it or pair
// of key+value strings. You can also mix them.
function set_properties(target, args, method){
var len=args.length
for(var idx=0; idx<len; idx++){
var arg=args[idx]
if(typeof arg=='object'){
for(var prop in arg){
var value=arg[prop]
if(method){ target[method](prop, value) } else { target[prop]=value }
if(value && value.addRewritable){ value.addRewritable(target, method, prop, value.addRewritableKey) }
}
} else {
var value=args[idx+1]
if(method){ target[method](arg, value) } else { target[arg]=value }
idx++
if(value && value.addRewritable){ value.addRewritable(target, method, arg, value.addRewritableKey) }
}
}
}
var _e_prototype={
'__is_e':function(){ return true },
'AppendText':function(text, args){
if(text===''){ return this }
if(typeof(args)!='object'){
var tnode=document.createTextNode(text)
if(text && text.addRewritable){ text.addRewritable(tnode, '', 'data', text.addRewritableKey) }
this.appendChild(tnode)
return this
}
if(args.br){
var parts=text.split('\n')
for(var idx=0; idx<parts.length-1; idx++){
this.appendChild(document.createTextNode(parts[idx]))
this.appendChild(document.createElement('br'))
}
// *** FIX ***: this must be adjusted to work with rewriter!
this.appendChild(document.createTextNode(parts[parts.length-1]))
} else {
this.appendChild(document.createTextNode(text))
}
return this
},
'AppendChild':function(child){ this.appendChild(child); return this },
'SetProperties':function(){ set_properties(this, arguments); return this },
'SetStyle':function(){ set_properties(this.style, arguments); return this },
'SetAttributes':function(){ set_properties(this, arguments, 'setAttribute'); return this },
'SetClass':function(className){ this.SetProperties('className', className); return this; },
'AppendElement':function(element_name, attrs){ this.AppendChild(_e(element_name, attrs)); return this },
'Title':function(title){ var prop=['title', title]; set_properties(this, prop, 'setAttribute'); set_properties(this, prop); return this },
// Returns newly created element instead of "this".
'AppendElementNext':function(element_name, attrs){ var ne=_e(element_name, attrs); this.AppendChild(ne); return ne },
'AddEvent':function(event, func){ if (this.addEventListener){ this.addEventListener(event, func, false) } else if (this.attachEvent){ this.attachEvent('on'+event, func) } return this },
// Pre-cooked elements
'checkbox':function(name, value, checked, return_new){ var ch=input_return(this, 'checkbox', name, checked, 'defaultChecked', 1); ch.value=value; if(return_new){ return ch } else { return this } },
'submit':function(name, value, return_new){ return input_return(this, 'submit', name, value, 'value', return_new) },
'button':function(value, return_new){ return input_return(this, 'button', null, value, 'value', return_new) },
'hidden':function(name, value, return_new){ return input_return(this, 'hidden', name, value, 'value', return_new) },
'input':function(name, value, return_new){ return input_return(this, 'text', name, value, 'value', return_new) },
// Table-cell. *** Not chained - returns new element! ***
'td':function(){ return _e(this.insertCell(-1)) },
// Table-row. *** Not chained - returns new element! ***
'tr':function(){ return _e(this.insertRow(-1)) }
}
// Aliases
var aliases={
'AppendText':['at'],
'AppendChild':['ac'],
'SetProperties':['sp'],
'SetStyle':['st', 'ss'],
'SetAttributes':['sa'],
'SetClass':['sc'],
'AppendElement':['e'],
'AppendElementNext':['ex'],
'AddEvent':['ev'],
'Title':['tt']
}
for(var orig in aliases){ var idx=aliases[orig].length; while(idx--){ _e_prototype[aliases[orig][idx]]=_e_prototype[orig] } }
_e=function(element_name, attrs){
var element=typeof(element_name)=='string'?document.createElement(element_name):element_name
if(!element.__is_e){ for(func in _e_prototype){ element[func]=_e_prototype[func] } }
if(attrs){
if(typeof(attrs)=='object'){ element.SetAttributes(attrs) }
else { element.SetProperties('className', attrs) }
}
return element
}
// Global _e object level methods
_e.add=function(name, func){ _e_prototype[name]=func }
_e.post=function(){
var form=document.createElement('form')
form.method='POST'
form.style.display='none'
var len=arguments.length
for(var idx=0; idx<len; idx++){
var arg=arguments[idx]
if(typeof arg=='object'){
for(prop in arg){
var input=document.createElement('input')
input.name=prop
input.value=arg[prop]
form.appendChild(input)
}
} else {
var input=document.createElement('input')
input.name=arg
input.value=arguments[idx+1]
form.appendChild(input)
idx++
}
}
document.body.appendChild(form)
form.submit()
}
var head=document.getElementsByTagName('head')[0]
var haveCSS={}
_e.css=function(src, encoding){
if(haveCSS[src]){ return }
var css=_e('link')
css.sa('rel', 'stylesheet', 'type', 'text/css', 'href', src)
if(encoding){ css.sa('charset', encoding) }
head.appendChild(css)
haveCSS[src]=true
}
})() // Global closure END
+80
View File
@@ -0,0 +1,80 @@
var xmlHttpp = [];
function ajaxLoad(url, iid, params) {
xmlHttpp[iid] = GetXmlHttpObject1();
if(xmlHttpp[iid] == null){
alert("Browser does not support HTTP Request")
return
}
xmlHttpp[iid].open("POST", url, true);
xmlHttpp[iid].onreadystatechange = function() {
var container = null;
if(xmlHttpp[iid].readyState == 4 || xmlHttpp[iid].readyState == "complete") {
if(xmlHttpp[iid].responseText.indexOf('<!--CONTAINER=') == 0) {
var a = xmlHttpp[iid].responseText.indexOf('-->');
if(a >= 0) {
var b = xmlHttpp[iid].responseText.substr(14, a-14);
if(document.getElementById(b) != undefined) {
container = document.getElementById(b);
} else{
throw "Указаный в редиректе контейнер не найден";
}
}
} else {
container = document.getElementById(iid);
}
$('#'+container.id).html(xmlHttpp[iid].responseText);
scripts = container.getElementsByTagName('script');
var loadJS = null;
for(var i = 0; i < scripts.length; i++) {
if(scripts[i].id == '') {
eval(scripts[i].text);
} else {
scriptId = scripts[i].id;
scripts[i].id = '';
if(!document.getElementById(scriptId)) {
loadJS = document.createElement("script");
loadJS.setAttribute("type","text/javascript");
loadJS.setAttribute("id",scriptId);
loadJS.text = scripts[i].text;
document.getElementsByTagName('head')[0].appendChild(loadJS);
}
scripts[i].parentNode.removeChild(scripts[i]);
i--;
}
}
$(window).trigger('ajaxLoadComplete');
}
}
xmlHttpp[iid].setRequestHeader("Accept-Charset", "windows-1251");
xmlHttpp[iid].setRequestHeader("Accept-Language", "ru, en");
xmlHttpp[iid].setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttpp[iid].setRequestHeader("Connection", "close");
var tmp = '';
for(var i in params) {
tmp += '&'+i+'='+encodeURIComponent(params[i]);
}
tmp = 'ajax_mode=load&ajax_target='+iid+tmp;
xmlHttpp[iid].send(tmp);
}
function GetXmlHttpObject1() {
var xmlHttp1 = null;
try {
xmlHttp1 = new XMLHttpRequest();
} catch(e) {
try {
xmlHttp1 = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp1;
}
+31
View File
@@ -0,0 +1,31 @@
function FindFrameDocument(a,b){if(a=a.document)if(a=a.getElementById(b))if(a=a.contentWindow||a.contentDocument)return a.document||a}var fw=[];
var rnd=Math.random(),
redHP=0.33,
yellowHP=0.66,
TimerOn=-1,
tkHP,maxHP,
speed=100,
mspeed=100,
chat_version=-1;
function setHP(a,b,c){
tkHP=a;maxHP=b;vrem=c;
if(TimerOn>=0){clearTimeout(TimerOn);TimerOn=-1}
setHPlocal()}
function setHPlocal(){
if(tkHP>maxHP){tkHP=maxHP;TimerOn=-1
}else TimerOn=0;
var a=Math.round(120/maxHP*tkHP),
b=120-a,
c=FindFrameDocument(top,main_uid);
if(c){var d=c.getElementById("HP");
if(d){var e=c.getElementById("HP1");
c=c.getElementById("HP2");
e.width=a;
c.width=b;
c.style.display=b?"":"none";
e.src=tkHP/maxHP<redHP?"i/1red.gif":tkHP/maxHP<yellowHP?"i/1yellow.gif":"i/1green.gif";
d.innerHTML=Math.round(tkHP)+"/"+maxHP}}
if(vrem>0){tkHP+=maxHP/(vrem*60);}
if(TimerOn!=-1)TimerOn=setTimeout(setHPlocal,delay*100)
}
+93
View File
@@ -0,0 +1,93 @@
//-------------------------------------------------------------
// Функция для определения координат указателя мыши
function defPosition(event) {
var x = y = 0;
if (document.attachEvent != null) { // Internet Explorer & Opera
x = window.event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
y = window.event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
if (window.event.clientY + 72 > document.body.clientHeight) { y-=68 } else { y-=2 }
} else if (!document.attachEvent && document.addEventListener) { // Gecko
x = event.clientX + window.scrollX;
y = event.clientY + window.scrollY;
if (event.clientY + 72 > document.body.clientHeight) { y-=68 } else { y-=2 }
} else {
// Do nothing
}
return {x:x, y:y};
}
var flagpop=0;
var clip = new ZeroClipboard.Client();
clip.setHandCursor( true );
clip.setCSSEffects(true);
clip.addEventListener( 'onComplete', function(client){
clip.hide();
cMenu();
} );
function OpenMenu(evt,level){
evt = evt || window.event;
evt.cancelBubble = true;
// Показываем собственное контекстное меню
var menu = document.getElementById("oMenu");
var html = "";
login=(evt.target || evt.srcElement).innerHTML;
clip.setText(login);
var i1, i2;
if ((i1 = login.indexOf('['))>=0 && (i2 = login.indexOf(']'))>0) login=login.substring(i1+1, i2);
var login2 = login;
login2 = login2.replace('%', '%25');
while (login2.indexOf('+')>=0) login2 = login2.replace('+', '%2B');
while (login2.indexOf('#')>=0) login2 = login2.replace('#', '%23');
while (login2.indexOf('?')>=0) login2 = login2.replace('?', '%3F');
html = '<a href="javascript:void(0)" class="menuItem" onclick="top.AddTo(\''+login+'\');cMenu()">TO</a>'+
'<a href="javascript:void(0)" class="menuItem" onclick="top.AddToPrivate(\''+login+'\');cMenu()">PRIVATE</a>'+
'<a href="javascript:void(0)" class="menuItem" onclick="window.open(\'inf.php?login='+login+'\')"; cMenu();">INFO</a>'+
'<div class="my_clip_button" id="d_clip_button">COPY</div>';
// Если есть что показать - показываем
if (html){
menu.innerHTML = html;
menu.style.top = defPosition(evt).y + "px";
menu.style.left = defPosition(evt).x + "px";
menu.style.display = "";
}
if (flagpop==0){
flagpop=1;
clip.glue( 'd_clip_button' )
}
else
clip.reposition('d_clip_button');
// Блокируем всплывание стандартного браузерного меню
return false;
}
function addHandler(object, event, handler, useCapture){
if (object.addEventListener){
object.addEventListener(event, handler, useCapture ? useCapture : false);
} else if (object.attachEvent){
object.attachEvent('on' + event, handler);
} else alert("Add handler is not supported");
}
addHandler(document, "contextmenu", function(){
document.getElementById("oMenu").style.display = "none";
});
addHandler(document, "click", function(){
clip.hide();
document.getElementById("oMenu").style.display = "none";
});
function cMenu() {
/*document.all("oMenu").style.visibility = "hidden";
document.all("oMenu").style.top="0px";*/
document.getElementById("oMenu").style.display = "none";
top.frames['bottom'].window.document.F1.text.focus();
}
//-------------------------------------------------------------------------
+97
View File
@@ -0,0 +1,97 @@
document.onmousedown = Down;
function Down() {top.CtrlPress = window.event.ctrlKey}
// Разрешенные смайлики
var sm = new Array("horse",60,40, "hug",48,20, "laugh",15,15, "susel",70,34 , "fingal",22,15, "eek",15,15, "flowers",28,29, "smoke",20,20, "hi",31,28, "bye",15,15,
"king",21,22, "king2",28,24, "boks2",28,21, "boks",62,28, "gent",15,21, "lady",15,19, "tongue",15,15, "smil",16,16, "rotate",15,15,
"ponder",21,15, "bow",15,21, "smile",18,18, "angel",42,43, "angel2",26,25, "hello",25,27, "dont",26,26, "idea",26,27, "mol",27,22, "super",26,28,
"beer",15,15, "drink",19,17, "baby",15,18, "tongue2",15,15, "sword",49,18, "agree",37,15,
"loveya",27,15, "kiss",15,15, "kiss2",15,15, "kiss3",15,15, "kiss4",37,15, "rose",15,15, "love",27,28,
"love2", 55,24, "inv",80,20,
"confused",15,22, "yes",15,15, "no",15,15, "shuffle",15,20, "nono",22,19, "maniac",70,25, "privet",27,29, "ok",22,16, "ninja",15,15,
"pif",46,26, "smash",30,26, "alien",13,15, "pirate",23,19, "gun",40,18, "trup",20,20,
"mdr",56,15, "sneeze",15,20, "mad",15,15, "friday",57,28, "cry",16,16, "grust",15,15, "rupor",38,18,
"fie",15,15, "nnn",82,16, "row",36,15, "red",15,15, "lick",15,15,
"help",23,15, "wink",15,15, "jeer",26,16, "tease",33,19, "str", 35, 25, "kruger",34,27, "girl",37,26, "Knight1",69,37, "rev",40,25, "smile100",44,39, "smile118",25,25,
"smile149", 54,37, "smile166",46,29, "smile237",35,35, "smile245",50,30, "smile28",33,34, "smile289",46,31, "smile314",36,29, "smile36",50,46, "smile39",46,48,
"smile44",27,26, "smile70",50,32
);
function AddLogin()
{ var o = window.event.srcElement;
if (o.tagName == "SPAN") {
var login=o.innerText;
if (o.alt != null && o.alt.length>0) login=o.alt;
var i1,i2;
if ((i1 = login.indexOf('['))>=0 && (i2 = login.indexOf(']'))>0) login=login.substring(i1+1, i2);
if (o.className.substr(0,1) == "p") { top.AddToPrivate(login, false) }
else if (o.className == "s") {top.AddToSms(login, false) }
else { top.AddTo(login) }
}
}
function ClipBoard(text)
{
//var holdtext.innerText = text;
var Copied = text;//holdtext.createTextRange();
Copied.execCommand("RemoveFormat");
Copied.execCommand("Copy");
}
function OpenMenu(th) {
var el, x, y, login, login2;
el = document.all("oMenu");
var o = window.event.srcElement;
if (o.tagName != "SPAN") return true;
x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft - 3;
y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
if (window.event.clientY + 72 > document.body.clientHeight) { y-=68 } else { y-=2 }
login = o.innerText;
if (o.alt != null && o.alt.length>0) login = o.alt;
window.event.returnValue=false;
var i1, i2;
if ((i1 = login.indexOf('['))>=0 && (i2 = login.indexOf(']'))>0) login=login.substring(i1+1, i2);
var login2 = login;
login2 = login2.replace('%', '%25');
while (login2.indexOf('+')>=0) login2 = login2.replace('+', '%2B');
while (login2.indexOf('#')>=0) login2 = login2.replace('#', '%23');
while (login2.indexOf('?')>=0) login2 = login2.replace('?', '%3F');
el.innerHTML = '<A class=menuItem HREF="javascript:top.AddTo(\''+login+'\');cMenu()">TO</A>'+
'<A class=menuItem HREF="javascript:top.AddToPrivate(\''+login+'\');cMenu()">PRIVATE</A>'+
'<A class=menuItem HREF="" target=_blank onclick="OpenInfo(\''+login2+'\');return false;">INFO</A>'+
'<A class=menuItem HREF="javascript:ClipBoard(\''+login+'\');cMenu()">COPY</A>';
el.style.left = x + "px";
el.style.top = y + "px";
el.style.visibility = "visible";
}
function OpenInfo(login) {
var lar = login.split(/,/g);
for (i=0;i<lar.length;i++) {
if (lar[i].match(/^(k|c)lan$/i)) {
window.open('http://capitalcity.combats.com/encicl/clans.html');
} else {
window.open('/inf.pl?login='+top.trim(lar[i]));
}
}
}
function cMenu() {
document.all("oMenu").style.visibility = "hidden";
document.all("oMenu").style.top="0px";
top.frames['bottom'].window.document.F1.text.focus();
}
function closeMenu(event) {
if (window.event && window.event.toElement) {
var cls = window.event.toElement.className;
if (cls=='menuItem' || cls=='menu') return;
}
document.all("oMenu").style.visibility = "hidden";
document.all("oMenu").style.top="0px";
return false;
}
+833
View File
@@ -0,0 +1,833 @@
var sml_img = { };
Element.prototype.remove = function() {
this.parentElement.removeChild(this);
}
NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
for(var i = 0, len = this.length; i < len; i++) {
if(this[i] && this[i].parentElement) {
this[i].parentElement.removeChild(this[i]);
}
}
}
var chat = {
key:'',
room:'',
count:0,
time:0,
t:null, //timer
t2:null, //timer 2
t_all:{}, //time molch
r:0,
g:0,
rtime:37,
ct:{ '-1':0, '1':15, '2':30, '3':60, '4':300},
saveData:null,
msg_id:0,
nrg:0,
nozpros:0,
newmsg:0,
sound:0,
translit:0,
filter:0,
globalMsg:0,
ignoreList:{x:0,nms:[]},
citySys:0,
inObj:null,
ignore:function(login)
{
if(this.ignoreList[login]!=undefined)
{
if($('#ignr_alu').attr('id')!=undefined)
{
$('#ignr_u_'+this.ignoreList[login]).remove();
}
delete this.ignoreList.nms[this.ignoreList[login]];
delete this.ignoreList[login];
//msg
}else{
this.ignoreList.x++;
this.ignoreList[login] = this.ignoreList.x;
this.ignoreList.nms[this.ignoreList.x] = login;
if($('#ignr_alu').attr('id')!=undefined)
{
$('#ignr_alu').html($('#ignr_alu').html()+'<div id="ignr_u_'+this.ignoreList.x+'">    <b>'+login+'</b> <a target="_blank" href="/inf.php?login='+login+'"><img src="//'+top.c.img+'/i/inf_capitalcity.gif" title="Инф. о '+login+'"></a>   <small><a href="javascript:void(0)" onclick="chat.ignorUn('+this.ignoreList.x+')">Clear</a></small>  </div>');
}
//msg
}
},
getRandom:function(a, b){
return a + ( (b-a) * Math.random() );
},
ignorUn:function(x)
{
$('#ignr_u_'+x).remove();
this.ignore(this.ignoreList.nms[x]);
},
ignorListOpen:function()
{
var date = '',i = 0;
var j = 1;
while(j<=this.ignoreList.x)
{
if(this.ignoreList[this.ignoreList.nms[j]]!=undefined)
{
date += '<div id="ignr_u_'+j+'">    <b>'+this.ignoreList.nms[j]+'</b> <a target="_blank" href="/inf.php?login='+this.ignoreList.nms[j]+'"><img src="//'+top.c.img+'/i/inf_capitalcity.gif" title="Инф. о '+this.ignoreList.nms[j]+'"></a>   <small><a href="javascript:void(0)" onclick="chat.ignorUn('+j+')">Clear</a></small>  </div>';
}
j++;
}
win.add('ignorListWin','Список игнорируемых','<div id="ignr_alu">'+date+'</div>',{},0,1,'min-width:200px;');
delete date;
},
addSmile:function(id)
{
$('#textmsg').val($('#textmsg').val()+' :'+id+': ');
$('#textmsg').focus();
},
lookSmiles:function()
{
if($('#chbtn8').attr('class')=='db cp chatBtn8_1')
{
$('#ttSmiles').css('display','');
$('#chbtn8').attr('class','db cp chatBtn8_2');
}else{
$('#ttSmiles').css('display','none');
$('#chbtn8').attr('class','db cp chatBtn8_1');
}
},
filterMsg:function()
{
if($('#chbtn1').attr('class')=='db cp chatBtn1_1')
{
$('#chbtn1').attr('class','db cp chatBtn1_2'); this.filter = 1;
}else{
$('#chbtn1').attr('class','db cp chatBtn1_1'); this.filter = 0;
}
},
systemMsg:function()
{
if($('#chbtn4').attr('class')=='db cp chatBtn4_1')
{
$('#chbtn4').attr('class','db cp chatBtn4_2'); this.citySys = 1; $.cookie('citySys',1);
}else{
$('#chbtn4').attr('class','db cp chatBtn4_1'); this.citySys = 0; $.cookie('citySys',0);
}
},
soundChat:function()
{
if($('#chbtn7').attr('class')=='db cp chatBtn7_1')
{
$('#chbtn7').attr('class','db cp chatBtn7_2'); this.sound = 1;
}else if($('#chbtn7').attr('class')=='db cp chatBtn7_2'){
$('#chbtn7').attr('class','db cp chatBtn7_3'); this.sound = 2;
}else{
$('#chbtn7').attr('class','db cp chatBtn7_1'); this.sound = 0;
}
},
translitChat:function()
{
if($('#chbtn6').attr('class')=='db cp chatBtn6_1')
{
$('#chbtn6').attr('class','db cp chatBtn6_2'); this.translit = 1;
}else{
$('#chbtn6').attr('class','db cp chatBtn6_1'); this.translit = 0;
}
},subValSend:'',
subSend:function()
{
if($('#textmsg').val()!='')
{
if($('#textmsg').val()!=this.subValSend)
{
if(this.nozpros == 0) {
this.trmb();
$.post('online.php?r'+c.rnd+'&cas'+((new Date().getTime()) + Math.random()),{
msg:$('#textmsg').val(),key:this.key,mid:this.msg_id,rndo:c.rnd},
function(data){ chat.clearText();
chat.fc(); chat.genchatData(data,1);
});
this.subValSend = $('#textmsg').val();
this.nozpros=1;
setTimeout('chat.subValSend="";chat.nozpros=0;',1000);
} else {
console.log('nozpros != 0');
}
} else {
console.log('No text input = ""');
}
} else {
console.log('No text input');
}
},
addto:function(login, type2) {
var loginaddT = login;
var s = '';
if($('#'+$(this.inObj).attr('id')).attr('id') == undefined) {
$('#textmsg').focus();
s = $('#textmsg').val();
} else {
$(this.inObj).focus();
}
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; i < prar.length; i++) {
prar[i] = prar[i].replace(/^\s+/,'');
prar[i] = prar[i].replace(/\s+$/,'');
}
var str = prar.join(', ');
if(str) login += ', ';
space = '';
if (!s.match(/^\s+/)) space = ' ';
var prob = '';
if($('#'+$(this.inObj).attr('id')).attr('id') == undefined && (this.inObj == null || $('#main').contents().find('#'+this.inObj.id).attr('id') == undefined))
{
if (!cs.match(reg))
{
if(type2=='to')
{
if(test1!=null)
{
type2 = 'private';
}
}
s = type2+' ['+prob+''+login+str+''+prob+']'+space+s;
} else {
if(type3 == 'to') {
type3 = "private";
}
s = type3+' ['+prob+''+str+''+prob+']'+space+s;
}
} else {
s = login+str;
}
if(this.inObj != null && $('#main').contents().find('#'+this.inObj.id).attr('id') != undefined) {
$('#main').contents().find('#'+this.inObj.id).val(s);
} else if($('#'+$(this.inObj).attr('id')).attr('id') == undefined) {
$('#textmsg').val(s);
} else {
$(this.inObj).val(s);
}
},
clearText:function()
{
$('#textmsg').val('');
},
reflesh:function()
{
this.time = 0;
this.testTimer(true);
},
reMoney:function()
{
$('#moneyGM').html(top.c.money+' кр.');
},
btl:0
,
testTimer:function(n)
{
clearTimeout(this.t);
/*if(top.c.money < 100)
{
$('#moneyGM').height('50px');
}else if(top.c.money < 1000)
{
$('#moneyGM').height('70px');
}else{
$('#moneyGM').height('100px');
}*/
if($.cookie('btl') != this.btl) {
if($.cookie('btl') > 0) {
this.sendSound(2);
if(top.frames['main'].smnpty != undefined) {
}else{
top.frames['main'].location.href="main.php";
}
}
this.btl = $.cookie('btl');
}
if(this.rtime!=this.ct[$.cookie('chatCfg0')] && this.ct[$.cookie('chatCfg0')]!=undefined)
{
this.rtime = this.ct[$.cookie('chatCfg0')];
if(this.time>this.rtime)
{
this.time = this.rtime;
}
}
if(this.rtime>=10 || this.r==0)
{
if(this.time < 1)
{
var aot = {
0:0,
1:1,
2:0
};
if($('#chcf10').attr('checked')==true)
{
aot[2] = 1;
}
if($('#autoRefOnline').attr('checked')==true || this.r==0 || n!=false)
{
aot[0] = 1;
}
//alert('chat.reflesh.undefined()');
if(this.nozpros == 0) {
$.getJSON('online.php?r'+c.rnd+'&cas'+((new Date().getTime()) + Math.random()),
{
key:this.key,
mid:this.msg_id,
r1:aot[0],
r2:aot[1],
r3:aot[2],
rndo:c.rnd
},
function(data){
if(data.rnd!=null){
if(data.telegram > 0){
$('#mini_sms').show();
}else{
$('#mini_sms').hide();
}
chat.genchatData(data);
if(data.key!=undefined){
chat.saveData=data;
}
this.g++;
c.rnd = data.rnd;
}
});
this.nozpros=1;
setTimeout('chat.nozpros=0;',1000);
}
this.time = this.rtime; this.r++;
}else{
this.time--;
}
this.t = setTimeout('chat.testTimer(false);clearTimeout(this.t);',1000);
}
},mlch:{},
fc:function()
{
$('#textmsg').focus();
},
timeOut:function(v)
{
msPerDay = '';
dt = new Date();
dt.setTime((v-c.time)*1000);
m1 = dt.getUTCMonth();
d1 = dt.getUTCDay();
h1 = dt.getUTCHours();
min1 = dt.getUTCMinutes();
sec = dt.getUTCSeconds();
if(m1>0)
{
msPerDay = m1+' мес. ';
}
if(d1>0 && Math.floor((v-c.time)/(60*60*24)) == d1)
{
msPerDay = d1+' д. ';
}
if(h1>0)
{
msPerDay += h1+' ч. ';
}
if(min1>0)
{
msPerDay += min1+' мин. ';
}
if(sec>0 && msPerDay != '')
{
msPerDay += sec+' сек. ';
}
if(msPerDay == '')
{
msPerDay = 'меньше минуты.';
}
delete m1;
delete d1;
delete h1;
delete min1;
delete sec;
return msPerDay;
},
deleteMessage:function(id,fc)
{
//$('#msg_'+id).hide('slow'); setTimeout("$('#msg_'+id).remove();",1000);
if(fc == 1) {
top.msgdeleted(id);
}else{
$('#msg_'+id).remove();
$('#msg_'+id+'_sys').remove();
if(top.c.admin>0)
{
$.post('online.php?jack='+c.rnd+'&cas'+((new Date().getTime()) + Math.random()),{delMsg:id});
}
}
},
clear:function()
{
if($('#textmsg').val()=='')
{
if(confirm('Очистить окно чата?'))
{
if(top.cb_date[top.cb_select] == 4 || top.cb_date[top.cb_select] == 5) {
$('#canal'+top.cb_date[top.cb_select]).html('');
$('#textmsg').focus();
};
}
}else{
$('#textmsg').val('');
}
},
scrollNow:function(id)
{
},
msgcount:0,
sendMsg:function(data)
{
var msg_see = 1;
if(!data) { console.log('No data [0]'); } else { console.log(data); }
if(data[0]=='new')
{
data[0] = 'new_msg_'+this.newmsg; this.newmsg++;
}
if(data[2] == 'delete')
{
this.deleteMessage(data[0]);
}else if(data['d']>0)
{
this.deleteMessage(data['d']);
}else if(data['s']>0)
{
this.deleteMessage(data['s']);
}else if(data[0]!=undefined && document.getElementById('msg_'+data[0]) == undefined)
{
var msg = '';
if(data[0]!=0)
{
if(data[3]!='')
{
msg += '[<a href="javascript:void(0)" oncontextmenu="top.infoMenu(\''+data[3]+'\',event,\'chat\'); return false;" onClick="chat.addto(\''+data[3]+'\',\'to\')">'+data[3]+'</a>]';
}
if(data[4]!='')
{
var forYou = 0;
//тот кто писал
//кому написали, разбор массива
if(data[4]!='')
{
var to = '',to2 = '',arr = data[4].split(','),i = 0,vl = '';
//тем кому писали
while(i!=-1)
{
if(arr[i]!=undefined)
{
vl = this.trim(arr[i]);
if(vl.toLowerCase() == c.login.toLowerCase())
{
forYou++;
}
if(vl.toLowerCase() == c.login.toLowerCase())
{
vl = this.trim(data[3]);
}
if(i>0)
{
to += ', ';
to2 += ', ';
}
if(data[3]!='')
{
to += '<span style="cursor:pointer" onclick="chat.addto(\''+vl+'\',\'private\');" oncontextmenu="top.infoMenu(\''+this.trim(arr[i])+'\',event,\'chat\'); return false;">'+this.trim(arr[i])+'</span>';
if(this.trim(arr[i].toLowerCase()) != c.login.toLowerCase())
{
to2 += this.trim(arr[i]);
}else{
if(data[2]==2)
{
to2 += this.trim(arr[i]);
}else{
to2 += this.trim(vl);
}
}
}
}else{
i = -2;
}
i++;
}
}
if(data[2]==6)
{
//личная системка, внимание
msg += ' <span style="color:red">Внимание!</span> ';
}else if(data[2]==2)
{
if(forYou>0)
{
msg += ' <span style="color:'+data[6]+'"><b>to ['+to2+']</b></span>';
}else{
msg += ' <span style="color:'+data[6]+'">to ['+to2+']</span>';
}
}else if(data[2]==3)
{
if(this.trim(data[3].toLowerCase()) == c.login.toLowerCase())
{
forYou++;
}
if(data[3]!='')
{
if(data[4]=='klan' && data[2]==3)
{
msg += ' <span class="klan"><span style="cursor:pointer" onclick="chat.multiaddto(\'klan\',\'private\');">private [klan]</span></span>';
}else if(data[4]=='paladins' && data[2]==3)
{
msg += ' <span class="klan"><span style="cursor:pointer" onclick="chat.multiaddto(\'paladins\',\'private\');">private [paladins]</span></span>';
}else if(data[4]=='tarmans' && data[2]==3)
{
msg += ' <span class="klan"><span style="cursor:pointer" onclick="chat.multiaddto(\'tarmans\',\'private\');">private [tarmans]</span></span>';
}else{
msg += ' <span class="private"><span style="cursor:pointer" onclick="chat.multiaddto(\''+to2+'\',\'private\');">private [ </span>'+to+'<span style="cursor:pointer" onclick="chat.multiAddto(\''+to2+'\',\'private\');"> ]</span></span>';
}
}
}
}
msg += ' ';
} else {
console.log('No data');
}
data[5] = this.replaceAll(data[5],"[s1;]",'"');
data[5] = this.replaceAll(data[5],"[s2;]",'\'');
data[5] = this.replaceAll(data[5],"[s3;]",'<');
data[5] = this.replaceAll(data[5],"[s4;]",'>');
if(data[6]!='Black' && data[6]!='')
{
msg += '<font color="Black">'+data[5]+'</font>';
}else{
msg += data[5];
}
if(data[1]>0)
{
var td = new Date((parseInt(data[1]))*1000);
td = [td,null,null,null];
td[1] = td[0].getHours();
td[2] = td[0].getMinutes();
td[3] = td[0].getSeconds();
td[4] = td[0].getDay();
td[5] = td[0].getMonth();
td[6] = td[0].getYear();
var j = 1;while(j<6){if(td[j]<10){td[j]='0'+td[j];}j++;}
var cls = '';
if(forYou>0)
{
cls = 'date2';
}else{
cls = 'date';
}
var msg22 = '<span ';
if(c.admin > 0) {
msg22 += 'oncontextmenu="chat.deleteMessage('+data[0]+');return false;" ';
}else{
msg22 += 'oncontextmenu="chat.deleteMessage('+data[0]+',1);return false;" ';
}
if( data[8] == 2 ) {
//msg22 += 'class="'+cls+'">'+td[4]+'.'+td[5]+'.'+(td[6]+1900)+' '+td[1]+':'+td[2]+'</span> ';
msg22 += 'class="'+cls+'">'+data[14]+'</span> ';
}else{
//msg22 += 'class="'+cls+'">'+td[1]+':'+td[2]+'</span> ';
msg22 += 'class="'+cls+'">'+data[13]+'</span> ';
}
msg = msg22+msg;
}
this.msgcount++;
msg = '<span id="msg_'+data[0]+'">'+msg+'<br /></span>';
if(forYou > 0 && this.sound > 0 && this.trim(data[3].toLowerCase()) != c.login.toLowerCase())
{
this.sendSound(1);
}
if(msg_see == 1)
{
if(this.trim(data[3].toLowerCase()) == c.login.toLowerCase() || forYou == 1 || this.filter == 0)
{
if( data[9] > 0 ) {
this.sendSound(data[9]);
}
$('#chat').find('#mes').html(msg
);
//обычное сообщение
console.log(msg);
} else {
console.log('N errors');
}
} else {
console.log('Msg see = '+msg_see+'');
}
this.scrollNow(this.msgcount);
delete forYou;
delete cls;
delete msg_see;
delete msg;
delete arr;
} else {
console.log('UNNAMED ERROR');
}
},
testKey:function(m,v)
{
var i = 0, r = v;
v = false;
while(i!=-1)
{
if(m[i]!=undefined)
{
if(m[i]==r)
{
v = i;
i = -2;
}
}else{
i = -2;
}
i++;
}
delete r,m;
return v;
},
isNumber:function(s)
{
if(!isNaN(s))
{
s = true;
}else{
s = false;
}
return s;
},
testSmile:function(txt)
{
txr = txt.split(':');
var i = 1, j = 0, smid = 0;
while(i <= txr.length) {
if( txr[i] != undefined) {
smid = this.testKey(top.sml,txr[i]);
imsml = txr[i].split('-');
if(((smid != false || smid == 0) && this.isNumber(txr[i]) != true) || (imsml != undefined && imsml[0] == '%usersmile%')) {
if(j < 3 && this.isNumber(top.sml[smid]) != true && (top.sml[smid] != undefined || imsml[0] == '%usersmile%')) {
if(imsml[0] == '%usersmile%') {
//txt = txt.replace("\:%usersmile%-"+imsml[1]+"\:",'<img src="//'+top.c.img+'/i/smile/'+(imsml[1].toLowerCase())+'.gif" width="'+top.sml_img[imsml[1]][0]+'" height="'+top.sml[imsml[1]][1]+'" title="Именной смайлик">');
txt = txt.replace("\:%usersmile%-"+imsml[1]+"\:",'<img src="//'+top.c.img+'/i/smile/'+(imsml[1].toLowerCase())+'.gif" title="Именной смайлик">');
}else{
txt = txt.replace("\:"+txr[i]+"\:",'<img src="//'+top.c.img+'/i/smile/'+(txr[i].toLowerCase())+'.gif" style="cursor:pointer" width="'+top.sml[smid+1]+'" height="'+top.sml[smid+2]+'" onclick="chat.addSmile(\''+(txr[i].toLowerCase())+'\')">');
}
j++;
}
}
}
i++;
}
//}
return txt;
},
trmb:function()
{
if(this.translit==1)
{
$('#textmsg').val(this.convert2($('#textmsg').val()));
}
},
replaceAll:function(t,v,s)
{
return t.split(v).join(s);
},
convert2:function(txt)
{
var trn = new Array();
trn = txt.split(' ');
for(var i=0;i<trn.length;i++) {
if(trn[i].indexOf("//") < 0 && trn[i].indexOf('@') < 0 && trn[i].indexOf("www.") < 0 && !(trn[i].charAt(0)==":" && trn[i].charAt(trn[i].length-1)==":")) {
if ((i<trn.length-1)&&(trn[i]=="to" || trn[i]=="private")&&(trn[i+1].charAt(0)=="[")) {
while ( (i<trn.length-1) && (trn[i].charAt(trn[i].length-1)!="]") ) i++;
} else { trn[i] = this.convert(trn[i]); }
}
}
return trn.join(' ');
},
map_en: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',"'"),
map_ru:Array('сх','Сх','СХ','сХ','щ','Щ','Щ','ё','ё','Ё','Ё','Ё','ж','ж','Ж','Ж','Ж','ч','Ч','Ч','ш','Ш','Ш','э','Э','ю','ю','Ю','Ю','Ю','я','я','Я','Я','Я','а','А','б','Б','в','В','г','Г','д','Д','е','Е','з','З','и','И','й','Й','к','К','л','Л','м','М','н','Н','о','О','п','П','р','Р','с','С','т','Т','у','У','ф','Ф','х','Х','ц','Ц','ъ','ы','Ы','ь'),
addSm:function(i)
{
$('#textmsg').focus();
top.document.textmsg.value += ' :'+i+': ';
},
convert:function(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<this.map_en.length;++i) while(str.indexOf(this.map_en[i])>=0) str = str.replace(this.map_en[i],this.map_ru[i]);
newstr += str;
return newstr;
},
sendSound:function(s)
{
var svolm = 100;
if(this.sound == 0) {
svolm = 0;
}else if(this.sound == 1) {
svolm = 25;
}else if(this.sound == 2) {
svolm = 100;
}
var M$ = navigator.appName.indexOf("Microsoft")!=-1
if(!M$ && this.getSwf('Sound').SetVariable == undefined) {
document.getElementById('Sound2').SetVariable("Volume",svolm);
document.getElementById('Sound2').SetVariable("Sndplay",s);
}else{
window.document["Sound"].SetVariable("Volume", svolm);
window.document["Sound"].SetVariable("Sndplay", s);
}
},
getSwf:function(val) {
var M$ = navigator.appName.indexOf("Microsoft")!=-1
return (M$ ? window : document)[val]
},
trim:function(s)
{
return this.rtrim(this.ltrim(s));
},
ltrim:function(s)
{
return s.replace(/^\s+/, '');
},
rtrim:function(s)
{
return s.replace(/\s+$/, '');
},
multiaddto:function(users,tp)
{
var arr = users.split(',');
var i = arr.length;
while(i>=0)
{
if(arr[i]!=undefined)
{
this.addto(arr[i],tp);
}
i--;
}
},
osize:function(obj) {
var size = 0, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) size++;
}
return size;
},
genchatData:function(data,prs)
{
if(prs == 1) {
data = $.parseJSON(data);
}
if(data == null && this.saveData!=null)
{
data = this.saveData;
data.js = '';
data.rn = undefined;
data.key = undefined;
}
//Получаем сообщение
if(data.msg!=undefined)
{
var ms = $.parseJSON(data.msg);
if(ms['ld']>this.msg_id)
{
this.msg_id = ms['ld'];
}
var i = 0;
//while(i <= this.osize(ms.length)+10)
while(i <= ms['id'])
{
if(ms['m'+i]!=undefined)
{
this.sendMsg(ms['m'+i]);
}
i++;
}
}
//Если есть JS
if(data.js!='')
{
eval(data.js);
}
if(data.rnd!=undefined){ c.rnd = data.rnd; }
if(data.key!=undefined){ this.key = data.key; }
}
}
+22
View File
@@ -0,0 +1,22 @@
function getalign(al)
{
al+="";
if (al.substring(0,1)=="3") return("Темное братство");
if (al.substring(0,1)=="2") return("Хаос");
if (al.substring(0,1)=="1") return("Белое братство");
if (al=="0.5" || al.substring(0,1)=="7") return("Нейтрал");
return("");
}
function drwfl(name, id, level, align, klan)
{
var s="";
if (align!="0") s+="<A HREF=encicl/alignment.html target=_blank><IMG SRC='i/align_"+align+".gif' WIDTH=12 HEIGHT=15 ALT=\""+getalign(align)+"\"></A>";
if (klan) s+="<A HREF='encicl/klan/"+klan+".html' target=_blank><IMG SRC='i/klan/"+klan+".gif' WIDTH=24 HEIGHT=15 ALT=''></A>";
s+="<B>"+name+"</B> ";
if (level!=-1) s+="["+level+"]";
if (id!=-1) s+="<A HREF="+id+"'../inf.php?' target='_blank'><IMG SRC=i/inf.gif WIDTH=12 HEIGHT=11 ALT='Инф. о "+name+"'></A>";
document.write(s);
}
+145
View File
@@ -0,0 +1,145 @@
jQuery(function ($) {
var contact = {
message: null,
init: function () {
$('a.contact').click(function (e) {
e.preventDefault();
// load the contact form using ajax
var act = $(this).attr('id');
var page = $('div.page').attr('id');
$.get("data/contact.php?act=edit&fid="+act+"", function(data){
// create a modal dialog with the data
$(data).modal({
closeHTML: "<a href='#' title='Закрыть' class='modal-close'>x</a>",
position: ["15%",],
overlayId: 'contact-overlay',
containerId: 'contact-container',
onOpen: contact.open,
onShow: contact.show,
onClose: contact.close
});
});
});
},
open: function (dialog) {
// dynamically determine height
var h = 480;
if ($('#contact-subject').length) {
h += 26;
}
if ($('#contact-cc').length) {
h += 22;
}
var title = $('#contact-container .contact-title').html();
$('#contact-container .contact-title').html('Открытие...');
dialog.overlay.fadeIn(200, function () {
dialog.container.fadeIn(200, function () {
dialog.data.fadeIn(200, function () {
$('#contact-container .contact-content').animate({
height: h
}, function () {
$('#contact-container .contact-title').html(title);
$('#contact-container form').fadeIn(200, function () {
$('#contact-container #contact-name').focus();
$('#contact-container .contact-cc').click(function () {
var cc = $('#contact-container #contact-cc');
cc.is(':checked') ? cc.attr('checked', '') : cc.attr('checked', 'checked');
});
});
});
});
});
});
},
show: function (dialog) {
$('#contact-container .contact-send').click(function (e) {
e.preventDefault();
// validate form
if (contact.validate()) {
var msg = $('#contact-container .contact-message');
msg.fadeOut(function () {
msg.removeClass('contact-error').empty();
});
$('#contact-container .contact-title').html('Обработка...');
$('#contact-container form').fadeOut(200);
$('#contact-container .contact-content').animate({
height: '80px'
}, function () {
$('#contact-container .contact-loading').fadeIn(200, function () {
$.ajax({
url: 'data/contact.php',
data: $('#contact-container form').serialize() + '&act=send',
type: 'GET',
cache: false,
dataType: 'html',
success: function (data) {
$('#contact-container .contact-loading').fadeOut(200, function () {
$('#contact-container .contact-title').html('Успешно ...');
msg.html(data).fadeIn(200);
});
},
error: contact.error
});
});
});
}
else {
if ($('#contact-container .contact-message:visible').length > 0) {
var msg = $('#contact-container .contact-message div');
msg.fadeOut(200, function () {
msg.empty();
contact.showError();
msg.fadeIn(200);
});
}
else {
$('#contact-container .contact-message').animate({
height: '30px'
}, contact.showError);
}
}
});
},
close: function (dialog) {
$('#contact-container .contact-message').fadeOut();
$('#contact-container .contact-title').html('Закрываю...');
$('#contact-container form').fadeOut(200);
$('#contact-container .contact-content').animate({
height: 40
}, function () {
dialog.data.fadeOut(200, function () {
dialog.container.fadeOut(200, function () {
dialog.overlay.fadeOut(200, function () {
$.modal.close();
});
});
});
});
},
error: function (xhr) {
alert(xhr.statusText);
},
validate: function () {
contact.message = '';
if (!$('#contact-container #contact-message').val()) {
contact.message += 'Введите сообщение.';
}
if (contact.message.length > 0) {
return false;
} else {
return true;
}
},
showError: function () {
$('#contact-container .contact-message').html($('<div class="contact-error"></div>').append(contact.message)).fadeIn(200);
}
};
contact.init();
});
+263
View File
@@ -0,0 +1,263 @@
var xmlHttpp = [];
function screenSize() {
var w, h;
w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
return {w:w, h:h};
}
function endingsForm(n, form1, form2, form5) {
var last_digit = n % 10;
var last_two_digits = n % 100;
if(last_digit == 1 && last_two_digits != 11) {
return form1;
}
if((last_digit == 2 && last_two_digits != 12) || (last_digit == 3 && last_two_digits != 13) || (last_digit == 4 && last_two_digits != 14)) {
return form2;
}
return form5
}
/**
* Function : dump()
* Arguments: The data - array,hash(associative array),object
* The level - OPTIONAL
* Returns : The textual representation of the array.
* This function was inspired by the print_r function of PHP.
* This will accept some data as the argument and return a
* text that will be a more readable version of the
* array/hash/object that is given.
* Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php
*/
function dump(arr,level) {
var dumped_text = "";
if(!level) level = 0;
//The padding given at the beginning of the line.
var level_padding = "";
for(var j=0;j<level+1;j++) level_padding += " ";
if(typeof(arr) == 'object') { //Array/Hashes/Objects
for(var item in arr) {
var value = arr[item];
if(typeof(value) == 'object') { //If it is an array,
dumped_text += level_padding + "'" + item + "' ...\n";
dumped_text += dump(value,level+1);
} else {
dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
}
}
} else { //Stings/Chars/Numbers etc.
dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
}
return dumped_text;
}
/*
Загрузить HTML в контейнер
*/
function ajaxLoad(url,iid,params){
xmlHttpp[iid]=GetXmlHttpObject1()
if (xmlHttpp[iid]==null){
alert ("Browser does not support HTTP Request")
return
}
//document.getElementById(iid).innerHTML="<img src='./i/loading2.gif' />";
//var url="./ajax/"+func+".php"
xmlHttpp[iid].open("POST",url,true);
xmlHttpp[iid].onreadystatechange=function() {
var container = null;
if (xmlHttpp[iid].readyState==4 || xmlHttpp[iid].readyState=="complete") {
if(xmlHttpp[iid].responseText.indexOf('<!--CONTAINER=') == 0){
var a = xmlHttpp[iid].responseText.indexOf('-->');
if(a >= 0){
var b = xmlHttpp[iid].responseText.substr(14,a-14)
if(document.getElementById(b) != undefined){
container = document.getElementById(b);
} else{
throw "Указаный в редиректе контейнер не найден";
}
}
}else{
container = document.getElementById(iid);
}
//container.innerHTML = xmlHttpp[iid].responseText;
$('#'+container.id).html(xmlHttpp[iid].responseText);
scripts = container.getElementsByTagName('script');
var loadJS = null;
for(var i = 0; i < scripts.length; i++){
if(scripts[i].id == ''){ // нет ID просто EVAL
eval(scripts[i].text);
}else{ // пробуем встраивать
scriptId = scripts[i].id;
scripts[i].id = '';
if(!document.getElementById(scriptId)){ // не загружен - встраиваем!
loadJS = document.createElement("script");
loadJS.setAttribute("type","text/javascript");
loadJS.setAttribute("id",scriptId);
loadJS.text = scripts[i].text;
document.getElementsByTagName('head')[0].appendChild(loadJS);
}
scripts[i].parentNode.removeChild(scripts[i]);
i--;
} // попытка встраивания
} // for по коллекции скриптов
// Вызываем своё событие
$(window).trigger('ajaxLoadComplete');
}
}
xmlHttpp[iid].setRequestHeader("Accept-Charset", "windows-1251");
xmlHttpp[iid].setRequestHeader("Accept-Language","ru, en");
xmlHttpp[iid].setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttpp[iid].setRequestHeader("Connection", "close");
var tmp = '';
for(var i in params){
tmp+='&'+i+'='+encodeURIComponent(params[i]);
}
tmp = 'ajax_mode=load&ajax_target='+iid+tmp;
xmlHttpp[iid].send(tmp);
}
function GetXmlHttpObject1(){
var xmlHttp1=null;
try {
// Firefox, Opera 8.0+, Safari
xmlHttp1=new XMLHttpRequest();
}catch(e){
//Internet Explorer
try {
xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp1;
}
appearance = {
info: function(){
$('div#appearance_out').text('info');
},
drop: function(){
$('div#appearance_out').text('drop');
},
use: function(){
$('div#appearance_out').text('use');
},
error: function(){
$('div#appearance_out').text('error');
}
}
core = {
grabLogin: null,
_findGrabLogin: function(input) {
var tmp = null;
if('string' == typeof input) {
tmp = $('#'+input);
} else if(input instanceof $) {
tmp = input;
} else if(input.tagName == 'INPUT' && input.type == 'text') {
tmp = $(input);
}
if(!(tmp instanceof $) || tmp.length < 1) {
alert('ОШИБКА! Неизвестный параметр core._findGrabLogin ['+input+']');
return null;
}
return tmp.get(0);
},
setGrabLogin: function(input){
var tmp = this._findGrabLogin(input);
this.clearGrabLogin();
this.grabLogin = tmp;
return $(tmp).addClass('grabLogin').select();
},
clearGrabLogin: function(){
$('input.grabLogin').removeClass('grabLogin');
this.grabLogin = null;
},
toggleGrabLogin: function(input){
var tmp = this._findGrabLogin(input);
if($(tmp).hasClass('grabLogin')){
this.clearGrabLogin();
}else{
this.setGrabLogin(tmp);
}
},
refresh: function(){
document.location = document.location;
}
}
function str_replace ( search, replace, subject ) {
if(!(replace instanceof Array)){
replace=new Array(replace);
if(search instanceof Array){
while(search.length>replace.length){
replace[replace.length]=replace[0];
}
}
}
if(!(search instanceof Array))search=new Array(search);
while(search.length>replace.length){
replace[replace.length]='';
}
if(subject instanceof Array){
for(k in subject){
subject[k]=str_replace(search,replace,subject[k]);
}
return subject;
}
for(var k=0; k<search.length; k++){
var i = subject.indexOf(search[k]);
while(i>-1){
subject = subject.replace(search[k], replace[k]);
i = subject.indexOf(search[k],i);
}
}
return subject;
}
(function ($) {
$.fn.vAlign = function() {
return this.each(function(i){
var ah = $(this).height();
var ph = $(this).parent().height();
var mh = (ph - ah) / 2;
$(this).css('margin-top', mh);
});
};
})(jQuery);
// GENERATE UNIQUE ID DOM-ELEMENTS
(function($) {
$.fn.genId = function(prefix,params){
return this.each(function(){
var counter = 0;
var id;
do{
id = (prefix ? prefix + '-' : '_') + (counter++);
}while(document.getElementById(id));
$(this).attr('id', id);
return this;
});
};
})(jQuery);
+369
View File
@@ -0,0 +1,369 @@
var Hint3Name = '';
step=0;
top.is_qlaunch = 0;
function errmess(s)
{
messid.innerHTML='<B>'+s+'</B>';
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 findlogin(title, script, name, defaultlogin, mtype, addon, need_defend) {
var s;
if (need_defend && defend==false) {
defend = -1;
// errmess("Блок не выбран."); return false;
}
if (need_defend) {
addon+="<INPUT type=hidden name='mdefend' value='"+defend+"'>";
addon+="<INPUT type=hidden name='enemy' value='"+enemy+"'>";
addon+="<INPUT type=hidden name='myid' value='"+myid+"'>";
}
s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME="'+name+'" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="slform.'+name+'.value=fixspaces(slform.'+name+'.value);">'+(addon?addon:'')+'</TD></TR></FORM></TABLE>';
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.zIndex = 200;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all(name).focus();
Hint3Name = name;
}
// Заголовок, название скрипта, имя поля с логином
function bank_open(ac_list, ac_def, skipz, name) {
var ac = ac_list.split(',');
var s;
var addon = '<INPUT type=hidden name="ac_open" value="' + Math.random() +'">';
var hint = 'Выберите счёт и введите пароль';
var title = 'Счёт в банке';
var opt = '<select name="num" size=0 style="width: 100px">';
for (var i=0; i<ac.length; i++){
opt += '<option value="' + ac[i] + '"' +((ac_def && (ac_def == ac[i]))?' selected':'')+ '>'+ ac[i] + '</option>';
}
opt += '</select>';
//alert (opt);
s='<table border=0 width=100% cellspacing="0" cellpadding="2" ><tr>'+
'<form action="?" method="POST" name=slform>'+
'<input type=hidden name=edit value=2>'+
'<td colspan=2 align=center>'+ hint + '</TD></TR>' +
'<TR><TD width=84% align=right style="padding-left:5">' + opt+ '&nbsp;<input style="width: 100px" type="password" name="psw" size="12" maxlength="30"></TD>' +
'<TD width=16%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" >'+(addon?addon:'')+'</TD></TR></FORM></TABLE>';
s = crtmagic('', title, s,"",skipz);
if (!name) {name = "hint4"};
document.all(name).innerHTML = s;
document.all(name).style.visibility = "visible";
if (!skipz) {
document.all(name).style.left = 100;
document.all(name).style.zIndex = 200;
document.all(name).style.top = document.body.scrollTop+50;
}
document.all('num').focus();
Hint3Name = 'num';
for (var i=0; i<ac.length; i++){
opt += '<option value="' + ac[i] + '"' +((ac_def && ac_def == ac[i])?' selected':'')+ '>'+ ac[i] + '</option>';
}
opt += '</select>';
}
function bank_info() {
alert('У Вас нет активных счетов. \n\n На правах рекламы: Вы можете открыть счёт в Банке БК,'+
' на Страшилкиной улице*\n\n* Мелким шрифтом: услуга платная.');
}
function bank_blocked(tm) {
var s = 'Ваши счета заблокированы (ещё '+ tm + ').';
alert(s);
}
function get_bank_pwd(){
}
function b_confirm(script, txt, mtype, addon, need_defend) {
if (need_defend && defend==false) {
defend=-1
// errmess("Блок не выбран."); return false;
}
if (need_defend) {
addon+="<INPUT type=hidden name='mdefend' value='"+defend+"'>";
addon+="<INPUT type=hidden name='enemy' value='"+enemy+"'>";
addon+="<INPUT type=hidden name='myid' value='"+myid+"'>";
}
dialogconfirm('Подтверждение', '/battle.pl', '<TABLE width=100%><TD><B>'+txt+'</B><BR>Использовать сейчас?</TABLE>'+addon, mtype);
}
function dialogconfirm(title, script, text, mtype) {
var s;
s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
text+'</TD></TR><TR><TD width=50% align=left><INPUT TYPE="button" name="tmpname423" value="Да" style="width:70%" onclick="if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(slform.use.value); closehint3(); } "></TD><TD width=50% align=right><INPUT type=button style="width:70%" value="Нет" onclick="closehint3();"></TD></TR></FORM></TABLE>';
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.zIndex = 200;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("tmpname423").focus();
Hint3Name = name;
}
function dialogOK(title, text, mtype) {
var s;
s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>'+
text+'</TD></TR><TR><TD width=100% align=right><INPUT type=button style="width:70%" value="Закрыть" onclick="closehint3();"></TD></TR></FORM></TABLE>';
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.zIndex = 200;
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;
}
// Для магии. Заголовок, название скрипта, название магии, номер вещицы в рюкзаке, логин по умолчанию, описание доп. поля
function magicklogin(title, script, magickname, n, defaultlogin, extparam, mtype) {
var s = '<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD style="padding-left:5" width=50% align=right><INPUT TYPE="text" NAME="param" value="'+defaultlogin+'" style="width: 100%"></TD><TD width=50%><IMG SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="slform.param.value=fixspaces(slform.param.value); if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(\'' + magickname + '\', slform.param.value); closehint3(); } " onmouseover="this.style.cursor = \'hand\';" onmouseout="this.style.cursor = \'\';"></TD></TR>';
if (extparam != null && extparam != '') {
s = s + '<TR><td style="padding-left:5">'+extparam+'<BR><INPUT style="width: 100%" TYPE="text" NAME="param2"></TD><TD></TR>';
}
s = s + '</FORM></TABLE>';
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.zIndex = 200;
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 = '<table border=0 width=100% cellspacing="1" cellpadding="0"><TR><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><td colspan=2 align=left><NOBR><SMALL>'+
extparam + ':</NOBR></TD></TR><TR><TD width=100% align=left style="padding-left:5"><INPUT tabindex=1 style="width: 100%" TYPE="'+t1+'" id="param" NAME="param" value=""></TD><TD width=10%><IMG SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" tabindex=3 onclick="if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(\'' + name + '\', slform.param.value ' + ((extparam2 != null && extparam2 != '') ? ', slform.param2.value' : '') + ' ); closehint3(); } " onmouseover="this.style.cursor = \'hand\';" onmouseout="this.style.cursor = \'\';"></TD></TR>';
if (extparam2 != null && extparam2 != '') {
if (extparam2.substr(0,1) == "!")
{
t2='password';
extparam2=extparam2.substr(1,extparam2.length);
}
s = s + '<TR><td colspan=2><NOBR><SMALL>'+extparam2+':</NOBR><TR style="padding-left:5"><TD><INPUT tabindex=2 TYPE="'+t2+'" id="param2" NAME="param2" style="width: 50%"></TD><TD></TR>';
}
s += '</FORM></TABLE>';
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.zIndex = 200;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("param").focus();
Hint3Name = 'param';
} else {
dialogconfirm('Подтверждение', script, '<TABLE width=100%><TD><IMG src="http://img.combats.com/i/items/'+name+'.gif"></TD><TD>Использовать сейчас?</TABLE>'+
'<input type=hidden name="use" id="use" value="'+name+'"><input type=hidden name="n" value="'+n+'">', mtype);
}
}
// Закрывает окно ввода логина
function closehint3()
{
top.is_qlaunch = 0;
document.all("hint4").style.visibility="hidden";
Hint3Name='';
}
// Для боевой магии. Заголовок, название магии, номер вещицы в рюкзаке
function Bmagicklogin (title, magickname, n, defaultlogin, extparam, mtype) {
if (defend==false) {
defend=-1;
// errmess("Блок не выбран."); return false;
}
var s = '<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="/battle.pl" method=POST name="bmagic" onsubmit="bmagic.mdefend.value=defend;"><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><input type=hidden name="mdefend" value="'+defend+'"><input type=hidden name="enemy" value="'+enemy+'"><input type=hidden name="myid" value="'+myid+'"><td colspan=2 align=left>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT style="width: 100%" TYPE="text" id="param" NAME="param" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="bmagic.param.value=fixspaces(bmagic.param.value);"></TD></TR>';
if (extparam != null && extparam != '') {
s = s + '<TR><td colspan=2>'+extparam+'<TR><TD style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME="param2"><TD></TD></TR>';
}
s = s + '</FORM></TABLE>';
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.zIndex = 200;
document.all("hint4").style.top = 60;
document.all("param").focus();
Hint3Name = 'param';
}
// Магия
function BUseMagick(name, extparam, n, mtype) {
if (defend==false) {
defend=-1;
// 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+'&param='+s+'&n='+n+'&mdefend='+defend+'&enemy='+enemy+'&myid='+myid;
}
} else {
dialogconfirm('Подтверждение', '/battle.pl', '<TABLE width=100%><TD><IMG src="http://img.combats.com/i/items/'+name+'.gif"></TD><TD>Использовать сейчас?</TABLE>'+
'<input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><input type=hidden name="mdefend" value="'+defend+'"><input type=hidden name="enemy" value="'+enemy+'"><input type=hidden name="myid" value="'+myid+'">', mtype);
}
}
function crtmagic(mtype, title, body, subm, noclose) {
return crtmagic_full(mtype, title, body, subm, noclose, 270, 0);
}
function crtmagic_full(mtype, title, body, subm, noclose, dx, dy) {
//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#', 'http://img.combats.com/i/misc/dmagic/'+names[mtype*10]+'_30.gif');
var s='<table width="'+dx+(dy?'" height="'+dy:'')+'" border="0" align="center" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+1]+'" align="left"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_03.gif" width="'+names[mtype*10+1]+'" height="'+names[mtype*10+2]+'"></td>'+
'<td width="100%" align="right" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_05.gif"></td>'+
'<td width="'+names[mtype*10+3]+'" align="right"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_07.gif" width="'+names[mtype*10+3]+'" height="'+names[mtype*10+2]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
(names[mtype*10+7]?'<td width="'+names[mtype*10+7]+'"><SPAN style="width:'+names[mtype*10+7]+'">&nbsp;</SPAN></td>':'')+
'<td width="5" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_17.gif">&nbsp;</td>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td bgcolor="#'+colors[mtype*2]+'"'+(names[mtype*10+9]?' style="padding-top: '+names[mtype*10+9]+'"':'')+' >'+
'<table border=0 width=100% cellspacing="0" cellpadding="0"><td style="padding-left: 20" align=center><B>'+title+
'</td><td width=20 align=right valign=top style="cursor: hand" '+(noclose?'':'onclick="closehint3();" ') + 'style=\'filter:Gray()\' onmouseover="this.filters.Gray.Enabled=false" onmouseout="this.filters.Gray.Enabled=true"><IMG src="http://img.combats.com/i/clear.gif" width=13 height=13>&nbsp;</td></table>'+
'</td></tr>'+
'<tr>'+
'<td align="center" bgcolor="#'+colors[mtype*2+1]+'">'+body+
'</tr>'+
'</table></td>'+
'<td width="5" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_19.gif">&nbsp;</td>'+
(names[mtype*10+8]?'<td width="'+names[mtype*10+8]+'"><SPAN style="width:'+names[mtype*10+8]+'">&nbsp;</SPAN></td></td>':'')+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+4]+'" align="left"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_27.gif" width="'+names[mtype*10+4]+'" height="'+names[mtype*10+6]+'"></td>'+
'<td width="100%" align="right" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_29.gif"></td>'+
'<td width="'+names[mtype*10+5]+'" align="right"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_31.gif" width="'+names[mtype*10+5]+'" height="'+names[mtype*10+6]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table>';
return s;
}
+346
View File
@@ -0,0 +1,346 @@
var Hint3Name = '';
step=0;
top.is_qlaunch = 0;
function errmess(s)
{
messid.innerHTML='<B>'+s+'</B>';
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 bank_open(ac_list, ac_def, skipz, name) {
var ac = ac_list.split(',');
var s;
var addon = '<INPUT type=hidden name="ac_open" value="' + Math.random() +'">';
var hint = 'Выберите счёт и введите пароль';
var title = 'Счёт в банке';
var opt = '<select name="num" size=0 style="width: 100px">';
for (var i=0; i<ac.length; i++){
opt += '<option value="' + ac[i] + '"' +((ac_def && (ac_def == ac[i]))?' selected':'')+ '>'+ ac[i] + '</option>';
}
opt += '</select>';
//alert (opt);
s='<table border=0 width=100% cellspacing="0" cellpadding="2" ><tr>'+
'<form action="?" method="POST" name=slform>'+
'<input type=hidden name=edit value=2>'+
'<td colspan=2 align=center>'+ hint + '</TD></TR>' +
'<TR><TD width=84% align=right style="padding-left:5">' + opt+ '&nbsp;<input style="width: 100px" type="password" name="psw" size="12" maxlength="30"></TD>' +
'<TD width=16%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" >'+(addon?addon:'')+'</TD></TR></FORM></TABLE>';
s = crtmagic('', title, s,"",skipz);
if (!name) {name = "hint4"};
document.all(name).innerHTML = s;
document.all(name).style.visibility = "visible";
if (!skipz) {
document.all(name).style.left = 100;
document.all(name).style.zIndex = 200;
document.all(name).style.top = document.body.scrollTop+50;
}
document.all('num').focus();
Hint3Name = 'num';
for (var i=0; i<ac.length; i++){
opt += '<option value="' + ac[i] + '"' +((ac_def && ac_def == ac[i])?' selected':'')+ '>'+ ac[i] + '</option>';
}
opt += '</select>';
}
function bank_info() {
alert('У Вас нет активных счетов. \n\n На правах рекламы: Вы можете открыть счёт в Банке БК,'+
' на Страшилкиной улице*\n\n* Мелким шрифтом: услуга платная.');
}
function bank_blocked(tm) {
var s = 'Ваши счета заблокированы (ещё '+ tm + ').';
alert(s);
}
function get_bank_pwd(){
}
function b_confirm(script, txt, mtype, addon, need_defend) {
if (need_defend && defend==false) {
defend=-1
// errmess("Блок не выбран."); return false;
}
if (need_defend) {
addon+="<INPUT type=hidden name='mdefend' value='"+defend+"'>";
addon+="<INPUT type=hidden name='enemy' value='"+enemy+"'>";
addon+="<INPUT type=hidden name='myid' value='"+myid+"'>";
}
dialogconfirm('Подтверждение', '/battle.pl', '<TABLE width=100%><TD><B>'+txt+'</B><BR>Использовать сейчас?</TABLE>'+addon, mtype);
}
function dialogconfirm(title, script, text, mtype) {
var s;
s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
text+'</TD></TR><TR><TD width=50% align=left><INPUT TYPE="button" name="tmpname423" value="Да" style="width:70%" onclick="if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(slform.use.value); closehint3(); } "></TD><TD width=50% align=right><INPUT type=button style="width:70%" value="Нет" onclick="closehint3();"></TD></TR></FORM></TABLE>';
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.zIndex = 200;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("tmpname423").focus();
Hint3Name = name;
}
function dialogOK(title, text, mtype) {
var s;
s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>'+
text+'</TD></TR><TR><TD width=100% align=right><INPUT type=button style="width:70%" value="Закрыть" onclick="closehint3();"></TD></TR></FORM></TABLE>';
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.zIndex = 200;
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;
}
// Для магии. Заголовок, название скрипта, название магии, номер вещицы в рюкзаке, логин по умолчанию, описание доп. поля
function magicklogin(title, script, magickname, n, defaultlogin, extparam, mtype) {
var s = '<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD style="padding-left:5" width=50% align=right><INPUT TYPE="text" NAME="param" value="'+defaultlogin+'" style="width: 100%"></TD><TD width=50%><IMG SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="slform.param.value=fixspaces(slform.param.value); if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(\'' + magickname + '\', slform.param.value); closehint3(); } " onmouseover="this.style.cursor = \'hand\';" onmouseout="this.style.cursor = \'\';"></TD></TR>';
if (extparam != null && extparam != '') {
s = s + '<TR><td style="padding-left:5">'+extparam+'<BR><INPUT style="width: 100%" TYPE="text" NAME="param2"></TD><TD></TR>';
}
s = s + '</FORM></TABLE>';
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.zIndex = 200;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("param").focus();
Hint3Name = 'param';
}
// Магия
function UseMagick(title, script, name, extparam, n, extparam2, mtype) {
var image = name;
var path = ('' + name).split('/');
name = path[ path.length - 1 ];
if ((extparam != null)&&(extparam != '')) {
var t1='text',t2='text';
if (extparam.substr(0,1) == "!")
{
t1='password';
extparam=extparam.substr(1,extparam.length);
}
var s = '<table border=0 width=100% cellspacing="1" cellpadding="0"><TR><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><td colspan=2 align=left><NOBR><SMALL>'+
extparam + ':</NOBR></TD></TR><TR><TD width=100% align=left style="padding-left:5"><INPUT tabindex=1 style="width: 100%" TYPE="'+t1+'" id="param" NAME="param" value=""></TD><TD width=10%><IMG SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" tabindex=3 onclick="if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(\'' + name + '\', slform.param.value ' + ((extparam2 != null && extparam2 != '') ? ', slform.param2.value' : '') + ' ); closehint3(); } " onmouseover="this.style.cursor = \'hand\';" onmouseout="this.style.cursor = \'\';"></TD></TR>';
if (extparam2 != null && extparam2 != '') {
if (extparam2.substr(0,1) == "!")
{
t2='password';
extparam2=extparam2.substr(1,extparam2.length);
}
s = s + '<TR><td colspan=2><NOBR><SMALL>'+extparam2+':</NOBR><TR style="padding-left:5"><TD><INPUT tabindex=2 TYPE="'+t2+'" id="param2" NAME="param2" style="width: 50%"></TD><TD></TR>';
}
s += '</FORM></TABLE>';
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.zIndex = 200;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("param").focus();
Hint3Name = 'param';
} else {
dialogconfirm('Подтверждение', script, '<TABLE width=100%><TD><IMG src="http://img.combats.com/i/items/'+image+'.gif"></TD><TD>Использовать сейчас?</TABLE>'+
'<input type=hidden name="use" id="use" value="'+name+'"><input type=hidden name="n" value="'+n+'">', mtype);
}
}
// Закрывает окно ввода логина
function closehint3()
{
top.is_qlaunch = 0;
document.all("hint4").style.visibility="hidden";
Hint3Name='';
}
// Для боевой магии. Заголовок, название магии, номер вещицы в рюкзаке
function Bmagicklogin (title, magickname, n, defaultlogin, extparam, mtype) {
if (defend==false) {
defend=-1;
// errmess("Блок не выбран."); return false;
}
var s = '<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="/battle.pl" method=POST name="bmagic" onsubmit="bmagic.mdefend.value=defend;"><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><input type=hidden name="mdefend" value="'+defend+'"><input type=hidden name="enemy" value="'+enemy+'"><input type=hidden name="myid" value="'+myid+'"><td colspan=2 align=left>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT style="width: 100%" TYPE="text" id="param" NAME="param" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="bmagic.param.value=fixspaces(bmagic.param.value);"></TD></TR>';
if (extparam != null && extparam != '') {
s = s + '<TR><td colspan=2>'+extparam+'<TR><TD style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME="param2"><TD></TD></TR>';
}
s = s + '</FORM></TABLE>';
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.zIndex = 200;
document.all("hint4").style.top = 60;
document.all("param").focus();
Hint3Name = 'param';
}
// Магия
function BUseMagick(name, extparam, n, mtype) {
if (defend==false) {
defend=-1;
// 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+'&param='+s+'&n='+n+'&mdefend='+defend+'&enemy='+enemy+'&myid='+myid;
}
} else {
dialogconfirm('Подтверждение', '/battle.pl', '<TABLE width=100%><TD><IMG src="http://img.combats.com/i/items/'+name+'.gif"></TD><TD>Использовать сейчас?</TABLE>'+
'<input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><input type=hidden name="mdefend" value="'+defend+'"><input type=hidden name="enemy" value="'+enemy+'"><input type=hidden name="myid" value="'+myid+'">', mtype);
}
}
function crtmagic(mtype, title, body, subm, noclose) {
return crtmagic_full(mtype, title, body, subm, noclose, 270, 0);
}
function crtmagic_full(mtype, title, body, subm, noclose, dx, dy) {
//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#', 'http://img.combats.com/i/misc/dmagic/'+names[mtype*10]+'_30.gif');
var s='<table width="'+dx+(dy?'" height="'+dy:'')+'" border="0" align="center" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+1]+'" align="left"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_03.gif" width="'+names[mtype*10+1]+'" height="'+names[mtype*10+2]+'"></td>'+
'<td width="100%" align="right" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_05.gif"></td>'+
'<td width="'+names[mtype*10+3]+'" align="right"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_07.gif" width="'+names[mtype*10+3]+'" height="'+names[mtype*10+2]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
(names[mtype*10+7]?'<td width="'+names[mtype*10+7]+'"><SPAN style="width:'+names[mtype*10+7]+'">&nbsp;</SPAN></td>':'')+
'<td width="5" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_17.gif">&nbsp;</td>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td bgcolor="#'+colors[mtype*2]+'"'+(names[mtype*10+9]?' style="padding-top: '+names[mtype*10+9]+'"':'')+' >'+
'<table border=0 width=100% cellspacing="0" cellpadding="0"><td style="padding-left: 20" align=center><B>'+title+
'</td><td width=20 align=right valign=top style="cursor: hand" '+(noclose?'':'onclick="closehint3();" ') + 'style=\'filter:Gray()\' onmouseover="this.filters.Gray.Enabled=false" onmouseout="this.filters.Gray.Enabled=true"><IMG src="http://img.combats.com/i/clear.gif" width=13 height=13>&nbsp;</td></table>'+
'</td></tr>'+
'<tr>'+
'<td align="center" bgcolor="#'+colors[mtype*2+1]+'">'+body+
'</tr>'+
'</table></td>'+
'<td width="5" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_19.gif">&nbsp;</td>'+
(names[mtype*10+8]?'<td width="'+names[mtype*10+8]+'"><SPAN style="width:'+names[mtype*10+8]+'">&nbsp;</SPAN></td></td>':'')+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+4]+'" align="left"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_27.gif" width="'+names[mtype*10+4]+'" height="'+names[mtype*10+6]+'"></td>'+
'<td width="100%" align="right" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_29.gif"></td>'+
'<td width="'+names[mtype*10+5]+'" align="right"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_31.gif" width="'+names[mtype*10+5]+'" height="'+names[mtype*10+6]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table>';
return s;
}
+368
View File
@@ -0,0 +1,368 @@
var SmileParser;
$(document).ready(
function () {
SmileParser.init(initBBEditors);
});
function initBBEditors() {
var options = {
buttons:"testlink,bold,italic,underline,removeFormat,|,justifyleft,justifycenter,justifyright,|,img,link,smilebox,|,quote",
smileList:SmileParser.smileList,
allButtons:{
img:{
title:"Вставка картинки с параметрами",
buttonText:"myimg",
modal:{
title:"Заголовок окна",
width:"600px",
tabs:[
{
input:[ {
param:"SRC",
title:"Введите адрес изображения",
validation:'^http(s)?://.*?\.(jpg|png|gif|jpeg)$'
}, {
param:"WIDTH",
title:"Ширина"
}, {
param:"HEIGHT",
title:"Высота"
}
]
}
],
onLoad:function () {
},
onSubmit:function (param1, param2, param3) {
var src = $("div.wbbm-inp-row input[name=SRC]").val();
var width = $("div.wbbm-inp-row input[name=WIDTH]").val();
var height = $("div.wbbm-inp-row input[name=HEIGHT]").val();
if (width.length == 0 || height.length == 0) {
if (width.length == 0) {
$("div.wbbm-inp-row input[name=WIDTH]").val(ImageSizeDetector.width);
}
if (height.length == 0) {
$("div.wbbm-inp-row input[name=HEIGHT]").val(ImageSizeDetector.height);
}
}
}
},
transform:{
'<img src="{SRC}" width="{WIDTH}" height="{HEIGHT}"/>':'[img width={WIDTH} height={HEIGHT}]{SRC}[/img]'
}
},
link:{
title:"Вставка ссылки",
buttonText:"testlink",
modal:{ //Описание модального окна
title:"Заголовок окна",
width:"600px",
tabs:[
{
input:[
//Список полей формы
{
param:"SELTEXT",
title:"Текст"
} ,
{
param:"SRC",
title:"Введите адрес",
validation:'^http(s)?://.*?$'
},
{
param:"TARGET"
}
]
}
],
onLoad:function () {
//Callback функция, которая будет вызываться после отображения модального окна
$("div.tab-cont").append("<input type='checkbox' name='TARGETFLAG'>Открывать в новом окне</input>");
$("div.wbbm-inp-row input[name=TARGET]").hide();
},
onSubmit:function (param1, param2, param3) {
var target = $("div.wbbm-cont input[name=TARGETFLAG]").prop("checked");
if (target) {
$("div.wbbm-inp-row input[name=TARGET]").val("_blank");
} else {
$("div.wbbm-inp-row input[name=TARGET]").val("_self");
}
}
},
transform:{
'<a href="{SRC}" target="{TARGET}">{SELTEXT}</a>':'[url src={SRC} target={TARGET}]{SELTEXT}[/url]'
}
}
}
};
jQuery("#message").wysibb(options);
jQuery("#answer").wysibb(options);
$("div.wbbm-inp-row input[name=WIDTH]").live("change", function () {
var h = $("div.wbbm-inp-row input[name=HEIGHT]").val();
if (h != "" && h > 0) {
return;
}
var width = $("div.wbbm-inp-row input[name=WIDTH]").val();
if (!ImageSizeDetector.isEmpty()) {
var height = width * ImageSizeDetector.height / ImageSizeDetector.width;
height = height.toFixed(0);
$("div.wbbm-inp-row input[name=HEIGHT]").val(height);
}
});
$("div.wbbm-inp-row input[name=HEIGHT]").live("change", function () {
var w = $("div.wbbm-inp-row input[name=WIDTH]").val();
if (w != "" && w > 0) {
return;
}
var height = $("div.wbbm-inp-row input[name=HEIGHT]").val();
if (!ImageSizeDetector.isEmpty()) {
var width = height * ImageSizeDetector.width / ImageSizeDetector.height;
width = width.toFixed(0);
$("div.wbbm-inp-row input[name=WIDTH]").val(width);
}
});
$("div.wbbm-inp-row input[name=SRC]").live("change", function () {
var src = $("div.wbbm-inp-row input[name=SRC]").val();
ImageSizeDetector.init(src);
});
}
ImageSizeDetector = new Object();
ImageSizeDetector.src = null;
ImageSizeDetector.img = null;
ImageSizeDetector.height = null;
ImageSizeDetector.width = null;
ImageSizeDetector.init = function (src, callback) {
var img = $("<img src='" + src + "' />");
ImageSizeDetector.img = img;
ImageSizeDetector.src = src;
ImageSizeDetector.width = img.get(0).width;
ImageSizeDetector.height = img.get(0).height;
if (callback) {
callback();
}
}
ImageSizeDetector.isNotEmpty = function () {
return ImageSizeDetector.width != null && ImageSizeDetector.width > 0 &&
ImageSizeDetector.height != null && ImageSizeDetector.height > 0;
}
ImageSizeDetector.isEmpty = function () {
return !ImageSizeDetector.isNotEmpty();
}
SmileParser = new Object();
SmileParser.map = null;
SmileParser.init = function (callback) {
var url = "/js/forum_smiles.json";
jQuery.ajax({
url:url,
dataType:'json',
success:function (json) {
// $("#list_routines").html("");
SmileParser.map = json;
SmileParser.prepareSmileList();
SmileParser.proceed();
if (callback) {
callback();
}
},
error:function (jqXHR, textStatus, errorThrown) {
}
});
}
SmileParser.replace = function (str) {
var result = str;
for (smileCode in SmileParser.map) {
smileURL = SmileParser.map[smileCode];
result = result.replace(smileCode, "<img src='" + smileURL + "'/>");
}
for (smileCode in SmileParser.oldMap) {
smileURL = SmileParser.oldMap[smileCode];
result = result.replace(smileCode, "<img src='" + smileURL + "'/>");
}
return result;
}
SmileParser.proceed = function () {
jQuery("p.pleft").each(function (index, value) {
var html = jQuery(value).html();
jQuery(value).html(SmileParser.replace(html));
});
}
SmileParser.smileList = [];
SmileParser.prepareSmileList = function () {
SmileParser.smileList = [];
for (smileCode in SmileParser.map) {
smileURL = SmileParser.map[smileCode];
var smileListItem = {
title:smileCode,
img:'<img src="' + smileURL + '"/>',
bbcode:smileCode
};
SmileParser.smileList.push(smileListItem);
}
return SmileParser.smileList;
}
SmileParser.oldMap = {
":)":"/i/forum/icon7.gif",
":(":"/i/smile/grust.gif",
":D":"/i/smile/laugh.gif",
";)":"/i/smile/wink.gif"
}
function storeCaret(text) {
if (text.createTextRange) {
text.caretPos = document.selection.createRange().duplicate();
}
}
function cs(s1, s2, formname) {
if (!formname) {
formname = 'F1';
}
if (document.getSelection) {
alert("Под NN не работает!");
}
if (document.selection) {
var str = document.selection.createRange();
var s = document[formname].text.value;
if (s1 == '//') {
if ((str.text != "") && (s.indexOf(str.text) < 0)) {
var str2 = '> ';
var j = 0;
for (var i = 0; i < str.text.length; i++) {
str2 += str.text.charAt(i);
j++;
if (str.text.charAt(i) == "\n") {
str2 += "> ";
j = 0;
}
if ((j > 55) && (str.text.charAt(i) == ' ')) {
str2 += "\n> ";
j = 0;
}
}
document[formname].text.value = s + "<I>\n" + str2 + "\n</I>\n";
} else {
alert("Не выделен текст!\nДля вставки цитаты, сначала выделите на странице нужный текст, а затем нажмите эту кнопку.");
}
} else {
if ((str.text != "") && (s.indexOf(str.text) >= 0)) {
if (str.text.indexOf(s1) == 0)
return ''
str.text = s1 + str.text + s2;
} else {
if (document[formname].text.createTextRange
&& document[formname].text.caretPos) {
var caretPos = document[formname].text.caretPos;
caretPos.text = s1 + s2;
} else {
document[formname].text.value = s + s1 + s2;
}
}
}
}
document[formname].text.focus();
return false;
}
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 convert(st) {
for (var i = 0; i < map_en.length; ++i)
while (st.indexOf(map_en[i]) >= 0)
st = st.replace(map_en[i], map_ru[i]);
return st;
}
function translate2(str) {
var strarr = new Array();
strarr = str.split(' ');
for (var k = 0; k < strarr.length; k++) {
if (strarr[k].indexOf("http://") < 0 && strarr[k].indexOf('@') < 0
&& strarr[k].indexOf("www.") < 0)
strarr[k] = convert(strarr[k]);
}
return strarr.join(' ');
}
function translate(str2) {
var s = new Array();
s = str2.split('\n');
for (var i = 0; i < s.length; i++)
s[i] = translate2(s[i])
return s.join('\n');
}
function subm() {
document.F1.text.value = translate(document.F1.text.value);
document.F1.title.value = translate(document.F1.title.value);
}
function subm2() {
document.F1.text.value = translate(document.F1.text.value);
}
var oneclick = false;
function getalign(al) {
al += "";
if (al == "3")
return ("Темное братство");
if (al == "2")
return ("Хаос");
if (al.substring(0, 1) == "1")
return ("Белое братство");
if (al == "0.5")
return ("Нейтрал");
return ("");
}
function drwfl(name, level) {
var s = "";
s += '&nbsp;<b>' + name + '</b>';
if(level > 0 && level != '') s += "&nbsp;[" + level + "]";
document.write(s);
}
var $addFavoriteSet = function () {
$('a.addFavorite').each(function (count, elm) {
var $elem = $(elm);
var id = $elem.attr('id');
$(elm).click(function () {
// ajax
$.ajax({
url:'/forum.pl?act=add_favorite',
// type: 'GET',
data:{
id:id
},
dataType:'json',
error:function (XTR, message) {
alert(XXX[3]);
},
success:function (data) {
alert(XXX[data.code]);
}
});
});
});
}
+133
View File
@@ -0,0 +1,133 @@
{
":smile0:":"/i/forum/icon7.gif",
":baby:":"/i/smile/baby.gif",
":sniper:":"/i/smile/sniper.gif",
":trup:":"/i/smile/trup.gif",
":beggar:":"/i/smile/beggar.gif",
":rotate:":"/i/smile/rotate.gif",
":hello:":"/i/smile/hello.gif",
":sten:":"/i/smile/sten.gif",
":shuffle:":"/i/smile/shuffle.gif",
":elix:":"/i/smile/elix.gif",
":smil:":"/i/smile/smil.gif",
":mdr:":"/i/smile/mdr.gif",
":podz:":"/i/smile/podz.gif",
":dont:":"/i/smile/dont.gif",
":grust:":"/i/smile/grust.gif",
":boks:":"/i/smile/boks.gif",
":susel:":"/i/smile/susel.gif",
":dedmoroz:":"/i/smile/dedmoroz.gif",
":creator:":"/i/smile/creator.gif",
":no:":"/i/smile/no.gif",
":horse:":"/i/smile/horse.gif",
":vamp:":"/i/smile/vamp.gif",
":eek:":"/i/smile/eek.gif",
":sorry:":"/i/smile/sorry.gif",
":friday:":"/i/smile/friday.gif",
":obm:":"/i/smile/obm.gif",
":smile:":"/i/smile/smile.gif",
":nail:":"/i/smile/nail.gif",
":gent:":"/i/smile/gent.gif",
":beer:":"/i/smile/beer.gif",
":inv:":"/i/smile/inv.gif",
":fire:":"/i/smile/fire.gif",
":dance1:":"/i/smile/dance1.gif",
":maniac:":"/i/smile/maniac.gif",
":kiss4:":"/i/smile/kiss4.gif",
":confused:":"/i/smile/confused.gif",
":kiss2:":"/i/smile/kiss2.gif",
":snowfight:":"/i/smile/snowfight.gif",
":row:":"/i/smile/row.gif",
":naem:":"/i/smile/naem.gif",
":radio1:":"/i/smile/radio1.gif",
":fie:":"/i/smile/fie.gif",
":love:":"/i/smile/love.gif",
":sneeze:":"/i/smile/sneeze.gif",
":mol:":"/i/smile/mol.gif",
":showng:":"/i/smile/showng.gif",
":rocket:":"/i/smile/rocket.gif",
":dustman:":"/i/smile/dustman.gif",
":rupor:":"/i/smile/rupor.gif",
":nnn:":"/i/smile/nnn.gif",
":snegur:":"/i/smile/snegur.gif",
":dance2:":"/i/smile/dance2.gif",
":jeer:":"/i/smile/jeer.gif",
":kiss:":"/i/smile/kiss.gif",
":ponder:":"/i/smile/ponder.gif",
":drink:":"/i/smile/drink.gif",
":angel:":"/i/smile/angel.gif",
":idea:":"/i/smile/idea.gif",
":lady:":"/i/smile/lady.gif",
":gun:":"/i/smile/gun.gif",
":pif:":"/i/smile/pif.gif",
":help:":"/i/smile/help.gif",
":alch:":"/i/smile/alch.gif",
":kiss3:":"/i/smile/kiss3.gif",
":hug:":"/i/smile/hug.gif",
":lordhaos:":"/i/smile/lordhaos.gif",
":rose:":"/i/smile/rose.gif",
":radio2:":"/i/smile/radio2.gif",
":boks2:":"/i/smile/boks2.gif",
":str:":"/i/smile/str.gif",
":invis:":"/i/smile/invis.gif",
":rev:":"/i/smile/rev.gif",
":ok:":"/i/smile/ok.gif",
":alien:":"/i/smile/alien.gif",
":smash:":"/i/smile/smash.gif",
":super:":"/i/smile/super.gif",
":love2:":"/i/smile/love2.gif",
":victory:":"/i/smile/victory.gif",
":kruger:":"/i/smile/kruger.gif",
":agree:":"/i/smile/agree.gif",
":hi:":"/i/smile/hi.gif",
":privet:":"/i/smile/privet.gif",
":devil:":"/i/smile/devil.gif",
":naem2:":"/i/smile/naem2.gif",
":tongue:":"/i/smile/tongue.gif",
":red:":"/i/smile/red.gif",
":doc:":"/i/smile/doc.gif",
":icon7:":"/i/forum/icon7.gif",
":lightfly:":"/i/smile/lightfly.gif",
":owl:":"/i/smile/owl.gif",
":pirate:":"/i/smile/pirate.gif",
":sword:":"/i/smile/sword.gif",
":bye:":"/i/smile/bye.gif",
":mad:":"/i/smile/mad.gif",
":fingal:":"/i/smile/fingal.gif",
":nono:":"/i/smile/nono.gif",
":loveya:":"/i/smile/loveya.gif",
":cry:":"/i/smile/cry.gif",
":superng:":"/i/smile/superng.gif",
":yes:":"/i/smile/yes.gif",
":crying:":"/i/smile/crying.gif",
":'(":"/i/smile/crying.gif",
":flowers:":"/i/smile/flowers.gif",
":tease:":"/i/smile/tease.gif",
":wink:":"/i/smile/wink.gif",
":sharp:":"/i/smile/sharp.gif",
":nunu:":"/i/smile/nunu.gif",
":angel2:":"/i/smile/angel2.gif",
":naem3:":"/i/smile/naem3.gif",
":lick:":"/i/smile/lick.gif",
":ninja:":"/i/smile/ninja.gif",
":cat:":"/i/smile/cat.gif",
":smoke:":"/i/smile/smoke.gif",
":chtoza:":"/i/smile/chtoza.gif",
":grace:":"/i/smile/grace.gif",
":tongue2:":"/i/smile/tongue2.gif",
":sorry2:":"/i/smile/sorry2.gif",
":yar:":"/i/smile/yar.gif",
":king2:":"/i/smile/king2.gif",
":carreat:":"/i/smile/carreat.gif",
":hlw:":"/i/smile/hlw.gif",
":grenade:":"/i/smile/grenade.gif",
":bow:":"/i/smile/bow.gif",
":doc2:":"/i/smile/doc2.gif",
":duel:":"/i/smile/duel.gif",
":mag:":"/i/smile/mag.gif",
":king:":"/i/smile/king.gif",
":laugh:":"/i/smile/laugh.gif",
":pal:":"/i/smile/pal.gif",
":nun:":"/i/smile/nun.gif",
":ura:":"/i/smile/ura.gif"
}
+107
View File
@@ -0,0 +1,107 @@
function delItmsNo(title, name, mtype, addon, itmImg, itmName, urls) {
var s = '';
s = '<table width="100%" border="0" cellspacing="0" cellpadding="5"><tr><td width="80"><div align="center"><img src="i/sh/'+itmImg+'"></div></td><td>Предмет \'<b>'+itmName+'</b>\' будет утерян, вы уверены ?</td></tr></table><input type="checkbox" name="dropall" /> <small>Все предметы этого вида</small><br /><center><input style="width: 70px;" type="button" name="button" id="button" value="Да" onClick="location=\''+urls+'\';" /> <input style="width: 70px;" onclick="closehint();" type="button" name="button" id="button" value="Нет" /></center>';
s = crtmagic(0, title, s);
document.getElementById('hint4').innerHTML = s;
document.getElementById('hint4').style.visibility = 'visible';
document.getElementById('hint4').style.left = '150px';
document.getElementById('hint4').style.top = '50px';
Hint3Name = name;
}
function closehint() {
document.all("hint4").style.visibility = "hidden";
Hint3Name = '';
}
function closehint3() {
document.all("hint4").style.visibility = "hidden";
Hint3Name = '';
}
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;
}
function crtmagic(mtype, title, body, subm) {
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#', 'i/misc/dmagic/'+names[mtype*10]+'_30.gif');
var s = '<table width="250" border="0" align="center" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+1]+'" align="left"><img src="i/misc/dmagic/b'+names[mtype*10]+'_03.gif" width="'+names[mtype*10+1]+'" height="'+names[mtype*10+2]+'"></td>'+
'<td width="100%" align="right" background="i/misc/dmagic/b'+names[mtype*10]+'_05.gif"></td>'+
'<td width="'+names[mtype*10+3]+'" align="right"><img src="i/misc/dmagic/b'+names[mtype*10]+'_07.gif" width="'+names[mtype*10+3]+'" height="'+names[mtype*10+2]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
(names[mtype*10+7]?'<td width="'+names[mtype*10+7]+'"><SPAN style="width:'+names[mtype*10+7]+'">&nbsp;</SPAN></td>':'')+
'<td width="5" background="i/misc/dmagic/b'+names[mtype*10]+'_17.gif">&nbsp;</td>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td bgcolor="#'+colors[mtype*2]+'"'+(names[mtype*10+9]?' style="padding-top: '+names[mtype*10+9]+'"':'')+' >'+
'<table border=0 width=100% cellspacing="0" cellpadding="0"><td style="padding-left: 20" align=center><B>'+title+
'</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint();"><img src="i/clear.gif" width=13 height=13 alt="">&nbsp;</td></table>'+
'</td></tr>'+
'<tr>'+
'<td align="center" bgcolor="#'+colors[mtype*2+1]+'">'+body+
'</tr>'+
'</table></td>'+
'<td width="5" background="i/misc/dmagic/b'+names[mtype*10]+'_19.gif">&nbsp;</td>'+
(names[mtype*10+8]?'<td width="'+names[mtype*10+8]+'"><SPAN style="width:'+names[mtype*10+8]+'">&nbsp;</SPAN></td></td>':'')+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+4]+'" align="left"><img src="i/misc/dmagic/b'+names[mtype*10]+'_27.gif" width="'+names[mtype*10+4]+'" height="'+names[mtype*10+6]+'"></td>'+
'<td width="100%" align="right" background="i/misc/dmagic/b'+names[mtype*10]+'_29.gif"></td>'+
'<td width="'+names[mtype*10+5]+'" align="right"><img src="i/misc/dmagic/b'+names[mtype*10]+'_31.gif" width="'+names[mtype*10+5]+'" height="'+names[mtype*10+6]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table>';
return s;
}
+35
View File
@@ -0,0 +1,35 @@
function qn_win(t,obr) {
$('#qsst').html(
'<table width="710" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
'<td width="12"><div style="position:relative;"> <img style="display:block; position:absolute; top:-27px; left:598px;" src="i/ric1_2g.png" width="147" height="72">'+
'<img style="display:block; position:absolute; top:-27px; left:-35px;" src="i/ric12g.png" width="147" height="72"></div></td>'+
'<td height="9" background="i/line_32g.png"><img src="http://img.combatz.ru/1x1.gif" style="display:block" height="1" width="1"></td>'+
'<td width="12"></td>'+
'</tr>'+
'<tr>'+
'<td background="i/line_12g.png">&nbsp;</td>'+
'<td bgcolor="#EBEBEB" style="padding:20px">'+
'<!-- enter -->'+
'<div style="width:150px;float:left;text-align:center;"><img src="http://combatz.ru/bot_q/'+obr+'.jpg" width="140" height="170"><br><br><center><a href="javascript:void(0)" onclick="top.qn_slk(\''+obr+'\')">Свернуть</a></center></div><div style="width:485px;float:right;">'+t+'</div>'+
'<!-- enter -->'+
'</td>'+
'<td background="i/line_22g.png">&nbsp;</td>'+
'</tr>'+
'<tr>'+
'<td><div style="position:relative;"> <img style="display:block; position:absolute; top:-32px; left:606px;" src="i/ric2_2g.png" width="111" height="63"> <img style="display:block; position:absolute; top:-32px; left:-7px;" src="i/ric22g.png" width="111" height="63"> </div></td>'+
'<td height="9" background="i/line_42g.png"><img style="display:block" height="1" width="1"></td>'+
'<td></td>'+
'</tr>'+
'</table>'
);
if(top.qst_sml == '') {
$('#qsst').css('display','block');
}else{
if(top.qst_sml != obr) {
$('#mini_qsst').html('<img src="http://combatz.ru/bot_q/mini_'+obr+'.png" width="50" height="50">');
}
}
$('#qsst').center();
}
+280
View File
@@ -0,0 +1,280 @@
function H(isOutBox){
this.document = document;
this.isOutBox = isOutBox;
this.iframe = this.isOutBox ? $('#mainbox') : $('body');
// DOM-элемент, который перехватывает клик по логину
//this.grabLogin = null;
// DOM-элемент, который перехватывает клик по названию шмотки
//this.grabItem = null;
this.grabLogin = new Grabber({inputClass: 'grabLogin'});
this.grabItem = new Grabber({inputClass: 'grabLogin'});
// storage
this.data = {};
}
H.prototype.toString = function(){
return 'This is H-object';
}
H.prototype.getMainBox = function(){
return this.isOutBox ? this.iframe.contents().find('body') : $('body');
}
H.prototype.loadMainBox = function(location){
location = location || '/main.php';
this.iframe.attr('src',location);
}
H.prototype.loadDocument = function(location){
this.document.location = location;
}
// ======== storage
H.prototype.set = function(key, value){
this.data[key] = value;
}
H.prototype.get = function(key, defaultValue){
return undefined == this.data[key] ? defaultValue : this.data[key];
}
H.prototype.setHP = function(id, curHP, maxHP){
curHP = curHP || 0;
maxHP = maxHP || 0;
var hp = this.getMainBox().find('#hpKey_'+id);
if(hp.length < 1){
return false;
}
var hpA = $('img:eq(1)', hp);
var hpB = $('img:eq(2)', hp);
var redHP = 0.33; // меньше 30% красный цвет
var yellowHP = 0.66; // меньше 60% желтый цвет, иначе зеленый
if(curHP > maxHP){
curHP = maxHP;
}
var text = curHP + '/' + maxHP;
var lengthHP = 170 - (text.length - 1) * 8;
var sizeFirst = Math.round((lengthHP / maxHP) * curHP);
var sizeSecond = lengthHP - sizeFirst;
hpA.attr('width', sizeFirst);
hpB.attr('width', sizeSecond);
if(curHP / maxHP < redHP){
hpA.attr('src', '/i/1red.gif');
}else{
if(curHP / maxHP < yellowHP){
hpA.attr('src', '/i/1yellow.gif');
}else{
hpA.attr('src', '/i/1green.gif');
}
}
hp.html(hp.html().substring(0, hp.html().lastIndexOf(':') + 1) + Math.round(curHP) + "/" + maxHP);
}
/* ------------------ перехват клика по логину юзера -------------------------------------------- * /
H.prototype.setGrabLogin = function(input){
var obj = this;
this.clearGrabLogin();
var tmp = $(input);
if(tmp.length > 0){
this.grabLogin = tmp.get(0);
$(this.grabLogin)
.addClass('grabLogin')
.dblclick(function(){obj.toggleGrabLogin(this)})
.select();
return true;
}
return false;
}
H.prototype.clearGrabLogin = function(){
$(this.grabLogin).removeClass('grabLogin');
this.grabLogin = null;
},
H.prototype.toggleGrabLogin = function(input){
if($(input).hasClass('grabLogin')){
this.clearGrabLogin();
}else{
this.setGrabLogin($(input));
}
}
/* -------------------------------- простые диалоги --------------------------------------------- */
H.prototype.sdOptionsDefault = {
formMethod: 'POST',
formAction: '',
formClass: '',
title: 'заголовок не указан',
width: 250,
data: {},
content: '<span>контент не указан</span>',
onSubmit: function(){return true;},
onClose: function(){this.remove()}
}
H.prototype._sd = function(options){
options = $.extend({}, this.sdOptionsDefault, options);
var m = $('<div class="sd-container"></div>').css('width',options.width);
var t = $('<div class="sd-title">').text(options.title);
var c = $('<img class="sd-closer" src="/i/clear.gif" title="Закрыть окно" alt="X">')
.click(function(){return options.onClose.call($(this).closest('div.sd-container'))});
var f = $('<form class="sd-form"></form>')
.attr('method', options.formMethod)
.attr('action', options.formAction)
.submit(function(){return options.onSubmit.call($(this).closest('div.sd-container'))});
for(var i in options.data){
$('<input type=hidden>').attr('name',i).val(options.data[i]).appendTo(f);
}
if(options.formClass){
f.addClass(options.formClass);
}
$('div.sd-container', this.getMainBox()).remove();
return m.append(t.prepend(c)).append(f.append(options.content));
}
H.prototype.sd = function(options){
var tmp = this._sd(options);
return this.getMainBox().append(tmp);
}
H.prototype.sdOneInput = function(options){
var onSubmit2 = options.onSubmit;
options = $.extend({},this.sdOptionsDefault, {inputName: 'target', inputValue: '', grabber: null}, options);
var i = $('<input type="text" class="text">')
.css({'width': options.width - 45})
.attr('name',options.inputName)
.val(options.inputValue);
if(options.grabber && this[options.grabber] instanceof Grabber){
this[options.grabber].set(i);
}else{
i.select();
}
options.content.append($('<div></div>')
.append(i)
.append('<input type="submit" class="button" style="width:33px;" value=" »» ">'));
options.onSubmit = function(){
var v = i.val($.trim(i.val())).val();
if(v.length <= 0){
alert('Не заполнено обязательное поле');
return false
}
if(typeof onSubmit2 == 'function'){
return onSubmit2.call(this);
}
return true;
}
return this.sd(options);
}
H.prototype.sdLogin = function(options){
options.content = $('<div>Укажите логин персонажа:<br><small>(можно кликнуть по логину в чате)</small></div>');
options.grabber = 'grabLogin';
return this.sdOneInput(options);
}
H.prototype.sdItem = function(options){
options.content = $('<div>Укажите название или s/n предмета:<br><small>(можно кликнуть по названию в рюкзаке)</small></div>');
options.grabber = 'grabItem';
options.width = 270;
return this.sdOneInput(options);
}
/**
* Функция для обратной совместимости
* Не надо её использовать в новом коде!
*/
H.prototype.sdFindLogin = function(title, formAction, inputName, inputValue){
return this.sdLogin({
title: title,
formAction: formAction,
inputName: inputName,
inputValue: inputValue});
}
/**
* Функция для обратной совместимости
* Не надо её использовать в новом коде!
*/
H.prototype.sdFindItem = function(title, formAction, inputName, inputValue){
return this.sdItem({
title: title,
formAction: formAction,
inputName: inputName,
inputValue: inputValue});
}
/* ----------------------- вывод системных сообщений -------------------------------------------- */
H.prototype._popupConfig = {
'd':[10000, 'Отладочное сообщение'],
'i':[3000 , 'Сообщение'],
'w':[5000 , 'Предупреждение'],
'e':[0 , 'Ошибка']
}
H.prototype.msgPopup = function(type, text){
if(this._popupConfig[type] == undefined){
type = 'w';
}
var conf = this._popupConfig[type];
$.jGrowl(text,{
header: '<img src="/i/jgrowl_moover.png" alt="<>" class="jgrowl-moover" title="Передвинуть"> ' + conf[1],
glue: 'before',
life: conf[0],
sticky: conf[0] <= 0,
theme: 'msg_' + type
});
}
/* ================== перехват клика на логине/шмотке и т.п. ==================================== */
function Grabber(options){
this.options = $.extend({}, this.optionsDef, options);
this.input = null;
}
Grabber.prototype.toString = function(){
return 'This is Grabber-object';
}
Grabber.prototype.optionsDef = {
inputClass: 'grab'
}
Grabber.prototype.get = function(){
return this.input;
}
Grabber.prototype.isActive = function(){
return $(this.input).is(':visible');
}
Grabber.prototype.set = function(input){
var obj = this;
this.clear();
var tmp = $(input);
if(tmp.length > 0){
this.input = tmp.get(0);
$(this.input)
.addClass(this.options.inputClass)
.dblclick(function(){obj.toggle(this)})
.select();
return true;
}
return false;
}
Grabber.prototype.clear = function(){
$(this.input).removeClass(this.options.inputClass);
this.input = null;
},
Grabber.prototype.toggle = function(input){
if($(input).hasClass(this.options.inputClass)){
this.clear();
}else{
this.set($(input));
}
}
+20
View File
@@ -0,0 +1,20 @@
var CtrlPress=false,doc=document;
var rnd=Math.random(),
redHP=0.33,
yellowHP=0.66,
TimerOn=-1,
tkHP,
maxHP,
speed=100,
mspeed=100;
function setHP(a,b,c){
tkHP=a;
maxHP=b;
vrem=c;
if(TimerOn>=0){
clearTimeout(TimerOn);TimerOn=-1}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<redHP?"i/1red.gif":tkHP/maxHP<yellowHP?"i/1yellow.gif":"i/1green.gif";b=doc.all("HP").innerHTML;doc.all("HP").innerHTML=Math.round(tkHP)+"/"+maxHP}if(vrem>0){tkHP+=maxHP/(vrem*60);}if(TimerOn!=-1)TimerOn=setTimeout("setHPlocal()",delay*100)}
+119
View File
@@ -0,0 +1,119 @@
function NewErrorTrap() { return true; }
function errtrap(nick)
{
var OldErrorTrap = window.onerror;
window.onerror = NewErrorTrap;
if (window.opener) { // && window.opener.top.delay) {
document.write('<IMG SRC=../i/lock3.gif WIDTH=20 HEIGHT=15 ALT="Приватное сообщение" onclick="window.opener.top.AddToPrivate(\''+nick+'\', true)" style="cursor:hand">');
}
if (document.log != null) { window.top.location="/index.htm"; }
window.onerror = OldErrorTrap;
}
function fastshow (content) {
var el = document.getElementById("mmoves");
var o = window.event.srcElement;
if (content!='' && el.style.visibility != "visible") {el.innerHTML = '<small>'+content+'</small>';}
var x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft + 3;
var y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop+5;
el.style.left = x + "px";
el.style.top = y + "px";
if (el.style.visibility != "visible") {
el.style.visibility = "visible";
}
}
var gift = new Array('','',''); // gift_from_before, gift_from_after, gift_from_anonym;
function quoteString(str){
str = str.replace(/\\/g,'\\\\');
str = str.replace(/\'/g,'\\\'');
str = str.replace(/\"/g,'\\"');
str = str.replace(/\n/g,'\\n');
return "'" + str + "'";
}
function DrawGift(name, flag, title, text, from, uid, width, height){
var s = ('<IMG SRC="../i/items/'+name+'.gif" WIDTH='+width+' HEIGHT='+height+' style="cursor: hand;" ALT="');
if (text)s+=text+"\n";
s += (from?(gift[0] + from + gift[1]):gift[2]) + '"' +
' onclick="HideGift();ShowGift('+ quoteString(title)+ ', ' + quoteString(name) +', ' +
flag + ', ' + quoteString(text)+', '+ quoteString(from)+', this.offsetTop'+(uid?(',\''+uid+'\''):'')+');"'+
'>';
document.writeln(s);
}
function DG1(name, flag, title, text, from, uid){
DrawGift(name, flag, title, text, from, uid, 61, 60);
}
function DG2(name, flag, title, text, from, uid){
DrawGift(name, flag, title, text, from, uid, 80, 74);
}
function DF(name, flag, title, text, from, uid){
DrawGift(name, flag, title, text, from, uid, 60, 60);
}
function quote_url(s){
var from = Array('+', ' ', '#');
var to = Array('%2B', '+', '%23');
for(var i=0;i<from.length;++i) while(s.indexOf(from[i])>=0) s= s.replace(from[i],to[i]);
return s;
}
function ShowGift(title, name, img, text, from, y, uid) {
var el = document.getElementById("mgift");
var o = window.event.srcElement;
var stitle = (img & 8)?
'<a href="/encicl/object/'+ name +'.html" target=_blank>' + title + '</a>':
((img & 2)?'<a target=_blank href="../i/items/big/3d'+name+'.jpg">' + title + '</a>':
title);
if (el.style.visibility !='visible'){
if (uid){
if (parseInt(uid))from = gift[0] + '<a target=_blank href="/inf.php?'+uid+'">' + from + '</a>' + gift[1];
else from = gift[0] + '<a target=_blank href="/encicl/klan/'+uid+'.html">' + from + '</a>' + gift[1];
}else if (from) from = gift[0] + ((from == 'АНТИБК Online')?from:'<a target=_blank href="/inf.php?login='+quote_url(from)+'">' + from + '</a>') + gift[1];
if (!from) from = gift[2];
document.getElementById("mgift_sign").innerHTML = '<small>' + (text?text+'<br>':'') + from + '</small>';
document.getElementById("mgift_title").innerHTML = '<small><b>' + stitle + '</b></small>';
var eimg = document.getElementById("mgift_pict");
if (!(img & 6)){
eimg.innerHTML = '<br><img src=../i/items/' +name+ '.gif alt="'+title+'"><br><br>';
} else {
var s = ((img & 4)?'middle/':'big/3d');
eimg.innerHTML = '<img width=240 src="../i/items/' + s + name + '.jpg" '+ (img==5?'':' height=180')+'alt="' + title + '">';
}
}
var x = 15;
// var y = y; # window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
el.style.left = x + "px";
el.style.top = y + "px";
if (el.style.visibility != "visible") {
el.style.visibility = "visible";
}
}
function hideshow () {
document.getElementById("mmoves").style.visibility = 'hidden';
}
function HideGift () {
document.getElementById("mgift").style.visibility = 'hidden';
}
function drawDivs(){
document.writeln('<div id="mmoves" style="background-color:#FFFFCC; visibility:hidden; overflow:visible; position:absolute; border-color:#666666; border-style:solid; border-width: 1px; padding: 2px; white-space: nowrap;"></div>');
document.writeln('<div id="mgift" style="background-color:#FFFFCC; z-index:99; visibility:hidden; overflow:visible; position:absolute; border-color:#666666; border-style:solid; border-width: 1px; padding: 2px;">');
document.writeln('<table width=240 border=0 cellpadding=0 cellspacing=0>' +
'<tr><td align=left id=mgift_title></td><td align=right><font color=red>'+
'<a href="javascript:void(0);" onclick="HideGift(); return 0;"><b>x</b></a>'+
'</font></td></tr>'+
'<tr><td colspan=2><img src="../i/1x1.gif" alt="" width=240 height=1 border=0></td></tr>'+
'<tr><td colspan=2 id=mgift_pict align=center bgcolor="#dedede"><td></tr>' +
'<tr><td colspan=2 id=mgift_sign></td></tr></table></div>');
}
+138
View File
@@ -0,0 +1,138 @@
//------------------------------------
function MagicInput(options, data, callback){
this.data = data;
this.options = options;
this._callback = callback;
}
MagicInput.prototype.toString = function(){
return 'This is MagicInput object';
}
MagicInput.prototype.callback = function(){
this._callback.apply(this, arguments);
}
MagicInput.instance = function(el, data, callback){
// var options = $(el).mapAttributes('mi-', true);
el = $(el);
var options = {};
options['action'] = el.attr('mi-action');
options['title'] = el.attr('mi-title');
options['iface'] = el.attr('mi-iface');
options['data'] = el.attr('mi-data');
try{
$.extend(data, options.data ? $.parseJSON(options.data) : {});
delete options.data;
options.iface = 'mi' + options.iface.substring(0,1).toUpperCase() + options.iface.substring(1);
return input = new window[options.iface](options, data, callback);
}catch(e){
console.log('MagicInput::instance ' + e);
throw e;
}
}
//------------------------------------
function miNone(options, callback){
miNote.superclass.constructor.apply(this, arguments);
this.callback();
}
extend(miNone, MagicInput);
miNone.prototype.toString = function(){
return 'This is miNone object';
}
//------------------------------------
function miNote(options, callback){
miNote.superclass.constructor.apply(this, arguments);
if(confirm('Eniieuciaaou "'+this.options.title+'" nae?an?')){
this.callback()
}
}
extend(miNote, MagicInput);
miNote.prototype.toString = function(){
return 'This is miNote object';
}
//------------------------------------
function miDialog(options, data, callback, content, dialogOptions){
miDialog.superclass.constructor.apply(this, arguments);
var mi = this;
this.dialog = content.dialog($.extend({},{
title: this.options.title,
resizable: false,
minHeight: 20,
dialogClass: 'sand-style mi-container',
beforeClose: function(e, ui){
var tmp = true;
if(1 * $(this).attr('submit')){
mi._collect.call(mi);
if(tmp = mi._validation.call(mi)){
return true;
}
}
$(this).attr('submit', 0);
return tmp;
},
close: function(e, ui){
if(1 * $(this).attr('submit')){
mi.callback();
}
mi.destroy();
}
}, dialogOptions))
.on('click','.dialog-submit',function(){
$(this).closest('.ui-dialog-content').attr('submit', 1).dialog('close')
})
}
extend(miDialog, MagicInput);
miDialog.prototype.toString = function(){
return 'This is ABSTRACT miDialog object';
}
miDialog.prototype.destroy = function(){
this.dialog.dialog('destroy').remove();
}
miDialog._oneInput = function(p){
var i = $('<input type='+(p.type ? p.type : 'text')+' class=text>').attr('name',p.name);
if(p.grabber){
h[p.grabber].set(i);
}else{
i.select();
}
return $('<div class=oneinput></div>')
.append('<input type=button class="button dialog-submit" value=" »» ">')
.append($('<div></div>').append(i));
}
miDialog.prototype._collect = function(){
var mi = this;
this.dialog.find('[name]').each(function(){
var el = $(this);
if(el.is('input[type="checkbox"]')){
mi.data[el.attr('name')] = ~~el.is(':checked');
return;
}
mi.data[el.attr('name')] = el.val();
})
}
miDialog.prototype._validation = function(){
return true;
}
function miUser(options, data, callback){
var mi = this;
miUser.superclass.constructor.call(this, options, data, callback,
$('<div>Укажите логин персонажа :<br /><small>(можно кликнуть по логину в чате)</small></div>')
.append(miDialog._oneInput({name:'victim',grabber:'grabLogin'})),
{width: 250});
}
extend(miUser, miDialog);
miUser.prototype._validation = function(){
this.data.victim = $.trim(this.data.victim);
return miUser.superclass._validation.apply(this)
&& this.data.victim.length > 0;
}
+4
View File
File diff suppressed because one or more lines are too long
+51
View File
@@ -0,0 +1,51 @@
/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { // name and value given, set cookie
options = options || {};
if (value === null) {
value = '';
options.expires = -1;
}
var expires = '';
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
}
// CAUTION: Needed to parenthesize options.path and options.domain
// in the following expressions, otherwise they evaluate to undefined
// in the packed version for some reason...
var path = options.path ? '; path=' + (options.path) : '';
var domain = options.domain ? '; domain=' + (options.domain) : '';
var secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
} else { // only name given, get cookie
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
};
+7179
View File
File diff suppressed because it is too large Load Diff
+2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+26
View File
@@ -0,0 +1,26 @@
/*
* SimpleModal 1.4.4 - jQuery Plugin
* http://simplemodal.com/
* Copyright (c) 2013 Eric Martin
* Licensed under MIT and GPL
* Date: Sun, Jan 20 2013 15:58:56 -0800
*/
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):b(jQuery)})(function(b){var j=[],n=b(document),k=navigator.userAgent.toLowerCase(),l=b(window),g=[],o=null,p=/msie/.test(k)&&!/opera/.test(k),q=/opera/.test(k),m,r;m=p&&/msie 6./.test(k)&&"object"!==typeof window.XMLHttpRequest;r=p&&/msie 7.0/.test(k);b.modal=function(a,h){return b.modal.impl.init(a,h)};b.modal.close=function(){b.modal.impl.close()};b.modal.focus=function(a){b.modal.impl.focus(a)};b.modal.setContainerDimensions=
function(){b.modal.impl.setContainerDimensions()};b.modal.setPosition=function(){b.modal.impl.setPosition()};b.modal.update=function(a,h){b.modal.impl.update(a,h)};b.fn.modal=function(a){return b.modal.impl.init(this,a)};b.modal.defaults={appendTo:"body",focus:!0,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:!1,autoPosition:!0,zIndex:1E3,
close:!0,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:!0,overlayClose:!1,fixed:!0,position:null,persist:!1,modal:!0,onOpen:null,onShow:null,onClose:null};b.modal.impl={d:{},init:function(a,h){if(this.d.data)return!1;o=p&&!b.support.boxModel;this.o=b.extend({},b.modal.defaults,h);this.zIndex=this.o.zIndex;this.occb=!1;if("object"===typeof a){if(a=a instanceof b?a:b(a),this.d.placeholder=!1,0<a.parent().parent().size()&&(a.before(b("<span></span>").attr("id",
"simplemodal-placeholder").css({display:"none"})),this.d.placeholder=!0,this.display=a.css("display"),!this.o.persist))this.d.orig=a.clone(!0)}else if("string"===typeof a||"number"===typeof a)a=b("<div></div>").html(a);else return alert("SimpleModal Error: Unsupported data type: "+typeof a),this;this.create(a);this.open();b.isFunction(this.o.onShow)&&this.o.onShow.apply(this,[this.d]);return this},create:function(a){this.getDimensions();if(this.o.modal&&m)this.d.iframe=b('<iframe src="javascript:false;"></iframe>').css(b.extend(this.o.iframeCss,
{display:"none",opacity:0,position:"fixed",height:g[0],width:g[1],zIndex:this.o.zIndex,top:0,left:0})).appendTo(this.o.appendTo);this.d.overlay=b("<div></div>").attr("id",this.o.overlayId).addClass("simplemodal-overlay").css(b.extend(this.o.overlayCss,{display:"none",opacity:this.o.opacity/100,height:this.o.modal?j[0]:0,width:this.o.modal?j[1]:0,position:"fixed",left:0,top:0,zIndex:this.o.zIndex+1})).appendTo(this.o.appendTo);this.d.container=b("<div></div>").attr("id",this.o.containerId).addClass("simplemodal-container").css(b.extend({position:this.o.fixed?
"fixed":"absolute"},this.o.containerCss,{display:"none",zIndex:this.o.zIndex+2})).append(this.o.close&&this.o.closeHTML?b(this.o.closeHTML).addClass(this.o.closeClass):"").appendTo(this.o.appendTo);this.d.wrap=b("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(this.d.container);this.d.data=a.attr("id",a.attr("id")||this.o.dataId).addClass("simplemodal-data").css(b.extend(this.o.dataCss,{display:"none"})).appendTo("body");this.setContainerDimensions();
this.d.data.appendTo(this.d.wrap);(m||o)&&this.fixIE()},bindEvents:function(){var a=this;b("."+a.o.closeClass).bind("click.simplemodal",function(b){b.preventDefault();a.close()});a.o.modal&&a.o.close&&a.o.overlayClose&&a.d.overlay.bind("click.simplemodal",function(b){b.preventDefault();a.close()});n.bind("keydown.simplemodal",function(b){a.o.modal&&9===b.keyCode?a.watchTab(b):a.o.close&&a.o.escClose&&27===b.keyCode&&(b.preventDefault(),a.close())});l.bind("resize.simplemodal orientationchange.simplemodal",
function(){a.getDimensions();a.o.autoResize?a.setContainerDimensions():a.o.autoPosition&&a.setPosition();m||o?a.fixIE():a.o.modal&&(a.d.iframe&&a.d.iframe.css({height:g[0],width:g[1]}),a.d.overlay.css({height:j[0],width:j[1]}))})},unbindEvents:function(){b("."+this.o.closeClass).unbind("click.simplemodal");n.unbind("keydown.simplemodal");l.unbind(".simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var a=this.o.position;b.each([this.d.iframe||null,!this.o.modal?null:this.d.overlay,
"fixed"===this.d.container.css("position")?this.d.container:null],function(b,e){if(e){var f=e[0].style;f.position="absolute";if(2>b)f.removeExpression("height"),f.removeExpression("width"),f.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'),f.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"');else{var c,d;a&&a.constructor===
Array?(c=a[0]?"number"===typeof a[0]?a[0].toString():a[0].replace(/px/,""):e.css("top").replace(/px/,""),c=-1===c.indexOf("%")?c+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(c.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',a[1]&&(d="number"===typeof a[1]?
a[1].toString():a[1].replace(/px/,""),d=-1===d.indexOf("%")?d+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(d.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')):(c='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',
d='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"');f.removeExpression("top");f.removeExpression("left");f.setExpression("top",c);f.setExpression("left",d)}}})},focus:function(a){var h=this,a=a&&-1!==b.inArray(a,["first","last"])?a:"first",e=b(":input:enabled:visible:"+a,h.d.wrap);setTimeout(function(){0<e.length?e.focus():h.d.wrap.focus()},
10)},getDimensions:function(){var a="undefined"===typeof window.innerHeight?l.height():window.innerHeight;j=[n.height(),n.width()];g=[a,l.width()]},getVal:function(a,b){return a?"number"===typeof a?a:"auto"===a?0:0<a.indexOf("%")?parseInt(a.replace(/%/,""))/100*("h"===b?g[0]:g[1]):parseInt(a.replace(/px/,"")):null},update:function(a,b){if(!this.d.data)return!1;this.d.origHeight=this.getVal(a,"h");this.d.origWidth=this.getVal(b,"w");this.d.data.hide();a&&this.d.container.css("height",a);b&&this.d.container.css("width",
b);this.setContainerDimensions();this.d.data.show();this.o.focus&&this.focus();this.unbindEvents();this.bindEvents()},setContainerDimensions:function(){var a=m||r,b=this.d.origHeight?this.d.origHeight:q?this.d.container.height():this.getVal(a?this.d.container[0].currentStyle.height:this.d.container.css("height"),"h"),a=this.d.origWidth?this.d.origWidth:q?this.d.container.width():this.getVal(a?this.d.container[0].currentStyle.width:this.d.container.css("width"),"w"),e=this.d.data.outerHeight(!0),f=
this.d.data.outerWidth(!0);this.d.origHeight=this.d.origHeight||b;this.d.origWidth=this.d.origWidth||a;var c=this.o.maxHeight?this.getVal(this.o.maxHeight,"h"):null,d=this.o.maxWidth?this.getVal(this.o.maxWidth,"w"):null,c=c&&c<g[0]?c:g[0],d=d&&d<g[1]?d:g[1],i=this.o.minHeight?this.getVal(this.o.minHeight,"h"):"auto",b=b?this.o.autoResize&&b>c?c:b<i?i:b:e?e>c?c:this.o.minHeight&&"auto"!==i&&e<i?i:e:i,c=this.o.minWidth?this.getVal(this.o.minWidth,"w"):"auto",a=a?this.o.autoResize&&a>d?d:a<c?c:a:f?
f>d?d:this.o.minWidth&&"auto"!==c&&f<c?c:f:c;this.d.container.css({height:b,width:a});this.d.wrap.css({overflow:e>b||f>a?"auto":"visible"});this.o.autoPosition&&this.setPosition()},setPosition:function(){var a,b;a=g[0]/2-this.d.container.outerHeight(!0)/2;b=g[1]/2-this.d.container.outerWidth(!0)/2;var e="fixed"!==this.d.container.css("position")?l.scrollTop():0;this.o.position&&"[object Array]"===Object.prototype.toString.call(this.o.position)?(a=e+(this.o.position[0]||a),b=this.o.position[1]||b):
a=e+a;this.d.container.css({left:b,top:a})},watchTab:function(a){if(0<b(a.target).parents(".simplemodal-container").length){if(this.inputs=b(":input:enabled:visible:first, :input:enabled:visible:last",this.d.data[0]),!a.shiftKey&&a.target===this.inputs[this.inputs.length-1]||a.shiftKey&&a.target===this.inputs[0]||0===this.inputs.length)a.preventDefault(),this.focus(a.shiftKey?"last":"first")}else a.preventDefault(),this.focus()},open:function(){this.d.iframe&&this.d.iframe.show();b.isFunction(this.o.onOpen)?
this.o.onOpen.apply(this,[this.d]):(this.d.overlay.show(),this.d.container.show(),this.d.data.show());this.o.focus&&this.focus();this.bindEvents()},close:function(){if(!this.d.data)return!1;this.unbindEvents();if(b.isFunction(this.o.onClose)&&!this.occb)this.occb=!0,this.o.onClose.apply(this,[this.d]);else{if(this.d.placeholder){var a=b("#simplemodal-placeholder");this.o.persist?a.replaceWith(this.d.data.removeClass("simplemodal-data").css("display",this.display)):(this.d.data.hide().remove(),a.replaceWith(this.d.orig))}else this.d.data.hide().remove();
this.d.container.hide().remove();this.d.overlay.hide();this.d.iframe&&this.d.iframe.hide().remove();this.d.overlay.remove();this.d={}}}}});
+6
View File
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+56
View File
File diff suppressed because one or more lines are too long
+21
View File
@@ -0,0 +1,21 @@
function DrawBar(title, id, flags, link_text, link){
// alert(title + document);
var s ='<table width="100%" border=0 cellspacing=0 cellpadding=1 background="http://img.combats.com/i/icon/back.gif">' +
'<tr><td valign=top>';
var sz = 11, num = 1;
var rnd = Math.random();
s += '<a name="bar__'+id+'" href="?edit='+rnd+'&bar='+id+'&a=explore&is_open='+(1-(flags & 1))+'#bar_'+id+'">';
if (flags & 1) {
s+= '<img width='+sz+' height=9 alt="Скрыть" border=0 src="http://img.combats.com/i/icon/'+num+'minus.gif">';
} else {
s+= '<img width='+sz+' height=9 alt="Показать" border=0 src="http://img.combats.com/i/icon/'+num+'plus.gif">';
}
s += '</a> </td>';
s += '<td>&nbsp;</td><td bgcolor="#e2e0e0"><small>&nbsp;<b>'+title+':<b>&nbsp;</small></td>';
if (link_text){
s += '<td>&nbsp;</td><td bgcolor="#e2e0e0"><small>&nbsp;<a href="'+link+'">'+link_text+'</a>&nbsp;</small></td>';
}
s += '</tr></table>';
// window.clipboardData.setData('Text', s);
document.writeln(s);
}
+142
View File
@@ -0,0 +1,142 @@
function close_hint(id) {
document.getElementById('hint'+id+'').style.visibility = 'hidden';
Hint3Name = '';
}
function DrawBar(title, id, flags, link_text, link){
var s ='<table width="100%" border=0 cellspacing=0 cellpadding=1 background="http://img.combats.com/i/icon/back.gif">' +
'<tr><td valign=top>';
var sz = 11, num = 1;
var rnd = Math.random();
s += '<a name="bar__'+id+'" href="?edit='+rnd+'&bar='+id+'&a=explore&is_open='+(1-(flags & 1))+'#bar_'+id+'">';
if (flags & 1) {
s+= '<img width='+sz+' height=9 alt="Скрыть" border=0 src="http://img.combats.com/i/icon/'+num+'minus.gif">';
} else {
s+= '<img width='+sz+' height=9 alt="Показать" border=0 src="http://img.combats.com/i/icon/'+num+'plus.gif">';
}
s += '</a> </td>';
s += '<td>&nbsp;</td><td bgcolor="#e2e0e0"><small>&nbsp;<b>'+title+':<b>&nbsp;</small></td>';
if (link_text){
s += '<td>&nbsp;</td><td bgcolor="#e2e0e0"><small>&nbsp;<a href="'+link+'">'+link_text+'</a>&nbsp;</small></td>';
}
s += '<td align=right valign=top width="100%">';
s += ' </td>';
s += '</tr></table>';
document.writeln(s);
}
function splitstack(title, script, img, st) {
var s;
if (st==1) {
s='<form action="'+script+'" method=POST name=slform><table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>'+
'<TABLE width=100%><TD><IMG src="/i/sh/'+img+'"></TD><TD>\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u043F\u0440\u0435\u0434\u043C\u0435\u0442 <b>'+title+'</b></TABLE> \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E: <input type="text" name="qty" value="1"> </TD></TR><TR><TD width=50% align=left><INPUT TYPE="button" name="tmpname423" value="\u0414\u0430" style="width:70%" onclick="if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(slform.use.value); closehint3(); } "></TD><TD width=50% align=right><INPUT type=button style="width:70%" value="\u041D\u0435\u0442" onclick="closehint3();"></TD></TR></TABLE></FORM>';
s = crtmagic(0, '\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u043F\u0440\u0435\u0434\u043C\u0435\u0442?', s);
} else {
s='<form action="'+script+'" method=POST name=slform><table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>'+
'<TABLE width=100%><TD><IMG src="/i/sh/'+img+'"></TD><TD>\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u043D\u0430 \u0440\u0430\u0432\u043D\u044B\u0435 \u0447\u0430\u0441\u0442\u0438 <b>'+title+'</b></TABLE> \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0447\u0430\u0441\u0442\u0435\u0439: <input type="text" name="qty" value="2"> </TD></TR><TR><TD width=50% align=left><INPUT TYPE="button" name="tmpname423" value="\u0414\u0430" style="width:70%" onclick="if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(slform.use.value); closehint3(); } "></TD><TD width=50% align=right><INPUT type=button style="width:70%" value="\u041D\u0435\u0442" onclick="closehint3();"></TD></TR></TABLE></FORM>';
s = crtmagic(0, '\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u043D\u0430 \u0440\u0430\u0432\u043D\u044B\u0435?', s);
}
document.all("hint3").innerHTML = s;
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 200;
document.all("hint3").style.top = 100;
if (!("autofocus" in document.createElement("input"))) {document.all("tmpname423").focus();}
Hint3Name = name;
}
var sd4 = 0;
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;
}
function crtmagic(mtype, title, body, subm, noclose) {
return crtmagic_full(mtype, title, body, subm, noclose, 270, 0);
}
function crtmagic_full(mtype, title, body, subm, noclose, dx, dy) {
//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#', '/i/misc/dmagic/'+names[mtype*10]+'_30.gif');
var s='<table width="'+dx+(dy?'" height="'+dy:'')+'" border="0" align="center" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+1]+'" align="left"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_03.gif" width="'+names[mtype*10+1]+'" height="'+names[mtype*10+2]+'"></td>'+
'<td width="100%" align="right" background="/i/misc/dmagic/b'+names[mtype*10]+'_05.gif"></td>'+
'<td width="'+names[mtype*10+3]+'" align="right"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_07.gif" width="'+names[mtype*10+3]+'" height="'+names[mtype*10+2]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
(names[mtype*10+7]?'<td width="'+names[mtype*10+7]+'"><SPAN style="width:'+names[mtype*10+7]+'">&nbsp;</SPAN></td>':'')+
'<td width="5" background="/i/misc/dmagic/b'+names[mtype*10]+'_17.gif">&nbsp;</td>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td bgcolor="#'+colors[mtype*2]+'"'+(names[mtype*10+9]?' style="padding-top: '+names[mtype*10+9]+'"':'')+' >'+
'<table border=0 width=100% cellspacing="0" cellpadding="0"><td style="padding-left: 20" align=center><B>'+title+
'</td><td width=20 align=right valign=top style="cursor: hand" '+(noclose?'':'onclick="close_hint(4);" ') + ' /><IMG src="/i/clear.gif" width=13 height=13>&nbsp;</td></table>'+
'</td></tr>'+
'<tr>'+
'<td align="center" bgcolor="#'+colors[mtype*2+1]+'">'+body+
'</tr>'+
'</table></td>'+
'<td width="5" background="/i/misc/dmagic/b'+names[mtype*10]+'_19.gif">&nbsp;</td>'+
(names[mtype*10+8]?'<td width="'+names[mtype*10+8]+'"><SPAN style="width:'+names[mtype*10+8]+'">&nbsp;</SPAN></td></td>':'')+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+4]+'" align="left"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_27.gif" width="'+names[mtype*10+4]+'" height="'+names[mtype*10+6]+'"></td>'+
'<td width="100%" align="right" background="/i/misc/dmagic/b'+names[mtype*10]+'_29.gif"></td>'+
'<td width="'+names[mtype*10+5]+'" align="right"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_31.gif" width="'+names[mtype*10+5]+'" height="'+names[mtype*10+6]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table>';
return s;
}
+145
View File
@@ -0,0 +1,145 @@
function extend(Child, Parent) {
var F = function() { }
F.prototype = Parent.prototype
Child.prototype = new F()
Child.prototype.constructor = Child
Child.superclass = Parent.prototype
}
function MagicInput(options, data, callback) {
this.data = data;
this.options = options;
this._callback = callback;
}
MagicInput.prototype.toString = function() {
return 'This is MagicInput object';
}
MagicInput.prototype.callback = function() {
this._callback.apply(this, arguments);
}
MagicInput.instance = function(el, data, callback) {
el = $(el);
var options = {};
options['action'] = el.attr('mi-action');
options['title'] = el.attr('mi-title');
options['iface'] = el.attr('mi-iface');
options['data'] = el.attr('mi-data');
try {
$.extend(data, options.data ? $.parseJSON(options.data) : {});
delete options.data;
options.iface = 'mi' + options.iface.substring(0, 1).toUpperCase() + options.iface.substring(1);
return input = new window[options.iface](options, data, callback);
} catch(e) {
console.log('MagicInput::instance ' + e);
throw e;
}
}
function miNone(options, callback) {
miNote.superclass.constructor.apply(this, arguments);
this.callback();
}
extend(miNone, MagicInput);
miNone.prototype.toString = function() {
return 'This is miNone object';
}
function miNote(options, callback) {
miNote.superclass.constructor.apply(this, arguments);
if(confirm('Использовать "'+this.options.title+'" сейчас?')) {
this.callback()
}
}
extend(miNote, MagicInput);
miNote.prototype.toString = function() {
return 'This is miNote object';
}
function miDialog(options, data, callback, content, dialogOptions) {
miDialog.superclass.constructor.apply(this, arguments);
var mi = this;
this.dialog = content.dialog($.extend({}, {
title: this.options.title,
resizable: false,
minHeight: 20,
dialogClass: 'sand-style mi-container',
beforeClose: function(e, ui) {
var tmp = true;
if(1 * $(this).attr('submit')) {
mi._collect.call(mi);
if(tmp = mi._validation.call(mi)) {
return true;
}
}
$(this).attr('submit', 0);
return tmp;
},
close: function(e, ui) {
if(1 * $(this).attr('submit')) {
mi.callback();
}
mi.destroy();
}
}, dialogOptions)).on('click','.dialog-submit',function() { $(this).closest('.ui-dialog-content').attr('submit', 1).dialog('close')})
}
extend(miDialog, MagicInput);
miDialog.prototype.toString = function() {
return 'This is ABSTRACT miDialog object';
}
miDialog.prototype.destroy = function() {
this.dialog.dialog('destroy').remove();
}
miDialog._oneInput = function(p) {
var i = $('<input type="'+(p.type ? p.type : 'text')+'" onkeyup="'+(p.onkeyup ? p.onkeyup : 'return false;')+'" onchange="'+(p.onchange ? p.onchange : 'return false;')+'" class="'+(p.clas ? p.clas : 'text')+'" value="'+(p.value ? p.value : '')+'" />').attr('name', p.name);
if(p.grabber) {
h[p.grabber].set(i);
} else {
i.select();
}
return $('<div class=oneinput></div>').append('<input type=button class="button dialog-submit" value=" »» ">').append($('<div></div>').append(i));
}
miDialog._hiddenInput = function(p) {
var i = $('<input type="hidden" class="text" />').attr('name', p.name).attr('value', p.value);
if(p.grabber) {
h[p.grabber].set(i);
} else {
i.select();
}
return $('<div class=oneinput></div>').append($('<div></div>').append(i));
}
miDialog._simpleInput = function(p) {
var i = $('<input type="'+(p.type ? p.type : 'text')+'" value="'+(p.value ? p.value : '')+'" class="text" />').attr('name', p.name);
if(p.grabber) {
h[p.grabber].set(i);
} else {
i.select();
}
return $('<div class=oneinput></div>').append($('<div></div>').append(i));
}
miDialog.prototype._collect = function() {
var mi = this;
this.dialog.find('[name]').each(function() {
var el = $(this);
if(el.is('input[type="checkbox"]')) {
mi.data[el.attr('name')] = ~~el.is(':checked');
return;
}
mi.data[el.attr('name')] = el.val();
})
}
miDialog.prototype._validation = function() {
return true;
}
+131
View File
@@ -0,0 +1,131 @@
function findlogin2(title, script, name) {
var s = '<form action="'+script+'" method=POST><table width=270 cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>';
s +='<table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><td align=center>';
s +='<table width=90% cellspacing=0 cellpadding=2 align=center><tr><td align=left colspan="2">';
s +='Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></td></tr>';
s += '<tr><td align=right><small><b>Логин:</b></small></td><td><INPUT TYPE=text NAME="'+name+'" style="width:140px"></td></tr>';
s += '<INPUT type=image SRC=i/friend/b__ok.gif WIDTH=25 HEIGHT=18 ALT="Добавить контакт" style="border:0; vertical-align: middle"></TD></TR></TABLE><INPUT TYPE=hidden name=sd4 value="1"></TD></TR></TABLE></td></tr></table></FORM>';
document.all("hint3").innerHTML = s;
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = document.body.scrollTop+50;
document.all(name).focus();
Hint3Name = name;
}
function findlogin(title, script, name) {
var s;
s = '<form action="'+script+'" method=POST name=slform><table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043B\u043E\u0433\u0438\u043D \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u0436\u0430: <br><small>(\u041C\u043E\u0436\u043D\u043E \u043A\u043B\u0438\u043A\u043D\u0443\u0442\u044C \u043F\u043E \u043B\u043E\u0433\u0438\u043D\u0443 \u0432 \u0447\u0430\u0442\u0435)</small>'+
'</TD></TR><TR><TD width=50% align=right style="padding-left:5">'+
'<input style="width: 100%" type="text" name="'+name+'" id="'+name+'" /></TD><TD width=50%>'+
'<input type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 alt="" onclick="slform.submit();" /></TD></TR></TABLE></FORM>';
s = crtmagic(5, title, s);
document.getElementById("hint3").innerHTML = s;
document.getElementById("hint3").style.visibility = "visible";
document.getElementById("hint3").style.left = 200;
document.getElementById("hint3").style.top = 100;
Hint3Name = name;
document.getElementById(name).focus();
}
var sd4 = 0;
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;
}
function crtmagic(mtype, title, body, subm, noclose) {
return crtmagic_full(mtype, title, body, subm, noclose, 270, 0);
}
function closehint3() {
document.getElementById("hint3").style.visibility = "hidden";
Hint3Name = '';
}
function crtmagic_full(mtype, title, body, subm, noclose, dx, dy) {
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#', '/i/misc/dmagic/'+names[mtype*10]+'_30.gif');
}
var s = '<table width="'+dx+(dy?'" height="'+dy:'')+'" border="0" align="center" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+1]+'" align="left"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_03.gif" width="'+names[mtype*10+1]+'" height="'+names[mtype*10+2]+'"></td>'+
'<td width="100%" align="right" background="/i/misc/dmagic/b'+names[mtype*10]+'_05.gif"></td>'+
'<td width="'+names[mtype*10+3]+'" align="right"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_07.gif" width="'+names[mtype*10+3]+'" height="'+names[mtype*10+2]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
(names[mtype*10+7]?'<td width="'+names[mtype*10+7]+'"><SPAN style="width:'+names[mtype*10+7]+'">&nbsp;</SPAN></td>':'')+
'<td width="5" background="/i/misc/dmagic/b'+names[mtype*10]+'_17.gif">&nbsp;</td>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td bgcolor="#'+colors[mtype*2]+'"'+(names[mtype*10+9]?' style="padding-top: '+names[mtype*10+9]+'"':'')+' >'+
'<table border=0 width=100% cellspacing="0" cellpadding="0"><td style="padding-left: 20" align=center><B>'+title+
'</td><td width=20 align=right valign=top style="cursor: hand" '+(noclose?'':'onclick="closehint3();" ') + '><IMG src="/i/clear.gif" width=13 height=13>&nbsp;</td></table>'+
'</td></tr>'+
'<tr>'+
'<td align="center" bgcolor="#'+colors[mtype*2+1]+'">'+body+
'</tr>'+
'</table></td>'+
'<td width="5" background="/i/misc/dmagic/b'+names[mtype*10]+'_19.gif">&nbsp;</td>'+
(names[mtype*10+8]?'<td width="'+names[mtype*10+8]+'"><SPAN style="width:'+names[mtype*10+8]+'">&nbsp;</SPAN></td></td>':'')+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+4]+'" align="left"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_27.gif" width="'+names[mtype*10+4]+'" height="'+names[mtype*10+6]+'"></td>'+
'<td width="100%" align="right" background="/i/misc/dmagic/b'+names[mtype*10]+'_29.gif"></td>'+
'<td width="'+names[mtype*10+5]+'" align="right"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_31.gif" width="'+names[mtype*10+5]+'" height="'+names[mtype*10+6]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table>';
return s;
}
+122
View File
@@ -0,0 +1,122 @@
var RecoverScroll=
{
timer:null, x:0, y:0, actOnHash:false, cookieId:"RecoverScroll", expiry : "", dataCode:0, logged:0,
start : function( pageIdent, days )
{
this.installHandler=function(obj,evt,func) {
window.attachEvent ? obj.attachEvent(evt,func) : obj.addEventListener(evt.replace(/^on/i,""),func,false);
return func;
}
this.installHandler( window, 'onload', function(){ RecoverScroll.init( pageIdent, days ); } );
},
init : function( pageName, days )
{
var dt, duration;
if( typeof window.pageXOffset != 'undefined' )
this.dataCode = 1;
else
if( document.documentElement )
this.dataCode = 3;
else
if( document.body && typeof document.body.scrollTop != 'undefined' )
this.dataCode = 2;
if( pageName )
this.cookieId = pageName.replace( /[\s\=\;\,]/g, '_' );
if( days && ( duration = parseInt( days ) ) != NaN )
{
dt = new Date();
dt.setDate( dt.getDate() + duration );
this.expiry = ";expires=" + dt.toUTCString();
}
this.installHandler( window, 'onscroll', function(){ RecoverScroll.reset() } );
this.go();
},
go : function( )
{
var sx, sy, offsetData;
if( ( window.location.hash == "" || this.actOnHash )
// && location.search.length == 0
&& ( offsetData = this.readCookie( this.cookieId )) != ""
&& ( offsetData = offsetData.split('|') ).length == 4
&& !isNaN( sx = Number( offsetData[ 1 ] ) ) && !isNaN( sy = Number( offsetData[3] ) ) )
{
if(!!window.SoftScroll && SoftScroll.scrollTo)
{ SoftScroll.init(); SoftScroll.scrollTo(sx, sy); }
else
window.scrollTo(sx, sy);
}
this.record();
},
sf : function( str )
{
return unescape(str).replace(/(.)(.*)/, function(a,b,c){return c+b;});
},
reset : function()
{
clearTimeout( this.timer );
this.timer = setTimeout( function(){ RecoverScroll.record(); }, 50 );
},
record : function()
{
var cStr;
this.getScrollData();
this.setTempCookie( this.cookieId, cStr='x|'+this.x+'|y|'+this.y );
},
setTempCookie : function(cName, cValue)
{
document.cookie = cName + "=" + cValue + this.expiry;
},
readCookie : function(cookieName)
{
var cValue="";
if(typeof document.cookie!='undefined')
cValue=(cValue=document.cookie.match(new RegExp("(^|;|\\s)"+cookieName+'=([^;]+);?'))) ? cValue[2] : "";
return cValue;
},
hash : function()
{
this.actOnHash = true;
},
getScrollData : function()
{
switch( this.dataCode )
{
case 3 : this.x = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
this.y = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
break;
case 2 : this.x = document.body.scrollLeft;
this.y = document.body.scrollTop;
break;
case 1 : this.x = window.pageXOffset; this.y = window.pageYOffset; break;
}
},
installHandler : function(){},
}
+3
View File
@@ -0,0 +1,3 @@
//top.localroom=top.changeroom;
//top.frames['online'].location='ch.php?online='+Math.round(Math.random()*100000);
//<script language="javascript" src="ajax/refreshonline.js"></script>
+60
View File
@@ -0,0 +1,60 @@
// selectlogin.js
var Hint3Name = '';
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 findlogin(title, script, name)
{
document.all("hint3").innerHTML = '<table border=0 width=100% cellspacing="1" cellpadding="0" bgcolor="#CCC3AA"><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>'+
'<table border=0 width=100% cellspacing="0" cellpadding="2" bgcolor="#FFF6DD"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE="text" NAME="'+name+'"></TD><TD width=50%><INPUT type=image SRC="/i/b__ok.gif" WIDTH="25" HEIGHT="18" BORDER=0 ALT="" onclick="slform.'+name+'.value=fixspaces(slform.'+name+'.value);"></TD></TR></FORM></TABLE></td></tr></table>';
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = 60;
document.all(name).focus();
Hint3Name = name;
}
// Для магии. Заголовок, название скрипта, название магии, номер вещицы в рюкзаке
function magicklogin(title, script, magickname, n)
{
document.all("hint3").innerHTML = '<table border=0 width=100% cellspacing="1" cellpadding="0" bgcolor="#CCC3AA"><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>'+
'<table border=0 width=100% cellspacing="0" cellpadding="2" bgcolor="#FFF6DD"><tr><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE="text" NAME="param"></TD><TD width=50%><INPUT type=image SRC="/i/b__ok.gif" WIDTH="25" HEIGHT="18" BORDER=0 ALT="" onclick="slform.param.value=fixspaces(slform.param.value);"></TD></TR></FORM></TABLE></td></tr></table>';
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = 60;
document.all("param").focus();
Hint3Name = 'param';
}
// Закрывает окно ввода логина
function closehint3()
{
document.all("hint3").style.visibility="hidden";
Hint3Name='';
}
// Магия
function UseMagick(script, name, extparam, n) {
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=script+'?use='+name+'&param='+s+'&n='+n;
}
} else {
if (confirm('Использовать сейчас?')) { location=script+'?use='+name+'&n='+n; }
}
}
+76
View File
@@ -0,0 +1,76 @@
function absPosition(obj) {
var x = y = 0;
while(obj) {
x += obj.offsetLeft;
y += obj.offsetTop;
obj = obj.offsetParent;
}
return {x : x, y : y};
}
function ShowThing(obj, xshift, yshift, txt, left) {
if(left == 1) {
var xxx = 1;
} else {
var xxx = 0;
}
DDD = setTimeout(function() {
ShowThingMain(obj, txt, xshift, yshift, xxx);
}, 300);
}
function ShowThingMain(obj, txt, xshift, yshift, xxx) {
var img_x = absPosition(obj).x;
var img_y = absPosition(obj).y;
if(xxx == 1) {
img_y = img_y+yshift;
img_x = img_x-60-xshift;
} else {
img_y = img_y+yshift;
img_x = img_x+xshift;
}
if(document.getElementById("thing_")) {
document.getElementById("thing_").style.display = 'block';
} else {
var divTag = document.createElement("div");
divTag.id = "thing_";
divTag.style.position = "absolute";
divTag.style.zIndex = 9;
divTag.style.border = "1px solid black";
divTag.style.top = img_y + "px";
divTag.style.left = img_x + "px";
divTag.style.backgroundColor = "#ffffe1";
divTag.style.minWidth = "100px"
divTag.style.maxWidth = "400px";
divTag.style.paddingLeft = "5px";
divTag.style.paddingRight = "5px";
divTag.style.paddingTop = "2px";
divTag.style.paddingBottom = "2px";
divTag.style.boxShadow = "5px 5px 5px black";
divTag.style.boxShadow = "5px 5px 10px rgba(0,0,0,0.5)";
divTag.style.MozBoxShadow = "5px 5px 10px rgba(0,0,0,0.5)";
divTag.style.WebkitBoxShadow = "5px 5px 10px rgba(0,0,0,0.5)";
if(xxx == 1) {
divTag.style.borderRadius = "5px 0px 5px 5px";
divTag.style.MozBorderRadius = "5px 0px 5px 5px";
divTag.style.WebkitBorderRadius = "5px 0px 5px 5px";
} else {
divTag.style.borderRadius = "0px 5px 5px 5px";
divTag.style.MozBorderRadius = "0px 5ipx 5px 5px";
divTag.style.WebkitBorderRadius = "0px 5px 5px 5px";
}
divTag.style.lineHeight = "10px";
divTag.style.fontSize = "9px";
divTag.className ="dynamicDiv";
divTag.innerHTML = txt;
document.body.appendChild(divTag);
}
}
function HideThing(obj) {
try {
document.body.removeChild(document.getElementById("thing_"));
} catch(err) {
clearTimeout(DDD);
}
}
+263
View File
@@ -0,0 +1,263 @@
var Hint3Name = '';
step=0;
function errmess(s)
{
messid.innerHTML='<B>'+s+'</B>';
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 findlogin(title, script, name, defaultlogin, mtype) {
var s;
s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME="'+name+'" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="slform.'+name+'.value=fixspaces(slform.'+name+'.value);"></TD></TR></FORM></TABLE>';
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='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
text+'</TD></TR><TR><TD width=50% align=left><INPUT TYPE="submit" name="tmpname423" value="Да" style="width:70%"></TD><TD width=50% align=right><INPUT type=button style="width:70%" value="Нет" onclick="closehint3();"></TD></TR></FORM></TABLE>';
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 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;
}
// Для магии. Заголовок, название скрипта, название магии, номер вещицы в рюкзаке, логин по умолчанию, описание доп. поля
function magicklogin(title, script, magickname, n, defaultlogin, extparam, mtype) {
var s = '<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD style="padding-left:5" width=50% align=right><INPUT TYPE="text" NAME="param" value="'+defaultlogin+'" style="width: 100%"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="slform.param.value=fixspaces(slform.param.value);"></TD></TR>';
if (extparam != null && extparam != '') {
s = s + '<TR><td style="padding-left:5">'+extparam+'<BR><INPUT style="width: 100%" TYPE="text" NAME="param2"></TD><TD></TR>';
}
s = s + '</FORM></TABLE>';
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 = '<table border=0 width=100% cellspacing="1" cellpadding="0"><TR><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><td colspan=2 align=left><NOBR><SMALL>'+
extparam + ':</NOBR></TD></TR><TR><TD width=100% align=left style="padding-left:5"><INPUT tabindex=1 style="width: 100%" TYPE="'+t1+'" id="param" NAME="param" value=""></TD><TD width=10%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" tabindex=3></TD></TR>';
if (extparam2 != null && extparam2 != '') {
if (extparam2.substr(0,1) == "!")
{
t2='password';
extparam2=extparam2.substr(1,extparam2.length);
}
s = s + '<TR><td colspan=2><NOBR><SMALL>'+extparam2+':</NOBR><TR style="padding-left:5"><TD><INPUT tabindex=2 TYPE="'+t2+'" NAME="param2" style="width: 50%"></TD><TD></TR>';
}
s += '</FORM></TABLE>';
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, '<TABLE width=100%><TD><IMG src="i/items/'+name+'.gif"></TD><TD>Использовать сейчас?</TABLE>'+
'<input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'">', 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 = '<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="/battle.pl" method=POST name="bmagic" onsubmit="bmagic.mdefend.value=defend;"><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><input type=hidden name="mdefend" value="'+defend+'"><input type=hidden name="enemy" value="'+enemy+'"><input type=hidden name="myid" value="'+myid+'"><td colspan=2 align=left>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT style="width: 100%" TYPE="text" id="param" NAME="param" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="bmagic.param.value=fixspaces(bmagic.param.value);"></TD></TR>';
if (extparam != null && extparam != '') {
s = s + '<TR><td colspan=2>'+extparam+'<TR><TD style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME="param2"><TD></TD></TR>';
}
s = s + '</FORM></TABLE>';
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+'&param='+s+'&n='+n+'&mdefend='+defend+'&enemy='+enemy+'&myid='+myid;
}
} else {
dialogconfirm('Подтверждение', '/battle.pl', '<TABLE width=100%><TD><IMG src="i/items/'+name+'.gif"></TD><TD>Использовать сейчас?</TABLE>'+
'<input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><input type=hidden name="mdefend" value="'+defend+'"><input type=hidden name="enemy" value="'+enemy+'"><input type=hidden name="myid" value="'+myid+'">', 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#', 'http://img.combats.com/i/misc/dmagic/'+names[mtype*10]+'_30.gif');
var s='<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+1]+'" align="left"></td>'+
'<td width="100%" align="right" background="i/misc/dmagic/b'+names[mtype*10]+'_05.gif"></td>'+
'<td width="'+names[mtype*10+3]+'" align="right"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
(names[mtype*10+7]?'<td width="'+names[mtype*10+7]+'"><SPAN style="width:'+names[mtype*10+7]+'">&nbsp;</SPAN></td>':'')+
'<td width="5" background="i/misc/dmagic/b'+names[mtype*10]+'_17.gif">&nbsp;</td>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td bgcolor="#'+colors[mtype*2]+'"'+(names[mtype*10+9]?' style="padding-top: '+names[mtype*10+9]+'"':'')+' >'+
'<table border=0 width=100% cellspacing="0" cellpadding="0"><td style="padding-left: 20" align=center><B>'+title+
'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();" style=\'filter:Gray()\' onmouseover="this.filters.Gray.Enabled=false" onmouseout="this.filters.Gray.Enabled=true"><IMG src="i/clear.gif" width=13 height=13>&nbsp;</td></table>'+
'</td></tr>'+
'<tr>'+
'<td align="center" bgcolor="#'+colors[mtype*2+1]+'">'+body+
'</tr>'+
'</table></td>'+
'<td width="5" background="i/misc/dmagic/b'+names[mtype*10]+'_19.gif">&nbsp;</td>'+
(names[mtype*10+8]?'<td width="'+names[mtype*10+8]+'"><SPAN style="width:'+names[mtype*10+8]+'">&nbsp;</SPAN></td></td>':'')+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+4]+'" align="left"></td>'+
'<td width="100%" align="right" background="i/misc/dmagic/b'+names[mtype*10]+'_29.gif"></td>'+
'<td width="'+names[mtype*10+5]+'" align="right"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table>';
return s;
}
+147
View File
@@ -0,0 +1,147 @@
var Hint3Name = '';
step=0;
function errmess(s)
{
messid.innerHTML='<B>'+s+'</B>';
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 findlogin(title, script, name, defaultlogin)
{
document.all("hint3").innerHTML = '<table border=0 width=100% cellspacing="1" cellpadding="0" bgcolor="#CCC3AA"><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>'+
'<table border=0 width=100% cellspacing="0" cellpadding="2" bgcolor="#FFF6DD"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE="text" NAME="'+name+'" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="/i/b__ok.gif" WIDTH="25" HEIGHT="18" BORDER=0 ALT="" onclick="slform.'+name+'.value=fixspaces(slform.'+name+'.value);"></TD></TR></FORM></TABLE></td></tr></table>';
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = 60;
document.all(name).focus();
Hint3Name = name;
}
// Для магии. Заголовок, название скрипта, название магии, номер вещицы в рюкзаке, логин по умолчанию, описание доп. поля
function magicklogin(title, script, magickname, n, defaultlogin, extparam)
{
var s = '<table border=0 width=100% cellspacing="1" cellpadding="0" bgcolor="#CCC3AA"><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>'+
'<table border=0 width=100% cellspacing="0" cellpadding="2" bgcolor="#FFF6DD"><tr><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE="text" NAME="param" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="/i/b__ok.gif" WIDTH="25" HEIGHT="18" BORDER=0 ALT="" onclick="slform.param.value=fixspaces(slform.param.value);"></TD></TR>';
if (extparam != null && extparam != '') {
s = s + '<TR><td colspan=2>'+extparam+'<BR><INPUT TYPE="text" NAME="param2" size=20></TD></TR>';
}
s = s + '</FORM></TABLE></td></tr></table>';
document.all("hint3").innerHTML = s;
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = document.body.scrollTop+50;
document.all("param").focus();
Hint3Name = 'param';
}
// Магия
function UseMagick(title, script, name, extparam, n, extparam2) {
if ((extparam != null)&&(extparam != '')) {
var t1='text',t2='text';
if (extparam.substr(0,1) == "!")
{
t1='password';
extparam=extparam.substr(1,extparam.length);
}
var s = '<table border=0 width=100% cellspacing="1" cellpadding="0" bgcolor="#CCC3AA"><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>'+
'<table border=0 width=100% cellspacing="0" cellpadding="2" bgcolor="#FFF6DD"><tr><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><td colspan=2><NOBR><SMALL>'+
extparam + ':</NOBR></TD></TR><TR><TD width=100% align=left>&nbsp;&nbsp;<INPUT tabindex=1 size=30 TYPE="'+t1+'" NAME="param" value=""></TD><TD width=10%><INPUT type=image SRC="/i/b__ok.gif" WIDTH="25" HEIGHT="18" BORDER=0 ALT="" tabindex=3></TD></TR>';
if (extparam2 != null && extparam2 != '') {
if (extparam2.substr(0,1) == "!")
{
t2='password';
extparam2=extparam2.substr(1,extparam2.length);
}
s = s + '<TR><td colspan=2><NOBR><SMALL>'+extparam2+':</NOBR><TR colspan=2><TD>&nbsp;&nbsp;<INPUT tabindex=2 TYPE="'+t2+'" NAME="param2" size=30></TD></TR>';
}
s = s + '</FORM></TABLE></td></tr></table>';
document.all("hint3").innerHTML = s;
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = document.body.scrollTop+50;
document.all("param").focus();
Hint3Name = 'param';
} else {
if (confirm('Использовать сейчас?')) { location=script+'?use='+name+'&n='+n; }
}
}
// Закрывает окно ввода логина
function closehint3()
{
document.all("hint3").style.visibility="hidden";
Hint3Name='';
}
// Для боевой магии. Заголовок, название магии, номер вещицы в рюкзаке
function Bmagicklogin(title, magickname, n)
{
if (defend==false)
{
errmess("Блок не выбран.");
return false;
}
document.all("hint3").innerHTML = '<table border=0 width=100% cellspacing="1" cellpadding="0" bgcolor="#CCC3AA"><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>'+
'<table border=0 width=100% cellspacing="0" cellpadding="2" bgcolor="#FFF6DD"><tr><form name="bmagic" action="/battle.pl" method=POST onsubmit="bmagic.mdefend.value=defend;"><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><input type=hidden name="mdefend" value="'+defend+'"><input type=hidden name="enemy" value="'+enemy+'"><input type=hidden name="myid" value="'+myid+'"><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE="text" NAME="param"></TD><TD width=50%><INPUT type=image SRC="/i/b__ok.gif" WIDTH="25" HEIGHT="18" BORDER=0 ALT="" onclick="bmagic.param.value=fixspaces(bmagic.param.value);"></TD></TR></FORM></TABLE></td></tr></table>';
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = 60;
document.all("param").focus();
Hint3Name = 'param';
}
// Магия
function BUseMagick(name, extparam, n) {
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+'&param='+s+'&n='+n+'&mdefend='+defend+'&enemy='+enemy+'&myid='+myid;
}
} else {
if (confirm('Использовать сейчас?')) { location='/battle.pl?use='+name+'&n='+n+'&mdefend='+defend+'&enemy='+enemy+'&myid='+myid;}
}
}
+26
View File
@@ -0,0 +1,26 @@
function ShowTime(fname,lefttime,type)
{
lefttime--;
if (lefttime<=0) { document.all(''+fname).innerText=''; window.location.reload(); }
sec=lefttime%60;
min=Math.floor(lefttime/60);
day=Math.floor(lefttime/86400);
hour=Math.floor((lefttime/3600)-(day*86400/3600));
if (sec<10) sec="0"+sec;
if (min>60) min-=(Math.floor(min/60)*60);
if (min==60) min=0;
if (type!=1) { if (min<10) min="0"+min; }
if (type==1) { document.all(''+fname).innerText=min+" мин. "+sec+" сек."; }
else {
if (day>0) document.all(''+fname).innerText=day+" д. "+hour+" ч. "+min+" мин.";
else document.all(''+fname).innerText=hour+" ч. "+min+" мин.";
}
setTimeout("ShowTime('"+fname+"',"+lefttime+","+type+")",1000);
}
+198
View File
@@ -0,0 +1,198 @@
/*
* TipTip
* Copyright 2010 Drew Wilson
* www.drewwilson.com
* code.drewwilson.com/entry/tiptip-jquery-plugin
*
* Version 1.3 - Updated: Mar. 23, 2010
*
* This Plug-In will create a custom tooltip to replace the default
* browser tooltip. It is extremely lightweight and very smart in
* that it detects the edges of the browser window and will make sure
* the tooltip stays within the current window size. As a result the
* tooltip will adjust itself to be displayed above, below, to the left
* or to the right depending on what is necessary to stay within the
* browser window. It is completely customizable as well via CSS.
*
* This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function($){
$.fn.tipTip = function(options) {
var defaults = {
activation: "hover",
keepAlive: false,
maxWidth: "150px",
edgeOffset: 0,
defaultPosition: "right",
delay: 0,
fadeIn: 200,
fadeOut: 200,
attribute: "title",
content: false, // HTML or String to fill TipTIp with
enter: function(){},
exit: function(){}
};
var opts = $.extend(defaults, options);
// Setup tip tip elements and render them to the DOM
if($("#tiptip_holder").length <= 0){
var tiptip_holder = $('<div id="tiptip_holder" style="max-width:'+ opts.maxWidth +';"></div>');
var tiptip_content = $('<div id="tiptip_content"></div>');
var tiptip_arrow = $('<div id="tiptip_arrow"></div>');
$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')));
} else {
var tiptip_holder = $("#tiptip_holder");
var tiptip_content = $("#tiptip_content");
var tiptip_arrow = $("#tiptip_arrow");
}
return this.each(function(){
var org_elem = $(this);
if(opts.content){
var org_title = opts.content;
} else {
var org_title = org_elem.attr(opts.attribute);
}
if(org_title != ""){
if(!opts.content){
org_elem.removeAttr(opts.attribute); //remove original Attribute
}
var timeout = false;
if(opts.activation == "hover"){
org_elem.hover(function(){
active_tiptip();
}, function(){
if(!opts.keepAlive){
deactive_tiptip();
}
});
if(opts.keepAlive){
tiptip_holder.hover(function(){}, function(){
deactive_tiptip();
});
}
} else if(opts.activation == "focus"){
org_elem.focus(function(){
active_tiptip();
}).blur(function(){
deactive_tiptip();
});
} else if(opts.activation == "click"){
org_elem.click(function(){
active_tiptip();
return false;
}).hover(function(){},function(){
if(!opts.keepAlive){
deactive_tiptip();
}
});
if(opts.keepAlive){
tiptip_holder.hover(function(){}, function(){
deactive_tiptip();
});
}
}
function active_tiptip(){
opts.enter.call(this);
tiptip_content.html(org_title);
tiptip_holder.hide().removeAttr("class").css("margin","0");
tiptip_arrow.removeAttr("style");
var top = parseInt(org_elem.offset()['top']);
var left = parseInt(org_elem.offset()['left']);
var org_width = parseInt(org_elem.outerWidth());
var org_height = parseInt(org_elem.outerHeight());
var tip_w = tiptip_holder.outerWidth();
var tip_h = tiptip_holder.outerHeight();
var w_compare = Math.round((org_width - tip_w) / 2);
var h_compare = Math.round((org_height - tip_h) / 2);
var marg_left = Math.round(left + w_compare);
var marg_top = Math.round(top + org_height + opts.edgeOffset);
var t_class = "";
var arrow_top = "";
var arrow_left = Math.round(tip_w - 12) / 2;
if(opts.defaultPosition == "bottom"){
t_class = "_bottom";
} else if(opts.defaultPosition == "top"){
t_class = "_top";
} else if(opts.defaultPosition == "left"){
t_class = "_left";
} else if(opts.defaultPosition == "right"){
t_class = "_right";
}
var right_compare = (w_compare + left) < parseInt($(window).scrollLeft());
var left_compare = (tip_w + left) > parseInt($(window).width());
if((right_compare && w_compare < 0) || (t_class == "_right" && !left_compare) || (t_class == "_left" && left < (tip_w + opts.edgeOffset + 5))){
t_class = "_right";
arrow_top = Math.round(tip_h - 13) / 2;
arrow_left = -12;
marg_left = Math.round(left + org_width + opts.edgeOffset);
if (org_width == 120){
marg_left = marg_left - 100;
}
marg_top = Math.round(top + h_compare);
} else if((left_compare && w_compare < 0) || (t_class == "_left" && !right_compare)){
t_class = "_left";
arrow_top = Math.round(tip_h - 13) / 2;
arrow_left = Math.round(tip_w);
marg_left = Math.round(left - (tip_w + opts.edgeOffset + 5));
marg_top = Math.round(top + h_compare);
}
var top_compare = (top + org_height + opts.edgeOffset + tip_h + 8) > parseInt($(window).height() + $(window).scrollTop());
var bottom_compare = ((top + org_height) - (opts.edgeOffset + tip_h + 8)) < 0;
if(top_compare || (t_class == "_bottom" && top_compare) || (t_class == "_top" && !bottom_compare)){
if(t_class == "_top" || t_class == "_bottom"){
t_class = "_top";
} else {
t_class = t_class+"_top";
}
arrow_top = tip_h;
marg_top = Math.round(top - (tip_h + 5 + opts.edgeOffset));
} else if(bottom_compare | (t_class == "_top" && bottom_compare) || (t_class == "_bottom" && !top_compare)){
if(t_class == "_top" || t_class == "_bottom"){
t_class = "_bottom";
} else {
t_class = t_class+"_bottom";
}
arrow_top = -12;
marg_top = Math.round(top + org_height + opts.edgeOffset);
}
if(t_class == "_right_top" || t_class == "_left_top"){
marg_top = marg_top + 5;
} else if(t_class == "_right_bottom" || t_class == "_left_bottom"){
marg_top = marg_top - 5;
}
if(t_class == "_left_top" || t_class == "_left_bottom"){
marg_left = marg_left + 5;
}
tiptip_arrow.css({"margin-left": arrow_left+"px", "margin-top": 200+arrow_top+"px"});
var art_top = top + org_height - tip_h/2;
if(art_top < 0){art_top=10;}
// old one - marg_top
tiptip_holder.css({"margin-left": marg_left+10+"px", "margin-top": art_top+"px"}).attr("class","tip");
if (timeout){ clearTimeout(timeout); }
timeout = setTimeout(function(){ tiptip_holder.stop(true,true).fadeIn(opts.fadeIn); }, opts.delay);
}
function deactive_tiptip(){
opts.exit.call(this);
if (timeout){ clearTimeout(timeout); }
tiptip_holder.fadeOut(opts.fadeOut);
}
}
});
}
})(jQuery);
+201
View File
@@ -0,0 +1,201 @@
isIE = document.all;
isNN = !document.all&&document.getElementById;
isN4 = document.layers;
isHot = false;
document.onmousedown = ddInit;
document.onmouseup = Function("ddEnabled=false");
function ddInit(e) {
topDog = isIE ? "BODY" : "HTML";
whichDog = isIE ? document.all.theLayer : document.getElementById("theLayer");
hotDog = isIE ? event.srcElement : e.target;
while(hotDog.id != "titleBar"&&hotDog.tagName != topDog) {
hotDog = isIE ? hotDog.parentElement : hotDog.parentNode;
}
if(hotDog.id == "titleBar") {
offsetx = isIE ? event.clientX : e.clientX;
offsety = isIE ? event.clientY : e.clientY;
nowX = parseInt(whichDog.style.left);
nowY = parseInt(whichDog.style.top);
ddEnabled = true;
document.onmousemove = dd;
}
}
function dd(e) {
if(!ddEnabled) return;
whichDog.style.left = isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx;
whichDog.style.top = isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
return false;
}
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 win = {
winc:{},
wsdr:null,
scor:{},
openw:function(id, title, text, date, type, style) {
if($('#win_'+id).attr('id') == undefined) {
this.add(id, title, text, date, type, 1, '');
}
},
WstartDrag:function(id) {
$('#wupbox').css({'display':'block', 'cursor':'move'});
this.wsdr = id;
$('.w1').css({'z-index':1102});
$('#win_'+id).css({'z-index':1103});
delete cm;
},
WmoveDrag:function(e) {
var x = mousePageXY(e)['x'], y = mousePageXY(e)['y'];
if(this.scor.x == undefined) {
this.scor.x = x;
this.scor.y = y;
this.scor.x2 = unpx($('#win_'+this.wsdr).css('left'));
this.scor.y2 = unpx($('#win_'+this.wsdr).css('top'));
}
x = x-this.scor.x;
y = y-this.scor.y;
x += this.scor.x2;
y += this.scor.y2;
if(x < 9) { x = 9; }
if(x + $('#win_'+this.wsdr).width() > $(window).width() - 9) {
x = $(window).width() - 9 - $('#win_'+this.wsdr).width();
}
if(y < 35) { y = 35; }
if(y + $('#win_'+this.wsdr).height() > $(window).height() - 35) {
y = $(window).height() - 35 - $('#win_'+this.wsdr).height();
}
$('#win_'+this.wsdr).css({'top':y+'px','left':x+'px'});
},
WstopDrag:function() {
$('#wupbox').css({'display':'none', 'cursor':'move'});
this.wsdr = null;
this.scor = {};
},
add:function(id, title, text, date, type, style, css) {
var nw = '';
if($('#win_'+id).attr('id') == undefined) {
var acts = {};
if(date.usewin != undefined){
acts[0] = 'onmouseup="'+date.usewin+'"';
}
if(date.n != undefined){
text += '<div style="margin-left: 11px;">'+date.n+'</div>';
}
var kyps = ['', ''];
if(type == 0) {
nw = text;
} else if(type == 1) {
nw = text;
} else if(type == 2) {
nw = '<div>'+text+'</div><div style="padding:5px"><div style="float:left"><button onclick="'+date.a1+';win.closew(\''+id+'\');" class="btnnew" id="winyesbtnfox'+id+'" style="width:100px">Aa</button></div><div style="float:right"><button class="btnnew" onClick="'+date.a2+';win.closew(\''+id+'\')" style="width:100px">Iao</button></div><br></div>';
kyps[0] = ''+date.a1+';win.closew(\\\''+id+'\\\');win.addaction(0,\\\'\\\');';
} else if(type == 3) {
nw = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>'+text+'</td><td width="40" align="center" valign="middle"><img style="margin-top:5px;cursor:pointer" onClick="'+date.a1+';win.closew(\''+id+'\');" src="http://img.originalcombats.com/i/b__ok.gif" width="25" height="18"><br><img onClick="win.closew(\''+id+'\')" style="cursor:pointer" src="http://img.originalcombats.com/i/b__cancel.jpg" width="25" height="18"></td></tr></table>';
kyps[0] = ''+date.a1+';win.closew(\\\''+id+'\\\');win.addaction(0,\\\'\\\');';
} else if(type == 4) {
nw = text[0];
}
if(date.d != undefined) {
nw = nw+date.d;
}
nw = '<div style="margin: 2px;'+css+'">'+nw+'</div>';
if(title != '') {
nw = '<div class="wi'+style+'s10" onselectstart="return false">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
'<td rowspan="2" style="cursor: move;" onmousedown="win.WstartDrag(\''+id+'\')" '+acts[0]+'><b>'+title+'</b></td>'+
'<td width="15" align="right"><img style="display:block" onclick="win.closew(\''+id+'\')" src="http://img.originalcombats.com/i/clear.gif" width="13" height="13"></td>'+
'</tr>'+
'</table>'+
'</div>'+nw;
}
nw = '<table onclick="win.addaction(0,\''+kyps[0]+'\')" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
'<td class="wi'+style+'s0"></td>'+
'<td class="wi'+style+'s1"></td>'+
'<td class="wi'+style+'s2"></td>'+
'</tr>'+
'<tr>'+
'<td class="wi'+style+'s3"><img src="http://img.originalcombats.com/1x1.gif" width="5" height="1"></td>'+
'<td class="wi'+style+'s7" id="win_main_'+id+'">'+nw+'</td>'+
'<td class="wi'+style+'s4"><img src="http://img.originalcombats.com/1x1.gif" width="5" height="1"></td>'+
'</tr>'+
'<tr>'+
'<td class="wi'+style+'s5"></td>'+
'<td class="wi'+style+'s6"></td>'+
'<td class="wi'+style+'s8"><div id="win_a_'+id+'" class="wi'+style+'s9"></div></td>'+
'</tr>'+
'</table>';
nw = '<div class="w1" '+acts[0]+' id="win_'+id+'">'+nw+'</div>';
$('#windows').html($('#windows').html()+nw);
$('#win_'+id).center();
if(type == 2 || type == 3) {
if(type == 2) {
$('#winyesbtnfox'+id).focus();
}
}
}
delete nw;
},
addaction:function(nm, vl) {
key_actions[nm] = vl;
if(nm != 2) {
key_actions[2] = 1;
}
},
closew:function(id) {
$('#win_'+id).html('');
$('#win_'+id).remove();
}
}
function hideMe() {
if (isIE||isNN) {
whichDog.style.visibility = "hidden";
} else if (isN4) {
document.theLayer.visibility = "hide";
}
}
function showForm(title, text, input_name, input_value, hidden_name, hidden_value, action) {
document.getElementById('ftitle').innerHTML = title;
document.getElementById('ftext').innerHTML = text;
document.getElementById('finput').name = input_name;
document.getElementById('finput').value = input_value;
document.getElementById('fhinput').name = hidden_name;
document.getElementById('fhinput').value = hidden_value;
if(action != ""){
document.getElementById('fuse').action = action;
}
whichDog.style.left = (document.body.clientWidth - 240)/2;
if(isIE||isNN) {
whichDog.style.visibility = "visible";
} else if (isN4) {
document.theLayer.visibility = "show";
}
document.getElementById('finput').focus();
}