(function(){var n,t=function(n,t){return function(){return n.apply(t,arguments)}};n=function(){function n(){this.fill=t(this.fill,this)}return n.prototype.init=function(){return this.load_federal(),this.load_regional(),this.load_local()},n.prototype.load_federal=function(){return $.post("/get-federal-campaigns",null,function(n){return function(t){return n.fill("federal-campaign-list",t)}}(this))},n.prototype.load_regional=function(){return $.post("/get-regional-campaigns",null,function(n){return function(t){return n.fill("regional-campaign-list",t)}}(this))},n.prototype.load_local=function(){return $.post("/get-local-campaigns",null,function(n){return function(t){return n.fill("local-campaign-list",t)}}(this))},n.prototype.fill=function(n,t){var i,o,e,l,a,r,c,p,s,u;if(0===t.length)return void $("#"+n).html("Нет активных проектов");for($("#"+n).html(""),o=0,l=t.length;l>o;o++){for(i=t[o],r=$("<li class='project'>"+i.name+"</li>"),u=$("<div class='doit-options'><div class='header'><div class='arrow'></div>В качестве кого?</div></div>"),s=$("<ul></ul>"),p=i.professions,e=0,a=p.length;a>e;e++)c=p[e],s.append("<li><label><input type='checkbox' value='"+c+"' name='campaigns["+i._id+"][professions][]'>"+c+"</label></li>");u.append(s),r.append(u),$("#"+n).append(r)}$("#"+n+" li.project").mouseenter(function(n){return function(n){return u=$(n.target).find(".doit-options"),$(u).is(":hidden")?($(".doit-options").hide(),u.css("left",$(n.target).width()+20).css("top",-4).show()):void 0}}(this)),$(".doit-options").mouseleave(function(){return $(".doit-options").hide()})},n}(),$(function(){return window.campaigns=new n,window.campaigns.init(),$("input[data-type=region]").bind("complete",function(){return window.campaigns.load_regional(),window.campaigns.load_local()}),$("input[data-type=area]").bind("complete",function(){return window.campaigns.load_local()})})}).call(this);