window.addEvent("domready",function(){scrollWindow=new Fx.Scroll(window);roar=new Roar({duration:10000});$$(".gen_title").addEvent("keyup",function(C){var A=getURI(this.value);var B=$$(".gen_name");B.each(function(D){D.value=A})})});function msg(B,A){roar.setOptions({className:"roar-"+A});roar.alert(lng["h_"+A],B)}function loader(A){if(A==undefined){var A=true}var B="loader";if(A){$(B).removeClass("none")}else{$(B).addClass("none")}}function getData(C,D){var A="/inc/ajax.php?json&action="+C;var B=new Request.JSON({url:A,onComplete:function(E){resultData(C,E)}}).get(D)}function getDataPost(C,D){var A="/inc/ajax.php?json&action="+C;var B=new Request.JSON({method:"post",url:A,data:D,onComplete:function(E){resultData(C,E)}}).send()}function getExternalData(A,B){new Request.JSONP({url:A,onComplete:B}).send()}function loadGMap(B,E,D,C){var A="map";if(GBrowserIsCompatible()){if($(A)){$(A).setStyle("width",B+"px");$(A).setStyle("height",E+"px");$(A).setStyle("display","block");var G=new GMap2(document.getElementById(A));G.setCenter(new GLatLng(55.75,37.61),D);var F=new GIcon(G_DEFAULT_ICON);F.image="http://"+site_url+"/tpl/img/point.png";F.shadow="";F.iconSize=new GSize(20,20);markerOptions={icon:F};$each(C,function(H){var I=new GMarker(new GLatLng(H.latitude,H.longitude),markerOptions);GEvent.addListener(I,"click",function(){I.openInfoWindowHtml(H.info)});G.addOverlay(I)});G.addControl(new GLargeMapControl())}}}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 checkFormFields(fields,errorType,errorPrefix){if(errorType==undefined){errorType=1}if(errorPrefix==undefined){errorPrefix="error_"}var errorText="";var classError="error_field";var result=true;var error=false;$each(fields,function(field,index){$each(field,function(check){switch(check.code){case"zero":cond="$(index).get('value') == 0";break;case"empty":cond="$(index).get('value') == ''";break;case"empty_editor":cond="tinyMCE.activeEditor.getContent() == ''";break;case"uri":cond="/[а-яА-Я#'\" ]/.test($(index).get('value'))";break;case"photo":cond="$(index).value != '' && !/jpg|jpeg|gif|png$/.test($(index).value)";break;case"photo_web":cond="($(index).value != '' && !/jpg|jpeg|gif|png$/.test($(index).value)) || ($(index + '_web').value != lng['l_url'] && !/jpg|jpeg|gif|png$/.test($(index + '_web').value))";break;case"email":cond="$(index).get('value') != '' && !/^[.-_A-Za-z0-9]+?@[.-A-Za-z0-9]+?.[A-Za-z0-9]{2,6}$/.test($(index).get('value'))";break;case"checked":cond="!$(index).checked";break;case"sex":cond="!$(index + '_1').get('checked') && !$(index + '_2').get('checked')";break;case"pwd_confirm":cond="$(index).get('value') != '' && $(index).get('value') != $(index + '_confirm').get('value')";break;case"banners_upload":cond="$('banner_type').get('value') == 1 && $(index).get('value') == ''";break;case"banners_code":cond="$('banner_type').get('value') == 2 && $(index).get('value') == ''";break;case"banners_url":cond="($('banner_type').get('value') == 1 && !/swf$/.test($('banner').get('value'))) && $(index).get('value') == ''";break;case"pubs_desc_count":cond="$(index).get('value') != '' && $(index).get('value').length > lim_pubs_desc";break;default:cond=check.code}if(eval(cond)){error=true;if(errorType==1){$(errorPrefix+index).set("text",check.text)}else{if(errorType==2){errorText+=check.text+"<br />"}}}});if(error){if(errorType==1){$(errorPrefix+index).setStyle("display","block");if($(index)){$(index).className+=" "+classError}}result=false}else{if(errorType==1){if($(index)){$(index).className=$(index).className.replace(" "+classError,"")}$(errorPrefix+index).setStyle("display","none")}}error=false});if(errorType==2&&errorText!=""){msg(errorText,"error",false)}return result}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 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};