<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns:x="http://www.w3.org/1999/XML/xinclude">
	<xsl:template match="/">
		<xsl:apply-templates select="root"/>
	</xsl:template>
	<xsl:template match="root">
		<!--START OF MAIN TABLE -->
		<table cellpadding="0" cellspacing="0" border="0" height="100%">
			<tr>
				<td valign="top">
					<xsl:for-each select="row/long_text/Section[@name $eq$ 'MyFavorites']">
						<!--START FAVORITES TABLE-->
						<table cellpadding="0" cellspacing="0" border="0">
							<caption align="left" nowrap="true">
								<tr>
									<td width="100%" height="23px" class="mnuMainSection" style="border-top:solid 1px #BDBCBE;">
										<xsl:attribute name="id">h_<xsl:value-of select="@name"/></xsl:attribute>
										<xsl:attribute name="onclick">_SelectSection('<xsl:value-of select="@name"/>','<xsl:value-of select="ShortCuts/Group[index()=0]/@name"/>','<xsl:value-of select="@groups"/>')</xsl:attribute>
										<table width="100%" cellpadding="0" cellpsacing="0" class="table_label">
											<tr>
												<td class="mnuMainGroup" nowrap="true" onmouseover="showTitle(this)">
													<xsl:attribute name="id">f_<xsl:value-of select="@name"/></xsl:attribute>
													<xsl:value-of select="@title"/>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</caption>
							<tbody style="display:none">
								<xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
								<tr>
									<td valign="top">
										<xsl:apply-templates select="ShortCuts/Group"/>
									</td>
								</tr>
							</tbody>
						</table>
						<!--END FAVORITES TABLE-->
					</xsl:for-each>
				</td>
			</tr>
			<tr>
				<td valign="top">
					<xsl:for-each select="row/long_text/Section[@name $eq$ 'Search']">
						<!--START SEARCH TABLE-->
						<table cellpadding="0" cellspacing="0" border="0">
							<caption align="left" nowrap="true">
								<tr>
									<td width="100%" height="23px" class="mnuMainSection" style="border-top:solid 1px #BDBCBE;">
										<xsl:attribute name="id">h_<xsl:value-of select="@name"/></xsl:attribute>
										<xsl:attribute name="onclick">_SelectSection('<xsl:value-of select="@name"/>',null,5)</xsl:attribute>
										<table width="100%" cellpadding="0" cellpsacing="0" class="table_label">
											<tr>
												<td class="mnuMainGroup" nowrap="true" onmouseover="showTitle(this)">
													<xsl:attribute name="id">f_<xsl:value-of select="@name"/></xsl:attribute>
													<xsl:value-of select="@title"/>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</caption>
							<tbody style="display:none">
								<xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
								<tr>
									<td style="padding-left:3px; padding-top:7px" valign="top">
										<table height="100%" width="100%" cellpadding="0" cellspacing="0" border="0">
											<form onsubmit="searchMenuBar();return false;">
											<tr>
												<td width="100%"><input style="width:100%" tabindex="0" id="SearchPortal_input"/></td>
												<td style="padding-right:3px">
													<button onclick="searchMenuBar();return false;" class="clickTranspButt">
														<table cellpadding="0" cellspacing="0" border="0">
															<tr>
																<td class="butt_left"></td>
																<td class="imgText" astea-trans="text;TXTVIRTUAL$go_vx_t_vx;N;">Go</td>
																<td class="butt_right"></td>
															</tr>
														</table>
													</button>
													<!--
													<input type="image" src="../images/gobutton.gif" style="width:33px; height:19px" class="clickTranspButt" id="SearchPortal_button_img">
													</input>
													-->
												</td>
											</tr>
											<tr style="padding-top:7px">
												<td style="color:black" astea-trans="text;TXTASP$searchresult_vx;Y;">Search Results:</td>
												<td style="color:black"><label style="font:11px" id="search_results_number"/></td>
											</tr>
											<tr><td colspan="2" style="padding-bottom:2px" height="100%"><select size="10" style="width:97%;height:100%" id="SearchPortal_select" onkeypress="SearchPortalPress(this,window.event.keyCode)" onclick="SearchPortal_Jump(this.value)"/></td></tr>
											</form>
										</table>
									</td>
								</tr>
							</tbody>
						</table>
						<!--END SEARCH TABLE-->
					</xsl:for-each>
				</td>
			</tr>
			<tr>
				<td height="100%" valign="top">
					<!--START ALL OTHER SECTIONS-->
					<xsl:for-each select="row" order-by="+number(fr_version)">
						<xsl:for-each select="long_text/Section[(@name $ne$ 'MyFavorites') $and$ (@name $ne$ 'Search') $and$ (@items $ne$  '0')]">
							<table cellpadding="0" cellspacing="0" border="0" style="border-top:solid 1px #BDBCBE">
								<caption align="left" nowrap="true">
									<tr>
										<td width="100%" height="22px" class="mnuMainSection">
											<xsl:attribute name="id">h_<xsl:value-of select="@name"/></xsl:attribute>
											<xsl:attribute name="onclick">_SelectSection('<xsl:value-of select="@name"/>','<xsl:value-of select="ShortCuts/Group[index()=0]/@name"/>','<xsl:value-of select="@groups"/>')</xsl:attribute>
											<table width="100%" border="0" cellpadding="0" cellpsacing="0" class="table_label">
												<tr>
													<td class="mnuMainGroup" nowrap="true" onmouseover="showTitle(this)">
														<xsl:attribute name="id">f_<xsl:value-of select="@name"/></xsl:attribute>
														<xsl:eval>f_ConvertSpecialChars(this.getAttribute("title"))</xsl:eval>
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</caption>
								<tbody style="display:none">
									<xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
									<tr>
										<td valign="top">
											<div style="height:100%; overflow-y:auto">
												<xsl:apply-templates select="ShortCuts/Group"/>
											</div>
										</td>
									</tr>
								</tbody>
							</table>
						</xsl:for-each>
					</xsl:for-each>
					<!--END ALL OTHER SECTIONS-->
				</td>
			</tr>
		</table>
		<!--END OF MAIN TABLE -->
	</xsl:template>
	<!-- <xsl:template match="ShortCuts">
		<xsl:apply-templates select="Grou2p"/>		
	</xsl:template> -->
	<xsl:template match="Group">
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr style="cursor:hand">
				<xsl:attribute name="onclick">_SelectShortCutItem_new('<xsl:value-of select="../../@name"/>_<xsl:value-of select="@name"/>',<xsl:value-of select="../../@groups"/>)</xsl:attribute>
				<td style="padding-left:7px">
					<img src="../images/pixel.gif" align="absmiddle" class="clsShortcutItem_plus">
						<xsl:attribute name="id"><xsl:value-of select="../../@name"/>_<xsl:value-of select="@name"/></xsl:attribute>
					</img>
					<span style="padding-left:3px; font:bold 11px arial">
						<xsl:value-of select="@title"/>
					</span>
				</td>
			</tr>
			<tr>
				<td style="padding-left:10px">
					<table border="0" style="display:none;table-layout:fixed" cellSpacing="0" cellPadding="0">
						<xsl:attribute name="id">sci_sub<xsl:value-of select="../../@name"/>_<xsl:value-of select="@name"/></xsl:attribute>
						<xsl:apply-templates select="Item"/>
					</table>
				</td>
			</tr>
		</table>
	</xsl:template>
	<xsl:template match="Item">
		<tr>
			<xsl:attribute name="title"><xsl:value-of select="Title"/></xsl:attribute>
			<td nowrap="true" width="5px">
				<xsl:attribute name="id"><xsl:value-of select="../../../@name"/>_<xsl:value-of select="../@name"/>_arrow<xsl:eval>ChildNumber(this)-1</xsl:eval></xsl:attribute>
			</td>
			<td width="100%" class="clsShortcutSubItem" nowrap="true" style="overflow:hidden; text-overflow:ellipsis">
				<xsl:attribute name="id"><xsl:value-of select="../../../@name"/>_<xsl:value-of select="../@name"/>_<xsl:value-of select="BC"/></xsl:attribute>
				<xsl:choose>
					<xsl:when test=".[../@name $ieq$ 'MyLinks']">
						<a target="_new">
							<xsl:attribute name="href"><xsl:eval>f_get_URL2(this)</xsl:eval></xsl:attribute>
							<xsl:eval>f_cut(this)</xsl:eval>
						</a>
					</xsl:when>
					<xsl:when test=".[../@name $ieq$ 'MyReports']">
						<xsl:if test=".[URL $gt$ '']">
							<xsl:attribute name="onclick">_OpenWindowFromMenu(<xsl:eval>f_get_URL(this)</xsl:eval>,'<xsl:value-of select="../../../@name"/>')</xsl:attribute>
							<xsl:eval>f_cut(this)</xsl:eval>
						</xsl:if>
						<xsl:if test=".[(URL $le$ '') $and$ (Report $gt$ '') ]">
							<xsl:attribute name="onclick">Retreive_Report(<xsl:value-of select="Report"/>)</xsl:attribute>
							<xsl:eval>f_cut(this)</xsl:eval>
						</xsl:if>
					</xsl:when>
					<xsl:otherwise>
						<xsl:attribute name="onclick">_OpenWindowFromMenu(<xsl:eval>f_get_URL(this)</xsl:eval>,'<xsl:value-of select="../../../@name"/>')</xsl:attribute>
						<xsl:eval>f_cut(this)</xsl:eval>
					</xsl:otherwise>
				</xsl:choose>
			</td>
		</tr>
	</xsl:template>
	<xsl:script language="JavaScript">
        <![CDATA[
		function f_get_URL2(node){
			var url=node.selectSingleNode("URL");			
			if (url==null)return ""; 		
			url=""+url.text;
			url=url.replace("..","");
			url=url.replace("&lt;![CDATA[","");
			url=url.replace("]]&gt;","");	
			if (url.indexOf("http://")!=0) url="http://"+url;
			return url;						
		}
		function f_get_URL(node){
			var url=node.selectSingleNode("URL");
			if (url==null)return ""; 
			url=""+url.text;
			url=url.replace(/amp\;/ig,"");
      if(url.lastIndexOf("\"") == 0) url+="\"";
			return url;
		}
		function f_cut(obj){
			var title=obj.selectSingleNode("Title").text;
			var smaller=Math.min(22, title.length);
			var tmpStr=title.substring(0,smaller);
			if (smaller==22) {
				tmpStr=title.substring(0,19) + "..."
			}			
			return tmpStr;
		}
		function f_ConvertSpecialChars(str)
		{
		    str=str.replace("&amp;quote;","'");
		    str=str.replace("&amp;dquote;","\"");
            str=str.replace("&amp;lt;","<");
            str=str.replace("&amp;gt;",">");
		    return str;
		}
	]]></xsl:script>
</xsl:stylesheet>

