var Forum={id:"Forum",title:"Forum",image:"forum16.gif",itemName:"Message",allowItems:true,allowDrag:false,allowFolders:false,noOpenItem:true,addMenuName:"Add Message...",EditDialog:"EditDialog/60098191.js",UpdateDialog:"updatedialog/54002516.js",UpdateSection:"updateSection/66269830.js",defaultEditKind:"NoReplies",defaultMaxItems:10,_36:300,initSection:function(s){var sp=s.permissions;if(sp.addComment){sp.addContent=true;sp.editOwnContent=true;sp.deleteOwnContent=true}if(s.lid=="MessageItem"){Forum._30(s.topic,s)}},_30:function(node,s){if(node){ContentItem.initItem(s,node);var ch=node.children;if(ch&&ch.length){var f=Forum._30;for(var i=0;i<ch.length;i++){f(ch[i],s)}}}},createItemMenuItems:function(menuItems,item,src){var t=Forum;var id=item.nodeId;var s=item.section;var sp=s.permissions;if(!item.isClosed&&sp.addContent){menuItems.addDivider();menuItems.add("Reply...",t._34,id);menuItems.add("Quote...",t._35,id)}menuItems.addDivider();menuItems.add("Show Topic Detail",t._31,id);},updateSection:function(s){Module.showDialog(Forum,"UpdateSection",{section:s})},addItems:function(s,b,c){c=c||{};Object.extend(c,{parentId:s,beforeId:-2});Module.showDialog(Forum,"EditDialog",c)},updateItem:function(i,c){var t=Forum;c=c||{};var item=page.nodes[i];if(item){var editInfo=t._21(item);if(!editInfo.editable){Dialog.alert(editInfo.text)}else{c.sectionId=item.section.nodeId;c.messageNumber=item.number;Module.showDialog(Forum,"EditDialog",c)}}},deleteItem:function(i){if(i){ContentItem.onDeleteItem(i);C.beginExec("forum/deletemessage",{page:page.pageId,version:page.version,nodeId:i})}},_34:function(id){Forum._10(id)},_35:function(id){Forum._10(id,{quote:true})},_8:function(id){Forum._10(id,{showItem:true})},_22:function(id){Forum._10(id,{quote:true,showItem:true})},_26:function(id){if(C.requireSignIn()){var item=page.nodes[id];if(item){var cb=item.createdUser;var title=Forum.formatSubject("Re: ",item.title);var body="<br/><br/>--- "+(cb.displayName||cb.userName)+" wrote:<br/>"+item.body;C.send({dialogTitle:"Reply to Author",subject:title,body:body,to:cb.userName,lockTo:true})}}},_25:function(id){if(C.requireSignIn()){var item=page.nodes[id];if(item){var cb=item.createdUser;var title=Forum.formatSubject("Fwd: ",item.title);var body="<br/><br/>--- "+(cb.displayName||cb.userName)+" wrote:<br/>"+item.body;C.send({subject:title,body:body})}}},_19:function(id){Forum.updateItem(id,{showItem:true})},_10:function(id,c){c=c||{};var p=c.parentItem=page.nodes[id];if(p&&p.isClosed){Dialog.alert("You cannot reply to this Message because its Topic is closed.")}else{Forum.addItems(p.section.nodeId,-2,c)}},_23:function(s){Forum.addItems(s,-2,{showItem:true})},_44:function(sid){var t=Forum;var s=page.nodes[sid];t._2(s,{baseType:"start"})},_41:function(sid){var t=Forum;var s=page.nodes[sid];if(s.items.length>0){var firstItem=s.items[0];var baseMessage=firstItem.number;if(firstItem.topic&&firstItem.topic.lastReply)baseMessage=firstItem.topic.lastReply.number;t._2(s,{baseType:"before",baseMessage:baseMessage,baseIndex:s.startIndex})}else{t._2(s,{baseType:"start"})}},_42:function(sid){var t=Forum;var s=page.nodes[sid];if(s.items.length>0){var lastItem=s.items[s.items.length-1];var baseMessage=lastItem.number;if(lastItem.topic&&lastItem.topic.lastReply)baseMessage=lastItem.topic.lastReply.number;t._2(s,{baseType:"after",baseMessage:baseMessage,baseIndex:s.startIndex+s.items.length-1})}else{t._2(s,{baseType:"end"})}},_32:function(sid){var t=Forum;var s=page.nodes[sid];t._2(s,{baseType:"end"})},_16:function(s){var t=Forum;t._2(s,{baseType:"start"})},_2:function(s,args){var t=Forum;t._39(s);args.page=page.pageId;args.section=s.nodeId;args.layout=s.lid;var state={sid:s.nodeId};C.beginExec("forum/getitems",args,t._33,state)},_33:function(response,state){var t=Forum;var s=page.nodes[state.sid];if(s&&!response.error){var result=response.result;ContentItem.initItems(s,result.section.items);Object.extend(s,result.section);Section.refreshContentHtml(s)}},_31:function(id){var item=page.nodes[id];if(item){Nexo.go(Forum._18(item))}},onBeforeUpdateSection:function(s,props){if(props.maxItems||props.lid){Forum._16(s)}},onClientLayoutChanged:function(s){Forum._16(s)},onSectionMessage:function(s,msg,args){if(msg=="changed"){Forum._16(s)}},renderStyle:function(w){w(".forumNavBar {.padding: 5px 8px 5px 8px;}",".forumHeader th {border-bottom: 1px solid ",Theme.c0.dark,"; text-align: center;}",".forumColumnTBPad {padding-top: 6px;padding-bottom: 6px;}",".forumColumnLeftBorder {border-left: 1px solid ",Theme.c0.normal,";}",".forumColumnBottomBorder {border-bottom: 1px solid ",Theme.c0.normal,";}",".forumColumnCenter {text-align: center;}",".forumMessageDiv {padding: 6px 3px 6px 3px;}",".forumTable {border-top: 1px solid ",Theme.c0.normal,"; border-bottom: 1px solid ",Theme.c0.normal,";}",".forum-body {",FontSize.s,"}",".forum-author {",FontSize.xs,"white-space:nowrap; }")},itemTagName:"TR",showEmpty:true,defaultLayout:"TopicSummary",detailLayout:"MessageDetails",itemLayout:"MessageDetails",layouts:{TopicList:{title:"Topic List",refreshSection:true,noItemPadding:true,renderItemsHeader:function(w,s,items){var t=Forum;var isNarrow=t._3(s);var showAuthorInColumn=(s.zone.width>600);t._6(w,s,items,true);w("<table class=forumTable width=100% >");if(isNarrow){w("<tr class='forumHeader font-sys'>","<th>","Topic","</th>","</tr>")}else{w("<col/>",(showAuthorInColumn?"<col width='100px' />":""),"<col width='40px' />","<col width='40px'  />","<col width='150px' />","<tr class='forumHeader font-sys'>","<th>","Topic","</th>",(showAuthorInColumn?"<th>Author</th>":""),"<th>","Views","</th>","<th>","Replies","</th>","<th>","Last&nbsp;Post","</th>","</tr>")}},renderItemsFooter:function(w,s,items){Forum.layouts.TopicSummary.renderItemsFooter(w,s,items)},renderItemAttributes:function(w,item,index){var t=Forum;t._7(w,item,index,"top")},renderItemContent:function(w,item){var t=Forum;var s=item.section;var isNarrow=t._3(s);var showAuthorInColumn=(s.zone.width>600);var topicReplyCount=t._28(item);var topicViewCount=t._27(item);if(isNarrow){w("<td class='forumColumnTBPad'>",t._1(),t._5(item),t._12(item),"<div class=forum-author>","Last by: ",t._11(item),"&nbsp;",t._13(item),t._0(item,true,true),(topicReplyCount>0?" - "+topicReplyCount.toN0()+" replies":""),"</div>","</td>")}else{w("<td class='forumColumnTBPad' style='padding-left:5px;'>",t._1(),t._5(item),t._12(item),t._4(item),(!showAuthorInColumn?" <span class='forum-author color-lightest'>- by "+User.formatLink(item.createdUser)+"</span>":""),"</td>");if(showAuthorInColumn){w("<td class='forumColumnTBPad forumColumnLeftBorder' style='text-align: center;' >",User.formatLink(item.createdUser),"</td>")}w("<td class='forumColumnTBPad forumColumnLeftBorder forumColumnCenter' >",(topicViewCount>0)?topicViewCount.toN0():"","</td>","<td class='forumColumnTBPad forumColumnLeftBorder' style='text-align: center;' >",(topicReplyCount>0)?topicReplyCount.toN0():"","</td>","<td class='forumColumnLeftBorder' style='text-align: center;'>",t._0(item,true),"<br/>","<span class=forum-author>","by: ",t._11(item),"&nbsp;",t._13(item),"</span>","</td>")}}},TopicSummary:{title:"Topic Summary",refreshSection:true,noItemPadding:true,renderItemsHeader:function(w,s,items){var t=Forum;var isNarrow=t._3(s);t._6(w,s,items,true);w("<table class=forumTable width=100% >");if(isNarrow){w("<tr class='forumHeader font-sys'>","<th>","Topic","</th>","</tr>")}else{w("<col/>","<col width='50px' />","<col width='50px' />","<col width='150px' />","<tr class='forumHeader font-sys'>","<th>","Topic","</th>","<th>","Views","</th>","<th>","Replies","</th>","<th>","Last&nbsp;Post","</th>","</tr>")}},renderItemsFooter:function(w,s,items){var t=Forum;w("</table>");t._14(w,s,items)},renderItemAttributes:function(w,item,index){var t=Forum;t._7(w,item,index,"top")},renderItemContent:function(w,item){var t=Forum;var s=item.section;var isNarrow=t._3(item.section);var topicReplyCount=t._28(item);var topicViewCount=t._27(item);if(isNarrow){w("<td class='forumColumnTBPad' style='padding-left:5px;'>",t._1(),t._5(item),t._12(item),t._4(item),"<br/>",t._15(item)," <span class=forum-author>","- by ",User.formatLink(item.createdUser),"</span>");if(topicReplyCount>0){w("<div>","<span class=forum-author>",topicReplyCount.toN0()+" replies - Last by: ",t._11(item),"&nbsp;",t._13(item),"</span>",t._0(item,true,true),"</div>")}else{w(t._0(item,true,true))}w("</td>")}else{w("<td  class='forumColumnTBPad' style='padding-left:5px;'>",t._1(),t._5(item),t._12(item),t._4(item),"<br/>",t._15(item)," <span class='forum-author color-lightest'>- by ",User.formatLink(item.createdUser),"</span>","</td>","<td class='forumColumnTBPad forumColumnLeftBorder forumColumnCenter'>",(topicViewCount>0)?topicViewCount.toN0():"","</td>","<td class='forumColumnTBPad forumColumnLeftBorder forumColumnCenter'>",(topicReplyCount>0)?topicReplyCount.toN0():"","</td>","<td class='forumColumnLeftBorder forumColumnCenter'>",t._0(item,true),"<br/>","<span class=forum-author>","by: ",t._11(item),"&nbsp;",t._13(item),"</span>","</td>")}}},MessageList:{title:"Message List",refreshSection:true,noItemPadding:true,renderItemsHeader:function(w,s,items){var t=Forum;var isNarrow=t._3(s);t._6(w,s,items);w("<table class=forumTable width=100% >");if(!isNarrow){w("<col style='padding-left:5px;'/>","<col width='150px' style='text-align: center;'/>","<col width='100px' style='text-align: center;' />","<tr class='forumHeader font-sys'>","<th>","Title","</th>","<th>","Author","</th>","<th>","Posted","</th>","</tr>")}},renderItemsFooter:function(w,s,items){var t=Forum;w("</table>");t._14(w,s,items)},renderItemAttributes:function(w,item,index){var t=Forum;t._7(w,item,index,"top")},renderItemContent:function(w,item){var t=Forum;var isNarrow=t._3(item.section);if(isNarrow){w("<td>","<div class=forumMessageDiv>",t._1(),t._17(item),t._4(item),t._0(item,false,true)," <span class='forum-author color-lightest'>","- by ",User.formatLink(item.createdUser),"</span>","</div>","</td>")}else{w("<td>",t._1(),t._17(item),t._4(item),"</td>","<td class='forumColumnLeftBorder'>",User.formatLink(item.createdUser),"</td>","<td class='forumColumnLeftBorder'>",t._0(item),"</td>")}}},MessageSummary:{title:"Message Summary",refreshSection:true,noItemPadding:true,renderItemsHeader:function(w,s,items){var t=Forum;t._6(w,s,items);w("<table class=forumTable width=100% >")},renderItemsFooter:function(w,s,items){var t=Forum;w("</table>");t._14(w,s,items)},renderItemAttributes:function(w,item,index){var t=Forum;t._7(w,item,index,"top")},renderItemContent:function(w,item){var t=Forum;w("<td>","<div class=forumMessageDiv>",t._1(),t._17(item),t._4(item),t._0(item,false,true),"<br/>",t._15(item)," <span class='forum-author color-lightest'>","- by ",User.formatLink(item.createdUser),"</span>","</div>","</td>")}},MessageItem:{title:"Message Item",kind:1,refreshSection:true,fill:true,renderContent:function(w,s){var t=Forum;var l=Forum.layouts.MessageItem;l.fill=true;s.topicClosed=s.topic.state>0;l._24(w,s);var lastReply=s.topic.lastReply||s.topic;var lastReplyUrl=WebPath.fromPathKey(page.pageId)+"/"+s.nodeId+"/"+lastReply.number;var age=new AgeBinding(lastReply.created);w("<div style='background-color: ",Theme.c0.lightest,";border: 1px solid  ",Theme.c0.dark,";padding: 10px;'>","Views: ",((s.topic.views||0)+1).toN0(),"&nbsp;&nbsp;","Replies: ",(s.topic.replies||0).toN0()," - <a href='",lastReplyUrl,"'>Last Message</a>: ","<span id='"+age.id+"'>"+age.text+"</span> ago by: ",User.formatLink(lastReply.createdUser),"</div>");l._20(w,s,s.topic,0);l._24(w,s)},_24:function(w,s){w("<div style='padding:10px;' class='font-sys printHide'>");if(s.permissions.addContent&&!s.topicClosed){w("<a href='' onclick='Forum._8(\"",s.topic.nodeId,"\");return false;' >","<img src='",ImgSrc.reply,"' style='vertical-align: middle;' />","</a>","&nbsp;","<a href='' onclick='Forum._8(\"",s.topic.nodeId,"\");return false;' >","Reply to this Topic","</a>","&nbsp;&nbsp;")}w("<a href='",WebPath.fromPathKey(page.pageId),"' >","<img src='",ImgSrc.restart,"' style='vertical-align: middle;' />","</a>","&nbsp;","<a href='",WebPath.fromPathKey(page.pageId),"'>","Show All Messages","</a>");if(s.permissions.addContent){w("&nbsp;&nbsp;","<a href='' onclick='Forum._23(",s.nodeId,");return false;' >",ImageEx.formatImg(ImgSrc.topicAdd,16,16,{},{"vertical-align":"middle"}),"</a>","&nbsp;","<a href='' onclick='Forum._23(",s.nodeId,");return false;' >","New Topic","</a>","</div>")}},_20:function(w,s,msg,level){var t=Forum;var i;var user=msg.createdUser;var l=Forum.layouts.MessageItem;l.fill=!l.fill;if(msg){w("<div style='margin: 10px 0px 0px ",(20*level),"px;'>");var highlight=(s.highlightMessage==msg.number);if(highlight){w("<div style='border: 2px solid yellow;'>")}var editInfo=t._21(msg);w("<div style='border: 1px solid ",Theme.c0.dark,";",(l.fill?"background-color: "+Theme.c0.lightest+";":""),"'>","<table width=100%>","<col width=100px />","<tr>","<td style='vertical-align: top; text-align: center; padding: 5px;'>","<div>",User.formatLink(msg.createdUser),(msg.createdUser.online?" <img align='absMiddle' src='"+ImgSrc.onlinenow+"' />":""),"<p/>",(user.image?User.formatUserImage(user.image,user.userName,user.dispayName):""),"</div>","</td>","<td class=forumColumnLeftBorder style='vertical-align: top;'>","<div>","<table width:100%>","<col width=100%>","<tr>","<td class=forumColumnBottomBorder style='padding: 5px;'>",msg.title,"<br/>","<span>","Posted: ",t._0(msg,false,false),"</span>","</td>","<td class='forumColumnBottomBorder' style='padding: 5px; white-space: nowrap;'><span class=printHide>");if(s.permissions.addContent&&!s.topicClosed){w("<a href='' onclick='Forum._8(\"",msg.nodeId,"\");return false;' >","<img src='",ImgSrc.reply,"' style='vertical-align: middle;' />","</a>","&nbsp;","<a href='' onclick='Forum._8(\"",msg.nodeId,"\");return false;' >","<span class=font-sys>","Reply","</span>","</a>","&nbsp;&nbsp;");w("<a href='' onclick='Forum._22(\"",msg.nodeId,"\");return false;' >","<img src='",ImgSrc.reply,"' style='vertical-align: middle;' />","</a>","&nbsp;","<a href='' onclick='Forum._22(\"",msg.nodeId,"\");return false;' >","<span class=font-sys>","Quote","</span>","</a>","&nbsp;&nbsp;")}w("<a href='' onclick='Forum._26(\"",msg.nodeId,"\");return false;' >","<img src='",ImgSrc.email,"' style='vertical-align: middle;' />","</a>","&nbsp;","<a href='' onclick='Forum._26(\"",msg.nodeId,"\");return false;' >","<span class=font-sys>","Reply to Author","</span>","</a>","&nbsp;&nbsp;","<a href='' onclick='Forum._25(\"",msg.nodeId,"\");return false;'>","<img src='",ImgSrc.email,"' style='vertical-align: middle;' />","</a>","&nbsp;","<a href='' onclick='Forum._25(\"",msg.nodeId,"\");return false;'>","<span class=font-sys>","Forward","</span>","</a>");if(editInfo.editable){w("&nbsp;&nbsp;","<a href='' onclick='Forum._19(\"",msg.nodeId,"\");return false;' >","<img src='",ImgSrc.edit,"' style='vertical-align: middle;' />","</a>","&nbsp;","<a href='' onclick='Forum._19(\"",msg.nodeId,"\");return false;' >","<span class=font-sys>","Edit","</span>","</a>")}w("</span></td>","</tr>","</table>","</div>","<div style='padding: 5px;'>",msg.body);if(msg.attachments&&msg.attachments.length>0){w("<div style='padding: 5px; margin-top: 15px; border: 1px solid gray;'>","<div class='font-sys' style='padding-bottom: 5px;'>","Attachments","</div>");for(i=0;i<msg.attachments.length;i++){var attachment=msg.attachments[i];var imageHtml;var fileUrl;if(attachment.isImage){var attachmentPath=A.userStaticBase+page.pageId+"/"+attachment.guid+"/";var tnUrl=attachmentPath+encodeURIComponent(attachment.thumbnail);imageHtml=HtmlFactory.img({"class":"imagesImage",src:tnUrl,alt:"Click to see original image"},{"vertical-align":"middle"});fileUrl=attachmentPath+encodeURIComponent(attachment.fileName)}else{var iconPath=A.imagesBase+"DocumentIcons"+"/"+attachment.ext+".png";imageHtml=ImageEx.formatImg(iconPath,16,16,{border:"0",alt:"Click to open file",onerror:'Forum.onFileIconImageError(this);'},{"vertical-align":"baseline"});fileUrl=WebPath.fromPathKey(page.pageId)+"/"+s.nodeId+"/"+msg.number+"/"+WindowEx.encodeFileName(attachment.fileName)}w("<div style='borderx: 1px solid lightgrey; padding: 5px; margin-right: 5px; display: inline; '>","<table style=' overflow: hidden; display: inline; table-layout: fixed;'>","<col style='width: 120px' />","<tr>","<td align=center>","<a",Html.attribute("href",fileUrl),(attachment.isImage?" target='_37'":""),">",imageHtml,"</a>","</td>","</tr>","<tr>","<td style='text-align: center;'>","<div class='ellipsis wide'>","<a",Html.attribute("href",fileUrl),(attachment.isImage?" target='_37'":"")," title=\""+attachment.fileName+"\" >",attachment.fileName,"</a>","</div>","<span class='forum-author color-lighter'>",attachment.size.toFileSize(),"</span>","</td>","</tr>","<tr>","<td>","</td>","</tr>","</table>","</div>")}w("</div>")}w("</div>");if(msg.modifiedCount){var age=new AgeBinding(msg.modified,msg.nodeId+".modAge");w("<div class='font-sys color-red' style='padding: 5px;'>","[",(msg.modifiedCount>1?"Last ":""),"Modified by ",User.formatLink(msg.modifiedUser)," - ",age.formatAgo(),"]","</div>")}w("</td>","</tr>","</table>","</div>");if(highlight){w("</div>")}w("</div>");if(msg.children){level++;var f=l._20;for(i=0;i<msg.children.length;i++){f(w,s,msg.children[i],level)}}}}}},renderEmpty:function(w,s){Section.renderEmpty(w,s)},onFileIconImageError:function(e){if(e){e.src=A.imagesBase+"DocumentIcons/document.png"}},_21:function(item){var t=Forum;var s=item.section;var text=null;var valid=true;if(!s.permissions.edit){if(item.closed){valid=false;text="This Message cannot editted because its Topic is closed."}else if(!item.permissions.edit){valid=false;text="You are not authorized to edit this item."}else{var editKind=s.editKind||t.defaultEditKind;var createDt=Date.fromSeconds(item.created);var now=new Date();var tenMinutes=1000*60*10;var oneHour=1000*60*60;var oneDay=oneHour*24;switch(s.editKind){case"Always":break;case"Never":valid=false;text="This forum does not allow Messages to be edited once they are posted.";break;case"TenMinutes":if(now-createDt>tenMinutes){valid=false;text="This forum only allows Messages to be edited for ten minutes after they are posted."}break;case"OneHour":if(now-createDt>oneHour){valid=false;text="This forum only allows Messages to be edited for one hour after they are posted."}break;case"OneDay":if(now-createDt>oneDay){valid=false;text="This forum only allows Messages to be edited for one day after they are posted."}break;case"NoReplies":if(item.children&&item.children.length>0){valid=false;text="This forum does not allow Messages to be edited once they have been replied to."}break;default:break}}}return{editable:valid,text:text}},_7:function(w,item,index,vAlign){w(" valign='",vAlign,"'",(index%2==1?" style='background-color: "+Theme.c0.lightest+";'":""))},_39:function(s){var t=Forum;t._38(s,"Retrieving "+(t._40(s)?"Topics":"Messages"))},_40:function(s){var lid=s.lid||Forum.defaultLayout;return lid.startsWith("Topic")},_38:function(s,msg){var t=Forum;var e=Dom.getElement(s.nodeId+".forumDisplayMessage");if(e){e.innerHTML=msg}},_43:function(s,isTopicList){var total=(isTopicList?s.topicCount:s.messageCount);var startIndex=s.startIndex||1;var count=Array.getLength(s.items);var endIndex=startIndex+count-1;var msg=(isTopicList?total.toCount("Topic"):total.toCount("Message"));if(total>count){msg=startIndex.toN0()+" - "+endIndex.toN0()+" of "+msg}return msg},_6:function(w,s,items,isTopicList){var t=Forum;var isNarrow=t._3(s);w("<div class=forumNavBar>","<table style='width:100%;'>","<tr>","<td>","<span id='",s.nodeId,".forumDisplayMessage' class=font-sys>",t._43(s,isTopicList),"</span>","&nbsp;");if(s.permissions.addContent){w("|&nbsp;<a class='font-sys' href='' onclick='Forum.addItems("+s.nodeId+",-2);return false;'>Add Topic</a>&nbsp;")}w("</td>");if(isNarrow){w("</tr><tr>")}w("<td style='text-align:right;'>");if(s.allowPrev||s.allowNext){t._29(w,s)}w("</td>","</tr>","</table>","</div>")},_14:function(w,s,items){var t=Forum;if(items.length<s.topicCount){w("<div class=forumNavBar style='text-align: right;' >");if(s.allowPrev||s.allowNext){t._29(w,s)}w("</div>")}},_29:function(w,s){var t=Forum;var sid=s.nodeId;w("<div class=font-sys>");t._9(w,"‹‹&nbsp;First&nbsp;",s.allowPrev,"Forum._44("+sid+")");t._9(w,"‹&nbsp;Previous",s.allowPrev,"Forum._41("+sid+")");w("&nbsp;&nbsp;&nbsp;");t._9(w,"Next&nbsp;›&nbsp;",s.allowNext,"Forum._42("+sid+")");t._9(w,"Last&nbsp;››",s.allowNext,"Forum._32("+sid+")");w("</div>")},_9:function(w,label,enabled,methodName){w((enabled?"<a href='' onclick='"+methodName+";return false;'>":"<span>"),label,(enabled?"</a>":"</span>"))},_4:function(item){if(item.attachments&&item.attachments.length>0){return ImageEx.formatImg(ImgSrc.attachment,16,16,{alt:"Message contains attachments"},{"vertical-align":"middle"})}return""},_0:function(item,isTopicLayout,addDash){var t=Forum;var created=item.created;if(isTopicLayout&&item.topic&&item.topic.lastReply){created=item.topic.lastReply.created}if(!created){return""}var age=new AgeBinding(created,item.nodeId+".age");return(addDash?" - ":"")+age.formatAgo()},_1:function(){return ImageEx.formatImg(A.imagesBase+"trianglebullet.png",5,9,{"class":"trianglebullet"})},_5:function(item){var ret="";if(item.topic&&item.topic.pinned==1){ret+=HtmlFactory.img({src:ImgSrc.pushpin,alt:'Topic pinned'},{'vertical-align':'middle'})}if(item.topic&&item.topic.state){if(item.topic.state==1){ret+=HtmlFactory.img({src:ImgSrc.lock,alt:'Topic closed'},{'vertical-align':'middle'})}else if(item.topic.state==2){ret+=HtmlFactory.img({src:ImgSrc.lock,alt:'Topic permanently closed'},{'vertical-align':'middle'})}}return ret},formatSubject:function(prefix,s){if(s){s=s.replace(/^(Re|Fwd|Fw)(:|&#58;)\s*/i,"")}return prefix+s},_15:function(item){return"<span class=forum-body>"+(item.summary||"")+"</span>"},_18:function(item){return PageNode.formatHref(item.section)+"/"+item.number},_12:function(item){return Html.a(Forum._18(item),item.title||"(No Subject)")},_17:function(item){return Html.a(Forum._18(item),(item.title||""))},_28:function(item){return(item&&item.topic&&item.topic.replies)?item.topic.replies:0},_27:function(item){return(item&&item.topic&&item.topic.views)?item.topic.views:0},_13:function(item){var n=(item.topic&&item.topic.lastReply&&item.topic.lastReply.number)?item.topic.lastReply.number:item.number;var href=PageNode.formatHref(item.section)+"/"+n;return Html.a(href,"»")},_11:function(item){var u;if(item.topic&&item.topic.lastReply){u=item.topic.lastReply.createdUser}else{u=item.createdUser}return User.formatLink(u)},_3:function(s){var t=Forum;return(s.zone&&s.zone.width<t._36)}};Module.add(Forum);