##<!-- $Header: Exp $ -->
## Site group list
<div class ="portletBody">
	#if($menu)#toolbar($menu)#end
	<h3>
		$tlang.getString('group.list')
	</h3>	
	#if ($alertMessage)
		<div class="alertMessage">$tlang.getString("ediacc.alert") $validator.escapeHtml($alertMessage)</div>
		<div class="clear"></div>
	#end
	<form name="groupForm" id="groupForm" action="#toolForm($action)" method="post">
		#set($hasgroup = false)
		#if ($!groups && $!groups.hasNext())
			#set($hasgroup = true)
			
			<table class ="listHier lines nolines"  border="0" cellpadding="0" cellspacing="0" summary ="$tlang.getString('group.tablesummary')">
				<tr>
					<th id="name">
						<a href="#toolLinkParam($action "doSort_sites" "criterion=$tlang.getString('group.title')")" title ="$tlang.getString("group.title")"> 
							$tlang.getString("group.title")
							#if ($currentSortedBy.equals($tlang.getString("group.title"))) 
								#if ($currentSortAsc.equals("true")) 
									<img src = "#imageLink("sakai/sortascending.gif")" border="0" title ="$tlang.getString('group.sorttitleasc')" alt ="$tlang.getString('group.sorttitleasc')" /> 
								#else 
									<img src = "#imageLink("sakai/sortdescending.gif")" border="0" title ="$tlang.getString('group.sorttitledesc')" alt ="$tlang.getString('group.sorttitledesc')" /> 
								#end 
							#end 
						</a>
					</th>
					<th id="revise">
						<span class="skip">$tlang.getString("editgroup.revise")</span>
					</th>
					<th id="count">
						<a href="#toolLinkParam($action "doSort_sites" "criterion=$tlang.getString('group.number')")" title ="$tlang.getString("group.number")"> 
							$tlang.getString("group.number")
							#if ($currentSortedBy.equals($tlang.getString("group.number"))) 
								#if ($currentSortAsc.equals("true")) 
									<img src = "#imageLink("sakai/sortascending.gif")" border="0" title ="$tlang.getString('group.sortnumberasc')" alt ="$tlang.getString('group.sortnumberasc')" /> 
								#else 
									<img src = "#imageLink("sakai/sortdescending.gif")" border="0" title ="$tlang.getString('group.sortnumberdesc')" alt ="$tlang.getString('group.sortnumberdesc')" /> 
								#end 
							#end 
						</a>
					</th>
					<th id="remove" class="screenOnly">
						$tlang.getString("editgroup.remove")
					</th>
				</tr>
				#foreach($group in $!groups)
					<tr>
						<td headers="name">
							<h4>$group.Title</h4>
						</td>
						<td headers="revise">
							<span class="itemAction">
								<a href="#toolLinkParam("$action" "doGroup_edit" "groupId=$group.Id")" title ="$tlang.getString("editgroup.revise") $group.Title">$tlang.getString("editgroup.revise")</a>
							</span>	
						</td>
						<td headers="count">
							$!group.getMembers().size()
						</td>
						<td headers="remove" class="screenOnly">
							<label class="skip" for="remove_$group.Id">$tlang.getString("editgroup.selectremovechecked")  $group.Title</label> 
							<input type="checkbox" name="removeGroups" value="$group.Id" id="remove_$group.Id" onclick="adjustCount(this, 'removeCount', 'removeButton');" onkeypress="adjustCount(this, 'removeCount', 'removeButton');" />
						</td>
					</tr>
				#end
			</table>
		#else	
			$tlang.getString("group.nogroup")
		#end		
		<input type="hidden" name="template-index" value="49" />
		<input type="hidden" name="back" value="12" />
		<div class ="act">
				#if ($hasgroup)
					<input type="submit" accesskey ="s" class="active" name="eventSubmit_doGroup_remove_prep" id="removeButton" value="$tlang.getString("editgroup.removechecked")" disabled="disabled" />
				#end
					<input type="submit" accesskey ="x"  name="eventSubmit_doBack" value="$tlang.getString('editgroup.back')" />
		</div>
		<input type="hidden" id="removeCount" value="0" />
	</form>
	<script language="JavaScript" type="text/JavaScript">
	<!--	
		function adjustCount(caller, countName, buttonName)
		{
			var counter = document.getElementById(countName);
			var button = document.getElementById(buttonName);
			
			if(caller && caller.checked && caller.checked == true)
			{
				counter.value = parseInt(counter.value) + 1;
			}
			else
			{
				counter.value = parseInt(counter.value) - 1;
			}
	
			if(button)
			{
				if(counter.value > 0)
				{
					button.disabled = false;
					button.className='enabled';
				}
				else
				{
					button.disabled = true;
					button.className='disabled';
				}
			}
		}
	//-->
	</script>
</div>
