MySpace.UI.getViewportBounds=function(){return{width:self.innerWidth||(document.documentElement.clientWidth||document.body.clientWidth),height:self.innerHeight||(document.documentElement.clientHeight||document.body.clientHeight),x:window.pageXOffset||(document.documentElement.scrollLeft||document.body.scrollLeft),y:window.pageYOffset||(document.documentElement.scrollTop||document.body.scrollTop)}};MySpace.UI.getPercentVisible=function(c){var b=Sys.UI.DomElement.getBounds(c);var g=MySpace.UI.getViewportBounds();if(b.height===0||b.width===0){return 0}var f=g.y-b.y;f=(f<0)?0:(f>b.height?b.height:f);var a=g.y+g.height-b.y;a=(a>b.height)?b.height:a;var d=g.x-b.x;d=(d<0)?0:(d>b.width?b.width:d);var e=g.x+g.width-b.x;e=(e>b.width)?b.width:e;return((a-f)/b.height)*((e-d)/b.width)};MySpace.UI||(MySpace.UI={});MySpace.UI.UserActionWatcher=(function(){var c=MySpace.ClientIntMaintenanceConfigs.useractionwatcher,h=MySpace.ClientContext.FunctionalContext,d=!c||(c.enabled&&(!c[h]||c[h].enabled)),a=[],b=[],g=MySpace.UI.getPercentVisible,e=+new Date,f=function(){if(+new Date-e<2000){return}e=+new Date;Array.forEach(b,function(j){if(g($get(j[0]))>=0.5){generateAd.apply(this,j)}});if(window.google_ad_url){var i=$q(".googleafc")[0];if(!i){return}i.parentNode.removeChild(i);MySpace.UI.addScript(window.google_ad_url+"&"+(+new Date))}};if(!c||c.enabled){window.sdc_wrapper=function(){if(Array.contains(a,arguments[0])&&!Array.find(b,function(j){return j[0]===arguments[0]})){b.push(arguments)}generateAd.apply(this,arguments)}}return{discover:function(j){if(c&&!c.enabled){return}var i=$q(".action",j);Array.forEach(i,function(k){$addHandler(k,"click",f)})},setAdTypes:function(i){a=arguments},onUserAction:f}})();MySpace.UI.UserActionWatcher.setAdTypes("tkn_medrec","tkn_medrecumg","tkn_medrecwmg","tkn_medrecsonybmg","tkn_medrecemi","tkn_medrecband","tkn_medrec2","tkn_medrec2umg","tkn_medrec2wmg","tkn_medrec2sonybmg","tkn_medrec2emi","tkn_medrec2band");MySpace.UI.UserActionWatcher.discover();(function(a){var j=-1,b=a(".wrap #stretchedBgImage"),c={width:0,height:0,ratio:0,stretchWidth:0,stretchHeight:0};function i(){h();a(window).resize(a.proxy(g,this));b.css("visibility","visible")}function g(){if(j!=-1){clearTimeout(j)}j=setTimeout(a.proxy(h,this),100)}function h(){f();if(!(c.ratio>0)){return}var k=a(window).height();var m=a(window).width();var l=null;if(c.ratio<1){l=e(m,k)}else{l=d(m,k)}b.css({width:(l.scale*c.width)+"px",height:(l.scale*c.height)+"px",left:l.left+"px",top:l.top+"px"});j=-1}function f(){c.height=b.height();c.width=b.width();c.ratio=(b.height()>0&&b.width()>0)?(b.width()/b.height()):0}function d(n,k){var m=k/c.height;if((m*c.width)<n){m=n/c.width}var l=n/k;return{scale:m,left:((l<c.ratio)?(Math.floor((n-m*c.width)/2)):0),top:0}}function e(n,k){var m=n/c.width;if((m*c.height)<k){m=k/c.height}var l=n/k;return{scale:m,left:0,top:((l<(1/c.ratio))?(Math.floor((k-m*c.height)/2)):0)}}if(b.length){i()}})(jQuery);(function(a){var b={$Expandbar:null,$Content:null,initialize:function(){this.$Expandbar=a(".marqueeModule .expandBar");this.$Content=a(".marqueeContent");this.$Expandbar.click(a.proxy(b.expand,b))},expand:function(){if(this.$Expandbar.hasClass("expanded")){this.$Expandbar.removeClass("expanded");this.$Content.animate({height:this.$Content.attr("data-collapsedHeight")})}else{this.$Expandbar.addClass("expanded");this.$Content.attr("data-collapsedHeight",this.$Content.css("height").replace("px",""));this.$Content.animate({height:this.$Content.attr("data-maxHeight")})}}};b.initialize();namespace("MySpace.Profiles.Modules").Marquee=b})(jQuery);(function(a){function b(h){var c=a(h.target),k=c.attr("class").match(/gap[a-zA-Z]+/),l=MySpaceRes.Global,m,g,f;if(!k){return}h.preventDefault();switch(k[0]){case"gapAddComment":var d=a(".commentsModule .textAreaInit",null,true);if(!d.length){return false}var o=d.offset();window.scrollTo(o.left,o.top-110);d.focus();return false;break;case"gapAddFriend":MySpace.UI.AddFriendPopup(c.attr("data-id"));break;case"gapFollowVideos":if(!MySpace.ClientContext.IsLoggedIn){MySpace.UI.LoginPrompt.show();return}var n=c.hasClass("following"),i=c.attr("data-userId"),e=MySpaceRes.Common;MySpace.UI.Pages.Data.request(n?"UnFollowArtist.ashx":"FollowArtist.ashx",this,function(v){var r;try{r=JSON.parse(v.get_responseData())}catch(s){return}if(!r.ServerResponse.IsRequestSuccessful){return}c.toggleClass("following notFollowing");var t=c.html(),p=a(".gapActionTip",c),u=!u;var q=p.html();if(u){t=t.replace(e.Global_Unfollow_Text,e.Global_Follow_Text);q=q.replace(e.Global_Unfollow_User_Videos_Tip,e.Global_Follow_User_Videos_Tip)}else{t=t.replace(e.Global_Follow_Text,e.Global_Unfollow_Text);q=q.replace(e.Global_Follow_User_Videos_Tip,e.Global_Unfollow_User_Videos_Tip)}c.html(t);p.html(q)},"friendId="+i);break;case"gapBlockUser":MySpace.UI.GlobalActions.BlockUser(c.attr("data-friendId"));break;case"gapRemoveFriend":MySpace.UI.GlobalActions.RemoveFriend(c.attr("data-friendId"));break;case"gapAddFriendToList":a('<div class="addToList"><span>'.concat(MySpaceRes.People.List,"</span>",j(),"</div>")).dialog({title:MySpaceRes.People.AddToList,buttons:{Cancel:function(){a(".addToList").remove()},Add:function(){var p=a(".addToList .glue-dropdown .categoryoptions").attr("data-categoryid");MySpace.UI.Pages.Data.request("AddFriendsToCategory.ashx",null,null,"friendids=".concat(JSON.stringify([getDisplayFriendID()]),"&categoryid=",p),null,null,null,"My");a(".addToList").remove()}},width:"small",height:50});a(".addToList .glue-dropdown").dropdown();break}function j(){var q='<div class="glue-dropdown"><a href="#">'.concat(MySpaceRes.People.Lists,"▼</a><ul>");var p=MySpace.UI.Pages.Profiles.Categories;for(var r=0;r<p.length;r++){q+='<li><a href="#" class="categoryoptions" data-categoryname="'.concat(p[r].name,'" data-categoryid="',p[r].id,'">',p[r].name,"</a></li>")}q+="</ul></div>";return q}}a(document).ready(function(){a(".sitesHeader").click(b);a(".gapReportAbuse").click(function(){MySpace.ReportAbuse.show(a(this).attr("href"));return false})})})(jQuery);(function(a,c,b){namespace("MySpace.UI.Pages.Profiles.VideoPlayerModule",{initialize:function(){a(".removeVideoFromProfile").click(function(){var d=String.format("videoId={0}&releaseId={1}",a(this).attr("data-videoId"),a(this).attr("data-releaseId"));MySpace.UI.Pages.Data.request("RemoveVideoFromProfile.ashx",this,MySpace.UI.Pages.Profiles.VideoPlayerModule.removeVideoFromProfileComplete,d,null);return false})},removeVideoFromProfileComplete:function(f){var d;try{var d=Sys.Serialization.JavaScriptSerializer.deserialize(f.get_responseData())}catch(e){d={error:true,errorMsg:MySpaceRes.Global.ErrorMessageRequest,statusCode:"ErrorOccured"}}MySpace.Util.setInnerHtml(a(".videoPlayerModule .moduleBody")[0],null,d.content,true);MySpace.UI.Pages.Profiles.VideoPlayerModule.initialize()}})})(jQuery,window);(function(a){var b=a(".fblike");var d=[];window.fbAsyncInit=function(){FB.init({appId:"Myspace",status:true,cookie:true,xfbml:true});if(MySpace.ClientContext.IsLoggedIn){FB.Event.subscribe("edge.create",function(f){c("Like",f)});FB.Event.subscribe("edge.remove",function(f){c("UnLike",f)})}};function e(f){f.each(function(){var g=a(this);if(!g.data("bind")){if(!a("#fb-root").length){var h=document.createElement("script");h.async=true;h.src=document.location.protocol+"//connect.facebook.net/"+g.data("locale")+"/all.js";g[0].appendChild(h);g.prepend('<div id="fb-root"/>')}var i=g.data("href");var j=g.data("uri");g.append('<fb:like href="'+i+'" ref="'+g.data("ref")+'" layout="'+g.data("layout")+'" action="like" show_faces="'+g.data("show_faces")+'" width="'+g.data("width")+'" height="'+g.data("height")+'" font="'+g.data("font")+'" colorscheme="'+g.data("colorscheme")+'"></fb:like>');d[d.length]={url:i,uri:j};g.data("bind",1)}})}e(b);function c(j,h){var k="";for(var f=0,g=d.length;f<g&&!k;f++){if(h==d[f].url){k=d[f].uri}}if(k){a.ajax({async:false,type:"POST",url:"/Modules/PageEditor/Handlers/Common/{0}.ashx".replace("{0}",j),data:{ruri:k,puid:MySpace.ClientContext.UserId,ouid:MySpace.ClientContext.UserId,hash:MySpace.UI.Pages.HashMashter,ish:0}})}}namespace("MySpace.UI.FacebookLike",{wire:e})}(jQuery));(function(a){var d,b,e=true;function o(q){d={};if(q){for(var p in q){d[p]=q[p]}}if(MySpace.ClientContext.UserId<=0){f();i()}else{c()}return false}function j(p){e=p;b.dialog("close")}function i(){if(!b){b=a("<div/>");b.attr("id","loginOverlay");var p,q="GetLoginOverlayForm.ashx";if(d.redirectUrl){p="dest="+d.redirectUrl+"&"}else{p="dest="+window.location+"&"}if(d.messageResourceId){p+="messageResourceId="+d.messageResourceId}if(p){q+="?"+p}MySpace.UI.Pages.Data.request(q,null,function(t){var s;try{s=JSON.parse(t.get_responseData())}catch(r){n()}if(s){if(s.Code=="0"){n()}else{b.html(s.Data[0]);MySpace.UI.LoginManager.wireOverlayForm();h(1100,b);b.find('button[name="loginBtn"]').click(function(u){h(1101,b)});b.find(".needAccount").click(function(u){h(1102,b)});b.find(".forgotPassword").click(function(u){h(1103,b)})}b.closest(".glue-dialog").removeClass("pending")}},null,null,null,null,"Login");b.dialog({dialogClass:"pending customPadding",close:k,width:"medium",minHeight:300})}else{b.dialog("open")}}function f(){g("SplashStatus")}function n(){d.overlayDisabledCallback&&d.overlayDisabledCallback()}function c(){d.alreadyLoggedInCallback&&d.alreadyLoggedInCallback()}function m(p){h(1106,b,p);d.loggedInCallback&&d.loggedInCallback();f()}function l(){h(1105,b)}function k(){if(e){h(1104,b)}d.cancelLoginCallback&&d.cancelLoginCallback();return false}function g(p){document.cookie=p+"=; domain=."+document.domain+"; expires=Sat, 07-Feb-1981 20:22:04 GMT; path=/"}function h(q,p,u){if(!u){u=-2}var t=b.find(".alertbox > p").html(),s=t&&(q==1100||q==1105)?encodeURIComponent(t):"";var r={tmid:13,eid:q,em:a("#emailOverlay").val(),kfl:a("#rememberOverlay").val()=="false"?"f":"t",msg:s};if(q==1106){r.new_uid=u}MySpace.Beacon.Request(r)}namespace("MySpace.UI.LoginOverlayAPI",{show:o,hide:j,onSuccess:m,onFailedLoginAttempt:l})})(jQuery);(function(a){function b(c){c.preventDefault();MySpace.UI.LoginOverlayAPI.show({messageResourceId:"MusicTimelimitExceeded"})}a("#signupOverlay").click(b)})(jQuery);
