arrWeekCaption_cn = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六") arrWeekCaption_en = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat") arrMonthCaption_cn= new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月") arrMonthCaption_en= new Array("January","February","March","APRil","May","June","July","August","September","October","November","December")
function MonthView(){}
/******************************* 初始化控件 /*******************************/ function MonthView.initialize(){
function MonthView.setCurrentCaption(){ spanCurrentYear.innerHTML=currentYear if (languageName=="cn"){ spanCurrentMonth.innerHTML=arrMonthCaption_cn[currentMonth] }else{ spanCurrentMonth.innerHTML=arrMonthCaption_en[currentMonth] } } function MonthView.setWeekCaption(){
if (languageName=="cn"){ arrCaption=arrWeekCaption_cn }else{ arrCaption=arrWeekCaption_en }
for (var i=0; i<arrCaption.length; i++){ tblShowDay.rows[0].cells[i].innerHTML=arrCaption[i] } } function MonthView.bulidDay(){
function MonthView.showCurrentDate(direction){ if (direction=="preview"){ currentMonth-- if (currentMonth<0) {currentMonth=11 ;currentYear--} } if (direction=="next"){ currentMonth++ if (currentMonth>11) {currentMonth=0 ;currentYear++} }
MonthView.setCurrentCaption() MonthView.bulidDay() } function MonthView.setLanguage(itsName){ languageName=itsName MonthView.setCurrentCaption() MonthView.setWeekCaption() MonthView.setShowHideToday(true) } function MonthView.setCaptionBg(itsColor){ trCaption.style.background=itsColor } function MonthView.setBorder(itsBorder){ tblMonthView.style.border=itsBorder } function MonthView.setLineColor(itsColor){ tdLine.style.background=itsColor } function MonthView.setShowHideToday(flag){ el=tblToday.rows[0].cells[1] if (flag){ if (languageName=="cn"){ el.innerHTML="今日:"+nowYear+"-"+(nowMonth+1)+"-"+nowDate }else{ el.innerHTML="Today:"+nowYear+"-"+(nowMonth+1)+"-"+nowDate }
el.style.display="block" }else{ el.style.display="none" } } function MonthView.action(){ //*********请修改此函数********* MonthView_value=currentYear+"-"+(currentMonth+1)+"-"+this.innerHTML alert(MonthView_value)