
	function group_mem_add(gid)
	{
		getajax('/groups/ajax/mem_add.html','&GID='+gid,'ajaxresult','group_mem_status(ajaxresult)');
	}

	function group_mem_del(gid)
	{
		getajax('/groups/ajax/mem_del.html','&GID='+gid+'&STEP=1','ajaxresult','group_mem_status(ajaxresult)');
	}

	function group_mem_del_ok(gid)
	{
		getajax('/groups/ajax/mem_del.html','&GID='+gid+'&STEP=2','ajaxresult','group_mem_status(ajaxresult)');
	}

	function groupDelete(gid, c)
	{
		if(typeof c == 'undefined') c = 0;
		getajax('/groups/ajax/group_delete.html','&gid='+gid+'&c=' + c,'ajaxresult','groupDeleteHandle(ajaxresult)');
	}

	function groupDeleteHandle(result)
	{
		if (result == 'deleted') {
			document.location.href = '/groups/';
		}
		else {
			$('group_status_sub').innerHTML	= result;
		}
	}

	function group_mem_status(result)
	{
		resultarray = result.split('|');
		if (resultarray[0] == 1)
		{
			if (resultarray[1] == 1)
			{
				$('group_status').innerHTML = resultarray[4];
			}
			if (resultarray[2] == 1)
			{
				$('group_status_sub').innerHTML = resultarray[3];
			}
		}
		if (resultarray[0] == 0)
		{
			if (resultarray[1] == 1)
			{
				$('group_status').innerHTML = resultarray[4];
			}
			if (resultarray[2] == 1)
			{
				$('group_status_sub').innerHTML = resultarray[3];
			}
		}
	}

	function group_hide_substatus()
	{
		$('group_status_sub').innerHTML = '';
	}

	function ruser_status(result)
	{
		none('ruser_'+result);
		var tmp = ($('grusernum').innerHTML)*1-1;
		$('grusernum').innerHTML = tmp;
	}

	function add_ruser(uid)
	{
		getajax('/groups/ajax/ruser_add.html','&GID='+gid+'&UID='+uid,'ajaxresult','ruser_status(ajaxresult)');
	}

	function del_ruser(uid)
	{
		block('ruser_del_'+uid);
		none('ruser_delbtn_'+uid);
	}

	function del_ruser_ok(uid)
	{
		getajax('/groups/ajax/ruser_del.html','&GID='+gid+'&UID='+uid,'ajaxresult','ruser_status(ajaxresult)');
	}

	function del_ruser_cancel(uid)
	{
		none('ruser_del_'+uid);
		block('ruser_delbtn_'+uid);
	}


