jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};(function(e){var f=(e.browser.msie?"paste":"input")+".mask";var d=(window.orientation!=undefined);e.mask={definitions:{"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"}};e.fn.extend({caret:function(b,a){if(this.length==0){return}if(typeof b=="number"){a=(typeof a=="number")?a:b;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(b,a)}else{if(this.createTextRange){var h=this.createTextRange();h.collapse(true);h.moveEnd("character",a);h.moveStart("character",b);h.select()}}})}else{if(this[0].setSelectionRange){b=this[0].selectionStart;a=this[0].selectionEnd}else{if(document.selection&&document.selection.createRange){var c=document.selection.createRange();b=0-c.duplicate().moveStart("character",-100000);a=b+c.text.length}}return{begin:b,end:a}}},unmask:function(){return this.trigger("unmask")},mask:function(b,q){if(!b&&this.length>0){var o=e(this[0]);var m=o.data("tests");return e.map(o.data("buffer"),function(h,g){return m[g]?h:null}).join("")}q=e.extend({placeholder:"_",completed:null},q);var a=e.mask.definitions;var m=[];var p=b.length;var c=null;var l=b.length;e.each(b.split(""),function(g,h){if(h=="?"){l--;p=g}else{if(a[h]){m.push(new RegExp(a[h]));if(c==null){c=m.length-1}}else{m.push(null)}}});return this.each(function(){var g=e(this);var y=e.map(b.split(""),function(s,t){if(s!="?"){return a[s]?q.placeholder:s}});var x=false;var h=g.val();g.data("buffer",y).data("tests",m);function B(s){while(++s<=l&&!m[s]){}return s}function D(s){while(!m[s]&&--s>=0){}for(var u=s;u<l;u++){if(m[u]){y[u]=q.placeholder;var t=B(u);if(t<l&&m[u].test(y[t])){y[u]=y[t]}else{break}}}E();g.caret(Math.max(c,s))}function C(w){for(var t=w,u=q.placeholder;t<l;t++){if(m[t]){var v=B(t);var s=y[t];y[t]=u;if(v<l&&m[v].test(s)){u=s}else{break}}}}function z(u){var s=e(this).caret();var t=u.keyCode;x=(t<16||(t>16&&t<32)||(t>32&&t<41));if((s.begin-s.end)!=0&&(!x||t==8||t==46)){A(s.begin,s.end)}if(t==8||t==46||(d&&t==127)){D(s.begin+(t==46?0:-1));return false}else{if(t==27){g.val(h);g.caret(0,j());return false}}}function k(F){if(x){x=false;return(F.keyCode==8)?false:null}F=F||window.event;var v=F.charCode||F.keyCode||F.which;var u=e(this).caret();if(F.ctrlKey||F.altKey||F.metaKey){return true}else{if((v>=32&&v<=125)||v>186){var t=B(u.begin-1);if(t<l){var s=String.fromCharCode(v);if(m[t].test(s)){C(t);y[t]=s;E();var w=B(t);e(this).caret(w);if(q.completed&&w==l){q.completed.call(g)}}}}}return false}function A(s,u){for(var t=s;t<u&&t<l;t++){if(m[t]){y[t]=q.placeholder}}}function E(){return g.val(y.join("")).val()}function j(F){var v=g.val();var u=-1;for(var w=0,t=0;w<l;w++){if(m[w]){y[w]=q.placeholder;while(t++<v.length){var s=v.charAt(t-1);if(m[w].test(s)){y[w]=s;u=w;break}}if(t>v.length){break}}else{if(y[w]==v[t]&&w!=p){t++;u=w}}}if(!F&&u+1<p){g.val("");A(0,l)}else{if(F||u+1>=p){E();if(!F){g.val(g.val().substring(0,u+1))}}}return(p?w:c)}if(!g.attr("readonly")){g.one("unmask",function(){g.unbind(".mask").removeData("buffer").removeData("tests")}).bind("focus.mask",function(){h=g.val();var s=j();E();setTimeout(function(){if(s==b.length){g.caret(0,s)}else{g.caret(s)}},0)}).bind("blur.mask",function(){j();if(g.val()!=h){g.change()}}).bind("keydown.mask",z).bind("keypress.mask",k).bind(f,function(){setTimeout(function(){g.caret(j(true))},0)})}j()})}})})(jQuery);jQuery.fn.inputHints=function(){jQuery(this).each(function(a){if(jQuery(this).attr("type").match(/^text$|^textarea$/g)){jQuery(this).val(jQuery(this).attr("title"));jQuery(this).css("color","#999")}});jQuery(this).focus(function(){if(jQuery(this).val()==jQuery(this).attr("title")&&jQuery(this).attr("type").match(/^text$|^textarea$/g)){jQuery(this).val("");jQuery(this).css("color","")}});jQuery(this).blur(function(){if(jQuery(this).val()==""){if(jQuery(this).attr("type").match(/^text$|^textarea$/g)){jQuery(this).val(jQuery(this).attr("title"));jQuery(this).css("color","#999")}}})};var slide_time=8000;var slide_pos=0;var fade_speed=200;var next_slide=1;var periodical=null;var slideshow={};function get_slideshow_image_data(){jQuery.ajax({type:"GET",url:"/js/slideshow_data.js",dataType:"script",cache:false,async:false,success:function(){slideshow.slides=list.slides}});return false}function hide_show(b,a){jQuery(b).css({display:"none"});jQuery(a).css({display:""});return false}function new_slide(d){slide_pos=slide_pos+d;if(slide_pos>=slideshow.slides.length){slide_pos=0}else{if(slide_pos<0){slide_pos=slideshow.slides.length-1}}var b=slideshow.slides[slide_pos].link;var a=slideshow.slides[slide_pos].rel;var c=slideshow.slides[slide_pos].img;if(periodical!==null){jQuery("#slideshow a").fadeOut(fade_speed,function(){jQuery("#slideshow a").attr("href",b);jQuery("#slideshow a").attr("rel",a);jQuery("#slideshow img").attr("src",c);jQuery("#slideshow a").fadeIn(fade_speed)})}jQuery("#position").html((slide_pos+1)+"/"+slideshow.slides.length)}function slideshow_setup(){get_slideshow_image_data();new_slide(0);jQuery("#play").click(function(){hide_show(jQuery("#play"),jQuery("#stop"));next_slide=1;periodical=setInterval(function(){new_slide(next_slide)},slide_time)});jQuery("#prev").click(function(){next_slide=-1;new_slide(next_slide)});jQuery("#next").click(function(){next_slide=1;new_slide(next_slide)});jQuery("#stop").click(function(){clearInterval(periodical);hide_show(jQuery("#stop"),jQuery("#play"))});return false}function slideshow_startup(){slideshow_setup();jQuery("#menu").css({display:"block"});jQuery("#play").trigger("click");return false}var ga_key="UA-1889218-1";if(document.domain.match(/^www\.powells\.com|^powells\.com/g)===null){ga_key="UA-1889218-3"}var stockTimeOut=500;function OtherOnloadTrackingEvents(){if(typeof EcommerceTracking=="function"){EcommerceTracking()}if(typeof RandomizerCheckRAU=="function"){RandomizerCheckRAU()}return false}var pageTracker=undefined;function start_analytics(){jQuery.ajax({type:"GET",url:(document.location.protocol=="https:"?"https://ssl":"http://www")+".google-analytics.com/ga.js",cache:true,async:false,dataType:"script",data:null,success:function(){if(is_defined(_gat)){pageTracker=_gat._getTracker(ga_key);pageTracker._trackPageview()}else{throw"_gat has not been defined"}OtherOnloadTrackingEvents()},error:function(){throw"This is an error callback inside jQuery.ajax within start_analytics"}});return false}function TrackEvent(c,e,a,d){if(typeof a===null){a=""}if(!(d>0)){d=0}if(is_defined(pageTracker)){pageTracker._trackEvent(c,e,a,d)}else{var b=setTimeout(function(){pageTracker._trackEvent(c,e,a,d)},stockTimeOut)}return false}function addTrans(b,d,h,f,a,g,c,e){if(is_defined(_gat)){pageTracker._addTrans(b,d,h,f,a,g,c,e)}else{var j=setTimeout(function(){pageTracker._addTrans(b,d,h,f,a,g,c,e)},stockTimeOut)}return false}function addItem(g,a,f,d,c,e){if(is_defined(_gat)){pageTracker._addItem(g,a,f,d.toUpperCase(),c,e)}else{var b=setTimeout(function(){pageTracker._addItem(g,a,f,d.toUpperCase(),c,e)},stockTimeOut)}return false}function trackTrans(){if(is_defined(_gat)){pageTracker._trackTrans()}else{var a=setTimeout(function(){pageTracker._trackTrans()},stockTimeOut)}return false}function analytics_startup(){start_analytics();book_nugget_event_tracking();navigation_event_tracking();slideshow_event_tracking()}function toggle_search_options(c,b,a){if(jQuery("#"+b).hasClass("selected")){jQuery("#"+b).removeClass("selected");jQuery("#"+c).addClass("invisible")}else{jQuery(".search").addClass("invisible");jQuery(".selected").removeClass("selected");jQuery("#"+b).addClass("selected");jQuery("#"+c).removeClass("invisible")}jQuery("#"+a).focus()}function toggle(a,b){jQuery("#"+a).toggleClass(b)}function toggle_text(a,b,c){if(jQuery("#"+a).html()==b){jQuery("#"+a).empty().html(c)}else{jQuery("#"+a).empty().html(b)}}function empty_form(e,b){if(e=="adv_search_form"){var d=["kw_adv","title_adv","author_adv","publisher_adv","section_adv"];for(var c in d){jQuery("#"+d[c]).val("")}var a=["class_adv","binding_adv","sort_by_adv","location_adv","days_old_adv"];for(var c in a){jQuery("#"+a[c]).find("option:first").attr("selected","selected").parent("select")}jQuery("#exact_title_adv").attr("checked",false);jQuery("#per_page_adv option[value='100']").attr("selected","selected")}else{jQuery("#isbn").val("")}jQuery(".filled-in").removeClass("filled-in");jQuery("#kw_adv").focus()}function unflag(a){var b=jQuery(a).attr("id");if(jQuery("label[for='"+b+"']").hasClass("filled-in")){jQuery("label[for='"+b+"']").removeClass("filled-in")}}function view_others(isbns,isbn,condition,link_type){if(condition=="electronic"){th="eBook Format"}else{th="Condition"}other_copies_div="other-copies-"+isbn;jQuery("#"+other_copies_div).html("<img src='/images/loading.gif' /> Loading...");other_copies_url="/book?type=json_truncated&isbn="+isbns.replace(/,/g,"&isbn=")+"&nofuzzy=1&order=price asc&jsoncallback=?";jQuery.ajax({url:other_copies_url,success:function(data){r=eval("("+data+")");_other_copies=[];_other_copies_table=[];for(inkey in r){if(r[inkey].price){price="$"+r[inkey].price}else{price=""}_other_copies_row=[];_other_copies_row.push("<tr>");_other_copies_row.push("<td style='width:200px; border:1px solid #EBE7DC'><!--"+r[inkey].price/1000+" sort value-->"+r[inkey].class_external+" "+r[inkey].condition+"</td>");_other_copies_row.push("<td style='width:200px; border:1px solid #EBE7DC'>"+r[inkey].binding+"</td>");_other_copies_row.push("<td style='text-align:right; border:1px solid #EBE7DC; width:1px;'>"+price+"</td>");_other_copies_row.push("<td style='width:1px; border:1px solid #EBE7DC'><small><a href='/biblio/"+inkey+"' title='"+r[inkey].title+"'>more&nbsp;info</a></small></td>");_other_copies_row.push("<td style='width:1px; border:1px solid #EBE7DC'>"+add_to_cart_button(inkey,r[inkey].title)+"</td>");_other_copies_row.push("</tr>");_other_copies_table.push(_other_copies_row.join(""))}if(r){top_row="<tr style='background:#EBE7DC; border:1px solid ##B09B8A;'><th>"+th+"<!-- [<a title='See our Glossary for term descriptions.' href='javascript:open_window(\"/post?type=popup&name=glossary&#condition\");'>?</a>]--></th><th>Binding<!-- [<a title='See our Glossary for term descriptions.' href='javascript:open_window(\"/post?type=popup&name=glossary&#binding\");'>?</a>]--></th><th>Price</th><th>&nbsp;</th><th>&nbsp;</th></tr>";_other_copies_table="<table cellpadding='2px' class='sortable'>"+top_row+_other_copies_table.sort().join(" ")+"</table>"}jQuery("#"+other_copies_div).html(_other_copies_table).css("display","none").fadeIn("slow")}});_v=link_type.split(":");TrackEvent("Search-Also-Available",_v[0],_v[1])}function also_available(g,a,j,l,m,c,h,d){jQuery("#other-copies-"+a).html("<img src='/images/loading.gif' /> Loading...");var k=[];for(i=0;i<m.split(":").length;i++){k.push("<tr>");k.push("<td style='width:200px; border:1px solid #EBE7DC'>"+c.split(":")[i]+"</td>");k.push("<td style='width:200px; border:1px solid #EBE7DC'>"+d.split(":")[i]+"</td>");k.push("<td style='width:200px; border:1px solid #EBE7DC;text-align:right;width:1px;'>$"+h.split(":")[i]+"</td>");k.push("<td style='width:1px; border:1px solid #EBE7DC'><a href='/biblio/"+m.split(":")[i]+"'><small>more&nbsp;info</small></a></td>");k.push("<td style='width:1px; border:1px solid #EBE7DC'>"+add_to_cart_button(m.split(":")[i],g)+"</td>");k.push("</tr>")}var e=(j=="Electronic")?"eBook&nbsp;Format":"Condition";var b="<table><tr style='background:#EBE7DC; border:1px solid #B09B8A;'><th>"+e+"</th><th>Binding</th><th>Price</th><th></th><th></th></tr>";var f="</table>";jQuery("#other-copies-"+a).fadeIn().html(b+k.join("")+f);_v=l.split(":");TrackEvent("Search-Also-Available",_v[0],_v[1])}function add_to_cart_button(a,b){return"<a href='/cgi-bin/Shopping_cart?add="+a+"' title='Add &quot;"+b+"&quot; to your Shopping Cart'><img src='/images/buttons/addtocart82.gif'  style='border:0;' class='add-to-cart-button' /></a>"}var UserTrail={};UserTrail.proto=location.protocol;UserTrail.host=location.host;UserTrail.base=UserTrail.proto+"//"+UserTrail.host;UserTrail.initUser=function(){var c=jQuery.cookie("trail_id");if(!c){var a=jQuery.cookie("preferences");var b="";if(a){b=P_Cookie.getPropValue("preferences","ident");if(b!=""){P_Cookie.setCookie("trail_id",b)}else{UserTrail.getHashId()}}else{UserTrail.getHashId()}}return false};UserTrail.loggedIn=function(){var b=jQuery.cookie("authent");var p=0;var o="(hash)";var m="(&)";var k=".*?";var j="((?:[a-z][a-z]*[0-9]+[a-z0-9]*))";var h="(&)";var g="(timestamp)";var f="(&)";var e="(\\d+)";var d="(&)";var c="(username)";var a="(&)";var q="((?:[a-z][a-z]+))";var l=new RegExp(o+m+k+j+h+g+f+e+d+c+a+q,["i"]);if(b.length!==0&&l.exec(b)){p=1}return p};UserTrail.getCartAndNameDisplay=function(){var a=UserTrail.base+"/user?type=user_and_cart_html";jQuery.ajax({type:"GET",url:a,data:"{}",dataType:"html",cache:false,success:function(b){UserTrail.displayCartAndName(b)}});return false};UserTrail.displayCartAndName=function(a){if(a!==undefined&&a.length>0){jQuery("#display_name").empty().html(a+jQuery("#display_name").html())}return false};UserTrail.getHashId=function(){var a=UserTrail.base+"/trail/get_anon_id";jQuery.ajax({type:"GET",url:a,data:"{}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(b){UserTrail.parseHashId(b)}});return false};UserTrail.parseHashId=function(a){var b=a.result;if(b!==undefined&&b.length>0){P_Cookie.setCookie("trail_id",b)}return false};UserTrail.getTrail=function(b){var a=UserTrail.base+"/trail/template_html";if(b&&b.all==1){a=UserTrail.base+"/trail/template_all_html"}jQuery.ajax({type:"GET",url:a,data:"{}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(c){UserTrail.parseTrail(c)}});return false};UserTrail.parseTrail=function(b){var a=b.result;if(a!==undefined&&a.length>0){jQuery("#trail_pod").html(a)}if(UserPrefs.getPref("show_trail")!==0){toggle_displaying("show_trail")}return false};UserTrail.clearTrail=function(){var a=UserTrail.base+"/trail/clear_trail";UserTrail.clearTrailDisplay();jQuery.ajax({type:"POST",url:a,data:"{}",contentType:"application/json; charset=utf-8",dataType:"json"});return false};UserTrail.clearTrailDisplay=function(){jQuery("div#show_trail .rec_item").remove();jQuery("clear_trail").remove();jQuery("#show_trail").append("<div style='text-align: center; padding: 3px, 0;'>No Items</div>");return false};var P_Cookie=new Object();P_Cookie.proto=location.protocol;P_Cookie.host=location.host;P_Cookie.base=P_Cookie.proto+"//"+P_Cookie.host;P_Cookie.setCookie=function(b,c,a){jQuery.cookie(b,c,{path:"/",domain:".powells.com",duration:a})};P_Cookie.getPropValue=function(c,e,b){var g="";var a="";var d="";if(!b){b="&"}var f=jQuery.cookie(c);if(f.match(e)){g=f.indexOf(e+b);if(g!=-1){g=g+e.length+1;a=f.indexOf(b,g);if(a==-1){a=f.length}d=unescape(f.substring(g,a))}}return d};P_Cookie.getPropHash=function(c,b){if(!b){b="&"}var e=jQuery.cookie(c);var a=new Hash();var d=e.split(b);for(i=0;i<d.length;i+=2){a.set(d[i],d[i+1])}return a};function set_last_location_cookie(){document.cookie="lastlocation="+document.location+"; path=/; domain=.powells.com;";return false}var UserPrefs={};UserPrefs.preferences={};UserPrefs.dateObj=new Date();UserPrefs.proto=location.protocol;UserPrefs.host=location.host;UserPrefs.base=UserPrefs.proto+"//"+UserPrefs.host;UserPrefs.getPrefs=function(){UserPrefs.Cookie=jQuery.cookie("preferences");if(UserPrefs.Cookie){UserPrefs.parseCookie();if(UserPrefs.dateObj.getTime()-UserPrefs.timeStamp>1000*60*5){if(UserPrefs.preferences.ident){UserPrefs.getData()}UserPrefs.setCookie()}}else{UserPrefs.setCookie()}return false};UserPrefs.parseCookie=function(c){UserPrefs.originalPreferences={};var b=UserPrefs.Cookie.split("&");for(var a=0;a<b.length;a+=2){if(b[a]=="timeStamp"){UserPrefs.timeStamp=decodeURIComponent(b[a+1])}else{UserPrefs.preferences[b[a]]=decodeURIComponent(b[a+1])}}for(a in UserPrefs.preferences){UserPrefs.originalPreferences[a]=UserPrefs.preferences[a]}return false};UserPrefs.Cookiefy=function(){var b=[];for(var a in UserPrefs.preferences){if(!a.match("JSON")){b.push(a+"&"+encodeURIComponent(UserPrefs.preferences[a]))}}b.push("timeStamp&"+UserPrefs.dateObj.getTime());return b.join("&")};UserPrefs.setCookie=function(){var a=UserPrefs.Cookiefy();P_Cookie.setCookie("preferences",a,99999);return false};UserPrefs.isChanged=function(){for(var a in UserPrefs.preferences){if(UserPrefs.preferences[a]!=UserPrefs.originalPreferences[a]){return 1}}return 0};UserPrefs.setPref=function(a,b){if(b!=UserPrefs.preferences[a]){UserPrefs.preferences[a]=b;UserPrefs.setCookie();if(UserPrefs.preferences.ident&&UserPrefs.preferences.ident.length>0){UserPrefs.setData()}}return false};UserPrefs.getPref=function(a){return UserPrefs.preferences[a]};UserPrefs.getData=function(){var a=UserPrefs.base+"/prefs/"+UserPrefs.preferences.ident;$.ajax({type:"GET",url:a,data:"{}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(b){UserPrefs.parseData(b)}});return false};UserPrefs.parseData=function(object){var storedUserPrefs=eval(object);for(var i in storedUserPrefs){if(i!="toJSONString"){UserPrefs.preferences[i]=storedUserPrefs[i]}}return false};UserPrefs.setData=function(){var b="preferences="+JSON.stringify(UserPrefs.preferences);var a=UserPrefs.base+"/prefs/"+UserPrefs.preferences.ident;$.ajax({type:"POST",url:a,data:b,contentType:"application/json; charset=utf-8",dataType:"json"});return false};UserPrefs.getSessionID=function(){if(!jQuery.cookie("p_session")){var a=UserPrefs.base+"/trail/get_anon_id";jQuery.ajax({type:"GET",url:a,data:"{}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(b){UserPrefs.setSessionCookie(b)}})}return false};UserPrefs.setSessionCookie=function(a){var b=a.result;if(b!==undefined&&b.length>0){P_Cookie.setCookie("p_session",b)}return false};toggle_displaying=function(d){var b=jQuery("#"+d);var a=jQuery("#"+d+"_inverse");var c=b.css("display");b.css({display:a.css("display")});a.css({display:c});return false};function newtoggle_displaying(d,c){var b=jQuery("#"+d);var a=jQuery("#"+d+"_inverse");if(!c){c="inline"}if(b.css("display")!="none"){b.css({display:"none"});if(a.length>0){a.css({display:c})}}else{b.css({display:c});if(a.length>0){a.css({display:"none"})}}return false}function open_window(b,c,a){mywin=window.open(b,"win","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width="+c+",height="+a)}function show_big_images(a,b){mywin=window.open(a,"win","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width="+b+",height=560")}function open_smaller_window(a){mywin=window.open(a,"win","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=400,height=500")}function open_freeship_window(a){mywin=window.open(a,"win","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=500,height=500")}function launchBookwrap(b,a){var d="/cgi-bin/bookwrap_redirect?display="+b+"&version="+a;if(a==1){var c=window.open(d,"bookwrap","height=460,width=280,scrollbars=no,status=no,toolbar=no, menubar=no, location=no,resizable=no")}else{var c=window.open(d,"bookwrap","height=295,width=760,scrollbars=no,status=no,toolbar=no, menubar=no, location=no,resizable=no")}if(c){c.focus()}}function lazy_load_the_nugget(){jQuery.each(jQuery("span.lazy_load_nugget"),function(){isbn=jQuery(this).attr("id").replace("isbn-","");url="/book?type=nugget&isbn="+isbn;jQuery("#"+jQuery(this).attr("id")).load(url)})}function lazy_load_the_images(){jQuery("img").lazyload({failurelimit:20,threshold:50,effect:"fadeIn"})}function search_startup(){if(jQuery("#search-box").attr("value")){return false}jQuery("#main-search").submit(function(a){if(jQuery("#search-box").attr("value")==jQuery("#search-box").attr("title")||!jQuery("#search-box").attr("value")){var b=prompt("Did you forget to type something in the search box?\r\n\r\nType it here and click 'OK.'");if(b){jQuery("#main-search").unbind("submit");jQuery("#search-box").attr("value",b);jQuery("#main-search").submit()}else{jQuery("#search-box").inputHints();return false}}});return false}function event_detail(e){if(jQuery("#single_event_popup").length===0){var d=jQuery("<div></div>");jQuery(d).attr("id","single_event_popup");jQuery("body").prepend(d)}close_it("single_event_popup");var b=parseInt(((window.viewport.width()/2)-250),10)+"px";var c=parseInt((window.viewport.scrollTop()+60),10)+"px";jQuery("#single_event_popup").css({display:"block",position:"absolute","z-index":"5000",left:b,top:c,border:"5px solid #ccc",padding:"5px",background:"white",width:"500px"});jQuery("#single_event_popup").empty().html('<small><img src="/images/loading.gif" style="float:left;margin-right:5px;"> Loading...</small>');var a="/cgi-bin/calnug?id="+e;jQuery("#single_event_popup").load(a).fadeIn("slow");return false}function close_it(a){jQuery("#"+a).empty().html("");jQuery("#"+a).css({display:"none"});return false}blue=new Array();blue.dark="#5F747E";blue.medium="#98B4C2";blue.light="#86A5B5";blue.lightest="#DAE4E9";brown=new Array();brown.dark="#4A3A2D";brown.medium="#B09B8A";brown.light="#EBE7DC";orange=new Array();orange.dark="#F07F24";white=new Array();white.full="#FFFFFF";function navigation_startup(){jQuery("#nav").children().mouseover(function(){jQuery(this).addClass("over")}).mouseout(function(){jQuery(this).removeClass("over")});setTimeout("load_user()",500)}function load_user(){jQuery("#user").load("/user?type=user_cart")}var isbnUtils={};isbnUtils.valid={};isbnUtils.inValid={};isbnUtils.proto=location.protocol;isbnUtils.host=location.host;isbnUtils.base=isbnUtils.proto+"//"+isbnUtils.host;isbnUtils.searchStopped=false;isbnUtils.checkList=function(c,d){isbnUtils.invalid=[];isbnUtils.valid=[];isbnUtils.searchStopped=false;var e=jQuery("#listId");if(typeof d=="undefined"){d="error_box"}jQuery("#errorId").css({display:"none"});jQuery("#errorId").empty();var b=isbnUtils.removeBadChars(e.attr("value"));var f=b.split(" ");f.remove("");f.remove("\n");if(f.length<1){e.value="";isbnUtils.searchStopped=true;return false}isbnUtils.checkLength(f);e.value=isbnUtils.valid.join("\n");if(isbnUtils.invalid.length>0){var a=[];a=isbnUtils.invalid.map(function(j,h){return"*"+j});if(isbnUtils.valid.length<1){e.value=a.join("\n")}else{e.value=e.value+"\n"+a.join("\n")}var g=[];g=isbnUtils.invalid.map(function(j,h){return"<li>"+j+"</li>"});jQuery("#errorId").html("<li>Found invalid ISBNs.</li>");jQuery("#errorId").css({display:"block"});isbnUtils.searchStopped=true;return false}return true};isbnUtils.removeBadChars=function(a){a=a.replace(/-/g,"");a=a.replace(/[^0-9Xx]+/g," ");a=a.replace(/(\n|\t| )/g," ");return a};isbnUtils.checkLength=function(a){a.each(function(c,b){if(c.length==13||c.length==10){isbnUtils.valid.include(c)}else{isbnUtils.invalid.include(c)}})};function isbnsearch(){var c=document.isbngroupsearch.isbn.value;c=c.replace(/-/g,"");c=c.replace(/[^0-9Xx]+/g,", ");c=c.replace(/, $/,"");if(document.isbngroupsearch.isbn.value.length===0){alert("Aw....Please enter an ISBN!");return(false)}var b=c.split(", ");for(var a=0;a<b.length;a++){if(!(b[a].length==10||b[a].length==13)){alert("Sorry, but all ISBN's must be either 10 or 13 digits long and have spaces between each one.\n\nPlease double check your ISBN's and click on \"Search\" again.\n");return(false)}}document.isbngroupsearch.isbn.value=c;return(true)}function pop_in(c){var b=jQuery("#"+c).val();if(b!=""){jQuery("body").append('<div id="pagewrap"><div id="overlay" onClick="pop_out()"></div><div id="popover"></div></div>');jQuery("#popover").fadeIn(300).css({display:"block"}).html('<div style="float: right; margin: 0; padding: 0; font-weight: bold; font-size: 16px; padding: 1px 1px 2px 2px; margin: 0px -35px 5px 0px; background: #000000; color: #ffffff;"><a onClick="pop_out()" style="color: #ffffff; cursor: pointer; text-decoration: none;">X</a></div><br clear="all" />'+b);jQuery("#overlay").css({display:"block"});var a=(window.pageYOffset+30+"px")}else{alert("No blurb, yet!  Please enter one before previewing.")}}function pop_out(){jQuery("#popover").css({display:"none"});jQuery("#overlay").css({display:"none"})}function PowellsCardForm(){var a=parseInt(location.search.substring(1),10);document.actual.add.value="0-20"+(a<10?"0":"")+a;var b=jQuery("input[@name='quantum_amount']:checked").val();if(b===undefined){b=parseFloat(jQuery("input:text[name=amount]").val())}if(b<5){alert("Powell's Cards must be at least $5!");return false}if(!(b>0)){alert("Please select a value!");return false}document.actual.add.value+=(b/100000).toFixed(7).substring(2);document.actual.add.value+="-0";var c=parseInt(document.powellsCard.qty.value,10);if(!(c>0)){c=1}document.actual.quantity.value=c;setTimeout(function(){document.actual.submit()},10);return false}function UncheckQuantumAmounts(){jQuery("input[@name='quantum_amount']:checked").attr("checked",false)}function iterateNodes(b){if(!b||!b.childNodes||searchTerms.length==0){return}for(var a=b.childNodes.length-1;a>=0;a--){if(b.childNodes[a]){if(b.childNodes[a].nodeName=="#text"){splitTextNode(b.childNodes[a])}else{iterateNodes(b.childNodes[a])}}}}function splitTextNode(c){pretext="";text=c.data;var e;for(term=0;term<searchTerms.length;term++){var b=1;while(b){b=0;var a=text.search(searchRegs[term]);if(a>-1){if(!e){e=document.createDocumentFragment()}var d=document.createElement("span");d.className="searchterm term"+term;d.innerHTML=text.substr(a,searchTerms[term].length);e.appendChild(document.createTextNode(text.substr(0,a)));e.appendChild(d);text=text.substr(a+searchTerms[term].length);b=1}}}if(e){e.appendChild(document.createTextNode(text));c.parentNode.insertBefore(e,c.nextSibling);c.parentNode.removeChild(c)}}var searchTerms=[];var searchRegs=[];var stopwords={the:1,"in":1,"if":1,to:1,of:1,"for":1,"powells.com":1,powells:1,book:1};function findSearchTerm(b){spans=document.getElementsByTagName("span");for(var a=0;a<spans.length;a++){if((spans[a].parentNode.id!="highlighted")&&(spans[a].className=="searchterm "+b)){spans[a].id="searchspan"+a;location.hash="searchspan"+a;return}}}function doSearch(){if(document.all||document.cookie.match(/nohighlight/)){}else{var b=new RegExp("^(link|site|inurl):","i");var g=document.referrer.match("google.*q=([^&;]+)");if(g){st=decodeURIComponent(g[1]).split("+");for(var e=st.length-1;e>=0;e--){if(st[e].match(/ /)){n=st[e].split(" ");for(var c=0;c<n.length;c++){st.push(n[c].replace(b,""))}st[e]=""}}for(var e=0;e<st.length;e++){if(st[e].match(/\S/)&&!stopwords[st[e]]){searchTerms.push(st[e])}}for(var e=0;e<searchTerms.length;e++){searchRegs[e]=new RegExp("\\b"+searchTerms[e]+"\\b","i")}iterateNodes(document.body);var f=document.getElementById("content");var d=document.createElement("div");d.id="highlighted";var a="The following search terms have been highlighted: ";for(var e=0;e<searchTerms.length;e++){a+='<span class="searchterm term'+e+'" onClick="findSearchTerm(\'term'+e+"')\">"+searchTerms[e]+"</span> "}a+=' [<span class="off" onClick="document.cookie=\'nohighlight=yes;domain=.powells.com;path=/;expires=Sun, 17-Jan-2038 19:14:07 GMT\'; window.location.reload(); ">Turn this off</span>]';d.innerHTML=a;f.insertBefore(d,f.firstChild)}}}var error_count=0;var section="";function build_your_own_link(a,b,c){c=(c)?c:"";partner_section=(partner_id)?"partner/"+partner_id:"";make_link="<a href='http://www.powells.com/"+partner_section+"/"+a+"' title='"+c+"' rel='powells'>";make_link+=jQuery("#link-text-"+b).val();make_link+="</a>";jQuery("#link-code-"+b).text(make_link);jQuery("#link-preview-"+b).html("Finished link: "+make_link)}function Password(){window.name="parent";password=window.open("/partnership/password.html","password","toolbar=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=175,height=175")}function setCookie(){if(!document.password.entry_password.value){document.password.entry_password.value=prompt("Please enter your password","")}if(!document.password.partner_id.value){document.password.partner_id.value=prompt("Please enter your partner id","")}}function checkRequired(){var a=false;if(!document.create.first_name.value){document.create.first_name.value=prompt("Please enter your first name","");a=true}if(!document.create.last_name.value){document.create.last_name.value=prompt("Please enter your last name","");a=true}if(!document.create.phone.value){document.create.phone.value=prompt("Please enter your phone number","");a=true}if(!document.create.tax_id.value){document.create.tax_id.value=prompt("Please enter your Tax ID or S.S. #","");a=true}if(!document.create.email.value){document.create.email.value=prompt("Please enter your email address","");a=true}if(!document.create.password.value){document.create.password.value=prompt("Please enter a password","");a=true}if(document.create.password.value!=document.create.password2.value){alert("Your passwords do not match!");a=true}return !a}function createUrl(){var b;var a="/partner/";if(!document.result.partner_id.value){document.result.partner_id.value=prompt("Please enter your partner id","")}b=document.result.URL.value;if(!b){alert("Please select a section from the popup");return false}b=document.result.partner_id.value+"/"+b;b=a+b;document.result.result.value=b;return false}function makeSection(b){var a="/partner/";if(!document.result.partner_id.value){document.result.partner_id.value=prompt("Please enter your partner id","")}document.result.result.value=a+document.result.partner_id.value+"/"+b;return false}function makeUrl(){var a=document.home_url.jojo.value;url="/partner/"+a;document.home_url.home_result.value=url}function makeObbUrl(){var b=document.obb_url.partnerid.value;var a='<a href="http://www.powells.com/partner/'+b+'/sellonline">YOUR TEXT OR IMAGE HERE</a>';document.obb_url.obb_result.value=a}function makeIsbnUrl(){guh=document.isbn_url.partner.value;isbn=document.isbn_url.isbn.value;url="/cgi-bin/partner?partner_id=";url+=guh+"&cgi=search/search&searchtype=isbn";url+="&searchfor="+isbn;document.isbn_url.your_url.value=url}function makeAuthUrl(){var c=document.auth_url.partner.value;var d=document.auth_url.first.value;var b=document.auth_url.last.value;var a="/partner/"+c;a+="/s?kw=";a+=escape(b+"+"+d);document.auth_url.your_url.value=a}function makeKwUrl(){var a=document.kw_url.partner.value;pokey=document.kw_url.pokey.value;url="/partner/"+a;url+="/s?kw=";url+=escape(pokey);document.kw_url.your_url.value=url}function CheckLength(c){var b=window.event.srcElement.value;var a=255;if(window.event.srcElement.value.length>=c){alert("You have reached the maximum length of 255 characters permitted here.");window.event.srcElement.value=b.substring(0,a);return false}}var partner_id=false;function partner_startup(){if(jQuery.cookie("partner_password")){var a=jQuery.cookie("partner_password").split(":");partner_id=a[0]}}var is_production=1;function set_is_prod(){if(document.domain.match(/^www\.powells\.com|^powells\.com/g)===null){is_production=0}return false}function showObject(a){var b=JSON.stringify(a,null,"\t");alert(b)}function prepareNonProductionSystems(){if(is_production==1){return false}jQuery("#scanalert").css({display:"none"});jQuery("#VerisignFooter").css({display:"none"});return false}window.viewport={height:function(){return jQuery(window).height()},width:function(){return jQuery(window).width()},scrollTop:function(){return jQuery(window).scrollTop()},scrollLeft:function(){return jQuery(window).scrollLeft()}};function general_startup(){set_is_prod();prepareNonProductionSystems();search_startup();UserPrefs.getPrefs();UserPrefs.getSessionID();UserTrail.initUser();UserTrail.getCartAndNameDisplay();navigation_startup();set_last_location_cookie();partner_startup();jQuery("input[title]").inputHints();setTimeout("analytics_startup()",500);lazy_load_the_nugget();return false}function addToCart(c,d,b){var a="/cgi-bin/Shopping_cart?add="+c+"&quantity="+d+"&where="+b;jQuery.ajax({url:a,cache:false})}zero_one=Math.round(Math.random(0,1));function is_defined(a){if(typeof a=="undefined"){return false}return true}var pv="";function ValidatePhone(a){if(pv.length<a.value.length){a.value=a.value.replace(/^\(?(\d{3})\)?$/,"($1)");a.value=a.value.replace(/^(\(\d{3}\)\s*\d\d\d)$/,"$1-")}pv=a.value}function testphone(b){var a=b.value.replace(/[\s\(\)\-]/g,"");if(!isNaN(a.substring(0,10))&&a.length<10){alert("Phone number must contain area code!");return false}}function book_nugget_event_tracking(){jQuery.each(jQuery(".booklist"),function(){if(jQuery(this).attr("id")){var a=jQuery(this).attr("id");jQuery.each(jQuery("#"+jQuery(this).attr("id")+" a"),function(b){if(jQuery(this).attr("rel")=="cover-image"){book_title=jQuery(this).attr("title").replace(/\'/g,"")}jQuery(this).bind("click",{book_title:book_title},function(c){TrackEvent("Book-Nugget",a+":"+jQuery(this).attr("rel"),c.data.book_title)})})}})}function navigation_event_tracking(){jQuery("._trackNavigation a").bind("click",function(){if(jQuery(this).attr("rel")){var a=jQuery(this).attr("rel").replace(/\'/g,"").replace(/ /g,"-").split(":");if(jQuery(this).attr("rel")!="nofollow"){TrackEvent("Navigation",a[0],a[1])}else{TrackEvent("Navigation","nofollow",jQuery(this).html().replace(/\'/g,"").replace(/ /g,"-"))}}})}function slideshow_event_tracking(){jQuery("#slideshow-wrapper a").bind("click",function(){if(jQuery(this).attr("rel")){var a=jQuery(this).attr("rel").replace(/\'/g,"").replace(/ /g,"-").split(":");TrackEvent("Slideshow",a[0],a[1])}})}(function(a){a.fn.lazyload=function(b){var c={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(b){a.extend(c,b)}var d=this;if("scroll"==c.event){a(c.container).bind("scroll",function(g){var e=0;d.each(function(){if(a.abovethetop(this,c)||a.leftofbegin(this,c)){}else{if(!a.belowthefold(this,c)&&!a.rightoffold(this,c)){a(this).trigger("appear")}else{if(e++>c.failurelimit){return false}}}});var f=a.grep(d,function(h){return !h.loaded});d=a(f)})}this.each(function(){var e=this;if(undefined==a(e).attr("original")){a(e).attr("original",a(e).attr("src"))}if("scroll"!=c.event||undefined==a(e).attr("src")||c.placeholder==a(e).attr("src")||(a.abovethetop(e,c)||a.leftofbegin(e,c)||a.belowthefold(e,c)||a.rightoffold(e,c))){if(c.placeholder){a(e).attr("src",c.placeholder)}else{a(e).removeAttr("src")}e.loaded=false}else{e.loaded=true}a(e).one("appear",function(){if(!this.loaded){a("<img />").bind("load",function(){a(e).hide().attr("src",a(e).attr("original"))[c.effect](c.effectspeed);e.loaded=true}).attr("src",a(e).attr("original"))}});if("scroll"!=c.event){a(e).bind(c.event,function(f){if(!e.loaded){a(e).trigger("appear")}})}});a(c.container).trigger(c.event);return this};a.belowthefold=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).height()+a(window).scrollTop()}else{var b=a(d.container).offset().top+a(d.container).height()}return b<=a(c).offset().top-d.threshold};a.rightoffold=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).width()+a(window).scrollLeft()}else{var b=a(d.container).offset().left+a(d.container).width()}return b<=a(c).offset().left-d.threshold};a.abovethetop=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).scrollTop()}else{var b=a(d.container).offset().top}return b>=a(c).offset().top+d.threshold+a(c).height()};a.leftofbegin=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).scrollLeft()}else{var b=a(d.container).offset().left}return b>=a(c).offset().left+d.threshold+a(c).width()};a.extend(a.expr[":"],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"})})(jQuery);function is_set(){return(typeof google.loader=="object"&&is_defined(google.loader.ClientLocation)&&is_defined(google.loader.ClientLocation.address))?true:false}function is_US(){if(is_set()===true&&is_defined(google.loader.ClientLocation.address.country)===true&&google.loader.ClientLocation.address.country=="USA"){return true}else{if(is_set()===true){return false}}return undefined}function is_international(){if(is_set()===true&&is_defined(google.loader.ClientLocation.address.country)===true&&google.loader.ClientLocation.address.country!="USA"){return true}else{if(is_set()===true){return false}}return undefined}function country_code(){return(is_set()===true&&is_defined(google.loader.ClientLocation.address.country_code)===true)?google.loader.ClientLocation.address.country_code:undefined}function is_OR_or_WA(){if(is_set()===true&&is_defined(google.loader.ClientLocation.address.region)===true&&(google.loader.ClientLocation.address.region=="OR"||google.loader.ClientLocation.address.region=="WA")){return true}else{if(is_set()===true){return false}}return undefined}function is_Portland(){if(is_set()===true&&is_defined(google.loader.ClientLocation.address.city)===true&&google.loader.ClientLocation.address.city=="Portland"){return true}else{if(is_set()===true){return false}}return undefined}function is_local(){var a=["Portland","Beaverton","Gresham","Vancouver","Hillsboro","Forest Grove","Aloha","Tualatin","Tigard","Sherwood","West Linn","Oregon City","Lake Oswego","Gladstone","Milwuakie","Clackamas","Battle Ground","Camas","Washougal","Troutdale","Wilsonville"];if(is_set()===true&&is_OR_or_WA()===true&&is_defined(google.loader.ClientLocation.address.city)===true&&jQuery.inArray(google.loader.ClientLocation.address.city,a)>=0){return true}else{if(is_set()===true){return false}}return undefined}function local_or_no_banner(e,d,c){var a=[];if(is_local()===true){a.img=d[0];a.href_val=d[1];a.rel_val=d[2]}else{a.img=c[0];a.href_val=c[1];a.rel_val=c[2]}jQuery("#"+e).html("<a href='"+a.href_val+"'><img rel='"+a.rel_val+"' src='"+a.img+"' style='border:0;' /></a>");var f="Show Banner ("+a.rel_val+")";var b=setTimeout('TrackEvent("Misc", "'+f+'")',500);return false};