function hord(){
	if(divAdvance.style.display == "none"){
		divAdvance.style.display = "";
	}
	else{
		divAdvance.style.display = "none";
	}
}
function chkfilename()
{
	var filename=del_space(document.oblogform.filename.value);
	if (filename=="自动编号"){document.oblogform.filename.value=""}
	if (filename==""){document.oblogform.filename.value="自动编号"}
}
function checkerr(string)
{
var i=0;
for (i=0; i<string.length; i++)
{
if((string.charAt(i) < '0' || string.charAt(i) > '9') && (string.charAt(i) < 'a' || string.charAt(i) > 'z')&& (string.charAt(i) < 'A' || string.charAt(i) > 'Z')&& (string.charAt(i)!='-')&& (string.charAt(i)!='_')) 
{
return 1;
}
}
return 0;//pass
}
function setdraft()
{
	document.oblogform.isdraft.value='1';
}
function VerifySubmit()
{
	submits(); 
	topic = del_space(document.oblogform.topic.value);
     if (topic.length == 0)
     {
        alert("您忘了填写题目!");
	return false;
     }
	 <%
	 Dim iNeed
	 iNeed=1
	 %>
	 var needclassid=<%=iNeed%>;
	 if (needclassid==1) {
	 if (document.oblogform.classid.value == 0)
     {
        alert("请选择类别!");
	return false;
     }
	 }
	 
	 var filename=del_space(document.oblogform.filename.value);
	if ((checkerr(filename) == "1")&&(filename!="")&&(filename!="自动编号")){
		alert("文件名称请用0-9的数字和a-z的半角字母及下划线,不允许中文和怪字符（如!@#$%^等）；")
	return false
	}
	
	 showword = del_space(document.oblogform.showword.value);
      for(i = 0; i < showword.length; i++){
	  if(showword.charAt(i) < "0" || showword.charAt(i) > "9"){
	  alert("请输入正确的显示字数！");
	  return false;  
		 }
     }
	
 	if (document.oblogform.edit.value == "")
     {
        alert("请输入内容!");
	return false;
     }
	var date=document.oblogform.selecty.value+"-"+document.oblogform.selectm.value+"-"+document.oblogform.selectd.value
	var datereg=/^(\d{4})-(\d{1,2})-(\d{1,2})$/
	var datareg=/^(\d){1,2}$/
	if (!datereg.test(date)){
	  alert("发布时间输入格式错误");
	   return false;
	 }
	var r=date.match(datereg)
	var d=new Date(r[1],r[2]-1,r[3])
	if (!(d.getFullYear()==r[1]&&d.getMonth()==r[2]-1&&d.getDate()==r[3])){
	  alert("发布时间输入格式错误");
	   return false;
	 }
	 
  var FormLimit = 51100
  var TempVar = new String
  TempVar = document.oblogform.edit.value
  if (TempVar.length > FormLimit)
	{
	if (confirm("您要发布的内容太长，建议您拆分为几部分分别发布。\n如果您坚持提交，注意需要较长时间才能提交成功。\n\n是否坚持提交？") == false)
	return false;
	}
	
	  if (TempVar.length > FormLimit)
  {
    document.oblogform.edit.value = TempVar.substr(0, FormLimit)
    TempVar = TempVar.substr(FormLimit)
    while (TempVar.length > 0)
    {
      var objTEXTAREA = document.createElement("hidden")
      objTEXTAREA.name = "logtext"
      objTEXTAREA.value = TempVar.substr(0, FormLimit)
      document.oblogform.appendChild(objTEXTAREA)
      
      TempVar = TempVar.substr(FormLimit)
    }
  }	
 return true;
}

function setSort(s1,s2)
{
param=s1.selectedIndex-1;
if(param>=0)
	{
	s2.options.length=0;						
		for(i=0;i<p_array[param].length;i++)
		{
			s2.options.length++;
			s2.options[i].text=p_array[param][i];
			s2.options[i].value=p_array_id[param][i];
		}

	}else
	{
	s2.options.length=0;
	s2.options.length++;
	s2.options[0].text="我的专题";
	s2.options[0].value="0";
	}
}