var AdTooltip={continuePlayback:false,addStyles:function(B){var C=null;if(document.createStyleSheet){C=document.createStyleSheet()}else{var A=document.getElementsByTagName("head")[0];C=document.createElement("style");A.appendChild(C)}if(Sys.Browser.agent===Sys.Browser.InternetExplorer){C.cssText=B}else{if(Sys.Browser.agent===Sys.Browser.Safari){C.innerText=B}else{C.innerHTML=B}}},close:function(){if(typeof(window.tip)!="undefined"){window.tip.hide()}},reposition:function(){var D=286;var F=300;var B;if(Sys.Browser.agent===Sys.Browser.InternetExplorer){B=document.getElementById("shell")}else{if(Sys.Browser.agent===Sys.Browser.Safari){B=document.getElementById("shell")}else{B=document.getElementById("shell").getElementsByTagName("object")[0]}}var A=MySpaceMusic.getElementPosition(B);var C=0;if(B.offsetWidth>F){C=(B.offsetWidth-F)/2}var E=(MusicPlayerControl.Width=="450")?44:99;window.tip._tipDiv.style.left=(A.x+C)+"px";window.tip._tipDiv.style.top=(A.y+E)+"px"},open:function(A){if(typeof(A)!="undefined"){AdTooltip.continuePlayback=A}AdTooltip.close();var F=286;var H=300;var C;if(Sys.Browser.agent===Sys.Browser.InternetExplorer){C=document.getElementById("shell")}else{if(Sys.Browser.agent===Sys.Browser.Safari){C=document.getElementById("shell")}else{C=document.getElementById("shell").getElementsByTagName("object")[0]}}var B=MySpaceMusic.getElementPosition(C);var E=0;if(C.offsetWidth>H){E=(C.offsetWidth-H)/2}var G=(MusicPlayerControl.Width=="450")?44:99;var D=".tooltipdiv .helper{background:none;border:none;}.tooltipdiv .helperarrow{display:none;}.tooltipleft{margin-left:10px;}";AdTooltip.addStyles(D);content="<iframe scrolling='no' style='position:absolute;' id='musicFlashPlayerContent' height='"+F+"' width='"+H+"' frameborder='0' src='"+MusicPlayerControl.TooltipUrl+"'></iframe>";window.tip=$create(MySpace.UI.Tooltip,{content:content,autoPos:false,hover:false,tipPos:"bottom",margin:0},null,null,$get(MusicPlayerControl.SwfObjectDiv));window.tip._tipDiv.childNodes[1].style.display="none";window.tip._tipDiv.childNodes[2].childNodes[0].style.display="none";window.tip._tipDiv.childNodes[2].childNodes[2].style.display="none";window.tip._tipDiv.childNodes[3].style.display="none";window.tip._tipDiv.childNodes[2].style.background="transparent";window.tip.show();window.tip._tipDiv.style.left=(B.x+E)+"px";window.tip._tipDiv.style.top=(B.y+G)+"px";$addHandler(window,"resize",AdTooltip.reposition)},onClickContinueListen:function(){if(typeof(window.parent)!="undefined"&&typeof(window.parent.tip)!="undefined"){window.parent.tip.hide();if(AdTooltip.continuePlayback){window.parent.MySpaceMusic.getPlayerFlashObject().playCurrentTrack()}}}};var AmazonBuy={AmazonInPlacePurchase:function(A){var E=MusicPlayerControl.AmazonPrice+"&asin="+A+"&mode=";var C=626;var D=426;if(navigator.userAgent.toLowerCase().indexOf("firefox/")>=0){C=611;D=366}E+="windowed";var B=window.open(E,"Amazon","status=no, scrollbars=no, resizable=no, toolbar=no, location=no, directories=no, menubar=no, width=610, height=400");if(B){B.focus()}else{MySpaceMusic.showPopupBlockerMessage()}},AmazonNotInPlacePurchase:function(A){standardAffUrl="http://www.amazon.com/dp/"+A+"?tag=mys0d05-20";var B=window.open(standardAffUrl,"AmazonSA","status=yes, scrollbars=yes, resizable=yes, toolbar=yes, location=yes, directories=no, menubar=yes, width=950, height=700");if(B){B.focus()}else{MySpaceMusic.showPopupBlockerMessage()}}};var FlashUpgrade={checkIfBelow104:function(){if((Sys.Browser.agent===Sys.Browser.Safari)&&(Sys.Browser.version<200)){return true}if(Sys.Browser.agent===Sys.Browser.Firefox){var A=navigator.oscpu;return(A.indexOf("10.3")!=-1)||(A.indexOf("10.2")!=-1)}return false},GetFlashUpgradeURL:function(A){var J=MusicPlayerControl.AllOtherFlashUpgradeURL;if(A){var D=navigator.userAgent.toLowerCase();var C=navigator.platform.toLowerCase();var H=false;var I=false;var B=false;var E=false;var F=false;var K=false;var G=false;H=(D.indexOf("win 9x 4.90")!=-1&&D.indexOf("win")!=-1);I=(D.indexOf("win98")!=-1)||(D.indexOf("windows 98")!=-1);B=(D.indexOf("inux")!=-1);E=(D.indexOf("mac os x")!=-1);F=(E&&FlashUpgrade.checkIfBelow104());K=(E&&((D.indexOf("ppc")!=-1)||(D.indexOf("powerpc")!=-1)));G=(E&&((C.indexOf("intel")!=-1)));if(I||H){if(Sys.Browser.agent===Sys.Browser.InternetExplorer){J=MusicPlayerControl.WinME98_IE_FlashUpgradeURL}if(Sys.Browser.agent===Sys.Browser.Firefox){J=MusicPlayerControl.WinME98_Netscape_FlashUpgradeURL}}else{if(B){J=MusicPlayerControl.Linux_FlashUpgradeURL}else{if(F){if(K){J=MusicPlayerControl.MacOSX_Less10dot4_PowerPC_FlashUpgradeURL}if(G){J=MusicPlayerControl.MacOSX_Less10dot4_Intel_FlashUpgradeURL}}}}}return J}};var LoginObj={ajaxActionHandler:"/Modules/MusicV2/Services/MusicUtil.ashx?action=EnforceLogin",req:null,_loginWin:null,Sleep:function(A){setTimeout("LoginObj.EnforceLoginOpenComplete()",A)},LoginRedirect:function(){if(LoginObj.req.readyState==4){var json=eval("("+LoginObj.req.responseText+")");if(json.ServerResponse.IsRequestSuccessful){window.location.href=json.ServerResponse.DisplayText}}},EnforceLoginPOMP:function(A){LoginObj._loginWin=window.open(decodeURI(A),"newWin","","");LoginObj.Sleep(1000)},EnforceLoginOpenComplete:function(){if(LoginObj._loginWin==null){LoginObj.Sleep(1000)}else{if(LoginObj._loginWin.document==null){LoginObj.Sleep(1000)}else{var A=LoginObj._loginWin.document.getElementById(MusicPlayerControl.SwfObjectDiv);if(A==null){LoginObj.Sleep(1000)}else{LoginObj._loginWin.LoginObj.EnforceLogin()}}}}};var Purchase={AlbumClicked:function(F,C,B,A,D){switch(F.toLowerCase()){case"amazon":if(MusicPlayerControl.AllowAmazonInPlace&&C!=undefined&&C!=null&&C!=""){AmazonBuy.AmazonInPlacePurchase(C)}else{AmazonBuy.AmazonNotInPlacePurchase(C)}break;case"itunes":if(C!=undefined&&C!=null&&C!=""){iTunesURL=MySpaceMusic.textFormat(MusicPlayerControl.ITunesUrl,"","?id="+C);var E=window.open(iTunesURL,"iTunesSA","status=yes, scrollbars=yes, resizable=yes, toolbar=yes, location=yes, directories=no, menubar=yes, width=950, height=700");if(E){E.focus()}else{MySpaceMusic.showPopupBlockerMessage()}}break;default:}},SongClicked:function(D,B,F,A,E){switch(D.toLowerCase()){case"amazon":if(MusicPlayerControl.AllowAmazonInPlace&&B!=undefined&&B!=null&&B!=""){AmazonBuy.AmazonInPlacePurchase(B)}else{AmazonBuy.AmazonNotInPlacePurchase(B)}break;case"itunes":if(B!=undefined&&B!=null&&B!=""){iTunesURL=MySpaceMusic.textFormat(MusicPlayerControl.ITunesUrl,"?i="+B,"&id="+F);var C=window.open(iTunesURL,"iTunesSA","status=yes, scrollbars=yes, resizable=yes, toolbar=yes, location=yes, directories=no, menubar=yes, width=950, height=700");if(C){C.focus()}else{MySpaceMusic.showPopupBlockerMessage()}}break;default:}}};var Ringtones={open:function(B,A){var G="";var D=[];MySpace.UI.hideElements=function(J,I){for(name in J){if(J[name]=="object"){J[name]=""}}for(var K=0;K<J.length;K++){var M=document.getElementsByTagName(J[K]);for(var L=0;L<M.length;L++){if(I){M[L].setAttribute("origvis",M[L].style.visibility)}M[L].style.visibility=I?"hidden":(M[L].getAttribute("origvis")?M[L].getAttribute("origvis"):"")}}};switch(MySpace.Cookies.MSCulture.get_values().IPCulture.toLowerCase()){case"en-gb":if(A==""||B==""){G=MusicPlayerControl.JambaUrl}else{A=A.replace(/[^A-Za-z0-9\s:]/g,"").replace(/[\s]/g,"+");D=A.split(":");G=MusicPlayerControl.JambaUrl+D[0]}var H=window.open(G,"JambaRingtones","status=no, scrollbars=no, resizable=no, toolbar=no, location=no, directories=no, menubar=no, width=604, height=465");if(H){H.focus()}else{MySpaceMusic.showPopupBlockerMessage()}break;default:var F="";var E;popupWidth=604;popupHeight=465;if(A==""||B==""){G=MusicPlayerControl.JambaUrl}else{A=A.replace(/[^A-Za-z0-9\s:]/g,"").replace(/[\s]/g,"+");D=A.split(":");F=D[0]+","+D[1];for(var C=1;C<B.length;C++){E=B[C].replace(/[^A-Za-z0-9\s:]/g,"").replace(/[\s]/g,"+");D=E.split(":");F=F+"&arttitle="+D[0]+","+D[1]}G=MusicPlayerControl.JambaUrl+F}popupContent="<iframe id='popupiframe' scrolling='no' style='border:0;overflow:hidden' src='"+G+"' width='"+popupWidth+"' height='"+popupHeight+"'></iframe>";invCloseBtn="<p onclick='Ringtones.close();' clafss='popup_x' style='background:none; width:66px; height:25px; top:26px; margin:-27px 0 0 0; cursor:pointer; float:right; position:relative; z-index:1000201;'></p>";popup=MySpaceMusic.createPopUp(popupContent,popupWidth,popupHeight,invCloseBtn,"ringtone");popup.show();popupiFrame=document.getElementById("popupiframe");targetPopUpParent=popupiFrame.parentNode;targetPopUpParent2=popupiFrame.offsetParent;targetPopUpParent.style.padding="0px";targetPopUpParent2.style.padding="0px";targetPopUpParent.style.paddingTop="0px";targetPopUpParent.style.borderTop="0px"}},close:function(){dDd=document.getElementById("divWrapper");document.body.removeChild(dDd);var A=$get("shell");if(A){A.style.visibility="visible"}MySpaceMusic.getPlayerFlashObject().playCurrentTrack()}};var MySpaceMusic={focusStatus:true,createPopUp:function(G,B,J,E,C){var I="";var K=G;var D=document.createElement("div");var F=50;var A=100;if(MySpace.ClientContext.FunctionalContext=="PopUpPlayer"&&C=="optin"){F=0;if(browser.isIE6x){A=65}}var H;if(C=="optin"){H=MySpace.UI.Popup.create(K,"");H.set_width(B+18)}else{D.innerHTML="<div id='divWrapper' class='popup_wrapper' style='z-index:1000201;left:0px;width: "+A+"%;display:none;visibility:hidden;text-align:center;padding:auto auto auto auto;'><div class='appspopup_box' style='width:"+B+"px; height:"+J+"px; margin-left: auto;margin-right: auto;border: 4px solid #6698CB;'>"+E+"<div></div><div class='appspopup_content' style='margin:0 auto;'></div><div class='appspopup_buttons'></div></div></div>";H=$create(MySpace.UI._Popup,{title:I,content:K,left:0,top:F},null,null,D.firstChild)}return H},textFormat:function(C){var B=arguments.length-1;for(var A=0;A<B;A++){C=C.replace(new RegExp("\\{"+A+"\\}","gi"),arguments[A+1])}return C},getElementPosition:function(A){var C=0;var B=0;if(A){while(A.offsetParent){C+=A.offsetLeft;B+=A.offsetTop;A=A.offsetParent}C+=A.offsetLeft;B+=A.offsetTop}return{x:C,y:B}},showPopupBlockerMessage:function(){var C=false;var A=document.createElement("iframe");A.setAttribute("src","/modules/musicv2/pages/NoAmazonPopupMessaging.aspx");A.setAttribute("id","amazonNoPopUp");A.style.position="absolute";A.setAttribute("allowTransparency","true");A.setAttribute("frameBorder","0");A.style.backgroundColor="transparent";var G=300;var F=300;var E=document.getElementById(MusicPlayerControl.SwfObjectDiv);var D=MySpaceMusic.getElementPosition(E);if(E.offsetHeight>G){A.style.top=D.y+"px"}else{var B=D.y-(G-E.offsetHeight)/2;A.style.top=B+"px"}if((parseInt(MusicPlayerControl.Height)==1)&&(parseInt(MusicPlayerControl.Width)==1)){A.style.position="fixed";A.style.left="44%";A.style.top="44%"}else{A.style.left=D.x+"px";A.style.width=F+"px"}A.style.height=G+"px";A.style.borderStyle="none";document.body.appendChild(A)},getPlayerFlashObject:function(){var A=document.getElementsByTagName("object");for(i in A){if(typeof(A[i].playSong)!="undefined"){return A[i]}}return null},Focus:function(){MySpaceMusic.focusStatus=true},Blur:function(){MySpaceMusic.focusStatus=false},IsWindowFocused:function(){return MySpaceMusic.focusStatus},onFindRingtoneClicked:function(B,A){if(MusicPlayerControl.AllowJamba){Ringtones.open(B,A)}},onPlayingTrack:function(C,D,B,A){if(MySpace.Ads&&MySpace.Ads.BandType){MySpace.Ads.BandType.Genre1=B[0];MySpace.Ads.BandType.Genre2=B[1];MySpace.Ads.BandType.Genre3=B[2]}if(D[0]>0){MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.GetMultipleArtistsUpdate(D,MySpaceMusic.WebSvrManager.ArtistUpdateSuccess,MySpaceMusic.WebSvrManager.OnFailure)}else{document.getElementById("feedResult").innerHTML='<br/><div class="activityFeedNoUpdate">'+MySpaceRes.PopUpPlayer.NoUpdatesForThisArtist+"</div>"}},onBuyAlbumClicked:function(B,C,A,D){if(MusicPlayerControl.AllowAmazonInPlace&&B!=undefined&&B!=null&&B!=""){AmazonBuy.AmazonInPlacePurchase(B)}else{AmazonBuy.AmazonNotInPlacePurchase(B)}},onBuySongClicked:function(B,D,A,C){if(MusicPlayerControl.AllowAmazonInPlace&&B!=undefined&&B!=null&&B!=""){AmazonBuy.AmazonInPlacePurchase(B)}else{AmazonBuy.AmazonNotInPlacePurchase(B)}},onPurchaseAlbumClicked:function(E,C,B,A,D){Purchase.AlbumClicked(E,C,B,A,D)},onPurchaseSongClicked:function(C,B,E,A,D){Purchase.SongClicked(C,B,E,A,D)},MedRecRefresh:function(A){if(MySpace.ClientContext.FunctionalContext=="UserViewProfile"){AdTooltip.open(A)}if(MySpace.ClientContext.FunctionalContext=="MusicDiscography"){AdTooltip.open()}},MedRecDismiss:function(){AdTooltip.close()},OptIn:function(B,D,F,C,E,A){popupWidth=530;popupHeight=550;popupContent="<iframe id='popupiframe' scrolling='no' style='border:0;overflow:hidden' src=\"/modules/musicv2/pages/optindialog.aspx?userid="+B+"&songid="+F+"&playlistid="+D+"&artistid="+C+"&songname="+escape(E)+"&albumid="+A+"\" width='"+popupWidth+"' height='"+popupHeight+"'></iframe>";invCloseBtn="<p class='popup_x' style='background:none; width:55px; height:25px; top:42px; margin:-28px 20px 0 0; padding:0 20px 0 0; cursor:pointer; float:right; position:relative;'></p>";popup=MySpaceMusic.createPopUp(popupContent,popupWidth,popupHeight,"","optin");if((MySpace.ClientContext.FunctionalContext=="Music"||MySpace.ClientContext.FunctionalContext=="PopUpPlayer")&&browser.isIE6x){popup.set_autoSize(false)}popup.show();if((MySpace.ClientContext.FunctionalContext=="Music"||MySpace.ClientContext.FunctionalContext=="PopUpPlayer")&&browser.isIE6x){popup.set_autoSize(true)}},EnforceLogin:function(){try{if(window.XMLHttpRequest){LoginObj.req=new XMLHttpRequest();LoginObj.req.onreadystatechange=LoginObj.LoginRedirect;LoginObj.req.open("GET",LoginObj.ajaxActionHandler,true);LoginObj.req.send(null)}else{if(window.ActiveXObject){LoginObj.req=new ActiveXObject("Microsoft.XMLHTTP");if(LoginObj.req){LoginObj.req.onreadystatechange=LoginObj.LoginRedirect;LoginObj.req.open("GET",LoginObj.ajaxActionHandler,true);LoginObj.req.send()}}}}catch(A){}},popupAllowed:function(){var A=window.open("","","width=1,height=1,left=0,top=0,scrollbars=no");if(A){var B=true;A.close()}else{MySpaceMusic.showPopupBlockerMessage()}return B},onStop:function(B,A){ButtonControls.oldElem.src=MyPlaylistsControl.playIcon;Sys.UI.DomElement.removeCssClass(ButtonControls.oldParentElem,"isPlaying")},PlaySongInPOMP:function(D,B,A,E){try{document.getElementById("shell").playSong(D,B,A,E)}catch(C){}}};if(typeof($addHandler)!=="undefined"){if(Sys.Browser.agent===Sys.Browser.InternetExplorer){$addHandler(document,"focusout",MySpaceMusic.Blur);$addHandler(document,"focusin",MySpaceMusic.Focus)}else{if(Sys.Browser.agent===Sys.Browser.Safari){$addHandler(window,"blur",MySpaceMusic.Blur);$addHandler(window,"focus",MySpaceMusic.Focus)}else{$addHandler(window,"blur",MySpaceMusic.Blur);$addHandler(window,"focus",MySpaceMusic.Focus)}}}var popup;function ClosePopUp(){popup._hide();popupId=document.getElementById("divWrapper");document.body.removeChild(popupId)}function logoutAndClose(){checkbox=document.getElementById("logoutUserCheckBox");if(checkbox.checked){var A=document.createElement("iframe");A.id="amazonLogoutIFrame";A.src=MusicPlayerControl.AmazonLogoutFrameURL;A.style.display="none";A.style.width="1px";A.style.height="1px";document.body.appendChild(A);popup._hide()}else{popup._hide()}checkbox.checked=false}killPopupBlockerMessaging=function(){popupFrame=document.getElementById("amazonNoPopUp");document.body.removeChild(popupFrame)};Type.registerNamespace("MySpace.Web.Modules.MusicV2.Services");MySpace.Web.Modules.MusicV2.Services.PopUpPlayer=function(){MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.initializeBase(this);this._timeout=0;this._userContext=null;this._succeeded=null;this._failed=null};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.prototype={GetMultipleArtistsUpdate:function(C,B,A,D){return this._invoke(MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.get_path(),"GetMultipleArtistsUpdate",false,{ArtistIds:C},B,A,D)},GetArtistUpdate:function(B,C,A,D){return this._invoke(MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.get_path(),"GetArtistUpdate",false,{ArtistId:B},C,A,D)}};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.registerClass("MySpace.Web.Modules.MusicV2.Services.PopUpPlayer",Sys.Net.WebServiceProxy);MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance=new MySpace.Web.Modules.MusicV2.Services.PopUpPlayer();MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.set_path=function(A){MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance._path=A};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.get_path=function(){return MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance._path};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.set_timeout=function(A){MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance._timeout=A};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.get_timeout=function(){return MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance._timeout};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.set_defaultUserContext=function(A){MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance._userContext=A};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.get_defaultUserContext=function(){return MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance._userContext};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.set_defaultSucceededCallback=function(A){MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance._succeeded=A};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.get_defaultSucceededCallback=function(){return MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance._succeeded};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.set_defaultFailedCallback=function(A){MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance._failed=A};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.get_defaultFailedCallback=function(){return MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance._failed};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.set_path("/Modules/MusicV2/Services/PopUpPlayer.asmx");MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.GetMultipleArtistsUpdate=function(B,C,A,D){MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance.GetMultipleArtistsUpdate(B,C,A,D)};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.GetArtistUpdate=function(B,C,A,D){MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance.GetArtistUpdate(B,C,A,D)};MySpaceMusic.WebSvrManager={ArtistUpdateSuccess:function(A,B){if(A!=null){var C=document.getElementById("feedResult");if(C!=null){C.innerHTML=A}}},OnFailure:function(A){}};
