<%
  import org.exoplatform.ecm.webui.component.explorer.UIJCRExplorer;
  def rcontext = _ctx.getRequestContext();
  def jsManager = rcontext.getJavascriptManager(); 
  if(uicomponent.isShowViewFile() && !uicomponent.isJcrEnable()) {
%>
<div class="UIResizableBlock" style="padding:10px;">
	<%if(uicomponent.isDisplayOptionBlockPanel()) {%>
    <div style="display: block;float:left; width: 70%;">
  <%}%>
	<div class="UITabPane" id="$uicomponent.id">
		  <div class="TabPaneContent">
		    <div class="WorkingAreaWithHelp">
		      <div class="UIHorizontalTabs">
		        <div class="LeftHorizontalTabs">
			     	  <div class="RightHorizontalTabs">
			     	    <div class="CenterHorizontalTabs">
					        <div class="TabsContainer">
					          <%
					            for(uiChild in uicomponent.getChildren()) {
					              String style = "NormalTab" ;
					              String tabId = uiChild.getId();		
					              if(tabId.indexOf("OptionBlock")>=0)	continue;	              
					              String paneId = uicomponent.getId();
					              if(uiChild.isRendered()) style = "SelectedTab" ;
					          %>
					            <div class="UITab NormalTabStyle">
					              <div class="$style">
					                <div class="LeftTab">
					                  <div class="RightTab">                
					                  <div id="$tabId" class="MiddleTab" onClick="<%=uicomponent.event("ChangeTab"  ,tabId)%>"><%=_ctx.appRes("UITabPane.title." + uiChild.getId());%></div>
					                  </div>
					                </div>
					              </div>
					            </div>              
					          <%}%>
					        </div>
					      </div>
					    </div>
					  </div>
		      </div>
		      <div class="UITabContentContainer" id="TabContainerParent">
		        <%
		          for(uiChild in uicomponent.getChildren()) { 
		            String display = "none" ;
		            if(uiChild.isRendered()) display="block" ;
		            println "<div class=\"UITabContent\" id=\"UITabContent\" style=\"display: $display;overflow:auto;\">" ;
		            uicomponent.renderUIComponent(uiChild) ;
		            println "</div>" ;
		          }
		        %>
		      </div>  
		    </div>  
		  </div>  
		</div> 
	</div>
<%

  if(uicomponent.isDisplayOptionBlockPanel()) {
  	println "<div class=\"ClearFix\">";
    for(uiChild in uicomponent.getChildren()) { 
      String width = "30%";	  
      if(uiChild.getId().indexOf("OptionBlock")<0) continue;
      String display = "block" ;	     	
      println "<div style=\"display: $display;float:left; width: $width;\">" ;
      uicomponent.renderUIComponent(uiChild) ;
      println "</div>" ;
    }
    println "</div>";
  }
%>

<%
  } else { 
    if(uicomponent.isDocumentNode() && uicomponent.isDisplayOptionBlockPanel()) {	
      print "<div id=\"$uicomponent.id\" style=\"padding:8px;\">";	    
      for(uiChild in uicomponent.getChildren()) {		      
        if(uiChild.getId()=="UIDocumentWithTree") continue;
        String width = "70%";	  
        if(uiChild.getId() != "UIDocumentInfo") {
          width = "30%";
        }
        String display = "none" ;		   		
        if(uiChild.isRendered() || uiChild.getId().indexOf("OptionBlock")>=0) display="block" ;		     	
        println "<div style=\"display: $display;float:left; width: $width;\">" ;
        uicomponent.renderUIComponent(uiChild) ;
        println "</div>" ;
      }		
      print "</div>"; 
    } else {			
      print "<div id=\"$uicomponent.id\">";	
      uicomponent.renderChild("UIDocumentInfo") ;
      print "</div>";
    }
  }
%>	
