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;
	}
	}
	function recoder(id,word,author,editor){
	script=document.createElement("SCRIPT"); 
	script.type="text/javascript"; 
	script.src="http://cms.gdzjdaily.com.cn/pl/plcount.php?index_id="+id+"&index_name="+escape(word)+"&author="+escape(author)+"&editor="+escape(editor); 
	//script.src="testpl.php?index_name="+escape(word); 
	document.getElementsByTagName("HEAD")[0].appendChild(script);
	//alert("testpl.php?index_name="+escape(word));
	}
	function recoder1(id,word,author,editor,img){ //增加主题图片显示
	script=document.createElement("SCRIPT"); 
	script.type="text/javascript"; 
	script.src="http://cms.gdzjdaily.com.cn/pl/plcount.php?index_id="+id+"&index_name="+escape(word)+"&author="+escape(author)+"&editor="+escape(editor)+"&img="+escape(img); 
	//script.src="testpl.php?index_name="+escape(word); 
	document.getElementsByTagName("HEAD")[0].appendChild(script);
	//alert("testpl.php?index_name="+escape(word));
	}	
	function getCookie(name){
	var dc=document.cookie;
	var prefix=name+"=";
	var begin=dc.indexOf("; "+prefix);
	if(begin==-1){
	begin=dc.indexOf(prefix);
	if(begin!=0){
	return "";
	}
	}
	else{
	begin+=2;
	}
	var end=document.cookie.indexOf(";",begin);
	if(end==-1){
	end=dc.length;
	}
	return unescape(dc.substring(begin+prefix.length,end));
	}

	function deleteCookie(name,path,domain){
	if(getCookie(name)){
	document.cookie=name+"="+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
	} 
	function unshowComment(){
		var content=document.getElementById("content");
		if(content.value=='文明上网，理性评论')content.value='';

	}
	    	var now=new Date();
	now.setTime(now.getTime()+365*24*60*60*1000);
