function toggleCommentArea(){if(document.getElementById("comments").style.display=="block"){document.getElementById("comments").style.display="none"}else{document.getElementById("comments").style.display="block"}}var handleReview=function(t){var response=eval("("+t.responseText+")");if(response.status=="SUCCESS"){document.getElementById("review_text").value="";document.getElementById("review_title").value="";window.location.href=window.location.href}else{document.getElementById("error-text").innerHTML=response.errorText;document.getElementById("error-title").innerHTML=response.errorTitle}};var errFunc=function(a){alert("Error "+a.status+" -- "+a.statusText)};var errAddBook=function(a){alert("Error "+a.status+" -- "+a.statusText)};function submitReview(){var b=document.getElementById("starRating").innerHTML;var a="commentAndReview.pbc?m=cr&rating="+b;var c=Form.serialize("reviewForm");new Ajax.Request(a,{parameters:c,onSuccess:handleReview,onFailure:errFunc})}function submitComment(){var url="commentAndReview.pbc?m=cc";var params=Form.serialize("commentForm");new Ajax.Request(url,{parameters:params,onSuccess:function(t){var response=eval("("+t.responseText+")");if(response.status=="SUCCESS"){document.getElementById("comment_text").value="";document.getElementById("comment_title").value="";window.location.href=window.location.href}else{document.getElementById("error-text").innerHTML=response.errorText;document.getElementById("error-title").innerHTML=response.errorTitle}},onFailure:function(t){alert("Error "+t.status+" -- "+t.statusText)}})}var handleAddBook=function(t){var response=eval("("+t.responseText+")");if(response.status=="SUCCESS"){window.location.href=window.location.href}else{if(response.status=="AJAX"){document.getElementById("cartItemCount").innerHTML=response.cartItemCount;$("add_overlay").innerHTML=response.addBookText}else{if(response.status=="SINGLE_BOOK_MAX"){document.getElementById("cartItemCount").innerHTML=response.cartItemCount;$("add_overlay").innerHTML=response.addBookText}else{if(response.status=="FULL"){window.location.href="joinConfirmBooks.pbc"}else{if(response.status=="MAXBOOKS"){showOverlay();document.getElementById("dialogueMessage").innerHTML="Your order cannot exceed 5 different books. Please remove one from your cart to add this book.";document.getElementById("dialogueButtons").innerHTML='<a href="javascript:closeDialogue()" class="btn" tabindex="10001"><span>Ok</span></a>&nbsp';$("dialogue").show()}else{alert("There was an error processing your request!")}}}}}};var handleAddBookRedirect=function(t){var response=eval("("+t.responseText+")");if(response.status=="SUCCESS"){window.location.href="browseBooks.pbc?m=b"}else{if(response.status=="AJAX"){document.getElementById("cartItemCount").innerHTML=response.cartItemCount;window.location.href="browseBooks.pbc?m=b"}else{if(response.status=="SINGLE_BOOK_MAX"){document.getElementById("cartItemCount").innerHTML=response.cartItemCount;$("add_overlay").innerHTML=response.addBookText}else{if(response.status=="FULL"){window.location.href="joinConfirmBooks.pbc"}else{if(response.status=="MAXBOOKS"){showOverlay();document.getElementById("dialogueMessage").innerHTML="Your order cannot exceed 5 different books. Please remove one from your cart to add this book.";document.getElementById("dialogueButtons").innerHTML='<a href="javascript:closeDialogue()" class="btn" tabindex="10001"><span>Ok</span></a>&nbsp';$("dialogue").show()}else{alert("There was an error processing your request!")}}}}}};function addBookToCart(b){document.getElementById("cartItemCount").innerHTML='<img src="images/icon/loading.gif" align="absmiddle">';var a="addBookToCart.pbc";var c="addBookId="+b;Position.prepare();coords=Position.cumulativeOffset($("addBook"+b));$("add_overlay").style.left=coords[0]-10+"px";$("add_overlay").style.top=coords[1]-10+"px";$("add_overlay").innerHTML='<img src="images/icon/loading.gif" align="absmiddle"> Adding...';$("add_overlay").show();new Ajax.Request(a,{parameters:c,onSuccess:handleAddBook,onFailure:errAddBook})}function addBookToCartFlash(b){document.getElementById("cartItemCount").innerHTML='<img src="images/icon/loading.gif" align="absmiddle">';var a="addBookToCart.pbc";var c="addBookId="+b;new Ajax.Request(a,{parameters:c,onSuccess:handleAddBook,onFailure:errAddBook})}function addBookToCartDetailRedirect(b){document.getElementById("cartItemCount").innerHTML='<img src="images/icon/loading.gif" align="absmiddle">';var a="addBookToCart.pbc";var c="addBookId="+b;Position.prepare();coords=Position.cumulativeOffset($("addBook"+b));$("add_overlay").style.left=coords[0]-10+"px";$("add_overlay").style.top=coords[1]-10+"px";$("add_overlay").innerHTML='<img src="images/icon/loading.gif" align="absmiddle"> Adding...';$("add_overlay").show();new Ajax.Request(a,{parameters:c,onSuccess:handleAddBookRedirect,onFailure:errAddBook})}function addBookToCartMultiple(b){document.getElementById("cartItemCount").innerHTML='<img src="images/icon/loading.gif" align="absmiddle">';var a="addBookToCart.pbc";var c="addBookId="+b+"&cartMultiple=true";new Ajax.Request(a,{parameters:c,onSuccess:handleAddBook,onFailure:errAddBook})}var handleRemoveBook=function(t){var response=eval("("+t.responseText+")");if(response.status=="SUCCESS"){window.location.href=window.location.href;document.getElementById("cartItemCount").innerHTML=response.cartItemCount;document.getElementById("removeBookId").innerHTML=0}else{alert("There was an error processing your request.")}};var errRemoveBook=function(a){alert("Error "+a.status+" -- "+a.statusText)};function deleteBookFromCart(){var a="removeBookFromCart.pbc";var c=document.getElementById("removeBookId").innerHTML;var b="removeBookId="+c;new Ajax.Request(a,{parameters:b,onSuccess:handleRemoveBook,onFailure:errRemoveBook})}function deleteBookFromCartNoConf(c){var a="removeBookFromCart.pbc";var b="removeBookId="+c;new Ajax.Request(a,{parameters:b,onSuccess:handleRemoveBook,onFailure:errRemoveBook})}function submitTags(){var url="addTag.pbc";var params=Form.serialize("tagForm");new Ajax.Request(url,{parameters:params,onSuccess:function(t){var response=eval("("+t.responseText+")");if(response.status=="SUCCESS"){window.location.href=window.location.href}else{alert("There was an error processing your request!")}},onFailure:function(t){alert("Error "+t.status+" -- "+t.statusText)}})}function swapVideo(videoId,width,height,top){var url="swapVideo.pbc";var params="videoId="+videoId+"&w="+width+"&h="+height;new Ajax.Request(url,{parameters:params,onSuccess:function(t){var response=eval("("+t.responseText+")");if(response.status=="SUCCESS"){document.getElementById("videoDiv").innerHTML=response.videoObjectString;document.getElementById("videoTitle").innerHTML=response.videoTitle;if(top!=undefined){self.scrollTo(0,0);document.getElementById("videoDescription").innerHTML=response.videoDescription}}else{alert("There was an error processing your request!")}},onFailure:function(t){alert("Error "+t.status+" -- "+t.statusText)}})}function noAddBookToCart(){showOverlay();document.getElementById("dialogueMessage").innerHTML="Your member status is pending at this time. You cannot place any new orders until your status has been updated to full club member.";document.getElementById("dialogueButtons").innerHTML='<a href="javascript:closeNoAddDialogue()" class="btn" tabindex="10001"><span>Ok</span></a>&nbsp';$("dialogue").show()}function unavailableAddBookToCart(){showOverlay();document.getElementById("dialogueMessage").innerHTML="This product is not available at this time.";document.getElementById("dialogueButtons").innerHTML='<a href="javascript:closeNoAddDialogue()" class="btn" tabindex="10001"><span>Ok</span></a>&nbsp';$("dialogue").show()}function closeNoAddDialogue(){hideOverlay();$("dialogue").hide()}function confirmDeleteBookFromCart(a){showOverlay();document.getElementById("dialogueMessage").innerHTML="Are you sure you want to remove that item from your cart? ";document.getElementById("dialogueButtons").innerHTML='<a href="javascript:deleteBookFromCart()"><img src="images/btn/ok.gif"></a>&nbsp;&nbsp;<a href="javascript:closeDialogue()"><img src="images/btn/cancel.gif"></a>';document.getElementById("removeBookId").innerHTML=a;$("dialogue").show()}function confirmDeactivateProfile(){showOverlay();document.getElementById("dialogueMessage").innerHTML="Are you sure you want to deactivate your account? ";document.getElementById("dialogueButtons").innerHTML='<a href="myPBC.pbc?m=d"><img src="images/btn/ok.gif"></a>&nbsp;&nbsp;<a href="javascript:closeDialogue()"><img src="images/btn/cancel.gif"></a>&nbsp';$("dialogue").show()}function changeSelectionWarning(){showOverlay();document.getElementById("dialogueMessage").innerHTML="Maximum number of books selected. If you would like to change your selection, please delete a book from your shopping cart.";document.getElementById("dialogueButtons").innerHTML='<a href="browseBooks.pbc?m=b"><img src="images/btn/ok.gif"></a>&nbsp;&nbsp;<a href="javascript:closeDialogue()"><img src="images/btn/cancel.gif"></a>&nbsp';$("dialogue").show()}function notEnoughBooksSelectedWarning(){showOverlay();document.getElementById("dialogueMessage").innerHTML="You must add more books before you can checkout";document.getElementById("dialogueButtons").innerHTML='<a href="javascript:closeDialogue()"><img src="images/btn/ok.gif"></a>&nbsp';$("dialogue").show()}function showOverlay(){var f=$("dialogue");var e=$("overlay");var a=Element.getDimensions(document.body);var d=getBrowserWindowSize();var b=Element.getDimensions(f);var c=getScrollXY();if(a.height>d.height){d.height=a.height}e.style.width=d.width+"px";e.style.height=d.height+"px";Element.show(e)}function hideOverlay(){$("overlay").hide()}function closeDialogue(){hideOverlay();$("dialogue").hide()}function closeAddOverlay(){$("add_overlay").hide()}function closeDialogueAndRefresh(){hideOverlay();$("dialogue").hide();window.location.href=window.location.href}function getBrowserWindowSize(){var a=630,c=460;if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape"){a=window.innerWidth;c=window.innerHeight}if(navigator.appName.indexOf("Microsoft")!=-1){a=document.body.offsetWidth;c=document.body.offsetHeight}}var b={width:a,height:c};return b}function getScrollXY(){var b=0,a=0;if(typeof(window.pageYOffset)=="number"){a=window.pageYOffset;b=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){a=document.body.scrollTop;b=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){a=document.documentElement.scrollTop;b=document.documentElement.scrollLeft}}}var c={offsetX:b,offsetY:a};return c}function submitSearch(){var a=document.getElementById("searchText").value;window.location="http://www.progressivebookclub.com/pbc2/search.pbc?searchText="+a}function enterSubmitSearch(a){var c;var b;if(window.event){c=a.keyCode}else{if(a.which){c=a.which}}if(c==13){submitSearch()}}function showLongBlurb(c){var b="shortBlurb"+c;var a="longBlurb"+c;document.getElementById(b).style.display="none";document.getElementById(a).style.display="block"}function showShortBlurb(c){var b="shortBlurb"+c;var a="longBlurb"+c;document.getElementById(b).style.display="block";document.getElementById(a).style.display="none"}function updateCreditCard(){document.getElementById("currentCreditCardInfo").style.display="none";document.getElementById("newCreditCardInfo").style.display="block";document.getElementById("displayCurrentCC").value="none";document.getElementById("displayNewCC").value="block"}function cancelUpdateCreditCard(){document.getElementById("newCreditCardInfo").style.display="none";document.getElementById("currentCreditCardInfo").style.display="block";document.getElementById("displayNewCC").value="none";document.getElementById("displayCurrentCC").value="block"}function addBookmark(b){var f;var e=document.title;var c=location.href;var a=/{url}/gi;var d=/{title}/gi;b=b.replace(a,c);b=b.replace(d,e);f=window.open(b,"window","resizable=yes,height=400,width=400,scrollbars=yes");if(window.focus){f.focus()}document.getElementById("socailBookmarks").style.display="none"}function addToFavorites(){var a=document.title;var b=location.href;if(window.external){window.external.AddFavorite(b,a)}else{alert("Sorry! Your browser doesn't support this function.")}}function findPosX(a){var b=0;if(a.offsetParent){while(1){b+=a.offsetLeft;if(!a.offsetParent){break}a=a.offsetParent}}else{if(a.x){b+=a.x}}return b}function findPosY(b){var a=0;if(b.offsetParent){while(1){a+=b.offsetTop;if(!b.offsetParent){break}b=b.offsetParent}}else{if(b.y){a+=b.y}}return a}function toggleSocailBookmarks(){if(document.getElementById("socialBookmarks").style.display=="block"){document.getElementById("socialBookmarks").style.display="none"}else{Position.prepare();coords=Position.cumulativeOffset($("shareSaveLink"));$("socialBookmarks").style.left=coords[0]-160+"px";$("socialBookmarks").style.top=coords[1]+12+"px";$("socialBookmarks").style.display="block"}}function addToBookshelf(addBookId){var url="addToBookshelf.pbc";var params="addBookId="+addBookId;new Ajax.Request(url,{parameters:params,onSuccess:function(t){var response=eval("("+t.responseText+")");if(response.status=="SUCCESS"){document.getElementById("addToMyBookshelfConfirmation").style.display="block"}else{alert("There was an error processing your request!")}},onFailure:function(t){alert("Error "+t.status+" -- "+t.statusText)}})}function emailFriend(b){var a="emailFriend.pbc?type=book&id="+b;var c=window.open(a,"emailFriendWindow","height=400,width=500");if(window.focus){c.focus()}}function emailFriendArticle(a){var b="emailFriend.pbc?type=article&id="+a;var c=window.open(b,"emailFriendWindow","height=400,width=500");if(window.focus){c.focus()}}function openExcerpt(c){var b="viewBookExcerpt.pbc?id="+c;var a=window.open(b,"bookExcerptWindow","height=600,width=400,scrollbars=yes");if(window.focus){a.focus()}}function siteAgreementPopUp(b){var c="siteAgreement.pbc?id="+b;var a=window.open(c,"siteAgreementWindow","height=400,width=500,scrollbars=yes");if(window.focus){a.focus()}}function cvvExplanationPopUp(){var b="cvvExplanation.pbc";var a=window.open(b,"cvvExplanationWindow","height=400,width=500,scrollbars=yes");if(window.focus){a.focus()}}function promotionDetailPopUp(a){var b="viewPromotionDetails.pbc?id="+a;var c=window.open(b,"promotionDetailWindow","height=400,width=500,scrollbars=yes");if(window.focus){c.focus()}}var savedRating=0;var ratingURLs=new Array("images/review/stars-0.gif","images/review/stars-1.gif","images/review/stars-2.gif","images/review/stars-3.gif","images/review/stars-4.gif","images/review/stars-5.gif");function saveRating(a){document.getElementById("starRating").innerHTML=a;savedRating=a}function swapStars(a){imageObj=document.getElementById("starsrating");imageObj.src=ratingURLs[a];document.getElementById("starRating").innerHTML=a;savedRating=a}function reset(){imageObj=document.getElementById("starsrating");imageObj.src=ratingURLs[savedRating]}function openTab(a){if(a&&$("tab-"+a)){$$("#product-overview-tabs li a img").each(function(b){if(b.src.search("tab_roll_"+a)!=-1){return}if(b.src.search("tab_off_"+a)!=-1){b.src=b.src.replace("_off","_roll");b.id="product-tab-on"}else{b.src=b.src.replace("_roll","_off");b.id=""}});$$(".ds-as-box").each(function(b){b.style.display="none"});$("tab-"+a).style.display="block"}}Event.observe(window,"load",function(){var a=false;var d=false;var e=new Object();window.location.search.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function(h,g,j,i){e[g]=i});for(var f in e){if(f=="tabname"){a=e[f]}if(f=="displayonly"){d=e[f]}}if(d!=false){switch(d){case"reviews":a="reviews";break;default:a="summary"}}if(a&&$("tab-"+a)){$$("#product-overview-tabs li a img").each(function(g){if(g.src.search("tab_off_"+a)!=-1){g.src=g.src.replace("_off","_roll");g.id="product-tab-on"}else{g.src=g.src.replace("_roll","_off");g.id=""}});$$(".ds-as-box").each(function(g){g.style.display="none"});$("tab-"+a).style.display="block";if(window.location.hash&&window.location.hash.length>0){window.location=window.location.hash}}var c=$$("#product-overview-tabs li a");for(var b=0;b<c.length;b++){Event.observe(c[b],"click",function(k){Event.stop(k);var j=getElement(k);if(j.src==null){j=j.getElementsByTagName("img")[0]}var i=$("product-tab-on");i.src=i.src.replace("_roll","_off");var h=i.src.split("_off_")[1];h=h.split(".")[0];$("tab-"+h).style.display="none";$("product-tab-on").id=" ";j.src=j.src.replace("_off","_roll");j.id="product-tab-on";var g=j.src.split("_roll_")[1];g=g.split(".")[0];$("tab-"+g).style.display="block"})}},true);function getElement(a){if(a.srcElement){return a.srcElement}else{return a.target}}function fixTrans(){var a=document.getElementsByTagName("img");if(a){for(var b=0;b<a.length;b++){if((a[b].src.indexOf(".png"))!=-1){var c=a[b].src.replace(new RegExp("(.*)/(.*)?.png"),"$1/$2");a[b].parentNode.style.display="inline-block";a[b].parentNode.style.width=a[b].offsetWidth+"px";a[b].parentNode.style.height=a[b].offsetHeight+"px";a[b].parentNode.style.top=a[b].offsetTop+"px";a[b].parentNode.style.left=a[b].offsetLeft+"px";a[b].parentNode.style.position="relative";a[b].style.visibility="hidden";a[b].parentNode.style.filter="progid:dximagetransform.microsoft.alphaimageloader(src='"+c+".png',sizingmethod='crop');"}}}}if(document.all&&!window.opera){attachEvent("onload",fixTrans)}var handlerLogin=function(t){var response=eval("("+t.responseText+")");if(response.status=="SUCCESS"){window.location.href="home.pbc"}else{showOverlay();document.getElementById("dialogueMessage").innerHTML=response.loginFailureMessage;document.getElementById("dialogueButtons").innerHTML='<a href="javascript:closeDialogue()" class="btn" tabindex="10001"><span>Ok</span></a>&nbsp';$("dialogue").show()}};var handlerLogout=function(t){var response=eval("("+t.responseText+")");window.location.href=response.logoutUrl};var err=function(a){alert("Error "+a.status+" -- "+a.statusText)};function doLogin(){var a="login.pbc?m=i";var b=Form.serialize("loginForm");new Ajax.Request(a,{parameters:b,onSuccess:handlerLogin,onFailure:err})}function doLogout(){var b="logout.pbc?m=o";var a="";new Ajax.Request(b,{parameters:a,onSuccess:handlerLogout,onFailure:err})}function openOfferDetails(a){var c="viewOfferDetails.pbc?id="+a;var b=window.open(c,"offerDetailsWindow","height=200,width=400,scrollbars=yes");if(window.focus){b.focus()}}function openPromotionDetails(a){var b="viewPromotionDetails.pbc?id="+a;var c=window.open(b,"promotionDetailsWindow","height=200,width=400,scrollbars=yes");if(window.focus){c.focus()}}function showTagWhatsThis(){if(document.getElementById("tagWhatsThisDiv").style.display=="block"){document.getElementById("tagWhatsThisDiv").style.display="none"}else{Position.prepare();coords=Position.cumulativeOffset($("tagWhatsThisLink"));$("tagWhatsThisDiv").style.left=coords[0]-160+"px";$("tagWhatsThisDiv").style.top=coords[1]-30+"px";$("tagWhatsThisDiv").style.display="block"}}function showAccountInformation(){if(document.getElementById("accountInformationDiv").style.display=="block"){document.getElementById("accountInformationDiv").style.display="none"}else{Position.prepare();coords=Position.cumulativeOffset($("accountInformationDivLink"));$("accountInformationDiv").style.left=coords[0]-160+"px";$("accountInformationDiv").style.top=coords[1]-30+"px";$("accountInformationDiv").style.display="block"}}function showCommitmentStatusWhatsThis(){showOverlay();document.getElementById("dialogueMessage").innerHTML="Your membership commitment is the number of member-priced books ($10 or greater) that you agree to purchase from PBC over a specific time period (i.e., 4 books in 2 years).  Commitment status shows you both the number of books and the time remaining to fulfill your commitment";document.getElementById("dialogueButtons").innerHTML='<a href="javascript:closeDialogue()"><img src="images/btn/ok.gif"></a>';$("dialogue").show()}function showBookshelfWhatsThis(){if(document.getElementById("bookshelfWhatsThisDiv").style.display=="block"){document.getElementById("bookshelfWhatsThisDiv").style.display="none"}else{Position.prepare();coords=Position.cumulativeOffset($("bookshelfWhatsThisLink"));$("bookshelfWhatsThisDiv").style.left=coords[0]-160+"px";$("bookshelfWhatsThisDiv").style.top=coords[1]-30+"px";$("bookshelfWhatsThisDiv").style.display="block"}}function showPromotionWhatsThis(){if(document.getElementById("promotionWhatsThisDiv").style.display=="block"){document.getElementById("promotionWhatsThisDiv").style.display="none"}else{Position.prepare();coords=Position.cumulativeOffset($("promotionWhatsThisLink"));$("promotionWhatsThisDiv").style.left=coords[0]-160+"px";$("promotionWhatsThisDiv").style.top=coords[1]-30+"px";$("promotionWhatsThisDiv").style.display="block"}}function mustReadDecision(decision){var url="mustReadDecision.pbc";var params="decision="+decision;new Ajax.Request(url,{parameters:params,onSuccess:function(t){var response=eval("("+t.responseText+")");if(response.status=="SUCCESS"){showOverlay();document.getElementById("dialogueMessage").innerHTML="The PBC Pick will be added to your cart.";document.getElementById("dialogueButtons").innerHTML='<a href="javascript:closeDialogueAndRefresh()"><img src="images/btn/ok.gif"></a>&nbsp';$("dialogue").show()}else{if(response.status=="SUCCESS_NO"){showOverlay();document.getElementById("dialogueMessage").innerHTML="You have declined this month's PBC Pick.";document.getElementById("dialogueButtons").innerHTML='<a href="javascript:closeDialogueAndRefresh()"><img src="images/btn/ok.gif"></a>&nbsp';$("dialogue").show()}else{alert("There was an error processing your request!")}}},onFailure:function(t){alert("Error "+t.status+" -- "+t.statusText)}})};