<mef:set container="forums" forum_header_type="thread" title="{thread.topic}" />
<script type="text/javascript" src="/js/thread.js"></script>

<mef:if expr="thread.id = 604295">
<audio id="vuvuzela" loopstart="0" autoplay="autoplay" loop="loop">
<source src="//djungxnpq2nug.cloudfront.net/audio/vuvuzela-loop.mp3" type="audio/mp3" />
<source src="//djungxnpq2nug.cloudfront.net/audio/vuvuzela-loop.ogg" type="audio/ogg; codecs=vorbis" />
</audio>
<script type="text/javascript">
<![CDATA[
$('vuvuzela').observe('ended', function() { $('vuvuzela').currentTime = 0;} );
]]>
</script>
</mef:if>

<mef:if expr="thread.id = 610713">
<audio id="usa-anthem" loopstart="0" autoplay="autoplay">
<source src="//djungxnpq2nug.cloudfront.net/audio/usa_anthem.mp3" type="audio/mp3" />
<source src="//djungxnpq2nug.cloudfront.net/audio/usa_anthem.ogg" type="audio/ogg; codecs=vorbis" />
</audio>
</mef:if>


<div><a href="/forums/">Allegro.cc Forums</a> » <span class="board"><a href="/forums/board/{thread.board_id}">{forum.BoardName}</a></span> » <b>{thread.topic}</b></div>
<mef:comment>The thread.id != last_read_post_id checked needs to be re-written.</mef:comment>
<mef:if expr="last_read_post_id">
<div style="font-size: 10px; margin: 3px 3px 19px 3px;"><mef:if expr="use_pages && !last_read_on_same_page"><mef:true><a href="/forums/thread/{thread.id}/{last_read_post_id}#target" style="color: black">jump to last read post</a></mef:true><mef:false><a href="#last_read" style="color: black;">jump to last read post</a></mef:false></mef:if></div>
</mef:if>

<mef:if expr="!last_read_post_id"><br /></mef:if>

<div align="right" mef:if="thread.result = 2">
<small>Credits go to 
<mef:loop name="h" collection="helpers" id="helper_id" item="helper" delim=", " lastdelim=", and " onlydelim=" and ">
<a href="/members/id/{helper_id}">{helper}</a></mef:loop>
 for helping out!</small>
</div>


<div style="text-align: right; margin: 0 0 0.25em 0;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" summary="pages">
	<tr>
		<td align="left">
			<span mef:if="thread.locked" style="font-size: 10px; margin-left: 2em; padding-top: 4px; float: right;">
				This thread is locked; no one can reply to it.
			</span>
			
			<span mef:if="!thread.locked && ignored" style="font-size: 10px; margin-left: 2em; float: right; padding-top: 4px;">
				You are unable to reply to this thread because you are on the thread originator's ignore list.
			</span>
			
			<span mef:if="USER_ID" style="cursor: pointer;">
			<mef:if expr="thread.mark_flag = 1">
				<mef:true><mef:theme_image src="icon/thread-flag.png" alt="%" onclick="toggleFlag(this,'{thread.id}')" /></mef:true>
				<mef:false><mef:theme_image src="icon/thread-dot.png" alt="%" onclick="toggleFlag(this,'{thread.id}')" /></mef:false>
			</mef:if>
			</span>
			<a href="/rss/thread.xml/{thread.id}"><img src="/images/rss.png" alt="rss feed" border="0" /></a> 
			<a href="/forums/print-thread/{thread.id}" target="_blank"><mef:theme_image src="icon/print.png" alt="Print" /></a>

			<a mef:if="similarFlag" href="/forums/similar/{thread.id}" style="margin-left: 1em; font-size: 10px; color: black; font-weight: bold;">View Similar Threads</a>

		</td>
		<td align="right">
<mef:if expr="use_pages">
			<mef:capture name="pages">
			<div class="page-numbers" mef:attributes="+class: compact if settings.forum_header = 'compact'" style="margin-right: 5px;">
			<mef:loop item="i" start="page_count > 6 ? page_count-5 : 1" stop="page_count">
				<mef:if expr="i = page">
					<mef:true>
						<span id="top-page-{i}" class="selected"> {i+1} </span>
					</mef:true>
					<mef:false>
						<span id="top-page-{i}"><a href="/forums/thread/{thread.id}/{i}"> {i+1} </a></span>
					</mef:false>
				</mef:if>
			</mef:loop>
			</div>
			</mef:capture>
			{pages}
</mef:if>
		</td>
	</tr>
</table>
</div>
		
<div id="thread" class="forum-table">
<table id="thread-topic" width="100%" border="0" cellspacing="0" cellpadding="0" summary="thread header">
<thead>
	<tr>
		<td>{thread.topic}</td>
	</tr>
</thead>
</table>
<mef:loop name="pp" collection="posts" item="p">
<table mef:attributes="+class: odd if !(pp.i % 2); +class: even if (pp.i % 2)" id="post-{p.id}" width="100%" class="m{p.member_id} post" border="0" cellspacing="0" cellpadding="0" summary="post">
	<tbody>
		<tr>
			<td class="info" width="150">
				<div class="member">
					<div class="originator">{p.DisplayName}</div>
					<div class="member-number">{p.moniker}</div>
					<div class="join-date">{p.DateRegistered|localtime("F Y")}</div>
				</div>
				
				<mef:if expr="p.Avatar">
				<div class="avatar_{p.member_id}" align="center">
					<div class="avatar"><img src="//d1cxvcw9gjxu2x.cloudfront.net/avatars/80/{p.Avatar}" width="80" height="80" alt="avatar" mef:attributes="style: 'border: outset #999 1px;' if p.AvatarBorder" /></div>
				</div>
				</mef:if>
				<br />		
			</td>
		
			<td class="content">
				<div class="header">
					<span class="posted-on">
						<a mef:attributes="class: target if requested_post_id = p.id; name: target if requested_post_id = p.id" title="Right-click to copy the link location" href="/forums/thread/{p.thread_id}/{p.id}#target" onclick="return false;">Posted on {p.post_dt|localtime}</a><mef:if expr="USER_ID && p.revision_dt">, revised <a href="/forums/revision/{p.id}">{p.revision_dt|localtime}</a></mef:if></span>  
					<a href="/members/id/{p.member_id}"><mef:theme_image src="icon/view-profile.png" alt="View Profile" /></a>
					<a mef:if="p.can_edit" href="/forums/edit-post/{p.id}"><mef:theme_image src="icon/edit-post.png" alt="Edit Post" /></a>
					<mef:if expr="!thread.locked && admin_flag"><mef:theme_image src="icon/delete-post.png" alt="Delete Post" class="delete-post" /></mef:if>
					<mef:if expr="p.attachment"><a href="/files/download-attachment/?area=forum%20post&id={p.id}" class="attachment" target="_blank"><mef:theme_image src="icon/attachment.png" alt="Attachments" border="0" /></a></mef:if>
							
					<a mef:if="last_read_post_id = p.id" name="last_read"> </a>
				</div>
				<div style="margin-top: 0.5em;">
					{p.html|ppm}
					<div mef:if="p.ForumSignatureMockup" class="signature">{p.ForumSignatureMockup|ppm}</div>
				</div>
			</td>
		</tr>
	</tbody>
</table>
<div mef:if="pp.i + 1 < pp.size && last_read_post_id = p.id" class='break'></div>
</mef:loop>
<table mef:if="!USER_ID || USER_ID = 1" width="100%" border="0" cellspacing="0" cellpadding="8" summary="post" style="border-top: #fff solid 1px;">
	<tbody>
		<tr>
			<td align="center" style="background-color: #eee"><mef:ad type="linkbar" bgcolor="eeeeee" dots="false" width="728" height="15" /></td>
		</tr>
	</tbody>
</table>
</div>

<table id="bottom-navigation" width="100%" summary="bottom navigation">
	<tr>
		<td align="left" valign="top">
			<div mef:attributes="style: 'position: fixed; top: 4px; left: auto; right: 4px; z-index: 102' if settings.forum_header = 'compact'">
			<a mef:if="!ignored && !thread.locked && thread.last_poster_id != USER_ID" href="/forums/reply/{thread.id}"><mef:theme_image src="button/post-reply.png" alt="Post Reply" /></a>
			<mef:if expr="user_id">
			<a mef:if="!thread.bookmark_flag" href="/forums/bookmark/{thread.id}"><mef:theme_image src="button/bookmark.png" alt="Bookmark" /></a>
			<a mef:if="thread.bookmark_flag" href="/forums/remove-bookmark/{thread.id}"><mef:theme_image src="button/unbookmark.png" alt="Unbookmark" /></a>
			<mef:if expr="!thread.locked">
				<mef:if expr="thread.subscribe_flag">
				<mef:true><a href="/forums/subscription/{thread.id}/stop"><mef:theme_image src="button/unsubscribe.png" alt="Unsubscribe" /></a></mef:true>
				<mef:false><a href="/forums/subscription/{thread.id}/start"><mef:theme_image src="button/subscribe.png" alt="Subscribe" /></a></mef:false>
				</mef:if>
			</mef:if>
			<a mef:if="!thread.locked" href="/forums/send-to-top/{thread.id}"><mef:theme_image src="button/send-to-top.png" alt="Send to Top" /></a>
			<a href="/forums/hide-thread/{thread.id}" onclick="return confirm('This will hide the thread for you. Everyone else will still see it.\n\nPress OK if you still want to hide it.')"><mef:theme_image src="button/hide-thread.png" alt="Hide Thread" /></a>
			</mef:if>
			</div>
			<mef:if expr="admin_flag">
			<br /><br />
			<mef:if expr="!thread.locked">
				<mef:true><a href="/forums/close-thread/{thread.id}"><mef:theme_image src="button/close-thread.png" alt="Close Thread" /></a></mef:true>
				<mef:false><a href="/forums/open-thread/{thread.id}"><mef:theme_image src="button/open-thread.png" alt="Open Thread" /></a></mef:false>
			</mef:if>
			<a href="/forums/move-thread/{thread.id}">Move Thread</a>
			</mef:if>
		</td>
		<td align="right" valign="top">
			<mef:if expr="use_pages">{pages|replace("top","bottom")}<br /><br /></mef:if>
			<mef:include file="forums/select-board" default="{thread.board_id}" />
		</td>
	</tr>
</table>

<span id="quick-load" style="display: none;">{settings.quick_thread_flag}</span>

<div mef:if="show_quick_reply" id="div-quick-reply"><mef:include id="reply-{thread.id}" file="forums/post-box" action="reply" thread="{thread}" topic="{thread.topic}" post_to="/forums/reply/{thread.id}" body="" icon="" attachments_ok="{true}" /></div>