//不允许输入中文 var engonly=function(str){ for(i=0;i2050||m<1||m>12||d<1||d>31) return false; if ((m==4||m==6||m==9||m==11)&&d>30) return false; if ((y%100!=0&&y%4==0)||y%400==0){ if (m==2&&d>29) return false; } else { if (m==2&&d>28) return false; } return true; } //密码强度检测 function passwordgrade(pwd) { var score = 0; var regexarr = ['[0-9]', '[a-z]', '[a-z]', '[\\w_]']; var repeatcount = 0; var prevchar = ''; //check length var len = pwd.length; score += len > 18 ? 18 : len; //check type for (var i = 0, num = regexarr.length; i < num; i++) { if (eval('/' + regexarr[i] + '/').test(pwd)) score += 4; } //bonus point for (var i = 0, num = regexarr.length; i < num; i++) { if (pwd.match(eval('/' + regexarr[i] + '/g')) && pwd.match(eval('/' + regexarr[i] + '/g')).length >= 2) score += 2; if (pwd.match(eval('/' + regexarr[i] + '/g')) && pwd.match(eval('/' + regexarr[i] + '/g')).length >= 5) score += 2; } //deduction for (var i = 0, num = pwd.length; i < num; i++) { if (pwd.charat(i) == prevchar) repeatcount++; else prevchar = pwd.charat(i); } score -= repeatcount * 1; return score; } //字符限制 var charset="gb2312"; function strlen_verify(obj, checklen, maxlen) { var v = obj.value, charlen = 0, maxlen = !maxlen ? 255 : maxlen, curlen = maxlen, len = strlen(v); for(var i = 0; i < v.length; i++) { if(v.charcodeat(i) < 0 || v.charcodeat(i) > 255) { curlen -= charset == 'utf-8' ? 2 : 1; } } if(curlen >= len) { $('#'+checklen).html(curlen - len); } else { obj.value = mb_cutstr(v, maxlen, true); } } function mb_cutstr(str, maxlen, dot) { var len = 0; var ret = ''; var dot = !dot ? '...' : ''; maxlen = maxlen - dot.length; for(var i = 0; i < str.length; i++) { len += str.charcodeat(i) < 0 || str.charcodeat(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1; if(len > maxlen) { ret += dot; break; } ret += str.substr(i, 1); } return ret; } function strlen(str) { return ($.browser.msie && str.indexof('\n') != -1) ? str.replace(/\r?\n/g, '_').length : str.length; } //全选取消 function checkall(form) { for (var i=0;it3){t0=t3} url=t2+t0; if(t4==1) { if(t1!=1) { if(t0<=1) { if(t1==2){ var a=t2; var b=a.split("_"); t5="list_"+b[1]+".html" } else { t5="./" } } else { if(t1==2){ var a=t2; var b=a.split("_"); t5="list_"+b[1]+"_[page].html" } else { t5="index_[page].html" } t5=t5.replace("[page]",t0); } url=t5; } } document.location.href=url; } $(function(){ var $body; var $select; var messageidnumber=0; var messageid; $.message=function(settings){ if(settings.content==null){ settings.content=""; } if($body==null){ $body=$("body"); } if(!window.xmlhttprequest&&$select==null){ $select=$("select"); } if($select!=null) { $select.css("visibility","hidden"); } if(settings.type==null){ settings.type="warn"; } if(settings.time==null){ settings.time=1500; } if(settings.id==null) { messageid="message"+messageidnumber; } else { messageid=settings.id } messageidnumber++; var messagehtml; messagehtml='
'+settings.content+'
'; $body.append(messagehtml); var $message=$("#"+messageid); $message.css({"margin-left":"-"+parseint($message.width()/2)+"px"}).slidetoggle(); settimeout(function(){ $message.animate({width:0,height:0},"toggle",function(){ $message.remove(); if ($select!=null){ $select.css("visibility","visible"); } }); },settings.time); return messageid; } });