<%-- $Id: tabsLayout.jsp,v 1.22.2.2 2004/05/13 13:05:03 asivakumar Exp $ --%>

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>

<tiles:useAttribute name="tabList" classname="java.util.List" />
<tiles:useAttribute id="completeDef" name="completeDef" ignore="true" classname="java.lang.String" />


<SCRIPT language=JavaScript type=text/JavaScript>

function traverseTab(beanName,tabindex)
{  
// For issue in Mozilla & Opera
document.forms[beanName].mode.value = "tab";
document.forms[beanName].perform.value = "traverse";
document.forms[beanName].toBeSelected.value = tabindex;
}

function changeMode(beanName,tabindex)
{
document.forms[beanName].mode.value = tabindex;
document.forms[beanName].perform.value = "traverse";
document.forms[beanName].submit(); 
}

function traverseTabLink(beanName,tabindex)
{  
//document.forms[beanName].mode.value = "tab";
document.forms[beanName].perform.value = "traverse";
document.forms[beanName].toBeSelected.value = tabindex;
document.forms[0].submit();
}

function updatePerform(beanName)
{  
//document.forms[beanName].mode.value = "tab";
document.forms[beanName].perform.value = "update";
}

</SCRIPT>

<INPUT type="hidden" name="perform" value="traverse">
<INPUT type="hidden" value="<c:out value='${selectedTopoTabName}'/>" name="selectedTopoTab">
<INPUT type="hidden" value="<c:out value='${selectedTopoTabName}'/>" name="toBeSelected">

<c:choose>
<c:when test='${uiMode == "tab"}'>

<td width="130" valign="top"  class = "propertyTabLeftbg"> <table width="130" border="0" cellspacing="0" cellpadding="0">
      <tr> 
      <td><table width="130" border="0" align="center" cellpadding="0" cellspacing="0">
          <c:forEach items="${tabList}" var="tab"> 

            <c:choose>
 <c:when test="${tab.value == selectedTopoTabName}"> 
          <tr class="propertyTabSelected"> <td height="45" align="center" >
              <c:set var="selectedBody" value='${tab.link}'/> <img src="<c:out value='${tab.icon}'/>_on.gif" alt="<fmt:message key='${tab.value}'/>" border="0" title="<fmt:message key='${tab.tooltip}'/>"></td>
          </tr>
          <tr  class="propertyTabSelected"> 
            <td height="20" align="center"> <span class="text"><fmt:message key='${tab.value}'/></span> </c:when> <c:otherwise> 
<tr><td height="45" align="center" >
              <input name="image" type=image title="<fmt:message key='${tab.tooltip}'/>" onclick="traverseTab('<c:out value='${beanName}'/>','<c:out value='${tab.value}'/>')" src="<c:out value='${tab.icon}'/>_off.gif"> 
            </td>
          </tr>
          <tr> 
            <td height="20" align="center"> <span class="text"><a href="javascript:traverseTabLink('<c:out value='${beanName}'/>','<c:out value='${tab.value}'/>')"><fmt:message key='${tab.value}'/></a></span> </c:otherwise> </c:choose> 
            </td>
          </tr>
          <tr> 
            <td align="center" class="header2Bg"><img src="/webclient/topo/images/spacer.gif" width="1" height="1"></td>
          </tr>
          </c:forEach> </table></td>
    </tr>
  </table>
</td>
<td height="400" align="left" valign="top" class="propertyLeftBg"> 
<table width="100%" border="0" cellpadding="0" cellspacing="3">
    <tiles:insert attribute='header'/> <tiles:insert beanName="selectedBody"/> 
    <tr> 
      <td height="20" colspan=2>&nbsp;</td> 
    </tr>
 </table>
</td>
</c:when>
<c:otherwise>
<td  width="130" valign="top"  class="propertyBg"> <table height="100%" width="130" border="0" cellspacing="2" cellpadding="0">
<tr> 
<td  colspan=2>
 <table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
    <tiles:insert attribute='header'/>
   </table>
</td>
</tr>   

     <c:forEach items="${tabList}" var="tab"> 
      <tr> 
      <td height="100%" valign="top" ><table width="130" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr class="propertyTabSelected"> <td height="45" align="center" >
              <c:set var="selectedBody" value='${tab.link}'/> <img src="<c:out value='${tab.icon}'/>_on.gif" alt="<fmt:message key='${tab.value}'/>" border="0" title="<fmt:message key='${tab.tooltip}'/>"></td>
          </tr>
          <tr  class="propertyTabSelected"> 
            <td height="20" align="center"> <span class="text"><fmt:message key='${tab.value}'/></span>
            </td>
            
          </tr>
</table> </td>

<td>
 <table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
 <tiles:insert beanName="selectedBody"/> 
</table>
<br> <br>
</td>

 </tr>
          </c:forEach> 
  </table>
</td>


<%--
<td height="400" align="left" valign="top" class="propertyBg" colspan=2> 
 <table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
    <tiles:insert attribute='header'/> <tiles:insert beanName="completeDef"/> 
    <tr> <td height="21">&nbsp;</td> </tr>
 </table>
</td>
--%>
</c:otherwise>
</c:choose>
