/*
HTTP Host: static.ak.fbcdn.net
Generated: March 22nd 2010 6:35:11 AM PDT
Machine: 10.16.140.109
Locale: nu_ll
Path: js/profile/boxes.js
*/

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/profile\/boxes.js"]); }


function newBoxAdded(profile_id,app_id,tab_id,elem_prefix){if(!ge(elem_prefix+app_id)){return;}
var app_box=$(elem_prefix+app_id);var border=document.createElement('div');var border_frame='<div class="popcontent_advanced border_frame">'+'<div class="pop_content popcontent_old" id="pop_content"></div>'+'<div class="dialog_buttons">'+'<input type="submit" class="inputsubmit inputbutton" value="Keep"/>'+'<input type="submit" class="inputaux inputbutton" value="Remove">'+'</div></div>';set_inner_html(border,border_frame);border.getElementsByTagName('input')[0].onclick=function(){animation(app_box.previousSibling).to('opacity',0).duration(200).hide().go();return false;}
border.getElementsByTagName('input')[1].onclick=function(){removeAppBox(profile_id,app_id,tab_id,elem_prefix);DOM.remove(app_box.previousSibling);}
CSS.addClass(border,'add_new_box_border');border.childNodes[0].style.width=app_box.offsetWidth+20+'px';border.childNodes[0].style.position='absolute';border.childNodes[0].childNodes[0].style.height=app_box.offsetHeight+9+'px';app_box.parentNode.insertBefore(border,app_box);animation(DOMScroll.getScrollRoot()).to('scrollTop',elementY(app_box)-40).ease(animation.ease.end).duration(800).go();}
function removeAppBox(profile_id,app_id,tab_id,elem_prefix){if(!ge(elem_prefix+app_id)){return false;}
new AsyncRequest().setURI('/ajax/profile/box.php').setData({profile_id:profile_id,app_id:app_id,action:'remove',tab_id:tab_id}).send();var app_box=$(elem_prefix+app_id);animation(app_box).to('opacity',0).duration(200).hide().ondone(DOM.remove.bind(null,elem_prefix+app_id)).go();return false;}
function moveToTab(profile_id,app_id,from_tab,to_tab,to_tab_name,next_uri){new AsyncRequest().setURI('/ajax/profile/box.php').setData({to_tab:to_tab,profile_id:profile_id,app_id:app_id,action:'move_to_tab',from_tab:from_tab}).setHandler(function(resp){tab_controller.dirtyCachedView(to_tab_name);if(to_tab_name=='feed'||to_tab_name=='wall'){tab_controller.dirtyCachedView('box_3');}
DOM.remove('box_app_'+app_id);goURI(next_uri);DOMScroll.scrollTo(new Vector2(0,0,'document'),false);}).send();return false;}

if (window.Bootloader) { Bootloader.done(["js\/profile\/boxes.js"]); }