var jqOnload=function(){if(!$.browser.mozilla){window.console={log:function(){}}}$("#processStatus").ajaxStart(function(){$("#regular_errors, #ajax_errors").hide();$(this).show()}).ajaxStop(function(){$(this).hide()});$(".default_hint").bind("focus",function(){if($(this).val()==this.defaultValue){$(this).val("").removeClass("default_hint")}}).bind("blur",function(){if($(this).val()==""){$(this).val(this.defaultValue).addClass("default_hint")}});$("#topServMenu ul li .i").mouseover(function(){$(this).parent().addClass("over")}).mouseout(subButOut).click(function(){$(this).next("ul").slideToggle(150);return false}).blur(function(){var D=this,C=setTimeout(function(){subMenuClose(D);clearTimeout(C)},150)});function B(C){$("#login_form span.proceed").hide();if(C.errors.length){$("#login_form span.error").text("Логин или пароль неверны.").show()}else{$("#login_form span.error").text("").hide();location.href=location.href}$("#login_form :submit").attr("disabled","")}var A={success:B,dataType:"json",beforeSubmit:function(){$("#login_form span.error").hide();$("#login_form span.proceed").show();$("#login_form :submit").attr("disabled","disabled")}};$("#login_form").ajaxForm(A)};function subButOut(){if($(this).next("ul:hidden").length){$(this).parent().removeClass("over")}}function subMenuClose(A){$(A).next("ul").hide().end().mouseout(subButOut).parent().removeClass("over")}function showErrors(B){$("#regular_errors, #ajax_errors").hide();if(B.length){var A="<strong>Внимание:</strong>";A+="<ul>";$(B).each(function(){A+="<li>"+this+"</li>"});A+="</ul>";$("#ajax_errors").html(A).show()}return Boolean(B.length)}var url_parts=location.href.replace(/http:\/\/[^\/]+\//,"").split("/");var abs_url="/"+url_parts.slice(0,2).join("/");function sprintf(B){if((arguments.length==2)&&typeof arguments[1]=="object"){var D=/{[$%]([^}]+)}/g,A=arguments[1];return B.replace(D,function(F,E){return A[E]||""})}else{var D=/{[%$]([^}]+)}/;for(var C=1;C<=arguments.length;C++){B=B.replace(D,arguments[C])}return B}}function check_host(B){var A="http://"+location.host;return(B.substr(0,A.length)==A)}function unique(A,C){var D=[],B={},C=C||false;if(C){for(var E=0;E<C.length;E++){B[C[E]]=true}}for(var E=0;E<A.length;E++){if(!B[A[E]]){B[A[E]]=true;D.push(A[E])}}return D}function requireSelectForSubmit(){switch($(this).find("option:selected").attr("index")){case 0:$(this).siblings("input[type=submit]").attr("disabled","disabled").end().siblings("textarea").hide();break;default:$(this).siblings("input[type=submit]").attr("disabled","").end().siblings("textarea").hide();break;case (this.options.length-1):$(this).siblings("input[type=submit]").attr("disabled","").end().siblings("textarea").show().focus();break}}function doPopup(C,B,D,A){if(!window.focus){return true}window.open(C,B,sprintf("location=yes,width={$width},height={$height}",D,A));return false}if(typeof (jsx)!="undefined"){jsx.require(["jquery.form"],function(){jqOnload();jsx.loaded("main")})}else{$(jqOnload)};