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

<xsl:template match="VIEW-CONTENT">
	<style>
			.sb-formtableheader-th { background-color: #ffffff; }
			.sb-page { padding-top: 0; }
	</style>
<xsl:apply-templates select="/SITEBUILDER-PAGE/STATUS" mode="admin"/>
<script type="text/javascript" src="/js/Admin/Profile.js?{$version}.{$build}"/>
<form name="profileForm" method="POST" action="{$baseUrl}" onsubmit="submitForm(); return false;">
<input type="hidden" name="action" value="/Admin/Profile/Save"/>
<input type="hidden" name="tab" value=""/>
<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>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<td align="left" style="padding-left: 35px"><xsl:call-template name="REQUIRED-FIELDS"/></td>
		<td>
			<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/Profile/View';</xsl:with-param>
			</xsl:call-template>
		</td>
	</tr>
</table>
</xsl:template>


<xsl:template match="OBJECT[@TYPE='ACCOUNT']">
<table border="0" width="100%" cellpadding="2" cellspacing="0">
	<tr class="sb-formview-alternaterow">
		<td>
			<xsl:apply-templates select="CONTROL[@NAME='firstName']" mode="TITLE-LEFT">
				<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
				<xsl:with-param name="require">on</xsl:with-param>
				<xsl:with-param name="onChange">self.sbApplyChangesObject.registerChange();</xsl:with-param>
			</xsl:apply-templates>
		</td>
	</tr>
	<tr class="sb-formview-row">
		<td>
			<xsl:apply-templates select="CONTROL[@NAME='lastName']" mode="TITLE-LEFT">
				<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
				<xsl:with-param name="require">on</xsl:with-param>
				<xsl:with-param name="onChange">self.sbApplyChangesObject.registerChange();</xsl:with-param>
			</xsl:apply-templates>
		</td>
	</tr>
	<tr  class="sb-formview-alternaterow">
		<td>
			<xsl:apply-templates select="CONTROL[@NAME='userName']" mode="TITLE-LEFT" >
				<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
				<xsl:with-param name="disabled">1</xsl:with-param>
				<xsl:with-param name="onChange">self.sbApplyChangesObject.registerChange();</xsl:with-param>
			</xsl:apply-templates>
		</td>
	</tr>
		
	<tr id="rowSetPassword" class="sb-formview-row">
		<td>
			<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
				<tbody>
					<tr class="">
						<td style="width: 50%;">&#160;</td>
						<td style="padding-left: 5px;" class="sb-formview-padding-bottom sb-formview-padding-top">
							<xsl:call-template name="BUTTON-CONTROL">
								<xsl:with-param name="style">width: 120px;</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:value-of select="CONTROL[@NAME='ssoIsAppOwner']/@VALUE" />, &quot;<xsl:value-of select="CONTROL[@NAME='passwordChangeUrl']/@VALUE" />&quot;);</xsl:with-param>
							</xsl:call-template>
						</td>
					</tr>
				</tbody>
			</table>
		</td>
	</tr>
	
	
	<tr id="rowCurrentPassword" style="display: none;"  class="sb-formview-row">
		<td>
			<xsl:call-template name="INPUT-CONTROL" mode="TITLE-LEFT" type="PASSWORD">
				<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
				<xsl:with-param name="title"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/CURRENT-PASSWORD"/></xsl:with-param>
				<xsl:with-param name="name">currentPassword</xsl:with-param>
				<xsl:with-param name="id">currentPassword</xsl:with-param>
				<xsl:with-param name="type">password</xsl:with-param>
				<xsl:with-param name="onChange">self.sbApplyChangesObject.registerChange();</xsl:with-param>
			</xsl:call-template>
		</td>
	</tr>
	<tr id="rowPassword" style="display: none;" class="sb-formview-alternaterow">
		<td>
			<xsl:call-template name="INPUT-CONTROL" mode="TITLE-LEFT" type="PASSWORD">
				<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
				<xsl:with-param name="title"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/PASSWORD"/></xsl:with-param>
				<xsl:with-param name="name">password</xsl:with-param>
				<xsl:with-param name="id">password</xsl:with-param>
				<xsl:with-param name="type">password</xsl:with-param>
				<xsl:with-param name="onChange">self.sbApplyChangesObject.registerChange();</xsl:with-param>
			</xsl:call-template>
		</td>
	</tr>
	<tr id="rowPasswordConfirm" style="display: none;"  class="sb-formview-row">
		<td>
			<xsl:call-template name="INPUT-CONTROL" mode="TITLE-LEFT" type="PASSWORD">
				<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
				<xsl:with-param name="title"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/CONFIRM-PASSWORD"/></xsl:with-param>
				<xsl:with-param name="name">confirmPassword</xsl:with-param>
				<xsl:with-param name="id">confirmPassword</xsl:with-param>
				<xsl:with-param name="type">password</xsl:with-param>
				<xsl:with-param name="onChange">self.sbApplyChangesObject.registerChange();</xsl:with-param>
			</xsl:call-template>
		</td>
	</tr>
	<tr class="sb-formview-alternaterow">
		<td>
			<xsl:apply-templates select="CONTROL[@NAME='email']" mode="TITLE-LEFT">
				<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
				<xsl:with-param name="require">on</xsl:with-param>
				<xsl:with-param name="onChange">self.sbApplyChangesObject.registerChange();</xsl:with-param>
			</xsl:apply-templates>
		</td>
	</tr>
</table>
<script type="text/javascript">
function showPassword(isLocalUser, passwordChangeUrl) {
	if (!isLocalUser) {
		try { window.open(passwordChangeUrl,'_blank'); } 
		catch(e) { };
		return false;
	}
	showElement(document.getElementById("rowCurrentPassword"), true);
	showElement(document.getElementById("rowPassword"), true);
	showElement(document.getElementById("rowPasswordConfirm"), true);
	showElement(document.getElementById("rowSetPassword"), false);
	return false;
}
</script>
</xsl:template>

<xsl:template match="OBJECT[@TYPE='PROFILE']">
<table border="0" width="100%" cellpadding="2" cellspacing="0">
	<tr class="sb-formview-alternaterow">
		<td>
			<xsl:apply-templates select="CONTROL[@NAME='localeId' and @TYPE='COMBO-BOX']" mode="TITLE-LEFT">
				<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
				<xsl:with-param name="onChange">self.sbApplyChangesObject.registerChange();</xsl:with-param>
			</xsl:apply-templates>
		</td>
	</tr>
	<tr class="sb-formview-row">
		<td>
			<xsl:apply-templates select="CONTROL[@NAME='skinId' and @TYPE='COMBO-BOX']" mode="TITLE-LEFT">
				<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
				<xsl:with-param name="onChange">self.sbApplyChangesObject.registerChange();</xsl:with-param>
			</xsl:apply-templates>
		</td>
	</tr>
	<tr class="sb-formview-alternaterow">
		<td>
			<xsl:apply-templates select="CONTROL[@NAME='listSize']" mode="TITLE-LEFT">
				<xsl:with-param name="controlClass">sb-control-input-input</xsl:with-param>
				<xsl:with-param name="require">on</xsl:with-param>
				<xsl:with-param name="onChange">self.sbApplyChangesObject.registerChange();</xsl:with-param>
			</xsl:apply-templates>
		</td>
	</tr>
</table>
</xsl:template>

</xsl:stylesheet>