function checkAll(n,fldName) { if(!fldName){ fldName = 'cb'; } var f = document.form1; var c = f.toggle.checked; var n2 = 0; for (i=0; i < n; i++) { cb = eval( 'f.' + fldName + '' + i ); if (cb) { if(cb.disabled==false) cb.checked = c; n2++; } } if (c) { document.form1.boxchecked.value = n2; } else { document.form1.boxchecked.value = 0; } } // function check_all(t,n){ var c=document.getElementById('toggle_'+n).checked; var f = document.form1; for(i=1;i<=t;i++) { cb=document.getElementById('cb_'+n+'_'+i); if(cb){ cb.checked=c; } } } //--------------------------------树路径checkbox //取得上级路径 function check_all_tree(){ var n=document.getElementsByTagName("input"); var C=new Array(); for(i=0;i0){ var a=confirm("确认删除吗?"); if(a==true){ document.form1._a.value="delete"; document.form1.submit(); } }else{ alert('请选择记录!'); } } // function ddel_act(n,act){ var f = document.form1; var fldName = 'cb'; var n2 = 0; for (i=0; i < n; i++) { cb = eval( 'f.' + fldName + '' + i ); if (cb) { if(cb.checked) n2++; } } if(n2>0){ var a=confirm("确认删除吗?"); if(a==true){ document.form1._a.value=act; document.form1.submit(); } }else{ alert('请选择记录!'); } } // function dcheckbox_act(n,act,msg){ var f = document.form1; var fldName = 'cb'; var n2 = 0; for (i=0; i < n; i++) { cb = eval( 'f.' + fldName + '' + i ); if (cb) { if(cb.checked) n2++; } } if(n2>0){ var a=confirm(msg); if(a==true){ document.form1._a.value=act; document.form1.submit(); } }else{ alert('请选择记录!'); } } // function dcheckbox_act1(n,act){ var f = document.form1; var fldName = 'cb'; var n2 = 0; for (i=0; i < n; i++) { cb = eval( 'f.' + fldName + '' + i ); if (cb) { if(cb.checked) n2++; } } if(n2==1){ document.form1._a.value=act; document.form1.submit(); }else{ alert('请选择一条记录进行操作!'); } } // function dadd(){ document.form1._a.value="add"; document.form1.submit(); } // function dimport(){ document.form1._a.value="import"; document.form1.submit(); } // function dexport(){ document.form1._a.value="export"; document.form1.submit(); } // function daction(act){ document.form1._a.value=act; document.form1.submit(); } // function dconfirm(msg,act){ var a=confirm(msg); if(a==true){ document.form1._a.value=act; document.form1.submit(); } } // function dconfirm_url(msg,url){ var a=confirm(msg); if(a==true){ window.location.href=url; } } // function dconfirm_owin(msg,url,winName,width,height){ var a=confirm(msg); if(a==true){ o_window(url,winName,width,height); } } // function save_ord(n){ document.form1.boxchecked.value = 0; document.form1.toggle.checked = true; checkAll(n); document.form1._a.value="save_ord"; document.form1.submit(); } // function save_ord1(act,n){ document.form1.boxchecked.value = 0; document.form1.toggle.checked = true; checkAll(n); document.form1._a.value=act; document.form1.submit(); } /////////////-------------------------------------> function o_window(url,winName,width,height){ xposition=0; yposition=0; if ((parseInt(navigator.appVersion) >= 4 )){ xposition = (screen.width - width) / 2; yposition = (screen.height - height) / 2; } theproperty= "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=1," + "scrollbars=yes," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0," + "screenx=" + xposition + "," //仅适用于Netscape + "screeny=" + yposition + "," //仅适用于Netscape + "left=" + xposition + "," //IE + "top=" + yposition; //IE window.open( url,winName,theproperty ); } function o_window1(url,winName,width,height){ xposition=0; yposition=0; if ((parseInt(navigator.appVersion) >= 4 )){ xposition = (screen.width - width) / 2; yposition = (screen.height - height) / 2; } theproperty= "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=1," + "scrollbars=no," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0," + "screenx=" + xposition + "," //仅适用于Netscape + "screeny=" + yposition + "," //仅适用于Netscape + "left=" + xposition + "," //IE + "top=" + yposition; //IE window.open( url,winName,theproperty ); } //打印窗口 function win_print(url){ o_window(url,'print',800,580,'_blank'); } // function win_print_heng(url){ o_window(url,'print',1000,580,'_blank'); } // function IsExt(url,opt){ var sTemp; var b=false; var s=opt.toUpperCase().split("|"); for (var i=0;i0){ var WeekFirstDay = new Date(Nowdate - (Nowdate.getDay()-1) * 86400000); var WeekLastDay = Nowdate; }else{ var WeekLastDay = Nowdate; var WeekFirstDay = new Date((WeekLastDay / 1000 - 6 * 86400) * 1000); } document.getElementById(s).value = date2string(WeekFirstDay); document.getElementById(e).value = date2string(WeekLastDay); } function set_date_last_week(s,e){ var Nowdate = new Date(); if(Nowdate.getDay()>0){ var WeekFirstDay = new Date(Nowdate - (Nowdate.getDay() + 6) * 86400000); var WeekLastDay = new Date((WeekFirstDay / 1000 + 6 * 86400) * 1000); }else{ var WeekFirstDay = new Date(Nowdate - (Nowdate.getDay() + 13) * 86400000); var WeekLastDay = new Date((WeekFirstDay / 1000 + 6 * 86400) * 1000); } document.getElementById(s).value = date2string(WeekFirstDay); document.getElementById(e).value = date2string(WeekLastDay); } function set_date_this_month(s,e){ var Nowdate = new Date(); var FirstDay = new Date(Nowdate - (Nowdate.getDate()-1) * 86400000); var LastDay = Nowdate; document.getElementById(s).value = date2string(FirstDay); document.getElementById(e).value = date2string(LastDay); } function show_kh_pic(kh,pic){ var obj_div=document.getElementById("div_kh_pic"); var e=e||window.event; var st=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop; var t1=e.clientY+st; var l1=e.clientX+40; t1=e.clientY>350?t1-230:t1; obj_div.style.top=t1+"px"; obj_div.style.left=l1+"px"; obj_div.innerHTML="
"+kh+"
关闭
"; obj_div.style.display=""; } function close_div(div){ var obj_div=document.getElementById(div); obj_div.style.display="none"; }