﻿<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>

<!--|| TEMPLATE : virus scan summary item ||-->
	<xsl:template match="data[@name='report_item_virus_summary']">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
			<thead>
				<tr>
					<td class="tableheader" colspan="4"><xsl:value-of select="$localization[@name=current()/@name]"/></td>
				</tr>
				<tr>
					<td class="grey"     width="25%"><xsl:value-of select="$localization[@name='activities']"/></td>
					<td class="grey"     width="25%" align="right"><xsl:value-of select="$localization[@name='frequency']"/></td>
					<td class="grey-end" width="25%" align="right"><xsl:value-of select="$localization[@name='percentage']"/></td>
					<td class="grey-end"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
				</tr>
			</thead>
			<tbody>                
				<tr>
					<td class="data2b"><xsl:value-of select="$localization[@name='total_message_count']"/></td>
					<td class="data2b" align="right"><xsl:value-of select="datarow/@total_message_count"/></td>
					<td class="data2"  align="right"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
					<td class="data2"></td>
				</tr>
				<tr>
					<td class="data2b"><xsl:value-of select="$localization[@name='total_viruses']"/></td>
					<td class="data2b" align="right"><xsl:value-of select="datarow/@virus_detected_count"/></td>
					<td class="data2"  align="right"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
					<td class="data2"></td>
				</tr>				 
				<tr>
					<td class="data1b"><xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
						<xsl:value-of select="$localization[@name='virus_uncleanable_count']"/></td>
					<td class="data1b" align="right"><xsl:value-of select="datarow/@virus_uncleanable_count"/></td>
					<td class="data1"  align="right">
						<xsl:call-template name="format_percentage">
							<xsl:with-param name="numerator" select="datarow/@virus_uncleanable_count"/>
							<xsl:with-param name="denominator" select="datarow/@virus_detected_count"/></xsl:call-template></td>
					<td class="data1"><xsl:value-of select="$localization[@name='of_total_viruses']"/></td>
				</tr>
                
                <tr>
					<td class="data2b"><xsl:value-of select="$localization[@name='spyware_detected_count']"/></td>
					<td class="data2b" align="right"><xsl:value-of select="datarow/@spyware_detected_count"/></td>
					<td class="data2"  align="right"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
					<td class="data2"></td>
				</tr>
			</tbody>
		</table>
	</xsl:template>

    <xsl:template match="data[@name='report_item_spyware_actions']">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
			<thead>
				<tr>
					<td class="tableheader" colspan="3"><xsl:value-of select="$localization[@name=current()/@name]"/></td>
				</tr>
				<tr>
					<td class="grey"     width="40%"><xsl:value-of select="$localization[@name='activities']"/></td>
					<td class="grey"     width="30%" align="right"><xsl:value-of select="$localization[@name='frequency']"/></td>
					<td class="grey-end" width="30%" align="right"><xsl:value-of select="$localization[@name='percentage']"/></td>
				</tr>
			</thead>
			<tbody>
				<xsl:variable name="total_spyware_count" select="sum(./datarow//@spyware_count)"/>
				<xsl:for-each select="datarow">
					<xsl:variable name="col-style">
						<xsl:if test="position() mod 2 = 1">data1</xsl:if>
						<xsl:if test="position() mod 2 = 0">data2</xsl:if>
					</xsl:variable>
					<tr>
						<td>
							<xsl:attribute name="class"><xsl:value-of select="$col-style"/>b</xsl:attribute>
							<xsl:value-of select="$actions[@id=current()/@spyware_action]"/>
						</td>
						<td align="right">
							<xsl:attribute name="class"><xsl:value-of select="$col-style"/>b</xsl:attribute>
							<xsl:call-template name="format_int_number">
								<xsl:with-param name="num" select="@spyware_count"/>
							</xsl:call-template>
						</td>
						<td align="right">
							<xsl:attribute name="class"><xsl:value-of select="$col-style"/>b</xsl:attribute>
							<xsl:call-template name="format_percentage">
								<xsl:with-param name="numerator" select="@spyware_count"/>
								<xsl:with-param name="denominator" select="$total_spyware_count"/>
							</xsl:call-template>
						</td>
					</tr>
				</xsl:for-each>
			</tbody>
		</table>
	</xsl:template>

<!--|| TEMPLATE : virus action item ||-->
	<xsl:template match="data[@name='report_item_virus_actions']">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
			<thead>
				<tr>
					<td class="tableheader" colspan="3"><xsl:value-of select="$localization[@name=current()/@name]"/></td>
				</tr>
				<tr>
					<td class="grey"     width="40%"><xsl:value-of select="$localization[@name='activities']"/></td>
					<td class="grey"     width="30%" align="right"><xsl:value-of select="$localization[@name='frequency']"/></td>
					<td class="grey-end" width="30%" align="right"><xsl:value-of select="$localization[@name='percentage']"/></td>
				</tr>
			</thead>
			<tbody>
				<xsl:variable name="total_count" select="sum(./datarow//@virus_count)"/>
				<xsl:for-each select="datarow">
					<xsl:variable name="col-style">
						<xsl:if test="position() mod 2 = 1">data1</xsl:if>
						<xsl:if test="position() mod 2 = 0">data2</xsl:if>
					</xsl:variable>
					<tr>
						<td>
							<xsl:attribute name="class"><xsl:value-of select="$col-style"/>b</xsl:attribute>
							<xsl:value-of select="$actions[@id=current()/@virus_action]"/>
						</td>
						<td align="right">
							<xsl:attribute name="class"><xsl:value-of select="$col-style"/>b</xsl:attribute>
							<xsl:call-template name="format_int_number">
								<xsl:with-param name="num" select="@virus_count"/>
							</xsl:call-template>
						</td>
						<td align="right">
							<xsl:attribute name="class"><xsl:value-of select="$col-style"/>b</xsl:attribute>
							<xsl:call-template name="format_percentage">
								<xsl:with-param name="numerator" select="@virus_count"/>
								<xsl:with-param name="denominator" select="$total_count"/>
							</xsl:call-template>
						</td>
					</tr>
				</xsl:for-each>
			</tbody>
		</table>
	</xsl:template>


<!--|| TEMPLATE : virus types item ||-->
	<xsl:template match="data[@name='report_item_virus_types']">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
			<thead>
				<tr>
					<td class="tableheader" colspan="4"><xsl:value-of select="$localization[@name=current()/@name]"/></td>
				</tr>
				<tr>
					<td class="grey"     width="40%"><xsl:value-of select="$localization[@name='virus_type']"/></td>
					<td class="grey"     width="30%" align="right"><xsl:value-of select="$localization[@name='frequency']"/></td>
					<td class="grey-end" width="30%" align="right"><xsl:value-of select="$localization[@name='percentage']"/></td>
				</tr>
			</thead>
			<tbody>
				<xsl:variable name="total_count" select="sum(./datarow//@virus_count)"/>
				<xsl:for-each select="datarow">
					<xsl:variable name="col-style">
						<xsl:if test="position() mod 2 = 1">data1</xsl:if>
						<xsl:if test="position() mod 2 = 0">data2</xsl:if>
					</xsl:variable>
					<tr>
						<td>
							<xsl:attribute name="class"><xsl:value-of select="$col-style"/>b</xsl:attribute>
							<xsl:value-of select="$virus_type[@name=concat('virus_type_', current()/@virus_type)]"/>
						</td>
						<td align="right">
							<xsl:attribute name="class"><xsl:value-of select="$col-style"/>b</xsl:attribute>
							<xsl:call-template name="format_float_number">
								<xsl:with-param name="num" select="@virus_count"/>
							</xsl:call-template>
						</td>
						<td align="right">
							<xsl:attribute name="class"><xsl:value-of select="$col-style"/>b</xsl:attribute>
							<xsl:call-template name="format_percentage">
								<xsl:with-param name="numerator" select="@virus_count"/>
								<xsl:with-param name="denominator" select="$total_count"/>
							</xsl:call-template>
						</td>
					</tr>
				</xsl:for-each>
			</tbody>
		</table>
	</xsl:template>


</xsl:stylesheet>
