(function(){var searchBoxText="Search for an audiobook, newspaper, magazine, speech and more...";$(function(){var noFocusColor="#C0C0C0";var inFocusColor="#000000";var inFocus=false;$("#adbl_search_term").css("color",noFocusColor);$("#adbl_search_term")[0].value=searchBoxText;$("body").click(function(evt){var target=$(evt.target)[0].tagName.toUpperCase();if(inFocus&&target!=="INPUT"){$("#adbl_search_term").css("color",noFocusColor);$("#adbl_search_term")[0].value=searchBoxText;inFocus=false}});$("#adbl_search_term").focus(function(){$(this).css("color",inFocusColor);$(this)[0].value="";inFocus=true});$("#adbl_country").click(function(){var email=$("#adbl_email_id").attr("value");var deEmail=".de";var frEmail=".fr";var ukEmail=".uk";var emailCountry="none";if($("#emailCountry").length>0){emailCountry=$("#emailCountry").attr("value")}if(email.match(deEmail+"$")==deEmail&&emailCountry!="DE"){ajaxToGetIntlSite("/signup-intlredirect?countryCode=DE","no");$("#adbl_country").blur();if($("#emailCountry").length<1){insertNewDiv("emailCountry","DE")}else{$("#emailCountry").attr("value","DE")}}else{if(email.match(frEmail+"$")==frEmail&&emailCountry!="FR"){ajaxToGetIntlSite("/signup-intlredirect?countryCode=FR","no");$("#adbl_country").blur();if($("#emailCountry").length<1){insertNewDiv("emailCountry","FR")}else{$("#emailCountry").attr("value","FR")}}else{if(email.match(ukEmail+"$")==ukEmail&&emailCountry!="GB"){ajaxToGetIntlSite("/signup-intlredirect?countryCode=GB","no");$("#adbl_country").blur();if($("#emailCountry").length<1){insertNewDiv("emailCountry","GB")}else{$("#emailCountry").attr("value","GB")}}}}});$("#adbl_country").change(function(){var emailCountry="none";if($("#emailCountry").length>0){emailCountry=$("#emailCountry").attr("value")}if(($("#adbl_country").val()=="GB")||($("#adbl_country").val()=="DE")||($("#adbl_country").val()=="FR")){if(emailCountry!=$("#adbl_country").val()){ajaxToGetIntlSite("/signup-intlredirect?countryCode="+$("#adbl_country").val(),"yes")}}});if($("#adbl_continue")){$("#adbl_continue").click(function(evt){var emailId=$("#adbl_email_id")[0].value;if(emailId===""){evt.preventDefault();alert("Please enter your email address")}else{if(!AdblGlobal.isValidEmail(emailId)){evt.preventDefault();alert("Please enter a valid email address")}}})}function insertNewDiv(id,value){var bodytag=document.getElementsByTagName("body")[0];var newdiv=document.createElement("div");newdiv.setAttribute("id",id);newdiv.setAttribute("value",value);bodytag.appendChild(newdiv)}function popUpModalOverlay(ajaxResult){var strBuilder=[];if(ajaxResult=="none"){return}if($(".intlredirectbg").length>0){$(".intlredirectbg").remove()}if($(".redirectcontent").length>0){$(".redirectcontent").remove()}strBuilder.push(ajaxResult);var bodytag=document.getElementsByTagName("body")[0];var newdiv=document.createElement("div");newdiv.setAttribute("id","overlayparent");newdiv.innerHTML=ajaxResult;bodytag.appendChild(newdiv);$("#adbl_page_content").css({"z-index":"0"});$(".intlredirectbg").css({"z-index":"1",width:"100%",height:"100%",opacity:"0.3",background:"#000000",top:"0",left:"0",position:"fixed"});$(".redirectcontent").css({"z-index":"2",width:"800px",height:"308px",background:"#FFFFFF"});var windowWidth=$(window).width();var windowHeight=$(window).height();var popupHeight=$(".redirectcontent").height();var popupWidth=$(".redirectcontent").width();$(".redirectcontent").css({position:"absolute",top:($(window).scrollTop()+100)+"px",left:windowWidth/2-popupWidth/2});$(".redirectcontent").fadeIn("slow");$(".intlredirectbg").fadeIn("slow");$(".redirectcontent").focus()}function resizeModalOverlay(){if($(".redirectcontent").length>0){$(".intlredirectbg").css({width:$(window).width()+"px",height:$(document).height()+"px"});if(typeof modalWidth=="undefined"){modalWidth=800}$("#int-container").css({left:(($(window).width()-modalWidth)/2)+"px",top:($(window).scrollTop()+100)+"px"})}}function ajaxToGetIntlSite(ajaxUrl,submitForm){var ajaxResult;$.get(ajaxUrl,function dataLoaded(data,textStatus){if(textStatus!=="success"){}else{popUpModalOverlay(data);$("#adbl-intlredirect-dismiss").click(function(){$(".redirectcontent").fadeOut("slow");$(".intlredirectbg").fadeOut("slow");$("#adbl_country").focus();var emailId=$("#adbl_email_id")[0].value;if(emailId===""){alert("Please enter your email address")}else{if(!AdblGlobal.isValidEmail(emailId)){alert("Please enter a valid email address")}else{if(submitForm=="yes"){$("#adbl_sign_up").submit()}}}})}})}function dismissIntlRedirectOverlay(){$(".redirectcontent").fadeOut("slow");$(".intlredirectbg").fadeOut("slow")}})})();


