<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<!-- Map Viewer (Third Edition) by Howie Sternberg at howies@snet.net. Map Viewer is placed in the public domain and is "Freeware". Map Viewer may be freely used and redistributed, is provided "AS-IS" without warranty of any kind, and there is no technical support provided. --> 

<!-- input parameters and defauts --> 
<xsl:param name="servicetype" select="imagemapserver"/>
<xsl:param name="imagewidth" select="400"/>
<xsl:param name="imageheight" select="350"/>
<xsl:param name="imagepreserveview" select="'true'"/>
<xsl:param name="navigatemaxscale" select="24000"/>
<xsl:param name="featuremaxscale" select="24000"/>
<xsl:param name="featureminmax" select="'true'"/>
<xsl:param name="featurelimitlist" select="'25'"/>
<xsl:param name="featurecolor" select="'0,255,255'"/>
<xsl:param name="featurepointtype" select="circle"/>
<xsl:param name="featurepointwidth" select="12"/>
<xsl:param name="featurelinetype" select="solid"/>
<xsl:param name="featurelinewidth" select="3"/>
<xsl:param name="featurepolygonboundary" select="'true'"/>
<xsl:param name="featurepolygonfilltype" select="'solid'"/>
<xsl:param name="featurepolygonfilltransparency" select="1.0"/>
<xsl:param name="labeltextfontcolor" select="'0,0,0'"/>
<xsl:param name="labeltextfont" select="'Arial'"/>
<xsl:param name="labeltextfontstyle" select="'regular'"/>
<xsl:param name="labeltextfontsize" select="10"/>
<xsl:param name="labeltextprintmode" select="'none'"/>
<xsl:param name="labelhowmany" select="'One_label_per_shape'"/>
<xsl:param name="labelminmax" select="'false'"/>
<xsl:param name="panfactor" select="0.75"/>
<xsl:param name="zoomfactor" select="2"/>
<xsl:param name="scalebarunits" select="'kilometers'"/>
<xsl:param name="screenwidthinch" select="12"/>
<xsl:param name="scaleappliestoprint" select="'true'"/>

<!-- Return current map properties as HTML -->
<xsl:template match="/">
	<tr><td class="mv_r"><a href="Javascript:setMapProperties()">Set Map Properties</a></td></tr>
	<tr><td><xsl:call-template name="map-size-properties"/></td></tr>
	<tr><td><xsl:apply-templates select="mapviewer/properties/mapscale/appliestoprintedmap"/></td></tr>
	<tr><td><xsl:apply-templates select="mapviewer/properties/navigate/maxscale"/></td></tr>
	<tr><td><xsl:apply-templates select="mapviewer/properties/feature/maxscale"/></td></tr>
	<!-- Only include feature and label properties if imagemapserver. Can't do this with arcmapserver. -->
	<xsl:if test="$servicetype = 'imagemapserver'">	
		<tr><td><xsl:call-template name="feature-properties"/></td></tr>
		<tr><td><xsl:call-template name="label-properties"/></td></tr>
	</xsl:if>	
	<tr><td><xsl:apply-templates select="mapviewer/properties/panfactor"/></td></tr>
	<tr><td><xsl:apply-templates select="mapviewer/properties/zoomfactor"/></td></tr>
	<tr><td><xsl:apply-templates select="mapviewer/properties/scalebarunits"/></td></tr>
</xsl:template>

<xsl:template name="map-size-properties">
	<table class="mv_block" width="100%" cellpadding="0" cellspacing="0">
	<tr><th class="mv_block_title" colspan="4">Map</th></tr>	
	<tr><td><xsl:apply-templates select="mapviewer/properties/image"/></td></tr>	
	<tr><td><xsl:apply-templates select="mapviewer/properties/image/preserveview"/></td></tr>	
	</table>
</xsl:template>

<xsl:template name="feature-properties">
	<table class="mv_block" width="100%" cellpadding="0" cellspacing="0">
	<tr><th class="mv_block_title" colspan="4"><xsl:value-of select="mapviewer/properties/feature/@label"/></th></tr>	
	<tr><td><xsl:apply-templates select="mapviewer/properties/feature/pointsymbol"/></td>
	<td rowspan="4" width="20%"><xsl:apply-templates select="mapviewer/properties/feature/color"/></td></tr>
	<tr><td><xsl:apply-templates select="mapviewer/properties/feature/linesymbol"/></td></tr>
	<tr><td><xsl:apply-templates select="mapviewer/properties/feature/polygonsymbol"/></td></tr>
	<tr><td><xsl:apply-templates select="mapviewer/properties/feature/limitlist"/></td></tr>
	<tr><td><xsl:apply-templates select="mapviewer/properties/feature/minmax"/></td></tr>	
	</table>
</xsl:template>

<xsl:template name="label-properties">	
	<table class="mv_block" width="100%" cellpadding="0" cellspacing="0">
	<tr><th class="mv_block_title" colspan="4"><xsl:value-of select="mapviewer/properties/label/@label"/></th></tr>	
	<tr><td><xsl:apply-templates select="mapviewer/properties/label/textsymbol"/></td>
	<td rowspan="3" width="20%"><xsl:apply-templates select="mapviewer/properties/label/textsymbol/fontcolor"/></td></tr>
	<tr><td><xsl:apply-templates select="mapviewer/properties/label/minmax"/></td></tr>
	<tr><td><xsl:apply-templates select="mapviewer/properties/label/howmany"/></td></tr>
	</table>
</xsl:template>

<xsl:template match="mapviewer/properties/mapscale/appliestoprintedmap">
	<table class="mv_block" width="100%" cellpadding="0" cellspacing="0">
	<tr><th class="mv_block_title"><xsl:value-of select="@label"/></th></tr>
	<tr><td><table border="0" cellpadding="2" cellspacing="2">
	<tr><td colspan="2"><xsl:value-of select="@description"/></td></tr>
	<xsl:for-each select="option">
		<tr><td>
		<xsl:variable name="theValue">
			<xsl:value-of select="@value"/>
		</xsl:variable>
		<xsl:variable name="theLabel">
			<xsl:value-of select="@label"/>
		</xsl:variable>
		<xsl:choose>
		<xsl:when test="$scaleappliestoprint = $theValue">			
			<input type="radio" name="propertymapscaleappliestoprint" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertymapscaleappliestoprint" value="{$theValue}"/><xsl:value-of select="$theLabel"/>
		</xsl:otherwise>
		</xsl:choose>
		<xsl:if test="'false' = $theValue">	
			Screen width is <input type="text" id="screenwidthinchid" name="propertyscreenwidthinch" value="{$screenwidthinch}" size="4"/> inches.
		</xsl:if>
		</td></tr>
	</xsl:for-each>
	</table></td></tr></table>
</xsl:template>

<xsl:template match="mapviewer/properties/image">
	<table width="100%" border="0" cellpadding="2" cellspacing="4">
	<tr><th class="mv_block_subtitle" colspan="4"><xsl:value-of select="@label"/></th></tr>
	<xsl:for-each select="size">
	<tr><td class="b"><xsl:value-of select="@label"/></td>
	<xsl:for-each select="option">
		<xsl:variable name="theWidth">
			<xsl:value-of select="@width"/>
		</xsl:variable>
		<xsl:variable name="theHeight">
			<xsl:value-of select="@height"/>
		</xsl:variable>
		<xsl:variable name="theValue">
			<xsl:value-of select="@value"/>
		</xsl:variable>		
		<xsl:choose>
			<xsl:when test="$imagewidth = $theWidth and $imageheight = $theHeight">		
				<td><input type="radio" name="propertyimgsize" value="{$theWidth},{$theHeight}" checked="checked"/><xsl:value-of select="@width"/><text> x </text><xsl:value-of select="@height"/></td>
			</xsl:when>
			<xsl:otherwise>
				<td><input type="radio" name="propertyimgsize" value="{$theWidth},{$theHeight}"/><xsl:value-of select="@width"/><text> x </text><xsl:value-of select="@height"/></td>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:for-each>
	</tr>
	</xsl:for-each>
	</table>
</xsl:template>

<xsl:template match="mapviewer/properties/image/preserveview">
	<table width="100%" border="0" cellpadding="2" cellspacing="4">
	<tr><th class="mv_block_subtitle"><xsl:value-of select="@label"/></th></tr>
	<xsl:for-each select="option">
		<xsl:sort select="@value" order="descending" data-type="text"/>
			<xsl:variable name="theValue">
				<xsl:value-of select="@value"/>
			</xsl:variable>
			<xsl:variable name="theLabel">
				<xsl:value-of select="@label"/>
			</xsl:variable>
			<xsl:choose>
				<xsl:when test="$imagepreserveview = $theValue">			
					<tr><td><input type="radio" name="propertyimgpreserveview" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/></td></tr>
				</xsl:when>
				<xsl:otherwise>
					<tr><td><input type="radio" name="propertyimgpreserveview" value="{$theValue}"/><xsl:value-of select="$theLabel"/></td></tr>
				</xsl:otherwise>
			</xsl:choose>	
	</xsl:for-each>
	</table>
</xsl:template>

<xsl:template match="mapviewer/properties/navigate/maxscale">
	<table class="mv_block" width="100%" cellpadding="0" cellspacing="0">
	<tr><th class="mv_block_title"><xsl:value-of select="@label"/></th></tr>
	<tr><td><table border="0" cellpadding="2" cellspacing="2">
	<tr><td colspan="2"><xsl:value-of select="@description"/></td></tr>
	<tr><td>
	<xsl:for-each select="option">
		<xsl:variable name="theValue">
			<xsl:value-of select="@value"/>
		</xsl:variable>
		<xsl:variable name="theLabel">
			<xsl:value-of select="@label"/>
		</xsl:variable>
		<xsl:choose>
		<xsl:when test="$navigatemaxscale = $theValue">			
			<input type="radio" name="propertynavigatemaxscale" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertynavigatemaxscale" value="{$theValue}"/><xsl:value-of select="$theLabel"/>
		</xsl:otherwise>
		</xsl:choose>
	</xsl:for-each>
	</td></tr></table></td></tr></table>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/maxscale">
	<table class="mv_block" width="100%" cellpadding="0" cellspacing="0">
	<tr><th class="mv_block_title"><xsl:value-of select="@label"/></th></tr>
	<tr><td><table border="0" cellpadding="2" cellspacing="2">
	<tr><td colspan="2"><xsl:value-of select="@description"/></td></tr>
	<tr><td>
	<xsl:for-each select="option">
		<xsl:variable name="theValue">
			<xsl:value-of select="@value"/>
		</xsl:variable>
		<xsl:variable name="theLabel">
			<xsl:value-of select="@label"/>
		</xsl:variable>
		<xsl:choose>
		<xsl:when test="$featuremaxscale = $theValue">			
			<input type="radio" name="propertyfeaturemaxscale" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertyfeaturemaxscale" value="{$theValue}"/><xsl:value-of select="$theLabel"/>
		</xsl:otherwise>
		</xsl:choose>
	</xsl:for-each>
	</td></tr></table></td></tr></table>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/color">
<table width="100%" align="left" border="0" cellpadding="2" cellspacing="4">
<tr><th class="mv_block_subtitle" colspan="2"><xsl:value-of select="@label"/></th></tr>
<xsl:for-each select="option">
<xsl:sort select="@label" order="ascending" data-type="text"/>
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<tr><td class="cc"><img src="images/transparent.gif" border="0" width="12" height="12" alt="{$theLabel}" style="background:rgb({$theValue})"/></td>
	<xsl:choose>
		<xsl:when test="$featurecolor = $theValue">			
			<td><input type="radio" name="propertyfeaturecolor" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/></td>
		</xsl:when>
		<xsl:otherwise>
			<td><input type="radio" name="propertyfeaturecolor" value="{$theValue}"/><xsl:value-of select="$theLabel"/></td>	
		</xsl:otherwise>
	</xsl:choose>
	</tr>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/pointsymbol">
<table width="100%" align="left" border="0" cellpadding="2" cellspacing="4">
<tr><th  class="mv_block_subtitle" colspan="2"><img src="images/layerpoint.jpg" border="0" alt="point data" width="15" heigth="13"/><xsl:value-of select="@label"/></th></tr>
<tr><td class="mv_cb"><xsl:value-of select="type/@label"/></td><td>
<xsl:for-each select="type/option">
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$featurepointtype = $theValue">			
			<input type="radio" name="propertyfeaturepointtype" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertyfeaturepointtype" value="{$theValue}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
<tr><td class="mv_cb"><xsl:value-of select="width/@label"/></td><td>
<xsl:for-each select="width/option">
	<xsl:variable name="theValue2">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$featurepointwidth = $theValue2">			
			<input type="radio" name="propertyfeaturepointwidth" value="{$theValue2}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertyfeaturepointwidth" value="{$theValue2}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
</table>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/linesymbol">
<table width="100%" align="left" border="0" cellpadding="2" cellspacing="4">
<tr><th class="mv_block_subtitle" colspan="2"><img src="images/layerline.jpg" border="0" alt="line data" width="15" heigth="13"/><xsl:value-of select="@label"/></th></tr>
<tr><td class="mv_cb"><xsl:value-of select="type/@label"/></td><td>
<xsl:for-each select="type/option">
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$featurelinetype = $theValue">			
			<input type="radio" name="propertyfeaturelinetype" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertyfeaturelinetype" value="{$theValue}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
<tr><td class="mv_cb"><xsl:value-of select="width/@label"/></td><td>
<xsl:for-each select="width/option">
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$featurelinewidth = $theValue">			
			<input type="radio" name="propertyfeaturelinewidth" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertyfeaturelinewidth" value="{$theValue}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
</table>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/polygonsymbol">
<table width="100%" align="left" border="0" cellpadding="2" cellspacing="4">
<tr><th class="mv_block_subtitle" colspan="2"><img src="images/layerpolygon.jpg" border="0" alt="polygon data" width="15" heigth="13"/><xsl:value-of select="@label"/></th></tr>
<tr><td class="mv_cb"><xsl:value-of select="boundary/@label"/></td><td>
<xsl:for-each select="boundary/option">
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$featurepolygonboundary = $theValue">			
			<input type="radio" name="propertyfeaturepolygonboundary" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertyfeaturepolygonboundary" value="{$theValue}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
<tr><td class="mv_cb"><xsl:value-of select="filltype/@label"/></td><td>
<xsl:for-each select="filltype/option">
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$featurepolygonfilltype = $theValue">			
			<input type="radio" name="propertyfeaturepolygonfilltype" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertyfeaturepolygonfilltype" value="{$theValue}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
<tr><td class="mv_cb"><xsl:value-of select="filltransparency/@label"/></td><td>
<xsl:for-each select="filltransparency/option">
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$featurepolygonfilltransparency = $theValue">			
			<input type="radio" name="propertyfeaturepolygonfilltransparency" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertyfeaturepolygonfilltransparency" value="{$theValue}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
</table>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/limitlist">
<table width="100%" align="left" border="0" cellpadding="2" cellspacing="4">
<tr><th class="mv_block_subtitle" colspan="2"><img src="images/table.jpg" border="0" width="15" height="13" alt="Data Table"/><xsl:value-of select="@label"/></th></tr>
<tr><td class="mv_cb"><xsl:value-of select="@description"/></td><td>
<xsl:for-each select="option">
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$featurelimitlist = $theValue">			
			<input type="radio" name="propertyfeaturelimitlist" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertyfeaturelimitlist" value="{$theValue}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
</table>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/minmax">
<table width="100%" align="left" border="0" cellpadding="2" cellspacing="4">
<tr><th class="mv_block_subtitle"><xsl:value-of select="@label"/></th></tr>
<xsl:for-each select="option">
<xsl:sort select="@value" order="descending" data-type="text"/>
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$featureminmax = $theValue">			
			<tr><td><input type="radio" name="propertyfeatureminmax" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/></td></tr>
		</xsl:when>
		<xsl:otherwise>
			<tr><td><input type="radio" name="propertyfeatureminmax" value="{$theValue}"/><xsl:value-of select="$theLabel"/></td></tr>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</table>
</xsl:template>

<xsl:template match="mapviewer/properties/label/textsymbol/fontcolor">
<table width="100%" align="left" border="0" cellpadding="2" cellspacing="4">
<tr><th class="mv_block_subtitle" colspan="2"><xsl:value-of select="@label"/></th></tr>
<xsl:for-each select="option">
<xsl:sort select="@label" order="ascending" data-type="text"/>
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<tr><td class="mv_cc"><img src="images/transparent.gif" border="0" width="12" height="12" alt="{$theLabel}" style="background:rgb({$theValue})"/></td>
	<xsl:choose>
		<xsl:when test="$labeltextfontcolor = $theValue">			
			<td><input type="radio" name="propertylabeltextfontcolor" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/></td>
		</xsl:when>
		<xsl:otherwise>
			<td><input type="radio" name="propertylabeltextfontcolor" value="{$theValue}"/><xsl:value-of select="$theLabel"/></td>	
		</xsl:otherwise>
	</xsl:choose>
	</tr>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template match="mapviewer/properties/label/textsymbol">
<table width="100%" align="left" border="0" cellpadding="2" cellspacing="4">
<tr><th class="mv_block_subtitle" colspan="2"><xsl:value-of select="@label"/></th></tr>
<tr><td class="mv_cb"><xsl:value-of select="font/@label"/></td><td>
<xsl:for-each select="font/option">
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$labeltextfont = $theValue">			
			<input type="radio" name="propertylabeltextfont" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertylabeltextfont" value="{$theValue}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
<tr><td class="mv_cb"><xsl:value-of select="fontstyle/@label"/></td><td>
<xsl:for-each select="fontstyle/option">
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$labeltextfontstyle = $theValue">			
			<input type="radio" name="propertylabeltextfontstyle" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertylabeltextfontstyle" value="{$theValue}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
<tr><td class="mv_cb"><xsl:value-of select="fontsize/@label"/></td><td>
<xsl:for-each select="fontsize/option">
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$labeltextfontsize = $theValue">			
			<input type="radio" name="propertylabeltextfontsize" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertylabeltextfontsize" value="{$theValue}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
<tr><td class="mv_cb"><xsl:value-of select="printmode/@label"/></td><td>
<xsl:for-each select="printmode/option">
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$labeltextprintmode = $theValue">			
			<input type="radio" name="propertylabeltextprintmode" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertylabeltextprintmode" value="{$theValue}"/><xsl:value-of select="$theLabel"/><xsl:text disable-output-escaping = "yes">&amp;nbsp;</xsl:text>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</td></tr>
</table>
</xsl:template>

<xsl:template match="mapviewer/properties/label/minmax">
<table width="100%" align="left" border="0" cellpadding="2" cellspacing="4">
<tr><th class="mv_block_subtitle"><xsl:value-of select="@label"/></th></tr>
<xsl:for-each select="option">
<xsl:sort select="@value" order="descending" data-type="text"/>
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$labelminmax = $theValue">			
			<tr><td><input type="radio" name="propertylabelminmax" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/></td></tr>
		</xsl:when>
		<xsl:otherwise>
			<tr><td><input type="radio" name="propertylabelminmax" value="{$theValue}"/><xsl:value-of select="$theLabel"/></td></tr>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</table>
</xsl:template>

<xsl:template match="mapviewer/properties/label/howmany">
<table width="100%" align="left" border="0" cellpadding="2" cellspacing="4">
<tr><th class="mv_block_subtitle"><xsl:value-of select="@label"/></th></tr>
<xsl:for-each select="option">
<xsl:sort select="@value" order="descending" data-type="text"/>
	<xsl:variable name="theValue">
		<xsl:value-of select="@value"/>
	</xsl:variable>
	<xsl:variable name="theLabel">
		<xsl:value-of select="@label"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="$labelhowmany = $theValue">			
			<tr><td><input type="radio" name="propertylabelhowmany" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/></td></tr>
		</xsl:when>
		<xsl:otherwise>
			<tr><td><input type="radio" name="propertylabelhowmany" value="{$theValue}"/><xsl:value-of select="$theLabel"/></td></tr>
		</xsl:otherwise>
	</xsl:choose>	
</xsl:for-each>
</table>
</xsl:template>

<xsl:template match="mapviewer/properties/panfactor">
	<table class="mv_block" width="100%" cellpadding="0" cellspacing="0">
	<tr><th class="mv_block_title" colspan="4"><xsl:value-of select="@label"/></th></tr>
	<tr><td><table border="0" cellpadding="2" cellspacing="2"><tr><td><xsl:value-of select="@description"/>
	<xsl:for-each select="option">
		<xsl:sort select="@value" order="ascending" data-type="text"/>
		<xsl:variable name="theValue">
			<xsl:value-of select="@value"/>
		</xsl:variable>
		<xsl:variable name="theLabel">
			<xsl:value-of select="@label"/>
		</xsl:variable>
		<xsl:choose>
		<xsl:when test="$panfactor = $theValue">			
			<input type="radio" name="propertypanfactor" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertypanfactor" value="{$theValue}"/><xsl:value-of select="$theLabel"/>
		</xsl:otherwise>
		</xsl:choose>
	</xsl:for-each>
	</td></tr></table></td></tr></table>
</xsl:template>

<xsl:template match="mapviewer/properties/zoomfactor">
	<table class="mv_block" width="100%" cellpadding="0" cellspacing="0">
	<tr><th class="mv_block_title" colspan="4"><xsl:value-of select="@label"/></th></tr>
	<tr><td><table border="0" cellpadding="2" cellspacing="2"><tr><td><xsl:value-of select="@description"/>
	<xsl:for-each select="option">
		<xsl:sort select="@value" order="ascending" data-type="text"/>
		<xsl:variable name="theValue">
			<xsl:value-of select="@value"/>
		</xsl:variable>
		<xsl:variable name="theLabel">
			<xsl:value-of select="@label"/>
		</xsl:variable>
		<xsl:choose>
		<xsl:when test="$zoomfactor = $theValue">			
			<input type="radio" name="propertyzoomfactor" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertyzoomfactor" value="{$theValue}"/><xsl:value-of select="$theLabel"/>
		</xsl:otherwise>
		</xsl:choose>
	</xsl:for-each>
	</td></tr></table></td></tr></table>
</xsl:template>

<xsl:template match="mapviewer/properties/scalebarunits">
	<table class="mv_block" width="100%" cellpadding="0" cellspacing="0">
	<tr><th class="mv_block_title"><xsl:value-of select="@label"/></th></tr>
	<tr><td><table border="0" cellpadding="2" cellspacing="2"><tr><td><xsl:value-of select="@description"/>
	<xsl:for-each select="option">
		<xsl:sort select="@value" order="ascending" data-type="text"/>
		<xsl:variable name="theValue">
			<xsl:value-of select="@value"/>
		</xsl:variable>
		<xsl:variable name="theLabel">
			<xsl:value-of select="@label"/>
		</xsl:variable>
		<xsl:choose>
		<xsl:when test="$scalebarunits = $theValue">			
			<input type="radio" name="propertyscaleunits" value="{$theValue}" checked="checked"/><xsl:value-of select="$theLabel"/>
		</xsl:when>
		<xsl:otherwise>
			<input type="radio" name="propertyscaleunits" value="{$theValue}"/><xsl:value-of select="$theLabel"/>
		</xsl:otherwise>
		</xsl:choose>
	</xsl:for-each>
	</td></tr></table></td></tr></table>
</xsl:template>

</xsl:stylesheet>