<xsl:stylesheet version="1.0"
	xmlns:date="http://exslt.org/dates-and-times"
  xmlns:ebe="http://cks/ebemethods"
	xmlns:string="http://exslt.org/strings"
	xmlns:ms="urn:schemas-microsoft-com:xslt"
  xmlns:dt="urn:schemas-microsoft-com:datatypes"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  exclude-result-prefixes="date ebe string">
  <xsl:param name="IsBlogOwner" />
  <xsl:param name="RelativeUrl" />
  <xsl:param name="Language" />
  <xsl:param name="ShortDatePattern" />
  <xsl:param name="IsTechnoratiEnabled" />

  <xsl:output omit-xml-declaration="yes" />

	<xsl:template match="/">
		<!-- <xmp><xsl:copy-of select="."/></xmp> -->

		<xsl:apply-templates select="rows/row"/>
	</xsl:template>

	<xsl:template match="row">
	<br/>


		<div>

			<h3>
				<xsl:value-of select="Title"/>&#160;
				<xsl:if test="$IsBlogOwner = 'True'">
				<a href="/{substring-after(FileDirRef,'#')}/EditPost.aspx?ID={ID}">
					[<xsl:value-of select="ebe:res('EditPost')"/>]
				</a>
				</xsl:if>
				&#160;<xsl:value-of select="ebe:ExportPDF('themes/avista/images/exportPDF.gif', ID)" disable-output-escaping="yes" />
			</h3>
			<xsl:value-of select="ebe:res('Tags')"/>:
			<xsl:for-each select="string:split(CategoriesAsText, ';')">
				<a href="{ebe:createTagUrl(.)}" title="">
					<xsl:value-of select="."/>
				</a>
				<xsl:if test="position() != last()">, </xsl:if>
			</xsl:for-each>
			<xsl:if test="$IsTechnoratiEnabled = 'True'">
				<br/>
				<xsl:value-of select="ebe:res('TechnoratiTags')"/>:
				<xsl:for-each select="string:split(CategoriesAsText, ';')">
					<a href="http://technorati.com/tag/{.}" rel="tag">
						<xsl:value-of select="."/>
					</a>
					<xsl:if test="position() != last()">, </xsl:if>
				</xsl:for-each>
			</xsl:if>

			<br/><br/>
			<div class="blogcontent">
				<div class="entry">
					<xsl:value-of select="Body" disable-output-escaping="yes"/>
				</div>
				<div class="clear">&#160;</div>
			</div>
			<div class="bottompost-text">
				<xsl:value-of select="ebe:res('PostedBy')"/>&#160;
				<xsl:value-of select="substring-after(Author,'#')"/>&#160;
				<xsl:value-of select="ebe:res('PostedOn')"/>&#160;
				<xsl:variable name="publishedDate" select="date:parseDate(PublishedDate, 'yyyy-MM-dd HH:mm:ss')"/>
				<xsl:value-of select="ms:format-date($publishedDate, $ShortDatePattern, $Language)"/>
				<br/>
				<xsl:value-of select="NumComments"/>&#160;
				<xsl:choose>
					<xsl:when test="NumComments = 1">
						<xsl:value-of select="ebe:res('Comment')"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="ebe:res('Comments')"/>
					</xsl:otherwise>
				</xsl:choose>
				<!--&#160;|&#160; <a href="{$RelativeUrl}/_layouts/cks/ebe/Trackback.aspx?ID={ID}" rel="trackback"><xsl:value-of select="ebe:res('TrackbackUrl')"/></a>-->
				&#160;|&#160;<a href="{ebe:createPostUrl(PublishedDate, BlogTitleForUrl)}">
					<xsl:value-of select="NumLinkbacks"/>&#160;
					<xsl:choose>
						<xsl:when test="NumTrackbacks = 1">
							<xsl:value-of select="ebe:res('Trackback')"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="ebe:res('Trackbacks')"/>
						</xsl:otherwise>
					</xsl:choose>
				</a>
				| <xsl:value-of select="ebe:res('BookmarkPost')"/>: <span class="categories-post">
					<a href="http://del.icio.us/post?url={ebe:createAbsolutePostUrl(PublishedDate, BlogTitleForUrl)}&amp;title={Title}" title="Add to del.icio.us">
						<img src="{$RelativeUrl}/themes/avista/images/delicious.png" border="0"/>
					</a>
					&#160;
					<a href="http://digg.com/submit?phase=2&amp;url={ebe:createAbsolutePostUrl(PublishedDate, BlogTitleForUrl)}" title="Digg it">
						<img src="{$RelativeUrl}/themes/avista/images/digg.png" border="0"/>
					</a>
					&#160;
					<a href="http://technorati.com/cosmos/search.html?url={ebe:createAbsolutePostUrl(PublishedDate, BlogTitleForUrl)}" title="Technorati">
						<img src="{$RelativeUrl}/themes/avista/images/technorati.png" border="0"/>
					</a>
					&#160;
					<a href="http://www.facebook.com/share.php?u={ebe:createAbsolutePostUrl(PublishedDate, BlogTitleForUrl)}" title="Facebook">
						<img src="{$RelativeUrl}/themes/avista/images/facebook.gif" border="0"/>
					</a>
					&#160;
					<a href="http://reddit.com/submit?url={ebe:createAbsolutePostUrl(PublishedDate, BlogTitleForUrl)}&amp;title={Title}" title="Reddit">
						<img src="{$RelativeUrl}/themes/avista/images/reddit.png" border="0"/>
					</a>
					&#160;
					<a href="http://twitter.com/home/?status={ebe:createAbsolutePostUrl(PublishedDate, BlogTitleForUrl)}" title="Twitter">
						<img src="{$RelativeUrl}/themes/avista/images/twitter.png" border="0"/>
					</a>

				</span>
			</div>

		</div>
		<!-- close div content -->
		<div class="clear">&#160;</div>
	</xsl:template>

</xsl:stylesheet>
