<%	
	def rcontext = _ctx.getRequestContext();
	rcontext.getJavascriptManager().require("SHARED/portalRequest").require("SHARED/bts_tab");
	
%>
<div class="UITabPane uiTabNormal" id="$uicomponent.id">
	<ul class="nav nav-tabs" id="myTab">
		<%
			String url = uicomponent.url("SelectTab");
			String selTabId = uicomponent.getSelectedTabId();
			for(uiChild in uicomponent.getChildren()) {
				if(!uiChild.isRendered()) continue; 
				String style = "";
				String tabId = uiChild.getId();
				if(tabId.equals(selTabId)) style="active";
		%>
		
			<% String actionLink = "ajaxAsyncGetRequest('" + uicomponent.url("SelectTab",tabId) + "', true)" %>								
			<li class="$style" onclick="$actionLink">
				<a data-toggle="tab" href="#tab-$tabId"><%=_ctx.appRes("UITabPane.title." + uiChild.getId());%></a>
			</li>
		
		<%}%>
	</ul>
	<div class="tab-content" id="myTabContent">
		<%
			for(uiChild in uicomponent.getChildren()) {
				if(!uiChild.isRendered()) continue; 
				String active = "";
				if(uiChild.getId().equals(selTabId)) active="in active";				
				println "<div class=\"tab-pane fade $active\" id=\"tab-" + uiChild.getId() + "\">";
				uicomponent.renderUIComponent(uiChild);
				println "</div>";
			}
		%>
	</div>	
</div>	
