/*    HTTP Host:  b.static.ak.fbcdn.net                                        */
/*    Generated:  July 20th 2009 8:09:19 AM PDT                                */
/*      Machine:  10.16.140.103                                                */
/*       Source:  Global Cache                                                 */
/*     Location:  js/2cc9kqc9lgpwocss.pkg.js h:6mhd09ca                        */
/*       Locale:  en_US                                                        */
/*         Path:  js/2cc9kqc9lgpwocss.pkg.js                                   */


function ads_fetch_admarket_ad(page,location,adnetwork_id,handler,error_handler){var data={'page':page,'location':location,'adnetwork_id':adnetwork_id};var r=new AsyncRequest().setURI(muffinize('/muffins/ajax/fetch_admarket_muffin.php')).setData(data).setHandler(handler).setErrorHandler(error_handler).send();}

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='<table class="pop_dialog_table add_new_box_table">'+'<tr><td class="pop_topleft" /><td class="pop_top"/><td class="pop_topright"/></tr>'+'<tr><td class="pop_side"/ rowspan=2><td class="pop_content"/>'+'<td class="pop_side"/ rowspan=2></tr>'+'<tr><td class="dialog_buttons"></tr>'+'<tr><td class="pop_bottomleft" /><td class="pop_bottom"/><td class="pop_bottomright"/></tr></table>';set_inner_html(border,border_frame);var buttons='<div class="dialog_buttons"><input type="submit" class="inputsubmit inputbutton" value="Keep"/>'+'<input type="submit" class="inputaux inputbutton" value="Remove"></div>';set_inner_html(border.childNodes[0].childNodes[0].childNodes[2].childNodes[0],buttons);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+40+'px';border.childNodes[0].style.position='absolute';border.childNodes[0].childNodes[0].childNodes[1].childNodes[1].style.height=app_box.offsetHeight+10+'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;}
function profileShowExtendedNetworks(id){hide($('nwf_short'));show($('nwf_full'));new AsyncRequest().setURI('/ajax/profile_networks.php').setReadOnly(true).setData({profile_id:id}).setHandler(function(response){set_inner_html($("nwf_full"),response.getPayload().data);}).send();return false;}
function profile_show_all_profile_actions(wrapper_class,individual_class){var wrapper_div=DOM.find($('left_column'),'div.'+wrapper_class);var actions=DOM.scry(wrapper_div,'a.'+individual_class);for(var i=0;i<actions.length;i++){CSS.removeClass(actions[i],'hidden_elem');}
CSS.addClass(DOM.find(wrapper_div,'a.profile_actions_more_arrow'),'hidden_elem');CSS.removeClass(DOM.find(wrapper_div,'a.profile_actions_less_arrow'),'hidden_elem');return false;}
function profile_hide_extra_profile_actions(wrapper_class){var wrapper_div=DOM.find($('left_column'),'div.'+wrapper_class);var hidden_actions=DOM.scry(wrapper_div,'a.hidden_action');for(var i=0;i<hidden_actions.length;i++){CSS.addClass(hidden_actions[i],'hidden_elem');}
CSS.removeClass(DOM.find(wrapper_div,'a.profile_actions_more_arrow'),'hidden_elem');CSS.addClass(DOM.find(wrapper_div,'a.profile_actions_less_arrow'),'hidden_elem');return false;}

function ProfileTabController(id,viewer,can_edit,top_bar,root,canvas,selected_tab,tab_more_id,tab_add_id,ajax_tab_load,is_impersonated,ads_wanted,non_sortable_tabs,composer_tab){this.tabs={};this.addTabLink=null;this.moreLink=null;this.topBar=top_bar;this.numTabs=0;addEventBase($('top_bar_pic'),'click',function(controller,event){controller.onselect('wall')
return Event.kill(event);}.bind(null,this));var tab_li=root.getElementsByTagName('li');for(var i=0;i<tab_li.length;i++){var attr=tab_li[i].getAttributeNode('view');if(attr?attr.specified:false){var view=tab_li[i].getAttribute('view');if(CSS.hasClass(tab_li[i],'selected')){this.currentView=view;}
this._hookUpTab(tab_li[i],view);this.tabs[view]=tab_li[i];var app_link=tab_li[i].getElementsByTagName('a')[0];$(app_link).listen('click',function(event){if(this.activeDrag){return event.kill();}});if(tab_li[i].getElementsByTagName('a').length>1){var edit_link=tab_li[i].getElementsByTagName('a')[1];this._hookUpEdit(edit_link,view,app_link.innerHTML);}
this.numTabs++;}}
if(ge(tab_more_id)){this.tab_more=$(tab_more_id);this.moreDropMenu=dropmenu(this.tab_more.childNodes[0]).registerHTMLMenu('menu_tab_more').setPosition(dropmenu.ALIGN_LEFT).addHook('show',function(){CSS.addClass(this.tab_more,'selected_tab_more');}.bind(this)).addHook('hide',function(){CSS.removeClass(this.tab_more,'selected_tab_more');}.bind(this));}
if(ge(tab_add_id)){this.add_tab=$(tab_add_id);this.addMenu=flyout_menu(this.add_tab.childNodes[0]).registerHTMLMenu('flyout_menu_profile_add_tab').setMenuClickArea(DOM.find($('profile_tab_add'),'div.add_tab_app_typeahead')).setPosition(dropmenu.ALIGN_LEFT).addHook('show',function(){CSS.addClass(this.add_tab,'selected_menu_icon');}.bind(this)).addHook('hide',function(){CSS.removeClass(this.add_tab,'selected_menu_icon');}.bind(this));}
this.id=id;this.viewer=viewer;this.is_impersonated=is_impersonated;this.can_edit=can_edit;this.root=root;this.canvas=canvas;this.leftColumn=canvas.firstChild;this.href='';this.cachedTabs={};this.ads_wanted=ads_wanted;this.rightColumn=$('tab_canvas');if(!ajax_tab_load){this.cachedTabs[selected_tab]=this.rightColumn.childNodes[0];}else{onloadRegister(this.selectView.bind(this,selected_tab));}
this.nonSortables=non_sortable_tabs;this.maxSortableTabs=ProfileTabController.MAX_TABS-this.nonSortables.length;this.composerTab=composer_tab;if(can_edit){this.sortableMainRoot=$('profile_tabs');this.sortableMoreRoot=this.tab_more&&this.tab_more.getElementsByTagName('ul')[0];this.sortableMain=new SortableGroup();if(this.sortableMore=this.sortableMoreRoot&&new SortableGroup()){this.sortableMain.link(this.sortableMore);}
this.sortableMain.setLinkJumpHandler(this.onSortableLinkJump.bind(this));for(view in this.tabs){var tab=this.tabs[view];if(!this.nonSortables.contains(tab.getAttribute('view'))){(tab.parentNode==this.sortableMainRoot?this.sortableMain:this.sortableMore).addSortable(view,tab,tab.getElementsByTagName('a')[0]);}}
this.sortableMain.setOrderChangeHandler(this.saveTabOrder.bind(this));this.sortableMore.setOrderChangeHandler(this.saveTabOrder.bind(this));}
PageTransitions.registerHandler(bind(this,'handleNavigation',selected_tab));tab_controller=this;}
ProfileTabController.MAX_TABS=6;ProfileTabController.viewasTabs=['photos','info','posts','wall'];ProfileTabController.twoColumnViews={'posts':true,'info':true,'wall':true};ProfileTabController.facebookTabs=['wall','posts','info','photos','box_3','app_2347471856','app_2392950137','app_2344061033','app_2373072738','app_6261817190'];ProfileTabController.prototype.getLastDisplayedView=function(){var order=this.sortableMain.getOrder();if(!order.length){return null;}
return order[order.length-1];}
ProfileTabController.prototype.getFirstOverflowView=function(){var order=this.sortableMore.getOrder();if(!order.length){return null;}
return order[0];}
ProfileTabController.prototype.onSortableLinkJump=function(key){var order=this.sortableMain.getOrder(),migrateKey=null;if(order.length>this.maxSortableTabs){for(var i=order.length-1;i>=0;i--){if(order[i]!=key&&order[i]!=this.currentView){migrateKey=order[i];break;}}
this.sortableMoreRoot.insertBefore(this.tabs[migrateKey],this.sortableMoreRoot.firstChild);this.sortableMore.migrateLinkedSortable(migrateKey);}else if(order.length<this.maxSortableTabs){order=this.sortableMore.getOrder();for(var i=0;i<order.length;i++){if(order[i]!=key){migrateKey=order[i];break;}}
this.sortableMainRoot.insertBefore(this.tabs[migrateKey],this.tab_more);this.sortableMain.migrateLinkedSortable(migrateKey);}
if(this.moreDropMenu){this.moreDropMenu._positionMenu();}}
ProfileTabController.prototype._hookUpTab=function(tab,view,addNewTab){var sortable=null;if(this.numTabs>=ProfileTabController.MAX_TABS){if(addNewTab){var menu=$('tabs_more_menu').firstChild;menu.appendChild(tab);this.numTabs++;CSS.removeClass(this.tab_more,'hidden_elem');sortable=this.sortableMore;}}else{if(addNewTab){if(this.tab_more){this.root.insertBefore(tab,this.tab_more);}else{this.root.insertBefore(tab,this.add_tab);}
this.numTabs++;sortable=this.sortableMain;}}
if(sortable){sortable.addSortable(view,tab,tab.getElementsByTagName('a')[0]);}}
ProfileTabController.prototype.onselect=function(view){if(this.currentView==view||this.waitingForAjax){return;}
goURI(URI.getRequestURI().addQueryData({v:view}));}
ProfileTabController.prototype._hookUpEdit=function(target,tab_name,app_name){var menu_content=document.createElement('div');var delete_link=document.createElement('a');delete_link.innerHTML=_tx("Delete Tab");delete_link.setAttribute('href','#');delete_link.onclick=this.deleteTab.bind(this,tab_name);menu_content.appendChild(delete_link);flyout_menu(target).setMarkupContent('edit_menu_'+tab_name,'link_menu flyout_menu_18',_tx("Tab Options"),menu_content).addHook('show',function(){CSS.addClass(target,'selected');}.bind(this)).addHook('hide',function(){CSS.removeClass(target,'selected');}.bind(this));return false;}
ProfileTabController.prototype.handleNavigation=function(default_tab,uri){var query=uri.getQueryData();var requested_viewer=query.viewas||this.viewer;var ondone=function(cached){if(this.ads_wanted&&parseInt(this.viewer)>0){ads_refresh(this.currentView,new URI(uri).getPath(),false,false,false,cached);}
PageTransitions.transitionComplete();}.bind(this);if(query.app_page){this.selectPage(query.fbhref,ondone);return true;}
if(query.story_fbid){return false;}
if(!(ProfileURIController.isDestinationURIProfilePage(uri)&&requested_viewer==this.viewer)){return false;}
if(!query.v&&this.currentView==default_tab){return false;}
if(window.ProfilePhotosTabController){var result=ProfilePhotosTabController.transitionHandler(this.currentView,uri,default_tab);if(result!==null){return result;}}
var okay_params={'v':1,'id':1,'viewas':1,'ref':1};for(var param in query){if(!okay_params[param]){return false;}}
if(this.currentView!=query.v&&!this.can_edit){search_log_2nd_action('Select tab:'+query.v);}
this.selectView(query.v||default_tab,ondone);return true;}
ProfileTabController.prototype.selectView=function(view,ondone){if(this.addMenu){this.addMenu.hide();}
if(this.is_impersonated&&!ProfileTabController.viewasTabs.contains(view)){var uri=URI.getRequestURI().addQueryData({'v':view});if(this.viewer){uri.addQueryData({'viewas':this.id});}
uri.go();return false;}
if(!this.tabs[view]){new URI('/profile.php').addQueryData({'v':view}).go();return false;}
this.selectTab(view);if(!ProfileTabController.twoColumnViews[view]&&ProfileTabController.twoColumnViews[this.currentView]){CSS.removeClass(document.body,'profile_two_columns');CSS.removeClass(document.body,'flipped_profile_two_columns');}else if(ProfileTabController.twoColumnViews[view]&&!ProfileTabController.twoColumnViews[this.currentView]){CSS.addClass(document.body,'profile_two_columns');if(CSS.hasClass(document.body,'flipped_profile')){CSS.addClass(document.body,'flipped_profile_two_columns');}}
this.changePage(view,'',ondone);}
ProfileTabController.prototype.selectTab=function(view){if(intl_locale_is_rtl()){var padding_dir='padding-left';}else{var padding_dir='padding-right';}
for(var i in this.tabs){if(i==view){if(this.sortableMore&&this.sortableMore.getOrder().contains(view)){var lastDisplayedView=this.getLastDisplayedView();var lastDisplayedTab=this.tabs[lastDisplayedView];var firstOverflowView=this.getFirstOverflowView();var firstOverflowTab=this.tabs[firstOverflowView];var newLastTab=lastDisplayedTab.previousSibling;DOM.insertBefore(lastDisplayedTab,firstOverflowTab);DOM.insertAfter(newLastTab,this.tabs[i]);this.sortableMore.migrateLinkedSortable(lastDisplayedView);this.sortableMain.migrateLinkedSortable(view);}
if(this.tabs[i].childNodes[1]){animation(this.tabs[i].childNodes[0]).from(padding_dir,'11px').to(padding_dir,'25px').duration(100).go();animation(this.tabs[i].childNodes[1]).from('width','0').to('width','19px').duration(100).go();}
CSS.addClass(this.tabs[i],'selected');}else if(CSS.hasClass(this.tabs[i],'selected')){CSS.removeClass(this.tabs[i],'selected');if(this.tabs[i].childNodes[1]){animation(this.tabs[i].childNodes[0]).from(padding_dir,'25px').to(padding_dir,'11px').duration(100).go();}}}}
ProfileTabController.prototype.selectPage=function(href,ondone){this.changePage(this.currentView,href,ondone);}
ProfileTabController.prototype.setTabContent=function(name,html,js){this.cachedTabs[name]=HTML(html).setAction(js);}
ProfileTabController.prototype.fetchPage=function(view,href,handler,lastView,ondone){lastView=lastView||'';subdomain=ProfileTabController.facebookTabs.contains(view)?'www':'apps';var viewData={id:this.id,v:view,href:href,iframe:true};if(this.is_impersonated&&this.viewer){viewData['viewas']=this.viewer;}
new AsyncRequest().setOption('useIframeTransport',true).setReadOnly(true).setMethod('GET').setURI(new URI('/ajax/profile/tab.php').setSubdomain(subdomain)).setData(viewData).setContextData('src_tab_name',lastView).setContextData('dst_tab_name',view).setContextData('nectar_isaction',true).setHandler(function(response){var payload=response.getPayload();if(payload.redirect){goURI(payload.redirect);}else{var should_cache=!href;handler(HTML(payload.tab_content),view,should_cache,payload.additional_content);}}.bind(this)).setFinallyHandler(function(response){this.waitingForAjax=false;ondone&&ondone(0);}.bind(this)).send();this.waitingForAjax=true;}
ProfileTabController.prototype.changePage=function(view,href,ondone){var target=this.rightColumn;while(this.rightColumn.childNodes.length){this.rightColumn.removeChild(this.rightColumn.childNodes[0]);}
CSS.addClass(this.rightColumn,'loading');var lastView=this.currentView;this.currentView=view;this.href=href;var loadTab=function(node,view,should_cache,additional_content){if(additional_content){for(var i=0;i<additional_content.length;++i){var content=additional_content[i];DOM.setContent($(content.div_id),HTML(content.html));}}
CSS.removeClass(target,'loading');var was_node;if(node instanceof HTML){var d=$N('div');target.appendChild(d);DOM.setContent(d,node);if(should_cache){this.cachedTabs[view]=d;}
was_node=false;}else{target.appendChild(node);was_node=true;}}.bind(this);if(this.cachedTabs[view]&&!href&&(lastView!=view)){loadTab(this.cachedTabs[view],view,true);ondone&&ondone(1);}else{this.fetchPage(view,href,loadTab,lastView,ondone);}}
ProfileTabController.prototype.dirtyCachedView=function(view){if(this.cachedTabs[view]){delete this.cachedTabs[view];}}
ProfileTabController.prototype.addNewTab=function(target,app_id,tab_name,new_box_tab){if(this.addMenu){this.addMenu.hide();}
var new_tab=document.createElement('li');var new_link=document.createElement('a');CSS.setClass(new_link,'tab_link');new_link.innerHTML=tab_name;var new_edit=document.createElement('a');CSS.setClass(new_edit,'edit');new_tab.appendChild(new_link);new_tab.appendChild(new_edit);if(new_box_tab){new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'add_app_tab'}).setHandler(function(response){var view='box_'+response.payload.tab_id;new_tab.setAttribute('view',view);this._hookUpTab(new_tab,view,true);this._hookUpView(new_tab,new_link,new_edit,tab_name,view);if(target){CSS.addClass(target,'hidden_elem');}}.bind(this)).send();}else{var view='app_'+app_id;new_tab.setAttribute('view',view);this._hookUpTab(new_tab,view,true);this._hookUpView(new_tab,new_link,new_edit,tab_name,view);if(target){CSS.addClass(target,'hidden_elem');}
new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'add_tab',tab_id:app_id}).send();}}
ProfileTabController.prototype._hookUpView=function(new_tab,new_link,new_edit,app_name,view){var base_uri=ProfileURIController.getCurrentProfileBaseURI();var query_data={v:view};if(this.is_impersonated&&this.viewer){query_data['viewas']=this.viewer;}
new_link.href=base_uri.addQueryData(query_data).toString();this._hookUpEdit(new_edit,view,app_name);this.tabs[view]=new_tab;this.onselect(view);}
ProfileTabController.prototype.editTabName=function(view,e){var tab_id=view.split('_')[1];var tab=this.tabs[view];tab.style.width=tab.offsetWidth-2+'px';tab.style.height=tab.offsetheight+'px';var cur_width=tab.firstChild.offsetWidth-16;for(var i=0;i<tab.childNodes.length;i++){hide(tab.childNodes[i]);}
var name_form=document.createElement('form');var oldname=DOM.find(tab,'.app_tab_title').innerHTML;name_form.innerHTML='<input type="text" id="tab_name_edit" class="inputtext" style="width:'+cur_width+'px" value="'+oldname+'">';tab.appendChild(name_form);$('tab_name_edit').focus();function clickedOut(e){name_form.onsubmit();}
function clickedIn(e){Event.kill(e);}
name_form.onsubmit=function(){var new_name=name_form.firstChild.value;var title_node=DOM.find(tab,'.app_tab_title');title_node.innerHTML=new_name;tab.removeChild(name_form);for(var i=0;i<tab.childNodes.length;i++){show(tab.childNodes[i]);}
document.body.removeEventListener('click',clickedOut,false);tab.removeEventListener('click',clickedIn,true);new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'rename_tab',tab_id:tab_id,tab_name:new_name}).send();tab.style.width=null;return false;}.bind(this);document.body.addEventListener('click',clickedOut,false);tab.addEventListener('click',clickedIn,true);Event.kill(e);}
ProfileTabController.prototype.deleteTab=function(view){var tab_id;if(view=='photos'){tab_id=2305272732;}else{tab_id=view.split('_')[1];}
new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'delete_tab',tab_id:tab_id}).send();var firstOverflowView=this.getFirstOverflowView();var firstOverflowTab=this.tabs[firstOverflowView];var lastDisplayedView=this.getLastDisplayedView();var lastDisplayedTab=this.tabs[lastDisplayedView];if(firstOverflowView){DOM.insertAfter(lastDisplayedTab,firstOverflowTab);}
this.sortableMain.migrateLinkedSortable(firstOverflowView);this.sortableMain.removeSortable(view);this.root.removeChild(this.tabs[view]);delete this.tabs[view];this.numTabs--;var menu_tab_id=ge('new_tab_'+tab_id);if(menu_tab_id)CSS.removeClass(menu_tab_id,'hidden_elem');var newFirstOverflowView=this.getFirstOverflowView();if(!newFirstOverflowView){CSS.addClass(this.tab_more,'hidden_elem');}
this.onselect('wall');return false;}
ProfileTabController.prototype.saveTabOrder=function(){var order=this.sortableMain.getOrder();if(this.sortableMore){order=order.concat(this.sortableMore.getOrder());}
new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'reorder_tabs',tab_order:order}).send();}
var ProfileURIController={_profileId:0,_profilePage:false,init:function(profile_id){this._profileId=profile_id;this._profileURI=URI.getRequestURI();this._setProfilePage(true);onunloadRegister(this._setProfilePage.bind(this,false));},_setProfilePage:function(profile_page){this._profilePage=profile_page;},isProfilePage:function(){return this._profilePage;},isDestinationURIProfilePage:function(uri){if(!this.isProfilePage()){return false;}
var requested_id=uri.getQueryData().id;if(uri.getPath()=='/profile.php'){return requested_id==this._profileId;}
return this._profileURI.getPath()==uri.getPath();},getCurrentProfileBaseURI:function(){var most_recent_uri=URI.getMostRecentURI();var current_id=most_recent_uri.getQueryData().id;var query_data={};if(current_id){query_data.id=current_id;}
return most_recent_uri.setQueryData(query_data);}};

function motion_spawn_delete_dialog(video_id,parent_oid){var data={v:video_id,delete_dialog:true};if(parent_oid){data.parent_oid=parent_oid;}
new AsyncRequest().setURI('/ajax/motion.php').setData(data).setHandler(function(response){dialog_data=response.getPayload();_motion_show_delete_dialog(video_id,dialog_data.preview_content,dialog_data.success_content,parent_oid);}).send();}
function _motion_show_delete_dialog(video_id,content,success_content,parent_oid){var dialog=new Dialog().setTitle(content.title).setBody(content.html).setButtons([Dialog.newButton(content.verb.toLowerCase(),content.verb,'',function(){_motion_delete_video(video_id,success_content,parent_oid);}),Dialog.CANCEL]).show();}
function _motion_delete_video(video_id,success_content,parent_oid){var data={delete_video:true,v:video_id};if(parent_oid){data.parent_oid=parent_oid;}
new AsyncRequest().setURI('/ajax/motion.php').setData(data).setHandler(function(response){var current_dialog=Dialog.getCurrent();if(current_dialog){current_dialog.hide();}
new Dialog().setTitle(success_content.title).setBody(success_content.html).show();goURI.bind(null,success_content.url).defer(2000);}).send();}
function motion_show_profile_video_dialog(video_id,content,success_content){var dialog=new Dialog().setTitle(content.title).setBody(content.html).setButtons([Dialog.newButton('make-profile-video',_tx("Make Profile Video"),'',function(){_motion_set_profile_video(video_id,success_content);}),Dialog.CANCEL]).show();}
function _motion_set_profile_video(video_id,success_content){new AsyncRequest().setURI('/ajax/motion.php').setData({profile_video:1,v:video_id}).setHandler(function(response){goURI('/video/video.php?profile&v='+video_id);return true;}).send();}
function video_send_email_when_processed(video_id,send_email){var args={action:'set_send_email',video_id:video_id,send_email:send_email?1:0};new AsyncRequest().setURI('/ajax/motion_upload.php').setData(args).setHandler(function(response){$('notification_status').innerHTML=response.getPayload();}).send();}
var recorder_dialog;function motion_submit_video_handler(fvr_data){video_id=fvr_data['video_id'];video_category=fvr_data['video_category'];oid=fvr_data['parent_oid'];if(!video_id){goURI('/video/editvideo.php?error');}
switch(video_category){case 1:new AsyncRequest().setURI('/ajax/motion_fvr_dialog.php').setData({'action':'fvr_get_permalink','video_id':video_id}).setHandler(function(response){inboxAttachments.attach_link_url(ge('attachment_stage_area'),response.getPayload(),true);}).send();break;case 2:new AsyncRequest().setURI('/ajax/motion.php').setData({obj_attach:1,v:video_id,parent_oid:oid}).setHandler(function(response){goURI('/video/editvideo.php?created&v='+video_id+'&oid='+oid);}).send();break;case 0:default:goURI('/video/editvideo.php?created&v='+video_id);break;}}
function video_add_video_msg_inputs(fvr_data){video_id=fvr_data['video_id'];if(inboxAttachments.is_active){var attachment=ge(inboxAttachments.edit_id);}else{var attachment=ge(wallAttachments.edit_id);}
if(attachment){if(ge('video_msg_id')){$('video_msg_id').value=video_id;}else{var video_msg_id=document.createElement('input');video_msg_id.name='attachment[params][0]';video_msg_id.id='video_msg_id';video_msg_id.value=video_id;video_msg_id.type='hidden';var share_type=document.createElement('input');share_type.name='attachment[type]';share_type.id='video_msg_share_type';share_type.value=15;share_type.type='hidden';attachment.appendChild(video_msg_id);attachment.appendChild(share_type);}}}
function video_remove_video_msg_inputs(){if(inboxAttachments.is_active){var attachment=ge(inboxAttachments.edit_id);}else{var attachment=ge(wallAttachments.edit_id);}
if(attachment){var video_msg_id=ge('video_msg_id');if(video_msg_id){attachment.removeChild(video_msg_id);var video_msg_share_type=ge('video_msg_share_type');if(video_msg_share_type){attachment.removeChild(video_msg_share_type);}}}}
function video_toggle_dialog(dialog_type,value){var args={action:'toggle_dialog',dialog_type:dialog_type,dialog_value:value};new AsyncRequest().setURI('/ajax/motion_invite.php').setData(args).setHandler(function(response){}).send();}

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