<!--

//==================================================== WEB 页面显示部分 =====================================================
document.writeln('<div id=meizzTimeLayer style="position: absolute; width: 167; height: 166; z-index: 9998; display: none">');
document.writeln('<span id=tmpSelectYearLayer1  style="z-index: 9999;position: absolute;top: 2; left: 18;display: none"></span>');
document.writeln('<span id=tmpSelectMonthLayer1 style="z-index: 9999;position: absolute;top: 2; left: 75;display: none"></span>');
document.writeln('<table border=0 cellspacing=1 cellpadding=0 width=167 height=160 bgcolor=#808080 onselectstart="return false">');
document.writeln('  <tr><td width=167 height=23 bgcolor=#FFFFFF><table border=0 cellspacing=1 cellpadding=0 width=165 height=23>');
document.writeln('      <tr align=center><td width=20 align=center bgcolor=#808080 style="font-size:12px;cursor: hand;color: #FFD700" ');
document.writeln('        onclick="meizzPrevM1()" title="向前翻　月" Author=meizz><b Author=meizz>&lt;&lt;</b>');
document.writeln('        </td><td width=100 align=center style="font-size:12px;cursor:default" Author=meizz>');
document.writeln('        <span Author=meizz id=meizzYearHead1 onclick="tmpSelectYearInnerHTML1(this.innerText)"></span>&nbsp;年&nbsp;<span');
document.writeln('         id=meizzMonthHead1 Author=meizz onclick="tmpSelectMonthInnerHTML1(this.innerText)"></span>&nbsp;月</td>');
document.writeln('        <td width=20 bgcolor=#808080 align=center style="font-size:12px;cursor: hand;color: #FFD700" ');
document.writeln('         onclick="meizzNextM1()" title="往后翻　月" Author=meizz><b Author=meizz>&gt;&gt;</b></td></tr>');
document.writeln('    </table></td></tr>');
document.writeln('  <tr><td width=167 height=18 bgcolor=#808080>');
document.writeln('<table border=0 cellspacing=0 cellpadding=0 width=165 height=1 style="cursor:default">');
document.writeln('<tr align=center><td style="font-size:12px;color:#FFFFFF" Author=meizz>日</td>');
document.writeln('<td style="font-size:12px;color:#FFFFFF" Author=meizz>一</td><td style="font-size:12px;color:#FFFFFF" Author=meizz>二</td>');
document.writeln('<td style="font-size:12px;color:#FFFFFF" Author=meizz>三</td><td style="font-size:12px;color:#FFFFFF" Author=meizz>四</td>');
document.writeln('<td style="font-size:12px;color:#FFFFFF" Author=meizz>五</td><td style="font-size:12px;color:#FFFFFF" Author=meizz>六</td></tr>');
document.writeln('</table></td></tr><!-- Author:F.R.Huang(meizz) http://www.meizz.com/ mail: meizz@hzcnc.com 2002-10-8 -->');
document.writeln('  <tr><td width=167 height=120>');
document.writeln('    <table border=0 cellspacing=1 cellpadding=0 width=165 height=120 bgcolor=#FFFFFF>');
var n1=0; for (j=0;j<5;j++){ document.writeln (' <tr align=center>'); for (i=0;i<7;i++){
document.writeln('<td width=20 height=20 id=meizzDay_1'+n1+' style="font-size:12px" Author=meizz onclick=meizzDayClick1(this.innerText)></td>');
n1++;
}
document.writeln('</tr>');}
document.writeln('      <tr align=center><td width=20 height=20 style="font-size:12px" id=meizzDay_135 Author=meizz ');
document.writeln('         onclick=meizzDayClick1(this.innerText)></td>');
document.writeln('        <td width=20 height=20 style="font-size:12px" id=meizzDay_136 Author=meizz onclick=meizzDayClick1(this.innerText)></td>');
document.writeln('        <form name="calendar_time_submit_form" method="post" action=""><td nowrap colspan=5 align=right Author=meizz><select size=1 name=hour1 id=hour1 onChange=meizzHourClick1(this.options[this.options.selectedIndex].value)>');
var meizzTheHour0=new Date().getHours();
  for (var ii = 0; ii < 24; ii++)
  {
		if(ii<10)
		{
		document.writeln(' <option value='+'0'+ii);
		if(ii == meizzTheHour0){document.writeln(' selected');}
		document.writeln('>0'+ii+'</option>\r\n');
		}
		else
		{
		document.writeln(' <option value='+ii);
		if(ii == meizzTheHour0){document.writeln(' selected');}
		document.writeln('>'+ii+'</option>\r\n');
		}
	}
document.writeln('        </select>:<select style=font-family: 宋体;font-size: 12px;color: #000000; size=1 name=minute1 id=minute1  onChange=meizzMinuteClick1(this.options[this.options.selectedIndex].value)>');
var meizzTheMinute0=new Date().getMinutes();
  for (var jj = 0; jj < 60; jj++)
  {
		if(jj<10)
		{
		document.writeln(' <option value='+'0'+jj);
		if(jj == meizzTheMinute0){document.writeln(' selected');}
		document.writeln('>0'+jj+'</option>\r\n');
		}
		else
		{
		document.writeln(' <option value='+jj);
		if(jj == meizzTheMinute0){document.writeln(' selected');}
		document.writeln('>'+jj+'</option>\r\n');
		}
	}
document.writeln('        </select>:00</td></form>');
document.writeln('    </table></td></tr><tr><td>');
document.writeln('        <table border=0 cellspacing=1 cellpadding=0 width=100% bgcolor=#FFFFFF>');
document.writeln('          <tr><td Author=meizz align=left><input Author=meizz type=button value="< " title="向前翻　年" onclick="meizzPrevY1()" ');
document.writeln('             onfocus="this.blur()" style="font-size: 12px; height: 20px"><input Author=meizz title="向前翻　月" type=button ');
document.writeln('             value="<<" onclick="meizzPrevM1()" onfocus="this.blur()" style="font-size: 12px; height: 20px"></td><td ');
document.writeln('             Author=meizz align=center><input Author=meizz type=button value=今天 onclick="meizzToday1()" ');
document.writeln('             onfocus="this.blur()" title="现在的年月" style="font-size: 12px; height: 20px"></td><td ');
document.writeln('             Author=meizz align=right><input Author=meizz type=button value=">>" onclick="meizzNextM1()" ');
document.writeln('             onfocus="this.blur()" title="往后翻　月" style="font-size: 12px; height: 20px"><input ');
document.writeln('             Author=meizz type=button value=" >" title="往后翻　年" onclick="meizzNextY1()"');
document.writeln('             onfocus="this.blur()" style="font-size: 12px; height: 20px"><input type=button value="关闭" title="关闭日历" onclick="closeLayer1()" style="font-size: 12px; height: 20px"></td>');

document.writeln('</tr></table></td></tr></table></div>');

//==================================================== WEB 页面显示部分 ======================================================

var stroutObject;
var stroutObject1;
var stroutObject2;
var stroutObject3;

var meizzTheYear1=new Date().getFullYear(); //定义年的变量的初始值
var meizzTheMonth0=new Date().getMonth()+1; //定义月的变量的初始值
//if(meizzTheMonth0 < 10){meizzTheMonth0="0"+meizzTheMonth0;}
var meizzTheDay0=new Date().getDate();

var meizzWDay1=new Array(37);               //定义写日期的数组

function setDayTime(tt1,obj1) //主调函数
{
  var meizzTheYear1=new Date().getFullYear();
  var meizzTheMonth0=new Date().getMonth()+1;
  meizzSetDay1(meizzTheYear1,meizzTheMonth0,meizzTheHour0,meizzTheMinute0);
  if (arguments.length >  2){alert("对不起！传入本控件的参数太多！");return;}
  if (arguments.length == 0){alert("对不起！您没有传回本控件任何参数！");return;}
  var dads  = document.all.meizzTimeLayer.style;var th = tt1;
  var ttop  = tt1.offsetTop;     //TT控件的定位点高
  var thei  = tt1.clientHeight;  //TT控件本身的高
  var tleft = tt1.offsetLeft;    //TT控件的定位点宽
  var ttyp  = tt1.type;          //TT控件的类型
  while (tt1 = tt1.offsetParent)
  {
  	ttop+=tt1.offsetTop; 
  	tleft+=tt1.offsetLeft;
  }
  dads.top  = (ttyp=="image")? ttop+thei : ttop+thei+6;
  dads.left = tleft;
  stroutObject = (arguments.length == 1) ? th : obj1;
//  if(stroutObject){stroutObject.value=""}
  dads.display = '';
  event.returnValue=false;
}

var MonHead1 = new Array(12);    		   //定义阳历中每个月的最大天数
    MonHead1[0] = 31; MonHead1[1] = 28; MonHead1[2] = 31; MonHead1[3] = 30; MonHead1[4]  = 31; MonHead1[5]  = 30;
    MonHead1[6] = 31; MonHead1[7] = 31; MonHead1[8] = 30; MonHead1[9] = 31; MonHead1[10] = 30; MonHead1[11] = 31;

function meizzWriteHead1(yy1,mm1)  //往 head 中写入当前的年与月
  { document.all.meizzYearHead1.innerText  = yy1;
    document.all.meizzMonthHead1.innerText = mm1;
	document.all.hour1.selectedIndex = meizzTheHour0;
	document.all.minute1.selectedIndex = meizzTheMinute0;
  }

function tmpSelectYearInnerHTML1(strYear) //年份的下拉框
{
  if (strYear.match(/\D/)!=null){alert("年份输入参数不是数字！");return;}
  var m1 = (strYear) ? strYear : new Date().getFullYear();
  if (m1 < 1000 || m1 > 9999) {alert("年份值不在 1000 到 9999 之间！");return;}
  var n1 = m1 - 10;
  if (n1 < 1000) n1 = 1000;
  if (n1 + 26 > 9999) n1 = 9974;
  var s1 = "<select Author=meizz name=tmpSelectYear style='font-size: 12px' "
     s1 += "onblur='document.all.tmpSelectYearLayer1.style.display=\"none\"' "
     s1 += "onchange='document.all.tmpSelectYearLayer1.style.display=\"none\";"
     s1 += "meizzTheYear1 = this.value; meizzSetDay1(meizzTheYear1,meizzTheMonth0)'>\r\n";
  var selectInnerHTML = s;
  for (var i = n1; i < n1 + 26; i++)
  {
    if (i == m1)
       {selectInnerHTML += "<option value='" + i + "' selected>" + i + "年" + "</option>\r\n";}
    else {selectInnerHTML += "<option value='" + i + "'>" + i + "年" + "</option>\r\n";}
  }
  selectInnerHTML += "</select>";
  document.all.tmpSelectYearLayer1.style.display="";
  document.all.tmpSelectYearLayer1.innerHTML = selectInnerHTML;
  document.all.tmpSelectYear.focus();
}

function tmpSelectMonthInnerHTML1(strMonth) //月份的下拉框
{
  if (strMonth.match(/\D/)!=null){alert("月份输入参数不是数字！");return;}
  var m1 = (strMonth) ? strMonth : new Date().getMonth() + 1;
  var s1 = "<select Author=meizz name=tmpSelectMonth style='font-size: 12px' "
     s1 += "onblur='document.all.tmpSelectMonthLayer1.style.display=\"none\"' "
     s1 += "onchange='document.all.tmpSelectMonthLayer1.style.display=\"none\";"
     s1 += "meizzTheMonth0 = this.value; meizzSetDay1(meizzTheYear1,meizzTheMonth0)'>\r\n";
  var selectInnerHTML = s1;
  for (var i = 1; i < 13; i++)
  {
    if (i == m1)
       {selectInnerHTML += "<option value='"+i+"' selected>"+i+"月"+"</option>\r\n";}
    else {selectInnerHTML += "<option value='"+i+"'>"+i+"月"+"</option>\r\n";}
  }
  selectInnerHTML += "</select>";
  document.all.tmpSelectMonthLayer1.style.display="";
  document.all.tmpSelectMonthLayer1.innerHTML = selectInnerHTML;
  document.all.tmpSelectMonth.focus();
}

function closeLayer1()               //这个层的关闭
  {
    document.all.meizzTimeLayer.style.display="none";
  }

function document.onkeydown1()
  {
    if (window.event.keyCode==27)document.all.meizzTimeLayer.style.display="none";
  }

function IsPinYear1(year)            //判断是否闰平年
  {
    if (0==year%4&&((year%100!=0)||(year%400==0))) return true;else return false;
  }

function GetMonthCount1(year,month)  //闰年二月为29天
  {
    var c=MonHead1[month-1];if((month==2)&&IsPinYear1(year)) c++;return c;
  }

function GetDOW1(day,month,year)     //求某天的星期几
  {
    var dt=new Date(year,month-1,day).getDay()/7; return dt;
  }

function meizzPrevY1()  //往前翻 Year
  {
    if(meizzTheYear1 > 999 && meizzTheYear1 <10000){meizzTheYear1--;}
    else{alert("年份超出范围（1000-9999）！");}
    meizzSetDay1(meizzTheYear1,meizzTheMonth0);
  }
function meizzNextY1()  //往后翻 Year
  {
    if(meizzTheYear1 > 999 && meizzTheYear1 <10000){meizzTheYear1++;}
    else{alert("年份超出范围（1000-9999）！");}
    meizzSetDay1(meizzTheYear1,meizzTheMonth0);
  }
function meizzToday1()  //Today Button
  {
    meizzTheYear1 = new Date().getFullYear();
    meizzTheMonth0 = new Date().getMonth()+1;
    meizzSetDay1(meizzTheYear1,meizzTheMonth0);
  }
function meizzPrevM1()  //往前翻月份
  {
    if(meizzTheMonth0>1){meizzTheMonth0--}else{meizzTheYear1--;meizzTheMonth0=12;}
    meizzSetDay1(meizzTheYear1,meizzTheMonth0);
  }
function meizzNextM1()  //往后翻月份
  {
    if(meizzTheMonth0==12){meizzTheYear1++;meizzTheMonth0=1}else{meizzTheMonth0++}
    meizzSetDay1(meizzTheYear1,meizzTheMonth0);
  }

function meizzSetDay1(yy1,mm1,meizzTheHour0,meizzTheMinute0)   //主要的写程序**********
{
  meizzWriteHead1(yy1,mm1);
  for (var i = 0; i < 37; i++){meizzWDay1[i]=""};  //将显示框的内容全部清空
  var day1 = 1,firstday = new Date(yy1,mm1-1,1).getDay();  //某月第一天的星期几
  for (var i = firstday; day1 < GetMonthCount1(yy1,mm1)+1; i++){meizzWDay1[i]=day1;day1++;}
  for (var i = 0; i < 37; i++)
  { var da = eval("document.all.meizzDay_1"+i)     //书写新的一个月的日期星期排列
    if (meizzWDay1[i]!="")
      { da.innerHTML = "<b>" + meizzWDay1[i] + "</b>";
        da.style.backgroundColor = (yy1 == new Date().getFullYear() &&
        mm1 == new Date().getMonth()+1 && meizzWDay1[i] == new Date().getDate()) ? "#FFD700" : "#ADD8E6";
        da.style.cursor="hand"
      }
    else{da.innerHTML="";da.style.backgroundColor="";da.style.cursor="default"}
  }
}
//检测时间日期的位数

var meizzTheDay01;
var meizzTheMonth01;
var meizzTheHour01;
var meizzTheMinute01;

if(meizzTheDay0<10){
	meizzTheDay01="0"+meizzTheDay0;
}
else
{
	meizzTheDay01=meizzTheDay0;
}
if(meizzTheMonth0<10){
	meizzTheMonth01="0"+meizzTheMonth0;
}
else
{
	meizzTheMonth01=meizzTheMonth0;
}
if(meizzTheHour0<10){
	meizzTheHour01="0"+meizzTheHour0;
}
else
{
	meizzTheHour01=meizzTheHour0;
}
if(meizzTheMinute0<10){
	meizzTheMinute01="0"+meizzTheMinute0;
}
else
{
	meizzTheMinute01=meizzTheMinute0;
}

function meizzDayClick1(n1)  //点击显示框选取日期，主输入函数*************
{
  var yy1 = meizzTheYear1;
  var mm1 = meizzTheMonth0;
  stroutObject0=stroutObject.value;
  if (mm1 < 10){mm1 = "0" + mm1;}
  if (stroutObject)
  {
    if (!n1) {stroutObject.value=""; return;}
    if ( n1 < 10){n1 = "0" + n1;}
    var stroutObject1= yy1 + "-" + mm1 + "-" + n1; //注：在这里你可以输出改成你想要的格式
  }
  else {
  closeLayer1();
  alert("您所要输出的控件对象并不存在！");}
  if(stroutObject0.length==19){
  stroutObject.value=stroutObject1+stroutObject0.substring(10,19);
  }
  else{
  stroutObject.value=stroutObject1+" "+meizzTheHour01+":"+meizzTheMinute01+":00";
  }
}
function meizzHourClick1(n1)  //点击显示框选取日期，主输入函数*************
{
  if (stroutObject)
  {
    stroutObject1=stroutObject.value;
    var stroutObject2= n1; //注：在这里你可以输出改成你想要的格式
  }
  else {
  closeLayer1();
  alert("您所要输出的控件对象并不存在！");}
  if(stroutObject1.length==19){
  stroutObject.value=stroutObject1.substring(0,11)+stroutObject2+stroutObject1.substring(13,19);
  }
  else{
  stroutObject.value=meizzTheYear1+"-"+meizzTheMonth01+"-"+meizzTheDay01+" "+stroutObject2+":"+meizzTheMinute01+":00";
  }
}
function meizzMinuteClick1(n1)  //点击显示框选取日期，主输入函数*************
{
  if (stroutObject)
  {
	stroutObject2=stroutObject.value;
    if (!n1) {stroutObject.value=""; return;}
    var stroutObject3= n1; //注：在这里你可以输出改成你想要的格式
  }
  else {
  closeLayer1();
  alert("您所要输出的控件对象并不存在！");}
  if(stroutObject2.length==19){
  stroutObject.value=stroutObject2.substring(0,14)+stroutObject3+stroutObject2.substring(16,19);
  }
  else{
  stroutObject.value=meizzTheYear1+"-"+meizzTheMonth01+"-"+meizzTheDay01+" "+meizzTheHour01+":"+stroutObject3+":00";
  }
}
//meizzSetDay1(meizzTheYear1,meizzTheMonth0,meizzTheHour0,meizzTheMinute0);

