function woome_video_rating_change(video_id,rating){var req=new Ajax("/video/"+video_id+"/rating/",{method:"post",data:"rating="+rating,onComplete:function(){},onFailure:function(){}}).request();}
function woome_toggle_rating_msg(msg_id){$(msg_id).toggleClass('hidden');$('ratingCount').toggleClass('hidden');$('videoViews').toggleClass('hidden');$$('#videoStats .videoRating').toggleClass('alreadyRated');}
function woome_unpublic_video(id,state,hide_item,action_type){woome_generic_alert_YN('<h2 style="margin-top: 0;">are you sure you want to remove this video from WooMe TV?</h2>',function(){videouser_optin_toggle(id,state,hide_item,action_type);});}
function videouser_optin_toggle(id,state,hide_item,action_type){$E('.greenConfirmation').addClass('hidden');$$('.greenConfirmation span').addClass('hidden');var req=new Ajax('/video/'+id+'/user_optin_toggle/',{method:"post",data:"optin_state="+state,onSuccess:function(response){if(state=="USERDEL"){videouser_remove_panel($('meeting_'+id).getParent());$E('.greenConfirmation').removeClass('hidden');$('deleteVideo').removeClass('hidden');}
else{$('button_'+id).setHTML(response);$(action_type+'_conf').removeClass('hidden');$E('.greenConfirmation').removeClass('hidden');if($E('#'+action_type+'_conf a')){$E('#'+action_type+'_conf a').setProperty("href","/video/"+id+"/");}
if(hide_item=='y'&&$('meeting_'+id)){videouser_remove_panel($('meeting_'+id).getParent());}
if($E('.fullWidth')){document.location.reload();}}},onFailure:function(){}}).request();}
function videouser_remove_panel(panel){var fx=panel.effects({duration:300});fx.start({'opacity':0}).chain(function(){this.start.delay(0,this,{'height':0,'margin':0,'padding':0});});}
function woome_share_video(){if(!$j('#current_user').length||(!window.FBC||(window.FBC&&(FBC.connected||FBC.action_popup_hidden)))){woome_show_friendshare_popup();}
else{fb_woome_check_connection();}}
function fbs_click(){u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}
function woome_digg_share(){u=location.href;t=document.title;window.open('http://digg.com/submit?phase=2&url='+encodeURIComponent(u)+'');return false;}
function woome_myspace_share(T,C,U,L){var targetUrl='http://www.myspace.com/index.cfm?fuseaction=postto&'+'t='+encodeURIComponent(T)
+'&c='+encodeURIComponent(C)+'&u='+encodeURIComponent(U)+'&l='+L;window.open(targetUrl);}
function woome_hide_video_welcome_message(){var username=woome.loggedin.username;new Ajax('/'+username+'/preferences/',{'method':'post','data':{'seen_video_welcome':'True'},'onSuccess':function(){$('userNotice').toggleClass('hidden');},'onFailure':function(){}}).request();}
function woome_report_video(form){$('reportVideoForm').send({onSuccess:function(){if($('blockedVideoInfoPanel')){$('mainColumn').addClass('alertInfoSpacer');$('reportedVideoInfoPanel').removeClass('hidden');}
$('report_video_container').addClass('hidden');},onFailure:function(){alert('Failed');}});}
function video_do_report(id,reason){$E("#btnAdminReportVideo a.btnText").setText("reporting video");$E("#btnAdminReportVideo ul").addClass("hideElement");var req=new Ajax('/video/'+id+'/report/',{method:"post",data:"crime="+reason,onSuccess:function(){$("btnAdminReportVideo").removeEvents();$$("#btnAdminReportVideo a.btnText").setText("video reported").addClass("greyedOut");woome_generic_alert_OK("<h1>video reported</h1>",function(){},true);},onFailure:function(){alert("reporting failed - please try again");$E("#btnAdminReportVideo a.btnText").setText("report video");}}).request();}
function woome_video_autopublish(userid,sessionid,continuation){var req=new Ajax("/session/"+sessionid+"/publish/",{method:"post",data:{'sessionid':sessionid,'userid':userid},onSuccess:function(){if(continuation){continuation();}},onFailure:function(){alert("something went wrong - please try again");}}).request();}