
var Profile=function(){return{friendChanged:function(ev,id,action){switch(action){case'add':$('#addFriend-'+id).hide();$('#requestingFriend-'+id).show();break;case'remove':$('#removeFriend-'+id).hide();$('#addFriend-'+id).show();$('#message-friend').hide();break;}},idolChanged:function(ev,id,action){switch(action){case'add':$('#addIdol-'+id).hide();$('#removeIdol-'+id).show();if(DataBridge.profileSetting==2){document.location.href=document.location.href;}
break;case'remove':$('#addIdol-'+id).show();$('#removeIdol-'+id).hide();if(DataBridge.profileSetting==2){document.location.href=document.location.href;}
break;}}}}();Ugame.addHandlers({userKilled:function(success,data){if(success){Ugame.Msg.info('User Killed','This user has been killed and his email banned.');document.location.href='/users/'+DataBridge.urlName+'/';}else{Ugame.Msg.error('User Cannot Be Killed','For some reason this user couldn\'t be killed. Please contact a developer.');}}})
$(function(){$(document.body).bind('friendChanged',Profile.friendChanged);$(document.body).bind('idolChanged',Profile.idolChanged);$('#games-list').expandList(4);$('#teams-list').expandList(4);$('#groups-list').expandList(4);$('#supporters-list ul.image-view-list').expandList(4,{rowSpan:5});$('#friends-list .image-view-list').carousel(7);$('.news-delete').click(function(ev){ev.preventDefault();var postData={id:$(this).stripId()};$('#news-'+postData.id).remove();Ugame.makeRequest({url:'/users/'+DataBridge.urlName+'/profile/deleteNews/',postData:postData});});$('#kill-user').click(function(ev){ev.preventDefault();ev.target.blur();Ugame.Msg.confirm('Kill This User?','Are you sure you want to kill this user? It will result in total wipe of this account and all the content assigned to it. The e-mail address will also be banned. A killed user cannot be resurrected.',function(pressed){if(pressed=='yes'){Ugame.makeRequest({url:'/ajax/killUser/kill/'+DataBridge.userId+'/',handler:'userKilled'});}});});$("#status-edit > p").editable(function(value,settings){Ugame.makeRequest({url:'/users/'+DataBridge.urlName+'/profile/updateStatus/',postData:{status:value}});return value;},{type:"text",submit:'Ok',height:16,width:285,select:true});});