jQuery.cookie=function(a,k,j){if(typeof k!="undefined"){j=j||{};if(k===null){k="";j.expires=-1}var e="";if(j.expires&&(typeof j.expires=="number"||j.expires.toUTCString)){var b;if(typeof j.expires=="number"){b=new Date();b.setTime(b.getTime()+(j.expires*24*60*60*1000))}else{b=j.expires}e="; expires="+b.toUTCString()}var m=j.path?"; path="+(j.path):"";var c=j.domain?"; domain="+(j.domain):"";var h=j.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(k),e,m,c,h].join("")}else{var g=null;if(document.cookie&&document.cookie!=""){var l=document.cookie.split(";");for(var d=0;d<l.length;d++){var f=jQuery.trim(l[d]);if(f.substring(0,a.length+1)==(a+"=")){g=decodeURIComponent(f.substring(a.length+1));break}}}return g}};(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(r,s){if(r!="?"){return a[r]?q.placeholder:r}});var x=false;var h=g.val();g.data("buffer",y).data("tests",m);function B(r){while(++r<=l&&!m[r]){}return r}function D(r){while(!m[r]&&--r>=0){}for(var t=r;t<l;t++){if(m[t]){y[t]=q.placeholder;var s=B(t);if(s<l&&m[t].test(y[s])){y[t]=y[s]}else{break}}}E();g.caret(Math.max(c,r))}function C(v){for(var s=v,t=q.placeholder;s<l;s++){if(m[s]){var u=B(s);var r=y[s];y[s]=t;if(u<l&&m[u].test(r)){t=r}else{break}}}}function z(t){var r=e(this).caret();var s=t.keyCode;x=(s<16||(s>16&&s<32)||(s>32&&s<41));if((r.begin-r.end)!=0&&(!x||s==8||s==46)){A(r.begin,r.end)}if(s==8||s==46||(d&&s==127)){D(r.begin+(s==46?0:-1));return false}else{if(s==27){g.val(h);g.caret(0,j());return false}}}function k(w){if(x){x=false;return(w.keyCode==8)?false:null}w=w||window.event;var u=w.charCode||w.keyCode||w.which;var t=e(this).caret();if(w.ctrlKey||w.altKey||w.metaKey){return true}else{if((u>=32&&u<=125)||u>186){var s=B(t.begin-1);if(s<l){var r=String.fromCharCode(u);if(m[s].test(r)){C(s);y[s]=r;E();var v=B(s);e(this).caret(v);if(q.completed&&v==l){q.completed.call(g)}}}}}return false}function A(r,t){for(var s=r;s<t&&s<l;s++){if(m[s]){y[s]=q.placeholder}}}function E(){return g.val(y.join("")).val()}function j(w){var u=g.val();var t=-1;for(var v=0,s=0;v<l;v++){if(m[v]){y[v]=q.placeholder;while(s++<u.length){var r=u.charAt(s-1);if(m[v].test(r)){y[v]=r;t=v;break}}if(s>u.length){break}}else{if(y[v]==u[s]&&v!=p){s++;t=v}}}if(!w&&t+1<p){g.val("");A(0,l)}else{if(w||t+1>=p){E();if(!w){g.val(g.val().substring(0,t+1))}}}return(p?v:c)}if(!g.attr("readonly")){g.one("unmask",function(){g.unbind(".mask").removeData("buffer").removeData("tests")}).bind("focus.mask",function(){h=g.val();var r=j();E();setTimeout(function(){if(r==b.length){g.caret(0,r)}else{g.caret(r)}},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=800;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",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(c){slide_pos=slide_pos+c;if(slide_pos>=slideshow.slides.length){slide_pos=0}else{if(slide_pos<0){slide_pos=slideshow.slides.length-1}}var a=slideshow.slides[slide_pos].link;var b=slideshow.slides[slide_pos].img;if(periodical!==null){jQuery("#slideshow a").fadeOut(fade_speed,function(){jQuery("#slideshow a").attr("href",a);jQuery("#slideshow img").attr("src",b);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"}function OtherOnloadTrackingEvents(){if(typeof EcommerceTracking=="function"){EcommerceTracking()}return false}var pageTracker=undefined;function start_analytics(){if(UrchinLoaded==1){alert("Skipping analytics.js");return false}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(typeof _gat!==undefined){pageTracker=_gat._getTracker(ga_key);if(typeof _uacct!==undefined){pageTracker._trackPageview()}else{alert("PHEW!!  We're not tracking this pageview twice...")}}else{alert("_gat has not been defined");throw"_gat has not been defined"}}});return false}function TrackEvent(c,a,b,d){if(typeof b===null){b=""}if(typeof d===null){d=""}pageTracker._trackEvent(c,a,b,d);return false}function analytics_startup(){start_analytics()}function addTrans(h,a,d,c,b,g,e,f){pageTracker._addTrans(h,a,d,c,b,g,e,f);return false}function addItem(e,a,d,c,b,f){pageTracker._addItem(e,a,d,c,b,f);return false}function trackTrans(){pageTracker._trackTrans();return false}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(b,a){jQuery("#"+b).toggleClass(a)}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(b,a){if(b=="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 e=["class_adv","binding_adv","sort_by_adv","location_adv","days_old_adv"];for(var c in e){jQuery("#"+e[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")}}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.getDisplayName=function(){var a=UserTrail.base+"/trail/user_template_html";jQuery.ajax({type:"GET",url:a,data:"{}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(b){UserTrail.parseDisplayName(b)}});return false};UserTrail.parseDisplayName=function(a){var b=a.result;if(b!==undefined&&b.length>0){jQuery("#display_name").empty().html(b+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(e,a,d){var g="";var c="";var b="";if(!d){d="&"}var f=jQuery.cookie(e);if(f.match(a)){g=f.indexOf(a+d);if(g!=-1){g=g+a.length+1;c=f.indexOf(d,g);if(c==-1){c=f.length}b=unescape(f.substring(g,c))}}return b};P_Cookie.getPropHash=function(c,b){if(!b){b="&"}var e=jQuery.cookie(c);var d=new Hash();var a=e.split(b);for(i=0;i<a.length;i+=2){d.set(a[i],a[i+1])}return d};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(b){UserPrefs.originalPreferences={};var c=UserPrefs.Cookie.split("&");for(var a=0;a<c.length;a+=2){if(c[a]=="timeStamp"){UserPrefs.timeStamp=decodeURIComponent(c[a+1])}else{UserPrefs.preferences[c[a]]=decodeURIComponent(c[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(b,a){if(a!=UserPrefs.preferences[b]){UserPrefs.preferences[b]=a;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(a){mywin=window.open(a,"win","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=500,height=275")}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 c="/cgi-bin/bookwrap_redirect?display="+b+"&version="+a;if(a==1){var d=window.open(c,"bookwrap","height=460,width=280,scrollbars=no,status=no,toolbar=no, menubar=no, location=no,resizable=no")}else{var d=window.open(c,"bookwrap","height=295,width=760,scrollbars=no,status=no,toolbar=no, menubar=no, location=no,resizable=no")}if(d){d.focus()}}function search_startup(){if(jQuery("#search-box").attr("value")){return false}jQuery("#search-box").inputHints();jQuery("#main-search").submit(function(b){if(jQuery("#search-box").attr("value")==jQuery("#search-box").attr("title")||!jQuery("#search-box").attr("value")){var a=prompt("Did you forget to type something in the search box?\r\n\r\nType it here and click 'OK.'");if(a){jQuery("#main-search").unbind("submit");jQuery("#search-box").attr("value",a);jQuery("#main-search").submit()}else{jQuery("#search-box").inputHints();return false}}});return false}function event_detail(d){if(jQuery("#single_event_popup").length===0){var e=jQuery("<div></div>");jQuery(e).attr("id","single_event_popup");jQuery("body").prepend(e)}close_it("single_event_popup");var a=parseInt(((window.viewport.width()/2)-250),10)+"px";var b=parseInt((window.viewport.scrollTop()+60),10)+"px";jQuery("#single_event_popup").css({display:"block",position:"absolute","z-index":"5000",left:a,top:b,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 c="/cgi-bin/calnug?id="+d;jQuery("#single_event_popup").load(c).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")})}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,a){isbnUtils.invalid=[];isbnUtils.valid=[];isbnUtils.searchStopped=false;var e=jQuery("#listId");if(typeof a=="undefined"){a="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 d=[];d=isbnUtils.invalid.map(function(j,h){return"*"+j});if(isbnUtils.valid.length<1){e.value=d.join("\n")}else{e.value=e.value+"\n"+d.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 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 d=0;d<n.length;d++){st.push(n[d].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 c=document.createElement("div");c.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>]';c.innerHTML=a;f.insertBefore(c,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 a=document.obb_url.partnerid.value;var b='<a href="http://www.powells.com/partner/'+a+'/sellonline">YOUR TEXT OR IMAGE HERE</a>';document.obb_url.obb_result.value=b}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 a=document.auth_url.partner.value;var d=document.auth_url.first.value;var c=document.auth_url.last.value;var b="/partner/"+a;b+="/s?kw=";b+=escape(c+"+"+d);document.auth_url.your_url.value=b}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(a){var b=window.event.srcElement.value;var c=255;if(window.event.srcElement.value.length>=a){alert("You have reached the maximum length of 255 characters permitted here.");window.event.srcElement.value=b.substring(0,c);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.getDisplayName();navigation_startup();set_last_location_cookie();partner_startup();return false}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}};