/*       Source:  Local Cache                                                                 */
/*     Location:  rsrc:103645:/html/js/video/common.js                                        */
/*      Machine:  10.16.140.101                                                               */
/*    Generated:  July 23rd 2008 7:17:24 AM PDT                                               */
/*    HTTP Host:  static.ak.fbcdn.net                                                         */


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){new pop_dialog('video_delete_dialog').show_choice(content.title,content.html,content.verb,function(){generic_dialog.get_dialog(this).enable_buttons(false);_motion_delete_video(video_id,success_content,this,parent_oid);},tx('sh:cancel-button'),function(){generic_dialog.get_dialog(this).enable_buttons(false);generic_dialog.get_dialog(this).fade_out(100);});}
function _motion_delete_video(video_id,success_content,dialog_handle,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){generic_dialog.get_dialog(dialog_handle).hide();success_dialog=new pop_dialog('video_delete_success_dialog').show_prompt(success_content.title,success_content.html);setTimeout(function(){goURI(success_content.url);},2000);}).send();}
function motion_show_profile_video_dialog(video_id,content,success_content){new pop_dialog('video_profile_video_dialog').show_choice(content.title,content.html,tx('vc01'),function(){generic_dialog.get_dialog(this).enable_buttons(false);_motion_set_profile_video(video_id,success_content,this);},tx('sh:cancel-button'),function(){generic_dialog.get_dialog(this).enable_buttons(false);generic_dialog.get_dialog(this).fade_out(100);});}
function _motion_set_profile_video(video_id,success_content,dialog_handle){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_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();}
var recorder_dialog;function motion_submit_video_handler(video_id,video_category,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){attachments.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(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);}}}}
if(window.Bootloader){Bootloader.done(1);}