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={focusStatus:true,Focus:function(){MySpaceMusic.focusStatus=true},Blur:function(){MySpaceMusic.focusStatus=false}};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)}}}MySpaceMusic.WebSvrManager={ArtistUpdateSuccess:function(A,B){if(A!=null){document.getElementById("feedResult").innerHTML=A}},OnFailure:function(A){}};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}};MySpaceMusic.openTooltip=function(){MySpaceMusic.closeTooltip();var E=286;var G=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=getElementPosition(B);var D=0;if(B.offsetWidth>G){D=(B.offsetWidth-G)/2}var F=(MusicPlayerControl.Width=="450")?44:99;var C=".tooltipdiv .helper{background:none;border:none;}.tooltipdiv .helperarrow{display:none;}.tooltipleft{margin-left:10px;}";addStyles(C);content="<iframe scrolling='no' style='position:absolute;' id='musicFlashPlayerContent' height='"+E+"' width='"+G+"' 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=(A.x+D)+"px";window.tip._tipDiv.style.top=(A.y+F)+"px"};MySpaceMusic.closeTooltip=function(){if(typeof(window.tip)!="undefined"){window.tip.hide()}};function MedRecDismiss(){MySpaceMusic.closeTooltip()}function onClickContinueListen(){if(window.parent.tip!=undefined){window.parent.tip.hide();window.parent.getPlayerFlashObject().playCurrentTrack()}}function getPlayerFlashObject(){var A=document.getElementsByTagName("object");for(i in A){if(typeof(A[i].playSong)!="undefined"){return A[i]}}return null}function addStyles(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}}}function createPopUp(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}}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>";var H=$create(MySpace.UI._Popup,{title:I,content:K,left:0,top:F},null,null,D.firstChild);return H}MySpaceMusic.onFindRingtoneClicked=function(B,A){if(MusicPlayerControl.AllowJamba){MySpace.UI.hideElements=function(I,H){for(name in I){if(I[name]=="object"){I[name]=""}}for(var J=0;J<I.length;J++){var L=document.getElementsByTagName(I[J]);for(var K=0;K<L.length;K++){if(H){L[K].setAttribute("origvis",L[K].style.visibility)}L[K].style.visibility=H?"hidden":(L[K].getAttribute("origvis")?L[K].getAttribute("origvis"):"")}}};var G="";var F="";var D=[];var E;esvtk_track({esvtk_v:"1",esvtk_esvid:"A10030",event:"myspacejvmusic_ringtone",esvtk_forcecount:"1"});popupWidth=604;popupHeight=465;if(A==""||B==""){G=MusicPlayerControl.JambaUrl1}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.JambaUrl2+F}popupContent="<iframe id='popupiframe' scrolling='no' style='border:0;overflow:hidden' src='"+G+"' width='"+popupWidth+"' height='"+popupHeight+"'></iframe>";invCloseBtn="<p onclick='closeRingtoneWindow();' 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=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"}};function closeRingtoneWindow(){dDd=document.getElementById("divWrapper");document.body.removeChild(dDd);var A=$get("shell");if(A){A.style.visibility="visible"}getPlayerFlashObject().playCurrentTrack()}MySpaceMusic.IsWindowFocused=function(){return MySpaceMusic.focusStatus};killPopupBlockerMessaging=function(){popupFrame=document.getElementById("amazonNoPopUp");document.body.removeChild(popupFrame)};MySpaceMusic.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};MySpaceMusic.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=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)};MySpaceMusic.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()}};MySpaceMusic.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()}};MySpaceMusic.onBuyAlbumClicked=function(B,C,A,D){esvtk_track({esvtk_v:"1",esvtk_esvid:"A10030",event:"myspacejvmusic_buyalbum",esvtk_forcecount:"1"});if(MusicPlayerControl.AllowAmazonInPlace&&B!=undefined&&B!=null&&B!=""){MySpaceMusic.AmazonInPlacePurchase(B)}else{MySpaceMusic.AmazonNotInPlacePurchase(B)}};MySpaceMusic.onBuySongClicked=function(B,D,A,C){esvtk_track({esvtk_v:"1",esvtk_esvid:"A10030",event:"myspacejvmusic_buysong",esvtk_forcecount:"1"});if(MusicPlayerControl.AllowAmazonInPlace&&B!=undefined&&B!=null&&B!=""){MySpaceMusic.AmazonInPlacePurchase(B)}else{MySpaceMusic.AmazonNotInPlacePurchase(B)}};var popup;function ClosePopUp(){popup._hide();popupId=document.getElementById("divWrapper");document.body.removeChild(popupId)}MySpaceMusic.OptIn=function(B,D,F,C,E,A){popupWidth=530;popupHeight=520;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=createPopUp(popupContent,popupWidth,popupHeight,invCloseBtn,"optin");popup.show()};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}MySpaceMusic.refreshMedRec=function(){MySpaceMusic.MedRecRefresh()};MySpaceMusic.MedRecRefresh=function(){if(MySpace.ClientContext.FunctionalContext=="PopUpPlayer"){MedRecRefresh()}if(MySpace.ClientContext.FunctionalContext=="UserViewProfile"){MySpaceMusic.openTooltip()}if(MySpace.ClientContext.FunctionalContext=="MusicDiscography"){MySpaceMusic.openTooltip()}};MySpaceMusic.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>"}};MySpaceMusic.onStop=function(B,A){MySpaceMusicUtil.oldElem.src=MyPlaylistsControl.playIcon;Sys.UI.DomElement.removeCssClass(MySpaceMusicUtil.oldParentElem,"isPlaying")};MySpaceMusic.PlaySongInPOMP=function(D,B,A,E){try{document.getElementById("shell").playSong(D,B,A,E)}catch(C){}};var ajaxActionHandler="/Modules/MusicV2/Services/MusicUtil.ashx?action=EnforceLogin";var req=null;MySpaceMusic.EnforceLogin=function(){try{if(window.XMLHttpRequest){req=new XMLHttpRequest();req.onreadystatechange=LoginRedirect;req.open("GET",ajaxActionHandler,true);req.send(null)}else{if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");if(req){req.onreadystatechange=LoginRedirect;req.open("GET",ajaxActionHandler,true);req.send()}}}}catch(A){}};LoginRedirect=function(){if(req.readyState==4){var json=eval("("+req.responseText+")");if(json.ServerResponse.IsRequestSuccessful){window.location.href=json.ServerResponse.DisplayText}}};var loginWin=null;MySpaceMusic.EnforceLoginPOMP=function(A){loginWin=window.open(decodeURI(A),"newWin","","");Sleep(1000)};EnforceLoginOpenComplete=function(){if(loginWin==null){Sleep(1000)}else{if(loginWin.document==null){Sleep(1000)}else{var A=loginWin.document.getElementById(MusicPlayerControl.SwfObjectDiv);if(A==null){Sleep(1000)}else{loginWin.MySpaceMusic.EnforceLogin()}}}};Sleep=function(A){setTimeout("EnforceLoginOpenComplete()",A)};
