/*       Source:  Local Cache                                                                 */
/*     Location:  rsrc:105043:/html/js/profile.js                                             */
/*      Machine:  10.16.140.110                                                               */
/*    Generated:  July 23rd 2008 7:15:07 AM PDT                                               */
/*    HTTP Host:  static.ak.fbcdn.net                                                         */


var REMOVE_BOX_ONLY=1;var REMOVE_ENTIRE_APP=2;var REMOVE_LINK_ONLY=3;var REMOVE_INTERACTIONS_ONLY=4;function removeActionLink(obj,application_name,app_id){var dialog=new contextual_dialog();dialog.set_context(obj);buttons='<div class="dialog_buttons">'+'<input class="inputsubmit" type="button" value="'+tx('prf:remove-applink')+'"/>'+'<input class="inputsubmit" type="button" value="'+tx('prf:remove-app')+'"/>'+'<input class="inputsubmit" type="button" value="'+tx('sh:cancel-button')+'" />'+'</div>';var prompt=tx('prf03');add_css_class_name(obj,'box_remove_selected');dialog.show_prompt(tx('prf04',{'application-name':application_name}),prompt+buttons);dialog_options=dialog.obj.getElementsByTagName('input');dialog_options[0].onclick=function(){_remove_app(REMOVE_LINK_ONLY,app_id,'pra');dialog.hide();}
dialog_options[1].onclick=function(){_remove_app(REMOVE_ENTIRE_APP,app_id,'pra');dialog.hide();}
dialog_options[2].onclick=function(){dialog.hide();remove_css_class_name(obj,'box_remove_selected');}
return false;}
function _remove_app(remove_type,app_id,ref){var error_message;if(remove_type==REMOVE_BOX_ONLY){error_message=tx('prf:error-box');_remove_app_box_from_page(app_id);_remove_app_icon_from_page_profile(app_id);}else if(remove_type==REMOVE_LINK_ONLY){error_message=tx('prf:error-applink');_remove_app_link_from_page_profile(app_id);}else if(remove_type==REMOVE_ENTIRE_APP){error_message=tx('prf:error-app');_remove_app_box_from_page(app_id);_remove_app_icon_from_page_profile(app_id);remove_app_link_from_side_nav(app_id);_remove_app_link_from_page_profile(app_id);}
ajax_remove_application(app_id,PROFILE_FBID,remove_type,ref,error_message);}
function ajax_remove_application(app_id,profile_fbid,remove_type,ref,error_message){if(!error_message){error_message=tx('prf:error-app');}
new AsyncRequest().setURI('/ajax/profile_boxes.php').setMethod('POST').setData({profile_fbid:profile_fbid,app_id:app_id,remove_type:remove_type,ref:ref}).setHandler(function(resp){if(!(resp.getPayload()).success){Util.error(error_message+'for app %d.',app_id);aiert(error_message);}}).setErrorHandler(function(){Util.error(error_message+'for app %d.',app_id);aiert(error_message);}).send();}
function _remove_app_box_from_page(app_id){var box=ge('box_app_'+app_id);if(box){box.parentNode.removeChild(box);}}
function remove_app_link_from_side_nav(app_id){app_id=String(app_id);if(ge(app_id)){$(''+app_id).style.display='none';}}
function _remove_app_icon_from_page_profile(app_id){var app_icon_id='icon_app'+app_id;if(ge(app_icon_id)){$(app_icon_id).style.display='none';}}
function _remove_app_link_from_page_profile(app_id){if(ge('action_app_'+app_id)){$('action_app_'+app_id).style.display='none';}}
function removeBox(obj,application_name,app_id){var dialog=new contextual_dialog();dialog.set_context(obj);buttons='<div class="dialog_buttons">'+'<input class="inputsubmit" type="button" value="'+tx('prf:remove-app')+'" />'+'<input class="inputsubmit" type="button" value="'+tx('prf:remove-box')+'" />'+'<input class="inputsubmit" type="button" value="'+tx('sh:cancel-button')+'" />'+'</div>';var remove_prompt=tx('prf05');dialog.show_prompt(tx('prf06',{'application-name':application_name}),dialog.content_to_markup(remove_prompt)+buttons);add_css_class_name(obj,'box_remove_selected');dialog_options=dialog.obj.getElementsByTagName('input');dialog_options[0].onclick=function(){_remove_app(REMOVE_ENTIRE_APP,app_id,'prb');dialog.hide();}
dialog_options[1].onclick=function(){_remove_app(REMOVE_BOX_ONLY,app_id,'prb');dialog.hide();}
dialog_options[2].onclick=function(){dialog.hide();remove_css_class_name(obj,'box_remove_selected');}
return false;}
var mf_uninstalled_apps={};function minifeed_hide(clicked_element,story_id,fbpage_name,app_id,installed,hash,story_type,source_id,template_id,non_user,approved){var minifeed_dialog_handle=new contextual_dialog();minifeed_dialog_handle.set_context(clicked_element);var title=tx('prf07');var message=tx('prf08');var hide_story=function(){if(source_id){_minifeed_hide_click(story_id,source_id,false,false);}else{_minifeed_hide_click(story_id,null,false,false,story_type,app_id,template_id,hash);}
generic_dialog.get_dialog(this).fade_out(100);};var hide_inaccurate_app_story=function(){if(source_id){_minifeed_hide_click(story_id,source_id,false,true);}else{_minifeed_hide_click(story_id,null,null,true,story_type,app_id,template_id,hash);}
generic_dialog.get_dialog(this).fade_out(100);};var hide_story_and_remove_app=function(){if(source_id){_minifeed_hide_click(story_id,source_id,true,true);mf_uninstalled_apps[source_id]=true;}else{_minifeed_hide_click(story_id,null,null,true,story_type,app_id,template_id,hash);_remove_app(REMOVE_ENTIRE_APP,app_id,'mf');mf_uninstalled_apps[app_id]=true;}
generic_dialog.get_dialog(this).fade_out(100);};var hide_story_and_block_app=function(){mf_uninstalled_apps[app_id]=true;_remove_app(REMOVE_INTERACTIONS_ONLY,app_id,'mf');_minifeed_hide_click(story_id,null,null,true,story_type,app_id,template_id,hash);generic_dialog.get_dialog(this).fade_out(100);}
var cancel=function(){generic_dialog.get_dialog(this).fade_out(100);};var inaccurate_installed_app=function(){var uninstall_title=source_id?tx('ua03'):tx('prf09');var uninstall_message=source_id?tx('ua04'):tx('prf10');var remove_button_text=source_id?tx('ua:block-source'):tx('prf:remove-app');minifeed_dialog_handle.show_choice(uninstall_title,uninstall_message,tx('prf:just-hide-story'),hide_inaccurate_app_story,remove_button_text,hide_story_and_remove_app,'',tx('sh:cancel-button'),cancel);var dialog_popup=minifeed_dialog_handle.obj.firstChild;dialog_popup.className='remove_app_dialog_popup '+dialog_popup.className;};if(app_id&&non_user&&!approved){message+=' '+tx('prf33');minifeed_dialog_handle.show_choice(title,message,tx('prf:hide-story'),hide_story,tx('prf:dont-want'),hide_story_and_block_app,'',tx('sh:cancel-button'),cancel);}else if((app_id||source_id)&&!approved){message+=' '+tx('prf11');var inaccurate_function;if(installed&&(source_id&&!mf_uninstalled_apps[source_id])||(app_id&&!mf_uninstalled_apps[app_id])){inaccurate_function=inaccurate_installed_app;}else{inaccurate_function=hide_inaccurate_app_story;}
minifeed_dialog_handle.show_choice(title,message,tx('prf:hide-story'),hide_story,tx('prf:didnt-do'),inaccurate_function,'',tx('sh:cancel-button'),cancel);}else{minifeed_dialog_handle.show_choice(title,message,tx('prf:hide-story'),hide_story,tx('sh:cancel-button'),cancel);}
return false;}
function _minifeed_hide_click(hide_id,source_id,block_source,inaccurate,story_type,app_id,template_id,hash){story=ge('story_'+hide_id);if(story.previousSibling.className=='date_divider'&&story.nextSibling.className.indexOf('story')==-1){remove_node(story.previousSibling);}else if(story.previousSibling.className=='date_divider'){story.nextSibling.className+=' no_border';}
remove_node(story);_minifeed_decrement_story_count();var post={'hide_ministory_key':hide_id,'profile_fbid':PROFILE_FBID};if(app_id){post['app_id']=app_id;post['hash']=hash;if(template_id){post['template_id']=template_id;}}
if(inaccurate){post['inaccurate']=1;post['story_type']=story_type;}
if(source_id){post['source_id']=source_id;if(block_source){post['block_source']=true;}}
new AsyncRequest().setURI('/ajax/minifeed.php').setMethod('POST').setData(post).setHandler(function(resp){}).setErrorHandler(function(){aiert(tx('prf:error-hide-mf'));}).send();}
function _minifeed_decrement_story_count(){var text;var count_el=ge('mf_story_count_string');if(!count_el)return;var count=parseInt(count_el.getAttribute('story_count'));count=count-1;if(count==1){text=tx('prf12');}else{text=tx('prf13',{'count':count});}
count_el.innerHTML=text;count_el.setAttribute('story_count',count);}
function close_remove_mf_flex_message(elem,profile_id){new AsyncRequest().setURI('/ajax/minifeed.php').setData({profile_fbid:profile_id,close_remove_mf_flex_message:true}).send();animation(elem).to('height',0).to('opacity','0').duration(250).hide().go();return false;}
function save_box_orders(){var moveable_wide=ge('moveable_wide');var hidden_wide=ge('hidden_apps_wide');var i,j;var moveable_wide_list='';for(i=0;i<moveable_wide.childNodes.length;i++){if(i!=0){moveable_wide_list+=':';}
moveable_wide_list+=moveable_wide.childNodes[i].id;}
var apps_wide_cutoff=i;if(hidden_wide){for(j=0;j<hidden_wide.childNodes.length;j++){if(i!=0){moveable_wide_list+=':';}
moveable_wide_list+=hidden_wide.childNodes[j].id;}}
var moveable_narrow=ge('moveable_narrow');var hidden_narrow=ge('hidden_apps_narrow');var moveable_narrow_list='';for(i=0;i<moveable_narrow.childNodes.length;i++){if(i!=0){moveable_narrow_list+=':';}
moveable_narrow_list+=moveable_narrow.childNodes[i].id;}
var apps_narrow_cutoff=i;if(hidden_narrow){for(j=0;j<hidden_narrow.childNodes.length;j++){if(i!=0){moveable_narrow_list+=':';}
moveable_narrow_list+=hidden_narrow.childNodes[j].id;}}
new AsyncRequest().setURI('/ajax/profile_boxes.php').setMethod('POST').setData({'profile_fbid':PROFILE_FBID,'moveable_wide_list':moveable_wide_list,'moveable_narrow_list':moveable_narrow_list,'apps_wide_cutoff':apps_wide_cutoff,'apps_narrow_cutoff':apps_narrow_cutoff}).send();}
function show_profile_layout_dialog(){var dialog=new pop_dialog();dialog.show_message(tx('prf14'),tx('prf15'));}
function show_public_profile_dialog(url){var dialog=new pop_dialog();dialog.show_message(tx('prf17'),tx('prf18')
+'<br/><br/>'
+'<span style="color: #3b5998; border: 1px solid #ccc; padding: 5px; margin: 5px;">'
+url
+'</span>'
+'<br/><br/>'
+tx('prf20',{'search-privacy-link':'<a href="/privacy.php?view=search">'+tx('prf21')+'</a>'}));}
function profile_icon_hover(icon_link){var tooltip=icon_link.previousSibling;tooltip.style.display='block';tooltip.style.zindex=1;if(has_css_class_name(tooltip,'loaded_tooltip')){visible_tooltip=tooltip;return;}
var offsetWidth=tooltip.childNodes[0].offsetWidth;tooltip.style.width=offsetWidth+'px';tooltip.style.left=-((offsetWidth-22)/2)+'px';tooltip.style.top=-24+'px';add_css_class_name(tooltip,'loaded_tooltip');visible_tooltip=tooltip;}
function clear_tooltip(icon_link){var tooltip=icon_link.previousSibling;tooltip.style.display='none';}
function boxFlexToggle(el){var userprofile=ge('userprofile');if(has_css_class_name(userprofile,'collapsed_mode')){remove_css_class_name(userprofile,'collapsed_mode');remove_css_class_name(el,'flex_shut');add_css_class_name(el,'flex_open');_animate_scroll_to_id(el.id,5);_profileBoxFlexAjax(el.id,0);return;}
if(has_css_class_name(el,'flex_open')){remove_css_class_name(el,'flex_open');add_css_class_name(el,'flex_shut');_profileBoxFlexAjax(el.id,1);}else{remove_css_class_name(el,'flex_shut');add_css_class_name(el,'flex_open');_profileBoxFlexAjax(el.id,0);}
el.blur();return false;}
function _profileBoxFlexAjax(elId,val){new AsyncSignal('/ajax/profile_box_flex_ajax.php',{'app_id':elId,'value':val}).send();}
function _boxFlexSet(el,open){if(open==true&&has_css_class_name(el,'flex_shut')){remove_css_class_name(el,'flex_shut');add_css_class_name(el,'flex_open');}else if(open==false&&has_css_class_name(el,'flex_open')){remove_css_class_name(el,'flex_open');add_css_class_name(el,'flex_shut');}}
function profile_app_switcher_select(scroll_element_id,app_id){_boxFlexSet(app_container,1);var box_head=$('box_head_'+app_id);if(box_head){var app_container=box_head.parentNode;if(app_container.parentNode.id.indexOf('moveable')==-1){toggle_profile_apps_link(true);}
_make_header_blue(app_id);_animate_scroll_to_id(scroll_element_id,app_id);}else{ProfileHiddenBoxes.singleton.ensureHiddenContents(function(){box_head=$('box_head_'+app_id);if(box_head){profile_app_switcher_select(scroll_element_id,app_id);}});}
AsyncRequest.pingURI('/ajax/profile_boxes_log.php',{'log_scroll':1,'profile_fbid':window.PROFILE_OWNER_ID,'app_id':app_id},false);return false;}
var ANI_SCROLL_STEP_AMOUNT=250;var ANI_SCROLL_SLOWING_WINDOW=750;var ANI_SCROLL_STOP_WINDOW=13;var ANI_MAX_SLOWDOWN_AMOUNT=120;var ANI_CALLBACK_PAUSE_TIME=200;function _animate_scroll_to_id(scroll_element_id,app_id){var element=(typeof app_id!='undefined')?ge('box_app_'+app_id):ge(scroll_element_id);var target_height=elementY(element);var target_bottom=target_height+element.offsetHeight;if(target_height>pageScrollY()&&target_bottom<pageScrollY()+getViewportHeight()){setTimeout("_fade_header("+app_id+")",ANI_CALLBACK_PAUSE_TIME+400);}else{_animate_scroll_to_id_helper(scroll_element_id,20,app_id,pageScrollY(),'_fade_header');}}
function _animate_scroll_to_id_no_fade(scroll_element_id,app_id){var element=(typeof app_id!='undefined')?ge('box_app_'+app_id):ge(scroll_element_id);var target_height=elementY(element);var target_bottom=target_height+element.offsetHeight;_animate_scroll_to_id_helper(scroll_element_id,20,app_id,pageScrollY(),'');}
function _animate_scroll_to_id_helper(scroll_element_id,scroll_speed,app_id,scroll_height,scroll_complete_callback){var element=ge(scroll_element_id);var target_height=elementY(element);var page_scroll_height=pageScrollY();var scroll_dir=1;if(target_height<page_scroll_height){scroll_dir=-1;}
var scroll_amount=0;if(scroll_height!=page_scroll_height){if(scroll_complete_callback){setTimeout(scroll_complete_callback+"("+app_id+")",ANI_CALLBACK_PAUSE_TIME);}
return;}
if(!(page_scroll_height>target_height-ANI_SCROLL_SLOWING_WINDOW&&page_scroll_height<target_height+ANI_SCROLL_SLOWING_WINDOW)){scroll_amount=ANI_SCROLL_STEP_AMOUNT;}else if(!(page_scroll_height>target_height-ANI_SCROLL_STOP_WINDOW&&page_scroll_height<target_height+ANI_SCROLL_STOP_WINDOW)){scroll_amount=parseInt(Math.abs(page_scroll_height-target_height)/ANI_SCROLL_SLOWING_WINDOW*ANI_MAX_SLOWDOWN_AMOUNT);}
if(scroll_amount!=0){var expected_page_scroll_height=pageScrollY()+scroll_dir*scroll_amount;window.scrollBy(0,scroll_dir*scroll_amount);setTimeout("_animate_scroll_to_id_helper('"+
scroll_element_id+"',"+
scroll_speed+","+
app_id+","+
expected_page_scroll_height+",'"+
scroll_complete_callback+"')",scroll_speed);}else{window.scrollTo(0,target_height-ANI_SCROLL_STOP_WINDOW);if(scroll_complete_callback){setTimeout(scroll_complete_callback+"("+app_id+")",ANI_CALLBACK_PAUSE_TIME);}}}
function _fade_header(id){var box_header=ge('box_head_'+id);remove_css_class_name(box_header,'box_head_highlight');var box=ge('box_head_'+id);if(!box){return;}
remove_css_class_name(box.parentNode,'box_outline');var old_border=ge('scroll_highlight_border');old_border.parentNode.removeChild(old_border);if(id==2719290516){$('wall_text').focus();}}
function make_try_app_header(app_id,callback){_animate_scroll_to_id_no_fade("a_"+app_id,app_id);var newBorder=document.createElement('div');newBorder.id='scroll_highlight_border';newBorder.className="temp_box_highlight_outline";var box=$('box_head_'+app_id).parentNode;newBorder.style.top=elementY(ge('box_head_'+app_id))-10+'px';newBorder.style.left=elementX(ge('box_head_'+app_id))-10+'px';newBorder.style.width=box.offsetWidth+15+'px';newBorder.style.height=box.offsetHeight+30+'px';var newForm=document.createElement('form');newForm.style.position='relative';newForm.style.textalign='center';newForm.style.top=box.offsetHeight+'px';var keep_app=function(){var data={'profile_fbid':PROFILE_FBID,'app_id':app_id,'add':true};new AsyncRequest().setURI('/ajax/profile_boxes.php').setData(data).setHandler(function(){document.location=callback;}).send();};var _remove_app=function(){_remove_app_box_from_page(app_id);document.location=callback;};var keepButton=document.createElement('input');keepButton.type='button';keepButton.className='inputsubmit';keepButton.value=tx('prf30');keepButton.onclick=keep_app;var remButton=document.createElement('input');remButton.type='button';remButton.className='inputsubmit';remButton.value=tx('sh:remove');remButton.onclick=_remove_app;newForm.appendChild(keepButton);newForm.appendChild(remButton);newBorder.appendChild(newForm);document.body.appendChild(newBorder);}
function _make_header_blue(id){var newBorder=document.createElement('div');newBorder.id='scroll_highlight_border';newBorder.className="box_highlight_outline";var box=$('box_head_'+id).parentNode;newBorder.style.top=elementY(ge('box_head_'+id))-10+'px';newBorder.style.left=elementX(ge('box_head_'+id))-10+'px';newBorder.style.width=box.offsetWidth+15+'px';newBorder.style.height=box.offsetHeight+5+'px';document.body.appendChild(newBorder);var box_header=ge('box_head_'+id);}
function show_wall_tour(){toggle_css_class_name(ge('wall_tour'),'extended');$('wall_tour_link').innerHTML=(shown('wall_tour_extended')?tx('prf23'):tx('prf24'));toggle('wall_tour_extended');}
function write_on_your_own_wall(){toggle_css_class_name(ge('wall_tour'),'borderless_attachment');toggle('inline_wall_post');if(shown('inline_wall_post')){_animate_scroll_to_id('inline_wall_post')}}
var COLS_INDEX=['wide','narrow'];function toggle_profile_apps_link(force_more,force_less){for(var i=0;i<COLS_INDEX.length;i++){var toggle_boxes_link=ge('toggle_boxes_link_content_'+COLS_INDEX[i]);if(!force_less&&(toggle_boxes_link.className=='see_more_arrow'||force_more)){ProfileHiddenBoxes.singleton.ensureHiddenContents(null);toggle_boxes_link.className='see_less_arrow';toggle_boxes_link.innerHTML=tx('prf02');var hidden_portion=ge('hidden_apps_'+COLS_INDEX[i]);if(hidden_portion.childNodes.length){hidden_portion.style.display='block';if(PROFILE_FBID==PROFILE_OWNER_ID){show('more_apps_divider_'+COLS_INDEX[i]);}}}else{toggle_boxes_link.className='see_more_arrow';toggle_boxes_link.innerHTML=tx('prf01');hide('hidden_apps_narrow');hide('hidden_apps_wide');hide('more_apps_divider_'+COLS_INDEX[i]);}}}
function remove_profile_app_rooster(rooster_obj,moved_boxes){if(!rooster_obj){rooster_obj=ge('profile_rooster_notice');}
if(rooster_obj){if(moved_boxes){rooster_obj.className='profile_top_status';rooster_obj.innerHTML='<h2>'+tx('prf28')+'</h2><br>'+tx('prf29',{'edit_extended_profile_link':'<a href="#" onclick="edit_profile_expand_section_dialog(); return false">'+
tx('prf25')+'</a>'});}else{hide(rooster_obj);}}
save_box_orders();return false;}
function move_to_hidden(options_obj){function _move_app_to_more_section(app,col_str){var section=ge('hidden_apps_'+col_str);if(section.childNodes.length>0){section.insertBefore(app,section.firstChild);}else{section.appendChild(app);}}
function _move_app_to_display_section(app,col_str){var section=ge('moveable_'+col_str);section.appendChild(app);}
var i;var boxes_to_hide=[];var boxes_to_show=[];for(i=0;i<options_obj.childNodes.length;i++){var child_option=options_obj.childNodes[i];var inputs=child_option.getElementsByTagName('input');var j;for(j=0;j<inputs.length;j++){if(inputs[j].checked){boxes_to_hide.push(inputs[j].value);}else{boxes_to_show.push(inputs[j].value);}}}
var more_apps=Array();if(boxes_to_hide.length>0){for(j=boxes_to_hide.length-1;j>=0;j--){var app=ge('box_app_'+boxes_to_hide[j]);if(app.parentNode.id.indexOf('moveable')!=-1){var col=app.parentNode.id.replace('moveable_','');more_apps[col]=true;_move_app_to_more_section(app,col);}}}else{more_apps={'wide':false,'narrow':false};}
if(boxes_to_show.length>0){for(j=boxes_to_show.length-1;j>=0;j--){var app=ge('box_app_'+boxes_to_show[j]);if(app.parentNode.id.indexOf('hidden_apps_')!=-1){var col=app.parentNode.id.replace('hidden_apps_','');_move_app_to_display_section(app,col);}}}
for(col in more_apps){if(more_apps[col]==true){show('toggle_profile_apps_link_'+col);}else{hide('toggle_profile_apps_link_'+col);}}
save_box_orders();return false;}
var MAX_APPS_PER_COL=5;var SPECIAL_APPS={2719290516:1,2297529396:1,2327158227:1};function edit_profile_expand_section_dialog(){ProfileHiddenBoxes.singleton.ensureHiddenContents(function(){var dialog=new pop_dialog('app_expander_dialog');var options={'display':Array(),'hidden':Array()};var sections=[ge('moveable_wide'),ge('moveable_narrow'),ge('hidden_apps_wide'),ge('hidden_apps_narrow')];var section,list,app_id,i,j;var count_apps=0;for(i=0;i<sections.length;i++){section=sections[i];for(j=0;j<section.childNodes.length;j++){app_id=section.childNodes[j].id.replace('box_app_','');if(SPECIAL_APPS[app_id])continue;if(section.id.indexOf('moveable_')==0){options['display'][app_id]=$('title_app_'+app_id).innerHTML;}else{options['hidden'][app_id]=$('title_app_'+app_id).innerHTML;}}
count_apps+=j;}
var cols=1;if(count_apps>=MAX_APPS_PER_COL&&count_apps<=MAX_APPS_PER_COL*2){cols=2;}else if(count_apps>MAX_APPS_PER_COL*2){cols=3;}
var per_col=count_apps/cols;var edit_profile_expander=tx('prf27',{'count':count_apps})+'<br/><br/>';edit_profile_expander+='<div class="collapse_options clearfix" id="hide_expand_app_list">';edit_profile_expander+='<div class="column_'+cols+'">';j=0;for(option_type in options){var checked='';if(option_type=='hidden')checked=' checked="true"';for(app_id in options[option_type]){if(j>=per_col){edit_profile_expander+='</div><div class="column_'+cols+'">';j=0;}
if(parseInt(app_id)){edit_profile_expander+='<input type="checkbox" id="checkbox_app_id_'+app_id+'" class="inputcheckbox" value="'+app_id+'"'+checked+'/>'+'<label for="checkbox_app_id_'+app_id+'">'+options[option_type][app_id]+'</label><br/>';j++;}}}
edit_profile_expander+='</div></div>';dialog.show_choice(tx('prf25'),edit_profile_expander,tx('prf26'),function(){move_to_hidden(ge('hide_expand_app_list'));dialog.fade_out(100);},tx('sh:cancel-button'),function(){dialog.fade_out(100);});});}
function ProfileHiddenBoxes(){}
ProfileHiddenBoxes.prototype={ensureHiddenContents:function(onCompletedCallback){if(this.delayedBoxes&&!this.areContentFetched){var boxesToFetch=[];for(var i=0;i<this.delayedBoxes.length;i++){var delayed_box=this.delayedBoxes[i];if(delayed_box.section_html===undefined){boxesToFetch.push(delayed_box);}
else{var hidden_box_id='hidden_box_'+delayed_box.app_id;var hidden_box=ge(hidden_box_id);if(hidden_box){delayed_box.section_html=hidden_box.innerHTML;}}}
var hidden_box_container=ge('profile_hidden_htmls');if(hidden_box_container){hidden_box_container.parentNode.removeChild(hidden_box_container);}
if(boxesToFetch.length>0){var request=new AsyncRequest()
request.setURI('/ajax/profile_boxes_fetch.php');request.setData({owner_id:PROFILE_OWNER_ID,profile_boxes:JSON.encode(boxesToFetch)});request.setHandler(bind(this,function(asyncResponse){var payload=asyncResponse.payload;var style=payload.style;if(style){var style_container=ge('style_container_for_hidden_boxes');style_container.innerHTML='<span style="display:none">&nbsp</span><style>'+style+'</style>';}
var htmls=payload.htmls;var length=this.delayedBoxes.length;for(var i=0;i<length;i++){var delayedBox=this.delayedBoxes[i];var appId=delayedBox.app_id;var section_html=htmls[appId];if(section_html!==undefined){delayedBox.section_html=section_html;}}
this.render(onCompletedCallback);}));request.setErrorHandler(bind(this,'onError'))
request.send();}
else{this.render(onCompletedCallback);}
this.areContentFetched=true;}
else{if(onCompletedCallback){onCompletedCallback();}}},onError:function(){Util.error('Sorry, profile box could not be loaded at this time. Please refresh');},render:function(onCompletedCallback){var length=this.delayedBoxes.length;var narrow_html='';var wide_html='';for(var i=0;i<length;i++){var delayedBox=this.delayedBoxes[i];if(delayedBox.section_html){if(delayedBox.profile_box_column==1){narrow_html+=delayedBox.section_html;}else{wide_html+=delayedBox.section_html;}}}
var hidden_apps_narrow=ge('hidden_apps_narrow');if(hidden_apps_narrow){set_inner_html(hidden_apps_narrow,narrow_html);}
var hidden_apps_wide=ge('hidden_apps_wide');if(hidden_apps_wide){set_inner_html(hidden_apps_wide,wide_html);}
var profile_loading_narrow=ge('profile_loading_narrow');if(profile_loading_narrow){profile_loading_narrow.parentNode.removeChild(profile_loading_narrow);}
var profile_loading_wide=ge('profile_loading_wide');if(profile_loading_wide){profile_loading_wide.parentNode.removeChild(profile_loading_wide);}
if(onCompletedCallback){window.setTimeout(function(){onCompletedCallback();},0);}},init:function(delayedBoxes){this.delayedBoxes=delayedBoxes;},areContentFetched:false,delayedBoxes:null}
ProfileHiddenBoxes.singleton=new ProfileHiddenBoxes();function NetworksController(element,id){element.onresponse=function(response){var data=response.getPayload().data;set_inner_html($("nwf_full"),data);}
element.onclick=function(){hide($("nwf_short"));show($("nwf_full"));new AsyncRequest().setURI('/ajax/profile_networks.php').setReadOnly(true).setData({profile_id:id}).setHandler(element.onresponse.bind(element)).send();return false;}}
function profile_log_friend_click(friend_ids,position){new AsyncSignal('/ajax/log_friends.php',{'friend_ids':friend_ids,'position':position}).send();return true;}
function profile_pic_cam_dialog(){var async=new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/camera/dialog.php?profile&ref=profile_no_photo');new Dialog().setAsync(async).setClassName('camera').setModal().show();}
if(window.Bootloader){Bootloader.done(1);}