<?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="SITEBUILDER-PAGE">
		<script type="text/javascript" language="javascript" src="/js/navigation.js?{$version}.{$build}"/>
		<script type="text/javascript" language="javascript">
			baseUrl='<xsl:value-of select="$baseUrl"/>';
			var sbNavigationObject;
			sbNavigationObject = new SB_Navigation('<xsl:value-of select="APPLY-CHANGES/@FORM-ID"/>');
		</script>
	
		<table cellpadding="0" cellspacing="0" border="0" style="width: 100%; height: 100%" class="SB_Page">
			<xsl:if test="$hideNavigation != 1">
				<xsl:call-template name="MAIN-PAGE-HEADER"/>
			</xsl:if>
			<xsl:call-template name="MAIN-PAGE-CONTENT"/> 
			<xsl:call-template name="MAIN-PAGE-FOOTER"/>  
		</table>
		
		<xsl:if test="NAVIGATION/MENU-PANEL">
			<script type="text/javascript">
				<xsl:comment>
					AdminPanelCheckToResize();checkAdminPanelSize();
					<xsl:for-each select="SITEBUILDER-PAGE/NAVIGATION/MENU-PANEL">
						SBPanelToggle('<xsl:value-of select="@ID"/>','<xsl:value-of select="$skinPath"/>/images/show.gif','<xsl:value-of select="$skinPath"/>/images/hide.gif' );
					</xsl:for-each>
				</xsl:comment>
			</script>
		</xsl:if>
		
	</xsl:template>
	
	
	<xsl:template name="MAIN-PAGE-HEADER">
		<tr>
			<td class="SB_AdminPanel_Header">
				<xsl:if test="NAVIGATION">
					<xsl:attribute name="colspan">2</xsl:attribute>
				</xsl:if>
				<table class="SB_AdminPanel_Header_Inner" border="0" width="100%">
					<tr>
						<td valign="middle" style="padding-left:20;">
							<xsl:call-template name="HEADER-LOGO"/>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</xsl:template>
	
	
	<xsl:template name="MAIN-PAGE-CONTENT">
		<tr>
			<xsl:choose>
				<xsl:when test="$hideNavigation = 1">
					<td style="width: 0px"><form action="/" method="post" name="adminNavigation" id="adminNavigation"/></td>
				</xsl:when>
				<xsl:otherwise>
					<xsl:if test="NAVIGATION">
						<td style="height: 100%;"  class="SB_LeftMenu"><xsl:apply-templates select="NAVIGATION"/></td>
					</xsl:if>
				</xsl:otherwise>
			</xsl:choose>
		
			<td valign="top">
				<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"> 
					<tr>
						<td>
							<table class="SB_PageTitle" width="100%" cellpadding="0" cellspacing="0" border="0">
								<tr>
									<td colspan="2" class="SB_PageTitle_Path" align="left" >							
										<xsl:choose>
											<xsl:when test="VIEW-CONTENT/PATHS/PATH">
												<xsl:for-each select="VIEW-CONTENT/PATHS/PATH">
													<a style="color: Black; font-family: Tahoma,Arial,Helvetica,sans-serif; font-size: 11px; font-weight: normal;" href="#">
														<xsl:attribute name="onclick">javascript:sbNavigationObject.go('<xsl:value-of select="@ACTION"/>');</xsl:attribute>
														<xsl:value-of select="@TITLE"/>
													</a>
													&gt;
												</xsl:for-each>
											</xsl:when>
											<xsl:otherwise>
												<br/>
											</xsl:otherwise>
										</xsl:choose>
									</td>
								</tr>
								<tr>
									<td align="left" class="SB_PageTitle_Title">
										<xsl:value-of select="VIEW-CONTENT/@TITLE"/>
									</td>
									<td valign="middle" align="right" class="SB_PageTitle_LevelUp">
										<xsl:if test="VIEW-CONTENT/@LEVEL-UP-ACTION">
										<table cellpadding="3" cellspacing="0">
											<tr>
												<td>
													<a>
														<xsl:attribute name="href"><xsl:value-of select="VIEW-CONTENT/@LEVEL-UP-ACTION"/></xsl:attribute>		
														<img src="{$skinPath}/images/levelup.gif" border="0" alt=""/>
													</a>
												</td>
												<td>
													<a style="color:Black;" href="#">
														<xsl:attribute name="onclick">javascript:sbNavigationObject.go('<xsl:value-of select="VIEW-CONTENT/@LEVEL-UP-ACTION"/>');</xsl:attribute>
														<xsl:value-of select="VIEW-CONTENT/@LEVEL-UP-TITLE"/>
													</a>
												</td>
											</tr>
										</table>
										</xsl:if>
									</td>
								</tr>
							</table>
						</td>
					</tr>
<!--					<tr><td style="padding: 10px;">&#160;</td></tr> -->
					<tr>
						<td align="left" colspan="2" style="height: 100%; padding-top: 12px;">
							<div id="DivAdminPanel" style="overflow: auto; white-space: nowrap; width: 100; height: 100;">
								<xsl:apply-templates select="VIEW-CONTENT"/>
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</xsl:template>
	
	<xsl:template name="MAIN-PAGE-FOOTER">
		<!-- Nothing to do in PAGE-FOOTER -->
	</xsl:template>
	
	
	<xsl:template match="VIEW-CONTENT">
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td>&#160;</td>
				</tr>
				<tr>
					<td>					
						<xsl:apply-templates select="/SITEBUILDER-PAGE/ACTION-STATUS"/>
						<xsl:apply-templates/>
					</td>
				</tr>
		</table>
	</xsl:template>
	
	<xsl:template match="NAVIGATION">
		<script src='/js/panel_toggle.js?{$version}.{$build}' type='text/javascript'></script>
		<!-- style="width: 210px; height: 100%;"  -->
		<table cellpadding="0" cellspacing="0" border="0" style="width: 210px; height: 100%;"> 
			<tr>
				<td valign="top" class="SB_LeftMenu_Table"> <!-- style="height:99%; padding-top: 10px;" -->
					<div id="DivLeftMenu" style="width: 100%; overflow: auto; overflow-x: hidden; text-align: center; vertical-align: top; height: 100%;">
<!--						<table width="100%"><tr><td  class="SB_LeftMenu_Table" cellpadding="0" cellspacing="0"> -->
						<form action="/" method="post" name="adminNavigation" id="adminNavigation"> 
							<xsl:apply-templates select="MENU-PANEL"/>
						</form> 
<!--						</td></tr>
						</table> -->
					</div>
				</td>
			</tr>
			<tr>
				<td  class="SB_LeftMenu_Copyright" valign="Bottom">
					<table border="0" cellpadding="0" cellspacing="0" width="100%" valign="bottom">
						<tr>
							<td align="left" class="SB_LeftMenu_Copyright" style="white-space: nowrap;">
								<span onclick="window.open('http://swsoft.com', '_new'); return false;" style="cursor:pointer;">
									Powered by&#160;
									<img src="{$skinPath}/images/swsoft_logo_small_admin.gif" style="border-width:0px;" alt=""/>&#160;
								</span>
							</td>
						</tr>
						<tr>
							<td align="left" class="SB_LeftMenu_Horizontal_Separator" style="white-space: nowrap;">
								<img style="border-width: 0px; height: 1px;" src="/images/blank.gif"/>
							</td>
						</tr>
						<tr>
							<td align="left">&#169; Copyright 1999-2006 SWsoft, Inc. <br/>All Rights Reserved</td>
						</tr>
		
					</table>
				</td>
			</tr>
		</table> 

	</xsl:template>

	<xsl:template match="ACTION-STATUS[@STATUS='1']">
		<xsl:call-template name="ACTION-STATUS">
			<xsl:with-param name="styleClass">SB_Info_Message</xsl:with-param>
			<xsl:with-param name="icon">information.gif</xsl:with-param>
			<xsl:with-param name="title"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/INFO"/></xsl:with-param>
		</xsl:call-template>
	</xsl:template>

	<xsl:template match="ACTION-STATUS[@STATUS='2']">
		<xsl:call-template name="ACTION-STATUS">
			<xsl:with-param name="styleClass">SB_Error_Message</xsl:with-param>
			<xsl:with-param name="icon">error.gif</xsl:with-param>
			<xsl:with-param name="title"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/ERROR"/></xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	
	<xsl:template match="ACTION-STATUS[@STATUS='3']">
		<xsl:call-template name="ACTION-STATUS">
			<xsl:with-param name="styleClass">SB_Warning_Message</xsl:with-param>
			<xsl:with-param name="icon">warning.gif</xsl:with-param>
			<xsl:with-param name="title"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/WARNING"/></xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	
	<xsl:template name="ACTION-STATUS">
		<xsl:param name="styleClass"/>
		<xsl:param name="icon"/>
		<xsl:param name="title"/>
		
		<table style="width: 100%;" cellpadding="8">
			<tr>
				<td>
					<table border="0" class="{$styleClass}" style="width: 100%;">
						<tr>
							<td style="text-valign:middle"><img src="{$skinPath}/icons/{$icon}" style="border-width:0px;"/></td>
							
							<td><xsl:value-of select="$title"/>:</td>
							<td width="100%" style="color:Black;font-family:Tahoma,Arial,Helvetica,sans-serif;font-size:11px;font-weight:normal;">
								<xsl:for-each select="MESSAGE">
									<xsl:value-of select="."/><br/>
								</xsl:for-each>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</xsl:template>

</xsl:stylesheet>