<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<xsl:output method="html" omit-xml-declaration="yes" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" xmlns:dc="http://purl.org/dc/elements/1.1/" />
	<xsl:variable name="title" select="/rss/channel/title"/>
	<xsl:variable name="url_syndic" select="/rss/channel/atom10:link[@rel='self']/@href" xmlns:atom10="http://www.w3.org/2005/Atom"/>
		
	<xsl:template match="/">
		<xsl:element name="html">
			<head>
			<title><xsl:value-of select="$title"/></title>
			
			<xsl:element name="link">
				<xsl:attribute name="rel">stylesheet</xsl:attribute>
				<xsl:attribute name="type">text/css</xsl:attribute>
				<xsl:attribute name="href">http://www.wmaker.net/_xml/style.css</xsl:attribute>
			</xsl:element>			

			<xsl:element name="link">
				<xsl:attribute name="rel">stylesheet</xsl:attribute>
				<xsl:attribute name="type">text/css</xsl:attribute>
				<xsl:attribute name="href">http://www.wmaker.net/_xml/orange.css</xsl:attribute>
			</xsl:element>	
			
			<xsl:element name="link">
				<xsl:attribute name="rel">alternate</xsl:attribute>
				<xsl:attribute name="type">application/rss+xml</xsl:attribute>
				<xsl:attribute name="title">RSS</xsl:attribute>
				<xsl:attribute name="href"><xsl:value-of select="$url_syndic"/></xsl:attribute>
			</xsl:element>	
																	
			<xsl:element name="script">
				<xsl:attribute name="type">text/javascript</xsl:attribute>
				<xsl:attribute name="src">http://www.wmaker.net/_xml/disableOutputEscaping.js</xsl:attribute>
			</xsl:element>
			</head>
			<xsl:apply-templates select="rss/channel" />
		</xsl:element>
	</xsl:template>
	
	<xsl:template match="channel">
		<body onload="go_decoding();">
			<div id="cometestme" style="display:none;">
				<xsl:text disable-output-escaping="yes">&amp;amp;</xsl:text>
			</div>
		
			<div id="main">
				<div id="main_inner">

					<div id="z_col0">
						 <div class="z_col0_inner">
						 	<div id="top">
								<h1 class="title"><a href="{link}"><xsl:value-of select="$title"/></a></h1>
								<h2 class="subtitle"><xsl:value-of select="description"/></h2>
							</div>
						 </div>
					</div>

					<div id="z_col1">
						<div class="z_col1_inner">
							<div id="content">
								<ul class="list_items">
									<xsl:apply-templates select="item"/>
								</ul>
							</div>
						 </div>
					</div>								
	
					<div id="z_col100">
						<div class="z_col100_inner">
							<div id="footer">
								<div class="bouton">
									<a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url={$url_syndic}"><img src="http://www.wmaker.net/_xml/images/addgator.gif" class="image" alt="Add to Gator" /></a>
									<xsl:text> </xsl:text>
									<a href="http://fusion.google.com/add?feedurl={$url_syndic}"><img src="http://www.wmaker.net/_xml/images/addgoogle.gif" class="image" alt="Add to Google" /></a>
									<xsl:text> </xsl:text>
									<a href="http://www.rojo.com/add-subscription?resource={$url_syndic}"><img src="http://www.wmaker.net/_xml/images/addrojo.gif" class="image" alt="Add to Rojo" /></a>
									<xsl:text> </xsl:text>
									<a href="http://add.my.yahoo.com/rss?url={$url_syndic}"><img src="http://www.wmaker.net/_xml/images/addyahoo.gif" class="image" alt="Add to Yahoo" /></a>
									<xsl:text> </xsl:text>
									<a href="http://www.bloglines.com/sub/{$url_syndic}"><img src="http://www.wmaker.net/_xml/images/addbloglines.gif" class="image" alt="Add to Bloglines" /></a>
									<xsl:text> </xsl:text>
									<a href="http://www.netvibes.com/subscribe.php?url={$url_syndic}"><img src="http://www.wmaker.net/_xml/images/addnetvibes.gif" class="image" alt="Add to Netvibes" /></a>
								</div>
							</div>
						</div>
					</div>
				</div>			
			</div>
		</body>
	</xsl:template>
	
	<xsl:template match="item">
		<li class="item">	
			<h3 class="title">
				<a href="{link}">
					<!-- <img src="/_theme/images/before_item.gif" alt="" class="before_after"/> -->
					<xsl:value-of select="substring(title, 1, 85)" disable-output-escaping="yes" />
					<!-- <img src="/_theme/images/after_item.gif" alt="" class="before_after"/> -->
				</a>
				<span class="after">&#160;</span>
			</h3>
			
			<div class="date">
				<xsl:value-of select="substring(pubDate,5)"/>
			</div>
			
			<h4 class="author">
				<xsl:choose>
					<xsl:when test="dc:creator != ''">
						<xsl:choose>
							<xsl:when test="author != ''">
								<a href="mailto:{author}"><xsl:value-of select="dc:creator"/></a>
							</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="dc:creator"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:when>
					<xsl:otherwise>
						<xsl:if test="author != ''">
							<a href="mailto:{author}"><xsl:value-of select="author"/></a>
						</xsl:if>
					</xsl:otherwise>
				</xsl:choose>
				
				<xsl:if test="(dc:creator != '' or author != '') and (category != '' or dc:subject != '')">
					<xsl:text> - </xsl:text>
				</xsl:if>
				
				<xsl:choose>
					<xsl:when test="category != ''">
						<xsl:choose>
							<xsl:when test="category/@domain != ''">
								<a href="{category/@domain}"><xsl:value-of select="category"/></a>
							</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="category"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="dc:subject"/>
					</xsl:otherwise>
				</xsl:choose>
			</h4>

			<xsl:apply-templates select="enclosure"/>
				
			<div class="text" name="decodeable">
				<xsl:call-template name="contenu"/>
			</div>
		</li>
	
	</xsl:template>
	
	<xsl:template match="enclosure">
		<br />
		<xsl:variable name="type_media" select="substring-before(@type, '/')"/>

		<xsl:choose>
			<xsl:when test="$type_media = 'audio'">		
				<xsl:element name="object">
					<xsl:attribute name="type">application/x-shockwave-flash</xsl:attribute>
					<xsl:attribute name="height">20</xsl:attribute>
					<xsl:attribute name="width">200</xsl:attribute>
					<xsl:attribute name="data">http://www.wmaker.net/dewplayer.swf?son=<xsl:value-of select="@url" /></xsl:attribute>
					<xsl:element name="param">
						<xsl:attribute name="name">movie</xsl:attribute>
						<xsl:attribute name="value">
							http://www.wmaker.net/dewplayer.swf?son=<xsl:value-of select="@url" />
						</xsl:attribute>
					</xsl:element>
				</xsl:element>	
				<a href="{@url}">
					<xsl:element name="img">
						<xsl:attribute name="class">image</xsl:attribute>
						<xsl:attribute name="src">http://www.wmaker.net/_images/icones/podcast.gif</xsl:attribute>
						<xsl:attribute name="alt"><xsl:value-of select='format-number(number(@length div "1024000"),"0.0")'/> Mo</xsl:attribute>
					</xsl:element>
				</a>
			</xsl:when>	
				
			<xsl:otherwise>
				<div class="center">
				<xsl:element name="object">
					<xsl:attribute name="height">280</xsl:attribute>
					<xsl:attribute name="width">320</xsl:attribute>
					<xsl:attribute name="align">middle</xsl:attribute>

											
					<xsl:element name="param">
						<xsl:attribute name="name">filename</xsl:attribute>
						<xsl:attribute name="value"><xsl:value-of select="@url" /></xsl:attribute>
					</xsl:element>
					<xsl:element name="embed">
						<xsl:attribute name="type">@type</xsl:attribute>
						<xsl:attribute name="src"><xsl:value-of select="@url" /></xsl:attribute>
						<xsl:attribute name="align">middle</xsl:attribute>
						<xsl:attribute name="height">280</xsl:attribute>
						<xsl:attribute name="width">320</xsl:attribute>
						<xsl:attribute name="showstatusbar">true</xsl:attribute>
						<xsl:attribute name="defaultframe">rightFrame</xsl:attribute>
						<xsl:attribute name="autostart">false</xsl:attribute>
						<xsl:attribute name="loop">false</xsl:attribute>
					</xsl:element>					
				</xsl:element>	

				</div>
			</xsl:otherwise>	
		</xsl:choose>	
	</xsl:template>
	
	<xsl:template match="image">
		<a href="{link}">
			<xsl:element name="img" namespace="http://www.w3.org/1999/xhtml">
				<xsl:attribute name="src">
					<xsl:value-of select="url"/>
				</xsl:attribute>
				<xsl:attribute name="alt">Link to <xsl:value-of select="title"/></xsl:attribute>
				<xsl:attribute name="id">feedimage</xsl:attribute>
			</xsl:element>
		</a>
		
		<xsl:text/>
	</xsl:template>
	
	<xsl:template name="contenu">
		<xsl:if test="description">
			<xsl:value-of select="description" disable-output-escaping="yes"/>
		</xsl:if>
		<xsl:if xmlns:content="http://purl.org/rss/1.0/modules/content/" test="content:encoded">
			<xsl:value-of select="content:encoded" disable-output-escaping="yes"/>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>
