<html>
<head>
<title>js calendar</title>
<script language="javascript">
/* Copyright Mihai Bazon, 2002-2005 | /mishoo
* -----------------------------------------------------------
*
* The DHTML Calendar, version 1.0 "It is happening again"
*
* Details and latest version at:
* /projects/calendar
*
* This script is developed by . Visit us at .
*
* This script is distributed under the GNU Lesser General Public License.
* Read the entire license text here: /licenses/
*/
// $Id: ,v 1.51 2005/03/07 16:44:31 mishoo Exp $
/** The Calendar object constructor. */
Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) {
// member variables
= null;
= null;
= null;
= null;
= null;
= null;
= onSelected || null;
= onClose || null;
= false;
= false;
= 1970;
= 2050;
= Calendar._TT["DEF_DATE_FORMAT"];
= Calendar._TT["TT_DATE_FORMAT"];
= true;
= true;
= typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; // 0 for Sunday, 1 for Monday, etc.
= false;
= dateStr;
this.ar_days = null;
= false;
this.time24 = true;
= 2;
= true;
= null;
// HTML elements
= null;
= null;
= null;
= null;
// Combo boxes
= null;
= null;
= null;
= null;
= null;
= null;
// Information
= false;
// one-time initializations
if (typeof Calendar._SDN == "undefined") {
// table of short day names
if (typeof Calendar._SDN_len == "undefined")
Calendar._SDN_len = 3;
var ar = new Array();
for (var i = 8; i > 0;) {
ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len);
}
Calendar._SDN = ar;
// table of short month names
if (typeof Calendar._SMN_len == "undefined")
Calendar._SMN_len = 3;
ar = new Array();
for (var i = 12; i > 0;) {
ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len);
}
Calendar._SMN = ar;
}
};
// ** constants
/// "static", needed for event handlers.
Calendar._C = null;
/// detect a special case of "web browser"
Calendar.is_ie = ( /msie/() &&
!/opera/() );
Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/() );
/// detect Opera browser
Calendar.is_opera = /opera/();
/// detect KHTML-based browsers
Calendar.is_khtml = /Konqueror|Safari|KHTML/();
// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate
// library, at some point.
= function(el) {
var SL = 0, ST = 0;
var is_div = /^div$/();
if (is_div && )
SL = ;
if (is_div && )
ST = ;
var r = { x: - SL, y: - ST };
if () {
var tmp = ();
+= ;
+= ;
}
return r;
};
= function (el, evt) {
var related = ;
if (!related) {
var type = ;
if (type == "mouseover") {
related = ;
} else if (type == "mouseout") {
related = ;
}
}
while (related) {
if (related == el) {
return true;
}
related = ;
}
return false;
};
= function(el, className) {
if (!(el && )) {
return;
}
var cls = (" ");
var ar = new Array();
for (var i = ; i > 0;) {
if (cls[--i] != className) {
ar[] = cls[i];
}
}
= (" ");
};
= function(el, className) {
(el, className);
+= " " + className;
};
// FIXME: the following 2 functions totally suck, are useless and should be replaced immediately.
= function(ev) {
var f = Calendar.is_ie ? : ;
while ( != 1 || /^div$/())
f = ;
return f;
};
= function(ev) {
var f = Calendar.is_ie ? : ;
while ( != 1)
f = ;
return f;
};
= function(ev) {
ev || (ev = );
if (Calendar.is_ie) {
= true;
= false;
} else {
();
();
}
return false;
};
= function(el, evname, func) {
if () { // IE
("on" + evname, func);
} else if () { // Gecko / W3C
(evname, func, true);
} else {
el["on" + evname] = func;
}
};
= function(el, evname, func) {
if () { // IE
("on" + evname, func);
} else if () { // Gecko / W3C
(evname, func, true);
} else {
el["on" + evname] = null;
}
};
= function(type, parent) {
var el = null;
if () {
// use the XHTML namespace; IE won't normally get here unless
// _they_ "fix" the DOM2 implementation.
el = ("http:///1999/xhtml", type);
} else {
el = (type);
}
if (typeof parent != "undefined") {
(el);
}
return el;
};
// END: UTILITY FUNCTIONS
// BEGIN: CALENDAR STATIC FUNCTIONS
/** Internal -- adds a set of events to make some element behave like a button. */
Calendar._add_evs = function(el) {
with (Calendar) {
addEvent(el, "mouseover", dayMouseOver);
addEvent(el, "mousedown", dayMouseDown);
addEvent(el, "mouseout", dayMouseOut);
if (is_ie) {
addEvent(el, "dblclick", dayMouseDblClick);
("unselectable", true);
}
}
};
= function(el) {
if (typeof != "undefined") {
return el;
} else if (typeof != "undefined") {
return ;
}
return null;
};
= function(el) {
if (typeof != "undefined") {
return el;
} else if (typeof != "undefined") {
return ;
}
return null;
};
= function () {
var cal = Calendar._C;
if (!cal) {
return false;
}
var cal = cal;
var cd = ;
var mc = ;
if () {
(, "hilite");
}
if () {
(, "active");
}
var mon = ("div")[()];
(mon, "active");
= mon;
var s = ;
= "block";
if ( < 0)
= + "px";
else {
var mcw = ;
if (typeof mcw == "undefined")
// Konqueror brain-dead techniques
mcw = 50;
= ( + - mcw) + "px";
}
= ( + ) + "px";
};
= function (fwd) {
var cal = Calendar._C;
if (!cal) {
return false;
}
var cal = cal;
var cd = ;
var yc = ;
if () {
(, "hilite");
}
if () {
(, "active");
}
= null;
var Y = () + (fwd ? 1 : -1);
var yr = ;
var show = false;
for (var i = 12; i > 0; --i) {
if (Y >= && Y <= ) {
= Y;
= Y;
= "block";
show = true;
} else {
= "none";
}
yr = ;
Y += fwd ? : -;
}
if (show) {
var s = ;
= "block";
if ( < 0)
= + "px";
else {
var ycw = ;
if (typeof ycw == "undefined")
// Konqueror brain-dead techniques
ycw = 50;
= ( + - ycw) + "px";
}
= ( + ) + "px";
}
};
// event handlers
= function(ev) {
var cal = Calendar._C;
if (!cal) {
return false;
}
if () {
clearTimeout();
}
var el = ;
if (!el) {
return false;
}
var target = (ev);
ev || (ev = );
(el, "active");
if (target == el || == el) {
(el, ev);
}
var mon = (target);
var date = null;
if (mon) {
date = new Date();
if ( != ()) {
();
(date);
= false;
();
}
} else {
var year = (target);
if (year) {
date = new Date();
if ( != ()) {
();
(date);
= false;
();
}
}
}
with (Calendar) {
removeEvent(document, "mouseup", tableMouseUp);
removeEvent(document, "mouseover", tableMouseOver);
removeEvent(document, "mousemove", tableMouseOver);
cal._hideCombos();
_C = null;
return stopEvent(ev);
}
};
= function (ev) {
var cal = Calendar._C;
if (!cal) {
return;
}
var el = ;
var target = (ev);
if (target == el || == el) {
(el, "hilite active");
(, "rowhilite");
} else {
if (typeof == "undefined" || ( != 50 && ( == 0 || () > 2)))
(el, "active");
(el, "hilite");
(, "rowhilite");
}
ev || (ev = );
if ( == 50 && target != el) {
var pos = (el);
var w = ;
var x = ;
var dx;
var decrease = true;
if (x > + w) {
dx = x - - w;
decrease = false;
} else
dx = - x;
if (dx < 0) dx = 0;
var range = el._range;
var current = el._current;
var count = (dx / 10) % ;
for (var i = ; --i >= 0;)
if (range[i] == current)
break;
while (count-- > 0)
if (decrease) {
if (--i < 0)
i = - 1;
} else if ( ++i >= )
i = 0;
var newval = range[i];
= newval;
();
}
var mon = (target);
if (mon) {
if ( != ()) {
if () {
(, "hilite");
}
(mon, "hilite");
= mon;
} else if () {
(, "hilite");
}
} else {
if () {
(, "hilite");
}
var year = (target);
if (year) {
if ( != ()) {
if () {
(, "hilite");
}
(year, "hilite");
= year;
} else if () {
(, "hilite");
}
} else if () {
(, "hilite");
}
}
return (ev);
};
= function (ev) {
if ((ev) == (ev)) {
return (ev);
}
};
= function (ev) {
var cal = Calendar._C;
if (!(cal && )) {
return false;
}
var posX;
var posY;
if (Calendar.is_ie) {
posY = + ;
posX = + ;
} else {
posX = ;
posY = ;
}
();
var st = ;
= (posX - ) + "px";
= (posY - ) + "px";
return (ev);
};
= function (ev) {
var cal = Calendar._C;
if (!cal) {
return false;
}
= false;
with (Calendar) {
removeEvent(document, "mousemove", calDragIt);
removeEvent(document, "mouseup", calDragEnd);
tableMouseUp(ev);
}
();
};
= function(ev) {
var el = (ev);
if () {
return false;
}
var cal = ;
= el;
Calendar._C = cal;
if ( != 300) with (Calendar) {
if ( == 50) {
el._current = ;
addEvent(document, "mousemove", tableMouseOver);
} else
addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver);
addClass(el, "hilite active");
addEvent(document, "mouseup", tableMouseUp);
} else if () {
cal._dragStart(ev);
}
if ( == -1 || == 1) {
if () clearTimeout();
= setTimeout("()", 250);
} else if ( == -2 || == 2) {
if () clearTimeout();
= setTimeout(( > 0) ? "(true)" : "(false)", 250);
} else {
= null;
}
return (ev);
};
= function(ev) {
((ev), ev || );
if (Calendar.is_ie) {
();
}
};
= function(ev) {
var el = (ev);
if ((el, ev) || Calendar._C || ) {
return false;
}
if () {
if ((0, 1) == "_") {
= () + (1);
}
= ;
}
if ( != 300) {
(el, "hilite");
if () {
(, "rowhilite");
}
}
return (ev);
};
= function(ev) {
with (Calendar) {
var el = getElement(ev);
if (isRelated(el, ev) || _C || )
return false;
removeClass(el, "hilite");
if ()
removeClass(, "rowhilite");
if ()
= _TT["SEL_DATE"];
return stopEvent(ev);
}
};
/**
* A generic "click" handler :) handles all types of buttons defined in this
* calendar.
*/
= function(el, ev) {
var cal = ;
var closing = false;
var newdate = false;
var date = null;
if (typeof == "undefined") {
if () {
(, "selected");
(el, "selected");
closing = ( == el);
if (!closing) {
= el;
}
}
();
date = ;
var other_month = !( = !);
if (!other_month && !)
cal._toggleMultipleDate(new Date(date));
else
newdate = !;
// a date was clicked
if (other_month)
cal._init(, date);
} else {
if ( == 200) {
(el, "hilite");
();
return;
}
date = new Date();
if ( == 0)
(new Date()); // TODAY
// unless "today" was clicked, we assume no date was clicked so
// the selected handler will know not to close the calenar when
// in single-click mode.
// = ( == 0);
= false;
var year = ();
var mon = ();
function setMonth(m) {
var day = ();
var max = (m);
if (day > max) {
(max);
}
(m);
};
switch () {
case 400:
(el, "hilite");
var text = Calendar._TT["ABOUT"];
if (typeof text != "undefined") {
text += ? Calendar._TT["ABOUT_TIME"] : "";
} else {
// FIXME: this should be removed as soon as lang files get updated!
text = "Help and about box text is not translated into this language.\n" +
"If you know this language and you feel generous please update\n" +
"the corresponding file in \"lang\" subdir to match \n" +
"and send it back to <mihai_bazon@> to get it into the distribution ;-)\n\n" +
"Thank you!\n" +
"/mishoo/\n";
}
alert(text);
return;
case -2:
if (year > ) {
(year - 1);
}
break;
case -1:
if (mon > 0) {
setMonth(mon - 1);
} else if (year-- > ) {
(year);
setMonth(11);
}
break;
case 1:
if (mon < 11) {
setMonth(mon + 1);
} else if (year < ) {
(year + 1);
setMonth(0);
}
break;
case 2:
if (year < ) {
(year + 1);
}
break;
case 100:
();
return;
case 50:
var range = el._range;
var current = ;
for (var i = ; --i >= 0;)
if (range[i] == current)
break;
if (ev && ) {
if (--i < 0)
i = - 1;
} else if ( ++i >= )
i = 0;
var newval = range[i];
= newval;
();
return;
case 0:
// TODAY will bring us here
if ((typeof == "function") &&
(date, (), (), ())) {
return false;
}
break;
}
if (!()) {
(date);
newdate = true;
} else if ( == 0)
newdate = closing = true;
}
if (newdate) {
ev && ();
}
if (closing) {
(el, "hilite");
ev && ();
}
};
// END: CALENDAR STATIC FUNCTIONS
// BEGIN: CALENDAR OBJECT FUNCTIONS
/**
* This function creates the calendar inside the given parent. If _par is
* null than it creates a popup calendar inside the BODY element. If _par is
* an element, be it BODY, then it creates a non-popup calendar (still
* hidden). Some properties need to be set before calling this function.
*/
= function (_par) {
var parent = null;
if (! _par) {
// default parent is the document body, in which case we create
// a popup calendar.
parent = ("body")[0];
= true;
} else {
parent = _par;
= false;
}
= ? new Date() : new Date();
var table = ("table");
= table;
= 0;
= 0;
= this;
(table, "mousedown", );
var div = ("div");
= div;
= "calendar";
if () {
= "absolute";
= "none";
}
(table);
var thead = ("thead", table);
var cell = null;
var row = null;
var cal = this;
var hh = function (text, cs, navtype) {
cell = ("td", row);
= cs;
= "button";
if (navtype != 0 && (navtype) <= 2)
+= " nav";
Calendar._add_evs(cell);
= cal;
= navtype;
= "<div unselectable='on'>" + text + "</div>";
return cell;
};
row = ("tr", thead);
var title_length = 6;
() && --title_length;
() && ++title_length;
hh("?", 1, 400).ttip = Calendar._TT["INFO"];
= hh("", title_length, 300);
= "title";
if () {
= Calendar._TT["DRAG_TO_MOVE"];
= "move";
hh("×", 1, 200).ttip = Calendar._TT["CLOSE"];
}
row = ("tr", thead);
= "headrow";
this._nav_py = hh("«", 1, -2);
this._nav_py.ttip = Calendar._TT["PREV_YEAR"];
this._nav_pm = hh("‹", 1, -1);
this._nav_pm.ttip = Calendar._TT["PREV_MONTH"];
this._nav_now = hh(Calendar._TT["TODAY"], ? 4 : 3, 0);
this._nav_now.ttip = Calendar._TT["GO_TODAY"];
this._nav_nm = hh("›", 1, 1);
this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"];
this._nav_ny = hh("»", 1, 2);
this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"];
// day names
row = ("tr", thead);
= "daynames";
if () {
cell = ("td", row);
= "name wn";
= Calendar._TT["WK"];
}
for (var i = 7; i > 0; --i) {
cell = ("td", row);
if (!i) {
= 100;
= this;
Calendar._add_evs(cell);
}
}
= () ? : ;
this._displayWeekdays();
var tbody = ("tbody", table);
= tbody;
for (i = 6; i > 0; --i) {
row = ("tr", tbody);
if () {
cell = ("td", row);
}
for (var j = 7; j > 0; --j) {
cell = ("td", row);
= this;
Calendar._add_evs(cell);
}
}
if () {
row = ("tr", tbody);
= "time";
cell = ("td", row);
= "time";
= 2;
= Calendar._TT["TIME"] || " ";
cell = ("td", row);
= "time";
= ? 4 : 3;
(function(){
function makeTimePart(className, init, range_start, range_end) {
var part = ("span", cell);
= className;
= init;
= cal;
= Calendar._TT["TIME_PART"];
= 50;
part._range = [];
if (typeof range_start != "number")
part._range = range_start;
else {
for (var i = range_start; i <= range_end; ++i) {
var txt;
if (i < 10 && range_end >= 10) txt = '0' + i;
else txt = '' + i;
part._range[part._range.length] = txt;
}
}
Calendar._add_evs(part);
return part;
};
var hrs = ();
var mins = ();
var t12 = !cal.time24;
var pm = (hrs > 12);
if (t12 && pm) hrs -= 12;
var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23);
var span = ("span", cell);
= ":";
= "colon";
var M = makeTimePart("minute", mins, 0, 59);
var AP = null;
cell = ("td", row);
= "time";
= 2;
if (t12)
AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]);
else
= " ";
= function() {
var pm, hrs = (),
mins = ();
if (t12) {
pm = (hrs >= 12);
if (pm) hrs -= 12;
if (hrs == 0) hrs = 12;
= pm ? "pm" : "am";
}
= (hrs < 10) ? ("0" + hrs) : hrs;
= (mins < 10) ? ("0" + mins) : mins;
};
= function() {
var date = ;
var h = parseInt(, 10);
if (t12) {
if (/pm/() && h < 12)
h += 12;
else if (/am/() && h == 12)
h = 0;
}
var d = ();
var m = ();
var y = ();
(h);
(parseInt(, 10));
(y);
(m);
(d);
= false;
();
};
})();
} else {
= = function() {};
}
var tfoot = ("tfoot", table);
row = ("tr", tfoot);
= "footrow";
cell = hh(Calendar._TT["SEL_DATE"], ? 8 : 7, 300);
= "ttip";
if () {
= Calendar._TT["DRAG_TO_MOVE"];
= "move";
}
= cell;
div = ("div", );
= div;
= "combo";
for (i = 0; i < Calendar._MN.length; ++i) {
var mn = ("div");
= Calendar.is_ie ? "label-IEfix" : "label";
= i;
= Calendar._SMN[i];
(mn);
}
div = ("div", );
= div;
= "combo";
for (i = 12; i > 0; --i) {
var yr = ("div");
= Calendar.is_ie ? "label-IEfix" : "label";
(yr);
}
this._init(, );
();
};
/** keyboard navigation, only for popup calendars */
Calendar._keyEvent = function(ev) {
var cal = window._dynarch_popupCalendar;
if (!cal || )
return false;
(Calendar.is_ie) && (ev = );
var act = (Calendar.is_ie || == "keypress"),
K = ;
if () {
switch (K) {
case 37: // KEY left
act && (cal._nav_pm);
break;
case 38: // KEY up
act && (cal._nav_py);
break;
case 39: // KEY right
act && (cal._nav_nm);
break;
case 40: // KEY down
act && (cal._nav_ny);
break;
default:
return false;
}
} else switch (K) {
case 32: // KEY space (now)
(cal._nav_now);
break;
case 27: // KEY esc
act && ();
break;
case 37: // KEY left
case 38: // KEY up
case 39: // KEY right
case 40: // KEY down
if (act) {
var prev, x, y, ne, el, step;
prev = K == 37 || K == 38;
step = (K == 37 || K == 39) ? 1 : 7;
function setVars() {
el = ;
var p = ;
x = p & 15;
y = p >> 4;
ne = cal.ar_days[y][x];
};setVars();
function prevMonth() {
var date = new Date();
(() - step);
(date);
};
function nextMonth() {
var date = new Date();
(() + step);
(date);
};
while (1) {
switch (K) {
case 37: // KEY left
if (--x >= 0)
ne = cal.ar_days[y][x];
else {
x = 6;
K = 38;
continue;
}
break;
case 38: // KEY up
if (--y >= 0)
ne = cal.ar_days[y][x];
else {
prevMonth();
setVars();
}
break;
case 39: // KEY right
if (++x < 7)
ne = cal.ar_days[y][x];
else {
x = 0;
K = 40;
continue;
}
break;
case 40: // KEY down
if (++y < cal.ar_days.length)
ne = cal.ar_days[y][x];
else {
nextMonth();
setVars();
}
break;
}
break;
}
if (ne) {
if (!)
(ne);
else if (prev)
prevMonth();
else
nextMonth();
}
}
break;
case 13: // KEY enter
if (act)
(, ev);
break;
default:
return false;
}
return (ev);
};
/**
* (RE)Initializes the calendar to the given date and firstDayOfWeek
*/
._init = function (firstDayOfWeek, date) {
var today = new Date(),
TY = (),
TM = (),
TD = ();
= "hidden";
var year = ();
if (year < ) {
year = ;
(year);
} else if (year > ) {
year = ;
(year);
}
= firstDayOfWeek;
= new Date(date);
var month = ();
var mday = ();
var no_days = ();
// calendar voodoo for computing the first day that would actually be
// displayed in the calendar, even if it's from the previous month.
// WARNING: this is magic. ;-)
(1);
var day1 = (() - ) % 7;
if (day1 < 0)
day1 += 7;
(-day1);
(() + 1);
var row = ;
var MN = Calendar._SMN[month];
var ar_days = this.ar_days = new Array();
var weekend = Calendar._TT["WEEKEND"];
var dates = ? ( = {}) : null;
for (var i = 0; i < 6; ++i, row = ) {
var cell = ;
if () {
= "day wn";
= ();
cell = ;
}
= "daysrow";
var hasdays = false, iday, dpos = ar_days[i] = [];
for (var j = 0; j < 7; ++j, cell = , (iday + 1)) {
iday = ();
var wday = ();
= "day";
= i << 4 | j;
dpos[j] = cell;
var current_month = (() == month);
if (!current_month) {
if () {
+= " othermonth";
= true;
} else {
= "emptycell";
= " ";
= true;
continue;
}
} else {
= false;
hasdays = true;
}
= false;
= ? (date, iday) : iday;
if (dates)
dates[("%Y%m%d")] = cell;
if () {
var status = (date, year, month, iday);
if () {
var toolTip = (date, year, month, iday);
if (toolTip)
= toolTip;
}
if (status === true) {
+= " disabled";
= true;
} else {
if (/disabled/(status))
= true;
+= " " + status;
}
}
if (!) {
= new Date(date);
= "_";
if (! && current_month
&& iday == mday && ) {
+= " selected";
= cell;
}
if (() == TY &&
() == TM &&
iday == TD) {
+= " today";
+= Calendar._TT["PART_TODAY"];
}
if ((()) != -1)
+= ? " oweekend" : " weekend";
}
}
if (!(hasdays || ))
= "emptyrow";
}
= Calendar._MN[month] + ", " + year;
();
= "visible";
this._initMultipleDates();
// PROFILE
// = "Generated in " + ((new Date()) - today) + " ms";
};
._initMultipleDates = function() {
if () {
for (var i in ) {
var cell = [i];
var d = [i];
if (!d)
continue;
if (cell)
+= " selected";
}
}
};
._toggleMultipleDate = function(date) {
if () {
var ds = ("%Y%m%d");
var cell = [ds];
if (cell) {
var d = [ds];
if (!d) {
(cell, "selected");
[ds] = date;
} else {
(cell, "selected");
delete [ds];
}
}
}
};
= function (unaryFunction) {
= unaryFunction;
};
/**
* Calls _init function above for going to a certain date (but only if the
* date is different than the currently selected one).
*/
= function (date) {
if (!()) {
this._init(, date);
}
};
/**
* Refreshes the calendar. Useful if the "disabledHandler" function is
* dynamic, meaning that the list of disabled date can change at runtime.
* Just * call this function if you think that the list of disabled dates
* should * change.
*/
= function () {
this._init(, );
};
/** Modifies the "firstDayOfWeek" parameter (pass 0 for Synday, 1 for Monday, etc.). */
= function (firstDayOfWeek) {
this._init(firstDayOfWeek, );
this._displayWeekdays();
};
/**
* Allows customization of what dates are enabled. The "unaryFunction"
* parameter must be a function object that receives the date (as a JS Date
* object) and returns a boolean value. If the returned value is true then
* the passed date will be marked as disabled.
*/
= = function (unaryFunction) {
= unaryFunction;
};
/** Customization of allowed year range for the calendar. */
= function (a, z) {
= a;
= z;
};
/** Calls the first user handler (selectedHandler). */
= function () {
if () {
(this, ());
}
};
/** Calls the second user handler (closeHandler). */
= function () {
if () {
(this);
}
();
};
/** Removes the calendar object from the DOM tree and destroys it. */
= function () {
var el = ;
();
Calendar._C = null;
window._dynarch_popupCalendar = null;
};
/**
* Moves the calendar element to a different section in the DOM tree (changes
* its parent).
*/
= function (new_parent) {
var el = ;
(el);
new_parent.appendChild(el);
};
// This gets called when the user presses a mouse button anywhere in the
// document, if the calendar is shown. If the click was outside the open
// calendar this function closes it.
Calendar._checkCalendar = function(ev) {
var calendar = window._dynarch_popupCalendar;
if (!calendar) {
return false;
}
var el = Calendar.is_ie ? (ev) : (ev);
for (; el != null && el != ; el = );
if (el == null) {
// calls closeHandler which should hide the calendar.
window._dynarch_popupCalendar.callCloseHandler();
return (ev);
}
};
/** Shows the calendar. */
= function () {
var rows = ("tr");
for (var i = ; i > 0;) {
var row = rows[--i];
(row, "rowhilite");
var cells = ("td");
for (var j = ; j > 0;) {
var cell = cells[--j];
(cell, "hilite");
(cell, "active");
}
}
= "block";
= false;
if () {
window._dynarch_popupCalendar = this;
(document, "keydown", Calendar._keyEvent);
(document, "keypress", Calendar._keyEvent);
(document, "mousedown", Calendar._checkCalendar);
}
();
};
/**
* Hides the calendar. Also removes any "hilite" from the class of any TD
* element.
*/
= function () {
if () {
(document, "keydown", Calendar._keyEvent);
(document, "keypress", Calendar._keyEvent);
(document, "mousedown", Calendar._checkCalendar);
}
= "none";
= true;
();
};
/**
* Shows the calendar at a given absolute position (beware that, depending on
* the calendar element style -- position property -- this might be relative
* to the parent's containing rectangle).
*/
= function (x, y) {
var s = ;
= x + "px";
= y + "px";
();
};
/** Shows the calendar near a given element. */
= function (el, opts) {
var self = this;
var p = (el);
if (!opts || typeof opts != "string") {
(, + );
return true;
}
function fixPosition(box) {
if ( < 0)
= 0;
if ( < 0)
= 0;
var cp = ("div");
var s = ;
= "absolute";
= = = = "0px";
(cp);
var br = (cp);
(cp);
if (Calendar.is_ie) {
+= ;
+= ;
} else {
+= ;
+= ;
}
var tmp = + - ;
if (tmp > 0) -= tmp;
tmp = + - ;
if (tmp > 0) -= tmp;
};
= "block";
Calendar.continuation_for_the_fucking_khtml_browser = function() {
var w = ;
var h = ;
= "none";
var valign = (0, 1);
var halign = "l";
if ( > 1) {
halign = (1, 1);
}
// vertical alignment
switch (valign) {
case "T": -= h; break;
case "B": += ; break;
case "C": += ( - h) / 2; break;
case "t": += - h; break;
case "b": break; // already there
}
// horizontal alignment
switch (halign) {
case "L": -= w; break;
case "R": += ; break;
case "C": += ( - w) / 2; break;
case "l": += - w; break;
case "r": break; // already there
}
= w;
= h + 40;
= "none";
fixPosition(p);
(, );
};
if (Calendar.is_khtml)
setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10);
else
Calendar.continuation_for_the_fucking_khtml_browser();
};
/** Customizes the date format. */
= function (str) {
= str;
};
/** Customizes the tooltip date format. */
= function (str) {
= str;
};
/**
* Tries to identify the date represented in a string. If successful it also
* calls which moves the calendar to the given date.
*/
= function(str, fmt) {
if (!fmt)
fmt = ;
((str, fmt));
};
= function () {
if (!Calendar.is_ie && !Calendar.is_opera)
return;
function getVisib(obj){
var value = ;
if (!value) {
if ( && typeof () == "function") { // Gecko, W3C
if (!Calendar.is_khtml)
value = .
getComputedStyle(obj, "").getPropertyValue("visibility");
else
value = '';
} else if () { // IE
value = ;
} else
value = '';
}
return value;
};
var tags = new Array("applet", "iframe", "select");
var el = ;
var p = (el);
var EX1 = ;
var EX2 = + EX1;
var EY1 = ;
var EY2 = + EY1;
for (var k = ; k > 0; ) {
var ar = (tags[--k]);
var cc = null;
for (var i = ; i > 0;) {
cc = ar[--i];
p = (cc);
var CX1 = ;
var CX2 = + CX1;
var CY1 = ;
var CY2 = + CY1;
if ( || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
if (!cc.__msh_save_visibility) {
cc.__msh_save_visibility = getVisib(cc);
}
= cc.__msh_save_visibility;
} else {
if (!cc.__msh_save_visibility) {
cc.__msh_save_visibility = getVisib(cc);
}
= "hidden";
}
}
}
};
/** Internal function; it displays the bar with the names of the weekday. */
._displayWeekdays = function () {
var fdow = ;
var cell = ;
var weekend = Calendar._TT["WEEKEND"];
for (var i = 0; i < 7; ++i) {
= "day name";
var realday = (i + fdow) % 7;
if (i) {
= Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]);
= 100;
= this;
= realday;
Calendar._add_evs(cell);
}
if ((()) != -1) {
(cell, "weekend");
}
= Calendar._SDN[(i + fdow) % 7];
cell = ;
}
};
/** Internal function. Hides all combo boxes that might be displayed. */
._hideCombos = function () {
= "none";
= "none";
};
/** Internal function. Starts dragging the element. */
._dragStart = function (ev) {
if () {
return;
}
= true;
var posX;
var posY;
if (Calendar.is_ie) {
posY = + ;
posX = + ;
} else {
posY = + ;
posX = + ;
}
var st = ;
= posX - parseInt();
= posY - parseInt();
with (Calendar) {
addEvent(document, "mousemove", calDragIt);
addEvent(document, "mouseup", calDragEnd);
}
};
// BEGIN: DATE OBJECT PATCHES
/** Adds the number of days array to the Date object. */
Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
/** Constants used for time computations */
= 1000 /* milliseconds */;
= 60 * ;
= 60 * ;
= 24 * ;
= 7 * ;
= function(str, fmt) {
var today = new Date();
var y = 0;
var m = -1;
var d = 0;
var a = (/\W+/);
var b = (/%./g);
var i = 0, j = 0;
var hr = 0;
var min = 0;
for (i = 0; i < ; ++i) {
if (!a[i])
continue;
switch (b[i]) {
case "%d":
case "%e":
d = parseInt(a[i], 10);
break;
case "%m":
m = parseInt(a[i], 10) - 1;
break;
case "%Y":
case "%y":
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
break;
case "%b":
case "%B":
for (j = 0; j < 12; ++j) {
if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; }
}
break;
case "%H":
case "%I":
case "%k":
case "%l":
hr = parseInt(a[i], 10);
break;
case "%P":
case "%p":
if (/pm/(a[i]) && hr < 12)
hr += 12;
else if (/am/(a[i]) && hr >= 12)
hr -= 12;
break;
case "%M":
min = parseInt(a[i], 10);
break;
}
}
if (isNaN(y)) y = ();
if (isNaN(m)) m = ();
if (isNaN(d)) d = ();
if (isNaN(hr)) hr = ();
if (isNaN(min)) min = ();
if (y != 0 && m != -1 && d != 0)
return new Date(y, m, d, hr, min, 0);
y = 0; m = -1; d = 0;
for (i = 0; i < ; ++i) {
if (a[i].search(/[a-zA-Z]+/) != -1) {
var t = -1;
for (j = 0; j < 12; ++j) {
if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; }
}
if (t != -1) {
if (m != -1) {
d = m+1;
}
m = t;
}
} else if (parseInt(a[i], 10) <= 12 && m == -1) {
m = a[i]-1;
} else if (parseInt(a[i], 10) > 31 && y == 0) {
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
} else if (d == 0) {
d = a[i];
}
}
if (y == 0)
y = ();
if (m != -1 && d != 0)
return new Date(y, m, d, hr, min, 0);
return today;
};
/** Returns the number of days in the current month */
= function(month) {
var year = ();
if (typeof month == "undefined") {
month = ();
}
if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
return 29;
} else {
return Date._MD[month];
}
};
/** Returns the number of day in the year. */
= function() {
var now = new Date((), (), (), 0, 0, 0);
var then = new Date((), 0, 0, 0, 0, 0);
var time = now - then;
return (time / );
};
/** Returns the number of the week in year, as defined in ISO 8601. */
= function() {
var d = new Date((), (), (), 0, 0, 0);
var DoW = ();
(() - (DoW + 6) % 7 + 3); // Nearest Thu
var ms = (); // GMT
(0);
(4); // Thu in Week 1
return ((ms - ()) / (7 * 864e5)) + 1;
};
/** Checks date and time equality */
= function(date) {
return ((() == ()) &&
(() == ()) &&
(() == ()) &&
(() == ()) &&
(() == ()));
};
/** Set only the year, month, date parts (keep existing time) */
= function(date) {
var tmp = new Date(date);
(1);
(());
(());
(());
};
/** Prints the date in a string according to the given format. */
= function (str) {
var m = ();
var d = ();
var y = ();
var wn = ();
var w = ();
var s = {};
var hr = ();
var pm = (hr >= 12);
var ir = (pm) ? (hr - 12) : hr;
var dy = ();
if (ir == 0)
ir = 12;
var min = ();
var sec = ();
s["%a"] = Calendar._SDN[w]; // abbreviated weekday name [FIXME: I18N]
s["%A"] = Calendar._DN[w]; // full weekday name
s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N]
s["%B"] = Calendar._MN[m]; // full month name
// FIXME: %c : preferred date and time representation for the current locale
s["%C"] = 1 + (y / 100); // the century number
s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31)
s["%e"] = d; // the day of the month (range 1 to 31)
// FIXME: %D : american date style: %m/%d/%y
// FIXME: %E, %F, %G, %g, %h (man strftime)
s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format)
s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format)
s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366)
s["%k"] = hr; // hour, range 0 to 23 (24h format)
s["%l"] = ir; // hour, range 1 to 12 (12h format)
s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12
s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59
s["%n"] = "\n"; // a newline character
s["%p"] = pm ? "PM" : "AM";
s["%P"] = pm ? "pm" : "am";
// FIXME: %r : the time in am/pm notation %I:%M:%S %p
// FIXME: %R : the time in 24-hour notation %H:%M
s["%s"] = (() / 1000);
s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59
s["%t"] = "\t"; // a tab character
// FIXME: %T : the time in 24-hour notation (%H:%M:%S)
s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn;
s["%u"] = w + 1; // the day of the week (range 1 to 7, 1 = MON)
s["%w"] = w; // the day of the week (range 0 to 6, 0 = SUN)
// FIXME: %x : preferred date representation for the current locale without the time
// FIXME: %X : preferred time representation for the current locale without the date
s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)
s["%Y"] = y; // year with the century
s["%%"] = "%"; // a literal '%' character
var re = /%./g;
if (!Calendar.is_ie5 && !Calendar.is_khtml)
return (re, function (par) { return s[par] || par; });
var a = (re);
for (var i = 0; i < ; i++) {
var tmp = s[a[i]];
if (tmp) {
re = new RegExp(a[i], 'g');
str = (re, tmp);
}
}
return str;
};
.__msh_oldSetFullYear = ;
= function(y) {
var d = new Date(this);
d.__msh_oldSetFullYear(y);
if (() != ())
(28);
this.__msh_oldSetFullYear(y);
};
// END: DATE OBJECT PATCHES
// global object that remembers the calendar
window._dynarch_popupCalendar = null;
//********* END ********************
/* Copyright Mihai Bazon, 2002, 2003 | /mishoo/
* ---------------------------------------------------------------------------
*
* The DHTML Calendar
*
* Details and latest version at:
* /mishoo/
*
* This script is distributed under the GNU Lesser General Public License.
* Read the entire license text here: /licenses/
*
* This file defines helper functions for setting up the calendar. They are
* intended to help non-programmers get a working calendar on their site
* quickly. This script should not be seen as part of the calendar. It just
* shows you what one can do with the calendar, while in the same time
* providing a quick and simple method for setting it up. If you need
* exhaustive customization of the calendar creation process feel free to
* modify this code to suit your needs (this is recommended and much better
* than modifying itself).
*/
// $Id: ,v 1.25 2005/03/07 09:51:33 mishoo Exp $
/**
* This function "patches" an input field (or other element) to use a calendar
* widget for date selection.
*
* The "params" is a single object that can have the following properties:
*
* prop. name | description
* -------------------------------------------------------------------------------------------------
* inputField | the ID of an input field to store the date
* displayArea | the ID of a DIV or other element to show the date
* button | ID of a button or other element that will trigger the calendar
* eventName | event that will trigger the calendar, without the "on" prefix (default: "click")
* ifFormat | date format that will be stored in the input field
* daFormat | the date format that will be used to display the date in displayArea
* singleClick | (true/false) wether the calendar is in single click mode or not (default: true)
* firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc.
* align | alignment (default: "Br"); if you don't know what's this see the calendar documentation
* range | array with 2 elements. Default: [1900, 2999] -- the range of years available
* weekNumbers | (true/false) if it's true (default) the calendar will display week numbers
* flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID
* flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar)
* disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar
* onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay)
* onClose | function that gets called when the calendar is closed. [default]
* onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar.
* date | the date that the calendar will be initially displayed to
* showsTime | default: false; if true the calendar will include a time selector
* timeFormat | the time format; can be "12" or "24", default is "12"
* electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close
* step | configures the step of the years in drop-down boxes; default: 2
* position | configures the calendar absolute position; default: null
* cache | if "true" (but default: "false") it will reuse the same calendar object, where possible
* showOthers | if "true" (but default: "false") it will show days from other months too
*
* None of them is required, they all have default values. However, if you
* pass none of "inputField", "displayArea" or "button" you'll get a warning
* saying "nothing to setup".
*/
= function (params) {
function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
param_default("inputField", null);
param_default("displayArea", null);
param_default("button", null);
param_default("eventName", "click");
param_default("ifFormat", "%Y/%m/%d");
param_default("daFormat", "%Y/%m/%d");
param_default("singleClick", true);
param_default("disableFunc", null);
param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined
param_default("dateText", null);
param_default("firstDay", null);
param_default("align", "Br");
param_default("range", [1900, 2999]);
param_default("weekNumbers", true);
param_default("flat", null);
param_default("flatCallback", null);
param_default("onSelect", null);
param_default("onClose", null);
param_default("onUpdate", null);
param_default("date", null);
param_default("showsTime", false);
param_default("timeFormat", "24");
param_default("electric", true);
param_default("step", 2);
param_default("position", null);
param_default("cache", false);
param_default("showOthers", false);
param_default("multiple", null);
var tmp = ["inputField", "displayArea", "button"];
for (var i in tmp) {
if (typeof params[tmp[i]] == "string") {
params[tmp[i]] = (params[tmp[i]]);
}
}
if (!( || || || || )) {
alert(":\n Nothing to setup (no fields found). Please check your code");
return false;
}
function onSelect(cal) {
var p = ;
var update = ( || );
if (update && ) {
= ();
if (typeof == "function")
();
}
if (update && )
= ();
if (update && typeof == "function")
(cal);
if (update && ) {
if (typeof == "function")
(cal);
}
if (update && && )
();
};
if ( != null) {
if (typeof == "string")
= ();
if (!) {
alert(":\n Flat specified but can't find parent.");
return false;
}
var cal = new Calendar(, , || onSelect);
= ;
= ;
cal.time24 = ( == "24");
= params;
= ;
([0], [1]);
();
= ;
if () {
();
}
if ( && typeof == "string") {
();
}
();
();
return false;
}
var triggerEl = || || ;
triggerEl["on" + ] = function() {
var dateEl = || ;
var dateFmt = ? : ;
var mustCreate = false;
var cal = ;
if (dateEl)
= ( || , dateFmt);
if (!(cal && )) {
= cal = new Calendar(,
,
|| onSelect,
|| function(cal) { (); });
= ;
cal.time24 = ( == "24");
= ;
mustCreate = true;
} else {
if ()
();
();
}
if () {
= {};
for (var i = ; --i >= 0;) {
var d = [i];
var ds = ("%Y%m%d");
[ds] = d;
}
}
= ;
= ;
([0], [1]);
= params;
();
= ;
(dateFmt);
if (mustCreate)
();
();
if (!)
( || || , );
else
([0], [1]);
return false;
};
return cal;
};
//************ END *********************
// ** I18N
// Calendar big5-utf8 language
// Author: Gary Fu, <gary@>
// Encoding: utf8
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("day",
"one",
"two",
"three",
"Four",
"five",
"six",
"day");
// First day of the week. "0" means display Sunday first, "1" means display
// Monday first, etc.
Calendar._FD = 0;
// full month names
Calendar._MN = new Array
("January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December");
// short month names
Calendar._SMN = new Array
("January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "About";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: /projects/calendar/\n" +
"Distributed under GNU LGPL. See /licenses/ for details." +
"\n\n" +
"Date selection method:\n" +
"- Use the \xab, \xbb button to select year\n" +
"- Use " + (0x2039) + ", " + (0x203a) + " button to select month\n" +
"- Press and hold the button above to speed up selection";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Time selection method:\n" +
"- Click any time part to increase its value\n" +
"- At the same time, press the Shift key and click to reduce its value\n" +
"- Click and drag to speed up changing values";
Calendar._TT["PREV_YEAR"] = "Previous year (press and hold menu)";
Calendar._TT["PREV_MONTH"] = "Previous Month (Press and hold menu)";
Calendar._TT["GO_TODAY"] = "Today";
Calendar._TT["NEXT_MONTH"] = "Next month (press and hold menu)";
Calendar._TT["NEXT_YEAR"] = "Next year (press and hold menu)";
Calendar._TT["SEL_DATE"] = "Select date";
Calendar._TT["DRAG_TO_MOVE"] = "Drag";
Calendar._TT["PART_TODAY"] = " (Today)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Show %s first";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Close";
Calendar._TT["TODAY"] = "Today";
Calendar._TT["TIME_PART"] = "Click or drag to change the time (press Shift at the same time to reduce)";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "weekly";
Calendar._TT["TIME"] = "Time:";
//************ END *******************
</script>
<style rel="stylesheet" type="text/css" >
/* Distributed as part of The Coolest DHTML Calendar
Author: Mihai Bazon, /mishoo
Copyright 2005,
*/
/* The main calendar widget. DIV containing a table. */
{ position: relative; }
.calendar, .calendar table {
border: 1px solid #bdb2bf;
font-size: 13px;
color: #000;
cursor: default;
background: "gray";
font-family: "trebuchet ms",verdana,tahoma,sans-serif;
}
.calendar {
border-color: #797979;
}
/* Header part -- contains navigation buttons and day names. */
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
text-align: center; /* They are the navigation buttons */
padding: 2px; /* Make the buttons seem like they're pressing */
background: url("") repeat-x 0 100%; color: #000;
font-weight: bold;
}
.calendar .nav {
font-family: verdana,tahoma,sans-serif;
}
.calendar .nav div {
background: transparent url("") no-repeat 100% 100%;
}
.calendar thead tr { background: url("") repeat-x 0 100%; color: #000; }
.calendar thead .title { /* This holds the current "month, year" */
font-weight: bold; /* Pressing it will take you to the current date */
text-align: center;
padding: 2px;
background: url("") repeat-x 0 100%; color: #000;
}
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
}
.calendar thead .name { /* Cells <TD> containing the day names */
border-bottom: 1px solid #797979;
padding: 2px;
text-align: center;
color: #000;
}
.calendar thead .weekend { /* How a weekend day name shows in header */
color: #c44;
}
.calendar thead .hilite { /* How do the buttons in header appear when hover */
background: url("");
border-bottom: 1px solid #797979;
padding: 2px 2px 1px 2px;
}
.calendar thead .active { /* Active (pressed) buttons in header */
background: url(""); color: #fff;
padding: 3px 1px 0px 3px;
border-bottom: 1px solid #797979;
}
.calendar thead .daynames { /* Row <TR> containing the day names */
background: url("");
}
/* The body part -- contains all the days in month. */
.calendar tbody .day { /* Cells <TD> containing month days dates */
font-family: verdana,tahoma,sans-serif;
width: 2em;
color: #000;
text-align: right;
padding: 2px 4px 2px 2px;
font-size: 13px;
}
.calendar tbody . {
font-size: 80%;
color: #999;
font-size: 13px;
}
.calendar tbody . {
color: #f99;
font-size: 13px;
}
.calendar table .wn {
padding: 2px 3px 2px 2px;
border-right: 1px solid #797979;
background: url("");
}
.calendar tbody .rowhilite td,
.calendar tbody .rowhilite {
background: url("");
}
.calendar tbody { font-weight: bold;
font-size: 13px;/* background: url("") no-repeat 70% 50%; */ }
.calendar tbody { /* Hovered cells <TD> */
background: url("");
padding: 1px 3px 1px 1px;
border: 1px solid #bbb;
}
.calendar tbody { /* Active (pressed) cells <TD> */
padding: 2px 2px 0px 2px;
}
.calendar tbody { /* Cells showing weekend days */
color: #c44;
}
.calendar tbody { /* Cell showing selected date */
font-weight: bold;
border: 1px solid #797979;
padding: 1px 3px 1px 1px;
background: url(""); color: #fff;
}
.calendar tbody .disabled { color: #999; }
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
/* The footer part -- status bar and "Close" button */
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
text-align: center;
background: #565;
color: #fff;
}
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
padding: 2px;
background: url("") repeat-x 0 0; color: #000;
}
.calendar tfoot .hilite { /* Hover style for buttons in footer */
background: #afa;
border: 1px solid #084;
color: #000;
padding: 1px;
}
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
background: #7c7;
padding: 2px 0px 0px 2px;
}
/* Combo boxes (menus that display months/years for direct selection) */
.calendar .combo {
position: absolute;
display: none;
top: 0px;
left: 0px;
width: 4em;
cursor: default;
border-width: 0 1px 1px 1px;
border-style: solid;
border-color: #797979;
background: url(""); color: #000;
z-index: 100;
font-size: 90%;
}
.calendar .combo .label,
.calendar .combo .label-IEfix {
text-align: center;
padding: 1px;
}
.calendar .combo .label-IEfix {
width: 4em;
}
.calendar .combo .hilite {
background: url(""); color: #000;
}
.calendar .combo .active {
background: url(""); color: #fff;
font-weight: bold;
}
.calendar {
border-top: 1px solid #797979;
padding: 1px 0px;
text-align: center;
background: url("");
}
.calendar .hour,
.calendar .minute,
.calendar .ampm {
padding: 0px 5px 0px 6px;
font-weight: bold;
background: url(""); color: #000;
}
.calendar .hour,
.calendar .minute {
font-family: monospace;
}
.calendar .ampm {
text-align: center;
}
.calendar .colon {
padding: 0px 2px 0px 3px;
font-weight: bold;
}
.calendar {
background: url(""); color: #000;
}
.calendar {
background: url(""); color: #fff;
}
</style>
</head>
<body>
<form name="form1" action="?" method="post">
<table>
<?php
function disp_js_calendar($button_id, $output_id)
{
/* == sample & description ==
inputField : "birthday", // the ID of input field which you want to put "date" data, not NAME
ifFormat : "%Y-%m-%d", // Date Format
showsTime : false, // also show time ?
button : "BTN", // button's ID, not NAME
singleClick : true, // how to start this function ? Single-click or Double-click
step : 1 // the interval of last year and next year
*/
echo '<script type="text/javascript">
({
inputField : "'.$output_id.'",
ifFormat : "%Y-%m-%d",
showsTime : false,
button : "'.$button_id.'",
singleClick : true,
step : 1
});
</script>';
}
echo '<tr><th class="header">Date:</th>
<td><input type="text" name="src_date" value="'.$_POST['src_date'].'">
<input type="button" value="">';
disp_js_calendar("BTN", "src_date");
echo '</td></tr>';
?>
</table>
</body>
</html>