function inputnum() { if ( !(((window.event.keycode >= 48) && (window.event.keycode <= 57)) || (window.event.keycode == 13) || (window.event.keycode == 45) || (window.event.keycode == 46))) { window.event.keycode = 0 ; } } function onlychinese() { if ((window.event.keycode >=32) && (window.event.keycode <= 126)) { window.event.keycode = 0 ; } } function correlative(formobject,fields,ctype,errstr,ismust) { if (typeof(formobject)=="undefined"){formobject = document.all;} if (typeof(ctype)=="undefined"){ctype="or";} if (typeof(errstr)=="undefined"){errstr="";} if (typeof(ismust)=="undefined"){ismust=1;} var tfield = fields.split("|") var z=0; for (var i=0;i0){getmsg(errstr);formobject[tfield[i-z]].focus();return false;} }else if (ctype=="or"){ if (i==z && ismust==1){getmsg(errstr);formobject[tfield[0]].focus();return false;} } formobject[tfield[0]].focus(); return true; } function replace(s, t, u) { i = s.indexof(t); r = ""; if (i == -1) return s; r += s.substring(0,i) + u; if ( i + t.length < s.length) r += replace(s.substring(i + t.length, s.length), t, u); return r; } function isnum(cstr,errstr,ismust,ltype,min,max) { if (typeof(cstr)=="undefined"){cstr="";} if (typeof(ismust)=="undefined"){ismust=1;} if (typeof(errstr)=="undefined"){errstr="";} var tempstr = "1234567890"; var k; if (cstr=="" && ismust==1){ getmsg(errstr); return false; } for(var i=0;i"){ if (cstrmax){ getmsg(errstr); return false; } }else if(ltype=="><"){ if (!(cstrmax)){ getmsg(errstr); return false; } }else{ return true; } } function isdate(dstr,errstr,ismust) { if (typeof(ismust)=="undefined"){ismust=1;} if (typeof(errstr)=="undefined"){errstr="";} var re=/^(\d{4})-(\d{1,2})-(\d{1,2})$/ if (!re.test(dstr)){ if (ismust==1 || dstr!=""){ getmsg(errstr); return false; }else{ return true; } } var r=dstr.match(re) var d=new date(r[1],r[2]-1,r[3]) var iserror = d.getfullyear()==r[1] && d.getmonth()==r[2]-1 && d.getdate()==r[3] if (errstr!="" && iserror==false){getmsg(errstr);} return iserror } function strlen(lstr,errstr,ismust,ltype,min,max) { if (typeof(lstr)=="undefined"){lstr = ""} var lnum = lstr.length; if (typeof(ismust)!="undefined"){if (ismust==0 && lnum==0){return;}} if (typeof(ltype)=="undefined" || ltype==""){ltype="=="} if (typeof(min)=="undefined" || min==""){min=0} if (typeof(max)=="undefined" || max==""){max=0} if (ltype=="=="){ if (lnum!=min && lnum!=max){ getmsg(errstr); return false; } }else if(ltype=="<>"){ if (lnummax){ getmsg(errstr); return false; } }else if(ltype=="><"){ if (!(lnummax)){ getmsg(errstr); return false; } }else{ return lnum; } } function isemail(formobject,fieldname,errstr,ismust) { if (typeof(formobject)=="undefined"){formobject = document.all;} if (typeof(formobject[fieldname])=="undefined"){return;} if (typeof(ismust)=="undefined"){ismust=1} var csobj = formobject[fieldname]; var csvalue = csobj.value; var nlen; var ncnt1, ncnt2; ncnt1=0; ncnt2=0; nlen = csvalue.length; for(var i=0; i' ){return false;} if(csvalue.charat(i)=='@'){ncnt1++;} if(csvalue.charat(i)=='.'){ncnt2++;} } if( ncnt1!=1 || ncnt2<1){ if (csvalue!="" || ismust==1){ getmsg(errstr); csobj.focus(); return false; }else{ return true; } }else{ return true; } } function ischecked(formobject,fieldname,errstr,ismust) { if (typeof(formobject)=="undefined"){formobject = document.all;} if (typeof(formobject[fieldname])=="undefined"){return;} if (typeof(ismust)=="undefined"){ismust=1;} if (typeof(errstr)=="undefined"){errstr="";} var checkedcount = 0; if (typeof(formobject[fieldname].length)=="undefined"){ if (formobject[fieldname].checked == true){checkedcount++;} }else{ for (var t=0;tenddate[month]){returndate=enddate[month]};else {returndate=date};return returndate;};function weekday(date){var thedate;if(typeof(date)=="string"){thedate=new date(date.split("-")[0],date.split("-")[1],date.split("-")[2]);};if(typeof(date)=="object"){thedate=date};return thedate.getday();};function hs_calender(){var lis="";var style="";style+="";var now;if(typeof(arguments[0])=="string"){selectdate=arguments[0].split("-");var year=selectdate[0];var month=parseint(selectdate[1])-1+"";var date=selectdate[2];now=new date(year,month,date);};else if(typeof(arguments[0])=="object"){now=arguments[0];};var lastmonthenddate=hs_dateadd("d","-1",now.getfullyear()+"-"+now.getmonth()+"-01").getdate();var lastmonthdate=weekday(now.getfullyear()+"-"+now.getmonth()+"-01");var thismonthlastdate=hs_dateadd("d","-1",now.getfullyear()+"-"+(parseint(now.getmonth())+1).tostring ()+"-01");var thismonthenddate=thismonthlastdate.getdate();var thismonthendday=thismonthlastdate.getday();var todayobj=new date();today=todayobj.getfullyear()+"-"+todayobj.getmonth()+"-"+todayobj.getdate();for(i=0;i"+lastmonthenddate+""+lis;lastmonthenddate--;};for(i=1;i<=thismonthenddate;i++){if(today==now.getfullyear()+"-"+now.getmonth()+"-"+i){var todaystring=now.getfullyear()+"-"+(parseint(now.getmonth())+1).tostring ()+"-"+i;lis+="
  • "+i+"
  • ";};else {lis+="
  • "+i+"
  • ";};};var j=1;for(i=thismonthendday;i<6;i++){lis+="
  • "+j+"
  • ";j++;};lis+=style;var calendertitle="»";calendertitle+="«";calendertitle+=""+now.getfullyear()+""+(parseint(now.getmonth())+1).tostring ()+"月";if(arguments.length>1){arguments[1].parentnode.parentnode.getelementsbytagname("ul")[1].innerhtml=lis;arguments[1].parentnode.innerhtml=calendertitle;};else {var calenderbox=style+"
    "+calendertitle+"
      "+lis+"
    ";return calenderbox;};};function _selectthisday(d){var boxobj=d.parentnode.parentnode.parentnode.parentnode.parentnode;boxobj.targetobj.value=d.title;boxobj.parentnode.removechild(boxobj);};function closecalender(d){var boxobj=d.parentnode.parentnode.parentnode;boxobj.parentnode.removechild(boxobj);};function calenderselectyear(obj){var opt="";var thisyear=obj.innerhtml;for(i=1970;i<=2020;i++){if(i==thisyear){opt+="";};else {opt+="";};};opt="";obj.parentnode.innerhtml=opt;};function selectthisyear(obj){hs_calender(obj.value+"-"+obj.parentnode.parentnode.getelementsbytagname("span")[1].getelementsbytagname("a")[0].innerhtml+"-1",obj.parentnode);};function calenderselectmonth(obj){var opt="";var thismonth=obj.innerhtml;for(i=1;i<=12;i++){if(i==thismonth){opt+="";};else {opt+="";};};opt="";obj.parentnode.innerhtml=opt;};function selectthismonth(obj){hs_calender(obj.parentnode.parentnode.getelementsbytagname("span")[0].getelementsbytagname("a")[0].innerhtml+"-"+obj.value+"-1",obj.parentnode);};function hs_setdate(inputobj){var calenderobj=document.createelement("span");calenderobj.innerhtml=hs_calender(new date());calenderobj.style.position="absolute";calenderobj.targetobj=inputobj;inputobj.parentnode.insertbefore(calenderobj,inputobj.nextsibling);};