/** * File Name : PopCalendar.js * Description : This is the template for Javascript * Copyright : Copyright (s) 2002 * Company : W&Jsoft Corp. * Author : Derk Tsia * Modifications : * Change Flag Date Author Description * ------ ---- ---------- ----- ------------------------------ * N1.00 I 2002/04/05 Derk Initiation * N1.01 M 2002/06/10 Derk For Support special function about EP_E0101030 * N1.02 M 2002/11/04 Derk For Support special function about EP_F0105010 * N1.03 M 2002/11/09 Derk For Support special function about EP_F0201010 */ var fixedX = -1 // x position (-1 if to appear below control) var fixedY = -1 // y position (-1 if to appear below control) var startAt = 0 // 0 - sunday ; 1 - monday var showWeekNumber = 1 // 0 - don't show; 1 - show var showToday = 1 // 0 - don't show; 1 - show //var imgDir = "images/" var imgDir = "/images/calendar/" // directory for images ... e.g. var imgDir="/img/" var gotoString = "Go To Current Month" var todayString = "今天是星期" var weekString = "星期" var scrollLeftMessage = "Click to scroll to previous month. Hold mouse button to scroll automatically." var scrollRightMessage = "Click to scroll to next month. Hold mouse button to scroll automatically." var selectMonthMessage = "Click to select a month." var selectYearMessage = "Click to select a year." var selectDateMessage = "Select [date] as date." // do not replace [date], it will be replaced by date. var crossobj, crossMonthObj, crossYearObj, monthSelected, yearSelected, dateSelected, omonthSelected, oyearSelected, odateSelected, monthConstructed, yearConstructed, intervalID1, intervalID2, timeoutID1, timeoutID2, ctlToPlaceValue, ctlNow, dateFormat, nStartingYear var bPageLoaded=false var ie=document.all var dom=document.getElementById var ns4=document.layers var today = new Date() var dateNow = today.getDate() var monthNow = today.getMonth() var yearNow = today.getYear() var imgsrc = new Array("popcalendar_drop1.gif","popcalendar_drop2.gif","popcalendar_left1.gif","popcalendar_left2.gif","popcalendar_right1.gif","popcalendar_right2.gif") var img = new Array() var timeStr var re_url = new RegExp('datetime=(\\-?\\d+)') var dt_current = (re_url.exec(String(window.location)) ? new Date(new Number(RegExp.$1)) : new Date()) var bShow = false; function cal_gen_time1 (dt_datetime) { return ( (dt_datetime.getHours() < 10 ? '0' : '') + dt_datetime.getHours() + ":" + (dt_datetime.getMinutes() < 10 ? '0' : '') + (dt_datetime.getMinutes()) + ":" + (dt_datetime.getSeconds() < 10 ? '0' : '') + (dt_datetime.getSeconds()) ); } function cal_gen_hour (dt_datetime) { return ( (dt_datetime.getHours() < 10 ? '0' : '') + dt_datetime.getHours() ); } function cal_gen_minute (dt_datetime) { return ( (dt_datetime.getMinutes() < 10 ? '0' : '') + (dt_datetime.getMinutes()) ); } function cal_gen_second (dt_datetime) { return ( (dt_datetime.getSeconds() < 10 ? '0' : '') + (dt_datetime.getSeconds()) ); } /* hides and objects (for IE only) */ function showElement( elmID ){ if( ie ){ for( i = 0; i < document.all.tags( elmID ).length; i++ ){ obj = document.all.tags( elmID )[i]; if( !obj || !obj.offsetParent ){ continue; } obj.style.visibility = ""; } } } function HolidayRec (d, m, y, desc){ this.d = d this.m = m this.y = y this.desc = desc } function FloatingRec (d, m, y, desc){ this.d = d this.m = m this.y = y this.desc = desc } var HolidaysCounter = 0 var Holidays = new Array() var FloatingsCounter = 0 var Floatings = new Array() function addHoliday (d, m, y, desc){ Holidays[HolidaysCounter++] = new HolidayRec ( d, m, y, desc ) } function addFloating (d, m, y, desc){ Floatings[FloatingsCounter++] = new FloatingRec ( d, m, y, desc ) } if (dom){ for (i=0;i