﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
	<xsl:import href="NumberDataEntryControlTemplates.xslt"/>
	<xsl:output method="xml" indent="yes"/>

	<xsl:template match="/">
		<style>
			.font10
			{
			font-size:8px;font-weight:300;color:#333;
			}
			.inpsmal{    height: 25px!important;
			padding: 2px 12px!important;
			font-size: 12px!important;
			line-height: 1!important;color:#333!important;}
			.nmberFont{color:#333!important;}
			.fornw{    margin: 0px 3px!important;	width: 97%!important;}
			.nwstyle{    padding: 9px 0;	width: 100%;float: left;	background: #d0cece;	margin-bottom: 4px;}
			.nmberFont{font-size:12px;}
			.wid100{width:100%!important}
			.leftincr{height: 16px;	vertical-align: middle;	line-height: 16px!Important;		padding: 0px 10px;}
			.midiv{font-size: 10px;padding:7px;height: 10px;}
			.ritdec{padding: 0px 7px;font-size:11px;}
		</style>
		<xsl:variable name="MasterPortalItemID" select="AjaxRequest/Params/MasterPortalItemID"></xsl:variable>
		<xsl:variable name="PortalItemID" select="AjaxRequest/Params/PortalItemID"></xsl:variable>
		<xsl:variable name="MetricList" select="AjaxRequest/Metrics/."></xsl:variable>
		<xsl:variable name="NumberGoalDataXML" select="AjaxRequest/NumberGoalDataXML"></xsl:variable>
		<xsl:variable name="MetricKey" select="AjaxRequest/Params/MetricKey"></xsl:variable>
		<xsl:variable name="MetricKeyDisplay" select="$NumberGoalDataXML/Metrics/Metric[Metric = $MetricKey]/MetricDisplay"></xsl:variable>
		<xsl:variable name="CurrentPage" select="AjaxRequest/Params/PageNumber"></xsl:variable>
		<xsl:variable name="UserID" select="AjaxRequest/Params/UserID"></xsl:variable>
		<xsl:variable name="GoalItemID" select="AjaxRequest/Params/GoalItemID"></xsl:variable>
		<xsl:variable name="NumberFormat" select="$NumberGoalDataXML/Metrics/Metric/GoalNumberFormat"></xsl:variable>
		<xsl:variable name="PeriodType" select="$NumberGoalDataXML/Metrics/Metric[Metric = $MetricKey]/PeriodType"></xsl:variable>
		<xsl:variable name="InputType" select="$NumberGoalDataXML/Metrics/Metric[Metric = $MetricKey]/InputType"></xsl:variable>
		<xsl:variable name="ItemID" select="$NumberGoalDataXML/Metrics/Metric[Metric = $MetricKey]/ItemID"></xsl:variable>
		<xsl:variable name="IsSecureConnection" select="AjaxRequest/IsSecureConnection"></xsl:variable>
		<xsl:variable name="MetricData" select="$NumberGoalDataXML/Metrics/Metric[Metric = $MetricKey]/MetricData/."></xsl:variable>

		<!--<xsl:variable name="NextMetric" select="$MetricList/Metric[MetricKey = $MetricKey]/following-sibling::Metric[1]/MetricKey"></xsl:variable>
		<xsl:variable name="PrevMetric" select="$MetricList/Metric[MetricKey = $MetricKey]/preceding-sibling::Metric[1]/MetricKey"></xsl:variable>-->
		<xsl:variable name="NextMetric" select="$MetricList/Metric[MetricKey = $MetricKey]/following-sibling::Metric[InputType != 'None' and InputType != 'Label'][1]/MetricKey"></xsl:variable>
		<xsl:variable name="PrevMetric" select="$MetricList/Metric[MetricKey = $MetricKey]/preceding-sibling::Metric[InputType != 'None' and InputType != 'Label'][1]/MetricKey"></xsl:variable>



		<xsl:variable name="HostName" select="normalize-space(AjaxRequest/HostName)"></xsl:variable>
		<xsl:variable name="SelectedYear" select="AjaxRequest/Params/SelectedYear"></xsl:variable>
		<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
		<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
		<xsl:variable name="Classification" select="AjaxRequest/Params/Classification"></xsl:variable>

		<xsl:variable name="LoweredCasePeriodType" select="translate($PeriodType, $uppercase, $smallcase)"></xsl:variable>

		<xsl:variable name="TotalPages" select="$NumberGoalDataXML/PeriodData/Period[translate(PeriodType, $uppercase, $smallcase)=$LoweredCasePeriodType]/TotalPages"></xsl:variable>
		<xsl:variable name="NextPage" select="$CurrentPage+1"></xsl:variable>
		<xsl:variable name="PrePage" select="($CurrentPage)-1"></xsl:variable>

		<xsl:variable name="MaxYear" select="AjaxRequest/MaxYear"></xsl:variable>
		<xsl:variable name="MinYear" select="AjaxRequest/MinYear"></xsl:variable>

		<xsl:variable name="EscapedMetricKey">
			<xsl:call-template name="replaceCharsInString">
				<xsl:with-param name="stringIn" select="$MetricKey"></xsl:with-param>
				<xsl:with-param name="charsIn">
					<xsl:text>'</xsl:text>
				</xsl:with-param>
				<xsl:with-param name="charsOut">
					<xsl:text>\'</xsl:text>
				</xsl:with-param>
			</xsl:call-template>
		</xsl:variable>

		<xsl:variable name="EscapedNextMetricKey">
			<xsl:call-template name="replaceCharsInString">
				<xsl:with-param name="stringIn" select="$NextMetric"></xsl:with-param>
				<xsl:with-param name="charsIn">
					<xsl:text>'</xsl:text>
				</xsl:with-param>
				<xsl:with-param name="charsOut">
					<xsl:text>\'</xsl:text>
				</xsl:with-param>
			</xsl:call-template>
		</xsl:variable>

		<xsl:variable name="EscapedPrevMetricKey">
			<xsl:call-template name="replaceCharsInString">
				<xsl:with-param name="stringIn" select="$PrevMetric"></xsl:with-param>
				<xsl:with-param name="charsIn">
					<xsl:text>'</xsl:text>
				</xsl:with-param>
				<xsl:with-param name="charsOut">
					<xsl:text>\'</xsl:text>
				</xsl:with-param>
			</xsl:call-template>
		</xsl:variable>
		<xsl:variable name="Protocol">
			<xsl:choose>
				<xsl:when test="$IsSecureConnection = 1">
					<xsl:text>https://</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>http://</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="NumbersEnteredBy" select="AjaxRequest/ActionCounts/NumbersEnteredBy">
		</xsl:variable>
		<xsl:variable name="pageNext">
			goalNumberDataEntryPanelForMetric('optMyNumberGoals','<xsl:value-of select="$NextPage"></xsl:value-of>'
			,'7','optMyNumbersDBUser','<xsl:value-of select="$EscapedMetricKey"></xsl:value-of>','divNumbersLeaderBoard','<xsl:value-of select="$MasterPortalItemID"></xsl:value-of>');
		</xsl:variable>
		<xsl:variable name="pagePrev">
			<xsl:choose>
				<xsl:when test="$PrePage!=0">
					goalNumberDataEntryPanelForMetric('optMyNumberGoals','<xsl:value-of select="$PrePage"></xsl:value-of>'
					,'7','optMyNumbersDBUser','<xsl:value-of select="$EscapedMetricKey"></xsl:value-of>','divNumbersLeaderBoard','<xsl:value-of select="$MasterPortalItemID"></xsl:value-of>');
				</xsl:when>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="NextMetricPage">
			goalNumberDataEntryPanelForMetric('optMyNumberGoals','1','7','optMyNumbersDBUser','<xsl:value-of select="$EscapedNextMetricKey"/>'
			,'divNumbersLeaderBoard','<xsl:value-of select="$MasterPortalItemID"></xsl:value-of>');
		</xsl:variable>
		<xsl:variable name="PrevMetricPage">
			goalNumberDataEntryPanelForMetric('optMyNumberGoals','1','7','optMyNumbersDBUser','<xsl:value-of select="$EscapedPrevMetricKey"/>'
			,'divNumbersLeaderBoard','<xsl:value-of select="$MasterPortalItemID"></xsl:value-of>');
		</xsl:variable>
		<xsl:variable name="PrevYear">
			<xsl:value-of select="$SelectedYear - 1"/>
		</xsl:variable>
		<xsl:variable name="NxtYear">
			<xsl:value-of select="$SelectedYear + 1"/>
		</xsl:variable>
		<xsl:variable name="PrevYearClass">
			<xsl:choose>
				<xsl:when test="$PrevYear &lt; $MinYear">
					<xsl:text>disabledArrow</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text></xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="NxtYearClass">
			<xsl:choose>
				<xsl:when test="$NxtYear &gt; $MaxYear">
					<xsl:text>disabledArrow</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text></xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<div>
			<!--<div class="col-md-12  col-sm-12  col-xs-12 padg0 borderBtm" style="margin:20px 0;">
				<span class="col-md-3 col-sm-3 col-xs-2">
					<a href="#" onclick="return false">
						<xsl:if test="$PrevMetric[text()]">
							<i class="glyphicon glyphicon-menu-left pre" style="float:right;" onclick="{$PrevMetricPage}"></i>
						</xsl:if>
					</a>
				</span>
				<span class="col-md-6 col-sm-6 col-xs-8 cntrMet " style="color: rgba(0, 0, 0, 0.42);">
					<xsl:value-of  select="$MetricKeyDisplay"/>
				</span>
				<span class="col-md-3 col-sm-3 col-xs-2">
					<a href="#" onclick="return false">
						<xsl:if test="$NextMetric[text()]">
							<i class="glyphicon glyphicon-menu-right pre" style="float:left;" onclick="{$NextMetricPage}"></i>
						</xsl:if>
					</a>
				</span>
			</div>-->


			<div  id="no-more-tables" class="newtable">
				<table class="table-bordered table-condensed cf" cellspacing="5" cellpadding="7">
					<thead class="cf">
						<tr>
							<th style="background-color:#ecf1f7;" >
								<i class="glyphicon glyphicon-menu-left  onMouseOver {$PrevYearClass}" style="margin-right:2px; font-weight: bolder;"
								   onclick="goalNumberDataEntryPanelForBusinessPlanMetric({$GoalItemID},1,12,{$UserID},'{$MetricKey}','divNumbersLeaderBoard',{$MasterPortalItemID},{$PrevYear},{$PortalItemID},'{$Classification}');"></i>
								<xsl:value-of select="$SelectedYear"/>
								<i class="glyphicon glyphicon-menu-right  onMouseOver {$NxtYearClass}" style="margin-left:2px;font-weight: bolder;"
								   onclick="goalNumberDataEntryPanelForBusinessPlanMetric({$GoalItemID},1,12,{$UserID},'{$MetricKey}','divNumbersLeaderBoard',{$MasterPortalItemID},{$NxtYear},{$PortalItemID},'{$Classification}');"></i>
								<!--<i class="glyphicon glyphicon-menu-left  onMouseOver {$PrevYearClass}" style="margin-right:2px; font-weight: bolder;"
								   onclick="loadBusinessPlanResults_3_0_Core('divBusinessPlanDashboardOpertaions', {$UserID}, {$MasterPortalItemID}, {$PortalItemID},'{$Classification}', '01/01/{$PrevYear}');"></i>
								<xsl:value-of select="$SelectedYear"/>
								<i class="glyphicon glyphicon-menu-right  onMouseOver {$NxtYearClass}" style="margin-left:2px;font-weight: bolder;"
								   onclick="loadBusinessPlanResults_3_0_Core('divBusinessPlanDashboardOpertaions', {$UserID}, {$MasterPortalItemID}, {$PortalItemID},'{$Classification}', '01/01/{$NxtYear}');"></i>-->
							</th>
							<th style="background-color:#ecf1f7;">Actual</th>
						</tr>
					</thead>
					<tbody>
						<xsl:for-each select="$NumberGoalDataXML/PeriodData/Period[translate(PeriodType, $uppercase, $smallcase)=$LoweredCasePeriodType]">
							<xsl:sort select="PeriodKey"/>
							<xsl:variable name="PeriodYear">
								<xsl:value-of select="substring(PeriodKey,1,4)"/>
							</xsl:variable>
							<xsl:if test="$PeriodYear=$SelectedYear">
								<xsl:variable name="currentPeriodKey" select="PeriodKey"></xsl:variable>
								<xsl:variable name="position" select="position()"></xsl:variable>
								<tr>
									<td style="text-align:left!important">

										<span>
											<xsl:choose>
												<xsl:when test="Period_3_0[text()]">
													<xsl:value-of select="Period_3_0"/>
												</xsl:when>
												<xsl:otherwise>
													<xsl:value-of select="Period"/>
												</xsl:otherwise>
											</xsl:choose>
										</span>

									</td>
									<td style="text-align:right!important">
										<xsl:variable name="curAmount" select="$MetricData/MetricDataRecord[PeriodKey = $currentPeriodKey]/Amount"></xsl:variable>
										<xsl:variable name="Amount">
											<xsl:choose>
												<xsl:when test="count($MetricData/MetricDataRecord[PeriodKey = $currentPeriodKey]/Amount) &gt; 0">
													<xsl:value-of select="format-number($MetricData/MetricDataRecord[PeriodKey = $currentPeriodKey]/Amount, '#')"/>
												</xsl:when>
												<xsl:otherwise>
													<xsl:number value="0"/>
												</xsl:otherwise>
											</xsl:choose>
										</xsl:variable>
										<input type="hidden" class="clsAmontActual"
											   value="{$MetricData/MetricDataRecord[PeriodKey = $currentPeriodKey]/Amount}"></input>
										<xsl:if test="$currentPeriodKey[text()]">
											<xsl:choose>
												<xsl:when test="$InputType = 'Slider10' or $InputType = 'Slider50' 
											  or $InputType = 'Slider100' or $InputType = 'Slider25'">
													<xsl:call-template name="Slider">
														<xsl:with-param name="Min">
															<xsl:number value="0"/>
														</xsl:with-param>
														<xsl:with-param name="Max">
															<xsl:choose>
																<xsl:when test="$InputType = 'Slider10'">
																	<xsl:number value="10"/>
																</xsl:when>
																<xsl:when test="$InputType = 'Slider50'">
																	<xsl:number value="50"/>
																</xsl:when>
																<xsl:when test="$InputType= 'Slider100'">
																	<xsl:number value="100"/>
																</xsl:when>
															</xsl:choose>
														</xsl:with-param>
														<xsl:with-param name="EscapedMetricKey" select="$EscapedMetricKey"></xsl:with-param>
														<xsl:with-param name="curMetric" select="$MetricKey"></xsl:with-param>
														<xsl:with-param name="curPeriodKey" select="$currentPeriodKey"></xsl:with-param>
														<xsl:with-param name="curMetricFormat" select="$NumberFormat"></xsl:with-param>
														<xsl:with-param name="Amount" select="$Amount"></xsl:with-param>
														<xsl:with-param name="ItemID" select="$ItemID"></xsl:with-param>
														<xsl:with-param name="GoalItemID" select="$GoalItemID"></xsl:with-param>
														<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
														<xsl:with-param name="classXS" select="'XS7'"></xsl:with-param>

													</xsl:call-template>
												</xsl:when>
												<xsl:when test="$InputType = 'CheckBox'">
													<xsl:call-template name="CheckBox">
														<xsl:with-param name="EscapedMetricKey" select="$EscapedMetricKey"></xsl:with-param>
														<xsl:with-param name="curMetric" select="$MetricKey"></xsl:with-param>
														<xsl:with-param name="curPeriodKey" select="$currentPeriodKey"></xsl:with-param>
														<xsl:with-param name="curMetricFormat" select="$NumberFormat"></xsl:with-param>
														<xsl:with-param name="Amount" select="$Amount"></xsl:with-param>
														<xsl:with-param name="ItemID" select="$ItemID"></xsl:with-param>
														<xsl:with-param name="GoalItemID" select="$GoalItemID"></xsl:with-param>
														<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
														<xsl:with-param name="GoalNumberFormat" select="GoalNumberFormat"></xsl:with-param>
														<xsl:with-param name="tabIndex" select="$position"></xsl:with-param>
													</xsl:call-template>
												</xsl:when>
												<xsl:when test="$InputType = 'CheckBox5'">
													<xsl:call-template name="CheckBox5">
														<xsl:with-param name="EscapedMetricKey" select="$EscapedMetricKey"></xsl:with-param>
														<xsl:with-param name="curMetric" select="$MetricKey"></xsl:with-param>
														<xsl:with-param name="curPeriodKey" select="$currentPeriodKey"></xsl:with-param>
														<xsl:with-param name="curMetricFormat" select="$NumberFormat"></xsl:with-param>
														<xsl:with-param name="Amount" select="$Amount"></xsl:with-param>
														<xsl:with-param name="ItemID" select="$ItemID"></xsl:with-param>
														<xsl:with-param name="GoalItemID" select="$GoalItemID"></xsl:with-param>
														<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
														<xsl:with-param name="GoalNumberFormat" select="GoalNumberFormat"></xsl:with-param>

													</xsl:call-template>
												</xsl:when>
												<xsl:when test="$InputType = 'TextNumber'">
													<xsl:call-template name="TextNumber">
														<xsl:with-param name="EscapedMetricKey" select="$EscapedMetricKey"></xsl:with-param>
														<xsl:with-param name="curMetric" select="$MetricKey"></xsl:with-param>
														<xsl:with-param name="curPeriodKey" select="$currentPeriodKey"></xsl:with-param>
														<xsl:with-param name="curMetricFormat" select="$NumberFormat"></xsl:with-param>
														<xsl:with-param name="Amount" select="$curAmount"></xsl:with-param>
														<xsl:with-param name="ItemID" select="$ItemID"></xsl:with-param>
														<xsl:with-param name="GoalItemID" select="$GoalItemID"></xsl:with-param>
														<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
														<xsl:with-param name="tabIndex" select="$position"></xsl:with-param>
														<xsl:with-param name="NumbersEnteredBy" select="$NumbersEnteredBy"></xsl:with-param>
														<xsl:with-param name="classXS" select="'BusinessXS7'"></xsl:with-param>
														<xsl:with-param name="ControlStatus" select="ControlStatus"></xsl:with-param>
													</xsl:call-template>
												</xsl:when>
												<xsl:when test="$InputType = 'TextCurrency'">
													<xsl:call-template name="TextCurrency">
														<xsl:with-param name="EscapedMetricKey" select="$EscapedMetricKey"></xsl:with-param>
														<xsl:with-param name="curMetric" select="$MetricKey"></xsl:with-param>
														<xsl:with-param name="curPeriodKey" select="$currentPeriodKey"></xsl:with-param>
														<xsl:with-param name="curMetricFormat" select="$NumberFormat"></xsl:with-param>
														<xsl:with-param name="Amount" select="$curAmount"></xsl:with-param>
														<xsl:with-param name="ItemID" select="$ItemID"></xsl:with-param>
														<xsl:with-param name="GoalItemID" select="$GoalItemID"></xsl:with-param>
														<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
														<xsl:with-param name="tabIndex" select="$position"></xsl:with-param>
														<xsl:with-param name="NumbersEnteredBy" select="$NumbersEnteredBy"></xsl:with-param>
														<xsl:with-param name="classXS" select="'BusinessXS7'"></xsl:with-param>
														<xsl:with-param name="ControlStatus" select="ControlStatus"></xsl:with-param>
													</xsl:call-template>
												</xsl:when>
												<xsl:when test="$InputType = 'Increamental' or $InputType = 'Incremental'">
													<xsl:call-template name="Increamental">
														<xsl:with-param name="EscapedMetricKey" select="$EscapedMetricKey"></xsl:with-param>
														<xsl:with-param name="curMetric" select="$MetricKey"></xsl:with-param>
														<xsl:with-param name="curPeriodKey" select="$currentPeriodKey"></xsl:with-param>
														<xsl:with-param name="curMetricFormat" select="$NumberFormat"></xsl:with-param>
														<xsl:with-param name="Amount" select="$curAmount"></xsl:with-param>
														<xsl:with-param name="ItemID" select="$ItemID"></xsl:with-param>
														<xsl:with-param name="GoalItemID" select="$GoalItemID"></xsl:with-param>
														<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
														<xsl:with-param name="tabIndex" select="$position"></xsl:with-param>
														<xsl:with-param name="NumbersEnteredBy" select="$NumbersEnteredBy"></xsl:with-param>
														<xsl:with-param name="classXS" select="'BusinessXS7'"></xsl:with-param>
														<xsl:with-param name="ControlStatus" select="ControlStatus"></xsl:with-param>
													</xsl:call-template>
												</xsl:when>
												<xsl:otherwise>
													<xsl:call-template name="TextNumber">
														<xsl:with-param name="EscapedMetricKey" select="$EscapedMetricKey"></xsl:with-param>
														<xsl:with-param name="curMetric" select="$MetricKey"></xsl:with-param>
														<xsl:with-param name="curPeriodKey" select="$currentPeriodKey"></xsl:with-param>
														<xsl:with-param name="curMetricFormat" select="$NumberFormat"></xsl:with-param>
														<xsl:with-param name="Amount" select="$curAmount"></xsl:with-param>
														<xsl:with-param name="ItemID" select="$ItemID"></xsl:with-param>
														<xsl:with-param name="GoalItemID" select="$GoalItemID"></xsl:with-param>
														<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
														<xsl:with-param name="tabIndex" select="$position"></xsl:with-param>
														<xsl:with-param name="NumbersEnteredBy" select="$NumbersEnteredBy"></xsl:with-param>
														<xsl:with-param name="classXS" select="'BusinessXS7'"></xsl:with-param>
														<xsl:with-param name="ControlStatus" select="ControlStatus"></xsl:with-param>
													</xsl:call-template>
												</xsl:otherwise>
											</xsl:choose>
										</xsl:if>
									</td>

								</tr>
							</xsl:if>
						</xsl:for-each>
						<tr>
							<td style="text-align:left!important;">
								<strong>Total</strong>
							</td>
							<td data-title="demo" style="background: white;TEXT-ALIGN: CENTER!IMPORTANT;">
								<strong>
									<xsl:if test="$InputType='TextCurrency'">
										<xsl:text>$</xsl:text>
									</xsl:if>
									<span id="spanTotalActual" style="display:inline-block;">
									</span>
								</strong>
							</td>
						</tr>
					</tbody>
				</table>

				<!--<div class="col-md-12 col-sm-12 col-xs-12 padg0" style="margin:20px 0;">
					<span class="col-md-3 col-sm-3 col-xs-2">
						<xsl:choose>
							<xsl:when test="$NextPage &lt; $TotalPages">
								<a href="#" onclick="return false">
									<i class="glyphicon glyphicon-menu-left pre" style="float:right;" onclick="{$pageNext}"></i>
								</a>
							</xsl:when>
						</xsl:choose>
					</span>
					<span class="col-md-6 col-sm-6 col-xs-8 cntrMet">
						<xsl:text>&#xa0;</xsl:text>
					</span>
					<span class="col-md-3 col-sm-3 col-xs-2">
						<xsl:choose>
							<xsl:when test="$PrePage!=0">
								<a href="#" onclick="return false">
									<i class="glyphicon glyphicon-menu-right pre" style="float:left!important;" onclick="{$pagePrev}">
									</i>
								</a>
							</xsl:when>
						</xsl:choose>

					</span>
				</div>-->
				<div class="onMouseOver" style="width: 100%;  text-align: center;    float: left;" >
					<a id="btnOpenNewWindowGoal" title="Open Goal in New Window"  href="{$Protocol}{$HostName}/Goal.aspx?ID={$GoalItemID}" target="_blank" style="font-size:14px; text-decoration:underline;">View Program</a>
				</div>
			</div>

		</div>
	</xsl:template>

	<xsl:template name="replaceCharsInString">
		<xsl:param name="stringIn"/>
		<xsl:param name="charsIn"/>
		<xsl:param name="charsOut"/>
		<xsl:choose>
			<xsl:when test="contains($stringIn,$charsIn)">
				<xsl:value-of select="concat(substring-before($stringIn,$charsIn),$charsOut)"/>
				<xsl:call-template name="replaceCharsInString">
					<xsl:with-param name="stringIn" select="substring-after($stringIn,$charsIn)"/>
					<xsl:with-param name="charsIn" select="$charsIn"/>
					<xsl:with-param name="charsOut" select="$charsOut"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$stringIn"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

</xsl:stylesheet>
