Ajax=function(b){function g(a){return a&&"object"==typeof a}function h(){f||(f=new function(){var a=[];this.clear=function(){a=[]};this.value=function(c){return a[c]};this.insert=function(c,d){a[c]=d;return this};this.remove=function(c){delete a[c];return this};this.toString=function(){var c=[],d;for(d in a)c.push(encodeURIComponent(d)+"="+encodeURIComponent(a[d]));return c.join("&")}});return f}function m(){if(e){var a=(new String(b.method)).toUpperCase();if("GET"==a||"POST"==a){var c=new String(b.url);if(c)return d.open(a,c,!0),(a=h().toString())&&d.setRequestHeader&&d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),d.send(a),!0}}return!1}function j(a,c,d){b.method=a;c&&(b.url=c);d&&(b.events.ready=d);return m()}var d;if(XMLHttpRequest==void 0)for(var n=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],o=n.length,k=0;k<o;k++)try{d=ActiveXObject(n[k]);break}catch(q){}else d=new XMLHttpRequest;var e=g(d);if(this.enabled=e){var p=this;d.onreadystatechange=function(){var a;switch(d.readyState){case 1:a="open";break;case 2:a="send";break;case 3:a="receive";break;case 4:a="ready";break;default:return}(a=b.events[a])&&"function"==typeof a&&a(p)}}g(b)||(b=[]);g(b.events)||(b.events=[]);this.useMethod=function(a){b.method=a;return this};this.requestURL=function(a){b.url=a;return this};this.hookOpen=function(a){b.events.open=a;return this};this.hookSend=function(a){b.events.send=a;return this};this.hookReceive=function(a){b.events.receive=a;return this};this.hookReady=function(a){b.events.ready=a;return this};var f;this.queryParam=function(a,c){h().insert(a,c);return this};this.queryParams=h;this.abort=function(){e&&d.abort();return this};this.exec=m;this.get=function(a,c){return j("GET",a,c)};this.post=function(a,c){return j("POST",a,c)};this.sendForm=function(a,c,d){var b,i,e,g,f;if(c instanceof Array)i=c.length;else{c=[];i=(e=a.elements).length;for(b=0;b<i;c.push(e[b++].name));}e=h();for(b=0;b<i;b++)(f=c[b])&&(g=a[f])&&e.insert(f,g.value);return j(a.method,a.action,d)};var l;this.getResponse=function(){e&&(l||(l=new function(){this.asJson=function(){try{return eval("("+d.responseText+")")}catch(a){return{}}};this.asText=function(){try{return d.responseText}catch(a){return""}};this.asXml=function(){return d.responseXML};this.header=function(a){return a?d.getResponseHeader(a):""};this.headers=function(){var a=d.getAllResponseHeaders();if(a){for(var c={},a=a.split("\n"),b,e=0,f=a.length;e<f;e++)b=a[e].replace("\r","").split(": "),b.length>1&&(c[b[0]]=b[1]);return c}return{}};this.statusCode=function(){return d.status};this.statusText=function(){return d.statusText}}));return l}};dom=new function(){function h(a,b){!b&&(b=document);return b.getElementsByTagName(a)}function i(a,b){b&&b.appendChild(a);return a}function g(a,b){a.appendChild(b);return a}function k(a,b,d){a.insertBefore(b,d);return a}this.byId=function(a){return document.getElementById(a)};this.byTag=function(a,b){return h(a,b)[0]};this.hasTag=h;this.parent=i;this.add=g;this.before=k;this.after=function(a,b,d){return(b=b.nextSibling)?k(a,d,b):g(a,d)};this.off=function(a){a.parentNode.removeChild(a);return a};this.newTag=function(a,b){return i(document.createElement(a),b)};this.newText=function(a,b){return i(document.createTextNode(a),b)};this.head=function(a){g(h("head")[0],a);return a};this.body=function(a){g(document.body,a);return a};this.get=function(a,b){switch(b.constructor){case String:b=b.split(",");case Array:for(var d={},e,j=b.length,c=0;c<j;c++)e=b[c],d[e]=a.getAttribute(e);return d;case Object:for(c in b)b[c]=a.getAttribute(c);return b}};this.set=function(a,b){for(var d in b)a.setAttribute(d,b[d]);return a};this.read=function(a,b){switch(b.constructor){case String:b=b.split(",");case Array:for(var d={},e,j=b.length,c=0;c<j;c++)e=b[c],d[e]=a[e];return d;case Object:for(c in b)b[c]=a[c];return b}};this.write=function(a,b){function d(a,b){for(var c in b){var f=b[c];f==void 0||f==null?a[c]=null:typeof f=="object"?d(a[c],f):a[c]=f}}d(a,b);return a}};function Shield(e){function c(){return new Boolean(a&&a.parentNode&&a.parentNode.tagName)}function b(b){b^c()&&(b?(!a&&(a=dom.write(dom.newTag("div"),{id:d})),dom.body(a)):dom.off(a))}var d="shield",a=dom.byId(d);b(new Boolean(e));this.getVisible=this.isVisible=c;this.setVisible=b;this.hide=function(){b(0)};this.show=function(){b(1)}};function Loader(d,f){function j(a){a.complete||g&&a.src.indexOf(g)<0?h++:(a.onabort=a.onerror=a.onload=k,c++);return a}var i=0,h=0,c=0,g=!1,k=function(){c--;h++};d&&function(){var a=d.base,b=d.list;d=[];for(var l=function(c){var b=new Image;b.src=a+c;d.push(j(b));i++},c=0,e=b.length;c<e;l(b[c++]));}();(function(){g=location.hostname.replace("www.","");for(var a=0,b=document.images,c=b.length;a<c;j(b[a++]));i+=c})();c&&function(){function a(){e&&(clearInterval(e),dom.off(g),b.hide(),e=null)}var b=new Shield(1),d=dom.newTag("div"),g=dom.body(dom.add(dom.add(dom.write(dom.newTag("div"),{id:"loader"}),dom.newText("\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 ...")),dom.add(dom.newTag("div"),d))),e=null,f=0,e=setInterval(function(){if(c){var b=Math.round(100*h/i);if(f!=b)d.style.width=b+"%",f=b}else a()},100);setTimeout(a,1E4)}();document.body.removeAttribute("class");f&&f()};location.host&&function(d){new Loader({base:"/styles/graphics/",list:["textures/seamless/canvas.jpg","textures/seamless/leather.jpg","textures/repeat-x.jpg","slices/repeat-x.png","slices/repeat-y.png","sprite.png"]});(function(a){function b(b,e){for(var d,c=[];b--;)c.push(dom.newTag("span",a));b=c.length;this.value=function(a){if(d!==a){d=a;var e=(a=(new String(a)).split("")).length;if(e<b)for(e=b-e;e--;)a.unshift("0");for(e=0;e<b;e++)c[e].className="digit-"+a[e]}};e&&(dom.newTag("span",a).className="separator")}a=dom.body(dom.set(dom.newTag("div"),{id:"clock",title:"\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f"}));(a=dom.newTag("span",a)).className="date";var c=new b(4,1),d=new b(2,1),e=new b(2);(a=dom.newTag("span",a.parentNode)).className="time";var g=new b(2,1),h=new b(2,1),i=new b(2);(function(){with(new Date)i.value(getSeconds()),h.value(getMinutes()),g.value(getHours()),e.value(getDate()),d.value(getMonth()+1),c.value(getFullYear());setTimeout(arguments.callee,1E3)})()})(d);location.host&&(d=dom.byId("search"))&&function(a){for(var b=0,c,f=a.length;b<f;b++)switch((d=a[b]).type){case "submit":d.onclick=function(){var a=c.value;if(a){with(new Ajax)queryParams().insert("expression",a),post(c.form.action);open("http://google.com/search?as_sitesearch=megaweb.org.ru&as_q="+a.replace(/(\s+)/g,"+"))}else alert("\u041d\u0435 \u0437\u0430\u0434\u0430\u043d\u0430 \u0444\u0440\u0430\u0437\u0430 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430");return!1};continue;case "text":c=d}}(dom.byTag("form",d).elements);location.host&&(d=dom.byId("W3C"))&&function(a){function b(a,b){a&&(a="?uri="+escape(a),open(b?"http://jigsaw.w3.org/css-validator/validator"+a+"&profile=css3":"http://validator.w3.org/check"+a))}for(var c=0,f=a.length;c<f;c++)switch((d=a[c]).className){case "css":d.onclick=function(){for(var a=0,c=document.styleSheets,d=c.length;a<d;b(c[a++].href,1));};continue;case "uml":d.onclick=function(){b(location,0)}}}(dom.hasTag("span"));location.host&&function(){(new Ajax).post("/@services/geoip.cgi",function(a){a=a.getResponse();if(a.statusCode()==200&&(a=a.asJson())){var b=a.flag;if(b){var c=a.code+": "+a.country+", "+a.city;dom.body(dom.add(dom.set(dom.newTag("div"),{id:"geo-ip",title:c}),dom.add(dom.add(dom.newTag("p"),dom.set(dom.newTag("img"),{alt:b,src:"/geo/"+b.toLowerCase()+".png"})),dom.newText(c+" ("+a.ip+")"))))}}})}()}();location.host&&function(c){c&&(new Ajax).post("/@services/geoip.cgi",function(a){a=a.getResponse();if(a.statusCode()==200&&(a=a.asJson())){var b=a.flag;if(b){var d=a.code+": "+a.country+", "+a.city;dom.add(c,dom.add(dom.add(dom.write(dom.newTag("span"),{className:"geoip"}),dom.write(dom.newTag("img"),{alt:b,src:"/geo/"+b.toLowerCase()+".png",title:d})),dom.add(dom.newTag("span"),dom.newText(d+" ("+a.ip+")"))))}}})}(dom.byId("footer"));function EventContext(b){var a=b.length?b[0]:event;this.eventObject=a;this.eventTarget=a.target||a.srcElement;this.preventDefault=function(){a.preventDefault?a.preventDefault():a.returnValue=0}};with(document)onkeydown=onkeyup=onmousemove=onmousedown=onmouseup=ondblclick=function(){var a=new EventContext(arguments),c=a.eventTarget;try{if(!c.tagName.match(/INPUT|TEXTAREA/i)){var b=window.getSelection;b?b().removeAllRanges():this.selection.empty();a.preventDefault()}}catch(d){}};document.onclick=function(){function d(a){if(a.parentNode.className=="picture")return e.preventDefault(),1;if(a.hostname==location.hostname){var b=a.href;if(b.indexOf("/@partners/")<0&&b.indexOf("/@redirect/")<0)return 0}a.target="_blank";return 1}var e=new EventContext(arguments);try{var c=e.eventTarget,a=c.tagName.toLowerCase();if(!(a=="a"&&d(c))&&a=="img"){var b=c.parentNode,a=b.tagName.toLowerCase();if(a=="span")b=b.parentNode,a=b.tagName.toLowerCase();a=="a"&&d(b)}}catch(f){}};location.host&&function(b){function d(a){var b="blogger|digg|evernote|delicious|facebook|friendfeed|gbuzz|greader|juick|liveinternet|linkedin|lj|moikrug|moimir|myspace|odnoklassniki|twitter|vkontakte|yaru|yazakladki".split("|");return a?b.join(",|,").split(","):b}if(b){dom.body(dom.write(dom.newTag("script"),{charset:"utf-8",src:"//yandex.st/share/share.js",type:"text/javascript"}));for(var a,c=0,e=dom.hasTag("meta",dom.byTag("head")),f=e.length;c<f;c++)if((a=e[c]).name=="description"){a=a.content;break}else a=null;var g={element:b.id,description:a,elementStyle:{border:!0,quickServices:a?[]:d(1)},popupStyle:{blocks:{"\u0421\u043f\u0438\u0441\u043e\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432":d(0)}}},h=setInterval(function(){if(Ya&&Ya.share){clearInterval(h);try{Ya.share(g)}catch(a){alert("\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f: "+a.toString()),dom.off(b)}}},500)}}(dom.byId("ya_share"));location.host&&(function(a,b){a[b]||(a[b]=[function(){try{a.yaCounter2092135=new Ya.Metrika({id:2092135,enableAll:!0})}catch(b){}}]);dom.body(dom.set(dom.newTag("script"),{defer:"defer",src:"//mc.yandex.ru/metrika/watch.js",type:"text/javascript"}));dom.body(dom.add(dom.set(dom.newTag("a"),{href:"//top100.rambler.ru/navi/1530013/"}),dom.set(dom.newTag("img"),{src:"//counter.rambler.ru/top100.cnt?1530013"})))})(window,"yandex_metrika_callbacks");
