<script type="text/javascript">
function manage_group(mode, value) {
	ajax.exec({
		action   : 'manage_group',
		mode     : mode,
		group_id : {GROUP_ID},
		value    : value
	});
	ajax.callback.manage_group = function(data) {
		if (data.act == 0) $('div#avatar').hide(100);
		console.log(data);
	}
}
</script>
<div class="col-md-12">
<div class="box box-primary">
	<div class="box-header with-border">
		<h3 class="box-title">{L_GROUP_INFORMATION}</h3>
	</div>
	<div class="box-body form-horizontal">
		<div class="form-group">
			<label class="col-sm-2 control-label">{L_GROUP_NAME}:</label>

			<div class="col-sm-10">
				<input type="text" class="form-control" id="group_name" size="80" value="{GROUP_NAME}" onblur="manage_group(this.id, this.value);" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">{L_GROUP_DESCRIPTION}:</label>

			<div class="col-sm-10">
				<p><div id="preview_description"></div></p>
				<p><textarea class="form-control" id="group_description">{GROUP_DESCRIPTION}</textarea></p>
					<input class="btn btn-default" type="button" value="{L_AJAX_PREVIEW}" onclick="ajax.exec({ action: 'posts', type: 'view_message', message: $('textarea#group_description').val()});ajax.callback.posts=function(data){$('div#preview_description').html(data.message_html);initPostBBCode('div#preview_description')}">
					<input class="btn btn-default" type="button" value="{L_SAVE}" onclick="manage_group('group_description',$('textarea#group_description').val())">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">{L_SIGNATURE}:</label>

			<div class="col-sm-10">
			<p><div id="preview_signature"></div></p>
				<p><textarea class="form-control" id="group_signature">{GROUP_SIGNATURE}</textarea></p>
					<input class="btn btn-default" type="button" value="{L_AJAX_PREVIEW}" onclick="ajax.exec({ action: 'posts', type: 'view_message', message: $('textarea#group_signature').val()});ajax.callback.posts=function(data){$('div#preview_signature').html(data.message_html);initPostBBCode('div#preview_signature')}">
					<input class="btn btn-default" type="button" value="{L_SAVE}" onclick="manage_group('group_signature',$('textarea#group_signature').val())">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">{L_GROUP_TYPE}:</label>

			<div class="col-sm-10">
				<div class="form-group" style="margin-left: 0px; margin-right: 0px;">
					<div class="radio">
						<label><input type="radio" name="group_type" onchange="manage_group(this.name,this.value)" value="{S_GROUP_OPEN_TYPE}" {S_GROUP_OPEN_CHECKED} />{L_GROUP_OPEN}</label>
					</div>
					<div class="radio">
						<label><input type="radio" name="group_type" onchange="manage_group(this.name,this.value)" value="{S_GROUP_CLOSED_TYPE}" {S_GROUP_CLOSED_CHECKED} />{L_GROUP_CLOSED}</label>
					</div>
					<div class="radio">
						<label><input type="radio" name="group_type" onchange="manage_group(this.name,this.value)" value="{S_GROUP_HIDDEN_TYPE}" {S_GROUP_HIDDEN_CHECKED} />{L_GROUP_HIDDEN}</label>
					</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">{L_RELEASE_GROUP}:</label>

			<div class="col-sm-10">
				<div class="form-group" style="margin-left: 0px; margin-right: 0px;">
					<div class="radio">
						<label><input type="radio" name="release_group" value="1" onclick="manage_group(this.name,this.value)" <!-- IF RELEASE_GROUP -->checked="checked"<!-- ENDIF --> />{L_YES}</label>
						<label><input type="radio" name="release_group" value="0" onclick="manage_group(this.name,this.value)" <!-- IF not RELEASE_GROUP -->checked="checked"<!-- ENDIF --> />{L_NO}</label>
					</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">{L_AVATAR}:
				<div id="avatar" align="test-center">
					<p>{AVATAR_IMG}</p>
					<p><input type="button" class="btn btn-default" name="delete_avatar" value="{L_DELETE_IMAGE}" onclick="manage_group(this.name,this.value)" /></p>
				</div>
			</label>

			<div class="col-sm-10">
			<div id="avatar_explain" class="text-muted small">{AVATAR_EXPLAIN}</div>
			<!-- IF $bb_cfg['group_avatars']['up_allowed'] -->
			<div class="form-group">
				<form action="{S_GROUP_CONFIG_ACTION}" method="post" enctype="multipart/form-data">
					{S_HIDDEN_FIELDS}
					<p>
					<input type="hidden" name="MAX_FILE_SIZE" value="{$bb_cfg['avatars']['max_size']}">
					<input type="file" name="avatar">
					</p>
					<input class="btn btn-default" type="submit" name="submit" value="{L_UPLOAD_AVATAR_FILE}">
				</form>
			</div>
			<!-- ENDIF -->
			</div>
		</div>
	</div>
</div>
</div>