﻿var d=document,hn="http://udf.su/",search_module_dd,login_cont;function ajax(url,func,post,postVar){var xmlhttp=false;try{xmlhttp=new XMLHttpRequest}catch(a){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){xmlhttp=false}}}if(!post){xmlhttp.open("GET",url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)if(xmlhttp.status==200)if(func)eval(func).call(window,xmlhttp.responseText)};xmlhttp.send(null)}else{xmlhttp.open("POST",url,true);xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)if(xmlhttp.status==200)if(func)eval(func).call(window,xmlhttp.responseText)};xmlhttp.send(postVar)}}function preImg(a){var b=new Image;b.src=a}function getStyle(element,style){if(element.currentStyle)return eval("element.currentStyle."+style);else return eval("window.getComputedStyle(element, null)."+style)}function setStyle(a,b){if(b.lastIndexOf(";")==b.length-1)b=b.slice(0,b.lastIndexOf(";"));var c=b.toLowerCase();c=c.split(";");c=c.join(":");c=c.split(":");for(var d=0;d<c.length;d++){if(c[d].indexOf("-")!=-1)c[d]=c[d].slice(0,c[d].indexOf("-"))+c[d].slice(c[d].indexOf("-")+1,c[d].indexOf("-")+2).toUpperCase()+c[d].slice(c[d].indexOf("-")+2);if(c[d]=="float")c[d]="styleFloat";if(c[d]=="opacity"){a.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+c[d+1]+")";c[d+1]=c[d+1]/100;a.style.MozOpacity=a.style.KhtmlOpacity=c[d+1]}a.style[c[d]]=c[++d]}}function displayTip(a,b){var c=d.getElementById("tip");if(c==null){c=d.createElement("div");c.id="tip";setStyle(c,"position:absolute;border:2px #ffa800 dashed;background:#000000;padding:10px;font-size:11pt;display:none;");d.body.appendChild(c)}if(b){c.innerHTML=b;if(!a)var a=window.event;if(a.pageX==null&&a.clientX!=null){var e=d.documentElement;var f=d.body;a.pageX=a.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e.clientLeft||0);a.pageY=a.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e.clientTop||0)}var g=a.pageX+10;var h=a.pageY+10;setStyle(c,"display:block;top:"+h+"px;left:"+g+"px;")}else{setStyle(c,"display:none;");return false}}function queryStr(a){var b="";for(var c=0;c<a.length;c++){var d=a.elements[c];if(d.name!=""&&d.type!="button"&&d.type!="submit"&&d.type!="reset"){var e=d.name;var f=d.value;if(d.type!="checkbox"||d.checked){b+="&";b+=encodeURIComponent(e)+"="+encodeURIComponent(f)}}}b=b.slice(1);return b}function renewScripts(a){a=a.replace('<script type="text/javascript">window.resizeTo(750,420);</script>',"");var b="",c=new RegExp("<script type=.?text/javascript.?");while(c.test(a)){b=a.slice(a.search(c),a.indexOf("</script>")+9);a=a.replace(b,"");var e=new RegExp("<script type=.?text/javascript.?>");if(e.test(b)){b=b.replace(e,"").replace("</script>","");strToFunc(b)}else{e=new RegExp("['\"]>");b=b.slice(b.indexOf("src=")+5,b.indexOf(">")-1);var f=d.createElement("script");f.type="text/javascript";f.src=b;d.body.appendChild(f)}}}function strToFunc(str){while(str.indexOf("function")!=-1){str=str.slice(str.indexOf("function")+8);var fName=str.replace(" ","");fName=fName.replace(/ /g,"");fName=fName.slice(0,fName.indexOf("("));var fVar=str.slice(str.indexOf("(")+1,str.indexOf(")"));fVar=fVar.replace(/ /g,"");fVar=fVar.replace(/,/g,'", "');fVar='"'+fVar+'"';var fStr=str.slice(str.indexOf("{")+1);if(str.indexOf("function")!=-1)fStr=fStr.slice(0,fStr.indexOf("function"));fStr=fStr.slice(0,fStr.lastIndexOf("}"));if(fName=="switchpage")fStr="var form = document.memform;form.s.value=n;ajax(form.action, 'submitSetup', true, queryStr(form))";fStr=fVar.replace(/"/g,'\\"');fStr=fVar.replace(/\n/g,"");fStr='"'+fStr+'"';window[fName]=new Function(eval(fVar),eval(fStr))}}function blockBubble(a){a=a||window.event;if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true}function animation(element,param,from,to,dimension,delta,duration,speed,n,onFinish){var start=(new Date).getTime();clearTimeout(ticker[n]);ticker[n]=setTimeout(function(){var now=(new Date).getTime()-start,progress=now/duration,result=Math.round((to-from)*delta(progress)+from);if(param!="func")element.style[param]=result+dimension;else eval(dimension);if(progress<1)ticker[n]=setTimeout(arguments.callee,speed);else{if(param!="func")element.style[param]=to+dimension;if(onFinish)eval(onFinish)}},speed)}function setOpacity(a,b,c){if(b+c>=0&&b+c<=100){b+=c;a.MozOpacity=a.KhtmlOpacity=a.opacity=b/100;a.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+b+")";return b}return false}function getElementsByClass(a,b,c){var e=new Array;if(b==null)b=d;if(c==null)c="*";var f=b.getElementsByTagName(c),g=f.length,h=new RegExp("(^|\\\\s)"+a+"(\\\\s|$)");for(var i=0,j=0;i<g;i++)if(h.test(f[i].className)){e[j]=f[i];j++}return e}function insertAfter(a,b,c){a.insertBefore(b,c.nextSibling)}function addEvent(a,b,c){if(!c.$$guid)c.$$guid=addEvent.guid++;if(!a.events)a.events={};var d=a.events[b];if(!d){d=a.events[b]={};if(a["on"+b])d[0]=a["on"+b]}d[c.$$guid]=c;a["on"+b]=handleEvent}addEvent.guid=1;function removeEvent(a,b,c){if(a.events&&a.events[b])delete a.events[b][c.$$guid]}function handleEvent(a){a=a||window.event;var b=this.events[a.type];for(var c in b){this.$$handleEvent=b[c];this.$$handleEvent(a)}}(function(){var a=d.getElementById("search_module").getElementsByTagName("a");for(var b=1;b<a.length;b++)a[b].onclick=function(){search_swichModule(this)};a=a[0];var c=0;a.onclick=function(a){blockBubble(a);search_module_dd(true)};a.onmouseover=function(){a.style.backgroundPosition="-712px -112px"};a.onmouseout=function(){if(!c)a.style.backgroundPosition="-572px -157px"};sClick=function(){if(c)search_module_dd()};addEvent(d,"click",sClick);runSearch=function(){var b=encodeURIComponent(d.getElementById("search").value),c=a.innerHTML.slice(5,-6);switch(c){case"Новости":c="&m=site&m=news&t=0";break;case"Файлы":c="&m=load&t=0";break;case"Уроки":c="&m=publ&t=0";break;case"Форум":c="&m=site&m=news&m=publ&m=load&m=forum&t=0";break;default:c="&m=site&m=news&m=publ&m=load&m=forum&t=0";break}location="/search/?q="+b+c};search_swichModule=function(b){var c=a.innerHTML;a.innerHTML=b.innerHTML;b.innerHTML=c};search_module_dd=function(b){if(b){a.style.backgroundPosition="-712px -112px";d.getElementById("search_module_dd").style.display="block";c=1}else{a.style.backgroundPosition="-572px -157px";d.getElementById("search_module_dd").style.display="none";c=0}}})();(function(){var a=new Array;ticker=new Array;elemNumber=new Array;var b=new Array;cont=new Array;var c=new Array,e=3,f=15,g=1;startPosition=162;var h=23+e,i,j;a.push("");a.push("dd_files");a.push("dd_lessons");a.push("dd_forum");for(var k=0;k<a.length;k++)if(a[k]!=""){cont[k]=d.getElementById(a[k]);c[k]=cont[k].getElementsByTagName("div");cont[k].style.height=h*c[k].length/2+startPosition+h+"px";elemNumber[k]=0;i=d.getElementById("menu").getElementsByTagName("li")[k];(function(){var a=k;i.onmouseover=function(){j=b[a]=1;cont[a].style.display="block";dropDown(a)};i.onmouseout=function(){j=b[a]=0;ticker[(a+1)*10]=setTimeout(function(){l(a)},10)};cont[a].onmouseover=function(){b[a]=1};cont[a].onmouseout=function(){b[a]=0;ticker[(a+1)*10]=setTimeout(function(){l(a)},10)}})()}var l=function(a){clearTimeout(ticker[(a+1)*10]);if(b[a]==0){var d=c[a];for(var e=0;e<d.length;e+=2)d[e].style.zIndex=1;goingUp(a)}};dropDown=function(a){var b=c[a];setStyle(cont[a],"opacity:100;");if(elemNumber[a]==-2)elemNumber[a]=0;if(elemNumber[a]<b.length){var d=b[elemNumber[a]];if(elemNumber[a]){var e=b[elemNumber[a]-2].style;e.zIndex=5;d.style.zIndex=4;var i=d.style.top=e.top}else var i=d.style.top=startPosition+"px";i=parseInt(i);var j=h+i;animation(d,"top",i,j,"px",function(a){return a},f,g,a,"elemNumber[n]+=2;dropDown(n);")}};goingUp=function(a){var b=c[a];if(j)setStyle(cont[a],"opacity:60;");var d='element.style.top = startPosition + "px";elemNumber[n]-=2;goingUp(n);';if(elemNumber[a]==b.length)elemNumber[a]=b.length-2;if(elemNumber[a]>=0){var e=b[elemNumber[a]];e.style.zIndex=1;if(elemNumber[a]){var h=b[elemNumber[a]-2].style;h.zIndex=2;var i=parseInt(h.top)}else{var i=startPosition;d+='cont[n].style.display = "none";'}var k=parseInt(e.style.top);animation(e,"top",k,i,"px",function(a){return a},f,g,a,d)}}})();var numPages,filesDiv=d.getElementById("files_body"),module="/load/",arrFiles=new Array,currEnt=0,rowCenter=0,prevPage,nextPage=1,pgc,entFirstCont,entSecondCont,fileRow;(function(){if(filesDiv){filesDiv.innerHTML='<div id="file"></div><div class="hr_left"></div><center><div class="fileRow"><a href="javascript:" onmouseout="eM(this, \'-308px\')" onmouseover="eM(this, \'-384px\')" onMouseDown="eM(this, \'-423px\')" onMouseUp="eM(this, \'-384px\')" onclick="prevEnt();" class="leftLinkFileRow"></a><a href="javascript:" onmouseout="eM(this, \'-327px\')" onmouseover="eM(this, \'-403px\')" onMouseDown="eM(this, \'-442px\')" onMouseUp="eM(this, \'-403px\')" onclick="nextEnt()" class="rightLinkFileRow"></a><div id="fileRow"></div></div></center><div style="text-align:right;"><a href="/load">Все файлы</a></div>';entFirstCont=d.createElement("center");entSecondCont=d.createElement("div");var a=d.getElementById("file");fileRow=d.getElementById("fileRow");a.appendChild(entFirstCont);a.appendChild(entSecondCont);nextEnt()}})();function nextEnt(){if(rowCenter+4>arrFiles.length){ajax(module+"0-"+nextPage++,function(a){pgc=a;while(/<!--title-->/.test(pgc)){var b=getEnteries();arrFiles.push(b)}nextEnt()});return true}if(!numPages){numPages=pgc.slice(pgc.indexOf("<!--page-->"),pgc.indexOf("<!--/page-->"));numPages=numPages.slice(0,numPages.lastIndexOf("</a>"));numPages=numPages.slice(0,numPages.lastIndexOf("</a>"));prevPage=numPages=numPages.slice(numPages.lastIndexOf(">")+1);createEnt()}rowManage(1)}function prevEnt(){if(rowCenter-4<0){ajax(module+"0-"+prevPage--,function(a){pgc=a;var b=arrFiles.length,c=new Array;while(/<!--title-->/.test(pgc))c.push(getEnteries());for(var d=c.length-1;d>=0;d--)arrFiles.unshift(c[d]);b=arrFiles.length-b;rowCenter+=b;currEnt+=b;prevEnt()});return true}rowManage(-1)}function smallImg(a){if(a=="")return;preImg(a.slice(a.indexOf("src")+5,a.indexOf('" ')));a=a.replace("225","90").replace("300","120").replace(">",' onclick="replaceFile(this)">').replace('style="','style="cursor:pointer;');return a}function createEnt(){entFirstCont.innerHTML=arrFiles[currEnt][0]+"<br>"+arrFiles[currEnt][1]+"<br>";entSecondCont.innerHTML=arrFiles[currEnt][2]+arrFiles[currEnt][3]}function getEnteries(){var a=new Array;a[0]=pgc.slice(pgc.indexOf("<!--title-->")+12,pgc.indexOf("<!--/title-->"));a[1]=pgc.slice(pgc.indexOf("<!--img-->")+10,pgc.indexOf("<!--/img-->"));a[2]=pgc.slice(pgc.indexOf("<!--message-->")+14,pgc.indexOf("<!--/message-->"));a[3]=pgc.slice(pgc.indexOf("<!--details-->")+14,pgc.indexOf("<!--/details-->"));pgc=pgc.replace("<!--title-->"+a[0]+"<!--/title-->","").replace("<!--img-->"+a[1]+"<!--/img-->","").replace("<!--message-->"+a[2]+"<!--/message-->","").replace("<!--details-->"+a[3]+"<!--/details-->","");return a}function rowManage(a){var b=new Array,c=2-a*2;b[0]=rowCenter;rowCenter+=a;if(b[0]==currEnt){b[0]+=a;rowCenter+=a}b[c+=a]=smallImg(arrFiles[b[0]][1]);if(b[0]+a==currEnt)b[0]+=a;b[c+=a]=smallImg(arrFiles[b[0]+=a][1]);if(b[0]+a==currEnt)b[0]+=a;b[c+=a]=smallImg(arrFiles[b[0]+=a][1]);fileRow.innerHTML=b[1]+b[2]+b[3]}function eM(a,b){a.style.backgroundPosition=b+" 0"}function replaceFile(a){for(var b=0;b<arrFiles.length;b++)if(arrFiles[b][1].indexOf(a.src)>0){currEnt=b;rowCenter--;rowManage(1);createEnt()}}var ned;function newsEffects(a,b){if(b!="click")if(b=="hover")a.style.backgroundPosition="0 -121px";else a.style.backgroundPosition="0 -102px";else{var c=a.getElementsByTagName("div")[3];c.onclick=function(a){blockBubble(a)};c=c.style;if(c.display!="block"){c.display="block";a.className="news_body";a.style.backgroundPosition="0 -248px";a.onmouseover=a.onmouseout=""}else{c.display="none";a.className="news_body_collapsed";a.onmouseover=function(){newsEffects(a,"hover")};a.onmouseout=function(){newsEffects(a)}}}}(function(){var a=d.getElementById("news");if(a){var b=getElementsByClass("news_body",a,"div");for(var c=0;c<b.length;c++){b[c].className="news_body_collapsed";b[c].onclick=function(){newsEffects(this,"click")};b[c].onmouseover=function(){newsEffects(this,"hover")};b[c].onmouseout=function(){newsEffects(this)};b[c].getElementsByTagName("a")[0].href="javascript:"}}})();(function(){var a=d.getElementById("poll"),b=a.innerHTML;if(b.indexOf("radio")==-1){a.innerHTML="";var c=new Array;var e=0;var f=b.slice(b.search(/<[Bb]>/),b.search(/<\/[Bb]>/)+4);var g='<div class="pollQuestion">'+f+"</div>";while(b.indexOf("Голосов:")!=-1){c[e]=new Array;var h=b.slice(b.indexOf("Голосов:")+8,b.indexOf('%)"'));var i=h.replace(/ /g,"");h=b.slice(b.indexOf("Голосов:"+h));i=i.split("(");c[e][0]=i[0];c[e][1]=i[1];c[e][2]=h.slice(h.indexOf(">")+1,h.indexOf("<"));if(c[e][1]<100){c[e][3]=Math.ceil(232/100*c[e][1]);if(c[e][3]-30>=0)c[e][3]-=30;else c[e][3]+=3}else c[e][3]=Math.ceil(232/100*c[e][1])-35;b=b.replace("Голосов:","").replace('%)"',"");g+='<div class="pollVoteCont"><div class="pollCornerLeft"></div><div class="pollCornerRight"></div><div class="pollVote" style="width:'+c[e][1]+'%"></div><div class="pollVoteText" style="text-indent:'+c[e][3]+'px;">'+c[e][1]+'%</div></div><div class="pollVoteAnswer"><span class="attention">'+c[e][0]+"</span> пользователей ответили "+c[e][2]+"</div>";e++}var j=b.slice(b.indexOf("· <")+2,b.indexOf(" ]</")).replace("Архив опросов","Все опросы");var k=b.slice(b.indexOf("Всего ответов:")).replace(new RegExp("(Всего ответов: <[bB]>[^<]+</[Bb]>).*\\n*.*"),"$1");g+='<div class="pollFooter"><div>'+k+"</div>"+j+"</div>";a.innerHTML+=g}})();function psInitForum(a){var b=d.getElementById("forumBody");if(!b)return false;b=getElementsByClass("switches",b,"table");var c=b[a];if(!c)return false;var e=c.getElementsByTagName("td");for(var f=1;f<e.length;f++){var g=e[f].getElementsByTagName("a")[0];if(g!=null){createPDiv("",g,g.lastChild);g.onmouseover=g.onmouseout=function(){hover(this)}}else if(e[f].className!="switch")e[f].innerHTML='<div class="psla">&nbsp;</div><b>'+e[f].innerHTML+'</b><div class="psra">&nbsp;</div>'}}function psInit(a){var b=d.getElementById(a);if(!b)return false;if(!/a/.test(b.innerHTML))return false;b.className="psel";var c=b.getElementsByTagName("span")[0];if(c)b=c;b.innerHTML=b.innerHTML.replace(/> +</g,"><");var e=b.getElementsByTagName("b")[0],f=b.getElementsByTagName("a");createPDiv("a",b,e);for(var g=0;g<f.length;g++){createPDiv("",f[g],f[g].lastChild);f[g].onmouseover=f[g].onmouseout=function(){hover(this)}}}function createPDiv(a,b,c){var e=d.createElement("div");e.className="psl"+a;e.innerHTML="&nbsp;";var f=d.createElement("div");f.className="psr"+a;f.innerHTML="&nbsp;";b.insertBefore(e,c);insertAfter(b,f,c)}function hover(a){var b=a.getElementsByTagName("div");if(/a/.test(b[0].className))b[0].className="psl";else b[0].className="psla";if(/a/.test(b[1].className))b[1].className="psr";else b[1].className="psra"}(function(){if(!psInit("psel")&&!psInit("psel1")&&!psInit("pagesBlock1")){psInitForum(0);psInitForum(1)}})();function swichHover(a,b){a.style.backgroundPosition=b+" bottom"}(function(){var a=d.getElementById("menu"),b=a.getElementsByTagName("li"),c=a.getElementsByTagName("a"),e=new Array(95,88,84,90);for(var f=0;f<c.length;f++){b[f].style.width=e[f]+"px";var g=0;for(var h=0;h<f;h++)g+=e[h];if(f)g+=20*f;(function(){var b=[c[f],g,a];b[0].onmouseover=function(){swichHover(b[2],b[1]+"px")};b[0].onmouseout=function(){swichHover(b[2],"-145px")}})()}})();(function(){login_cont=d.getElementById("login_cont");var a=d.getElementById("login_glass");if(!login_cont){var b=d.getElementById("user");var c=b.getElementsByTagName("li");var e=b.getElementsByTagName("a");var f=new Array(98,78);for(var g=0;g<e.length;g++){c[g].style.width=f[g]+"px";var h=0;for(var i=0;i<g;i++)h+=f[i];if(g)h-=10*g;else h-=15;(function(){var a=[e[g],h,b];a[0].onmouseover=function(){swichHover(a[2],a[1]+"px")};a[0].onmouseout=function(){swichHover(a[2],"-145px")}})()}return false}var j=0,b=d.getElementById("user"),c=b.getElementsByTagName("li"),e=b.getElementsByTagName("a"),f=new Array(120,74);for(var g=0;g<e.length;g++){c[g].style.width=f[g]+"px";var h=0;for(var i=0;i<g;i++)h+=f[i];if(g)h-=10*g;(function(){var a=[e[g],h,b];a[0].onmouseover=function(){swichHover(a[2],a[1]+"px")};a[0].onmouseout=function(){swichHover(a[2],"-145px")}})()}loginManage=function(b){if(!j&&b!="login_glass")if(b!="login_cont"){login_cont.style.display=a.style.display="block";animation(a,"func",0,100,"setOpacity(element.style, result, 0)",function(a){return a},500,20,999,'loginManage("login_cont")')}else{animation(login_cont,"func",0,70,"setOpacity(element.style, result, 0)",function(a){return a},500,20,999,false);j=1}else if(b!="login_glass")animation(login_cont,"func",70,0,"setOpacity(element.style, result, 0)",function(a){return a},500,20,999,'loginManage("login_glass")');else{animation(a,"func",100,0,"setOpacity(element.style, result, 0)",function(a){return a},500,20,999,'login_cont.style.display = "none";');j=0}};e[1].onclick=function(a){blockBubble(a);loginManage()};login_cont.onclick=function(a){blockBubble(a)};a.onclick=function(a){blockBubble(a)};lClick=function(){if(j)loginManage()};addEvent(d,"click",lClick)})()