
var REMOVE_BOX_ONLY=1;var REMOVE_ENTIRE_APP=2;var al_dialog;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="Remove Link" />'+'<input class="inputsubmit" type="button" value="Remove Application" />'+'<input class="inputsubmit" type="button" value="Cancel" />'+'</div>';var prompt='You can remove this link or remove this application from your account.';add_css_class_name(obj,'box_remove_selected');dialog.show_prompt('Do you want to remove this link from '+application_name+'?',prompt+buttons);al_dialog=true;dialog_options=dialog.obj.getElementsByTagName('input');dialog_options[0].onclick=function(){remove_link(obj.parentNode,app_id);dialog.hide();}
dialog_options[1].onclick=function(){remove_link_and_app(obj.parentNode,app_id);dialog.hide();}
dialog_options[2].onclick=function(){dialog.hide();remove_css_class_name(obj,'box_remove_selected');al_dialog=false;}
return false;}
function remove_link_and_app(link_obj,app_id){link_obj.style.display='none';var profile_box=ge('box_app_'+app_id);if(profile_box){profile_box.style.display='none';ge('icon_app'+app_id).style.display='none';}
var error_message='Sorry, removing this application failed.';var ajax=new Ajax(function(obj,text){eval(text);if(!success){Util.error('Removing app_id %d failed.',app_id);aiert(error_message);}});ajax.onFail=function(){Util.error('Removing app_id %d failed.',app_id);aiert(error_message);}
var post={'app_id':app_id};ajax.post('/ajax/profile_link.php',post,true);post={'profile_fbid':PROFILE_FBID,'app_id':app_id,'remove_type':REMOVE_ENTIRE_APP,'ref':'pra'};ajax.post('/ajax/profile_boxes.php',post,true);}
function remove_link(link_obj,app_id){link_obj.style.display='none';var error_message='Sorry, removing this link failed.';var ajax=new Ajax(function(obj,text){eval(text);if(!success){Util.error('Removing link to app_id %d failed.',app_id);aiert(error_message);}});ajax.onFail=function(){Util.error('Removing link to app_id %d failed.',app_id);aiert(error_message);}
var post={'app_id':app_id};ajax.post('/ajax/profile_link.php',post);}
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="Remove Application" />'+'<input class="inputsubmit" type="button" value="Remove Box" />'+'<input class="inputsubmit" type="button" value="Cancel" />'+'</div>';dialog.show_prompt('Do you want to remove '+application_name+'?',dialog.content_to_markup(get_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);dialog.hide();}
dialog_options[1].onclick=function(){remove_app('',REMOVE_BOX_ONLY,app_id);dialog.hide();}
dialog_options[2].onclick=function(){dialog.hide();remove_css_class_name(obj,'box_remove_selected');}
return false;}
function get_remove_prompt(application_name,app_id){return'You can remove this application box from your profile or remove this application from your account entirely.';}
function remove_app(e,remove_type,app_id){ge('box_app_'+app_id).style.display='none';ge('icon_app'+app_id).style.display='none';var error_message='Sorry, removing this profile box failed.';var ajax=new Ajax(function(obj,text){eval(text);if(!success){Util.error('Removing app_id %d failed.',app_id);aiert(error_message);}});ajax.onFail=function(){Util.error('Removing app_id %d failed.',app_id);aiert(error_message);}
var post={'profile_fbid':PROFILE_FBID,'app_id':app_id,'remove_type':remove_type,'ref':'prb'};ajax.post('/ajax/profile_boxes.php',post);}
function flexToggle(el){if(el.className=='flex_open'){el.className='flex_shut';profileFlexAjax(el.id,1);}else{el.className='flex_open';profileFlexAjax(el.id,0);}}
var all_boxes_open=true;function allBoxesFlexToggle(){all_boxes_open=!all_boxes_open;var text_el=ge('profile_view_button_text');var userprofile=ge('userprofile');if(all_boxes_open){text_el.innerHTML='Minimize Profile';remove_css_class_name(userprofile,'collapsed_mode');}else{text_el.innerHTML='Expand Profile';add_css_class_name(userprofile,'collapsed_mode');}
return false;}
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 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;}
profileFlexAjax=function(elId,val){var ajax=new Ajax()
ajax.onDone=function(){}
ajax.onFail=function(){}
ajax.post('/ajax/profile_flex_ajax.php',elId+'='+val);}
profileBoxFlexAjax=function(elId,val){var ajax=new Ajax()
ajax.onDone=function(){}
ajax.onFail=function(){}
ajax.post('/ajax/profile_box_flex_ajax.php',{'app_id':elId,'value':val});}
function minifeed_hide(clickedElement,story_id,who)
{var minifeed_dialog_handle=new contextual_dialog();minifeed_dialog_handle.set_context(clickedElement);minifeed_dialog_handle.show_choice('Are you sure you want to hide this mini-feed story?','Hiding will remove the story from '+who+' Mini-Feed and prevent anyone from seeing it.','Hide Story','','Cancel','');var minifeed_inputs=minifeed_dialog_handle.obj.getElementsByTagName('input');minifeed_inputs[0].onclick=function(){minifeed_hide_click(story_id);generic_dialog.get_dialog(this).fade_out(100);};minifeed_inputs[1].onclick=function(){generic_dialog.get_dialog(this).hide();};return false;}
function minifeed_hide_click(hide_id)
{ajax=new Ajax();ajax.onDone=function(){}
ajax.onFail=function(){aiert("Sorry, hiding this story failed");}
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();ajax.post('/minifeed.php',{'hide_ministory_key':hide_id,'profile_fbid':PROFILE_FBID});}
function minifeed_decrement_story_count(){var text;var mf_story_count_string_array=new Array();var count_el=ge('mf_story_count_string');if(!count_el)return;var count=parseInt(count_el.innerHTML.split(' ')[0]);count=count-1;if(count==1){text='story';}else{text='stories';}
count_el.innerHTML=(count)+' '+text;}
function show_profile_layout_dialog(){var dialog=new pop_dialog();dialog.show_message('Profile Layout','You can edit the layout of your profile at any time. Simply use your mouse to drag and drop boxes anywhere on your profile.'
+'<br/><br/>'
+'Please note that you cannot move your Mini-Feed or Friends box. Also, some boxes may be restricted to either the right or left column of the profile.');}
function show_public_profile_dialog(url){var dialog=new pop_dialog();dialog.show_message('Public Listing','Your public listing contains some information about you that may be viewed by people outside of Facebook.'
+'<br/><br/>'
+'If you allow people to view your public listing, people not logged in to Facebook can view it at this URL:'
+'<br/><br/>'
+'<span style="color: #3b5998; border: 1px solid #ccc; padding: 5px; margin: 5px;">'
+url
+'</span>'
+'<br/><br/>'
+'You can control who can see your public listing on your '
+'<a href="/privacy.php?view=search">search privacy</a> page.');}
function is_left_click(e){if(e.which==null){if(e.button<2)return true;}else{if(e.which<2)return true;}
return false;}
function isMouseLeaveOrEnter(e,handler){if(e.type!='mouseout'&&e.type!='mouseover')return false;var reltg=e.relatedTarget?e.relatedTarget:e.type=='mouseout'?e.toElement:e.fromElement;while(reltg&&reltg!=handler)
reltg=reltg.parentNode;return(reltg!=handler);}
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 profile_app_switcher_select(scroll_element_id,app_id){boxFlexSet(ge('box_head_'+app_id).parentNode,1);make_header_blue(app_id);animate_scroll_to_id(scroll_element_id,app_id);return false;}
var ANI_SCROLL_STEP_AMOUNT=150;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>getPageScrollHeight()&&target_bottom<getPageScrollHeight()+getViewportHeight()){setTimeout("fade_header("+app_id+")",ANI_CALLBACK_PAUSE_TIME+400);}else{animate_scroll_to_id_helper(scroll_element_id,20,app_id,getPageScrollHeight(),'fade_header');}}
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=getPageScrollHeight();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=getPageScrollHeight()+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){ge('wall_text').focus();}}
function make_header_blue(id){var newBorder=document.createElement('div');newBorder.id='scroll_highlight_border';newBorder.className="box_highlight_outline";var box=ge('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 position_edit_profile_tour(){var body=document.getElementsByTagName("body")[0];var container=document.createElement('span');container.style.fontFamily='"Lucida Grande", Tahoma, Verdana, Arial, sans-serif;';container.innerHTML='Profile';body.appendChild(container);var additionalOffset=container.offsetWidth;body.removeChild(container);var defaultOffset=12;ge('edit_profile_tour').style.marginLeft=(defaultOffset+additionalOffset)+'px';}
function show_tour(tour_div){hide((tour_div=='search_tour')?'edit_profile_tour':'search_tour');var default_offset_search_tour=25;var default_offset_edit_profile_tour=8;var edit_profile_tour=ge('edit_profile_tour');var search_tour=ge('search_tour');if(search_tour){search_tour.style.top=elementY(ge('qsearch'))+default_offset_search_tour+'px';}
if(edit_profile_tour){edit_profile_tour.style.top=elementY(ge('navigator'))+default_offset_edit_profile_tour+'px';}
if(!shown(tour_div)){animate_scroll_to_id('book');}
setTimeout("show('"+tour_div+"')",2000);animation(ge(tour_div)).duration(7000).checkpoint().to('opacity',0).hide().go();}
function show_wall_tour(){toggle_css_class_name(ge('wall_tour'),'extended');ge('wall_tour_link').innerHTML=(shown('wall_tour_extended')?'Learn more about the Wall':'Here is what a Wall post looks like:');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')}}
function profile_log_friend_click(friend_ids,position){var ajax=new Ajax();var params={'friend_ids':friend_ids,'position':position};ajax.get('ajax/log_friends.php',params,true);return true;}