function deleteActivityComment(a,b){$.ajax({url:"/delete_activity_comment.php",type:"POST",data:{c:a},dataType:"json",error:function(){},success:function(c){b.parent().parent().css("display","none")}})}var cancelVideoPost=false;
function postVideoComment(a,b,c,d){if(cancelVideoPost||c==i18n["comm Escribe un comentario..."])return false;cancelVideoPost=true;$.ajax({url:"/videos_add_video_message.php",type:"POST",data:{u:a,v:b,c:c},dataType:"json",error:function(){alert(i18n["No se pudo agregar el comentario, por favor intente nuevamente en unos minutos."]);cancelVideoPost=false},success:function(e){if(e.error)alert(e.error);else{d.before($('<dl class="user-comment f-wrap">    <dt><strong><a href="'+e.friendLink+'">'+e.friendName+
"</a> "+i18n["comm coment\u00f3"]+'</strong> <span class="datetime">- '+e.messageDate+'</span></dt><dd class="user-pic"><a class="thumb" href="'+e.friendLink+'"><img src="'+e.imgSrc+'" width="30"/></a></dd><dd class="user-msg"><p><span>'+e.messageText+"</span></p></dd></dl>"));cancelVideoPost=false}}})}
function postVideoCommentByURI(a,b){var c=b.parent().parent().parent();b.addClass("formfield-quiet");b.next(".btn-input").addClass("collapse");var d=b.val();a=/videos_detail\.php\?u=(\d+)\&a=(\d+)/.exec(a);d.replace(/\s+/,"").length===0?alert(i18n["comm Escribe un comentario..."]):postVideoComment(a[1],a[2],d,c);b.val(i18n["comm Escribe un comentario..."])}var cancelPhotoPost=false;
function postPhotoComment(a,b,c,d,e){if(cancelPhotoPost||d==i18n["comm Escribe un comentario..."])return false;cancelPhotoPost=true;$.ajax({url:"/album_add_photo_message.php",type:"POST",data:{u:a,a:b,p:c,c:d},dataType:"json",error:function(){alert(i18n["No se pudo agregar el comentario, por favor intente nuevamente en unos minutos."]);cancelPhotoPost=false},success:function(f){f.error?alert(f.error):e.before($('<dl class="user-comment f-wrap">    <dt><strong><a href="'+f.friendLink+'">'+f.friendName+
"</a> "+i18n["comm coment\u00f3"]+'</strong> <span class="datetime">- '+f.messageDate+'</span></dt><dd class="user-pic"><a class="thumb" href="'+f.friendLink+'"><img src="'+f.imgSrc+'" width="30"/></a></dd><dd class="user-msg"><p><span>'+f.messageText+"</span></p></dd></dl>"));cancelPhotoPost=false}})}
function postPhotoCommentByURI(a,b){var c=$("#comment_input_"+b);b=$("#pics_comments_"+b);c.addClass("formfield-quiet");c.next(".btn-input").addClass("collapse");var d=c.val();a=/album_view_photo\.php\?u=(\d+)\&a=(\d+)\&p=(\d+)/.exec(a);d.replace(/\s+/,"").length===0?alert(i18n["comm Escribe un comentario..."]):postPhotoComment(a[1],a[2],a[3],d,b);c.val(i18n["comm Escribe un comentario..."])}var cancelSharedPost=false;
function postSharedLinkCommentNew(a,b,c,d,e,f,g){if(cancelSharedPost)return false;else cancelSharedPost=true;$.ajax({type:"POST",url:"ajax_shared_link.php",data:{action:"link_comment",link_user_id:a,link_id:b,comment:c},dataType:"json",error:function(){alert(i18n["No se pudo agregar el comentario, por favor intente nuevamente en unos minutos."]);return cancelSharedPost=false},success:function(h){if(h.error){alert(i18n["No se pudo agregar el comentario, por favor intente nuevamente en unos minutos."]);
return cancelSharedPost=false}h='<dl class="user-comment f-wrap">    <dt><strong><a href="/profile.php?u='+e+'">'+f+"</a> "+i18n["comm coment\u00f3"]+'</strong> <span class="datetime">- '+i18n["comm Reci\u00e9n"]+'</span></dt><dd class="user-pic"><a class="thumb" href="/profile.php?u='+e+'">'+g+'</a></dd><dd class="user-msg"><p><span>'+c+"</span></p></dd></dl>";$(d).before(h).find(".txtarea:first").val("");return cancelSharedPost=false}});return false}
function deleteSharedLinkCommentNew(a,b,c,d){$.ajax({type:"POST",url:"ajax_shared_link.php",data:{action:"delete_link_comment",link_user_id:a,link_id:b,comment_id:c},dataType:"json"});$.getJSON("delete_newsfeed_event.php",{l:b,u1:a,u2:d,cid:c},function(e){});return false}function newsfeedVideoCommentMsg_play(a){$(a).parent().parent().parent().next().find("a:first").click();return false}function newsfeedVideoCommentMsg_play2(a){$(a).parent().parent().find("a:first").click();return false}
function newsfeedVideoCommentMsg_toggle(a){a=$(a).parent();a.parent().find(".video-full-view:first").show().next().hide();a.hide().prev().hide().parent().find(".meta-minimize:first").show();return false}function newsfeedVideoCommentMsg_toggle2(a,b){if(typeof b==="undefined")b=true;var c=$(a).parent().parent().parent();if(b)newsfeedVideoCommentMsg_toggle(a);else{c.find(".newsfeed-comments").toggle();c.find(".newsfeed-comments .new-msg textarea").focus()}return false}
function newsfeedVideoCommentMsg_toggle3(a){a=$(a).parent().hide().parent().parent().parent().find(".video-full-view:first");a.hide().next().show();a.prev().show().prev().show();return false}function newsfeedPhotoCommentMsg_toggle(a){a=$(a).parent().parent().parent();a.find(".newsfeed-comments").toggle();a.find(".newsfeed-comments .new-msg textarea").focus()}
function newsfeedSharedLinkMsg_toggle(a){a=$(a).parent().parent().parent();a.find(".newsfeed-comments").toggle();a.find(".newsfeed-comments .new-msg textarea").focus()}function newsfeedSharedVideoMsg_play(a){$(a).parent().parent().parent().next().find("a:first").click();return false}function newsfeedSharedVideoMsg_play2(a){$(a).parent().parent().find("a:first").click();return false}
function newsfeedSharedVideoMsg_toggle(a){a=$(a).parent();a.parent().find(".video-full-view:first").show();a.hide().prev().hide().parent().find(".meta-minimize:first").show();return false}function newsfeedSharedVideoMsg_toggle2(a){a=$(a).parent().parent().parent();a.find(".newsfeed-comments").toggle();a.find(".newsfeed-comments .new-msg textarea").focus()}
function newsfeedSharedVideoMsg_toggle3(a){a=$(a).parent().hide().parent().parent().parent().find(".video-full-view:first");a.hide().next().show();a.prev().show().prev().show()}function printProfileSimpleBoardMessage_toggle2(a){a=$(a).parent().parent().parent();a.find(".newsfeed-comments").toggle();a.find(".newsfeed-comments .new-msg textarea").focus()}
function printProfilePhotoBoardMessage_toggle2(a){a=$(a).parent().parent().parent();a.find(".newsfeed-comments").toggle();a.find(".newsfeed-comments .new-msg textarea").focus()}function getGameRanking(a,b,c){$("#ranking"+a).load("ajax_responser.php",{action:"getGameRanking",v:c,t:b},function(){$("#newsfeedComments"+a).hide();$("#ranking"+a).show();$("#ranking"+a+" .link-close").click(function(){$("#ranking"+a).hide()})})}
function getPollOptions(a,b){return getGenericPollOptions(a,b,"ajax_polls.php","#pollAnswerBox-")}function getPagePollOptions(a,b){return getGenericPollOptions(a,b,"/publico/pages_polls_ajax.php","#pollPageAnswerBox-")}function getGenericPollOptions(a,b,c,d){if(!$(d+a).hasClass("loaded")){$(d+a).addClass("loaded");$.get(c,{get_vote_newsfeed:1,u:b,fpid:b,pid:a},function(e){$(d+a).hide().after(e)})}}
function postPollVote(a,b){var c=document.getElementsByName("idsonico_option_"+a);return postGenericPollVote(a,b,c,"#pollVoteBox-","ajax_polls.php")}function postPagePollVote(a,b){var c=document.getElementsByName("idsonico_option_p_"+a);return postGenericPollVote(a,b,c,"#pollPageVoteBox-","/publico/pages_polls_ajax.php")}
function postGenericPollVote(a,b,c,d,e){var f=0;lenOption=c.length;if(lenOption==undefined){if(c.checked)f=c.value}else for(var g=0;g<lenOption;g++)if(c[g].checked)f=c[g].value;if(!f)return false;$.get(e,{set_vote_newsfeed:1,u:b,fpid:b,oid:f,pid:a},function(h){$(d+a).hide();$(d+a+"-2").hide().after(h)})};
