function name_area(ccc){ if(ccc.checked){ document.getElementById("name_area").style.display='none'; writeCookie('nameshow',1,720) }else{ document.getElementById("name_area").style.display=''; writeCookie('nameshow',0,720) } } function readCookie(name){ var cookieValue = ""; var search = name + "="; if(document.cookie.length > 0){ offset = document.cookie.indexOf(search); if (offset != -1){ offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; cookieValue = unescape(document.cookie.substring(offset, end)) } } return cookieValue; } function writeCookie(name, value, hours){ var expire = ""; var domain = "; path=/; domain=.hangzhou.com.cn"; if(hours != null){ expire = new Date((new Date()).getTime() + hours * 3600000); expire = "; expires=" + expire.toGMTString(); } document.cookie = name + "=" + escape(value) + expire + domain; } function comcheck(frm){ if(frm.content.value==''){ alert("请输入评论类容!"); frm.content.focus(); return false; } if(frm.niming.checked===false && frm.name.value==''){ alert("请输入昵称,或者勾选匿名发表!"); frm.name.focus(); return false; }else{ writeCookie('namecom',frm.name.value,720); } return true; } function byteLength (sStr) { aMatch = sStr.match(/[^\x00-\x80]/g); return (sStr.length + (! aMatch ? 0 : aMatch.length)); } function getStrbylen(str, len) { var num = 0; var strlen = 0; var newstr = ""; var laststrlen = 1; var obj_value_arr = str.split(""); for(var i = 0; i < obj_value_arr.length; i ++) { if(i < len && num + byteLength(obj_value_arr[i]) <= len) { num += byteLength(obj_value_arr[i]); strlen = i + 1; } } if(str.length > strlen) { if(byteLength(str.charAt(strlen-1)) == 1){ laststrlen = 2; } newstr = str.substr(0, strlen-laststrlen) + '…'; } else { newstr = str; } return newstr; } function textCounter(obj, maxlimit) { var len = strLen(obj.value); if(len > maxlimit) { obj.value = getStrbylen(obj.value, maxlimit); alert("最多"+maxlimit+"个字节"); } } function strLen(str) { var charset = document.charset; var len = 0; for(var i = 0; i < str.length; i++) { len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == "utf-8" ? 3 : 2) : 1; } return len; } document.write(''); document.write(''); document.write('
'); document.write('
网友提问选登
'); document.write('所有发帖(已有5位网友发帖)
'); document.write('下雨天 2011-04-15 17:21:16
'); document.write('aaa 2011-04-15 17:10:21
'); document.write('上学难 2011-04-15 16:40:12
'); document.write('小朋友 2011-04-15 16:15:24
'); document.write('mumu 2011-04-15 16:07:18
'); document.write(''); document.write('所有发帖(已有5位网友发帖)'); document.write('
'); document.write(''); document.write('
'); document.write(''); document.write('