/*
聽AspirinCheck v1.0
聽code by aspirin
聽thinking814@hotmail.com
*/
function AspirinCheck(){
聽var i =1;
聽var ipCk = ipCk=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}$)/g;
聽var numberCk=/^\d+$/g;
聽//Email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$ //渚嬪瓙<input name="Email" dataType="Email" msg="淇$鏍煎紡涓嶆紜?>
聽/*鍙傝冪殑ip鎺т歡
聽聽<span class="ipInput" id="bip">
聽聽聽<input
name="broadCastIpOne" MAXLENGTH=3 onkeydown="nextFocus(event)"
>.<input name="broadCastIpTwo" MAXLENGTH=3
onkeydown="nextFocus(event)" >.<input name="broadCastIpThree"
MAXLENGTH=3 onkeydown="nextFocus(event)" >.<input
name="broadCastIpFour" MAXLENGTH=3 onkeydown="nextFocus(event)" >
聽聽</span>
聽聽<script>
聽聽function nextFocus(event){
聽聽聽if(event.keyCode==110 || event.keyCode==46 || event.keyCode==190){聽
聽聽聽聽event.keyCode=9;
聽聽聽}
聽聽}
聽聽</script>
聽*/
聽this.ipCheck = function(ip){
聽聽if(this.isEmpty(email))return true;
聽聽var ipArray = ip.split(".");
聽聽return
ipCk.test(ip) && new Number(ipArray[0])<=255 && new
Number(ipArray[1])<=255 && new Number(ipArray[2])<=255
&& new Number(ipArray[3])<=255;
聽}
聽
聽this.numberOnly = function (str){
聽聽if(this.isEmpty(email))return true;
聽聽return numberCk.test(str);
聽}
聽
聽this.limit = function (len,min,max){
聽聽min = min || 0;
聽聽max = max || Number.MAX_VALUE;
聽聽return min <= len && len <= max;
聽}
聽
聽this.isRepeat = function (one,two){
聽聽return one==two;
聽}
聽this.checkemail = function (email){
聽聽if(this.isEmpty(email))return true;
聽聽var emailCk = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
聽聽/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
聽聽if (!emailCk.test(email)) return false;
聽聽return true;
聽}
聽
聽this.checkmobile = function (mobile){
聽聽if(this.isEmpty(email))return true;
聽聽var mobileCk = /^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
聽聽if (!mobileCk.test(mobile)) return false;
聽聽return true;
聽}
聽this.isEmpty = function (obj){
聽聽return (obj=="" || obj.split(" ").join("") == "")?true:false;
聽}
}
/*寮曞叆鏂瑰紡(star)
<script type="text/javascript">
聽function _import(className){
聽聽window.document.write("<scr"+"ipt
type=\"text/javascript\"
src=\"鍓嶆璺緞\""+className+".js\"></sc"+"ript>");
聽}
聽_import("AspirinCheck");
</script>
*/