<% 
	import org.exoplatform.faq.webui.FAQUtils;
	import org.exoplatform.faq.service.Utils;
	import org.exoplatform.web.application.JavascriptManager;

	JavascriptManager jsmanager = _ctx.getRequestContext().getJavascriptManager();
	jsmanager.addOnLoadJavascript('eXo.faq.UIAnswersPortlet.loadBreadcumbScroll');
%>
<div class="UIBreadcumbs" id="$uicomponent.id">
	<div class="BreadcumbsInfoBar">
		<table style="table-layout: fixed">
			<tbody>
				<tr>
					<td class="ControlButtonContainer">
						<div style="padding-left:5px;">
							<%  
								if(uicomponent.getBreadcumbs().size() > 1){
							%>
							<% int t = 1 ;
								String image = "";
								for(namePath in uicomponent.getBreadcumbs()) {
									String link = uicomponent.event("ChangePath", uicomponent.getPath(t-1)) ;
									String url = uicomponent.url("ChangePath", uicomponent.getPath(t-1)) ;
									String title = "" ;
									image = "";
									if(t == 1){
										image = "/faq/skin/DefaultSkin/webui/background/HomeIcon.gif";
									}
									if(t < uicomponent.getMaxPath()) {
										if(namePath.length() > 30) {
											title = FAQUtils.getTitle(namePath) ; 
											namePath = FAQUtils.getSubString(namePath,30);
										%>
											<a href="$url" onclick="$link; return false;" class="Selected ControlButton" title="$title">$namePath</a>
									<%} else { 
										 	if(image.length() > 0){
									%>
											<a href="$url" onclick="$link; return false;" class="Selected ControlButton"><img src="$image" alt="$namePath"/></a>
										<%} else { %>
											<a href="$url" onclick="$link; return false;" class="Selected ControlButton">$namePath</a>
										<%} %>
									<%} %>
										<div class="RightArrowIcon ControlButton"><span></span></div>
								<%} else {
								 		 if(namePath.length() > 30) {
												title = FAQUtils.getTitle(namePath) ; 
												namePath = FAQUtils.getSubString(namePath,30);
												
								%>
												<div class="Selected ControlButton" title="$title">$namePath</div>
									<% } else { %>
												<div class="Selected ControlButton">$namePath</div>
									<% } 
									}
						  	t = t + 1 ;
						  } %>
						 <div class="ScrollButtons" style="width:35px;_width:50px;padding: 4px 1px 0px 1px;">
							<div title="<%=_ctx.appRes("UIBreadcumbs.label.Previous")%>">
								<div title="<%=_ctx.appRes("UIBreadcumbs.label.Next")%>"><span></span></div>
							</div>
						</div>
						  <div style="clear:left"><span></span></div>
						  <% } %>
						 </div>
				  </td>
				  <td style="width:280px;">
						<div class="SearchForm">
							<%uicomponent.renderChild(uicomponent.QUICK_SEARCH) ;%>
						</div>
						<div style="clear:right;"><span></span></div>
					</td>
		 		</tr>
		 	</tbody>
		</table>
	</div>
</div>