"use strict";function loadingGraphic(A){A.w.append("<div class='loading initial' id='loading'><img src='/images/oneclick/processing.gif' class='processing' alt='processing'><h3>please stand by...</h3></div>");A.w.fadeIn("1000")}function rearrangeMargins(B){var C=parseInt($(B).parents("div.bookModule").width(),10),D=parseInt($(B).width(),10),A=Math.round((C-D)/2);$(B).parents("div.ds1").hide().css("marginLeft",(A-4)).fadeIn(50)}function showTab(){if(document.getElementById&&document.createElement){if($("#featured").get(0)){$("#featured li a").click(function(){var C,A=$(this).parents("li").attr("id"),B=A.substring(8);$("#featured a").removeClass("selected");$(this).addClass("selected");$("#featuredReviews div.featuredBook").addClass("noshow");B="#featuredBook"+B;$(B).removeClass("noshow");C=$(B+" img.shadow");rearrangeMargins(C);return false})}}}$(function(){showTab()});function isClicked(){$("#continue").click(function(){$("a.dlmCheck").unbind();$("#dlm").hide();$(".jqmOverlay").hide();$("#eMusicRemote").hide();$("#whyDlm").hide()})}function subscribeBook(){if(document.getElementById("upsellModal")!==null){$("#upsellTitle").hide();$("#upsellContainer").hide();$("#upsellClose").hide();$("#upsellLoading").show()}var A=1;$.ajax({async:false,type:"POST",url:"/remote/upsellBook.html",data:"mode=subscribe&r="+Math.random(),success:function(D){var B=D.split(","),F="credit ",C=" &amp; ",E="";if(A===1){A=2;$("#upsellClose").show();$("#upsellLoading").hide();if(parseInt(B[0],10)===1){$("#newBookDownloads").append(B[1]);$("#newBookPlanName").append(B[2]);$("#upsellSuccess").show();if(parseInt(B[1],10)!==1){F="credits "}if($("#downloadCount").html()===null){C="";E=" remaining"}$("span.downloadHeaderUpdate").after(C+"<span id='bookDownloadCount'>"+B[1]+"</span> audiobook "+F+E);$("#bookDownloadCount").css({color:"yellow",fontSize:12,fontWeight:"bold"});$("img.freeAudiobook").attr({src:"/images/audiobooks/btn-download_audiobook.png",height:"19",width:"118",className:"downloadAudiobook"})}else{if(parseInt(B[0],10)===2){$("#upsellError").show()}else{$("#ccError").show()}}}},error:function(C,D,B){$("#upsellClose").show();$("#upsellLoading").hide();$("#upsellError").show()}})}function subscribe(A){$("#subscribeBook input").click(function(){subscribeBook();return false})}function checkAS(){if($("span.credits").html()==="1"){var B,D=window.location.href.substring(1+window.location.href.lastIndexOf("/"),window.location.href.lastIndexOf(".")),A={type:"POST",dataType:"text",async:false,url:"/remote/checkdlb.html?bookID="+D,data:Math.random()},C=$.ajax(A).responseText;if(C==="red"){B="/remote/upsellBook.html?r="+Math.random();$("body").append("<div id='upsellModal' class='upsellWindow' style='display:none;'></div>");$("#upsellModal").jqm({onShow:loadingGraphic,ajax:B,modal:true,onLoad:subscribe}).jqmShow();return false}}return true}"use strict";(function(){var C,G=new MouseWindowGroup("addToListBox_","addToListContent_","addToListTrigger_","addToListContainer_");for(C=0;C<G.wins.length;){G.wins[C].loadingHtml=null;C=C+1}function F(J,I){if(I){J.removeAttr("disabled")}else{J.attr("disabled","disabled")}J.setClass(!I,"addNewListDisabled")}function H(J){var I=$("input.listName",J);J.find($("form.addToListForm").show());I.val(" Start new list...");I.one("focus.clearOnce",function(){I.val("")});F($("a.addNewList",J),false)}function E(J,I){$("img.close",I).click(function(){if(J.state===MouseWindow.States.SHOWING&&!J.ignoreClick){J.hide()}return false})}function D(I,J){$(".scroll-pane",I).jScrollPane({dragMinHeight:10});$("a.addToListLink",I).click(function(){J(this);$(".addToListForm",I).slideUp("slow");return false})}function A(J,I){var K=$("input.listName",J),L=$("a.addNewList",J),M=$(".addToListForm",J);K.bind("keyup keypress",function(O,N){return function(P){F(O,jQuery.trim(N.val())!=="")}}(L,K)).blur(function(O,N){return function(P){if(N.val().trim()===""){H(O)}}}(J,K));M.submit(function(N,P,O){return function(Q){if(!O.attr("disabled")){I(this);N.blur();P.slideUp("slow")}return false}}(K,M,L));L.click(function(N){return function(){N.trigger("submit");return false}}(M));H(J)}G.buildContainerHtml=function(I,K){var J=K.contentType==="A"?"album":K.contentType==="B"?"book":"song";return['<div id="addToListBox_',I,'" class="addToListBox">','<div class="dialog">','<div class="listContent">','<div class="t"></div>','<p class="saved">Add ',J," to list</p>",'<div id="result">','<div class="scroll-container">','<div id="addToListContent_',I,'">',"</div>","</div>",'<div class="startNewList">','<form action="/lists/ajax.html" method="POST" class="addToListForm">','<input name="listName" type="text" class="listName"/>','<input type="hidden" name="saving" value="true"/>','<input type="hidden" name="method" value="addToNewList"/>','<input type="hidden" name="sfl" value="false"/>','<input type="hidden" name="contentType" value="',K.contentType,'"/>','<input type="hidden" name="contentIds" value="',K.contentId,'"/>','<input type="hidden" name="listId" value=""/>','<a href="#" class="addNewList" title="Add to new list">add list</a>',"</form>",'<p><a href="/profile/lists.html" class="manageLists">Manage your lists</a></p>','<div class="bg"></div>',"</div>",'<img class="close" src="/images/core/icons/icon-close.gif" alt="close">',"</div>","</div>",'<div class="b">',"<div></div>","</div>","</div>","</div>"].join("")};G.initWindow=function(M,K,L){var I=$(M.divName),J=$("input.listName",I),N=$(".addToListForm",I);M.showStarted=(function(O){return function(){if(O.parents("td.track").length&&DUMAS.clientWidth()<1115){I.css("left","350px")}if(O.parents("table.tracksWrap").width()>500){O.addClass("wider")}}}(I));M.contentChanged=(function(Q,P,O){return function(){D(P,function(R){Q.show(R.href)})}}(M,I,N));M.hideStarted=function(){$(this.divName).parents("tr").children("td").removeClass("trackHighlight")};M.hideAnimation=function(O,P){$(this.divName).fadeOut(O,P)};M.showAnimation=function(O,P){$(this.divName).fadeIn(O,P)};M.backAnimation=function(O,P){$(this.divName).fadeTo(O,1,P)};E(M,I);A(I,function(O){return function(P){O.show(P.action+"?"+$(P).serialize())}}(M));J.blur(function(O){return function(P){O.setIgnoreHover(false)}}(M));J.focus(function(O){return function(P){O.setIgnoreHover(true)}}(M))};G.getContentHtml=function(I,J){return"/lists/ajax.html?method=getLists&contentType="+J.contentType+"&contentIds="+J.contentId};function B(I){G.each("setIgnoreHover",[true]);$("#addToListTrigger_"+I).click()}$(document).ready(function(){var I=DUMAS.param("atlIndex");if(I!==null){B(parseInt(I,10))}});DUMAS.ATL={addContent:function(){G.addContent.apply(G,arguments)},group:G,bindAddToListEvents:A,bindAddToListLinks:D}}());(function(){var U,a,Z,O={},W=false,Y,F,I,J,B,P,V=Cookie({name:"dlmCheckDialogStatusCookie",path:"/",expires:3650}),X=1,N="<img src='/images/oneclick/processing.gif' alt='(loading download manager information)' class='loading' />";U=V.get("status");function D(){if($.browser.msie){$("body.ie #downloadDialog.fancyBorderBoxWrapper").css("width","789px")}$("#noDLMView, #thanks, #confirmation").hide();$("#initialView").show()}function Q(){if(typeof ActiveXObject!="undefined"){try{Y=new ActiveXObject("EMusicActiveX.eMusicDownloadManager.1");if(Y){W=true}}catch(b){W=false}}if(navigator.plugins){navigator.plugins.refresh(false);if(navigator.plugins["eMusic Remote Plugin"]!==undefined){W=true}}if(navigator.userAgent&&(navigator.userAgent.indexOf("eMusic DLM/4")!=-1||navigator.userAgent.indexOf("eMusic Remote/1")!=-1)){W=true}if(W){if(!DUMAS.sessionDlmChoice||DUMAS.sessionDlmChoice.dlmChoice!="hasDLM"){$.ajax({type:"GET",data:{dlmChoice:"hasDLM"},async:false,url:"/sessions/remote.html"})}$("a.downloadAlbum, a.downloadTrack, span.downloadTrack a").each(function(){if($(this).attr("href")){var c=$(this).attr("href").replace(/([\/\.])emp/g,"$1emx");$(this).attr("href",c)}})}return W}function G(b,c){clearInterval(a);$("img.loading").hide();$("#confirmation h1").text("We have not yet detected that the Download Manager has been installed. ");$("#confirmation p:first").html('Please make sure your installation is complete. If there was a problem with the installation please <a href="" class="reinstall">reinstall the Download Manager</a>.');$("a.reinstall").attr("href",b);$("p:first, div, div *","#confirmation").show(function(){$("#confirmation a.jqmClose").click(function(){c.w.jqmHide();return false})})}function H(c,b){J="with the eMusic Download Manager.";$("#confirmation h1").text("Success!");if(b!==undefined){if(b=="mp3"||b=="other"){J="without a Download Manager."}else{if(b=="emp"){J="with an older version of the eMusic Download Manager."}else{if(b=="emx"){J="with eMusic Download Manager 4.0, eMusic/J, or eMusic Remote."}}}}else{$("#confirmation p:eq(0)").remove()}F="Your account is now configured to download "+J;$("#confirmation h3").text(F);$("#confirmation p span").text("the "+c.mediaType);$("#confirmation p em").text(c.title);$("#confirmation p a.downloadTrackDLM").attr("href",c.href);$("#confirmation h3, #confirmation p").fadeIn();if(b=="emp"){$("#confirmation p a.downloadTrackDLM").attr("href",$("#confirmation p a.downloadTrackDLM").attr("href").replace(/([\/\.])emx/g,"$1emp"))}else{if(b=="emx"||b===undefined){$("#confirmation p a.downloadTrackDLM").attr("href",$("#confirmation p a.downloadTrackDLM").attr("href").replace(/([\/\.])emp/g,"$1emx"))}}}function R(c,b,d){if(Q()){clearInterval(a);clearTimeout(Z);H(c);$("#confirmation *").show(function(){$("a.jqmClose").click(function(){d.w.jqmHide();return false})});$("#confirmation h1 img").hide();if($(c.target).attr("data-dlm")=="no"){$("#confirmation p:eq(0)").text("Please click the close button to enable the download manager. You may then try your download again.");$("#confirmation p:eq(1)").hide();$("#confirmation a.jqmClose, p.jqmClose").click(function(){window.location.reload(false)})}else{$("#confirmation p a.downloadTrackDLM").click(function(){$("#downloadDialog.fancyBorderBoxWrapper").hide();return DUMAS.checkDL(c.mediaType,this.href)})}}else{if(X==1){Z=setTimeout(function(){G(b,d)},"18000")}}X++}function C(c,b,d){if($.browser.msie){$("body.ie #downloadDialog.fancyBorderBoxWrapper").css("width","685px")}$("#confirmation h1").text("Checking for install. . . ");$("#confirmation h1").append(N);$("#confirmation").show();$("#confirmation *").hide();$("#confirmation h1, #confirmation h1 img").fadeIn();a=setInterval(function(){R(c,b,d)},"3000")}function M(c,b,d){$("#dlmHref").click(function(){$("#initialView").hide();$("p.jqmClose").click(function(){clearInterval(a)});if($(c.target).attr("data-dlm")&&$(c.target).attr("data-dlm")=="no"){if(!DUMAS.sessionDlmChoice||DUMAS.sessionDlmChoice.dlmChoice!="emx"){$.get("/sessions/remote.html",{dlmChoice:"emx"})}}C(c,b,d);return true})}function L(b,c,d){H(c,b);$("#noDLMView").hide();if($.browser.msie){$("#downloadDialog.fancyBorderBoxWrapper").css("width","689px")}$("#confirmation").show();if(b=="mp3"||b=="other"||$(c.target).attr("data-dlm")=="no"){if($("#confirmation p:eq(1)").length>0){$("#confirmation p:eq(1)").hide()}else{$("#confirmation p:eq(0)").hide()}$("a.whiteWebButtonGray, p.jqmClose, a.jqmClose").click(function(){window.location.reload(false)})}$("a.jqmClose, p.jqmClose").click(function(){$("#downloadDialog.fancyBorderBoxWrapper").jqmHide();return false});$("#confirmation p a.downloadTrackDLM").click(function(){$("#downloadDialog.fancyBorderBoxWrapper").jqmHide();if(DUMAS.checkDL){return DUMAS.checkDL(c.mediaType,this.href)}else{return true}return false})}function A(b,c){if(c!==null){L(b,c);if(c.mediaType!="book"){if(b=="emp"){$("a.downloadAlbum, a.downloadTrack, span.downloadTrack a").each(function(){if($(this).attr("href")){var d=$(this).attr("href").replace(/([\/\.])emx/g,"$1emp");$(this).attr("href",d)}})}else{if(b=="emx"){$("a.downloadAlbum, a.downloadTrack, span.downloadTrack a").each(function(){if($(this).attr("href")){var d=$(this).attr("href").replace(/([\/\.])emp/g,"$1emx");$(this).attr("href",d)}})}}}}}function E(b,c){if(!DUMAS.sessionDlmChoice||DUMAS.sessionDlmChoice.dlmChoice!=b){$.get("/sessions/remote.html",{dlmChoice:b},function(){A(b,c)})}else{A(b,c)}}function T(e,c){var b=function(i){$("#processing").hide();i.w.css({top:DUMAS.scrollTop()+50+"px",left:(DUMAS.clientWidth()/2)-(i.w.width()/2)+"px"});$("#downloadDialog").addClass("installCheck");$("#downloadDialog .fancyBoxContent").load("/dlm/dlmInstallCheck.html",function(){g(i,false)});var h=function(l,k,j){if(!j){$("#initialView h1, #initialView h2").show()}if($.browser.msie){$("#downloadDialog.fancyBorderBoxWrapper").css("width","789px")}else{$("#downloadDialog.fancyBorderBoxWrapper").css("width","auto")}$("#initialView h1 span").text(c.mediaType);$("#initialView, #initialView h1, #initialView h2").show();$("#initialView div.close").hide();$("a.no").show();$("div.dlmInfo").html(k);I=$("#dlmButton a").attr("href");M(c,I,l);$("a.no").click(function(){$("p.jqmClose").hide();$("#initialView").fadeOut("fast",function(){$("#noDLMView").fadeIn(function(){if($.browser.msie){$("#downloadDialog.fancyBorderBoxWrapper").css("width","689px")}})});$("a.back").click(function(){$("#noDLMView").hide();$("#initialView").show();$("p.jqmClose").show();if($.browser.msie){$("#downloadDialog.fancyBorderBoxWrapper").css("width","789px")}return false});$("button").click(function(){if($("input:radio[name=dlmChoice]:checked").length>0){e.set("status","2");E($("input:radio[name=dlmChoice]:checked").val(),c);$(this).unbind("click")}else{if($("#dlmOptions p.error").length===0){$("#dlmOptions").prepend('<p class="error">You must choose one of the download options.</p>')}}return false});return false})};function g(k,j){$("#initialView h1, #initialView h2").hide();k.w.fadeIn("slow");$.ajax({type:"GET",timeout:5000,url:"/dlm/downloadCheck.html",data:"installCheck=true",success:function(l){h(k,l,j)},error:function(){$("#initialView h1, #initialView h2, img.loading").hide();$("div.dlmInfo").append("<p>We apologize but we could not load the download manager information at this time. Please <a href='#' class='reTry'>try</a> again.</p>");$("#initialView div.close").show();$("a.reTry").click(function(){$("#initialView div.close").hide();$("div.dlmInfo p").remove();$("img.loading").show();g(k,true)})}})}D()};var f=function(g){g.w.fadeOut("4000",function(){g.o.remove()})};var d=true;if($.browser.msie){d=false}$("#downloadDialog.fancyBorderBoxWrapper").jqm({onShow:b,modal:true,onHide:f,overlay:80,toTop:d}).jqmShow();return false}function S(d,c){var b=d.get("status");if(b!==undefined){if(!Q()){if(b==1){T(d,c);return false}else{if(b>=2){return true}}}else{if(b===""){return false}else{return true}}}else{if(!Q()){T(d,c);return false}else{return true}}return true}function K(b){if((window.location.href.indexOf("wmp")>-1)||(navigator.userAgent.indexOf("Linux")>-1)){return true}else{if(S(V,b)){if(b.mediaType=="book"){if($("#downloadBook").length&&!$.browser.msie){$("#downloadBook").attr("target","emxframe");var c="<iframe id='myFrame' name='emxframe' src='about:blank' width='0' height='0' style='position:absolute; left:-2000px;'></iframe>";if($("#myFrame").length===0){$("body").prepend(c)}$("#myFrame").attr("src","about:blank");return true}return true}}else{b.e.preventDefault();return false}return true}}DUMAS.dlmInstallCheck=K;$("#enableDownloadManager").click(function(){E("enable",null);setTimeout(function(){window.location.reload(false)},"500");return false})})();function scrollContent(B,E,H,D,C){if(($(B).length==0)||($(E).length==0)){return }if($(B).height()>H){$(B).css("overflow","hidden");$(B).height(D+"px");var F=document.createElement("img");F.src="/images/ctlg/album/icons/more.png";F.className=C;$(E)[0].appendChild(F);var A=$(B).height();var G=$(B)[0].scrollHeight;$(F).click(function(){var I,K;if(G>$(B).height()){I=G;K="/images/ctlg/album/icons/hide.png"}else{I=A;K="/images/ctlg/album/icons/more.png"}var J=$(this);$(this).prev(B).animate({height:I},"medium",function(){J.attr("src",K)})})}}function placeButton(){if($("#lists").width()=="230"){$("img.reviewToggle").css("left","451px")}else{$("img.reviewToggle").css("left","709px")}}scrollContent("#theReview","#review","180","140","reviewToggle");scrollContent("#review","div.review","80","40","reviewToggle");placeButton();(function(){DUMAS.checkDL=D;DUMAS.upgradeSub=A;DUMAS.getPlanChoice=B;var E=function(F){F.w.append("<div id='processing'><h2>Processing...</h2><img src='/images/oneclick/processing.gif' alt='processing' /></div>");F.w.fadeIn("1000")};var C=function(F){F.o.remove();F.w.hide();$("#upgradeModal").remove()};function B(){return $("#oneclick input[name=selectedPlan]:checked").val()}function D(F){if(DUMAS.download&&DUMAS.download.oneClickEnabled&&!F.target.hasClass("redownload")){if($.ajax({type:"POST",async:false,url:"/remote/checkdlm.html",data:"m="+F.mediaType+"&u="+F.href+"&r="+Math.random()}).responseText=="red"){var G="/remote/oneclick.html?r="+Math.random();function I(){$("#oneclick").submit(function(){A(B("selectedPlan"));return false});$("#annualDetails").click(function(){$("#termsAndDetails").slideToggle("normal");return false})}var H=I;$("body").append("<div id='upgradeModal' class='jqmUpgradeWindow' style='display:none;'></div>");$("#upgradeModal").jqm({onLoad:H,onShow:E,ajax:G,modal:true,onHide:C,toTop:"true"}).jqmShow();F.e.preventDefault();return false}else{if($("#myFrame").length){$("#myFrame")[0].contentWindow.location.replace(F.href);F.e.preventDefault()}return true}}return true}function A(G){if(document.getElementById("inlineUpgrade")!==null){$("#oneclick").hide();$("#oneClickFooter").hide();$("#close").hide();$("#loading").show()}var F=1;$.ajax({async:false,type:"POST",url:"/remote/oneclick.html",data:"step=upgrade&selectedPlan="+G+"&random="+Math.random(),success:function(I){if(F==1){F=2;var H=I.split(",");$("#inlineUpgrade").css("height","216px");$("#close").show();if(H[0]==1){$("#boosterDownloads").get(0).innerHTML=H[1];$("#upgradeDownloads").get(0).innerHTML=H[1];$("span.musicDownloadCount").get(0).innerHTML=H[3];$("#loading").hide();if(G===undefined||G.indexOf("booster")==-1){$("#successPlanName").get(0).innerHTML=H[2];$("#complete, #complete *").show();$("#close").show();var J=_gat._getTracker("UA-331194-1");J._trackPageview("/onPage/album/upgrade/confirmation/"+H[2])}else{$("#annualDetails").hide();$("#loading").hide();$("#added, #added *").show()}$("#loading").hide()}else{if(H[0]==2){$("#options").hide();if(G>0){$("#upgradeError, #upgradeError *").show()}else{$("#boosterError, #boosterError *").show()}}else{if(H[0]==3){$("#loading").hide();$("#ccError, #ccError *").show();$("#close").show()}}}}},error:function(I,J,H){$("#inlineUpgrade").css("height","182px");$("#loading").hide();$("#loading").hide();if(G>0){$("#upgradeError, #upgradeError *").show()}else{$("#boosterError, #boosterError *").show()}$("#close").show()}})}})();(function(){var B,A,D;DUMAS.handleDownloadEvents=C;function C(){$("a.downloadBook, #downloadBook").click(function(F){B={target:$(this),href:$(this).attr("href"),mediaType:"book",title:$("#bookInfo div.info h1").text()!=""?$("#bookInfo div.info h1").text():$("#bookTitle").text(),e:F};return DUMAS.dlmInstallCheck(B)});$("a.downloadTrack").each(function(F){$(this).click(function(G){var H=$(this);songName=$("p.songName")[F];songName=$(songName);B={target:$(this),href:$(this).attr("href"),mediaType:"song",title:songName.text(),i:F,e:G};return DUMAS.dlmInstallCheck(B)})})}$(function(){E(DUMAS.download)});function E(F){if(F){D=F.hasSubscription;A=F.authorized;if(A&&D){C()}}}})();