window.addEvent("domready",function(){scrollWindow=new Fx.Scroll(window);var A;$$(".help").addEvent("focus",function(B){A=this.get("value");if(this.hasClass("m")){this.removeClass("m");this.set("value","")}});$$(".help").addEvent("blur",function(B){if(this.get("value")==""){this.addClass("m");this.set("value",A)}});$$(".gen_title").addEvent("keyup",function(D){var B=getURI(this.value);var C=$$(".gen_name");C.each(function(E){E.value=B})});$$(".done",".error","#msg").addEvent("click",function(B){this.setStyle("display","none")});$$(".confirm").each(function(B){B.addEvent("click",this.confirmSomething.bindWithEvent(this,B))})});if(typeof(Shadowbox)!="undefined"){Shadowbox.init({adapter:"mootools",players:["img","iframe"],language:"ru"})}function msg(B,A){$("msg").addClass(A);$("msg").set("html",B);$("msg").removeClass("none")}function loading(){$$(".loading").toggleClass("none")}function loader(A){if(A==undefined){var A=true}var B="loader";if(A){$(B).removeClass("none")}else{$(B).addClass("none")}}function confirmSomething(B,A){if(!confirm(A.get("title"))){B.stop()}}function getURI(A){A=A.toLowerCase();var B=new Array(/ /g,/ж/g,/ю/g,/я/g,/ц/g,/ч/g,/ш/g,/щ/g,/эй/g,/а/g,/б/g,/в/g,/г/g,/д/g,/е/g,/ё/g,/з/g,/и/g,/й/g,/ы/g,/к/g,/л/g,/м/g,/н/g,/о/g,/п/g,/р/g,/с/g,/т/g,/у/g,/ф/g,/х/g,/ъ/g,/ю/g,/ь/g,/э/g,/\!/g,/\?/g,/\+/g,/—/g,/-/g,/\./g,/,/g,/\(/g,/\)/g,/\[/g,/\]/g,/%/g,/&prime;/g,/&quot;/g,/«/g,/»/g,/:/g,/'/g,/__/g,/"/g,"/","…","#",/---|--/g);var C=new Array("-","zh","ju","ja","ts","ch","sh","csh","a","a","b","v","g","d","e","e","z","i","i","y","k","l","m","n","o","p","r","s","t","u","f","h","","y","","e","","","","-","-","","","","","","","","","","","","","_","_","","","","","-");for(i=0;i<C.length;i++){A=A.replace(B[i],C[i])}return A}function fixPNG(C){if(/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){var E;if(C.tagName=="IMG"){if(/\.png$/.test(C.src)){E=C.src;C.src="/tpl/img/blank.gif"}}else{E=C.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/i);if(E){E=E[1];C.runtimeStyle.backgroundImage="none"}}var D=/iesizing\-(\w+)/;var A=D.exec(C.className);var B=(A)?A[1]:"crop";if(E){C.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+E+"',sizingMethod='"+B+"')"}}}function sprintf(E){var D=E.split("%");var A=D[0];var C=/^([ds])(.*)$/;for(var B=1;B<D.length;B++){p=C.exec(D[B]);if(!p||arguments[B]==null){continue}if(p[1]=="d"){A+=parseInt(arguments[B],10)}else{if(p[1]=="s"){A+=arguments[B]}}A+=p[2]}return A}function getParams(A){var B={};A.split(/\&|\?/).each(function(C){var D=C.split("=");B[D[0]]=D[1]});return B}function $count(B){var A=[];if(!B){return 0}switch($type(B)){case"number":return B;case"function":return((B+"").test(/[{]([\W]*[\w]+[\W\w]*)[}]/))?1:0;case"object":return $H(B).getLength();case"window":case"document":case"element":return B.getChildren().length}return(B.length)?B.length:($type(+B))?+B:1}function openWin(B,A,C){return window.open(C,"popup","HEIGHT="+A+",resizable=yes,WIDTH="+B,false)}function see(D,C){var A="The properties for the "+C+" object:\n";for(var B in D){A+=B+" = "+D[B]+"\n"}return A};
