<?xml version="1.0" encoding="Shift_JIS" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="_common.xsl"/>
<xsl:output method="html" version="4.01" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" encoding="Shift_JIS"/>
<xsl:strip-space elements="*" />
<xsl:param name="sort"/>
<xsl:param name="lang"/>
<xsl:variable name="prefix">ZZ_</xsl:variable>

<xsl:variable name="img_dir">../image/</xsl:variable>
<xsl:variable name="author">augustus</xsl:variable>
<xsl:variable name="target_frame"></xsl:variable>
<xsl:variable name="coin_desc">moneta.xml</xsl:variable>

<xsl:variable name="top">
	<xsl:choose>
        <xsl:when test="concat($lang,/doc/@lang)='e'">../other/e_topf.html</xsl:when>
        <xsl:otherwise>../</xsl:otherwise>
    </xsl:choose>
</xsl:variable>


<xsl:variable name="top_name">
	<xsl:choose>
        <xsl:when test="concat($lang,/doc/@lang)='e'">Ancient ROME</xsl:when>
        <xsl:otherwise>古代ローマ （ローマ帝国の歴史とコイン）</xsl:otherwise>
    </xsl:choose>
</xsl:variable>

<xsl:variable name="site_name">
	<xsl:choose>
        <xsl:when test="concat($lang,/doc/@lang)='e'">Ancient ROME</xsl:when>
        <xsl:otherwise>古代ローマ</xsl:otherwise>
    </xsl:choose>
</xsl:variable>

<xsl:template match="/doc">
<html>
<head>
<SCRIPT LANGUAGE='php'>
$a="<xsl:value-of select="item/name[@lang='e']"/>";
</SCRIPT>
<META HTTP-EQUIV="CONTENT-STYLE-TYPE" CONTENT="text/css"/>
<link rel="stylesheet" type="text/css" href="/style.css"/>
<link rel="Contents" href="{concat('ZF_', $sort, '_', $lang, '.html')}"/>
	<xsl:choose>
        <xsl:when test="concat($lang,/doc/@lang)='e'">
	        <title><xsl:value-of select="item/name[@lang='e']"/> @ Ancient ROME </title>
			<link rel="Start" title="{$site_name}" href="/" />
			<meta name='Keywords' content="{concat(item/name[@lang='e'],',Ancient ROME,Roman Empire,Coinage')}"/>
			<META name='description' content="{concat('Coinage of ', item/name[@lang='e'],' @ Ancient ROME')}"/>
			<META NAME="ROBOTS" CONTENT="NOARCHIVE"/>
        </xsl:when>
        <xsl:otherwise>
	        <title lang='ja'><xsl:value-of select="item/name[@lang='j']"/>@古代ローマ</title>
			<link rel="Start" title="{$site_name}" href="/" />
			<meta name='Keywords' content="{concat(item/name[@lang='j'],',',item/name[@lang='e'],',ローマ,歴史,ローマ史,ローマ皇帝,ローマ帝国,古代ローマ,コイン,ローマ皇帝')}"/>
			<META name='description' content="{concat('古代ローマ帝国の ',item/name[@lang='j'],' のコイン')}"/>
			<META NAME="ROBOTS" CONTENT="NOARCHIVE"/>
        </xsl:otherwise>
    </xsl:choose>
</head>
<body style="BACKGROUND-COLOR:#f0f0d0;BACKGROUND:url(../image/parts/back.jpg)">
	<xsl:apply-templates select="item"/>
</body>
</html>
</xsl:template>



<xsl:template name="url">
	<xsl:choose>
    	<xsl:when test="/doc/item/index[@sort=$sort and @dir='back']/@name!=''">
    		<xsl:choose>
    			<xsl:when test="$lang='e'">
					<a href="{concat($prefix, $sort,'_', $lang,'_',/doc/item/index[@sort=$sort and @dir='back']/@name,'.html')}"  title="{/doc/item/index[@sort=$sort and @dir='back']/@name}" >
						<img src="../image/parts/back.gif" alt="{/doc/item/index[@sort=$sort and @dir='back']/@name}" border='0'/>
					</a>
        		</xsl:when>
        		<xsl:otherwise>
					<a href="{concat($prefix, $sort,'_', $lang,'_',/doc/item/index[@sort=$sort and @dir='back']/@name,'.html')}"  title="{/doc/item/index[@sort=$sort and @dir='back']/@j_name}" >
						<img src="../image/parts/back.gif" alt="{/doc/item/index[@sort=$sort and @dir='back']/@j_name}" border='0'/>
					</a>
        		</xsl:otherwise>
        	</xsl:choose>
        </xsl:when>
        <xsl:otherwise><span class="hide"><img src="../image/parts/back.gif" /></span></xsl:otherwise>
    </xsl:choose>
   	<a href="{$top}"  target='_top' title="{$top_name}"><img src="../image/parts/top.gif" alt="{$top_name}" border="0"/></a>
	<xsl:choose>
    	<xsl:when test="/doc/item/index[@sort=$sort and @dir='next']/@name!=''">
    		<xsl:choose>
    			<xsl:when test="$lang='e'">
					<a href="{concat($prefix, $sort,'_', $lang,'_',/doc/item/index[@sort=$sort and @dir='next']/@name,'.html')}" title="{/doc/item/index[@sort=$sort and @dir='next']/@name}">
						<img src="../image/parts/next.gif" alt="{/doc/item/index[@sort=$sort and @dir='next']/@name}" border='0'/>
					</a>
        		</xsl:when>
        		<xsl:otherwise>
					<a href="{concat($prefix, $sort,'_', $lang,'_',/doc/item/index[@sort=$sort and @dir='next']/@name,'.html')}" title="{/doc/item/index[@sort=$sort and @dir='next']/@j_name}">
						<img src="../image/parts/next.gif" alt="{/doc/item/index[@sort=$sort and @dir='next']/@j_name}" border='0'/>
					</a>
        		</xsl:otherwise>
        	</xsl:choose>
        </xsl:when>
        <xsl:otherwise>
        	<span class="hide">
				<img src="../image/parts/next.gif" alt="{/doc/item/index[@sort=$sort and @dir='next']/@name}" border='0'/>
        	</span>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

<xsl:template match="item">
	<xsl:variable name="language"><xsl:value-of select="concat($lang, /doc/@lang)"/></xsl:variable>
	<xsl:choose>
    	<xsl:when test="@condex[.='hide']"/>
    	<xsl:otherwise>
			<xsl:call-template name="name"/>
            <div align="right"><xsl:call-template name="url"/></div>
            <xsl:apply-templates select="coin"/>
            <xsl:if test="$language='j'">
	        	<span class="desc"><xsl:apply-templates select="desc" /></span>
	        	<br clear="all"/>
            </xsl:if>
    	</xsl:otherwise>
   	</xsl:choose>
    <xsl:for-each select="item">
       	<br clear="all"/>
      	<div class="coinname">
        <a name="{@name}">
			<xsl:call-template name="name"/>
        </a>
       	</div>
        <xsl:apply-templates select="coin" />
         <xsl:if test="$language='j'">
	      	<span class="desc"><xsl:apply-templates select="desc" /></span>
	       	<br clear="all"/>
        </xsl:if>
    </xsl:for-each>
    <div style="text-align:center;font-size:x-small">
    		<br/>
        	<xsl:call-template name="url"/><br /><br/>
   			<a href="/" target="_top">
	            <img border="0" alt="{$top_name}" src="{concat($img_dir,'parts/logo_small2.gif')}"/><br/>
    	    <xsl:value-of select="$top_name"/>
    	    </a>
	</div>
</xsl:template>

<xsl:template name="name"> 
	<xsl:variable name="language"><xsl:value-of select="concat($lang, /doc/@lang)"/></xsl:variable>
	<h1 style="background-color:#003333;color:white;text-indent:0.5em;font-size:15pt; line-height:150%;">
    <xsl:value-of select="name[@lang=$language]" />
    <xsl:if test="when[@lang=$language]!=''">
         ( <xsl:value-of select="when[@lang=$language]"/> )
    </xsl:if>
    <xsl:apply-templates select="." mode="new_up"/>
    </h1>
</xsl:template>

<xsl:template match="coin">
    <xsl:variable name="large_img"><xsl:value-of select="concat('ZL_',/doc/@lang,$lang,'_',../@name,'_',@moneta,'.html')"/></xsl:variable>
	<xsl:if test="side/img[../@name='obv'][.!='']">
		<a href="{$large_img}"><img src="../image/parts/musimegane.gif" alt="+" border="0" /></a>
	</xsl:if>
	<table>
    <tr>
    	<xsl:for-each select="side">
		    <td>
            <a href="{concat($large_img,'#',@name)}">
            <xsl:if test="img[@size='s' and .!='']">
            <img width="200" align="left" border="0" src="{concat($img_dir,img[@size='s'])}" alt="{../img/@base} {@name}."/>
			</xsl:if>
            </a>
            </td>
        </xsl:for-each>
        <td>
        	<xsl:if test="denomination[.!='']">
        		<xsl:value-of select="denomination"/><br/>
        	</xsl:if>
            <xsl:if test="diameter[.!=''] or weight[.!='']">
                <xsl:value-of select="diameter"/>,
                <xsl:value-of select="weight"/>
        	    <br/>
            </xsl:if>
        	<xsl:if test="mint[.!=''] or struck[.!='']">
                <xsl:value-of select="struck"/>
        	    <xsl:if test="mint[.!='']">
                    , <xsl:value-of select="mint"/>
                </xsl:if>
                <br/>
        	</xsl:if>
        	<xsl:if test="text()!='' and $lang='j'">
                <xsl:value-of select="text()"/>
                <br/>
        	</xsl:if>
            <br/>
        </td>
    </tr>
	</table>  
    <br/>
</xsl:template>

<xsl:template match="item" mode="new_up">
        <xsl:if test="@condex[.='new']">
            <img src="{concat($img_dir,'parts/new.gif')}" align="absmiddle" hspace="2" alt="new"/>
        </xsl:if>
        <xsl:if test="@condex[.='up']">
            <img src="{concat($img_dir,'parts/up.gif')}" align="absmiddle" hspace="2" alt="up"/>
        </xsl:if>
</xsl:template>

<xsl:template match="*" mode="disp">
<xsl:if test=".!=''"><xsl:value-of select="."/>,</xsl:if>
</xsl:template>

<xsl:template match="desc">
	<xsl:apply-templates mode="desc"/>
</xsl:template>

<xsl:template match="*" mode="desc">
	<xsl:choose>
		<xsl:when test="name()='aa'">
			<xsl:choose>
				<xsl:when test="@href">
					<a href="{concat('ZZ_', $sort, '_', $lang, '_', @href, '.html')}" title="{@href}"><xsl:copy-of select="node()"/></a>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="node()"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:when>
		<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
	</xsl:choose>
</xsl:template>


</xsl:stylesheet>
