<script language= "JavaScript" type= "Text/javascript" >var diarydays= "";d iarydays=diarydays+ "<2008-12-13 ><2008-12-14> ";d iarydays=diarydays+" <2008-11-15> ";d iarydays=diarydays+" <2008-10-11> "; diarydays=diarydays+ "<2008-12-13> <2008-12-14>";d iarydays=diarydays+ "<2009-01-14>"; </ Script><style>.calendarbigborder {font-family: "Arial", "Helvetica", "Sans-serif", "Song Body"; Text-decoration: None width:170; Background-color: #999999; font-size:9pt;border:1px dotted #999999; }.CALENDARTD {font-family: "Arial", "Helvetica", "Sans-serif", "Song Body"; font-size:9pt; color: #000000; Background-color: #e eeeee; height:18px; width:11%; Text-align:center;}. calendarminput {font-family: "Arial", "Helvetica", "Sans-serif", "Song Body"; font-size:9pt; text-decoration:none; background -color: #FFFFFF; height:15px; border:1px solid #666666; width:19px; Color: #0099FF;}. calendaryinput {font-family: "Arial", "Helvetica", "Sans-serif", "Song Body"; font-size:9pt; cOlor: #0099FF; Text-decoration:none; Background-color: #FFFFFF; height:15px; width:34px; border:1px solid #666666;}. Calendarmonthtitle {font-family: "Arial", "Helvetica", "Sans-serif", "Song Body"; font-size:9pt; font-weight:normal; height:2 4px; Text-align:center; Color: #333333; Text-decoration:none; Background-color: #eeeeee; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; Border-bottom-style:none; Border-top-color: #999999; Border-right-color: #999999; Border-bottom-color: #999999; Border-left-color: #999999;}. Calendarnow {font-family: "Arial", "Helvetica", "Sans-serif", "Song Body"; font-size:9pt; font-weight:bold; color: #FFFFFF; BAC Kground-color: #CC6633; height:18px; Text-align:center;}. Calendardaysat {font-family: "Arial", "Helvetica", "Sans-serif", "Song Body"; font-size:9pt; color: #FF3366; text-decoration:n One Background-color: #eeeeee; Text-align:center; height:18px; Width:12%;font-weight:bold;}. Calendardaysun {Font-familY: "Arial", "Helvetica", "Sans-serif", "Song Body"; font-size:9pt; Color: #FF3366; Text-decoration:none; Background-color: #eeeeee; Text-align:center; height:18px; Width:12%;font-weight:bold;}. Calendarlink {font-family: "Arial", "Helvetica", "Sans-serif", "Song Body"; font-size:9pt; font-weight:normal; color: #FFFFFF; Text-decoration:none; Background-color: #FF0000; Text-align:center; Height:18px;font-weight:bold;}. categorytxt {font-family: "Arial", "Helvetica", "Sans-serif", "Song Body"; font-size:9pt; line-height:23px; color: #669900; te Xt-decoration:none;}. categorytable {border-right-width:1px; border-bottom-width:1px; border-right-style:solid; Border-bottom-style: Solid Border-left-style:none; Border-right-color: #000000; Border-bottom-color: #000000; border-top-width:1px; Border-top-style:solid; Border-top-color: #71b99c;} </style><script language= "JavaScript" type= "text/javascript" >var months = new Array ("One", "two", "three", "four", "five", "Six", "seven", "eight", "Nine", "Ten", "11", "12") var daysinmonth = new Array (+, +, +, +, +, +, 31,30, +, +); var days = new Array ("Day", "one", "two", "three", " Four "," five "," six "), Var classtemp;var calendarhover=" Calendarhover "; var today=new gettoday (); var year=today.year;var month= Today.month;var newcal;//Get a month number of days function getDays (month, year) {if (1 = = month) return ((0 = = year% 4) && (0! = (y Ear% 100)) | | (0 = = year% 400)? 29:28;else return daysinmonth[month];} Get the day time information function Gettoday () {this.now = new Date (); This.year = This.now.getFullYear (); This.month = This.now.getMonth (); This.day = This.now.getDate ();} Create Calendar function calendar () {newcal = new Date (year,month,1);//The first day of the current month today = new Gettoday (); var day =-1; Used to determine if the calendar is the day var startday = Newcal.getday (); The month start time var endday=getdays (Newcal.getmonth (), newcal.getfullyear ());//month end time var daily = 0; Used to generate the value of days in the calendar if ((Today.year = = Newcal.getfullyear ()) && (Today.month = = Newcal.getmonth ())) day = Today.day; var caltable = document. All.caltable.tBodies.calendar; Get a collection of calendar tables var intdaysinmonth =getdays (Newcal.getmonth (), newcal.getfullyear ()); Get the days of the month//Generate calendar for (var intweek = 0; Intweek < caltable.rows.length;intweek++) for (var intday = 0;intday < Calt able.rows[intweek].cells.length;intday++) {var cell = Caltable.rows[intweek].cells[intday]; Get the unit eligible//generate string to determine if there is a log var montemp= (Newcal.getmonth () +1) <10 on the day? ("0" + (Newcal.getmonth () +1)):(Newcal.getmonth () +1); if ((Intday = = startday) && (0 = = daily)) {daily = 1;} var daytemp=daily<10? ("0" +daily):(daily); var d= "<" +newcal.getfullyear () + "-" +montemp+ "-" +daytemp+ ">"; Select the style if (day==daily) cell.classname= "Calendarnow"; else if (Diarydays.indexof (d)!=-1) cell.classname= "Calendarlink"; else if (intday==6) cell.classname = "Calendardaysat"; else if (intday==0) cell.classname = "Calendardaysun"; else cell.classname= "CALENDARTD"; Generate Value if ((Daily > 0) && (daily <= IntdaysiNmonth)) {cell.innertext = daily; daily++; } else Cell.innertext = ""; }document.all.year.value=year;document.all.month.value=month+1;} function Submonth () {if ((month-1) <0) {month=11;year=year-1;} else{month=month-1;} Calendar ();} function Addmonth () {if ((month+1) >11) {month=0; year=year+1;} else{month=month+1;} Calendar ();} Get the response thing function getdiary () {var mon= (Newcal.getmonth () +1) <10? (" 0 "+ (Newcal.getmonth () +1)):(Newcal.getmonth () +1); var day=event.srcelement.innertext<10? ("0" +event.srcelement.innertext):(Event.srcElement.innerText) var d= "<" +newcal.getfullyear () + "-" +mon+ "-" +day + ">"; if ("TD" = = Event.srcElement.tagName) if ((""!! = Event.srcElement.innerText) && (Diarydays.indexof (d)! = -1) {diary.location= "/yczx/searchdate.php?searchtype=title&keywords=&catid=183&areaid=0&typeid =0&fromdate= "+newcal.getfullyear () +"-"+mon+"-"+day+" &todate= "+newcal.getfullyear () +"-"+mon+"-"+day+" Ordertype=0&search=1 "; Window.location.href = Diary.location;}} function SetDate () {if (document.all.month.value<1| | DOCUMENT.ALL.MONTH.VALUE>12) {alert ("The effective range of the month is between 1-12!"); return;} Year=math.ceil (Document.all.year.value); Month=math.ceil (document.all.month.value-1); Calendar ();} </script> <table border= "0" cellpadding= "0" cellspacing= "1" class= "Calendarbigborder" id = "Caltable" style= "height:170px;width:200px;" > <thead> <tr align= "center" valign= "Middle" > <td colspan= "7" class= "Cale Ndarmonthtitle "><input name=" Year "type=" text "class=" Calendaryinput "size=" 3 "maxlength=" 4 "/> Years <input name= "Month" type= "text" class= "Calendarminput" size= "1" maxlength= "2"/> Month [<a h ref= "javascript:;" class= "STYLE11" onclick= "Addmonth ()" > next month </a>] [<a href= "javascript:;" class= "STYLE11" Onclick= "Submonth ()" > Last month </a>]</td> </tr> <tr align= "center" Valign= "Middle" > <script language= "JavaScript" type= "Text/javascript" >document.write ("<td class=calend Ardaysun id=diary> "+ days[0" + "</TD>"); for (var intloop = 1; intloop < days.length-1;intloop++) Document.writ E ("<td class=calendartd id=diary>" + days[intloop] + "</TD>");d ocument.write ("<td Class=calendardaysat Id=diary> "+ Days[intloop] +" </TD> "); </script> </tr> </thead> <tbody border= "1" cellspacing= "0" cellpadding= " 0 "id=" Calendar "align=" center "onclick=" Getdiary () "onmouseup=" Document.selection.empty () "oncontextmenu=" return False "onselectstart=" return false "ondragstart=" return false "onbeforecopy=" return false "oncopy=" Document.selection.empty () "onselect=" Document.selection.empty () "> <script language=" JavaScript "type=" Te Xt/javascript ">for (var intweeks = 0; intweeks < 6; intweeks++) {document.write (" <tr style= ' Cursor:hand ' > "); For (Var intdays = 0; Intdays < days.length;intdays++) document.write ("<td class=calendartd onmouseover= ' {classTemp=this.className; This.classname=calendarhover} ' onmouseout= ' this.classname=classtemp ' ></TD> ');d ocument.write ("</TR > ");} </script> </tbody> </table> <script language= "JavaScript" type= "Text/javas Cript ">calendar (); </script>
Performance scheduling JavaScript