<%@ page language="java" buffer="100kb" errorPage="/common/error.jsp"%>

<%@ taglib uri="struts-bean"  prefix="bean"  %>
<%@ taglib uri="struts-html"  prefix="html"  %>
<%@ taglib uri="struts-logic" prefix="logic" %>
<%@ taglib uri="vkc-taglib"   prefix="vkc"   %>

<%@ page import="vkc.view.WebShare" %>
<%@ page import="vkc.view.form.ClusterEditCategoryViewForm" %>
<%@ page import="org.apache.struts.Globals" %>

<vkc:checkLogin/>
<vkc:init/>
<html:html locale="true">
<head>
    <meta http-equiv="content-type"  content="text/html; charset=iso-8859-1" />
    
    <meta http-equiv="pragma"        content="no-cache" />
    <meta http-equiv="expires"       content="0" />
    <meta http-equiv="robots"        content="noindex" />
    <meta http-equiv="robots"        content="nofollow" />
    <meta http-equiv="cache-control" content="no-cache" />
    <script type="text/javascript" src="<vkc:rewrite page='/common/utils.js'/>"></script>
    <script type="text/javascript" src="<vkc:rewrite page='/common/overlib/overlib.js'/>"><!-- overLIB (c) Erik Bosrup --></script>
    <vkc:cssinclude />

    <script type="text/javascript">
    window.name = "CLUSTEREDITCATEGORYVIEW";
    var currentCalendar = null;
    var windowOpen = null;

    function init(){
		setAnchor();
	    
	    <logic:present name="clusterEditCategoryViewForm">
	      <logic:equal name="clusterEditCategoryViewForm" property="refreshTreeView" value="true">
            if (this.parent && this.parent.CLUSTERTREEVIEW) {
              var clusterTreeView = this.parent.CLUSTERTREEVIEW;

              if (clusterTreeView) {
                var params = 'action=refresh&categoryId=<vkc:write name="clusterEditCategoryViewForm" property="categoryId"/>&<vkc:write name="<%=vkc.util.treeview.TreeView.CLUSTER_TREE_KEY%>" property="clearQueryString" filter="false" ignore="true"/>';
                clusterTreeView.refresh(params);
              }
            }
	      </logic:equal>
	    </logic:present>
    }

	function setAnchor() {
		<logic:present parameter="anchor">
			<bean:parameter id="anchor2" name="anchor"/>
			this.location.hash = '<%=anchor2%>';
		</logic:present>
	}

    function showInfoText() {
        return overlib( '<vkc:message javascript="true" filter="false" key="vkc.cluster.planehierarchy.info"/>',
                        STICKY, MOUSEOFF, WIDTH, 400, OFFSETX, 10, OFFSETY, -40, RIGHT );
    }

	function unloadPage() {
    	if ( currentCalendar!=null ) {
      		hideCalendar();
    	}

	    if ( windowOpen != null ) {
	    	windowOpen.close();
	    }
    }

	</script>
</head>

<body onload="init();" onUnload="unloadPage();">
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<html:form action="/clusterEditCategoryView" method="post">
<bean:define id="form" name="clusterEditCategoryViewForm" type="vkc.view.form.ClusterEditCategoryViewForm"/>
<logic:notEmpty name="form" property="categoryId">
  <html:hidden name="form" property="categoryId"/>
</logic:notEmpty>

<table width="100%" cellspacing="0" cellpadding="0" border="0">
  <logic:present name="<%=org.apache.struts.Globals.ERROR_KEY%>">
  <html:messages id="error" message="false">
  <tr><td align="left" nowrap="nowrap" colspan="2"><span class="error"><b><vkc:write name="error"/></b></span></td></tr>
  </html:messages>
  <tr><td colspan="2"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="5" border="0"/></td></tr>
  </logic:present>

  <tr>
    <td width="100%" valign="top">
      <table cellspacing="1" cellpadding="1" width="100%" border="0">
        <tr>
          <td align="left" nowrap="nowrap">
            <b><vkc:message key="vkc.category"/>:</b>
          </td>
          <td align="left" nowrap="nowrap">
            <logic:notEmpty name="form" property="category">
              <logic:notEmpty name="form" property="category.name">
                (ID = <vkc:write name="form" property="category.clusterID"/>) - <vkc:write name="form" property="category.name"/>
              </logic:notEmpty>
              <logic:empty name="form" property="category.name">
                (ID = <vkc:write name="form" property="category.clusterID"/>)
              </logic:empty>
            </logic:notEmpty>
          </td>
        </tr>
 		
 		<tr><td>&nbsp;</td></tr>

        <tr>
          <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.name"/>:&nbsp;<vkc:img page="/templates/${template.name}/gfx/mandatoryField.gif" alt="*" border="0"/></b></td>
          <td width="100%" align="left"><vkc:text property="name" style="width:100%;"/></td>
        </tr>

      	<tr>
          <td align="left" valign="top" nowrap="nowrap"><b><vkc:message key="vkc.description"/>:</b></td>
          <td width="100%" align="left" valign="top"><vkc:textarea property="description" cols="57" rows="2" style="width:100%;"/></td>
        </tr>

      	<tr>
          <td align="left" valign="top" nowrap="nowrap"><b><vkc:message key="vkc.cluster.planehierarchy"/>:</b></td>
          <td width="100%" align="left" valign="top">
            <html:checkbox name="form" property="planeHierarchy"/>
            <vkc:img page="/templates/${template.name}/gfx/help.bmp" onmouseover='return showInfoText();' onmouseout="return nd();" width="16" height="16" border="0"/>
          </td>
        </tr>
        <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="5"/>

        <tr>
          <td align="left" nowrap="nowrap" colspan="2">
            <vkc:button property="action.apply" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="button.apply"/></vkc:button>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</html:form>
</body>
</html:html>