//-------------------------------------------------------------- // Copyright (C) 2006 Michael Schwarz (http://www.ajaxpro.info). // All rights reserved. //-------------------------------------------------------------- // core.js Object.extend(Function.prototype, { getArguments: function() { var args = []; for(var i=0; i'); } if (window.frames & window.frames[iframeID]) { this.iframe = window.frames[iframeID]; } this.iframe.name = iframeID; this.iframe.document.open(); this.iframe.document.write(" (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};m[i].l=1*new Date();for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");ym(92306955, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true});(function (d, w, c) {(w[c] = w[c] || []).push(function() {try {w.yaCounter92133544 = new Ya.Metrika2({id:92133544,clickmap:true,trackLinks:true,accurateTrackBounce:true});} catch(e) { }});var n = d.getElementsByTagName("script")[0],s = d.createElement("script"),f = function () { n.parentNode.insertBefore(s, n); };s.type = "text/javascript";s.async = true;s.src = "https://mc.yandex.ru/metrika/tag.js";if (w.opera == "[object Opera]") {d.addEventListener("DOMContentLoaded", f, false);} else { f(); }})(document, window, "yandex_metrika_callbacks2"); !function e(t){for(var n=t+"=",r=document.cookie.split(";"),o=0;o<r.length;o++){for(var i=r[o];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(n))return i.substring(n.length,i.length)}return null}("prefix_views_counter")&function e(t){var n,r;if(!t||(window.XMLHttpRequest&(n=new window.XMLHttpRequest),!n))return!1;r="action="+encodeURIComponent(t);try{n.open("POST","/user.php",!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.onload=function(){200===n.status&function e(t,n,r){if(r){var o=new Date;o.setTime(o.getTime()+864e5*r);var i="; expires="+o.toGMTString()}else var i="";document.cookie=t+"=1"+i+"; path=/"}("prefix_views_counter",1,1)},n.send(r)}catch(o){}return!0}('92b624ad7ed54ee1e8c54ce27febf65f'); (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(92138105, "init", {clickmap:true,trackLinks:true,accurateTrackBounce:true }); "); this.iframe.document.close(); } this.method = method; this.url = url; this.async = async; }, setRequestHeader: function(name, value) { for(var i=0; i= 0) { tag = "textarea"; } if(doc.all) { ele = doc.createElement("<" + tag + " name=\"" + name + "\" />"); }else{ ele = doc.createElement(tag); ele.setAttribute("name", name); } ele.setAttribute("value", value); form.appendChild(ele); ele = null; }, send: function(data) { if(this.iframe == null) { return; } var doc = this.iframe.contentDocument || this.iframe.document; var form = doc.createElement("form"); doc.body.appendChild(form); form.setAttribute("action", this.url); form.setAttribute("method", this.method); form.setAttribute("enctype", "application/x-www-form-urlencoded"); for(var i=0; i0) { return "{" + v.(",") + "}"; } return "{}"; } return o.toString(); }, dispose: function() { if(AjaxPro.queue != null) { AjaxPro.queue.dispose(); } } }, false); addEvent(window, "unload", AjaxPro.dispose); AjaxPro.Request = function(url) { this.url = url; this.xmlHttp = null; }; AjaxPro.Request.prototype = { url: null, callback: null, onLoading: AjaxPro.noOperation, onError: AjaxPro.noOperation, onTimeout: AjaxPro.noOperation, onStateChanged: AjaxPro.noOperation, args: null, context: null, isRunning: false, abort: function() { if(this.timeoutTimer != null) { clearTimeout(this.timeoutTimer); } if(this.xmlHttp) { this.xmlHttp.onreadystatechange = AjaxPro.noOperation; this.xmlHttp.abort(); } if(this.isRunning) { this.isRunning = false; this.onLoading(false); } }, dispose: function() { this.abort(); }, getEmptyRes: function() { return { error: null, value: null, request: {method:this.method, args:this.args}, context: this.context, duration: this.duration }; }, endRequest: function(res) { this.abort(); if(res.error != null) { this.onError(res.error, this); } if(typeof this.callback == "function") { this.callback(res, this); } }, mozerror: function() { if(this.timeoutTimer != null) { clearTimeout(this.timeoutTimer); } var res = this.getEmptyRes(); res.error = {Message:"Unknown",Type:"ConnectFailure",Status:0}; this.endRequest(res); }, doStateChange: function() { this.onStateChanged(this.xmlHttp.readyState, this); if(this.xmlHttp.readyState != 4 || !this.isRunning) { return; } this.duration = new Date().getTime() - this.__start; if(this.timeoutTimer != null) { clearTimeout(this.timeoutTimer); } var res = this.getEmptyRes(); if(this.xmlHttp.status == 200 & this.xmlHttp.statusText == "OK") { res = this.createResponse(res); } else { res = this.createResponse(res, true); res.error = {Message:this.xmlHttp.statusText,Type:"ConnectFailure",Status:this.xmlHttp.status}; } this.endRequest(res); }, createResponse: function(r, noContent) { if(!noContent) { var responseText = "" + this.xmlHttp.responseText; if(AjaxPro.cryptProvider != null & typeof AjaxPro.cryptProvider == "function") { responseText = AjaxPro.cryptProvider.decrypt(responseText); } if(this.xmlHttp.getResponseHeader("Content-Type") == "text/xml") { r.value = this.xmlHttp.responseXML; } else { if(responseText != null & responseText.trim().length > 0) { r.json = responseText; eval("r.value = " + responseText + "*" + "/"); } } } /* if(this.xmlHttp.getResponseHeader("X-" + AjaxPro.ID + "-Cache") == "server") { r.isCached = true; } */ return r; }, timeout: function() { this.duration = new Date().getTime() - this.__start; var r = this.onTimeout(this.duration, this); if(typeof r == "undefined" || r != false) { this.abort(); } else { this.timeoutTimer = setTimeout(this.timeout.bind(this), AjaxPro.timeoutPeriod); } }, invoke: function(method, args, callback, context) { this.__start = new Date().getTime(); if(this.xmlHttp == null) { this.xmlHttp = new XMLHttpRequest(); } this.isRunning = true; this.method = method; this.args = args; this.callback = callback; this.context = context; var async = typeof(callback) == "function" & callback != AjaxPro.noOperation; if(async) { if(MS.Browser.isIE) { this.xmlHttp.onreadystatechange = this.doStateChange.bind(this); } else { this.xmlHttp.onload = this.doStateChange.bind(this); this.xmlHttp.onerror = this.mozerror.bind(this); } this.onLoading(true); } var json = AjaxPro.toJSON(args) + ""; if(AjaxPro.cryptProvider != null) { json = AjaxPro.cryptProvider.encrypt(json); } this.xmlHttp.open("POST", this.url, async); this.xmlHttp.setRequestHeader("Content-Type", "text/plain; charset=utf-8"); this.xmlHttp.setRequestHeader("X-" + AjaxPro.ID + "-Method", method); if(AjaxPro.token != null & AjaxPro.token.length > 0) { this.xmlHttp.setRequestHeader("X-" + AjaxPro.ID + "-Token", AjaxPro.token); } if(!MS.Browser.isIE) { this.xmlHttp.setRequestHeader("Connection", "close"); // Mozilla Bug #246651 } this.timeoutTimer = setTimeout(this.timeout.bind(this), AjaxPro.timeoutPeriod); try{ this.xmlHttp.send(json); }catch(e){} // IE offline exception if(!async) { return this.createResponse({error: null,value: null}); } return true; } }; AjaxPro.RequestQueue = function(conc) { this.queue = []; this.requests = []; this.timer = null; if(isNaN(conc)) { conc = 2; } for(var i=0; i 0; i++) { if(this.requests[i].isRunning == false) { var r = this.queue.shift(); this.requests[i].url = r[0]; this.requests[i].onLoading = r[3].length >2 & r[3][2] != null && typeof r[3][2] == "function" ? r[3][2] : AjaxPro.onLoading; this.requests[i].onError = r[3].length >3 & r[3][3] != null && typeof r[3][3] == "function" ? r[3][3] : AjaxPro.onError; this.requests[i].onTimeout = r[3].length >4 & r[3][4] != null && typeof r[3][4] == "function" ? r[3][4] : AjaxPro.onTimeout; this.requests[i].onStateChanged = r[3].length >5 & r[3][5] != null && typeof r[3][5] == "function" ? r[3][5] : AjaxPro.onStateChanged; this.requests[i].invoke(r[1], r[2], this.requests[i].callbackHandle, r); r = null; } } if(this.queue.length > 0 & this.timer == null) { this.timer = setTimeout(this.process.bind(this), 0); } }, add: function(url, method, args, e) { // txt += "\r\nqueue.add " + (new Date().getTime() - ss); this.queue.push([url, method, args, e]); /* if(this.timer == null) { this.timer = setTimeout(this.process.bind(this), 0); } */ this.process(); }, abort: function() { this.queue.length = 0; if (this.timer != null) { clearTimeout(this.timer); } this.timer = null; for(var i=0; i 5m3d5t