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";if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){window.tip._tipDiv.style.top=((B.y+G)-328)+"px"}else{window.tip._tipDiv.style.top=(B.y+G)+"px"}$addHandler(window,"resize",AdTooltip.reposition)},onClickContinueListen:function(A){if(typeof(A.parent)!="undefined"&&typeof(A.parent.tip)!="undefined"){A.parent.tip.hide();if(A.parent.AdTooltip.continuePlayback){A.parent.MySpaceMusic.getPlayerFlashObject().playCurrentTrack()}}}};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},Init:function(){var E=null;try{E=new SWFObject(MusicPlayerControl.EmbedHandlerURL,"shell",MusicPlayerControl.Width,MusicPlayerControl.Height,MusicPlayerControl.PlayerVersion,MusicPlayerControl.BgColor)}catch(H){}var C=MusicPlayerControl.PlayerVersion.split(".");var D=false;var G=false;var F=false;var B=false;var A=false;if(E&&E.installedVer!=undefined){D=E.installedVer.major>C[0];G=E.installedVer.major==C[0];F=E.installedVer.minor>C[1];B=E.installedVer.minor==C[1];A=E.installedVer.rev>=C[2]}if(D||(G&&F)||(G&&B&&A)){if(E){E.addParam("allowScriptAccess","always");E.addParam("wmode","transparent");E.write(MusicPlayerControl.SwfObjectDiv)}}else{MusicPlayerControl.NeedUpgrade=true;document.getElementById(MusicPlayerControl.SwfObjectDiv).style.backgroundColor="#FFFFFF";if(MusicPlayerControl.FlashUpgradeEnabled){if(!MusicPlayerControl.IsPixelPlayer){document.getElementById(MusicPlayerControl.SwfObjectDiv).innerHTML=MusicPlayerControl.FlashUpgradeMarkup.replace("{0}",FlashUpgrade.GetFlashUpgradeURL(true));if(MySpace.ClientContext.FunctionalContext=="MusicSinglePlaylist"||MySpace.ClientContext.FunctionalContext=="ArtistAlbums"){$get("PlaylistsSinglePlayer").style.height="172px";$get("flashUpgradeBig").style.margin="0px 0px 0px 67px"}}else{}}else{document.getElementById(MusicPlayerControl.SwfObjectDiv).innerHTML='<span style="color:#000000;"><blockquote>'+MusicPlayerControl.ResourcesGetFlash+"</blockquote></span>"}}},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/Music/Handlers/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={Popup:null,AlbumOnlySong:false,BuyOptionObjects:null,ClickedWhileSongPlaying:null,ButtonMouseOver:function(D,B){if(D!=null&&B!=""){if(D.className==""){D.className=B}else{var E="";var A=D.className.split(" ");for(var C=0;C<A.length;C++){if(A[C]==B){return}}D.className+=" "+B}}},ButtonMouseOut:function(D,C){if(D!=null&&C!=""){var E="";var A=D.className.split(" ");for(var B=0;B<A.length;B++){if(A[B]!=C){E+=(E?" ":"")+A[B]}}D.className=E}},ButtonClicked:function(){if(Purchase.ClickTrackingEnabled()){Purchase.ButtonClickTracking()}MySpace.UI.hideElements=function(B,A){for(name in B){if(B[name]=="object"){B[name]=""}}for(var C=0;C<B.length;C++){var E=document.getElementsByTagName(B[C]);for(var D=0;D<E.length;D++){if(A){E[D].setAttribute("origvis",E[D].style.visibility)}E[D].style.visibility=A?"hidden":(E[D].getAttribute("origvis")?E[D].getAttribute("origvis"):"")}}};Purchase.OpenPopup(Purchase.CreatePopupContent())},RingtonesButtonClicked:function(A){if(Purchase.ClickTrackingEnabled()){Purchase.MakeBeaconRequest("","ringtones","jamster",MySpace.Application.keyDisabled("MusicJV_BuyButtonMultipleProviders"))}Ringtones.openBeta(A)},CreatePopupContent:function(){var j=0;var buyOptions=new Array();var ringtoneArtist="";var iTunesButton="<div id='poiTunesLogo'></div> 							<div id='poiTunesPrice'>"+MySpaceRes.Purchase.For+"</div>";var amazonButton="<div id='poAmazonLogo'></div> 							<div id='poAmazonPrice'>"+MySpaceRes.Purchase.For+"</div>";var jamsterButton="<div id='poRingtoneButtons'> 								<H5 class='poHfive'><span id='poBoldText' class='poBoldText'>"+MySpaceRes.Purchase.ChooseMp3s+"</span></H5> 								<div id='poRingtoneButton' class='poMusicButton' onclick=\"javascript:Purchase.RingtonesButtonClicked('{0}');\" > 									<div id='poJamsterLogo'></div> 									<div id='poJamsterPrice'>"+MySpaceRes.Purchase.Ringtones+"</div> 								</div> 							 </div>";var popupContent="<div id='po'> 								<div id='poGreeting'> 									<H2 class='poHtwo'>"+MySpaceRes.Purchase.GreatChoice+"</H2> 								</div>									<div id='poInformation'> 									<H5 class='poHfive'>"+MySpaceRes.Purchase.DownloadInformation+"</H5> 								</div> 								<div id ='poAlbumOnly'> 									<H5 class='poHfive'><span id='poBoldText' class='poBoldText' style='color:red !important;font-weight:bold !important;font-size:10px !important;'>"+MySpaceRes.Purchase.AlbumOnly+"</span></h5> 								</div> 								<div id='poMusicButtons'> 									<H5 class='poHfive'><span id='poBoldText' class='poBoldText'>"+MySpaceRes.Purchase.DownloadMp3s+"</span></H5>";var sortFunction=function(a,b){var c=a.providerName;var d=b.providerName;if(c>d){return -1}if(c<d){return 1}return 0};buyOptions=Purchase.BuyOptionObjects.split("|");for(j=0;j<buyOptions.length;j++){buyOptions[j]=eval("("+buyOptions[j]+")")}buyOptions.sort(sortFunction);for(j=0;j<buyOptions.length;j++){switch(buyOptions[j].purchaseType.toLowerCase()){case"song":popupContent=MySpaceMusic.textFormat(popupContent,buyOptions[j].mediaName,buyOptions[j].artistName);switch(buyOptions[j].providerName.toLowerCase()){case"amazon":popupContent+="<div id='poMusicButton' class='poMusicButton' onclick=\"javaScript:Purchase.SongClicked('"+buyOptions[j].providerName+"','"+buyOptions[j].productId+"','"+((buyOptions[j].mediaId!=null)?buyOptions[j].mediaId:"")+"','','');\">";popupContent+=MySpaceMusic.textFormat(amazonButton,(buyOptions[j].price=="")?"FREE":buyOptions[j].price);break;case"itunes":popupContent+="<div id='poMusicButton' class='poMusicButtonNoBackground' onclick=\"javaScript:Purchase.SongClicked('"+buyOptions[j].providerName+"','"+buyOptions[j].productId+"','"+((buyOptions[j].mediaId!=null)?buyOptions[j].mediaId:"")+"','','');\">";popupContent+=MySpaceMusic.textFormat(iTunesButton,(buyOptions[j].price=="")?"FREE":buyOptions[j].price);break;default:}popupContent+="</div>";break;case"albumonly":popupContent=MySpaceMusic.textFormat(popupContent,buyOptions[j].mediaName,buyOptions[j].artistName);switch(buyOptions[j].providerName.toLowerCase()){case"amazon":popupContent+="<div id='poMusicButton' class='poMusicButton' onclick=\"javaScript:Purchase.SongClicked('"+buyOptions[j].providerName+"','"+buyOptions[j].productId+"','"+((buyOptions[j].mediaId!=null)?buyOptions[j].mediaId:"")+"','','');\">";popupContent+=MySpaceMusic.textFormat(amazonButton,(buyOptions[j].price=="")?"FREE":buyOptions[j].price);break;case"itunes":popupContent+="<div id='poMusicButton' class='poMusicButtonNoBackground' onclick=\"javaScript:Purchase.SongClicked('"+buyOptions[j].providerName+"','"+buyOptions[j].productId+"','"+((buyOptions[j].mediaId!=null)?buyOptions[j].mediaId:"")+"','','');\">";popupContent+=MySpaceMusic.textFormat(iTunesButton,(buyOptions[j].price=="")?"FREE":buyOptions[j].price);break;default:}popupContent+="</div>";Purchase.AlbumOnlySong=true;break;case"album":popupContent=MySpaceMusic.textFormat(popupContent,buyOptions[j].mediaName,buyOptions[j].artistName);switch(buyOptions[j].providerName.toLowerCase()){case"amazon":popupContent+="<div id='poMusicButton' class='poMusicButton' onclick=\"javaScript:Purchase.AlbumClicked('"+buyOptions[j].providerName+"','"+buyOptions[j].productId+"','"+((buyOptions[j].mediaId!=null)?buyOptions[j].mediaId:"")+"','','');\">";popupContent+=MySpaceMusic.textFormat(amazonButton,(buyOptions[j].price=="")?"FREE":buyOptions[j].price);break;case"itunes":popupContent+="<div id='poMusicButton' class='poMusicButtonNoBackground' onclick=\"javaScript:Purchase.AlbumClicked('"+buyOptions[j].providerName+"','"+buyOptions[j].productId+"','"+((buyOptions[j].mediaId!=null)?buyOptions[j].mediaId:"")+"','','');\">";popupContent+=MySpaceMusic.textFormat(iTunesButton,(buyOptions[j].price=="")?"FREE":buyOptions[j].price);break;default:}popupContent+="</div>";break;case"playlist":popupContent="<div id='po'> 										<div id='poGreeting'> 											<H2 class='poHtwo'>"+MySpaceRes.Purchase.GreatChoice+"</H2> 										</div>											<div id='poInformation'> 											<H5 class='poHfive'>"+MySpaceRes.Purchase.DownloadInformationPlaylist+"</H5> 										</div> 										<div id ='poAlbumOnly'> 										</div> 										<div id='poMusicButtons'> 											<H5 class='poHfive'><span id='poBoldText' class='poBoldText'>"+MySpaceRes.Purchase.DownloadMp3s+"</span></H5>";popupContent=MySpaceMusic.textFormat(popupContent,buyOptions[j].artistName,buyOptions[j].mediaName);popupContent+="<div id='poMusicButton' class='poMusicButton' onclick=\"javaScript:Purchase.PlaylistClicked('"+buyOptions[j].providerName+"','"+buyOptions[j].productId+"','"+((buyOptions[j].mediaId!=null)?buyOptions[j].mediaId:"")+"','','');\">";popupContent+=MySpaceMusic.textFormat(amazonButton,buyOptions[j].price);popupContent+="</div>";break;case"ringtone":ringtoneArtist=buyOptions[j].artistName;break;default:}}popupContent+="</div>";if(ringtoneArtist!=""){popupContent+=MySpaceMusic.textFormat(jamsterButton,ringtoneArtist)}popupContent+="</div>";return popupContent},OpenPopup:function(A){jQuery(A).dialog({width:"small"})},AlbumClicked:function(provider,productId,albumId,artistName,albumName){if(Purchase.ClickTrackingEnabled()){Purchase.MakeBeaconRequest(albumId,"album",provider,MySpace.Application.keyDisabled("MusicJV_BuyButtonMultipleProviders"))}switch(provider.toLowerCase()){case"amazon":if(MusicPlayerControl.AllowAmazonInPlace==true&&productId!=undefined&&productId!=null&&productId!=""){Purchase.AmazonInPlace(productId)}else{Purchase.AmazonAffiliate(productId,"album")}break;case"itunes":if(productId!=undefined&&productId!=null&&productId!=""){var providers=eval("("+MusicPlayerControl.Providers+")");var urlCulture=MySpace.Cookies.MSCulture.get_values().IPCulture.toLowerCase();if(urlCulture=="en-au"||urlCulture=="en-nz"||urlCulture=="en-gb"){encodedProductId=encodeURIComponent(productId);iTunesURL=MySpaceMusic.textFormat(providers.iTunes.Address,encodedProductId+"%3F")}else{if(urlCulture=="en-us"||urlCulture=="es-us"){doubleEncodedProductId=encodeURIComponent(encodeURIComponent(productId));iTunesURL=MySpaceMusic.textFormat(providers.iTunes.Address,doubleEncodedProductId+"%253F")}else{iTunesURL=MySpaceMusic.textFormat(providers.iTunes.Address,"?"+productId)}}var newWindow=window.open(iTunesURL,"iTunesSA","status=yes, scrollbars=yes, resizable=yes, toolbar=yes, location=yes, directories=no, menubar=yes, width=950, height=700");MySpaceMusic.checkForPopUpBlocker(newWindow)}break;default:}},SongClicked:function(provider,productId,songId,artistName,songName){if(Purchase.ClickTrackingEnabled()){Purchase.MakeBeaconRequest(songId,"song",provider,MySpace.Application.keyDisabled("MusicJV_BuyButtonMultipleProviders"))}switch(provider.toLowerCase()){case"amazon":if(MusicPlayerControl.AllowAmazonInPlace==true&&productId!=undefined&&productId!=null&&productId!=""){Purchase.AmazonInPlace(productId)}else{Purchase.AmazonAffiliate(productId,"song")}break;case"itunes":if(productId!=undefined&&productId!=null&&productId!=""){var providers=eval("("+MusicPlayerControl.Providers+")");var urlCulture=MySpace.Cookies.MSCulture.get_values().IPCulture.toLowerCase();if(urlCulture=="en-au"||urlCulture=="en-nz"||urlCulture=="en-gb"){encodedProductId=encodeURIComponent(productId);iTunesURL=MySpaceMusic.textFormat(providers.iTunes.Address,encodedProductId+"%26")}else{if(urlCulture=="en-us"||urlCulture=="es-us"){doubleEncodedProductId=encodeURIComponent(encodeURIComponent(productId));iTunesURL=MySpaceMusic.textFormat(providers.iTunes.Address,doubleEncodedProductId+"%2526")}else{iTunesURL=MySpaceMusic.textFormat(providers.iTunes.Address,"?"+productId)}}var newWindow=window.open(iTunesURL,"iTunesSA","status=yes, scrollbars=yes, resizable=yes, toolbar=yes, location=yes, directories=no, menubar=yes, width=950, height=700");MySpaceMusic.checkForPopUpBlocker(newWindow)}break;default:}},PlaylistClicked:function(C,A,B){if(Purchase.ClickTrackingEnabled()){Purchase.MakeBeaconRequest(B,"playlist",C,MySpace.Application.keyDisabled("MusicJV_BuyButtonMultipleProviders"))}switch(C.toLowerCase()){case"amazon":switch(MySpace.ClientContext.FunctionalContext){case"MusicSinglePlaylist":buyPlaylistUrl=MySpaceMusic.textFormat("http://www.amazon.com/gp/browse.html?node={0}&tag={1}&ASINs={2}","1266319011","playlistpurchase-20",A);break;case"CelebrityPromo":buyPlaylistUrl=MySpaceMusic.textFormat("http://www.amazon.com/gp/browse.html?node={0}&tag={1}&ASINs={2}","1266319011","featuredplaylistpurchase-20",A);break;default:buyPlaylistUrl=MySpaceMusic.textFormat("http://www.amazon.com/gp/browse.html?node={0}&tag={1}&ASINs={2}","1266319011","mys0d05-20",A);break}window.open(buyPlaylistUrl,"AmazonSA","status=yes, scrollbars=yes, resizable=yes, toolbar=yes, location=yes, directories=no, menubar=yes, width=950, height=700");break;default:}},AmazonInPlace: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");MySpaceMusic.checkForPopUpBlocker(B)},AmazonAffiliate:function(B,A){standardAffUrl="http://www.amazon.com/dp/"+B;if(A=="album"){switch(MySpace.ClientContext.FunctionalContext){case"ArtistAlbums":standardAffUrl+="?tag=albumalbumpurchase-20";break;case"MusicSinglePlaylist":standardAffUrl+="?tag=playlistalbumpurchase-20";break;case"UserViewProfile":case"SitesProfile":if(MySpace.ProfileClientContext!=null&&MySpace.ProfileClientContext.ProfileType==7){standardAffUrl+="?tag=artistalbumpurchase-20"}else{if(MySpace.ProfileClientContext!=null&&MySpace.ProfileClientContext.ProfileType==8){standardAffUrl+="?tag=brandalbumpurchase-20"}else{standardAffUrl+="?tag=useralbumpurchase-20"}}break;case"CelebrityPromo":standardAffUrl+="?tag=featuredalbumpurchase-20";break;case"PopUpPlayer":standardAffUrl+="?tag=pompalbumpurchase-20";break;case"SiteSearch":standardAffUrl+="?tag=searchalbumpurchase-20";break;case"MusicTopCharts":standardAffUrl+="?tag=chartsalbumpurchase-20";break;default:standardAffUrl+="?tag=mys0d05-20"}}if(A=="song"){switch(MySpace.ClientContext.FunctionalContext){case"ArtistAlbums":standardAffUrl=standardAffUrl+"?tag=albumsongpurchase-20";break;case"MusicSinglePlaylist":standardAffUrl+="?tag=playlistsongpurchase-20";break;case"UserViewProfile":case"SitesProfile":if(MySpace.ProfileClientContext!=null&&MySpace.ProfileClientContext.ProfileType==7){standardAffUrl+="?tag=artistsongpurchase-20"}else{if(MySpace.ProfileClientContext!=null&&MySpace.ProfileClientContext.ProfileType==8){standardAffUrl+="?tag=brandsongpurchase-20"}else{standardAffUrl+="?tag=usersongpurchase-20"}}break;case"CelebrityPromo":standardAffUrl+="?tag=featuredsongpurchase-20";break;case"PopUpPlayer":standardAffUrl+="?tag=pompsongpurchase-20";break;case"Music":standardAffUrl+="?tag=msmhomesongpurchase-20";break;case"SiteSearch":standardAffUrl+="?tag=searchsongpurchase-20";break;case"MusicTopCharts":standardAffUrl+="?tag=chartssongpurchase-20";break;default:standardAffUrl=standardAffUrl+"?tag=mys0d05-20"}}var C=window.open(standardAffUrl,"AmazonSA","status=yes, scrollbars=yes, resizable=yes, toolbar=yes, location=yes, directories=no, menubar=yes, width=950, height=700");MySpaceMusic.checkForPopUpBlocker(C)},ButtonClickTracking:function(){try{if(Purchase.BuyOptionObjects){var buyOptions=Purchase.BuyOptionObjects.split("|");if(buyOptions.length>0){var providers="";for(var j=0;j<buyOptions.length;j++){buyOptions[j]=eval("("+buyOptions[j]+")");providers+=buyOptions[j].providerName.toLowerCase()+","}providers=providers.substring(0,providers.length-1);var srcType=buyOptions[0].purchaseType=="albumonly"?"song":buyOptions[0].purchaseType;Purchase.MakeBeaconRequest(buyOptions[0].mediaId,srcType,providers,true)}}}catch(e){}},findTopLevelElement:function(A){while(!(Sys.UI.DomElement.containsCssClass(A,"msm_draggablesong")||Sys.UI.DomElement.containsCssClass(A,"ui-draggable"))){A=A.parentNode;if(A.tagName.toLowerCase()==="body"){return null}}return A},AddMusicSearchClickTracking:function(C){var B=Purchase.ClickedBuyButton;if(C.srcType==="song"){var A=Purchase.findTopLevelElement(B);if(A!=null){C.albumid=A.getAttribute("msm_albumid");C.searchid=A.getAttribute("msm_searchid");C.pagenum=A.getAttribute("msm_pn");C.filter=A.getAttribute("msm_filter");C.sort=A.getAttribute("msm_sort");C.origin=A.getAttribute("msm_origin");C.dorigin=A.getAttribute("msm_dorigin");C.action=A.getAttribute("msm_action");C.rank=A.getAttribute("msm_rank")}}else{if(C.srcType==="album"){if(B.parentNode.id==="AlbumBuy"||B.parentNode.id==="AlbumBuyNew"){A=B.parentNode;C.artistid=A.getAttribute("msm_artistid");C.searchid=A.getAttribute("msm_searchid");C.pagenum=A.getAttribute("msm_pn");C.filter=A.getAttribute("msm_filter");C.sort=A.getAttribute("msm_sort");C.origin=A.getAttribute("msm_origin");C.dorigin=A.getAttribute("msm_dorigin");C.action=A.getAttribute("msm_action");C.rank=A.getAttribute("msm_rank")}}}return C},MakeBeaconRequest:function(E,B,C,A){var D;if(A){D={type:"musicbuybtn",srcType:B};if(E&&E!==""){if(B==="song"){D.songid=E}else{if(B==="album"){D.albumid=E}else{if(B==="playlist"){D.playlistid=E}}}}if(!MySpace.Application.keyDisabled("DWBeaconMusicBuyButton")){D.prov=C;if(MySpace.Application.keyDisabled("MusicJV_BuyButtonMultipleProviders")){D.lb="0"}else{D.lb="1"}}if(MySpace.ClientContext.FunctionalContext==="SiteSearch"&&!MySpace.Application.keyDisabled("DWBeaconMusicSearch")&&Purchase.ClickedBuyButton){D=Purchase.AddMusicSearchClickTracking(D)}}else{if(!MySpace.Application.keyDisabled("DWBeaconMusicBuyButton")){D={type:"musicbuylb",ptype:B,prov:C}}}if(D){MySpace.Beacon.Request(D)}},ClickTrackingEnabled:function(){return MySpace.BeaconData&&MySpace.Beacon&&(!MySpace.Application.keyDisabled("DWBeaconMusicBuyButton")||MySpace.ClientContext.FunctionalContext==="SiteSearch"&&!MySpace.Application.keyDisabled("DWBeaconMusicSearch"))}};var Ringtones={Popup:null,open:function(A){var C="";var B=[];MySpace.UI.hideElements=function(F,E){for(name in F){if(F[name]=="object"){F[name]=""}}for(var G=0;G<F.length;G++){var I=document.getElementsByTagName(F[G]);for(var H=0;H<I.length;H++){if(E){I[H].setAttribute("origvis",I[H].style.visibility)}I[H].style.visibility=E?"hidden":(I[H].getAttribute("origvis")?I[H].getAttribute("origvis"):"")}}};if(A!=""){A=A.replace(/[^A-Za-z0-9\s:-]/g,"").replace(/[\s]/g,"+");B=A.split(":");C=MusicPlayerControl.JambaUrl+B[0];switch(MySpace.Cookies.MSCulture.get_values().IPCulture.toLowerCase()){case"en-gb":var D=window.open(C,"JambaRingtones","status=no, scrollbars=no, resizable=no, toolbar=no, location=no, directories=no, menubar=no, width=757, height=721");MySpaceMusic.checkForPopUpBlocker(D);break;case"en-au":C="http://ad.jamster.com.au/landingpages/campaigns/int_o_flash/myspacemusic/?adv_partner=0017&partner_var=Music&artist="+B[0];var D=window.open(C,"JambaRingtones","status=no, scrollbars=no, resizable=no, toolbar=no, location=no, directories=no, menubar=no, width=757, height=721");MySpaceMusic.checkForPopUpBlocker(D);break;case"en-nz":C="http://ad.jamster.co.nz/landingpages/campaigns/int_o_flash/myspacemusic/?adv_partner=0017&partner_var=Music&artist="+B[0];var D=window.open(C,"JambaRingtones","status=no, scrollbars=no, resizable=no, toolbar=no, location=no, directories=no, menubar=no, width=757, height=721");MySpaceMusic.checkForPopUpBlocker(D);break;default:if(MySpace.ClientContext.FunctionalContext=="PopUpPlayer"){var D=window.open(C,"JambaRingtones","status=no, scrollbars=yes, resizable=no, toolbar=no, location=no, directories=no, menubar=no, width=780, height=820");MySpaceMusic.checkForPopUpBlocker(D)}else{content="<iframe id='ringtonesIframe' width='763' height='820' scrolling='no' style='border:0;' src='"+C+"'></iframe>";jQuery(content).dialog({width:"large:",height:700})}}}},openBeta:function(A){var B="";MySpace.UI.hideElements=function(E,D){for(name in E){if(E[name]=="object"){E[name]=""}}for(var F=0;F<E.length;F++){var H=document.getElementsByTagName(E[F]);for(var G=0;G<H.length;G++){if(D){H[G].setAttribute("origvis",H[G].style.visibility)}H[G].style.visibility=D?"hidden":(H[G].getAttribute("origvis")?H[G].getAttribute("origvis"):"")}}};if(A!=""){A=A.replace(/[^A-Za-z0-9\s:-]/g,"").replace(/[\s]/g,"+");B=MusicPlayerControl.JambaUrl+A;switch(MySpace.Cookies.MSCulture.get_values().IPCulture.toLowerCase()){case"en-gb":var C=window.open(B,"JambaRingtones","status=no, scrollbars=no, resizable=no, toolbar=no, location=no, directories=no, menubar=no, width=757, height=721");MySpaceMusic.checkForPopUpBlocker(C);break;case"en-au":B="http://ad.jamster.com.au/landingpages/campaigns/int_o_flash/myspacemusic/?adv_partner=0017&partner_var=Music&artist="+A;var C=window.open(B,"JambaRingtones","status=no, scrollbars=no, resizable=no, toolbar=no, location=no, directories=no, menubar=no, width=757, height=721");MySpaceMusic.checkForPopUpBlocker(C);break;case"en-nz":B="http://ad.jamster.co.nz/landingpages/campaigns/int_o_flash/myspacemusic/?adv_partner=0017&partner_var=Music&artist="+A;var C=window.open(B,"JambaRingtones","status=no, scrollbars=no, resizable=no, toolbar=no, location=no, directories=no, menubar=no, width=757, height=721");MySpaceMusic.checkForPopUpBlocker(C);break;default:if(MySpace.ClientContext.FunctionalContext=="PopUpPlayer"){var C=window.open(B,"JambaRingtones","status=no, scrollbars=yes, resizable=no, toolbar=no, location=no, directories=no, menubar=no, width=780, height=820");MySpaceMusic.checkForPopUpBlocker(C)}else{content="<iframe id='ringtonesIframe' width='763' height='820' scrolling='no' style='border:0;' src='"+B+"'></iframe>";jQuery(content).dialog({width:"large:",height:700})}}}},close:function(){var A=MySpaceMusic.getPlayerFlashObject();if(A!=null){A.resumeAfterRingtonesClose()}},ClosePopupCallback:function(){Ringtones.Popup._hide();Purchase.ButtonClicked()}};var MySpaceMusic={focusStatus:true,playerLoaded:false,prevSongID:null,prevArtistIDArray:null,isPlayingAudioAd:false,createPopUp:function(G,B,J,E,C){var I="";var K=G;var D=document.createElement("div");var F=50;var A=100;var H;if(C=="optin"){H=MySpace.UI.Popup.create(K,"");H.set_width(B+18);if(MySpace.ClientContext.FunctionalContext=="PopUpPlayer"&&C=="optin"){H.set_top(0)}else{if(C=="optin"&&Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version==6){H.set_top(F)}}}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){do{C+=A.offsetLeft;B+=A.offsetTop}while((A=A.offsetParent)&&MySpaceMusic.getElementStyle(A,"position")!="relative")}return{x:C,y:B}},getElementStyle:function(B,A){var C="";if(B.currentStyle){C=B.currentStyle[A]}else{if(document.defaultView&&document.defaultView.getComputedStyle){C=document.defaultView.getComputedStyle(B,null).getPropertyValue(A)}else{C=B[A]}}return C},showPopupBlockerMessage:function(){var C=false;var A=document.createElement("iframe");A.setAttribute("src","/modules/music/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},onBuyClickedFromHTML:function(A,B){if(document.getElementById("shell")){if((Sys.Browser.agent===Sys.Browser.Firefox)&&(MySpace.ClientContext.FunctionalContext==="UserViewProfile"||MySpace.ClientContext.FunctionalContext==="SitesProfile")){Purchase.ClickedWhileSongPlaying=document.getElementById("shell").getElementsByTagName("object")[0].getPlayingState();if(Purchase.ClickedWhileSongPlaying){document.getElementById("shell").getElementsByTagName("object")[0].pauseCurrentTrack()}}else{Purchase.ClickedWhileSongPlaying=document.getElementById("shell").getPlayingState();if(Purchase.ClickedWhileSongPlaying){document.getElementById("shell").pauseCurrentTrack()}}}Purchase.ClickedBuyButton=A;MySpaceMusic.onBuyClicked(B)},onBuyClicked:function(A){Purchase.BuyOptionObjects=A;Purchase.ButtonClicked()},onFindRingtoneClicked:function(B,A){if(MusicPlayerControl.AllowJamba){Ringtones.open(A)}},onPlayingTrack:function(E,F,D,B){if(MySpace.Ads&&MySpace.Ads.BandType){MySpace.Ads.BandType.Genre1=D[0];MySpace.Ads.BandType.Genre2=D[1];MySpace.Ads.BandType.Genre3=D[2]}if(E!=MySpaceMusic.prevSongID&&F!=MySpaceMusic.prevArtistIDArray){if(document.getElementById("feedResult")!=null){if(F[0]>0){if(document.getElementById("ArtistFeeds")!=null){MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.GetMultipleArtistsUpdateFromArtistUpdatesApi(F,MySpaceMusic.WebSvrManager.ArtistUpdateSuccess,MySpaceMusic.WebSvrManager.OnFailure)}else{MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.GetMultipleArtistsUpdate(F,MySpaceMusic.WebSvrManager.ArtistUpdateSuccess,MySpaceMusic.WebSvrManager.OnFailure)}}else{document.getElementById("feedResult").innerHTML='<br/><div class="activityFeedNoUpdate">'+MySpaceRes.PopUpPlayer.NoUpdatesForThisArtist+"</div>"}}MySpaceMusic.prevSongID=E;MySpaceMusic.prevArtistIDArray=F}if(document.getElementById("msaaSimilarSongsDiv")!=null){if(typeof(Carousel)!="undefined"&&E>0&&E!=Carousel.seedSong){if(typeof(PlayButton)!="undefined"&&!PlayButton.IsSimilarSong(PlayButton._oldElem)){var A=document.getElementById("shell").getSongMetadata();var C=(A[6]!=null)?A[6]:-1;Carousel.loadModule(E,C)}}}},showLoginOverlay:function(){MySpace.UI.LoginOverlayClient.show({loggedInCallback:MySpaceMusic.loggedInCallbackFunction,alreadyLoggedInCallback:MySpaceMusic.alreadyLoggedInCallbackFunction})},loggedInCallbackFunction:function(){document.getElementById("shell").onLogin(true,1)},alreadyLoggedInCallbackFunction:function(){document.getElementById("shell").onLogin(true,1)},onBuyAlbumClicked:function(B,C,A,D){Purchase.AlbumClicked("Amazon",B,C,A,D)},onBuySongClicked:function(B,D,A,C){Purchase.SongClicked("Amazon",B,D,A,C)},DisablePlayButtons:function(){try{jQuery.each($(".chrtSongd1d0CSS"),function(E,F){$(F).html($(F).html().replace(/onmouseover/,"offmouseover").replace(/onclick/,"offclick").replace(/title/,"offtitle").replace(/search_btn_play.gif/,"search_btn_playDisabled.gif"))})}catch(D){}try{images=document.getElementsByTagName("*");for(var B=0;B<images.length;B++){if(images[B].id.indexOf("PlayButton_")!=-1||images[B].id.indexOf("SimilarSong_")!=-1){images[B].onclick=function(){};try{images[B].setAttribute("onclick","");$clearHandlers(images[B])}catch(C){}images[B].style.opacity=".2";images[B].style.filter="alpha(opacity=20)";images[B].style["-ms-filter"]="progid:DXImageTransform.Microsoft.Alpha(Opacity=20)"}}}catch(A){}},EnablePlayButtons:function(){try{jQuery.each($(".chrtSongd1d0CSS"),function(D,E){$(E).html($(E).html().replace(/offmouseover/,"onmouseover").replace(/offclick/,"onclick").replace(/offtitle/,"title").replace(/search_btn_playDisabled.gif/,"search_btn_play.gif"))})}catch(C){}try{images=document.getElementsByTagName("*");for(var B=0;B<images.length;B++){if(images[B].id.indexOf("PlayButton_")!=-1||images[B].id.indexOf("SimilarSong_")!=-1){images[B].style.opacity="";images[B].style.filter="";images[B].style["-ms-filter"]="";$addHandler(images[B],"click",function(){if((typeof(PlayButton)!=="undefined")){PlayButton.OnClickPlaySongButton(this)}else{if((typeof(ButtonControls)!=="undefined")){ButtonControls.OnClickPlaySongButton(this)}}})}}}catch(A){}},onLockPlayerControls:function(){MySpaceMusic.isPlayingAudioAd=true;MySpaceMusic.DisablePlayButtons()},onUnLockPlayerControls:function(){MySpaceMusic.EnablePlayButtons();MySpaceMusic.isPlayingAudioAd=false},checkForPopUpBlocker:function(A){if(A){A.focus()}else{MySpaceMusic.showPopupBlockerMessage()}},MedRecRefresh:function(A){if(MySpace.ClientContext.FunctionalContext=="UserViewProfile"||MySpace.ClientContext.FunctionalContext=="SitesProfile"){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=515;popupContent="<iframe id='popupiframe' scrolling='no' style='border:0;overflow:hidden' src=\"/modules/music/pages/optindialog.aspx?userid="+B+"&songid="+F+"&playlistid="+D+"&artistid="+C+"&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");popup.show()},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){if(typeof(PlayButton)!="undefined"){Sys.UI.DomElement.removeCssClass(PlayButton._oldElem,PlayButton._oldElem.className);Sys.UI.DomElement.addCssClass(PlayButton._oldElem,PlayButton._oldClassName);PlayButton._oldElem.title=PlayButton._oldTitle;Sys.UI.DomElement.removeCssClass(PlayButton.oldParentElem,"isPlaying")}else{if(typeof(ButtonControls)!="undefined"){ButtonControls._oldElem.src=ButtonControls._oldSrc;ButtonControls._oldElem.title=ButtonControls._oldTitle;Sys.UI.DomElement.removeCssClass(ButtonControls.oldParentElem,"isPlaying")}}},onPausingCurrentTrack:function(){if(typeof SongList.SongItem.onPlayerPause=="function"){SongList.SongItem.onPlayerPause()}},onPlayingCurrentTrack:function(){if(typeof SongList.SongItem.onPlayerPlay=="function"){SongList.SongItem.onPlayerPlay()}},PlaySongInPOMP:function(D,B,A,E){try{document.getElementById("shell").playSong(D,B,A,E)}catch(C){}},onPlayerLoaded:function(){MySpaceMusic.playerLoaded=true;if((typeof SongList.SongListView.onPlayerLoaded)!="undefined"){SongList.SongListView.onPlayerLoaded()}},onShareClick:function(I,F,L,A,H,G,N,E,D,K){var B;if(L>0){B="http://www.myspace.com/{0}/music/songs/{1}".Format(D,L)}else{if(A>0){B="http://www.myspace.com/{0}/music/albums/{1}?songid={2}".Format(D,A,L)}else{if(K>0){B="http://www.myspace.com/{0}/music/playlists/{1}?songid={2}".Format(D,K,L)}}}var C=MySpaceRes.SingleSong.addThisTitle.Format(G,N);var M=jQuery(this);var J=new MySpace.UI.ShareButton(M);J.openPopup({url:B,title:C})},onEmbedClicked:function(K,H,O,A,J,I,P,F,N){var L=document.getElementById("shell");L=L.getElementsByTagName("object")[0];var E=MySpaceMusic.getElementPosition(L);var M=document.getElementById("musicFlashPlayerContent");var C=document.createElement("div");C.style.background="#F3F3F3";C.style.borderStyle="solid";C.style.borderWidth="5px";C.style.zIndex="500";C.style.width="240px";C.style.height="40px";C.style.position="absolute";C.style.top=E.y+H+"px";C.style.left=E.x+K+"px";var G=document.createElement("input");G.id="codeInput";G.value="<table style='background-color:#EDEDED;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;' width='400px' border='0'><tr><td><embed style='display:inline;' wmode='transparent' id='FlashDiv' FlashVars='"+O+"' AllowScriptAccess='always' src='http://lads-stage.myspace.com/Embeds/SongEmbed/SongEmbed.swf' width='400' height='77'></td></tr><tr style='font-family: Arial, sans-serif;padding-left:10px;margin-left:10px;font-size:small;color:#666666;'><td style='background-color:#D8D8D8;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;padding:5px;'>";G.style.zIndex="1000";G.style.position="absolute";G.style.top="10px";G.style.left="15px";G.style.height="15px";G.style.width="205px";G.style.fontSize="65%";C.appendChild(G);var D=document.createElement("div");D.style.zIndex="2000";D.style.backgroundImage="url(http://www.myspace.com/music/modules/common/static/img/closeButton.png)";D.style.position="absolute";D.style.width="6px";D.style.height="5px";D.style.top="5px";D.style.right="5px";D.onmouseup=function(){M.removeChild(C)};var B=seoTextReceved;C.appendChild(D);M.appendChild(C);jQuery.ajax({url:"http://www.myspace.com/music/song-embed?songid="+O+"&seoText=true",success:B})},seoTextreceved:function(B){var A=document.getElementById("codeInput");A.value+=B+"</td></tr></table>";A.style.visibility="visible"},AddThisFlashJS:function(){this.flashID=null;this.debug=false;this.divX=0;this.divY=0;this.addThisFlashDiv=null;this.init=function(C,F){this.debug=(F==true)?true:false;this.flashID=C;var D=document.getElementById(this.flashID);var B;if(Sys.Browser.agent==Sys.Browser.Firefox&&D.getElementsByTagName("object").length>0){var A=D.getElementsByTagName("object")[0];var E=MySpaceMusic.getElementPosition(A);if(E.x==0&&E.y==0){B=MySpaceMusic.getElementPosition(D)}else{B=E}}else{B=MySpaceMusic.getElementPosition(D)}this.divX=B.x;this.divY=B.y;this.addThisFlashDiv=document.getElementById("AddThisFlashDIV");if(!this.addThisFlashDiv){this.addThisFlashDiv=document.createElement("div");this.addThisFlashDiv.setAttribute("id","AddThisFlashDIV");this.addThisFlashDiv.style.position="absolute";this.addThisFlashDiv.style.zIndex=100000;this.addThisFlashDiv.style.visibility="hidden";this.addThisFlashDiv.style.width=(!this.debug)?"0px":"16px";this.addThisFlashDiv.style.height=(!this.debug)?"0px":"16px";if(this.debug){this.addThisFlashDiv.style.border="1px solid #FF0000"}document.getElementById(this.flashID).parentNode.appendChild(this.addThisFlashDiv)}};this.open=function(D,F,C,B,A,E){this.init(D,E);this.addThisFlashDiv.style.top=this.divY+B+"px";this.addThisFlashDiv.style.left=this.divX+A+"px";this.addThisFlashDiv.style.height="1px";this.addThisFlashDiv.style.width="1px";if(this.debug){this.addThisFlashDiv.style.visibility="visible"}else{return addthis_open(this.addThisFlashDiv,"",C,F)}};this.close=function(){if(this.debug){this.addThisFlashDiv.style.visibility="hidden"}else{addthis_close()}};this.sendto=function(){if(this.debug){this.addThisFlashDiv.style.visibility="hidden"}else{return addthis_sendto()}}}};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)}killPopupBlockerMessaging=function(){popupFrame=document.getElementById("amazonNoPopUp");document.body.removeChild(popupFrame)};String.prototype.Format=function(){var C=this;for(var A=0;A<arguments.length;A++){var B=new RegExp("\\{"+A+"\\}","g");C=C.replace(B,arguments[A])}return C};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)},GetMultipleArtistsUpdateFromArtistUpdatesApi:function(C,B,A,D){return this._invoke(MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.get_path(),"GetMultipleArtistsUpdateFromArtistUpdatesApi",false,{ArtistIds:C},B,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/Music/Handlers/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)};MySpace.Web.Modules.MusicV2.Services.PopUpPlayer.GetMultipleArtistsUpdateFromArtistUpdatesApi=function(B,C,A,D){MySpace.Web.Modules.MusicV2.Services.PopUpPlayer._staticInstance.GetMultipleArtistsUpdateFromArtistUpdatesApi(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){}};Type.registerNamespace("MySpace.Web.Modules.Common.Services");MySpace.Web.Modules.Common.Services.MusicPlaylists=function(){MySpace.Web.Modules.Common.Services.MusicPlaylists.initializeBase(this);this._timeout=0;this._userContext=null;this._succeeded=null;this._failed=null};MySpace.Web.Modules.Common.Services.MusicPlaylists.prototype={GetToken:function(B,A,C){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"GetToken",false,{},B,A,C)},IsUserOptedIn:function(B,C,A,D){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"IsUserOptedIn",false,{userId:B},C,A,D)},SetUserOptedId:function(B,C,D,A,E){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"SetUserOptedId",false,{userId:B,isOptedIn:C},D,A,E)},PublishPlaylistToProfile:function(B,D,C,A,E){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"PublishPlaylistToProfile",false,{userId:B,playlistId:D},C,A,E)},AddSongToPlayList:function(D,C,G,A,E,B,F){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"AddSongToPlayList",false,{userId:D,playListId:C,songId:G,albumId:A},E,B,F)},ReplaceSongInPlayListAndSetOptin:function(D,C,G,A,E,B,F){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"ReplaceSongInPlayListAndSetOptin",false,{userId:D,playListId:C,songId:G,albumId:A},E,B,F)},AddPlayList:function(C,A,F,D,E,B,G){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"AddPlayList",false,{userId:C,name:A,desc:F,isPublic:D},E,B,G)},RemovePlayList:function(C,B,D,A,E){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"RemovePlayList",false,{userId:C,playListId:B},D,A,E)},AddPlayListWithSong:function(D,A,C,H,B,F,I,G,E){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"AddPlayListWithSong",false,{userId:D,name:A,desc:C,isPublic:H,songId:B,albumId:F},I,G,E)},AddSongToPlayListAndSetOptin:function(E,D,H,B,A,F,C,G){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"AddSongToPlayListAndSetOptin",false,{userId:E,playListId:D,songId:H,albumId:B,setOptin:A},F,C,G)},CreateSpecialPlaylists:function(B,C,A,D){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"CreateSpecialPlaylists",false,{userId:B},C,A,D)},CreateSpecialPlaylistsWithSong:function(C,F,A,D,B,E){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"CreateSpecialPlaylistsWithSong",false,{userId:C,songId:F,albumId:A},D,B,E)},GetPlaylistImage:function(C,A,D,B,E){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"GetPlaylistImage",false,{userId:C,plid:A},D,B,E)},GetPlaylists:function(B,C,A,D){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"GetPlaylists",false,{userId:B},C,A,D)},GetLocalization:function(B,A,C){return this._invoke(MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path(),"GetLocalization",false,null,B,A,C)}};MySpace.Web.Modules.Common.Services.MusicPlaylists.registerClass("MySpace.Web.Modules.Common.Services.MusicPlaylists",Sys.Net.WebServiceProxy);MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance=new MySpace.Web.Modules.Common.Services.MusicPlaylists();MySpace.Web.Modules.Common.Services.MusicPlaylists.set_path=function(A){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance._path=A};MySpace.Web.Modules.Common.Services.MusicPlaylists.get_path=function(){return MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance._path};MySpace.Web.Modules.Common.Services.MusicPlaylists.set_timeout=function(A){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance._timeout=A};MySpace.Web.Modules.Common.Services.MusicPlaylists.get_timeout=function(){return MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance._timeout};MySpace.Web.Modules.Common.Services.MusicPlaylists.set_defaultUserContext=function(A){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance._userContext=A};MySpace.Web.Modules.Common.Services.MusicPlaylists.get_defaultUserContext=function(){return MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance._userContext};MySpace.Web.Modules.Common.Services.MusicPlaylists.set_defaultSucceededCallback=function(A){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance._succeeded=A};MySpace.Web.Modules.Common.Services.MusicPlaylists.get_defaultSucceededCallback=function(){return MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance._succeeded};MySpace.Web.Modules.Common.Services.MusicPlaylists.set_defaultFailedCallback=function(A){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance._failed=A};MySpace.Web.Modules.Common.Services.MusicPlaylists.get_defaultFailedCallback=function(){return MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance._failed};MySpace.Web.Modules.Common.Services.MusicPlaylists.set_path("/Modules/Common/Services/MusicPlaylists.asmx");MySpace.Web.Modules.Common.Services.MusicPlaylists.GetToken=function(B,A,C){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.GetToken(B,A,C)};MySpace.Web.Modules.Common.Services.MusicPlaylists.IsUserOptedIn=function(B,C,A,D){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.IsUserOptedIn(B,C,A,D)};MySpace.Web.Modules.Common.Services.MusicPlaylists.SetUserOptedId=function(B,C,D,A,E){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.SetUserOptedId(B,C,D,A,E)};MySpace.Web.Modules.Common.Services.MusicPlaylists.PublishPlaylistToProfile=function(B,C,D,A,E){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.PublishPlaylistToProfile(B,C,D,A,E)};MySpace.Web.Modules.Common.Services.MusicPlaylists.AddSongToPlayList=function(D,C,G,A,E,B,F){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.AddSongToPlayList(D,C,G,A,E,B,F)};MySpace.Web.Modules.Common.Services.MusicPlaylists.ReplaceSongInPlayListAndSetOptin=function(D,C,G,A,E,B,F){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.ReplaceSongInPlayListAndSetOptin(D,C,G,A,E,B,F)};MySpace.Web.Modules.Common.Services.MusicPlaylists.AddPlayList=function(C,A,F,D,E,B,G){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.AddPlayList(C,A,F,D,E,B,G)};MySpace.Web.Modules.Common.Services.MusicPlaylists.RemovePlayList=function(C,B,D,A,E){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.RemovePlayList(C,B,D,A,E)};MySpace.Web.Modules.Common.Services.MusicPlaylists.AddPlayListWithSong=function(E,A,D,I,C,H,G,B,F){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.AddPlayListWithSong(E,A,D,I,C,H,G,B,F)};MySpace.Web.Modules.Common.Services.MusicPlaylists.AddSongToPlayListAndSetOptin=function(E,D,H,B,A,F,C,G){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.AddSongToPlayListAndSetOptin(E,D,H,B,A,F,C,G)};MySpace.Web.Modules.Common.Services.MusicPlaylists.CreateSpecialPlaylists=function(B,C,A,D){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.CreateSpecialPlaylists(B,C,A,D)};MySpace.Web.Modules.Common.Services.MusicPlaylists.CreateSpecialPlaylistsWithSong=function(C,F,A,D,B,E){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.CreateSpecialPlaylistsWithSong(C,F,A,D,B,E)};MySpace.Web.Modules.Common.Services.MusicPlaylists.GetPlaylistImage=function(C,A,D,B,E){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.GetPlaylistImage(C,A,D,B,E)};MySpace.Web.Modules.Common.Services.MusicPlaylists.GetPlaylists=function(B,C,A,D){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.GetPlaylists(B,C,A,D)};MySpace.Web.Modules.Common.Services.MusicPlaylists.GetLocalization=function(B,A,C){MySpace.Web.Modules.Common.Services.MusicPlaylists._staticInstance.GetLocalization(B,A,C)};DialogWebService={_floating:false,_securityToken:null,_completeExecutionState:null,setup:function(A){DialogWebService._securityToken=A;Sys.Net.WebRequestManager.add_invokingRequest(DialogWebService.onInvokingRequest);Sys.Application.add_unload(DialogWebService.onPageUnload)},completeExecution:function(A){if(DialogWebService._completeExecutionState!=null){if(typeof(DialogWebService._completeExecutionState.handler)=="function"){return DialogWebService._completeExecutionState.handler(DialogWebService._completeExecutionState.params,A)}}DialogWebService._completeExecutionState=null;return null},addNewPlaylist:function(A,E,D,C){if(A!=null&&E!=null&&D!=null){if(A.replace(/\s/g,"").length>0){var B={handler:C,name:A,desc:E,ispublic:D};MySpace.Web.Modules.Common.Services.MusicPlaylists.AddPlayList(MySpace.ClientContext.UserId,A,E,D,DialogWebService.onCallSuccess,DialogWebService.onFailure,B);return true}}return false},addSongToPlaylist:function(F,A,G,H,C,B,E){H=parseInt(H);if(H<1||F==null){return false}F=parseInt(F);var D={playlistid:F,isprofile:A,songs:G,songid:H,albumid:B,handler:E};if(A=="true"&&F==-1){MySpace.Web.Modules.Common.Services.MusicPlaylists.CreateSpecialPlaylistsWithSong(MySpace.ClientContext.UserId,H,B,DialogWebService.onCallSuccess,DialogWebService.onFailure,D);return true}if(F<1){return false}G=parseInt(G);if(A=="true"&&!MusicDialogs.isUserOptedIn){DialogWebService._completeExecutionState={params:D,handler:function(I,J){if(J){MusicDialogs.isUserOptedIn=true;return MySpace.Web.Modules.Common.Services.MusicPlaylists.AddSongToPlayList(MySpace.ClientContext.UserId,I.playlistid,I.songid,I.albumid,DialogWebService.onCallSuccess,DialogWebService.onFailure,I)}return MySpace.Web.Modules.Common.Services.MusicPlaylists.ReplaceSongInPlayListAndSetOptin(MySpace.ClientContext.UserId,I.playlistid,I.songid,I.albumid,DialogWebService.onCallSuccess,DialogWebService.onFailure,I)}};MusicDialogs.showOptIn(null,DialogWebService._floating);return true}if(G>99){D.name=C;DialogWebService._completeExecutionState={params:D,handler:function(I){return MySpace.Web.Modules.Common.Services.MusicPlaylists.AddPlayListWithSong(MySpace.ClientContext.UserId,I.name,"",true,I.songid,I.albumid,DialogWebService.onCallSuccess,DialogWebService.onFailure,I)}};MusicDialogs.showDelete101th(null,DialogWebService._floating);return true}MySpace.Web.Modules.Common.Services.MusicPlaylists.AddSongToPlayList(MySpace.ClientContext.UserId,F,H,B,DialogWebService.onCallSuccess,DialogWebService.onFailure,D);return true},addNewPlaylistWithSong:function(B,G,F,E,A,D){var E=parseInt(E);if(E>0&&B!=null&&F!=null&&B.replace(/\s/g,"").length>0){var C={handler:D,name:B,desc:G,ispublic:F,songid:E,albumid:A};MySpace.Web.Modules.Common.Services.MusicPlaylists.AddPlayListWithSong(MySpace.ClientContext.UserId,B,G,F,E,A,DialogWebService.onCallSuccess,DialogWebService.onFailure,C);return true}return false},onInitialize:function(){},onInvokingRequest:function(B,A){if(DialogWebService._securityToken!=null&&DialogWebService._securityToken.length>0){A.get_webRequest().get_headers()["MySpace_Music_ServiceCheck"]=DialogWebService._securityToken}},onPageUnload:function(B,A){Sys.Net.WebRequestManager.remove_invokingRequest(DialogWebService.onInvokingRequest)},onCallSuccess:function(A,B){if(B!=null){B.result=A;if(typeof(B.handler)=="function"){B.handler(B)}}},onFailure:function(A,B){MusicDialogs.showError(null,DialogWebService._floating)}};try{if(MySpace&&MySpace.UI&&MySpace.UI.Music){DialogWebService.setup(MySpace.UI.Music.DialogWebServiceToken)}}catch(err){}var AddButton={findTopLevelElement:function(A){while(!(Sys.UI.DomElement.containsCssClass(A,"msm_draggablesong")||Sys.UI.DomElement.containsCssClass(A,"ui-draggable"))){A=A.parentNode;if(A.tagName.toLowerCase()==="body"){return null}}return A},OnClickAddSongButton:function(B){var A=AddButton.findTopLevelElement(B);if(A!=null){if((!MySpace.Application.keyDisabled("DWBeaconMusicSearch"))&&(MySpace.ClientContext.FunctionalContext==="SiteSearch")){MySpace.Beacon.Request({songid:jQuery(A).attr("msm_songid"),albumid:jQuery(A).attr("msm_albumid"),searchid:jQuery(A).attr("msm_searchid"),pagenum:jQuery(A).attr("msm_pn"),filter:jQuery(A).attr("msm_filter"),sort:jQuery(A).attr("msm_sort"),origin:jQuery(A).attr("msm_origin"),dorigin:jQuery(A).attr("msm_dorigin"),action:jQuery(A).attr("msm_action"),rank:jQuery(A).attr("msm_rank"),type:"add"})}else{if(A.className.indexOf("similarity")>-1&&!MySpace.Application.keyDisabled("DWBeaconMusicSimilarities")){MySpace.Beacon.Request({type:"songrec",song:jQuery(A).attr("msm_songid"),srcid:Carousel.seedSong,rank:parseInt(jQuery(A).attr("msm_rank"))+1,action:"addpl"})}}}MusicDialogs.showAddToPlaylist(B,jQuery(A).attr("msm_songid"),jQuery(A).attr("msm_songname"),jQuery(A).attr("msm_artistid"),jQuery(A).attr("msm_artistname"),true)},OnMouseOverAddSongButton:function(A){if(MySpaceMusic.playerLoaded){A.style.cursor="pointer"}}};MusicDialogs={isNonJv:false,nonJVAddSongURL:null,closeDialog:true,init:function(A,B){MusicDialogs.isNonJv=A;MusicDialogs.nonJVAddSongURL=B},showError:function(A,E){var C="<p>{0}</p>";var D=MySpaceRes.MusicDialogs;C=String.format(C,D.MyMusicError2);var B={};B[D.Ok]=function(){};MusicDialogs.showDialog("small",D.MyMusicError,C,B)},showDelete101th:function(A,E){var C="<p>{0}</p>";var D=MySpaceRes.MusicDialogs;C=String.format(C,D.WouldYouLike);var B={};B[D.CancelCaps]=function(){};B[D.CreateANewPlaylistCaps]=function(){MusicDialogs.completeExecution(this)};MusicDialogs.showDeleteDialog("small",D.MaxSongsInPlaylist,C,B)},showOptIn:function(A,E){var C='<div id="optingInDialog" class="musicDialog"><div class="players"><div class="onePlayer"><p class="title">{1}</p><div class="img"></div></div><div class="playlistPlayer"><p class="title">{2}</p><div class="img"></div></div></div>';var D=MySpaceRes.MusicDialogs;C=String.format(C,D.optInMessage2,D.optInMessage3);var B={};B[D.GetMiniPlayer]=function(){MusicDialogs.completeExecution("optingInDialog",false)};B[D.GetProfilePlayer]=function(){MusicDialogs.completeExecution("optingInDialog",true)};MusicDialogs.showDialog("large",D.optInMessage1,C,B)},showNewPlaylist:function(A,E){if(MySpace.ClientContext.IsLoggedIn){var C='<div id="newPlaylistDialog" class="musicDialog"><p class="legend">{0}</p><p><label for="newName">{1}:</label></p><p><input id="newPlaylistDialogName" name="newName" type="text"></p><p><label for="newDesc">{2}:</label></p><p><textarea id="newPlaylistDialogDesc" name="newDesc"></textarea></p><p><input id="newPlaylistDialogIsPrivate" name="newIsPrivate" type="checkbox"><label for="newIsPrivate">{3}</label></p></div>';var D=MySpaceRes.MusicDialogs;C=String.format(C,D.AddToPlaylist,D.PlaylistName,D.PlaylistDesc,D.MakePLPublic);var B={};B[D.Cancel]=function(){};B[D.Ok]=function(){MusicDialogs.addToPlaylist(this)};MusicDialogs.showDialog("small",D.AddToPlaylist,C,B)}else{MusicDialogs.showDialog("small",null,null,null)}},showAddToPlaylist:function(element,songid,songname,artistid,artistname,floating){var PlaylistDialogName="";if(artistname!=""){PlaylistDialogName=artistname+" Mix"}if(MySpace.ClientContext.IsLoggedIn){MySpace.Web.Modules.Common.Services.MusicPlaylists.GetPlaylists(MySpace.ClientContext.UserId,function(result){var content='<div class="musicDialog"><div class="option"><input checked="checked" type="radio" id="addToExistingPlaylistRadio" name="PlaylistType" /><select id="slPlayLists"><option value="">{1}</option></select><p class="title">{2}</p></div><div class="option"><input type="radio" id="addToNewPlaylistRadio" name="PlaylistType" /><input id="addToNewPlaylistDialogName" name="newName" value="'+PlaylistDialogName+'" type="text" disabled="disabled"/><p id="makeplaylist"><input id="addToPlaylistDialogIsPrivate" name="newIsPrivate" type="checkbox" /><label for="newIsPrivate">{3}</label></p><input type="hidden" id="songid" value="{4}"><input type="hidden" id="songname" value="{5}"></div>';var playlistData=eval(result.d);var localization=MySpaceRes.MusicDialogs;content=String.format(content,localization.addToPlaylist,localization.choosePlaylist,localization.CreateANewPlayList,localization.MakePLPublic,songid,songname);if(playlistData.length>0){jQuery(playlistData).each(function(){content=jQuery(content).find("select").append('<option msm_plid="'+this.PlaylistId+'" msm_isprofile="'+this.IsProfilePlaylist+'" msm_songs="'+this.MediaCount+'">'+MusicDialogs.DecodeData(this.Title)+"</option>").end()})}var buttons={};buttons[localization.cancel]=function(){};buttons[localization.Ok]=function(){MusicDialogs.addToPlaylist(this)};MusicDialogs.showDialog("small",localization.AddToPlaylist,content,buttons);jQuery("#makeplaylist").hide()})}else{MusicDialogs.showDialog("small",null,null,null)}},addNewPlaylist:function(D){var A=null;var C=null;var B=false;if(D=="newPlaylistDialog"){A=$get("newPlaylistDialogName").value;C=$get("newPlaylistDialogDesc").value;B=$get("newPlaylistDialogIsPrivate").checked}if(DialogWebService.addNewPlaylist(A,C,!B,MusicDialogs.onAddNewPlaylist)){MusicDialogs.close(D)}else{alert(MySpaceRes.MyPlaylistsControl.pleaseEnterName)}},completeExecution:function(B,A){jQuery(B).dialog("close");DialogWebService.completeExecution(A)},addToPlaylist:function(container){MusicDialogs.closeDialog=true;with(jQuery(container)){var songid=find("#songid").val();var songname=find("#songname").val();if(find("#addToNewPlaylistRadio").is(":checked")){var isprivate=find("#addToPlaylistDialogIsPrivate").is(":checked");var name=MusicDialogs.EncodeData(find("#addToNewPlaylistDialogName").val());if(DialogWebService.addNewPlaylistWithSong(name,null,!isprivate,songid,null,MusicDialogs.onAddNewPlaylist)){jQuery(container).dialog("close")}else{alert(MySpaceRes.MyPlaylistsControl.pleaseEnterName);MusicDialogs.closeDialog=false}}else{if(find("#addToExistingPlaylistRadio").is(":checked")){var playlistid=find("#slPlayLists :selected").attr("msm_plid");var isprofile=find("#slPlayLists :selected").attr("msm_isprofile");var songs=find("#slPlayLists :selected").attr("msm_songs");if(DialogWebService.addSongToPlaylist(playlistid,isprofile,songs,songid,songname,null,MusicDialogs.onAddToPlaylist)){jQuery(container).dialog("close")}else{alert(MySpaceRes.MyPlaylistsControl.pleaseEnterName);MusicDialogs.closeDialog=false}}}}},select:function(C,A,B){var D=MySpace.UI.getElementsByClassName(C);for(i=0;i<D.length;i++){Sys.UI.DomElement.removeCssClass(D[i],A)}Sys.UI.DomElement.addCssClass(B,A)},onAddNewPlaylist:function(A){if(A){var C=$get("addToPlaylistComboList");var B=document.createElement("li");B.setAttribute("msm_plid",A.result);B.setAttribute("msm_isprofile","false");B.setAttribute("msm_songs","1");$addHandler(B,"onmouseover",function(D){D.target.style.backgroundColor="#64c8f1"});$addHandler(B,"onmouseout",function(D){D.target.style.backgroundColor="transparent"});$addHandler(B,"click",function(D){MusicDialogs.selectComboItem(D.target)});B.innerHTML=A.name;C.appendChild(B)}},onAddToPlaylist:function(B){if(B){var A=0;if(B.name){MusicDialogs.onAddNewPlaylist(B);return}}},showPendingDialog:function(){jQuery("#dialogBox").html("");jQuery("#dialogBox").html('<img class="preloader" src="/Modules/Music/Static/img/circle_spin_busy.gif"/>').dialog({width:"small"})},showDialog:function(A,D,C,B){if(!MySpace.ClientContext.IsLoggedIn){C=String.format('<div><p>{0}</p><br /><p><a href="#" onclick="MySpaceMusic.EnforceLogin();">{1}</a></p></div>',MySpaceRes.MusicDialogs.LoginWarning,MySpaceRes.MusicDialogs.ClickToLogin);B=[]}jQuery("#dialogBox").empty();jQuery("#dialogBox").append(C);jQuery("#dialogBox #addToExistingPlaylistRadio").click(function(){jQuery("#dialogBox #slPlayLists").removeAttr("disabled");jQuery("#dialogBox #addToNewPlaylistDialogName").attr("disabled","disabled");jQuery("#dialogBox #makeplaylist").hide()});jQuery("#dialogBox #addToNewPlaylistRadio").click(function(){jQuery("#dialogBox #slPlayLists").attr("disabled","disabled");jQuery("#dialogBox #addToNewPlaylistDialogName").removeAttr("disabled");jQuery("#dialogBox #makeplaylist").show()});jQuery("#dialogBox").dialog({title:D,width:A,buttons:B,beforeClose:function(F,E){var H=MySpaceRes.MusicDialogs;var G=jQuery(F.currentTarget.activeElement).html();if(G==H.cancel||F.button!=undefined){return true}else{if(G==H.Ok){return MusicDialogs.closeDialog}}}})},showDeleteDialog:function(A,D,C,B){if(!MySpace.ClientContext.IsLoggedIn){C=String.format('<div><p>{0}</p><br /><p><a href="#" onclick="MySpaceMusic.EnforceLogin();">{1}</a></p></div>',MySpaceRes.MusicDialogs.LoginWarning,MySpaceRes.MusicDialogs.ClickToLogin);B=[]}jQuery(C).dialog({title:D,width:A,buttons:B})},EncodeData:function(A){encodedText=A.replace(/&/g,"&amp;");encodedText=encodedText.replace(/</g,"&lt;");encodedText=encodedText.replace(/>/g,"&gt;");encodedText=encodedText.replace(/"/g,"&quot;");encodedText=encodedText.replace(/'/g,"&#39;");encodedText=encodedText.replace(/\\/g,"&#092;");return encodedText},DecodeData:function(A){decodedText=A.replace(/&amp;/g,"&");decodedText=decodedText.replace(/&lt;/g,"<");decodedText=decodedText.replace(/&gt;/g,">");decodedText=decodedText.replace(/&quot;/g,'"');decodedText=decodedText.replace(/&#39;/g,"'");decodedText=decodedText.replace(/&#092;/g,"\\");return decodedText}};jQuery(document).ready(function(){DialogWebService.onInitialize();jQuery("body").append('<div id="dialogBox"></div>')});var PlayButton={_publicPlaylistPlayer:9,_oldParentElem:null,_oldElem:null,_iter:0,_oldClassName:"",_oldTitle:"",findTopLevelElement:function(A){while(!(Sys.UI.DomElement.containsCssClass(A,"msm_draggablesong")||Sys.UI.DomElement.containsCssClass(A,"ui-draggable"))){A=A.parentNode;if(A.tagName.toLowerCase()==="body"){return null}}return A},shadowSongInPage:function(B){var E=null;var F=MySpace.UI.getElementsByClassName("msm_draggablesong");for(E in F){try{var D=F[E].getAttribute("msm_index");if(B==D){if((Sys.UI.DomElement.containsCssClass(F[E],"isPlaying"))){return}if(PlayButton._oldElem){Sys.UI.DomElement.removeCssClass(PlayButton._oldElem,PlayButton._oldElem.className);Sys.UI.DomElement.addCssClass(PlayButton._oldElem,PlayButton._oldClassName);PlayButton._oldElem.title=PlayButton._oldTitle}if(PlayButton._oldParentElem){Sys.UI.DomElement.removeCssClass(PlayButton._oldParentElem,"isPlaying")}PlayButton._oldParentElem=F[E];var A="PlayButton_"+F[E].getAttribute("msm_songid")+"_"+B;PlayButton._oldElem=document.getElementById(A);Sys.UI.DomElement.addCssClass(F[E],"isPlaying");if(PlayButton._oldElem){PlayButton._oldClassName=PlayButton._oldElem.className;PlayButton._oldTitle=PlayButton._oldElem.title;Sys.UI.DomElement.addCssClass(PlayButton._oldElem,"bttnPause");PlayButton._oldElem.title=MySpaceRes.MyPlaylistsControl.PauseSong}return}}catch(C){}}},playSongInPage:function(B){if(document.getElementById("shell")){var D=PlayButton.findTopLevelElement(B);if((Sys.UI.DomElement.containsCssClass(D,"isPlaying"))){if(B.title!=MySpaceRes.MyPlaylistsControl.PauseSong){Sys.UI.DomElement.removeCssClass(B,"fullPlay");Sys.UI.DomElement.removeCssClass(B,"samplePlay");Sys.UI.DomElement.addCssClass(B,"bttnPause");B.title=MySpaceRes.MyPlaylistsControl.PauseSong;document.getElementById("shell").playCurrentTrack()}else{B.className=PlayButton._oldClassName;B.title=PlayButton._oldTitle;document.getElementById("shell").pauseCurrentTrack()}}else{var A=false;if(PlayButton._oldElem){var G=D.getAttribute("msm_index");if(G!=null&&Sys.UI.DomElement.containsCssClass(PlayButton._oldElem,"subModule")){A=true}if(Sys.UI.DomElement.containsCssClass(PlayButton._oldParentElem,"isPlaying")){Sys.UI.DomElement.removeCssClass(PlayButton._oldParentElem,"isPlaying")}PlayButton._oldElem.className=PlayButton._oldClassName;PlayButton._oldElem.title=PlayButton._oldTitle}PlayButton._oldParentElem=D;PlayButton._oldElem=B;Sys.UI.DomElement.addCssClass(D,"isPlaying");PlayButton._oldClassName=B.className;PlayButton._oldTitle=B.title;Sys.UI.DomElement.removeCssClass(B,"fullPlay");Sys.UI.DomElement.removeCssClass(B,"samplePlay");Sys.UI.DomElement.addCssClass(B,"bttnPause");B.title=MySpaceRes.MyPlaylistsControl.PauseSong;var G=D.getAttribute("msm_index");if(G!=null){var J=(MusicPlayerControl.PlayerType==PlayButton._publicPlaylistPlayer)?"msm_playlistid":"msm_albumid";var F=(MusicPlayerControl.PlayerType==PlayButton._publicPlaylistPlayer)?MySpace.ClientContext.DisplayFriendId:D.getAttribute("msm_artistid");var C=D.getAttribute(J);if(A){PlayButton.loadPlayerList(J,F,C,G)}document.getElementById("shell").playSongAtIndex(C,G)}else{var E=D.getAttribute("msm_songid");var H=D.getAttribute("msm_albumid");var I=PlayButton._oldClassName.indexOf("samplePlay")!=-1;document.getElementById("shell").playSong(E,null,H,null,true,I)}}}},InitializePlayer:function(){if((typeof(MySpaceMusic)!=="undefined")&&MySpaceMusic.onPlayingTrack!=null){var A=$get("flashUpgradeBig");if(MySpace.ClientContext.FunctionalContext=="SiteSearch"){var B=$get("flashUpgradeBig");if(!((typeof B=="undefined")||(!B)||(B==null))){Sys.UI.DomElement.addCssClass(B,"fixPlayerPlay");B.style.position="fixed";if((Sys.Browser.agent==Sys.Browser.InternetExplorer)&&(Sys.Browser.version==6)){B.style.position="absolute";B.style.top="20px";B.style.left="50px"}}}MySpaceMusic.onPlayingCurrentTrack=function(){if(!PlayButton._oldElem||!Sys.UI.DomElement.containsCssClass(PlayButton._oldElem,"subModule")){try{var C=document.getElementById("shell").getCurrentSongIndex();PlayButton.shadowSongInPage(C)}catch(D){}}if(PlayButton._oldElem){Sys.UI.DomElement.addCssClass(PlayButton._oldElem,"bttnPause");PlayButton._oldElem.title=MySpaceRes.MyPlaylistsControl.PauseSong}};MySpaceMusic.onPausingCurrentTrack=function(){if(PlayButton._oldElem){PlayButton._oldElem.className=PlayButton._oldClassName;PlayButton._oldElem.title=PlayButton._oldTitle}}}},CreateFlashUpgradePopup:function(){var B=MusicPlayerControl.FlashUpgradeMarkup.replace("{0}",FlashUpgrade.GetFlashUpgradeURL(true));var A=MySpace.UI.Popup.create(B,"");MySpace.UI.getElementsByClassName("popup_box")[PlayButton._iter].style.height="220px";MySpace.UI.getElementsByClassName("popup_box")[PlayButton._iter].style.backgroundColor="#e6e7e8";MySpace.UI.getElementsByClassName("popup_box")[PlayButton._iter].style.width="311px";MySpace.UI.getElementsByClassName("popup_box")[PlayButton._iter].style.padding="17px";MySpace.UI.getElementsByClassName("popup_box")[PlayButton._iter].style.border="3px solid #000000";MySpace.UI.getElementsByClassName("popup_x")[PlayButton._iter].style.background="transparent url(http://x.myspacecdn.com/modules/musicv2/static/img/close_button.gif) no-repeat scroll 0";MySpace.UI.getElementsByClassName("popup_x")[PlayButton._iter].style.backgroundPosition="right";MySpace.UI.getElementsByClassName("popup_x")[PlayButton._iter].style.top="8px";MySpace.UI.getElementsByClassName("popup_title")[PlayButton._iter].style.height="22px";MySpace.UI.getElementsByClassName("popup_title")[PlayButton._iter].style.background="transparent url() no-repeat scroll 0";MySpace.UI.getElementsByClassName("popup_content")[PlayButton._iter].style.backgroundColor="#e6e7e8";MySpace.UI.getElementsByClassName("popup_content")[PlayButton._iter].style.padding="0px";MySpace.UI.getElementsByClassName("popup_content")[PlayButton._iter].style.border="0px";MySpace.UI.getElementsByClassName("flashUpgradeDiv")[PlayButton._iter].style.border="0px";MySpace.UI.getElementsByClassName("flashUpgradeDiv")[PlayButton._iter].style.backgroundColor="#e6e7e8";A.show();PlayButton._iter++},IsCurrentState:function(A,B){return A.src.search(A.getAttribute(B))!=-1},IsSimilarSong:function(A){var B=false;if(A!=null){var C=A.getAttribute("id");if(C!=null){B=C?C.search("SimilarSong_")!=-1:false}}return B},loadPlayerList:function(C,B,A,D){var E=document.getElementById("shell");if(E!=null){if(C=="msm_playlistid"){E.load_playlist(B,A,D)}else{if(C=="msm_albumid"){E.load_album(B,A,D)}}}},OnClickPlaySongButton:function(B){if((MySpaceMusic.playerLoaded)&&(typeof(MusicPlayerControl)!=="undefined")&&(typeof(PlayButton)!=="undefined")){var A=PlayButton.findTopLevelElement(B);if(A!=null){if((!MySpace.Application.keyDisabled("DWBeaconMusicSearch"))&&(B.title!=MySpaceRes.MyPlaylistsControl.PauseSong)&&(MySpace.ClientContext.FunctionalContext==="SiteSearch")){MySpace.Beacon.Request({songid:A.getAttribute("msm_songid"),albumid:A.getAttribute("msm_albumid"),searchid:A.getAttribute("msm_searchid"),pagenum:A.getAttribute("msm_pn"),filter:A.getAttribute("msm_filter"),sort:A.getAttribute("msm_sort"),origin:A.getAttribute("msm_origin"),dorigin:A.getAttribute("msm_dorigin"),action:A.getAttribute("msm_action"),rank:A.getAttribute("msm_rank"),type:"play"})}else{if(A.className.indexOf("similarity")>-1&&!MySpace.Application.keyDisabled("DWBeaconMusicSimilarities")){MySpace.Beacon.Request({type:"songrec",song:A.getAttribute("msm_songid"),srcid:Carousel.seedSong,rank:parseInt(A.getAttribute("msm_rank"))+1,action:"play"})}}}if(MusicPlayerControl.FlashUpgradeEnabled&&MusicPlayerControl.NeedUpgrade&&MusicPlayerControl.IsPixelPlayer){PlayButton.CreateFlashUpgradePopup()}else{if(document.getElementById("shell")&&document.getElementById("shell").playSong){PlayButton.playSongInPage(B)}}}},OnMouseOverPlaySongButton:function(A){if(MySpaceMusic.playerLoaded){A.style.cursor="pointer"}},Buttons:function(){return MySpace.UI.getElementsByClassName("playButton")},NowPlaying:null,Player:function(){if(PlayButton.NowPlaying){if(PlayButton.NowPlaying.getAttribute("data-playerId")){return document.getElementById(PlayButton.NowPlaying.getAttribute("data-playerId"))}}return document.getElementById("shell")},initialize:function(){if(MySpaceMusic.addEventListener){MySpaceMusic.addEventListener("onPlayingTrack",PlayButton.onPlayingTrack);MySpaceMusic.addEventListener("onPlayingCurrentTrack",PlayButton.onPlayingCurrentTrack);MySpaceMusic.addEventListener("onPausingCurrentTrack",PlayButton.onPausingCurrentTrack);MySpaceMusic.addEventListener("onStop",PlayButton.onStop);MySpaceMusic.addEventListener("onLockPlayerControls",PlayButton.onLockPlayerControls);MySpaceMusic.addEventListener("onUnLockPlayerControls",PlayButton.onUnLockPlayerControls)}},onClick:function(F){if(!F){var F=window.event}if(F.preventDefault){F.preventDefault()}else{if(F.returnValue){F.returnValue=false}}var E=F.srcElement||F.target;if(Sys.UI.DomElement.containsCssClass(E,"notPlayable")||Sys.UI.DomElement.containsCssClass(E,"locked")){return}if(PlayButton.NowPlaying===E){if(PlayButton.Player().getPlayingState()===1){PlayButton.Player().pauseCurrentTrack()}else{PlayButton.Player().playCurrentTrack()}}else{if(PlayButton.NowPlaying){Sys.UI.DomElement.removeCssClass(PlayButton.NowPlaying,"playing")}PlayButton.NowPlaying=E;Sys.UI.DomElement.addCssClass(PlayButton.NowPlaying,"playing");var H=PlayButton.NowPlaying.getAttribute("data-songId");var B=PlayButton.NowPlaying.getAttribute("data-albumId");var G=PlayButton.NowPlaying.getAttribute("data-playlistId");var C=PlayButton.NowPlaying.getAttribute("data-artistId");var A=PlayButton.NowPlaying.getAttribute("data-songIndex");var D=Sys.UI.DomElement.containsCssClass(PlayButton.NowPlaying,"sampleOnly");if(B>0){PlayButton.Player().playSongAtIndex(B,A)}else{if(G>0||G==-1){PlayButton.Player().playSongAtIndex(G,A)}else{PlayButton.Player().playSong(H,C,B,null,true,D)}}}},onStop:function(C,B){var D=PlayButton.Buttons();for(var A in D){if(D[A].getAttribute("data-songId")==C){Sys.UI.DomElement.removeCssClass(D[A],"playing");PlayButton.NowPlaying=null;return}}},onLockPlayerControls:function(){try{var C=PlayButton.Buttons();for(var B in C){Sys.UI.DomElement.addCssClass(C[B],"locked")}}catch(A){}},onUnLockPlayerControls:function(){try{var C=PlayButton.Buttons();for(var B in C){Sys.UI.DomElement.removeCssClass(C[B],"locked")}}catch(A){}},onPlayingCurrentTrack:function(){var C=PlayButton.Player().getSongMetadata();var D=C[4];var A=PlayButton.Player().getCurrentSongIndex();if(PlayButton.NowPlaying){if(PlayButton.NowPlaying.getAttribute("data-songId")==D&&PlayButton.NowPlaying.getAttribute("data-songIndex")==A){Sys.UI.DomElement.addCssClass(PlayButton.NowPlaying,"playing");return}else{Sys.UI.DomElement.removeCssClass(PlayButton.NowPlaying,"playing")}}var E=PlayButton.Buttons();for(var B in E){if(E[B].getAttribute("data-songIndex")==A&&E[B].getAttribute("data-songId")==D){PlayButton.NowPlaying=E[B];Sys.UI.DomElement.addCssClass(PlayButton.NowPlaying,"playing");return}}},onPausingCurrentTrack:function(){var B=PlayButton.Player().getSongMetadata();var C=B[4];var D=PlayButton.Buttons();for(var A in D){if(D[A].getAttribute("data-songId")==C&&PlayButton.Player().getPlayingState()!==1){Sys.UI.DomElement.removeCssClass(PlayButton.NowPlaying,"playing")}}},onPlayingTrack:function(E,G,D,C,A){var F=PlayButton.Buttons();for(var B in F){if(F[B].getAttribute("data-songIndex")==A&&F[B].getAttribute("data-songId")==E){if(PlayButton.NowPlaying){Sys.UI.DomElement.removeCssClass(PlayButton.NowPlaying,"playing")}PlayButton.NowPlaying=F[B];return}}}};PlayButton.initialize();
