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

<xsl:template match="PUBLISH-SETTINGS-CARD-CONTENT">

<xsl:variable name="style">width:100%;height:18px;</xsl:variable>

<xsl:if test="ENABLE-HOSTING-PUBLISH='true' or ENABLE-KNOWN-PUBLISH='true'">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td width="50%">
			<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/PUBLISHING-SCENARIO"/>
		</td>
		<td width="50%">
			<select name="defaultScenario" class="SB_Control_Input_Input">
				<xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>

				<xsl:if test="ENABLE-HOSTING-PUBLISH='true'">
					<option value="1">
						<xsl:if test="CONTROL[@NAME='defaultScenario']/@VALUE = 1">
							<xsl:attribute name="selected">true</xsl:attribute>
						</xsl:if>
						<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/PUBLISHING-SCENARIO1"/>
					</option>
				</xsl:if>

				<xsl:if test="ENABLE-KNOWN-PUBLISH='true'">
					<option value="2">
						<xsl:if test="CONTROL[@NAME='defaultScenario']/@VALUE = 2">
							<xsl:attribute name="selected">true</xsl:attribute>
						</xsl:if>
						<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/PUBLISHING-SCENARIO2"/>
					</option>
				</xsl:if>
			</select>
		</td>
	</tr>
</table>
</xsl:if>

<xsl:if test="ENABLE-HOSTING-PUBLISH='true'">
<fieldset class="SB_Form_FieldSet">
	<legend><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/HOSTING-LEGEND"/></legend>
	<table width="100%" cellpadding="0" cellspacing="0" border="0">

		<tr>
			<td colspan="2" style="padding-bottom: 4px;">
				<xsl:apply-templates select="CONTROL[@NAME='publishModeId' and @TYPE='COMBO-BOX']" mode="TITLE-LEFT">
					<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
					<xsl:with-param name="onChange">showPublishFields();</xsl:with-param>
					<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
				</xsl:apply-templates>
			</td>
		</tr>

		<tr id="rowHost">
			<xsl:if test="CONTROL[@NAME='hostId' and @HIDDEN]">
				<xsl:attribute name="style">display : none;</xsl:attribute>
			</xsl:if>
			<td colspan="2" style="padding-bottom: 4px;">
				<xsl:apply-templates select="CONTROL[@NAME='hostId' and @TYPE='COMBO-BOX']" mode="TITLE-LEFT">
					<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
					<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
				</xsl:apply-templates>
			</td>
		</tr>

		<tr>
			<td colspan="2" style="padding-bottom: 4px;">
				<xsl:apply-templates select="CONTROL[@NAME='hostingUrl']" mode="TITLE-LEFT">
					<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
					<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
					<xsl:with-param name="require">off</xsl:with-param>
					<xsl:with-param name="autoComplete">off</xsl:with-param>
				</xsl:apply-templates>
			</td>
		</tr>

		<tr id="rowVpsId">
			<xsl:if test="CONTROL[@NAME='vpsId' and @HIDDEN]">
				<xsl:attribute name="style">display : none;</xsl:attribute>
			</xsl:if>
			<td colspan="2" style="padding-bottom: 4px;">
				<xsl:apply-templates select="CONTROL[@NAME='vpsId']" mode="TITLE-LEFT">
					<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
					<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
					<xsl:with-param name="require">off</xsl:with-param>
					<xsl:with-param name="autoComplete">off</xsl:with-param>
				</xsl:apply-templates>
			</td>
		</tr>

		<tr id="rowDirectory">
			<xsl:if test="CONTROL[@NAME='directory' and @HIDDEN]">
				<xsl:attribute name="style">display : none;</xsl:attribute>
			</xsl:if>
			<td colspan="2" style="padding-bottom: 4px;">
				<xsl:apply-templates select="CONTROL[@NAME='directory']" mode="TITLE-LEFT">
					<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
					<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
					<xsl:with-param name="require">off</xsl:with-param>
					<xsl:with-param name="autoComplete">off</xsl:with-param>
				</xsl:apply-templates>
			</td>
		</tr>
		
		<tr id="rowUser">
			<xsl:if test="CONTROL[@NAME='user' and @HIDDEN]">
				<xsl:attribute name="style">display : none;</xsl:attribute>
			</xsl:if>
			<td colspan="2" style="padding-bottom: 4px;">
				<xsl:apply-templates select="CONTROL[@NAME='user']" mode="TITLE-LEFT">
					<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
					<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
					<xsl:with-param name="require">off</xsl:with-param>
					<xsl:with-param name="autoComplete">off</xsl:with-param>
				</xsl:apply-templates>
			</td>
		</tr>

		<tr id="rowGroup">
			<xsl:if test="CONTROL[@NAME='group' and @HIDDEN]">
				<xsl:attribute name="style">display : none;</xsl:attribute>
			</xsl:if>
			<td colspan="2" style="padding-bottom: 4px;">
				<xsl:apply-templates select="CONTROL[@NAME='group']" mode="TITLE-LEFT">
					<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
					<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
					<xsl:with-param name="require">off</xsl:with-param>
					<xsl:with-param name="autoComplete">off</xsl:with-param>
				</xsl:apply-templates>
			</td>
		</tr>

		<!-- START password -->
		<tr id="tableAuth" style="padding-bottom: 4px;">
			<xsl:if test="CONTROL[@NAME='password' and @HIDDEN]">
				<xsl:attribute name="style">display : none;</xsl:attribute>
			</xsl:if>
			<td width="50%" valign="top"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/AUTH-TYPE"/>
				<div style="color:#474747;font-family:Arial;font-size:11px;"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/AUTH-TYPE-DESC"/></div>
			</td>
			<td width="50%">
			<table border="0" width="100%">
				<tr>
					<td style="padding-bottom: 4px;">
						<input type="radio" name="hostingIsAnonymous" id="FtpCredentials_RadioButtonSpecified" value="0" onclick="auth(false);" style="padding-bottom: 4px;">
							<xsl:if test="CONTROL[@NAME='hostingIsAnonymous']/@VALUE = 0 or not(CONTROL[@NAME='hostingIsAnonymous']/@VALUE)">
								<xsl:attribute name="checked">true</xsl:attribute>
							</xsl:if>
						</input>
						<label for="FtpCredentials_RadioButtonSpecified"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/SPECIFY-ACCOUNT"/></label>
					</td>
				</tr>
				<tr>
					<td style="padding-bottom: 4px;">
						<xsl:apply-templates select="CONTROL[@NAME='login']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
							<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
							<xsl:with-param name="require">off</xsl:with-param>
							<xsl:with-param name="autoComplete">off</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				<tr id="rowPassword">
					<xsl:if test="CONTROL[@NAME='id']/@VALUE">
						<xsl:attribute name="style">display : none;</xsl:attribute>
					</xsl:if>
					<td style="padding-bottom: 4px;">
						<xsl:apply-templates select="CONTROL[@NAME='password']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
							<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
							<xsl:with-param name="type">password</xsl:with-param>
							<xsl:with-param name="require">off</xsl:with-param>
							<xsl:with-param name="autoComplete">off</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				<tr id="rowConfirmPassword">
					<xsl:if test="CONTROL[@NAME='id']/@VALUE">
						<xsl:attribute name="style">display : none;</xsl:attribute>
					</xsl:if>
					<td style="padding-bottom: 4px;">
						<xsl:apply-templates select="CONTROL[@NAME='confirmPassword']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
							<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
							<xsl:with-param name="type">password</xsl:with-param>
							<xsl:with-param name="require">off</xsl:with-param>
							<xsl:with-param name="autoComplete">off</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				<tr id="rowSetPassword">
					<xsl:if test="not(CONTROL[@NAME='id']/@VALUE)">
						<xsl:attribute name="style">display : none;</xsl:attribute>
					</xsl:if>
					<td align="left" style="padding-left: 7px">
						<xsl:call-template name="BUTTON-CONTROL">
							<xsl:with-param name="class">SB_LoginControlButton</xsl:with-param>
							<xsl:with-param name="title">
								<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/CHANGE-PASSWORD"/>
							</xsl:with-param>
							<xsl:with-param name="action">showPassword();</xsl:with-param>
						</xsl:call-template>
					</td>
				</tr>
				<tr>
					<td style="padding-bottom: 4px;">
						<input type="radio" name="hostingIsAnonymous" id="FtpCredentials_RadioButtonAnonymous" value="1" onclick="auth(true);" style="padding-bottom: 4px;">
							<xsl:if test="CONTROL[@NAME='hostingIsAnonymous']/@VALUE = 1">
								<xsl:attribute name="checked">true</xsl:attribute>
							</xsl:if>
						</input>
						<label for="FtpCredentials_RadioButtonAnonymous"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/USE-ANONYMOUS-ACCOUNT"/></label>
					</td>
				</tr>
			</table>
			</td>
		</tr>
		<!-- END password -->
	</table>
</fieldset>
<br/>
</xsl:if>

<xsl:variable name="hideKnownInputs"></xsl:variable>

<xsl:if test="ENABLE-KNOWN-PUBLISH='true'">
<fieldset class="SB_Form_FieldSet">
	<legend><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/KNOWN-LEGEND"/></legend>
	<table width="100%" cellpadding="0" cellspacing="0" border="0">

		<tr>
			<td colspan="2" style="padding-bottom: 4px;">
				<xsl:apply-templates select="CONTROL[@NAME='knownHost']" mode="TITLE-LEFT">
					<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
					<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
					<xsl:with-param name="require">off</xsl:with-param>
				</xsl:apply-templates>
			</td>
		</tr>

		<tr>
			<td colspan="2" style="padding-bottom: 4px;">
				<xsl:apply-templates select="CONTROL[@NAME='knownUrl']" mode="TITLE-LEFT">
					<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
					<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
					<xsl:with-param name="require">off</xsl:with-param>
					<xsl:with-param name="autoComplete">off</xsl:with-param>
				</xsl:apply-templates>
			</td>
		</tr>

		<tr>
			<td colspan="2" style="padding-bottom: 4px;">
				<xsl:apply-templates select="CONTROL[@NAME='knownDirectory']" mode="TITLE-LEFT">
					<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
					<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
					<xsl:with-param name="require">off</xsl:with-param>
					<xsl:with-param name="autoComplete">off</xsl:with-param>
				</xsl:apply-templates>
			</td>
		</tr>

		<tr style="padding-bottom: 4px;">
			<td width="50%" valign="top">
				<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/AUTH-TYPE"/>
				<div style="color:#474747;font-family:Arial;font-size:11px;"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/AUTH-TYPE-DESC"/></div>
			</td>
			<td width="50%">
			<table border="0" width="100%">
				<tr>
					<td style="padding-bottom: 4px;">
						<input type="radio" name="knownIsAnonymous" id="knownFtpCredentials_RadioButtonSpecified" value="0" onclick="knowAuth(false);" style="padding-bottom: 4px;">
							<xsl:if test="CONTROL[@NAME='knownIsAnonymous']/@VALUE = 0 or not(CONTROL[@NAME='knownIsAnonymous']/@VALUE)">
								<xsl:attribute name="checked">true</xsl:attribute>
							</xsl:if>
						</input>
						<label for="knownFtpCredentials_RadioButtonSpecified"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/SPECIFY-ACCOUNT"/></label>
					</td>
				</tr>
				<tr>
					<td style="padding-bottom: 4px;">
						<xsl:apply-templates select="CONTROL[@NAME='knownLogin']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
							<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
							<xsl:with-param name="require">off</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				<tr id="rowKnownPassword">
					<xsl:if test="CONTROL[@NAME='id']/@VALUE">
						<xsl:attribute name="style">display : none;</xsl:attribute>
					</xsl:if>
					<td style="padding-bottom: 4px;">
						<xsl:apply-templates select="CONTROL[@NAME='knownPassword']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
							<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
							<xsl:with-param name="type">password</xsl:with-param>
							<xsl:with-param name="require">off</xsl:with-param>
							<xsl:with-param name="autoComplete">off</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				<tr id="rowConfirmKnownPassword">
					<xsl:if test="CONTROL[@NAME='id']/@VALUE">
						<xsl:attribute name="style">display : none;</xsl:attribute>
					</xsl:if>
					<td style="padding-bottom: 4px;">
						<xsl:apply-templates select="CONTROL[@NAME='confirmKnownPassword']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">SB_Control_Input_Input</xsl:with-param>
							<xsl:with-param name="controlStyle"><xsl:value-of select="$style"/></xsl:with-param>
							<xsl:with-param name="type">password</xsl:with-param>
							<xsl:with-param name="require">off</xsl:with-param>
							<xsl:with-param name="autoComplete">off</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				<tr id="rowSetKnownPassword">
					<xsl:if test="not(CONTROL[@NAME='id']/@VALUE)">
						<xsl:attribute name="style">display : none;</xsl:attribute>
					</xsl:if>
					<td align="left" style="padding-left: 7px">
						<xsl:call-template name="BUTTON-CONTROL">
							<xsl:with-param name="class">SB_LoginControlButton</xsl:with-param>
							<xsl:with-param name="title">
								<xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/CHANGE-PASSWORD"/>
							</xsl:with-param>
							<xsl:with-param name="action">showKnownPassword();</xsl:with-param>
						</xsl:call-template>
					</td>
				</tr>
				<tr>
					<td style="padding-bottom: 4px;">
						<input type="radio" name="knownIsAnonymous" id="knownFtpCredentials_RadioButtonAnonymous" value="1" onclick="knowAuth(true);" style="padding-bottom: 4px;">
							<xsl:if test="CONTROL[@NAME='knownIsAnonymous']/@VALUE = 1">
								<xsl:attribute name="checked">true</xsl:attribute>
							</xsl:if>
						</input>
						<label for="knownFtpCredentials_RadioButtonAnonymous"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/USE-ANONYMOUS-ACCOUNT"/></label>
					</td>
				</tr>
			</table>
			</td>
		</tr>
		<!-- END password -->
	</table>
</fieldset>
</xsl:if>

<script type="text/javascript">
function showPassword(){
	showElement(document.getElementById("rowPassword"), true);
	showElement(document.getElementById("rowConfirmPassword"), true);
	showElement(document.getElementById("rowSetPassword"), false);
	return false;
}
function auth(flag){
	document.getElementById("login").disabled = flag;
	document.getElementById("password").disabled = flag;
	document.getElementById("confirmPassword").disabled = flag;
}
function showKnownPassword(){
	showElement(document.getElementById("rowKnownPassword"), true);
	showElement(document.getElementById("rowConfirmKnownPassword"), true);
	showElement(document.getElementById("rowSetKnownPassword"), false);
	return false;
}
function knowAuth(flag){
	document.getElementById("knownLogin").disabled = flag;
	document.getElementById("knownPassword").disabled = flag;
	document.getElementById("confirmKnownPassword").disabled = flag;
}
</script>
<xsl:if test="CONTROL[@NAME='hostingIsAnonymous']/@VALUE = 1">
<script type="text/javascript">auth(true);</script>
</xsl:if>

<xsl:if test="CONTROL[@NAME='knownIsAnonymous']/@VALUE = 1">
<script type="text/javascript">knowAuth(true);</script>
</xsl:if>
</xsl:template>

</xsl:stylesheet>