if(!window.Nexo)window.Nexo={};Nexo.Amazon={id:"Amazon",title:"Amazon",image:"amazon16.gif",allowItems:true,allowFolders:true,allowDrag:true,allowComments:true,itemName:"Amazon Product",UpdateDialog:"updatedialog/60097973.js",FindDialog:"finddialog/56310311.js",_2:new ImageSizer(65,120),_3:new ImageSizer(500,1000),defaultLayout:"Details",detailLayout:"ItemDetail",sendContentItem:function(item,dlg){dlg.subject=item.title;dlg.body=Html.a(Nexo.Amazon.formatHref(item),item.title)+Html.div(item.text)},sendUpdateRequest:function(item,dlg){dlg.fields=[{type:"Html",value:Nexo.Amazon.formatImgLink(item)},{name:"title",label:"Title",value:item.title},{name:"text",label:"Description",value:item.text,type:"TextArea"},{name:"comments.add",label:"Comments",type:"TextArea"}]},renderStyle:function(w){w()},layouts:{Titles:{itemTagName:"LI",renderItemsHeader:function(w,s,items){w("<ul class='contentList bullet1'>")},renderItemsFooter:function(w,s,items){w("</ul>")},renderItemContent:function(w,item){Nexo.Amazon._1(w,item)}},Images:{itemTagName:"SPAN",renderItemContent:function(w,item){var t=Nexo.Amazon;t._0(w,item,{style:{margin:"3px 6px 3px 0"}})}},Details:{renderItemContent:function(w,item){var t=Nexo.Amazon;w("<span style='float:left; padding: 3px 6px 3px 3px;'>");t._0(w,item);w("</span>");t._1(w,item);var desc=item.text;w(((desc)?"<br /><span class=amazon-desc>"+desc+"</span>":""));ItemComment.renderCount(w,item);w("<div class=clear>&nbsp;</div>")}},ItemDetail:{kind:1,renderItemContent:function(w,item,index){var t=Nexo.Amazon;var p=new ItemPanel(w,item);p.property("Title",item.title);p.property("Description",item.text);var buy="<a href='"+Nexo.Amazon.formatHref(item)+"'"+Att.target+">Buy at Amazon</a>";p.property("",buy);var sb=new StringBuilder();t._0(sb.write,item);p.property("Image",sb.toString());p.created();p.modified();p.close()}}},_1:function(w,item){w("<span class=amazon-title>",Nexo.Amazon.formatTitleLink(item),"</span>")},_0:function(w,item,atts){var t=Nexo.Amazon;w("<a href='",t.formatHref(item),"' target='"+A.targetWindowName+"'>");atts=atts||{};atts.className="amazon-image";atts.src="http://images.amazon.com/images/P/"+item.asin+".01._"+"AA_"+"SCTZZZZZZZ_.jpg";t._2.render(w,atts);w("</a>")},renderEmpty:function(w,s){Section.renderEmpty(w,s)},insertItem2:function(parentId,beforeId,asin,title,text){C.beginExec("amazon/add",{parent:parentId,beforeId:beforeId,asin:asin,title:title,text:text})},addItems:function(id,beforeId){if(!beforeId)beforeId=-1;var src=Dom.getByNodeId(id);Module.showDialog(Nexo.Amazon,"FindDialog",{src:src,parentId:id,beforeId:beforeId})},updateItem:function(id){if(id){Module.showDialog(Nexo.Amazon,"UpdateDialog",{item:page.nodes[id]})}},deleteItem:function(id){ContentItem.deleteItem(id)},formatCreatorLink:function(item){var c=item.creator;return"<a href='http://www.amazon.com/exec/obidos/redirect?link_code=ur2&tag=nexo-20&camp=1789&creative=9325&path=search-handle-url%2Findex%3Dbooks%2526field-author-exact%3D"+c+"%2526rank%3D-relevance%252C%252Bavailability%252C-daterank'"+Att.target+">"+c+"</a>"},formatImg:function(item){return"<img style='border:0' src='http://images.amazon.com/images/P/"+item.asin+".01.THUMBZZZ.jpg' />"},formatImgLink:function(item){var t=Nexo.Amazon;return"<a href='"+t.formatHref(item)+"'"+Att.target+">"+t.formatImg(item)+"</a>"},formatHref:function(item){return"http://www.amazon.com/exec/obidos/redirect?link_code=as2&path=ASIN/"+item.asin+"&tag=nexo-20&camp=1789&creative=9325"},formatTitleLink:function(item){return"<a href='http://www.amazon.com/exec/obidos/ASIN/"+item.asin+"/nexo-20?dev-t=D29TMA7VLQ0YPA&camp=2025&link_code=xm2'"+Att.target+">"+item.title+"</a>"},renderItemDivider:function(w){w(this.formatDivider())},formatDivider:function(){return"<div class='divider' style='font-size: 4px;'>&nbsp;</div>"}};if(window.Module)Module.add(Nexo.Amazon);