function checkpro(){

	if(!check('username','用户昵称不能为空')){return false;};
	if(!checklen('username',3,'用户名不能小于三位')){
		return false;
	}else{
		var img = $R('chkuserimg').src;
		img = img.substr(img.length-9,5);
		if(img=="wrong"){alert("昵称已存在");$R('username').focus();return false;}
	}
	if(!checklen('onepasswd',6,'密码不能小于六位')){return false;}
	if(!repasswd('onepasswd','repasswd')){return false};
	if(!check('name','真实姓名不能为空')){return false;};
	if(!check('email','邮箱不能为空')){
		return false;
	}else{
		var emailimg = $R('chkemailimg').src;
		emailimg = emailimg.substr(emailimg.length-9,5);
		if(emailimg=="wrong"){alert("邮件格式错误或已被注册");$R('email').focus();return false;}
	}
	return true;
	}
	
function checkqy(){
	if(!check('username','公司名称不能为空')){return false;};
	if(!checklen('username',3,'用户名不能小于三位')){return false;}
	if(!checklen('onepasswd',6,'密码不能小于六位')){return false;}
	if(!repasswd('onepasswd','repasswd')){return false};
	if(!check('email','邮箱不能为空')){return false;};
	if(!checkemail('email')){return false;};

	
	return true;
	}

function checkly(){
	if(!check('guestname','姓名不能为空')){return false;};
	if(!check('guesttext','内容不能为空')){return false};
	if(!check('guestyzm','验证码不能为空')){return false;};
	}


function checksm(){
	if(!check('username','姓名不能为空')){return false;};
	if(!check('cdata','时间不能为空')){return false};
	if(!check('tel','联系电话不能为空')){return false;};
	if(!check('address','联系地址不能为空')){return false;};
	if(!check('text','描述不能为空')){return false;};
	}

function checknum(o,msg){
	reg = RegExp( '/[0-9]+/');
	if(!reg.test($V(o))){
		alert(msg);
		$R(o).focus();
		return false;
		}
	return o;
	}

function checkemail(o){
	if($V(o).length > 0 && !$V(o).match( /^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/ )){
		alert('邮箱格式错误！');
		$R(o).focus();
		return false;
	}
	return true;
}

function checklen(o,num,msg){
	if($V(o).length < num-1){
		alert(msg);
		$R(o).focus();
		return false;
	}
	return true;
}

function check(o,msg){
	if($V(o)==""){
		alert(msg);
		$R(o).focus();
		return false;
		}
	return true;
	}

function repasswd(one,two){
	if($V(one)==''){
		alert('密码不能为空');
		$R(one).focus();
		return false;
		}
	if($V(one)!=$V(two)){
		alert("二次密码不一致");
		$R(one).focus();
		return false;
		}
	return true;
	}
	
function $R(o){
	return document.getElementById(o);
	}
function $V(o){
	return document.getElementById(o).value;
	}
function $H(o,msg){
	document.getElementById(o).innerHTML=msg;
	}