y = (y <= 1000)? 1000 : ((y >= 9999)? 9999 : y);
var min = (y - n >= 1000) ? y - n : 1000;
var max = (y + n <= 9999) ? y + n : 9999;
min = (max == 9999) ? max-n*2 : min;
max = (min == 1000) ? min+n*2 : max;
for (var i=min; i<=max; i++) e.options.add(new Option(i, i)); // +"年"
e.style.display = ""; e.value = y; e.focus();
}
function funHourSelect() //小时的滚动按钮
{
if(WebCalendar.timeShow)
{
var h = isNaN(parseInt(WebCalendar.thisHour, 10)) ? new Date().getHours() : parseInt(WebCalendar.thisHour);
var e = WebCalendar.iframe.document.forms[0].tmpHourSelect;
e.style.display = ""; e.value = h; e.focus();
}
}
function funMinuteSelect() //分钟的滚动按钮
{
if(WebCalendar.timeShow)
{
var mi = isNaN(parseInt(WebCalendar.thisMinute, 10)) ? new Date().getMinutes() : parseInt(WebCalendar.thisMinute);
var e = WebCalendar.iframe.document.forms[0].tmpMinuteSelect;
e.style.display = ""; e.value = mi; e.focus();
}
}
function funSecondSelect() //秒的滚动按钮
{
if(WebCalendar.timeShow)
{
var s = isNaN(parseInt(WebCalendar.thisSecond, 10)) ? new Date().getSeconds : parseInt(WebCalendar.thisSecond);
var e = WebCalendar.iframe.document.forms[0].tmpSecondSelect;
e.style.display = ""; e.value = s; e.focus();
}
}
function prevM() //往前翻月份
{
WebCalendar.thisDay = 1;
if (WebCalendar.thisMonth==1)
{
WebCalendar.thisYear--;
WebCalendar.thisMonth=13;
}
WebCalendar.thisMonth--;
writeCalendar();
}
function nextM() //往后翻月份
{
WebCalendar.thisDay = 1;
if (WebCalendar.thisMonth==12)
{
WebCalendar.thisYear++;
WebCalendar.thisMonth=0;
}
WebCalendar.thisMonth++;
writeCalendar();
}
//往前翻 Year
function prevY()
{WebCalendar.thisDay = 1; WebCalendar.thisYear--; writeCalendar(); }
//往后翻 Year
function nextY()
{WebCalendar.thisDay = 1; WebCalendar.thisYear++; writeCalendar(); }
//隐藏下拉列表
function hiddenSelect(e)
{for(var i=e.options.length; i>-1; i--)e.options.remove(i); e.style.display="none"; }
//隐藏微调按钮
function hiddenTextarea(e)
{e.style.display="none"; }
//获取对象
function getObjectById(id)
{
if(document.all)
return(eval("document.all."+ id));
return(eval(id));
}
//隐藏日历
function hiddenCalendar()
{
getObjectById("eosCalendarLayer").style.display = "none";
WebCalendar.isOpen = false;
}
//日期自动补零程序
function appendZero(n)
{return(("00"+ n).substr(("00"+ n).length-2)); }
//覆盖字符串的去空格函数
function String.prototype.trim()
{return this.replace(/(^\s*)|(\s*$)/g,""); }
//鼠标移到某天时的事件
function dayMouseOver()
{
this.className = "over";
this.style.backgroundColor = WebCalendar.darkColor;
if(WebCalendar.day[this.id.substr(8)].split("/")[1] == WebCalendar.thisMonth)
this.style.color = WebCalendar.lightColor;
this.style.cursor = "hand";
}
//鼠标移出某天时的事件
function dayMouseOut()
{
this.className = "out";
var d = WebCalendar.day[this.id.substr(8)], a = d.split("/");
this.style.removeAttribute('backgroundColor');
if(a[1] == WebCalendar.thisMonth && d != WebCalendar.today)
{
if(WebCalendar.dateStyle && a[0] == parseInt(WebCalendar.dateStyle[4], 10))
this.style.color = WebCalendar.lightColor;
this.style.color = WebCalendar.wordColor;
}
}
//对日历显示的数据的处理程序
function writeCalendar()
{
var y = WebCalendar.thisYear;
var m = WebCalendar.thisMonth;

