<?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 = 1;
        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;
        
        string mylinkIncludeUrl = string.Empty;
        string mylinkIncludeMarginTop = string.Empty;
        string mylinkIncludeMarginLeft = string.Empty;
        string mylinkIncludeHeight = string.Empty;
        string mylinkIncludeWidth = string.Empty;
        string mylinkIncludeDisplay = 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 = "Inactive";
            var enabledNode = getValue(oNode.SelectNodes("//Enabled/text()"));
            var defaultNode = getValue(oNode.SelectNodes("//Default/text()"));
            
            if (defaultNode == "true")
            {
                classStr = "active" ;
            }

            return classStr;
        }

        public string writeSTAID()
        {
                var classStr = "resource";
                var x =( tabNumber % 4);
                
			           switch(x)
                 {
			               case 1:
				             classStr = "resource";
				             break;
			               case 2:
				             classStr = "employee";
				             break;
			               case 3:
				             classStr = "corporate";
				             break;
			               case 0:
				             classStr = "news";
				             break;
			          }  
          return classStr;
        }
        
        public string writeClassStart(XPathNodeIterator oNode1)
        {
            var oNode = GetXmlElement(oNode1);
            var aDefault = oNode.SelectNodes("Default/text()");
            var classStr = string.Empty;

            if (hidealltabs == "false")
            {
                if(getValue(aDefault) == "true")
                {
                   var x =( tabNumber % 4);
			             switch(x)
                   {
			                 case 1:
				               classStr = "clsTabSelectedGrn";
				               break;
			                 case 2:
				               classStr = "clsTabSelectedBlue";
				               break;
			                 case 3:
				               classStr = "clsTabSelectedRed";
				               break;
			                 case 4:
				               classStr = "clsTabSelectedYel";
				               break;
                   }
                }
                else
                {
       	          classStr = "clsTab" + tabNumber;
                }
            }
            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++;
            	if (tabNumber == 5)
              { tabNumber =1;}
            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 setPortalMyLinkData(XPathNodeIterator oNode1)
        {
                var oNode = GetXmlElement(oNode1);
                var urlNode = oNode.SelectNodes("/Portal/LinkIncludeFile/Url/text()");
                var HeightNode = oNode.SelectNodes("/Portal/LinkIncludeFile/Height/text()");
                var WidthNode = oNode.SelectNodes("/Portal/LinkIncludeFile/Width/text()");
                var marginTopNode = oNode.SelectNodes("/Portal/LinkIncludeFile/MarginTop/text()");
                var marginLeftNode = oNode.SelectNodes("/Portal/LinkIncludeFile/MarginLeft/text()");
  
  
                 if (urlNode.Count > 0)
                 {
                  mylinkIncludeUrl = urlNode[0].InnerText;

                  if(marginTopNode.Count > 0)
                  {
                     mylinkIncludeMarginTop = marginTopNode[0].InnerText;
                  }
                  else
                  {
                       mylinkIncludeMarginTop="0";
                  }
                  if(marginLeftNode.Count > 0)
                  {
                     mylinkIncludeMarginLeft = marginLeftNode[0].InnerText;
                  }
                  else
                  {
                       mylinkIncludeMarginLeft="0";
                  }
                  if(HeightNode.Count > 0)
                  {
                     mylinkIncludeHeight = HeightNode[0].InnerText;
                  }
                  else
                  {
                       mylinkIncludeHeight="0";
                  }
                  if(WidthNode.Count > 0)
                  {
                     mylinkIncludeWidth = WidthNode[0].InnerText;
                  }
                  else
                  {
                       mylinkIncludeWidth="0";
                  }
                }
                else
                {
                   mylinkIncludeMarginTop="0";
                   mylinkIncludeMarginLeft="0";
                   mylinkIncludeHeight="0";
                   mylinkIncludeWidth="0";
                   mylinkIncludeDisplay="none";
    
                }
                return string.Empty;

        }

        public string getPortalIncludeStyle(bool mylink)
        {
            var display = "position: absolute;";
            display += "top: " + getPortalIncludeInfo("MARGINTOP",mylink) + ";";
           // display += "left: " + getPortalIncludeInfo("MARGINLEFT",mylink) + ";";
            display += "right: 0;";
            display += "width: " + getPortalIncludeInfo("WIDTH",mylink) + ";";
            display += "height: " + getPortalIncludeInfo("HEIGHT",mylink) + ";";
            display += "display: " + getPortalIncludeInfo("DISPLAY",mylink) + ";";
            display += "visibility:visible;";
            return display;
        }

        public string getPortalIncludeImageStyle(bool mylink)
        {
            var display = "position: absolute;";
           // display += "left: " + getPortalIncludeInfo("MARGINLEFT") + ";";
            display += "right: 0px;";
            display += "top: " + getPortalIncludeInfo("MARGINTOP",mylink) + "px;";
            display += "width: " + getPortalIncludeInfo("WIDTH",mylink) + "px;";
            display += "height: " + getPortalIncludeInfo("HEIGHT",mylink) + "px;";
            display += "display: " + getPortalIncludeInfo("DISPLAY",mylink) + ";";
            display += "visibility:visible;";
            return display;
        }

        public string getPortalIncludeInfo(string property,bool mylink)
        {
            	if (mylink)
              {
		               switch(property)
                   {
		                 case "URL":
		                   return mylinkIncludeUrl;
		                 break;
		                 case "MARGINTOP":
		                   return mylinkIncludeMarginTop;
		                 break;
		                 case "MARGINLEFT":
		                   return mylinkIncludeMarginLeft;
		                 break;
		                 case "HEIGHT":
		                   return mylinkIncludeHeight;
		                 break;
		                 case "WIDTH":
		                  return mylinkIncludeWidth;
		                 break;
		                 case "DISPLAY":
		                  return mylinkIncludeDisplay;
		                 break;
                     default:
                     return string.Empty;
		              }
	          }
            else
            {
                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.PortalBannerSTA.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(.)"/>
      <xsl:value-of select="user:setPortalMyLinkData(.)"/>
      var banIframeSrc="<xsl:value-of select="user:getPortalIncludeInfo('URL',0)"/>"
      var banSecondIframeSrc="<xsl:value-of select="user:getPortalIncludeInfo('URL',1)"/>"
      var g_Style= "<xsl:value-of select="Portal/StyleSheet" />"
      var g_FloatIframe = false
      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()
      }

      }

    </SCRIPT>
    <xsl:value-of select="user:lineBreak()"  />
    <HTML>
      <Script Language='JavaScript' src='scripts/PortalFrameworkSystem.js'><xsl:comment></xsl:comment></Script>
      <style type="text/css" media="screen, projection, print">
        <xsl:comment>

          @import url(/stylesheets/intranet_home_layout.css);
        </xsl:comment>
      </style>
      <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>
          <xsl:attribute name="id">bannerIFrame2</xsl:attribute>
        
        <div id="rightBackgroundWrapper">
          <!-- BEGIN left column wrapper -->
          <div id="leftBackgroundWrapper">
            <!-- BEGIN Header -->
            <div id="header">
              <xsl:variable name="logoImageScr">
                <xsl:choose>
                  <xsl:when test="Portal/BannerLogoURL = ''">images/start_logo.gif</xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="//Portal/BannerLogoURL" />
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:variable>
              <xsl:variable name="logohyperlink" select="//LogoHyperlink"/>
              <A href="javascript:PFSNavigateBanner('{$logohyperlink}')" title="STA Real Time &gt; Home">
                <img src="{$logoImageScr}"  alt="STA Real Time" width="141" height="28" border="0" />
              </A>
              <h1>
                <span class="hide">STA Real Time</span>
              </h1>
              <!-- Page Banner -->
              <iframe>
                <xsl:attribute name="src">
                  <xsl:value-of select="user:getPortalIncludeInfo('URL',1)"/>
                </xsl:attribute>
                <xsl:attribute name="allowTransparency">true</xsl:attribute>
                <xsl:attribute name="style">
                  <xsl:value-of select="user:getPortalIncludeImageStyle(true)"/>
                </xsl:attribute>
                <xsl:attribute name="marginwidth">0px</xsl:attribute>
                <xsl:attribute name="marginheight">0px</xsl:attribute>
                <xsl:attribute name="id">bannerIFrame2</xsl:attribute>
                <xsl:attribute name="name">bannerIFrame2</xsl:attribute>
                <xsl:attribute name="scrolling">no</xsl:attribute>
                <xsl:attribute name="frameborder">0</xsl:attribute>
              </iframe>
              <xsl:apply-templates select="//BannerIncludeFile" />
            </div>
          </div>
        </div>
        <!-- Page tab System -->
        <!-- END Header -->
        <div id="navcontainer">
          <ul id="navlist">
            <xsl:apply-templates select="//Portal/Tab" />

          </ul>
        </div>
      </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']">
      <li>
        <xsl:attribute name="id">
          <xsl:value-of select="user:writeSTAID()"/>
        </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>
          <span>
            <xsl:value-of select="user:getTabValue(.,0)"/>
            <xsl:value-of select="user:getTabValue(.,1)"/>
          </span>
        </A>
      </li>

      <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:value-of select="user:getPortalIncludeInfo('URL',0)"/>
        </xsl:attribute>
        <xsl:attribute name="allowTransparency">true</xsl:attribute>
        <xsl:attribute name="style">
          <xsl:value-of select="user:getPortalIncludeImageStyle(0)"/>
        </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',0)"/>
          </xsl:attribute>
          <xsl:attribute name="style">
            <xsl:value-of select="user:getPortalIncludeImageStyle(false)"/>
          </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: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" style="LEFT: 931px; POSITION: absolute;" class="clsToolbar" alt="Logoff" src="images/SPT-logoff.gif" ></img>
      </a>
      <xsl:value-of select="user:lineBreak()"  />
    </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" style="LEFT: 871px;" class="clsToolbar" alt="Print" src="images/SPT-print.gif" ></img>
      </a>
    </xsl:if>

    <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" style="LEFT: 776px;" class="clsToolbar" alt="Bookmark this Page" src="images/SPT-bookmark.gif" ></img>
      </a>
    </xsl:if>

    <xsl:apply-templates select="//Icon" />

  </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>