var url_to="/profile.php";if(typeof(sonico)=="undefined"){var sonico=function(){}}sonico.pProfile={nsfdToggleSeeMore:function(newsfeedLastdate){if(!newsfeedLastdate){$("#moreNewsfeed").css("display","none")}else{$($("#moreNewsfeed").children()[1]).css("display","");$($("#moreNewsfeed").children()[0]).css("display","none")}setTimeout("rzContent();",1000);return false},nsfdGetMoreEvents:function(lastdate){if(typeof lastdate!=="undefined"){newsfeedLastdate=lastdate}$($("#moreNewsfeed").children()[0]).css("display","");$($("#moreNewsfeed").children()[1]).css("display","none");$.getJSON("ajax_responser.php",{getaction:"getProfileNewsfeed",u:userId,d:newsfeedLastdate,sec:true},function(alldata){newsfeedLastdate=alldata[0];$(".col-w305px , .col-w500px").height("auto");$("#moreNewsfeed").before(alldata[1]);pProfile.nsfdToggleSeeMore(newsfeedLastdate);$("#ex2").jqmAddTrigger("#boardMessages a.openwin");pProfile.enhanceTextArea();imagesOnDemmandLoaded=false;_dh=$(document).height();imgOndemand()});return false},nsfdRmStatus:function(statusId,elmt){elmt.remove();$.getJSON("delete_newsfeed_event.php",{s:statusId},function(res){});return false},nsfdRmGift:function(giftId,elmt){elmt.remove();$.getJSON("delete_newsfeed_event.php",{g:giftId},function(ret){});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(divId,w,s,h,u,idName){var iF=document.createElement("iframe");adObj=document.getElementById(divId);iF.src=u;iF.id=idName;iF.name=idName;iF.width=w+"px";iF.height=h+"px";iF.frameBorder="0";iF.marginwidth="0px";iF.marginheight="0px";iF.scrolling=s;iF.allowTransparency=true;adObj.appendChild(iF)},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{if(skShow!=0){pc_start_customization()}}pProfile.nsfdToggleSeeMore(newsfeedLastdate);pProfile.enhanceTextArea();if(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}}if(profileCustomized){rzContent()}});function deleteNewsfeedEvent(eventId,elmt,user1,user2,cidName,cid){elmt.remove();if(typeof cidName!=="undefined"){var params={e:eventId,u1:user1,u2:user2};params[cidName]=cid;$.getJSON("delete_newsfeed_event.php",params,function(ret){})}else{$.getJSON("delete_newsfeed_event.php",{e:eventId,u1:user1,u2:user2},function(ret){})}}function deletePhotoCommentEvent(eventId,elmt,cid,aid,pid,uid,ouid){if(cid){$.ajax({url:"/album_delete_photo_message.php",type:"POST",data:{a:aid,p:pid,m:cid,u:uid},dataType:"json",error:function(){},success:function(d){}})}if(eventId){deleteNewsfeedEvent(eventId,elmt,uid,ouid,"p",cid)}else{elmt.remove()}}function deleteVideoCommentEvent(eventId,elmt,cid,vid,uid,ouid){if(cid){$.ajax({url:"/videos_delete_video_message.php",type:"POST",data:{v:vid,m:cid,u:uid},dataType:"json",error:function(){},success:function(d){}})}if(eventId){deleteNewsfeedEvent(eventId,elmt,uid,ouid,"v",cid)}else{elmt.remove()}}function postVote(){var objOption=document.getElementsByName("idsonico_option");var voteOption=0;lenOption=objOption.length;if(lenOption==undefined){if(objOption.checked){voteOption=objOption.value}}else{for(var i=0;i<lenOption;i++){if(objOption[i].checked){voteOption=objOption[i].value}}}if(!voteOption){alert(sonico.translate._("Debes seleccionar una opcion"));return(false)}$.get("ajax_polls.php",{set_vote:1,u:userId,oid:voteOption,pid:idsonicoPoll},function(data){$("#voteBox").fadeOut(1000,function(){$("#voteBox").html(data);$("#voteBox").fadeIn(1000)})})}function changeStatus(poll_id,status){if(status==1){msg=sonico.translate._("Estas seguro que quieres Borrar la encuesta?")}else{msg=sonico.translate._("Estas seguro que quieres Finalizar la encuesta?")}if(confirm(msg)){$("#change").attr("value",status);$("#pid").attr("value",poll_id);$("#statusForm").submit()}};