/*******************************************************************************************
* 创建对象 var c = new Calendar("c"); document.write(c);
* 调用方法 c.show(arg1,arg2,arg3)
* 参数1: 文本输入框(必填). 如 onfocus="c.show(this)";
* 参数2: 按钮或其它可用单击事件的HTML元素(如果使用按钮方式则必填).
如 onclick="c.show(this,c.getObjById(*))" *=文本输入框名称
* 参数3: 如果没有文本框没有值则使用该值初始化日历(选填).
如 onfocus="c.show(this,'2006-01-01')
* 注: 参数顺序不分先后. MSIE6/Opera8/FireFox1.5 下测试通过
************************如果您使用本日历控件 请保留该信息 谢谢! ***************************
* http://2lin.net
* Email:caoailin@gmail.com
* QQ:38062022
* Creation date: 2006-11-22
*********************************************************************************************/
function Calendar(objName)
{
this.style = {
borderColor : "#909eff", //边框颜色
headerBackColor : "#909EFF", //表头背景颜色
headerFontColor : "#ffffff", //表头字体颜色
bodyBarBackColor : "#f4f4f4", //日历标题背景色
bodyBarFontColor : "#000000", //日历标题字体色
bodyBackColor : "#ffffff", //日历背景色
bodyFontColor : "#000000", //日历字体色
bodyHolidayFontColor : "#ff0000", //假日字体色
watermarkColor : "#d4d4d4", //背景水印色
moreDayColor : "#cccccc"
};
this.showMoreDay = false; //是否显示上月和下月的日期
this.Obj = objName;
this.date = null;
this.mouseOffset = null;
this.dateInput = null;
this.timer = null;
};
Calendar.prototype.toString = function()
{
var str = this.getStyle();
str += '
今天:'+new Date().toFormatString("yyyy年mm月dd日")+' |
\n';
return str;
};
Calendar.prototype.getBodyBar = function()
{
var str = '