"); ifm.style.width = 167; ifm.style.height = 160; var brcount,i,pos; brcount = 0; while(daysGrid.indexOf("
")!=-1) { pos = daysGrid.indexOf("
"); if( pos !=-1) { brcount =brcount +1 ; daysGrid = daysGrid.substr(pos+4); } } if(brcount == 5) ifm.style.height = 140; if(brcount==6) ifm.style.height = 157; if(brcount == 7) ifm.style.height = 172; //elt.innerHTML = daysGrid; } else { var elt = document.layers[eltName].document; elt.open(); elt.write(daysGrid); elt.close(); } } function incMonth(delta,eltName) { displayMonth += delta; if (displayMonth >= 12) { displayMonth = 0; incYear(1,eltName); } else if (displayMonth <= -1) { displayMonth = 11; incYear(-1,eltName); } else { newCalendar(eltName); } } function incYear(delta,eltName) { displayYear = parseInt(displayYear + '') + delta; newCalendar(eltName); } function makeDaysGrid(startDay,day,intDaysInMonth,newCal,eltName) { var daysGrid; var month = newCal.getMonth(); var year = newCal.getFullYear(); var isThisYear = (year == new Date().getFullYear()); var isThisMonth = (day > -1) daysGrid = ''; daysGrid += '' daysGrid += ''; daysGrid += ''; return daysGrid + "
' daysGrid += ''; daysGrid += '
'; daysGrid += ''; daysGrid += '  '; daysGrid += '«'; daysGrid += ' '; if (isThisMonth) { daysGrid += '' + months[month] + ''; } else { daysGrid += months[month]; } daysGrid += ''; daysGrid += ' »'; daysGrid += '  '; daysGrid += '«'; daysGrid += ' '; daysGrid += ''; if (isThisYear) { daysGrid += '' + year + ''; } else { daysGrid += ''+year; } daysGrid += ''; daysGrid += ' »
'; daysGrid += ' Su Mo Tu We Th Fr Sa 
 '; var dayOfMonthOfFirstSunday = (7 - startDay + 1); for (var intWeek = 0; intWeek < 6; intWeek++) { var dayOfMonth; for (var intDay = 0; intDay < 7; intDay++) { dayOfMonth = (intWeek * 7) + intDay + dayOfMonthOfFirstSunday - 7; if (dayOfMonth <= 0) { daysGrid += "   "; } else if (dayOfMonth <= intDaysInMonth) { var color = "Black"; if (day > 0 && day == dayOfMonth) color="red"; daysGrid += ''; var dayString = dayOfMonth + " "; if (dayString.length == 6) dayString = '0' + dayString; daysGrid += dayString; } } if (dayOfMonth < intDaysInMonth) daysGrid += "
 "; } daysGrid += '
'; daysGrid += '清 空
"; } function setDay(day,eltName) { if (day != null){ displayElement.value = displayYear + "-" + (displayMonth + 1) + "-" + day; }else{ displayElement.value = ""; } hideElement(eltName); } function setToDay(eltName) { this.now = new Date(); this.year = this.now.getFullYear(); this.month = this.now.getMonth(); this.day = this.now.getDate(); displayElement.value = this.year + "-" + (this.month + 1) + "-" + this.day; hideElement(eltName); } function fixPosition(eltname) { elt = getXBrowserRef(eltname); positionerImgName = eltname + 'Pos'; // hint: try setting isPlacedUnder to false isPlacedUnder = false; if (isPlacedUnder) { setPosition(elt,positionerImgName,true); } else { setPosition(elt,positionerImgName) } } function toggleDatePicker(eltName,formElt) { var x = formElt.indexOf('.'); var formName = formElt.substring(0,x); var formEltName = formElt.substring(x+1); newCalendar(eltName,document.forms[formName].elements[formEltName]); toggleVisible(eltName); }