(function(d){var e=window.AmazonUIPageJS||window.P,f=e._namespace||e.attributeErrors,a=f?f("AudiblePodcastAssets",""):e;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,e,f){d.when("A","bodyBegin").execute(function(a){var b=document.getElementById("bookDesc_override_CSS");b&&(b.text+="body{background-color: transparent !important;font-size: 13px !important;color: white}");a.delay(function(){var a=document.getElementsByTagName("iframe")[0];a!==f&&(a=a.contentWindow,
a.document.getElementsByTagName("body")[0].style.backgroundColor="transparent",a.document.getElementsByTagName("body")[0].style.color="#FFFFFF",a.document.getElementsByTagName("body")[0].style.fontSize="13px")},10)});d.when("A","ready").execute(function(a){function b(b,c){a.ajax("/hz/audible/clickstream",{type:"POST",dataType:"json",params:{asin:b,"event-aud-action":"INTENTION","event-aud-type":"AddToLibrary","event-aud-subType":c},success:function(a){},error:function(a){}})}var g=a.$,c=g("#checkoutForm"),
d=g("#addToLibPodcastButton"),e=g("#removeFromLibPodcastButton"),f=g("#informationTextOwn"),k=g("#informationTextNotOwn"),h=null,h="PODCASTPROSPECTADDLIB"===c.find('input[name\x3d"purchaseType"]').val()?c.find('input[name\x3d"ASIN"]').val():c.find('input[name\x3d"audibleASIN"]').val();a.declarative("checkoutSubmit","click",function(a){c.submit()});a.declarative("ayclpurchase","click",function(a){g.ajax({url:"/hz/audible/ajax/library/add",type:"POST",dataType:"json",data:{audibleAsin:h,hmacKey:c.find('input[name\x3d"HMAC"]').val(),
hmac2Key:c.find('input[name\x3d"HMAC2"]').val(),purchaseType:c.find('input[name\x3d"purchaseType"]').val(),productType:"Non-Wfv",surfaceType:c.find('input[name\x3d"surfaceType"]').val()},success:function(a){"success"===a.status&&"OWNERSHIP-Ownership_Already_Exists"===a.errorCode?d.addClass("a-hidden"):(d.addClass("a-hidden"),k.addClass("a-hidden"),e.removeClass("a-hidden"),f.removeClass("a-hidden"),b(h,c.find('input[name\x3d"podcastType"]').val()))},error:function(a){},complete:function(a){}})});
a.declarative("ayclremovepurchase","click",function(a){g.ajax({url:"/hz/audible/ajax/library/remove",type:"POST",dataType:"json",data:{audibleAsin:h,hmacKey:c.find('input[name\x3d"HMAC2"]').val(),purchaseType:c.find('input[name\x3d"purchaseType"]').val(),productType:"Non-Wfv",surfaceType:c.find('input[name\x3d"surfaceType"]').val()},success:function(a){e.addClass("a-hidden");f.addClass("a-hidden");d.removeClass("a-hidden");k.removeClass("a-hidden")},error:function(a){},complete:function(a){}})})});
d.when("A","ready").execute(function(a){a.on("a:tabs:3PPodcastTabs:amazonMusic:select",function(b){b=a.$;b(".amazonMusicClass").css({display:"block"});b(".audibleClass").css({display:"none"})});a.on("a:tabs:3PPodcastTabs:audible:select",function(b){b=a.$;b(".audibleClass").css({display:"block"});b(".amazonMusicClass").css({display:"none"})})})});