<?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="IMAGES-UPLOAD">
	</xsl:template>
	
	<xsl:template match="IMAGES-UPLOAD" mode="content">
		<script src='/modules/ImageGallery/js/uploadManager.js?{$version}.{$build}' type='text/javascript'/>
		
		<div style="overflow:auto; width:100%;height:230px;">
		
		<table border="0" style="width:100%;" id="uploadManager">
			<!-- draw select box for resize images -->
			<tr>
				<td style="width:50%;" align="left">
					<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/IMAGE-UPLOAD-RESIZE"/> &#160;
					<select name="resizeImages">
						<xsl:apply-templates select="IMAGE-SELECT-ITEM-RESIZE"/>
						<option value="0">
							<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/IMAGE-UPLOAD-NO_RESIZE"/>
						</option>
					</select>
				</td>
				<td style="width:10%;" align="left"></td>
				<td style="width:40%;" align="left">
					<input type="checkbox" name="defaultImageName" id="defaultImageName" checked="true"/>
					<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/IMAGE-UPLOAD-DEFAULT"/>
				</td>
			</tr>
			<!-- draw padding top 10px between select box and list items for upload images -->
			<tr>
				<td colspan="3" style="padding-top:10px;">
					<div style="width:100%; height:0px;"><span></span></div>
				</td>
			</tr>
			<!-- draw list items for upload images -->
			<xsl:apply-templates select="IMAGE-UPLOAD-ITEM"/>
		</table>
		
		<!-- draw button upload -->
		<table border="0" style="width:100%;" class="sb-page">
			<!--<tr>
				<td style="width:50%"><div style="width:100%; height:0px;"><span></span></div></td>
				<td style="width:10%" align="center">
					<xsl:call-template name="BUTTON">
						<xsl:with-param name="title">
							<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/IMAGE-UPLOAD-UPLOAD"/>
						</xsl:with-param>
						<xsl:with-param name="action">
							uploadImages();
						</xsl:with-param>
					</xsl:call-template>
				</td>
				<td style="width:40%"></td>
			</tr>-->
			<tr style="display:none" id="defaultUploadImage">
				<td style="padding-left: 0px; padding-bottom: 5px; width:300px;" align="left">
					<span>
						<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/IMAGE-FILE"/>
					</span>	&#160;
					<input type="file" name="imagesFile[]" value="" class="sb-text" style="display:none; border: Solid 1px #999EA1;" size="30" onchange="checkBrowse();"/>
				</td>
				<td style="width:10%">
				</td>
				<td style="padding-left: 0px; padding-bottom: 5px; width:40%;" align="left">
					<span>
						<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/IMAGE-UPLOAD-TITLE"/> 
					</span>	&#160;
					<input type="text" name="imagesTitle[]" class="sb-control-input-input" maxlength="50"/> 
				</td>
			</tr>
		</table>
		<!--
		<table border="0" style="width:100%;" class="sb-page">
			<tr>
				<td style="width:100%;" align="left" colspan="3">
					<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/IMAGE-UPLOAD-NOT-RECOMMENDED"/>
				</td>
			</tr>
		</table>
		-->
		</div>
		<br/>
		<xsl:call-template name="MODULE-MODAL-FORM-OK-CANCEL-BUTTONS"/>
	</xsl:template>
	
	<xsl:template match="IMAGES-UPLOAD" mode="initAfterBody">
		<xsl:call-template name="MODAL-FORM">
			<xsl:with-param name="formName">modalForm</xsl:with-param>
			<xsl:with-param name="formTitle" select="/SITEBUILDER-PAGE/LOCALE/FORM-TITLE"/>
			<!--<xsl:with-param name="helpHint" select="/SITEBUILDER-PAGE/LOCALE/HELP-HINT"/>-->
			<!--<xsl:with-param name="closeHint" select="@CLOSE-HINT"/>-->
			<xsl:with-param name="additionalFormStyle">width: 800px; height: 360px;</xsl:with-param>
			<xsl:with-param name="content" select="current()" />
			<xsl:with-param name="onCloseAction">sbNavigationObject.go();</xsl:with-param>
		</xsl:call-template>	
	</xsl:template>
	
	
	<xsl:template match="IMAGES-UPLOAD-CARD">
	</xsl:template>
	
	<xsl:template match="IMAGE-SELECT-ITEM-RESIZE">
		<option>
			<xsl:attribute name="value"><xsl:value-of select="@CODE"/></xsl:attribute>
			<xsl:if test="@SELECTED=1">
				<xsl:attribute name="selected">true</xsl:attribute>
			</xsl:if>
			<xsl:value-of select="@SIZE"/>
		</option>
	</xsl:template>

	<xsl:template match="IMAGE-UPLOAD-ITEM">
		<tr>
			<td style="padding-left: 0px; padding-bottom: 5px; padding-top: 5px; width:300px" align="left">
					<span>
						<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/IMAGE-FILE"/>
					</span>	&#160;
				<input type="file" name="imagesFile[]" value="" onchange="checkBrowse();" class="sb-text" style="border: Solid 1px #999EA1;" size="30"/>
			</td>
			<td style="width:5%"></td>
			<td style="padding-left: 0px; padding-bottom: 5px; width:40%;" align="left">
				<span>
					<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/IMAGE-UPLOAD-TITLE"/> 
				</span>	&#160;
				<input type="text" name="imagesTitle[]" class="sb-control-input-input" maxlength="50"/> 
			</td>
		</tr>
	</xsl:template>
</xsl:stylesheet>