var url_to="/profile.php";if(typeof sonico=="undefined")var sonico=function(){};
sonico.pProfile={nsfdToggleSeeMore:function(a){if(a){$($("#moreNewsfeed").children()[1]).css("display","");$($("#moreNewsfeed").children()[0]).css("display","none")}else $("#moreNewsfeed").css("display","none");setTimeout("rzContent();",1E3);return false},nsfdGetMoreEvents:function(a){if(typeof a!=="undefined")newsfeedLastdate=a;$($("#moreNewsfeed").children()[0]).css("display","");$($("#moreNewsfeed").children()[1]).css("display","none");$.getJSON("/ajax_responser.php",{getaction:"getProfileNewsfeed",
u:userId,d:newsfeedLastdate,sec:0},function(b){if(typeof sonico.pProfile.fromPermalink!="undefined"&&sonico.pProfile.fromPermalink==true){$("li",$("#boardMessages")).first().remove();sonico.pProfile.fromPermalink=false}newsfeedLastdate=b[0];$(".col-w305px , .col-w500px").height("auto");$("#moreNewsfeed").before(b[1]);pProfile.nsfdToggleSeeMore(newsfeedLastdate);$("#ex2").jqmAddTrigger("#boardMessages a.openwin");pProfile.enhanceTextArea();imagesOnDemmandLoaded=false;_dh=$(document).height();imgOndemand()});
return false},nsfdRmStatus:function(a,b){b.remove();$.getJSON("delete_newsfeed_event.php",{s:a},function(){});return false},nsfdRmGift:function(a,b){b.remove();$.getJSON("delete_newsfeed_event.php",{g:a},function(){});return false},enhanceTextArea:function(){$("dd.newsfeed-comments textarea.txtarea").TextTip().elastic().focus(function(){if(this.value===i18n["comm Escribe un comentario..."])this.value="";$(this).parents(".blur").removeClass("blur").addClass("focus")}).blur(function(){if(this.value===
""||this.value===i18n["comm Escribe un comentario..."])$(this).parents(".focus").removeClass("focus").addClass("blur")});return false},osLoadApps:function(a,b,c,e,f,g){var d=document.createElement("iframe");adObj=document.getElementById(a);d.src=f;d.id=g;d.name=g;d.width=b+"px";d.height=e+"px";d.frameBorder="0";d.marginwidth="0px";d.marginheight="0px";d.scrolling=c;d.allowTransparency=true;adObj.appendChild(d)},medUpdNavigationLinks:function(){targetID=$(this).attr("href");targetURL="ajax_profile.php?media="+
targetID.replace(/#/,"")+"&u="+userId;$("#profileMedia .nav-filter .current").removeClass("current");$(this).addClass("current").parent("li").addClass("current");$("#profileMedia>div").hide();$(targetID).show();$(targetID).load(targetURL);rzContent();return false}};var pProfile=sonico.pProfile;
$(function(){$(".startProfileCustomization").click(pc_start_customization);if(trigger_pc)pc_start_temporal_customization();else skShow!=0&&pc_start_customization();pProfile.nsfdToggleSeeMore(newsfeedLastdate);pProfile.enhanceTextArea();typeof spskId!="undefined"&&spskId!="0"&&$("#ex2").jqm({ajax:"layers/spsk_accept_skin.php?spsk_id="+spskId,overlay:30,modal:true}).jqmShow();if(openPublisherTab>0)switch(openPublisherTab){case 1:changeGiftCategory(1);shareManager.triggerClickLinkAction(document.getElementById("attachGiftTab"),
$("#attachGiftTab").attr("href"),true,false);break;case 2:shareManager.triggerClickLinkAction(document.getElementById("attachPhotoTab"),$("#attachPhotoTab").attr("href"),false,false);break}profileCustomized&&rzContent()});function deleteNewsfeedEvent(a,b,c,e,f,g){b.remove();if(typeof f!=="undefined"){a={e:a,u1:c,u2:e};a[f]=g;$.getJSON("delete_newsfeed_event.php",a,function(d){})}else $.getJSON("delete_newsfeed_event.php",{e:a,u1:c,u2:e},function(d){})}
function deletePhotoCommentEvent(a,b,c,e,f,g,d){c&&$.ajax({url:"/album_delete_photo_message.php",type:"POST",data:{a:e,p:f,m:c,u:g},dataType:"json",error:function(){},success:function(h){}});a?deleteNewsfeedEvent(a,b,g,d,"p",c):b.remove()}function deleteVideoCommentEvent(a,b,c,e,f,g){c&&$.ajax({url:"/videos_delete_video_message.php",type:"POST",data:{v:e,m:c,u:f},dataType:"json",error:function(){},success:function(d){}});a?deleteNewsfeedEvent(a,b,f,g,"v",c):b.remove()}
function postVote(){var a=document.getElementsByName("idsonico_option"),b=0;lenOption=a.length;if(lenOption==undefined){if(a.checked)b=a.value}else for(var c=0;c<lenOption;c++)if(a[c].checked)b=a[c].value;if(!b){alert(sonico.translate._("Debes seleccionar una opcion"));return false}$.get("ajax_polls.php",{set_vote:1,u:userId,oid:b,pid:idsonicoPoll},function(e){$("#voteBox").fadeOut(1E3,function(){$("#voteBox").html(e);$("#voteBox").fadeIn(1E3)})})}
function changeStatus(a,b){msg=b==1?sonico.translate._("Estas seguro que quieres Borrar la encuesta?"):sonico.translate._("Estas seguro que quieres Finalizar la encuesta?");if(confirm(msg)){$("#change").attr("value",b);$("#pid").attr("value",a);$("#statusForm").submit()}};
