 /* 1514:minified:js2/basics1.js */ 

var expireDate=new Date(2050,10,23);var g_prototypeAvailable=false;try{document.execCommand('BackgroundImageCache',false,true);}catch(e){}
if((typeof Prototype!='undefined')&&(typeof Element!='undefined')&&(typeof Element.Methods!='undefined'))
{g_prototypeAvailable=true;var g_userControls=new Hash();}
function cookieVal(cookieName)
{thisCookie=document.cookie.split("; ")
for(i=0;i<thisCookie.length;i++)
{if(cookieName==thisCookie[i].split("=")[0])
{return thisCookie[i].split("=")[1]}}
return 0;}
function setCookie(cookieName,cookieContent,transientBoolean)
{if(transientBoolean)
{document.cookie=cookieName+"="+cookieContent;}
else
{document.cookie=cookieName+"="+cookieContent+";expires="+expireDate.toGMTString();}}
function setDisplayforID(id,display)
{document.getElementById(id).style.display=display;}
function toggleShowHide(id,state)
{if(document.getElementById(id).style.display=='none')
{setDisplayforID(id,state);}
else
{setDisplayforID(id,'none');}}
function gotoaURL(url)
{window.top.location=url;}
function checkSpans(page){var x=document.getElementById('*');var postArray='';if(x){x.parentNode.removeChild(x);}
for(var x=0,y=document.getElementsByTagName('*'),oStr='';y[x];x++){if(y[x].id&&y[x].tagName.match("span","i")){var saneStr=y[x].id.replace(/&/,'&amp;').replace(/</,'&lt;').replace(/>/,'&gt;').replace(/\"/,'&quot;');if(saneStr.match("tr[0-9]{6}")&&saneStr){void(postArray+=saneStr+',');}}}
postArray=postArray.replace(/,$/g,'');var tForm=document.createElement('form');void(tForm.name='translateForm');void(tForm.action='/translate.php?page='+page);void(tForm.method='POST');void(tForm.innerHTML='<input type="hidden" name="stuff" value="'+postArray+'">');void(document.body.appendChild(tForm));tForm.submit();}
function lightSpan()
{}
function scaleTextBox(id,size)
{document.getElementById("ms_"+id).style.display="none";new Effect.Scale(id,size,{scaleX:false,scaleContent:false});}
function basic_ajax_updater(url,params,elt_to_update)
{basic_ajax(url,params,function(r)
{$(elt_to_update).innerHTML=r.responseText;});}
function basic_ajax(url,params,callback){var request=new Ajax.Request(url,{method:"post",asynchronous:true,parameters:params,onSuccess:callback});return request;}
function basic_ajax_sync(url,params,callback){var request=new Ajax.Request(url,{method:"post",asynchronous:false,parameters:params,onSuccess:callback});}
function basic_ajax_eval(url,params,callback){var request=new Ajax.Request(url,{method:"post",asynchronous:true,parameters:params,onSuccess:callback,evalJS:'force'});}
if(g_prototypeAvailable)
{Ajax.Request.prototype.abort=function()
{this.transport.onreadystatechange=Prototype.emptyFunction;this.transport.abort();{Ajax.activeRequestCount--;}};}
function disable_button(button,button_text){button_text=button_text||"loading...";button.setAttribute('disabled',true);button.value=button_text;button.form.submit();return false;}
function updateUserConnections(){var handleReturn=function(t){if(t.responseText)
{setTimeout('updateUserControls()',100);}};basic_ajax('/ajax_updateUserConnections.php',null,handleReturn);}
function updateUserControls(){var gsize=g_userControls.size();if(g_prototypeAvailable&&gsize)
{var i=0;var outString='objects=';var paramHash=new Hash();var len=g_userControls.size();g_userControls.each(function(uc){paramHash[uc.key]=uc.value.number;outString+=uc.key+':'+uc.value.number;if(i<(len-1))
outString+=',';i++;});var par=$H({objects:paramHash});var handleReturn1=function(t){var infoHash=$H(t.responseText.evalJSON(true));infoHash.each(function(pair){theUC=g_userControls[pair.key];affInfo=$H(pair.value);theUC.updateAffinityDisplay(affInfo.uc_percentile,affInfo.uc_overlap);});}
basic_ajax('/ajax_updateUserControls.php',outString,handleReturn1);}}
if(g_prototypeAvailable)
{var LTUserControl=Class.create();LTUserControl.prototype={initialize:function(el,paramList){var params=paramList.evalJSON(true);this.inputParams=params;this.element=$(el);this.controlid=params.controlid;this.controlcode=params.controlcode;this.name=params.name;this.number=params.number;this.isSelf=params.isSelf;this.element.className='userControlObject';this.originalHTML=this.element.innerHTML;this.affinity=new Object({percentile:parseInt(params.affinityPercentile),overlap:parseInt(params.affinityOverlap),control:$('ucaf_'+this.controlcode),textbox:$('ucafp_'+this.controlcode)});var afp=$('ucafp_'+this.controlcode);if((this.affinity.overlap>0)&&(!this.isSelf))
afp.innerHTML=this.affinity.percentile+'%';else
afp.innerHTML='';this.arrow=$('ucar_'+this.controlcode);this.rightside=$('ucrs_'+this.controlcode);this.mainMenu=document.createElement('div');this.mainMenu.className='ucoMenu ucoMainMenu';this.mainMenu.id='ucmm_'+this.controlcode;document.body.appendChild(this.mainMenu);this.mainMenu.style.position='absolute';this.mainMenu.style.zIndex='10';Position.absolutize(this.mainMenu);this.links=new Object();this.links.profile='/profile/'+this.name;this.links.catalog='/catalog/'+this.name;this.links.reviews='/profile_reviews.php?view='+this.name;this.links.tagcloud='/tagcloud.php?view='+this.name;this.links.authorcloud='/authorcloud.php?view='+this.name;this.registerEvents();},destroy:function(){},registerEvents:function(){Event.observe(this.arrow,"click",this.dropdown.bindAsEventListener(this));Event.observe($('ucrs_'+this.controlcode),"click",this.onclick.bindAsEventListener(this));Event.observe(document,"click",this.onmouseout.bindAsEventListener(this));},addMenuItem:function(parent,imgfile,text,link,disabled,hasSubmenu,afterElement)
{var menuItem=document.createElement('div');menuItem.className='ucoMenuItem';var base='<span class="ucoMenuIcon">';if(imgfile)
{base+='<img src="/pics/'+imgfile+'">';}
base+='</span><span class="ucoMenuItemText">'+text+'</span>';if(hasSubmenu)
{base='<div class="ucoMenuItemArrow">&#x25B6;</div>'+base;}
if(link)
{menuItem.onclick=function(){gotoaURL(link)};}
menuItem.update(base);if(disabled)
{menuItem.addClassName('ucoDisabled');}
if(parent)
{if(afterElement)
{var pels=parent.descendants();var pcount=pels.length;if(pels[pcount-1]==$(afterElement))
{parent.appendChild(menuItem);}
else
{var ae=$(afterElement);var ne=ae.next();var newel=this.mainMenu.insertBefore(menuItem,ne);}}
else
{parent.appendChild(menuItem);}}
return menuItem;},updateAffinityDisplay:function(percentile,overlap)
{if(!this.isSelf)
{this.affinity.percentile=percentile;this.affinity.overlap=overlap;if(this.menuItemsExist)
{var am1=$('ucafpm_'+this.controlcode);var am2=$('ucafom_'+this.controlcode);if(this.affinity.overlap)
{var s1=$('ucafsi_'+this.controlcode);if(!am1)
{afftext1=this.affinity.percentile+'% similar library';afftext2=this.affinity.overlap+' shared book'+plural;var am1=this.addMenuItem(this.mainMenu,'',afftext1,'',true,false,s1);am1.id='ucafpm_'+this.controlcode;var am2=this.addMenuItem(this.mainMenu,'',afftext2,'',true,false,s1);am2.id='ucafom_'+this.controlcode;this.addSeparatorItem(this.mainMenu);}
else
{var am1=$('ucafpm_'+this.controlcode);var am2=$('ucafom_'+this.controlcode);afftext1=this.affinity.percentile+'% similar library';afftext2=this.affinity.overlap+' shared book'+plural;am1.down('.ucoMenuItemText').innerHTML=afftext1;am2.down('.ucoMenuItemText').innerHTML=afftext2;}}}
if(this.affinity.overlap)
{var mainaff=$('ucafp_'+this.controlcode);mainaff.innerHTML=percentile+'%';var tt=overlap+' shared book';if(overlap!=1)
tt+='s';mainaff.title=tt;}}},addSeparatorItem:function(parent)
{var menuItem=document.createElement('div');menuItem.className='ucoMenuDivider';parent.appendChild(menuItem);return menuItem;},doNothing:function(event)
{},onclick:function(event)
{Event.stop(event);gotoaURL(this.profileURL);},onmouseout:function(event)
{this.mainMenu.hide();this.mainMenu.style.display='none';this.arrow.removeClassName('ucoArrowOn');this.element.removeClassName('userControlHover');},dropdown:function(event)
{Event.stop(event);g_userControls.each(function(o){o.value.onmouseout();});if(!this.menuItemsExist)
{var plural='';if(this.affinity.overlap>1)
plural='s';this.addMenuItem(this.mainMenu,'status_offline_tiny.png','Profile',this.links.profile,false,false,null);this.addMenuItem(this.mainMenu,'book_tiny.png','Catalog',this.links.catalog,false,false,null);var s1=this.addSeparatorItem(this.mainMenu);s1.id='ucafsi_'+this.controlcode;if(this.affinity.overlap)
{afftext1=this.affinity.percentile+'% similar library';afftext2=this.affinity.overlap+' shared book'+plural;var am1=this.addMenuItem(this.mainMenu,'',afftext1,'',true,false,null);am1.id='ucafpm_'+this.controlcode;var am2=this.addMenuItem(this.mainMenu,'',afftext2,'',true,false,null);am2.id='ucafom_'+this.controlcode;this.addSeparatorItem(this.mainMenu);}
this.addMenuItem(this.mainMenu,'reviews_tiny.png','Reviews',this.links.reviews,false,false,null);this.addMenuItem(this.mainMenu,'tag_yellow_tiny.png','Tag Cloud',this.links.tagcloud,false,false,null);this.addMenuItem(this.mainMenu,'author_cloud_tiny.png','Author Cloud',this.links.authorcloud,false,false,null);this.menuItemsExist=true;}
var elof=Position.positionedOffset(this.element);this.mainMenu.style.top=elof[1]+17+'px';this.mainMenu.style.left=elof[0]+1+'px';this.mainMenu.style.borderWidth='1px';this.mainMenu.show();this.mainMenu.style.display='block';this.arrow.addClassName('ucoArrowOn');this.element.addClassName('userControlHover');}};}
function registerUserControlObject(ucname,params){if(g_prototypeAvailable)
{var controlElement=$(ucname);var uc=new LTUserControl(controlElement,params);g_userControls[ucname]=uc;controlElement.userControlObject=uc;}}
function releaseMenu(menu)
{menu.style.display='none';}
function toggleCollectionMembership(checkbox,bookid,fullcode)
{checkbox.disabled=true;var url='/ajax_collectionsToggleMembership.php';var params={c_id:checkbox.value,newvalue:checkbox.checked,bookid:bookid,fullcode:fullcode};var responseFunction=function(t)
{if(t.responseText=='1')
{checkbox.disabled=false;}
else
{checkbox.checked=!checkbox.checked;checkbox.disabled=false;}};basic_ajax(url,params,responseFunction);}
function addCollection(name,omit,listcontainerID,bookid,fullcode)
{var url='/ajax_collectionsAddCollection.php';var params={name:name.value,omit:omit.checked,book:bookid};var responseFunction=function(t){var rArray=t.responseText.evalJSON();if(rArray.success)
{var container=$(listcontainerID);var newel=document.createElement('div');newel.className='collectionModItem';newel.id='collectionItem_'+rArray.c_id;var newlines='<input name="cList_'+rArray.c_id+'" id="cList_'+rArray.c_id+'" type="checkbox" value="'+rArray.c_id+'" ';if(rArray.inCollection)
newlines+=' checked ';newlines+='onChange="javascript:toggleCollectionMembership(this,'+bookid+','+fullcode+'); return false;">';newlines+=name.value;if(omit.checked)
newlines+=' * ';newlines+=' (<a href="#" onclick="javascript:deleteCollection('+rArray.c_id+'); return false;">delete</a>)';newel.innerHTML=newlines;container.appendChild(newel);}
else
{}};basic_ajax(url,params,responseFunction);}
function deleteCollection(c_id)
{var url='/ajax_collectionsDeleteCollection.php';var params={c_id:c_id};var responseFunction=function(t)
{if(t.responseText=='1')
{var clist=$('collectionModList');var item=$('collectionItem_'+c_id);item.style.display='none';clist.removeChild(item);}
else
{alert('failure');}};basic_ajax(url,params,responseFunction);}
function setRating(container,bookid,rating,editable,style)
{co=LT_findObj(container);var uid=LT_GetRandomID(8);var url='/ajax_setBookRating.php';var params={uid:uid,book:bookid,editable:editable,container:container,style:style,rating:rating};var rateSuccessF=function(t){if(co)
{if(t.responseText!='0')
{co.innerHTML=t.responseText;}
co.style.opacity=1;co.style.filter='alpha(opacity=100)';}};if(co)
{co.style.opacity=0.3;co.style.filter='alpha(opacity='+30+')';}
basic_ajax(url,params,rateSuccessF);}
function showuwyb()
{$('showmoreuwyb').style.display='none';$('uwybhide').style.display='inline';}
function showMore(element)
{var el=$(element);var className=el.className;className=className.replace("showmore","showmore_show");el.className=className;}
function showLess(element)
{var el=$(element);var className=el.className;className=className.replace("showmore_show","showmore");el.className=className;}
if(typeof window.console=="undefined")
{window.console={};console.log=function(o)
{};console.debug=function(o)
{};console.info=function(o)
{};console.warn=function(o)
{};console.assert=function(expr)
{};console.error=function(o)
{};console.dir=function(o)
{};console.dirxml=function(node)
{};console.trace=function()
{};console.group=function(o)
{};console.groupEnd=function()
{};console.time=function(name)
{};console.timeEnd=function(name)
{};console.profile=function(title)
{};console.profileEnd=function()
{};console.profileEnd=function()
{};console.count=function(title)
{};}
function dovote(type,id,vote)
{var theid='vote_'+type+'_'+id;var url="/ajax_voter.php?type="+encodeURIComponent(type)+"&id="+encodeURIComponent(id)+"&vote="+encodeURIComponent(vote);$(theid).innerHTML="<span class='main'>Saving...</span>";basic_ajax_updater(url,null,$(theid));}
function confirmAction(action)
{return confirm(action+"?");} 
 /* 1514:minified:js/compare_page.js */ 

function iesucks(f,l)
{if(ajax_is_loading){return false;}
$('format').value=f;$('limit').value=l;$('format_td').className='format_'+f;var url='/ajax_sharedbooks.php?'+$('sharedsubmit').serialize();$('ajaxcontent').innerHTML='<img src="http://www.librarything.com/pics/ajax-loader.gif">';basic_ajax(url,null,function(r){$('ajaxcontent').innerHTML=r.responseText;ajax_is_loading=false;});ajax_is_loading=true;return null;}
function iesucks_connections(filter,format,l,type)
{if(ajax_is_loading){return false;}
$('format_td').className='format_'+type;$('format').value=format;$('filterby').value=filter;$('limit').value=l;var url='/ajax_sharedbooks.php?'+$('sharedsubmit').serialize();$('ajaxcontent').innerHTML='<img src="http://www.librarything.com/pics/ajax-loader.gif">';basic_ajax(url,null,function(r){$('ajaxcontent').innerHTML=r.responseText;ajax_is_loading=false;});ajax_is_loading=true;return null;}
function sharedsubmit_LL(f,limit)
{if(ajax_is_loading){return false;}
if(f!==-1)
{$('format').value=f;$('format_td').className='format_'+f;}
$('limit').value=limit;var url='/ajax_sharedbooks.php?'+$('sharedsubmit').serialize();$('ajaxcontent').innerHTML='<img src="http://www.librarything.com/pics/ajax-loader.gif">';basic_ajax(url,null,function(r){$('ajaxcontent').innerHTML=r.responseText;ajax_is_loading=false;});ajax_is_loading=true;return null;}
function sharedsubmit_ebooks(f,limit,collections)
{if(ajax_is_loading){return false;}
if(f!==-1)
{$('format').value=f;}
$('limit').value=limit;var url='/ajax_ebooksstats.php?'+$('sharedsubmit').serialize()+'&books_collections='+collections;$('ajaxcontent').innerHTML='<img src="http://www.librarything.com/pics/ajax-loader.gif">';basic_ajax(url,null,function(r){$('ajaxcontent').innerHTML=r.responseText;ajax_is_loading=false;});ajax_is_loading=true;return null;}
function sharedsubmit_connections(nothing,limit)
{if(ajax_is_loading){return false;}
$('limit').value=limit;var url='/ajax_sharedbooks.php?'+$('sharedsubmit').serialize();$('ajaxcontent').innerHTML='<img src="http://www.librarything.com/pics/ajax-loader.gif">';basic_ajax(url,null,function(r){$('ajaxcontent').innerHTML=r.responseText;ajax_is_loading=false;});ajax_is_loading=true;return null;}
function showadvanced()
{if(divotposition)
{$('divot').src='/pics/divet.gif';$('select').style.display='none';divotposition=false;}
else
{$('divot').src='/pics/divet-on.gif';$('select').style.display='block';divotposition=true;}}
function chooseshared(show,filter,format)
{$('show').value=show;$('filterby').value=filter;$('format').value=format;$('show').setValue(show);$('filterby').setValue(filter);$('format').setValue(format);sharedsubmit_LL(format,250);}
function chooseebooklist(format,collections)
{$('format').value=format;$('format').setValue(format);sharedsubmit_ebooks(format,250,collections);}
var divotposition=0;var ajax_is_loading=false; 
 /* 1514:minified:js2/lt_lightbox.js */ 

var LibraryThing=LibraryThing||{};LibraryThing.lightbox=LibraryThing.lightbox||{};LibraryThing.lightbox={active:0,yPos:0,xPos:0,css_url:'/css/lt_lightbox.css',ie:(navigator.appName=="Microsoft Internet Explorer"?true:false),safari:(navigator.vendor=='Apple Computer, Inc.'?true:false),dochead:document.getElementsByTagName('head')[0],initialized:false,div_lightbox:null,div_overlay:null,div_content:null,div_loading:null,lb_width:400,lb_height:300,inline_container:null,params:null,hasiframe:false,unload:function(){this.active=false;},init:function()
{this.active=true;try
{if(!this.initialized)
{var body=document.getElementsByTagName('body')[0];this.div_overlay=document.createElement('div');this.div_overlay.id='LT_LB_overlay';this.div_lightbox=document.createElement('div');this.div_lightbox.id='LT_LB';this.div_lightbox.style.display="none";this.div_content=document.createElement('div');this.div_content.id='LT_LB_content';this.div_content.className='LT_LB_content';this.div_content.style.display="none";this.div_loading=document.createElement('div');this.div_loading.id='LT_LB_loading';this.div_loading.style.display="none";this.div_loading.innerHTML="Loading...";body.appendChild(this.div_overlay);body.appendChild(this.div_lightbox);this.div_lightbox.appendChild(this.div_loading);this.div_lightbox.appendChild(this.div_content);this.params={};this.initialized=true;}}
catch(e)
{this.initialized=false;}},setParams:function(inparams)
{if(inparams)
{this.init();this.params={};for(pp in inparams)
{this.params[pp]=inparams[pp];if(pp=='content_class')
{this.div_content.className=inparams[pp];}
else
{this.div_content.className='LT_LB_content';}
if(pp=='rounded'){this.div_lightbox.className='LT_LB_rounded';}}}},setPosition:function()
{var iw=this.params.width;var ih=this.params.height;var iwp=(iw)?iw:this.lb_width;var ihp=(ih)?ih:this.lb_width;var winWidth=0,winHeight=0;var workingLeft=0,workingTop=0;if(typeof(window.innerWidth)=='number')
{winWidth=window.innerWidth;winHeight=window.innerHeight;}
else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))
{winWidth=document.documentElement.clientWidth;winHeight=document.documentElement.clientHeight+20;}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight))
{winWidth=document.body.clientWidth;winHeight=document.body.clientHeight;}
if(iwp>winWidth)
{iwp=winWidth;}
if(ihp>winHeight)
{ihp=winHeight;}
this.div_overlay.style.height=winHeight+'px';workingLeft=winWidth-iwp;workingTop=winHeight-ihp;if(workingLeft)
{workingLeft=Math.floor((winWidth-iwp)/2);}
else
{if(this.ie)
{iwp=iwp-40;}}
if(workingTop)
{workingTop=Math.floor((winHeight-ihp)/2);}
else
{if(this.ie)
{ihp=ihp-44;}}
if(this.params.absolute==true)
{this.div_lightbox.style.position='absolute';}
this.div_lightbox.style.width=iwp+'px';this.div_lightbox.style.height=ihp+'px';if(this.ie)
{this.getScroll();this.prepareIE('100%','hidden');this.setScroll(0,0);this.div_lightbox.style.position='absolute';this.div_lightbox.style.overflow='auto';}
this.div_lightbox.style.top=workingTop+'px';this.div_lightbox.style.left=workingLeft+'px';},on:function(ev)
{this.init();ev=ev||window.event;var evt=ev.target||ev.srcElement;var href=evt.href;var url=href;var rel=evt.rel;var inlined_el;var queryString=url.replace(/^[^\?]+\??/,'');if(this.params)
{this.params=this.parseQuery(queryString);this.lb_width=(this.params.width*1)+30||400;this.lb_height=(this.params.height*1)+40||300;this.div_lightbox.style.left="50%";this.div_lightbox.style.right="50%";}
if(this.ie){this.getScroll();this.prepareIE('100%','hidden');this.setScroll(0,0);this.hideSelects('hidden');}
if(this.params.inlineId)
{inlined_el=this.params.inlineId;this.inline(inlined_el);}
else if(this.params.url)
{var ajaxURL=this.params.url;if(url.indexOf("?")!==-1)
{inlined_el=url.substr(0,url.indexOf("?"));}
this.ajax(ajaxURL);}},ajax:function(contentURL,params)
{if(contentURL)
{this.init();if(params)
{this.setParams(params);}
this.setPosition();if(this.ie){this.getScroll();this.prepareIE('100%','hidden');this.setScroll(0,0);this.hideSelects('hidden');}
var wasShowing=this.isShowing('LT_LB');var uid=0;var ajaxparams={};if(params)
{if(params['ajaxparams'])
{ajaxparams=params['ajaxparams'];}}
ajaxparams.uid=uid;var lightboxResponse=function(t)
{var rt=t.responseText;if(rt==='')
{LibraryThing.lightbox.showhide('LT_LB_loading',false);LibraryThing.lightbox.showhide('LT_LB_content',true);LibraryThing.lightbox.div_content.style.display='block';LibraryThing.lightbox.div_content.innerHTML='There was a problem retrieving the data. Please try again.';}
else
{LibraryThing.lightbox.showhide('LT_LB_loading',false);LibraryThing.lightbox.showhide('LT_LB_content',true);LibraryThing.lightbox.div_content.style.display='block';LibraryThing.lightbox.div_content.innerHTML=rt;if(LibraryThing.lightbox.params.catalogCK)
{LibraryThing.lightbox.enterCKEditMode();}
rt.evalScripts();LibraryThing.lightbox.ready();if(LibraryThing.lightbox.params.scriptwhendone)
{eval(LibraryThing.lightbox.params.scriptwhendone);}}};LibraryThing.lightbox.div_content.innerHTML='';this.showhide('LT_LB_overlay',true);this.showhide('LT_LB',true);this.showhide('LT_LB_loading',true);basic_ajax(contentURL,ajaxparams,lightboxResponse);this.unload=function(){LibraryThing.lightbox.div_content.innerHTML='';};this.modalCheck();}},iframe:function(contentURL,params)
{if(contentURL)
{if(typeof(window.parent.LibraryThing.lightbox)!='undefined'&&LibraryThing.lightbox.hasiframe==false&&window.parent.LibraryThing.lightbox.hasiframe==true)
{window.parent.LibraryThing.lightbox.iframe(contentURL,params);return false;}
this.init();if(params)
{this.setParams(params);}
this.setPosition();if(this.ie){this.getScroll();this.prepareIE('100%','hidden');this.setScroll(0,0);this.hideSelects('hidden');}
var wasShowing=this.isShowing('LT_LB');var uid=0;var ajaxparams={};if(params)
{if(params['ajaxparams'])
{ajaxparams=params['ajaxparams'];}}
ajaxparams.uid=uid;LibraryThing.lightbox.div_content.innerHTML='';var currentWidth=$('LT_LB').getWidth()-4;var currentHeight=$('LT_LB').getHeight()-4;var iframeS="<iframe id='LT_iframe' src='"+contentURL;iframeS+="' frameborder='0' scrolling='auto' width='"+currentWidth;iframeS+="' height='"+currentHeight+"'></iframe>";$('LT_LB_content').innerHTML=iframeS;this.showhide('LT_LB_overlay',true);this.showhide('LT_LB',true);LibraryThing.lightbox.showhide('LT_LB_content',true);LibraryThing.lightbox.div_content.style.display='block';LibraryThing.lightbox.ready();this.unload=function(){LibraryThing.lightbox.div_content.innerHTML='';};this.modalCheck();}},enterCKEditMode:function(fieldname)
{var pencils=document.getElementsByClassName('fwikiEditPencil');if(pencils)
{for(var i=0;i<pencils.length;i++)
{var pencil=pencils[i];pencil.onclick();}}},inline:function(elt_id,params)
{var elt=document.getElementById(elt_id);this.inline_container=elt;if(elt!='undefined')
{this.init();if(params)
{this.setParams(params);}
this.setPosition();if(this.ie){this.getScroll();this.prepareIE('100%','hidden');this.setScroll(0,0);this.hideSelects('hidden');}
LibraryThing.lightbox.div_content.innerHTML='';LibraryThing.lightbox.div_content.innerHTML='';this.showhide('LT_LB_overlay',true);this.showhide('LT_LB',true);this.showhide('LT_LB_loading',true);if(1)
{var cloned=elt.cloneNode(true);this.div_content.appendChild(cloned);cloned.style.display="block";}
else
{var childs=elt.children||elt.childNodes;for(var i=0;i<childs.length;i++)
{var child=childs[i];LibraryThing.lightbox.div_content.appendChild(child);}
this.unload=function(){var childs=this.div_content.children||this.div_content.childNodes;for(var i=0;i<childs.length;i++)
{var child=childs[i];this.inline_container.appendChild(child);}};}
LibraryThing.lightbox.showhide('LT_LB_loading',false);LibraryThing.lightbox.showhide('LT_LB_content',true);this.modalCheck();}
this.ready();},off:function(success){this.unload();if(this.ie)
{this.setScroll(0,this.yPos);this.prepareIE("auto","auto");this.hideSelects("visible");}
if(this.params.absolute)
{this.prepareIE("auto","auto");this.setScroll(0,this.yPos+1);}
if(this.safari)
{this.prepareIE("auto","scroll");}
this.showhide('LT_LB_overlay',false);this.showhide('LT_LB',false);if(success)
{if(this.params&&this.params.callbackSuccess)
{LibraryThing.lightbox.cbRun(this.params.callbackSuccess,this.params.callbackParams);this.params.callbackSuccess=null;}}
else
{if(this.params&&this.params.callbackFailure)
{LibraryThing.lightbox.cbRun(this.params.callbackFailure,this.params.callbackParams);this.params.callbackFailure=null;}}},cbRun:function(f,p)
{if(typeof f==='function')
{f(p);}
else if(typeof f!=='undefined')
{var fstring=f+'(';if(p)
{fstring+='p';}
fstring+=')';if(fstring&&(fstring!==null)&&(fstring!=='undefined')){eval(fstring);}}},ready:function()
{if(this.params&&this.params.callbackReady)
{LibraryThing.lightbox.cbRun(this.params.callbackReady);}},modalCheck:function()
{if(this.params)
{if(this.params.modal==true)
{$('LT_LB_overlay').stopObserving('click');this.div_overlay.style.cursor='default';}
else
{$('LT_LB_overlay').observe('click',function(event){event.stop();LibraryThing.lightbox.off();});this.div_overlay.style.cursor='hand';}}
else
{$('LT_LB_overlay').observe('click',function(event){event.stop();LibraryThing.lightbox.off();});this.div_overlay.style.cursor='hand';}},addEvent:function(elt,evt,func)
{if(typeof elt=='string'){elt=document.getElementById(elt);}
if(elt.addEventListener){elt.addEventListener(evt,func,false);}
else{elt.attachEvent("on"+evt,func);}},removeEvent:function(elt,evt,func)
{if(typeof elt=='string'){elt=document.getElementById(elt);}
if(elt.removeEventListener){elt.removeEventListener(evt,func,false);}
else{elt.detachEvent("on"+evt,elt[evt+func]);elt[evt+func]=null;elt['e'+evt+func]=null;}},showhide:function(elt_id,bool)
{var elt=document.getElementById(elt_id);if(elt)
{elt.style.display=bool?'block':'none';}},isShowing:function(elt_id)
{var elt=document.getElementById(elt_id);if(elt.style.display=='none')
{return false;}
return true;},prepareIE:function(height,overflow)
{var htm=document.getElementsByTagName('html')[0];htm.style.height=height;htm.style.overflow=overflow;htm.style.display='block';},hideSelects:function(visibility){var selects=document.getElementsByTagName('select');for(var i=0;i<selects.length;i++){selects[i].style.visibility=visibility;}},getScroll:function(){if(self.pageYOffset){this.yPos=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){this.yPos=document.documentElement.scrollTop;}else if(document.body){this.yPos=document.body.scrollTop;}},setScroll:function(x,y){window.scrollTo(x,y);},addScriptURL:function(url){var script=document.createElement('script');script.type='text/javascript';script.src=url;this.dochead.appendChild(script);},load:function(response,container){container=container||"LT_LB_content";var lb=document.getElementById(container);lb.innerHTML=response;LibraryThing.showhide('LT_LB_loading',false);LibraryThing.showhide('LT_LB_content',true);},parseQuery:function(query){var Params={};if(!query){return Params;}
var Pairs=query.split(/[;&]/);for(var i=0;i<Pairs.length;i++){var KeyVal=Pairs[i].split('=');if(!KeyVal||KeyVal.length!=2){continue;}
var key=unescape(KeyVal[0]);var val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val;}
return Params;}}; 
 /* 1514:minified:js2/getItLocal.js */ 

LibraryThing=LibraryThing||{};LibraryThing.getItLocal={};LibraryThing.getThisBook={};var gtb=LibraryThing.getThisBook;var gil=LibraryThing.getItLocal;var onBookServicesPage=window.onBookServicesPage||0;gil.showVenueType=function(type)
{if(!type)
{type=1;}
var url='/ajax_getitlocal.php';var params={'vt':type};var response=function(t){var container=$('getitlocal');var rt=t.responseText;if(container)
{container.innerHTML=rt;}}
basic_ajax(url,params,response);}
gil.toggleClassForItems=function(classid,moreid,container)
{var items;if(container)
{items=$(container).select('.'+classid);}
else
{items=document.getElementsByClassName(classid);}
if(items)
{items.each(function(e){Effect.Appear(e);});var more=$(moreid);if(more)
{more.hide();}}}
gil.editPrefs=function(workcode,containerid,titleid)
{var url='/ajax_local_prefs_lb.php';var form=$('localprefs');var focusCallback=function(){var inp=$('localprefs_location');inp.activate();inp.observe('keydown',function(event){if(Event.KEY_RETURN==event.keyCode)
{event.stop();LibraryThing.getItLocal.savePrefs(workcode,containerid,titleid);}});};var ajaxparams={workcode:workcode,containerid:containerid,titleid:titleid};var params={height:108,width:390,rounded:1,callbackReady:focusCallback,ajaxparams:ajaxparams};LibraryThing.lightbox.ajax(url,params);}
gil.savePrefs=function(workcode,containerid,titleid)
{var url='/ajax_updateUserHomeLocation.php';var form=$('localprefs');var vloc=$('localprefs_location').value;var uid=LT_GetRandomID(5);var params={q:vloc,vpub:0,uid:uid,workcode:workcode,containerid:containerid,titleid:titleid};var response=function(t){var rt=t.responseText;LibraryThing.lightbox.off();LibraryThing.getItLocal.reload(workcode,containerid,titleid);}
form.innerHTML='Saving...';basic_ajax(url,params,response);}
gil.reload=function(workcode,containerid,titleid)
{var chwil=window.location;var regex=new RegExp("(.*)(&place=.*)");var regres=regex.exec(chwil);if(regres&&regres[1])
{window.location=regres[1];}
else
{window.location.reload();}
var _obsp=0;if(onBookServicesPage)
{_obsp=onBookServicesPage;var loadingMsg='<div style="margin:15px;">Loading...</div>';var bookstoreContainerID=containerid+'_B';var bookstoreContainer=$(bookstoreContainerID);bookstoreContainer.innerHTML=loadingMsg;var bookstoreContainerID2=containerid+'_L';var bookstoreContainer2=$(bookstoreContainerID2);bookstoreContainer2.innerHTML=loadingMsg;}
else
{var gtb_container=$('getitlocalcontainer');var container=$(containerid);var ph='<table class="gtb_bf_placeholder"><tr><td class="gtb_bf_placeholder_inner"> \
 <img height="16px" width="16px" alt="" src="/pics/spinner.gif"/><br/><br/>Reloading page using new location...</td></tr></table>';container.innerHTML=ph;}}
gtb.toggleStoreItemsx=function(classid,moreid,container)
{var container=$(id);if(container)
{if(container.visible())
{Effect.Appear(id);}
else
{Effect.Appear(id);}}}
gtb.toggleStoreItems=function(id)
{var container=$(id);if(container)
{if(container.visible())
{container.hide();}
else
{Effect.Appear(id,{duration:0.4});}}}
gtb.bfreload=function(id,jp)
{var container=$(id);var params=jp.evalJSON();params.containerID=id;var url='/ajax_gtb_bookfinder_contents.php';var response=function(t){var rt=t.responseText;container.innerHTML=rt;};var ph='<table class="gtb_bf_placeholder"><tr><td class="gtb_bf_placeholder_inner"> \
 <img height="16px" width="16px" src="/pics/spinner.gif"/><br/><br/>Fetching fresh pricing data...</td></tr></table>';container.innerHTML=ph;basic_ajax(url,params,response);}
gtb.handleITunes=function()
{var container=$('gio-iTunes');if(container)
{var content=$('gtb_online_itunesItems');}
var url='';var params={};var response=function(t){};}
gtb.bookfindertitleshidden=true;gtb.showhidebookfindertitles=function(work,containerID,bookinfo)
{if(gtb.bookfindertitleshidden)
{var url='/ajax_getbookfindereditiontitles.php';var params={'work':work,'bookinfo':bookinfo,'containerID':containerID};var response=function(t){var container=$('editiontitles');var rt=t.responseText;if(container)
{container.innerHTML=rt;$('editiontitles').show();$('defaulttitle').hide();$('editionloading').hide();}}
$('edition_bookfinder_showmore').hide();$('edition_bookfinder_showless').show();$('editionloading').show();basic_ajax(url,params,response);gtb.bookfindertitleshidden=false;}
else
{$('editiontitles').hide();$('defaulttitle').show();$('edition_bookfinder_showmore').show();$('edition_bookfinder_showless').hide();gtb.bookfindertitleshidden=true;}
return;};gtb.editiontitlesearchshidden=true;gtb.showhideeditiontitles=function(work,venueid,titleurl)
{if(gtb.editiontitlesearchshidden)
{var url='/ajax_geteditiontitles.php';var params={'work':work,'venueid':venueid,'titleurl':titleurl};var response=function(t){var container=$('editiontitles');var rt=t.responseText;if(container)
{container.innerHTML=rt;$('editiontitles').show();$('defaulttitle').hide();$('editionloading').hide();}}
$('edition_showmore').hide();$('edition_showless').show();$('editionloading').show();basic_ajax(url,params,response);gtb.editiontitlesearchshidden=false;}
else
{$('editiontitles').hide();$('defaulttitle').show();$('edition_showmore').show();$('edition_showless').hide();gtb.editiontitlesearchshidden=true;}
return;};gtb.bfeditionsselected=null;gtb.bfeditionsselectedcount=0;gtb.bfeditionselect=function(isbn,incoming_isbns)
{if(gtb.bfeditionsselected==null)
{gtb.bfeditionsselected={};var isbnA=incoming_isbns.split(',');for(var i=0;i<isbnA.length;i++)
{gtb.bfeditionsselected[isbnA[i]]=1;gtb.bfeditionsselectedcount++;}}
if(typeof gtb.bfeditionsselected[isbn]==='undefined'||gtb.bfeditionsselected[isbn]===0)
{if(gtb.bfeditionsselectedcount>=10)
{alert('BookFinder has a limit of 10 editions per search.');return;}
gtb.bfeditionsselectedcount++;gtb.bfeditionsselected[isbn]=1;}
else
{gtb.bfeditionsselectedcount--;gtb.bfeditionsselected[isbn]=0;}
gtb.bfredoeditionselection();};gtb.bfredoeditionselection=function()
{var allcovers=$$('.edition_cover');for(var i=0;i<allcovers.length;i++)
{var isbn=allcovers[i].id.substr(6);if(typeof gtb.bfeditionsselected[isbn]!=='undefined'&&gtb.bfeditionsselected[isbn]===1)
{allcovers[i].addClassName('selected');}
else
{allcovers[i].removeClassName('selected');}}};gtb.bfcleareditionselection=function()
{gtb.bfeditionsselected={};gtb.bfredoeditionselection();gtb.bfeditionsselectedcount=0;};gtb.bfsubmiteditionselection=function(containerid,bookinfo)
{var bookinfoA=bookinfo.evalJSON();if(gtb.bfeditionsselected!=null)
{var _isbnA=[];for(isbn in gtb.bfeditionsselected)
{if(gtb.bfeditionsselected[isbn]==1)
{_isbnA.push(isbn);}}
bookinfoA.isbnA=_isbnA.join(',');}
LibraryThing.lightbox.off();gtb.bfreload(containerid,Object.toJSON(bookinfoA))};function lockdown_availability(d){var bdata=d.evalJSON();for(var si in bdata){var s=bdata[si];var sourceid=s.type+':'+s.ve_id;var pattern='[bsm_code="'+sourceid+'"]';var matches=$$(pattern);matches.each(function(m){var editionLabel=$(document.createElement('span'));editionLabel.addClassName('detail');editionLabel.innerHTML=' ('+s.editions+')';m.appendChild(editionLabel);var images=m.select('img.flim');if(images.length)
{images[0].src=s.img;}
var ml=m.select('a');if(ml.length)
{var mainLink=ml[0];mainLink.href=s.js_link;}});}}
function stopAllSpinnyLozenges(){var matches=$$('img.flimspin[src="/pics/steps-3.5.gif"]');for(var si in matches)
{var img=matches[si];img.src='/pics/steps-3.gif';}}
Event.observe(window,'load',function(){setTimeout('stopAllSpinnyLozenges()',15000);});function editions_swap(work,site_id){var params={v:1.0,width:620,w:620,height:400,modal:false};var url='/ajax_editions_swap.php?work='+work+"&site_id="+site_id;LibraryThing.lightbox.ajax(url,params);}
function eds(work,site_id){return editions_swap(work,site_id);}
function editions_ebooks(work,source_id)
{var params={v:1.0,width:620,w:620,height:400,modal:false};var url='/ajax_editions_ebooks.php?work='+work+"&source_id="+source_id;LibraryThing.lightbox.ajax(url,params);}
function ede(work,source_id){return editions_ebooks(work,source_id);}
function editions_arbitrary(work,type,site_id)
{var params={v:1.0,width:620,w:620,height:400,modal:false};var url='/ajax_editions_arbitrary.php?work='+work+"&type="+type+"&site_id="+site_id;LibraryThing.lightbox.ajax(url,params);}
function eda(work,type,site_id){return editions_arbitrary(work,type,site_id);}
function editions_alternate(work,site_id)
{var params={v:1.0,width:620,w:620,height:400,modal:false};var url='/ajax_editions_alternate.php?work='+work+"&site_id="+site_id;LibraryThing.lightbox.ajax(url,params);}
function edal(work,site_id){return editions_alternate(work,site_id);}
function editions_bypass_lightbox(url)
{window.location=url;}
function edbp(url){return editions_bypass_lightbox(url);}
function editions_bookfinder(bookinfo)
{var params={v:1.0,width:620,w:620,height:400,modal:false};var url='/ajax_editions_bookfinder.php?bookinfo='+bookinfo;LibraryThing.lightbox.ajax(url,params);}
function edbf(bookinfo){return editions_bookfinder(bookinfo);}
function editions_venue(work,ve_id,defaulttitle,zipcode)
{if(typeof zipcode==='undefined')
{zipcode='';}
var params={v:1.0,width:620,w:620,height:400,modal:false};var url='/ajax_editions_venue.php?work='+work+"&ve_id="+ve_id+"&defaulttitle="+defaulttitle+"&zipcode="+zipcode;LibraryThing.lightbox.ajax(url,params);}
function edv(work,ve_id,defaulttitle,zipcode){return editions_venue(work,ve_id,defaulttitle,zipcode);}
gil.amazonNote=function()
{var url='/ajax_bookservices_amazonnote.php';var params={rounded:1,width:400,height:270,modal:false};LibraryThing.lightbox.ajax(url,params);}
