function chkForm(obj)
{
var pattern=/^[\u4e00-\u9fa5a-zA-Z0-9]+$/;
if(obj.ftblog.value == "")
{
alert("请输入分类名称");
obj.ftblog.focus();
return false;
}
if(!pattern.test(obj.ftblog.value))
{
alert("注意:只能是中文,英文或数字");
return false;
}
return true;
}
function chk(ftblog_old){
	if(ftblog_old!=""){
		document.all.t1.style.display="";
	}else{
		document.all.t1.style.display="none";
	}
var obj = document.form2;
obj.ftblog_old.value = ftblog_old;
obj.ftblog.value = ftblog_old;
document.getElementById("oldgroupname").innerHTML = ftblog_old;	
}
function chkid(ftblog_old,id){
	if(ftblog_old!=""){
		document.all.t1.style.display="";
	}else{
		document.all.t1.style.display="none";
	}
var obj = document.form2;
obj.ftblog_old.value = ftblog_old;
obj.ftblog.value = ftblog_old;
obj.id.value = id;
document.getElementById("oldgroupname").innerHTML = ftblog_old;	
}
function closechk()
{
document.all.t1.style.display="none";
}

function hiddenGroup1(ftblog, obj)
{
	var flag = (obj.checked ? 1 : 0);
	var v = obj.value;
	if (flag == 0){
		if(confirm("如果公开，那么任何人都可以在您的主页查看该分类的内容！"))
		{
			window.location.href = "?act=hiddenGroup&ftblog=" + ftblog + "&flag=0";
		}else{
			location.reload();
		}
	}
	if (flag == 1)
	{
		if(confirm("如果隐藏，那么该分类将不出现在您主页里！"))
		{
			window.location.href = "op.php?act=hiddenGroup&ftblog=" + ftblog + "&flag=1";
		}else{
			location.reload();
		}
	}
}
function pwd(id,userid,photo_name)
{
  var arr = showModalDialog("pwd.php?id="+id+"&userid="+userid+"&photo_name="+photo_name, "", "dialogWidth:18em; dialogHeight:8em; status:0;help:0");
  if (arr != null){
   // window.location.href = "op.php?id=" + id + "&sign=2";
   return true;
  }
  else
  {return false;}
}
function checkpwd(id,userid,photo_name)
{
  var arr = showModalDialog("pass.php?id="+id+"&userid="+userid+"&photo_name="+photo_name, "", "dialogWidth:18em; dialogHeight:4.5em; status:0;help:0");
  if (arr != null){
   return true;
  }
  else
  {return false;}
}
//全选反选
function checkall(form, checkall) {
	var checkall = checkall ? checkall : 'chkall';
	for(var i = 0; i < form.elements.length; i++) {
		var e = form.elements[i];
		e.checked = form.elements[checkall].checked;
	}
}
function play(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
			if (e.checked==false)
			{
				e.checked = true;
			}
			else
			{
				e.checked = false;
			}
	document.selectform.submit()
	}
	return false;
}