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

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

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

<vkc:checkLogin />
<vkc:init/>
<html:html locale="true">
<head>

  	<vkc:cssinclude />

    <meta http-equiv="content-type"  content="text/html; charset=iso-8859-1" />
    <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>

    <script type="text/javascript">

    window.name = "MAINVIEW";
    var associatedTabId = <%=TabId.ADMIN_GROUPMANAGEMENT_TAB%>;

    function init() {

        var tabView = getTabView();
        var tabViewForm = tabView.document.forms[0];

        if (tabView && tabView.systemviewtype == "administrationview" && tabView.selectedTabId != associatedTabId) {
            tabView.location.replace("<%=ctxPath%>/adminTabView.do?selectedTabId=<%=TabId.ADMIN_GROUPMANAGEMENT_TAB%>"
          						   + "&lastCategoryId=" + tabViewForm.lastCategoryId.value
          						   + "&lastFunctionalId=" + tabViewForm.lastFunctionalId.value
          						   + "&lastProjectId=" + tabViewForm.lastProjectId.value);
        }

        <logic:present name="<%=WebShare.INFO_KEY%>" scope="request">
          <bean:define id="msg" type="java.lang.String" scope="request" name="<%=WebShare.INFO_KEY%>"/>
          alert( '<vkc:message javascript="true" filter="false" key="<%=msg%>"/>' );
        </logic:present>
        
        <logic:present name="<%=WebShare.MESSAGE_KEY%>" scope="request">
          <bean:define id="message" type="java.lang.String" scope="request" name="<%=WebShare.MESSAGE_KEY%>"/>
          alert( '<vkc:write name="message" javascript="true" filter="false"/>' );
        </logic:present>
    }

    function sort(mode) {
        var form = document.forms[0];
        form.sortMode.value   = mode;

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.change.sortmode=true";
        } else {
          form.action = form.action + "&action.change.sortmode=true";
        }

        form.submit();
    }
    	
    function changeListIndex() {
        var form = document.forms[0];

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.change.listindex=true";
        } else {
          form.action = form.action + "&action.change.listindex=true";
        }

        form.submit();
    }
    
    function changeGroupsPerPage() {
        var form = document.forms[0];

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.change.groupsperpage=true";
        } else {
          form.action = form.action + "&action.change.groupsperpage=true";
        }

        form.submit();
    }

    function gotoFirstPage() {
        var form   = document.forms[ 0 ];
        var field  = form.listIndex;
    
        if ( field.selectedIndex==0 )
            return;
    
        field.selectedIndex = 0;
        changeListIndex();
    }
    
    function gotoPrevPage() {
        var form   = document.forms[ 0 ];
        var field  = form.listIndex;
        var index  = field.selectedIndex;
    
        if ( index-1 < 0 )
            return;
    
        field.selectedIndex = index-1;
        changeListIndex();
    }
    
    function gotoNextPage() {
        var form   = document.forms[ 0 ];
        var field  = form.listIndex;
        var index  = field.selectedIndex;
    
        index = index + 1;
        if ( index>=field.options.length )
            return;
    
        field.selectedIndex = index;
        changeListIndex();
    }
    
    function gotoLastPage() {
        var form   = document.forms[ 0 ];
        var field  = form.listIndex;
        var length = field.options.length;
    
        if ( field.selectedIndex==length - 1 )
            return;
    
        field.selectedIndex = length - 1;
        changeListIndex();
    }
    
	function checkAll( mForm ) {			
		for(var i=0 ; i<mForm.elements.length ; i++){ 
			var elem = mForm.elements[i];
			if(elem.name!='allItems') {
			    elem.checked=mForm.allItems.checked;
			}
		}
	}
	
	function getNumberOfCheckedEntries() {
        var form  = document.forms[ 0 ];
        var field = form.selectedIds;

        if ( !field )
        	return 0;

        if ( !field.length ) {

            <%-- nur eine Checkbox auf der Seite --%>
            if ( field.checked ) {
                return 1;
            } else {
                return 0;
            }
        }

        var checked = 0;
        for ( var i=0 ; i<field.length ; i++ ) {
            if ( field[i].checked ) {
                checked++;
            }
        }
        return checked;
	}
	
    function deleteGroups(elem) {
        var numChecked = getNumberOfCheckedEntries();

        if ( numChecked == 0 ) {
            alert( '<vkc:message javascript="true" filter="false" key="vkc.administration.select.groups"/>' );
            return;
        }

		if ( numChecked==1 ) {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.delete.group"/>' ) )
                return;
		} else {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.delete.groups"/>' ) )
            	return;
		}               
        
        var form  = document.forms[0];
        
        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.delete.groups=true";
        } else {
          form.action = form.action + "&action.delete.groups=true";
        }

        disableAllButtons(elem);
        form.submit();
    }

    function lockGroups(elem) {
        var numChecked = getNumberOfCheckedEntries();

        if ( numChecked == 0 ) {
            alert( '<vkc:message javascript="true" filter="false" key="vkc.administration.select.groups"/>' );
            return;
        }

		if ( numChecked==1 ) {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.lock.group"/>' ) )
                return;
		} else {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.lock.groups"/>' ) )
            	return;
		}               

        var form  = document.forms[0];

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.lock.groups=true";
        } else {
          form.action = form.action + "&action.lock.groups=true";
        }

        disableAllButtons(elem);
        form.submit();
    }

    function unlockGroups(elem) {
        var numChecked = getNumberOfCheckedEntries();

        if ( numChecked == 0 ) {
            alert( '<vkc:message javascript="true" filter="false" key="vkc.administration.select.groups"/>' );
            return;
        }

		if ( numChecked==1 ) {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.unlock.group"/>' ) )
                return;
		} else {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.unlock.groups"/>' ) )
            	return;
		}               

        var form  = document.forms[0];

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.unlock.groups=true";
        } else {
          form.action = form.action + "&action.unlock.groups=true";
        }

        disableAllButtons(elem);
        form.submit();
    }

	function modifyGroups(elem) {
		var form = document.forms[ 0 ];
		var field = form.selectedCmdAction.value;

		if ( field == "noaction" || field == "noaction1" ) {
       		alert( '<vkc:message javascript="true" filter="false" key="error.noaction_choosen"/>' );
       		return false;
		}

		if ( field == "delete.groups" ) {
			deleteGroups(elem);
		}

		if ( field == "lock.groups" ) {
			lockGroups(elem);
		}

		if ( field == "unlock.groups" ) {
			unlockGroups(elem);
		}
	}
	
   function openUserInfoWindow( id ) {
        var w = 800;
        var h = 600;
        var leftPosition = screen.width/2  - w/2;
        var topPosition  = screen.height/2 - h/2;
        var settings ='height=' + h + ', width=' + w + ', top=' + topPosition + ', left=' + leftPosition;
        settings += ',scrollbars=yes,resizable';
        settings += ',toolbar=no, location=no, directories=no, status=true, menubar=no';
        var win = window.open( '<vkc:rewrite page="/displayUserInfo.do"/>?userId=' + id, 'USERINFO_MAINVIEW', settings );
        win.focus();                              
    }
	
    function showHelpText() {
    	var text = '<vkc:message javascript="true" filter="false" key="vkc.administration.groupssearch.help"/>';

		return overlib( text, STICKY, MOUSEOFF, WIDTH, 400, OFFSETX, 0, OFFSETY, 40, CENTER );    	
    }

    </script>
</head>
<body onload="init();" topmargin="0" marginheight="0">
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<table width="100%" align="center" cellspacing="0" cellpadding="0" border="0">
  <html:form action="/groupList" method="post">

  <bean:define id="form" name="groupListForm" scope="request" type="vkc.administration.form.GroupListForm"/>
  <bean:define id="sortMode"     name="form" property="sortMode"          type="java.lang.Integer"/>
  <bean:define id="selectedIds"  name="form" property="selectedIds"       type="java.lang.Integer[]"/>
  <bean:define id="pageCount"    name="form" property="groupInfoPageCount" type="java.lang.Integer"/>
  <bean:define id="groupsPerPage" name="form" property="groupsPerPage"      type="java.lang.Integer"/>

  <html:hidden property="sortMode"/>

  <logic:present name="<%=Globals.ERROR_KEY%>">
  <tr><td align="left" nowrap="nowrap" colspan="3"><font color="red"><b><vkc:errors/></b></font></td></tr>
  <tr><td align="left" nowrap="nowrap" colspan="3"><hr></td></tr>
  </logic:present>

  <logic:equal name="form" property="allGroupsCount" value="0">
  <tr>
    <td align="left" nowrap="nowrap" colspan="3"><vkc:message key="vkc.administration.noGroupEntry"/></td>
    <td width="100%">&nbsp;</td>	
    <td nowrap="nowrap"><vkc:link page="/newGroup.do"><vkc:message key="vkc.administration.newgroup" /></vkc:link></td>
  </tr>
  </logic:equal>	

  <logic:notEqual name="form" property="allGroupsCount" value="0">
  <tr>
    <td>
      <table width="100%">
        <tr>
          <td nowrap="nowrap"><vkc:link href="javascript:gotoFirstPage();" onclick="this.blur();"><vkc:img page="/templates/${template.name}/gfx/rewind.gif" border="0" alt=""/></vkc:link>&nbsp;&nbsp;</td>
          <td nowrap="nowrap"><vkc:link href="javascript:gotoPrevPage();" onclick="this.blur();"><vkc:img page="/templates/${template.name}/gfx/arrow-left.gif" border="0" alt=""/></vkc:link>&nbsp;&nbsp;</td>

          <td>
            <html:select name="form" property="listIndex" onchange="changeListIndex();">
              <logic:iterate id="pageIndex" type="java.lang.Integer" name="form" property="pageIndices">
              <html:option value="<%=String.valueOf( pageIndex )%>" key="key">
			  <bean:define id="groupInfoRange" name="form" property='<%=String.valueOf( "rangeValue(" + pageIndex.intValue() + ")")%>' type="vkc.view.bean.GroupInfoRange"/>
          	  <logic:equal value="true" name="form" property="sortByName">
          	  	<vkc:message key="string.from"/>&nbsp;[<vkc:write name="groupInfoRange" property="from.name" />]&nbsp;<vkc:message key="string.to"/>&nbsp;[<vkc:write name="groupInfoRange" property="to.name" />]&nbsp;
          	  </logic:equal>
          	  <logic:equal value="true" name="form" property="sortByDescription">
              	<vkc:message key="string.Page"/>&nbsp;<%=(pageIndex.intValue()/groupsPerPage.intValue()+1)%>&nbsp;<vkc:message key="string.of"/>&nbsp;<%=pageCount.intValue()%>&nbsp;
          	  </logic:equal>
          	  <logic:equal value="true" name="form" property="sortByAccountStatus">
              	<vkc:message key="string.Page"/>&nbsp;<%=(pageIndex.intValue()/groupsPerPage.intValue()+1)%>&nbsp;<vkc:message key="string.of"/>&nbsp;<%=pageCount.intValue()%>&nbsp;
          	  </logic:equal>
          	  <logic:equal value="true" name="form" property="sortByCreator">
          	  	<logic:empty name="groupInfoRange" property="from.creator">
          	  	  <logic:empty name="groupInfoRange" property="to.creator">
          	  	    <vkc:message key="string.from"/>&nbsp;[]&nbsp;<vkc:message key="string.to"/>&nbsp;[]&nbsp;
          	  	  </logic:empty>
          	  	</logic:empty>
          	  	<logic:empty name="groupInfoRange" property="from.creator">
          	  	  <logic:notEmpty name="groupInfoRange" property="to.creator">
          	  	    <vkc:message key="string.from"/>&nbsp;[]&nbsp;<vkc:message key="string.to"/>&nbsp;[<vkc:write name="groupInfoRange" property="to.creator.username" />]&nbsp;
          	  	  </logic:notEmpty>
          	  	</logic:empty>
          	  	<logic:notEmpty name="groupInfoRange" property="from.creator">
          	  	  <logic:empty name="groupInfoRange" property="to.creator">
          	  	    <vkc:message key="string.from"/>&nbsp;[<vkc:write name="groupInfoRange" property="from.creator.username" />]&nbsp;<vkc:message key="string.to"/>&nbsp;[]&nbsp;
          	  	  </logic:empty>
          	  	</logic:notEmpty>
          	  	<logic:notEmpty name="groupInfoRange" property="from.creator">
          	  	  <logic:notEmpty name="groupInfoRange" property="to.creator">
          	  	    <vkc:message key="string.from"/>&nbsp;[<vkc:write name="groupInfoRange" property="from.creator.username" />]&nbsp;<vkc:message key="string.to"/>&nbsp;[<vkc:write name="groupInfoRange" property="to.creator.username" />]&nbsp;
          	  	  </logic:notEmpty>
          	  	</logic:notEmpty>
          	  </logic:equal>
          	  <logic:equal value="true" name="form" property="sortByCreated">
          	  	<vkc:message key="string.from"/>&nbsp;[<vkc:write name="groupInfoRange" property="from.createdStr" />]&nbsp;<vkc:message key="string.to"/>&nbsp;[<vkc:write name="groupInfoRange" property="to.createdStr" />]&nbsp;
          	  </logic:equal>
          	  <logic:equal value="true" name="form" property="sortByCountMembers">
              	<vkc:message key="string.Page"/>&nbsp;<%=(pageIndex.intValue()/groupsPerPage.intValue()+1)%>&nbsp;<vkc:message key="string.of"/>&nbsp;<%=pageCount.intValue()%>&nbsp;
          	  </logic:equal>
              </html:option>
              </logic:iterate>
            </html:select>
          </td>

          <td nowrap="nowrap">&nbsp;&nbsp;<vkc:link href="javascript:gotoNextPage();" onclick="this.blur();"><vkc:img page="/templates/${template.name}/gfx/arrow-right.gif" border="0" alt=""/></vkc:link></td>
          <td nowrap="nowrap">&nbsp;&nbsp;<vkc:link href="javascript:gotoLastPage();" onclick="this.blur();"><vkc:img page="/templates/${template.name}/gfx/forward.gif" border="0" alt=""/></vkc:link></td>
          <td nowrap="nowrap">&nbsp;&nbsp;<b><vkc:message key="vkc.administration.groupsperpage"/>:</b></td>

          <td nowrap="nowrap">&nbsp;&nbsp;
            <html:select name="form" property="groupsPerPage" onchange="changeGroupsPerPage();">
              <html:option value="5"><vkc:message key="vkc.administration.groupsperpage.five"/></html:option>
              <html:option value="10"><vkc:message key="vkc.administration.groupsperpage.ten"/></html:option>
              <html:option value="20"><vkc:message key="vkc.administration.groupsperpage.twenty"/></html:option>
              <html:option value="30"><vkc:message key="vkc.administration.groupsperpage.thirty"/></html:option>
              <html:option value="40"><vkc:message key="vkc.administration.groupsperpage.forty"/></html:option>
              <html:option value="50"><vkc:message key="vkc.administration.groupsperpage.fifty"/></html:option>
            </html:select>
          </td>

          <td nowrap="nowrap">
            &nbsp;&nbsp;<b><vkc:message key="vkc.administration.groupssearch"/>:</b>&nbsp;&nbsp;
            <vkc:text property="searchQuery" style="width:200;"/>
          </td>

          <td nowrap="nowrap">
			<vkc:image property="btn_search" page="/templates/${template.name}/gfx/search.bmp" alt="" titleKey="vkc.administration.groupssearch.start"/>
			<vkc:img onmouseover="return showHelpText();" onmouseout="return nd();" page="/templates/${template.name}/gfx/help.bmp" width="16" height="16" border="0"/>
          </td>

		  <td width="100%">&nbsp;</td>	
          <td nowrap="nowrap"><vkc:link page="/newGroup.do"><vkc:message key="vkc.administration.newgroup" /></vkc:link></td>
        </tr>
      </table>
    </td>
  </tr>

  <logic:equal name="form" property="visibleGroupInfoSizes" value="0">
  <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="5"/>
  <tr><td align="left" nowrap="nowrap"><vkc:message key="vkc.administration.noGroupEntry"/></td></tr>
  </logic:equal>

  <logic:notEqual name="form" property="visibleGroupInfoSizes" value="0">
  <tr>
    <td class="tableLineColor">
      <table width="100%" cellspacing="1" cellpadding="2" border="0" class="tableLineColor">
 	    <tr>
		  <% String nameColStyle             = "columnUnselected"; %>	
	      <% String descriptionColStyle      = "columnUnselected"; %>	
	      <% String countMembersColStyle  	 = "columnUnselected"; %>	
	      <% String accountStatusColStyle  	 = "columnUnselected"; %>	
	      <% String creatorColStyle          = "columnUnselected"; %>
	      <% String createdColStyle          = "columnUnselected"; %>

	      <td class="headerUnselected">&nbsp;</td>

          <logic:equal value="true" name="form" property="sortByName">
            <% nameColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_NAME_UP )%>" name="form" property="sortMode">
        	<td align="left" nowrap="nowrap" class="headerSelected">
        	  &nbsp;<b><vkc:message key="vkc.administration.groups.name"/></b>
        	  <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_NAME_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
        	</td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_NAME_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.groups.name"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_NAME_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByName">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.groups.name"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_NAME_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>

          <logic:equal value="true" name="form" property="sortByDescription">
            <% descriptionColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_DESCRIPTION_UP )%>" name="form" property="sortMode">
            <td width="100%" align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.groups.description"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_DESCRIPTION_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_DESCRIPTION_DOWN )%>" name="form" property="sortMode">
            <td width="100%" align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.groups.description"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_DESCRIPTION_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByDescription">
            <td width="100%" align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.groups.description"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_DESCRIPTION_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>

          <logic:equal value="true" name="form" property="sortByCountMembers">
            <% countMembersColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_COUNTMEMBERS_UP )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.groups.countMembers"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_COUNTMEMBERS_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_COUNTMEMBERS_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.groups.countMembers"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_COUNTMEMBERS_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByCountMembers">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.groups.countMembers"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_COUNTMEMBERS_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>

          <logic:equal value="true" name="form" property="sortByAccountStatus">
            <% accountStatusColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_ACCOUNTSTATUS_UP )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.accountState"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_ACCOUNTSTATUS_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_ACCOUNTSTATUS_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.accountState"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_ACCOUNTSTATUS_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByAccountStatus">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.accountState"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_ACCOUNTSTATUS_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>

          <logic:equal value="true" name="form" property="sortByCreator">
            <% creatorColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_CREATOR_UP )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.creator"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_CREATOR_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_CREATOR_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.creator"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_CREATOR_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>    
          <logic:equal value="false" name="form" property="sortByCreator">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.creator"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_CREATOR_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>    

          <logic:equal value="true" name="form" property="sortByCreated">
            <% createdColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_CREATED_UP )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.created"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_CREATED_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( GroupListForm.SORT_CREATED_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.created"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_CREATED_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>    
          <logic:equal value="false" name="form" property="sortByCreated">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.created"/></b>
              <vkc:link href='<%="javascript:sort(" + GroupListForm.SORT_CREATED_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>    
		</tr>

        <logic:iterate id="groupInfo" name="form" property="visibleGroupInfos" indexId="index" type="vkc.view.bean.GroupInfo">
        <tr>
		  <td class="columnUnselected">
		    <html:multibox name="form" property="selectedIds" onfocus="this.blur();"><vkc:write name="groupInfo" property="groupId"/></html:multibox>
		  </td>
          <td align="left" nowrap="nowrap" class="<%=nameColStyle%>">
            <logic:equal name="groupInfo" property="adminPrivileges" value="true">
            <b>&nbsp;<vkc:link page="<%=form.getEditGroupLink()%>" paramId="groupId" paramName="groupInfo" paramProperty="groupId" titleKey="vkc.tooltip.group.usualgroup"><vkc:write name="groupInfo" property="name" /></vkc:link>&nbsp;</b>
            </logic:equal>
            <logic:equal name="groupInfo" property="adminPrivileges" value="false">
            &nbsp;<vkc:link page="<%=form.getEditGroupLink()%>" paramId="groupId" paramName="groupInfo" paramProperty="groupId" titleKey="vkc.tooltip.group.usualgroup" style="font-weight:normal;"><vkc:write name="groupInfo" property="name" /></vkc:link>&nbsp;
            </logic:equal>
          </td>
          <td width="100%" align="left" nowrap="nowrap" class="<%=descriptionColStyle%>">
            &nbsp;<vkc:write name="groupInfo" property="description"/>&nbsp;
          </td>
          <td align="right" nowrap="nowrap" class="<%=countMembersColStyle%>">
            &nbsp;<vkc:write name="groupInfo" property="countMembers"/>&nbsp;
          </td>
          <td align="left" nowrap="nowrap" class="<%=accountStatusColStyle%>">
            <logic:equal name="groupInfo" property="groupValid" value="false">
            &nbsp;<vkc:message key="vkc.administration.accountState.disabled"/>&nbsp;
            </logic:equal>
            <logic:equal name="groupInfo" property="groupValid" value="true">
            &nbsp;<vkc:message key="vkc.administration.accountState.active"/>&nbsp;
            </logic:equal>
          </td>
          <td align="left" nowrap="nowrap" class="<%=creatorColStyle%>">
            <logic:notEmpty name="groupInfo" property="creator">
            &nbsp;<vkc:link href='<%="javascript:openUserInfoWindow(" + groupInfo.getCreatorId() + ");"%>' style='font-weight:normal;'><vkc:write name="groupInfo" property="creator.username"/></vkc:link>&nbsp;
            </logic:notEmpty>
            <logic:empty name="groupInfo" property="creator">
            &nbsp;
            </logic:empty>
          </td>
          <td align="left" nowrap="nowrap" class="<%=createdColStyle%>">
            &nbsp;<vkc:write name="groupInfo" property="created" formatKey="date.short.format"/>&nbsp;
          </td>
        </tr>
        </logic:iterate>
 	  </table>
 	</td>
  </tr>

  <tr><td align="center"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" border="0" width="5" height="5"/></td></tr>
  <tr><td colspan="2">&nbsp;<input type="checkbox" name="allItems" value="allItems" onclick="javascript:checkAll(this.form);">&nbsp;<vkc:message key="vkc.string.checkAll"/></td></tr>
  <tr><td align="center"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" border="0" width="5" height="5"/></td></tr>
  <tr>
    <td colspan="2">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>  
          <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" border="0" width="5"/><vkc:img page="/templates/${template.name}/gfx/function-arrow.gif" alt="-->" border="0"/></td>
          <td>
            <html:select name="form" property="selectedCmdAction" value="noaction">
	  	      <html:option value="noaction"><vkc:message key="vkc.string.chooseFunction"/></html:option>
		      <html:option value="noaction1">------------------------------------</html:option>
		      <html:option value="delete.groups"><vkc:message key="button.delete"/></html:option>
		      <html:option value="lock.groups"><vkc:message key="button.lock"/></html:option>                		
		      <html:option value="unlock.groups"><vkc:message key="button.unlock"/></html:option>                		
	        </html:select>
	      </td>
	      <td>&nbsp;<vkc:button property="action.execute" onclick="modifyGroups(this);"><vkc:message key="button.execute"/></vkc:button></td>
        </tr>
 	  </table>
	</td>
  </tr>
  </logic:notEqual>
  </logic:notEqual>
  </html:form>
</table>
</html:html>
