﻿function is_number(str)
{
	exp=/[^0-9()-]/g;
	if(str.search(exp) != -1)
	{
		return false;
	}
	return true;
}

function CheckInput(){
if(form.kxlh.value==''){
		alert("Serial number can’t be empty. ");
		form.kxlh.focus();
		return false;
		
	}
 if(form.kxlh.value.length<10){
		alert("The format of serial number is wrong. ");
		form.kxlh.focus();
		return false;
	}
            if(!is_number(document.form.kxlh.value))
	{ alert("The format of serial number is wrong. ");
		form.kxlh.focus();
	return false;
	}
        if(form.user_pwd.value==''){
		alert("Registration password can’t be empty. ");
		form.user_pwd.focus();
		return false;
		
	}
        if(form.user_pwd.value.length<6){
		alert("Input wrong password. ");
		form.user_pwd.focus();
		return false;
	}
            if(!is_number(document.form.user_pwd.value))
	{ alert("Input wrong password.");
		form.user_pwd.focus();
	return false;
	}


	if (form.CheckCode.value==""){
       alert ("Verify code can’t be empty.");
       form.CheckCode.focus();
       return false;
    }

	return true;
}

