(function () {
var d = document;
var includeCss = function (url) {
var link = d.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = url;
d.getElementsByTagName("head")[0].appendChild(link)
};
includeCss("/wap/first/zsff/css/Mdate.css");
var dateopts = {
beginYear: 2000,
beginMonth: 1,
beginDay: 1,
endYear: new Date().getFullYear(),
endMonth: new Date().getMonth() + 1,
endDay: new Date().getDate(),
format: "YMD"
};
var MdSelectId = "";
var MdAcceptId = "";
var dateContentBox = "";
var datePlugs = "";
var yearTag = "";
var monthTag = "";
var dayTag = "";
var indexY = 1;
var indexM = 1;
var indexD = 1;
var initM = null;
var initD = null;
var yearScroll = null;
var monthScroll = null;
var dayScroll = null;
var Mdate = function (el, opts) {
if (!opts) {
opts = {}
}
this.id = el;
this.selectorId = d.getElementById(this.id);
this.acceptId = d.getElementById(opts.acceptId) || d.getElementById(this.id);
this.beginYear = opts.beginYear || dateopts.beginYear;
this.beginMonth = opts.beginMonth || dateopts.beginMonth;
this.beginDay = opts.beginDay || dateopts.beginDay;
this.endYear = opts.endYear || dateopts.endYear;
this.endMonth = opts.endMonth || dateopts.endMonth;
this.endDay = opts.endDay || dateopts.endDay;
this.format = opts.format || dateopts.format;
this.successFn=opts.success || null;
this.dateBoxShow()
};
Mdate.prototype = {
constructor: Mdate, dateBoxShow: function () {
var that = this;
that.selectorId.onclick = function () {
that.createDateBox();
that.dateSure()
}
}, createDateBox: function () {
var that = this;
MdatePlugin = d.getElementById("MdatePlugin");
if (!MdatePlugin) {
dateContentBox = d.createElement("div");
dateContentBox.id = "MdatePlugin";
d.body.appendChild(dateContentBox);
MdatePlugin = d.getElementById("MdatePlugin")
}
MdatePlugin.setAttribute("class", "slideIn");
that.createDateUi();
var yearUl = d.getElementById("yearUl");
var monthUl = d.getElementById("monthUl");
var dayUl = d.getElementById("dayUl");
yearUl.innerHTML = that.createDateYMD("year");
that.initScroll();
that.refreshScroll()
}, createDateUi: function () {
var str = "" + '' + '' + "
' + "