fileUploadResult=null;var trans=[];for(var i=1040;i<=1103;i++){trans[i]=i-848}trans[1025]=168;trans[1105]=184;function reloc_addr(a){document.location=a}function my_escape(d){try{var a=[];for(var b=0;b<d.length;b++){var e=d.charCodeAt(b);if(typeof trans[e]!="undefined"){e=trans[e]}if(e<=255){a.push(e)}}return window.escape(String.fromCharCode.apply(null,a))}catch(c){alert(c)}}function serialize(d){try{var h=function(o){var n=typeof o,l;if(n=="object"&&!o){return"null"}if(n=="object"){if(!o.constructor){return"object"}var k=o.constructor.toString();if(l=k.match(/(\w+)\(/)){k=l[1].toLowerCase()}var m=["boolean","number","string","array"];for(key in m){if(k==m[key]){n=m[key];break}}}return n};var f=h(d);var a,c="";switch(f){case"function":a="";break;case"undefined":a="N";break;case"boolean":a="b:"+(d?"1":"0");break;case"number":a=(Math.round(d)==d?"i":"d")+":"+d;break;case"string":a="s:"+d.length+':"'+d+'"';break;case"array":case"object":a="a";var e=0;var g="";var j;for(key in d){c=h(d[key]);if(c=="function"||c=="object"){continue}if(d[key]=="reduce"||d[key]=="reduceRight"){continue}j=(key.match(/^[0-9]+$/)?parseInt(key):key);g+=serialize(j)+serialize(d[key]);e++}a+=":"+e+":{"+g+"}";break}if(f!="object"&&f!="array"){a+=";"}return a}catch(b){alert(b)}}var ajaxRequest=function(){this.userOnLoad=null;this.userOnErrLoad=null;this.GET=new Array();this.POST=new Array();this.POSTARR=new Array();this.POST_N=false;this.text=null;this.xml=null;this.errtext=null;this.mContainerName=null;this.TIMEOUT=null;this.HTTP=null;if(window.XMLHttpRequest){this.HTTP=new XMLHttpRequest()}else{if(window.ActiveXObject){this.HTTP=new ActiveXObject("Msxml2.XMLHTTP")}}};ajaxRequest.prototype.nullData=function(){try{this.GET=new Array();this.POST=new Array();this.POSTARR=new Array();this.POST_N=false}catch(a){alert(a)}};ajaxRequest.prototype.setGET=function(c,b){try{this.GET[c]=b}catch(a){alert(a)}};ajaxRequest.prototype.setPOST=function(d,c){try{for(var a=0;a<this.POST.length;a++){if(this.POST[a]["name"]==d){this.POST[a]["value"]=c;return}}this.POST[this.POST.length]={name:d,value:c};this.POST_N=true}catch(b){alert(b)}};ajaxRequest.prototype.setPOSTARR=function(d,c){try{for(var a=0;a<this.POSTARR.length;a++){if(this.POSTARR[a]["name"]==d){this.POSTARR[a]["value"]=c;return}}this.POSTARR[this.POSTARR.length]={name:d,value:c};this.POST_N=true}catch(b){alert(b)}};ajaxRequest.prototype.load_form=function(b,g,a,d){try{if(typeof(a)=="undefined"||a==null){alert("Не указано имя элемента, который будет принимать данные.");return}this.mContainerName=a;if(typeof($("#"+b).ajaxForm)=="undefined"){alert("Не загружен модуль для работы с формами!");return}var f=function(){};var h=this;if(typeof(g)!="undefined"&&g!=null){f=g}var c={success:function(k,l){try{h.workLoadedText(k,h.mContainerName);if(h.userOnLoad!==null){h.userOnLoad()}}catch(j){alert(j);alert(k)}},beforeSubmit:f};if(typeof(d)!="undefined"&&d!=null){c.url=d}$("#"+b).ajaxForm(c)}catch(e){alert(e)}};ajaxRequest.prototype.load_file=function(b,h,d,a,g){try{if(typeof(a)=="undefined"||a==null){alert("Не указано имя элемента, который будет принимать данные.");return}this.mContainerName=a;var f=function(){};var c=this;if(typeof(g)!="undefined"&&g!=null){f=g}$("#"+b).upload({name:h,method:"post",enctype:"multipart/form-data",action:d,onSubmit:f,onComplete:function(k){try{c.workLoadedText(k,c.mContainerName);if(c.userOnLoad!==null){c.userOnLoad()}}catch(j){alert(j);alert(k)}}})}catch(e){alert(e)}};ajaxRequest.prototype.load=function(f,a){try{if(typeof(a)=="undefined"||a==null){alert("Не указано имя элемента, который будет принимать данные.");return}this.mContainerName=a;var b;var e;if(typeof(this)!="undefined"&&this!=null&&typeof(this.HTTP)!="undefined"&&this.HTTP!=null){this.HTTP.abort()}var c=f;if(this.GET.length!==0){c+="?";for(b in this.GET){c+=b+"="+encodeURIComponent(this.GET[b])+"&"}}c+="&eryiyhkfgdksbv&"+Math.random();if(this.POST_N==false){this.HTTP.open("GET",c,true);e=null}else{this.HTTP.open("POST",c,true);e="eryiyhkfgdksbv&"+Math.random()+"&";for(var d=0;d<this.POST.length;d++){e+=this.POST[d]["name"]+"="+encodeURIComponent(this.POST[d]["value"])+"&"}for(var d=0;d<this.POSTARR.length;d++){e+=this.POSTARR[d]["name"]+"="+encodeURIComponent(serialize(this.POSTARR[d]["value"]))+"&"}this.HTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.HTTP.setRequestHeader("Content-Length",e.length)}var h=this;this.HTTP.onreadystatechange=function(){try{if(h.HTTP.readyState==4){clearTimeout(h.TIMEOUT);h.TIMEOUT=null;if(h.HTTP.status==200){h.text=h.HTTP.responseText;h.xml=h.HTTP.responseXML;if(h.onLoaded!==null){h.onLoaded()}if(h.userOnLoad!==null){h.userOnLoad()}}else{h.errtext=h.HTTP.statusText;if(h.onerror!==null){h.onerror()}if(h.userOnErrLoad!==null){h.userOnErrLoad()}}h.userOnLoad=null;h.userOnErrLoad=null}}catch(j){alert(j)}};this.HTTP.send(e);this.nullData();this.TIMEOUT=setTimeout(function(){h.etimeout()},300000)}catch(g){alert(g)}};ajaxRequest.prototype.etimeout=function(){try{if(typeof(this)!="undefined"&&this!=null){if(typeof(this.HTTP)!="undefined"&&this.HTTP!=null){this.HTTP.abort()}this.errtext="Timeout";if(this.onerror!==null){this.onerror()}}}catch(a){alert(a)}};ajaxRequest.prototype.onLoaded=function(){try{this.workLoadedText(this.text,this.mContainerName)}catch(a){alert(a+"\r\n-----------\r\n"+this.text)}};ajaxRequest.prototype.workLoadedText=function(text,container){try{var element=document.getElementById(container);if(element!=null){var matchAllInline=new RegExp("<script[^>]*>([\\S\\s]*?)<\/script>","img");var matchAllSrc=new RegExp("<script src=['|\"]([^'\"]*?)['|\"][^>]*>([\\S\\s]*?)<\/script>","img");var stripScripts=function(text){while((matched=matchAllInline.exec(text))!=null){try{text=text.replace(matched[1],"")}catch(err){alert("Java eval error ("+err.number+"): "+err.description)}}};var extractScripts=function(text){while((matched=matchAllSrc.exec(text))!=null){$.getScript(matched[1])}while((matched=matchAllInline.exec(text))!=null){try{eval.call(window,matched[1])}catch(err){alert("Java eval error ("+err.number+"): "+err.description)}}};element.innerHTML=text;extractScripts(text)}else{alert("?лемент с id="+container+" не был найден в теле документа.")}}catch(err){alert(err)}};ajaxRequest.prototype.onerror=function(){var a="Ошибка запроса данных! "+this.HTTP.status+"\r\n"+this.HTTP.responseText;if(typeof(this.mContainerName)!="undefined"||this.mContainerName!=null){this.workLoadedText(a,this.mContainerName)}else{alert(a)}};
