-澳门凯发

/* jsmonthview 1.1 author by dengkang(china) 2004-4-12 */ function definemonthview(thetextobject){ //the month view construct function var thename = "jsmv"; //the name is only one on document this.name = thename; //the month view name this.source = thetextobject; //the month view act on thetextobject this.centuryyear = 1940; //if input two digit year, and the year add 1900 less than this.centuryyear, then year is the year add 2000 this.minyear = 1970; //year list min value //return year between 1000 and 9999 and <= this.maxyear this.maxyear = 2029; //year list max value //return year 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.allownulldate = true; //if this attribute is false, then empty string is invalid date and spring this.warningaction. this.alwaysmakehtml = false; //if this attribute is true, then every time show monthview, the html code will rebuild this.onlyinput = false; //do'nt show month view, only input and format date string. this.autohidden = true; //if this attribute is true, then use mouse select a date after, the month view auto hide; this.warningaction = ""; //if input string is not a date and this is not empty, then execute this. this.dateformat = "--
"; //the date format, must have year, month and day // or is year, or is digital format month, or is character format month, or
is day, other char unchanged //this function setting year, month and day sequence //for example: // --
: 2002-04-01 // .. : 02.4.1 // year month day : 2002 year april month 1 day // // : 4/1/02 //
, : apr 01, 2002 // , : april 1,2002 //
-- : 01-apr-2002 //
// : 01/04/2002 this.unselectbgcolor = "#ffffff"; //the month view default background color this.selectedbgcolor = "#808080"; //the selected date background color this.selectedcolor = "#ffffff"; //the selected date front color this.daybdwidth = "2px"; //the day unit border width this.daybdcolor = this.unselectbgcolor; //the day unit border color,default is this.unselectbgcolor this.todaybdcolor = "#ff0000"; //denote today's date border color this.invalidcolor = "#808080"; //it is not current month day front color this.validcolor = "#0000ff"; //it is current month day front color this.yearliststyle = "width:60px; font-size:12px; font-family:verdana;"; //the year list's style this.monthliststyle = "width:100px; font-size:12px; font-family:verdana;"; //the month list's style this.monthname = new array(); //month name list, font is include this.monthliststyle this.monthname[0] = "january"; this.monthname[1] = "february"; this.monthname[2] = "march"; this.monthname[3] = "april"; this.monthname[4] = "may"; this.monthname[5] = "june"; this.monthname[6] = "july"; this.monthname[7] = "august"; this.monthname[8] = "september"; this.monthname[9] = "october"; this.monthname[10] = "november"; this.monthname[11] = "december"; this.weekliststyle = "font-size:16px; font-weight:bolder; font-family:times new roman;"; //the week name's style this.titlestyle = "text-align:center; vertical-align:bottom; cursor:default; color:#000000; background-color:" this.unselectbgcolor ";"; //the month view title area's style this.weekname = new array(); //week name list, font is include this.weekliststyle this.weekname[0] = "sun"; this.weekname[1] = "mon"; this.weekname[2] = "tue"; this.weekname[3] = "wed"; this.weekname[4] = "thu"; this.weekname[5] = "fri"; this.weekname[6] = "sat"; this.monthgridstyle = "border-width:1px; border-style:solid; border-color:#000000;"; //the month view main body's default style this.headerstyle = "height:32px; background-color:buttonface;"; //the month view header area's style this.dayliststyle = "cursor:hand; font-size:12px; font-family:verdana; text-align:center; vertical-align:middle;"; //the month view day area's style this.dayoverstylename = new array(); //a style name for mouse over day this.dayoverstylevalue = new array(); //a style value for mouse over day with this.dayoverstylename this.dayoverstylename[0] = "textdecoration"; this.dayoverstylevalue[0] = "underline"; this.todayliststyle = "font-size:12px; font-family:verdana;"; //the today tip's style this.todaylisttitle = "goto today"; //the today tip's title this.footerstyle = "text-align:left; vertical-align:middle; cursor:hand; color:#000000; background-color:" this.unselectbgcolor ";"; //the month footer area's style this.todaytitle = "today:"; //today tip string, font is include this.todayliststyle this.monthbtstyle = "font-family:marlett; font-size:12px; width:20px; height:20px; "; //the change month button style this.previousmonthtitle = "goto previous month"; this.previousmonthtext = "3"; //the go previous month button text //font is include this.monthbtstyle this.nextmonthtitle = "goto next month"; this.nextmonthtext = "4"; //the go next month button text //font is include this.monthbtstyle this.linebgstyle = "height:10px; background-color:" this.unselectbgcolor "; text-align:center; vertical-align:middle;"; //the month view title area and day area compart area background style this.linestyle = "width:90%; height:1px; background-color:#000000;"; //the month view title area and day area compart area front style this.checkie = function( ){//check ie version. if greater than 5.0 return true, else return false; var version = ""; var navagent = navigator.useragent; var navindex = navagent.indexof("msie"); if (navindex == -1){ return(false); }else{ version = navagent.substr(navindex 4, 4); if (isnan(parsefloat(version))){ return(false); }else{ if (parsefloat(version) > 5.0){ return(true); }else{ return(false); } } } } this.getoffsetleft = function(theobject){ //return theobject's absolute offsetleft var absleft = 0; var theposition = ""; var tmpobject = theobject; while (tmpobject != null){ theposition = tmpobject.position; tmpobject.position = "static"; absleft = tmpobject.offsetleft; tmpobject.position = theposition; tmpobject = tmpobject.offsetparent; } return(absleft); } this.getoffsettop = function(theobject){ //return theobj's absolute offsettop var abstop = 0; var theposition = ""; var tmpobject = theobject; while (tmpobject != null){ theposition = tmpobject.position; tmpobject.position = "static"; abstop = tmpobject.offsettop; tmpobject.position = theposition; tmpobject = tmpobject.offsetparent; } return(abstop); } this.getformatyear = function(theyear){//format theyear to 4 digit var tmpyear = parseint(theyear,10); if (tmpyear < 100){ tmpyear = 1900; if (tmpyear < this.centuryyear){ tmpyear = 100; } } if (tmpyear < this.minyear){ tmpyear = this.minyear; } if (tmpyear > this.maxyear){ tmpyear = this.maxyear; } return(tmpyear); } this.getmonthdays = function(theyear, themonth){ //get theyear and themonth days number var thedays = new array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); var themonthday = 0 var tmpyear = this.getformatyear(theyear); themonthday = thedays[themonth]; if (themonth == 1){ //themonth is february if (((tmpyear % 4 == 0) && (tmpyear % 100 != 0)) || (tmpyear % 400 == 0)){ themonthday ; } } return(themonthday); } this.setdateformat = function(theyear, themonth, theday){//format a date to this.dateformat var thedate = this.dateformat; var tmpyear = this.getformatyear(theyear); var tmpmonth = themonth; if (tmpmonth < 0){ tmpmonth = 0; } if (tmpmonth > 11){ tmpmonth = 11; } var tmpday = theday; if (tmpday < 1){ tmpday = 1; }else{ tmpday = this.getmonthdays(tmpyear, tmpmonth); if (theday < tmpday){ tmpday = theday; } } thedate = thedate.replace(//g, tmpyear.tostring()); thedate = thedate.replace(//g, tmpyear.tostring().substr(2,2)); thedate = thedate.replace(//g, this.monthname[tmpmonth]); thedate = thedate.replace(//g, this.monthname[tmpmonth].substr(0,3)); if (themonth < 9){ thedate = thedate.replace(//g, "0" (tmpmonth 1).tostring()); }else{ thedate = thedate.replace(//g, (tmpmonth 1).tostring()); } thedate = thedate.replace(//g, (tmpmonth 1).tostring()); if (theday < 10){ thedate = thedate.replace(/
/g, "0" tmpday.tostring()); }else{ thedate = thedate.replace(/
/g, tmpday.tostring()); } thedate = thedate.replace(//g, tmpday.tostring()); return(thedate); } this.gettextdate = function(thestring){ //convert a date string to a date, if the string is not a date, return empty var i = 0, j = 0, tmpchar = "", find_tag = ""; var start_at = 0, end_at = 0, year_at = 0, month_at = 0, day_at = 0; var tmp_at = 0, one_at = 0, two_at = 0, one_days = 0, two_days = 0; var arydate = new array(); var tmpyear = -1, tmpmonth = -1, tmpday = -1; var tmpdate = thestring.tolowercase(); var defdate = ""; //convert string month to digital month tmpdate = tmpdate.replace(/(\d)0(\d)/g, "$1-$2"); for (i=11; i>=9; i--){ tmpdate = tmpdate.replace(this.monthname[i].tolowercase().substr(0,3), "-0" (i 1).tostring() "-"); } for (i=8; i>=0; i--){ tmpdate = tmpdate.replace(this.monthname[i].tolowercase().substr(0,3), "-00" (i 1).tostring() "-"); } tmpdate = tmpdate.replace(/jan/g, "-001-"); tmpdate = tmpdate.replace(/feb/g, "-002-"); tmpdate = tmpdate.replace(/mar/g, "-003-"); tmpdate = tmpdate.replace(/apr/g, "-004-"); tmpdate = tmpdate.replace(/may/g, "-005-"); tmpdate = tmpdate.replace(/jun/g, "-006-"); tmpdate = tmpdate.replace(/jul/g, "-007-"); tmpdate = tmpdate.replace(/aug/g, "-008-"); tmpdate = tmpdate.replace(/sep/g, "-009-"); tmpdate = tmpdate.replace(/oct/g, "-010-"); tmpdate = tmpdate.replace(/nov/g, "-011-"); tmpdate = tmpdate.replace(/dec/g, "-012-"); //delete redundant chars for (i = 0; i < tmpdate.length; i ){ tmpchar = tmpdate.charat(i); if (((tmpchar < "0") || (tmpchar>"9")) && (tmpchar != "-")){ tmpdate = tmpdate.replace(tmpchar, "-") } } while (tmpdate.indexof("--") != -1){ tmpdate = tmpdate.replace(/--/g, "-"); } start_at = 0; end_at = tmpdate.length - 1; while (tmpdate.charat(start_at) == "-"){ start_at ; } while (tmpdate.charat(end_at) == "-"){ end_at--; } if (start_at < end_at 1){ tmpdate = tmpdate.substring(start_at, end_at 1); }else{ tmpdate = ""; } //get thestring date format arydate = tmpdate.split("-"); if (arydate.length != 3){ return(defdate); } tmp_at = 0; for (i = 0; i < 3; i ){ if (parseint(arydate[i], 10)==0){ tmp_at ; year_at = i; } } if (tmp_at > 1){ return(defdate); } if (tmp_at == 1){ arydate[year_at] = this.getformatyear(arydate[year_at]).tostring(); } tmpdate = this.dateformat; year_at = tmpdate.indexof(""); if (year_at == -1){ year_at = tmpdate.indexof(""); } month_at = tmpdate.indexof(""); if (month_at == -1){ month_at = tmpdate.indexof(""); } if (month_at == -1){ month_at = tmpdate.indexof(""); } if (month_at == -1){ month_at = tmpdate.indexof(""); } day_at = tmpdate.indexof("
"); if (day_at == -1){ day_at = tmpdate.indexof(""); } //get month position find_tag = "000"; //start, the month position is null //find_tag date_format //000 unknow, thestring is not a date //001 day_year_month or year_day_month //010 day_month_year or year_month_day //100 month_day_year or month_year_dat for (i = 0; i < 3; i ){ if (arydate[i].length == 3){ if ((arydate[i] >= "001") && (arydate[i] <= "012")){ if (find_tag != "000"){ return(defdate); } tmpmonth = parseint(arydate[i], 10) - 1; switch (i){ case 0: find_tag = "100"; one_at = parseint(arydate[1], 10); two_at = parseint(arydate[2], 10); break; case 1: find_tag = "010"; one_at = parseint(arydate[0], 10); two_at = parseint(arydate[2], 10); break; case 2: find_tag = "001"; one_at = parseint(arydate[0], 10); two_at = parseint(arydate[1], 10); break; default:; } } } } if (find_tag!="000"){ one_days = this.getmonthdays(two_at, tmpmonth); two_days = this.getmonthdays(one_at, tmpmonth); if ((one_at > one_days) && (two_at > two_days)){ return(defdate); } if ((one_at <= one_days) && (two_at > two_days)){ tmpyear = this.getformatyear(two_at); tmpday = one_at; } if ((one_at > one_days) && (two_at <= two_days)){ tmpyear = this.getformatyear(one_at); tmpday = two_at; } if ((one_at <= one_days) && (two_at <= two_days)){ switch (find_tag){ case "100": //default month,day,year tmpday = one_at; tmpyear = this.getformatyear(two_at); if ((month_at > year_at) && (month_at > day_at)){ if (day_at > year_at){ tmpyear = this.getformatyear(one_at); tmpday = two_at; } } break; case "010": //default day,month,year tmpday = one_at; tmpyear = this.getformatyear(two_at); if (((month_at > year_at) && (month_at < day_at)) || ((month_at < year_at) && (month_at > day_at))){ if (day_at > year_at){ tmpyear = this.getformatyear(one_at); tmpday = two_at; } } break; case "001": //default year,day,month tmpyear = this.getformatyear(one_at); tmpday = two_at; if ((month_at < year_at) && (month_at < day_at)){ if (year_at > day_at){ tmpday = one_at; tmpyear = this.getformatyear(two_at); } } break; default: //default day,year tmpday = one_at; tmpyear = this.getformatyear(two_at); } } return(new date(tmpyear, tmpmonth, tmpday)); } find_tag = "000"; for (i = 0; i < 3; i ){ if (parseint(arydate[i], 10) > 31){ if (find_tag!="000"){ return(defdate); } tmpyear = this.getformatyear(arydate[i]); switch (i){ case 0: find_tag = "100"; one_at = parseint(arydate[1], 10); two_at = parseint(arydate[2], 10); break; case 1: find_tag = "010"; one_at = parseint(arydate[0], 10); two_at = parseint(arydate[2], 10); break; case 2: find_tag = "001"; one_at = parseint(arydate[0], 10); two_at = parseint(arydate[1], 10); break; default:; } } } if (find_tag == "000"){ if ((year_at > month_at) && (year_at > day_at)){ find_tag = "001"; } if ((year_at > month_at) && (year_at < day_at)){ find_tag = "010"; } if ((year_at < month_at) && (year_at > day_at)){ find_tag = "010"; } if ((year_at < month_at) && (year_at < day_at)){ find_tag = "100"; } switch (find_tag){ case "100": tmpyear = parseint(arydate[0], 10); one_at = parseint(arydate[1], 10); two_at = parseint(arydate[2], 10); break; case "010": one_at = parseint(arydate[0], 10); tmpyear = parseint(arydate[1], 10); two_at = parseint(arydate[2], 10); break; case "001": one_at = parseint(arydate[0], 10); two_at = parseint(arydate[1], 10); tmpyear = parseint(arydate[2], 10); break; default:; } tmpyear = this.getformatyear(tmpyear); } if (find_tag == "000"){ return(defdate); }else{ if ((one_at > 12) && (two_at > 12)){ return(defdate); } if ((one_at <= 12) && (two_at > 12)){ if (two_at > this.getmonthdays(tmpyear,one_at-1)){ return(new date(tmpyear, one_at-1, this.getmonthdays(tmpyear,one_at-1))); }else{ return(new date(tmpyear, one_at-1, two_at)); } } if ((one_at > 12) && (two_at <= 12)){ if (one_at > this.getmonthdays(tmpyear,two_at-1)){ return(new date(tmpyear, two_at-1, this.getmonthdays(tmpyear,two_at-1))); }else{ return(new date(tmpyear, two_at-1, one_at)); } } if ((one_at <= 12) && (two_at <= 12)){ tmpmonth = one_at-1; tmpday = two_at; if (month_at > day_at){ tmpmonth = two_at-1; tmpday = one_at; } return(new date(tmpyear, tmpmonth, tmpday)); } } } this.createyearlist = function(minyear, maxyear){ //create year list var thename = this.name; var theyearobject = document.all.item(thename "_yearlist"); if (theyearobject == null){ return; } var theyear = 0; var theyearhtml = ""; theyearobject.outerhtml = theyearhtml; } this.createmonthlist = function( ){ //create month list var thename = this.name; var themonthobject = document.all.item(thename "_monthlist"); if (themonthobject == null){ return; } var themonth = 0; var themonthhtml = ""; themonthobject.outerhtml = themonthhtml; } this.overday = function(theday){ var i=0; for (i=0;i"; thedayhtml = " "; for (dayid = 0; dayid < 7; dayid ){ thedayhtml = " " this.weekname[dayid] ""; } thedayhtml = " "; thedayhtml = " "; thedayhtml = " "; thedayhtml = " "; thedayhtml = " "; thedayhtml = "
"; thedayhtml = " "; thedayhtml = " "; for (weekid = 0; weekid < 6; weekid ){ thedayhtml = " "; for (dayid = 0; dayid < 7; dayid ){ if ((thecurrentday > theleftday) && (weekid < 3)){ offsetmonth ; //the month is current month; thecurrentday = 1; } if ((thecurrentday > therightday) && (weekid > 3)){ offsetmonth ; //the month is next month; thecurrentday = 1; } switch (offsetmonth){ case -1: thecolor = this.invalidcolor; break; case 1: thecolor = this.invalidcolor; break; case 0: thecolor = this.validcolor; break; default:; } thebgcolor = this.unselectbgcolor; thebdcolor = this.daybdcolor; if ((thecurrentday == theday) && (offsetmonth == 0) && (thetag == true)){ thecolor = this.selectedcolor; thebgcolor = this.selectedbgcolor; thebdcolor = thebgcolor; } if ((theyear == thecurrentdate.getfullyear()) && (themonth == thecurrentdate.getmonth()) && (thecurrentday == thecurrentdate.getdate()) && (offsetmonth == 0)){ thebdcolor = this.todaybdcolor; } thestyle = "border:" this.daybdwidth " solid " thebdcolor "; color:" thecolor "; background-color:" thebgcolor ";"; thedayhtml = ""; thecurrentday ; } thedayhtml = ""; } thedayhtml = "  "; thedayhtml = "  " this.todaytitle " " this.setdateformat(thecurrentdate.getfullyear(), thecurrentdate.getmonth(), thecurrentdate.getdate()) ""; thedayhtml = " "; thedayhtml = ""; var themonthgrid = document.all.item(thename "_monthgrid"); themonthgrid.innerhtml = thedayhtml; } this.createmonthgrid = function(theyear, themonth, theday, thetag){ //refresh the month view to the date, main action is run this.setdaylist() and set this.source.value var thetextobject = this.source; if (thetextobject == null){ return; } var thename = this.name; var theyearobject = document.all.item(thename "_yearlist"); var themonthobject = document.all.item(thename "_monthlist"); var tmpyear = theyear; var tmpmonth = themonth; var tmpday = 1; if (tmpmonth < 0){ tmpyear--; tmpmonth = 11; } if (tmpmonth > 11){ tmpyear ; tmpmonth = 0; } if (tmpyear < this.minyear){ tmpyear = this.minyear; } if (tmpyear > this.maxyear){ tmpyear = this.maxyear; } if (theday < 1){ tmpday = 1; }else{ tmpday = this.getmonthdays(tmpyear, tmpmonth); if (theday < tmpday){ tmpday = theday; } } theyearobject.value = tmpyear; themonthobject.value = tmpmonth; this.setdaylist(tmpyear, tmpmonth, tmpday, thetag); if (thetag==true){ thetextobject.value = this.setdateformat(tmpyear, tmpmonth, tmpday); thetextobject.select(); } } this.updatemonthgrid = function(theobject){ //run this.createmonthgrid() by theobject var thetextobject = this.source; if (thetextobject == null){ return; } var thename = this.name; var theyearobject = document.all.item(thename "_yearlist"); var themonthobject = document.all.item(thename "_monthlist"); var thedayobject = document.all.item(thename "_daylist"); var tmpname = theobject.id.substr(theobject.id.lastindexof("_")); switch (tmpname){ case "_gopreviousmonth": //go previous month button theobject.disabled = true; this.createmonthgrid(parseint(theyearobject.value, 10), parseint(themonthobject.value, 10) - 1, parseint(thedayobject.value, 10), true); theobject.disabled = false; break; case "_gonextmonth": //go next month button theobject.disabled = true; this.createmonthgrid(parseint(theyearobject.value, 10), parseint(themonthobject.value, 10) 1, parseint(thedayobject.value, 10), true); theobject.disabled = false; break; case "_yearlist": //year list this.createmonthgrid(parseint(theyearobject.value, 10), parseint(themonthobject.value, 10), parseint(thedayobject.value, 10), true); break; case "_monthlist": //month list this.createmonthgrid(parseint(theyearobject.value, 10), parseint(themonthobject.value, 10), parseint(thedayobject.value, 10), true); break; default: return; } } this.deletemonthgrid = function(thetag){ //check document focus, if blur this.source then delete this var thename = this.name; var thedivobject = document.all.item(thename "_monthview"); if (thedivobject == null){ return; } if (thetag == true){ this.revokemonthgrid(); return; } var tmpobject = document.activeelement; while (tmpobject != null){ if (tmpobject == this.source){ return; } //if (tmpobject.id == thename "_monthview"){ // return; //} //if (tmpobject.id == thename "_monthgrid"){ // return; //} if (tmpobject.id == thename "_gopreviousmonth"){ return; } if (tmpobject.id == thename "_gonextmonth"){ return; } if (tmpobject.id == thename "_yearlist"){ return; } if (tmpobject.id == thename "_monthlist"){ return; } if (tmpobject.id == thename "_daylist"){ return; } tmpobject = tmpobject.parentelement; } if (tmpobject == null){ //delete the month view this.revokemonthgrid(); } } this.revokemonthgrid = function( ){ var thename = this.name; var thedivobject = document.all.item(thename "_monthview"); if (thedivobject == null){ return; } //thedivobject.outerhtml = ""; thedivobject.style.visibility = "hidden"; if (this.source != null){ var thedate = new date(this.gettextdate(this.source.value)); if (isnan(thedate)){ var thetag = ""; if (this.source.value != ""){ thetag = "1"; }else{ thetag = "0" } if (this.warningaction != ""){ thetag = "1"; }else{ thetag = "0"; } switch (thetag){ case "00": break; case "01": if (this.allownulldate == false){ eval(this.warningaction); } break; case "10": this.source.value = ""; break; case "11": this.source.value = ""; eval(this.warningaction); break; } }else{ this.source.value = this.setdateformat(thedate.getfullyear(), thedate.getmonth(), thedate.getdate()); } this.source = null; } } this.initialmonthview = function( ){ var thename = this.name; var thetag = true; var thevalue = this.source.value; if (thevalue.replace(/ /g,"")==""){ thetag = false; } var thecurrentdate = new date(this.gettextdate(thevalue)); if (isnan(thecurrentdate)){ thecurrentdate = new date(); thetag = false; } var theietag = this.checkie() var thedivhtml = ""; var thedivobject = document.all.item(thename "_monthview"); if ((thedivobject == null)||(this.alwaysmakehtml == true)){ thedivhtml = "
"; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = "
"; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = "
"; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = " "; thedivhtml = "
"; thedivhtml = "
 
"; thedivhtml = "
"; thedivhtml = "
"; if (theietag == true){ thedivhtml = " "; //keep out select element } thedivhtml = "
"; if (thedivobject != null){ thedivobject.outerhtml = ""; } document.body.insertadjacenthtml("beforeend", thedivhtml); thedivobject = document.all.item(thename "_monthview"); this.createyearlist(this.minyear, this.maxyear); this.createmonthlist(); } thedivobject.style.position = "absolute"; var tmpleft = this.getoffsetleft(this.source); if (tmpleft this.width > document.body.clientwidth){ tmpleft = tmpleft this.source.offsetwidth - this.width; } if (tmpleft < 0){ tmpleft = 0; } thedivobject.style.posleft = tmpleft; thedivobject.style.postop = this.getoffsettop(this.source) this.source.offsetheight; this.createmonthgrid(thecurrentdate.getfullyear(), thecurrentdate.getmonth(), thecurrentdate.getdate(), thetag); if (this.onlyinput == false){ thedivobject.style.visibility = "inherit"; }else{ thedivobject.style.display = "none"; } } this.schememonthview = function( ){//restore attribute to default return; } } function createmonthview(thetextobject, thescheme){ //the month view create interface, fire at element's onfocus event if ((thetextobject.readonly == true)||(thetextobject.disabled == true)){ return; } if (document.jsmonthview == null){ document.jsmonthview = new definemonthview(thetextobject); }else{ if (document.jsmonthview.source == null){ document.jsmonthview.source = thetextobject; document.jsmonthview.schememonthview(); }else{ return; } } //document.jsmonthview.dateformat = "--
"; if (thescheme != null){ eval(thescheme); } document.jsmonthview.initialmonthview(); thetextobject.select(); } function deletemonthview(thetextobject){ //the month view delete interface, fire at element's onblur event if (document.jsmonthview == null){ return; } document.jsmonthview.deletemonthgrid(false); if ((document.jsmonthview.source == null)&&(document.jsmonthview.alwaysmakehtml == true)){ var thedivobject = document.all.item(document.jsmonthview.name "_monthview"); if (thedivobject != null){ thedivobject.outerhtml = ""; } document.jsmonthview = null; } }
网站地图