/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 10th 2010 2:41:17 AM PST                            */
/*      Machine:  10.16.140.101                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/3e2fu2yzwjwg4c0g.pkg.js h:4ylyl1lh                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/3e2fu2yzwjwg4c0g.pkg.js                                   */

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/3e2fu2yzwjwg4c0g.pkg.js"]); }

function friend_and_email_source(_L0){_L0=_L0?_L0+'&include_emails=1':'';this.parent.construct(this,_L0);}friend_and_email_source.extend('friend_source');friend_and_email_source.prototype.text_noinput=friend_and_email_source.prototype.text_placeholder=_tx("Skriv navnet p\u00e5 en venn, liste eller email adresse");friend_and_email_source.prototype.text_nomatch=_tx("Du kan skrive en e-postadresse ...");friend_and_email_source.prototype.onselect_not_found=function(){emails=this.results_text.split(/[,; ]/);for(var i=0;i<emails.length;i++){var _L1=emails[i].replace(/^\s+|\s+$/g,'');var _L2=/.*\@.*\.[a-z]+$/;if(!_L2.test(_L1))continue;var _L3={t:_L1,e:_L1};var _L4=new token(_L3,this.tokenizer,this.element);var _L5={email:_L1,pluses:false};new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_email.php').setData(_L5).setHandler(function(_L6){if(_L6.getPayload()){var obj=_L6.getPayload().token;this.render_obj(obj);this.tokenizer._ontokenadded(obj);}else this.tokenizer._ontokennotfound(_L1);}.bind(_L4)).setErrorHandler(function(_L6){ErrorDialog.showAsyncError(_L6);this.remove(false);}.bind(_L4)).send();}this.clear();};
function email_source(_L0){_L0=_L0?_L0+'&include_emails=1':'';this.parent.construct(this,_L0);}email_source.extend('friend_and_email_source');email_source.prototype.text_noinput=email_source.prototype.text_placeholder=_tx("Du kan skrive en e-postadresse ...");email_source.prototype.text_nomatch=_tx("Du kan skrive en e-postadresse ...");email_source.prototype.bootstrap=function(_L0){this.values='';this.index=0;this.ready();};
function multifriend_selector(_L0,_L1,_L2,_L3,_L4,_L5,_L6){this.num_rows=_L3;this.friend_info=_L0;this.form=ge(_L1);this.max=_L2;this.paginate=ua.ie()<8;this.page=0;this.total_items=0;this.num_per_page=this.num_rows*_L4;this.cur_view='all';this.num_selected=0;this.selected_ids={};this.colored_ids=_L6||{};this.disabled_ids={};this.disabled_reason=null;this.last_clicked=null;this.cur_network=0;this.cur_network_name='';this.cur_list=0;this.cur_list_name='';this.cur_list_members={};this.cur_event=0;this.cur_event_name='';this.cur_event_members={};this.loaded_event_filters={};this.notice_id='fb_multi_friend_selector_notice';this.set_view(this.cur_view);this.update_counters(0);if(_L5)for(var i=0;i<_L5.length;++i)this.select(_L5[i]);this.force_reset();}multifriend_selector.prototype.set_typeahead=function(_L0){this.fsth=_L0;};multifriend_selector.prototype.set_disabled=function(_L0){if(_L0)for(var i=0;i<_L0.length;i++)this.disabled_ids[_L0[i]]=true;};multifriend_selector.prototype.set_disabled_reason=function(_L0){this.disabled_reason=_L0;};multifriend_selector.prototype.force_reset=function(){this.dirty=true;setTimeout(this.reset.bind(this),0);};multifriend_selector.prototype.force_reset_now=function(){this.dirty=true;this.reset();};multifriend_selector.prototype.reset=function(){if(!this.dirty)return;this.filters=[];if(this.cur_view=='unselected'){this.filters.push(function(id,_L1){return !this.selected_ids[id];}.bind(this));}else if(this.cur_view=='selected')this.filters.push(function(id,_L1){return this.selected_ids[id];}.bind(this));if(this.cur_event)this.filters.push(function(id,_L1){return this.cur_event_members[id];}.bind(this));if(this.cur_network)this.filters.push(function(id,_L1){return _L1.networks[this.cur_network];}.bind(this));if(this.cur_list)this.filters.push(function(id,_L1){return this.cur_list_members[id];}.bind(this));if(this.search_filter)this.filters.push(this.search_filter);this.page=0;this.update_boxes();this.dirty=false;};multifriend_selector.prototype.set_search_filter=function(_L0){this.search_filter=_L0;this.force_reset();};multifriend_selector.prototype.get_matching_friends=function(){var _L0=[];for(var id in this.friend_info){for(var i=0;i<this.filters.length;i++)if(!this.filters[i](id,this.friend_info[id]))break;if(i==this.filters.length)_L0.push(id);}this.total_items=_L0.length;return _L0;};multifriend_selector.prototype.update_boxes=function(){var _L0=this.get_matching_friends();var lis=[];for(var i=0;i<_L0.length;i++)if(!this.paginate||(i>=this.num_per_page*this.page&&i<this.num_per_page*(this.page+1)))lis.push(this.render_friend_box(_L0[i]));DOM.setContent($('friends'),HTML(lis.join('')));if(this.paginate)DOM.setContent($('mfs_pag_nav_links'),HTML(this.render_paginator()));if(this.total_items==0&&this.cur_view!='all')if(this.cur_view=='unselected'){this.notice_show(_tx("Du har ingen venner som ikke er valgt."),true);}else if(this.cur_view=='selected')this.notice_show(_tx("Du har ikke valgt noen venner."),true);};multifriend_selector.prototype.render_friend_box=function(id){var _L1=this.friend_info[id];if(this.fsth&&this.fsth.cur_str){var _L2=typeahead_source.highlight_found(_L1.sname,this.fsth.cur_str);}else var _L2=_L1.sname;var _L3='';var _L4='fs.click(this.parentNode); return false;';var _L5=null;if(this.selected_ids[id]){_L3='class="selected"';}else if(this.disabled_ids[id]){_L3='class="disabled"';_L4='return false;';if(this.disabled_reason)_L5=this.disabled_reason;}else if(this.colored_ids[id])_L3='class="'+this.colored_ids[id]+'"';var _L6=['<li userid="',id,'" ',_L3,'>','<a href="#" title="',_L1.sname,'" onclick="',_L4,'">','<span class="square" style="background-image: url(',_L1.pic,');"><span></span></span>','<strong>',_L2,'</strong>'];if(_L2.split(' ').length<4&&_L1.pr_net)_L6.push('<br><span class="network">',_L1.pr_net,'</span>');if(_L5)_L6.push('<br><span class="disabled_reason">',_L5,'</span>');_L6.push('</a></li>');return _L6.join('');};multifriend_selector.prototype.render_paginator=function(){var _L0=[];var _L1=parseInt(this.total_items/this.num_per_page+.999);if(this.page>0)_L0.push('<li class="pagerpro_li">'+'<a href="#" class="pagerpro_a" onclick="return fs.prev_page();">Prev</a>'+'</li>');for(var i=Math.max(0,this.page-2);i<=Math.min(_L1-1,this.page+2);i++)_L0.push('<li class="pagerpro_li'+(i==this.page?' current':'')+'">'+'<a href="#" class="pagerpro_a" onclick="return fs.goto_page(',i,');">',i+1,'</a>'+'</li>');if(this.page<_L1-1)_L0.push('<li class="pagerpro_li">'+'<a class="pagerpro_a" href="#" onclick="return fs.next_page();">Next</a>'+'</li>');return _L0.join('');};multifriend_selector.prototype.goto_page=function(_L0){this.page=_L0;if(this.page<0){this.page=0;}else if(this.page*this.num_per_page>=this.total_items)this.page=parseInt(this.total_items/this.num_per_page+.999);this.update_boxes();return false;};multifriend_selector.prototype.prev_page=function(){return this.goto_page(this.page-1);};multifriend_selector.prototype.next_page=function(){return this.goto_page(this.page+1);};multifriend_selector.prototype.set_view=function(v){this.filter_reset();if(ge('view_'+v))CSS.setClass($('view_'+v),'view_on');this.cur_view=v;if(this.fsth)this.fsth.reset_search(true);this.force_reset();};multifriend_selector.prototype.click=function(li){var uid=li.getAttribute('userid');if(this.cur_view.indexOf('selected')>=0&&uid==this.last_clicked){CSS.setOpacity(li,1);window.clearTimeout(fx.timer_id);}this.last_clicked=uid;if(!this.selected_ids[uid]){if(this.max<0||this.num_selected<this.max){CSS.setClass(li,'selected');this.select(uid);if(this.cur_view=='unselected')fx.doFadeOut(li,true);}else if(this.max>=0)if(this.max==1){this.notice_show(_tx("Du har allerede valgt 1 person.",{'maximum':this.max}),true);}else this.notice_show(_tx("Du kan maksimalt velge {maximum} venner.",{'maximum':this.max}),true);}else{CSS.setClass(li,this.colored_ids[uid]||'');this.unselect(uid);this.delete_email_token(uid);if(this.cur_view=='selected')fx.doFadeOut(li,true);}if(this.cur_view=='selected'&&this.num_selected<=0)this.notice_show(_tx("Du har ikke valgt noen venner."),false);this.display_limit();};multifriend_selector.prototype.select=function(id){var _L1=document.createElement('input');_L1.setAttribute('fb_protected','true');_L1.type='hidden';_L1.name='ids[]';_L1.value=id;this.form.appendChild(_L1);this.selected_ids[id]=_L1;this.update_counters(1);};multifriend_selector.prototype.get_selected=function(){var _L0=[];for(var k in this.selected_ids)_L0.push(k);return mapToInt(_L0);};multifriend_selector.prototype.unselect=function(id){if(this.selected_ids[id]){this.selected_ids[id].parentNode.removeChild(this.selected_ids[id]);delete this.selected_ids[id];this.update_counters(-1);}};multifriend_selector.prototype.update_counters=function(n){this.num_selected+=n;this.num_unselected-=n;$('view_selected_count').setContent(this.num_selected);};multifriend_selector.prototype.display_limit=function(){var _L0=this.max-this.num_selected;show('max_limit_notice');if(_L0>0&&_L0<=3){$('max_limit_notice').style.color='#f60';$('max_limit_notice').setContent(_tx("Bare {remaining-friends} til",{'remaining-friends':_L0}));}else if(this.max>=0&&_L0<=0){$('max_limit_notice').style.color='#C90000';$('max_limit_notice').setContent(_tx("Grensen er {limit}",{'limit':this.max}));}else $('max_limit_notice').setContent('');};multifriend_selector.prototype.view=function(_L0){this.set_view(_L0);this.notice_hide();if(this.cur_network>0){this.network_filter(this.cur_network,this.cur_network_name);return;}this.force_reset();};multifriend_selector.prototype.network_filter=function(nid,_L1){this.set_view('all');this.filter_reset();this.cur_network=nid;this.cur_network_name=_L1;if(this.fsth)this.fsth.reset_search(true);this.force_reset_now();var _L2=[];if(this.max<0||this.total_items+this.num_selected<=this.max)_L2.push('<a href="#" onClick="fs.select_all();return false;" class="select">'+_tx("Velg alle")+'</a>');_L2.push('<a href="#" class="hide" onClick="fs.network_clear(); return false;"></a> ');if(this.total_items==1){_L2.push(_tx("Du ser 1 venn i {network}",{'network':_L1}));}else _L2.push(_tx("Du ser p\u00e5 {count} venner i {network}.",{'count':this.total_items,'network':_L1}));this.display_filter(_L2.join(''));};multifriend_selector.prototype.display_filter=function(_L0){show('fs_current_filter');$('fs_current_filter').setContent(HTML(_L0));};multifriend_selector.prototype.filter_reset=function(){hide('fs_current_filter');$('fs_current_filter').setContent('');this.cur_network=0;this.cur_network_name='';this.cur_list=0;this.cur_list_name='';this.cur_list_members={};this.cur_event=0;this.cur_event_name='';this.cur_event_members={};this.force_reset();};multifriend_selector.prototype.network_clear=function(){this.filter_reset();this.view('all');};multifriend_selector.prototype.list_filter=function(_L0,_L1,_L2){this.set_view('all');this.filter_reset();this.cur_list=_L0;this.cur_list_name=_L1;var len=_L2.length;for(var i=0;i<len;++i)this.cur_list_members[_L2[i]]=1;if(this.fsth)this.fsth.reset_search(true);this.force_reset_now();var _L5=[];if(this.max<0||this.total_items+this.num_selected<=this.max)_L5.push('<a href="#" onClick="fs.select_all();return false;" class="select">'+_tx("Velg alle")+'</a>');_L5.push('<a href="#" class="hide" onClick="fs.network_clear(); return false;"></a> ');if(this.total_items==1){_L5.push(_tx("Du viser 1 venn p\u00e5 {list}",{'list':_L1}));}else _L5.push(_tx("Du viser {count} venner fra {list}",{'count':this.total_items,'list':_L1}));this.display_filter(_L5.join(''));};multifriend_selector.prototype.event_filter=function(eid,_L1){this.set_view('all');this.filter_reset();this.cur_event=eid;this.cur_event_name=_L1;if(this.loaded_event_filters[eid]){this.cur_event_members=this.loaded_event_filters[eid];this.display_event_filter_text(eid,_L1);}else new AsyncRequest().setURI('/ajax/events/mfs_filter.php').setData({eid:eid}).setMethod('POST').setHandler(function(_L2){this.load_event_filter(eid,_L1,_L2);}.bind(this)).send();};multifriend_selector.prototype.load_event_filter=function(eid,_L1,_L2){if(!_L2)return false;var ids=_L2.getPayload();if(!ids)return false;for(var i=0;i<ids.length;++i)this.cur_event_members[ids[i]]=1;this.loaded_event_filters[eid]=this.cur_event_members;this.display_event_filter_text(eid,_L1);};multifriend_selector.prototype.display_event_filter_text=function(eid,_L1){if(this.fsth)this.fsth.reset_search(true);this.force_reset_now();var _L2=[];if(this.max<0||this.total_items+this.num_selected<=this.max)_L2.push('<a href="#" onClick="fs.select_all();return false;" class="select">'+_tx("Velg alle")+'</a>');_L2.push('<a href="#" class="hide" onClick="fs.network_clear(); return false;"></a> ');if(this.total_items==1){_L2.push(_tx("Du kikker p\u00e5 \u00e9n venn som ble invitert til {event}",{'event':htmlize(_L1)}));}else _L2.push(_tx("Du ser p\u00e5 {count} venner som ble invitert til {event}",{'count':this.total_items,'event':htmlize(_L1)}));this.display_filter(_L2.join(''));};multifriend_selector.prototype.select_all=function(){var _L0=this.get_matching_friends();if(_L0.length<=this.max)for(var i=0;i<_L0.length;i++){var uid=_L0[i];if(!this.selected_ids[uid]&&!this.disabled_ids[uid])this.select(uid);}this.update_boxes();};multifriend_selector.prototype.unselect_all=function(){var _L0=this.get_matching_friends();if(_L0.length<=this.max)for(var i=0;i<_L0.length;i++){var uid=_L0[i];if(this.selected_ids[uid])this.unselect(uid);}this.update_boxes();};multifriend_selector.prototype.notice_show=function(_L0,_L1){$(this.notice_id).setContent(_L0);show(this.notice_id);CSS.setOpacity(ge(this.notice_id),1);if(_L1==true)var t=setTimeout('fx.doFadeOut(\'fb_multi_friend_selector_notice\', false);',2500);};multifriend_selector.prototype.notice_hide=function(){hide(this.notice_id);};multifriend_selector.prototype.skip=function(_L0){var _L1=new URI(get_form_attr(this.form,'action'));var _L2=_L1.getQueryData();var _L3=_L1.setQueryData({}).toString();var _L4=$N('form',{action:_L3,method:'GET',target:_L0});DOM.getRootElement().appendChild(_L4);create_hidden_inputs(_L2,_L4);_L4.submit();};multifriend_selector.prototype.show_force_invite_dialog=function(_L0,_L1){this.dialog=new Dialog().setStackable(true).setShowLoading(true);var _L2;if(_L1){_L2=_tx("Lukk applikasjonen");}else _L2=_tx("Fjern applikasjon");this.onResponse=function(_L3){var _L4=_L3.getPayload();if(_L4['status']){var _L5=this.dialog;this.dialog.setTitle(_L4.dialog_title).setBody(_L4.dialog_contents).setButtons([Dialog.newButton('mfs-button',_L2,'',function(){this.onResponsePost=function(_L6){var _L7=_L6.getPayload();_L5.setTitle(_L7.dialog_title).setBody(_L7.dialog_contents).setButtons([Dialog.OK]).clearHandler().show();if(_L7.status)goURI('/home.php');};new AsyncRequest().setURI('/fbml/ajax/force_invite.php').setData({'app_id':_L0,'remove':1}).setHandler(bind(this,'onResponsePost')).setErrorHandler(bagofholding).send();}),Dialog.newButton('continue',_tx("Fortsett uansett"),'',function(){new AsyncRequest().setURI('/fbml/ajax/force_invite.php').setData({'app_id':_L0,'continue':1}).setHandler(bagofholding).setErrorHandler(bagofholding).send();if(Dialog.getCurrent())Dialog.getCurrent().hide();})]).show();}else this.dialog.setTitle(_L4.dialog_title).setBody(_L4.dialog_contents).setButtons([Dialog.OK]).show();};new AsyncRequest().setURI('/fbml/ajax/force_invite.php').setData({'app_id':_L0}).setHandler(bind(this,'onResponse')).setErrorHandler(bind(this,'onError')).send();return false;};multifriend_selector.prototype.filter_menu_open=function(){setTimeout(function(){$('friends').style.overflow='hidden';}.bind(this),1);};multifriend_selector.prototype.filter_menu_close=function(){$('friends').style.overflow='auto';};function multifriend_selector_typeahead(obj,_L1,fs){this.cur_str='';this.clear_div=null;this.focused=false;this.obj=obj;this.obj.typeahead=this;this.items=_L1;this.fs=fs;this.fs.set_typeahead(this);this.placeholder=this.obj.getAttribute('placeholder');var _L3='multi_friend_selector';addEventBase(this.obj,'focus',this._onfocus.bind(this),_L3);addEventBase(this.obj,'blur',this._onblur.bind(this),_L3);addEventBase(this.obj,'keyup',function(_L7){var e=_L7?_L7:window.event;var _L9=e?e.keyCode:-1;setTimeout(function(){return this._onkeyup(_L9);}.bind(this),0);}.bind(this),_L3);this.capture_submit();this.first_letter_index={};for(var id in _L1){var _L5=typeahead_source.tokenize(_L1[id].name);for(var _L6=0;_L6<_L5.length;_L6++){if(!this.first_letter_index[_L5[_L6][0]])this.first_letter_index[_L5[_L6][0]]={};this.first_letter_index[_L5[_L6][0]][id]=true;}}}multifriend_selector_typeahead.prototype={_onfocus:function(e){if(this.obj.value==this.placeholder)this.obj.value='';this.focused=true;this.capture_submit();if(this.fs&&this.fs.cur_view!='all')this.fs.view('all');},_onblur:function(e){this.focused=false;if(this.cur_str==''){this.hide_clear();this.obj.value=this.placeholder;}},_onkeyup:function(_L0){switch(_L0){case 27:return false;break;case undefined:case 37:case 38:case 39:case 40:return false;break;case 13:this.select();break;case 8:case 0:default:if(this.search()){this.reset_search(false,false);}else if(this.obj.value&&this.fs)this.fs.filter_reset();break;}},capture_submit:function(){if((!this.captured_form||this.captured_substitute!=this.captured_form.onsubmit)&&this.obj.form){this.captured_form=this.obj.form;this.captured_event=this.obj.form.onsubmit;this.captured_substitute=this.obj.form.onsubmit=function(){return false;}.bind(this.obj.form);}},reset_search:function(_L0,_L1){if(this.obj){var _L2=null;if(!this.obj.getControl){_L2=new TextInputControl(this.obj);}else _L2=this.obj.getControl();var _L3=_L2.getValue();if(!_L3||_L0){this.cur_str='';if(_L3){_L2.clear();this._onblur();_L2.setFocused(false);}}}if(_L1==true){var _L4=fx.timer_delay*10;window.setTimeout("fsth.show_all()",_L4);}else this.show_all();},show_all:function(){this.fs.set_search_filter(null);},search:function(){var str=typeahead_source.flatten_string(this.obj.value);if(str==this.cur_str)return false;this.cur_str=str;var _L1=typeahead_source.tokenize(str).sort(typeahead_source._sort);if(!_L1[0])return true;var _L2=this.first_letter_index[_L1[0][0]];this.show_clear();this.fs.set_search_filter(function(id,_L4){if(_L2!=null){return _L2[id]&&typeahead_source.check_match(_L1,_L4.name);}else return null;});return false;},show_clear:function(){if(this.clear_div==null){this.clear_div=document.createElement('div');this.clear_div.setAttribute('id','clear_finder');DOM.setContent(this.clear_div,HTML('<a href="#" onClick="fsth.reset_search(true);return false;" class="hide"></a>'));$('finder_friend_typeahead').appendChild(this.clear_div);}},hide_clear:function(){var d=ge('clear_finder');if(d){this.clear_div=null;d.parentNode.removeChild(d);}},select:function(){if(this.obj.value!=''&&this.obj.value!=this.placeholder&&this.fs.total_items==1)if(this.fs.click($('friends').firstChild)){this.obj.value='';this.reset_search(true,this.fs.cur_view!='all');}}};function condensed_multifriend_selector(_L0,_L1,_L2,_L3,_L4){this.parent.construct(this,_L0,_L1,_L2,0,[]);this.paginate=false;this.unselected_rows=_L3;this.selected_rows=_L4;}condensed_multifriend_selector.extend('multifriend_selector');condensed_multifriend_selector.prototype.set_typeahead=function(_L0){this.parent.set_typeahead(_L0);this.unselected_list=_L0.obj.parentNode.nextSibling;if(this.selected_rows==0){this.onebox=true;}else{this.selected_list=this.unselected_list.nextSibling;this.onebox=false;}this.total_items=0;for(var i=0;i<this.unselected_list.childNodes.length;i++){var _L2=this.unselected_list.childNodes[i];_L2.cb=_L2.firstChild;_L2.cb.checked=false;_L2.name_span=_L2.lastChild;_L2.onclick=function(){this.parentNode.parentNode.cmfs.toggle(this.cb.value);};this.friend_info[_L2.cb.value].unselected=_L2;this.total_items++;}if(!this.onebox){for(var i=0;i<this.selected_list.childNodes.length;i++){var _L2=this.selected_list.childNodes[i];_L2.cb=_L2.firstChild;_L2.cb.checked=false;_L2.name_span=_L2.lastChild;_L2.onclick=function(){this.parentNode.parentNode.cmfs.toggle(this.cb.value);};this.friend_info[_L2.cb.value].selected=_L2;this.total_items++;}this.nobody=document.createElement('div');CSS.setClass(this.nobody,'nobody_selected');DOM.setContent(this.nobody,_tx("Du har ikke valgt noen."));this.selected_list.appendChild(this.nobody);}this.container=_L0.obj.parentNode.parentNode;this.container.cmfs=this;this.toomany=document.createElement('div');CSS.setClass(this.toomany,'toomany_selected');if(this.max==1){DOM.setContent(this.toomany,_tx("Du kan bare velge \u00e9n venn.",{'maximum':this.max}));}else DOM.setContent(this.toomany,_tx("Du har allerede valgt {maximum} personer.",{'maximum':this.max}));this.container.appendChild(this.toomany);hide(this.toomany);this.check_sizes();window.setInterval(this.check_sizes.bind(this),100);this.container.style.visibility='visible';this.force_reset();};condensed_multifriend_selector.prototype.check_sizes=function(){if(this.container.offsetWidth==this.container_width)return;this.container_width=this.container.offsetWidth;var _L0=this.unselected_list.firstChild;var _L1=_L0&&_L0.offsetHeight?_L0.offsetHeight:19;this.unselected_list.style.height=_L1*this.unselected_rows+'px';if(!this.onebox){var _L2=15;this.selected_list.style.height=_L2*this.selected_rows+'px';}if(ua.safari()<500){var _L3=0;}else var _L3=6;this.fsth.obj.style.width=Math.max((this.container.offsetWidth-_L3-2),0)+'px';show(this.toomany);this.toomany.style.top=parseInt(this.unselected_list.offsetTop+(this.unselected_list.offsetHeight-this.toomany.offsetHeight)/2)+'px';hide(this.toomany);};condensed_multifriend_selector.prototype.check_match=function(id,_L1){for(var i=0;i<this.filters.length;i++)if(!this.filters[i](id,_L1))return false;return true;};condensed_multifriend_selector.prototype.update_match=function(_L0){this.total_items++;if(this.fsth&&this.fsth.cur_str){var _L1=typeahead_source.highlight_found(_L0.name,this.fsth.cur_str);}else var _L1=_L0.name;DOM.setContent(_L0.unselected.name_span,HTML(_L1));this.show(_L0.unselected);};condensed_multifriend_selector.prototype.update_boxes=function(){if(typeof this.onebox=='undefined')return;this.total_items=0;this.last_showing=null;for(var id in this.friend_info){var _L1=this.friend_info[id];if(_L1.checked&&!this.onebox)continue;if(this.check_match(id,_L1)){this.update_match(_L1);}else this.hide(_L1.unselected);}};condensed_multifriend_selector.prototype.show=function(_L0){show(_L0);this.last_showing=_L0;};condensed_multifriend_selector.prototype.hide=hide;condensed_multifriend_selector.prototype.toggle=function(id){var _L1=this.friend_info[id];if(this.onebox){if(!_L1.checked&&!_L1.unselected.cb.checked||_L1.checked&&_L1.unselected.cb.checked)return;}else{if(!_L1.checked&&!_L1.unselected.cb.checked)return;if(ua.firefox()&&_L1.checked&&_L1.selected.cb.checked)return;}_L1.checked=!_L1.checked;if(_L1.checked){if(this.num_selected==this.max){show(this.toomany);CSS.setOpacity(this.toomany,1);setTimeout(function(){fx.doFadeOut(this.toomany,false);}.bind(this),2500);_L1.checked=false;_L1.unselected.cb.checked=false;return false;}this.num_selected++;}else this.num_selected--;if(this.onebox){CSS.toggleClass(_L1.unselected,'selected');}else if(_L1.checked){this.total_items--;hide(this.nobody);hide(_L1.unselected);_L1.unselected.cb.checked=false;_L1.selected.cb.checked=true;show(_L1.selected);}else{if(!this.num_selected)show(this.nobody);this.hide(_L1.selected);if(!ua.opera()&&!(ua.safari()>=500))_L1.selected.cb.checked=false;if(this.check_match(id,_L1))this.update_match(_L1);}};condensed_multifriend_selector.prototype.filter_reset=function(){};condensed_multifriend_selector.prototype.set_view=function(){};condensed_multifriend_selector.prototype.update_counters=function(){};function condensed_mfs_typeahead(obj,_L1,fs){this.parent.construct(this,obj,_L1,fs);this.clear_div=document.createElement('div');CSS.setClass(this.clear_div,'hide');this.clear_div.onclick=function(){this.reset_search(true,false);return false;}.bind(this);hide(this.clear_div);this.obj.parentNode.insertBefore(this.clear_div,this.obj);}condensed_mfs_typeahead.extend('multifriend_selector_typeahead');condensed_mfs_typeahead.prototype.show_clear=function(){show(this.clear_div);};condensed_mfs_typeahead.prototype.hide_clear=function(){hide(this.clear_div);};condensed_mfs_typeahead.prototype.select=function(){if(this.fs.total_items==1&&!this.disabled_ids[this.fs.last_showing.cb.value]){this.fs.last_showing.cb.click();this.obj.value='';this.reset_search(true,false);}};multifriend_selector.prototype.addEmailTokenHandler=function(obj){if(obj.i){uid=obj.i;if(!this.selected_ids[uid])if(this.num_selected<this.max){click_li=DOM.scry($('friends'),'li[userid="'+uid+'"]');if(click_li.length==1){fs.click(click_li[0]);}else{this.select(uid);if(this.friend_info[uid])this.set_view('selected');this.display_limit();}}else{this.notice_show(_tx("Du kan maksimalt velge {maximum} venner.",{'maximum':this.max}),true);this.delete_email_token(uid);}}};multifriend_selector.prototype.removeEmailTokenHandler=function(obj){if(obj.i){uid=obj.i;if(this.selected_ids[uid]){click_li=DOM.scry($('friends'),'li[userid="'+uid+'"]');if(click_li.length==1){fs.click(click_li[0]);}else this.unselect(uid);}}};multifriend_selector.prototype.delete_email_token=function(uid){email_sections=DOM.scry($('fb_multi_friend_selector_wrapper'),'#email_section_id');if(email_sections.length>0){friend_inputs=DOM.scry(email_sections[0],'input[value="'+uid+'"]');for(var i=0;i<friend_inputs.length;i++){delete_token=friend_inputs[i].parentNode.parentNode.parentNode.parentNode.parentNode;if(delete_token)DOM.remove(delete_token);}}};var fx={timer_id:'',timer_delay:25,timer_clearout:false,delta:.1,doFadeIn:function(id){if(ua.ie()<8){this.timer_delay=0;this.delta=.5;}if(this.timer_clearout&&this.timer_id)window.clearTimeout(this.timer_id);CSS.setOpacity(ge(id),0);$(id).style.visibility="visible";this.fadeIn(id,0);},fadeIn:function(id,_L1){obj=ge(id);if(_L1<=1){CSS.setOpacity(obj,_L1);_L1+=this.delta;this.timer_id=setTimeout(function(){fx.fadeIn(id,_L1);},this.timer_delay);}},doFadeOut:function(id,_L1){if(ua.ie()<8){this.timer_delay=0;this.delta=.5;}if(this.timer_clearout&&this.timer_id)window.clearTimeout(this.timer_id);CSS.setOpacity(ge(id),1);$(id).style.visibility="visible";this.fadeOut(id,1,_L1);},fadeOut:function(id,_L1,_L2){obj=ge(id);if(_L1>=0){CSS.setOpacity(obj,_L1);_L1-=this.delta;this.timer_id=setTimeout(function(){fx.fadeOut(id,_L1,_L2);},this.timer_delay);}else if(window.fs&&fs.paginate&&id!=fs.notice_id){fs.update_boxes();}else if(_L2){obj.parentNode.removeChild(obj);}else obj.style.display='none';}};

if (window.Bootloader) { Bootloader.done(["js\/3e2fu2yzwjwg4c0g.pkg.js"]); }