<?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 match="IMAGES-UPLOAD" mode="initAfterBody">
		<table>
		<tr style="height:90%"><td>
		<xsl:call-template name="MODAL-FORM">
			<xsl:with-param name="formName">MultipleUploadDialogId</xsl:with-param>
			<xsl:with-param name="formTitle" select="/SITEBUILDER-PAGE/LOCALE/FORM-TITLE"/>
			<xsl:with-param name="additionalFormStyle">width: 960px;height: 640px;</xsl:with-param>
			<xsl:with-param name="content" select="current()" />
			<xsl:with-param name="onCloseAction">sbNavigationObject.go();</xsl:with-param>
		</xsl:call-template>
		</td></tr>
		<tr><td>
			<xsl:apply-templates select="//UPLOAD-MODAL-DIALOG" />		
		</td></tr>
		</table>
	</xsl:template>	

	<xsl:template match="IMAGES-UPLOAD" mode="content">
		<xsl:apply-templates select="//APPLET" />
		<span>&#160;</span>
	</xsl:template>	
	
	<xsl:template name="APPLET-PARAMS">
		<param>
			<xsl:attribute name="name">POST-PARAMS</xsl:attribute>
			<xsl:attribute name="value"><xsl:value-of select="POST-PARAMS" /></xsl:attribute>
		</param>
		<param>
			<xsl:attribute name="name">URL</xsl:attribute>
			<xsl:attribute name="value"><xsl:value-of select="URL" /></xsl:attribute>
		</param>
		<param>
			<xsl:attribute name="name">CATEGORIES</xsl:attribute>
			<xsl:attribute name="value"><xsl:value-of select="CATEGORIES" /></xsl:attribute>
		</param>
		<!--
		<param>
			<xsl:attribute name="name">PRIMARY-COLOR-1</xsl:attribute>
			<xsl:attribute name="value">#ff0000</xsl:attribute>
		</param>
		<param>
			<xsl:attribute name="name">PRIMARY-COLOR-2</xsl:attribute>
			<xsl:attribute name="value">#00ff00</xsl:attribute>
		</param>
		<param>
			<xsl:attribute name="name">PRIMARY-COLOR-3</xsl:attribute>
			<xsl:attribute name="value">#0000ff</xsl:attribute>
		</param>
		-->
		<!--
		<param>
			<xsl:attribute name="name">SECONDARY-COLOR-1</xsl:attribute>
			<xsl:attribute name="value">#0000ff</xsl:attribute>
		</param>
		<param>
			<xsl:attribute name="name">SECONDARY-COLOR-2</xsl:attribute>
			<xsl:attribute name="value">#ff0000</xsl:attribute>
		</param>
		<param>
			<xsl:attribute name="name">SECONDARY-COLOR-3</xsl:attribute>
			<xsl:attribute name="value">#ffffff</xsl:attribute>
		</param>
		-->
		<xsl:for-each select="LOCALE/*">
			<param>
				<xsl:attribute name="name">LOCALE-<xsl:value-of select="name()" /></xsl:attribute>
				<xsl:attribute name="value"><xsl:value-of select="text()" /></xsl:attribute>
			</param>
		</xsl:for-each>
		<xsl:for-each select="SKIN/*">
			<param>
				<xsl:attribute name="name"><xsl:value-of select="name()" /></xsl:attribute>
				<xsl:attribute name="value"><xsl:value-of select="text()" /></xsl:attribute>
			</param>
		</xsl:for-each>	
	</xsl:template>

	<xsl:template match="APPLET">
	<!--
		<xsl:comment><![CDATA[[if !IE]> Firefox and others will use outer object]]></xsl:comment>
		<object classid="java:MultipleImageUpload.class" 
              type="application/x-java-applet"
              archive="/applet/MIU.jar"
			  height="500" width="100%">
			<param name="archive" value="/applet/MIU.jar" />
			<xsl:call-template name="APPLET-PARAMS" />

			<xsl:comment><![CDATA[<![endif] MSIE (Microsoft Internet Explorer) will use inner object>]]></xsl:comment>
			
			<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" 
					codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"
					height="500" width="100%">
				<param name="archive" value="/applet/MIU.jar" />
				<param name="code" value="MultipleImageUpload.class" />
				<xsl:call-template name="APPLET-PARAMS" />
				<strong>
					This browser does not have a Java Plug-in.
					<br />
					<a href="http://java.sun.com/products/plugin/downloads/index.html">
					  Get the latest Java Plug-in here.
					</a>
				</strong>
			</object>

			<xsl:comment><![CDATA[[if !IE]> close outer object]]></xsl:comment>

		</object>
		
		<xsl:comment><![CDATA[<![endif]]]></xsl:comment>
		-->
		<applet code="MultipleImageUpload.class"
				archive="/applet/MIU.jar,/applet/swingx_v0201.jar"
				style="width:100%;height:100%">
			<xsl:call-template name="APPLET-PARAMS" />
		</applet>
		<script type="text/javascript">
		<!-- This function is kind of ugly hack. It overrides overflow propery of objects
			under the applet so that they do not appear over the applet window 
			(only in FF/Mozilla) -->
function ResetOverflowProperty() {
		P = function(e) { 
				return (e &amp;&amp; (e.style.overflow = 'hidden')); 
		}
		try {
			//$$ is from prototype, as well as each
			P($$('div#edit')[0]);
			P($$('div.scroll-table-block')[0]);
			$$('div.scroll-table-block *').each(P); 
		}
		catch (e) { }
}
RegisterOnloadAction("ResetOverflowProperty()");
		</script>
	</xsl:template>

</xsl:stylesheet>
