日期:2009-03-27  浏览次数:20963 次

<HTML>
<HEAD>
<TITLE>jsMonthView Demo</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<Script language="javascript">
<!--
//this is jsMonthView 1.1, author is Chinese DengKang (2002-08-21).
//I allow your do any modify, but i don't bear any liability.
//browser: IE 4 and later
function DefineMonthView(theTextObject){ //the month view construct function
  this.GetOnlyName = function( ){ //create one and only name on the document
    var theName = "MV"; //the month view elements name prefix, allow modify
    var aryName = new Array();
    aryName[0] = "_MonthView"; //the month view main body's name postfix, can not modify
    aryName[1] = "_MonthGrid"; //the month view day area's name postfix, can not modify
    aryName[2] = "_goPreviousMonth"; //the month view go previous month button's name postfix, can not modify
    aryName[3] = "_goNextMonth"; //the month view go next month button's name postfix, can not modify
    aryName[4] = "_YearList"; //the month view year list's name postfix, can not modify
    aryName[5] = "_MonthList"; //the month view month list's name postfix, can not modify
    aryName[6] = "_DayList"; //keep the month view current day's element name postfix, can not modify
    var i = 0, j = 0, maxi = 2000;
    var exTag = true;
    while ((exTag == true) && (i < maxi)){
      i++;
      exTag = false;
      for (j = 0; j < aryName.length; j++){
        if (document.all.item(theName + i.toString() + aryName[j]) != null){
          exTag = true;
        }
      }
    }
    if (exTag == false){
      return(theName + i.toString());
    }else{
      return("_" + theName);
    }
  }
  var theName = this.GetOnlyName();
  this.Name = theName; //the month view name
  this.Source = theTextObject; //the month view act on theTextObject
  this.MinYear = 1970; //year list min value
  //return between 1000 and 9999 and <= this.MaxYear
  this.MaxYear = 2030; //year list max value
  //return between 1000 and 9999 and >= this.MinYear
  this.Width = 300; //the month view main body's width
  this.Height = 200; //the month view main body's height
  this.DateFormat = "<yyyy>-<mm>-<dd>"; //the date format
  //<yy> or <yyyy> is year, <m> or <mm> is digital format month, <MMM> or <MMMMMM> is character format month, <d> or <dd> is day, other char unchanged
  //this function setting year, month and day sequence
  //for example:
  //  <yyyy>-<mm>-<dd> : 2002-04-01
  //  <yy>.<m>.<d> : 02.4.1
  //  <yyyy> Year <MMMMMM> Month <d> Day : 2002 Year April Month 1 Day
  //  <m>/<d>/<yy> : 4/1/02
  //  <MMM> <dd&g