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

	<xsl:strip-space elements="*"/>
	<xsl:output method="html" indent="yes" encoding="utf-8"/>

	<xsl:template match="VIEW-CONTENT">

		<xsl:apply-templates select="STEP-DESIGN/CUSTOM"/>

		<script src='/js/Wizard/Design.js?{$version}.{$build}' type='text/javascript'></script>
		<script type="text/javascript">
			function checkBrowserSize() {checkSize('This window size is too small for this application. Correct work is not guaranteed.');}attachCheckToResize();sb_design=new SB_Design('<xsl:value-of select="/SITEBUILDER-PAGE/VIEW-CONTENT/STEP-DESIGN/TEMPLATES-LIST/@URL"/>');
			RegisterOnloadAction('resizeDivContent()');
		</script>
		<table border="0" cellpadding="0" cellspacing="0" style="height: 100%;width:100%" align="center">
			<tr>
				<td width="100%" valign="top">
					<xsl:apply-templates select="STEP-DESIGN"/>
				</td>
			</tr>
		</table>
		<script type="text/javascript">
			<!-- sb_design.save(); -->
			<xsl:choose>
				<xsl:when test="STEP-DESIGN/TEMPLATES-LIST/TEMPLATE[@SELECTED='1']">
					<xsl:apply-templates select="STEP-DESIGN/TEMPLATES-LIST/TEMPLATE[@SELECTED='1'][1]" mode="selected"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:apply-templates select="STEP-DESIGN/TEMPLATES-LIST/TEMPLATE[VISIBLE='1'][1]" mode="set"/>
				</xsl:otherwise>
			</xsl:choose>
		</script>
	</xsl:template>

	<xsl:template match="TEMPLATE" mode="selected">
		<xsl:text>addEvent(window,'resize',resizeDivContent);</xsl:text>
		<xsl:apply-templates select="." mode="set"/>
	</xsl:template>

	<xsl:template match="TEMPLATE" mode="set">
		sb_design.selectTemplate(
			'<xsl:value-of select="@CODE"/>'
			, '<xsl:value-of select="COLOR-SCHEMES/@SELECTED"/>'
			, '<xsl:value-of select="COLOR-SCHEMES/@VALUE"/>'
			, 'icon_selected.gif'
			, '<xsl:value-of select="@LOGO"/>'
			, '<xsl:value-of select="HEADERS/@SELECTED"/>'
			, '<xsl:value-of select="HEADERS/@VALUE"/>'
			, '<xsl:value-of select="BUTTONS/@SELECTED"/>'
			, '<xsl:value-of select="BUTTONS/@VALUE"/>'
			, '<xsl:value-of select="@CATEGORY"/>'
			, '<xsl:value-of select="@KEYWORDS"/>'
			, 
				<xsl:choose>
					<xsl:when test="HEADERS/@HEADER-UPLOAD-SUPPORT=1">customHeaders</xsl:when>
					<xsl:otherwise>new Array()</xsl:otherwise>
				</xsl:choose>
			, customLogo
		);
	</xsl:template>

	<xsl:template match="TEMPLATE" mode="reset">
		sb_design.selectNewTemplate(
			'<xsl:value-of select="@CODE"/>'
			, '<xsl:value-of select="COLOR-SCHEMES/@SELECTED"/>'
			, '<xsl:value-of select="COLOR-SCHEMES/@VALUE"/>'
			, 'icon_selected.gif'
			, '<xsl:value-of select="@LOGO"/>'
			, '<xsl:value-of select="HEADERS/@VALUE"/>'
			, '<xsl:value-of select="BUTTONS/@VALUE"/>'
			, '<xsl:value-of select="@CATEGORY"/>'
			, '<xsl:value-of select="@KEYWORDS"/>'
			, 
				<xsl:choose>
					<xsl:when test="HEADERS/@HEADER-UPLOAD-SUPPORT=1">customHeaders</xsl:when>
					<xsl:otherwise>new Array()</xsl:otherwise>
				</xsl:choose>
			, customLogo
		);
	</xsl:template>

	<xsl:template match="TEMPLATE[@VISIBLE='1']" mode="choosing">
		<span style="padding: 5px; float: left; width: 130px;">
			<table cellspacing="0" cellpadding="0" border="0" align="center" style="cursor: pointer;">
				<xsl:attribute name="onclick">
					<xsl:apply-templates select="." mode="reset"/>
					<xsl:text>return false;</xsl:text>
				</xsl:attribute>
				<tr>
					<td valign="top" align="center" style="border: 1px solid rgb(204, 204, 204);">
						<table cellspacing="0" cellpadding="0">
							<tr>
								<td valign="top" align="center" style="padding: 5px 5px 10px;">
									<xsl:variable name="colorScheme"><xsl:value-of select="COLOR-SCHEMES/@DEFAULT"/></xsl:variable>
<!--									<xsl:if test="COLOR-SCHEMES/@SELECTED = '1'">
										<xsl:variable name="colorScheme"><xsl:value-of select="COLOR-SCHEMES/@SELECTED"/></xsl:variable>
									</xsl:if> -->
									<img style="border-width: 0px; height: 89px; width: 118px;">
										<xsl:attribute name="src"><xsl:value-of select="../../TEMPLATES-LIST/@URL"/>/<xsl:value-of select="@CODE"/>/<xsl:value-of select="$colorScheme"/>/icon.gif</xsl:attribute>
									</img> 
								</td>
							</tr>
							<tr>
								<td valign="top" align="left" style="padding-left: 5px; padding-right: 5px; padding-bottom: 10px;">
									<span style="color: Black; font-family: Arial; font-size: 11px; font-weight: bolder;">ID:</span>
									<span style="color: Black; font-family: Arial; font-size: 11px; padding-left: 5px;">
										<xsl:choose>
											<xsl:when test='string-length(@CODE) &gt; 17'>
												<xsl:value-of select="substring(@CODE,1,15)"/>..
											</xsl:when>
											<xsl:otherwise>
												<xsl:value-of select="@CODE"/>
											</xsl:otherwise>
										</xsl:choose>
									</span>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</span>
	</xsl:template>

	<xsl:template name="BOTTOM-SEPARATOR">
		<tr class="SB_FormView_BottomSeparator" style="">
			<td>&#160;</td>
		</tr>
	</xsl:template>

	<xsl:template match="TEMPLATE-HEADERS">
		<input type="hidden" name="headersList_hidden" id="headersList_hidden" value="false"/>
		<table cellspacing="0" cellpadding="0" onclick="sb_design.showHeadersList(this);" id="headersList" style="background-color:White;border-color:#9B9B9B;border-width:1px;border-style:solid;width:100%;border-collapse:collapse;cursor:pointer">
			<tr>
				<td>
					<table cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse;">
						<tr>
							<td align="center" id="selectedHeader" valign="middle" style="background-color:White;width:100%;">
								&#160;
							</td>
						</tr>
					</table>
				</td>
				<td style="width:19px;">
					<img src="{$skinPath}/images/DropDownMiddle.gif" style="border-width:0px;" />
				</td>
			</tr>
			<tr>
				<td>
					<div id="headersList_popup" style="border-color:#9B9B9B;border-width:1px;border-style:solid;position:absolute;display:none;z-index:1;overflow:auto;width:10;">
					</div>
				</td>
			</tr>
		</table>
		<table cellspacing="0" cellpadding="0" style="border-width:0px;width:100%;border-collapse:collapse;">
			<tr>
				<td style="padding-top: 5px; padding-left: 0px; padding-right: 0px">
					<table cellspacing="0" cellpadding="0" style="width: 100%">
						<tr>
							<td style="width: 100%">
								<input type="file" name="customHeader" id="customHeader" size="17" style="color:Black;border-color:#999EA1;border-width:1px;border-style:Solid;font-family:Arial;font-size:11px;width:100%;" />
							</td>
							<td style="padding-left: 5px">
								<xsl:call-template name="BUTTON-CONTROL">
									<xsl:with-param name="action">sb_design.validateUploadForm('customHeader');</xsl:with-param>
									<xsl:with-param name="title"><xsl:value-of select="//TEMPLATES-LIST/LOCALES/UPLOAD-BTN-TITLE/@VALUE"/></xsl:with-param>
									<xsl:with-param name="style">width: 70px; cursor: pointer;</xsl:with-param>
								</xsl:call-template>	
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</xsl:template>
	
	<xsl:template match="TEMPLATE-LOGO">
		<table cellspacing="0" border="0" style="width:100%;border-collapse:collapse;">
	    	<tr>
	        	<td style="padding-bottom: 3px; padding-left: 0px; padding-right: 0px">
	            	<table width="100%" cellspacing="0" cellpadding="0">
	                	<tr>
	                    	<td id="templateLogo" class="logotype_layer" valign="middle" align="center" style="width: 42; height: 42;">
	                        	<!--<img id="ctl00_ContentStep_ImageLogotype" src="" style="border-width:0px;" />-->
	                    	</td>
	                    	<td align="right" valign="bottom">&#160;</td>
	                	</tr>
	            	</table>
	        	</td>
	    	</tr>
	    	<tr>
	        	<td style="padding-left: 0px; padding-right: 0px">
	            	<table cellspacing="0" cellpadding="0" width="100%">
	                	<tr>
	                    	<td width="100%">
	                        	<input type="file" name="customLogo" id="customLogo" size="17" style="color:Black;border-color:#999EA1;border-width:1px;border-style:Solid;font-family:Arial;font-size:11px;width:100%;" />
	                        </td>
	                    	<td style="padding-left: 5px">
								<xsl:call-template name="BUTTON-CONTROL">
									<xsl:with-param name="action">sb_design.validateUploadForm('customLogo');</xsl:with-param>
									<xsl:with-param name="title"><xsl:value-of select="//TEMPLATES-LIST/LOCALES/UPLOAD-BTN-TITLE/@VALUE"/></xsl:with-param>
									<xsl:with-param name="style">width: 70px; cursor: pointer;</xsl:with-param>
								</xsl:call-template>	
	                    	</td>
	                	</tr>
	            	</table>
	        	</td>
	    	</tr>
		</table>
	</xsl:template>
	
	
	<xsl:template match="TEMPLATE-SITEINFO">
    	<table cellspacing="0" border="0" style="width:100%;border-collapse:collapse;">
	        <tr>
	            <td style="padding-left: 0px; padding-right: 0px">
	                <table cellpadding="0" cellspacing="0" width="100%">
	                    <tr>
	                        <td style="width: 40%; white-space: nowrap;color:Black;font-family:Arial;font-size:11px;"><xsl:value-of select="@COMPANY-NAME"/></td>
	                        <td>
	                            <input name="companyName" type="text" maxlength="40" size="25" style="color:Black;border-color:#999EA1;border-width:1px;border-style:Solid;font-family:Arial;font-size:11px;" onchange="top.sbApplyChangesObject.registerChange();">
	                            	<xsl:attribute name="value">
	                            		<xsl:value-of select="/SITEBUILDER-PAGE/VIEW-CONTENT//STEP-DESIGN/COMPANY/@NAME"/>
	                            	</xsl:attribute>
	                            </input>
	                        </td>
	                    </tr>
	                    <tr>
	                        <td style="color:Black;font-family:Arial;font-size:11px;"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/COPYRIGHT"/></td>
	                        <td>
	                            <input name="copyright" type="text" maxlength="40" size="25" style="color:Black;border-color:#999EA1;border-width:1px;border-style:Solid;font-family:Arial;font-size:11px;" onchange="top.sbApplyChangesObject.registerChange();">
	                            	<xsl:attribute name="value">
	                            		<xsl:value-of select="/SITEBUILDER-PAGE/VIEW-CONTENT/STEP-DESIGN/COMPANY/@COPYRIGHT"/>
	                            	</xsl:attribute>
	                            </input>
	                        </td>
	                    </tr>
	                </table>
	            </td>
	        </tr>
		</table>
	</xsl:template>

	<xsl:template match="TEMPLATE-BUTTONS">
		<span id="buttonsList"></span>
 	</xsl:template>	
	
	<xsl:template match="TEMPLATE-COLOR-SCHEMES">
		<span id="colorSchemesList"></span>
	</xsl:template>
	
	<xsl:template match="TEMPLATE-CONTENT">
		<table cellspacing="0" cellpadding="0" border="0" style="width: 100%; padding-left: 0px; padding-right: 0px;">
			<xsl:for-each select="*">
				<tr>
					<td style="padding-bottom: 3px; padding-top: 3px; padding-left: 10px; color: Black; font-family: Arial; font-size: 11px; font-weight: bold;">
						<xsl:value-of select="@VALUE"/> 
					</td>
				</tr>
				<tr>
					<td style="padding-left: 10px; padding-right: 10px">
						<xsl:apply-templates select="."/>
					</td>
				</tr>
				<xsl:call-template name="BOTTOM-SEPARATOR"/>
			</xsl:for-each>
		</table>
	</xsl:template>
	
	<xsl:template match="STEP-DESIGN">
		<table cellspacing="0" cellpadding="0" border="0" style="padding: 0px; width: 100%; height: 100%;">
			<tr>
				<td style="text-align: left; width: 90%;" class="SB_DesignPagerPanel">
					<xsl:call-template name="TOP-TOOLBAR"/>
				</td>
				<td style="padding: 0px; white-space: nowrap; vertical-align: top; width: 10%;" class="SB_DesignPagerPanel" rowspan="3">
					<xsl:apply-templates select="TEMPLATE-CONTENT"/>
				</td>
			</tr>
			<tr>
				<td style="vertical-align: top; height: 100%; width: 100%;">
					<input type="hidden" value="divTemplateList,190" name="inputResizeOption" id="inputResizeOption"/>
					<div style="overflow: auto; width: 100%; height: 423px;" id="divTemplateList">
						<span style="width: 100%;">
							<xsl:call-template name="ACTIVE-TEMPLATE"/>
							<xsl:apply-templates select="TEMPLATES-LIST"/>
						</span>
					</div>
				</td>
			</tr>
			<tr>
				<td class="SB_DesignPagerPanel">
					<xsl:call-template name="PAGER-PANEL"/>
				</td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template name="PAGE-NAVIGATION-BUTTON">
		<xsl:param name="title"/>
		<xsl:param name="style"/>
		<xsl:param name="action" select="''"/>
		<xsl:call-template name="BUTTON-CONTROL">
			<xsl:with-param name="title" select="$title"/>
			<xsl:with-param name="style" select="$style"/>
			<xsl:with-param name="action" select="$action"/>
		</xsl:call-template>
	</xsl:template>

	<xsl:template match="TEMPLATES-LIST/@*[.&gt;=1]" mode="pageNavigationButton">
		<xsl:param name="title"/>
		<xsl:call-template name="PAGE-NAVIGATION-BUTTON">
			<xsl:with-param name="title" select="$title"/>
			<xsl:with-param name="action">sb_design.goToPage(<xsl:value-of select="."/>);</xsl:with-param>
			<xsl:with-param name="style">width: 60px; cursor: pointer;</xsl:with-param>
		</xsl:call-template>
	</xsl:template>

	<xsl:template match="TEMPLATES-LIST/@*[.&lt;1]" mode="pageNavigationButton">
		<xsl:param name="title"/>
		<xsl:call-template name="PAGE-NAVIGATION-BUTTON">
			<xsl:with-param name="title" select="$title"/>
			<xsl:with-param name="style">width: 60px; opacity: 0.4; cursor: default;</xsl:with-param>
		</xsl:call-template>
	</xsl:template>

	<xsl:template name="PAGER-PANEL">
		<xsl:variable name="pageCount" select="/SITEBUILDER-PAGE/VIEW-CONTENT/STEP-DESIGN/TEMPLATES-LIST/@PAGES-COUNT" />
		<table cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td>
					<span style="width: 100%;">
						<table cellspacing="5" cellpadding="0">
							<tr>
								<td>
									<xsl:apply-templates select="/SITEBUILDER-PAGE/VIEW-CONTENT/STEP-DESIGN/TEMPLATES-LIST/@PREVIOUS-PAGE" mode="pageNavigationButton">
										<xsl:with-param name="title">&lt;</xsl:with-param>
									</xsl:apply-templates>
								</td>
								<td style="padding-left: 5px; padding-right: 5px; color: Black; font-family: Arial; font-size: 11px;">
									<xsl:value-of select="TEMPLATES-LIST/LOCALES/PAGE-OF/@VALUE"/>
								</td>
								<td>
									<xsl:apply-templates select="/SITEBUILDER-PAGE/VIEW-CONTENT/STEP-DESIGN/TEMPLATES-LIST/@NEXT-PAGE" mode="pageNavigationButton">
										<xsl:with-param name="title">&gt;</xsl:with-param>
									</xsl:apply-templates>
								</td>
								<td class="SB_Vertical_Panel_Separator">
									<img style="border-width: 0px; width: 1px;" src="{$skinPath}/images/empty.gif"/>
								</td>
								<td style="padding-left: 5px; white-space: nowrap;">
									<span style="color: Black; font-family: Arial; font-size: 11px;"><xsl:value-of select="TEMPLATES-LIST/LOCALES/GO-TO-PAGE/@VALUE"/>&#160;&#160;&#160;</span>
									<input type="text" style="border: 1px solid rgb(153, 158, 161); color: Black; font-family: Arial; font-size: 11px;" size="2" id="goToPage">
										<xsl:if test="$pageCount &lt;= 1">
											<xsl:attribute name="disabled">true</xsl:attribute>
										</xsl:if>
									</input>
									<span style="color: Red; visibility: hidden;"/>
								</td>
								<td>
									<xsl:choose>
										<xsl:when test="$pageCount &gt; 1">
											<xsl:call-template name="BUTTON-CONTROL">
												<xsl:with-param name="action">sb_design.validateAndGoToPage(document.getElementById('goToPage').value, <xsl:value-of select="$pageCount" />);</xsl:with-param>
												<xsl:with-param name="style">width: 60px; cursor: pointer;</xsl:with-param>
												<xsl:with-param name="title">
													<xsl:value-of select="TEMPLATES-LIST/LOCALES/GO-BTN-TITLE/@VALUE"/>
												</xsl:with-param>
											</xsl:call-template>
										</xsl:when>
										<xsl:otherwise>
											<xsl:call-template name="BUTTON-CONTROL">
												<xsl:with-param name="style">width: 60px; opacity: 0.4; cursor: default;</xsl:with-param>
												<xsl:with-param name="title">
													<xsl:value-of select="TEMPLATES-LIST/LOCALES/GO-BTN-TITLE/@VALUE"/>
												</xsl:with-param>
											</xsl:call-template>
										</xsl:otherwise>
									</xsl:choose>
								</td>
							</tr>
						</table>
					</span>
				</td>
			</tr>
		</table>
	</xsl:template>
	
	<xsl:template name="TOP-TOOLBAR">
		<table cellspacing="5" cellpadding="0" border="0">
			<tr>
				<td style="white-space: nowrap; padding-right: 5px;">
					<xsl:apply-templates select="SELECT-CATEGORY"/>
				</td>
				<td class="SB_Vertical_Panel_Separator">
					<img style="border-width: 0px; width: 1px;" src="{$skinPath}/images/empty.gif"/>
				</td>
				<td style="white-space: nowrap; padding-left: 5px;">
					<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/DESIGN-SEARCH"/>
				</td>
				<td style="white-space: nowrap; padding-left: 5px;">
					<xsl:call-template name="TITLE-NONE">
						<xsl:with-param name="id">search</xsl:with-param>
						<xsl:with-param name="name">search</xsl:with-param>
						<xsl:with-param name="title" select="/SITEBUILDER-PAGE/LOCALE/DESIGN-SEARCH"/>
						<xsl:with-param name="titleStyle">color: Black; font-family: Arial; font-size: 11px; padding-right: 5px;</xsl:with-param>
						<xsl:with-param name="controlStyle">border: 1px solid rgb(153, 158, 161); color: Black; font-family: Arial; font-size: 11px; width: 300px;</xsl:with-param>
						<xsl:with-param name="value" select="/SITEBUILDER-PAGE/VIEW-CONTENT/STEP-DESIGN/TEMPLATES-LIST/@SEARCH"/>
					</xsl:call-template>
					<script type="text/javascript" language="javascript">
						<xsl:comment>
							sb_design.prepareSearchInput();
						//</xsl:comment>
					</script>
				</td>
				<td>
					<xsl:call-template name="BUTTON-CONTROL">
						<xsl:with-param name="title" select="/SITEBUILDER-PAGE/LOCALE/DESIGN-GO"/>
						<xsl:with-param name="style">width: 60px;</xsl:with-param>
						<xsl:with-param name="action">sb_design.searchSubstring(document.getElementById('search').value);</xsl:with-param>
					</xsl:call-template>
				</td>
				<td>
					<xsl:call-template name="BUTTON-CONTROL">
						<xsl:with-param name="title" select="/SITEBUILDER-PAGE/LOCALE/DESIGN-SHOW-ALL"/>
						<xsl:with-param name="style">width: 60px;</xsl:with-param>
						<xsl:with-param name="action">sb_design.showAllTemplates();</xsl:with-param>
					</xsl:call-template>
				</td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template name="ACTIVE-TEMPLATE">
		<span style="padding: 5px; float: left; width: 270px;">
			<table cellspacing="0" cellpadding="0" border="0" align="center" >
				<tr>
					<td valign="top" height="248" align="center" style="border: 2px solid rgb(255, 61, 12);">
						<table cellspacing="0" cellpadding="0" border="0">
							<tr>
								<td valign="top" align="center" style="padding: 3px 7px 2px;">
									<img border="0" id="smallPreview" style="cursor: pointer; width: 252px; height: 189px;" onclick="sb_design.previewBigIcon();"/>
								</td>
							</tr>
							<tr>
								<td align="left" valign="top" style="padding-left: 7px; padding-right: 7px; padding-bottom: 2px; ">
									<span style="color:Black;font-family:Arial;font-size:11px;font-weight: bolder;"><xsl:value-of select="TEMPLATES-LIST/LOCALES/TEMPLATE-ID/@VALUE"/>:</span>
									<span id="labelIdContent" style="color:Black;font-family:Arial;font-size:11px;padding-left: 5px;"></span>
								</td>
							</tr>
							<tr>
								<td align="left" valign="top" style="padding-left: 7px; padding-right: 7px; padding-bottom: 3px;">
									<span style="font-weight: bolder;"><xsl:value-of select="TEMPLATES-LIST/LOCALES/TEMPLATE-CATEGORY/@VALUE"/>:</span>
									<span id="labelCategoryContent" style="padding-left: 5px;"></span>
								</td>
							</tr>
							<tr>
								<td align="left" valign="top" style="padding-left: 7px; padding-right: 7px; padding-bottom: 2px;">
									<span style="font-weight: bolder;"><xsl:value-of select="TEMPLATES-LIST/LOCALES/TEMPLATE-KEYWORDS/@VALUE"/>:</span>
									<span id="labelKeywordsContent" style="padding-left: 5px;">none</span>
								</td>
							</tr>												
						</table>
					</td>
				</tr>
				<tr>
					<td align="right" valign="top">
						<table cellpadding="0" cellspacing="0" width="100%" border="0">
							<tr>
								<td><img src="{$skinPath}/images/design_button_selected_left.gif" style="border-width:0px;" /></td>
								<td width="100%" valign="middle" align="center" nowrap="true" background="{$skinPath}/images/design_button_selected_m.gif" onclick="sb_design.previewBigIcon();" style="cursor:pointer;color:White;font-family:Arial;font-size:11px;">PREVIEW</td>
								<td><img src="{$skinPath}/images/design_button_selected_r.gif" style="border-width:0px;" /></td>
							</tr>
						</table>
					</td>
				</tr>		
			</table>
		</span>
		<input type="hidden" value="" name="activeTemplate" id="activeTemplate"/>
		<input type="hidden" value="" name="activeColorScheme" id="activeColorScheme"/>
		<input type="hidden" value="" name="activeHeader" id="activeHeader"/>
		<input type="hidden" value="" name="activeButton" id="activeButton"/>
	</xsl:template>

	<xsl:template match="TEMPLATES-LIST">
		<xsl:apply-templates select="TEMPLATE" mode="choosing"/>
	</xsl:template>

	<xsl:template match="CATEGORY">
		<option value="{@VALUE}">
			<xsl:if test="@SELECTED='1'">
				<xsl:attribute name="selected">1</xsl:attribute>
			</xsl:if>
			<xsl:value-of select="@TITLE"/>
		</option>
	</xsl:template>

	<xsl:template match="SELECT-CATEGORY">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td align="left" valign="middle" style="white-space: nowrap;color: Black; font-family: Arial; font-size: 11px; padding-right: 5px;"><xsl:value-of select="@TITLE"/></td>
				<td align="left" valign="middle" style="white-space: nowrap;" >
					<select id="category" onchange="sb_design.searchCategory(this.value);return false;" style="color:Black;font-family:Arial;font-size:11px;">
						<xsl:apply-templates select="CATEGORY"/>
					</select>
				</td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template match="CUSTOM">
		<script language="javascript">
		customHeaderUrl = '<xsl:value-of select="HEADER/@URL"/>';
		customLogoUrl = '<xsl:value-of select="LOGO/@URL"/>';
		customHeaders = new Array(
		<xsl:for-each select="HEADER/ITEM"><xsl:if test="position() != 1">,</xsl:if>'<xsl:value-of select="."/>'</xsl:for-each>
		);
		customLogo = '<xsl:value-of select="LOGO/."/>';
		</script>
	</xsl:template>
</xsl:stylesheet>
