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

	<xsl:template match="DASHBOARD-CONTENT">
		<style>
			.sb-pagetitle { border-bottom: solid 1px #776655; }
		</style>
		<table width="100%" cellpadding="0">
<!--			<tr>
				<td colspan="2">&#160;</td>
			</tr> -->
			<xsl:if test="DASHBOARD-PANEL[@TYPE='TIPS']">
				<tr>
					<td colspan="2" style="padding: 0 5 10 5;">
						<xsl:apply-templates select="DASHBOARD-PANEL[@TYPE='TIPS']"/>
					</td>
				</tr>
			</xsl:if>
			<tr>
				<td style="width: 50%; padding: 0 5 0 5;" valign="top">
					<xsl:apply-templates select="DASHBOARD-PANEL[@TYPE='TASKS']"/>
				</td>
				<td style="width: 50%; padding: 0 5 0 5;" valign="top">
					<xsl:apply-templates select="DASHBOARD-PANEL[@TYPE='STAT']"/>
				</td>
			</tr>
		 </table>
	</xsl:template>
	
	<xsl:template name="DASHBOARD-PANEL-TITLE">
		<tr>
			<td class="sb-dashboard-panel-corner" style="width:3px;" background="{$skinPath}/images/dashboard_tl.gif">
				<img src="{$skinPath}/images/empty.gif" width="3" alt=""/>
			</td>
			<td class="sb-dashboard-panel-header">
				<table cellpadding="0" cellspacing="0" border="0" style="width:100%;height:100%;">
					<tr>
						<td align="Left" class="sb-dashboard-panel-header-text"><xsl:value-of select="@TITLE"/></td>
						<td align="Right" valign="Middle"></td>
					</tr>
				</table>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="DASHBOARD-PANEL-FOOTER1">
		<tr>
			<td class="sb-dashboard-bottom" align="right" valign="middle">
				<table cellpadding="0" cellspacing="0" border="0" style="cursor:pointer;">
					<xsl:attribute name="onclick">javascript: doAdminNavigate('<xsl:value-of select="$baseUrl"/>/Admin/Desktop/HideGettingStarted');</xsl:attribute>	

					<tr>
						<td style="width:0px;"></td><td align="center" valign="middle"><img src="{$skinPath}/icons/close.png" width="16" height="16" alt=""/></td><td align="left" class="sb-dashboard-bottom-link" style="padding-left:5px;padding-right:5px;"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/CLOSE-GETTING-STARTED"/></td>
					</tr>
				</table>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="DASHBOARD-PANEL-FOOTER">
		<tr>
			<td colspan="2" class="sb-dashboard-bottom">&#160;</td>
		</tr>
	</xsl:template>
	
	
	<xsl:template match="DASHBOARD-PANEL[@TYPE='TIPS']">
   		<table cellpadding="0" cellspacing="0" border="0" style="width:100%;">
   			<xsl:call-template name="DASHBOARD-PANEL-TITLE"/>
			<tr>
				<td class="sb-dashboard-panel-content" colspan="2" style="padding-bottom:0px;padding-top:0px;">
					<table cellspacing="0" width="100%" cellpadding="0" border="0" style="height: 100%;">
						<tr>
							<td align="left" class="sb-dashboard-top" style="padding-left: 15px;">
                                <xsl:value-of select="@DESCRIPTION"/>
                            </td>
						</tr>
						<tr>
							<td>
								<table class="sb-gettingstarted" cellspacing="10" width="100%" border="0">
									<tr>
										<xsl:for-each select="DASHBOARD-PANEL-ITEM">
											<td width="25%" class="sb-gettingstarted-item">
												<span class="sb-gettingstarted-title"><xsl:value-of select="@TITLE"/></span>
												<br />
												<div class="sb-getting-started-description" style="padding: 5 0 5 0"><xsl:value-of select="@DESCRIPTION"/></div>
												 <a href="#" class="sb-gettingstarted-link" style="color: rgb(2, 64, 163); font-weight: normal;">
												 	<xsl:attribute name="href"><xsl:value-of select="@ACTION"/></xsl:attribute>
												 	<xsl:value-of select="@ADDITIONAL-LINK"/>
												 </a>
											</td>
										</xsl:for-each>
									</tr>
									
									<xsl:if test="count(CONTROL[@TYPE='INPUT']) > 0">
										<tr>
											<td colspan="4" class="sb-gettingstarted-item">
												<table cellspacing="0" width="100%" border="0">
													<script type="text/javascript" src="/js/Admin/Sites.js?{$version}.{$build}"/>
													
													<form id="ownSite" method="post" name="ownSite" onsubmit="javascript:return validateOwnForm();">
														<xsl:attribute name="action"><xsl:value-of select="$baseUrl"/>/Admin/Site/Own</xsl:attribute>
												
														<xsl:for-each select="CONTROL[@TYPE='INPUT']">
															<tr>
																<td>
																	<xsl:apply-templates select="." 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:apply-templates>
																</td>
															</tr>
															<tr>
																<td>
																	<table cellspacing="0" width="100%" border="0">
																		<td style="width: 50%">&#160;</td>
																		<td style="width: 50%"><span class="sb-text-pale"><xsl:value-of select="@HINT"/></span></td>
																	</table>
																</td>
															</tr>
														</xsl:for-each>
														
														<tr>
															<td align="right" style="padding-right: 10px;">
																<table cellspacing="0" cellpaddig="0" width="70" border="0">
																	<tr><td>
																		
																		<xsl:apply-templates select="CONTROL[@TYPE='BUTTON']">
																			<xsl:with-param name="style">width:90px;</xsl:with-param>
																			<xsl:with-param name="action">javascript: submitOwnForm();</xsl:with-param>
																		</xsl:apply-templates>
																	</td></tr>
																</table>
															</td>
														</tr>
													</form>
													
												</table>
											</td>
										</tr>
									</xsl:if>
									
									<tr>
										<td colspan="4">
											<a class="sb-dashboard-link">
												<xsl:attribute name="href">javascript:openWizard('<xsl:value-of select="@BOTTOM-LINK"/>?<xsl:value-of select="/SITEBUILDER-PAGE/PROPERTIES/SESSION/@NAME"/>=<xsl:value-of select="/SITEBUILDER-PAGE/PROPERTIES/SESSION/@VALUE"/>');</xsl:attribute>
												<xsl:value-of select="@BOTTOM-DESCRIPTION"/>
											</a>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<xsl:call-template name="DASHBOARD-PANEL-FOOTER1"/>
					</table>
				</td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template match="DASHBOARD-PANEL[@TYPE='TASKS']">
	   <xsl:variable name="total" select="count(DASHBOARD-PANEL-ITEM)"/>
	   <xsl:variable name="columns" select="2"/>
   		<table cellpadding="0" cellspacing="0" border="0" style="width: 100%;">			
   			<xsl:call-template name="DASHBOARD-PANEL-TITLE"/>
			<tr>
				<td class="sb-dashboard-panel-content" colspan="2" style="padding-bottom:0px;padding-top:5px;">
					<table cellspacing="0" width="100%" cellpadding="5" border="0">
						<xsl:call-template name="DASHBOARD-PANEL-ROW">
							<xsl:with-param name="start" select="1"/>
							<xsl:with-param name="columns" select="$columns"/>
							<xsl:with-param name="total" select="$total"/>
						</xsl:call-template>
						<xsl:call-template name="DASHBOARD-PANEL-FOOTER"/>
					</table>
				</td>
			</tr>
		</table>
  	</xsl:template>
	
	<xsl:template match="DASHBOARD-PANEL[@TYPE='STAT']">
		<table cellpadding="0" cellspacing="0" border="0" style="width:100%;">
   			<xsl:call-template name="DASHBOARD-PANEL-TITLE"/>
			<tr>
				<td class="sb-dashboard-panel-content" colspan="2" style="padding-bottom:0px;padding-top:0px;">
					<table cellspacing="0" cellpadding="5" border="0" style="width:100%;border-collapse:collapse;">
						<xsl:for-each select="DASHBOARD-PANEL-ITEM|DASHBOARD-PANEL-SLIDER">
							<tr>
								<td valign="middle" style="width:30%;white-space:nowrap;">
									<xsl:if test="name()='DASHBOARD-PANEL-SLIDER'">
										<xsl:attribute name="rowspan">2</xsl:attribute>
									</xsl:if>
									<table>
										<tr>
											<td>
												<img style="border-width:0px;" width="16" height="16" alt="">
													<xsl:attribute name="src"><xsl:value-of select="$skinPath"/>/icons/<xsl:value-of select="@ICON"/></xsl:attribute>
												</img>
											</td>
											<td style="padding-left: 10px;" class="sb-dashboard-item-description"><xsl:value-of select="@TITLE"/></td>
										</tr>
									</table>
								</td>
								<td style="white-space:nowrap;" class="sb-dashboard-item-description"><xsl:value-of select="@DESCRIPTION"/></td>
							</tr>
							<xsl:if test="name()='DASHBOARD-PANEL-SLIDER'">
							<tr>
								<td style="white-space:nowrap;padding-bottom:0px;padding-top:0px;padding-left:4px;padding-right:5px;">
									<xsl:apply-templates match="GAUGE-CONTROL"/>
								</td>
							</tr>
							</xsl:if>
						</xsl:for-each>
   						<xsl:call-template name="DASHBOARD-PANEL-FOOTER"/>
					</table>
				</td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template name="DASHBOARD-PANEL-ROW">
		<xsl:param name="start"/>
	   	<xsl:param name="columns"/>
	   	<xsl:param name="total"/>
	   	<xsl:variable name="next" select="$start + $columns"/>
	   	<tr>
			<xsl:for-each select="DASHBOARD-PANEL-ITEM[position() &gt;= $start and position() &lt; $next]">
			<td style="width: 50%">
				<table>
					<xsl:if test="@DISABLED = '1'">
						<xsl:attribute name="style">filter: gray alpha(opacity=40); -moz-opacity: 0.4; opacity: 0.4;</xsl:attribute>
					</xsl:if>
					<xsl:attribute name="onmouseover">SetContextHelp('<xsl:value-of select="@CONTEXT-HELP"/>')</xsl:attribute>
					<xsl:attribute name="onmouseout">SetContextHelp()</xsl:attribute>
				
					<tr>
						<td rowspan="2" valign="top" align="left">
						
							<xsl:choose>
								<xsl:when test="@DISABLED = '1'">
									<img width="32" height="32" style="border-width:0px;" alt="">
										<xsl:attribute name="src"><xsl:value-of select="$skinPath"/>/icons/<xsl:value-of select="@ICON"/></xsl:attribute>
									</img>
								</xsl:when>
								<xsl:otherwise>
									<a href="#" class="sb-dashboard-item-title-link" style="color: rgb(2, 64, 163); font-weight: bold;">
										<xsl:choose>
											<xsl:when test="substring-before(@ACTION,':')='javascript'">
												<xsl:attribute name="onclick"><xsl:value-of select="@ACTION"/></xsl:attribute>
												<xsl:attribute name="href">#</xsl:attribute>
											</xsl:when>
											<xsl:otherwise>
												<xsl:attribute name="href"><xsl:value-of select="@ACTION"/></xsl:attribute>
											</xsl:otherwise>
										</xsl:choose>
										<img width="32" height="32" style="border-width:0px;" alt="">
											<xsl:attribute name="src"><xsl:value-of select="$skinPath"/>/icons/<xsl:value-of select="@ICON"/></xsl:attribute>
										</img>
									</a>
								</xsl:otherwise>
							</xsl:choose>
						</td>
						<td style="padding-left:10px;" valign="top">
							<xsl:choose>
								<xsl:when test="@DISABLED = '1'">
									<span class="sb-dashboard-item-title-link" style="color: rgb(2, 64, 163); font-weight: bold;"><xsl:value-of select="@TITLE"/></span>
								</xsl:when>
								<xsl:otherwise>
									<a href="#" class="sb-dashboard-item-title-link" style="color: rgb(2, 64, 163); font-weight: bold;">
										<xsl:choose>
											<xsl:when test="substring-before(@ACTION,':')='javascript'">
												<xsl:attribute name="onclick"><xsl:value-of select="@ACTION"/></xsl:attribute>
												<xsl:attribute name="href">#</xsl:attribute>
											</xsl:when>
											<xsl:otherwise>
												<xsl:attribute name="href"><xsl:value-of select="@ACTION"/></xsl:attribute>
											</xsl:otherwise>
										</xsl:choose>
										<xsl:value-of select="@TITLE"/>
									</a>
								</xsl:otherwise>
							</xsl:choose>
								
							
						</td>
					</tr>
					<tr>
						<td style="padding-left:10px;" valign="top" class="sb-dashboard-item-description"><xsl:value-of select="@DESCRIPTION"/></td>
					</tr>
				</table>
			</td>
		  </xsl:for-each>
		  <xsl:call-template name="DASHBOARD-PANEL-EMPTY-CELL">
			 <xsl:with-param name="next" select="$next - 1"/>
			 <xsl:with-param name="total" select="$total"/>
		  </xsl:call-template>
	   </tr>
	   <xsl:if test="$next &lt;= $total">
		  <xsl:call-template name="DASHBOARD-PANEL-ROW">
			 <xsl:with-param name="start" select="$next"/>
			 <xsl:with-param name="columns" select="$columns"/>
			 <xsl:with-param name="total" select="$total"/>
		  </xsl:call-template>
	   </xsl:if>
	</xsl:template>
	
	
	<xsl:template name="DASHBOARD-PANEL-EMPTY-CELL">
	   <xsl:param name="next"/>
	   <xsl:param name="total"/>
	   <xsl:if test="$next &gt; $total">
		  <td>
			 <br />
		  </td>
		  <xsl:call-template name="DASHBOARD-PANEL-EMPTY-CELL">
			 <xsl:with-param name="next" select="$next - 1"/>
			 <xsl:with-param name="total" select="$total"/>		
		  </xsl:call-template>
	   </xsl:if>
	</xsl:template>	
	
	<xsl:template match="AREA-MAP-WARNING">
		<xsl:apply-templates select="STATUS" mode="admin"/>
	</xsl:template>	
	
	<xsl:template match="AREA-MAP-WARNING/STATUS/@STATUS-TEXT">
		<xsl:value-of select="."/>&#160;<a class="sb-dashboard-link" href="{$baseUrl}{../@COMMAND-HREF}"><xsl:value-of select="../@COMMAND-TITLE"/></a><br/>
	</xsl:template>	

</xsl:stylesheet>