乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      最新分享

       五谷雜味 2011-09-12

      /** keyboard navigation, only for popup calendars */
      Calendar._keyEvent = function(ev) {
      if (!window.calendar) {
         return false;
      }
      (Calendar.is_ie) && (ev = window.event);
      var cal = window.calendar;
      var act = (Calendar.is_ie || ev.type == "keypress");
      if (ev.ctrlKey) {
         switch (ev.keyCode) {
             case 37: // KEY left
          act && Calendar.cellClick(cal._nav_pm);
          break;
             case 38: // KEY up
          act && Calendar.cellClick(cal._nav_py);
          break;
             case 39: // KEY right
          act && Calendar.cellClick(cal._nav_nm);
          break;
             case 40: // KEY down
          act && Calendar.cellClick(cal._nav_ny);
          break;
             default:
          return false;
         }
      } else switch (ev.keyCode) {
            case 32: // KEY space (now)
         Calendar.cellClick(cal._nav_now);
         break;
            case 27: // KEY esc
         act && cal.hide();
         break;
            case 37: // KEY left
            case 38: // KEY up
            case 39: // KEY right
            case 40: // KEY down
         if (act) {
          var date = cal.date.getDate() - 1;
          var el = cal.currentDateEl;
          var ne = null;
          var prev = (ev.keyCode == 37) || (ev.keyCode == 38);
          switch (ev.keyCode) {
              case 37: // KEY left
           (--date >= 0) && (ne = cal.ar_days[date]);
           break;
              case 38: // KEY up
           date -= 7;
           (date >= 0) && (ne = cal.ar_days[date]);
           break;
              case 39: // KEY right
           (++date < cal.ar_days.length) && (ne = cal.ar_days[date]);
           break;
              case 40: // KEY down
           date += 7;
           (date < cal.ar_days.length) && (ne = cal.ar_days[date]);
           break;
          }
          if (!ne) {
           if (prev) {
            Calendar.cellClick(cal._nav_pm);
           } else {
            Calendar.cellClick(cal._nav_nm);
           }
           date = (prev) ? cal.date.getMonthDays() : 1;
           el = cal.currentDateEl;
           ne = cal.ar_days[date - 1];
          }
          Calendar.removeClass(el, "selected");
          Calendar.addClass(ne, "selected");
          cal.date.setDate(ne.caldate);
          cal.currentDateEl = ne;
         }
         break;
            case 13: // KEY enter
         if (act) {
          cal.callHandler();
          cal.hide();
         }
         break;
            default:
         return false;
      }
      Calendar.stopEvent(ev);
      };

      /**
      *   (RE)Initializes the calendar to the given date and style (if mondayFirst is
      *   true it makes Monday the first day of week, otherwise the weeks start on
      *   Sunday.
      */
      Calendar.prototype._init = function (mondayFirst, date) {
      var today = new Date();
      var year = date.getFullYear();
      if (year < this.minYear) {
         year = this.minYear;
         date.setFullYear(year);
      } else if (year > this.maxYear) {
         year = this.maxYear;
         date.setFullYear(year);
      }
      this.mondayFirst = mondayFirst;
      this.date = new Date(date);
      var month = date.getMonth();
      var mday = date.getDate();
      var no_days = date.getMonthDays();
      date.setDate(1);
      var wday = date.getDay();
      var MON = mondayFirst ? 1 : 0;
      var SAT = mondayFirst ? 5 : 6;
      var SUN = mondayFirst ? 6 : 0;
      if (mondayFirst) {
         wday = (wday > 0) ? (wday - 1) : 6;
      }
      var iday = 1;
      var row = this.tbody.firstChild;
      var MN = Calendar._MN3[month];
      var hasToday = ((today.getFullYear() == year) && (today.getMonth() == month));
      var todayDate = today.getDate();
      var week_number = date.getWeekNumber();
      var ar_days = new Array();
      for (var i = 0; i < 6; ++i) {
         if (iday > no_days) {
          row.className = "emptyrow";
          row = row.nextSibling;
          continue;
         }
         var cell = row.firstChild;
         if (this.weekNumbers) {
          cell.className = "day wn";
          cell.firstChild.data = week_number;
          cell = cell.nextSibling;
         }
         ++week_number;
         row.className = "daysrow";
         for (var j = 0; j < 7; ++j) {
          cell.className = "day";
          if ((!i && j < wday) || iday > no_days) {
           // cell.className = "emptycell";
           cell.innerHTML = " ";
           cell.disabled = true;
           cell = cell.nextSibling;
           continue;
          }
          cell.disabled = false;
          cell.firstChild.data = iday;
          if (typeof this.checkDisabled == "function") {
           date.setDate(iday);
           if (this.checkDisabled(date)) {
            cell.className += " disabled";
            cell.disabled = true;
           }
          }
          if (!cell.disabled) {
           ar_days[ar_days.length] = cell;
           cell.caldate = iday;
           cell.ttip = "_";
           if (iday == mday) {
            cell.className += " selected";
            this.currentDateEl = cell;
           }
           if (hasToday && (iday == todayDate)) {
            cell.className += " today";
            cell.ttip += Calendar._TT["PART_TODAY"];
           }
           if (wday == SAT || wday == SUN) {
            cell.className += " weekend";
           }
          }
          ++iday;
          ((++wday) ^ 7) || (wday = 0);
          cell = cell.nextSibling;
         }
         row = row.nextSibling;
      }
      this.ar_days = ar_days;
      this.title.firstChild.data = Calendar._MN[month] + ", " + year;
      // PROFILE
      // this.tooltips.firstChild.data = "Generated in " + ((new Date()) - today) + " ms";
      };

      /**
      *   Calls _init function above for going to a certain date (but only if the
      *   date is different than the currently selected one).
      */
      Calendar.prototype.setDate = function (date) {
      if (!date.equalsTo(this.date)) {
         this._init(this.mondayFirst, date);
      }
      };

      /** Modifies the "mondayFirst" parameter (EU/US style). */
      Calendar.prototype.setMondayFirst = function (mondayFirst) {
      this._init(mondayFirst, this.date);
      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.
      */
      Calendar.prototype.setDisabledHandler = function (unaryFunction) {
      this.checkDisabled = unaryFunction;
      };

      /** Customization of allowed year range for the calendar. */
      Calendar.prototype.setRange = function (a, z) {
      this.minYear = a;
      this.maxYear = z;
      };

      /** Calls the first user handler (selectedHandler). */
      Calendar.prototype.callHandler = function () {
      if (this.onSelected) {
         this.onSelected(this, this.date.print(this.dateFormat));
      }
      };

      /** Calls the second user handler (closeHandler). */
      Calendar.prototype.callCloseHandler = function () {
      if (this.onClose) {
         this.onClose(this);
      }
      this.hideShowCovered();
      };

      /** Removes the calendar object from the DOM tree and destroys it. */
      Calendar.prototype.destroy = function () {
      var el = this.element.parentNode;
      el.removeChild(this.element);
      Calendar._C = null;
      delete el;
      };

      /**
      *   Moves the calendar element to a different section in the DOM tree (changes
      *   its parent).
      */
      Calendar.prototype.reparent = function (new_parent) {
      var el = this.element;
      el.parentNode.removeChild(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) {
      if (!window.calendar) {
         return false;
      }
      var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
      for (; el != null && el != calendar.element; el = el.parentNode);
      if (el == null) {
         // calls closeHandler which should hide the calendar.
         window.calendar.callCloseHandler();
         Calendar.stopEvent(ev);
      }
      };

      /** Shows the calendar. */
      Calendar.prototype.show = function () {
      var rows = this.table.getElementsByTagName("tr");
      for (var i = rows.length; i > 0;) {
         var row = rows[--i];
         Calendar.removeClass(row, "rowhilite");
         var cells = row.getElementsByTagName("td");
         for (var j = cells.length; j > 0;) {
          var cell = cells[--j];
          Calendar.removeClass(cell, "hilite");
          Calendar.removeClass(cell, "active");
         }
      }
      this.element.style.display = "block";
      this.hidden = false;
      if (this.isPopup) {
         window.calendar = this;
         Calendar.addEvent(document, "keydown", Calendar._keyEvent);
         Calendar.addEvent(document, "keypress", Calendar._keyEvent);
         Calendar.addEvent(document, "mousedown", Calendar._checkCalendar);
      }
      this.showMonthsCombo();
      this.hideShowCovered();
      };

      /**
      *   Hides the calendar.   Also removes any "hilite" from the class of any TD
      *   element.
      */
      Calendar.prototype.hide = function () {
      if (this.isPopup) {
         Calendar.removeEvent(document, "keydown", Calendar._keyEvent);
         Calendar.removeEvent(document, "keypress", Calendar._keyEvent);
         Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar);
      }
      this.element.style.display = "none";
      this.hidden = true;
      this.hideShowCovered();
      };

      /**
      *   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).
      */
      Calendar.prototype.showAt = function (x, y) {
      var s = this.element.style;
      s.left = x + "px";
      s.top = y + "px";
      this.show();
      };

      /** Shows the calendar near a given element. */
      Calendar.prototype.showAtElement = function (el,moveX) {
      var p = Calendar.getAbsolutePos(el);
      if(moveX ==null)
         this.showAt(p.x, p.y + el.offsetHeight);
      else
         this.showAt(p.x - moveX, p.y + el.offsetHeight);
      };
      Calendar.prototype.showAtElementXY = function (el,moveX,moveY) {
      var p = Calendar.getAbsolutePos(el);
      if(moveX ==null)
         this.showAt(p.x, p.y + el.offsetHeight);
      else
         this.showAt(p.x - moveX, p.y + el.offsetHeight - moveY);
      };

      /** Customizes the date format. */
      Calendar.prototype.setDateFormat = function (str) {
      this.dateFormat = str;
      };

      /** Customizes the tooltip date format. */
      Calendar.prototype.setTtDateFormat = function (str) {
      this.ttDateFormat = str;
      };

      /**
      *   Tries to identify the date represented in a string.   If successful it also
      *   calls this.setDate which moves the calendar to the given date.
      */
      Calendar.prototype.parseDate = function (str, fmt) {
      var y = 0;
      var m = -1;
      var d = 0;
      var a = str.split(/\W+/);
      if (!fmt) {
         fmt = this.dateFormat;
      }
      var b = fmt.split(/\W+/);
      var i = 0, j = 0;
      for (i = 0; i < a.length; ++i) {
         if (b[i] == "D" || b[i] == "DD") {
          continue;
         }
         if (b[i] == "d" || b[i] == "dd") {
          d = parseInt(a[i]);
         }
         if (b[i] == "m" || b[i] == "mm") {
          m = parseInt(a[i]) - 1;
         }
         if (b[i] == "y") {
          y = parseInt(a[i]);
         }
         if (b[i] == "yy") {
          y = parseInt(a[i]) + 1900;
         }
         if (b[i] == "M" || b[i] == "MM") {
          for (j = 0; j < 12; ++j) {
           if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; }
          }
         }
      }
      if (y != 0 && m != -1 && d != 0) {
         this.setDate(new Date(y, m, d));
         return;
      }
      y = 0; m = -1; d = 0;
      for (i = 0; i < a.length; ++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]) <= 12 && m == -1) {
          m = a[i]-1;
         } else if (parseInt(a[i]) > 31 && y == 0) {
          y = a[i];
         } else if (d == 0) {
          d = a[i];
         }
      }
      if (y == 0) {
         var today = new Date();
         y = today.getFullYear();
      }
      if (m != -1 && d != 0) {
         this.setDate(new Date(y, m, d));
      }
      else
      {
         this.setDate(new Date());
      }
      };

      Calendar.prototype.hideShowCovered = function ()
      {
      var tags = new Array("applet", "iframe", "select");
      var el = this.element;

      var p = Calendar.getAbsolutePos(el);
      var EX1 = p.x;
      var EX2 = el.offsetWidth + EX1;
      var EY1 = p.y;
      var EY2 = el.offsetHeight + EY1;

      for (var k = tags.length; k > 0; ) {
         var ar = document.getElementsByTagName(tags[--k]);
         var cc = null;

         for (var i = ar.length; i > 0;) {
          cc = ar[--i];

          p = Calendar.getAbsolutePos(cc);
          var CX1 = p.x;
          var CX2 = cc.offsetWidth + CX1;
          var CY1 = p.y;
          var CY2 = cc.offsetHeight + CY1;

          if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
           cc.style.visibility = "visible";
          } else {
           cc.style.visibility = "hidden";
          }
         }
      }
      };

      /** 顯示星期工具欄 */
      Calendar.prototype._displayWeekdays = function ()
      {
      var MON = this.mondayFirst ? 0 : 1;
      var SUN = this.mondayFirst ? 6 : 0;
      var SAT = this.mondayFirst ? 5 : 6;
      var cell = this.firstdayname;
      for (var i = 0; i < 7; ++i) {
         cell.className = "day name";
         if (!i) {
          cell.ttip = this.mondayFirst ? Calendar._TT["SUN_FIRST"] : Calendar._TT["MON_FIRST"];
          cell.navtype = 100;
          cell.calendar = this;
          Calendar._add_evs(cell);
         }
         if (i == SUN || i == SAT) {
          Calendar.addClass(cell, "weekend");
         }
         cell.firstChild.data = Calendar._DN3[i + 1 - MON];
         cell = cell.nextSibling;
      }
      };

      /** 隱藏全部不必顯示的 combo */
      Calendar.prototype._hideCombos = function ()
      {
      this.monthsCombo.style.display = "none";
      this.yearsCombo.style.display = "none";
      };

      /** 拖曳開始動(dòng)作 */
      Calendar.prototype._dragStart = function (ev)
      {
      if (this.dragging) {
         return;
      }
      this.dragging = true;
      var posX;
      var posY;
      if (Calendar.is_ie) {
         posY = window.event.clientY + document.body.scrollTop;
         posX = window.event.clientX + document.body.scrollLeft;
      } else {
         posY = ev.clientY + window.scrollY;
         posX = ev.clientX + window.scrollX;
      }
      var st = this.element.style;
      this.xOffs = posX - parseInt(st.left);
      this.yOffs = posY - parseInt(st.top);
      with (Calendar) {
         addEvent(document, "mousemove", calDragIt);
         addEvent(document, "mouseover", stopEvent);
         addEvent(document, "mouseup", calDragEnd);
      }
      };

      // BEGIN: DATE OBJECT PATCHES

      /** 12個(gè)中的天數(shù) */
      Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31);

      /** 時(shí)間常量 */
      Date.SECOND = 1000;
      Date.MINUTE = 60 * Date.SECOND;
      Date.HOUR    = 60 * Date.MINUTE;
      Date.DAY     = 24 * Date.HOUR;
      Date.WEEK    =   7 * Date.DAY;

      /** 得到當(dāng)前月的天數(shù) */
      Date.prototype.getMonthDays = function(month)
      {
      var year = this.getFullYear();
      if (typeof month == "undefined") {
         month = this.getMonth();
      }
      if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
         return 29;
      } else {
         return Date._MD[month];
      }
      };

      /** 得到星期幾 */
      Date.prototype.getWeekNumber = function()
      {
      var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
      var then = new Date(this.getFullYear(), 0, 1, 0, 0, 0);
      var time = now - then;
      var day = then.getDay();
      (day > 3) && (day -= 4) || (day += 3);
      return Math.round(((time / Date.DAY) + day) / 7);
      };

      /** 檢查日期是否相等 */
      Date.prototype.equalsTo = function(date)
      {
           return ((this.getFullYear() == date.getFullYear()) &&(this.getMonth() == date.getMonth()) &&(this.getDate() == date.getDate()));
      };

      /** 按給定的日期格式輸出 */
      Date.prototype.print = function (frm)
      {
      var str = new String(frm);
      var m = this.getMonth();
      var d = this.getDate();
      var y = this.getFullYear();
      var wn = this.getWeekNumber();
      var w = this.getDay();
      var s = new Array();
      s["d"] = d;
      s["dd"] = (d < 10) ? ("0" + d) : d;
      s["m"] = 1+m;
      s["mm"] = (m < 9) ? ("0" + (1+m)) : (1+m);
      s["y"] = y;
      s["yy"] = new String(y).substr(2, 2);
      s["w"] = wn;
      s["ww"] = (wn < 10) ? ("0" + wn) : wn;
      with (Calendar) {
         s["D"] = _DN3[w];
         s["DD"] = _DN[w];
         s["M"] = _MN3[m];
         s["MM"] = _MN[m];
      }
      var re = /(.*)(\W|^)(d|dd|m|mm|y|yy|MM|M|DD|D|w|ww)(\W|$)(.*)/;
      while (re.exec(str) != null) {
         str = RegExp.$1 + RegExp.$2 + s[RegExp.$3] + RegExp.$4 + RegExp.$5;
      }
      return str;
      };

      // END: DATE OBJECT PATCHES

      // 全局對(duì)象
      window.calendar = null;

      // 以下本地化中文
      Calendar._DN = new Array("周日", "一", "二", "三", "四", "五", "六", "日");
      Calendar._MN = new Array("一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月","十月", "十一月", "十二月");

      // 操作提示
      Calendar._TT = {};
      Calendar._TT["TOGGLE"] = "切換周首日";
      Calendar._TT["PREV_YEAR"] = "選擇上一年。按住菜單,下拉選擇年份";
      Calendar._TT["PREV_MONTH"] = "選擇上一月。按住菜單,下拉選擇月份";
      Calendar._TT["GO_TODAY"] = "選擇本日";
      Calendar._TT["NEXT_MONTH"] = "選擇下一月。按住菜單,下拉選擇月份";
      Calendar._TT["NEXT_YEAR"] = "選擇下一年。按住菜單,下拉選擇年份";
      Calendar._TT["SEL_DATE"] = "選擇日期";
      Calendar._TT["DRAG_TO_MOVE"] = "拖曳";
      Calendar._TT["PART_TODAY"] = " (本日)";
      Calendar._TT["MON_FIRST"] = "以周一作為第一天";
      Calendar._TT["SUN_FIRST"] = "以周日作為第一天";
      Calendar._TT["CLOSE"] = "關(guān)閉";
      Calendar._TT["TODAY"] = "選擇本日";

      // 日期格式
      Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
      Calendar._TT["TT_DATE_FORMAT"] = "D, M d";

      Calendar._TT["WK"] = "星期";
      // 以上本地化中文


      //以下全局調(diào)用函數(shù)
      var calendar;
      function selected(cal, date)
      {
         cal.sel.value = date;
         if (cal.sel.id == "sel1" || cal.sel.id == "sel3")
           cal.callCloseHandler();
      }

      function showCalendar(id, format,moveX)
      {
         try{
          var el = document.getElementsByName(id)[0];
          if (calendar != null) {
         calendar.hide();
          } else {
         var cal = new Calendar(false, null, selected, closeHandler);
         calendar = cal;
         cal.setRange(1900, 2070);
         cal.create();
          }
          calendar.setDateFormat(format);
          calendar.parseDate(el.value);
          calendar.sel = el;
          calendar.showAtElement(el,moveX);
         }catch(ex){}
         return false;
      }

      function showCalendarXY(id, format,moveX,moveY)
      {
         var el = document.getElementById(id);
         if (calendar != null) {
           calendar.hide();
         } else {
           var cal = new Calendar(false, null, selected, closeHandler);
           calendar = cal;
           cal.setRange(1900, 2070);
           cal.create();
         }
         calendar.setDateFormat(format);
         calendar.parseDate(el.value);
         calendar.sel = el;
         calendar.showAtElementXY(el,moveX,moveY);
         return false;
      }

      function closeHandler(cal)
      {
         cal.hide();
      }

      //使用方法:

      //<script src='calendar.js'></script>

      //<input type="text" name="applyStartDateStr" size="10" value="" onchange="IsDate(this,'N')" class="input">
      //<a href="javascript:" onclick="return showCalendar('applyStartDateStr', 'y-mm-dd');"><img src="/images/calendar.gif" border="0" alt=""/></a>

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多