<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
?>
<script language="javascript" type="text/javascript">
var vBobjects = new Array();
function fetch_object(idname, forcefetch)
{
	if (typeof(vBobjects[idname]) == "undefined")
	{
		vBobjects[idname] = MM_findObj(idname);
	}
	return vBobjects[idname];
}
function getGroup(Did)
{
var SGroup = fetch_object(Did);
	if (SGroup){
		if (SGroup.style.display=='none'){
		SGroup.style.top = '120px'//(document.body.scrollTop+((document.body.clientHeight-1000)/2))+"px";
		SGroup.style.left = '340px'//(document.body.scrollLeft+((document.body.clientWidth-480)/2))+"px";
		SGroup.style.display = '';
		}
		else{
			var SelGroupid = fetch_object("SelGroupid");
			var groupid = fetch_object("groupid");
			var Val="";
			SGroup.style.display='none';
			if (SelGroupid){
				for (var i=0;i<SelGroupid.length;i++){
					if (SelGroupid.options[i].selected){
						Val += SelGroupid.options[i].value;
						Val += ",";
					}
				}
				groupid.value = Val.substr(0,Val.lastIndexOf(","));
			}
		}
	}
}
function MM_findObj(n, d) {
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  
	if(!x && d.getElementById) x=d.getElementById(n); return x;

} 
function CheckAll(form)  {
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name != 'chkall'&&e.type=="checkbox")
		{
			e.checked = form.chkall.checked;
		}
	}
}
function showtable(){
	if (document.getElementById("isdefault").checked){
		document.getElementById('table_1').style.display='none';
		document.getElementById('tr_1').style.display='none';
		document.getElementById('tr_2').style.display='none';
		}else{
		document.getElementById('table_1').style.display='block';
		document.getElementById('tr_1').style.display='block';
		document.getElementById('tr_2').style.display='block';
		}
	}
</script>
<form method="post" action="?action=savepermission&amp;editgroupid=<?=$groupid?>" style="margin : 0;">
<input type="hidden" name="groupid" value="" />
<input type="hidden" name="boardid" value="<?=$boardid?>" />
<table border="0" cellspacing="0" cellpadding="0"  align="center" class="tableborder">
<tbody>
<tr> 
<td width="100%" colspan="2" class="tdtit" ><?=$lang['g_title_falg']?>
<?=$lang['board_permission_7']?><?=$boardtype?> <?=$lang['board_permission_8']?> <?=$usertitle?>
</td>
</tr>
<tr class="forumrow">
<td style="text-align:right;"><input type="radio" name="isdefault" value="1"<?if($isdefault==1){echo ' checked';}?> onclick="showtable();"/></td>
<td><b><?=$lang['main_str_1']?></b> <?=$lang['main_str_2']?></td>
</tr>
<tr class="forumrow">
<td style="text-align:right;"><input type="radio" name="isdefault" value="0"<?if($isdefault==0){echo ' checked';}?> onclick="showtable();"/></td>
<td  class="forumrow"><b><?=$lang['main_str_3']?></b>&nbsp;<?=$lang['main_str_4']?></td>
</tr>
<tr class="forumrow" id="tr_2">
<td colspan="2" style="text-indent:48px;">
<ol style="margin-top : 0px;margin-bottom :0px;">
<li><font color="red"><?=$lang['main_str_5']?></font></li>
<li><font color="blue"><?=$lang['main_str_10']?></font></li>
<li><?=$lang['main_str_6']?></li>
</ol>
</td>
</tr>
<tr id="tr_1">
<td class="td" height="30" colspan="2" style="text-indent:50px;"><?=$lang['main_str_7']?><input type="button" class="button" value="<?=$lang['main_str_8']?>" onclick="getGroup('Select_Group');" />
 <input type="checkbox" name="chkall" onclick="CheckAll(this.form);" />[<?=$lang['main_str_9']?>]</td>
</tr>
</tbody>
</table>
<?
grouppermission($groupsetting);
?>
<input type="hidden" value="yes" name="groupaction" />
</form>
<?
Select_Group($GLOBALS['groupid']);
?>
<script language="javascript" type="text/javascript">
showtable();
</script>