var gdCtrl = new Object(); var goSelectTag = new Array(); var gcGray = "#808080"; var gcToggle = "#ffff00"; var gcBG = "#eeeeee"; var gdCurDate = new Date(); var giYear = gdCurDate.getFullYear(); var giMonth = gdCurDate.getMonth()+1; var giDay = gdCurDate.getDate(); function fPopCalendar(popCtrl, dateCtrl){ event.cancelBubble=true; gdCtrl = dateCtrl; fSetYearMon(giYear, giMonth); var point = fGetXY(popCtrl); with (VicPopCal.style) { left = point.x; top = point.y+popCtrl.offsetHeight+1; width = VicPopCal.offsetWidth; height = VicPopCal.offsetHeight; fToggleTags(point); visibility = 'visible'; } VicPopCal.focus(); } function fSetDate(iYear, iMonth, iDay){ if(iMonth<10) iMonth='0'+iMonth; if(iDay<10) iDay='0'+iDay; gdCtrl.value = iYear+"-"+iMonth+"-"+iDay; fHideCalendar(); } function fHideCalendar(){ VicPopCal.style.visibility = "hidden"; for (i in goSelectTag) goSelectTag[i].style.visibility = "visible"; goSelectTag.length = 0; } function fSetSelected(aCell){ var iOffset = 0; var iYear = parseInt(tbSelYear.value); var iMonth = parseInt(tbSelMonth.value); aCell.bgColor = gcBG; with (aCell.children["cellText"]){ var iDay = parseInt(innerText); if (color==gcGray) iOffset = (Victor<10)?-1:1; iMonth += iOffset; if (iMonth<1) { iYear--; iMonth = 12; }else if (iMonth>12){ iYear++; iMonth = 1; } } fSetDate(iYear, iMonth, iDay); } function Point(iX, iY){ this.x = iX; this.y = iY; } function fBuildCal(iYear, iMonth) { var aMonth=new Array(); for(i=1;i<7;i++) aMonth[i]=new Array(i); var dCalDate=new Date(iYear, iMonth-1, 1); var iDayOfFirst=dCalDate.getDay(); var iDaysInMonth=new Date(iYear, iMonth, 0).getDate(); var iOffsetLast=new Date(iYear, iMonth-1, 0).getDate()-iDayOfFirst+1; var iDate = 1; var iNext = 1; for (d = 0; d < 7; d++) aMonth[1][d] = (d" + WeekDay[i] + ""); write(""); for (w = 1; w < 7; w++) { write(""); for (d = 0; d < 7; d++) { write(""); write(" "); write("") } write(""); } } } function fUpdateCal(iYear, iMonth) { myMonth = fBuildCal(iYear, iMonth); var i = 0; for (w = 0; w < 6; w++) for (d = 0; d < 7; d++) with (cellText[(7*w)+d]) { Victor = i++; if (myMonth[w+1][d]<0) { color = gcGray; innerText = -myMonth[w+1][d]; }else{ color = ((d==0)||(d==6))?"red":"black"; innerText = myMonth[w+1][d]; } } } function fSetYearMon(iYear, iMon){ tbSelMonth.options[iMon-1].selected = true; for (i = 0; i < tbSelYear.length; i++) if (tbSelYear.options[i].value == iYear) tbSelYear.options[i].selected = true; iYear=tbSelYear.options[tbSelYear.selectedIndex].value; fUpdateCal(iYear, iMon); } function fPrevMonth(){ var iMon = tbSelMonth.value; var iYear = tbSelYear.value; if (--iMon<1) { iMon = 12; iYear--; } fSetYearMon(iYear, iMon); } function fNextMonth(){ var iMon = tbSelMonth.value; var iYear = tbSelYear.value; if (++iMon>12) { iMon = 1; iYear++; } fSetYearMon(iYear, iMon); } function fPrevYear(){ var iMon = tbSelMonth.value; var iYear = tbSelYear.value - 1 ; fSetYearMon(iYear, iMon); } function fNextYear(){ var iMon = tbSelMonth.value; var iYear = tbSelYear.value + 1 ; fSetYearMon(iYear, iMon); } function fToggleTags(){ with (document.all.tags("SELECT")){ for (i=0; ir)||(ptLT.x+aTag.offsetWidthb)||(ptLT.y+aTag.offsetHeightdocument.body.scrollWidth){ pt.x=pt.x+aTag.offsetWidth-190; // pt.x=document.body.scrollWidth-190; } return pt; } var gMonths = new Array(" 一月"," 二月"," 三月"," 四月"," 五月"," 六月"," 七月"," 八月"," 九月"," 十月","十一月","十二月"); var st = giYear - 80; var ed = giYear + 5; //ed = 2050; //如果是限制查询跨度的BOSS业务则起止年份为去年和今年 if (document.URL.indexOf("historyquery.jsp") > 0) { st = giYear - 1; ed = giYear; } //在线知识库类型,内容增加,批量修改时截止时间应为2050 beforeAddPubquestionanswer.do if (document.URL.indexOf("detailRepositoryType.do") > 0 || document.URL.indexOf("updateAllPub.do") > 0 || document.URL.indexOf("beforeEditPubquestionanswer.do") > 0 || document.URL.indexOf("beforeAddPubquestionanswer.do") > 0) { st = giYear - 1; ed = 2050; } with (document) { write(""); } function fClearCalendar(){ gdCtrl.value = ""; fHideCalendar(); } function keepCal() { event.cancelBubble = true; }