/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  November 5th 2008 11:03:25 AM PST                            */
/*      Machine:  10.16.140.103                                                */
/*       Source:  Global Cache                                                 */
/*     Location:  js/8eyy0vp4q1s084ks.pkg.js h:ezzah0tx                        */
/*       Locale:  en_US                                                        */
/*         Path:  js/8eyy0vp4q1s084ks.pkg.js                                   */


var PrivacyBaseValue={'FACEBOOK_EMPLOYEES':112,'CUSTOM':111,'OPEN':100,'EVERYONE':80,'NETWORKS_FRIENDS_OF_FRIENDS':60,'NETWORKS_FRIENDS':55,'FRIENDS_OF_FRIENDS':50,'ALL_FRIENDS':40,'SELF':10,'NOBODY':0};var PrivacyFriendsValue={'EVERYONE':80,'NETWORKS_FRIENDS':55,'FRIENDS_OF_FRIENDS':50,'ALL_FRIENDS':40,'SOME_FRIENDS':30,'NO_FRIENDS':0};var PrivacySpecialPreset={'ONLY_CORP_NETWORK':200,'COLLEGE_NETWORK_FRIENDS_OF_FRIENDS':201,'COLLEGE_NETWORK_FRIENDS':202};var PrivacyNetworkTypes={'TYPE_COLLEGE':1,'TYPE_HS':2,'TYPE_CORP':3,'TYPE_GEO':4,'TYPE_TEST':50};copy_properties(PrivacyBaseValue,PrivacySpecialPreset);var PrivacyNetworksAll=1;function PrivacyModel(){this.value=PrivacyBaseValue.ALL_FRIENDS;this.friends=PrivacyFriendsValue.ALL_FRIENDS;this.networks=[];this.lists=[];this.lists_x=[];this.list_anon=0;this.ids_anon=[];this.list_x_anon=0;this.ids_x_anon=[];return this;};copy_properties(PrivacyModel.prototype,{init:function(value,friends,networks,lists,lists_x,list_anon,ids_anon,list_x_anon,ids_x_anon){this.value=value;this.friends=friends;this.networks=networks.clone();this.lists=lists.clone();this.lists_x=lists_x.clone();this.list_anon=list_anon;this.ids_anon=ids_anon.clone();this.list_x_anon=list_x_anon;this.ids_x_anon=ids_x_anon.clone();},clone:function(){var clone=new PrivacyModel();clone.init(this.value,this.friends,this.networks,this.lists,this.lists_x,this.list_anon,this.ids_anon,this.list_x_anon,this.ids_x_anon);return clone;}});var PrivacyWidgetInstance={}
function PrivacyWidget(root,fbid,range,row,networks,dialog_title,properties){copy_properties(this,{root:$(root),fbid:fbid,range:range,tdata:row.tdata,networks:networks,mode:'basic',dialog_title:dialog_title});this.properties={};copy_properties(this.properties,properties);this.model=new PrivacyModel();this.model.init(row.value,row.friends,row.networks,row.lists,row.lists_x,row.list_anon,row.ids_anon,row.list_x_anon,row.ids_x_anon);this.form=this.root.childNodes[0];this.basic=this.root.childNodes[2];this.advanced=this.root.childNodes[3];this.prompt=this.root.childNodes[4];this.out_of_range={};this.summary_select=this.$('summary_select');this.summary_select.onchange=bind(this,'summary_onselect');this.advanced_select=this.$('advanced_select');this.advanced_select.onchange=bind(this,'adv_onselect');var links=this.root.getElementsByTagName('a');for(var i=0;i<links.length;++i){if(links[i].className){links[i].onclick=bind(this,links[i].className);}}
if(ge('privacy_page_custom_links_'+this.fbid)){var custom_links=this.$('privacy_page_custom_links').getElementsByTagName('a');for(var i=0;i<custom_links.length;++i){if(custom_links[i].className){custom_links[i].onclick=bind(this,custom_links[i].className);}}}
this.$('save').onclick=bind(this,'adv_onclick_save');this.$('cancel').onclick=bind(this,'adv_onclick_cancel');this.$('nothanks').onclick=bind(this,'adv_onclick_nothanks');if(ge('advanced_everyone_'+this.fbid)){this.$('advanced_everyone').getElementsByTagName('input')[0].onclick=bind(this,'adv_onclick_everyone');}else{this.out_of_range['everyone']=true;}
var friend_radios=this.$('advanced_friends_radios').getElementsByTagName('input');for(var i=0;i<friend_radios.length;++i){if(friend_radios[i].getAttribute('type')=="radio"){friend_radios[i].onclick=bind(this,'adv_onclick_friends_radio',friend_radios[i].value);}}
if(ge('advanced_networks_'+this.fbid)){var networks_checks=this.$('advanced_networks').getElementsByTagName('input');for(var i=0;i<networks_checks.length;++i){networks_checks[i].onclick=bind(this,'adv_onclick_networks_checkbox',networks_checks[i].value);}
this.$('advanced_networks_select').onchange=bind(this,'adv_onclick_networks_select');}else{this.out_of_range['networks']=true;}
if(!ge('some_friends_'+this.fbid)){this.out_of_range['some_friends']=true;}
if(!ge('advanced_except_'+this.fbid)){this.out_of_range['except']=true;}
this.undo=[];for(var i=0;i<this.model.networks.length;i++){if(this.model.networks[i]==1){this.model.networks=PrivacyNetworksAll;break;}}
this._model_check_for_valid_value();this.public_search=this.properties.toggle_public_search?ge('_priv_public_search_listing'):null;this.search_net=this.properties.toggle_public_search?ge('_priv_network_type_controls'):null;this.model_write_to_summary();PrivacyWidgetInstance[this.fbid]=this;return this;};copy_properties(PrivacyWidget.prototype,{$:function(elem){return $(elem+'_'+this.fbid);},model_read_from_adv:function(){this.model.value=this.get_model_value(this.adv_reverse_preset_value(false),this.adv_read_custom_ids('except','lists'),this.adv_read_custom_ids('except','names'));if(this.model.value==PrivacyBaseValue.EVERYONE){this.model.friends=PrivacyFriendsValue.EVERYONE;}else{this.model.friends=this.adv_read_friends();}
this.model.networks=this.adv_read_networks();if(!this._model_preset_exists(this.model.value)){var values=this.interpret_value(this.model.value);this.model.value=PrivacyBaseValue.CUSTOM;this.model.friends=values.friends;this.model.networks=values.networks;}
this.model.lists=[]
this.model.lists_x=[]
this.model.ids_anon=[]
this.model.ids_x_anon=[]
this._model_read_adv_tokens('lists','some','lists');this._model_read_adv_tokens('ids_anon','some','names');this._model_read_adv_tokens('lists_x','except','lists');this._model_read_adv_tokens('ids_x_anon','except','names');},_model_preset_exists:function(preset){preset=parseInt(preset);var options=this.$('advanced_select').options;for(var i=0;i<options.length;i++){if(options[i].value==preset){return true;}}},_model_check_for_valid_value:function(){if(this.model.value!=PrivacyBaseValue.CUSTOM){if(!this._model_preset_exists(this.model.value)){var valid_values=[];var options=this.$('advanced_select').options;for(var i=0;i<options.length;i++){var special_preset=false;for(var k in PrivacySpecialPreset){if(options[i].value==PrivacySpecialPreset[k]){special_preset=true;}}
if(!special_preset){valid_values.push(options[i].value);}}
valid_values.sort();var values=this.interpret_value(this.model.value);var value_ok=false;if(this.adv_friends_value_exists(values.friends)){value_ok=true;}
if(values.networks===PrivacyNetworksAll||values.networks.length>0){if(valid_values[valid_values.length-1]>PrivacyBaseValue.ALL_FRIENDS){value_ok=true;}else{value_ok=false;}}
if(values.everyone==true){if(this.out_of_range['everyone']==true){value_ok=false;}}
if(value_ok){this.model.value=PrivacyBaseValue.CUSTOM;this.model.friends=values.friends;this.model.networks=values.networks;}else{if(this.model.value>valid_values[valid_values.length-1]){this.model.value=valid_values[valid_values.length-1];}else{this.model.value=valid_values[0];}}}}else{if(this.model.friends==PrivacyFriendsValue.NETWORKS_FRIENDS){this.model.friends=PrivacyFriendsValue.ALL_FRIENDS;this.model.networks=PrivacyNetworksAll;}
if(this.model.friends==PrivacyFriendsValue.NO_FRIENDS&&this.model.networks!==PrivacyNetworksAll&&this.model.networks.length==0){if(this._model_preset_exists(PrivacyBaseValue.NOBODY)){this.model.value=PrivacyBaseValue.NOBODY;}else{this.model.value=PrivacyBaseValue.SELF;this._model_check_for_valid_value();}}
if(this.model.friends==PrivacyFriendsValue.EVERYONE&&this.model.value!=PrivacyBaseValue.EVERYONE){if(!this.adv_friends_value_exists(PrivacyFriendsValue.EVERYONE)){Util.log('Advanced Everyone does not exist')
var friends=[];var friend_radios=this.$('advanced_friends_radios').getElementsByTagName('input');for(var i=0;i<friend_radios.length;i++){if(friend_radios[i].type=='radio'){friends.push(friend_radios[i].value);}}
friends.sort();this.model.friends=friends[friends.length-1];this.model.networks=PrivacyNetworksAll;}}}},_model_read_adv_tokens:function(field,type,entity){var ids=this.adv_read_custom_ids(type,entity);for(var i=0;i<ids.length;++i){this.model[field].push(ids[i]);}},model_write_to_adv:function(){this.edit_value(this.model.value,true);if(this.model.value==PrivacyBaseValue.CUSTOM){this.edit_friends(this.model.friends);if(this.model.networks!==PrivacyNetworksAll&&this.model.networks.length==0){this.model.networks=[];}
this.edit_networks(this.model.networks);var select_display_value=this.select_display_value(this.model.value,this.model.friends,this.model.networks,this.model.lists,this.model.ids_anon);this.edit_preset();}
if(!this.out_of_range['some_friends']){this.$('some_friends_container').firstChild.innerHTML='';}
if(!this.out_of_range['except']){this.$('except_friends_container').firstChild.innerHTML='';}
if(!this.out_of_range['some_friends']){this._model_write_adv_token('lists','flid','some');this._model_write_adv_token('ids_anon','i','some');}
if(!this.out_of_range['except']){this._model_write_adv_token('lists_x','flid','except');this._model_write_adv_token('ids_x_anon','i','except');}},_model_write_adv_token:function(source,field,target){var ids=this.model[source];for(var i=0;i<ids.length;++i){var p={};p[field]=ids[i];p.t=this.tdata[ids[i]];this.adv_add_token(p,target);}},model_write_to_form:function(){this.form_save_value('changed',1);this.form_save_value('value',this.model.value);this.form_save_value('friends',this.model.friends);this.form_save_value('list_anon',this.model.list_anon);this.form_save_value('list_x_anon',this.model.list_x_anon);this.form_save_array('networks',this.model.networks);this.form_save_array('lists',this.model.lists);this.form_save_array('ids_anon',this.model.ids_anon);this.form_save_array('lists_x',this.model.lists_x);this.form_save_array('ids_x_anon',this.model.ids_x_anon);if(this.public_search){this.toggle_public_search();}},toggle_public_search:function(){var enable=false;if(this.model.value==PrivacyBaseValue.EVERYONE||this.model.value==PrivacyBaseValue.OPEN||this.model.friends==PrivacyFriendsValue.EVERYONE){this.public_search.style.display='block';}else{this.public_search.style.display='none';enable=true;}
var inputs=this.search_net.getElementsByTagName('input');for(var i=0;i<inputs.length;++i){if(enable){inputs[i].disabled=false;}else{inputs[i].disabled=true;}}
if(enable){this.search_net.style.display='block';}else{this.search_net.style.display='none';}},model_write_to_view:function(){var displaySummary=this.summary_select.options[this.summary_select.options.selectedIndex].innerHTML;DOM.setText($('summary_text_view_'+this.fbid),displaySummary);this.model_write_to_summary('_view');},model_write_to_summary:function(id_suffix){var suffix=id_suffix||'';if(this.model.value!=PrivacyBaseValue.CUSTOM){var values=this.interpret_value(this.model.value);var select_display_value=this.select_display_value(this.model.value,values.friends,values.networks,[],[]);this.model.friends=values.friends;this.model.networks=values.networks;}else{var select_display_value=this.select_display_value(this.model.value,this.model.friends,this.model.networks,this.model.lists,this.model.ids_anon);}
set_form_select_value(this.summary_select,select_display_value);this.summary_toggle_advanced_link(select_display_value);this.summary_update_select_text(select_display_value);var x=false;if(!this.out_of_range['except']){if(this._model_write_summary_lists('lists_x','summary_lists_x'+suffix)){x=true;}
if(this._model_write_summary_lists('ids_x_anon','summary_names_x'+suffix)){x=true;}}
if(x){CSS.removeClass(this.$('summary_except'+suffix),'collapsed');}else{CSS.addClass(this.$('summary_except'+suffix),'collapsed');}
if(select_display_value==PrivacyBaseValue.CUSTOM){if(this.model.friends==PrivacyFriendsValue.EVERYONE){CSS.addClass(this.$('summary_custom'+suffix),'collapsed');CSS.addClass(this.$('summary_networks'+suffix),'collapsed');CSS.addClass(this.$('summary_friends'+suffix),'collapsed');CSS.addClass(this.$('summary_lists'+suffix),'collapsed');CSS.addClass(this.$('summary_names'+suffix),'collapsed');}else{CSS.removeClass(this.$('summary_custom'+suffix),'collapsed');network_names=[];if(this.model.networks.length>0){for(var i=0;i<this.model.networks.length;++i){network_names.push('<li><a href="/networks/?nk='+this.model.networks[i]+'">'+this.networks[this.model.networks[i]]['name']+'</a></li>');}
this.$('summary_networks'+suffix).innerHTML='<ul>'+network_names.join('')+'</ul>';CSS.removeClass(this.$('summary_networks'+suffix),'collapsed');}else if(this.model.networks===PrivacyNetworksAll){this.$('summary_networks'+suffix).innerHTML='<ul><li>'+_tx("All of My Networks")+'</li></ul>';CSS.removeClass(this.$('summary_networks'+suffix),'collapsed');}else{CSS.addClass(this.$('summary_networks'+suffix),'collapsed');}
switch(parseInt(this.model.friends)){case PrivacyFriendsValue.ALL_FRIENDS:CSS.addClass(this.$('summary_friends_fof'+suffix),'collapsed');CSS.removeClass(this.$('summary_friends_all'+suffix),'collapsed');CSS.removeClass(this.$('summary_friends'+suffix),'collapsed');CSS.addClass(this.$('summary_friends_only_me'+suffix),'collapsed');break;case PrivacyFriendsValue.FRIENDS_OF_FRIENDS:CSS.addClass(this.$('summary_friends_all'+suffix),'collapsed');CSS.removeClass(this.$('summary_friends_fof'+suffix),'collapsed');CSS.removeClass(this.$('summary_friends'+suffix),'collapsed');CSS.addClass(this.$('summary_friends_only_me'+suffix),'collapsed');break;case PrivacyFriendsValue.NO_FRIENDS:CSS.addClass(this.$('summary_friends_all'+suffix),'collapsed');CSS.addClass(this.$('summary_friends_fof'+suffix),'collapsed');CSS.removeClass(this.$('summary_friends'+suffix),'collapsed');CSS.removeClass(this.$('summary_friends_only_me'+suffix),'collapsed');break;default:CSS.addClass(this.$('summary_friends'+suffix),'collapsed');break;}
if(this.model.friends==PrivacyFriendsValue.SOME_FRIENDS){this._model_write_summary_lists('lists','summary_lists'+suffix);this._model_write_summary_lists('ids_anon','summary_names'+suffix);}else{CSS.addClass(this.$('summary_lists'+suffix),'collapsed');CSS.addClass(this.$('summary_names'+suffix),'collapsed');}}
CSS.removeClass(this.$('summary'+suffix),'simple');CSS.removeClass(this.$('summary'+suffix),'except');if(x){CSS.addClass(this.$('summary'+suffix),'except_custom');}else{CSS.removeClass(this.$('summary'+suffix),'except_custom');}}else{CSS.addClass(this.$('summary_custom'+suffix),'collapsed');CSS.removeClass(this.$('summary'+suffix),'except_custom');CSS.addClass(this.$('summary'+suffix),'simple');if(x&&select_display_value!=PrivacyBaseValue.NOBODY&&select_display_value!=PrivacyBaseValue.SELF){CSS.addClass(this.$('summary'+suffix),'except');}else{CSS.removeClass(this.$('summary'+suffix),'except');}}},_model_write_summary_lists:function(source,target){var elems=this.model[source];var is_list=(source.indexOf('lists')!=-1);if(elems.length>0){if(is_list){var str='<ul>';}else{var str=[];}
if(!is_list){var min=Math.min(2,elems.length);}else{var min=elems.length;}
for(var i=0;i<min;++i){if(is_list){str+='<li>'+this.tdata[elems[i]]+'</li>';}else{str.push('<a href="/profile.php?id='+elems[i]+'">'+this.tdata[elems[i]]+'</a>');}}
if(!is_list){if(elems.length==3){if(is_list){str+='<li>'+this.tdata[elems[2]]+'</li>';}else{str.push('<a href="/profile.php?id='+elems[2]+'">'+this.tdata[elems[2]]+'</a>');}}else if(elems.length>3){str.push(_tx("{num} others",{'num':String(elems.length-2)}));}
this.$(target).innerHTML=str.join(', ');}else{str+='</ul>';this.$(target).innerHTML=str;}
CSS.removeClass(this.$(target),'collapsed');return true;}else{CSS.addClass(this.$(target),'collapsed');return false;}},model_simplify:function(){},form_save_value:function(elem,value){this.$(elem).value=value;},form_save_array:function(dest,arr){var name=dest+'_'+this.fbid+'[]';var dest=this.$('inputs_'+dest);html='';if(arr instanceof Array){for(var i=0;i<arr.length;++i){html+='<input type="hidden" name="'+name+'" value="'+arr[i]+'" />';}}else{html+='<input type="hidden" name="'+name+'" value="'+arr+'" />';}
dest.innerHTML=html;},adv_onfs_some:function(p){if(p===false){return;}
this.clear();var fbid=this.obj.getAttribute('fbid');var instance=PrivacyWidgetInstance[fbid];instance.adv_add_token(p,'some');instance.dialog.reset_dialog();return false;},adv_onfs_except:function(p){if(p===false){return;}
this.clear();var fbid=this.obj.getAttribute('fbid');var instance=PrivacyWidgetInstance[fbid];instance.adv_add_token(p,'except');instance.dialog.reset_dialog();return false;},adv_add_token:function(p,type){var reverse_types={'some':'except','except':'some'};var id=null;if(p.flid){id=p.flid;}else if(p.i){id=p.i;}
var container_div=this.$(type+'_friends_container');var container=container_div.childNodes[0];var container_inputs=container.getElementsByTagName('input');for(var i=0;i<container_inputs.length;++i){if(container_inputs[i].value==id){return;}}
var container_elements=container.getElementsByTagName('li');if(p.i){var has_names=false;var names_container;var names_container_text;for(var i=0;i<container_elements.length;i++){if(CSS.hasClass(container_elements[i],'friends_names')){has_names=true;names_container=container_elements[i];names_container_text=names_container.childNodes[1];break;}}
if(!has_names){names_container=document.createElement('li');names_container.className='friends_names clearfix';var icon_div=document.createElement('div');icon_div.appendChild(document.createTextNode(''));icon_div.className='icon';var text_area=document.createElement('div');text_area.className='text_area';names_container.appendChild(icon_div);names_container.appendChild(text_area);names_container_text=text_area;if(container.childNodes>0){container.insertBefore(names_container,container.childNodes[0]);}else{container.appendChild(names_container);}}
names_container_text.innerHTML+=this.adv_gen_token(id,p.t);}else{for(var i=0;i<container.childNodes.length;i++){var li=container.childNodes[i];var inputs=li.getElementsByTagName('input');for(var i2=0;i2<inputs.length;i2++){if(inputs[i2].type=='hidden'){if(inputs[i2].value==id){var has_fl=true;}
break;}}
if(has_fl){break;}}
if(!has_fl){var friend_list_li=document.createElement('li');friend_list_li.className='friends_lists clearfix';var icon_div=document.createElement('div');icon_div.className='icon';var text_area=document.createElement('div');text_area.className='text_area';friend_list_li.appendChild(icon_div);friend_list_li.appendChild(text_area);text_area.innerHTML=this.adv_gen_token(id,p.t);container.appendChild(friend_list_li);}}
this.edit_preset();this.tdata[id]=p.t;CSS.removeClass(container_div,'empty');},adv_gen_token:function(id,name){var js='PrivacyWidget.prototype.adv_rem_token(this, '+this.fbid+');';var html='<a class="token"><span><span><span><span>'+
name+'<input type="hidden" name="ids[]" value="'+id+'" />'+'<span class="x" onmouseout="this.className=\'x\'" onmouseover="this.className=\'x_hover\'" onclick="event.cancelBubble=true;'+js+'return false;">&nbsp;</span>'+'</span></span></span></span></a>';return html;},adv_rem_token:function(span,fbid){var instance=PrivacyWidgetInstance[fbid];if(instance.mode=='prompt'){animation(instance.prompt).from('background','#ffeeee').to('background','#fff').duration(250).go();return false;}
instance.dialog.reset_dialog();var anchor=span.parentNode.parentNode.parentNode.parentNode.parentNode;var container=anchor.parentNode.parentNode;var container_parent=container.parentNode;if(CSS.hasClass(container,'friends_lists')){container.parentNode.removeChild(container);}else{container.childNodes[1].removeChild(anchor);if(container.childNodes[1].childNodes.length==0){container.parentNode.removeChild(container);}}
if(container_parent.childNodes.length==0){CSS.addClass(container_parent.parentNode,'empty');}},adv_onselect:function(){this.edit_value(get_form_select_value(this.advanced_select));},adv_onclick_edit_settings:function(){this.edit_value(PrivacyBaseValue.CUSTOM);},adv_onclick_friends_radio:function(value){this.edit_everyone(false);if(value==PrivacyFriendsValue.SOME_FRIENDS){if(!this.out_of_range['some_friends']){CSS.removeClass(this.$('some_friends'),'collapsed');this.$('fs_some').focus();}}else{if(!this.out_of_range['some_friends']){CSS.addClass(this.$('some_friends'),'collapsed');}}
this.edit_preset();},adv_onclick_networks_select:function(value){this.edit_networks(this.adv_read_networks(),(this.adv_read_networks_select()=='some'));this.edit_everyone(false);this.edit_preset();},adv_onclick_networks_checkbox:function(value){this.edit_preset();},adv_onclick_everyone:function(){var checked=this.$('advanced_everyone').getElementsByTagName('input')[0].checked;if(checked){this.edit_friends(PrivacyFriendsValue.EVERYONE);}else if(!this.toggle_everyone){this.edit_networks(PrivacyNetworksAll);}
this.edit_preset();this.toggle_everyone=true;},adv_onclick_cancel:function(){this.model_write_to_summary();if(!this.properties.prevent_dialog_fade_out){this.dialog.fade_out(null,null,function(){this.hide_advanced();}.bind(this));}else{this.dialog.hide();this.hide_advanced();}},adv_onclick_save:function(){var cold=this.model.ids_anon.length;var some_names=this.adv_read_custom_ids('some','names');var cnew=some_names.length;var prompt=false;if(cnew!=cold&&cnew>=3){prompt='some';}
if(!prompt){cold=this.model.ids_x_anon.length;some_names=this.adv_read_custom_ids('except','names');cnew=some_names.length;if(cnew!=cold&&cnew>=3){prompt='except';}}
this.model_read_from_adv();this.model_write_to_form();this.model_write_to_summary();if(prompt){this.adv_show_prompt(prompt);}else{if(!this.properties.prevent_dialog_fade_out){this.dialog.fade_out(null,null,function(){this.root.appendChild(this.advanced);}.bind(this));}else{this.dialog.hide();this.root.appendChild(this.advanced);}}
this.on_save();},adv_show_prompt:function(type){this.mode='prompt';this.$('savelist').onclick=bind(this,'adv_onclick_savelist',type);this.$('savelist').disabled=false;this.$('listname').value='';this.dialog.content.childNodes[0].childNodes[0].innerHTML=_tx("Create a Friend List?");var some_ids=this.adv_read_custom_ids(type,'names');var token_html='';for(var i=0;i<some_ids.length;i++){token_html+=this.adv_gen_token(some_ids[i],this.tdata[some_ids[i]]);}
this.$('prompt_tokens').innerHTML=token_html;var cls='privacy_widget privacy_widget_pop';var id='privacy_pop_'+this.fbid;this.root.appendChild(this.advanced);$(id).appendChild(this.prompt);this.$('listname').focus();},adv_onclick_savelist:function(type){if(!this.$('listname').value){this.$('listname').focus();animation(this.$('listname')).from('background','#ffc0c0').to('background','#ffffff').duration(500).go();return;}
this.$('savelist').disabled=true;var data=serialize_form(this.prompt);new AsyncRequest().setURI('/privacy/ajax/lists.php').setData(data).setHandler(bind(this,'_adv_savelist',type)).setErrorHandler(bind(this,'_adv_savelist',type)).send();},_adv_savelist:function(type,r){if(r.getError()==kError_Privacy_FriendListNameAlreadyExists){this.dialog.is_stackable=true;ErrorDialog.showAsyncError(r);this.$('savelist').disabled=false;return;}
var payload=r.getPayload();if(payload&&(flid=payload.flid)){if(window.friendlist_source){friendlist_source.dirty();}
this.tdata[flid]=r.getPayload().name;if(type=='some'){this.model.ids_anon=[];this.model.lists.push(flid);}else{this.model.ids_x_anon=[];this.model.lists_x.push(flid);}
this.model_write_to_form();this.model_write_to_summary();}
if(!this.properties.prevent_dialog_fade_out){this.dialog.fade_out(null,null,function(){this.root.appendChild(this.prompt);}.bind(this));}else{this.dialog.hide();this.root.appendChild(this.prompt);}},adv_onclick_nothanks:function(){if(!this.properties.prevent_dialog_fade_out){this.dialog.fade_out(null,null,function(){this.root.appendChild(this.prompt);}.bind(this));}else{this.dialog.hide();this.root.appendChild(this.prompt);}},adv_toggle_except:function(){CSS.toggleClass(this.$('advanced_except'),'collapsed');return false;},adv_toggle_networks:function(){CSS.toggleClass(this.$('advanced_networks'),'collapsed');return false;},edit_preset:function(){set_form_select_value(this.$('advanced_select'),this.adv_reverse_preset_value());this.edit_friends(this.adv_read_friends());this.dialog.reset_dialog();},select_display_value:function(value,friends,networks,some_lists,some_names,check_if_exists){if(check_if_exists==null){var check_if_exists=true;}
var current_value=null;if(friends!=null){switch(friends){case PrivacyFriendsValue.EVERYONE:current_value=PrivacyBaseValue.EVERYONE;break;case PrivacyFriendsValue.NETWORKS_FRIENDS:current_value=PrivacyBaseValue.NETWORKS_FRIENDS;break;case PrivacyFriendsValue.SOME_FRIENDS:current_value=PrivacyBaseValue.CUSTOM;break;case PrivacyFriendsValue.ALL_FRIENDS:current_value=PrivacyBaseValue.ALL_FRIENDS;break;case PrivacyFriendsValue.FRIENDS_OF_FRIENDS:current_value=PrivacyBaseValue.FRIENDS_OF_FRIENDS;break;case PrivacyFriendsValue.NO_FRIENDS:current_value=PrivacyBaseValue.SELF;break;}}
if(current_value!=PrivacyBaseValue.EVERYONE){if(networks!==PrivacyNetworksAll&&networks.length!=0){if(networks.length==1&&(friends==PrivacyFriendsValue.NO_FRIENDS)&&this.networks[networks[0]]['type']==PrivacyNetworkTypes.TYPE_CORP&&this.networks[networks[0]]['primary']==true){current_value=PrivacySpecialPreset.ONLY_CORP_NETWORK;}else if(networks.length==1&&(friends==PrivacyFriendsValue.FRIENDS_OF_FRIENDS)&&this.networks[networks[0]]['type']==PrivacyNetworkTypes.TYPE_COLLEGE&&this.networks[networks[0]]['primary']==true){current_value=PrivacySpecialPreset.COLLEGE_NETWORK_FRIENDS_OF_FRIENDS;}else if(networks.length==1&&(friends==PrivacyFriendsValue.ALL_FRIENDS)&&this.networks[networks[0]]['type']==PrivacyNetworkTypes.TYPE_COLLEGE&&this.networks[networks[0]]['primary']==true){current_value=PrivacySpecialPreset.COLLEGE_NETWORK_FRIENDS;}else{current_value=PrivacyBaseValue.CUSTOM;}}
if(networks===PrivacyNetworksAll){if(friends==PrivacyFriendsValue.ALL_FRIENDS){current_value=PrivacyBaseValue.NETWORKS_FRIENDS;}else if(friends==PrivacyFriendsValue.FRIENDS_OF_FRIENDS){current_value=PrivacyBaseValue.NETWORKS_FRIENDS_OF_FRIENDS;}else{current_value=PrivacyBaseValue.CUSTOM;}}}
if(!current_value){if(value==PrivacyBaseValue.EVERYONE){current_value=PrivacyBaseValue.EVERYONE;friends=PrivacyFriendsValue.EVERYONE;}
if(value==PrivacyBaseValue.SELF){current_value=PrivacyBaseValue.SELF;friends=PrivacyFriendsValue.NO_FRIENDS;}}
if(!current_value){current_value=value;}
if(friends===PrivacyFriendsValue.SOME_FRIENDS&&some_lists.length==0&&some_names.length==0&&networks!==PrivacyNetworksAll&&networks.length==0){current_value=PrivacyBaseValue.NOBODY;if(!this._model_preset_exists(current_value)){if(this._model_preset_exists(current_value)){current_value=PrivacyBaseValue.SELF;}else if(this.adv_friends_value_exists(PrivacyFriendsValue.NO_FRIENDS)){current_value=PrivacyBaseValue.SELF;}else{current_value=PrivacyBaseValue.ALL_FRIENDS;}}}
if(friends===PrivacyFriendsValue.NO_FRIENDS&&networks!==PrivacyNetworksAll&&networks.length==0){current_value=PrivacyBaseValue.SELF;}
if(check_if_exists&&!this._model_preset_exists(current_value)){return PrivacyBaseValue.CUSTOM;}
return current_value;},get_model_value:function(display_value,lists_x,ids_anon_x){if(display_value==PrivacyBaseValue.CUSTOM){return display_value;}else{if(display_value===PrivacyBaseValue.NOBODY){return PrivacyBaseValue.NOBODY;}
for(var k in PrivacySpecialPreset){if(display_value==PrivacySpecialPreset[k]){return PrivacyBaseValue.CUSTOM;}}
if(((lists_x&&lists_x.length>0)||(ids_anon_x&&ids_anon_x.length>0))&&display_value!=PrivacyBaseValue.SELF&&display_value!=PrivacyBaseValue.NOBODY){return PrivacyBaseValue.CUSTOM;}
return display_value;}},adv_read_friends:function(){if(this.adv_read_everyone()==true){return PrivacyFriendsValue.EVERYONE;}
var friends=this.$('advanced_friends_radios').getElementsByTagName('input');for(var i=0;i<friends.length;i++){if(friends[i].type=='radio'){if(friends[i].checked){return parseInt(friends[i].value);}}}},adv_friends_value_exists:function(value){if(value==PrivacyFriendsValue.EVERYONE){if(this.out_of_range['everyone']){return false;}else{return true;}}
var friends=this.$('advanced_friends_radios').getElementsByTagName('input');for(var i=0;i<friends.length;i++){if(friends[i].type=='radio'&&parseInt(friends[i].value)===value){return true;}}
return false;},adv_read_everyone:function(){if(!this.out_of_range['everyone']){return this.$('advanced_everyone').getElementsByTagName('input')[0].checked;}},adv_read_custom_ids:function(type,entity){if(type=='some'&&this.out_of_range['some_friends']){return[];}
if(type=='except'&&this.out_of_range['except']){return[];}
var container_div=this.$(type+'_friends_container');var container=container_div.childNodes[0];var returns=[];if(container.childNodes.length>0){for(var i=0;i<container.childNodes.length;i++){if(CSS.hasClass(container.childNodes[i],'friends_'+entity)){var inputs=container.childNodes[i].getElementsByTagName('input');for(var i2=0;i2<inputs.length;i2++){returns.push(inputs[i2].value);}}}}
return returns;},adv_read_networks_select:function(){return get_form_select_value(this.$('advanced_networks_select'));},adv_read_networks:function(){if(this.out_of_range['networks']){return[];}
var select_value=this.adv_read_networks_select();if(select_value!='some'){if(select_value=='none'){return[];}else if(select_value=='all'){return PrivacyNetworksAll;}}
var selected_networks=[];var networks=this.$('advanced_networks_checkboxes').getElementsByTagName('input');for(var i=0;i<networks.length;i++){if(networks[i].checked){selected_networks.push(networks[i].value);}}
return selected_networks;},adv_all_networks:function(){if(this.out_of_range['networks']){return[];}
var inputs=this.$('advanced_networks_checkboxes').getElementsByTagName('input');var networks=[];for(var i=0;i<inputs.length;i++){networks.push(inputs[i].value);}
return networks;},adv_reverse_preset_value:function(check_if_exists){return this.select_display_value(get_form_select_value(this.$('advanced_select')),this.adv_read_friends(),this.adv_read_networks(),this.adv_read_custom_ids('some','lists'),this.adv_read_custom_ids('some','names'),check_if_exists);},interpret_value:function(value){var friends=PrivacyFriendsValue.NO_FRIENDS;var everyone=false;var networks=[];var self=false;value=parseInt(value);switch(value){case PrivacyBaseValue.OPEN:case PrivacyBaseValue.EVERYONE:friends=PrivacyFriendsValue.EVERYONE;everyone=true;break;case PrivacyBaseValue.FRIENDS_OF_FRIENDS:friends=PrivacyFriendsValue.FRIENDS_OF_FRIENDS;networks=[];break;case PrivacyBaseValue.NETWORKS_FRIENDS_OF_FRIENDS:friends=PrivacyFriendsValue.FRIENDS_OF_FRIENDS;networks=PrivacyNetworksAll;break;case PrivacySpecialPreset.COLLEGE_NETWORK_FRIENDS_OF_FRIENDS:friends=PrivacyFriendsValue.FRIENDS_OF_FRIENDS;networks=[];for(var k in this.networks){if(this.networks[k]['primary']==true&&this.networks[k]['type']==PrivacyNetworkTypes.TYPE_COLLEGE){networks.push(k);break;}}
break;case PrivacySpecialPreset.COLLEGE_NETWORK_FRIENDS:friends=PrivacyFriendsValue.ALL_FRIENDS;networks=[];for(var k in this.networks){if(this.networks[k]['primary']==true&&this.networks[k]['type']==PrivacyNetworkTypes.TYPE_COLLEGE){networks.push(k);break;}}
break;case PrivacySpecialPreset.ONLY_CORP_NETWORK:friends=PrivacyFriendsValue.NO_FRIENDS;networks=[];for(var k in this.networks){if(this.networks[k]['primary']==true&&this.networks[k]['type']==PrivacyNetworkTypes.TYPE_CORP){networks.push(k);break;}}
break;case PrivacyBaseValue.NETWORKS_FRIENDS:friends=PrivacyFriendsValue.ALL_FRIENDS;networks=PrivacyNetworksAll;break;case PrivacyBaseValue.ALL_FRIENDS:friends=PrivacyFriendsValue.ALL_FRIENDS;networks=[];break;case PrivacyBaseValue.SELF:friends=PrivacyFriendsValue.NO_FRIENDS;break;case PrivacyBaseValue.NOBODY:friends=PrivacyFriendsValue.SOME_FRIENDS;break;}
return{friends:friends,everyone:everyone,networks:networks,self:self};},edit_value:function(value,hidden){this.undo.push(value);value=parseInt(value);if(value&&value!=PrivacyBaseValue.CUSTOM){var values=this.interpret_value(value);this.edit_networks(values.networks);this.edit_everyone(values.everyone);this.edit_self(values.self);this.edit_friends(values.friends)}else{if(!this.out_of_range['some_friends']){this.edit_friends(PrivacyFriendsValue.SOME_FRIENDS);if(!hidden){this.$('fs_some').focus();}}
this.edit_networks([]);set_form_select_value(this.$('advanced_select'),PrivacyBaseValue.CUSTOM);this.edit_preset();}
if(!this._model_preset_exists(value)){set_form_select_value(this.$('advanced_select'),this.select_display_value(value,this.adv_read_friends(),this.adv_read_networks(),this.adv_read_custom_ids('some','lists'),this.adv_read_custom_ids('some','names')));}},edit_friends:function(friends){if(friends==PrivacyFriendsValue.EVERYONE){this.edit_everyone(true);friends=PrivacyFriendsValue.FRIENDS_OF_FRIENDS;this.edit_networks(PrivacyNetworksAll);}else{this.edit_everyone(false);}
if(!this.friends_radios){var friends_items=this.$('advanced_friends_radios').getElementsByTagName('input');this.friends_radios=[];for(var i=0;i<friends_items.length;i++){if(friends_items[i].type=='radio'){this.friends_radios.push(friends_items[i]);}}}
if(!this.friends_radio_items){var divs=this.$('advanced_friends_radios').getElementsByTagName('div');this.friends_radio_items=[];for(var i=0;i<divs.length;i++){if(CSS.hasClass(divs[i],'advanced_friends_radio_item')){this.friends_radio_items.push(divs[i]);}}}
for(var i=0;i<this.friends_radios.length;++i){var checked=(friends==this.friends_radios[i].value)?'checked':false;this.friends_radios[i].checked=checked;if(checked){CSS.addClass(this.friends_radio_items[i],'selected');}else{CSS.removeClass(this.friends_radio_items[i],'selected');}}
if(!this.out_of_range['some_friends']){if(friends==PrivacyFriendsValue.SOME_FRIENDS){CSS.removeClass(this.$('some_friends'),'collapsed');}else{CSS.addClass(this.$('some_friends'),'collapsed');}}},edit_networks:function(networks,force_some){if(this.out_of_range['networks']){return;}
var select_value;if(networks!==PrivacyNetworksAll&&(networks.length!=0||force_some)){networks_enabled=networks;select_value='some';CSS.removeClass(this.$('advanced_networks'),'no_checkboxes');var networks=this.$('advanced_networks_checkboxes');var inputs=networks.getElementsByTagName('input');for(var i2=0;i2<inputs.length;++i2){on=false;if(networks_enabled.length>0){for(var i=0;i<networks_enabled.length;i++){if(networks_enabled[i]==inputs[i2].value){inputs[i2].checked=true;on=true;}}
if(!on){inputs[i2].checked=false;}}else{inputs[i2].checked=false;}}}
if(networks===PrivacyNetworksAll||networks.length==0){CSS.addClass(this.$('advanced_networks'),'no_checkboxes')
if(networks===PrivacyNetworksAll){select_value='all';}else{select_value='none';}}
set_form_select_value(this.$('advanced_networks_select'),select_value);},edit_everyone:function(on){if(!this.out_of_range['everyone']){this.$('advanced_everyone').getElementsByTagName('input')[0].checked=on;if(!this.out_of_range['networks']){if(on){CSS.setOpacity(this.$('advanced_networks'),0.7);CSS.setOpacity(this.$('advanced_friends_radios'),0.7);}else{CSS.setOpacity(this.$('advanced_networks'),1);CSS.setOpacity(this.$('advanced_friends_radios'),1)}}}},edit_self:function(on){if(on){this.edit_friends(PrivacyFriendsValue.NO_FRIENDS);}},set_friends_radio:function(value){var friends_options=this.$('advanced_friends_radios').getElementsByTagName('input');for(var i=0;i<friends_options.length;i++){if(parseInt(friends_options[i].value)==value){friends_options[i].checked=true;break;}}},show_advanced:function(){if(this.dialog&&this.dialog.obj){return false;}
this.mode='advanced';var cls='privacy_widget privacy_widget_pop';var id='privacy_pop_'+this.fbid;this.dialog=new pop_dialog('privacy_widget');if(!this.properties.prevent_dialog_expand_animation){this.dialog.show_loading_title(_tx("Edit Privacy Settings"));this.dialog.do_expand_animation=true;}
this.dialog.show_prompt((this.dialog_title?this.dialog_title:_tx("Edit Privacy Settings")),'<div class="'+cls+'" id="'+id+'"></div>');$(id).appendChild(this.advanced);this.model_write_to_adv();this.dialog.reset_dialog();return false;},hide_advanced:function(){this.root.appendChild(this.advanced);CSS.setOpacity(this.dialog.obj,1);},summary_onselect:function(){var value=parseInt(get_form_select_value(this.summary_select));this.summary_update_select_text(value);if(value==PrivacyBaseValue.CUSTOM){this.show_advanced();}else{CSS.addClass(this.$('summary'),'simple');if((this.model.lists_x.length>0||this.model.ids_x_anon.length>0)&&value!=PrivacyBaseValue.NOBODY&&value!=PrivacyBaseValue.SELF){CSS.addClass(this.$('summary'),'except');}else{CSS.removeClass(this.$('summary'),'except');}
var values=this.interpret_value(parseInt(value));this.model.friends=values.friends;this.model.networks=values.networks;this.model.value=this.get_model_value(parseInt(value),this.model.lists_x,this.model.ids_x_anon);this.model_write_to_form();this.on_save();}
this.summary_toggle_advanced_link(value);},summary_toggle_advanced_link:function(value){var show_advanced=false;if((this.model.lists_x.length>0||this.model.ids_x_anon.length>0)&&value!=PrivacyBaseValue.NOBODY&&value!=PrivacyBaseValue.SELF){show_advanced=true;}else if(value==PrivacyBaseValue.CUSTOM){show_advanced=true;}
if(show_advanced){this.$('show_advanced_custom').style.display='';}else{this.$('show_advanced_custom').style.display='none';}},summary_update_select_text:function(value){if(value!=PrivacyBaseValue.CUSTOM){value_text=_tx("Customize...");}else{value_text=_tx("Custom");}
for(var i=(this.summary_select.options.length-1);i>=0;--i){if(this.summary_select.options[i].value==PrivacyBaseValue.CUSTOM){this.summary_select.options[i].innerHTML=value_text;break;}}},set_on_save_handler:function(handler){this.save_handler=handler;},on_save:function(){if(this.save_handler){this.save_handler(serialize_form(this.root),this);}},is_me_or_nobody:function(){if(this.model.value==PrivacyBaseValue.SELF||this.model.value==PrivacyBaseValue.NOBODY||(this.model.value==PrivacyBaseValue.CUSTOM&&this.model.friends==PrivacyFriendsValue.NO_FRIENDS&&this.model.networks.length==0)){return true;}
return false;}});function privacy_profile_wall_check(form_data,instance){if(instance.is_me_or_nobody()){CSS.addClass($('privacy_profile_wall_setting'),'wall_setting_disabled');$('wall_setting').checked=false;$('wall_setting').disabled=true;$('has_wall_setting').value=0;}else{CSS.removeClass($('privacy_profile_wall_setting'),'wall_setting_disabled');$('wall_setting').disabled=false;$('wall_setting').checked=true;$('has_wall_setting').value=1;}}

function friend_source(get_param){this.bootstrap=this.bootstrap.bind(this,get_param);this.parent.construct(this);}
friend_source.extend('static_source');friend_source.prototype.text_noinput=friend_source.prototype.text_placeholder=_tx("Start typing a friend's name");friend_source.friends={};friend_source.friends_index={};friend_source.prototype.cache_results=true;friend_source.prototype.bootstrap=function(get_param){if(friend_source.friends[get_param]){this.values=friend_source.friends[get_param];this.index=friend_source.friends_index[get_param];this.ready();}else{new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_friends.php?'+get_param).setHandler(function(response){friend_source.friends[get_param]=this.values=response.getPayload().friends;this.build_index();friend_source.friends_index[get_param]=this.index;}.bind(this)).send();}}
friend_source.dirty=function(){friend_source.friends={};friend_source.friends_index={};typeaheadpro.dirty_instances();}
friend_source.prototype.gen_html=function(friend,highlight){var text=friend.n;if(friend.n===false){text=_tx("0 friends");}else if(typeof(friend.n)=="object"){var names=[];for(var k in friend.n){names.push(friend.n[k]);}
if(names.length>3){text=_tx("{name1}, {name2}, {count} others",{name1:names[0],name2:names[1],count:names.length-2});}else if(names.length){text=names.join(', ');}else{text=_tx("0 friends");}}
return['<div>',typeahead_source.highlight_found(friend.t,highlight),'</div><div><small>',text,'</small></div>'].join('');}
friend_source.prototype.search_value=function(text){if(text=='\x5e\x5f\x5e'){return[{t:text,n:'\x6b\x65\x6b\x65',i:10,it:'http://static.ak.facebook.com/pics/t_default.jpg'}];}
return this.parent.search_value(text);}

function friendlist_source(get_param){this.parent.construct(this,get_param);this.generation=0;}
friendlist_source.extend('friend_source');friendlist_source.master_generation=1;friendlist_source.dirty=function(){friend_source.dirty();friendlist_source.master_generation++;}
friendlist_source.prototype.friend_lists=false;friendlist_source.prototype.text_placeholder=_tx("Start typing the name of a friend or friend list...");friendlist_source.prototype.return_friend_lists=function(){if(!this.friend_lists||(this.generation<friendlist_source.master_generation)||(this.friend_lists&&this.friend_lists.length==0)){this.generation=friendlist_source.master_generation;this.friend_lists=[];var index=this.index;var results=[];var pushed=[];if(!index.length||!(index.length>=1)){return;}
for(var i=0;i<index.length;i++){if(index[i].o.flid&&!pushed[index[i].o.flid]){pushed[index[i].o.flid]=true;results.push(index[i].o);}}
var results_sorted=results.sort(function(a,b){if(a.t>b.t)return 1;else if(a.t<b.t)return-1;else return 0;});this.friend_lists=results_sorted;}
return this.friend_lists;}
friendlist_source.prototype.search_value=function(text){if(text=='**FRIENDLISTS**'){return this.return_friend_lists();}
return this.parent.search_value(text);}
friendlist_source.prototype.gen_nomatch=function(){if(this.showing_icon_list){return _tx("You do not have any friend lists. Use the friends page to create a list.");}else{return this.parent.gen_nomatch();}}

function show_edit_app_dialog(app_id,visible_tab,dialog_handler){EditAppSettings.setup(app_id,true,visible_tab,dialog_handler);}
EditAppSettings={currentTab:undefined,dialogUrl:'/ajax/editapp_dialog.php',callbackUrl:'/ajax/edit_app_settings.php',statusElement:'edit_app_settings_save_fill',appID:0,uiMode:false,setup:function(appID,uiMode,currentTab,dialogHandler){this.appID=appID;this.uiMode=uiMode;this.currentTab=currentTab||'feed';if(this.uiMode){this.showDialog(dialogHandler);}
return this;},showDialog:function(handler){var async=new AsyncRequest().setURI(this.dialogUrl).setData({'app_id':this.appID,'visible_tab':this.currentTab});new Dialog().setAsync(async).setStackable(true).setHandler(handler||bagofholding).show();return this;},switchTab:function(tabName){CSS.removeClass(this.currentTab+'_tab_link','tab_link_selected');hide('app_settings_'+this.currentTab+'_tab');CSS.addClass(tabName+'_tab_link','tab_link_selected');show('app_settings_'+tabName+'_tab');this.currentTab=tabName;},setBookmarked:function(bookmarked,callback){var handler=callback||bagofholding;var async=new AsyncRequest().setURI(this.callbackUrl).setHandler(handler).setData({'bookmark':1,'bookmarked':bookmarked,'app_id':this.appID});if(this.uiMode){async.setStatusElement(this.statusElement);}
async.send();},setAllowPublish:function(setting,show_minor_buttons){if(show_minor_buttons){show('app_feed_minor_buttons');}else{$('edit_app_settings_allow_publish_small_radio').checked=false;$('edit_app_settings_allow_publish_medium_radio').checked=false;$('edit_app_settings_allow_publish_large_radio').checked=false;hide('app_feed_minor_buttons');}
new AsyncRequest().setStatusElement(this.statusElement).setURI(this.callbackUrl).setHandler(bagofholding).setData({'publishing':1,'setting':setting,'app_id':this.appID}).send();return true;},setExtendedPermission:function(permission,allow,callback){var handler=callback||bagofholding;var async=new AsyncRequest().setURI(this.callbackUrl).setHandler(handler).setData({'extended':1,'permission':permission,'allow':allow,'app_id':this.appID});if(this.uiMode){async.setStatusElement(this.statusElement);}
async.send();return true;},makeProfileChange:function(item,action,box_tab,callback){var handler=callback||bagofholding;new AsyncRequest().setStatusElement(this.statusElement).setURI(this.callbackUrl).setHandler(handler).setData({'profile':1,'item':item,'action':action,'app_id':this.appID,'box_tab':box_tab}).send();if(this.uiMode){toggleDisplayNone('app_settings_profile_'+item+'_add');toggleDisplayNone('app_settings_profile_'+item+'_remove');}},savePrivacy:function(privacyData){privacyData['privacy']=1;var async=new AsyncRequest().setURI(this.callbackUrl).setHandler(bagofholding).setData(privacyData);if(this.uiMode){async.setStatusElement(this.statusElement);}
async.send();},removeApplication:function(callback){var handler=callback||bagofholding;new AsyncRequest().setURI(this.callbackUrl).setHandler(handler).setData({'remove':1,'app_id':this.appID}).send();},blockApplication:function(callback){var handler=callback||bagofholding;new AsyncRequest().setURI(this.callbackUrl).setHandler(handler).setData({'block':1,'app_id':this.appID}).send();},reorderBookmarks:function(appIDs){new AsyncRequest().setURI(this.callbackUrl).setHandler(bagofholding).setData({'reorder_bookmarks':1,'app_ids':appIDs}).send();},setExternalWebsitePolicy:function(setting){new AsyncRequest().setURI(this.callbackUrl).setHandler(bagofholding).setData({external_site:1,app_id:this.appID,policy:setting}).send();},setGlobalExternalWebsitePolicy:function(setting){new AsyncRequest().setURI(this.callbackUrl).setHandler(bagofholding).setData({global_external_site:1,policy:setting?1:0}).send();},setAlertSetting:function(alert_setting,is_active,callback){var handler=callback||bagofholding;var async=new AsyncRequest().setURI(this.callbackUrl).setHandler(handler).setData({'alerts':1,'alert_setting':alert_setting,'alert_value':is_active?1:0});if(this.uiMode){async.setStatusElement(this.statusElement);}
async.send();},setBlockComposer:function(block,callback){new AsyncRequest().setURI(this.callbackUrl).setHandler(callback||bagofholding).setData({composer:1,blocked_composer:block,app_id:this.appID}).send();},killComposerDialog:function(app_name,context,callback){var composer_dialog=new contextual_dialog();var killComposer=function(){this.setBlockComposer(1,callback);composer_dialog.fade_out(100);}.bind(this);var title=_tx("Remove {app-name} Publisher?",{'app-name':htmlize(app_name)});var content=_tx("You can undo this action in {app-name}'s application settings.",{'app-name':htmlize(app_name)});var button=_tx("Remove");composer_dialog.set_context(context).show_choice(title,content,_tx("Remove"),killComposer,_tx("Cancel"),function(){composer_dialog.fade_out(100);});},reviveComposerDialog:function(app_name,callback){var title=_tx("Unblock {app-name} Publisher?",{'app-name':htmlize(app_name)});var content='<p>'+_tx("Are you sure you want to allow this application's publisher on your profile? ")+'</p>';var button=_tx("Unblock");new Dialog().setTitle(title).setBody(content).setButtons([{'name':'remove','label':button},Dialog.CANCEL]).setHandler(this.setBlockComposer.bind(this,0,callback)).show();},hideRooster:function(){new AsyncRequest().setURI(this.callbackUrl).setHandler(bagofholding).setData({hide_rooster:1}).send();hide('editapps_fb95_rooster_outer');}}

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