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

	<xsl:template match="INTERFACE-CONTENT">
	<style>
			.sb-formtableheader-th { background-color: #ffffff; }
			.sb-page { padding-top: 0; }
	</style>
		<script type="text/javascript" src="/js/Admin/InterfaceSettings.js?{$version}.{$build}"/>
	
		<form name="editInterfaceSettings" enctype="multipart/form-data" method="post" id="editInterfaceSettings" onsubmit="submitForm(); return false;">
			<input type="hidden" name="action" id="editInterfaceSettingsAction" value="/Admin/InterfaceSettings/Save"/>
		
			<table width="100%" cellpadding="0" cellspacing="0"  border="0">
				<tr>
			    	<td>
						<xsl:apply-templates/>
			    	</td>
				</tr>
			</table>
			
			<!-- input image needed for work default submit via Enter -->
			<input type="image" style="border-width: 0px; height: 0px; width: 0px;"/>
		</form>

         <xsl:call-template name="OK-CANCEL-BUTTONS">
			<xsl:with-param name="okAction">submitForm();</xsl:with-param>
			<xsl:with-param name="cancelAction">document.location.href="<xsl:value-of select="$baseUrl"/>/Admin/Server";</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	
	<xsl:template match="GENERAL-CARD-CONTENT">		
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td>
					<xsl:call-template name="LOGO-PREVIEW"/>
				</td>
			</tr>
		
			<tr><td><img src="{$skinPath}/images/white_pixel.gif" width="1" height="4"/></td></tr>
			
			<tr>
				<td>
					<xsl:call-template name="UPLOAD-LOGO"/>
				</td>
			</tr>
			
			<tr><td><img src="{$skinPath}/images/white_pixel.gif" width="1" height="4"/></td></tr>
		</table>
		
		<table width="100%" cellpadding="0" cellspacing="0" border="0">	
			<tr>
				<td>
					<xsl:apply-templates select="CONTROL[@ID='logoLink']" mode="TITLE-LEFT">
						<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
						<xsl:with-param name="maxLength">255</xsl:with-param>
						<xsl:with-param name="controlStyle">width: 300px;</xsl:with-param>
						<xsl:with-param name="onChange">sbApplyChangesObject.registerChange();</xsl:with-param>
					</xsl:apply-templates>
				</td>
			</tr>
			
			<tr><td><img src="{$skinPath}/images/white_pixel.gif" width="1" height="4"/></td></tr>
			
			<tr>
				<td>
					<xsl:apply-templates select="CONTROL[@NAME='title']" mode="TITLE-LEFT">
						<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
						<xsl:with-param name="maxLength">255</xsl:with-param>
						<xsl:with-param name="controlStyle">width: 300px;</xsl:with-param>
						<xsl:with-param name="onChange">sbApplyChangesObject.registerChange();</xsl:with-param>
					</xsl:apply-templates>
				</td>
			</tr>
			
			<tr><td><img src="{$skinPath}/images/white_pixel.gif" width="1" height="4"/></td></tr>
		</table>
		
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td>
					<xsl:apply-templates select="CONTROL[@NAME='restoreButton']">
						<xsl:with-param name="style">width: 140px;</xsl:with-param>
						<xsl:with-param name="action">javascript: if (confirm(SbGetLocaleByKey('SURE-TO-RESTORE'))) { document.getElementById('editInterfaceSettingsAction').value = '/Admin/InterfaceSettings/Restore'; return document.forms['editInterfaceSettings'].submit(); } return false;</xsl:with-param>
					</xsl:apply-templates>
				</td>
			</tr>
		</table>

	</xsl:template>

	<xsl:template name="LOGO-PREVIEW">
		<xsl:if test="LOGO-PREVIEW/@NEED-APPLY-CHANGES = '1'">
			<script type="text/javascript" language="javascript">
				sbApplyChangesObject.registerChange();
			</script>
		</xsl:if>

		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td width="50%">
					<xsl:value-of select="LOGO-PREVIEW/@VALUE"/>
				</td>
				<td width="50%">
					<table cellpadding="0" cellspacing="0" border="0">
						<tr>
							<td valign="middle" align="center" style="width: 150px; height: 40px;" class="logotype-layer">
								<img style="border-width: 0px;">
									<xsl:attribute name="src">
										<xsl:choose>
											<xsl:when test="LOGO-PREVIEW/@IMAGE">
											<!-- hard code must be removed! -->
												<xsl:value-of select="LOGO-PREVIEW/@IMAGE"/>
											</xsl:when>
											<xsl:otherwise>
												<xsl:value-of select="$skinPath"/>/images/<xsl:value-of select="LOGO-PREVIEW/@DEFAULT-IMAGE"/>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:attribute>
								</img>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>	
	</xsl:template>
	
	<xsl:template name="UPLOAD-LOGO">
		<input type="hidden" name="MAX_FILE_SIZE">
			<xsl:attribute name="value"><xsl:value-of select="UPLOAD-LOGO/@MAX-FILE-SIZE"/></xsl:attribute>
		</input>
					
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td width="50%">
					<xsl:value-of select="UPLOAD-LOGO/@VALUE"/>
				</td>
				<td width="50%">
					<table cellpadding="0" cellspacing="0" border="0">
						<tr>
							<td>
								<input type="file" style="border: 1px solid rgb(153, 158, 161); width: 185px;" id="idUploadLogo">
									<xsl:attribute name="name">
										<xsl:value-of select="UPLOAD-LOGO/@NAME"/>
									</xsl:attribute>
								</input>
							</td>
							
							<td><img src="/images/blank.gif" width="16" height="1"/></td>
							
							<td>
								<xsl:apply-templates select="UPLOAD-LOGO/CONTROL[@NAME='uploadButton']">
									<xsl:with-param name="action">javascript:submitForUpload();</xsl:with-param>
									<xsl:with-param name="style">width: 100px;</xsl:with-param>
								</xsl:apply-templates>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</xsl:template>
	
	<xsl:template match="HELP-LINKS-CONTAINER">
		<fieldset class="sb-toolbar-fieldset">
			<legend class="sb-label-toolbar-title"><xsl:value-of select="@TITLE"/></legend>
	
			<xsl:for-each select="CONTROL">
				<xsl:apply-templates select="." mode="TITLE-LEFT">
					<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
					<xsl:with-param name="onChange">sbApplyChangesObject.registerChange();</xsl:with-param>
				</xsl:apply-templates>
				
				<img src="{$skinPath}/images/white_pixel.gif" width="1" height="4"/><br/>
			</xsl:for-each>
		
		</fieldset>
	</xsl:template>
	
	<xsl:template match="SUPPORT-LINKS-CONTAINER">
		<fieldset class="sb-toolbar-fieldset">
			<legend class="sb-label-toolbar-title"><xsl:value-of select="@TITLE"/></legend>
	
			<xsl:apply-templates select="CONTROL" mode="TITLE-LEFT">
				<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
				<xsl:with-param name="onChange">sbApplyChangesObject.registerChange();</xsl:with-param>
			</xsl:apply-templates>
		
		</fieldset>
	</xsl:template>
	
</xsl:stylesheet>

                              
