
 /* 1592:minified:js/librarything.js */ 

var LibraryThing=LibraryThing||{};LibraryThing.namespace=function(namespace){var spaces=namespace.split('.');var currentSpace=LibraryThing;var i;for(i=0;i<spaces.length;i++)
{currentSpace[spaces[i]]=currentSpace[spaces[i]]||{};currentSpace=currentSpace[spaces[i]];}};LibraryThing.namespace("utils");LibraryThing.utils.loadScript=function(script,onLoaded){if(typeof LibraryThing.utils.loadScript.head==='undefined')
{LibraryThing.utils.loadScript.head=document.getElementsByTagName("head")[0];}
var s=document.createElement("script");s.type="text/javascript";s.src=script;if(typeof onLoaded!=='undefined')
{s.onloadDone=false;s.onload=function(){s.onloadDone=true;onLoaded();};s.onreadystatechange=function(){if(s.readyState==='loaded'&&!s.onloadDone){s.onloadDone=true;onLoaded();};};}
LibraryThing.utils.loadScript.head.appendChild(s);}; 
 /* 1592:minified:js/widget_wrapper.js */ 

LibraryThing.namespace("bookAPI.wrapper");LibraryThing.bookAPI.wrapper.addGlobalStyle=function(cssInput)
{var styleElement=document.createElement('style');styleElement.setAttribute('type','text/css');if(styleElement.styleSheet)
{styleElement.styleSheet.cssText=cssInput;}
else
{var textNode=document.createTextNode(cssInput);styleElement.appendChild(textNode);}
document.getElementsByTagName('head')[0].appendChild(styleElement);};LibraryThing.bookAPI.wrapper.showLightbox=function(bookID,widgetID,localDomain)
{var params={width:600,height:400,modal:false};if(typeof LibraryThing.bookArea!=='undefined'&&typeof LibraryThing.bookArea.kiosk!=='undefined')
{LibraryThing.bookArea.kiosk.pause();params.callbackFailure=function(){LibraryThing.bookArea.kiosk.unpause();};}
LibraryThing.lightbox.iframe('http://'+localDomain+'/widget_work.php?book='+bookID+'&id='+widgetID,params);};LibraryThing.bookAPI.wrapper.makeWidgetWrapper=function(ltdata,theDiv)
{LibraryThing.namespace("activeWidgets");LibraryThing.activeWidgets.all=LibraryThing.activeWidgets.all||{};LibraryThing.activeWidgets.info=LibraryThing.activeWidgets.info||{};LibraryThing.activeWidgets.info.animatedCount=LibraryThing.activeWidgets.info.animatedCount||0;if(typeof LibraryThing.activeWidgets.all[theDiv]==='undefined')
{var widgetType=ltdata.showWhat;LibraryThing.activeWidgets.all[theDiv]=widgetType;if(widgetType==='covers')
{LibraryThing.activeWidgets.info.animatedCount++;}}
else
{alert('You can only have one of the same widget on any given page.');return;}
var theDestination=document.getElementById(theDiv);LibraryThing.bookAPI.wrapper.addGlobalStyle(ltdata.style);if(ltdata.title!=="")
{var titleDiv=document.createElement("div");titleDiv.className='LT_header';var mainLink=document.createElement("a");if(ltdata.titleLink=='library')
{mainLink.setAttribute('href','http://www.librarything.com/catalog/'+ltdata.theuser);}
else
{mainLink.setAttribute('href','http://www.librarything.com/profile/'+ltdata.theuser);}
mainLink.setAttribute('target','_top');mainLink.innerHTML=ltdata.title;titleDiv.appendChild(mainLink);theDestination.appendChild(titleDiv);}
var contentDiv=document.createElement("div");contentDiv.className="LT_content";contentDiv.setAttribute("id",theDiv+"LT_Content");var preloadDiv=document.createElement("div");preloadDiv.setAttribute("id",theDiv+"preload");preloadDiv.className="LT_Preload";var preloadImg=document.createElement("img");preloadImg.setAttribute("src",ltdata.preloader);preloadDiv.appendChild(preloadImg);contentDiv.appendChild(preloadDiv);theDestination.appendChild(contentDiv);var poweredDiv=document.createElement("div");poweredDiv.setAttribute('style','vertical-align: middle;');var poweredImage=document.createElement("img");var poweredLink=document.createElement("a");var poweredImgLink=document.createElement("a");poweredDiv.className='LT_powered';poweredImage.className="favicon";poweredImage.setAttribute('src',"http://www.librarything.com/favicon.ico");poweredImage.setAttribute('width','16px');poweredImage.setAttribute('height','16px');poweredLink.setAttribute('href','http://www.librarything.com')
poweredLink.setAttribute('target','_top');poweredLink.innerHTML='Powered <span style="white-space: nowrap;">by LibraryThing</span>';poweredImgLink.setAttribute('href','http://www.librarything.com')
poweredImgLink.setAttribute('target','_top');poweredImgLink.appendChild(poweredImage);poweredDiv.appendChild(poweredImgLink);poweredDiv.appendChild(poweredLink);theDestination.appendChild(poweredDiv);return true;}; 
 /* 1592:minified:js/lt_lightbox_widget.js */ 

LibraryThing.lightbox={active:0,yPos:0,xPos:0,css_url:'/css/lt_lightbox.css',ie:(navigator.appName=="Microsoft Internet Explorer"?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...";this.div_close=document.createElement('div');this.div_close.id='LT_LB_close';body.appendChild(this.div_overlay);body.appendChild(this.div_lightbox);body.appendChild(this.div_close);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';}}}},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';{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';},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;var lightbox=document.getElementById('LT_LB');var lightbox_content=document.getElementById('LT_LB_content');var lightbox_overlay=document.getElementById('LT_LB_overlay');lightbox_content.innerHTML='';lightbox.style.display='block';var currentWidth=lightbox.offsetWidth-4;var currentHeight=lightbox.offsetHeight-5;var iframeS="<iframe id='LT_iframe' src='"+contentURL;iframeS+="' frameborder='0' scrolling='auto' width='"+currentWidth;iframeS+="' height='"+currentHeight+"'></iframe>";lightbox_content.innerHTML=iframeS;lightbox_overlay.style.display='block';lightbox_content.style.display='block';this.div_close.style.position='absolute';this.div_close.style.padding='0px';this.div_close.style.margin='0px';this.div_close.style.top=lightbox.offsetTop+8+'px';this.div_close.style.left=lightbox.offsetLeft+530+'px';this.div_close.style.zIndex=100000;this.div_close.style.color="#FFFFFF";this.div_close.style.cursor="pointer";this.div_close.innerHTML='<span style="padding: 0px; margin: 0px; font-size:14px; font-family:Verdana,Arial,Helvetica,sans-serif; " onclick="LibraryThing.lightbox.off();">(close)</span>';this.div_close.style.display='inline';LibraryThing.lightbox.ready();this.unload=function(){lightbox_content.innerHTML='';};this.modalCheck();}},off:function(success){this.unload();{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);}
this.showhide('LT_LB_overlay',false);this.showhide('LT_LB',false);this.showhide('LT_LB_close',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+=')';eval(fbstring);}},ready:function()
{if(this.params&&this.params.callbackReady)
{LibraryThing.lightbox.cbRun(this.params.callbackReady);}},modalCheck:function()
{var overlay=document.getElementById('LT_LB_overlay');if(this.params)
{if(this.params.modal==true)
{overlay.style.cursor='default';}
else
{if(typeof LibraryThing.lightbox.overlayInit==='undefined')
{this.addEvent(overlay,'click',function(event){event.cancelBubble=true;if(event.stopPropagation)
{event.stopPropagation();}
LibraryThing.lightbox.off();});LibraryThing.lightbox.overlayInit=true;}
overlay.style.cursor='default';}}
else
{if(typeof LibraryThing.lightbox.overlayInit==='undefined')
{this.addEvent(overlay,'click',function(event){event.cancelBubble=true;if(event.stopPropagation)
{event.stopPropagation();}
LibraryThing.lightbox.off();});LibraryThing.lightbox.overlayInit=true;}
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);LibraryThing.showhide('LT_LB_close',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;}}; 
 /* 1592:minified:js/widget_bookswithtext.js */ 

if(!LibraryThing)
{var LibraryThing={};}
if(!LibraryThing.bookAPI)
{LibraryThing.bookAPI={};}
if(typeof(LibraryThing.bookAPI.textWidget)=="undefined"){if(!LibraryThing.bookAPI.textWidget)
{LibraryThing.bookAPI.textWidget={};}
LibraryThing.bookAPI.textWidget.bookLinkAA=new Array();LibraryThing.bookAPI.textWidget.AuthorLinkPattern='/author/MAGICNUMBER';LibraryThing.bookAPI.textWidget.AuthorLinkField='author_code';LibraryThing.bookAPI.textWidget.AuthorLinkString=function(book,widgetSettings)
{var link='http://'+widgetSettings.domain+LibraryThing.bookAPI.textWidget.AuthorLinkPattern;link=link.replace('MAGICNUMBER',book.author_code);return link;}
LibraryThing.bookAPI.textWidget.makeCoverimage=function(book,coverHeight,coverWidth,widgetSettings)
{if(book.cover)
{var coverimage=document.createElement("img");coverimage.className='LT_cover';coverimage.setAttribute('src',book.cover);coverimage.onclick=function getLightbox(){LibraryThing.bookAPI.wrapper.showLightbox(book.book_id,widgetSettings.uniqueKey,widgetSettings.domain);}
if(coverWidth==''){coverimage.setAttribute('height',coverHeight);}
else
{coverimage.setAttribute('width',coverWidth);}
coverimage.setAttribute('title',book.title);return coverimage;}
else
{return null;}}
LibraryThing.bookAPI.textWidget.makeTags=function(book,widgetSettings)
{if(widgetSettings.textsnippets.Tagged==undefined)
{var tagged_wording="Tagged";}
else
{var tagged_wording=widgetSettings.textsnippets.Tagged;}
var tagList=" "+tagged_wording+": "
var theTag=document.createElement("span");theTag.className='LT_tags';var count=0;if(book.tags)
{var tagdisplayA=new Array();for(count=0;count<book.tags.length;count++)
{tagdisplayA.push('<a href="/catalog/'+encodeURI(widgetSettings.theuser)+'&tag='+encodeURI(book.tags[count])+'" target="_top">'+book.tags[count]+'</a>');}
tagList=tagList+tagdisplayA.join(', ');theTag.innerHTML=tagList;return theTag;}
else
{return null;}}
LibraryThing.bookAPI.textWidget.makeTitleandauthorlink=function(book,showTitle,showAuthor,widgetSettings)
{if(widgetSettings.textsnippets.Tagged==undefined)
{var by_wording="by";}
else
{var by_wording=widgetSettings.textsnippets.by;}
var titleandauthorlink=document.createElement("span");titleandauthorlink.className='LT_titleandauthor';var theTitle=document.createElement("span");theTitle.className='LT_title';var theAuthor=document.createElement("span");theAuthor.className='LT_author';if(showTitle==1)
{if(book.title)
{theTitle.innerHTML=book.title;theTitle.onclick=function getLightbox(){LibraryThing.bookAPI.wrapper.showLightbox(book.book_id,widgetSettings.uniqueKey,widgetSettings.domain);}
titleandauthorlink.appendChild(theTitle);}}
if(showAuthor==1&&book.author_fl)
{if(LibraryThing.bookAPI.textWidget.AuthorLinkPattern)
{var byspan=document.createElement("span");byspan.className='by';if(showTitle==1)
{var byText='&nbsp;'+by_wording+' ';byspan.innerHTML=byText;}
theAuthor.appendChild(byspan);var authorlink=document.createElement("a");authorlink.setAttribute('href',LibraryThing.bookAPI.textWidget.AuthorLinkString(book,widgetSettings));authorlink.setAttribute('target','_top');authorlink.innerHTML=book.author_fl;theAuthor.appendChild(authorlink);titleandauthorlink.appendChild(theAuthor);}}
return titleandauthorlink;}
LibraryThing.bookAPI.textWidget.makeBookreview=function(book,widgetSettings)
{if(widgetSettings.textsnippets.readreview==undefined)
{var wording="read review";}
else
{var wording=widgetSettings.textsnippets.readreview;}
if(book.bookreview)
{var bookreview=document.createElement('div');bookreview.className='LT_bookreview';bookreview.innerHTML=book.bookreview;var bookreviewlink=document.createElement("span");bookreviewlink.innerHTML=" (<a href='http://"+widgetSettings.domain+"/review/"+book.book_id+"' target='_top'>"+wording+"</a>)";bookreview.appendChild(bookreviewlink);return bookreview;}
else
{return null;}}
LibraryThing.bookAPI.textWidget.makeBookreviewlink=function(book)
{if(book.hasreview&&book.hasreview==1)
{var bookreviewlink=document.createElement("span");bookreviewlink.className='LT_reviewlink';var readreviewlink=' (<a class="LT_reviewlink" href="http://www.librarything.com/review/'+book.book_id+'" target="_top" >'+'read review'+'</a>)';bookreviewlink.innerHTML=readreviewlink;return bookreviewlink;}
else
{return null;}}
LibraryThing.bookAPI.textWidget.makeRatingimage=function(book,widgetSettings)
{if(book.rating)
{var ratingimage=document.createElement("img");ratingimage.className='LT_rating';var url='http://static.librarything.com/pics/ss'+(book.rating*2)+'.gif';ratingimage.setAttribute('src',url);ratingimage.setAttribute('title',book.rating+widgetSettings.textsnippets.Tagged);return ratingimage;}
else
{return null;}}
LibraryThing.bookAPI.textWidget.makeBasicwidget=function(ltdata,theDiv,onDone){var count=0;var theDestination=document.getElementById(theDiv);var widgetSettings=ltdata.settings;for(i in ltdata.books)
{var book=ltdata.books[i];if(book.book_id)
{var itemdiv=document.createElement("div");if(i==ltdata.books.length-1){itemdiv.className='LT_item';}
else
{itemdiv.className='LT_itemLast';}
itemdiv.setAttribute('id',ltdata.settings.uniqueKey+book.book_id+'LT_item');if(ltdata.settings.show.showCovers)
{if(book.cover)
{itemdiv.appendChild(LibraryThing.bookAPI.textWidget.makeCoverimage(book,ltdata.settings.coverheight,ltdata.settings.coverwidth,widgetSettings));}}
var titleandauthor=LibraryThing.bookAPI.textWidget.makeTitleandauthorlink(book,ltdata.settings.show.showTitles,ltdata.settings.show.showAuthors,widgetSettings);titleandauthor.id=ltdata.settings.uniqueKey+book.book_id;itemdiv.appendChild(titleandauthor);if(ltdata.settings.show.showRatings==1)
{theRatings=LibraryThing.bookAPI.textWidget.makeRatingimage(book,widgetSettings);if(theRatings){itemdiv.appendChild(theRatings)}}
if(ltdata.settings.show.showTags==1)
{theTags=LibraryThing.bookAPI.textWidget.makeTags(book,widgetSettings);if(theTags){itemdiv.appendChild(theTags)}}
if(ltdata.settings.show.showReviews==1)
{theReviews=LibraryThing.bookAPI.textWidget.makeBookreview(book,widgetSettings);if(theReviews){itemdiv.appendChild(theReviews)}}
var theTable=document.getElementById("iframeTable");var clearOut=document.createElement("div");clearOut.className="clearer";itemdiv.appendChild(clearOut);theDestination.appendChild(itemdiv);count++;}}
var booklinksdiv=document.createElement("div");booklinksdiv.id='LT_booklinksdiv';booklinksdiv.className='LT_booklinks';booklinksdiv.style.display='none';booklinksdiv.style.position='absolute';theDestination.appendChild(booklinksdiv);if(typeof onDone!=='undefined')
{var maxImageHeight=parseInt(widgetSettings.coverwidth.substr(0,(widgetSettings.coverwidth.length-2)));onDone(Math.floor(maxImageHeight*0.7*count));}}}