string.prototype.replaceall = function(s1,s2){ return this.replace(new regexp(s1,"gm"),s2); } function resizeimg(imgd,iwidth,iheight) { var image=new image(); image.src=imgd.src; if(image.width>0 && image.height>0){ if(image.width/image.height>= iwidth/iheight){ if(image.width>iwidth){ imgd.width=iwidth; imgd.height=(image.height*iwidth)/image.width; }else{ imgd.width=image.width; imgd.height=image.height; } imgd.alt=image.width+"×"+image.height; } else{ if(image.height>iheight){ imgd.height=iheight; imgd.width=(image.width*iheight)/image.height; }else{ imgd.width=image.width; imgd.height=image.height; } imgd.alt=image.width+"×"+image.height; }      imgd.style.cursor= "pointer"; //改变鼠标指针      imgd.onclick = function() { window.open(this.src);} //点击打开大图片     if (navigator.useragent.tolowercase().indexof("ie") > -1) { //判断浏览器,如果是ie       imgd.title = "请使用鼠标滚轮缩放图片,点击图片可在新窗口打开";       imgd.onmousewheel = function img_zoom() //滚轮缩放       {           var zoom = parseint(this.style.zoom, 10) || 100;           zoom += event.wheeldelta / 12;           if (zoom> 0) this.style.zoom = zoom + "%";           return false;       }     } else { //如果不是ie         imgd.title = "点击图片可在新窗口打开";        } } } function switchplay(url,p_width,p_height) { if(url.indexof(".")!=-1) { var swf_width=p_width; var swf_height=p_height; var extypearr=url.split("."); var extype=extypearr[extypearr.length-1].tolowercase(); var sfwstring=".swf"; var flvstring=".flv"; var mpstring=".mp3,.mp4,.wmv,.avi,.mpeg,.wma"; var rmstring=".rm3,.rmvb"; var picstring=".jpg,.gif,.png,.bmp"; if(sfwstring.indexof(extype)!=-1){ document.writeln("<\/embed>"); }else if(flvstring.indexof(extype)!=-1){ var texts = ''; var files = url; var config='0:自动播放|1:连续播放|100:默认音量|0:控制栏位置|2:控制栏显示|0x000033:主体颜色|60:主体透明度|0x66ff00:光晕颜色|0xffffff:图标颜色|0xffffff:文字颜色|:logo文字|:logo地址|:结束swf地址' document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); }else if(mpstring.indexof(extype)!=-1 || rmstring.indexof(extype)!=-1){ document.writeln("<\/embed>"); }else if(rmstring.indexof(extype)!=-1){ document.writeln("<\/embed>"); }else if(picstring.indexof(extype)!=-1){ document.writeln(""); }else{ document.writeln("<\/embed>"); } } } 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);};