// aupair_cal3_conf.js

// original at http://www.yxscripts.com/cal/cal3.html
// Copyright 2002 Xin Yang

// This script should work with IE4+/Win, IE5+/Mac, NN4x, N6+ and Konqueror3/Linux.

// Usage:
// <script language="javascript" src="cal3.js"></script>
// <script type="text/javascript" src="cal3_conf.js"></script> 

// <input type="text" "readonly" name="DateFrom1" value="click ..." size="11">
// <a href="javascript:showCal('CalFrom1')"><img src="date.gif" width="19" height="17" border="0"></a>
// Any call like showCal('Date3',0,-200) overwrites the parameters set.by showCal

//assumes a single form per page:
addCalendar("CalFrom1", "DateFrom1", "");
addCalendar("CalTo1", "DateTo1", "");
addCalendar("CalFrom2", "DateFrom2", "");
addCalendar("CalTo2", "DateTo2", "");

// font style
setFont("verdana", 11);
// pop-up size: title width, year & month on 1/2 lines, day cell width, no. of chars. shown for day. e.g. 3 - Fri
setWidth(90, 2, 18, 3);

// background colors: title, day title, empty cell, day cell, current day cell, bar, border
setColor("teal", "teal", "#cccccc", "#ccffff", "teal", "teal", "aqua");
// foreground colours: title, day title, 	day cell, current day cell, bar
setFontColor("white", "#ccffff", "blue", "#ccffff", "blue");

// date format: i.e. yyyy, dd, mm, Mon, MON, day, DAY
setFormat("dd-Mon-yyyy");

// pop-up offsets from image: (x,y) is (right,down):
setOffset(0, -205);

// week day format(optional): 0 to show Sunday or 1 to show Monday in first column
setWeekDay(0);

// default is English
setMonthNames("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
setDayNames("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
setLinkNames("[Ok]", "[Clear]");

var lang = get_language();
if (lang == 'zh') {
	setFont("宋体", 12);
	setWidth(120, 2, 20, 2);
	setOffset(-200, 16);
	setMonthNames("一 月", "二 月", "三 月", "四 月", "五 月", "六 月", "七 月", "八 月", "九 月", "十 月", "十一月", "十二月");
	setDayNames("日", "一", "二", "三", "四", "五", "六");
	setLinkNames("[关闭]", "[清空]");
} else if (lang == 'fr') {
	setMonthNames("Janvier", "F関rier", "Mars", "Avril", "Mai", "Juin", "Julliet", "Ao鹴", "Septembre", "Octobre", "Novembre", "Decembre");
	setDayNames("Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi");
	setLinkNames("[Ok]", "[Vide]");
}

// Some useful functions:

// checkDate(DateFrom1.value)
//	returns: 0 if input passes the output format, 1 if empty/invalid, 2 if calendar is undefined.

// getCurrentDate()
//	returns the current date as a string in the format defined by "setFormat()".

// compareDates(DateFrom1.value, DateTo1.value)  [ 2nd parameter default is getCurrentDate() ]
//	returns 0 if dates are the same,
//	or -1 if first is earlier than second,
//	or 1 if first is later second.

// getNumbers(DateFrom1.value)
//	returns a string array ('','','') with the year as [0], month as [1] and day as [2] converted from the formatted date,
//	or returns three empty strings if not a valid 
