<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxsl="urn:schemas-microsoft-com:xslt"
      xmlns:user="http://travelers.com/dynportal">

<msxsl:script language="csharp" implements-prefix="user">
    <msxsl:assembly name="System.Core" />
    <msxsl:using namespace="System.IO" />
    <msxsl:using namespace="System.Collections.Generic" />

  <![CDATA[
        int tabNumber = 0;
        string bannerIncludeUrl = string.Empty;
        string bannerIncludeMarginTop = string.Empty;
        string bannerIncludeMarginLeft = string.Empty;
        string bannerIncludeHeight = string.Empty;
        string bannerIncludeWidth = string.Empty;
        string bannerIncludeDisplay = string.Empty;
        string hidealltabs = string.Empty;

        public XmlElement GetXmlElement(XPathNodeIterator oNode, Boolean isMoveNext = true)
        {
            if (isMoveNext) oNode.MoveNext();
            var oDoc = new XmlDocument();
            oDoc.Load(new StringReader(oNode.Current.OuterXml));
            return oDoc.DocumentElement;
        }
        public string buildTabArray(XPathNodeIterator oNode1)
        {
            var root = GetXmlElement(oNode1);
            var resultstr = string.Empty;
            var arrInit = "\nvar g_Tabs = new Array;\nvar g_TabLength = new Array;\n";

            var domain = root.SelectSingleNode("/Portal/MultipleDomains/text()");
            if (domain != null)
            {
                resultstr += domain.InnerText == "true"
                    ? "var domainValue=getDomain(); \n document.domain = domainValue;\n " + arrInit
                    : arrInit;
            }
            else
            {
                resultstr += "var domainValue=getDomain(); \n document.domain = domainValue;\n " + arrInit;
            }

            hidealltabs = root.SelectSingleNode("/Portal/HideAllTabs/text()").InnerText;

            var tabList = "/Portal/Tab[Visible='true']";
            var tabNodeList = root.SelectNodes(tabList);
            var defaultTabStr = "defaultTab = ''";
            var bGotDefaultTab = "false";
            var i=0;

            foreach(XmlElement data in tabNodeList)
            {
                var thisTab = data;
                var tabId = thisTab.SelectSingleNode("Id/text()").InnerText;
                var tabName = thisTab.SelectSingleNode("Description/text()").InnerText;
                var tabNameLength = getTabNameLength(tabName);

                resultstr = string.Format("{0}g_Tabs[{1}] = \"{2}\";\n" + "g_TabLength[{1}] = \"{3}\";\n",
                resultstr, i, tabId, tabNameLength);

                if (bGotDefaultTab == "false")
                {
                    var thisDefault = thisTab.SelectSingleNode("Default/text()").InnerText;
                    if (i == 0 || thisDefault == "true")
                    {
                        defaultTabStr = string.Format("defaultTab = '{0}';\n", tabId);
                        if (thisDefault == "true") bGotDefaultTab = "true";
                    }
                }
                i++;
               
            }

            return resultstr + "\n" + defaultTabStr;
        }
        public string getTabValue(XPathNodeIterator oNode1, int lineNumber)
        {
            var root = GetXmlElement(oNode1);
            var tabName = root.SelectSingleNode("Description/text()").InnerText;

            if (tabName.Length > 0)
            {
                var tabValueArray = tabName.Split('~');
                if (tabValueArray.Length > lineNumber)
                {
                    return tabValueArray[lineNumber];
                }
                return string.Empty;
            }
            return string.Empty;
        }
        public int getTabNameLength(string TabName)
        {
            var blnTabNameLength = 0;
            var sSplitTabName = TabName.Split('~');
            if (sSplitTabName.Length == 1)
            {
                blnTabNameLength = TabName.Length;
            }
            else
            {
                var blnLengthZero = sSplitTabName[0].Length;
                var blnLengthOne = sSplitTabName[1].Length;
                blnTabNameLength = blnLengthZero > blnLengthOne ? blnLengthZero : blnLengthOne;
            }
            return blnTabNameLength;
        }
        public string writeClassLink(XPathNodeIterator oNode1)
        {
            var oNode = GetXmlElement(oNode1);
            var classStr = string.Empty;
            var enabledNode = getValue(oNode.SelectNodes("//Enabled/text()"));
            var defaultNode = getValue(oNode.SelectNodes("//Default/text()"));
            var displayNode = getValue(oNode.SelectNodes("//Display/text()"));

            classStr = enabledNode == "true" ? "clsTabLinkActive" : "clsTabLinkInActive";
            if (displayNode == "false")
            {
    	        classStr = "clsTabLinkHidden" ;
            }
            if (defaultNode == "true")
            {
                classStr = "clsTabLinkActiveSelected";
            }
            return classStr;
        }
        public string writeClassStart(XPathNodeIterator oNode1)
        {
            var oNode = GetXmlElement(oNode1);
            var aDefault = oNode.SelectNodes("Default/text()");
            var displayNode = oNode.SelectNodes("Display/text()");
            var classStr = "empty";;

            if (hidealltabs == "false")
            {
                if (getValue(aDefault) == "true"){
		            classStr = "clsTabSelected";
	            }
                if (getValue(aDefault) == "false") {
    	            classStr = "clsTabMainTDHidden";
		        }
                if (classStr == "empty") {
       	            classStr = "clsTab";
       	        }                
            }
            else
            {
                classStr = getValue(aDefault) == "true" ? "clsTabSelectedND" : "clsTabND";
            }
            return classStr;
        }

        public string writeClassEnd(XPathNodeIterator oNode1)
        {
            var oNode = GetXmlElement(oNode1);
            var aDefault = oNode.SelectNodes("Default/text()");
            var classStr = string.Empty;
            if (hidealltabs == "false")
            {
                classStr = getValue(aDefault) == "true" ? "clsTabEndSelected" : "clsTabEnd";
            }
            else
            {
                classStr = getValue(aDefault) == "true" ? "clsTabEndSelectedND" : "clsTabEndND";
            }
            return classStr;
        }

        public string incrementTabNumber()
        {
            tabNumber++;
            return string.Empty;
        }

        public string getStyleSheet()
        {
            return "StyleSheets/PortalFrameworkSystem.css";
        }

        public string getTabHref(XPathNodeIterator oNode1)
        {
            var oNode = GetXmlElement(oNode1);
            var tabId = oNode.SelectSingleNode("Id/text()").InnerText;

            var tempHref = string.Format("javascript:PFSTabClick('{0}','user')", tabId);
            var startPage = oNode.SelectSingleNode("StartPage/text()");
            if (startPage != null)
            {
                if (startPage.InnerText.Substring(0, 11) == "javascript:")
                {
                    tempHref = startPage.InnerText;
                }
            }
            return tempHref;
        }

        public string getValue(XmlNodeList oNode)
        {
            return oNode.Count > 0 ? oNode[0].InnerText : string.Empty;
        }

        public string setPortalIncludeData(XPathNodeIterator oNode1)
        {
            var oNode = GetXmlElement(oNode1);
            var urlNode = oNode.SelectNodes("/Portal/BannerIncludeFile/Url/text()");
            var HeightNode = oNode.SelectNodes("/Portal/BannerIncludeFile/Height/text()");
            var WidthNode = oNode.SelectNodes("/Portal/BannerIncludeFile/Width/text()");
            var marginTopNode = oNode.SelectNodes("/Portal/BannerIncludeFile/MarginTop/text()");
            var marginLeftNode = oNode.SelectNodes("/Portal/BannerIncludeFile/MarginLeft/text()");

            if (urlNode.Count > 0)
            {
                bannerIncludeUrl = urlNode[0].InnerText;

                if (marginTopNode.Count > 0)
                {
                    bannerIncludeMarginTop = marginTopNode[0].InnerText;
                }
                else
                {
                    bannerIncludeMarginTop = "0";
                }
                if (marginLeftNode.Count > 0)
                {
                    bannerIncludeMarginLeft = marginLeftNode[0].InnerText;
                }
                else
                {
                    bannerIncludeMarginLeft = "0";
                }
                if (HeightNode.Count > 0)
                {
                    bannerIncludeHeight = HeightNode[0].InnerText;
                }
                else
                {
                    bannerIncludeHeight = "0";
                }
                if (WidthNode.Count > 0)
                {
                    bannerIncludeWidth = WidthNode[0].InnerText;
                }
                else
                {
                    bannerIncludeWidth = "0";
                }
            }
            else
            {
                bannerIncludeMarginTop = "0";
                bannerIncludeMarginLeft = "0";
                bannerIncludeHeight = "0";
                bannerIncludeWidth = "0";
                bannerIncludeDisplay = "none";

            }
            return string.Empty;
        }

        public string getPortalIncludeStyle()
        {
            var display = "position: absolute;";
            display += "top: " + getPortalIncludeInfo("MARGINTOP") + ";";
            display += "left: " + getPortalIncludeInfo("MARGINLEFT") + ";";
            display += "width: " + getPortalIncludeInfo("WIDTH") + ";";
            display += "height: " + getPortalIncludeInfo("HEIGHT") + ";";
            display += "display: " + getPortalIncludeInfo("DISPLAY") + ";";
            display += "visibility:visible;";
            return display;
        }

        public string getPortalIncludeImageStyle()
        {
            var display = "position: absolute;";
            display += "left: " + getPortalIncludeInfo("MARGINLEFT") + ";";
            display += "top: " + getPortalIncludeInfo("MARGINTOP") + ";";
            display += "width: " + getPortalIncludeInfo("WIDTH") + ";";
            display += "height: " + getPortalIncludeInfo("HEIGHT") + ";";
            display += "display: " + getPortalIncludeInfo("DISPLAY") + ";";
            display += "visibility:visible;";
            return display;
        }

        public string getPortalIncludeInfo(string property)
        {
            switch (property)
            {
                case "URL":
                    return bannerIncludeUrl;
                case "MARGINTOP":
                    return bannerIncludeMarginTop;
                case "MARGINLEFT":
                    return bannerIncludeMarginLeft;
                case "HEIGHT":
                    return bannerIncludeHeight;
                case "WIDTH":
                    return bannerIncludeWidth;
                case "DISPLAY":
                    return bannerIncludeDisplay;
                default:
                    return string.Empty;
            }

        }

        public string getIncludeFile()
        {
            return " #include file='";
        }

        public string getIncludeFileEnd()
        {
            return "' ";
        }

        public string getIncludeVir()
        {
            return " #include virtual='";
        }

        public string getDDMenuInfo(XPathNodeIterator oNode1)
        {
            var oNode = GetXmlElement(oNode1);
            var tabId = oNode.SelectSingleNode("Description/text()").InnerText;
            var tabValue = removeSpaces(tabId);
            return string.Format("showDDMenu(event,'ddmnu{0}','tab{0}Main')", tabValue);
        }

        public string removeSpaces(string vName)
        {
            var re = "/\\W/";
            for (var i = 0; i < vName.Length; i++)
            {
                vName = vName.Replace(re, "");
            }
            return vName;
        }

        public string convertName(XPathNodeIterator oNode1)
        {
            var oNode = GetXmlElement(oNode1);
            var MenuId = oNode.SelectSingleNode("Id/text()").InnerText;
            return "ddmnu" + MenuId.Substring(3, MenuId.Length);
        }

        public string getPageHref(XPathNodeIterator oNode1)
        {
            var oNode = GetXmlElement(oNode1);
            var theHref = string.Empty;
            var checkForFunction = string.Empty;
            var urlList = oNode.SelectNodes("OnClick/text()");
            var newWindow = oNode.SelectSingleNode("NewWindow/text()");
            var newWindowHasToolbar = oNode.SelectSingleNode("NewWindowHasToolbar/text()");	
            var tmpNewWindowHasToolbar = newWindowHasToolbar == null ? "false" : newWindowHasToolbar.InnerText;


            if (urlList.Count > 0)
            {

                var thisPage = editPageUrl(urlList[0].InnerText);
                checkForFunction = thisPage.Substring(0, 11);
                if (checkForFunction == "javascript:")
                {
                    theHref = thisPage;
                }
                else
                {
                    
                    if (newWindow.InnerText == "true")
                    {
                        if (tmpNewWindowHasToolbar == "false")
                        {
                            theHref = "javascript:top.frames[1].PFSLaunchWindow4Themebar('" + thisPage + "','False')";
                        }
                        else
                        {
                            theHref = "javascript:top.frames[1].PFSLaunchWindow4Themebar('" + thisPage + "','True')";
                        }
                    }
                    else
                    {
                        theHref = "javascript:top.frames[1].PFSNavigateByPage('" + thisPage + "','" + thisPage + "')";
                    }
                }
            }
            else
            {
                theHref = "";
            }

            return theHref;
        }

        public string editPageUrl(string oNode)
        {
            // made by sully to ignore the code;
            return oNode;
        }

        public string getSubMenuName(XPathNodeIterator oNode1)
        {
            return string.Format("parent.PFSDDMenuItemOver('ddmnu{0}',this);", getMenuName(oNode1));
        }

        public string getMenuName(XPathNodeIterator oNode1)
        {
            var oNode = GetXmlElement(oNode1);
            var oNodeName = oNode.SelectSingleNode("Name/text()");
            return removeSpaces(oNodeName.InnerText);
        }

        public string getParentMenuName(XPathNodeIterator oNode1)
        {
            oNode1.Current.MoveToParent();
            var oNodeParentName = oNode1.Current.SelectSingleNode("Name");
            return "ddmnu" + oNodeParentName.Value;
        }

        public string getLogoffURL(XPathNodeIterator oNode1)
        {
            if (oNode1.CurrentPosition == 0) oNode1.MoveNext();
            var oNodeName = oNode1.Current.SelectSingleNode("Logoff");
            var oNodeAttrib = oNodeName.GetAttribute("url", "");
            return string.Format("javascript:TabFrame.PFSKillFormsAuthCookie('{0}')", oNodeAttrib);
        }

        public string lineBreak()
        {
            return "\n";
        }

        public string blankSpace()
        {
            return "&nbsp;";
        }
        
        ]]>

  </msxsl:script>

<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
    <xsl:value-of select="user:lineBreak()"/>
    <xsl:comment>Travelers.BI.PortalFramework.Web.PortalXSLT.PortalBannerSPT.xsl</xsl:comment>
    <xsl:value-of select="user:lineBreak()"/>

<SCRIPT Language="JavaScript">
<xsl:value-of select="user:lineBreak()"  />
<xsl:value-of select="user:buildTabArray(.)"/>
<xsl:value-of select="user:setPortalIncludeData(.)"/>

var banIframeSrc="<xsl:value-of select="user:getPortalIncludeInfo('URL')"/>"

function PFSWindowClose() {
// does not work on ns
    if(top){
      var MainPortal = parent.opener
      if (MainPortal) {
	MainPortal.focus()
	parent.close();
      }
    }
}

function getDomain() {
   var docname = document.domain
       var tmpDocName = docname.split(".")
       if (tmpDocName[1]){
   		var strDocName = tmpDocName[tmpDocName.length-2] + "." + tmpDocName[tmpDocName.length-1]
   		return strDocName;
    } else { return docname; }
}
	
function showDDMenu(event,ddmnuid,tabID) {
    var bodyFrame = top.frames[2]
    var eSrc = document.getElementById(tabID)
    var x = eSrc.offsetLeft - 168
    eDDMenu = bodyFrame.document.getElementById(ddmnuid)
    if (eDDMenu) {
	PFSDDMenuTabOver (event,ddmnuid,x,tabID);
    }	
		
}

function hideDDMenu() {
    if (PFSBannerOnBlur) {
	PFSBannerOnBlur()
    }

}
var g_Style= "<xsl:value-of select="Portal/StyleSheet" />"	
  </SCRIPT>
<xsl:value-of select="user:lineBreak()"  />  
<HTML>
  <Script Language='JavaScript' src='scripts/PortalFrameworkSystem.js'><xsl:comment></xsl:comment></Script>
  <link rel="stylesheet" TYPE="text/css" href="StyleSheets/PFS-Style-SPT.css"></link>
  
 	<BODY>
	<xsl:attribute name="bgcolor">white</xsl:attribute>	
	<xsl:attribute name="LEFTMARGIN">0</xsl:attribute>	
	<xsl:attribute name="TOPMARGIN">0</xsl:attribute>	
	<xsl:attribute name="MARGINWIDTH">0</xsl:attribute>	
        <xsl:attribute name="MARGINHEIGHT">0</xsl:attribute>	
	 
    <!-- Page Banner -->

<div id="divBannerTable">
<table border="0" cellPadding="0" cellSpacing="0" id="BannerTable" class="clsBannerTable">

  <xsl:choose>
    <xsl:when test="//LogoHyperlink[. !='']">
	<a>
	  <xsl:attribute name="href">javascript:PFSNavigateBanner('<xsl:value-of select="//LogoHyperlink" />')</xsl:attribute>
	  <tr><td>
		<xsl:attribute name="id">PageBanner</xsl:attribute>	
		<xsl:attribute name="class">clsPageBanner</xsl:attribute>
		<xsl:if test="//Portal/BannerLogoURL[. !='']">
			<xsl:attribute name="style">background-image:url(<xsl:value-of select="Portal/BannerLogoURL" />)</xsl:attribute>
		</xsl:if>
		<span>
		  <xsl:attribute name="id">PageTitle</xsl:attribute>
		  <xsl:attribute name="class">clsPageBannerText</xsl:attribute>
		  <xsl:apply-templates select="//Portal/Description" />
		</span>
		</td>
		<td>		    
		  <xsl:apply-templates select="//BannerIncludeFile" />
		</td>
	  </tr>
	</a>
    </xsl:when>
    <xsl:otherwise>
    <tr>
      <td>
	<xsl:attribute name="id">PageBanner</xsl:attribute>	
	<xsl:attribute name="class">clsPageBanner</xsl:attribute>
	<xsl:if test="//Portal/BannerLogoURL[. !='']">
		<xsl:attribute name="style">background-image:url(<xsl:value-of select="Portal/BannerLogoURL" />)</xsl:attribute>
	</xsl:if>
	<span>
	<xsl:attribute name="id">PageTitle</xsl:attribute>
	<xsl:attribute name="class">clsPageBannerText</xsl:attribute>
	<xsl:apply-templates select="//Portal/Description" />
	</span>
	</td>
	<td>		    
	  <xsl:apply-templates select="//BannerIncludeFile" />
        </td>
     </tr>
  </xsl:otherwise>
  </xsl:choose>
</table>
</div>

<!-- Page tab System -->
 	
<div>
<xsl:attribute name="id">divTabTable</xsl:attribute>
<xsl:if test="Portal/DropDownMenu[. != 'none']">
	<xsl:attribute name="onMouseOut">hideDDMenu()</xsl:attribute>
</xsl:if>
<table border="0" cellPadding="0" cellSpacing="0" id="TabTable" class="clsTabTable">
    <tr>
       	<td id="FirstTab"  class="clsFirstTab">
          <xsl:if test="//ToggleMenu[. ='true']">
		<xsl:apply-templates select="//ToggleMenu" />
	  </xsl:if>
	</td>

	<xsl:apply-templates select="//Portal/Tab" />

	<td id="LastTab" class="clsLastTab">
	  <xsl:value-of select="user:blankSpace()" disable-output-escaping = "yes" />
	</td>
     </tr>
</table>
</div>


<table border="0" class="clsThemeBarTable" cellPadding="0" cellSpacing="0">
<tr>
  <td id="ThemeBarSpacer" class="clsThemeBarSpacer" />
  <td id="ThemeBar" class="clsThemeBar">
  <span id="ThemeBar" class="clsThemeBarText">
  <xsl:choose>
    <xsl:when test="//ThemeTitle[. !='']">	
	<xsl:value-of select="//ThemeTitle" />
    </xsl:when>	
    <xsl:otherwise>
	<xsl:value-of select="user:blankSpace()" disable-output-escaping = "yes" />
    </xsl:otherwise>
  </xsl:choose>
  </span>
  <xsl:value-of select="user:lineBreak()"  /> 
  <span id="ToolBar" style="position: absolute; right: 1%;">
  	<xsl:apply-templates select="//ToolBar" />
  <xsl:value-of select="user:lineBreak()"  />
  </span>
  </td>
</tr>
</table>
</BODY>  	 
</HTML>
  
</xsl:template>

<xsl:template match="//Portal/Tab" >

<!-- Tabs -->
        <xsl:value-of select="user:lineBreak()"  />
	<xsl:comment>Tab Starts Here</xsl:comment>
	<xsl:value-of select="user:lineBreak()"  />
	<xsl:if test="Visible[. ='true']">
    
     <td><xsl:attribute name="class"><xsl:value-of select="user:writeClassStart(.)"/></xsl:attribute>
        <xsl:attribute name="id"><xsl:value-of select="Id" />Main</xsl:attribute>
       	<xsl:if test="DropDownMenu[. ='true']">
           	<xsl:attribute name="onMouseOver"><xsl:value-of select="user:getDDMenuInfo(.)"/></xsl:attribute>
        </xsl:if>
       <!-- <xsl:attribute name="onclick"><xsl:value-of select="user:getTabHref(.)"/></xsl:attribute>
        <xsl:attribute name="onmouseover">javascript:PFSTabMouseOver('<xsl:value-of select="Id" />')</xsl:attribute>
        <xsl:attribute name="onmouseout">javascript:PFSTabMouseOut('<xsl:value-of select="Id" />')</xsl:attribute>-->
   	<A>
   	<xsl:attribute name="HREF"><xsl:value-of select="user:getTabHref(.)"/></xsl:attribute>
   	<xsl:attribute name="id"><xsl:value-of select="Id" /></xsl:attribute>
   	<xsl:attribute name="name"><xsl:value-of select="Id" /></xsl:attribute>	
   	<xsl:attribute name="value"><xsl:value-of select="Name" /></xsl:attribute>	
   	<xsl:attribute name="class"><xsl:value-of select="user:writeClassLink(.)"/></xsl:attribute>
   	<xsl:value-of select="user:getTabValue(.,0)"/>
   	<BR/>	
   	<xsl:value-of select="user:getTabValue(.,1)"/>
   	</A>	    
     </td>
     
     <xsl:value-of select="user:incrementTabNumber()"/>
 </xsl:if>
</xsl:template>
          
<xsl:template match="BannerIncludeFile">
     	<xsl:if test="//Portal/BannerIncludeFile/Url[@image='false']">
         <iframe>
     		<xsl:attribute name="src"></xsl:attribute>
     		<xsl:attribute name="allowTransparency">true</xsl:attribute>
     		<xsl:attribute name="style"><xsl:value-of select="user:getPortalIncludeImageStyle()"/></xsl:attribute>
     		<xsl:attribute name="marginwidth">0px</xsl:attribute>
     		<xsl:attribute name="marginheight">0px</xsl:attribute>
     		<xsl:attribute name="id">bannerIFrame</xsl:attribute>
     		<xsl:attribute name="name">bannerIFrame</xsl:attribute>
     		<xsl:attribute name="scrolling">no</xsl:attribute>
     		<xsl:attribute name="frameborder">0</xsl:attribute>
     		<xsl:value-of select="user:blankSpace()" disable-output-escaping = "yes" />
         </iframe>
         	</xsl:if>
         	
     	<xsl:if test="//Portal/BannerIncludeFile/Url[@image='true']">
     		<span class="clsPageBannerIFrame">
     	    	<img>
     		  <xsl:attribute name="src"><xsl:value-of select="user:getPortalIncludeInfo('URL')"/></xsl:attribute>
     		  <xsl:attribute name="style"><xsl:value-of select="user:getPortalIncludeImageStyle()"/></xsl:attribute>
     		  <xsl:attribute name="id">bannerIFrame</xsl:attribute>
     		  <xsl:attribute name="name">bannerIFrame</xsl:attribute>
     		  <xsl:attribute name="scrolling">no</xsl:attribute>
     		  <xsl:attribute name="frameborder">0</xsl:attribute>
     	    	</img>
     	    	</span>
         	</xsl:if>
</xsl:template>
     	
<xsl:template match="ToggleMenu">
     	<img>
     	<xsl:attribute name="id">tab_MenuOnOff_img</xsl:attribute>
     	<xsl:attribute name="OnClick">PFSMenuOnOff()</xsl:attribute>
     	<xsl:if test="//Portal/ToggleMenu[@onStart='on']">	
     		<xsl:attribute name="src">images/SPT-menuon.gif</xsl:attribute>
     		<xsl:attribute name="class">clsTabMenuOn</xsl:attribute>	
     		<xsl:attribute name="alt">Menu On/Off</xsl:attribute>
     	</xsl:if>
     	<xsl:if test="//Portal/ToggleMenu[@onStart='off']">
     		<xsl:attribute name="src">images/SPT-menuoff.gif</xsl:attribute>
     		<xsl:attribute name="class">clsTabMenuOff</xsl:attribute>
     		<xsl:attribute name="alt">Menu On/Off</xsl:attribute>
     	</xsl:if>
     	</img>
</xsl:template>
     
<xsl:template match="Portal/Description">
     	
     	<xsl:if test="//Portal/Description[@image='false']">
     		<xsl:value-of select="//Description" />	
     	</xsl:if>
     	<xsl:if test="//Portal/Description[@image='true']">
     		<img>
     		<xsl:attribute name="src"><xsl:value-of select="//Description" /></xsl:attribute>
     		</img>
     	</xsl:if>
     	<xsl:if test="//Portal/Description[@include='file']">
     		<xsl:comment><xsl:value-of select="user:getIncludeVir()"/><xsl:value-of select="//Description" /><xsl:value-of select="user:getIncludeFileEnd()"/></xsl:comment>
     	</xsl:if>
     	<xsl:if test="//Portal/Description[@include='virtual']">
     		<xsl:comment><xsl:value-of select="user:getIncludeVir()"/><xsl:value-of select="//Description" /><xsl:value-of select="user:getIncludeFileEnd()"/></xsl:comment>
     	</xsl:if>
     	
</xsl:template>

<xsl:template match="Portal/ToolBar">
	<xsl:apply-templates select="//Icon" />

     	<xsl:if test="//Portal/ToolBar/Bookmark[. ='True']">
     	  <xsl:value-of select="user:lineBreak()"  />
     	  <a>
     		<xsl:attribute name="href">javascript:TabFrame.PFSAddToFavs()</xsl:attribute>
     	  	<img id="ToolBar_img_Bookmark" class="clsToolbar" alt="Bookmark this Page" src="images/SPT-bookmark.gif" ></img>
     	  </a>
	</xsl:if>

	<xsl:if test="//Portal/ToolBar/Print[. ='True']">
     	  <xsl:value-of select="user:lineBreak()"  />
     	  <a>
     	  	<xsl:attribute name="href">javascript:TabFrame.PFSPrintFromWhiteSpace()</xsl:attribute>
     	  	<img id="ToolBar_img_Print" class="clsToolbar" alt="Print" src="images/SPT-print.gif" ></img>
     	  </a>
	</xsl:if>

	<xsl:if test="//Portal/ToolBar/Logoff[. ='True']">
		<a>	
		<xsl:if test="//Portal/ToolBar/Logoff[@url!='']">
			<xsl:attribute name="href"><xsl:value-of select="user:getLogoffURL(.)"/></xsl:attribute>
		</xsl:if>
		<xsl:if test="//Portal/ToolBar/Logoff[@url='']">
			<xsl:attribute name="href">javascript:TabFrame.PFSKillFormsAuthCookie()</xsl:attribute>
		</xsl:if>
		<img id="ToolBar_img_Logoff" class="clsToolbar" alt="Logoff" src="images/SPT-logoff.gif" ></img>
		</a>
		<xsl:value-of select="user:lineBreak()"  />
     	</xsl:if>
</xsl:template>

<xsl:template match="Portal/ToolBar/Icon">
<xsl:if test="Visible[. ='true']">
	<xsl:value-of select="user:lineBreak()"  />
	<a>
		<xsl:attribute name="href"><xsl:value-of select="user:getPageHref(.)"/></xsl:attribute>
	  <img>
	  	<xsl:attribute name="id">ToolBar_img_<xsl:value-of select="./Name" /></xsl:attribute>
	  	<xsl:attribute name="class">clsToolbar</xsl:attribute>
	  	<xsl:attribute name="alt"><xsl:value-of select="./Tooltip" /></xsl:attribute>
	  	<xsl:attribute name="src"><xsl:value-of select="./Url" /></xsl:attribute>
	  </img>
	</a>
</xsl:if>
</xsl:template>

</xsl:stylesheet>