<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="xml" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
	<xsl:param name="message"/>
	<xsl:param name="pageTitle">CA</xsl:param>
	<xsl:include href="namedtemplates.xsl"/>
	<xsl:template match="/">
		<html>
			<head>
				<title>
					<xsl:value-of select="$web_title"/>
				</title>
				<xsl:call-template name="common_imports"/>
			</head>
			<body onload="window.defaultStatus=''; StartFloat();">
				<xsl:call-template name="initROPage">
					<xsl:with-param name="pageName">advca.py</xsl:with-param>
					<xsl:with-param name="message" select="$message"/>
				</xsl:call-template>
				<div id="displayresults">
					<h1 class="display">CA</h1>
					<div class="row">
						<div class="generalcell">
							<b>Adtec AES Decrypt:</b>
						</div>
						<div class="largegeneralcell">
							<xsl:value-of select="/configuration/ca[@index='1']/decrypt"/>
						</div>
					</div>
					<xsl:apply-templates mode="globalca"/>
					<xsl:apply-templates mode="portca"/>
				</div>
			</body>
		</html>
	</xsl:template>
	<!--CA content here -->
	<xsl:template match="/configuration/ca" mode="globalca">
		<div class="row">
			<hr size="1"/>
		</div>
		<div class="row">
			<div class="generalcell">
				<b>Enable <xsl:value-of select="@index"/>:</b>
			</div>
			<div class="largegeneralcell">
				<xsl:value-of select="enable"/>
			</div>
		</div>
		<xsl:choose>
			<xsl:when test="@index = '1' and enable = 'BISS1'">
				<xsl:for-each select="/configuration/ca_biss_keys/key">
					<div class="row">
						<div class="generalcell">
							<b>Key <xsl:value-of select="@index"/>:</b>
						</div>
						<div class="largegeneralcell">
							<xsl:value-of select="."/>
						</div>
					</div>
				</xsl:for-each>
			</xsl:when>
			<xsl:otherwise>
				<div class="row">
					<div class="generalcell">
						<b>Super CAS ID:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="super_cas_id"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>CAS System ID:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="cas_system_id"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>ECMG IP:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="ecmg/inet_addr"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>ECMG Port:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="ecmg/connection_port"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>ECMG Channel ID:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="ecmg/ecmg_channel_id"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>ECMG Crypto Period:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="ecmg/ecmg_crypto_period"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>ECMG Keep Alive:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="ecmg/ecmg_keep_alive"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>EMMG Mode:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="emmg/connection_mode"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>EMMG Port:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="emmg/connection_port"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>EMMG Maximum:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="emmg/max_bandwidth"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>EMMG PID:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="emmg/emm_pid_config"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>EMMG Data Channel ID:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="emmg/emmg_data_channel_id"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>EMMG Keep Alive:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="emmg/emmg_keep_alive"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>Private Data Length:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="private_data/@private_data_length"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
						<b>Private Data:</b>
					</div>
					<div class="largegeneralcell">
						<xsl:value-of select="private_data"/>
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
					</div>
					<div class="generalcell">
					</div>
				</div>
				<div class="row">
					<div class="generalcell">
					</div>
					<div class="generalcell">
					</div>
				</div>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<!--xsl:template match="/configuration/port" mode="portca">
			<div class="row">
			<div class="generalcell">
		<b>Port <xsl:value-of select="@index"/> Scramble All:</b></div>
					<div class="generalcell"><xsl:value-of select="ca/scramble_all"/></div>
		</div>
	</xsl:template-->
	<xsl:template match="text()" mode="portca"/>
	<xsl:template match="text()" mode="globalca">
	</xsl:template>
</xsl:stylesheet>
