Event.observe(document,"dom:loaded",function(){if(!logged_in()){$$(".focusLogin").each(function(a){attach_focus_handler(a.select("input"));attach_focus_handler(a.select("textarea"))})}if($("page-blanker")){Event.observe($("page-blanker"),"click",function(a){pop_over_close()})}show_and_hide();Event.observe(document,"session:logged_in",after_login)});function after_login(b){var a=b.memo;_member.logged_in=true;if(a.rights){rights=a.rights}if(a.can_act_as){can_act_as=a.can_act_as}show_and_hide()}function attach_focus_handler(a){a.each(function(b){Event.observe(b,"focus",function(){if(!logged_in()){request_login()}})})}function show_and_hide(){$$(".show_on_li").each(function(a){if(logged_in()){a.show()}else{a.hide()}});$$(".hide_on_li").each(function(a){if(logged_in()){a.hide()}else{a.show()}});$$(".show_on_matching").each(function(b){md=b.getMetaData();if(md.rules){var a="all";if(md.match_on){a=md.match_on}if(md.match_on=="all"){if(all_actors_match(md)){b.show()}else{b.hide()}}if(md.match_on=="some"){if(some_actors_match(md)){b.show()}else{b.hide()}}}});$$(".hide_on_matching").each(function(b){md=b.getMetaData();if(md.rules){var a="all";if(md.match_on){a=md.match_on}if(md.match_on=="all"){if(all_actors_match(md)){b.hide()}else{b.show()}}if(md.match_on=="some"){if(some_actors_match(md)){b.hide()}else{b.show()}}}})};