//网站顶部搜索表单验证. function checktopsearch() { if (jtrim(document.topsearchform.keyword.value)==''||jtrim(document.topsearchform.keyword.value)=='请输入关键字') { window.alert ("请输入关键字!"); document.topsearchform.keyword.value=""; document.topsearchform.keyword.focus(); return false; } return true } //网站首页项目搜索表单验证. function check_index_project_search() { if (jtrim(document.indexprojectsearchform.keyword.value)==''||jtrim(document.indexprojectsearchform.keyword.value)=='输入项目编号') { window.alert ("输入项目编号!"); document.indexprojectsearchform.keyword.value=""; document.indexprojectsearchform.keyword.focus(); return false; } return true } //网站内页项目搜索表单验证. function check_project_search() { if (jtrim(document.projectsearchform.keyword.value)==''||jtrim(document.projectsearchform.keyword.value)=='输入项目编号') { window.alert ("输入项目编号!"); document.projectsearchform.keyword.value=""; document.projectsearchform.keyword.focus(); return false; } return true } //////////jquery网页顶部消息提示框插件 配置begin////////////////////////// //为 tips 提示框自定义 css,以下为默认 xcsoft.tipscss = { height: '44px', fontsize: '16px' }; //隐藏、显示速度 ,默认 fast xcsoft.tipshide=xcsoft.tipsshow=100; //调用举例说明 //xcsoft.info('请填写你的相关信息哟',3000);//提示消息[3秒后自动消失] //xcsoft.success('你的信息更新完毕',1500);//成功消息[1.5秒后自动消失] //xcsoft.error('你还有信息未填写',2000);//失败消息[2秒后自动消失] //xcsoft.loading('正在更新中,请等待...');//加载消息[不会自动消失] //xcsoft._hide();//强制隐藏消息 //////////jquery网页顶部消息提示框插件 配置end////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////以下为基本公共函数///////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //重置表单函数 function formreset(formid){ document.getelementbyid(formid).reset() } //判断姓名是否为中文 function ischinesename(name) { var patrn = /^\s*[\u4e00-\u9fa5]{1,}[\u4e00-\u9fa5.·]{0,5}[\u4e00-\u9fa5]{1,}\s*$/; if(!patrn.exec(name)) { return false; } return true; } function is_mobile(s) { if(s.length!=11){return false;} if(isnan(s)){return false;} var sub_s = s.substr(0,3); var arr = new array(130,131,132,133,134,135,136,137,138,139,145,146,147,149,150,151,152,153,154,155,156,157,158,159,166,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199); for(var i = 0; i < arr.length; i++){ if(sub_s == arr[i]){ return true; } } return false; } //检查email地址是否有效. function is_email(s) { if(s.length<6 || s.length>50){ return false; }else{ var mytestexp = /^([a-za-z]|[0-9])(\w|\-)+@[a-za-z0-9]+\.([a-za-z]{2,4})$/; if(!mytestexp.test(s)){ return false; }else{ return true; } } } function is_username(s) { if(s.length<5 || s.length>20){ return false; }else{ //var regu = "^([a-za-z]+[_0-9a-za-z@.-]*)$" //字母(a-z)、数字(0-9)、@、点、中划线、下划线组成,且必须以字母开头 var regu = "^([a-za-z]+[_0-9a-za-z-]*)$" //字母(a-z)、数字(0-9)、中划线、下划线组成,且必须以字母开头 var re = new regexp(regu); if (s.search(re) != -1) { return true; } else { //window.alert ("会员登录名由字母(a-z)、数字(0-9)、中划线、下划线组成,且必须以字母开头!") return false; } } } function is_pwd(s) { if(s.length<5 || s.length>20){ return false; }else{ var mytestexp = /^[0-9a-za-z_-]{5,20}$/; if(!mytestexp.test(s)){ return false; }else{ return true; } } } function is_safedir(s) { if(s.length<5 || s.length>20){ return false; }else{ var regu = "^([a-za-z]+[_0-9a-za-z-]*)$" //字母(a-z)、数字(0-9)、中划线、下划线组成,且必须以字母开头 var re = new regexp(regu); if (s.search(re) != -1) { return true; } else { return false; } } } //判断字符是否为空的方法 function is_empty(obj){ if(typeof obj == "undefined" || obj == null || obj == "undefined" || obj == "nan" || obj == "" || obj == " " || obj.length == 0){ return true; }else{ return false; } } function is_mobiletwo(s) { //pattern: 手机号为数字,长度大于等于8且小于等于11 var patrn = /^(\d{7,11})?$/; if (!patrn.exec(s)) return false return true } function showclick(msg){ if(confirm(msg)){ event.returnvalue=true; }else{ event.returnvalue=false; } } function jtrim(str) { var i = 0; var len = str.length; if ( str == "" ) return( str ); j = len -1; flagbegin = true; flagend = true; while (( flagbegin == true) && (i< len)) { if ( str.charat(i) == " " ) { i=i+1; flagbegin=true; } else { flagbegin=false; } } while ((flagend== true) && (j>=0)) { if (str.charat(j)==" ") { j=j-1; flagend=true; } else { flagend=false; } } if ( i > j ) return (""); trimstr = str.substring(i,j+1); return trimstr; } function isvaliddate( year, month, day ) { year = parseint(year,10); month = parseint(month,10); day = parseint(day,10); if (( month==4) || (month==6) || (month==9) || (month==11) ) { if (( day < 1) || (day > 30) ) { alert( "日期在1 - 30之间" ); return (false); } } else { if ( month!=2 ) { if ( (day < 1) || (day > 31 )) { alert( "日期在1 - 31之间" ); return (false); } } else { // month == 2 if ( ( year % 100 ) != 0 && (year % 4 == 0) || ( year % 100 ) == 0 && ( year % 400) == 0 ) { if ( day > 29 ) { alert( "日期在1 - 29之间" ); return (false); } } else { if ( day > 28 ) { alert( "日期在1 - 28之间" ); return (false); } } } } return (true); } function isvaliddate_e( year, month, day ) { year = parseint(year,10); month = parseint(month,10); day = parseint(day,10); if (( month==4) || (month==6) || (month==9) || (month==11) ) { if (( day < 1) || (day > 30) ) { alert( "day must between 1 - 30" ); return (false); } } else { if ( month!=2 ) { if ( (day < 1) || (day > 31 )) { alert( "day must between 1 - 31" ); return (false); } } else { // month == 2 if ( ( year % 100 ) != 0 && (year % 4 == 0) || ( year % 100 ) == 0 && ( year % 400) == 0 ) { if ( day > 29 ) { alert( "day must between 1 - 29" ); return (false); } } else { if ( day > 28 ) { alert( "day must between 1 - 28" ); return (false); } } } } return (true); } function datecompare(yearfrom, monthfrom, yearto, monthto) { yearfrom = parseint(yearfrom,10); monthfrom = parseint(monthfrom,10); yearto = parseint(yearto,10); monthto = parseint(monthto,10); if (yearfrom > yearto) { return false;} else { if (yearfrom == yearto) { if (monthfrom > monthto) return false; } } return true; } function checkall(form) { for (var i=0;i