<!--
function isEmail(regexpValue){  //验证邮箱的合法性
	if ('undefined' == typeof(regexpValue)) {
		return false;
	}
	var email_regexp=/^[^\s].*@(\w*\-*\w*)+\.\w+/;
	var get_data = regexpValue;
	var result=get_data.match(email_regexp);
	if(result!=null){
		if(!get_data.match(/.*@.*@.*/))
			return true;
		return false;
	}
	return false;
}

function checkForm(obj){
  if (obj.user.value.length< 1 ||obj.user.value.length> 8){
  window.alert("名字长度在1-8个字符之间！请检查您的填写")
  obj.user.focus();
  return false;
  }//只要名是"user"的表单元素就行
  
  if (obj.email.value !=""){
     if(!isEmail(obj.email.value)){
	  alert("请输入合法的 Email 地址!");
	  obj.email.focus();
	  obj.email.select();
	  return false;
	  }
  }//只要名是"email"的表单元素就行
  
　if (obj.content.value.length< 1 ||obj.content.value.length> 240){
　window.alert("内容长度在1-240个字符之间！请检查您的填写")
　obj.content.focus();
　return false;
　}//只要名是"content"的表单元素就行

else return true;
}

function checkPfen(obj){
　if (obj.f1.value=="" ||obj.f2.value=="" ||obj.f3.value=="" ||obj.f4.value==""){
　window.alert("评分条目未选全，请返回检查")
　obj.f1.focus();
　return false;
　}//只要名是"f1,f2,f3,f4"的表单元素就行
else return true;
}

maxLen = 240; // 以下是限制多行文本框的输入字数，并动态显示它。
function checkMaxInput(obj) {
  if (obj.content.value.length > maxLen) // 如果太长，则trim它
  obj.content.value = obj.content.value.substring(0, maxLen);
  else document.getElementById("count").innerText = maxLen - obj.content.value.length;// 否则更新count的字数显示
  }

var showobj=document.createElement("img");
var sign=0;
function show(obj){
   var offsetleft = obj.offsetLeft;
   var offsettop = obj.offsetTop;
   while (obj.offsetParent != document.body){
   obj = obj.offsetParent;
   offsetleft += obj.offsetLeft;
   offsettop += obj.offsetTop;}

   //alert(offsettop);alert(offsetleft);
   sign=0;
   if(showobj.id){showobj.style.display='';return false;}
   showobj.style.position="absolute";
   showobj.src="/getcode.asp?type=2";
   showobj.id="showdiv";
   showobj.title="看不清楚？点击刷新验证码";
   showobj.width=60;
   showobj.height=20;
   showobj.border=1;
   showobj.style.top=(offsettop-22)+"px";
   showobj.style.left=(offsetleft+2)+"px";
   showobj.style.cursor="pointer";
   showobj.style.display='';
   document.body.appendChild(showobj);
   showobj.onclick=function(){this.src=this.src=="/getcode.asp"? "/getcode.asp":"/getcode.asp";}
   showobj.onmouseover=function(){sign=0;}
   showobj.onmouseout=function(){sign=1;}
}
document.onclick=function(){
   if(sign)showobj.style.display="none";
   else sign=1;
}

//-->

