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 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.asp?act=hiddenGroup&ftblog=" + ftblog + "&flag=1";
		}else{
			location.reload();
		}
	}
}
function pwd(id,userid,photo_name)
{
  var arr = showModalDialog("pwd.asp?id="+id+"&userid="+userid+"&photo_name="+photo_name, "", "dialogWidth:18em; dialogHeight:8em; status:0;help:0");
  if (arr != null){
   return true;
  }
  else
  {return false;}
}
function checkpwd(id,userid,photo_name)
{
  var arr = showModalDialog("pass.asp?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 selectAll()  //全选
{
	var f=document.selectform
	var box=f.checkbox1
    var length=0
	if(box && !box[0]){length=1}
	if(box[0]){length=box.length}

    if (length == 0 ){return;}
    if (length ==1 ){box.checked=true;}
    if (length>1){
      for (var i = 0; i < length; i++){
        box[i].checked=true;
       }
    }
}
function selectRev()  //反选
{
	var f=document.selectform
	var box=f.checkbox1
    var length=0
	if(box && !box[0]){length=1}
	if(box[0]){length=box.length}

    if (length == 0 ){return;}
    if (length ==1 ){box.checked=!(box.checked);}
    if (length>1){
      for (var i = 0; i < length; i++){
        box[i].checked=!box[i].checked;
       }
    }
}
function pl_op(optype){
	var f=document.forms["selectform"]
	f.op.value=optype
	f.submit()
}
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;
}
function chkphoto(form)
	{	
    if (form.photo_name.value=="")
    	{
    		alert("请选择你的相册名称如没有请先创建相册！");
    		form.photo_name.focus();
    		return false;
  	}
    if (form.photofile.value=="")
    	{
    		alert("请选择你要上传的相片！");
    		form.photofile.focus();
    		return false;
  	}
    return true;
}

function check(form)
	{
    if (form.clubuser_name.value=="")
    	{
    		alert("请填写用户名！");
    		form.clubuser_name.focus();
    		return false;
  	}
    if (form.clubuser_email.value=="")
    	{
    		alert("请填写你的Email！");
    		form.clubuser_email.focus();
    		return false;
  	}
    if ((form.clubuser_email.value.indexOf("@")==-1)||(form.clubuser_email.value.indexOf(".")==-1))
    	{
    		alert("email格式有错！(例如：master@x.com)");
    		form.clubuser_email.focus();
    		return false;
  	    }
    if (form.clubuser_address.value=="")
    	{
    		alert("请填写你的地址！");
    		form.clubuser_address.focus();
    		return false;
  	}
    if (form.homepagetitle.value=="")
    	{
    		alert("请填写blog的标题！");
    		form.homepagetitle.focus();
    		return false;
  	}
   return true;
}
function chkpassword(form)
	{
    if (form.oldpwd.value=="")
    	{
    		alert("请填写旧密码！");
    		form.oldpwd.focus();
    		return false;
  	}
    if (form.newpwd1.value=="")
    	{
    		alert("请填写新密码！");
    		form.newpwd1.focus();
    		return false;
  	}
    if (form.newpwd2.value=="")
    	{
    		alert("请填写确认密码！");
    		form.newpwd2.focus();
    		return false;
  	}
    if (form.newpwd1.value!=form.newpwd2.value)
    	{
    		alert("新密码和新密码确认不一致！");
    		form.newpwd2.focus();
    		return false;
  	}
   return true;
}
function OK(){
  var str1="";
  var strurl=document.form1.pwd1.value;
  if (strurl=="")
  {
  	alert("请先输入密码！");
	document.form1.pwd1.focus();
	return false;
  }
  if (form1.pwd1.value!=form1.pwd2.value)
   {
    alert("密码和确认密码不一致！");
    form1.pwd2.focus();
    return false;
  	}
  else
  { 
    document.form1.submit()
    window.close();
  }
}
function checkblogsms(form)
	{
    if (form.title.value=="")
    	{
    		alert("请填写标题！");
    		form.title.focus();
    		return false;
  	}
    if (form.content.value=="")
    	{
    		alert("请填写内容！");
    		form.content.focus();
    		return false;
  	}
return true;
}