function trim(string){
	var i=0,j=string.length-1,tmp,result;
	tmp=string.charAt(i);
	while(tmp==' '){
	i++;
	tmp=string.charAt(i);
	}
	tmp=string.charAt(j);
	while(tmp==' '){
	j--;
	tmp=string.charAt(j);
	}
	if(i<=j){
	result=string.substring(i,j+1);
	}
	else{
	result="";
	}
	return result;
	}
      function postform(string){
	
	//string.action='http://cms.gdzjdaily.com.cn/pl/pl_add.php';
	string.action='http://cms.gdzjdaily.com.cn/pl/pl_add.php';
	string.encoding='application/x-www-form-urlencoded';
	string.submit();
	}
	 function postformword(string,num){
    	
    	//string.action='http://cms.gdzjdaily.com.cn/pl/pl_add.php';
    	string.action='http://cms.gdzjdaily.com.cn/pl/pl_list.php?index_id='+num;
    	string.encoding='application/x-www-form-urlencoded';
    	string.submit();
    	}
	function notNull(fieldname,string){
	string.value=trim(string.value);
	if(string.value==""){
	alert("请输入“"+fieldname+"”！");
	string.focus();
	return false;
	}
	else{
	return true;
	}
	}

	function validform(string){
	re="/匿名网友/i";
	if(string.comment_username.value.search(re)==-1){
	if(string.content.value==""){
	alert("请填写内容！");
	string.content.focus();
	return false;
	}
	}
	if(!confirm('您真的要留言吗？')){
	return false;
	}
	string.action='http://cms.gdzjdaily.com.cn/pl/pl_add.php';
	string.encoding='application/x-www-form-urlencoded';
	}

	function textCount(form,limit){
	if(form.content.value.length>limit+1){
	alert("内容不能多于"+limit+"个字符数！");
	form.content.value=form.content.value.substring(0,limit);
	}
	form.chars.value=form.content.value.length;
	}

	function Reply(id){
		tmp=eval("A"+id);
		comment.innerHTML="原贴：<br>\n"+tmp.innerHTML;
		comment.style.display='';
		document.GuestBook.fid.value=id;
		document.GuestBook.content.focus();
		}

	function Complain(id){
	reason=prompt("请注明举报原因","");
	if(reason!=null&&reason!=0){
	document.location.href="gb_complain.php?id="+id+"&reason="+reason;
	}
	}