在编译时总是提示“tbSelYear”、“tbSelMonth”未定义
var gdCtrl = new Object();
var goSelectTag = new Array();
var gcGray = "#808080 ";
var gcToggle = "#FFFF00 ";
var gcred = "#FF0000 ";
var gcBG = "#F8F9EE ";
var gcGreen = "#00FF00 "
var gdCurDate = new Date();
var giYear = gdCurDate.getFullYear();
var giMonth = gdCurDate.getMonth()+1;
var giDay = gdCurDate.getDate();
function fSetDate(iYear, iMonth, iDay){
gdCtrl.value = iYear+ "- "+iMonth+ "- "+iDay;
}
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;
}
}
}
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 <iDayOfFirst)?-(iOffsetLast+d):iDate++;
for (w = 2; w < 7; w++)
for (d = 0; d < 7; d++)
aMonth[w][d] = (iDate <=iDaysInMonth)?iDate++:-(iNext++);
return aMonth;
}
function fDrawCal(iYear, iMonth, iCellHeight, iDateTextSize) {
var i = 0;
var w = 0;
var d = 0;
var WeekDay = new Array( "日 ", "一 ", " 二 ", " 三 ", " 四 ", " 五 ", " 六 ");
var styleTD &nbs